Mission01.cpp 636 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * Mission01.cpp
  22. *
  23. * DESCRIPTION
  24. * Mission 1 scripts
  25. *
  26. * PROGRAMMER
  27. * Design Team
  28. *
  29. * VERSION INFO
  30. * $Author: Joe_g $
  31. * $Revision: 268 $
  32. * $Modtime: 1/23/02 12:00p $
  33. * $Archive: /Commando/Code/Scripts/Mission01.cpp $
  34. *
  35. ******************************************************************************/
  36. #include "scripts.h"
  37. #include <string.h>
  38. #include "toolkit.h"
  39. #include "mission1.h"
  40. DECLARE_SCRIPT(M01_Mission_Controller_JDG, "")//this guys ID number is 100376
  41. {
  42. typedef enum {
  43. IDLE,
  44. ACTIVE,
  45. UNDER_ATTACK,
  46. DESTROYED,
  47. } M01_Building_State;
  48. typedef enum {
  49. LANDING_BEACH,
  50. INSIDE_GDI_CON,
  51. AT_GDI_BASE,
  52. INSIDE_GDI_POWERPLANT,
  53. BY_HAND_OF_NOD,
  54. INSIDE_HAND_OF_NOD,
  55. BY_REFINERY,
  56. INSIDE_REFINERY,
  57. BY_COMM_CENTER,
  58. INSIDE_COMM_CENTER,
  59. BY_TUNNEL,
  60. INSIDE_TUNNEL,
  61. BY_WATERFALL,
  62. INSIDE_WATERFALL,
  63. AT_SNIPER_SCENARIO,
  64. } M01_Location;
  65. bool is_startup;
  66. bool first_time_in_handofnod;
  67. bool first_time_in_hon_gruntlevel;
  68. bool first_time_in_hon_dojolevel;
  69. bool first_time_poking_gate_lock;
  70. bool players_first_time_by_commcenter;
  71. bool first_time_at_barn;
  72. bool gate_objective_done;
  73. bool church_guard_is_dead;
  74. bool loveshack_guard_is_dead;
  75. bool player_has_an_escort;
  76. bool clergy_are_boarding;
  77. bool church_pickup_chinook_is_on_its_way;
  78. bool player_has_unlocked_pen;
  79. bool radar_is_scrambled;
  80. bool unlock_gate_objective_active;
  81. bool commcenter_sam_objective_active;
  82. bool prisoners_are_freed;
  83. bool m01_hon_spawned_guy_01_alive;
  84. bool m01_hon_spawned_guy_02_alive;
  85. bool m01_hon_spawned_guy_03_alive;
  86. bool turret_01_is_dead;
  87. bool turret_02_is_dead;
  88. bool medium_tank_spawned;
  89. bool barn_prisoner_01_is_dead;
  90. bool barn_prisoner_02_is_dead;
  91. bool barn_prisoner_03_is_dead;
  92. bool barn_objective_active;
  93. bool kane_and_no2_conv01_active;
  94. bool kane_and_no2_conv02_active;
  95. bool kane_and_havoc_conv_active;
  96. bool m01_bridgeWeather_is_Set;
  97. bool m01_nodBase_weather_is_Set;
  98. bool missionStart;
  99. bool barn_objective_failed;
  100. bool barn_announcement_active;
  101. bool barn_objective_ended;
  102. bool turret_objective_over;
  103. bool final_conv_played;
  104. int m01_church_interior_nun02_ID;
  105. int m01_whack_a_mole_guy_ID;
  106. int m01_hon_spawned_guy_01_ID;
  107. int m01_hon_spawned_guy_02_ID;
  108. int m01_hon_spawned_guy_03_ID;
  109. int m01_medium_tank_ID;
  110. int m01_hon_spawners_tally;
  111. int m01_hon_total_spawners_tally;
  112. int m01_HON_SpawnRate;
  113. int new_turretbeach_engineers;
  114. int kane_ID;
  115. int eva_comm_center_line_01;
  116. int eva_comm_center_line_02;
  117. int eva_comm_center_line_03;
  118. int eva_comm_center_line_04;
  119. int eva_comm_center_line_05;
  120. int billy_conv;
  121. int babushka_conv;
  122. int start_conv;
  123. int start_conv2;
  124. int kane_and_no2_conv01;
  125. int kane_and_no2_conv02;
  126. int kane_and_havoc_conv;
  127. int lockes_hon_mct_conv1;
  128. int lockes_hon_mct_conv2;
  129. int barnEvac_conv;
  130. int barnfailed_conv;
  131. int civ3_conv;
  132. int missionIntro;
  133. int endMission_conv;
  134. int unlocked_gate_conv;
  135. int turrets_conv;
  136. int players_escorts_ID;
  137. int havocs_targets_ID;
  138. int m01_hon_chinook_guys_killed;
  139. int dead_barn_guard_tally;
  140. int dead_barn_prisoner_tally;
  141. //new stuff
  142. bool firstNodCommanderKilled;
  143. int loveshack_conv;
  144. bool loveshack_conv_playing;
  145. int priest_conv;
  146. bool priest_conv_playing;
  147. int interior_nun_conv;
  148. bool interior_nun_conv_playing;
  149. bool player_has_reached_grunt_level;
  150. bool civs_scattered;
  151. bool commcenter_sam_destroyed;
  152. M01_Building_State hand_of_nod_state, comm_center_state;
  153. M01_Location players_location;
  154. REGISTER_VARIABLES()
  155. {
  156. SAVE_VARIABLE(is_startup, 1);
  157. SAVE_VARIABLE(first_time_in_handofnod, 2);
  158. SAVE_VARIABLE(first_time_in_hon_gruntlevel, 3);
  159. SAVE_VARIABLE(first_time_in_hon_dojolevel, 4);
  160. SAVE_VARIABLE(first_time_poking_gate_lock, 5);
  161. SAVE_VARIABLE(players_first_time_by_commcenter, 6);
  162. SAVE_VARIABLE(first_time_at_barn, 7);
  163. SAVE_VARIABLE(gate_objective_done, 8);
  164. SAVE_VARIABLE(church_guard_is_dead, 9);
  165. SAVE_VARIABLE(loveshack_guard_is_dead, 10);
  166. SAVE_VARIABLE(player_has_an_escort, 11);
  167. SAVE_VARIABLE(clergy_are_boarding, 12);
  168. SAVE_VARIABLE(church_pickup_chinook_is_on_its_way, 13);
  169. SAVE_VARIABLE(player_has_unlocked_pen, 14);
  170. SAVE_VARIABLE(radar_is_scrambled, 15);
  171. SAVE_VARIABLE(unlock_gate_objective_active, 16);
  172. SAVE_VARIABLE(commcenter_sam_objective_active, 17);
  173. SAVE_VARIABLE(prisoners_are_freed, 18);
  174. SAVE_VARIABLE(m01_hon_spawned_guy_01_alive, 19);
  175. SAVE_VARIABLE(m01_hon_spawned_guy_02_alive, 20);
  176. SAVE_VARIABLE(m01_hon_spawned_guy_03_alive, 21);
  177. SAVE_VARIABLE(turret_01_is_dead, 22);
  178. SAVE_VARIABLE(turret_02_is_dead, 23);
  179. SAVE_VARIABLE(medium_tank_spawned, 24);
  180. SAVE_VARIABLE(barn_prisoner_01_is_dead, 25);
  181. SAVE_VARIABLE(barn_prisoner_02_is_dead, 26);
  182. SAVE_VARIABLE(barn_prisoner_03_is_dead, 27);
  183. SAVE_VARIABLE(barn_objective_active, 28);
  184. SAVE_VARIABLE(kane_and_no2_conv01_active, 29);
  185. SAVE_VARIABLE(kane_and_no2_conv02_active, 30);
  186. SAVE_VARIABLE(kane_and_havoc_conv_active, 31);
  187. SAVE_VARIABLE(m01_bridgeWeather_is_Set, 32);
  188. SAVE_VARIABLE(m01_nodBase_weather_is_Set, 33);
  189. SAVE_VARIABLE(missionStart, 34);
  190. SAVE_VARIABLE(barn_objective_failed, 35);
  191. SAVE_VARIABLE(barn_announcement_active, 36);
  192. SAVE_VARIABLE(barn_objective_ended, 37);
  193. SAVE_VARIABLE(turret_objective_over, 38);
  194. SAVE_VARIABLE(final_conv_played, 39);
  195. SAVE_VARIABLE(m01_church_interior_nun02_ID, 40);
  196. SAVE_VARIABLE(m01_whack_a_mole_guy_ID, 41);
  197. SAVE_VARIABLE(m01_hon_spawned_guy_01_ID, 42);
  198. SAVE_VARIABLE(m01_hon_spawned_guy_02_ID, 43);
  199. SAVE_VARIABLE(m01_hon_spawned_guy_03_ID, 44);
  200. SAVE_VARIABLE(m01_medium_tank_ID, 45);
  201. SAVE_VARIABLE(m01_hon_spawners_tally, 46);
  202. SAVE_VARIABLE(m01_hon_total_spawners_tally, 47);
  203. SAVE_VARIABLE(m01_HON_SpawnRate, 48);
  204. SAVE_VARIABLE(new_turretbeach_engineers, 49);
  205. SAVE_VARIABLE(kane_ID, 50);
  206. SAVE_VARIABLE(eva_comm_center_line_01, 51);
  207. SAVE_VARIABLE(eva_comm_center_line_02, 52);
  208. SAVE_VARIABLE(eva_comm_center_line_03, 53);
  209. SAVE_VARIABLE(eva_comm_center_line_04, 54);
  210. SAVE_VARIABLE(eva_comm_center_line_05, 55);
  211. SAVE_VARIABLE(billy_conv, 56);
  212. SAVE_VARIABLE(babushka_conv, 57);
  213. SAVE_VARIABLE(start_conv, 58);
  214. SAVE_VARIABLE(start_conv2, 59);
  215. SAVE_VARIABLE(kane_and_no2_conv01, 60);
  216. SAVE_VARIABLE(kane_and_no2_conv02, 61);
  217. SAVE_VARIABLE(kane_and_havoc_conv, 62);
  218. SAVE_VARIABLE(lockes_hon_mct_conv1, 63);
  219. SAVE_VARIABLE(lockes_hon_mct_conv2, 64);
  220. SAVE_VARIABLE(barnEvac_conv, 65);
  221. SAVE_VARIABLE(barnfailed_conv, 66);
  222. SAVE_VARIABLE(civ3_conv, 67);
  223. SAVE_VARIABLE(missionIntro, 68);
  224. SAVE_VARIABLE(endMission_conv, 69);
  225. SAVE_VARIABLE(unlocked_gate_conv, 70);
  226. SAVE_VARIABLE(turrets_conv, 71);
  227. SAVE_VARIABLE(players_escorts_ID, 72);
  228. SAVE_VARIABLE(havocs_targets_ID, 73);
  229. SAVE_VARIABLE(m01_hon_chinook_guys_killed, 74);
  230. SAVE_VARIABLE(dead_barn_guard_tally, 75);
  231. SAVE_VARIABLE(dead_barn_prisoner_tally, 76);
  232. SAVE_VARIABLE(hand_of_nod_state, 77);
  233. SAVE_VARIABLE(comm_center_state, 78);
  234. SAVE_VARIABLE(players_location, 79);
  235. SAVE_VARIABLE(firstNodCommanderKilled, 80);
  236. SAVE_VARIABLE(loveshack_conv, 81);
  237. SAVE_VARIABLE(loveshack_conv_playing, 82);
  238. SAVE_VARIABLE(priest_conv, 83);
  239. SAVE_VARIABLE(priest_conv_playing, 84);//
  240. SAVE_VARIABLE(interior_nun_conv, 85);
  241. SAVE_VARIABLE(interior_nun_conv_playing, 86);
  242. SAVE_VARIABLE(player_has_reached_grunt_level, 87);
  243. SAVE_VARIABLE(civs_scattered, 88);
  244. SAVE_VARIABLE(commcenter_sam_destroyed, 89);
  245. }
  246. void Created( GameObject * obj )
  247. {
  248. Commands->Enable_Hibernation( obj, false );
  249. hand_of_nod_state = IDLE;
  250. comm_center_state = IDLE;
  251. players_location = LANDING_BEACH;
  252. is_startup = true;
  253. first_time_in_handofnod = true;
  254. first_time_in_hon_gruntlevel = true;
  255. first_time_in_hon_dojolevel = true;
  256. first_time_poking_gate_lock = true;
  257. players_first_time_by_commcenter = true;
  258. first_time_at_barn = true;
  259. missionStart = true;
  260. church_guard_is_dead = false;
  261. loveshack_guard_is_dead = false;
  262. player_has_an_escort = false;
  263. church_pickup_chinook_is_on_its_way = false;
  264. clergy_are_boarding = false;
  265. player_has_unlocked_pen = false;
  266. radar_is_scrambled = false;
  267. unlock_gate_objective_active = false;
  268. commcenter_sam_objective_active = false;
  269. prisoners_are_freed = false;
  270. m01_hon_spawned_guy_01_alive = false;
  271. m01_hon_spawned_guy_02_alive = false;
  272. m01_hon_spawned_guy_03_alive = false;
  273. turret_01_is_dead = false;
  274. turret_02_is_dead = false;
  275. medium_tank_spawned = false;
  276. barn_prisoner_01_is_dead = false;
  277. barn_prisoner_02_is_dead = false;
  278. barn_prisoner_03_is_dead = false;
  279. barn_objective_active = false;
  280. kane_and_no2_conv01_active = false;
  281. kane_and_no2_conv02_active = false;
  282. kane_and_havoc_conv_active = false;
  283. m01_bridgeWeather_is_Set = false;
  284. m01_nodBase_weather_is_Set = false;
  285. barn_objective_failed = false;
  286. barn_announcement_active = false;
  287. barn_objective_ended = false;
  288. turret_objective_over = false;
  289. final_conv_played = false;
  290. gate_objective_done = false;
  291. firstNodCommanderKilled = false;
  292. loveshack_conv_playing = false;
  293. priest_conv_playing = false;
  294. interior_nun_conv_playing = false;
  295. player_has_reached_grunt_level = false;
  296. civs_scattered = false;
  297. commcenter_sam_destroyed = false;
  298. m01_hon_chinook_guys_killed = 0;
  299. m01_hon_spawners_tally = 0;
  300. m01_hon_total_spawners_tally = 0;
  301. new_turretbeach_engineers = 0;
  302. dead_barn_guard_tally = 0;
  303. dead_barn_prisoner_tally = 0;
  304. m01_HON_SpawnRate = 14;
  305. players_escorts_ID = 0;
  306. havocs_targets_ID = 0;
  307. //Commands->Set_Clouds (0.25f, 0.25f, 0);
  308. Commands->Set_Wind (0, 0, 0, 0);
  309. Commands->Set_Rain (0, 0, true);
  310. Commands->Set_Lightning (0.25f, 0.75f, 1, 0, 0.10f, 0);
  311. //putting datalink updates here
  312. Commands->Reveal_Encyclopedia_Character ( 19 );//gdi minigunner
  313. Commands->Reveal_Encyclopedia_Character ( 21 );//gdi minigunner officer
  314. Commands->Reveal_Encyclopedia_Character ( 14 );//gdi grenadier
  315. Commands->Reveal_Encyclopedia_Character ( 38 );//nod minigunner
  316. Commands->Reveal_Encyclopedia_Character ( 18 );//Lt Maus -- whoever that is
  317. Commands->Reveal_Encyclopedia_Character ( 16 );//General Locke
  318. Commands->Reveal_Encyclopedia_Character ( 39 );//sakura
  319. Commands->Reveal_Encyclopedia_Character ( 13 );//hotwire
  320. Commands->Reveal_Encyclopedia_Character ( 15 );//patch
  321. Commands->Reveal_Encyclopedia_Character ( 22 );//deadeye
  322. Commands->Reveal_Encyclopedia_Character ( 26 );//gunner
  323. Commands->Reveal_Encyclopedia_Character ( 24 );//gdi rocket guy
  324. Commands->Reveal_Encyclopedia_Character ( 25 );//gdi rocket guy officer
  325. Commands->Reveal_Encyclopedia_Character ( 23 );//gdi POW
  326. Commands->Reveal_Encyclopedia_Weapon ( 14 );//pistol
  327. Commands->Reveal_Encyclopedia_Weapon ( 20 );//sniper rifle
  328. Commands->Reveal_Encyclopedia_Weapon ( 5 );//remote c4
  329. Commands->Reveal_Encyclopedia_Vehicle ( 18 );//orca
  330. Commands->Reveal_Encyclopedia_Vehicle ( 19 );//gdi transport helicopter
  331. Commands->Reveal_Encyclopedia_Building ( 4 );//gdi powerplant
  332. Commands->Reveal_Encyclopedia_Building ( 2 );//gdi con yard
  333. }
  334. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  335. {
  336. if (type == CUSTOM_EVENT_SOUND_ENDED )
  337. {
  338. if (param == eva_comm_center_line_01)
  339. {
  340. eva_comm_center_line_02 = Commands->Create_Sound ( "00-N002E", Vector3 (0,0,0), obj );//please stand by
  341. Commands->Monitor_Sound ( obj, eva_comm_center_line_02 );
  342. }
  343. else if (param == eva_comm_center_line_02)
  344. {
  345. eva_comm_center_line_03 = Commands->Create_Sound ( "00-N026E", Vector3 (0,0,0), obj );//transmitting
  346. Commands->Monitor_Sound ( obj, eva_comm_center_line_03 );
  347. }
  348. else if (param == eva_comm_center_line_03)
  349. {
  350. eva_comm_center_line_04 = Commands->Create_Sound ( "00-N028E", Vector3 (0,0,0), obj );//receiving
  351. Commands->Monitor_Sound ( obj, eva_comm_center_line_04 );
  352. }
  353. else if (param == eva_comm_center_line_04)
  354. {
  355. eva_comm_center_line_05 = Commands->Create_Sound ( "00-N030E", Vector3 (0,0,0), obj );//data acquisition complete
  356. Commands->Monitor_Sound ( obj, eva_comm_center_line_05 );
  357. }
  358. else if (param == eva_comm_center_line_05)
  359. {
  360. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
  361. player_has_unlocked_pen = true;
  362. }
  363. }
  364. else if (type == 0)
  365. {
  366. switch (param)
  367. {
  368. case 0://mission is over--end pass
  369. {
  370. Commands->Mission_Complete ( true );
  371. }
  372. break;
  373. case M01_HON_HAS_BEEN_DESTROYED_JDG://Hand of Nod has been destroyed
  374. {
  375. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_HON_OBJECTIVE_PASS_JDG, 2 );
  376. float pick_a_sound = Commands->Get_Random ( 0.5f, 2.5f );
  377. if (pick_a_sound >= 0.5 && pick_a_sound < 1.5)
  378. {
  379. Commands->Create_Sound ( "EVA_Enemy_Structure_Destroyed", Vector3 (0,0,0), obj);
  380. }
  381. else
  382. {
  383. Commands->Create_Sound ( "EVA_Nod_Structure_Destroyed", Vector3 (0,0,0), obj);
  384. }
  385. hand_of_nod_state = DESTROYED;
  386. Commands->Give_Points( STAR, 5000, false );
  387. GameObject * honCafeteriaGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_EATING_GUY_ID );
  388. if (honCafeteriaGuy01 != NULL)
  389. {
  390. Commands->Send_Custom_Event( obj, honCafeteriaGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  391. }
  392. GameObject * honCafeteriaGuy02 = Commands->Find_Object ( M01_HON_CAFETERIA_WALKING_GUY_ID );
  393. if (honCafeteriaGuy02 != NULL)
  394. {
  395. Commands->Send_Custom_Event( obj, honCafeteriaGuy02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  396. }
  397. GameObject * honJudoGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_JUDO_GUY_ID );
  398. if (honJudoGuy01 != NULL)
  399. {
  400. Commands->Send_Custom_Event( obj, honJudoGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  401. }
  402. GameObject * honDormGuy01 = Commands->Find_Object ( M01_HON_DORMROOM_MINIGUNNER_ID );
  403. if (honDormGuy01 != NULL)
  404. {
  405. Commands->Send_Custom_Event( obj, honDormGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  406. }
  407. GameObject * honDormGuy02 = Commands->Find_Object ( M01_HON_DORMROOM_ROCKET_GUY_ID );
  408. if (honDormGuy02 != NULL)
  409. {
  410. Commands->Send_Custom_Event( obj, honDormGuy02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  411. }
  412. GameObject * honDormGuy03 = Commands->Find_Object ( M01_HON_DORMROOM_CHEM_GUY_ID );
  413. if (honDormGuy03 != NULL)
  414. {
  415. Commands->Send_Custom_Event( obj, honDormGuy03, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  416. }
  417. GameObject * honDormGuy04 = Commands->Find_Object ( M01_HON_DORMROOM_FLAME_GUY_ID );
  418. if (honDormGuy04 != NULL)
  419. {
  420. Commands->Send_Custom_Event( obj, honDormGuy04, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  421. }
  422. GameObject * honDormGuy05 = Commands->Find_Object ( M01_HON_DORMROOM_CRAPPER_ID );
  423. if (honDormGuy05 != NULL)
  424. {
  425. Commands->Send_Custom_Event( obj, honDormGuy05, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  426. }
  427. GameObject * honDojoSensei = Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG );
  428. if (honDojoSensei != NULL)
  429. {
  430. Commands->Send_Custom_Event( obj, honDojoSensei, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  431. }
  432. GameObject * honDojoCiv01 = Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG );
  433. if (honDojoCiv01 != NULL)
  434. {
  435. Commands->Send_Custom_Event( obj, honDojoCiv01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  436. }
  437. GameObject * honDojoCiv02 = Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG );
  438. if (honDojoCiv02 != NULL)
  439. {
  440. Commands->Send_Custom_Event( obj, honDojoCiv02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  441. }
  442. GameObject * honDojoCiv03 = Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG );
  443. if (honDojoCiv03 != NULL)
  444. {
  445. Commands->Send_Custom_Event( obj, honDojoCiv03, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
  446. }
  447. if (players_location != INSIDE_HAND_OF_NOD)
  448. {
  449. if (player_has_reached_grunt_level == false)
  450. {
  451. GameObject * m01_hon_evacuator_guy01 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
  452. Commands->Attach_Script(m01_hon_evacuator_guy01, "M01_HON_FrontDoor_Evacuator_JDG", "");
  453. GameObject * m01_hon_evacuator_guy02 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
  454. Commands->Attach_Script(m01_hon_evacuator_guy02, "M01_HON_FrontDoor_Evacuator_JDG", "");
  455. GameObject * m01_hon_evacuator_guy03 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
  456. Commands->Attach_Script(m01_hon_evacuator_guy03, "M01_HON_FrontDoor_Evacuator_JDG", "");
  457. GameObject * m01_hon_evacuator_guy04 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
  458. Commands->Attach_Script(m01_hon_evacuator_guy04, "M01_HON_BackDoor_Evacuator_JDG", "");
  459. GameObject * m01_hon_evacuator_guy05 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
  460. Commands->Attach_Script(m01_hon_evacuator_guy05, "M01_HON_BackDoor_Evacuator_JDG", "");
  461. GameObject * m01_hon_evacuator_guy06 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
  462. Commands->Attach_Script(m01_hon_evacuator_guy06, "M01_HON_BackDoor_Evacuator_JDG", "");
  463. }
  464. }
  465. }
  466. break;
  467. case M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG://Comm Center has been destroyed
  468. {
  469. if (players_location != INSIDE_COMM_CENTER)
  470. {
  471. GameObject * m01_commcenter_evacuator_guy01 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
  472. Commands->Attach_Script(m01_commcenter_evacuator_guy01, "M01_CommCenter_Evacuator_JDG", "");
  473. GameObject * m01_commcenter_evacuator_guy02 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
  474. Commands->Attach_Script(m01_commcenter_evacuator_guy02, "M01_CommCenter_Evacuator_JDG", "");
  475. GameObject * m01_commcenter_evacuator_guy03 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
  476. Commands->Attach_Script(m01_commcenter_evacuator_guy03, "M01_CommCenter_Evacuator_JDG", "");
  477. GameObject * m01_commcenter_evacuator_guy04 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
  478. Commands->Attach_Script(m01_commcenter_evacuator_guy04, "M01_CommCenter_Evacuator_JDG", "");
  479. GameObject * m01_commcenter_evacuator_guy05 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
  480. Commands->Attach_Script(m01_commcenter_evacuator_guy05, "M01_CommCenter_Evacuator_JDG", "");
  481. }
  482. if (player_has_unlocked_pen == false)
  483. {
  484. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
  485. player_has_unlocked_pen = true;
  486. }
  487. if (radar_is_scrambled == true)
  488. {
  489. Commands->Send_Custom_Event( obj, obj, 0, M01_UNSCRAMBLE_THE_RADAR_JDG, 0 );
  490. }
  491. float pick_a_sound = Commands->Get_Random ( 0.5f, 2.5f );
  492. if (pick_a_sound >= 0.5 && pick_a_sound < 1.5)
  493. {
  494. Commands->Create_Sound ( "EVA_Enemy_Structure_Destroyed", Vector3 (0,0,0), obj);
  495. }
  496. else if (pick_a_sound >= 1.5 && pick_a_sound <= 2.5)
  497. {
  498. Commands->Create_Sound ( "EVA_Nod_Structure_Destroyed", Vector3 (0,0,0), obj);
  499. }
  500. comm_center_state = DESTROYED;
  501. }
  502. break;
  503. case M01_PLAYER_IS_INSIDE_HON_JDG://Player is inside HON--kill rain sounds
  504. {
  505. players_location = INSIDE_HAND_OF_NOD;
  506. GameObject * soundController = Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG );
  507. if (soundController != NULL)
  508. {
  509. Commands->Send_Custom_Event( obj, soundController, 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
  510. Commands->Send_Custom_Event( obj, soundController, 0, M01_PLAYER_IS_INSIDE_HON_JDG, 0 );
  511. }
  512. if (first_time_in_handofnod == true)
  513. {
  514. first_time_in_handofnod = false;
  515. Commands->Send_Custom_Event( obj, obj, 0, M01_HON_CUE_WARROOM_LEVEL_ACTORS_JDG, 0 );
  516. }
  517. }
  518. break;
  519. case M01_PLAYER_IS_OUTSIDE_HON_JDG://Player is outside HON--restart rain sounds
  520. {
  521. players_location = BY_HAND_OF_NOD;
  522. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
  523. }
  524. break;
  525. case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG://Player is inside Comm Center--kill rain sounds--start internal pagings
  526. {
  527. players_location = INSIDE_COMM_CENTER;
  528. GameObject * soundController = Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG );
  529. if (soundController != NULL)
  530. {
  531. Commands->Send_Custom_Event( obj, soundController, 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
  532. Commands->Send_Custom_Event( obj, soundController, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  533. }
  534. GameObject * baseCommander = Commands->Find_Object ( M01_COMMCENTER_BASE_COMMANDER_JDG );
  535. if (baseCommander != NULL)
  536. {
  537. Commands->Send_Custom_Event( obj, baseCommander, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  538. }
  539. GameObject * baseScapeGoat = Commands->Find_Object ( M01_COMMCENTER_BASE_SCAPEGOAT_JDG );
  540. if (baseScapeGoat != NULL)
  541. {
  542. Commands->Send_Custom_Event( obj, baseScapeGoat, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  543. }
  544. GameObject * upstairsTech = Commands->Find_Object ( M01_COMMCENTER_UPSTAIRS_TECH_JDG );
  545. if (upstairsTech != NULL)
  546. {
  547. Commands->Send_Custom_Event( obj, upstairsTech, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  548. }
  549. GameObject * warroomTech01 = Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_01_JDG );
  550. if (warroomTech01 != NULL)
  551. {
  552. Commands->Send_Custom_Event( obj, warroomTech01, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  553. }
  554. GameObject * warroomTech02 = Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_02_JDG );
  555. if (warroomTech02 != NULL)
  556. {
  557. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_02_JDG ), 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  558. }
  559. GameObject * mainframeTech = Commands->Find_Object ( M01_COMMCENTER_COMPUTERROOM_TECH_JDG );
  560. if (mainframeTech != NULL)
  561. {
  562. Commands->Send_Custom_Event( obj, mainframeTech, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  563. }
  564. GameObject * upstairsGuard = Commands->Find_Object ( M01_COMMCENTER_UPSTAIRS_GUARD_JDG );
  565. if (upstairsGuard != NULL)
  566. {
  567. Commands->Send_Custom_Event( obj, upstairsGuard, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  568. }
  569. }
  570. break;
  571. case M01_PLAYER_IS_OUTSIDE_COMM_CENTER_JDG://Player is outside Comm Center--restart rain sounds
  572. {
  573. players_location = BY_COMM_CENTER;
  574. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
  575. }
  576. break;
  577. case M01_PLAYER_IS_INSIDE_TUNNEL_JDG://Player is inside TUNNEL leading to tailgun run--stop rain sounds
  578. {
  579. players_location = INSIDE_TUNNEL;
  580. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
  581. }
  582. break;
  583. case M01_PLAYER_IS_OUTSIDE_TUNNEL_JDG://Player is outside TUNNEL--restart rain sounds
  584. {
  585. players_location = BY_TUNNEL;
  586. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
  587. }
  588. break;
  589. case M01_PLAYER_IS_INSIDE_WATERFALL_JDG://Player is inside WATERFALL cave--stop rain sounds
  590. {
  591. players_location = INSIDE_WATERFALL;
  592. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
  593. }
  594. break;
  595. case M01_PLAYER_IS_OUTSIDE_WATERFALL_JDG://Player is outside WATERFALL cave--restart rain sounds
  596. {
  597. players_location = BY_WATERFALL;
  598. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
  599. }
  600. break;
  601. case M01_PLAYER_IS_IN_HON_GRUNT_LEVEL_JDG://Player is entering Grunt level--cue actors
  602. {
  603. player_has_reached_grunt_level = true;
  604. if ((hand_of_nod_state != DESTROYED) && (first_time_in_hon_gruntlevel == true))
  605. {
  606. first_time_in_hon_gruntlevel = false;
  607. GameObject * honCafeteriaGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_EATING_GUY_ID );
  608. if (honCafeteriaGuy01 != NULL)
  609. {
  610. Commands->Send_Custom_Event( obj, honCafeteriaGuy01, 0, M01_START_ACTING_JDG, 0 );
  611. }
  612. GameObject * honCafeteriaGuy02 = Commands->Find_Object ( M01_HON_CAFETERIA_WALKING_GUY_ID );
  613. if (honCafeteriaGuy02 != NULL)
  614. {
  615. Commands->Send_Custom_Event( obj, honCafeteriaGuy02, 0, M01_START_ACTING_JDG, 0 );
  616. }
  617. GameObject * honJudoGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_JUDO_GUY_ID );
  618. if (honJudoGuy01 != NULL)
  619. {
  620. Commands->Send_Custom_Event( obj, honJudoGuy01, 0, M01_START_ACTING_JDG, 0 );
  621. }
  622. GameObject * honDormGuy01 = Commands->Find_Object ( M01_HON_DORMROOM_MINIGUNNER_ID );
  623. if (honDormGuy01 != NULL)
  624. {
  625. Commands->Send_Custom_Event( obj, honDormGuy01, 0, M01_START_ACTING_JDG, 0 );
  626. }
  627. GameObject * honDormGuy02 = Commands->Find_Object ( M01_HON_DORMROOM_ROCKET_GUY_ID );
  628. if (honDormGuy02 != NULL)
  629. {
  630. Commands->Send_Custom_Event( obj, honDormGuy02, 0, M01_START_ACTING_JDG, 0 );
  631. }
  632. GameObject * honDormGuy03 = Commands->Find_Object ( M01_HON_DORMROOM_CHEM_GUY_ID );
  633. if (honDormGuy03 != NULL)
  634. {
  635. Commands->Send_Custom_Event( obj, honDormGuy03, 0, M01_START_ACTING_JDG, 0 );
  636. }
  637. GameObject * honDormGuy04 = Commands->Find_Object ( M01_HON_DORMROOM_FLAME_GUY_ID );
  638. if (honDormGuy04 != NULL)
  639. {
  640. Commands->Send_Custom_Event( obj, honDormGuy04, 0, M01_START_ACTING_JDG, 0 );
  641. }
  642. GameObject * honDormGuy05 = Commands->Find_Object ( M01_HON_DORMROOM_CRAPPER_ID );
  643. if (honDormGuy05 != NULL)
  644. {
  645. Commands->Send_Custom_Event( obj, honDormGuy05, 0, M01_START_ACTING_JDG, 0 );
  646. }
  647. }
  648. }
  649. break;
  650. case M01_PLAYER_IS_IN_HON_DOJO_JDG://Player is entering DOJO--cue actors
  651. {
  652. if ((hand_of_nod_state != DESTROYED) && (first_time_in_hon_dojolevel == true))
  653. {
  654. first_time_in_hon_dojolevel = false;
  655. if (Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG ))
  656. {
  657. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG ), 0, M01_START_ACTING_JDG, 0 );
  658. }
  659. }
  660. }
  661. break;
  662. case M01_HON_SAMSITE_HAS_BEEN_DESTROYED_JDG://hand of nod sam site has been destroyed--duh!
  663. {
  664. //Commands->Set_Objective_Status( M01_HON_SAM_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  665. GameObject * handOfNod = Commands->Find_Object ( M01_HAND_OF_NOD_JDG );
  666. float handOfNodHealth = Commands->Get_Health ( handOfNod );
  667. if (handOfNodHealth > 0)
  668. {
  669. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 3 );
  670. float delayTimer_A = Commands->Get_Random ( 0, 2 );
  671. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_A_JDG, delayTimer_A );
  672. float delayTimer_B = Commands->Get_Random ( 2, 4 );
  673. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_B_JDG, delayTimer_B );
  674. }
  675. }
  676. break;
  677. case M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG://Comm Center sam site has been destroyed--duh!
  678. {
  679. commcenter_sam_destroyed = true;
  680. if (commcenter_sam_objective_active == true)
  681. {
  682. Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_COMM_SAM_OBJECTIVE_JDG, 0 );
  683. }
  684. if (player_has_unlocked_pen == true)
  685. {
  686. unlocked_gate_conv = Commands->Create_Conversation( "M01_Remove_Unlock_Gate_Objective", 100, 1000, false);
  687. Commands->Join_Conversation( NULL, unlocked_gate_conv, false, false );
  688. Commands->Start_Conversation( unlocked_gate_conv, unlocked_gate_conv );
  689. Commands->Monitor_Conversation( obj, unlocked_gate_conv );
  690. }
  691. //Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 5 );
  692. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_COMMCENTER_REINFORCEMENTS_JDG, 10 );
  693. }
  694. break;
  695. case M01_ANNOUNCE_AIRSTRIKE_JDG://EVA announces incoming airstrike
  696. {
  697. Commands->Create_Sound ( "00-N036E", Vector3 (0,0,0), obj);
  698. }
  699. break;
  700. case M01_ANNOUNCE_REINFORCEMENTS_JDG://EVA announces incoming reinforcements
  701. {
  702. Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
  703. }
  704. break;
  705. case M01_SEND_COMMCENTER_REINFORCEMENTS_JDG://Starting Elie drop off animation at Comm Center
  706. {
  707. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-296.388f, 497.455f, 29.122f));
  708. Commands->Set_Facing(chinook_obj1, -130.00f);
  709. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_CommCenter_TroopDrop.txt");
  710. }
  711. break;
  712. case M01_SEND_HON_REINFORCEMENTS_A_JDG://Starting Elie drop off animation at Hand of Nod
  713. {
  714. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-147.1f, 558.8f, 4.4f));
  715. Commands->Set_Facing(chinook_obj1, -130.00f);
  716. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01a.txt");
  717. }
  718. break;
  719. case M01_SEND_HON_REINFORCEMENTS_B_JDG://Starting Elie drop off animation at Hand of Nod
  720. {
  721. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-154.679f, 519.009f, 4.97f));
  722. Commands->Set_Facing(chinook_obj1, 130.00f);
  723. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01b.txt");
  724. }
  725. break;
  726. case M01_HON_CHINOOK_GUY_HAS_BEEN_KILLED_JDG://a reinforcement guy's been killed--spawn more if needed
  727. {
  728. m01_hon_chinook_guys_killed++;
  729. if (m01_hon_chinook_guys_killed == 3)
  730. {
  731. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 3 );
  732. float pick_a_chinook = Commands->Get_Random ( 0.5f, 2.5f );
  733. if (pick_a_chinook >= 0.5 && pick_a_chinook < 1.5)
  734. {
  735. float delayTimer = Commands->Get_Random ( 0, 2 );
  736. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_A_JDG, delayTimer );
  737. }
  738. else
  739. {
  740. float delayTimer = Commands->Get_Random ( 0, 2 );
  741. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_B_JDG, delayTimer );
  742. }
  743. }
  744. }
  745. break;
  746. case M01_PLAYER_IS_APPROACHING_CHURCH_JDG://cue church actors
  747. {
  748. if (m01_bridgeWeather_is_Set == false)
  749. {
  750. m01_bridgeWeather_is_Set = true;
  751. //Commands->Set_Clouds (0.75f, 0.75f, 30);
  752. Commands->Set_Wind (60, 3.0f, 0.5f, 15);
  753. Commands->Set_Rain (0.75f, 30, false);
  754. Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
  755. Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
  756. GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
  757. Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
  758. GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
  759. if (chemGuy01 != NULL)
  760. {
  761. Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
  762. }
  763. }
  764. int church_upadate = Commands->Create_Conversation( "M01_Add_Church_Objective", 100, 1000, false);
  765. Commands->Join_Conversation( NULL, church_upadate, false, false );
  766. //Commands->Join_Conversation( STAR, church_upadate, false, false );
  767. Commands->Start_Conversation( church_upadate, 0 );
  768. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_CHURCH_OBJECTIVE_JDG, 8 );
  769. GameObject * loveshackGuard = Commands->Find_Object ( M01_CHURCH_LOVESHACK_MINIGUNNER_ID );
  770. if (loveshackGuard != NULL)
  771. {
  772. Commands->Send_Custom_Event( obj, loveshackGuard, 0, M01_START_ACTING_JDG, 0 );
  773. }
  774. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  775. if (loveshackNun != NULL)
  776. {
  777. Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_START_ACTING_JDG, 0 );
  778. }
  779. GameObject * exteriorGuard = Commands->Find_Object ( M01_CHURCH_EXTERIOR_MINIGUNNER_ID );
  780. if (exteriorGuard != NULL)
  781. {
  782. Commands->Send_Custom_Event( obj, exteriorGuard, 0, M01_START_ACTING_JDG, 0 );
  783. }
  784. GameObject * balconyGuard = Commands->Find_Object ( M01_CHURCH_BALCONY_MINIGUNNER_ID );
  785. if (balconyGuard != NULL)
  786. {
  787. Commands->Send_Custom_Event( obj, balconyGuard, 0, M01_START_ACTING_JDG, 0 );
  788. }
  789. GameObject * rectoryGuard = Commands->Find_Object ( M01_CHURCH_GUARD_MINIGUNNER_ID );
  790. if (rectoryGuard != NULL)
  791. {
  792. Commands->Send_Custom_Event( obj, rectoryGuard, 0, M01_START_ACTING_JDG, 0 );
  793. }
  794. GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  795. if (churchNun != NULL)
  796. {
  797. Commands->Send_Custom_Event( obj, churchNun, 0, M01_START_ACTING_JDG, 0 );
  798. }
  799. GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  800. if (churchPriest != NULL)
  801. {
  802. Commands->Send_Custom_Event( obj, churchPriest, 0, M01_START_ACTING_JDG, 0 );
  803. }
  804. }
  805. break;
  806. case M01_ADD_CHURCH_OBJECTIVE_JDG://Loveshack guard is dead--let nun know
  807. {
  808. Commands->Add_Objective( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_05, NULL, IDS_Enc_Obj_Secondary_M01_05 );
  809. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  810. if (pogController != NULL)
  811. {
  812. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_CHURCH_OBJECTIVE_JDG, 0 );
  813. }
  814. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  815. if (loveshackNun != NULL)
  816. {
  817. Commands->Set_Obj_Radar_Blip_Shape ( loveshackNun, RADAR_BLIP_SHAPE_OBJECTIVE );
  818. Commands->Set_Obj_Radar_Blip_Color ( loveshackNun, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  819. }
  820. GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  821. if (churchNun != NULL)
  822. {
  823. Commands->Set_Obj_Radar_Blip_Shape ( churchNun, RADAR_BLIP_SHAPE_OBJECTIVE );
  824. Commands->Set_Obj_Radar_Blip_Color ( churchNun, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  825. }
  826. GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  827. if (churchPriest != NULL)
  828. {
  829. Commands->Set_Obj_Radar_Blip_Shape ( churchPriest, RADAR_BLIP_SHAPE_OBJECTIVE );
  830. Commands->Set_Obj_Radar_Blip_Color ( churchPriest, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  831. }
  832. }
  833. break;
  834. case M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG://guard tower commander is destroyed--clear objective
  835. {
  836. Commands->Set_Objective_Status( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  837. firstNodCommanderKilled = true;
  838. }
  839. break;
  840. case M01_CLEAR_HON_OBJECTIVE_PASS_JDG://HON is destroyed--clear objective
  841. {
  842. Commands->Set_Objective_Status( M01_HON_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  843. }
  844. break;
  845. case M01_CLEAR_CHURCH_OBJECTIVE_PASS_JDG://player has rescued clergy
  846. {
  847. Commands->Set_Objective_Status( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  848. }
  849. break;
  850. case M01_CLEAR_CHURCH_OBJECTIVE_FAIL_JDG://player has rescued clergy
  851. {
  852. Commands->Set_Objective_Status( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  853. }
  854. break;
  855. case M01_LOVESHACK_GUARD_IS_DEAD_JDG://Loveshack guard is dead--let nun know
  856. {
  857. loveshack_guard_is_dead = true;
  858. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  859. if (loveshackNun != NULL)
  860. {
  861. float delayTimer = Commands->Get_Random ( 0, 2 );
  862. Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_LOVESHACK_GUARD_IS_DEAD_JDG, delayTimer );
  863. }
  864. if ((loveshack_guard_is_dead == true) && (church_guard_is_dead == true) && (church_pickup_chinook_is_on_its_way == false))
  865. {
  866. GameObject * churchEvacController = Commands->Find_Object ( 103394 );
  867. if (churchEvacController != NULL)
  868. {
  869. Commands->Send_Custom_Event( obj, churchEvacController, 0, M01_START_ACTING_JDG, 3 );//giving clearance to havoc exit zone for conversation
  870. }
  871. church_pickup_chinook_is_on_its_way = true;
  872. }
  873. }
  874. break;
  875. case M01_CHURCH_GUARD_IS_DEAD_JDG://inner guard is dead--let nuns & prist know
  876. {
  877. church_guard_is_dead = true;
  878. GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  879. if (churchNun != NULL)
  880. {
  881. float delayTimer = Commands->Get_Random ( 0, 2 );
  882. Commands->Send_Custom_Event( obj, churchNun, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, delayTimer );
  883. }
  884. GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  885. if (churchPriest != NULL)
  886. {
  887. float delayTimer = Commands->Get_Random ( 0, 2 );
  888. Commands->Send_Custom_Event( obj, churchPriest, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, delayTimer );
  889. }
  890. if ((loveshack_guard_is_dead == true) && (church_guard_is_dead == true) && (church_pickup_chinook_is_on_its_way == false))
  891. {
  892. church_pickup_chinook_is_on_its_way = true;
  893. GameObject * churchEvacController = Commands->Find_Object ( 103394 );
  894. if (churchEvacController != NULL)
  895. {
  896. Commands->Send_Custom_Event( obj, churchEvacController, 0, M01_START_ACTING_JDG, 3 );//giving clearance to havoc exit zone for conversation
  897. }
  898. }
  899. }
  900. break;
  901. case M01_CHURCH_CLERGY_HAS_BOARDED_JDG://when all clergy have boarded--tell chinook to take off
  902. {
  903. if (Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID ) || (Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID )) || (Commands->Find_Object ( m01_church_interior_nun02_ID )) || (Commands->Find_Object ( M01_CHURCH_PRIEST_ID )))
  904. {
  905. Commands->Send_Custom_Event( obj, obj, 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 2 );
  906. }
  907. else
  908. {
  909. if ((clergy_are_boarding == false))
  910. {
  911. clergy_are_boarding = true;
  912. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_CHURCH_OBJECTIVE_PASS_JDG, 2 );
  913. }
  914. }
  915. }
  916. break;
  917. case M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG://a card carrier has been killed--drop necessary card
  918. {
  919. bool playerHasLevel01KeyCard = Commands->Has_Key( STAR, 1 );;
  920. bool playerHasLevel02KeyCard = Commands->Has_Key( STAR, 2 );;
  921. bool playerHasLevel03KeyCard = Commands->Has_Key( STAR, 3 );;
  922. if (playerHasLevel01KeyCard == false)
  923. {
  924. Vector3 spawn_location = Commands->Get_Position ( sender );
  925. spawn_location.Z = spawn_location.Z + 0.75f;
  926. GameObject * keycard01 = Commands->Create_Object ( "Level_01_Keycard", spawn_location );
  927. Commands->Attach_Script(keycard01, "M01_KeyCard01_Script_JDG", "");
  928. }
  929. else if (playerHasLevel02KeyCard == false)
  930. {
  931. Vector3 spawn_location = Commands->Get_Position ( sender );
  932. spawn_location.Z = spawn_location.Z + 0.75f;
  933. Commands->Create_Object ( "Level_02_Keycard", spawn_location );
  934. }
  935. else if (playerHasLevel03KeyCard == false)
  936. {
  937. Vector3 spawn_location = Commands->Get_Position ( sender );
  938. spawn_location.Z = spawn_location.Z + 0.75f;
  939. Commands->Create_Object ( "Level_03_Keycard", spawn_location );
  940. }
  941. else
  942. {
  943. Vector3 spawn_location = Commands->Get_Position ( sender );
  944. spawn_location.Z = spawn_location.Z + 0.75f;
  945. Commands->Create_Object ( "POW_Health_100", spawn_location );
  946. }
  947. }
  948. break;
  949. case M01_GDI_GUY_HAS_BEEN_POKED_JDG://player has poked a GDI soldier--if player is alone assign escort
  950. {
  951. int poked_guys_ID = Commands->Get_ID ( sender );
  952. if (player_has_an_escort == false)
  953. {
  954. Commands->Send_Custom_Event( obj, sender, 0, M01_PLEASE_START_ESCORTING_PLAYER_JDG, 0 );
  955. players_escorts_ID = poked_guys_ID;
  956. player_has_an_escort = true;
  957. }
  958. else if (player_has_an_escort == true)
  959. {
  960. if (poked_guys_ID == players_escorts_ID)//this guy is escorting player--tell him to hold position
  961. {
  962. Commands->Send_Custom_Event( obj, sender, 0, M01_PLEASE_STOP_ESCORTING_PLAYER_JDG, 0 );
  963. player_has_an_escort = false;
  964. }
  965. }
  966. }
  967. break;
  968. case M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG://player's escort has been killed--reset escort parameters
  969. {
  970. player_has_an_escort = false;
  971. }
  972. break;
  973. case M01_PLAYER_IS_ATTACKING_ME_JDG://if player is being escorted--tell escort who havoc's target is
  974. {
  975. if (player_has_an_escort == true)
  976. {
  977. havocs_targets_ID = Commands->Get_ID ( sender );
  978. float delayTimer = Commands->Get_Random ( 0, 1 );
  979. Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), M01_PLAYER_IS_ATTACKING_ME_JDG, havocs_targets_ID, delayTimer );
  980. }
  981. }
  982. break;
  983. case M01_PLAYER_IS_LEAVING_CHURCH_01_JDG://if havoc has escort--tell them to go somewhere else
  984. {
  985. if (player_has_an_escort == true)
  986. {
  987. Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_CHURCH_01_JDG, 0 );
  988. }
  989. }
  990. break;
  991. case M01_PLAYER_IS_LEAVING_CHURCH_02_JDG://if havoc has escort--tell them to go somewhere else
  992. {
  993. if (player_has_an_escort == true)
  994. {
  995. Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_CHURCH_02_JDG, 0 );
  996. }
  997. }
  998. break;
  999. case M01_PLAYER_IS_LEAVING_HON_01_JDG://if havoc has escort--tell them to go somewhere else
  1000. {
  1001. if (player_has_an_escort == true)
  1002. {
  1003. Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_HON_01_JDG, 0 );
  1004. }
  1005. }
  1006. break;
  1007. case M01_PLAYER_IS_LEAVING_HON_02_JDG://if havoc has escort--tell them to go somewhere else
  1008. {
  1009. if (player_has_an_escort == true)
  1010. {
  1011. Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_HON_02_JDG, 0 );
  1012. }
  1013. }
  1014. break;
  1015. case M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG://havoc is crossing bridge for first time--cue driveby actors
  1016. {
  1017. if (m01_bridgeWeather_is_Set == false)
  1018. {
  1019. m01_bridgeWeather_is_Set = true;
  1020. //Commands->Set_Clouds (0.75f, 0.75f, 30);
  1021. Commands->Set_Wind (60, 3.0f, 0.5f, 15);
  1022. Commands->Set_Rain (0.75f, 30, false);
  1023. Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
  1024. Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
  1025. GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
  1026. Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
  1027. GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
  1028. if (chemGuy01 != NULL)
  1029. {
  1030. Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
  1031. }
  1032. }
  1033. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, 10 );
  1034. GameObject * churchAreaCommander = Commands->Find_Object ( M01_CHURCHAREA_NOD_COMMANDER_JDG );
  1035. if (churchAreaCommander != NULL)
  1036. {
  1037. Commands->Send_Custom_Event( obj, churchAreaCommander, 0, M01_START_ACTING_JDG, 0 );
  1038. }
  1039. }
  1040. break;
  1041. case M01_PLAYER_IS_CROSSING_THE_BRIDGE_VIA_CAVE_JDG://havoc is crossing bridge for first time--cue actors driveby actors
  1042. {
  1043. if (m01_bridgeWeather_is_Set == false)
  1044. {
  1045. m01_bridgeWeather_is_Set = true;
  1046. //Commands->Set_Clouds (0.75f, 0.75f, 30);
  1047. Commands->Set_Wind (60, 3.0f, 0.5f, 15);
  1048. Commands->Set_Rain (0.75f, 30, false);
  1049. Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
  1050. Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
  1051. GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
  1052. Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
  1053. GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
  1054. if (chemGuy01 != NULL)
  1055. {
  1056. Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
  1057. }
  1058. }
  1059. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, 10 );
  1060. GameObject * churchAreaCommander = Commands->Find_Object ( M01_CHURCHAREA_NOD_COMMANDER_JDG );
  1061. if (churchAreaCommander != NULL)
  1062. {
  1063. Commands->Send_Custom_Event( obj, churchAreaCommander, 0, M01_START_ACTING_JDG, 0 );
  1064. }
  1065. }
  1066. break;
  1067. case M01_SPAWN_TIB_CAVE_HELICOPTER_JDG://player is in tib cave--spawn surprise helicopter
  1068. {
  1069. GameObject * m01_tiberium_cave_helicopter = Commands->Create_Object ( "NOD_Apache", Vector3(-40.708f, 375.387f, 30.275f) );
  1070. Commands->Set_Facing ( m01_tiberium_cave_helicopter, -30 );
  1071. Commands->Attach_Script(m01_tiberium_cave_helicopter, "M01_Tiberium_Cave_Helicopter_JDG", "");
  1072. }
  1073. break;
  1074. case M01_ANNOUNCE_HON_OBJECTIVE_JDG://player is approaching hand of nod--give objective
  1075. {
  1076. if (m01_nodBase_weather_is_Set == false)
  1077. {
  1078. m01_nodBase_weather_is_Set = true;
  1079. //Commands->Set_Clouds (1.0f, 1.0f, 15);
  1080. Commands->Set_Wind (60, 5.0f, 1.0f, 15);
  1081. Commands->Set_Rain (1.0f, 15, false);
  1082. Commands->Set_Lightning (0.5f, 0, 0.25f, 0, 1, 15);
  1083. }
  1084. int hand_of_nod_conv = Commands->Create_Conversation( "M01_Add_HON_Objective", 100, 1000, false);
  1085. Commands->Join_Conversation( NULL, hand_of_nod_conv, false, false );
  1086. Commands->Start_Conversation( hand_of_nod_conv, 0 );
  1087. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_HON_OBJECTIVE_JDG, 10 );
  1088. }
  1089. break;
  1090. case M01_ADD_HON_OBJECTIVE_JDG://adding objective
  1091. {
  1092. Commands->Add_Objective( M01_HON_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_07, NULL, IDS_Enc_Obj_Secondary_M01_07 );
  1093. Commands->Set_Objective_Radar_Blip( M01_HON_OBJECTIVE_JDG, Vector3 (-179.3f, 541.9f, 3.518f) );
  1094. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1095. if (pogController != NULL)
  1096. {
  1097. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_HON_OBJECTIVE_JDG, 0 );
  1098. }
  1099. }
  1100. break;
  1101. case M01_KILL_THE_COMM_JDG://apply damage to COMM CENTER
  1102. {
  1103. if (comm_center_state != DESTROYED)
  1104. {
  1105. Commands->Apply_Damage( Commands->Find_Object ( M01_COMM_CENTER_JDG ), 100000000, "BlamoKiller", obj );
  1106. }
  1107. }
  1108. break;
  1109. case M01_KILL_THE_HON_JDG://apply damage to HON
  1110. {
  1111. if (hand_of_nod_state != DESTROYED)
  1112. {
  1113. Commands->Apply_Damage( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ), 100000000, "BlamoKiller", obj );
  1114. }
  1115. }
  1116. break;
  1117. case M01_PLAYER_HAS_POKED_COMM_CENTER_PCT_JDG:
  1118. {
  1119. if (player_has_unlocked_pen == false)//player is poking PCT--play EVA messages
  1120. {
  1121. eva_comm_center_line_01 = Commands->Create_Sound ( "00-N000E", Vector3 (0,0,0), obj );//accessing
  1122. Commands->Monitor_Sound ( obj, eva_comm_center_line_01 );
  1123. //Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
  1124. //player_has_unlocked_pen = true;
  1125. }
  1126. }
  1127. break;
  1128. case M01_PLAYER_HAS_POKED_PEN_GATE_JDG:
  1129. {
  1130. if (player_has_unlocked_pen != true)
  1131. {
  1132. if (first_time_poking_gate_lock == true)
  1133. {
  1134. first_time_poking_gate_lock = false;
  1135. int prisoner_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
  1136. Commands->Join_Conversation( NULL, prisoner_conv, false, false );
  1137. Commands->Start_Conversation( prisoner_conv, prisoner_conv );
  1138. }
  1139. else
  1140. {
  1141. Commands->Create_Sound ( "00-N008E", Vector3 (0,0,0), obj );//access denied
  1142. }
  1143. }
  1144. else if (gate_objective_done == false)
  1145. {
  1146. gate_objective_done = true;
  1147. Commands->Set_Objective_Status( M01_OPEN_THE_GATE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1148. Commands->Static_Anim_Phys_Goto_Last_Frame (M01_COMMCENTER_DETENTION_GATE_JDG, NULL );
  1149. //Vector3 gatePosition = Commands->Get_Position ( Commands->Find_Object ( M01_COMMCENTER_DETENTION_GATE_JDG ) );
  1150. //Vector3 gatePosition = Commands->Get_Position ( STAR );
  1151. Vector3 gatePosition (-313.060f, 575.220f, 28.513f);
  1152. Commands->Create_Sound ( "Gate_Down_01", gatePosition, obj );
  1153. if (Commands->Find_Object ( M01_COMMCENTER_SAM_JDG ))
  1154. {
  1155. Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_IS_DOWN_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
  1156. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG, 0 );
  1157. }
  1158. else
  1159. {
  1160. Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
  1161. }
  1162. if (prisoners_are_freed == false)
  1163. {
  1164. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_PRISONERS_PASS_JDG, 0 );
  1165. prisoners_are_freed = true;
  1166. }
  1167. }
  1168. }
  1169. break;
  1170. case M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG:
  1171. {
  1172. int comm_sam_conv = Commands->Create_Conversation( "M01_Add_Comm_SAM_Objective", 100, 1000, false);
  1173. Commands->Join_Conversation( NULL, comm_sam_conv, false, false );
  1174. //Commands->Join_Conversation( STAR, comm_sam_conv, false, false );
  1175. Commands->Start_Conversation( comm_sam_conv, 0 );
  1176. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_COMM_SAM_OBJECTIVE_JDG, 6 );
  1177. commcenter_sam_objective_active = true;
  1178. }
  1179. break;
  1180. case M01_ADD_COMM_SAM_OBJECTIVE_JDG:
  1181. {
  1182. GameObject * commSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
  1183. if (commSamSite != NULL)
  1184. {
  1185. Commands->Add_Objective( M01_COMM_SAM_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_04, NULL, IDS_Enc_Obj_Primary_M01_04 );
  1186. Commands->Set_Objective_Radar_Blip_Object( M01_COMM_SAM_OBJECTIVE_JDG, commSamSite );
  1187. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1188. if (pogController != NULL)
  1189. {
  1190. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_COMM_SAM_OBJECTIVE_JDG, 0 );
  1191. }
  1192. }
  1193. }
  1194. break;
  1195. case M01_ANNOUNCE_UNLOCK_GATE_OBJECTIVE_JDG:
  1196. {
  1197. int unlock_gate_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
  1198. Commands->Join_Conversation( NULL, unlock_gate_conv, false, false );
  1199. Commands->Start_Conversation( unlock_gate_conv, 0 );
  1200. }
  1201. break;
  1202. case M01_ADD_UNLOCK_GATE_OBJECTIVE_JDG:
  1203. {
  1204. Vector3 pogMarker (-296.505f, 521.090f, 27.090f);
  1205. Commands->Add_Objective( M01_UNLOCK_GATE_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_02, NULL, IDS_Enc_Obj_Primary_M01_02 );
  1206. Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_HACK, pogMarker );
  1207. unlock_gate_objective_active = true;
  1208. //Vector3 green (0,1,0);
  1209. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_02, TEXT_COLOR_OBJECTIVE_PRIMARY );
  1210. GameObject * invisibleCrate = Commands->Find_Object ( 107809 );
  1211. if (invisibleCrate != NULL)
  1212. {
  1213. Commands->Send_Custom_Event( obj, invisibleCrate, 0, M01_COMM_SAM_OBJECTIVE_JDG, 0 );
  1214. }
  1215. }
  1216. break;
  1217. case M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG:
  1218. {
  1219. if (commcenter_sam_destroyed == true)
  1220. {
  1221. unlocked_gate_conv = Commands->Create_Conversation( "M01_Remove_Unlock_Gate_Objective", 100, 1000, false);
  1222. Commands->Join_Conversation( NULL, unlocked_gate_conv, false, false );
  1223. Commands->Start_Conversation( unlocked_gate_conv, unlocked_gate_conv );
  1224. Commands->Monitor_Conversation( obj, unlocked_gate_conv );
  1225. }
  1226. else if (commcenter_sam_destroyed == false)//
  1227. {
  1228. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG, 0 );
  1229. }
  1230. if (unlock_gate_objective_active == true)
  1231. {
  1232. Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_UNLOCK_GATE_OBJECTIVE_JDG, 6 );
  1233. }
  1234. }
  1235. break;
  1236. case M01_PASS_UNLOCK_GATE_OBJECTIVE_JDG:
  1237. {
  1238. Commands->Set_Objective_Status( M01_UNLOCK_GATE_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1239. }
  1240. break;
  1241. case M01_PASS_COMM_SAM_OBJECTIVE_JDG:
  1242. {
  1243. Commands->Set_Objective_Status( M01_COMM_SAM_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1244. commcenter_sam_objective_active = false;
  1245. if (prisoners_are_freed == true)
  1246. {
  1247. Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
  1248. Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 60 );
  1249. }
  1250. }
  1251. break;
  1252. case M01_SCRAMBLE_THE_RADAR_JDG:
  1253. {
  1254. if (players_first_time_by_commcenter == true)
  1255. {
  1256. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103099 ), 0, M01_START_ACTING_JDG, 0 );//telling propaganda to start up
  1257. players_first_time_by_commcenter = false;
  1258. int radar_conv = Commands->Create_Conversation( "M01_Radar_Scrambled_Conversation", 100, 1000, false);
  1259. Commands->Join_Conversation( NULL, radar_conv, false, false, false );
  1260. Commands->Join_Conversation( NULL, radar_conv, false, false, false );
  1261. Commands->Start_Conversation( radar_conv, radar_conv );
  1262. }
  1263. if ((radar_is_scrambled == false) && (comm_center_state != DESTROYED) )
  1264. {
  1265. radar_is_scrambled = true;
  1266. Commands->Enable_Radar ( false );
  1267. }
  1268. }
  1269. break;
  1270. case M01_UNSCRAMBLE_THE_RADAR_JDG:
  1271. {
  1272. if (radar_is_scrambled == true)
  1273. {
  1274. Commands->Enable_Radar ( true);
  1275. radar_is_scrambled = false;
  1276. }
  1277. }
  1278. break;
  1279. case M01_ANNOUNCE_PRISONER_OBJECTIVE_JDG:
  1280. {
  1281. int prisoner_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
  1282. Commands->Join_Conversation( NULL, prisoner_conv, false, false );
  1283. Commands->Start_Conversation( prisoner_conv, prisoner_conv );
  1284. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_UNLOCK_GATE_OBJECTIVE_JDG, 10 );
  1285. Commands->Set_Objective_Status( M01_PRISONER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1286. }
  1287. break;
  1288. case M01_CLEAR_PRISONERS_PASS_JDG://prisoners have been freed
  1289. {
  1290. Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 0 );
  1291. }
  1292. break;
  1293. case M01_DO_END_MISSION_CHECK_JDG://see if any primary objectives are active
  1294. {
  1295. if ( (commcenter_sam_objective_active != true) && (prisoners_are_freed == true) )
  1296. {
  1297. //Commands->Set_Clouds (0, 0, 5);
  1298. Commands->Set_Wind (0, 0, 0, 5);
  1299. Commands->Set_Rain (0, 5, false);
  1300. Commands->Set_Lightning (0, 0, 0, 0, 0, 5);
  1301. if (final_conv_played == false)
  1302. {
  1303. final_conv_played = true;
  1304. //GameObject * evacController01 = Commands->Find_Object ( 103380 );
  1305. //GameObject * evacController02 = Commands->Find_Object ( 103381 );
  1306. //if (evacController01 != NULL)
  1307. //{
  1308. // Commands->Send_Custom_Event( obj, evacController01, 0, M01_START_ACTING_JDG, 0 );
  1309. //}
  1310. //if (evacController02 != NULL)
  1311. //{
  1312. // Commands->Send_Custom_Event( obj, evacController02, 0, M01_START_ACTING_JDG, 0 );
  1313. //}
  1314. GameObject * detentionPenCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
  1315. GameObject * detentionPenCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
  1316. GameObject * detentionPenCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
  1317. GameObject * detentionPenGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
  1318. GameObject * detentionPenGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
  1319. GameObject * detentionPenGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
  1320. if (detentionPenCiv01 != NULL)
  1321. {
  1322. Commands->Destroy_Object ( detentionPenCiv01 );
  1323. }
  1324. if (detentionPenCiv02 != NULL)
  1325. {
  1326. Commands->Destroy_Object ( detentionPenCiv02 );
  1327. }
  1328. if (detentionPenCiv03 != NULL)
  1329. {
  1330. Commands->Destroy_Object ( detentionPenCiv03 );
  1331. }
  1332. if (detentionPenGDI01 != NULL)
  1333. {
  1334. Commands->Destroy_Object ( detentionPenGDI01 );
  1335. }
  1336. if (detentionPenGDI02 != NULL)
  1337. {
  1338. Commands->Destroy_Object ( detentionPenGDI02 );
  1339. }
  1340. if (detentionPenGDI03 != NULL)
  1341. {
  1342. Commands->Destroy_Object ( detentionPenGDI03 );
  1343. }
  1344. Vector3 newPosition (51.023f, -35.918f, 0.246f);
  1345. Commands->Set_Position ( STAR, newPosition );
  1346. Commands->Set_Is_Rendered( obj, false );
  1347. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  1348. Commands->Attach_Script(controller1, "Test_Cinematic", "X1Z_Finale.txt");
  1349. Commands->Send_Custom_Event( obj, obj, 0, M01_END_MISSION_PASS_JDG, 20 );
  1350. }
  1351. }
  1352. }
  1353. break;
  1354. case M01_END_MISSION_PASS_JDG://see if any primary objectives are active
  1355. {
  1356. GameObject * propagandaController = Commands->Find_Object ( 103099 );
  1357. if (propagandaController != NULL)
  1358. {
  1359. Commands->Send_Custom_Event( obj, propagandaController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  1360. }
  1361. Commands->Mission_Complete ( true );
  1362. }
  1363. break;
  1364. case M01_SPAWN_WHACK_A_MOLE_GUY_JDG:
  1365. {
  1366. GameObject * m01_whack_a_mole_guy = Commands->Create_Object ( "Nod_MiniGunner_1Off", Vector3(-198.088f, 525.828f, 10.035f) );
  1367. Commands->Attach_Script(m01_whack_a_mole_guy, "M01_Whack_A_Mole_Minigunner_JDG", "");
  1368. m01_whack_a_mole_guy_ID = Commands->Get_ID ( m01_whack_a_mole_guy );
  1369. }
  1370. break;
  1371. case M01_CHANGE_WHACK_A_MOLE_GUY_JDG:
  1372. {
  1373. GameObject * whackAmole = Commands->Find_Object ( m01_whack_a_mole_guy_ID );
  1374. if (whackAmole != NULL)
  1375. {
  1376. Commands->Send_Custom_Event( obj, whackAmole, 0, M01_CHANGE_WHACK_A_MOLE_GUY_JDG, 0 );
  1377. }
  1378. }
  1379. break;
  1380. case M01_HON_SPAWNS_MINIGUNNER_JDG:
  1381. {
  1382. if (hand_of_nod_state != DESTROYED)
  1383. {
  1384. m01_HON_SpawnRate = 21;
  1385. if (m01_hon_total_spawners_tally <= 6)
  1386. {
  1387. if ((m01_hon_spawned_guy_01_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
  1388. {
  1389. GameObject * m01_hon_spawned_guy_01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-212.6f, 541.1f, 4));
  1390. Commands->Attach_Script(m01_hon_spawned_guy_01, "M01_HON_Easy_Spawned_Guy_01_JDG", "");
  1391. m01_hon_spawned_guy_01_ID = Commands->Get_ID ( m01_hon_spawned_guy_01 );
  1392. m01_hon_spawned_guy_01_alive = true;
  1393. m01_hon_spawners_tally++;
  1394. m01_hon_total_spawners_tally++;
  1395. }
  1396. else if ((m01_hon_spawned_guy_02_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
  1397. {
  1398. GameObject * m01_hon_spawned_guy_02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-217.2f, 540.2f, 4) );
  1399. Commands->Attach_Script(m01_hon_spawned_guy_02, "M01_HON_Easy_Spawned_Guy_02_JDG", "");
  1400. m01_hon_spawned_guy_02_ID = Commands->Get_ID ( m01_hon_spawned_guy_02 );
  1401. m01_hon_spawned_guy_02_alive = true;
  1402. m01_hon_spawners_tally++;
  1403. m01_hon_total_spawners_tally++;
  1404. }
  1405. else if ((m01_hon_spawned_guy_03_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
  1406. {
  1407. GameObject * m01_hon_spawned_guy_03 = Commands->Create_Object ( "Nod_FlameThrower_0", Vector3(-217.6f, 533.6f, 4));
  1408. Commands->Attach_Script(m01_hon_spawned_guy_03, "M01_HON_Easy_Spawned_Guy_03_JDG", "");
  1409. m01_hon_spawned_guy_03_ID = Commands->Get_ID ( m01_hon_spawned_guy_03 );
  1410. m01_hon_spawned_guy_03_alive = true;
  1411. m01_hon_spawners_tally++;
  1412. m01_hon_total_spawners_tally++;
  1413. }
  1414. }
  1415. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNS_MINIGUNNER_JDG, m01_HON_SpawnRate );
  1416. }
  1417. }
  1418. break;
  1419. case M01_HON_SPAWNER_IN_POSITION_JDG:
  1420. {
  1421. if (m01_hon_spawners_tally == 3)
  1422. {
  1423. GameObject * honSpawn01 = Commands->Find_Object ( m01_hon_spawned_guy_01_ID );
  1424. if (honSpawn01 != NULL)
  1425. {
  1426. Commands->Send_Custom_Event( obj, honSpawn01, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
  1427. m01_hon_spawned_guy_01_alive = false;
  1428. m01_hon_spawned_guy_01_ID = NULL;
  1429. }
  1430. GameObject * honSpawn02 = Commands->Find_Object ( m01_hon_spawned_guy_02_ID );
  1431. if (honSpawn02 != NULL)
  1432. {
  1433. Commands->Send_Custom_Event( obj, honSpawn02, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
  1434. m01_hon_spawned_guy_02_alive = false;
  1435. m01_hon_spawned_guy_02_ID = NULL;
  1436. }
  1437. GameObject * honSpawn03 = Commands->Find_Object ( m01_hon_spawned_guy_03_ID );
  1438. if (honSpawn03 != NULL)
  1439. {
  1440. Commands->Send_Custom_Event( obj, honSpawn03, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
  1441. m01_hon_spawned_guy_03_alive = false;
  1442. m01_hon_spawned_guy_03_ID = NULL;
  1443. }
  1444. m01_hon_spawners_tally = 0;
  1445. }
  1446. }
  1447. break;
  1448. case M01_HON_SPAWNER_01_IS_DEAD_JDG:
  1449. {
  1450. m01_hon_spawned_guy_01_alive = false;
  1451. m01_hon_spawners_tally--;
  1452. }
  1453. break;
  1454. case M01_HON_SPAWNER_02_IS_DEAD_JDG:
  1455. {
  1456. m01_hon_spawned_guy_02_alive = false;
  1457. m01_hon_spawners_tally--;
  1458. }
  1459. break;
  1460. case M01_HON_SPAWNER_03_IS_DEAD_JDG:
  1461. {
  1462. m01_hon_spawned_guy_03_alive = false;
  1463. m01_hon_spawners_tally--;
  1464. }
  1465. break;
  1466. case M01_HON_SPAWNER_IS_DEAD_JDG:
  1467. {
  1468. m01_hon_total_spawners_tally--;
  1469. }
  1470. break;
  1471. case M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG:
  1472. {
  1473. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  1474. if (loveshackNun != NULL && (church_guard_is_dead != true))
  1475. {
  1476. if (loveshack_conv_playing == false)
  1477. {
  1478. loveshack_conv_playing = true;
  1479. loveshack_conv = Commands->Create_Conversation( "M01_Locke_ChurchReminder_Conversation", 45, 1000, true);
  1480. Commands->Join_Conversation( NULL, loveshack_conv, false, false );
  1481. //Commands->Join_Conversation( STAR, loveshack_conv, false, false );
  1482. Commands->Start_Conversation( loveshack_conv, loveshack_conv );
  1483. Commands->Monitor_Conversation( obj, loveshack_conv );
  1484. }
  1485. }
  1486. }
  1487. break;
  1488. case M01_CUE_PRIEST_CONVERSATION_JDG:
  1489. {
  1490. GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  1491. if (priest != NULL && (loveshack_guard_is_dead != true))
  1492. {
  1493. if (priest_conv_playing == false)
  1494. {
  1495. priest_conv_playing = true;
  1496. priest_conv = Commands->Create_Conversation( "M01_PriestReminder_Conversation", 100, 1000, false);
  1497. Commands->Join_Conversation( priest, priest_conv, false, true, true );
  1498. Commands->Join_Conversation( STAR, priest_conv, false, false, false );
  1499. Commands->Start_Conversation( priest_conv, priest_conv );
  1500. Commands->Monitor_Conversation( obj, priest_conv );
  1501. }
  1502. }
  1503. }
  1504. break;
  1505. case M01_CUE_INTERIOR_NUN_CONVERSATION_JDG:
  1506. {
  1507. GameObject * interiorNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  1508. if (interiorNun != NULL && (loveshack_guard_is_dead != true))
  1509. {
  1510. if (interior_nun_conv_playing == false)
  1511. {
  1512. interior_nun_conv_playing = true;
  1513. interior_nun_conv = Commands->Create_Conversation( "M01_Interior_Nun_Conversation", 100, 1000, false);
  1514. Commands->Join_Conversation( interiorNun, interior_nun_conv, false, true, true );
  1515. Commands->Join_Conversation( STAR, interior_nun_conv, false, false, false);
  1516. Commands->Start_Conversation( interior_nun_conv, interior_nun_conv);
  1517. Commands->Monitor_Conversation( obj, interior_nun_conv );
  1518. }
  1519. }
  1520. }
  1521. break;
  1522. case M01_TURRET_HAS_BEEN_DESTROYED_JDG:
  1523. {
  1524. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  1525. if (turret01 == NULL)
  1526. {
  1527. turret_01_is_dead = true;
  1528. }
  1529. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  1530. if (turret02 == NULL)
  1531. {
  1532. turret_02_is_dead = true;
  1533. }
  1534. if ((turret_01_is_dead == true) && (turret_02_is_dead == true) )
  1535. {
  1536. Commands->Send_Custom_Event( obj, obj, 0, M01_END_TURRETS_OBJECTIVE_PASS_JDG, 0 );
  1537. }
  1538. }
  1539. break;
  1540. case M01_SPAWN_THE_MEDIUM_TANK_JDG:
  1541. {
  1542. if (medium_tank_spawned == false)
  1543. {
  1544. //Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
  1545. medium_tank_spawned = true;
  1546. //GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-85.808f, 125.455f, 3.927f));
  1547. //Commands->Set_Facing ( controller1, 180 );
  1548. //Commands->Attach_Script(controller1, "Test_Cinematic", "X1I_GDI_Drop_MediumTank.txt");
  1549. //GameObject *controller2 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  1550. //Commands->Attach_Script(controller2, "Test_Cinematic", "X1D_Hover_MTank.txt");
  1551. }
  1552. }
  1553. break;
  1554. case M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG:
  1555. {
  1556. GameObject * barnCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
  1557. if (barnCommander != NULL )
  1558. {
  1559. Commands->Add_Objective( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_01, NULL, IDS_Enc_Obj_Secondary_M01_01 );
  1560. Commands->Set_Obj_Radar_Blip_Shape ( barnCommander, RADAR_BLIP_SHAPE_OBJECTIVE ); // Set to -1 to reset default
  1561. Commands->Set_Obj_Radar_Blip_Color ( barnCommander, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1562. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1563. if (pogController != NULL)
  1564. {
  1565. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, 0 );
  1566. }
  1567. if (firstNodCommanderKilled == true)
  1568. {
  1569. Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG, 3 );
  1570. }
  1571. }
  1572. }
  1573. break;
  1574. case M01_PLAYER_APPROACHING_BARN_AREA_JDG:
  1575. {
  1576. if (first_time_at_barn == true)
  1577. {
  1578. first_time_at_barn = false;
  1579. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  1580. if (turret01 != NULL)
  1581. {
  1582. Commands->Send_Custom_Event( obj, turret01, 0, M01_START_ACTING_JDG, 0 );
  1583. }
  1584. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  1585. if (turret02 != NULL)
  1586. {
  1587. Commands->Send_Custom_Event( obj, turret02, 0, M01_START_ACTING_JDG, 0 );
  1588. }
  1589. GameObject * turretGunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  1590. if (turretGunboat != NULL)
  1591. {
  1592. Commands->Send_Custom_Event( obj, turretGunboat, 0, M01_START_ACTING_JDG, 0 );
  1593. }
  1594. GameObject * turretEngineer = Commands->Find_Object ( M01_TURRETBEACH_ENGINEER_ID );
  1595. if (turretEngineer != NULL)
  1596. {
  1597. Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_START_ACTING_JDG, 0 );
  1598. }
  1599. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_TURRETS_OBJECTIVE_JDG, 0 );
  1600. GameObject * barnAreaCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_02_JDG );
  1601. if (barnAreaCommander != NULL)
  1602. {
  1603. Commands->Send_Custom_Event( obj, barnAreaCommander, 0, M01_START_ACTING_JDG, 5 );
  1604. }
  1605. //Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CHINOOK_JDG, 30 );
  1606. //Setting new weather values for barn area
  1607. //Commands->Set_Clouds (0.5f, 0.5f, 120);
  1608. Commands->Set_Wind (60, 1.0f, 0.5f, 120);
  1609. Commands->Set_Rain (0.5f, 120, false);
  1610. }
  1611. }
  1612. break;
  1613. case M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG:
  1614. {
  1615. GameObject * tailgunCommander = Commands->Find_Object ( M01_TAILGUNAREA_NOD_COMMANDER_JDG);
  1616. if (tailgunCommander != NULL)
  1617. {
  1618. Commands->Send_Custom_Event( obj, tailgunCommander, 0, M01_START_ACTING_JDG, 8 );
  1619. }
  1620. GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID);
  1621. if (artilleryController != NULL)
  1622. {
  1623. Commands->Send_Custom_Event( obj, artilleryController, 0, M01_GOTO_IDLE_JDG, 0 );
  1624. }
  1625. GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG);
  1626. if (lightTank != NULL)
  1627. {
  1628. Commands->Send_Custom_Event( obj, lightTank, 0, M01_START_ACTING_JDG, 0 );
  1629. }
  1630. }
  1631. break;
  1632. case M01_PLAYER_APPROACHING_GDI_BASE_AREA_JDG:
  1633. {
  1634. GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID);
  1635. if (artilleryController != NULL)
  1636. {
  1637. Commands->Send_Custom_Event( obj, artilleryController, 0, M01_START_ACTING_JDG, 0 );
  1638. }
  1639. }
  1640. break;
  1641. case M01_ANNOUNCE_TURRETS_OBJECTIVE_JDG:
  1642. {
  1643. turrets_conv = Commands->Create_Conversation( "M01_Add_Turrets_Objective", 100, 1000, false);
  1644. Commands->Join_Conversation( NULL, turrets_conv, false, false );
  1645. Commands->Join_Conversation( NULL, turrets_conv, false, false );
  1646. Commands->Start_Conversation( turrets_conv, turrets_conv );
  1647. Commands->Monitor_Conversation( obj, turrets_conv );
  1648. }
  1649. break;
  1650. case M01_ADD_TURRETS_OBJECTIVE_JDG:
  1651. {
  1652. Commands->Add_Objective( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_02, NULL, IDS_Enc_Obj_Secondary_M01_02 );
  1653. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1654. if (pogController != NULL)
  1655. {
  1656. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, 0 );
  1657. }
  1658. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  1659. if (turret01 != NULL)
  1660. {
  1661. Commands->Set_Obj_Radar_Blip_Shape ( turret01, RADAR_BLIP_SHAPE_OBJECTIVE );
  1662. Commands->Set_Obj_Radar_Blip_Color ( turret01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1663. }
  1664. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  1665. if (turret02 != NULL)
  1666. {
  1667. Commands->Set_Obj_Radar_Blip_Shape ( turret02, RADAR_BLIP_SHAPE_OBJECTIVE );
  1668. Commands->Set_Obj_Radar_Blip_Color ( turret02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1669. }
  1670. int c4_conv = Commands->Create_Conversation( "M01_Locke_Sending_C4_Conversation", 100, 1000, false);
  1671. Commands->Join_Conversation( NULL, c4_conv, false, false );
  1672. Commands->Start_Conversation( c4_conv, c4_conv );
  1673. Vector3 airdropPosition (-82.786f, 113.665f, 2.221f);
  1674. GameObject *controller = Commands->Create_Object("Invisible_Object", airdropPosition);
  1675. Commands->Attach_Script(controller, "Test_Cinematic", "X1D_GTower_FlareDrop.txt");
  1676. }
  1677. break;
  1678. case M01_END_TURRETS_OBJECTIVE_FAIL_JDG:
  1679. {
  1680. if (turret_objective_over == false)
  1681. {
  1682. turret_objective_over = true;
  1683. Commands->Set_Objective_Status( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  1684. }
  1685. }
  1686. break;
  1687. case M01_END_TURRETS_OBJECTIVE_PASS_JDG:
  1688. {
  1689. if (turret_objective_over == false)
  1690. {
  1691. turret_objective_over = true;
  1692. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  1693. if (gunboat != NULL)
  1694. {
  1695. Commands->Send_Custom_Event( obj, gunboat, 0, M01_END_TURRETS_OBJECTIVE_PASS_JDG, 0 );
  1696. int turrets_conv_02 = Commands->Create_Conversation( "M01_Remove_Turrets_Objective", 100, 1000, false);
  1697. Commands->Join_Conversation( NULL, turrets_conv_02, false, false );
  1698. Commands->Start_Conversation( turrets_conv_02, 0 );
  1699. Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_TURRETS_OBJECTIVE_JDG, 5 );
  1700. }
  1701. else
  1702. {
  1703. //turrets_hummVee_conv = Commands->Create_Conversation( "M01_Locke_GiveHummVee_Conversation", 100, 1000, false);
  1704. //Commands->Join_Conversation( NULL, turrets_hummVee_conv, false, false );
  1705. //Commands->Join_Conversation( STAR, turrets_hummVee_conv, false, false );
  1706. //Commands->Start_Conversation( turrets_hummVee_conv, turrets_hummVee_conv );
  1707. //Commands->Monitor_Conversation( obj, turrets_hummVee_conv );
  1708. Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_TURRETS_OBJECTIVE_JDG, 5 );
  1709. }
  1710. }
  1711. }
  1712. break;
  1713. case M01_PASS_TURRETS_OBJECTIVE_JDG:
  1714. {
  1715. Commands->Set_Objective_Status( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1716. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_THE_MEDIUM_TANK_JDG, 0 );
  1717. }
  1718. break;
  1719. /*case M01_START_BARN_OBJECTIVE_JDG:
  1720. {
  1721. Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_BARN_OBJECTIVE_JDG, 0 );
  1722. }
  1723. break;
  1724. case M01_ANNOUNCE_BARN_OBJECTIVE_JDG:
  1725. {
  1726. if (barn_announcement_active == false)
  1727. {
  1728. int barn_conv = Commands->Create_Conversation( "M01_Add_Barn_Objective", 100, 1000, false);
  1729. Commands->Join_Conversation( NULL, barn_conv, false, false );
  1730. Commands->Join_Conversation( STAR, barn_conv, false, false );
  1731. Commands->Start_Conversation( barn_conv, 0 );
  1732. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_BARN_OBJECTIVE_JDG, 6 );
  1733. barn_announcement_active = true;
  1734. GameObject * barnObjectiveZone = Commands->Find_Object ( M01_BARN_OBJECTIVE_ZONE_ID );
  1735. if (barnObjectiveZone != NULL)
  1736. {
  1737. Commands->Destroy_Object ( barnObjectiveZone );
  1738. }
  1739. }
  1740. }
  1741. break;*/
  1742. /*case M01_ADD_BARN_OBJECTIVE_JDG:
  1743. {
  1744. if (barn_objective_active == false)
  1745. {
  1746. barn_objective_active = true;
  1747. Commands->Add_Objective( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_03, NULL, IDS_Enc_Obj_Secondary_M01_03 );
  1748. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1749. if (pogController != NULL)
  1750. {
  1751. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_BARN_OBJECTIVE_JDG, 0 );
  1752. }
  1753. GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  1754. if (barnPrisoner01 != NULL)
  1755. {
  1756. Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner01, RADAR_BLIP_SHAPE_OBJECTIVE );
  1757. Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1758. }
  1759. GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  1760. if (barnPrisoner02 != NULL)
  1761. {
  1762. Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner02, RADAR_BLIP_SHAPE_OBJECTIVE );
  1763. Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1764. }
  1765. GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  1766. if (barnPrisoner03 != NULL)
  1767. {
  1768. Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner03, RADAR_BLIP_SHAPE_OBJECTIVE );
  1769. Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner03, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1770. }
  1771. }
  1772. }
  1773. break;*/
  1774. case M01_END_BARN_OBJECTIVE_JDG:
  1775. {
  1776. if (barn_objective_failed != true && civs_scattered == false)
  1777. {
  1778. civs_scattered = true;
  1779. //Commands->Send_Custom_Event( obj, obj, 0, M01_CHANGE_BARN_OBJECTIVE_JDG, 5 );
  1780. GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  1781. if (barnPrisoner01 != NULL)
  1782. {
  1783. //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner01, RADAR_BLIP_SHAPE_OBJECTIVE );
  1784. //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1785. Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  1786. }
  1787. GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  1788. if (barnPrisoner02 != NULL)
  1789. {
  1790. //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner02, RADAR_BLIP_SHAPE_OBJECTIVE );
  1791. //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1792. Commands->Send_Custom_Event( obj, barnPrisoner02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  1793. }
  1794. GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  1795. if (barnPrisoner03 != NULL)
  1796. {
  1797. //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner03, RADAR_BLIP_SHAPE_OBJECTIVE );
  1798. //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner03, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
  1799. Commands->Send_Custom_Event( obj, barnPrisoner03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  1800. }
  1801. }
  1802. }
  1803. break;
  1804. /*case M01_CHANGE_BARN_OBJECTIVE_JDG:
  1805. {
  1806. if (barn_objective_failed != true)
  1807. {
  1808. int roundupcivs_conv = Commands->Create_Conversation( "M01_Add_Barn_Roundup_Objective", 100, 1000, false);
  1809. Commands->Join_Conversation( NULL, roundupcivs_conv, false, false );
  1810. Commands->Start_Conversation( roundupcivs_conv, roundupcivs_conv );
  1811. Commands->Set_Objective_Status( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  1812. Commands->Add_Objective( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_04, NULL, IDS_Enc_Obj_Secondary_M01_04 );
  1813. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  1814. if (pogController != NULL)
  1815. {
  1816. Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_BARN_ROUNDUP_OBJECTIVE_JGD, 0 );
  1817. }
  1818. }
  1819. }
  1820. break;*/
  1821. case M01_END_BARN_ROUNDUP_OBJECTIVE_JDG:
  1822. {
  1823. if (barn_objective_ended == false)
  1824. {
  1825. barn_objective_ended = true;
  1826. /*if (barn_objective_failed == true)
  1827. {
  1828. Commands->Set_Objective_Status( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  1829. Commands->Set_Objective_Status( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_STATUS_FAILED );
  1830. barnfailed_conv = Commands->Create_Conversation( "M01_Locke_3CivsDead_Conversation", 100, 1000, false);
  1831. Commands->Join_Conversation( NULL, barnfailed_conv, false, false );
  1832. Commands->Join_Conversation( STAR, barnfailed_conv, false, false );
  1833. Commands->Start_Conversation( barnfailed_conv, barnfailed_conv );
  1834. Commands->Monitor_Conversation( obj, barnfailed_conv );
  1835. }*/
  1836. if (barn_objective_failed != true)
  1837. {
  1838. //Commands->Set_Objective_Status( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_STATUS_ACCOMPLISHED );
  1839. //barnfailed_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
  1840. //Commands->Join_Conversation( NULL, barnfailed_conv, false, false );
  1841. //Commands->Start_Conversation( barnfailed_conv, barnfailed_conv );
  1842. //Commands->Monitor_Conversation( obj, barnfailed_conv );
  1843. }
  1844. }
  1845. }
  1846. break;
  1847. case M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG:
  1848. {
  1849. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  1850. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  1851. if ( (turret01 != NULL) || (turret02 != NULL) )
  1852. {
  1853. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
  1854. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-93.689f, 52.850f, -1.95f));
  1855. Commands->Set_Facing(chinook_obj1, 60.0f);
  1856. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_Nod_TurretBeach_TroopDrop.txt");
  1857. }
  1858. }
  1859. break;
  1860. case M01_CUE_BILLYS_CONVERSATION_JDG:
  1861. {
  1862. GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  1863. if ( barnPrisoner02 != NULL && barn_prisoner_02_is_dead != true) //this is billy
  1864. {
  1865. billy_conv = Commands->Create_Conversation( "M01_Billys_Conversation", 100, 1000, true);
  1866. Commands->Join_Conversation( barnPrisoner02, billy_conv, true, true );
  1867. Commands->Join_Conversation( STAR, billy_conv, false, true, true );
  1868. Commands->Join_Conversation( NULL, billy_conv, false, false );
  1869. Commands->Start_Conversation( billy_conv, billy_conv );
  1870. Commands->Monitor_Conversation( obj, billy_conv );
  1871. }
  1872. }
  1873. break;
  1874. case M01_CUE_BABUSHKA_CONVERSATION_JDG:
  1875. {
  1876. GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  1877. GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  1878. if ( barnPrisoner01 != NULL && barn_prisoner_01_is_dead != true) //this is babushka
  1879. {
  1880. babushka_conv = Commands->Create_Conversation( "M01_Barn_Babushka_Conversation", 100, 1000, true);
  1881. Commands->Join_Conversation( barnPrisoner01, babushka_conv, true, true, true );
  1882. Commands->Join_Conversation( STAR, babushka_conv, false, false, false );
  1883. Commands->Join_Conversation( NULL, babushka_conv, false, false, false );
  1884. Commands->Start_Conversation( babushka_conv, babushka_conv );
  1885. Commands->Monitor_Conversation( obj, babushka_conv );
  1886. Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  1887. if ( barnPrisoner03 != NULL && barn_prisoner_03_is_dead != true) //this is babushka
  1888. {
  1889. Commands->Send_Custom_Event( obj, barnPrisoner03, 0, M01_MODIFY_YOUR_ACTION_11_JDG, 0 );
  1890. }
  1891. }
  1892. else if ( barnPrisoner03 != NULL && barn_prisoner_03_is_dead != true) //this is babushka
  1893. {
  1894. civ3_conv = Commands->Create_Conversation( "M01_Civ03_Conversation", 100, 1000, true);
  1895. Commands->Join_Conversation( barnPrisoner03, civ3_conv, true, true, true );
  1896. Commands->Join_Conversation( STAR, civ3_conv, false, false, false );
  1897. Commands->Join_Conversation( NULL, civ3_conv, false, true, true );
  1898. Commands->Start_Conversation( civ3_conv, civ3_conv );
  1899. Commands->Monitor_Conversation( obj, civ3_conv );
  1900. }
  1901. }
  1902. break;
  1903. case M01_BARN_GUARD_IS_DEAD_JDG:
  1904. {
  1905. dead_barn_guard_tally++;
  1906. if (dead_barn_guard_tally >= 4)
  1907. {
  1908. Commands->Send_Custom_Event( obj, obj, 0, M01_END_BARN_OBJECTIVE_JDG, 0 );
  1909. }
  1910. }
  1911. break;
  1912. case M01_CIVILIAN_KILLED_JDG:
  1913. {
  1914. /*if (sender == Commands->Find_Object ( M01_BARN_PRISONER_01_ID ))//this is babushka
  1915. {
  1916. barn_prisoner_01_is_dead = true;
  1917. dead_barn_prisoner_tally++;
  1918. }
  1919. else if (sender == Commands->Find_Object ( M01_BARN_PRISONER_02_ID ))//this is billy
  1920. {
  1921. barn_prisoner_02_is_dead = true;
  1922. dead_barn_prisoner_tally++;
  1923. }
  1924. else if (sender == Commands->Find_Object ( M01_BARN_PRISONER_03_ID ))//this is pierre
  1925. {
  1926. barn_prisoner_03_is_dead = true;
  1927. dead_barn_prisoner_tally++;
  1928. }
  1929. if (dead_barn_prisoner_tally > 2)
  1930. {
  1931. barn_objective_failed = true;
  1932. Commands->Send_Custom_Event( obj, obj, 0, M01_END_BARN_ROUNDUP_OBJECTIVE_JDG, 0 );
  1933. }*/
  1934. }
  1935. break;
  1936. case M01_KILL_THE_GDI_POWER_PLANT_JDG:
  1937. {
  1938. Commands->Debug_Message ( "***************************Starting the GDI base encounter\n" );
  1939. if (missionStart == true)
  1940. {
  1941. missionStart = false;
  1942. }
  1943. //GameObject * crashed_orca = Commands->Find_Object ( 103121 );
  1944. //if (crashed_orca != NULL)
  1945. //{
  1946. // Commands->Send_Custom_Event( obj, crashed_orca, 0, M01_START_ACTING_JDG, 0 );
  1947. //}
  1948. }
  1949. break;
  1950. case M01_DO_DAMAGE_CHECK_JDG://a building has been damaged--take appropriate action
  1951. {
  1952. if (sender == Commands->Find_Object(M01_HAND_OF_NOD_JDG))//hand of nod under attack--refinery okay--send engineer
  1953. {
  1954. GameObject * honEngineer = Commands->Find_Object ( M01_HON_REPAIR_ENGINEER_ID );
  1955. if (honEngineer != NULL)
  1956. {
  1957. Commands->Send_Custom_Event( obj, honEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  1958. }
  1959. }
  1960. else if (sender == Commands->Find_Object(M01_COMM_CENTER_JDG))
  1961. {
  1962. GameObject * commEngineer = Commands->Find_Object ( M01_COMM_CENTER_ENGINEER_ID );
  1963. if (commEngineer != NULL)
  1964. {
  1965. Commands->Send_Custom_Event( obj, commEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  1966. }
  1967. }
  1968. }
  1969. break;
  1970. case M01_CUE_KANE_AND_NUMBER2_CONVERSATION_JDG://player is in comm center--cue kane encounter
  1971. {
  1972. GameObject * holograph = Commands->Find_Object ( 157978 );
  1973. if (holograph != NULL)
  1974. {
  1975. GameObject * kane = Commands->Create_Object_At_Bone ( holograph, "Nod_Kane_HologramHead", "KANEBONE" );
  1976. Commands->Attach_To_Object_Bone( kane, holograph, "KANEBONE" );
  1977. Commands->Set_Loiters_Allowed( kane, false );
  1978. kane_ID = Commands->Get_ID ( kane );
  1979. GameObject * commBaseCommander = Commands->Find_Object ( M01_COMMCENTER_BASE_COMMANDER_JDG );
  1980. if (commBaseCommander != NULL)
  1981. {
  1982. kane_and_no2_conv01_active = true;
  1983. kane_and_no2_conv01 = Commands->Create_Conversation( "M01_Kane_and_Number02_Conversation_01", 100, 1000, true);
  1984. Commands->Join_Conversation( kane, kane_and_no2_conv01, false, true );
  1985. Commands->Join_Conversation( commBaseCommander, kane_and_no2_conv01, false, true );
  1986. Commands->Start_Conversation( kane_and_no2_conv01, kane_and_no2_conv01 );
  1987. }
  1988. }
  1989. }
  1990. break;
  1991. case M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG://player is in comm center war room--cue kane encounter
  1992. {
  1993. if (kane_and_no2_conv01_active == true)
  1994. {
  1995. }
  1996. else if (kane_and_no2_conv02_active == true)
  1997. {
  1998. }
  1999. if (kane_and_havoc_conv_active == false)
  2000. {
  2001. GameObject * kane = Commands->Find_Object ( kane_ID );
  2002. if (kane != NULL)
  2003. {
  2004. kane_and_havoc_conv_active = true;
  2005. kane_and_havoc_conv = Commands->Create_Conversation( "M01_Kane_and_Havoc_Conversation", 100, 1000, false);
  2006. Commands->Join_Conversation( kane, kane_and_havoc_conv, false, true );
  2007. Commands->Join_Conversation( STAR, kane_and_havoc_conv, false, false );
  2008. Commands->Start_Conversation( kane_and_havoc_conv, kane_and_havoc_conv );
  2009. Commands->Monitor_Conversation( obj, kane_and_havoc_conv );
  2010. }
  2011. }
  2012. }
  2013. break;
  2014. case M01_SEND_BARN_CHINOOK_JDG://havoc is in barn area--send reinforcements
  2015. {
  2016. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
  2017. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-87.561f, 114.225f, 1.874f));
  2018. Commands->Set_Facing(chinook_obj1, 0.0f);
  2019. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
  2020. }
  2021. break;
  2022. case M01_SEND_GUARD_TOWER_CHINOOK_JDG://havoc is at GDI guard tower
  2023. {
  2024. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );
  2025. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(12.703f, 84.163f, 1.898f));
  2026. Commands->Set_Facing(chinook_obj1, -130.0f);
  2027. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
  2028. }
  2029. break;
  2030. case M01_SEND_TAILGUN_CHINOOK_JDG://havoc is in tailgun area--send reinforcementsM01_SEND_CHURCH_CHINOOK_JDG
  2031. {
  2032. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
  2033. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-7.831f, 292.034f, 2.665f));
  2034. Commands->Set_Facing(chinook_obj1, 0.0f);
  2035. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
  2036. }
  2037. break;
  2038. case M01_SEND_CHURCH_CHINOOK_JDG://havoc is in church area--send reinforcements
  2039. {
  2040. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
  2041. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-91.898f, 424.178f, 20.761f));
  2042. Commands->Set_Facing(chinook_obj1, 0.0f);
  2043. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook.txt");
  2044. }
  2045. break;
  2046. case M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG://havoc has found one of the barn civs--send in the chinook
  2047. {
  2048. GameObject * barnEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  2049. if (barnEvacController != NULL)
  2050. {
  2051. Commands->Send_Custom_Event( obj, barnEvacController, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  2052. }
  2053. }
  2054. break;
  2055. }
  2056. }
  2057. }
  2058. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2059. {
  2060. switch (complete_reason)
  2061. {
  2062. case ACTION_COMPLETE_CONVERSATION_ENDED:
  2063. {
  2064. if (action_id == billy_conv)
  2065. {
  2066. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  2067. }
  2068. else if (action_id == babushka_conv)
  2069. {
  2070. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  2071. GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  2072. if ( barnPrisoner01 != NULL && barn_prisoner_01_is_dead != true) //this is babushka
  2073. {
  2074. Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
  2075. }//int
  2076. }
  2077. else if (action_id == civ3_conv)
  2078. {
  2079. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  2080. }
  2081. else if (action_id == turrets_conv)
  2082. {
  2083. Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_TURRETS_OBJECTIVE_JDG, 0 );
  2084. }
  2085. //else if (action_id == turrets_hummVee_conv) //send in the humm vee
  2086. //{
  2087. //GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-96.744f, 138.498f, 1));
  2088. //Commands->Set_Facing(chinook_obj1, 60.0f);
  2089. //Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "XG_M01_HumveeDrop.txt");
  2090. //}
  2091. else if (action_id == barnfailed_conv)
  2092. {
  2093. //int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
  2094. //Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
  2095. //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
  2096. //Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
  2097. }
  2098. else if (action_id == kane_and_no2_conv01)
  2099. {
  2100. kane_and_no2_conv01_active = false;
  2101. GameObject * securityCamera = Commands->Find_Object ( M01_COMMCENTER_CEILING_CAMERA_JDG);
  2102. if (securityCamera != NULL)
  2103. {
  2104. Commands->Send_Custom_Event( obj, securityCamera, 0, M01_START_ATTACKING_01_JDG, 0 );
  2105. }
  2106. }
  2107. else if (action_id == kane_and_no2_conv02)
  2108. {
  2109. kane_and_no2_conv02_active = false;
  2110. }
  2111. else if (action_id == kane_and_havoc_conv)
  2112. {
  2113. GameObject * kane = Commands->Find_Object ( kane_ID);
  2114. if (kane != NULL)
  2115. {
  2116. Commands->Destroy_Object ( kane );
  2117. }
  2118. }
  2119. else if (action_id == unlocked_gate_conv) //
  2120. {
  2121. Vector3 radarMarker (-310.727f, 571.824f, 28.484f);
  2122. Commands->Add_Objective( M01_OPEN_THE_GATE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_03, NULL, IDS_Enc_Obj_Primary_M01_03 );
  2123. Commands->Set_Objective_Radar_Blip( M01_OPEN_THE_GATE_JDG, radarMarker );
  2124. Commands->Set_Objective_HUD_Info_Position( M01_OPEN_THE_GATE_JDG, 95, "POG_M01_1_03.tga", IDS_POG_OPEN, radarMarker );
  2125. //Vector3 green (0,1,0);
  2126. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_03, TEXT_COLOR_OBJECTIVE_PRIMARY );
  2127. }
  2128. else if (action_id == endMission_conv)
  2129. {
  2130. Commands->Create_2D_Sound ( "00-N048E" );//eva primary accomplished
  2131. Commands->Send_Custom_Event( obj, obj, 0, M01_END_MISSION_PASS_JDG, 3 );
  2132. }
  2133. else if (action_id == loveshack_conv)
  2134. {
  2135. loveshack_conv_playing = false;
  2136. }
  2137. else if (action_id == priest_conv)
  2138. {
  2139. priest_conv_playing = false;
  2140. }
  2141. else if (action_id == interior_nun_conv)
  2142. {
  2143. interior_nun_conv_playing = false;
  2144. }
  2145. }
  2146. break;
  2147. }
  2148. }
  2149. };
  2150. DECLARE_SCRIPT(M01_HON_Medlab_DropOff_Guy_JDG, "")
  2151. {
  2152. void Created( GameObject * obj )
  2153. {
  2154. Commands->Innate_Disable(obj);
  2155. Commands->Enable_Hibernation( obj, false );
  2156. }
  2157. void Animation_Complete(GameObject * obj, const char *anim)
  2158. {
  2159. if (stricmp(anim, "S_A_Human.H_A_TroopDrop") == 0)
  2160. {
  2161. ActionParamsStruct params;
  2162. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  2163. params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  2164. params.WaypathID = 125265;
  2165. Commands->Action_Goto(obj, params);
  2166. }
  2167. }
  2168. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2169. {
  2170. ActionParamsStruct params;
  2171. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  2172. {
  2173. Commands->Destroy_Object ( obj );
  2174. }
  2175. else
  2176. {
  2177. ActionParamsStruct params;
  2178. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  2179. params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  2180. params.WaypathID = 125265;
  2181. Commands->Action_Goto(obj, params);
  2182. }
  2183. }
  2184. };
  2185. DECLARE_SCRIPT(M01_Hand_of_Nod_Building_Script_JDG, "")
  2186. {
  2187. int memorial_sound;
  2188. REGISTER_VARIABLES()
  2189. {
  2190. SAVE_VARIABLE(memorial_sound, 1);
  2191. }
  2192. void Created( GameObject * obj )
  2193. {
  2194. Vector3 memorialSpot (-195.053f, 533.737f, 10.953f);
  2195. memorial_sound = Commands->Create_Sound ( "m01eval_dsgn0254r1ncxk_snd", memorialSpot, obj );
  2196. }
  2197. void Killed( GameObject * obj, GameObject * killer )
  2198. {
  2199. Commands->Stop_Sound ( memorial_sound, true );
  2200. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );
  2201. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );
  2202. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103371 ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );//this is the final escort zone
  2203. Commands->Create_Object ( "POW_Medal_Armor", Vector3 (-180.312f, 541.400f, 3.518f) );
  2204. Commands->Create_Object ( "POW_Medal_Health", Vector3 (-178.349f, 541.471f, 3.518f) );
  2205. }
  2206. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2207. {
  2208. if (obj )
  2209. {
  2210. GameObject * myEngineer = Commands->Find_Object ( M01_HON_REPAIR_ENGINEER_ID );
  2211. if (myEngineer != NULL)
  2212. {
  2213. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_DAMAGE_CHECK_JDG, 0 );
  2214. if (damager == myEngineer)
  2215. {
  2216. float MyMaxHealth = Commands->Get_Max_Health ( obj );
  2217. float MyMaxShield = Commands->Get_Max_Shield_Strength ( obj );
  2218. Commands->Set_Health ( obj, MyMaxHealth );
  2219. Commands->Set_Shield_Strength ( obj, MyMaxShield );
  2220. }
  2221. }
  2222. }
  2223. }
  2224. };
  2225. DECLARE_SCRIPT(M01_Flyover_Generic_Script_JDG, "")
  2226. {
  2227. void Created( GameObject * obj )
  2228. {
  2229. Commands->Disable_Physical_Collisions ( obj );
  2230. Commands->Enable_Hibernation( obj, false );
  2231. Commands->Enable_Cinematic_Freeze( obj, false );
  2232. float MyMaxHealth = Commands->Get_Max_Health ( obj );
  2233. float fudgeFactor = Commands->Get_Random ( .05f, 1.0f);
  2234. float myNewHealth = MyMaxHealth * fudgeFactor;
  2235. float MyMaxShield = Commands->Get_Max_Shield_Strength ( obj );
  2236. float fudgeFactor2 = Commands->Get_Random ( .05f, 1.0f);
  2237. float myNewShield = MyMaxShield * fudgeFactor2;
  2238. Commands->Set_Health ( obj, myNewHealth );
  2239. Commands->Set_Shield_Strength ( obj, myNewShield );
  2240. }
  2241. };
  2242. DECLARE_SCRIPT(M01_Ambient_Sound_Controller_JDG, "")
  2243. {
  2244. enum
  2245. {
  2246. play_destroyed_building_sound = 101,
  2247. pick_refinery_sound,
  2248. play_refinery_klaxon,
  2249. play_refinery_sound,
  2250. pick_commcenter_sound,
  2251. play_commcenter_klaxon,
  2252. play_commcenter_sound,
  2253. };
  2254. typedef enum {
  2255. ACTIVE,
  2256. DESTROYED,
  2257. } M01_Building_State;
  2258. typedef enum {
  2259. INSIDE_GDI_CON,
  2260. INSIDE_GDI_POWERPLANT,
  2261. INSIDE_HAND_OF_NOD,
  2262. INSIDE_REFINERY,
  2263. INSIDE_COMM_CENTER,
  2264. OUTSIDE,
  2265. } M01_Location;
  2266. M01_Building_State hand_of_nod_state, comm_center_state;
  2267. M01_Location players_location;
  2268. int building_sound;
  2269. int destroyed_building_sound;
  2270. int klaxon;
  2271. int sound;
  2272. bool outside_ambients_playing;
  2273. bool building_ambients_playing;
  2274. bool destroyed_building_ambients_playing;
  2275. REGISTER_VARIABLES()
  2276. {
  2277. SAVE_VARIABLE(hand_of_nod_state, 1);
  2278. SAVE_VARIABLE(comm_center_state, 2);
  2279. SAVE_VARIABLE(players_location, 3);
  2280. SAVE_VARIABLE(building_sound, 4);
  2281. SAVE_VARIABLE(destroyed_building_sound, 5);
  2282. SAVE_VARIABLE(klaxon, 6);
  2283. SAVE_VARIABLE(sound, 7);
  2284. SAVE_VARIABLE(outside_ambients_playing, 8);
  2285. SAVE_VARIABLE(building_ambients_playing, 9);
  2286. SAVE_VARIABLE(destroyed_building_ambients_playing, 10);
  2287. }
  2288. void Created( GameObject * obj )
  2289. {
  2290. Commands->Enable_Hibernation( obj, false );
  2291. hand_of_nod_state = ACTIVE;
  2292. comm_center_state = ACTIVE;
  2293. klaxon = 0;
  2294. sound = 0;
  2295. outside_ambients_playing = false;
  2296. building_ambients_playing = false;
  2297. destroyed_building_ambients_playing = false;
  2298. players_location = OUTSIDE;
  2299. Commands->Send_Custom_Event( obj, obj, 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
  2300. }
  2301. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2302. {
  2303. if ((param == M01_TURN_ON_OUTSIDE_AMBIENTS_JDG) && (outside_ambients_playing == false))
  2304. {
  2305. players_location = OUTSIDE;
  2306. outside_ambients_playing = true;
  2307. if (building_ambients_playing == true /*&& building_sound != NULL*/)
  2308. {
  2309. Commands->Stop_Sound ( building_sound, true );
  2310. }
  2311. building_ambients_playing = false;
  2312. destroyed_building_ambients_playing = false;
  2313. }
  2314. else if ((param == M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG) && (outside_ambients_playing == true))
  2315. {
  2316. outside_ambients_playing = false;
  2317. }
  2318. else if ((param == M01_HON_HAS_BEEN_DESTROYED_JDG))//Hand of Nod has been destroyed
  2319. {
  2320. hand_of_nod_state = DESTROYED;
  2321. }
  2322. else if ((param == M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG))//Comm Center has been destroyed
  2323. {
  2324. comm_center_state = DESTROYED;
  2325. }
  2326. else if (param == M01_PLAYER_IS_INSIDE_GDI_CON_JDG)
  2327. {
  2328. players_location = INSIDE_GDI_CON;
  2329. }
  2330. else if (param == M01_PLAYER_IS_INSIDE_GDI_POWERPLANT_JDG)
  2331. {
  2332. players_location = INSIDE_GDI_POWERPLANT;
  2333. }
  2334. else if (param == M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG)
  2335. {
  2336. players_location = INSIDE_COMM_CENTER;
  2337. if ((comm_center_state == ACTIVE) && (building_ambients_playing != true) )
  2338. {
  2339. Commands->Debug_Message ( "**********************turning on active Comm Center ambient noise\n" );
  2340. building_sound = Commands->Create_Sound ("CC_Ambient_M01", Vector3 (0,0,0), obj );
  2341. building_ambients_playing = true;
  2342. float delayTimer = Commands->Get_Random ( 5, 10 );
  2343. Commands->Send_Custom_Event( obj, obj, 0, pick_commcenter_sound, delayTimer );
  2344. }
  2345. }
  2346. else if (param == M01_PLAYER_IS_INSIDE_HON_JDG)
  2347. {
  2348. players_location = INSIDE_HAND_OF_NOD;
  2349. if ((hand_of_nod_state == ACTIVE) && (building_ambients_playing != true) )
  2350. {
  2351. building_ambients_playing = true;
  2352. }
  2353. }
  2354. else if ((param == play_commcenter_klaxon) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
  2355. {
  2356. char *klaxonNames[2] = {
  2357. "Klaxon Warning",
  2358. "Klaxon Info"
  2359. };
  2360. char *klaxonName = klaxonNames[klaxon];
  2361. GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
  2362. if ( star != NULL )
  2363. {
  2364. Vector3 playerPosition = Commands->Get_Position ( star );
  2365. float x_factor = Commands->Get_Random(-5,5);
  2366. float y_factor = Commands->Get_Random(-5,5);
  2367. playerPosition.X += x_factor;
  2368. playerPosition.Y += y_factor;
  2369. playerPosition.Z += 3;
  2370. Commands->Create_Sound ( klaxonName, playerPosition, obj );
  2371. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 1.5 );
  2372. }
  2373. }
  2374. else if ((param == play_commcenter_sound) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
  2375. {
  2376. char *sounds[15] = {
  2377. "01-I022E",
  2378. "01-I028E",
  2379. "01-I030E",
  2380. "01-I032E",
  2381. "01-I034E",
  2382. "01-I036E",
  2383. "01-I038E",
  2384. "01-I040E",
  2385. "01-I042E",
  2386. "01-I044E",
  2387. "01-I046E",
  2388. "01-I048E",
  2389. "01-I050E",
  2390. "01-I062E",
  2391. "01-I066E"
  2392. };
  2393. char *soundName = sounds[sound];
  2394. GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
  2395. if ( star != NULL )
  2396. {
  2397. Vector3 playerPosition = Commands->Get_Position ( star );
  2398. float x_factor = Commands->Get_Random(-5,5);
  2399. float y_factor = Commands->Get_Random(-5,5);
  2400. playerPosition.X += x_factor;
  2401. playerPosition.Y += y_factor;
  2402. playerPosition.Z += 3;
  2403. Commands->Create_Sound ( soundName, playerPosition, obj );
  2404. float delayTimer = Commands->Get_Random ( 10, 25 );
  2405. Commands->Send_Custom_Event( obj, obj, 0, pick_commcenter_sound, delayTimer );
  2406. }
  2407. }
  2408. else if ((param == pick_commcenter_sound) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
  2409. {
  2410. float lineNumber = Commands->Get_Random ( 0.5f, 15.5f);
  2411. if ((lineNumber >= 0.5) && (lineNumber < 1.5))
  2412. {
  2413. sound = 0;
  2414. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2415. }
  2416. else if ((lineNumber >= 1.5) && (lineNumber < 2.5))
  2417. {
  2418. sound = 1;
  2419. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2420. }
  2421. else if ((lineNumber >= 2.5) && (lineNumber < 3.5))
  2422. {
  2423. sound = 2;
  2424. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2425. }
  2426. else if ((lineNumber >= 3.5) && (lineNumber < 4.5))
  2427. {
  2428. klaxon = 1;
  2429. sound = 3;
  2430. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2431. }
  2432. else if ((lineNumber >= 4.5) && (lineNumber < 5.5))
  2433. {
  2434. sound = 4;
  2435. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2436. }
  2437. else if ((lineNumber >= 5.5) && (lineNumber < 6.5))
  2438. {
  2439. klaxon = 1;
  2440. sound = 5;
  2441. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2442. }
  2443. else if ((lineNumber >= 6.5) && (lineNumber < 7.5))
  2444. {
  2445. klaxon = 1;
  2446. sound = 6;
  2447. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2448. }
  2449. else if ((lineNumber >= 7.5) && (lineNumber < 8.5))
  2450. {
  2451. klaxon = 0;
  2452. sound = 7;
  2453. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2454. }
  2455. else if ((lineNumber >= 8.5) && (lineNumber < 9.5))
  2456. {
  2457. sound = 8;
  2458. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2459. }
  2460. else if ((lineNumber >= 9.5) && (lineNumber < 10.5))
  2461. {
  2462. klaxon = 0;
  2463. sound = 9;
  2464. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2465. }
  2466. else if ((lineNumber >= 10.5) && (lineNumber < 11.5))
  2467. {
  2468. klaxon = 0;
  2469. sound = 10;
  2470. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2471. }
  2472. else if ((lineNumber >= 11.5) && (lineNumber < 12.5))
  2473. {
  2474. klaxon = 1;
  2475. sound = 11;
  2476. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
  2477. }
  2478. else if ((lineNumber >= 12.5) && (lineNumber < 13.5))
  2479. {
  2480. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2481. }
  2482. else if ((lineNumber >= 13.5) && (lineNumber < 14.5))
  2483. {
  2484. sound = 13;
  2485. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2486. }
  2487. else
  2488. {
  2489. sound = 14;
  2490. Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
  2491. }
  2492. }
  2493. }
  2494. };
  2495. DECLARE_SCRIPT(M01_Entering_Church_Area_Zone, "")
  2496. {
  2497. void Entered( GameObject * obj, GameObject * enterer )
  2498. {
  2499. if (enterer == STAR )
  2500. {
  2501. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_CHURCH_JDG, 0 );
  2502. if (Commands->Find_Object ( 100801 ))//these are the three zones leading to the church--clean them up
  2503. {
  2504. Commands->Destroy_Object ( Commands->Find_Object ( 100801 ) );
  2505. }
  2506. if (Commands->Find_Object ( 100802 ))
  2507. {
  2508. Commands->Destroy_Object ( Commands->Find_Object ( 100802 ) );
  2509. }
  2510. if (Commands->Find_Object ( 100803 ))
  2511. {
  2512. Commands->Destroy_Object ( Commands->Find_Object ( 100803 ) );
  2513. }
  2514. }
  2515. }
  2516. };
  2517. DECLARE_SCRIPT(M01_Hand_Of_Nod_Interior_Zone, "")
  2518. {
  2519. void Entered( GameObject * obj, GameObject * enterer )
  2520. {
  2521. if (enterer == STAR )
  2522. {
  2523. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_HON_JDG, 0 );
  2524. }
  2525. }
  2526. };
  2527. DECLARE_SCRIPT(M01_Hand_Of_Nod_Exterior_Zone, "")
  2528. {
  2529. void Entered( GameObject * obj, GameObject * enterer )
  2530. {
  2531. if (enterer == STAR )
  2532. {
  2533. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_HON_JDG, 0 );
  2534. }
  2535. }
  2536. };
  2537. DECLARE_SCRIPT(M01_Comm_Center_Interior_Zone, "")
  2538. {
  2539. void Entered( GameObject * obj, GameObject * enterer )
  2540. {
  2541. if (enterer == STAR )
  2542. {
  2543. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
  2544. }
  2545. }
  2546. };
  2547. DECLARE_SCRIPT(M01_Comm_Center_Exterior_Zone, "")
  2548. {
  2549. void Entered( GameObject * obj, GameObject * enterer )
  2550. {
  2551. if (enterer == STAR )
  2552. {
  2553. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_COMM_CENTER_JDG, 0 );
  2554. }
  2555. }
  2556. };
  2557. DECLARE_SCRIPT(M01_Tunnel_Interior_Zone, "")
  2558. {
  2559. void Entered( GameObject * obj, GameObject * enterer )
  2560. {
  2561. if (enterer == STAR )
  2562. {
  2563. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_TUNNEL_JDG, 0 );
  2564. }
  2565. }
  2566. };
  2567. DECLARE_SCRIPT(M01_Tunnel_Exterior_Zone, "")
  2568. {
  2569. void Entered( GameObject * obj, GameObject * enterer )
  2570. {
  2571. if (enterer == STAR )
  2572. {
  2573. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_TUNNEL_JDG, 0 );
  2574. }
  2575. }
  2576. };
  2577. DECLARE_SCRIPT(M01_Waterfall_Interior_Zone, "")
  2578. {
  2579. void Entered( GameObject * obj, GameObject * enterer )
  2580. {
  2581. if (enterer == STAR )
  2582. {
  2583. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_WATERFALL_JDG, 0 );
  2584. }
  2585. }
  2586. };
  2587. DECLARE_SCRIPT(M01_Waterfall_Exterior_Zone, "")
  2588. {
  2589. void Entered( GameObject * obj, GameObject * enterer )
  2590. {
  2591. if (enterer == STAR )
  2592. {
  2593. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_WATERFALL_JDG, 0 );
  2594. }
  2595. }
  2596. };
  2597. DECLARE_SCRIPT(M01_Player_is_Leaving_GDI_Base_Zone, "")
  2598. {
  2599. bool firstEntry;
  2600. REGISTER_VARIABLES()
  2601. {
  2602. SAVE_VARIABLE(firstEntry, 1);
  2603. }
  2604. void Created( GameObject * obj )
  2605. {
  2606. firstEntry = true;
  2607. }
  2608. void Entered( GameObject * obj, GameObject * enterer )
  2609. {
  2610. if (enterer == STAR )
  2611. {
  2612. if (firstEntry == true)
  2613. {
  2614. firstEntry = false;
  2615. GameObject * barnSpawnerController = Commands->Find_Object (M01_GDIBASE_SPAWNER_CONTROLLER_JDG);
  2616. if (barnSpawnerController != NULL)
  2617. {
  2618. Commands->Send_Custom_Event( obj, barnSpawnerController, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2619. }
  2620. }
  2621. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_APPROACHING_BARN_AREA_JDG, 0 );
  2622. }
  2623. }
  2624. };
  2625. DECLARE_SCRIPT(M01_Player_is_Entering_GDI_Base_Zone, "")
  2626. {
  2627. void Entered( GameObject * obj, GameObject * enterer )
  2628. {
  2629. if (enterer == STAR )
  2630. {
  2631. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_APPROACHING_GDI_BASE_AREA_JDG, 0 );
  2632. }
  2633. }
  2634. };
  2635. DECLARE_SCRIPT(M01_Lose_Any_Church_Escorts_Zone, "")
  2636. {
  2637. void Entered( GameObject * obj, GameObject * enterer )
  2638. {
  2639. if (enterer == STAR)
  2640. {
  2641. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_CHURCH_01_JDG, 0 );
  2642. }
  2643. }
  2644. };
  2645. DECLARE_SCRIPT(M01_Lose_Any_Church_Escorts_Zone_02, "")
  2646. {
  2647. void Entered( GameObject * obj, GameObject * enterer )
  2648. {
  2649. if (enterer == STAR)
  2650. {
  2651. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_CHURCH_02_JDG, 0 );
  2652. }
  2653. }
  2654. };
  2655. DECLARE_SCRIPT(M01_Lose_Any_HON_Escorts_Zone, "")
  2656. {
  2657. void Entered( GameObject * obj, GameObject * enterer )
  2658. {
  2659. if (enterer == STAR)
  2660. {
  2661. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_HON_01_JDG, 0 );
  2662. }
  2663. }
  2664. };
  2665. DECLARE_SCRIPT(M01_Lose_Any_HON_Escorts_Zone_02, "")
  2666. {
  2667. void Entered( GameObject * obj, GameObject * enterer )
  2668. {
  2669. if (enterer == STAR)
  2670. {
  2671. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_HON_02_JDG, 0 );
  2672. }
  2673. }
  2674. };
  2675. DECLARE_SCRIPT(M01_Announce_Prisoner_Objective_Zone, "")
  2676. {
  2677. void Entered( GameObject * obj, GameObject * enterer )
  2678. {
  2679. if (enterer == STAR)
  2680. {
  2681. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ANNOUNCE_PRISONER_OBJECTIVE_JDG, 0 );
  2682. Commands->Destroy_Object ( obj );//this is a one-time only zone--clean it up
  2683. }
  2684. }
  2685. };
  2686. DECLARE_SCRIPT(M01_Scramble_Radar_Zone, "")
  2687. {
  2688. void Entered( GameObject * obj, GameObject * enterer )
  2689. {
  2690. if (enterer == STAR )
  2691. {
  2692. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SCRAMBLE_THE_RADAR_JDG, 0 );
  2693. }
  2694. }
  2695. };
  2696. DECLARE_SCRIPT(M01_UnScramble_Radar_Zone, "")
  2697. {
  2698. void Entered( GameObject * obj, GameObject * enterer )
  2699. {
  2700. if (enterer == STAR)
  2701. {
  2702. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_UNSCRAMBLE_THE_RADAR_JDG, 0 );
  2703. }
  2704. }
  2705. };
  2706. DECLARE_SCRIPT(M01_HON_Commander_Guy, "")
  2707. {
  2708. void Killed( GameObject * obj, GameObject * killer )
  2709. {
  2710. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
  2711. }
  2712. };
  2713. DECLARE_SCRIPT(M01_COMM_Commander_Guy, "")
  2714. {
  2715. void Killed( GameObject * obj, GameObject * killer )
  2716. {
  2717. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
  2718. }
  2719. };
  2720. DECLARE_SCRIPT(M01_HandOfNod_SAMSite_Script, "")//M01_HON_SAM_SITE_JDG==100031
  2721. {
  2722. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2723. {
  2724. if (damager == (STAR))
  2725. {
  2726. if (obj)
  2727. {
  2728. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2729. }
  2730. }
  2731. }
  2732. void Killed( GameObject * obj, GameObject * killer )
  2733. {
  2734. Commands->Send_Custom_Event( obj, Commands->Find_Object (M01_MISSION_CONTROLLER_JDG), 0, M01_HON_SAMSITE_HAS_BEEN_DESTROYED_JDG, 5 );
  2735. }
  2736. };
  2737. DECLARE_SCRIPT(M01_Destroyed_SAMSITE_JDG, "")
  2738. {
  2739. void Created( GameObject * obj )
  2740. {
  2741. ActionParamsStruct params;
  2742. Vector3 my_target = Commands->Get_Position ( obj );
  2743. my_target.Z -= -5;
  2744. params.Set_Basic( this, 100, 20 );
  2745. params.Set_Attack( my_target, 0, 0, true );
  2746. params.AttackCheckBlocked = true;
  2747. Commands->Action_Attack (obj, params);
  2748. }
  2749. };
  2750. DECLARE_SCRIPT(M01_CommCenter_Evacuator_JDG, "")
  2751. {
  2752. void Created( GameObject * obj )
  2753. {
  2754. Commands->Enable_Hibernation( obj, false );
  2755. ActionParamsStruct params;
  2756. Vector3 evac_spot;
  2757. float evac_location = Commands->Get_Random ( 0.5, 2.5f );
  2758. if (evac_location >= 0.5 && evac_location < 1.5)
  2759. {
  2760. evac_spot.Set(-286.904f, 557.896f, 27.616f);
  2761. }
  2762. else
  2763. {
  2764. evac_spot.Set(-318.149f, 530.868f, 27.971f);
  2765. }
  2766. float x_factor = Commands->Get_Random(-5,5);
  2767. float y_factor = Commands->Get_Random(-5,5);
  2768. evac_spot.X += x_factor;
  2769. evac_spot.Y += y_factor;
  2770. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  2771. params.Set_Movement( evac_spot, 1.0f, 2 );
  2772. Commands->Action_Goto( obj, params );
  2773. }
  2774. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2775. {
  2776. if (damager == STAR )
  2777. {
  2778. if (obj)
  2779. {
  2780. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2781. }
  2782. }
  2783. }
  2784. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2785. {
  2786. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is at workstation--face monitor
  2787. {
  2788. Commands->Enable_Hibernation( obj, true );
  2789. }
  2790. }
  2791. };
  2792. DECLARE_SCRIPT(M01_HON_FrontDoor_Evacuator_JDG, "")
  2793. {
  2794. void Created( GameObject * obj )
  2795. {
  2796. ActionParamsStruct params;
  2797. Commands->Enable_Hibernation( obj, false );
  2798. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_PICK_A_NEW_LOCATION_JDG);
  2799. params.Set_Movement( Vector3(-150.3f, 532.0f, 4.2f), 1.0f, 0.25f );
  2800. Commands->Action_Goto( obj, params );
  2801. }
  2802. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2803. {
  2804. if (damager == STAR )
  2805. {
  2806. if (obj)
  2807. {
  2808. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2809. }
  2810. }
  2811. }
  2812. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  2813. {
  2814. ActionParamsStruct params;
  2815. if (action_id == M01_PICK_A_NEW_LOCATION_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  2816. {
  2817. Vector3 evac_spot;
  2818. float evac_location = Commands->Get_Random ( 0.5, 3.5f );
  2819. if (evac_location >= 0.5 && evac_location < 1.5)
  2820. {
  2821. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  2822. }
  2823. else if (evac_location >= 1.5 && evac_location < 2.5)
  2824. {
  2825. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  2826. }
  2827. else
  2828. {
  2829. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  2830. }
  2831. float x_factor = Commands->Get_Random(-10,10);
  2832. float y_factor = Commands->Get_Random(-10,10);
  2833. evac_spot.X += x_factor;
  2834. evac_spot.Y += y_factor;
  2835. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  2836. params.Set_Movement( evac_spot, 1.0f, 3 );
  2837. Commands->Action_Goto( obj, params );
  2838. }
  2839. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is evac'd allow hibernation
  2840. {
  2841. Commands->Enable_Hibernation( obj, true );
  2842. }
  2843. }
  2844. };
  2845. DECLARE_SCRIPT(M01_HON_BackDoor_Evacuator_JDG, "")
  2846. {
  2847. void Created( GameObject * obj )
  2848. {
  2849. ActionParamsStruct params;
  2850. Commands->Enable_Hibernation( obj, false );
  2851. Vector3 evac_spot;
  2852. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  2853. float x_factor = Commands->Get_Random(-10,10);
  2854. float y_factor = Commands->Get_Random(-10,10);
  2855. evac_spot.X += x_factor;
  2856. evac_spot.Y += y_factor;
  2857. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  2858. params.Set_Movement( evac_spot, 1.0f, 3 );
  2859. Commands->Action_Goto( obj, params );
  2860. }
  2861. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2862. {
  2863. if (damager == STAR )
  2864. {
  2865. if (obj)
  2866. {
  2867. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2868. }
  2869. }
  2870. }
  2871. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  2872. {
  2873. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is evac'd allow hibernation
  2874. {
  2875. Commands->Enable_Hibernation( obj, true );
  2876. }
  2877. }
  2878. };
  2879. DECLARE_SCRIPT(M01_HON_Dorm_Crapper_JDG, "")
  2880. {
  2881. void Created( GameObject * obj )
  2882. {
  2883. Commands->Innate_Disable(obj);
  2884. Commands->Set_Facing ( obj, -120 );
  2885. }
  2886. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2887. {
  2888. if (damager == STAR )
  2889. {
  2890. if (obj)
  2891. {
  2892. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2893. }
  2894. }
  2895. }
  2896. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2897. {
  2898. ActionParamsStruct params;
  2899. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  2900. {
  2901. if (obj)
  2902. {
  2903. Commands->Innate_Enable( obj );
  2904. //params.Set_Basic(this, 60, 100);
  2905. //params.Set_Animation ("H_A_V22A", true);
  2906. //Commands->Action_Play_Animation (obj, params);
  2907. }
  2908. }
  2909. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  2910. {
  2911. if (obj)
  2912. {
  2913. Commands->Innate_Enable( obj );
  2914. Commands->Enable_Hibernation( obj, false );
  2915. Vector3 evac_spot;
  2916. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  2917. if (evac_location >= 0.5 && evac_location < 1.5)
  2918. {
  2919. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  2920. }
  2921. else if (evac_location >= 1.5 && evac_location < 2.5)
  2922. {
  2923. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  2924. }
  2925. else if (evac_location >= 2.5 && evac_location < 3.5)
  2926. {
  2927. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  2928. }
  2929. else
  2930. {
  2931. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  2932. }
  2933. float x_factor = Commands->Get_Random(-10,10);
  2934. float y_factor = Commands->Get_Random(-10,10);
  2935. evac_spot.X += x_factor;
  2936. evac_spot.Y += y_factor;
  2937. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  2938. params.Set_Movement( evac_spot, 1.0f, 3 );
  2939. Commands->Action_Goto( obj, params );
  2940. }
  2941. }
  2942. }
  2943. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  2944. {
  2945. ActionParamsStruct params;
  2946. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  2947. {
  2948. GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
  2949. if ( star != NULL )
  2950. {
  2951. int players_ID_number = Commands->Get_ID ( star );
  2952. params.Set_Basic( this, 90, 50 );
  2953. params.Set_Movement( Commands->Find_Object ( players_ID_number ), .8f, 1.5f );
  2954. params.MoveFollow = true;
  2955. Commands->Action_Goto( obj, params );
  2956. }
  2957. }
  2958. }
  2959. void Killed( GameObject * obj, GameObject * killer )
  2960. {
  2961. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
  2962. }
  2963. };
  2964. DECLARE_SCRIPT(M01_HON_Dorm_FlameGuy_JDG, "")
  2965. {
  2966. void Created( GameObject * obj )
  2967. {
  2968. Commands->Innate_Disable(obj);
  2969. Commands->Set_Facing ( obj, 90 );
  2970. }
  2971. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2972. {
  2973. if (damager == STAR )
  2974. {
  2975. if (obj)
  2976. {
  2977. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  2978. }
  2979. }
  2980. }
  2981. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2982. {
  2983. ActionParamsStruct params;
  2984. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  2985. {
  2986. if (obj)
  2987. {
  2988. Commands->Innate_Enable( obj );
  2989. params.Set_Basic(this, 60, 100);
  2990. params.Set_Animation ("H_A_601A", true);
  2991. Commands->Action_Play_Animation (obj, params);
  2992. }
  2993. }
  2994. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  2995. {
  2996. if (obj)
  2997. {
  2998. Commands->Innate_Enable( obj );
  2999. Commands->Enable_Hibernation( obj, false );
  3000. Vector3 evac_spot;
  3001. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3002. if (evac_location >= 0.5 && evac_location < 1.5)
  3003. {
  3004. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3005. }
  3006. else if (evac_location >= 1.5 && evac_location < 2.5)
  3007. {
  3008. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3009. }
  3010. else if (evac_location >= 2.5 && evac_location < 3.5)
  3011. {
  3012. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3013. }
  3014. else
  3015. {
  3016. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3017. }
  3018. float x_factor = Commands->Get_Random(-10,10);
  3019. float y_factor = Commands->Get_Random(-10,10);
  3020. evac_spot.X += x_factor;
  3021. evac_spot.Y += y_factor;
  3022. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3023. params.Set_Movement( evac_spot, 1.0f, 3 );
  3024. Commands->Action_Goto( obj, params );
  3025. }
  3026. }
  3027. }
  3028. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3029. {
  3030. ActionParamsStruct params;
  3031. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3032. {
  3033. Commands->Enable_Hibernation( obj, true );
  3034. }
  3035. }
  3036. };
  3037. DECLARE_SCRIPT(M01_HON_Dorm_ChemGuy_JDG, "")
  3038. {
  3039. void Created( GameObject * obj )
  3040. {
  3041. Commands->Innate_Disable(obj);
  3042. Commands->Set_Facing ( obj, -90 );
  3043. }
  3044. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3045. {
  3046. if (damager == STAR )
  3047. {
  3048. if (obj)
  3049. {
  3050. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3051. }
  3052. }
  3053. }
  3054. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3055. {
  3056. ActionParamsStruct params;
  3057. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  3058. {
  3059. if (obj)
  3060. {
  3061. Commands->Innate_Enable( obj );
  3062. params.Set_Basic(this, 60, 100);
  3063. params.Set_Animation ("H_A_613A", true);
  3064. Commands->Action_Play_Animation (obj, params);
  3065. }
  3066. }
  3067. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  3068. {
  3069. if (obj)
  3070. {
  3071. Commands->Innate_Enable( obj );
  3072. Commands->Enable_Hibernation( obj, false );
  3073. Vector3 evac_spot;
  3074. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3075. if (evac_location >= 0.5 && evac_location < 1.5)
  3076. {
  3077. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3078. }
  3079. else if (evac_location >= 1.5 && evac_location < 2.5)
  3080. {
  3081. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3082. }
  3083. else if (evac_location >= 2.5 && evac_location < 3.5)
  3084. {
  3085. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3086. }
  3087. else
  3088. {
  3089. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3090. }
  3091. float x_factor = Commands->Get_Random(-10,10);
  3092. float y_factor = Commands->Get_Random(-10,10);
  3093. evac_spot.X += x_factor;
  3094. evac_spot.Y += y_factor;
  3095. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3096. params.Set_Movement( evac_spot, 1.0f, 3 );
  3097. Commands->Action_Goto( obj, params );
  3098. }
  3099. }
  3100. }
  3101. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3102. {
  3103. ActionParamsStruct params;
  3104. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3105. {
  3106. Commands->Enable_Hibernation( obj, true );
  3107. }
  3108. }
  3109. };
  3110. DECLARE_SCRIPT(M01_HON_Dorm_RocketGuy_JDG, "")
  3111. {
  3112. void Created( GameObject * obj )
  3113. {
  3114. Commands->Innate_Disable(obj);
  3115. Commands->Set_Facing ( obj, -90 );
  3116. }
  3117. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3118. {
  3119. if (damager == STAR )
  3120. {
  3121. if (obj)
  3122. {
  3123. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3124. }
  3125. }
  3126. }
  3127. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3128. {
  3129. ActionParamsStruct params;
  3130. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  3131. {
  3132. if (obj)
  3133. {
  3134. Commands->Innate_Enable( obj );
  3135. params.Set_Basic(this, 60, 100);
  3136. params.Set_Animation ("H_A_601A", true);
  3137. Commands->Action_Play_Animation (obj, params);
  3138. }
  3139. }
  3140. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  3141. {
  3142. if (obj)
  3143. {
  3144. Commands->Innate_Enable( obj );
  3145. Commands->Enable_Hibernation( obj, false );
  3146. Vector3 evac_spot;
  3147. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3148. if (evac_location >= 0.5 && evac_location < 1.5)
  3149. {
  3150. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3151. }
  3152. else if (evac_location >= 1.5 && evac_location < 2.5)
  3153. {
  3154. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3155. }
  3156. else if (evac_location >= 2.5 && evac_location < 3.5)
  3157. {
  3158. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3159. }
  3160. else
  3161. {
  3162. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3163. }
  3164. float x_factor = Commands->Get_Random(-10,10);
  3165. float y_factor = Commands->Get_Random(-10,10);
  3166. evac_spot.X += x_factor;
  3167. evac_spot.Y += y_factor;
  3168. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3169. params.Set_Movement( evac_spot, 1.0f, 3 );
  3170. Commands->Action_Goto( obj, params );
  3171. }
  3172. }
  3173. }
  3174. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3175. {
  3176. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3177. {
  3178. Commands->Enable_Hibernation( obj, true );
  3179. }
  3180. }
  3181. };
  3182. DECLARE_SCRIPT(M01_HON_Dorm_MiniGunner_JDG, "")
  3183. {
  3184. void Created( GameObject * obj )
  3185. {
  3186. Commands->Innate_Disable(obj);
  3187. Commands->Set_Facing ( obj, 180 );
  3188. }
  3189. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3190. {
  3191. if (damager == STAR )
  3192. {
  3193. if (obj)
  3194. {
  3195. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3196. }
  3197. }
  3198. }
  3199. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3200. {
  3201. ActionParamsStruct params;
  3202. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  3203. {
  3204. if (obj)
  3205. {
  3206. Commands->Innate_Enable( obj );
  3207. params.Set_Basic(this, 60, 100);
  3208. params.Set_Animation ("H_A_442A", true);
  3209. Commands->Action_Play_Animation (obj, params);
  3210. }
  3211. }
  3212. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  3213. {
  3214. if (obj)
  3215. {
  3216. Commands->Innate_Enable( obj );
  3217. Commands->Enable_Hibernation( obj, false );
  3218. Vector3 evac_spot;
  3219. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3220. if (evac_location >= 0.5 && evac_location < 1.5)
  3221. {
  3222. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3223. }
  3224. else if (evac_location >= 1.5 && evac_location < 2.5)
  3225. {
  3226. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3227. }
  3228. else if (evac_location >= 2.5 && evac_location < 3.5)
  3229. {
  3230. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3231. }
  3232. else
  3233. {
  3234. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3235. }
  3236. float x_factor = Commands->Get_Random(-10,10);
  3237. float y_factor = Commands->Get_Random(-10,10);
  3238. evac_spot.X += x_factor;
  3239. evac_spot.Y += y_factor;
  3240. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3241. params.Set_Movement( evac_spot, 1.0f, 3 );
  3242. Commands->Action_Goto( obj, params );
  3243. }
  3244. }
  3245. }
  3246. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3247. {
  3248. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3249. {
  3250. Commands->Enable_Hibernation( obj, true );
  3251. }
  3252. }
  3253. };
  3254. DECLARE_SCRIPT(M01_HON_Cafeteria_Eating_Guy_JDG, "")
  3255. {
  3256. int enemy_detected;
  3257. REGISTER_VARIABLES()
  3258. {
  3259. SAVE_VARIABLE( enemy_detected, 1 );
  3260. }
  3261. void Created( GameObject * obj )
  3262. {
  3263. enemy_detected = 0;
  3264. Commands->Innate_Disable(obj);
  3265. Commands->Set_Facing ( obj, -125 );
  3266. }
  3267. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3268. {
  3269. if (damager == STAR )
  3270. {
  3271. if (obj)
  3272. {
  3273. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3274. }
  3275. }
  3276. }
  3277. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3278. {
  3279. ActionParamsStruct params;
  3280. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  3281. {
  3282. if (obj)
  3283. {
  3284. Commands->Innate_Enable( obj );
  3285. params.Set_Basic(this, 60, 100);
  3286. params.Set_Animation ("H_A_V11A", true);
  3287. Commands->Action_Play_Animation (obj, params);
  3288. }
  3289. }
  3290. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  3291. {
  3292. if (obj)
  3293. {
  3294. Commands->Innate_Enable( obj );
  3295. Commands->Enable_Hibernation( obj, false );
  3296. Vector3 evac_spot;
  3297. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3298. if (evac_location >= 0.5 && evac_location < 1.5)
  3299. {
  3300. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3301. }
  3302. else if (evac_location >= 1.5 && evac_location < 2.5)
  3303. {
  3304. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3305. }
  3306. else if (evac_location >= 2.5 && evac_location < 3.5)
  3307. {
  3308. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3309. }
  3310. else
  3311. {
  3312. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3313. }
  3314. float x_factor = Commands->Get_Random(-10,10);
  3315. float y_factor = Commands->Get_Random(-10,10);
  3316. evac_spot.X += x_factor;
  3317. evac_spot.Y += y_factor;
  3318. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3319. params.Set_Movement( evac_spot, 1.0f, 3 );
  3320. Commands->Action_Goto( obj, params );
  3321. }
  3322. }
  3323. }
  3324. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3325. {
  3326. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3327. {
  3328. Commands->Enable_Hibernation( obj, true );
  3329. }
  3330. }
  3331. };
  3332. DECLARE_SCRIPT(M01_HON_Cafeteria_Walking_Guy_JDG, "")
  3333. {
  3334. void Created( GameObject * obj )
  3335. {
  3336. Commands->Innate_Disable(obj);
  3337. }
  3338. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3339. {
  3340. if (damager == STAR )
  3341. {
  3342. if (obj)
  3343. {
  3344. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3345. }
  3346. }
  3347. }
  3348. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3349. {
  3350. ActionParamsStruct params;
  3351. if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
  3352. {
  3353. if (obj)
  3354. {
  3355. Commands->Innate_Enable( obj );
  3356. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3357. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3358. params.WaypathID = 100661;
  3359. params.WaypointStartID = 100662;
  3360. params.WaypointEndID = 100663;
  3361. Commands->Action_Goto( obj, params );
  3362. }
  3363. }
  3364. else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
  3365. {
  3366. if (obj)
  3367. {
  3368. Commands->Innate_Enable( obj );
  3369. Commands->Enable_Hibernation( obj, false );
  3370. Vector3 evac_spot;
  3371. float evac_location = Commands->Get_Random ( 0.5, 4.5f );
  3372. if (evac_location >= 0.5 && evac_location < 1.5)
  3373. {
  3374. evac_spot.Set(-156.637f, 553.163f, 4.295f);
  3375. }
  3376. else if (evac_location >= 1.5 && evac_location < 2.5)
  3377. {
  3378. evac_spot.Set(-145.746f, 531.964f, 4.271f);
  3379. }
  3380. else if (evac_location >= 2.5 && evac_location < 3.5)
  3381. {
  3382. evac_spot.Set(-163.828f, 515.290f, 4.258f);
  3383. }
  3384. else
  3385. {
  3386. evac_spot.Set(-221.947f, 515.124f, 4.012f);
  3387. }
  3388. float x_factor = Commands->Get_Random(-10,10);
  3389. float y_factor = Commands->Get_Random(-10,10);
  3390. evac_spot.X += x_factor;
  3391. evac_spot.Y += y_factor;
  3392. params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
  3393. params.Set_Movement( evac_spot, 1.0f, 3 );
  3394. Commands->Action_Goto( obj, params );
  3395. }
  3396. }
  3397. }
  3398. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  3399. {
  3400. ActionParamsStruct params;
  3401. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3402. {
  3403. params.Set_Basic(this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG);
  3404. params.Set_Face_Location( Vector3(-170.179f, 520.595f, 5.999f), 1 );
  3405. Commands->Action_Face_Location ( obj, params );
  3406. }
  3407. else if (action_id == M01_FACING_SPECIFIED_DIRECTION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3408. {
  3409. params.Set_Basic(this, 45, M01_DOING_ANIMATION_01_JDG);
  3410. params.Set_Animation ("H_A_J17C", false);
  3411. Commands->Action_Play_Animation (obj, params);
  3412. }
  3413. else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3414. {
  3415. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
  3416. params.Set_Movement( Vector3(0,0,0), .35f, .25f );
  3417. params.WaypathID = 100674;
  3418. params.WaypointStartID = 100676;
  3419. params.WaypointEndID = 100682;
  3420. Commands->Action_Goto( obj, params );
  3421. }
  3422. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3423. {
  3424. params.Set_Basic(this, 45, M01_DOING_ANIMATION_02_JDG);
  3425. params.Set_Animation ("H_A_V42A", false);
  3426. Commands->Action_Play_Animation (obj, params);
  3427. }
  3428. else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3429. {
  3430. Vector3 sitspot(-176.299f, 532.229f, -4.6f);
  3431. Commands->Set_Position ( obj, sitspot );
  3432. Commands->Set_Facing ( obj, 60 );
  3433. params.Set_Basic(this, 45, 100);
  3434. params.Set_Animation ("H_A_V11A", true);
  3435. Commands->Action_Play_Animation (obj, params);
  3436. }
  3437. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  3438. {
  3439. Commands->Enable_Hibernation( obj, true );
  3440. }
  3441. }
  3442. };
  3443. DECLARE_SCRIPT(M01_Hand_Of_Nod_Grunt_Zone, "")
  3444. {
  3445. void Entered( GameObject * obj, GameObject * enterer )
  3446. {
  3447. if (enterer == STAR )
  3448. {
  3449. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_IN_HON_GRUNT_LEVEL_JDG, 0 );
  3450. }
  3451. }
  3452. };
  3453. DECLARE_SCRIPT(M01_Hand_Of_Nod_Dojo_Zone, "")
  3454. {
  3455. void Entered( GameObject * obj, GameObject * enterer )
  3456. {
  3457. if (enterer == STAR )
  3458. {
  3459. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_IN_HON_DOJO_JDG, 0 );
  3460. }
  3461. }
  3462. };
  3463. DECLARE_SCRIPT(M01_Church_LoveShack_MiniGunner_JDG, "")//M01_CHURCH_LOVESHACK_MINIGUNNER_ID 101305
  3464. {
  3465. void Created( GameObject * obj )
  3466. {
  3467. Commands->Innate_Disable(obj);
  3468. }
  3469. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3470. {
  3471. if (damager == STAR)
  3472. {
  3473. if (obj)
  3474. {
  3475. Commands->Innate_Enable( obj );
  3476. ActionParamsStruct params;
  3477. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3478. params.Set_Movement( STAR, RUN, 5 );
  3479. params.Set_Attack( STAR, 15, 0, true );
  3480. Commands->Action_Attack ( obj, params );
  3481. }
  3482. }
  3483. }
  3484. void Killed( GameObject * obj, GameObject * killer )
  3485. {
  3486. GameObject * conversationZone = Commands->Find_Object ( 103392 );
  3487. if (conversationZone != NULL)
  3488. {
  3489. Commands->Destroy_Object ( conversationZone );
  3490. }
  3491. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_LOVESHACK_GUARD_IS_DEAD_JDG, 0 );
  3492. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
  3493. }
  3494. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3495. {
  3496. ActionParamsStruct params;
  3497. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  3498. {
  3499. Commands->Innate_Enable( obj );
  3500. params.Set_Basic(this, 85, M01_WALKING_WAYPATH_01_JDG);
  3501. params.Set_Movement( Vector3(0,0,0), WALK, 2 );
  3502. params.WaypathID = 100760;
  3503. params.WaypointStartID = 100761;
  3504. params.WaypointEndID = 100769;
  3505. Commands->Action_Goto( obj, params );
  3506. }
  3507. }
  3508. };
  3509. DECLARE_SCRIPT(M01_Church_Exterior_MiniGunner_JDG, "")
  3510. {
  3511. void Created( GameObject * obj )
  3512. {
  3513. Commands->Innate_Disable(obj);
  3514. }
  3515. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3516. {
  3517. ActionParamsStruct params;
  3518. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  3519. {
  3520. if (obj)
  3521. {
  3522. Commands->Innate_Enable( obj );
  3523. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3524. params.Set_Movement( Vector3(0,0,0), .2f, .25f );
  3525. params.WaypathID = 100771;
  3526. params.WaypointStartID = 100772;
  3527. params.WaypointEndID = 100776;
  3528. Commands->Action_Goto( obj, params );
  3529. }
  3530. }
  3531. }
  3532. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3533. {
  3534. if (damager == STAR)
  3535. {
  3536. if (obj)
  3537. {
  3538. Commands->Innate_Enable( obj );
  3539. ActionParamsStruct params;
  3540. params.Set_Basic(this, 100, 0);
  3541. params.Set_Movement( STAR, WALK, 5 );
  3542. params.Set_Attack( STAR, 15, 0, true );
  3543. Commands->Action_Attack ( obj, params );
  3544. }
  3545. }
  3546. }
  3547. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3548. {
  3549. ActionParamsStruct params;
  3550. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3551. {
  3552. char *animationName = M01_Choose_Idle_Animation ( );
  3553. params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
  3554. params.Set_Animation (animationName, false);
  3555. Commands->Action_Play_Animation (obj, params);
  3556. }
  3557. else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3558. {
  3559. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
  3560. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3561. params.WaypathID = 100778;
  3562. params.WaypointStartID = 100779;
  3563. params.WaypointEndID = 100782;
  3564. Commands->Action_Goto( obj, params );
  3565. }
  3566. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3567. {
  3568. char *animationName = M01_Choose_Idle_Animation ( );
  3569. params.Set_Basic( this, 45, M01_DOING_ANIMATION_02_JDG );
  3570. params.Set_Animation (animationName, false);
  3571. Commands->Action_Play_Animation (obj, params);
  3572. }
  3573. else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3574. {
  3575. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
  3576. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3577. params.WaypathID = 100778;
  3578. params.WaypointStartID = 100782;
  3579. params.WaypointEndID = 100779;
  3580. Commands->Action_Goto( obj, params );
  3581. }
  3582. else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3583. {
  3584. char *animationName = M01_Choose_Idle_Animation ( );
  3585. params.Set_Basic( this, 45, M01_DOING_ANIMATION_03_JDG );
  3586. params.Set_Animation (animationName, false);
  3587. Commands->Action_Play_Animation (obj, params);
  3588. }
  3589. else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3590. {
  3591. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_04_JDG);
  3592. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3593. params.WaypathID = 100771;
  3594. params.WaypointStartID = 100776;
  3595. params.WaypointEndID = 100772;
  3596. Commands->Action_Goto( obj, params );
  3597. }
  3598. else if (action_id == M01_WALKING_WAYPATH_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3599. {
  3600. char *animationName = M01_Choose_Idle_Animation ( );
  3601. params.Set_Basic( this, 45, M01_DOING_ANIMATION_04_JDG );
  3602. params.Set_Animation (animationName, false);
  3603. Commands->Action_Play_Animation (obj, params);
  3604. }
  3605. else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3606. {
  3607. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3608. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3609. params.WaypathID = 100771;
  3610. params.WaypointStartID = 100772;
  3611. params.WaypointEndID = 100776;
  3612. Commands->Action_Goto( obj, params );
  3613. }
  3614. }
  3615. };
  3616. DECLARE_SCRIPT(M01_Church_Balcony_MiniGunner_JDG, "")
  3617. {
  3618. void Created( GameObject * obj )
  3619. {
  3620. Commands->Innate_Disable(obj);
  3621. }
  3622. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3623. {
  3624. ActionParamsStruct params;
  3625. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  3626. {
  3627. if (obj)
  3628. {
  3629. Commands->Innate_Enable( obj );
  3630. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3631. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3632. params.WaypathID = 100784;
  3633. params.WaypointStartID = 100785;
  3634. params.WaypointEndID = 100786;
  3635. Commands->Action_Goto( obj, params );
  3636. }
  3637. }
  3638. }
  3639. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3640. {
  3641. ActionParamsStruct params;
  3642. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3643. {
  3644. char *animationName = M01_Choose_Idle_Animation ( );
  3645. params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
  3646. params.Set_Animation (animationName, false);
  3647. Commands->Action_Play_Animation (obj, params);
  3648. }
  3649. else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3650. {
  3651. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
  3652. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3653. params.WaypathID = 100788;
  3654. params.WaypointStartID = 100789;
  3655. params.WaypointEndID = 100790;
  3656. Commands->Action_Goto( obj, params );
  3657. }
  3658. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3659. {
  3660. char *animationName = M01_Choose_Idle_Animation ( );
  3661. params.Set_Basic( this, 45, M01_DOING_ANIMATION_02_JDG );
  3662. params.Set_Animation (animationName, false);
  3663. Commands->Action_Play_Animation (obj, params);
  3664. }
  3665. else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3666. {
  3667. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
  3668. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3669. params.WaypathID = 100792;
  3670. params.WaypointStartID = 100793;
  3671. params.WaypointEndID = 100794;
  3672. Commands->Action_Goto( obj, params );
  3673. }
  3674. else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3675. {
  3676. char *animationName = M01_Choose_Idle_Animation ( );
  3677. params.Set_Basic( this, 45, M01_DOING_ANIMATION_03_JDG );
  3678. params.Set_Animation (animationName, false);
  3679. Commands->Action_Play_Animation (obj, params);
  3680. }
  3681. else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3682. {
  3683. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_04_JDG);
  3684. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3685. params.WaypathID = 100796;
  3686. params.WaypointStartID = 100797;
  3687. params.WaypointEndID = 100799;
  3688. Commands->Action_Goto( obj, params );
  3689. }
  3690. else if (action_id == M01_WALKING_WAYPATH_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
  3691. {
  3692. char *animationName = M01_Choose_Idle_Animation ( );
  3693. params.Set_Basic( this, 45, M01_DOING_ANIMATION_04_JDG );
  3694. params.Set_Animation (animationName, false);
  3695. Commands->Action_Play_Animation (obj, params);
  3696. }
  3697. else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
  3698. {
  3699. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
  3700. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  3701. params.WaypathID = 100784;
  3702. params.WaypointStartID = 100785;
  3703. params.WaypointEndID = 100786;
  3704. Commands->Action_Goto( obj, params );
  3705. }
  3706. }
  3707. };
  3708. DECLARE_SCRIPT(M01_Announce_Hand_of_Nod_Zone, "")
  3709. {
  3710. void Entered( GameObject * obj, GameObject * enterer )
  3711. {
  3712. if (enterer == STAR )
  3713. {
  3714. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  3715. Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Apache_Orca_Chase_01.txt");
  3716. GameObject * buggyController = Commands->Find_Object ( 103367 );
  3717. if (buggyController != NULL)
  3718. {
  3719. Commands->Send_Custom_Event( obj, buggyController, 0, M01_START_ACTING_JDG, 0 );
  3720. }
  3721. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ANNOUNCE_HON_OBJECTIVE_JDG, 0 );
  3722. Commands->Destroy_Object ( obj);//this is a 1-time only zone--cleaning up
  3723. }
  3724. }
  3725. };
  3726. DECLARE_SCRIPT(M01_Announce_Barn_Objective_Zone, "")
  3727. {
  3728. void Entered( GameObject * obj, GameObject * enterer )
  3729. {
  3730. if (enterer == STAR )
  3731. {
  3732. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
  3733. Commands->Destroy_Object ( obj);//this is a 1-time only zone--cleaning up
  3734. }
  3735. }
  3736. };
  3737. DECLARE_SCRIPT(M01_Tiberium_Cave_Helicopter_JDG, "")
  3738. {
  3739. void Created( GameObject * obj )
  3740. {
  3741. ActionParamsStruct params;
  3742. Commands->Innate_Disable(obj);
  3743. Commands->Enable_Hibernation( obj, false );
  3744. Commands->Disable_Physical_Collisions ( obj );
  3745. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  3746. params.Set_Movement( Vector3(-42.883f, 376.457f, 18.025f), 0.005f, 0.25f );
  3747. params.AttackActive = false;
  3748. params.AttackCheckBlocked = false;
  3749. params.MovePathfind = false;
  3750. Commands->Action_Attack (obj, params);
  3751. float delayTimer = Commands->Get_Random ( 1, 2 );
  3752. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  3753. }
  3754. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  3755. {
  3756. ActionParamsStruct params;
  3757. if (param == M01_MODIFY_YOUR_ACTION_JDG )
  3758. {
  3759. params.Set_Basic(this, 100, M01_START_ACTING_JDG);
  3760. params.Set_Movement( Vector3(-42.883f, 376.457f, 18.025f), 0.05f, 0.25f );
  3761. params.AttackActive = true;
  3762. params.AttackCheckBlocked = false;
  3763. params.MovePathfind = false;
  3764. params.Set_Attack (STAR, 100, 0, true);
  3765. Commands->Modify_Action (obj, M01_START_ACTING_JDG, params);
  3766. float delayTimer = Commands->Get_Random ( 1, 2 );
  3767. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  3768. }
  3769. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG )
  3770. {
  3771. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  3772. params.Set_Movement( Vector3(0,0,0), 1.0f, 0.75f );
  3773. params.WaypathID = 100964;
  3774. params.WaypointStartID = 100965;
  3775. params.WaypointEndID = 101366;
  3776. params.WaypathSplined = true;
  3777. params.AttackActive = true;
  3778. params.AttackCheckBlocked = true;
  3779. params.MovePathfind = false;
  3780. params.Set_Attack (STAR, 100, 0, true);
  3781. Commands->Action_Attack (obj, params);
  3782. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 15 );
  3783. }
  3784. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG )
  3785. {
  3786. Commands->Destroy_Object ( obj );
  3787. }
  3788. }
  3789. };
  3790. DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Zone, "")
  3791. {
  3792. void Entered( GameObject * obj, GameObject * enterer )
  3793. {
  3794. if (enterer == STAR )
  3795. {
  3796. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG, 0 );
  3797. if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  3798. {
  3799. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  3800. }
  3801. if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
  3802. {
  3803. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  3804. }
  3805. //this is a one-time only zone--cleaning up
  3806. if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
  3807. {
  3808. Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
  3809. }
  3810. if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
  3811. {
  3812. Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
  3813. }
  3814. if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
  3815. {
  3816. Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
  3817. }
  3818. }
  3819. }
  3820. };
  3821. DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Via_Cave_Zone, "")
  3822. {
  3823. void Entered( GameObject * obj, GameObject * enterer )
  3824. {
  3825. if (enterer == STAR )
  3826. {
  3827. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_VIA_CAVE_JDG, 0 );
  3828. if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  3829. {
  3830. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  3831. }
  3832. if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
  3833. {
  3834. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  3835. }
  3836. //this is a one-time only zone--cleaning up
  3837. if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
  3838. {
  3839. Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
  3840. }
  3841. if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
  3842. {
  3843. Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
  3844. }
  3845. if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
  3846. {
  3847. Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
  3848. }
  3849. }
  3850. }
  3851. };
  3852. DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Via_Church_Zone, "")
  3853. {
  3854. void Entered( GameObject * obj, GameObject * enterer )
  3855. {
  3856. if (enterer == STAR )
  3857. {
  3858. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG, 0 );
  3859. if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  3860. {
  3861. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  3862. }
  3863. if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
  3864. {
  3865. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  3866. }
  3867. //this is a one-time only zone--cleaning up
  3868. if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
  3869. {
  3870. Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
  3871. }
  3872. if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
  3873. {
  3874. Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
  3875. }
  3876. if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
  3877. {
  3878. Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
  3879. }
  3880. }
  3881. }
  3882. };
  3883. DECLARE_SCRIPT(M01_Flamethrower_Point_Guard_JDG, "")
  3884. {
  3885. Vector3 myPosition;
  3886. float myFacing;
  3887. float leftFacing;
  3888. float rightFacing;
  3889. REGISTER_VARIABLES()
  3890. {
  3891. SAVE_VARIABLE(myPosition, 1);
  3892. SAVE_VARIABLE(myFacing, 2);
  3893. SAVE_VARIABLE(leftFacing, 3);
  3894. SAVE_VARIABLE(rightFacing, 4);
  3895. }
  3896. void Created( GameObject * obj )
  3897. {
  3898. myPosition = Commands->Get_Position ( obj );
  3899. myFacing = Commands->Get_Facing ( obj );
  3900. leftFacing = myFacing - 45;
  3901. rightFacing = myFacing + 45;
  3902. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 20.0f );
  3903. Commands->Set_Innate_Aggressiveness ( obj, 0.5f );
  3904. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
  3905. float delayTimer = Commands->Get_Random ( 5, 10 );
  3906. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  3907. }
  3908. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3909. {
  3910. ActionParamsStruct params;
  3911. if (param == M01_PICK_A_NEW_LOCATION_JDG)
  3912. {
  3913. float atarashiLookSpot = Commands->Get_Random ( leftFacing, rightFacing );
  3914. float delayTimer = Commands->Get_Random ( 5, 10 );
  3915. params.Set_Basic( this, 45, 20 );
  3916. params.Set_Face_Location( myPosition, DEG_TO_RAD(atarashiLookSpot), delayTimer );
  3917. Commands->Action_Face_Location ( obj, params );
  3918. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  3919. }
  3920. }
  3921. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3922. {
  3923. if ((sound.Type == SOUND_TYPE_BULLET_HIT) || (sound.Type == SOUND_TYPE_GUNSHOT))
  3924. {
  3925. Commands->Set_Innate_Is_Stationary ( obj, false );
  3926. }
  3927. }
  3928. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3929. {
  3930. Commands->Set_Innate_Is_Stationary ( obj, false );
  3931. }
  3932. void Damaged( GameObject * obj, GameObject * damager, float amount )
  3933. {
  3934. if (damager == STAR)
  3935. {
  3936. if (obj)
  3937. {
  3938. Commands->Set_Innate_Is_Stationary ( obj, false );
  3939. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  3940. }
  3941. }
  3942. }
  3943. };
  3944. DECLARE_SCRIPT(M01_MiniGunner_Point_Guard_JDG, "")
  3945. {
  3946. /*Vector3 myPosition;
  3947. REGISTER_VARIABLES()
  3948. {
  3949. SAVE_VARIABLE(myPosition, 1);
  3950. }
  3951. void Created( GameObject * obj )
  3952. {
  3953. myPosition.Set (Commands->Get_Position ( obj ));
  3954. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 3 );
  3955. }
  3956. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3957. {
  3958. int current_difficulty = Commands->Get_Difficulty_Level();
  3959. int easy = 0;
  3960. int medium = 1;
  3961. int hard = 2;
  3962. if (current_difficulty == easy)
  3963. {
  3964. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_EASY_DIFFICULTY_HOMERANGE_JDG );
  3965. Commands->Set_Innate_Aggressiveness ( obj, M01_EASY_DIFFICULTY_AGGRESSION_JDG );
  3966. Commands->Set_Innate_Take_Cover_Probability ( obj, M01_EASY_DIFFICULTY_TAKECOVER_JDG );
  3967. }
  3968. else if (current_difficulty == medium)
  3969. {
  3970. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_MEDIUM_DIFFICULTY_HOMERANGE_JDG );
  3971. Commands->Set_Innate_Aggressiveness ( obj, M01_MEDIUM_DIFFICULTY_AGGRESSION_JDG );
  3972. Commands->Set_Innate_Take_Cover_Probability ( obj, M01_MEDIUM_DIFFICULTY_TAKECOVER_JDG );
  3973. }
  3974. else if (current_difficulty == hard)
  3975. {
  3976. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_HARD_DIFFICULTY_HOMERANGE_JDG );
  3977. Commands->Set_Innate_Aggressiveness ( obj, M01_HARD_DIFFICULTY_AGGRESSION_JDG );
  3978. Commands->Set_Innate_Take_Cover_Probability ( obj, M01_HARD_DIFFICULTY_TAKECOVER_JDG );
  3979. }
  3980. }*/
  3981. };
  3982. DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_01_JDG, "")
  3983. {
  3984. bool hunting;
  3985. bool fighting;
  3986. REGISTER_VARIABLES()
  3987. {
  3988. SAVE_VARIABLE(hunting, 1);
  3989. SAVE_VARIABLE(fighting, 2);
  3990. }
  3991. void Created( GameObject * obj )
  3992. {
  3993. hunting = false;
  3994. fighting = false;
  3995. Commands->Enable_Hibernation( obj, false );
  3996. ActionParamsStruct params;
  3997. params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
  3998. params.Set_Movement( Vector3(-218.772f, 510.932f, 4.017f), RUN, 0.05f );
  3999. Commands->Action_Goto( obj, params );
  4000. }
  4001. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4002. {
  4003. if (damager == STAR)
  4004. {
  4005. if (obj)
  4006. {
  4007. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  4008. if (fighting == false)
  4009. {
  4010. Commands->Action_Reset ( obj, 100 );
  4011. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  4012. fighting = true;
  4013. }
  4014. }
  4015. }
  4016. }
  4017. void Killed( GameObject * obj, GameObject * killer )
  4018. {
  4019. if (hunting != true)
  4020. {
  4021. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_01_IS_DEAD_JDG, 0 );
  4022. }
  4023. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
  4024. }
  4025. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4026. {
  4027. if (enemy == STAR && fighting == false)
  4028. {
  4029. fighting = true;
  4030. Commands->Action_Reset ( obj, 100 );
  4031. Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
  4032. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
  4033. Commands->Enable_Hibernation( obj, true );
  4034. }
  4035. }
  4036. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  4037. {
  4038. if (sound.Creator == STAR && fighting == false)
  4039. {
  4040. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4041. if (sound.Type == SOUND_TYPE_GUNSHOT)
  4042. {
  4043. fighting = true;
  4044. Commands->Action_Reset ( obj, 100 );
  4045. Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
  4046. }
  4047. else if (sound.Type == SOUND_TYPE_BULLET_HIT)
  4048. {
  4049. fighting = true;
  4050. Commands->Action_Reset ( obj, 100 );
  4051. Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
  4052. }
  4053. }
  4054. }
  4055. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4056. {
  4057. ActionParamsStruct params;
  4058. if (param == M01_HUNT_THE_PLAYER_JDG )
  4059. {
  4060. if (obj && STAR)
  4061. {
  4062. hunting = true;
  4063. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4064. params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
  4065. params.Set_Movement( playersPosition, RUN, 5, false );
  4066. Commands->Action_Goto( obj, params );
  4067. }
  4068. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
  4069. }
  4070. }
  4071. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4072. {
  4073. ActionParamsStruct params;
  4074. if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
  4075. {
  4076. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  4077. }
  4078. }
  4079. };
  4080. DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_02_JDG, "")
  4081. {
  4082. bool hunting;
  4083. bool fighting;
  4084. REGISTER_VARIABLES()
  4085. {
  4086. SAVE_VARIABLE(hunting, 1);
  4087. SAVE_VARIABLE(fighting, 2);
  4088. }
  4089. void Created( GameObject * obj )
  4090. {
  4091. hunting = false;
  4092. fighting = false;
  4093. Commands->Enable_Hibernation( obj, false );
  4094. ActionParamsStruct params;
  4095. params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
  4096. params.Set_Movement( Vector3(-224.418f, 510.944f, 4.006f), RUN, 0.05f );
  4097. Commands->Action_Goto( obj, params );
  4098. }
  4099. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4100. {
  4101. if (damager == STAR )
  4102. {
  4103. if (obj)
  4104. {
  4105. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  4106. if (fighting == false)
  4107. {
  4108. Commands->Action_Reset ( obj, 100 );
  4109. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  4110. fighting = true;
  4111. }
  4112. }
  4113. }
  4114. }
  4115. void Killed( GameObject * obj, GameObject * killer )
  4116. {
  4117. if (hunting != true)
  4118. {
  4119. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_02_IS_DEAD_JDG, 0 );
  4120. }
  4121. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
  4122. }
  4123. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4124. {
  4125. if (enemy == STAR && fighting == false)
  4126. {
  4127. fighting = true;
  4128. Commands->Action_Reset ( obj, 100 );
  4129. Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
  4130. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
  4131. Commands->Enable_Hibernation( obj, true );
  4132. }
  4133. }
  4134. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  4135. {
  4136. if (sound.Creator == STAR && fighting == false)
  4137. {
  4138. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4139. if (sound.Type == SOUND_TYPE_GUNSHOT)
  4140. {
  4141. fighting = true;
  4142. Commands->Action_Reset ( obj, 100 );
  4143. Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
  4144. }
  4145. else if (sound.Type == SOUND_TYPE_BULLET_HIT)
  4146. {
  4147. fighting = true;
  4148. Commands->Action_Reset ( obj, 100 );
  4149. Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
  4150. }
  4151. }
  4152. }
  4153. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4154. {
  4155. ActionParamsStruct params;
  4156. if (param == M01_HUNT_THE_PLAYER_JDG )
  4157. {
  4158. if (obj && STAR)
  4159. {
  4160. hunting = true;
  4161. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4162. params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
  4163. params.Set_Movement( playersPosition, RUN, 5, false );
  4164. Commands->Action_Goto( obj, params );
  4165. }
  4166. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
  4167. }
  4168. }
  4169. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4170. {
  4171. ActionParamsStruct params;
  4172. if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
  4173. {
  4174. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  4175. }
  4176. }
  4177. };
  4178. DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_03_JDG, "")
  4179. {
  4180. bool hunting;
  4181. bool fighting;
  4182. REGISTER_VARIABLES()
  4183. {
  4184. SAVE_VARIABLE(hunting, 1);
  4185. SAVE_VARIABLE(fighting, 2);
  4186. }
  4187. void Created( GameObject * obj )
  4188. {
  4189. hunting = false;
  4190. fighting = false;
  4191. Commands->Enable_Hibernation( obj, false );
  4192. ActionParamsStruct params;
  4193. params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
  4194. params.Set_Movement( Vector3(-221.754f, 514.833f, 4.015f), RUN, 0.05f );
  4195. Commands->Action_Goto( obj, params );
  4196. }
  4197. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4198. {
  4199. if (damager == STAR )
  4200. {
  4201. if (obj)
  4202. {
  4203. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  4204. if (fighting == false)
  4205. {
  4206. Commands->Action_Reset ( obj, 100 );
  4207. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  4208. fighting = true;
  4209. }
  4210. }
  4211. }
  4212. }
  4213. void Killed( GameObject * obj, GameObject * killer )
  4214. {
  4215. if (hunting != true)
  4216. {
  4217. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_03_IS_DEAD_JDG, 0 );
  4218. }
  4219. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
  4220. }
  4221. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4222. {
  4223. if (enemy == STAR && fighting == false)
  4224. {
  4225. fighting = true;
  4226. Commands->Action_Reset ( obj, 100 );
  4227. Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
  4228. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
  4229. Commands->Enable_Hibernation( obj, true );
  4230. }
  4231. }
  4232. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  4233. {
  4234. if (sound.Creator == STAR && fighting == false)
  4235. {
  4236. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4237. if (sound.Type == SOUND_TYPE_GUNSHOT)
  4238. {
  4239. fighting = true;
  4240. Commands->Action_Reset ( obj, 100 );
  4241. Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
  4242. }
  4243. else if (sound.Type == SOUND_TYPE_BULLET_HIT)
  4244. {
  4245. fighting = true;
  4246. Commands->Action_Reset ( obj, 100 );
  4247. Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
  4248. }
  4249. }
  4250. }
  4251. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4252. {
  4253. ActionParamsStruct params;
  4254. if (param == M01_HUNT_THE_PLAYER_JDG )
  4255. {
  4256. if (obj && STAR)
  4257. {
  4258. hunting = true;
  4259. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4260. params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
  4261. params.Set_Movement( playersPosition, RUN, 5, false );
  4262. Commands->Action_Goto( obj, params );
  4263. }
  4264. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
  4265. }
  4266. }
  4267. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4268. {
  4269. ActionParamsStruct params;
  4270. if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
  4271. {
  4272. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  4273. }
  4274. else if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4275. {
  4276. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IN_POSITION_JDG, 0 );
  4277. }
  4278. }
  4279. };
  4280. DECLARE_SCRIPT(M01_Whack_A_Mole_Enter_Zone_JDG, "")//this guys ID is 101209
  4281. {
  4282. void Entered( GameObject * obj, GameObject * enterer )
  4283. {
  4284. if (enterer == STAR )
  4285. {
  4286. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_WHACK_A_MOLE_GUY_JDG, 0 );
  4287. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101207 ), 0, M01_SPAWN_WHACK_A_MOLE_GUY_JDG, 0 );
  4288. Commands->Destroy_Object ( obj );
  4289. }
  4290. }
  4291. };
  4292. DECLARE_SCRIPT(M01_Whack_A_Mole_Exit_Zone_JDG, "")//this guys ID is 101207
  4293. {
  4294. bool okayToAct;
  4295. REGISTER_VARIABLES()
  4296. {
  4297. SAVE_VARIABLE(okayToAct, 1);
  4298. }
  4299. void Created( GameObject * obj )
  4300. {
  4301. okayToAct = false;
  4302. }
  4303. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4304. {
  4305. if (param == M01_SPAWN_WHACK_A_MOLE_GUY_JDG )
  4306. {
  4307. okayToAct = true;
  4308. }
  4309. }
  4310. void Entered( GameObject * obj, GameObject * enterer )
  4311. {
  4312. if (enterer == STAR && okayToAct == true)
  4313. {
  4314. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHANGE_WHACK_A_MOLE_GUY_JDG, 0 );
  4315. Commands->Destroy_Object ( obj );
  4316. }
  4317. }
  4318. };
  4319. DECLARE_SCRIPT(M01_Whack_A_Mole_Minigunner_JDG, "")
  4320. {
  4321. typedef enum {
  4322. Left_To_Right,
  4323. Right_To_Left,
  4324. } Walking_State;
  4325. bool invincible;
  4326. bool attacked;
  4327. float base_health;
  4328. float speed;
  4329. int points_given;
  4330. Walking_State Whack_a_Mole_State;
  4331. REGISTER_VARIABLES()
  4332. {
  4333. SAVE_VARIABLE(invincible, 1);
  4334. SAVE_VARIABLE(attacked, 2);
  4335. SAVE_VARIABLE(base_health, 3);
  4336. SAVE_VARIABLE(speed, 4);
  4337. SAVE_VARIABLE(points_given, 5);
  4338. SAVE_VARIABLE(Whack_a_Mole_State, 6);
  4339. }
  4340. void Created( GameObject * obj )
  4341. {
  4342. //Commands->Innate_Disable(obj);
  4343. invincible = false;
  4344. attacked = false;
  4345. base_health = Commands->Get_Max_Health ( obj );
  4346. speed = 0.3f;
  4347. points_given = 1;
  4348. ActionParamsStruct params;
  4349. params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
  4350. params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
  4351. params.WaypathID = 101221;
  4352. Commands->Action_Goto( obj, params );
  4353. Whack_a_Mole_State = Right_To_Left;
  4354. }
  4355. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4356. {
  4357. ActionParamsStruct params;
  4358. if (param == M01_CHANGE_WHACK_A_MOLE_GUY_JDG )
  4359. {
  4360. if (obj)
  4361. {
  4362. invincible = false;
  4363. Commands->Innate_Enable(obj);
  4364. }
  4365. }
  4366. else if (param == M01_DOING_ANIMATION_01_JDG )
  4367. {
  4368. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  4369. params.Set_Animation( "H_A_J21C", false );
  4370. Commands->Action_Play_Animation ( obj, params );
  4371. }
  4372. else if (param == M01_PICK_A_NEW_LOCATION_JDG )
  4373. {
  4374. Commands->Action_Reset ( obj, 100 );
  4375. if (Whack_a_Mole_State == Right_To_Left)
  4376. {
  4377. params.Set_Basic( this, 45, M01_WALKING_WAYPATH_02_JDG );
  4378. params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
  4379. params.WaypathID = 101210;
  4380. Commands->Action_Goto( obj, params );
  4381. Whack_a_Mole_State = Left_To_Right;
  4382. }
  4383. else if (Whack_a_Mole_State == Left_To_Right)
  4384. {
  4385. params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
  4386. params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
  4387. params.WaypathID = 101221;
  4388. Commands->Action_Goto( obj, params );
  4389. Whack_a_Mole_State = Right_To_Left;
  4390. }
  4391. }
  4392. else if (param == M01_HUNT_THE_PLAYER_JDG )
  4393. {
  4394. if (obj)
  4395. {
  4396. invincible = false;
  4397. Commands->Innate_Enable(obj);
  4398. Commands->Grant_Key( obj, 1, true );
  4399. params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
  4400. params.Set_Movement( STAR, WALK, 5 );
  4401. params.Set_Attack( STAR, 15, 0, true );
  4402. Commands->Action_Attack ( obj, params );
  4403. }
  4404. }
  4405. }
  4406. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4407. {
  4408. ActionParamsStruct params;
  4409. if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4410. {
  4411. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  4412. }
  4413. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4414. {
  4415. if (attacked == false)
  4416. {
  4417. params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
  4418. params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
  4419. params.WaypathID = 101221;
  4420. Commands->Action_Goto( obj, params );
  4421. Whack_a_Mole_State = Right_To_Left;
  4422. }
  4423. else if (attacked == true)
  4424. {
  4425. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
  4426. }
  4427. }
  4428. else if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4429. {
  4430. params.Set_Basic( this, 45, M01_WALKING_WAYPATH_02_JDG );
  4431. params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
  4432. params.WaypathID = 101210;
  4433. Commands->Action_Goto( obj, params );
  4434. Whack_a_Mole_State = Left_To_Right;
  4435. }
  4436. }
  4437. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4438. {
  4439. if (damager == STAR && invincible == true)
  4440. {
  4441. if (obj)
  4442. {
  4443. attacked = true;
  4444. Commands->Set_Health ( obj, base_health );
  4445. points_given = 2 * points_given;
  4446. speed = speed + .1;
  4447. if (speed > 1)
  4448. {
  4449. speed = 1;
  4450. }
  4451. Commands->Give_Points( damager, points_given, false );
  4452. Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, 0 );
  4453. }
  4454. }
  4455. }
  4456. };
  4457. DECLARE_SCRIPT(M01_Left_Interrogation_Room_Enter_Zone_JDG, "")//this guys ID is 101354
  4458. {
  4459. void Entered( GameObject * obj, GameObject * enterer )
  4460. {
  4461. if (enterer == STAR )
  4462. {
  4463. if (Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ))
  4464. {
  4465. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ), 0, M01_PLAYER_ENTERING_LEFT_INTEROG_ROOM_JDG, 0 );
  4466. }
  4467. if (Commands->Find_Object ( 101354 ))
  4468. {
  4469. Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
  4470. }
  4471. if (Commands->Find_Object ( 101355 ))
  4472. {
  4473. Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
  4474. }
  4475. }
  4476. }
  4477. };
  4478. DECLARE_SCRIPT(M01_Right_Interrogation_Room_Enter_Zone_JDG, "")//this guys ID is 101355
  4479. {
  4480. void Entered( GameObject * obj, GameObject * enterer )
  4481. {
  4482. if (enterer == STAR )
  4483. {
  4484. if (Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ))
  4485. {
  4486. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ), 0, M01_PLAYER_ENTERING_RIGHT_INTEROG_ROOM_JDG, 0 );
  4487. }
  4488. if (Commands->Find_Object ( 101354 ))
  4489. {
  4490. Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
  4491. }
  4492. if (Commands->Find_Object ( 101355 ))
  4493. {
  4494. Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
  4495. }
  4496. }
  4497. }
  4498. };
  4499. DECLARE_SCRIPT(M01_Interrogation_Room_L03_Keycard_JDG, "")
  4500. {
  4501. void Created( GameObject * obj )
  4502. {
  4503. Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_NONE );
  4504. }
  4505. };
  4506. DECLARE_SCRIPT(M01_Interrogation_Room_Surprise_Guy_JDG, "")//this guys ID is 101357
  4507. {
  4508. Vector3 myPostion;
  4509. bool onGuard;
  4510. REGISTER_VARIABLES()
  4511. {
  4512. SAVE_VARIABLE(myPostion, 1);
  4513. SAVE_VARIABLE(onGuard, 2);
  4514. }
  4515. void Created( GameObject * obj )
  4516. {
  4517. Commands->Innate_Disable(obj);
  4518. onGuard = true;
  4519. }
  4520. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4521. {
  4522. ActionParamsStruct params;
  4523. if (onGuard == true)
  4524. {
  4525. if (obj)
  4526. {
  4527. Commands->Innate_Enable( obj );
  4528. Commands->Create_Sound ( "Huh_2", Commands->Get_Position ( obj ), obj );
  4529. float delayTimer = Commands->Get_Random ( 0.5f, 2 );
  4530. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  4531. onGuard = false;
  4532. if (Commands->Find_Object ( 101354 ))
  4533. {
  4534. Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
  4535. }
  4536. if (Commands->Find_Object ( 101355 ))
  4537. {
  4538. Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
  4539. }
  4540. }
  4541. }
  4542. else
  4543. {
  4544. }
  4545. }
  4546. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  4547. {
  4548. ActionParamsStruct params;
  4549. if (param == M01_PLAYER_ENTERING_LEFT_INTEROG_ROOM_JDG )
  4550. {
  4551. myPostion.Set (-182.199f, 529.167f, -31.130f);
  4552. params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
  4553. params.Set_Movement( myPostion, 0.75f, 0.05f );
  4554. Commands->Action_Goto( obj, params );
  4555. onGuard = false;
  4556. }
  4557. else if (param == M01_PLAYER_ENTERING_RIGHT_INTEROG_ROOM_JDG )
  4558. {
  4559. myPostion.Set (-182.753f, 539.906f, -31.130f);
  4560. params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
  4561. params.Set_Movement( myPostion, 0.75f, 0.05f );
  4562. Commands->Action_Goto( obj, params );
  4563. onGuard = false;
  4564. }
  4565. else if (param == M01_MODIFY_YOUR_ACTION_JDG )
  4566. {
  4567. if (obj)
  4568. {
  4569. Commands->Grant_Key( obj, 1, true );
  4570. Commands->Grant_Key( obj, 2, true );
  4571. Commands->Grant_Key( obj, 3, true );
  4572. Commands->Innate_Enable( obj );
  4573. params.Set_Basic( this, 80, M01_HUNT_THE_PLAYER_JDG );
  4574. params.Set_Attack( STAR, 20, 0, true );
  4575. params.AttackActive = true;
  4576. params.AttackCheckBlocked = true;
  4577. Commands->Action_Attack ( obj, params );
  4578. }
  4579. }
  4580. }
  4581. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4582. {
  4583. ActionParamsStruct params;
  4584. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4585. {
  4586. Commands->Create_Sound ( "TargetHasBeenEngaged_2", myPostion, obj );
  4587. params.Set_Basic( this, 80, M01_HUNT_THE_PLAYER_JDG );
  4588. params.Set_Attack( STAR, 20, 0, true );
  4589. params.AttackActive = true;
  4590. params.AttackCheckBlocked = false;
  4591. Commands->Action_Attack ( obj, params );
  4592. float delayTimer = Commands->Get_Random ( 1, 3 );
  4593. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  4594. }
  4595. }
  4596. };
  4597. DECLARE_SCRIPT(M01_Medium_Tank_Tunnel_Squish_Guy_JDG, "")
  4598. {
  4599. void Created( GameObject * obj )
  4600. {
  4601. Vector3 myPositon = Commands->Get_Position ( obj );
  4602. Commands->Set_Innate_Soldier_Home_Location ( obj, myPositon, 10.0f );
  4603. }
  4604. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4605. {
  4606. if (param == M01_MEDIUM_TANK_IS_HERE_JDG )
  4607. {
  4608. Commands->Set_Innate_Is_Stationary ( obj, false );
  4609. ActionParamsStruct params;
  4610. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4611. params.Set_Movement( Vector3(0,0,0), 1.0f, .25f );
  4612. params.WaypathID = 101554;
  4613. params.WaypointStartID = 101561;
  4614. Commands->Action_Goto( obj, params );
  4615. Commands->Create_3D_Sound_At_Bone ( "M01_Nod_HupHup", obj, "ROOTTRANSFORM" );
  4616. }
  4617. }
  4618. };
  4619. DECLARE_SCRIPT(M01_Billys_Conversation_Zone_JDG, "")//this guys ID is 101661
  4620. {
  4621. bool okay_to_play_conversation;
  4622. bool playerEntered;
  4623. REGISTER_VARIABLES()
  4624. {
  4625. SAVE_VARIABLE(okay_to_play_conversation, 1);
  4626. SAVE_VARIABLE(playerEntered, 2);
  4627. }
  4628. void Created( GameObject * obj )
  4629. {
  4630. okay_to_play_conversation = false;
  4631. playerEntered = false;
  4632. }
  4633. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4634. {
  4635. ActionParamsStruct params;
  4636. if ((param == M01_START_ACTING_JDG))//billy is in position--give okay for conversation
  4637. {
  4638. okay_to_play_conversation = true;
  4639. Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
  4640. }
  4641. else if ((param == M01_CUE_BILLYS_CONVERSATION_JDG))//see if billy and havoc are present
  4642. {
  4643. if (playerEntered == true && okay_to_play_conversation == true)
  4644. {
  4645. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
  4646. GameObject * babushkaZone = Commands->Find_Object ( 101662 );
  4647. GameObject * billyZone = Commands->Find_Object ( 101661 );
  4648. if (babushkaZone != NULL)
  4649. {
  4650. Commands->Destroy_Object ( babushkaZone );//this is one-time only zone--cleaning up
  4651. }
  4652. if (billyZone != NULL)
  4653. {
  4654. Commands->Destroy_Object ( billyZone );//this is one-time only zone--cleaning up
  4655. }
  4656. }
  4657. }
  4658. }
  4659. void Exited( GameObject * obj, GameObject * exiter )
  4660. {
  4661. if (exiter == STAR)
  4662. {
  4663. playerEntered = false;
  4664. }
  4665. }
  4666. void Entered( GameObject * obj, GameObject * enterer )
  4667. {
  4668. if (enterer == STAR )
  4669. {
  4670. playerEntered = true;
  4671. Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
  4672. }
  4673. }
  4674. };
  4675. DECLARE_SCRIPT(M01_Tank_Entering_Tunnel_Zone_JDG, "")//this guys ID is
  4676. {
  4677. int gdi_medium_tank;
  4678. REGISTER_VARIABLES()
  4679. {
  4680. SAVE_VARIABLE(gdi_medium_tank, 1);
  4681. }
  4682. void Created( GameObject * obj )
  4683. {
  4684. gdi_medium_tank = 0;
  4685. }
  4686. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4687. {
  4688. if (type == M01_MEDIUM_TANK_IS_HERE_JDG )
  4689. {
  4690. gdi_medium_tank = param;
  4691. }
  4692. }
  4693. void Entered( GameObject * obj, GameObject * enterer )
  4694. {
  4695. /*GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG );
  4696. if (lightTank != NULL && enterer == lightTank)
  4697. {
  4698. Commands->Send_Custom_Event( obj, lightTank, 0, M01_GOTO_IDLE_JDG, 0 );
  4699. Vector3 newTankPosition (14.208f, 225.943f, 4.0f);
  4700. Commands->Set_Position ( lightTank, newTankPosition );
  4701. }*/
  4702. if (enterer == Commands->Find_Object ( gdi_medium_tank ))
  4703. {
  4704. if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_01_ID ))
  4705. {
  4706. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_01_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
  4707. }
  4708. if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_02_ID ))
  4709. {
  4710. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_02_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
  4711. }
  4712. if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_03_ID ))
  4713. {
  4714. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_03_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
  4715. }
  4716. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  4717. }
  4718. }
  4719. };
  4720. DECLARE_SCRIPT(M01_Player_Is_Entering_Tailgun_Alley_JDG, "")//this guys ID is 101692
  4721. {
  4722. void Entered( GameObject * obj, GameObject * enterer )
  4723. {
  4724. if (enterer == STAR)
  4725. {
  4726. int tankWarning = Commands->Create_Conversation( "M01_Announce_LightTank_Conversation", 100, 1000, false);
  4727. Commands->Join_Conversation( NULL, tankWarning, false, false );
  4728. Commands->Join_Conversation( NULL, tankWarning, false, false );
  4729. //Commands->Join_Conversation( STAR, tankWarning, false, false );
  4730. Commands->Start_Conversation( tankWarning, tankWarning );
  4731. if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
  4732. {
  4733. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG, 0 );
  4734. }
  4735. if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
  4736. {
  4737. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_START_ACTING_JDG, 0 );
  4738. }
  4739. if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
  4740. {
  4741. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_START_ACTING_JDG, 0 );
  4742. }
  4743. if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
  4744. {
  4745. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_START_ACTING_JDG, 0 );
  4746. }
  4747. if ( Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
  4748. {
  4749. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  4750. }
  4751. if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  4752. {
  4753. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  4754. }
  4755. if ( Commands->Find_Object ( 101718 ))//this is the backway enter zone
  4756. {
  4757. Commands->Destroy_Object ( Commands->Find_Object ( 101718 ) );
  4758. }
  4759. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  4760. }
  4761. }
  4762. };
  4763. DECLARE_SCRIPT(M01_Player_Is_Entering_Tailgun_Alley_Backway_JDG, "")//this guys ID is 101691
  4764. {
  4765. void Entered( GameObject * obj, GameObject * enterer )
  4766. {
  4767. if (enterer == STAR)
  4768. {
  4769. if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
  4770. {
  4771. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG, 0 );
  4772. }
  4773. if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
  4774. {
  4775. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_START_ACTING_JDG, 0 );
  4776. }
  4777. if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
  4778. {
  4779. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_START_ACTING_JDG, 0 );
  4780. }
  4781. if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
  4782. {
  4783. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_START_ACTING_JDG, 0 );
  4784. }
  4785. if ( Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
  4786. {
  4787. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  4788. }
  4789. if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  4790. {
  4791. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  4792. }
  4793. if ( Commands->Find_Object ( 101692 ))//this is the enter zone in the tunnel
  4794. {
  4795. Commands->Destroy_Object ( Commands->Find_Object ( 101692 ) );
  4796. }
  4797. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  4798. }
  4799. }
  4800. };
  4801. DECLARE_SCRIPT(M01_TailGunner_01_JDG, "")//M01_TAILGUNNER_01_ID 101470
  4802. {
  4803. void Created( GameObject * obj )
  4804. {
  4805. Commands->Innate_Disable(obj);
  4806. if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
  4807. {
  4808. ActionParamsStruct params;
  4809. Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_01_ID ) );
  4810. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4811. params.Set_Movement( tailgunPosition, .25f, .25f );
  4812. Commands->Action_Goto( obj, params );
  4813. }
  4814. }
  4815. void Killed( GameObject * obj, GameObject * killer )
  4816. {
  4817. if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
  4818. {
  4819. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
  4820. }
  4821. }
  4822. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4823. {
  4824. ActionParamsStruct params;
  4825. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4826. {
  4827. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  4828. Commands->Action_Enter_Exit ( obj, params );
  4829. }
  4830. }
  4831. };
  4832. DECLARE_SCRIPT(M01_TailGunner_02_JDG, "")//M01_TAILGUNNER_02_ID 101471
  4833. {
  4834. void Created( GameObject * obj )
  4835. {
  4836. Commands->Innate_Disable(obj);
  4837. if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
  4838. {
  4839. ActionParamsStruct params;
  4840. Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_02_ID ) );
  4841. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4842. params.Set_Movement( tailgunPosition, .25f, .25f );
  4843. Commands->Action_Goto( obj, params );
  4844. }
  4845. }
  4846. void Killed( GameObject * obj, GameObject * killer )
  4847. {
  4848. if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
  4849. {
  4850. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
  4851. }
  4852. }
  4853. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4854. {
  4855. ActionParamsStruct params;
  4856. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4857. {
  4858. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  4859. Commands->Action_Enter_Exit ( obj, params );
  4860. }
  4861. }
  4862. };
  4863. DECLARE_SCRIPT(M01_TailGunner_03_JDG, "")//M01_TAILGUNNER_03_ID 101472
  4864. {
  4865. void Created( GameObject * obj )
  4866. {
  4867. Commands->Innate_Disable(obj);
  4868. if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
  4869. {
  4870. ActionParamsStruct params;
  4871. Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_03_ID ) );
  4872. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4873. params.Set_Movement( tailgunPosition, .25f, .35f );
  4874. Commands->Action_Goto( obj, params );
  4875. }
  4876. }
  4877. void Killed( GameObject * obj, GameObject * killer )
  4878. {
  4879. if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
  4880. {
  4881. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
  4882. }
  4883. }
  4884. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4885. {
  4886. ActionParamsStruct params;
  4887. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  4888. {
  4889. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  4890. Commands->Action_Enter_Exit ( obj, params );
  4891. }
  4892. }
  4893. };
  4894. DECLARE_SCRIPT(M01_TailGun_01_JDG, "")//M01_TAILGUN_01_ID 100243
  4895. {
  4896. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4897. {
  4898. ActionParamsStruct params;
  4899. if (param == M01_START_ACTING_JDG )
  4900. {
  4901. params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
  4902. params.Set_Attack( STAR, 50, 0, true );
  4903. params.AttackCheckBlocked = false;
  4904. Commands->Action_Attack ( obj, params );
  4905. }
  4906. }
  4907. };
  4908. DECLARE_SCRIPT(M01_TailGun_02_JDG, "")//M01_TAILGUN_02_ID 100244
  4909. {
  4910. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4911. {
  4912. ActionParamsStruct params;
  4913. if (param == M01_START_ACTING_JDG )
  4914. {
  4915. params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
  4916. params.Set_Attack( STAR, 50, 0, true );
  4917. params.AttackCheckBlocked = false;
  4918. Commands->Action_Attack ( obj, params );
  4919. }
  4920. }
  4921. };
  4922. DECLARE_SCRIPT(M01_TailGun_03_JDG, "")//M01_TAILGUN_03_ID 100245
  4923. {
  4924. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4925. {
  4926. ActionParamsStruct params;
  4927. if (param == M01_START_ACTING_JDG )
  4928. {
  4929. params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
  4930. params.Set_Attack( STAR, 50, 0, true );
  4931. params.AttackCheckBlocked = false;
  4932. Commands->Action_Attack ( obj, params );
  4933. }
  4934. }
  4935. };
  4936. DECLARE_SCRIPT(M01_Tailgun_02_SpawnApache_Zone_JDG, "")
  4937. {
  4938. void Entered( GameObject * obj, GameObject * enterer )
  4939. {
  4940. if (enterer == STAR )
  4941. {
  4942. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  4943. Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Tailgun_Apache_02.txt");
  4944. Commands->Destroy_Object ( obj );//this is a one-time zone--cleaning up
  4945. }
  4946. }
  4947. };
  4948. DECLARE_SCRIPT(M01_Civ_To_Minigunner_Guy_JDG, "")
  4949. {
  4950. void Created( GameObject * obj )
  4951. {
  4952. ActionParamsStruct params;
  4953. if (Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG))
  4954. {
  4955. Vector3 myGotoSpot = Commands->Get_Position ( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG) );
  4956. params.Set_Basic( this, 50, M01_WALKING_WAYPATH_01_JDG );
  4957. params.Set_Movement( myGotoSpot, RUN, 20 );
  4958. Commands->Action_Goto( obj, params );
  4959. }
  4960. }
  4961. };
  4962. DECLARE_SCRIPT(M01_Comm_Base_Commander_JDG, "")//this guys ID is M01_COMMCENTER_BASE_COMMANDER_JDG 101936
  4963. {
  4964. bool enemyEngaged;
  4965. REGISTER_VARIABLES()
  4966. {
  4967. SAVE_VARIABLE(enemyEngaged, 1);
  4968. }
  4969. void Created( GameObject * obj )
  4970. {
  4971. Commands->Innate_Disable(obj);
  4972. enemyEngaged = false;
  4973. }
  4974. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4975. {
  4976. if (damager == STAR && enemyEngaged == false)
  4977. {
  4978. enemyEngaged = true;
  4979. Commands->Innate_Enable(obj);
  4980. Commands->Action_Reset ( obj, 100 );
  4981. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  4982. Commands->Enable_Hibernation( obj, true );
  4983. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
  4984. }
  4985. }
  4986. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4987. {
  4988. if (enemy == STAR && enemyEngaged == false)
  4989. {
  4990. enemyEngaged = true;
  4991. Commands->Innate_Enable(obj);
  4992. Commands->Action_Reset ( obj, 100 );
  4993. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  4994. Commands->Enable_Hibernation( obj, true );
  4995. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
  4996. }
  4997. }
  4998. void Killed( GameObject * obj, GameObject * killer )
  4999. {
  5000. if (killer == STAR)
  5001. {
  5002. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
  5003. Vector3 spawn_location = Commands->Get_Position ( obj );
  5004. spawn_location.Z = spawn_location.Z + 0.75f;
  5005. bool player_has_level02_card = Commands->Has_Key( STAR, 2 );
  5006. if (player_has_level02_card == false)
  5007. {
  5008. Commands->Create_Object ( "Level_02_Keycard", spawn_location );
  5009. }
  5010. }
  5011. }
  5012. };
  5013. /*DECLARE_SCRIPT(M01_Comm_Base_Scapegoat_JDG, "")//this guys ID is M01_COMMCENTER_BASE_SCAPEGOAT_JDG 101938
  5014. {
  5015. void Created( GameObject * obj )
  5016. {
  5017. Vector3 myPosition = Commands->Get_Position ( obj );
  5018. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  5019. }
  5020. };
  5021. DECLARE_SCRIPT(M01_Comm_Ceiling_Camera_JDG, "")//this guys ID is M01_COMMCENTER_CEILING_CAMERA_JDG 101937
  5022. {
  5023. void Created( GameObject * obj )
  5024. {
  5025. ActionParamsStruct params;
  5026. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  5027. params.Set_Attack( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG), 0, 0, true );
  5028. Commands->Action_Attack( obj, params );
  5029. }
  5030. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5031. {
  5032. ActionParamsStruct params;
  5033. switch (param)
  5034. {
  5035. case M01_START_ATTACKING_01_JDG: //kane has told you to kill the scapegoat
  5036. {
  5037. if (Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG))
  5038. {
  5039. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  5040. params.Set_Attack( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG), 100, 0, true );
  5041. Commands->Action_Attack( obj, params );
  5042. }
  5043. }
  5044. break;
  5045. }
  5046. }
  5047. };*/
  5048. DECLARE_SCRIPT(M01_Comm_Stationary_Tech_JDG, "")
  5049. {
  5050. //these guys IDs are M01_COMMCENTER_UPSTAIRS_TECH_JDG 101168
  5051. //M01_COMMCENTER_WAROOM_TECH_01_JDG 101170
  5052. //M01_COMMCENTER_WAROOM_TECH_02_JDG 101171
  5053. Vector3 myLocation;
  5054. REGISTER_VARIABLES()
  5055. {
  5056. SAVE_VARIABLE(myLocation, 1);
  5057. }
  5058. void Created( GameObject * obj )
  5059. {
  5060. myLocation = Commands->Get_Position ( obj );
  5061. Commands->Innate_Disable(obj);
  5062. }
  5063. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5064. {
  5065. ActionParamsStruct params;
  5066. switch (param)
  5067. {
  5068. case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
  5069. {
  5070. Commands->Innate_Enable(obj);
  5071. Commands->Set_Innate_Aggressiveness ( obj, 0.15f );
  5072. Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
  5073. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5074. params.Set_Movement( myLocation, WALK, 0 );
  5075. Commands->Action_Goto( obj, params );
  5076. }
  5077. break;
  5078. }
  5079. }
  5080. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  5081. {
  5082. ActionParamsStruct params;
  5083. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5084. {
  5085. params.Set_Basic(this, 30, M01_DOING_ANIMATION_01_JDG);
  5086. params.Set_Animation( "H_A_CON2", false );
  5087. Commands->Action_Play_Animation ( obj, params );
  5088. }
  5089. else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5090. {
  5091. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5092. params.Set_Movement( myLocation, WALK, 0 );
  5093. Commands->Action_Goto( obj, params );
  5094. }
  5095. }
  5096. };
  5097. DECLARE_SCRIPT(M01_Comm_ComputerRoom_Tech_JDG, "")//this guys ID is M01_COMMCENTER_COMPUTERROOM_TECH_JDG 101172
  5098. {
  5099. Vector3 myLocation;
  5100. REGISTER_VARIABLES()
  5101. {
  5102. SAVE_VARIABLE(myLocation, 1);
  5103. }
  5104. void Created( GameObject * obj )
  5105. {
  5106. myLocation = Commands->Get_Position ( obj );
  5107. Commands->Innate_Disable(obj);
  5108. }
  5109. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5110. {
  5111. ActionParamsStruct params;
  5112. switch (param)
  5113. {
  5114. case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
  5115. {
  5116. Commands->Innate_Enable(obj);
  5117. Commands->Set_Innate_Aggressiveness ( obj, 0.15f );
  5118. Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
  5119. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5120. params.Set_Movement( myLocation, WALK, 0 );
  5121. Commands->Action_Goto( obj, params );
  5122. }
  5123. break;
  5124. }
  5125. }
  5126. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  5127. {
  5128. ActionParamsStruct params;
  5129. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5130. {
  5131. params.Set_Basic(this, 30, M01_DOING_ANIMATION_01_JDG);
  5132. params.Set_Animation( "H_A_CON2", false );
  5133. Commands->Action_Play_Animation ( obj, params );
  5134. }
  5135. else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5136. {
  5137. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5138. params.Set_Movement( myLocation, WALK, 0 );
  5139. Commands->Action_Goto( obj, params );
  5140. }
  5141. }
  5142. };
  5143. DECLARE_SCRIPT(M01_Comm_Upstairs_Guard_JDG, "")//this guys ID is M01_COMMCENTER_UPSTAIRS_GUARD_JDG 101946
  5144. {
  5145. void Created( GameObject * obj )
  5146. {
  5147. Commands->Innate_Disable(obj);
  5148. }
  5149. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5150. {
  5151. ActionParamsStruct params;
  5152. switch (param)
  5153. {
  5154. case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
  5155. {
  5156. Commands->Innate_Enable(obj);
  5157. Commands->Set_Innate_Aggressiveness ( obj, 0.75f );
  5158. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
  5159. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5160. params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
  5161. params.WaypathID = 101940;
  5162. params.WaypointStartID = 101944;
  5163. params.WaypointEndID = 101941;
  5164. Commands->Action_Goto( obj, params );
  5165. }
  5166. break;
  5167. }
  5168. }
  5169. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  5170. {
  5171. ActionParamsStruct params;
  5172. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5173. {
  5174. float delayTimer = Commands->Get_Random ( 1, 10 );
  5175. Commands->Start_Timer(obj, this, delayTimer, M01_WALKING_WAYPATH_01_JDG);
  5176. }
  5177. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  5178. {
  5179. float delayTimer = Commands->Get_Random ( 1, 10 );
  5180. Commands->Start_Timer(obj, this, delayTimer, M01_WALKING_WAYPATH_02_JDG);
  5181. }
  5182. }
  5183. void Timer_Expired(GameObject * obj, int timer_id)
  5184. {
  5185. ActionParamsStruct params;
  5186. switch (timer_id)
  5187. {
  5188. case M01_WALKING_WAYPATH_01_JDG:
  5189. {
  5190. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_02_JDG);
  5191. params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
  5192. params.WaypathID = 101940;
  5193. params.WaypointStartID = 101944;
  5194. params.WaypointEndID = 101941;
  5195. Commands->Action_Goto( obj, params );
  5196. }
  5197. break;
  5198. case M01_WALKING_WAYPATH_02_JDG:
  5199. {
  5200. params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
  5201. params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
  5202. params.WaypathID = 101940;
  5203. params.WaypointStartID = 101941;
  5204. params.WaypointEndID = 101944;
  5205. Commands->Action_Goto( obj, params );
  5206. }
  5207. break;
  5208. }
  5209. }
  5210. };
  5211. DECLARE_SCRIPT(M01_Comm_Base_Commander_Conv_Start_Zone_JDG, "")//this guys ID is 101947
  5212. {
  5213. void Entered( GameObject * obj, GameObject * enterer )
  5214. {
  5215. if (enterer == STAR )
  5216. {
  5217. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_NUMBER2_CONVERSATION_JDG, 0 );
  5218. GameObject * zone01 = Commands->Find_Object ( 101947 );
  5219. if (zone01 != NULL)
  5220. {
  5221. Commands->Destroy_Object ( zone01 );//this is a one-time only zone--cleaning up
  5222. }
  5223. GameObject * zone02 = Commands->Find_Object ( 111809 );
  5224. if (zone02 != NULL)
  5225. {
  5226. Commands->Destroy_Object ( zone02 );//this is a one-time only zone--cleaning up
  5227. }
  5228. }
  5229. }
  5230. };
  5231. DECLARE_SCRIPT(M01_Comm_Kane_n_Havoc_Conv_Start_Zone_JDG, "")//this guys ID is 101947
  5232. {
  5233. void Entered( GameObject * obj, GameObject * enterer )
  5234. {
  5235. if (enterer == STAR )
  5236. {
  5237. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
  5238. Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
  5239. }
  5240. }
  5241. };
  5242. DECLARE_SCRIPT(M01_HON_MCT_Placeholder_JDG, "")
  5243. {
  5244. void Killed( GameObject * obj, GameObject * killer )
  5245. {
  5246. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_KILL_THE_HON_JDG, 0 );
  5247. }
  5248. };
  5249. DECLARE_SCRIPT(M01_Comm_MCT_Placeholder_JDG, "")
  5250. {
  5251. void Killed( GameObject * obj, GameObject * killer )
  5252. {
  5253. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_KILL_THE_COMM_JDG, 0 );
  5254. }
  5255. };
  5256. DECLARE_SCRIPT(M01_GDI_Toolshed_PatrolGuy_JDG, "")
  5257. {
  5258. void Created( GameObject * obj )
  5259. {
  5260. ActionParamsStruct params;
  5261. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_01_JDG );
  5262. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5263. params.WaypathID = 102153;
  5264. params.WaypointStartID = 102154;
  5265. params.WaypointEndID = 102157;
  5266. Commands->Action_Goto( obj, params );
  5267. }
  5268. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  5269. {
  5270. ActionParamsStruct params;
  5271. switch (complete_reason)
  5272. {
  5273. case ACTION_COMPLETE_NORMAL:
  5274. {
  5275. switch (action_id)
  5276. {
  5277. case M01_WALKING_WAYPATH_01_JDG:
  5278. {
  5279. char *animationName = M01_Choose_Idle_Animation ( );
  5280. params.Set_Basic( this, 30, M01_DOING_ANIMATION_01_JDG );
  5281. params.Set_Animation (animationName, false);
  5282. Commands->Action_Play_Animation (obj, params);
  5283. }
  5284. break;
  5285. case M01_DOING_ANIMATION_01_JDG:
  5286. {
  5287. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_02_JDG );
  5288. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5289. params.WaypathID = 102159;
  5290. params.WaypointStartID = 102160;
  5291. params.WaypointEndID = 102168;
  5292. Commands->Action_Goto( obj, params );
  5293. }
  5294. break;
  5295. case M01_WALKING_WAYPATH_02_JDG:
  5296. {
  5297. char *animationName = M01_Choose_Idle_Animation ( );
  5298. params.Set_Basic( this, 30, M01_DOING_ANIMATION_02_JDG );
  5299. params.Set_Animation (animationName, false);
  5300. Commands->Action_Play_Animation (obj, params);
  5301. }
  5302. break;
  5303. case M01_DOING_ANIMATION_02_JDG:
  5304. {
  5305. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_03_JDG );
  5306. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5307. params.WaypathID = 102176;
  5308. params.WaypointStartID = 102177;
  5309. params.WaypointEndID = 102183;
  5310. Commands->Action_Goto( obj, params );
  5311. }
  5312. break;
  5313. case M01_WALKING_WAYPATH_03_JDG:
  5314. {
  5315. char *animationName = M01_Choose_Idle_Animation ( );
  5316. params.Set_Basic( this, 30, M01_DOING_ANIMATION_03_JDG );
  5317. params.Set_Animation (animationName, false);
  5318. Commands->Action_Play_Animation (obj, params);
  5319. }
  5320. break;
  5321. case M01_DOING_ANIMATION_03_JDG:
  5322. {
  5323. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_04_JDG );
  5324. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5325. params.WaypathID = 102176;
  5326. params.WaypointStartID = 102183;
  5327. params.WaypointEndID = 102177;
  5328. Commands->Action_Goto( obj, params );
  5329. }
  5330. break;
  5331. case M01_WALKING_WAYPATH_04_JDG:
  5332. {
  5333. char *animationName = M01_Choose_Idle_Animation ( );
  5334. params.Set_Basic( this, 30, M01_DOING_ANIMATION_04_JDG );
  5335. params.Set_Animation (animationName, false);
  5336. Commands->Action_Play_Animation (obj, params);
  5337. }
  5338. break;
  5339. case M01_DOING_ANIMATION_04_JDG:
  5340. {
  5341. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_05_JDG );
  5342. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5343. params.WaypathID = 102159;
  5344. params.WaypointStartID = 102168;
  5345. params.WaypointEndID = 102160;
  5346. Commands->Action_Goto( obj, params );
  5347. }
  5348. break;
  5349. case M01_WALKING_WAYPATH_05_JDG:
  5350. {
  5351. char *animationName = M01_Choose_Idle_Animation ( );
  5352. params.Set_Basic( this, 30, M01_DOING_ANIMATION_05_JDG );
  5353. params.Set_Animation (animationName, false);
  5354. Commands->Action_Play_Animation (obj, params);
  5355. }
  5356. break;
  5357. case M01_DOING_ANIMATION_05_JDG:
  5358. {
  5359. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_06_JDG );
  5360. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5361. params.WaypathID = 102153;
  5362. params.WaypointStartID = 102157;
  5363. params.WaypointEndID = 102154;
  5364. Commands->Action_Goto( obj, params );
  5365. }
  5366. break;
  5367. case M01_WALKING_WAYPATH_06_JDG:
  5368. {
  5369. char *animationName = M01_Choose_Idle_Animation ( );
  5370. params.Set_Basic( this, 30, M01_DOING_ANIMATION_06_JDG );
  5371. params.Set_Animation (animationName, false);
  5372. Commands->Action_Play_Animation (obj, params);
  5373. }
  5374. break;
  5375. case M01_DOING_ANIMATION_06_JDG:
  5376. {
  5377. params.Set_Basic( this, 30, M01_WALKING_WAYPATH_01_JDG );
  5378. params.Set_Movement( Vector3(0,0,0), WALK, .05f );
  5379. params.WaypathID = 102153;
  5380. params.WaypointStartID = 102154;
  5381. params.WaypointEndID = 102157;
  5382. Commands->Action_Goto( obj, params );
  5383. }
  5384. break;
  5385. }
  5386. }
  5387. break;
  5388. }
  5389. }
  5390. };
  5391. DECLARE_SCRIPT(M01_GDI_Base_Spawner_Controller_JDG, "")//this guys ID is M01_GDIBASE_SPAWNER_CONTROLLER_JDG
  5392. {
  5393. int active_unit_count;
  5394. REGISTER_VARIABLES()
  5395. {
  5396. SAVE_VARIABLE(active_unit_count, 1);
  5397. }
  5398. void Created( GameObject * obj )
  5399. {
  5400. active_unit_count = 0;
  5401. }
  5402. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5403. {
  5404. switch (param)
  5405. {
  5406. case M01_SPAWNER_IS_DEAD_JDG:
  5407. {
  5408. active_unit_count--;
  5409. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  5410. Commands->Debug_Message ( "***************************GDI Base spawner has recieved custom that someone is dead\n" );
  5411. }
  5412. break;
  5413. case M01_SPAWNER_SPAWN_PLEASE_JDG:
  5414. {
  5415. Commands->Enable_Hibernation( obj, false );
  5416. int currentDifficulty = Commands->Get_Difficulty_Level( );
  5417. int easy = 0;
  5418. int medium = 1;
  5419. int hard = 2;
  5420. if (currentDifficulty == easy)
  5421. {
  5422. if (active_unit_count == 0)
  5423. {
  5424. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
  5425. active_unit_count++;
  5426. Commands->Debug_Message ( "***************************GDI Base spawner has spawned an easy guy\n" );
  5427. }
  5428. }
  5429. else if (currentDifficulty == medium)
  5430. {
  5431. if (active_unit_count < 2)
  5432. {
  5433. int random = Commands->Get_Random(0.5f, 2.5f);
  5434. if ((random >= 0.5f) && (random < 1.5f))
  5435. {
  5436. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
  5437. active_unit_count++;
  5438. }
  5439. else
  5440. {
  5441. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_B_JDG );
  5442. active_unit_count++;
  5443. }
  5444. Commands->Debug_Message ( "***************************GDI Base spawner has spawned a medium guy\n" );
  5445. }
  5446. }
  5447. else if (currentDifficulty == hard)
  5448. {
  5449. if (active_unit_count < 3)
  5450. {
  5451. int random = Commands->Get_Random(0.5f, 3.5f);
  5452. if ((random >= 0.5f) && (random < 1.5f))
  5453. {
  5454. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
  5455. active_unit_count++;
  5456. }
  5457. else if ((random >= 1.5f) && (random < 2.5f))
  5458. {
  5459. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_B_JDG );
  5460. active_unit_count++;
  5461. }
  5462. else
  5463. {
  5464. Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_C_JDG );
  5465. active_unit_count++;
  5466. }
  5467. Commands->Debug_Message ( "***************************GDI Base spawner has spawned a hard guy\n" );
  5468. }
  5469. }
  5470. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 10 );
  5471. }
  5472. break;
  5473. case M01_QUIT_SPAWNING_PLEASE_JDG:
  5474. {
  5475. if (Commands->Find_Object (M01_GDIBASE_SPAWNER_A_JDG))
  5476. {
  5477. Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_A_JDG) );
  5478. }
  5479. if (Commands->Find_Object (M01_GDIBASE_SPAWNER_B_JDG))
  5480. {
  5481. Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_B_JDG) );
  5482. }
  5483. if (Commands->Find_Object (M01_GDIBASE_SPAWNER_C_JDG))
  5484. {
  5485. Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_C_JDG) );
  5486. }
  5487. Commands->Destroy_Object ( obj );
  5488. }
  5489. break;
  5490. }
  5491. }
  5492. };
  5493. DECLARE_SCRIPT(M01_GDI_Base_Spawner_Guy_JDG, "")
  5494. {
  5495. void Killed( GameObject * obj, GameObject * killer )
  5496. {
  5497. if (Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
  5498. {
  5499. Commands->Debug_Message ( "***************************GDI Base/barn area spawner has been killed--sending custom\n" );
  5500. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  5501. }
  5502. }
  5503. };
  5504. DECLARE_SCRIPT(M01_Tailgun_Run_Spawner_Controller_JDG, "")//this guys ID is M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG
  5505. {
  5506. int active_unit_count;
  5507. bool startup;
  5508. REGISTER_VARIABLES()
  5509. {
  5510. SAVE_VARIABLE(active_unit_count, 1);
  5511. SAVE_VARIABLE(startup, 2);
  5512. }
  5513. void Created( GameObject * obj )
  5514. {
  5515. Commands->Enable_Hibernation( obj, false );
  5516. active_unit_count = 0;
  5517. startup = true;
  5518. }
  5519. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5520. {
  5521. switch (param)
  5522. {
  5523. case M01_SPAWNER_IS_DEAD_JDG:
  5524. {
  5525. active_unit_count--;
  5526. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  5527. }
  5528. break;
  5529. case M01_SPAWNER_SPAWN_PLEASE_JDG:
  5530. {
  5531. int currentDifficulty = Commands->Get_Difficulty_Level( );
  5532. int easy = 0;
  5533. int medium = 1;
  5534. int hard = 2;
  5535. if (startup == true)
  5536. {
  5537. startup = false;
  5538. if (currentDifficulty == easy)
  5539. {
  5540. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5541. active_unit_count++;
  5542. }
  5543. else if (currentDifficulty == medium)
  5544. {
  5545. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5546. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
  5547. active_unit_count += 2;
  5548. }
  5549. else if (currentDifficulty == hard)
  5550. {
  5551. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5552. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
  5553. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_C_JDG );
  5554. active_unit_count += 3;
  5555. }
  5556. }
  5557. else
  5558. {
  5559. if (currentDifficulty == easy)
  5560. {
  5561. if (active_unit_count == 0)
  5562. {
  5563. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5564. active_unit_count++;
  5565. }
  5566. }
  5567. else if (currentDifficulty == medium)
  5568. {
  5569. if (active_unit_count < 2)
  5570. {
  5571. int random = Commands->Get_Random(0.5f, 2.5f);
  5572. if ((random >= 0.5f) && (random < 1.5f))
  5573. {
  5574. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5575. active_unit_count++;
  5576. }
  5577. else
  5578. {
  5579. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
  5580. active_unit_count++;
  5581. }
  5582. }
  5583. }
  5584. else if (currentDifficulty == hard)
  5585. {
  5586. if (active_unit_count < 3)
  5587. {
  5588. int random = Commands->Get_Random(0.5f, 3.5f);
  5589. if ((random >= 0.5f) && (random < 1.5f))
  5590. {
  5591. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
  5592. active_unit_count++;
  5593. }
  5594. else if ((random >= 1.5f) && (random < 2.5f))
  5595. {
  5596. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
  5597. active_unit_count++;
  5598. }
  5599. else
  5600. {
  5601. Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_C_JDG );
  5602. active_unit_count++;
  5603. }
  5604. }
  5605. }
  5606. }
  5607. }
  5608. break;
  5609. case M01_QUIT_SPAWNING_PLEASE_JDG:
  5610. {
  5611. if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_A_JDG))
  5612. {
  5613. Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_A_JDG) );
  5614. }
  5615. if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_B_JDG))
  5616. {
  5617. Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_B_JDG) );
  5618. }
  5619. if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_C_JDG))
  5620. {
  5621. Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_C_JDG) );
  5622. }
  5623. Commands->Destroy_Object ( obj );
  5624. }
  5625. break;
  5626. }
  5627. }
  5628. };
  5629. DECLARE_SCRIPT(M01_TailgunRun_Spawner_Guy_JDG, "")//Innate_Disable)(GameObject* object);(*Innate_Enable)(GameObject* object);
  5630. {
  5631. void Killed( GameObject * obj, GameObject * killer )
  5632. {
  5633. if (Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
  5634. {
  5635. Commands->Debug_Message ( "***************************taigun run area spawner has been killed--sending custom\n" );
  5636. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  5637. }
  5638. }
  5639. };
  5640. DECLARE_SCRIPT(M01_ChurchArea_Spawner_Controller_JDG, "")//this guys ID is M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG
  5641. {
  5642. int active_unit_count;
  5643. bool startup;
  5644. REGISTER_VARIABLES()
  5645. {
  5646. SAVE_VARIABLE(active_unit_count, 1);
  5647. SAVE_VARIABLE(startup, 2);
  5648. }
  5649. void Created( GameObject * obj )
  5650. {
  5651. Commands->Enable_Hibernation( obj, false );
  5652. active_unit_count = 0;
  5653. startup = true;
  5654. }
  5655. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5656. {
  5657. switch (param)
  5658. {
  5659. case M01_SPAWNER_IS_DEAD_JDG:
  5660. {
  5661. active_unit_count--;
  5662. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  5663. }
  5664. break;
  5665. case M01_SPAWNER_SPAWN_PLEASE_JDG:
  5666. {
  5667. int currentDifficulty = Commands->Get_Difficulty_Level( );
  5668. int easy = 0;
  5669. int medium = 1;
  5670. int hard = 2;
  5671. if (startup == true)
  5672. {
  5673. startup = false;
  5674. if (currentDifficulty == easy)
  5675. {
  5676. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5677. active_unit_count++;
  5678. }
  5679. else if (currentDifficulty == medium)
  5680. {
  5681. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5682. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
  5683. active_unit_count += 2;
  5684. }
  5685. else if (currentDifficulty == hard)
  5686. {
  5687. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5688. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
  5689. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_C_JDG );
  5690. active_unit_count += 3;
  5691. }
  5692. }
  5693. else
  5694. {
  5695. if (currentDifficulty == easy)
  5696. {
  5697. if (active_unit_count == 0)
  5698. {
  5699. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5700. active_unit_count++;
  5701. }
  5702. }
  5703. else if (currentDifficulty == medium)
  5704. {
  5705. if (active_unit_count < 2)
  5706. {
  5707. int random = Commands->Get_Random(0.5f, 2.5f);
  5708. if ((random >= 0.5f) && (random < 1.5f))
  5709. {
  5710. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5711. active_unit_count++;
  5712. }
  5713. else
  5714. {
  5715. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
  5716. active_unit_count++;
  5717. }
  5718. }
  5719. }
  5720. else if (currentDifficulty == hard)
  5721. {
  5722. if (active_unit_count < 3)
  5723. {
  5724. int random = Commands->Get_Random(0.5f, 3.5f);
  5725. if ((random >= 0.5f) && (random < 1.5f))
  5726. {
  5727. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
  5728. active_unit_count++;
  5729. }
  5730. else if ((random >= 1.5f) && (random < 2.5f))
  5731. {
  5732. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
  5733. active_unit_count++;
  5734. }
  5735. else
  5736. {
  5737. Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_C_JDG );
  5738. active_unit_count++;
  5739. }
  5740. }
  5741. }
  5742. }
  5743. }
  5744. break;
  5745. case M01_QUIT_SPAWNING_PLEASE_JDG:
  5746. {
  5747. if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_A_JDG))
  5748. {
  5749. Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_A_JDG) );
  5750. }
  5751. if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_B_JDG))
  5752. {
  5753. Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_B_JDG) );
  5754. }
  5755. if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_C_JDG))
  5756. {
  5757. Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_C_JDG) );
  5758. }
  5759. Commands->Destroy_Object ( obj );
  5760. }
  5761. break;
  5762. }
  5763. }
  5764. };
  5765. DECLARE_SCRIPT(M01_ChurchArea_Spawner_Guy_JDG, "")
  5766. {
  5767. void Killed( GameObject * obj, GameObject * killer )
  5768. {
  5769. if (Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
  5770. {
  5771. Commands->Debug_Message ( "***************************church area spawner has been killed--sending custom\n" );
  5772. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  5773. }
  5774. }
  5775. };
  5776. DECLARE_SCRIPT(M01_Turn_on_the_Hand_of_Nod_Zone_JDG, "")
  5777. {
  5778. void Entered( GameObject * obj, GameObject * enterer )
  5779. {
  5780. if (enterer == STAR )
  5781. {
  5782. if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
  5783. {
  5784. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  5785. }
  5786. if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
  5787. {
  5788. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNS_MINIGUNNER_JDG, 0 );
  5789. }
  5790. if (obj)
  5791. {
  5792. Commands->Destroy_Object ( obj);//this is a one-time only zone--cleaning up
  5793. }
  5794. }
  5795. }
  5796. };
  5797. /*DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_JDG, "")//M01_BARNAREA_NOD_COMMANDER_02_JDG 102476
  5798. {
  5799. bool deadYet;
  5800. bool firstTimeDamaged;
  5801. REGISTER_VARIABLES()
  5802. {
  5803. SAVE_VARIABLE(deadYet, 1);
  5804. SAVE_VARIABLE(firstTimeDamaged, 2);
  5805. }
  5806. void Created( GameObject * obj )
  5807. {
  5808. deadYet = false;
  5809. firstTimeDamaged = true;
  5810. Vector3 myPosition = Commands->Get_Position ( obj );
  5811. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
  5812. }
  5813. void Damaged( GameObject * obj, GameObject * damager, float amount )
  5814. {
  5815. if (obj)
  5816. {
  5817. if (damager == STAR && deadYet == false && firstTimeDamaged == true)
  5818. {
  5819. Vector3 myPosition = Commands->Get_Position ( obj );
  5820. Vector3 playerPosition = Commands->Get_Position ( STAR );
  5821. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  5822. if (playerDistance >= 15)
  5823. {
  5824. firstTimeDamaged = false;
  5825. ActionParamsStruct params;
  5826. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  5827. params.Set_Animation( "H_A_J21C", false );
  5828. Commands->Action_Play_Animation ( obj, params );
  5829. }
  5830. }
  5831. }
  5832. }
  5833. void Killed( GameObject * obj, GameObject * killer )
  5834. {
  5835. deadYet = true;
  5836. }
  5837. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5838. {
  5839. if (type == 0)
  5840. {
  5841. switch (param)
  5842. {
  5843. case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
  5844. {
  5845. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5846. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
  5847. }
  5848. break;
  5849. case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
  5850. {
  5851. if (obj)
  5852. {
  5853. int currentDifficulty = Commands->Get_Difficulty_Level( );
  5854. int medium = 1;
  5855. int hard = 2;
  5856. float delayTimer;
  5857. if (currentDifficulty == hard)
  5858. {
  5859. delayTimer = 60;
  5860. }
  5861. else if (currentDifficulty == medium)
  5862. {
  5863. delayTimer = 90;
  5864. }
  5865. else
  5866. {
  5867. delayTimer = 120;
  5868. }
  5869. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CHINOOK_JDG, delayTimer );
  5870. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  5871. }
  5872. }
  5873. break;
  5874. case M01_SEND_BARN_CHINOOK_JDG: //here comes player start calling in reinforcements
  5875. {
  5876. if (obj)
  5877. {
  5878. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_BARN_CHINOOK_JDG, 0 );
  5879. }
  5880. }
  5881. break;
  5882. case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
  5883. {
  5884. if (obj && deadYet == false)
  5885. {
  5886. GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
  5887. if (nodCommanderDialogController != NULL)
  5888. {
  5889. Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5890. }
  5891. float delayTimer = Commands->Get_Random ( 15, 30 );
  5892. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
  5893. }
  5894. }
  5895. break;
  5896. }
  5897. }
  5898. }
  5899. };*/
  5900. DECLARE_SCRIPT(M01_TailgunRun_NOD_Commander_JDG, "")//this guys ID is M01_TAILGUNAREA_NOD_COMMANDER_JDG 102358
  5901. {
  5902. bool deadYet;
  5903. bool firstTimeDamaged;
  5904. bool playerSeen;
  5905. REGISTER_VARIABLES()
  5906. {
  5907. SAVE_VARIABLE(deadYet, 1);
  5908. SAVE_VARIABLE(firstTimeDamaged, 2);
  5909. SAVE_VARIABLE(playerSeen, 2);
  5910. }
  5911. void Created( GameObject * obj )
  5912. {
  5913. deadYet = false;
  5914. firstTimeDamaged = true;
  5915. playerSeen = false;
  5916. Commands->Set_Innate_Is_Stationary ( obj, true );
  5917. }
  5918. void Damaged( GameObject * obj, GameObject * damager, float amount )
  5919. {
  5920. if (obj)
  5921. {
  5922. if (damager == STAR && deadYet == false && firstTimeDamaged == true)
  5923. {
  5924. Vector3 myPosition = Commands->Get_Position ( obj );
  5925. Vector3 playerPosition = Commands->Get_Position ( STAR );
  5926. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  5927. if (playerDistance >= 35)
  5928. {
  5929. firstTimeDamaged = false;
  5930. char *animationName = M01_Choose_Duck_Animation();
  5931. ActionParamsStruct params;
  5932. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  5933. params.Set_Animation( animationName, false );
  5934. Commands->Action_Play_Animation ( obj, params );
  5935. }
  5936. }
  5937. }
  5938. }
  5939. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  5940. {
  5941. if (enemy == STAR)
  5942. {
  5943. playerSeen = true;
  5944. }
  5945. }
  5946. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  5947. {
  5948. if (sound.Creator == STAR)
  5949. {
  5950. if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
  5951. {
  5952. if (obj)
  5953. {
  5954. if (deadYet == false && playerSeen == false)
  5955. {
  5956. Vector3 myPosition = Commands->Get_Position ( obj );
  5957. Vector3 playerPosition = Commands->Get_Position ( STAR );
  5958. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  5959. if (playerDistance >= 15)
  5960. {
  5961. //firstTimeDamaged = false;
  5962. char *animationName = M01_Choose_Duck_Animation();
  5963. ActionParamsStruct params;
  5964. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  5965. params.Set_Animation( animationName, false );
  5966. Commands->Action_Play_Animation ( obj, params );
  5967. }
  5968. }
  5969. }
  5970. }
  5971. }
  5972. }
  5973. void Killed( GameObject * obj, GameObject * killer )
  5974. {
  5975. deadYet = true;
  5976. }
  5977. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5978. {
  5979. if (type == 0)
  5980. {
  5981. switch (param)
  5982. {
  5983. case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
  5984. {
  5985. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5986. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
  5987. }
  5988. break;
  5989. case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
  5990. {
  5991. if (obj)
  5992. {
  5993. int currentDifficulty = Commands->Get_Difficulty_Level( );
  5994. int medium = 1;
  5995. int hard = 2;
  5996. float delayTimer;
  5997. if (currentDifficulty == hard)
  5998. {
  5999. delayTimer = 60;
  6000. }
  6001. else if (currentDifficulty == medium)
  6002. {
  6003. delayTimer = 90;
  6004. }
  6005. else
  6006. {
  6007. delayTimer = 120;
  6008. }
  6009. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_TAILGUN_CHINOOK_JDG, delayTimer );
  6010. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  6011. }
  6012. }
  6013. break;
  6014. case M01_SEND_TAILGUN_CHINOOK_JDG: //here comes player start calling in reinforcements
  6015. {
  6016. if (obj)
  6017. {
  6018. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_TAILGUN_CHINOOK_JDG, 0 );
  6019. }
  6020. }
  6021. break;
  6022. case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
  6023. {
  6024. if (obj && deadYet == false)
  6025. {
  6026. GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
  6027. if (nodCommanderDialogController != NULL)
  6028. {
  6029. Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  6030. }
  6031. float delayTimer = Commands->Get_Random ( 15, 30 );
  6032. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
  6033. }
  6034. }
  6035. break;
  6036. }
  6037. }
  6038. }
  6039. };
  6040. DECLARE_SCRIPT(M01_ChurchArea_NOD_Commander_JDG, "")//M01_CHURCHAREA_NOD_COMMANDER_JDG 102357
  6041. {
  6042. bool deadYet;
  6043. bool firstTimeDamaged;
  6044. bool playerSeen;
  6045. REGISTER_VARIABLES()
  6046. {
  6047. SAVE_VARIABLE(deadYet, 1);
  6048. SAVE_VARIABLE(firstTimeDamaged, 2);
  6049. SAVE_VARIABLE(playerSeen, 3);
  6050. }
  6051. void Created( GameObject * obj )
  6052. {
  6053. deadYet = false;
  6054. firstTimeDamaged = true;
  6055. playerSeen = false;
  6056. Commands->Set_Innate_Is_Stationary ( obj, true );
  6057. }
  6058. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6059. {
  6060. if (obj)
  6061. {
  6062. if (damager == STAR && deadYet == false && firstTimeDamaged == true && playerSeen == false)
  6063. {
  6064. Vector3 myPosition = Commands->Get_Position ( obj );
  6065. Vector3 playerPosition = Commands->Get_Position ( STAR );
  6066. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  6067. if (playerDistance >= 15)
  6068. {
  6069. firstTimeDamaged = false;
  6070. char *animationName = M01_Choose_Duck_Animation();
  6071. ActionParamsStruct params;
  6072. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  6073. params.Set_Animation( animationName, false );
  6074. Commands->Action_Play_Animation ( obj, params );
  6075. }
  6076. }
  6077. }
  6078. }
  6079. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  6080. {
  6081. if (enemy == STAR)
  6082. {
  6083. playerSeen = true;
  6084. }
  6085. }
  6086. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  6087. {
  6088. if (sound.Creator == STAR)
  6089. {
  6090. if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
  6091. {
  6092. if (obj)
  6093. {
  6094. if (deadYet == false && playerSeen == false)
  6095. {
  6096. Vector3 myPosition = Commands->Get_Position ( obj );
  6097. Vector3 playerPosition = Commands->Get_Position ( STAR );
  6098. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  6099. if (playerDistance >= 15)
  6100. {
  6101. //firstTimeDamaged = false;
  6102. char *animationName = M01_Choose_Duck_Animation();
  6103. ActionParamsStruct params;
  6104. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  6105. params.Set_Animation( animationName, false );
  6106. Commands->Action_Play_Animation ( obj, params );
  6107. }
  6108. }
  6109. }
  6110. }
  6111. }
  6112. }
  6113. void Killed( GameObject * obj, GameObject * killer )
  6114. {
  6115. deadYet = true;
  6116. }
  6117. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6118. {
  6119. if (type == 0)
  6120. {
  6121. switch (param)
  6122. {
  6123. case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
  6124. {
  6125. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  6126. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
  6127. }
  6128. break;
  6129. case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
  6130. {
  6131. if (obj)
  6132. {
  6133. int currentDifficulty = Commands->Get_Difficulty_Level( );
  6134. int medium = 1;
  6135. int hard = 2;
  6136. float delayTimer;
  6137. if (currentDifficulty == hard)
  6138. {
  6139. delayTimer = 60;
  6140. }
  6141. else if (currentDifficulty == medium)
  6142. {
  6143. delayTimer = 90;
  6144. }
  6145. else
  6146. {
  6147. delayTimer = 120;
  6148. }
  6149. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, delayTimer );
  6150. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  6151. }
  6152. }
  6153. break;
  6154. case M01_SEND_CHURCH_CHINOOK_JDG: //here comes player start calling in reinforcements
  6155. {
  6156. if (obj)
  6157. {
  6158. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_CHURCH_CHINOOK_JDG, 0 );
  6159. }
  6160. }
  6161. break;
  6162. case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
  6163. {
  6164. if (obj && deadYet == false)
  6165. {
  6166. GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
  6167. if (nodCommanderDialogController != NULL)
  6168. {
  6169. Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  6170. }
  6171. float delayTimer = Commands->Get_Random ( 15, 30 );
  6172. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
  6173. }
  6174. }
  6175. break;
  6176. }
  6177. }
  6178. }
  6179. };
  6180. DECLARE_SCRIPT(M01_GDI_Base_Artillery_Controller_JDG, "")//M01_GDIBASE_ARTILLERY_CONTROLLER_ID 102294
  6181. {
  6182. Vector3 locs[35];
  6183. Vector3 sound_location;
  6184. int last;
  6185. int bomb_sound;
  6186. float delayTimerMin;
  6187. float delayTimerMax;
  6188. bool command_clearance;
  6189. REGISTER_VARIABLES()
  6190. {
  6191. SAVE_VARIABLE(sound_location, 1);
  6192. SAVE_VARIABLE(last, 2);
  6193. SAVE_VARIABLE(bomb_sound, 3);
  6194. SAVE_VARIABLE(command_clearance, 4);
  6195. SAVE_VARIABLE(delayTimerMin, 5);
  6196. SAVE_VARIABLE(delayTimerMax, 6);
  6197. }
  6198. void Created( GameObject * obj )
  6199. {
  6200. locs[0] = Vector3(96.983f, -75.433f, -7.894f);
  6201. locs[1] = Vector3(64.778f,-70.692f, -7.917f );
  6202. locs[2] = Vector3(39.923f, -55.085f, -6.986f);
  6203. locs[3] = Vector3(64.088f, -51.238f, -1.130f);
  6204. locs[4] = Vector3(90.243f, -42.054f, 7.820f);
  6205. locs[5] = Vector3(101.932f, -22.724f, 3.892f);
  6206. locs[6] = Vector3(110.260f, 6.870f, 11.455f);
  6207. locs[7] = Vector3(104.993f, 34.865f, 7.102f);
  6208. locs[8] = Vector3(88.132f, 31.827f, 9.156f);
  6209. locs[9] = Vector3(82.538f, -2.162f, 7.260f);
  6210. locs[10] = Vector3(73.697f, 10.886f, 10.622f);
  6211. locs[11] = Vector3(61.373f, -9.328f, 9.156f);
  6212. locs[12] = Vector3(45.354f, -11.552f, 7.243f);
  6213. locs[13] = Vector3(53.740f, -1.580f, 13.105f);
  6214. locs[14] = Vector3(53.059f, 17.069f, 13.105f);
  6215. locs[15] = Vector3(24.016f, 8.417f, 7.113f);
  6216. locs[16] = Vector3(22.190f, -4.718f, 10.245f);
  6217. locs[17] = Vector3(1.074f, -48.981f, -1.604f);
  6218. locs[18] = Vector3(-17.956f, -48.856f, 3.441f);
  6219. locs[19] = Vector3(-46.404f, -26.827f, 6.827f);
  6220. locs[20] = Vector3(-40.934f, -20.838f, 2.387f);
  6221. locs[21] = Vector3(9.578f, -17.054f, 7.419f);
  6222. locs[22] = Vector3(-6.474f, -17.783f, 5.052f);
  6223. locs[23] = Vector3(-8.360f, -6.935f, 11.862f);
  6224. locs[24] = Vector3(5.836f, -4.874f, 17.664f);
  6225. locs[25] = Vector3(-40.130f, -1.333f, 6.052f);
  6226. locs[26] = Vector3(-43.953f, 5.812f, 14.117f);
  6227. locs[27] = Vector3(-50.261f, 32.361f, 5.410f);
  6228. locs[28] = Vector3(-50.813f, 48.439f, 11.585f);
  6229. locs[29] = Vector3(-40.847f, 60.449f, 5.454f);
  6230. locs[30] = Vector3(-36.209f, 68.892f, 14.059f);
  6231. locs[31] = Vector3(-14.355f, 40.254f, 3.190f);
  6232. locs[32] = Vector3(9.023f, 39.898f, 4.112f);
  6233. locs[33] = Vector3(-5.525f, 41.241f, 12.043f);
  6234. locs[34] = Vector3(24.496f, 52.051f, 9.968f);
  6235. last = 40;
  6236. delayTimerMin = 20;
  6237. delayTimerMax = 30;
  6238. command_clearance = true;
  6239. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
  6240. }
  6241. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6242. {
  6243. switch (param)
  6244. {
  6245. case M01_PICK_A_NEW_LOCATION_JDG:
  6246. {
  6247. if (command_clearance == true)
  6248. {
  6249. int random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
  6250. while (random == last)
  6251. {
  6252. random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
  6253. }
  6254. last = random;
  6255. sound_location = locs[random];
  6256. sound_location.Z += 10;
  6257. bomb_sound = Commands->Create_Sound ( "Bomb_Falling_Sound_Twiddler", sound_location, obj );
  6258. Commands->Monitor_Sound ( obj, bomb_sound );
  6259. }
  6260. }
  6261. break;
  6262. case M01_GOTO_IDLE_JDG:
  6263. {
  6264. command_clearance = false;
  6265. if (sender == Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ))//your "commander" is dead--destroy yourself
  6266. {
  6267. Commands->Destroy_Object ( obj );
  6268. }
  6269. }
  6270. break;
  6271. case M01_START_ACTING_JDG:
  6272. {
  6273. command_clearance = true;
  6274. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
  6275. }
  6276. break;
  6277. }
  6278. if (type == CUSTOM_EVENT_SOUND_ENDED )
  6279. {
  6280. if (param == bomb_sound)
  6281. {
  6282. Vector3 explosion_location = sound_location;
  6283. explosion_location.Z -= 10;
  6284. Commands->Create_Explosion("Ground Explosions Twiddler", explosion_location);
  6285. float delayTimer = Commands->Get_Random ( delayTimerMin, delayTimerMax );
  6286. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  6287. }
  6288. }
  6289. }
  6290. };
  6291. DECLARE_SCRIPT(M01_Nod_GuardTower_01_Enter_Zone_JDG, "")
  6292. {
  6293. void Entered( GameObject * obj, GameObject * enterer )
  6294. {
  6295. if (enterer == STAR)
  6296. {
  6297. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-148.379f, 342.954f, 9.656f));
  6298. Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-157.390 363.504 10.695, 148.379 342.954 9.656");
  6299. GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-149.930f, 338.900f, 9.170f));
  6300. Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-158.760 357.590 10.695, -149.930 338.900 9.170");
  6301. GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-146.812f, 339.745f, 9.345f));
  6302. Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-162.892 357.941 10.655, -146.812 339.745 9.345");
  6303. Commands->Destroy_Object ( obj );
  6304. }
  6305. }
  6306. };
  6307. DECLARE_SCRIPT(M01_Nod_GuardTower_02_Enter_Zone_JDG, "")
  6308. {
  6309. void Entered( GameObject * obj, GameObject * enterer )
  6310. {
  6311. if (enterer == STAR)
  6312. {
  6313. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-153.944f, 602.434f, 4.226f));
  6314. Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-141.665 573.039 4.409, -153.944 602.434 4.226");
  6315. GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-156.672f, 605.082f, 4.163f));
  6316. Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-138.653 576.128 4.889, -156.672 605.082 4.163");
  6317. GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-160.792f, 606.559f, 4.075f));
  6318. Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-143.313 580.514 4.337, -160.792 606.559 4.075");
  6319. Commands->Destroy_Object ( obj );
  6320. }
  6321. }
  6322. };
  6323. DECLARE_SCRIPT(M01_Nod_GuardTower_03_Enter_Zone_JDG, "")
  6324. {
  6325. void Entered( GameObject * obj, GameObject * enterer )
  6326. {
  6327. if (enterer == STAR)
  6328. {
  6329. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-254.164f, 564.968f, 30.630f));
  6330. Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-221.487 556.431 25.927, -254.164 564.968 30.630");
  6331. GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-253.935f, 561.105f, 30.922f));
  6332. Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-221.169 561.729 25.662, -253.935 561.105 30.922");
  6333. GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-257.185f, 562.242f, 30.540f));
  6334. Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-225.770 558.924 26.635, -257.185 562.242 30.540");
  6335. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-200.897f, 533.210f, 19.5f));
  6336. Commands->Attach_Script(controller1, "Test_Cinematic", "X1I_HON_Medlab_Chinook.txt");
  6337. Commands->Destroy_Object ( obj );
  6338. }
  6339. }
  6340. };
  6341. DECLARE_SCRIPT(M01_GuardTower_Sniper_Target_JDG, "wave_location:vector3, delete_location:vector3")
  6342. {
  6343. Vector3 runToPosition;
  6344. Vector3 leavePosition;
  6345. REGISTER_VARIABLES()
  6346. {
  6347. SAVE_VARIABLE(runToPosition, 1);
  6348. SAVE_VARIABLE(leavePosition, 2);
  6349. }
  6350. void Created( GameObject * obj )
  6351. {
  6352. runToPosition = Get_Vector3_Parameter("wave_location");
  6353. leavePosition = Get_Vector3_Parameter("delete_location");
  6354. Commands->Enable_Hibernation( obj, false );
  6355. ActionParamsStruct params;
  6356. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  6357. params.Set_Movement( runToPosition, RUN, 1);
  6358. Commands->Action_Goto ( obj, params );
  6359. }
  6360. void Killed( GameObject * obj, GameObject * killer )
  6361. {
  6362. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  6363. powerupSpawnLocation.Z += 0.75f;
  6364. char *powerups[2] =
  6365. {//this is a list of potential powerups to be dropped by sniper target guys
  6366. "POW_Health_100",
  6367. "POW_Armor_100",
  6368. };
  6369. int random = Commands->Get_Random_Int(0, 2);
  6370. //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
  6371. //if (spawn_effect)
  6372. //{
  6373. // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
  6374. //}
  6375. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  6376. }
  6377. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6378. {
  6379. ActionParamsStruct params;
  6380. if (param == M01_FACING_SPECIFIED_DIRECTION_01_JDG)
  6381. {
  6382. char *animationName = M01_Choose_Search_Animation ( );
  6383. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  6384. params.Set_Animation( animationName, false );
  6385. Commands->Action_Play_Animation ( obj, params );
  6386. }
  6387. }
  6388. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  6389. {
  6390. ActionParamsStruct params;
  6391. switch (complete_reason)
  6392. {
  6393. case ACTION_COMPLETE_NORMAL:
  6394. {
  6395. switch (action_id)
  6396. {
  6397. case M01_WALKING_WAYPATH_01_JDG:
  6398. {
  6399. params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  6400. params.Set_Attack( STAR, 0, 0, true );
  6401. Commands->Action_Attack ( obj, params );
  6402. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 1 );
  6403. }
  6404. break;
  6405. case M01_DOING_ANIMATION_01_JDG:
  6406. {
  6407. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  6408. params.Set_Movement( leavePosition, RUN, 5);
  6409. Commands->Action_Goto ( obj, params );
  6410. }
  6411. break;
  6412. case M01_WALKING_WAYPATH_02_JDG:
  6413. {
  6414. Commands->Destroy_Object ( obj );
  6415. }
  6416. break;
  6417. }
  6418. }
  6419. break;
  6420. }
  6421. }
  6422. };
  6423. DECLARE_SCRIPT(M01_Gunboat_Spawn_Hovercraft_Zone_JDG, "")//this guys id is 102500
  6424. {
  6425. /*bool okay_to_trigger;
  6426. REGISTER_VARIABLES()
  6427. {
  6428. SAVE_VARIABLE(okay_to_trigger, 1);
  6429. }
  6430. void Created( GameObject * obj )
  6431. {
  6432. okay_to_trigger = false;
  6433. }
  6434. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6435. {
  6436. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  6437. {
  6438. okay_to_trigger = true;
  6439. }
  6440. }
  6441. void Entered( GameObject * obj, GameObject * enterer )
  6442. {
  6443. if (okay_to_trigger == true)
  6444. {
  6445. if (enterer == Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID ))
  6446. {
  6447. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_THE_MEDIUM_TANK_JDG, 0 );
  6448. }
  6449. }
  6450. }*/
  6451. };
  6452. DECLARE_SCRIPT(M01_BasalBuilding_Population_JDG, "")
  6453. {
  6454. void Created( GameObject * obj )
  6455. {
  6456. Vector3 myPosition = Commands->Get_Position ( obj );
  6457. float myHomeRadius = Commands->Get_Random ( 2, 10 );
  6458. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRadius );
  6459. }
  6460. };
  6461. DECLARE_SCRIPT(M01_HarvesterScript_New_JDG, "")
  6462. {
  6463. int animation_count;
  6464. bool damagedYet;
  6465. bool deadYet;
  6466. REGISTER_VARIABLES()
  6467. {
  6468. SAVE_VARIABLE(animation_count, 1);
  6469. SAVE_VARIABLE(damagedYet, 2);
  6470. SAVE_VARIABLE(deadYet, 3);
  6471. }
  6472. void Created( GameObject * obj )
  6473. {
  6474. animation_count = 0;
  6475. damagedYet = false;
  6476. deadYet = false;
  6477. ActionParamsStruct params;
  6478. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6479. Vector3 loc (-103.5f, 375.6f, 19.0f);
  6480. loc.X += Commands->Get_Random(-1.0f, 1.0f);
  6481. loc.Y += Commands->Get_Random(-1.0f, 1.0f);
  6482. params.Set_Movement(loc, 0.25f, 1);
  6483. Commands->Action_Goto(obj, params);
  6484. }
  6485. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6486. {
  6487. if (obj && damager == STAR)
  6488. {
  6489. if (damagedYet == false)
  6490. {
  6491. if (deadYet == false)
  6492. {
  6493. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 0.25 );
  6494. }
  6495. damagedYet = true;
  6496. }
  6497. }
  6498. }
  6499. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6500. {
  6501. if (type == 0)
  6502. {
  6503. if (param == M01_START_ACTING_JDG)
  6504. {
  6505. if (deadYet == false)
  6506. {
  6507. int lockeHarvester = Commands->Create_Conversation( "M01_Add_Harvester_Objective", 100, 1000, true);
  6508. Commands->Join_Conversation( NULL, lockeHarvester, false, false );
  6509. Commands->Start_Conversation( lockeHarvester, lockeHarvester );
  6510. }
  6511. }
  6512. }
  6513. }
  6514. void Killed( GameObject * obj, GameObject * killer )
  6515. {
  6516. deadYet = true;
  6517. Commands->Create_Sound ( "EVA_Nod_Unit_Destroyed", Vector3 (0,0,0), obj);
  6518. Vector3 HarvesterDeathSpot (-93.9f, 426.6f, 21.0f);
  6519. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", HarvesterDeathSpot);
  6520. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  6521. }
  6522. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
  6523. {
  6524. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  6525. {
  6526. animation_count = 0;
  6527. Commands->Set_Animation(obj, "V_NOD_HRVSTR.V_NOD_HRVSTR", false);
  6528. }
  6529. }
  6530. void Animation_Complete(GameObject * obj, const char *anim)
  6531. {
  6532. if (animation_count <= 2)
  6533. {
  6534. Commands->Set_Animation(obj, "V_NOD_HRVSTR.V_NOD_HRVSTR", false);
  6535. animation_count++;
  6536. }
  6537. else
  6538. {
  6539. Gather_Tiberium();
  6540. }
  6541. }
  6542. void Gather_Tiberium(void)
  6543. {
  6544. ActionParamsStruct params;
  6545. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6546. Vector3 loc (-103.5f, 375.6f, 19.0f);
  6547. loc.X += Commands->Get_Random(-3.0f, 3.0f);
  6548. loc.Y += Commands->Get_Random(-3.0f, 3.0f);
  6549. params.Set_Movement(loc, 0.25f, 2);
  6550. Commands->Action_Goto(Owner(), params);
  6551. }
  6552. };
  6553. DECLARE_SCRIPT(M01_TibField_Guard01_New_JDG, "")
  6554. {
  6555. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6556. {
  6557. if (param == M01_START_ACTING_JDG)
  6558. {
  6559. GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
  6560. GameObject * chemGuy02 = Commands->Find_Object ( 103271 );
  6561. GameObject * chemGuy03 = Commands->Find_Object ( 103272 );
  6562. if (chemGuy01 != NULL)
  6563. {
  6564. if (chemGuy02 != NULL)
  6565. {
  6566. if (chemGuy03 != NULL)
  6567. {
  6568. int tibFieldConv = Commands->Create_Conversation( "M01_TiberiumField_Conversation", 80, 25, true);
  6569. Commands->Join_Conversation( chemGuy01, tibFieldConv);
  6570. Commands->Join_Conversation( chemGuy02, tibFieldConv);
  6571. Commands->Join_Conversation( chemGuy03, tibFieldConv);
  6572. Commands->Start_Conversation( tibFieldConv, tibFieldConv );
  6573. }
  6574. }
  6575. }
  6576. }
  6577. }
  6578. };
  6579. DECLARE_SCRIPT(M01_Barn_Babushkas_Conversation_Zone_JDG, "")//this guys ID is 101662
  6580. {
  6581. bool okay_to_play_conversation;
  6582. bool playerEntered;
  6583. REGISTER_VARIABLES()
  6584. {
  6585. SAVE_VARIABLE(okay_to_play_conversation, 1);
  6586. SAVE_VARIABLE(playerEntered, 2);
  6587. }
  6588. void Created( GameObject * obj )
  6589. {
  6590. okay_to_play_conversation = false;
  6591. playerEntered = false;
  6592. }
  6593. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6594. {
  6595. ActionParamsStruct params;
  6596. if ((param == M01_START_ACTING_JDG))//babushka is in position--give okay for conversation
  6597. {
  6598. okay_to_play_conversation = true;
  6599. Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
  6600. }
  6601. else if (param == M01_CUE_BABUSHKA_CONVERSATION_JDG)
  6602. {
  6603. if (playerEntered == true && okay_to_play_conversation == true)
  6604. {
  6605. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
  6606. GameObject * babushkaZone = Commands->Find_Object ( 101662 );
  6607. GameObject * billyZone = Commands->Find_Object ( 101661 );
  6608. if (babushkaZone != NULL)
  6609. {
  6610. Commands->Destroy_Object ( babushkaZone );//this is one-time only zone--cleaning up
  6611. }
  6612. if (billyZone != NULL)
  6613. {
  6614. Commands->Destroy_Object ( billyZone );//this is one-time only zone--cleaning up
  6615. }
  6616. }
  6617. }
  6618. }
  6619. void Exited( GameObject * obj, GameObject * exiter )
  6620. {
  6621. if (exiter == STAR)
  6622. {
  6623. playerEntered = false;
  6624. }
  6625. }
  6626. void Entered( GameObject * obj, GameObject * enterer )
  6627. {
  6628. if (enterer == STAR )
  6629. {
  6630. playerEntered = true;
  6631. Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
  6632. }
  6633. }
  6634. };
  6635. DECLARE_SCRIPT(M01_Barn_Point_Guard_01_JDG, "")//this guys ID is 101439
  6636. {
  6637. void Created( GameObject * obj )
  6638. {
  6639. Commands->Set_Innate_Is_Stationary ( obj, true );
  6640. }
  6641. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6642. {
  6643. if (obj)
  6644. {
  6645. if (damager == STAR)
  6646. {
  6647. Commands->Set_Innate_Is_Stationary ( obj, false );
  6648. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  6649. if (Commands->Find_Object ( 101658 ))
  6650. {
  6651. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101658 ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );//this is sent to his nearby buddy
  6652. }
  6653. }
  6654. }
  6655. }
  6656. void Killed( GameObject * obj, GameObject * killer )
  6657. {
  6658. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
  6659. }
  6660. };
  6661. DECLARE_SCRIPT(M01_Barn_Point_Guard_02_JDG, "")//this guys ID is 101658
  6662. {
  6663. bool retreating;
  6664. REGISTER_VARIABLES()
  6665. {
  6666. SAVE_VARIABLE(retreating, 1);
  6667. }
  6668. void Created( GameObject * obj )
  6669. {
  6670. Vector3 myPosition = Commands->Get_Position ( obj );
  6671. retreating = false;
  6672. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 2.0f );
  6673. }
  6674. /*void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6675. {
  6676. ActionParamsStruct params;
  6677. if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
  6678. {
  6679. Commands->Set_Innate_Is_Stationary ( obj, false );
  6680. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
  6681. params.Set_Movement( Vector3 (-44.8f, 117.8f, 2.6f), .8f, 1 );
  6682. params.Set_Attack( STAR, 15, 0, true );
  6683. Commands->Action_Attack ( obj, params );
  6684. }
  6685. }*/
  6686. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6687. {
  6688. if (obj)
  6689. {
  6690. if (damager == STAR)
  6691. {
  6692. if (obj && retreating == false)
  6693. {
  6694. if (Commands->Get_Health (obj) > 0)
  6695. {
  6696. Vector3 myPosition = Commands->Get_Position ( obj );
  6697. Commands->Create_Sound ( "WereOutGunned_2", myPosition, obj );
  6698. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  6699. //ActionParamsStruct params;
  6700. //params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6701. //params.Set_Movement( Commands->Find_Object ( M01_BARN_PRISONER_01_ID ), 1, 5 );
  6702. //params.Set_Attack( STAR, 50, 0, true );
  6703. //Commands->Action_Attack ( obj, params );
  6704. retreating = true;
  6705. }
  6706. }
  6707. }
  6708. }
  6709. }
  6710. void Killed( GameObject * obj, GameObject * killer )
  6711. {
  6712. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
  6713. }
  6714. };
  6715. DECLARE_SCRIPT(M01_Barn_Door_Guard_JDG, "")//this guys ID is M01_BARN_DOOR_GUARD_ID 101512
  6716. {
  6717. void Created( GameObject * obj )
  6718. {
  6719. Vector3 myPosition = Commands->Get_Position ( obj );
  6720. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5.0f );
  6721. }
  6722. //void Damaged( GameObject * obj, GameObject * damager, float amount )
  6723. //{
  6724. // Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
  6725. //}
  6726. void Killed( GameObject * obj, GameObject * killer )
  6727. {
  6728. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
  6729. }
  6730. };
  6731. DECLARE_SCRIPT(M01_Barn_Talk_Guard_01_JDG, "")//this guys ID is M01_BARN_TALK_GUARD_01_ID 103318
  6732. {
  6733. void Created( GameObject * obj )
  6734. {
  6735. Vector3 myPosition = Commands->Get_Position ( obj );
  6736. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5.0f );
  6737. }
  6738. //void Damaged( GameObject * obj, GameObject * damager, float amount )
  6739. //{
  6740. // Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
  6741. //}
  6742. void Killed( GameObject * obj, GameObject * killer )
  6743. {
  6744. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
  6745. }
  6746. };
  6747. DECLARE_SCRIPT(M01_BarnArea_AI_ExitZone_JDG, "")//112015 -- tunnel 112016 -- shack
  6748. {
  6749. int hovercraftGuyId;
  6750. REGISTER_VARIABLES()
  6751. {
  6752. SAVE_VARIABLE(hovercraftGuyId, 1);
  6753. }
  6754. void Created( GameObject * obj )
  6755. {
  6756. hovercraftGuyId = 0;
  6757. }
  6758. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6759. {
  6760. if (type == M01_ROPE_IS_SENDING_ID_JDG)
  6761. {
  6762. hovercraftGuyId = param;
  6763. }
  6764. }
  6765. void Entered( GameObject * obj, GameObject * enterer )
  6766. {
  6767. GameObject * hovercraftGuy = Commands->Find_Object ( hovercraftGuyId );
  6768. if (hovercraftGuy != NULL && enterer == hovercraftGuy)
  6769. {
  6770. Commands->Send_Custom_Event( obj, hovercraftGuy, 0, M01_HOLD_YOUR_POSITION_JDG, 0 );
  6771. }
  6772. }
  6773. };
  6774. DECLARE_SCRIPT(M01_TurretBeach_GDI_Guy_01_JDG, "")//
  6775. {
  6776. int turretbeach_conv;
  6777. REGISTER_VARIABLES()
  6778. {
  6779. SAVE_VARIABLE(turretbeach_conv, 1);
  6780. }
  6781. void Created( GameObject * obj )
  6782. {
  6783. int myId = Commands->Get_ID ( obj );
  6784. GameObject * myExitZone01 = Commands->Find_Object ( 112015 );
  6785. GameObject * myExitZone02 = Commands->Find_Object ( 112016 );
  6786. if (myExitZone01 != NULL)
  6787. {
  6788. Commands->Send_Custom_Event( obj, myExitZone01, M01_ROPE_IS_SENDING_ID_JDG, myId, 0 );
  6789. }
  6790. if (myExitZone02 != NULL)
  6791. {
  6792. Commands->Send_Custom_Event( obj, myExitZone02, M01_ROPE_IS_SENDING_ID_JDG, myId, 0 );
  6793. }
  6794. }
  6795. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6796. {
  6797. if (type == 0)
  6798. {
  6799. if (param == M01_HOLD_YOUR_POSITION_JDG)
  6800. {
  6801. ActionParamsStruct params;
  6802. Commands->Action_Reset ( obj, 100 );
  6803. Vector3 myGuardSpot (-49.146f, 201.741f, 1.590f);
  6804. params.Set_Basic( this, 55, M01_WALKING_WAYPATH_01_JDG );
  6805. params.Set_Movement( myGuardSpot, RUN, 1 );
  6806. Commands->Action_Goto( obj, params );
  6807. Commands->Set_Innate_Soldier_Home_Location ( obj, myGuardSpot, 5 );
  6808. }
  6809. }
  6810. }
  6811. void Animation_Complete(GameObject * obj, const char *anim)
  6812. {
  6813. if (stricmp(anim, "S_A_Human.H_A_X1E_Run") == 0)
  6814. {
  6815. ActionParamsStruct params;
  6816. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  6817. params.Set_Movement(STAR, RUN, 6);
  6818. Commands->Action_Goto(obj, params);
  6819. }
  6820. }
  6821. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  6822. {
  6823. ActionParamsStruct params;
  6824. if (action_id == M01_HUNT_THE_PLAYER_JDG)
  6825. {
  6826. turretbeach_conv = Commands->Create_Conversation( "M01_TurretBeach_TurnOverTank_Conversation", 100, 50, true);
  6827. Commands->Join_Conversation( obj, turretbeach_conv, true, true );
  6828. Commands->Start_Conversation( turretbeach_conv, turretbeach_conv );
  6829. Commands->Monitor_Conversation (obj, turretbeach_conv);
  6830. }
  6831. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  6832. {
  6833. if (action_id == turretbeach_conv)
  6834. {
  6835. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
  6836. params.Set_Movement(Vector3 (-49.7f, 109.7f, 2.0f), RUN, 0.5f);
  6837. Commands->Action_Goto(obj, params);
  6838. }
  6839. }
  6840. else if (action_id == M01_WALKING_WAYPATH_01_JDG)
  6841. {
  6842. Vector3 myPosition = Commands->Get_Position ( obj );
  6843. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
  6844. }
  6845. }
  6846. };
  6847. DECLARE_SCRIPT(M01_TurretBeach_GDI_Guy_02_JDG, "")
  6848. {
  6849. void Animation_Complete(GameObject * obj, const char *anim)
  6850. {
  6851. if (stricmp(anim, "S_A_Human.H_A_X1E_Run") == 0)
  6852. {
  6853. ActionParamsStruct params;
  6854. GameObject * nearbyTailgun = Commands->Find_Object ( 101448 );
  6855. if (nearbyTailgun != NULL)
  6856. {
  6857. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6858. params.Set_Movement(nearbyTailgun, RUN, 0.5f);
  6859. Commands->Action_Goto(obj, params);
  6860. }
  6861. else
  6862. {
  6863. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
  6864. params.Set_Movement(Vector3 (-65.4f, 204.6f, 3.7f), RUN, 0.5f);
  6865. Commands->Action_Goto(obj, params);
  6866. }
  6867. }
  6868. }
  6869. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  6870. {
  6871. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  6872. {
  6873. Vector3 myPosition = Commands->Get_Position ( obj );
  6874. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
  6875. }
  6876. }
  6877. };
  6878. DECLARE_SCRIPT(M01_DetentionPen_CivDeathMonitor, "")
  6879. {
  6880. bool damagedYet;
  6881. REGISTER_VARIABLES()
  6882. {
  6883. SAVE_VARIABLE(damagedYet, 1);
  6884. }
  6885. void Created( GameObject * obj )
  6886. {
  6887. damagedYet = false;
  6888. }
  6889. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6890. {
  6891. if (obj && damagedYet == false)
  6892. {
  6893. damagedYet = true;
  6894. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0512I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  6895. }
  6896. }
  6897. void Killed( GameObject * obj, GameObject * killer )
  6898. {
  6899. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0513I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  6900. Commands->Mission_Complete ( false );
  6901. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103380 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  6902. }
  6903. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6904. {
  6905. switch (param)
  6906. {
  6907. case M01_GOING_TO_EVAC_SPOT02_JDG:
  6908. {
  6909. Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( 103380 ) );
  6910. ActionParamsStruct params;
  6911. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT02_JDG);
  6912. params.Set_Movement(myEvacSpot, RUN, 0.25f);
  6913. Commands->Action_Goto(obj, params);
  6914. }
  6915. break;
  6916. }
  6917. }
  6918. };
  6919. DECLARE_SCRIPT(M01_DetentionPen_GDIDeathMonitor, "")
  6920. {
  6921. bool damagedYet;
  6922. REGISTER_VARIABLES()
  6923. {
  6924. SAVE_VARIABLE(damagedYet, 1);
  6925. }
  6926. void Created( GameObject * obj )
  6927. {
  6928. damagedYet = false;
  6929. }
  6930. void Damaged( GameObject * obj, GameObject * damager, float amount )
  6931. {
  6932. if (obj && damagedYet == false)
  6933. {
  6934. damagedYet = true;
  6935. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0512I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  6936. }
  6937. }
  6938. void Killed( GameObject * obj, GameObject * killer )
  6939. {
  6940. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0513I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  6941. Commands->Mission_Complete ( false );
  6942. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103380 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  6943. }
  6944. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6945. {
  6946. switch (param)
  6947. {
  6948. case M01_GOING_TO_EVAC_SPOT02_JDG:
  6949. {
  6950. Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( 103381 ) );
  6951. ActionParamsStruct params;
  6952. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT02_JDG);
  6953. params.Set_Movement(myEvacSpot, RUN, 0.25f);
  6954. Commands->Action_Goto(obj, params);
  6955. }
  6956. break;
  6957. }
  6958. }
  6959. };
  6960. DECLARE_SCRIPT(M01_DetentionPen_Evac_Controller01_JDG, "")//103380
  6961. {
  6962. //civGuy01 = 101929
  6963. //civGuy02 = 101930
  6964. //civGuy03 = 101931
  6965. int evac_waypath_id;
  6966. int evac_helicopter_id;
  6967. int deadPrisonerTally;
  6968. REGISTER_VARIABLES()
  6969. {
  6970. SAVE_VARIABLE(evac_waypath_id, 1);
  6971. SAVE_VARIABLE(evac_helicopter_id, 2);
  6972. SAVE_VARIABLE(deadPrisonerTally, 3);
  6973. }
  6974. void Created( GameObject * obj )
  6975. {
  6976. deadPrisonerTally = 0;
  6977. }
  6978. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6979. {
  6980. if (param == M01_START_ACTING_JDG)//prisoner have been freed--call in air evac
  6981. {
  6982. GameObject * civGuy01 = Commands->Find_Object ( 101929 );
  6983. GameObject * civGuy02 = Commands->Find_Object ( 101930 );
  6984. GameObject * civGuy03 = Commands->Find_Object ( 101931 );
  6985. if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
  6986. {
  6987. //Vector3 evacPosition = Commands->Get_Position ( obj );
  6988. //GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  6989. //Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_Detention_EvacAnim.txt");
  6990. }
  6991. }
  6992. else if (param == M01_CIVILIAN_KILLED_JDG)
  6993. {
  6994. deadPrisonerTally++;
  6995. if (deadPrisonerTally == 1)
  6996. {
  6997. Commands->Mission_Complete ( false );
  6998. }
  6999. }
  7000. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//civs are on board--send aircraft away
  7001. {
  7002. GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
  7003. GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
  7004. if (evacChopper != NULL)
  7005. {
  7006. Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7007. }
  7008. if (evacWaypath != NULL)
  7009. {
  7010. Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7011. }
  7012. }
  7013. }
  7014. };
  7015. DECLARE_SCRIPT(M01_DetentionCiv_Air_Evac_Waypath_JDG, "")
  7016. {
  7017. void Animation_Complete(GameObject * obj, const char *anim)
  7018. {
  7019. if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathA") == 0)
  7020. {
  7021. Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_Pathloop", true );
  7022. }
  7023. else if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathZ") == 0)
  7024. {
  7025. Commands->Destroy_Object ( obj );
  7026. }
  7027. }
  7028. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7029. {
  7030. switch (param)
  7031. {
  7032. case M01_MODIFY_YOUR_ACTION_JDG:
  7033. {
  7034. Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_PathZ", false );
  7035. }
  7036. break;
  7037. }
  7038. }
  7039. };
  7040. DECLARE_SCRIPT(M01_DetentionCiv_Air_Evac_Chopper_JDG, "")
  7041. {
  7042. void Created( GameObject * obj )
  7043. {
  7044. Commands->Set_Shield_Type ( obj, "Blamo" );
  7045. Commands->Enable_Hibernation( obj, false );
  7046. Commands->Disable_Physical_Collisions ( obj );
  7047. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  7048. }
  7049. void Damaged( GameObject * obj, GameObject * damager, float amount )
  7050. {
  7051. float myMaxHealth = Commands->Get_Max_Health ( obj );
  7052. Commands->Set_Health ( obj, myMaxHealth );
  7053. }
  7054. void Animation_Complete(GameObject * obj, const char *anim)
  7055. {
  7056. if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsA") == 0)
  7057. {
  7058. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsloop", true );
  7059. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  7060. GameObject * civGuy01 = Commands->Find_Object ( 101929 );
  7061. GameObject * civGuy02 = Commands->Find_Object ( 101930 );
  7062. GameObject * civGuy03 = Commands->Find_Object ( 101931 );
  7063. if (civGuy01 != NULL)
  7064. {
  7065. Commands->Send_Custom_Event ( obj, civGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7066. }
  7067. if (civGuy02 != NULL)
  7068. {
  7069. Commands->Send_Custom_Event ( obj, civGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7070. }
  7071. if (civGuy03 != NULL)
  7072. {
  7073. Commands->Send_Custom_Event ( obj, civGuy03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7074. }
  7075. }
  7076. else if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsz") == 0)
  7077. {
  7078. Commands->Destroy_Object ( obj );
  7079. }
  7080. }
  7081. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7082. {
  7083. switch (param)
  7084. {
  7085. case M01_MODIFY_YOUR_ACTION_JDG:
  7086. {
  7087. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsz", false );
  7088. }
  7089. break;
  7090. case M01_GOTO_IDLE_JDG:
  7091. {
  7092. Commands->Enable_Collisions ( obj );
  7093. }
  7094. break;
  7095. case M01_DO_END_MISSION_CHECK_JDG:
  7096. {
  7097. GameObject * civGuy01 = Commands->Find_Object ( 101929 );
  7098. GameObject * civGuy02 = Commands->Find_Object ( 101930 );
  7099. GameObject * civGuy03 = Commands->Find_Object ( 101931 );
  7100. if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
  7101. {
  7102. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  7103. }
  7104. else
  7105. {
  7106. GameObject * civController = Commands->Find_Object ( 103380 );
  7107. if (civController != NULL)
  7108. {
  7109. Commands->Send_Custom_Event ( obj, civController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7110. }
  7111. }
  7112. }
  7113. break;
  7114. }
  7115. }
  7116. };
  7117. DECLARE_SCRIPT(M01_DetentionPen_Evac_Controller02_JDG, "")//103381
  7118. {
  7119. //gdiGuy01 = 101926
  7120. //gdiGuy02 = 101927
  7121. //gdiGuy03 = 101928
  7122. int evac_waypath_id;
  7123. int evac_helicopter_id;
  7124. REGISTER_VARIABLES()
  7125. {
  7126. SAVE_VARIABLE(evac_waypath_id, 1);
  7127. SAVE_VARIABLE(evac_helicopter_id, 2);
  7128. }
  7129. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7130. {
  7131. if (param == M01_START_ACTING_JDG)//prisoner have been freed--call in air evac
  7132. {
  7133. GameObject * civGuy01 = Commands->Find_Object ( 101929 );
  7134. GameObject * civGuy02 = Commands->Find_Object ( 101930 );
  7135. GameObject * civGuy03 = Commands->Find_Object ( 101931 );
  7136. if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
  7137. {
  7138. //Vector3 evacPosition = Commands->Get_Position ( obj );
  7139. //GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  7140. //Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_Detention_EvacAnim.txt");
  7141. }
  7142. }
  7143. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//civs are on board--send aircraft away
  7144. {
  7145. GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
  7146. GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
  7147. if (evacChopper != NULL)
  7148. {
  7149. Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7150. }
  7151. if (evacWaypath != NULL)
  7152. {
  7153. Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7154. }
  7155. }
  7156. }
  7157. };
  7158. DECLARE_SCRIPT(M01_DetentionGDI_Air_Evac_Waypath_JDG, "")
  7159. {
  7160. void Animation_Complete(GameObject * obj, const char *anim)
  7161. {
  7162. if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathA") == 0)
  7163. {
  7164. Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_Pathloop", true );
  7165. }
  7166. else if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathZ") == 0)
  7167. {
  7168. Commands->Destroy_Object ( obj );
  7169. }
  7170. }
  7171. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7172. {
  7173. switch (param)
  7174. {
  7175. case M01_MODIFY_YOUR_ACTION_JDG:
  7176. {
  7177. Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_PathZ", false );
  7178. }
  7179. break;
  7180. }
  7181. }
  7182. };
  7183. DECLARE_SCRIPT(M01_DetentionGDI_Air_Evac_Chopper_JDG, "")
  7184. {
  7185. void Created( GameObject * obj )
  7186. {
  7187. Commands->Set_Shield_Type ( obj, "Blamo" );
  7188. Commands->Enable_Hibernation( obj, false );
  7189. Commands->Disable_Physical_Collisions ( obj );
  7190. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  7191. }
  7192. void Damaged( GameObject * obj, GameObject * damager, float amount )
  7193. {
  7194. float myMaxHealth = Commands->Get_Max_Health ( obj );
  7195. Commands->Set_Health ( obj, myMaxHealth );
  7196. }
  7197. void Animation_Complete(GameObject * obj, const char *anim)
  7198. {
  7199. if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsA") == 0)
  7200. {
  7201. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsloop", true );
  7202. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  7203. GameObject * GDIGuy01 = Commands->Find_Object ( 101926 );
  7204. GameObject * GDIGuy02 = Commands->Find_Object ( 101927 );
  7205. GameObject * GDIGuy03 = Commands->Find_Object ( 101928 );
  7206. if (GDIGuy01 != NULL)
  7207. {
  7208. Commands->Send_Custom_Event ( obj, GDIGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7209. }
  7210. if (GDIGuy02 != NULL)
  7211. {
  7212. Commands->Send_Custom_Event ( obj, GDIGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7213. }
  7214. if (GDIGuy03 != NULL)
  7215. {
  7216. Commands->Send_Custom_Event ( obj, GDIGuy03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  7217. }
  7218. }
  7219. else if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsz") == 0)
  7220. {
  7221. Commands->Destroy_Object ( obj );
  7222. }
  7223. }
  7224. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7225. {
  7226. switch (param)
  7227. {
  7228. case M01_MODIFY_YOUR_ACTION_JDG:
  7229. {
  7230. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsz", false );
  7231. }
  7232. break;
  7233. case M01_GOTO_IDLE_JDG:
  7234. {
  7235. Commands->Enable_Collisions ( obj );
  7236. }
  7237. break;
  7238. case M01_DO_END_MISSION_CHECK_JDG:
  7239. {
  7240. GameObject * GDIGuy01 = Commands->Find_Object ( 101926 );
  7241. GameObject * GDIGuy02 = Commands->Find_Object ( 101927 );
  7242. GameObject * GDIGuy03 = Commands->Find_Object ( 101928 );
  7243. if ((GDIGuy01 != NULL) || (GDIGuy02 != NULL) || (GDIGuy03 != NULL) )
  7244. {
  7245. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  7246. }
  7247. else
  7248. {
  7249. GameObject * civController = Commands->Find_Object ( 103381 );
  7250. if (civController != NULL)
  7251. {
  7252. Commands->Send_Custom_Event ( obj, civController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7253. }
  7254. }
  7255. }
  7256. break;
  7257. }
  7258. }
  7259. };
  7260. DECLARE_SCRIPT(M01_Nod_Chinook_Reinforcement_Guy_JDG, "")//
  7261. {
  7262. void Animation_Complete(GameObject * obj, const char *anim)
  7263. {
  7264. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  7265. {
  7266. Vector3 offset;
  7267. offset.X = Commands->Get_Random(1, 3);
  7268. offset.Y = Commands->Get_Random(1, 3);
  7269. offset.Z = 0;
  7270. ActionParamsStruct params;
  7271. params.Set_Basic(this, 100, 10);
  7272. params.Set_Movement(Commands->Get_Position(obj) + offset, 1.0f, 0.25f);
  7273. Commands->Action_Goto(obj, params);
  7274. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  7275. }
  7276. }
  7277. };
  7278. DECLARE_SCRIPT(M01_Hunt_The_Player_JDG, "")
  7279. {
  7280. void Created( GameObject * obj )
  7281. {
  7282. Commands->Enable_Hibernation( obj, false );
  7283. Commands->Start_Timer ( obj, this, 60, M01_GOTO_IDLE_JDG );
  7284. Commands->Start_Timer ( obj, this, 5, M01_HUNT_THE_PLAYER_JDG );
  7285. ActionParamsStruct params;
  7286. params.Set_Basic( this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  7287. params.Set_Movement( STAR, RUN, 1, false );
  7288. Commands->Action_Goto ( obj, params );
  7289. }
  7290. void Timer_Expired( GameObject * obj, int timer_id )
  7291. {
  7292. if (timer_id == M01_GOTO_IDLE_JDG)
  7293. {
  7294. Commands->Enable_Hibernation( obj, true );
  7295. Vector3 myPosition = Commands->Get_Position ( obj );
  7296. Vector3 playerPosition = Commands->Get_Position ( STAR );
  7297. float distanceFromStar = Commands->Get_Distance ( myPosition, playerPosition );
  7298. if (distanceFromStar >= 80)
  7299. {
  7300. bool visible = Commands->Is_Object_Visible( obj, STAR );
  7301. if (visible != true)
  7302. {
  7303. Commands->Apply_Damage( obj, 100000, "BlamoKiller", NULL );
  7304. }
  7305. else
  7306. {
  7307. Commands->Start_Timer ( obj, this, 20, M01_GOTO_IDLE_JDG );
  7308. }
  7309. }
  7310. else
  7311. {
  7312. Commands->Start_Timer ( obj, this, 20, M01_GOTO_IDLE_JDG );
  7313. }
  7314. }
  7315. else if (timer_id == M01_HUNT_THE_PLAYER_JDG)
  7316. {
  7317. if (obj)
  7318. {
  7319. ActionParamsStruct params;
  7320. params.Set_Basic( this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  7321. params.Set_Movement( STAR, RUN, 1, false );
  7322. Commands->Action_Goto ( obj, params );
  7323. Commands->Start_Timer ( obj, this, 5, M01_HUNT_THE_PLAYER_JDG );
  7324. }
  7325. }
  7326. }
  7327. };
  7328. DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Commander_JDG, "")//103373
  7329. {
  7330. void Created( GameObject * obj )
  7331. {
  7332. Commands->Set_Innate_Is_Stationary ( obj, true );
  7333. }
  7334. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7335. {
  7336. if (param == M01_START_ACTING_JDG)//here come the mct escorts--run into mct room
  7337. {
  7338. Commands->Set_Innate_Is_Stationary ( obj, false );
  7339. Vector3 myHomeSpot(-181.1f, 541.4f, 3.5f);
  7340. ActionParamsStruct params;
  7341. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  7342. params.Set_Movement(myHomeSpot, RUN, 0.25f);
  7343. Commands->Action_Goto(obj, params);
  7344. }
  7345. }
  7346. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  7347. {
  7348. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  7349. {
  7350. Commands->Set_Innate_Is_Stationary ( obj, true );
  7351. ActionParamsStruct params;
  7352. params.Set_Basic(this, 45, M01_START_ATTACKING_01_JDG);
  7353. params.Set_Attack( STAR, 50, 0, false );
  7354. Commands->Action_Attack (obj, params);
  7355. }
  7356. }
  7357. };
  7358. DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Protector01_JDG, "")//103374
  7359. {
  7360. void Created( GameObject * obj )
  7361. {
  7362. Commands->Set_Innate_Is_Stationary ( obj, true );
  7363. }
  7364. };
  7365. DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Protector02_JDG, "")//103375
  7366. {
  7367. void Created( GameObject * obj )
  7368. {
  7369. Commands->Set_Innate_Is_Stationary ( obj, true );
  7370. }
  7371. };
  7372. DECLARE_SCRIPT(M01_HON_Engineer02_JDG, "")//101948
  7373. {
  7374. bool repairSoundPlaying;
  7375. REGISTER_VARIABLES()
  7376. {
  7377. SAVE_VARIABLE(repairSoundPlaying, 1);
  7378. }
  7379. void Created( GameObject * obj )
  7380. {
  7381. repairSoundPlaying = false;
  7382. Commands->Set_Innate_Is_Stationary ( obj, true );
  7383. }
  7384. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7385. {
  7386. if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
  7387. {
  7388. Commands->Enable_Hibernation( obj, false );
  7389. Vector3 myRepairSpot (-178.925f, 542.943f, 4.932f);
  7390. ActionParamsStruct params;
  7391. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  7392. params.Set_Attack( myRepairSpot, 10, 0, false );
  7393. params.AttackCheckBlocked = false;
  7394. Commands->Action_Attack ( obj, params );
  7395. Commands->Start_Timer ( obj, this, 2, M01_START_ACTING_JDG );
  7396. }
  7397. }
  7398. void Timer_Expired( GameObject * obj, int timer_id )
  7399. {
  7400. if (timer_id == M01_START_ACTING_JDG)
  7401. {
  7402. Commands->Enable_Hibernation( obj, true );
  7403. Commands->Action_Reset ( obj, 100 );
  7404. Vector3 repair_sound_spot (-175.074f, 533.086f, 19.327f);
  7405. GameObject * handOfNod = Commands->Find_Object ( M01_HAND_OF_NOD_JDG );
  7406. float hon_max_health = Commands->Get_Max_Health ( handOfNod );
  7407. float hon_max_shield = Commands->Get_Max_Shield_Strength ( handOfNod );
  7408. float hon_current_health = Commands->Get_Health ( handOfNod );
  7409. if (hon_current_health > 0)
  7410. {
  7411. Commands->Set_Health ( handOfNod, hon_max_health );
  7412. Commands->Set_Shield_Strength ( handOfNod, hon_max_shield );
  7413. if (repairSoundPlaying == false)
  7414. {
  7415. Commands->Create_Sound ( "CnC_Healer_Sound", repair_sound_spot, obj );
  7416. repairSoundPlaying = true;
  7417. Commands->Start_Timer ( obj, this, 5, M01_GOTO_IDLE_JDG );
  7418. }
  7419. }
  7420. }
  7421. else if (timer_id == M01_GOTO_IDLE_JDG)
  7422. {
  7423. repairSoundPlaying = false;
  7424. }
  7425. }
  7426. };
  7427. DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_03_GDI_JDG, "")
  7428. {
  7429. int buggy_id;
  7430. REGISTER_VARIABLES()
  7431. {
  7432. SAVE_VARIABLE(buggy_id, 1);
  7433. }
  7434. void Animation_Complete(GameObject * obj, const char *anim)
  7435. {
  7436. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  7437. {
  7438. Vector3 myHomeSpot(-209.853f, 505.532f, 4.017f);//going to hand of nod backside
  7439. ActionParamsStruct params;
  7440. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  7441. params.Set_Movement(myHomeSpot, RUN, 3);
  7442. Commands->Action_Goto(obj, params);
  7443. }
  7444. }
  7445. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  7446. {
  7447. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  7448. {
  7449. GameObject * buggyController = Commands->Find_Object ( 103367 );
  7450. if (buggyController != NULL)
  7451. {
  7452. Commands->Send_Custom_Event ( obj, buggyController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7453. }
  7454. }
  7455. }
  7456. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7457. {
  7458. if (type == M01_MODIFY_YOUR_ACTION_JDG)
  7459. {
  7460. buggy_id = param;
  7461. GameObject * buggy = Commands->Find_Object ( buggy_id );
  7462. if (buggy != NULL)
  7463. {
  7464. ActionParamsStruct params;
  7465. params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
  7466. params.Set_Attack( buggy, 20, 3, true );
  7467. Commands->Action_Attack( obj, params );
  7468. }
  7469. }
  7470. }
  7471. };
  7472. DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_04_GDI_JDG, "")
  7473. {
  7474. int buggy_id;
  7475. REGISTER_VARIABLES()
  7476. {
  7477. SAVE_VARIABLE(buggy_id, 1);
  7478. }
  7479. void Animation_Complete(GameObject * obj, const char *anim)
  7480. {
  7481. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  7482. {
  7483. Vector3 myHomeSpot(-204.157f, 508.650f, 4.017f);//going to hand of nod backside
  7484. ActionParamsStruct params;
  7485. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  7486. params.Set_Movement(myHomeSpot, RUN, 3);
  7487. Commands->Action_Goto(obj, params);
  7488. }
  7489. }
  7490. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7491. {
  7492. if (type == M01_MODIFY_YOUR_ACTION_JDG)
  7493. {
  7494. buggy_id = param;
  7495. GameObject * buggy = Commands->Find_Object ( buggy_id );
  7496. if (buggy != NULL)
  7497. {
  7498. ActionParamsStruct params;
  7499. params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
  7500. params.Set_Attack( buggy, 20, 3, true );
  7501. Commands->Action_Attack( obj, params );
  7502. }
  7503. }
  7504. }
  7505. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  7506. {
  7507. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  7508. {
  7509. GameObject * buggyController = Commands->Find_Object ( 103367 );
  7510. if (buggyController != NULL)
  7511. {
  7512. Commands->Send_Custom_Event ( obj, buggyController, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  7513. }
  7514. }
  7515. }
  7516. };
  7517. DECLARE_SCRIPT(M01_BuggyNew_Controller_JDG, "")//this guys id is 103367
  7518. {
  7519. int buggy_id;
  7520. bool gdi_minigunner_01_inPlace;
  7521. bool gdi_minigunner_02_inPlace;
  7522. REGISTER_VARIABLES()
  7523. {
  7524. SAVE_VARIABLE(buggy_id, 1);
  7525. SAVE_VARIABLE(gdi_minigunner_01_inPlace, 2);
  7526. SAVE_VARIABLE(gdi_minigunner_02_inPlace, 3);
  7527. }
  7528. void Created( GameObject * obj )
  7529. {
  7530. gdi_minigunner_01_inPlace = false;
  7531. gdi_minigunner_02_inPlace = false;
  7532. }
  7533. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7534. {
  7535. if (param == M01_START_ACTING_JDG)
  7536. {
  7537. Vector3 spawnLocation (-233.946f, 494.424f, 5.234f);
  7538. GameObject *buggy = Commands->Create_Object("Nod_Buggy", spawnLocation);
  7539. Commands->Set_Facing ( buggy, -135 );
  7540. Commands->Attach_Script(buggy, "M01_BuggyScript_New_JDG", "");
  7541. buggy_id = Commands->Get_ID ( buggy );
  7542. }
  7543. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7544. {
  7545. gdi_minigunner_01_inPlace = true;
  7546. int minigunner01_id = Commands->Get_ID ( sender );
  7547. GameObject *buggy = Commands->Find_Object ( buggy_id );
  7548. if (buggy != NULL)
  7549. {
  7550. Commands->Send_Custom_Event ( obj, buggy, M01_MODIFY_YOUR_ACTION_02_JDG, minigunner01_id, 0 );
  7551. Commands->Send_Custom_Event ( obj, sender, M01_MODIFY_YOUR_ACTION_JDG, buggy_id, 0 );
  7552. }
  7553. }
  7554. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  7555. {
  7556. gdi_minigunner_02_inPlace = true;
  7557. int minigunner02_id = Commands->Get_ID ( sender );
  7558. GameObject *buggy = Commands->Find_Object ( buggy_id );
  7559. if (buggy != NULL)
  7560. {
  7561. Commands->Send_Custom_Event ( obj, buggy, M01_MODIFY_YOUR_ACTION_03_JDG, minigunner02_id, 0 );
  7562. Commands->Send_Custom_Event ( obj, sender, M01_MODIFY_YOUR_ACTION_JDG, buggy_id, 0 );
  7563. }
  7564. }
  7565. }
  7566. };
  7567. DECLARE_SCRIPT(M01_BuggyScript_New_JDG, "")
  7568. {
  7569. int minigunner01_id;
  7570. int minigunner02_id;
  7571. REGISTER_VARIABLES()
  7572. {
  7573. SAVE_VARIABLE(minigunner01_id, 1);
  7574. SAVE_VARIABLE(minigunner02_id, 2);
  7575. }
  7576. void Created( GameObject * obj )
  7577. {
  7578. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
  7579. ActionParamsStruct params;
  7580. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7581. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7582. params.WaypathID = 103289;
  7583. params.WaypointStartID = 103290;
  7584. params.AttackActive = false;
  7585. Commands->Action_Attack( obj, params );
  7586. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  7587. float myMaxHealth = Commands->Get_Max_Health ( obj );
  7588. float myNewHealth = myMaxHealth / 2;
  7589. Commands->Set_Health ( obj, myNewHealth );
  7590. float myMaxShield = Commands->Get_Max_Shield_Strength ( obj );
  7591. float myNewShield = myMaxShield / 2;
  7592. Commands->Set_Shield_Strength ( obj, myNewShield );
  7593. }
  7594. void Killed( GameObject * obj, GameObject * killer )
  7595. {
  7596. Commands->Create_Sound ( "EVA_Nod_Unit_Destroyed", Vector3 (0,0,0), obj);
  7597. Vector3 buggyDeathSpot (-217.0f, 499.4f, 4.0f);
  7598. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", buggyDeathSpot);
  7599. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  7600. }
  7601. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  7602. {
  7603. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  7604. {
  7605. ActionParamsStruct params;
  7606. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7607. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7608. params.WaypathID = 103289;
  7609. params.AttackActive = false;
  7610. Commands->Action_Attack( obj, params );
  7611. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 1 );
  7612. }
  7613. }
  7614. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7615. {
  7616. ActionParamsStruct params;
  7617. if (type == M01_MODIFY_YOUR_ACTION_02_JDG)
  7618. {
  7619. minigunner01_id = param;
  7620. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  7621. }
  7622. else if (type == M01_MODIFY_YOUR_ACTION_03_JDG)
  7623. {
  7624. minigunner02_id = param;
  7625. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  7626. }
  7627. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7628. {
  7629. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7630. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7631. params.WaypathID = 103289;
  7632. params.Set_Attack( STAR, 50, 2, true );
  7633. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
  7634. }
  7635. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)
  7636. {
  7637. GameObject * minigunner01 = Commands->Find_Object ( minigunner01_id );
  7638. GameObject * minigunner02 = Commands->Find_Object ( minigunner02_id );
  7639. if (minigunner01 != NULL)
  7640. {
  7641. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7642. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7643. params.WaypathID = 103289;
  7644. params.Set_Attack( minigunner01, 50, 2, true );
  7645. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
  7646. }
  7647. else if (minigunner02 != NULL)
  7648. {
  7649. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7650. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7651. params.WaypathID = 103289;
  7652. params.Set_Attack( minigunner02, 50, 2, true );
  7653. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
  7654. }
  7655. else
  7656. {
  7657. ActionParamsStruct params;
  7658. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  7659. params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
  7660. params.WaypathID = 103289;
  7661. params.Set_Attack( STAR, 50, 2, true );
  7662. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
  7663. }
  7664. }
  7665. }
  7666. };
  7667. DECLARE_SCRIPT(M01_Priest_Conversation_Zone_JDG, "")//this guys ID is 103395 M01_PriestReminder_Conversation
  7668. {
  7669. bool okay_to_play_conversation;
  7670. REGISTER_VARIABLES()
  7671. {
  7672. SAVE_VARIABLE(okay_to_play_conversation, 1);
  7673. }
  7674. void Created( GameObject * obj )
  7675. {
  7676. okay_to_play_conversation = false;
  7677. }
  7678. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7679. {
  7680. ActionParamsStruct params;
  7681. if ((param == M01_START_ACTING_JDG))//priest is in position--give okay for conversation
  7682. {
  7683. okay_to_play_conversation = true;
  7684. }
  7685. }
  7686. void Entered( GameObject * obj, GameObject * enterer )
  7687. {
  7688. if (enterer == STAR )
  7689. {
  7690. if (okay_to_play_conversation == true)
  7691. {
  7692. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_PRIEST_CONVERSATION_JDG, 0 );
  7693. Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
  7694. }
  7695. }
  7696. }
  7697. };
  7698. DECLARE_SCRIPT(M01_Loveshack_Nun_Conversation_Zone_JDG, "")//this guys ID is 101368
  7699. {
  7700. bool okay_to_play_conversation;
  7701. REGISTER_VARIABLES()
  7702. {
  7703. SAVE_VARIABLE(okay_to_play_conversation, 1);
  7704. }
  7705. void Created( GameObject * obj )
  7706. {
  7707. okay_to_play_conversation = false;
  7708. }
  7709. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7710. {
  7711. ActionParamsStruct params;
  7712. if ((param == M01_START_ACTING_JDG))//nun is in position--give okay for conversation
  7713. {
  7714. okay_to_play_conversation = true;
  7715. }
  7716. }
  7717. void Entered( GameObject * obj, GameObject * enterer )
  7718. {
  7719. if (enterer == STAR )
  7720. {
  7721. if (okay_to_play_conversation == true)
  7722. {
  7723. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG, 0 );
  7724. Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
  7725. }
  7726. }
  7727. }
  7728. };
  7729. DECLARE_SCRIPT(M01_Interior_Nun_Conversation_Zone_JDG, "")//this guys ID is #101370
  7730. {
  7731. bool okay_to_play_conversation;
  7732. REGISTER_VARIABLES()
  7733. {
  7734. SAVE_VARIABLE(okay_to_play_conversation, 1);
  7735. }
  7736. void Created( GameObject * obj )
  7737. {
  7738. okay_to_play_conversation = false;
  7739. }
  7740. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7741. {
  7742. if ((param == M01_START_ACTING_JDG))//nun is in position--give okay for conversation
  7743. {
  7744. okay_to_play_conversation = true;
  7745. }
  7746. }
  7747. void Entered( GameObject * obj, GameObject * enterer )
  7748. {
  7749. if (enterer == STAR )
  7750. {
  7751. if (okay_to_play_conversation == true)
  7752. {
  7753. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_INTERIOR_NUN_CONVERSATION_JDG, 0 );
  7754. Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
  7755. }
  7756. }
  7757. }
  7758. };
  7759. DECLARE_SCRIPT(M01_Church_Guard_MiniGunner_JDG, "")
  7760. {
  7761. void Created( GameObject * obj )
  7762. {
  7763. Vector3 myPosition = Commands->Get_Position ( obj );
  7764. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  7765. }
  7766. void Damaged( GameObject * obj, GameObject * damager, float amount )
  7767. {
  7768. if (damager == STAR)
  7769. {
  7770. if (obj)
  7771. {
  7772. ActionParamsStruct params;
  7773. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  7774. params.Set_Movement( STAR, WALK, 5 );
  7775. params.Set_Attack( STAR, 15, 0, true );
  7776. Commands->Action_Attack ( obj, params );
  7777. }
  7778. }
  7779. }
  7780. void Killed( GameObject * obj, GameObject * killer )
  7781. {
  7782. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_GUARD_IS_DEAD_JDG, 0 );
  7783. GameObject * havocExitZone = Commands->Find_Object ( 103393 );
  7784. if (havocExitZone != NULL)
  7785. {
  7786. Commands->Send_Custom_Event( obj, havocExitZone, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, 0 );
  7787. }
  7788. }
  7789. };
  7790. DECLARE_SCRIPT(M01_Church_Loveshack_InterrogationConv_Zone_JDG, "")//103392
  7791. {
  7792. bool conversation_triggered;
  7793. REGISTER_VARIABLES()
  7794. {
  7795. SAVE_VARIABLE(conversation_triggered, 1);
  7796. }
  7797. void Created( GameObject * obj )
  7798. {
  7799. conversation_triggered = false;
  7800. }
  7801. void Entered( GameObject * obj, GameObject * enterer )
  7802. {
  7803. if (enterer == STAR && conversation_triggered == false)
  7804. {
  7805. conversation_triggered = true;
  7806. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  7807. GameObject * loveshackGuard = Commands->Find_Object ( M01_CHURCH_LOVESHACK_MINIGUNNER_ID );
  7808. if ((loveshackNun != NULL) && (loveshackGuard != NULL))
  7809. {
  7810. int loveshackConv = Commands->Create_Conversation( "M01_Loveshack_Conversation_JDG", 90, 50, true);
  7811. Commands->Join_Conversation( loveshackGuard, loveshackConv, false, true, true );
  7812. Commands->Join_Conversation( loveshackNun, loveshackConv, false, true, true );
  7813. Commands->Start_Conversation( loveshackConv, loveshackConv );
  7814. }
  7815. Commands->Destroy_Object ( obj );//cleaning up this zone
  7816. }
  7817. }
  7818. };
  7819. DECLARE_SCRIPT(M01_GDI_Escort_Conversation_Controller_GDI, "")//103396
  7820. {
  7821. bool first_time_at_escort_limit;
  7822. REGISTER_VARIABLES()
  7823. {
  7824. SAVE_VARIABLE(first_time_at_escort_limit, 1);
  7825. }
  7826. void Created( GameObject * obj )
  7827. {
  7828. first_time_at_escort_limit = true;
  7829. }
  7830. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7831. {
  7832. if (param == M01_MODIFY_YOUR_ACTION_JDG)//gdi escort has been poked to follow player
  7833. {
  7834. int random = Commands->Get_Random_Int(0, 3);
  7835. if (random == 0)
  7836. {
  7837. int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes01", 90, 50, true);
  7838. Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
  7839. Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
  7840. Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
  7841. }
  7842. else if (random == 1)
  7843. {
  7844. int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes02", 90, 50, true);
  7845. Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
  7846. Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
  7847. Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
  7848. }
  7849. else
  7850. {
  7851. int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes03", 90, 50, true);
  7852. Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
  7853. Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
  7854. Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
  7855. }
  7856. }
  7857. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//gdi escort has been poked to stop following player
  7858. {
  7859. }
  7860. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//gdi escort has reached his escort limits
  7861. {
  7862. if (first_time_at_escort_limit == true)
  7863. {
  7864. first_time_at_escort_limit = false;
  7865. int pokeLimitConv01 = Commands->Create_Conversation( "M01_GDI_Escort_MustStayHere01", 90, 50, true);
  7866. Commands->Join_Conversation( sender, pokeLimitConv01, false, false, false );
  7867. Commands->Join_Conversation( STAR, pokeLimitConv01, false, false, false );
  7868. Commands->Start_Conversation( pokeLimitConv01, pokeLimitConv01 );
  7869. }
  7870. else
  7871. {
  7872. int pokeLimitConv01 = Commands->Create_Conversation( "M01_GDI_Escort_MustStayHere02", 90, 50, true);
  7873. Commands->Join_Conversation( sender, pokeLimitConv01, false, false, false );
  7874. Commands->Join_Conversation( STAR, pokeLimitConv01, false, false, false );
  7875. Commands->Start_Conversation( pokeLimitConv01, pokeLimitConv01 );
  7876. }
  7877. }
  7878. }
  7879. };
  7880. DECLARE_SCRIPT(M01_CHURCH_Chinook_Spawned_Soldier01_GDI, "")
  7881. {
  7882. typedef enum {
  7883. ESCORTING,
  7884. NOT_ESCORTING,
  7885. } M01_State;
  7886. M01_State thisGuysState;
  7887. int initialEscortConv;
  7888. REGISTER_VARIABLES()
  7889. {
  7890. SAVE_VARIABLE(thisGuysState, 1);
  7891. SAVE_VARIABLE(initialEscortConv, 2);
  7892. }
  7893. void Created( GameObject * obj )
  7894. {
  7895. thisGuysState = NOT_ESCORTING;
  7896. }
  7897. void Poked( GameObject * obj, GameObject * poker )
  7898. {
  7899. if (poker == STAR)
  7900. {
  7901. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
  7902. }
  7903. }
  7904. void Killed( GameObject * obj, GameObject * killer )
  7905. {
  7906. if (thisGuysState == ESCORTING)
  7907. {
  7908. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  7909. }
  7910. }
  7911. void Animation_Complete(GameObject * obj, const char *anim)
  7912. {
  7913. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  7914. {
  7915. ActionParamsStruct params;
  7916. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  7917. params.Set_Movement(STAR, RUN, 5);
  7918. Commands->Action_Goto(obj, params);
  7919. }
  7920. }
  7921. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  7922. {
  7923. ActionParamsStruct params;
  7924. if (complete_reason == ACTION_COMPLETE_NORMAL)
  7925. {
  7926. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  7927. {
  7928. if (obj && STAR)
  7929. {
  7930. initialEscortConv = Commands->Create_Conversation( "M01_FirstEscort_Conversation", 100, 50, true);
  7931. Commands->Join_Conversation( obj, initialEscortConv, true, true, true );
  7932. Commands->Join_Conversation( STAR, initialEscortConv, true, true, true );
  7933. Commands->Start_Conversation( initialEscortConv, initialEscortConv );
  7934. Commands->Monitor_Conversation (obj, initialEscortConv);
  7935. }
  7936. }
  7937. if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
  7938. {
  7939. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  7940. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  7941. Commands->Action_Attack (obj, params);
  7942. }
  7943. }
  7944. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  7945. {
  7946. if (action_id == initialEscortConv)
  7947. {
  7948. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  7949. }
  7950. }
  7951. }
  7952. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  7953. {
  7954. ActionParamsStruct params;
  7955. if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState != ESCORTING) )
  7956. {
  7957. Vector3 homeSpot;
  7958. Commands->Action_Reset ( obj, 100 );
  7959. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
  7960. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  7961. {
  7962. homeSpot.Set (-139.048f, 318.861f, 9.066f);
  7963. }
  7964. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  7965. {
  7966. homeSpot.Set (-81.160f, 333.117f, 10.131f);
  7967. }
  7968. else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
  7969. {
  7970. homeSpot.Set (-138.786f, 388.250f, 15.093f);
  7971. }
  7972. else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
  7973. {
  7974. homeSpot.Set (-140.785f, 348.389f, 21.931f);
  7975. }
  7976. else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
  7977. {
  7978. homeSpot.Set (-140.792f, 342.980f, 10.387f);
  7979. }
  7980. else
  7981. {
  7982. homeSpot.Set (-126.169f, 335.223f, 8.997f);
  7983. }
  7984. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
  7985. params.Set_Basic(this, 50, M01_PICK_A_NEW_LOCATION_JDG);
  7986. params.Set_Movement(homeSpot, RUN, 3);
  7987. Commands->Action_Goto(obj, params);
  7988. float delayTimer = Commands->Get_Random ( 10, 60 );
  7989. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  7990. }
  7991. else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
  7992. {
  7993. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  7994. if (escortDialogController != NULL)
  7995. {
  7996. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7997. }
  7998. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  7999. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  8000. Commands->Action_Attack (obj, params);
  8001. thisGuysState = ESCORTING;
  8002. }
  8003. else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
  8004. {
  8005. Commands->Action_Reset ( obj, 100 );
  8006. Vector3 myPosition = Commands->Get_Position ( obj );
  8007. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  8008. thisGuysState = NOT_ESCORTING;
  8009. }
  8010. else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
  8011. {
  8012. GameObject * myTarget = Commands->Find_Object ( param );
  8013. if (myTarget != NULL)
  8014. {
  8015. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8016. params.Set_Movement( myTarget, RUN, 5 );
  8017. params.AttackActive = true;
  8018. params.Set_Attack (myTarget, 50, 0, true);
  8019. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8020. }
  8021. }
  8022. else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_01_JDG) && (thisGuysState == ESCORTING))
  8023. {
  8024. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8025. if (escortDialogController != NULL)
  8026. {
  8027. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  8028. }
  8029. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8030. thisGuysState = NOT_ESCORTING;
  8031. Vector3 homeSpot;
  8032. Commands->Action_Reset ( obj, 100 );
  8033. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
  8034. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8035. {
  8036. homeSpot.Set (-160.217f, 446.353f, 34.976f);
  8037. }
  8038. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8039. {
  8040. homeSpot.Set (-173.371f, 437.383f, 29.711f);
  8041. }
  8042. else
  8043. {
  8044. homeSpot.Set (-138.958f, 435.696f, 27.001f);
  8045. }
  8046. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
  8047. params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
  8048. params.Set_Movement(homeSpot, WALK, 3);
  8049. Commands->Action_Goto(obj, params);
  8050. }
  8051. else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_02_JDG) && (thisGuysState == ESCORTING))
  8052. {
  8053. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8054. if (escortDialogController != NULL)
  8055. {
  8056. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  8057. }
  8058. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8059. thisGuysState = NOT_ESCORTING;
  8060. Vector3 homeSpot;
  8061. Commands->Action_Reset ( obj, 100 );
  8062. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
  8063. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8064. {
  8065. homeSpot.Set (-36.192f, 319.671f, 5.226f);
  8066. }
  8067. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8068. {
  8069. homeSpot.Set (-49.614f, 363.304f, 10.816f);
  8070. }
  8071. else
  8072. {
  8073. homeSpot.Set (-66.361f, 339.288f, 8.772f);
  8074. }
  8075. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
  8076. params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
  8077. params.Set_Movement(homeSpot, WALK, 3);
  8078. Commands->Action_Goto(obj, params);
  8079. }
  8080. }
  8081. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  8082. {
  8083. ActionParamsStruct params;
  8084. if (thisGuysState == ESCORTING)
  8085. {
  8086. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8087. params.Set_Movement( enemy, RUN, 5 );
  8088. params.Set_Attack( enemy, 50, 0, true );
  8089. params.AttackActive = true;
  8090. params.AttackCheckBlocked = true;
  8091. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8092. }
  8093. }
  8094. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8095. {
  8096. ActionParamsStruct params;
  8097. if (damager != NULL)
  8098. {
  8099. int attackersType = Commands->Get_Player_Type ( damager );
  8100. if (attackersType != SCRIPT_PLAYERTYPE_NOD)
  8101. {
  8102. }
  8103. else
  8104. {
  8105. if (thisGuysState == ESCORTING && damager != NULL)
  8106. {
  8107. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8108. params.Set_Movement( damager, RUN, 5 );
  8109. params.Set_Attack( damager, 50, 0, true );
  8110. params.AttackActive = true;
  8111. params.AttackCheckBlocked = true;
  8112. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8113. }
  8114. }
  8115. }
  8116. }
  8117. };
  8118. DECLARE_SCRIPT(M01_CHURCH_Chinook_Spawned_Soldier02_GDI, "")
  8119. {
  8120. typedef enum {
  8121. ESCORTING,
  8122. NOT_ESCORTING,
  8123. } M01_State;
  8124. M01_State thisGuysState;
  8125. REGISTER_VARIABLES()
  8126. {
  8127. SAVE_VARIABLE(thisGuysState, 1);
  8128. }
  8129. void Created( GameObject * obj )
  8130. {
  8131. thisGuysState = NOT_ESCORTING;
  8132. }
  8133. void Poked( GameObject * obj, GameObject * poker )
  8134. {
  8135. if (poker == STAR)
  8136. {
  8137. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
  8138. }
  8139. }
  8140. void Killed( GameObject * obj, GameObject * killer )
  8141. {
  8142. if (thisGuysState == ESCORTING)
  8143. {
  8144. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8145. }
  8146. }
  8147. void Animation_Complete(GameObject * obj, const char *anim)
  8148. {
  8149. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  8150. {
  8151. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  8152. }
  8153. }
  8154. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  8155. {
  8156. ActionParamsStruct params;
  8157. if (complete_reason == ACTION_COMPLETE_NORMAL)
  8158. {
  8159. if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
  8160. {
  8161. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8162. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  8163. Commands->Action_Attack (obj, params);
  8164. }
  8165. }
  8166. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  8167. {
  8168. }
  8169. }
  8170. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  8171. {
  8172. ActionParamsStruct params;
  8173. if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState != ESCORTING) )
  8174. {
  8175. Vector3 homeSpot;
  8176. Commands->Action_Reset ( obj, 100 );
  8177. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
  8178. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8179. {
  8180. homeSpot.Set (-139.048f, 318.861f, 9.066f);
  8181. }
  8182. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8183. {
  8184. homeSpot.Set (-81.160f, 333.117f, 10.131f);
  8185. }
  8186. else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
  8187. {
  8188. homeSpot.Set (-138.786f, 388.250f, 15.093f);
  8189. }
  8190. else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
  8191. {
  8192. homeSpot.Set (-140.785f, 348.389f, 21.931f);
  8193. }
  8194. else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
  8195. {
  8196. homeSpot.Set (-140.792f, 342.980f, 10.387f);
  8197. }
  8198. else
  8199. {
  8200. homeSpot.Set (-126.169f, 335.223f, 8.997f);
  8201. }
  8202. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
  8203. params.Set_Basic(this, 50, M01_PICK_A_NEW_LOCATION_JDG);
  8204. params.Set_Movement(homeSpot, RUN, 3);
  8205. Commands->Action_Goto(obj, params);
  8206. float delayTimer = Commands->Get_Random ( 10, 60 );
  8207. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  8208. }
  8209. else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
  8210. {
  8211. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8212. if (escortDialogController != NULL)
  8213. {
  8214. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8215. }
  8216. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8217. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  8218. Commands->Action_Attack (obj, params);
  8219. thisGuysState = ESCORTING;
  8220. }
  8221. else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
  8222. {
  8223. Commands->Action_Reset ( obj, 100 );
  8224. Vector3 myPosition = Commands->Get_Position ( obj );
  8225. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  8226. thisGuysState = NOT_ESCORTING;
  8227. }
  8228. else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
  8229. {
  8230. GameObject * myTarget = Commands->Find_Object ( param );
  8231. if (myTarget != NULL)
  8232. {
  8233. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8234. params.Set_Movement( myTarget, RUN, 5 );
  8235. params.AttackActive = true;
  8236. params.Set_Attack (myTarget, 50, 0, true);
  8237. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8238. }
  8239. }
  8240. else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_01_JDG) && (thisGuysState == ESCORTING))
  8241. {
  8242. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8243. if (escortDialogController != NULL)
  8244. {
  8245. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  8246. }
  8247. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8248. thisGuysState = NOT_ESCORTING;
  8249. Vector3 homeSpot;
  8250. Commands->Action_Reset ( obj, 100 );
  8251. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
  8252. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8253. {
  8254. homeSpot.Set (-160.217f, 446.353f, 34.976f);
  8255. }
  8256. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8257. {
  8258. homeSpot.Set (-173.371f, 437.383f, 29.711f);
  8259. }
  8260. else
  8261. {
  8262. homeSpot.Set (-138.958f, 435.696f, 27.001f);
  8263. }
  8264. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
  8265. params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
  8266. params.Set_Movement(homeSpot, WALK, 3);
  8267. Commands->Action_Goto(obj, params);
  8268. }
  8269. else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_02_JDG) && (thisGuysState == ESCORTING))
  8270. {
  8271. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8272. if (escortDialogController != NULL)
  8273. {
  8274. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  8275. }
  8276. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8277. thisGuysState = NOT_ESCORTING;
  8278. Vector3 homeSpot;
  8279. Commands->Action_Reset ( obj, 100 );
  8280. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
  8281. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8282. {
  8283. homeSpot.Set (-36.192f, 319.671f, 5.226f);
  8284. }
  8285. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8286. {
  8287. homeSpot.Set (-49.614f, 363.304f, 10.816f);
  8288. }
  8289. else
  8290. {
  8291. homeSpot.Set (-66.361f, 339.288f, 8.772f);
  8292. }
  8293. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
  8294. params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
  8295. params.Set_Movement(homeSpot, WALK, 3);
  8296. Commands->Action_Goto(obj, params);
  8297. }
  8298. }
  8299. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  8300. {
  8301. ActionParamsStruct params;
  8302. if (thisGuysState == ESCORTING)
  8303. {
  8304. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8305. params.Set_Movement( enemy, RUN, 5 );
  8306. params.Set_Attack( enemy, 50, 0, true );
  8307. params.AttackActive = true;
  8308. params.AttackCheckBlocked = true;
  8309. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8310. }
  8311. }
  8312. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8313. {
  8314. ActionParamsStruct params;
  8315. if (damager != NULL)
  8316. {
  8317. int attackersType = Commands->Get_Player_Type ( damager );
  8318. if (attackersType != SCRIPT_PLAYERTYPE_NOD)
  8319. {
  8320. }
  8321. else
  8322. {
  8323. if (thisGuysState == ESCORTING && damager != NULL)
  8324. {
  8325. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8326. params.Set_Movement( damager, RUN, 5 );
  8327. params.Set_Attack( damager, 50, 0, true );
  8328. params.AttackActive = true;
  8329. params.AttackCheckBlocked = true;
  8330. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8331. }
  8332. }
  8333. }
  8334. }
  8335. };
  8336. DECLARE_SCRIPT(M01_COMM_Chinook_Spawned_Soldier_GDI, "")
  8337. {
  8338. typedef enum {
  8339. ESCORTING,
  8340. NOT_ESCORTING,
  8341. } M01_State;
  8342. M01_State thisGuysState;
  8343. REGISTER_VARIABLES()
  8344. {
  8345. SAVE_VARIABLE(thisGuysState, 1);
  8346. }
  8347. void Created( GameObject * obj )
  8348. {
  8349. thisGuysState = NOT_ESCORTING;
  8350. }
  8351. void Poked( GameObject * obj, GameObject * poker )
  8352. {
  8353. if (poker == STAR)
  8354. {
  8355. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
  8356. }
  8357. }
  8358. void Killed( GameObject * obj, GameObject * killer )
  8359. {
  8360. if (thisGuysState == ESCORTING)
  8361. {
  8362. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
  8363. }
  8364. }
  8365. void Animation_Complete(GameObject * obj, const char *anim)
  8366. {
  8367. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  8368. {
  8369. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  8370. }
  8371. }
  8372. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  8373. {
  8374. ActionParamsStruct params;
  8375. if (complete_reason == ACTION_COMPLETE_NORMAL)
  8376. {
  8377. if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
  8378. {
  8379. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8380. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  8381. Commands->Action_Attack (obj, params);
  8382. }
  8383. }
  8384. }
  8385. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  8386. {
  8387. ActionParamsStruct params;
  8388. if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState == NOT_ESCORTING) )
  8389. {
  8390. Vector3 homeSpot;
  8391. Commands->Action_Reset ( obj, 100 );
  8392. float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
  8393. if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
  8394. {
  8395. homeSpot.Set (-277.309f, 468.428f, 18.553f);
  8396. }
  8397. else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
  8398. {
  8399. homeSpot.Set (-271.237f, 535.962f, 27.935f);
  8400. }
  8401. else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
  8402. {
  8403. homeSpot.Set (-247.278f, 563.557f, 30.610f);
  8404. }
  8405. else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
  8406. {
  8407. homeSpot.Set (-296.349f, 583.760f, 27.739f);
  8408. }
  8409. else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
  8410. {
  8411. homeSpot.Set (-313.597f, 568.022f, 27.740f);
  8412. }
  8413. else
  8414. {
  8415. homeSpot.Set (-301.160f, 523.405f, 16.583f);
  8416. }
  8417. Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
  8418. params.Set_Basic(this, 50, 20);
  8419. params.Set_Movement(homeSpot, RUN, 3);
  8420. Commands->Action_Goto(obj, params);
  8421. float delayTimer = Commands->Get_Random ( 10, 60 );
  8422. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  8423. }
  8424. else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
  8425. {
  8426. GameObject * escortDialogController = Commands->Find_Object ( 103396 );
  8427. if (escortDialogController != NULL)
  8428. {
  8429. Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8430. }
  8431. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8432. params.Set_Movement( STAR, RUN + 0.2f, 2 );
  8433. Commands->Action_Attack (obj, params);
  8434. thisGuysState = ESCORTING;
  8435. }
  8436. else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
  8437. {
  8438. Commands->Action_Reset ( obj, 100 );
  8439. Vector3 myPosition = Commands->Get_Position ( obj );
  8440. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  8441. thisGuysState = NOT_ESCORTING;
  8442. }
  8443. else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
  8444. {
  8445. GameObject * myTarget = Commands->Find_Object ( param );
  8446. if (myTarget != NULL)
  8447. {
  8448. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8449. params.Set_Movement( myTarget, RUN, 5 );
  8450. params.AttackActive = true;
  8451. params.Set_Attack (myTarget, 50, 0, true);
  8452. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8453. Commands->Debug_Message ( "**********************Player's escort has received orders to attack havocs target\n" );
  8454. }
  8455. }
  8456. }
  8457. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  8458. {
  8459. ActionParamsStruct params;
  8460. if (thisGuysState == ESCORTING)
  8461. {
  8462. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8463. params.Set_Movement( enemy, RUN, 5 );
  8464. params.Set_Attack( enemy, 50, 0, true );
  8465. params.AttackActive = true;
  8466. params.AttackCheckBlocked = true;
  8467. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8468. }
  8469. }
  8470. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8471. {
  8472. ActionParamsStruct params;
  8473. if (damager != NULL)
  8474. {
  8475. int attackersType = Commands->Get_Player_Type ( damager );
  8476. if (attackersType != SCRIPT_PLAYERTYPE_NOD)
  8477. {
  8478. }
  8479. else
  8480. {
  8481. if (thisGuysState == ESCORTING && damager != NULL)
  8482. {
  8483. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  8484. params.Set_Movement( damager, RUN, 5 );
  8485. params.Set_Attack( damager, 50, 0, true );
  8486. params.AttackActive = true;
  8487. params.AttackCheckBlocked = true;
  8488. Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
  8489. }
  8490. }
  8491. }
  8492. }
  8493. };
  8494. DECLARE_SCRIPT(M01_Barn_Truck_JDG, "")//
  8495. {
  8496. void Killed( GameObject * obj, GameObject * killer )
  8497. {
  8498. Vector3 myPosition = Commands->Get_Position ( obj );
  8499. Commands->Create_Explosion ( "Explosion_Vehicle", myPosition, NULL );
  8500. }
  8501. };
  8502. DECLARE_SCRIPT(M01_GDIBase_EvacMonitor_JDG, "")//M01_GDIBASE_EVAC_MONITOR_JDG
  8503. {
  8504. int unitsEvacuated;
  8505. REGISTER_VARIABLES()
  8506. {
  8507. SAVE_VARIABLE(unitsEvacuated, 1);
  8508. }
  8509. void Created( GameObject * obj )
  8510. {
  8511. unitsEvacuated = 0;
  8512. }
  8513. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8514. {
  8515. if (param == M01_GOING_TO_EVAC_SPOT_JDG)
  8516. {
  8517. unitsEvacuated++;
  8518. if (unitsEvacuated == 4)
  8519. {
  8520. int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
  8521. Commands->Join_Conversation( NULL, airdrop_conv, false, false );
  8522. Commands->Start_Conversation( airdrop_conv, airdrop_conv );
  8523. Vector3 airDropSpot (-32.247f, 36.075f, 0.547f);
  8524. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
  8525. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  8526. Commands->Destroy_Object ( obj );
  8527. }
  8528. }
  8529. }
  8530. };
  8531. DECLARE_SCRIPT(M01_ChurchArea_EvacMonitor_JDG, "")//M01_CHURCHAREA_EVAC_MONITOR_JDG
  8532. {
  8533. int unitsEvacuated;
  8534. REGISTER_VARIABLES()
  8535. {
  8536. SAVE_VARIABLE(unitsEvacuated, 1);
  8537. }
  8538. void Created( GameObject * obj )
  8539. {
  8540. unitsEvacuated = 0;
  8541. }
  8542. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8543. {
  8544. if (param == M01_GOING_TO_EVAC_SPOT_JDG)
  8545. {
  8546. unitsEvacuated++;
  8547. if (unitsEvacuated == 3)
  8548. {
  8549. int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
  8550. Commands->Join_Conversation( NULL, airdrop_conv, false, false );
  8551. Commands->Start_Conversation( airdrop_conv, airdrop_conv );
  8552. Vector3 airDropSpot (-158.807f, 351.532f, 10.353f);
  8553. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
  8554. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  8555. Commands->Destroy_Object ( obj );
  8556. }
  8557. }
  8558. }
  8559. };
  8560. DECLARE_SCRIPT(M01_MovieProjector_JDG, "")//103942
  8561. {//
  8562. bool destroyed;
  8563. REGISTER_VARIABLES()
  8564. {
  8565. SAVE_VARIABLE(destroyed, 1);
  8566. }
  8567. void Created( GameObject * obj )
  8568. {
  8569. destroyed = false;
  8570. }
  8571. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8572. {
  8573. if (damager == STAR && destroyed == false)
  8574. {
  8575. destroyed = true;
  8576. Commands->Set_Animation ( obj, "DSP_PROJECTOR.DSP_PROJECTOR", false, NULL, 0, 9 );
  8577. GameObject * propagandaController = Commands->Find_Object ( 103099 );
  8578. if (propagandaController != NULL)
  8579. {
  8580. Commands->Send_Custom_Event( obj, propagandaController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  8581. }
  8582. Vector3 myPosition = Commands->Get_Position ( obj );
  8583. Commands->Create_Explosion ( "Explosion_Barrel_Fuel", myPosition, NULL );
  8584. }
  8585. Commands->Set_Health ( obj, 0.25f );
  8586. }
  8587. };
  8588. DECLARE_SCRIPT(M01_Propaganda_Sounds_Controller_JDG, "")//this guys ID is 103099
  8589. {
  8590. int last;
  8591. int displayScreen_ID;
  8592. int monitor_sound01;
  8593. int monitor_sound02;
  8594. int monitor_sound03;
  8595. bool destroyed;
  8596. int propaganda_number;
  8597. bool soundPlaying;
  8598. REGISTER_VARIABLES()
  8599. {
  8600. SAVE_VARIABLE(last, 1);
  8601. SAVE_VARIABLE(displayScreen_ID, 2);
  8602. SAVE_VARIABLE(monitor_sound01, 3);
  8603. SAVE_VARIABLE(destroyed, 4);
  8604. SAVE_VARIABLE(propaganda_number, 5);
  8605. SAVE_VARIABLE(soundPlaying, 6);
  8606. SAVE_VARIABLE(monitor_sound02, 7);
  8607. SAVE_VARIABLE(monitor_sound03, 8);
  8608. }
  8609. void Created(GameObject * obj)
  8610. {
  8611. last = 0;
  8612. displayScreen_ID = 0;
  8613. monitor_sound01 = 0;
  8614. monitor_sound02 = 0;
  8615. monitor_sound03 = 0;
  8616. destroyed = false;
  8617. propaganda_number = 0;
  8618. soundPlaying = false;
  8619. }
  8620. void Custom(GameObject * obj, int type, int param, GameObject * sender)
  8621. {
  8622. if (type == 0)
  8623. {
  8624. if (obj && param == M01_MODIFY_YOUR_ACTION_JDG)
  8625. {
  8626. soundPlaying = false;
  8627. GameObject * oldDisplayScreen = Commands->Find_Object ( displayScreen_ID);
  8628. if (oldDisplayScreen != NULL)
  8629. {
  8630. Commands->Destroy_Object ( oldDisplayScreen );
  8631. }
  8632. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 2 );
  8633. }
  8634. //if (obj && type == CUSTOM_EVENT_SOUND_ENDED )
  8635. //{
  8636. // if (obj && param == monitor_sound01)
  8637. //{
  8638. //}
  8639. //}
  8640. else if (param == M01_START_ACTING_JDG && destroyed == false)
  8641. {
  8642. char *propaganda_screen[10] =
  8643. {
  8644. "M01_Propaganda_Screen_01",
  8645. "M01_Propaganda_Screen_02",
  8646. "M01_Propaganda_Screen_03",
  8647. "M01_Propaganda_Screen_04",
  8648. "M01_Propaganda_Screen_05",
  8649. "M01_Propaganda_Screen_06",
  8650. "M01_Propaganda_Screen_07",
  8651. "M01_Propaganda_Screen_08",
  8652. "M01_Propaganda_Screen_10",
  8653. "M01_Propaganda_Screen_11",
  8654. };
  8655. char *propaganda_sound[10] =
  8656. {
  8657. "M01NCXS_DSGN0270I1NCXS_SND",
  8658. "M01NCXS_DSGN0271I1NCXS_SND",
  8659. "M01NCXS_DSGN0272I1NCXS_SND",
  8660. "M01NCXS_DSGN0273I1NCXS_SND",
  8661. "M01NCXS_DSGN0279I1NCXS_SND",
  8662. "M01NCXS_DSGN0275I1NCXS_SND",
  8663. "M01NCXS_DSGN0276I1NCXS_SND",
  8664. "M01NCXS_DSGN0277I1NCXS_SND",
  8665. "M01NCXS_DSGN0278I1NCXS_SND",
  8666. "M01NCXS_DSGN0274I1NCXS_SND",
  8667. };
  8668. Vector3 propagandaSpeaker01 (-319.283f, 589.265f, 35.385f);
  8669. Vector3 propagandaSpeaker02 (-277.730f, 581.935f, 35.724f);
  8670. Vector3 propagandaSpeaker03 (-296.269f, 612.473f, 35.468f);
  8671. propaganda_number++;// = Commands->Get_Random_Int(0, 11);
  8672. if (propaganda_number >= 10)
  8673. {
  8674. propaganda_number = 0;
  8675. }
  8676. GameObject * displayScreen = Commands->Create_Object ( propaganda_screen[propaganda_number], Vector3 (0,0,0) );
  8677. displayScreen_ID = Commands->Get_ID ( displayScreen );
  8678. monitor_sound03 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker01, obj );
  8679. monitor_sound02 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker02, obj );
  8680. monitor_sound01 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker03, obj );
  8681. //Commands->Monitor_Sound ( obj, monitor_sound01 );
  8682. soundPlaying = true;
  8683. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 10 );
  8684. }
  8685. else if (param == M01_IVE_BEEN_KILLED_JDG)//projector is dead--stop playing propaganda stuff
  8686. {
  8687. destroyed = true;
  8688. GameObject * oldDisplayScreen = Commands->Find_Object ( displayScreen_ID);
  8689. if (oldDisplayScreen != NULL)
  8690. {
  8691. Commands->Destroy_Object ( oldDisplayScreen );
  8692. }
  8693. if (soundPlaying == true)
  8694. {
  8695. Commands->Stop_Sound ( monitor_sound01, true );
  8696. Commands->Stop_Sound ( monitor_sound02, true );
  8697. Commands->Stop_Sound ( monitor_sound03, true );
  8698. }
  8699. Commands->Destroy_Object ( obj );
  8700. }
  8701. }
  8702. }
  8703. };
  8704. DECLARE_SCRIPT(M01_BackPath_NodGuy_JDG, "")
  8705. {
  8706. void Created( GameObject * obj )
  8707. {
  8708. Commands->Set_Innate_Is_Stationary ( obj, true );
  8709. GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
  8710. if (gdiBaseCommander != NULL)
  8711. {
  8712. ActionParamsStruct params;
  8713. params.Set_Basic( this, 75, M01_START_ACTING_JDG );
  8714. params.Set_Attack( gdiBaseCommander, 30, 5, true );
  8715. params.AttackCheckBlocked = false;
  8716. Commands->Action_Attack ( obj, params );
  8717. }
  8718. }
  8719. };
  8720. DECLARE_SCRIPT(M01_Comm_Repair_Engineer_JDG, "")//this guys ID is M01_COMM_CENTER_ENGINEER_ID 101949
  8721. {
  8722. int healer_sound;
  8723. bool healing;
  8724. REGISTER_VARIABLES()
  8725. {
  8726. SAVE_VARIABLE(healer_sound, 1);
  8727. SAVE_VARIABLE(healing, 2);
  8728. }
  8729. void Created( GameObject * obj )
  8730. {
  8731. Commands->Set_Innate_Is_Stationary ( obj, true );
  8732. healing = false;
  8733. }
  8734. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8735. {
  8736. if (type == CUSTOM_EVENT_SOUND_ENDED )
  8737. {
  8738. if (param == healer_sound)
  8739. {
  8740. healing = false;
  8741. }
  8742. }
  8743. else if (type == 0)
  8744. {
  8745. if (param == M01_PLAYER_IS_ATTACKING_ME_JDG && healing == false)
  8746. {
  8747. healing = true;
  8748. Commands->Enable_Hibernation( obj, false );
  8749. Vector3 myRepairSpot (-301.382f, 551.366f, 18.205f);
  8750. ActionParamsStruct params;
  8751. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  8752. params.Set_Attack( myRepairSpot, 30, 0, false );
  8753. params.AttackCheckBlocked = false;
  8754. Commands->Action_Attack ( obj, params );
  8755. Commands->Start_Timer ( obj, this, 2, M01_START_ACTING_JDG );
  8756. }
  8757. }
  8758. }
  8759. void Timer_Expired( GameObject * obj, int timer_id )
  8760. {
  8761. if (timer_id == M01_START_ACTING_JDG)
  8762. {
  8763. Commands->Enable_Hibernation( obj, true );
  8764. Commands->Action_Reset ( obj, 100 );
  8765. GameObject * commCenter = Commands->Find_Object ( M01_COMM_CENTER_JDG );
  8766. Vector3 repair_sound_spot (-297.633f, 532.144f, 35.458f);
  8767. float commCenter_max_health = Commands->Get_Max_Health ( commCenter );;
  8768. float commCenter_max_shield = Commands->Get_Max_Shield_Strength ( commCenter );
  8769. float commCenter_current_health = Commands->Get_Health ( commCenter );
  8770. if (commCenter_current_health > 0)
  8771. {
  8772. Commands->Set_Health ( commCenter, commCenter_max_health );
  8773. Commands->Set_Shield_Strength ( commCenter, commCenter_max_shield );
  8774. healer_sound = Commands->Create_Sound ( "CnC_Healer_Sound", repair_sound_spot, obj );
  8775. Commands->Monitor_Sound ( obj, healer_sound );
  8776. }
  8777. }
  8778. }
  8779. };
  8780. DECLARE_SCRIPT(M01_Comm_Center_Building_Script_JDG, "")
  8781. {
  8782. void Killed( GameObject * obj, GameObject * killer )
  8783. {
  8784. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
  8785. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
  8786. GameObject * mainframe = Commands->Find_Object ( 107809 );
  8787. if (mainframe != NULL)
  8788. {
  8789. Commands->Send_Custom_Event( obj, mainframe, 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
  8790. }
  8791. GameObject * gateTutorialZone = Commands->Find_Object ( 120844 );
  8792. if (gateTutorialZone != NULL)
  8793. {
  8794. Commands->Send_Custom_Event( obj, gateTutorialZone, 0, M01_START_ACTING_JDG, 0 );
  8795. }
  8796. }
  8797. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8798. {
  8799. GameObject * myEngineer = Commands->Find_Object ( M01_COMM_CENTER_ENGINEER_ID );
  8800. if (myEngineer != NULL)
  8801. {
  8802. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_DAMAGE_CHECK_JDG, 0 );
  8803. }
  8804. }
  8805. };
  8806. DECLARE_SCRIPT(M01_PaintballRoom_ChatterController_JDG, "")//107554
  8807. {
  8808. int nodguy01_id;//
  8809. int nodguy02_id;
  8810. int nodguy03_id;
  8811. int nodguy04_id;
  8812. int nodguy05_id;
  8813. int nodguy06_id;
  8814. bool nodguy01_dead;
  8815. bool nodguy02_dead;
  8816. bool nodguy03_dead;
  8817. bool nodguy04_dead;
  8818. bool nodguy05_dead;
  8819. bool nodguy06_dead;
  8820. bool acting;
  8821. REGISTER_VARIABLES()
  8822. {
  8823. SAVE_VARIABLE(nodguy01_id, 1);
  8824. SAVE_VARIABLE(nodguy02_id, 2);
  8825. SAVE_VARIABLE(nodguy03_id, 3);
  8826. SAVE_VARIABLE(nodguy04_id, 4);
  8827. SAVE_VARIABLE(nodguy05_id, 5);
  8828. SAVE_VARIABLE(nodguy06_id, 6);
  8829. SAVE_VARIABLE(nodguy01_dead, 7);
  8830. SAVE_VARIABLE(nodguy02_dead, 8);
  8831. SAVE_VARIABLE(nodguy03_dead, 9);
  8832. SAVE_VARIABLE(nodguy04_dead, 10);
  8833. SAVE_VARIABLE(nodguy05_dead, 11);
  8834. SAVE_VARIABLE(nodguy06_dead, 12);
  8835. SAVE_VARIABLE(acting, 13);
  8836. }
  8837. void Created( GameObject * obj )
  8838. {
  8839. nodguy01_id = 102001;
  8840. nodguy02_id = 101998;
  8841. nodguy03_id = 102000;
  8842. nodguy04_id = 101999;
  8843. nodguy05_id = 102002;
  8844. nodguy06_id = 102003;
  8845. nodguy01_dead = false;
  8846. nodguy02_dead = false;
  8847. nodguy03_dead = false;
  8848. nodguy04_dead = false;
  8849. nodguy05_dead = false;
  8850. nodguy06_dead = false;
  8851. acting = false;
  8852. }
  8853. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8854. {
  8855. if (type == 0)
  8856. {
  8857. if (param == M01_START_ACTING_JDG && acting == false)
  8858. {
  8859. acting = true;
  8860. if (nodguy01_dead == false)
  8861. {
  8862. float delayTimer = Commands->Get_Random ( 1, 2 );
  8863. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  8864. }
  8865. else if (nodguy01_dead == true)
  8866. {
  8867. if (nodguy02_dead == false)
  8868. {
  8869. float delayTimer = Commands->Get_Random ( 1, 2 );
  8870. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  8871. }
  8872. }
  8873. if (nodguy03_dead == false)
  8874. {
  8875. float delayTimer = Commands->Get_Random ( 1, 2 );
  8876. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
  8877. }
  8878. else if (nodguy03_dead == true)
  8879. {
  8880. if (nodguy04_dead == false)
  8881. {
  8882. float delayTimer = Commands->Get_Random ( 1, 2 );
  8883. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, delayTimer );
  8884. }
  8885. }
  8886. if (nodguy05_dead == false)
  8887. {
  8888. float delayTimer = Commands->Get_Random ( 1, 2 );
  8889. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, delayTimer );
  8890. }
  8891. else if (nodguy05_dead == true)
  8892. {
  8893. if (nodguy06_dead == false)
  8894. {
  8895. float delayTimer = Commands->Get_Random ( 1, 2 );
  8896. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_06_JDG, delayTimer );
  8897. }
  8898. }
  8899. }
  8900. else if (param == M01_IVE_BEEN_KILLED_JDG)
  8901. {
  8902. GameObject * nodguy01 = Commands->Find_Object ( nodguy01_id );
  8903. GameObject * nodguy02 = Commands->Find_Object ( nodguy02_id );
  8904. GameObject * nodguy03 = Commands->Find_Object ( nodguy03_id );
  8905. GameObject * nodguy04 = Commands->Find_Object ( nodguy04_id );
  8906. GameObject * nodguy05 = Commands->Find_Object ( nodguy05_id );
  8907. GameObject * nodguy06 = Commands->Find_Object ( nodguy06_id );
  8908. if (sender == nodguy01)
  8909. {
  8910. nodguy01_dead = true;
  8911. }
  8912. else if (sender == nodguy02)
  8913. {
  8914. nodguy02_dead = true;
  8915. }
  8916. else if (sender == nodguy03)
  8917. {
  8918. nodguy03_dead = true;
  8919. }
  8920. else if (sender == nodguy04)
  8921. {
  8922. nodguy04_dead = true;
  8923. }
  8924. else if (sender == nodguy05)
  8925. {
  8926. nodguy05_dead = true;
  8927. }
  8928. else if (sender == nodguy06)
  8929. {
  8930. nodguy06_dead = true;
  8931. }
  8932. }
  8933. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  8934. {
  8935. GameObject * nodguy01 = Commands->Find_Object ( nodguy01_id );
  8936. if (nodguy01 != NULL)
  8937. {
  8938. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_02", 95, 20, true);
  8939. Commands->Join_Conversation( nodguy01, paintball_alert_conv);
  8940. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8941. }
  8942. }
  8943. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  8944. {
  8945. GameObject * nodguy02 = Commands->Find_Object ( nodguy02_id );
  8946. if (nodguy02 != NULL)
  8947. {
  8948. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_02", 95, 20, true);
  8949. Commands->Join_Conversation( nodguy02, paintball_alert_conv);
  8950. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8951. }
  8952. }
  8953. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
  8954. {
  8955. GameObject * nodguy03 = Commands->Find_Object ( nodguy03_id );
  8956. if (nodguy03 != NULL)
  8957. {
  8958. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_01", 95, 20, true);
  8959. Commands->Join_Conversation( nodguy03, paintball_alert_conv);
  8960. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8961. }
  8962. }
  8963. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)
  8964. {
  8965. GameObject * nodguy04 = Commands->Find_Object ( nodguy04_id );
  8966. if (nodguy04 != NULL)
  8967. {
  8968. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_01", 95, 20, true);
  8969. Commands->Join_Conversation( nodguy04, paintball_alert_conv);
  8970. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8971. }
  8972. }
  8973. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)
  8974. {
  8975. GameObject * nodguy05 = Commands->Find_Object ( nodguy05_id );
  8976. if (nodguy05 != NULL)
  8977. {
  8978. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_03", 95, 20, true);
  8979. Commands->Join_Conversation( nodguy05, paintball_alert_conv);
  8980. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8981. }
  8982. }
  8983. else if (param == M01_MODIFY_YOUR_ACTION_06_JDG)
  8984. {
  8985. GameObject * nodguy06 = Commands->Find_Object ( nodguy06_id );
  8986. if (nodguy06 != NULL)
  8987. {
  8988. int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_03", 95, 20, true);
  8989. Commands->Join_Conversation( nodguy06, paintball_alert_conv);
  8990. Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
  8991. }
  8992. }
  8993. }
  8994. }
  8995. };
  8996. DECLARE_SCRIPT(M01_HON_Paintball_Team_01_JDG, "")//this is the grunt team
  8997. {
  8998. int enemySniperId;
  8999. float myAggressiveness;
  9000. float myCoverProbability;
  9001. float myTimerMax;
  9002. float myTimerMin;
  9003. float myHomeRange;
  9004. Vector3 myPosition;
  9005. bool retreating;
  9006. bool starEncountered;
  9007. REGISTER_VARIABLES()
  9008. {
  9009. SAVE_VARIABLE(enemySniperId, 1);
  9010. SAVE_VARIABLE(myAggressiveness, 2);
  9011. SAVE_VARIABLE(myCoverProbability, 3);
  9012. SAVE_VARIABLE(myTimerMax, 4);
  9013. SAVE_VARIABLE(myTimerMin, 5);
  9014. SAVE_VARIABLE(myHomeRange, 6);
  9015. SAVE_VARIABLE(myPosition, 7);
  9016. SAVE_VARIABLE(retreating, 8);
  9017. SAVE_VARIABLE(starEncountered, 9);
  9018. }
  9019. void Created( GameObject * obj )
  9020. {
  9021. enemySniperId = 102001;
  9022. retreating = false;
  9023. starEncountered = false;
  9024. int myIdNumber = Commands->Get_ID ( obj );
  9025. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_RENEGADE );
  9026. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NOD );
  9027. if (myIdNumber == 101998)//team one sniper
  9028. {
  9029. }
  9030. else
  9031. {
  9032. myPosition = Commands->Get_Position ( obj );
  9033. myTimerMin = 5;
  9034. myTimerMax = 10;
  9035. myAggressiveness = Commands->Get_Random ( 0, 0.5f );
  9036. myCoverProbability = Commands->Get_Random ( 0.5f, 1 );
  9037. myHomeRange = Commands->Get_Random ( 0, 20 );
  9038. Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
  9039. Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
  9040. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
  9041. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9042. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9043. }
  9044. }
  9045. void Killed( GameObject * obj, GameObject * killer )
  9046. {
  9047. GameObject * convController = Commands->Find_Object ( 107554 );
  9048. if (convController != NULL)
  9049. {
  9050. Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  9051. }
  9052. }
  9053. void Damaged( GameObject * obj, GameObject * damager, float amount )
  9054. {
  9055. if (damager == STAR)
  9056. {
  9057. starEncountered = true;
  9058. GameObject * convController = Commands->Find_Object ( 107554 );
  9059. if (convController != NULL)
  9060. {
  9061. Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
  9062. }
  9063. }
  9064. else if (damager == Commands->Find_Object ( enemySniperId ))
  9065. {
  9066. retreating = true;
  9067. Commands->Set_Innate_Aggressiveness ( obj, 0.2f );
  9068. Commands->Set_Innate_Take_Cover_Probability ( obj, 1 );
  9069. float delayTimer = Commands->Get_Random ( 0, 2 );
  9070. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_02_JDG );
  9071. if (starEncountered == false)
  9072. {
  9073. float myMaxHealth = Commands->Get_Max_Health ( obj );
  9074. Commands->Set_Health ( obj, myMaxHealth );
  9075. }
  9076. }
  9077. else
  9078. {
  9079. if (starEncountered == false)
  9080. {
  9081. float myMaxHealth = Commands->Get_Max_Health ( obj );
  9082. Commands->Set_Health ( obj, myMaxHealth );
  9083. }
  9084. }
  9085. }
  9086. void Timer_Expired( GameObject * obj, int timer_id )
  9087. {
  9088. switch (timer_id)
  9089. {
  9090. case M01_MODIFY_YOUR_ACTION_JDG:
  9091. {
  9092. if (retreating == false)
  9093. {
  9094. myAggressiveness = Commands->Get_Random ( 0, 0.5f );
  9095. myCoverProbability = Commands->Get_Random ( 0.5f, 1 );
  9096. myHomeRange = Commands->Get_Random ( 0, 20 );
  9097. Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
  9098. Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
  9099. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
  9100. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9101. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9102. }
  9103. }
  9104. break;
  9105. case M01_MODIFY_YOUR_ACTION_02_JDG:
  9106. {
  9107. retreating = false;
  9108. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9109. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9110. }
  9111. break;
  9112. }
  9113. }
  9114. };
  9115. DECLARE_SCRIPT(M01_HON_Paintball_Team_02_JDG, "")//this is the officer team
  9116. {
  9117. int enemySniperId;
  9118. float myAggressiveness;
  9119. float myCoverProbability;
  9120. float myTimerMax;
  9121. float myTimerMin;
  9122. float myHomeRange;
  9123. Vector3 myPosition;
  9124. bool retreating;
  9125. bool starEncountered;
  9126. REGISTER_VARIABLES()
  9127. {
  9128. SAVE_VARIABLE(enemySniperId, 1);
  9129. SAVE_VARIABLE(myAggressiveness, 2);
  9130. SAVE_VARIABLE(myCoverProbability, 3);
  9131. SAVE_VARIABLE(myTimerMax, 4);
  9132. SAVE_VARIABLE(myTimerMin, 5);
  9133. SAVE_VARIABLE(myHomeRange, 6);
  9134. SAVE_VARIABLE(myPosition, 7);
  9135. SAVE_VARIABLE(retreating, 8);
  9136. SAVE_VARIABLE(starEncountered, 9);
  9137. }
  9138. void Created( GameObject * obj )
  9139. {
  9140. enemySniperId= 101998;
  9141. retreating = false;
  9142. starEncountered = false;
  9143. int myIdNumber = Commands->Get_ID ( obj );
  9144. if (myIdNumber == 102001)//team two sniper
  9145. {
  9146. }
  9147. else
  9148. {
  9149. myPosition = Commands->Get_Position ( obj );
  9150. myTimerMin = 5;
  9151. myTimerMax = 10;
  9152. myAggressiveness = Commands->Get_Random ( 0.75f, 1 );
  9153. myCoverProbability = Commands->Get_Random ( 0, 0.25f );
  9154. myHomeRange = Commands->Get_Random ( 0, 20 );
  9155. Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
  9156. Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
  9157. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
  9158. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9159. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9160. }
  9161. }
  9162. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  9163. {
  9164. if (enemy == STAR)
  9165. {
  9166. starEncountered = true;
  9167. }
  9168. }
  9169. void Killed( GameObject * obj, GameObject * killer )
  9170. {
  9171. GameObject * convController = Commands->Find_Object ( 107554 );
  9172. if (convController != NULL)
  9173. {
  9174. Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  9175. }
  9176. }
  9177. void Damaged( GameObject * obj, GameObject * damager, float amount )
  9178. {
  9179. if (damager == STAR)
  9180. {
  9181. starEncountered = true;
  9182. GameObject * convController = Commands->Find_Object ( 107554 );
  9183. if (convController != NULL)
  9184. {
  9185. Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
  9186. }
  9187. }
  9188. else if (damager == Commands->Find_Object ( enemySniperId ))
  9189. {
  9190. retreating = true;
  9191. Commands->Set_Innate_Aggressiveness ( obj, 0.2f );
  9192. Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
  9193. float delayTimer = Commands->Get_Random ( 1, 3 );
  9194. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_02_JDG );
  9195. if (starEncountered == false)
  9196. {
  9197. float myMaxHealth = Commands->Get_Max_Health ( obj );
  9198. Commands->Set_Health ( obj, myMaxHealth );
  9199. }
  9200. }
  9201. else
  9202. {
  9203. if (starEncountered == false)
  9204. {
  9205. float myMaxHealth = Commands->Get_Max_Health ( obj );
  9206. Commands->Set_Health ( obj, myMaxHealth );
  9207. }
  9208. }
  9209. }
  9210. void Timer_Expired( GameObject * obj, int timer_id )
  9211. {
  9212. switch (timer_id)
  9213. {
  9214. case M01_MODIFY_YOUR_ACTION_JDG:
  9215. {
  9216. if (retreating == false)
  9217. {
  9218. myAggressiveness = Commands->Get_Random ( 0.75f, 1 );
  9219. myCoverProbability = Commands->Get_Random ( 0, 0.25f );
  9220. myHomeRange = Commands->Get_Random ( 0, 20 );
  9221. Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
  9222. Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
  9223. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
  9224. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9225. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9226. }
  9227. }
  9228. break;
  9229. case M01_MODIFY_YOUR_ACTION_02_JDG:
  9230. {
  9231. retreating = false;
  9232. float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
  9233. Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
  9234. }
  9235. break;
  9236. }
  9237. }
  9238. };
  9239. DECLARE_SCRIPT(M01_HON_Dojo_Trainer_JDG, "")//this guys ID is M01_HON_DOJO_SENSEI_JDG 102051
  9240. {
  9241. int dojo_conv;
  9242. bool first_time;
  9243. bool handOfNodDead;
  9244. REGISTER_VARIABLES()
  9245. {
  9246. SAVE_VARIABLE(dojo_conv, 1);
  9247. SAVE_VARIABLE(first_time, 2);
  9248. SAVE_VARIABLE(handOfNodDead, 3);
  9249. }
  9250. void Created( GameObject * obj )
  9251. {
  9252. handOfNodDead = false;
  9253. first_time = true;
  9254. Commands->Innate_Disable(obj);
  9255. //Commands->Set_Innate_Is_Stationary ( obj, true );
  9256. }
  9257. void Killed( GameObject * obj, GameObject * killer )
  9258. {
  9259. if (handOfNodDead == false)
  9260. {
  9261. if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
  9262. {
  9263. float delayTimer = Commands->Get_Random ( 0, 1 );
  9264. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  9265. }
  9266. if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
  9267. {
  9268. float delayTimer2 = Commands->Get_Random ( 0, 1 );
  9269. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer2 );
  9270. }
  9271. if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
  9272. {
  9273. float delayTimer3 = Commands->Get_Random ( 0, 1 );
  9274. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer3 );
  9275. }
  9276. }
  9277. else
  9278. {
  9279. if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
  9280. {
  9281. float delayTimer = Commands->Get_Random ( 0, 1 );
  9282. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer );
  9283. }
  9284. if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
  9285. {
  9286. float delayTimer2 = Commands->Get_Random ( 0, 1 );
  9287. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer2 );
  9288. }
  9289. if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
  9290. {
  9291. float delayTimer3 = Commands->Get_Random ( 0, 1 );
  9292. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer3 );
  9293. }
  9294. }
  9295. }
  9296. void Damaged( GameObject * obj, GameObject * damager, float amount )
  9297. {
  9298. if (damager == STAR && first_time == true)
  9299. {
  9300. first_time = false;
  9301. if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
  9302. {
  9303. float delayTimer = Commands->Get_Random ( 0, 1 );
  9304. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer );
  9305. }
  9306. if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
  9307. {
  9308. float delayTimer2 = Commands->Get_Random ( 0, 1 );
  9309. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer2 );
  9310. }
  9311. if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
  9312. {
  9313. float delayTimer3 = Commands->Get_Random ( 0, 1 );
  9314. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer3 );
  9315. }
  9316. }
  9317. }
  9318. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9319. {
  9320. switch (param)
  9321. {
  9322. case M01_START_ACTING_JDG: //here comes the player--start your routine
  9323. {
  9324. //Commands->Set_Innate_Is_Stationary ( obj, false );
  9325. //Commands->Innate_Enable(obj);
  9326. Commands->Set_Innate_Aggressiveness ( obj, 0.50f );
  9327. Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
  9328. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
  9329. Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, false );
  9330. dojo_conv = Commands->Create_Conversation( "M01_Dojo_Sensei_Conversation", 100, 1000, true);
  9331. Commands->Join_Conversation( obj, dojo_conv, false, true );
  9332. Commands->Start_Conversation( dojo_conv, dojo_conv );
  9333. Commands->Monitor_Conversation( obj, dojo_conv);
  9334. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
  9335. }
  9336. break;
  9337. case M01_MODIFY_YOUR_ACTION_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
  9338. {
  9339. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
  9340. Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, true );
  9341. }
  9342. break;
  9343. case M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
  9344. {
  9345. handOfNodDead = true;
  9346. Commands->Innate_Enable(obj);
  9347. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
  9348. Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, true );
  9349. }
  9350. break;
  9351. }
  9352. }
  9353. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  9354. {
  9355. switch (complete_reason)
  9356. {
  9357. case ACTION_COMPLETE_CONVERSATION_ENDED:
  9358. {
  9359. if (action_id == dojo_conv)//your initial conv is over--tell civs to do pushups
  9360. {
  9361. if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
  9362. {
  9363. float delayTimer = Commands->Get_Random ( 0, 1 );
  9364. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_START_ACTING_JDG, delayTimer );
  9365. }
  9366. if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
  9367. {
  9368. float delayTimer2 = Commands->Get_Random ( 0, 1 );
  9369. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_START_ACTING_JDG, delayTimer2 );
  9370. }
  9371. if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
  9372. {
  9373. float delayTimer3 = Commands->Get_Random ( 0, 1 );
  9374. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_START_ACTING_JDG, delayTimer3 );
  9375. }
  9376. }
  9377. }
  9378. break;
  9379. }
  9380. }
  9381. };
  9382. DECLARE_SCRIPT(M01_HON_Dojo_Civ_01_JDG, "")
  9383. {
  9384. /*#define M01_HON_DOJO_CIV_01_JDG 102048
  9385. #define M01_HON_DOJO_CIV_02_JDG 102049
  9386. #define M01_HON_DOJO_CIV_03_JDG 102050*/
  9387. int i_am;
  9388. int dojo_civ_01;
  9389. int dojo_civ_02;
  9390. int dojo_civ_03;
  9391. int pushups_done;
  9392. int thanks_conv;
  9393. REGISTER_VARIABLES()
  9394. {
  9395. SAVE_VARIABLE(i_am, 1);
  9396. SAVE_VARIABLE(dojo_civ_01, 2);
  9397. SAVE_VARIABLE(dojo_civ_02, 3);
  9398. SAVE_VARIABLE(dojo_civ_03, 4);
  9399. SAVE_VARIABLE(pushups_done, 5);
  9400. SAVE_VARIABLE(thanks_conv, 6);
  9401. }
  9402. void Created( GameObject * obj )
  9403. {
  9404. dojo_civ_01 = 102048;//babushka
  9405. dojo_civ_02 = 102049;//billy
  9406. dojo_civ_03 = 102050;//farmerjohn
  9407. pushups_done = 0;
  9408. Commands->Innate_Disable(obj);
  9409. int myIdNumber = Commands->Get_ID ( obj );
  9410. if (myIdNumber == dojo_civ_01)
  9411. {
  9412. i_am = dojo_civ_01;
  9413. }
  9414. else if (myIdNumber == dojo_civ_02)
  9415. {
  9416. i_am = dojo_civ_02;
  9417. }
  9418. else if (myIdNumber == dojo_civ_03)
  9419. {
  9420. i_am = dojo_civ_03;
  9421. }
  9422. }
  9423. void Killed( GameObject * obj, GameObject * killer )
  9424. {
  9425. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
  9426. }
  9427. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9428. {
  9429. ActionParamsStruct params;
  9430. switch (param)
  9431. {
  9432. case M01_START_ACTING_JDG: //you've been told to do pushups--DO THEM!
  9433. {
  9434. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );//this is animation of guy going into pushup position
  9435. params.Set_Animation( "H_A_J13A", false );
  9436. Commands->Action_Play_Animation ( obj, params );
  9437. }
  9438. break;
  9439. case M01_MODIFY_YOUR_ACTION_JDG: //you're done with pushups--report to the armory
  9440. {
  9441. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  9442. params.Set_Movement( Vector3(0,0,0), WALK, 2 );
  9443. params.WaypathID = 102056;
  9444. params.WaypointStartID = 102058;
  9445. params.WaypointEndID = 102062;
  9446. Commands->Action_Goto( obj, params );
  9447. }
  9448. break;
  9449. case M01_PLAYER_IS_ATTACKING_ME_JDG: //your guard is alerted to Havoc--stop whatever you are doing
  9450. {
  9451. Commands->Action_Reset ( obj, 100 );
  9452. Vector3 myPosition = Commands->Get_Position ( obj );
  9453. myPosition.X += Commands->Get_Random ( 0.5f, 1 );
  9454. myPosition.Y += Commands->Get_Random ( 0.5f, 2 );
  9455. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  9456. params.Set_Movement( myPosition, WALK, 0 );
  9457. params.MoveCrouched = true;
  9458. Commands->Action_Goto( obj, params );
  9459. }
  9460. break;
  9461. case M01_MODIFY_YOUR_ACTION_02_JDG: //your guard is dead--flock Havoc and say thanks
  9462. {
  9463. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  9464. params.Set_Look( STAR, 5 );
  9465. Commands->Action_Face_Location ( obj, params );
  9466. float delayTimer = Commands->Get_Random ( 0, 1 );
  9467. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, delayTimer );
  9468. }
  9469. break;
  9470. case M01_MODIFY_YOUR_ACTION_03_JDG: //play thanks conv
  9471. {
  9472. if (obj)
  9473. {
  9474. Commands->Join_Conversation( obj, thanks_conv, false, true, true );
  9475. Commands->Join_Conversation( STAR, thanks_conv, false, false, false );
  9476. Commands->Start_Conversation( thanks_conv, thanks_conv );
  9477. Commands->Monitor_Conversation( obj, thanks_conv );
  9478. }
  9479. }
  9480. break;
  9481. case M01_MODIFY_YOUR_ACTION_04_JDG: //play thanks conv
  9482. {
  9483. if (i_am == dojo_civ_01)//babushka
  9484. {
  9485. thanks_conv = Commands->Create_Conversation( "M01_Dojo_Babushka_Thanks_Conversation", 100, 1000, true);
  9486. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  9487. }
  9488. else if (i_am == dojo_civ_02)
  9489. {
  9490. thanks_conv = Commands->Create_Conversation( "M01_Dojo_Billy_Thanks_Conversation", 100, 1000, true);
  9491. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 2 );
  9492. }
  9493. else
  9494. {
  9495. thanks_conv = Commands->Create_Conversation( "M01_Dojo_FarmerJohn_Thanks_Conversation", 100, 1000, true);
  9496. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 4 );
  9497. }
  9498. }
  9499. break;
  9500. case M01_PICK_A_NEW_LOCATION_JDG: //see how far you are from havoc
  9501. {
  9502. Vector3 myPosition = Commands->Get_Position ( obj );
  9503. Vector3 playerPosition = Commands->Get_Position ( STAR );
  9504. float myDistance = Commands->Get_Distance ( myPosition, playerPosition );
  9505. if (myDistance > 75)
  9506. {
  9507. bool starVisible = Commands->Is_Object_Visible( STAR, obj );
  9508. if (starVisible == true)
  9509. {
  9510. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );
  9511. }
  9512. else
  9513. {
  9514. Commands->Destroy_Object ( obj );
  9515. }
  9516. }
  9517. else
  9518. {
  9519. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );
  9520. }
  9521. }
  9522. break;
  9523. case M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
  9524. {
  9525. Commands->Action_Reset ( obj, 100 );
  9526. Vector3 newGotoSpot(-54.512f, 183.109f, 0.774f);//this is at the landing beach
  9527. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  9528. params.Set_Movement( newGotoSpot, RUN, 5 );
  9529. Commands->Action_Goto( obj, params );
  9530. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );//do distance check from star
  9531. }
  9532. break;
  9533. }
  9534. }
  9535. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  9536. {
  9537. ActionParamsStruct params;
  9538. switch (complete_reason)
  9539. {
  9540. case ACTION_COMPLETE_CONVERSATION_ENDED:
  9541. {
  9542. if (action_id == thanks_conv)
  9543. {
  9544. Vector3 myPosition = Commands->Get_Position ( obj );
  9545. Commands->Create_Sound ( "M01_GDI_Thanks_Twiddler", myPosition, obj );
  9546. Vector3 newGotoSpot(-54.512f, 183.109f, 0.774f);//this is at the landing beach
  9547. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  9548. params.Set_Movement( newGotoSpot, RUN, 5 );
  9549. Commands->Action_Goto( obj, params );
  9550. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );//do distance check from star
  9551. }
  9552. }
  9553. break;
  9554. case ACTION_COMPLETE_NORMAL:
  9555. {
  9556. switch (action_id)
  9557. {
  9558. case M01_DOING_ANIMATION_01_JDG:
  9559. {
  9560. if (pushups_done < 2)
  9561. {
  9562. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );//this is pushup animation animation
  9563. params.Set_Animation( "H_A_J13B", false );
  9564. Commands->Action_Play_Animation ( obj, params );
  9565. pushups_done++;
  9566. }
  9567. else
  9568. {
  9569. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );//this is guy standing up
  9570. params.Set_Animation( "H_A_J13C", false );
  9571. Commands->Action_Play_Animation ( obj, params );
  9572. }
  9573. }
  9574. break;
  9575. case M01_DOING_ANIMATION_02_JDG:
  9576. {
  9577. char *animationName = M01_Choose_Idle_Animation ( );
  9578. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );//this is guy standing up
  9579. params.Set_Animation( animationName, false );
  9580. Commands->Action_Play_Animation ( obj, params );
  9581. }
  9582. break;
  9583. case M01_DOING_ANIMATION_03_JDG:
  9584. {
  9585. if (i_am == dojo_civ_01)
  9586. {
  9587. float delayTimer = Commands->Get_Random ( 0, 1 );
  9588. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  9589. }
  9590. else if (i_am == dojo_civ_02)
  9591. {
  9592. float delayTimer2 = Commands->Get_Random ( 1, 2 );
  9593. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer2 );
  9594. }
  9595. else if (i_am == dojo_civ_03)
  9596. {
  9597. float delayTimer3 = Commands->Get_Random ( 2, 3 );
  9598. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer3 );
  9599. }
  9600. }
  9601. break;
  9602. case M01_WALKING_WAYPATH_01_JDG:
  9603. {
  9604. params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );//this is guy placing C$
  9605. params.Set_Animation( "H_A_J12C", false );
  9606. Commands->Action_Play_Animation ( obj, params );
  9607. }
  9608. break;
  9609. case M01_DOING_ANIMATION_04_JDG:
  9610. {
  9611. Vector3 myPosition = Commands->Get_Position ( obj );
  9612. GameObject *newsoldier = Commands->Create_Object("Nod_MiniGunner_0", myPosition);
  9613. Commands->Attach_Script(newsoldier, "M01_Civ_To_Minigunner_Guy_JDG", "");
  9614. Commands->Destroy_Object ( obj );
  9615. }
  9616. break;
  9617. }
  9618. }
  9619. break;
  9620. }
  9621. }
  9622. };
  9623. DECLARE_SCRIPT(M01_Nod_GuardTower_Tailgun_JDG, "")//100246
  9624. {
  9625. void Created( GameObject * obj )
  9626. {
  9627. ActionParamsStruct params;
  9628. params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
  9629. params.Set_Attack( STAR, 30, 1, true);
  9630. Commands->Action_Attack(obj, params);
  9631. }
  9632. };
  9633. DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_01_JDG, "")//108024
  9634. {//target location ()
  9635. void Entered( GameObject * obj, GameObject * enterer )
  9636. {
  9637. if (enterer == STAR)
  9638. {
  9639. Vector3 radarMarker (-293.163f, 499.787f, 19.959f);
  9640. Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
  9641. Commands->Destroy_Object ( obj );
  9642. }
  9643. }
  9644. };
  9645. DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_02_JDG, "")//108026
  9646. {//target location ()
  9647. void Entered( GameObject * obj, GameObject * enterer )
  9648. {
  9649. if (enterer == STAR)
  9650. {
  9651. Vector3 radarMarker (-292.135f, 522.740f, 16.448f);
  9652. Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
  9653. Commands->Destroy_Object ( obj );
  9654. }
  9655. }
  9656. };
  9657. DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_03_JDG, "")//108028
  9658. {//target location ()
  9659. void Entered( GameObject * obj, GameObject * enterer )
  9660. {
  9661. if (enterer == STAR)
  9662. {
  9663. Vector3 radarMarker (-314.578f, 517.124f, 16.447f);
  9664. Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
  9665. Commands->Destroy_Object ( obj );
  9666. }
  9667. }
  9668. };
  9669. DECLARE_SCRIPT(M01_Comm_Center_Player_Terminal_Zone, "")//107809
  9670. {
  9671. bool poked;
  9672. bool commCenterDead;
  9673. REGISTER_VARIABLES()
  9674. {
  9675. SAVE_VARIABLE(poked, 1);
  9676. SAVE_VARIABLE(commCenterDead, 2);
  9677. }
  9678. void Created( GameObject * obj )
  9679. {
  9680. commCenterDead = false;
  9681. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  9682. Commands->Display_Health_Bar( obj, false );
  9683. poked = false;
  9684. }
  9685. void Poked( GameObject * obj, GameObject * poker )
  9686. {
  9687. if (poker == STAR && poked == false)
  9688. {
  9689. if (commCenterDead == false)
  9690. {
  9691. poked = true;
  9692. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_HAS_POKED_COMM_CENTER_PCT_JDG, 0 );
  9693. Commands->Set_Obj_Radar_Blip_Shape ( obj, -1 );
  9694. Commands->Set_Obj_Radar_Blip_Color ( obj, -1 );
  9695. GameObject * gateTutorialZone = Commands->Find_Object ( 120844 );
  9696. if (gateTutorialZone != NULL)
  9697. {
  9698. Commands->Send_Custom_Event( obj, gateTutorialZone, 0, M01_START_ACTING_JDG, 0 );
  9699. }
  9700. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  9701. }
  9702. }
  9703. }
  9704. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9705. {
  9706. if (type == 0)
  9707. {
  9708. if (param == M01_COMM_SAM_OBJECTIVE_JDG)
  9709. {
  9710. Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
  9711. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE );
  9712. }
  9713. else if (param == M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG)//comm center has been destroyed
  9714. {
  9715. commCenterDead = true;
  9716. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  9717. }
  9718. }
  9719. }
  9720. };
  9721. DECLARE_SCRIPT(M01_Objective_Pog_Controller_JDG, "")//M01_MISSION_POG_CONTROLLER_JDG 105828
  9722. {
  9723. int missionIntro;
  9724. int escKeyConv;
  9725. REGISTER_VARIABLES()
  9726. {
  9727. SAVE_VARIABLE(missionIntro, 1);
  9728. SAVE_VARIABLE(escKeyConv, 2);
  9729. }
  9730. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  9731. {
  9732. switch (complete_reason)
  9733. {
  9734. case ACTION_COMPLETE_CONVERSATION_ENDED:
  9735. {
  9736. if (action_id == missionIntro) //add first objective pog here
  9737. {
  9738. Vector3 prisonerPenLocation (-312.725f, 575.887f, 27.221f);
  9739. Commands->Add_Objective( M01_PRISONER_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_01, NULL, IDS_Enc_Obj_Primary_M01_01 );
  9740. Commands->Set_Objective_Radar_Blip( M01_PRISONER_OBJECTIVE_JDG, prisonerPenLocation );
  9741. Commands->Set_Objective_HUD_Info_Position( M01_PRISONER_OBJECTIVE_JDG, 80, "POG_M01_1_01.tga", IDS_POG_LOCATE, prisonerPenLocation );
  9742. Commands->Set_HUD_Help_Text ( IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9743. escKeyConv = Commands->Create_Conversation( "M01_Press_ESC_For_Objectives_Conversation", 100, 1000, false);
  9744. Commands->Join_Conversation( NULL, escKeyConv, false, false );
  9745. Commands->Start_Conversation( escKeyConv, escKeyConv );
  9746. Commands->Monitor_Conversation( obj, escKeyConv );
  9747. }
  9748. else if (action_id == escKeyConv)
  9749. {
  9750. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0516I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9751. }
  9752. }
  9753. break;
  9754. }
  9755. }
  9756. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9757. {
  9758. if (type == 0)
  9759. {
  9760. if (param == M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG)
  9761. {
  9762. missionIntro = Commands->Create_Conversation( "M01_Start_Mission_Conversation", 100, 1000, false);
  9763. Commands->Join_Conversation( NULL, missionIntro, false, false );
  9764. //Commands->Join_Conversation( STAR, missionIntro, false, false );
  9765. Commands->Start_Conversation( missionIntro, missionIntro );
  9766. Commands->Monitor_Conversation( obj, missionIntro );//M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG
  9767. }
  9768. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  9769. {
  9770. escKeyConv = Commands->Create_Conversation( "M01_Press_ESC_For_Objectives_Conversation", 100, 1000, false);
  9771. Commands->Join_Conversation( NULL, escKeyConv, false, false );
  9772. Commands->Start_Conversation( escKeyConv, escKeyConv );
  9773. Commands->Monitor_Conversation( obj, escKeyConv );
  9774. }
  9775. }
  9776. else if (type == M01_ADD_OBJECTIVE_POG_JDG)
  9777. {
  9778. if (param == M01_GDI_BASE_POW_OBJECTIVE_JDG)
  9779. {
  9780. Vector3 initialCaptainLocation (47.128f, 36.584f, -0.930f);
  9781. Commands->Add_Objective( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_06, NULL, IDS_Enc_Obj_Secondary_M01_06 );
  9782. Commands->Set_Objective_Radar_Blip( M01_GDI_BASE_POW_OBJECTIVE_JDG, initialCaptainLocation );
  9783. Commands->Set_Objective_HUD_Info_Position( M01_GDI_BASE_POW_OBJECTIVE_JDG, 85, "POG_M01_2_08.tga", IDS_POG_RESCUE, initialCaptainLocation );
  9784. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9785. //Vector3 blue (0,0,1);
  9786. Commands->Set_HUD_Help_Text ( IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9787. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  9788. }
  9789. else if (param == M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG)
  9790. {
  9791. GameObject * barnCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
  9792. if (barnCommander != NULL)
  9793. {
  9794. Vector3 commanderPosition = Commands->Get_Position ( barnCommander );
  9795. Commands->Set_Objective_HUD_Info_Position( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, 86, "POG_M01_2_01.tga", IDS_POG_ELIMINATE, commanderPosition );
  9796. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9797. //Vector3 blue (0,0,1);
  9798. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_01, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9799. }
  9800. }
  9801. else if (param == M01_TURRETS_OBJECTIVE_JDG)
  9802. {
  9803. Vector3 turretsLocation;
  9804. GameObject * turret01 = Commands->Find_Object ( 101434 );
  9805. GameObject * turret02 = Commands->Find_Object ( 101435 );
  9806. if (turret01 != NULL)
  9807. {
  9808. turretsLocation.Set (-83.916f, 91.667f, 2.807f);
  9809. }
  9810. else if (turret02 != NULL)
  9811. {
  9812. turretsLocation.Set (-105.024f, 113.658f, 1.872f);
  9813. }
  9814. Commands->Set_Objective_HUD_Info_Position( M01_TURRETS_OBJECTIVE_JDG, 91, "POG_M01_2_02.tga", IDS_POG_DESTROY, turretsLocation );
  9815. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9816. //Vector3 blue (0,0,1);
  9817. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_02, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9818. }
  9819. else if (param == M01_BARN_OBJECTIVE_JDG)
  9820. {
  9821. Vector3 barnLocation (-49.910f, 183.860f, 0.774f);
  9822. Commands->Set_Objective_HUD_Info_Position( M01_BARN_OBJECTIVE_JDG, 92, "POG_M01_2_03.tga", IDS_POG_RESCUE, barnLocation );
  9823. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_BARN_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9824. //Vector3 blue (0,0,1);
  9825. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_03, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9826. }
  9827. else if (param == M01_BARN_ROUNDUP_OBJECTIVE_JGD)
  9828. {
  9829. Vector3 barnLocation (-54.786f, 213.816f, 6.453f);
  9830. Commands->Set_Objective_HUD_Info_Position( M01_BARN_ROUNDUP_OBJECTIVE_JGD, 93, "POG_M01_2_04.tga", IDS_POG_EVACUATE, barnLocation );
  9831. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_BARN_ROUNDUP_OBJECTIVE_JGD, SECONDARY_POG_DELAY );
  9832. //Vector3 blue (0,0,1);
  9833. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_04, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9834. }
  9835. else if (param == M01_CHURCH_OBJECTIVE_JDG)//
  9836. {
  9837. Vector3 churchLocation = Commands->Get_Position ( Commands->Find_Object ( M01_CHURCH_PRIEST_ID ) );
  9838. Commands->Set_Objective_HUD_Info_Position( M01_CHURCH_OBJECTIVE_JDG, 94, "POG_M01_2_06.tga", IDS_POG_RESCUE, churchLocation );
  9839. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_CHURCH_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9840. //Vector3 blue (0,0,1);
  9841. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_05, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9842. }
  9843. else if (param == M01_HON_OBJECTIVE_JDG)
  9844. {
  9845. Vector3 mctLocation (-179.3f, 541.9f, 3.518f);
  9846. Commands->Set_Objective_HUD_Info_Position( M01_HON_OBJECTIVE_JDG, 95, "POG_M02_2_01.tga", IDS_POG_DESTROY, mctLocation );
  9847. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_HON_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9848. //Vector3 blue (0,0,1);
  9849. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_07, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9850. }
  9851. else if (param == M01_COMM_SAM_OBJECTIVE_JDG)
  9852. {
  9853. Vector3 samLocation (-337.169f, 549.232f, 31.949f);
  9854. Commands->Set_Objective_HUD_Info_Position( M01_COMM_SAM_OBJECTIVE_JDG, 96, "POG_M01_1_04.tga", IDS_POG_DESTROY, samLocation );
  9855. //Vector3 green (0,1,0);
  9856. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_04, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9857. }
  9858. }
  9859. else if (type == M01_CHANGE_OBJECTIVE_POG_JDG)
  9860. {
  9861. GameObject * captDuncan = Commands->Find_Object ( 106050 );
  9862. if (captDuncan != NULL)
  9863. {
  9864. if (param == M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG)
  9865. {
  9866. //Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  9867. Commands->Add_Objective( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_08, NULL, IDS_Enc_Obj_Secondary_M01_08 );
  9868. Vector3 realCaptainLocation (109.959f, 97.340f, 8.923f);
  9869. Commands->Set_Objective_HUD_Info_Position( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 91, "POG_M01_2_05.tga", IDS_POG_CONTACT, realCaptainLocation );
  9870. Commands->Set_Objective_Radar_Blip( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, realCaptainLocation );
  9871. //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
  9872. GameObject * triggerZone03 = Commands->Find_Object ( 106052 );
  9873. if (triggerZone03 != NULL)
  9874. {
  9875. Commands->Send_Custom_Event( obj, triggerZone03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  9876. }
  9877. //Vector3 blue (0,0,1);
  9878. Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_08, TEXT_COLOR_OBJECTIVE_PRIMARY );
  9879. }
  9880. }
  9881. else if (param == M01_TURRETS_OBJECTIVE_JDG)
  9882. {
  9883. Vector3 turretsLocation;
  9884. GameObject * turret02 = Commands->Find_Object ( 101435 );
  9885. if (turret02 != NULL)
  9886. {
  9887. turretsLocation.Set (-105.024f, 113.658f, 1.872f);
  9888. }
  9889. Commands->Set_Objective_HUD_Info_Position( M01_TURRETS_OBJECTIVE_JDG, 91, "POG_M01_2_02.tga", IDS_POG_DESTROY, turretsLocation );
  9890. }
  9891. }
  9892. }
  9893. };
  9894. DECLARE_SCRIPT(M01_GDIBase_FirstChinook_Script_JDG, "")//
  9895. {
  9896. void Killed( GameObject * obj, GameObject * killer )
  9897. {
  9898. GameObject * gdiGuy01 = Commands->Find_Object ( 104685 );
  9899. if (gdiGuy01 != NULL)
  9900. {
  9901. Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_MODIFY_YOUR_ACTION_07_JDG, 0 );
  9902. }
  9903. }
  9904. };
  9905. DECLARE_SCRIPT(M01_Church_EvacController_JDG, "")//103394
  9906. {
  9907. int evac_waypath_id;
  9908. int evac_helicopter_id;
  9909. int evac_rope_id;
  9910. int protectCivsConv;
  9911. int deadCivs;
  9912. bool transportCalled;
  9913. REGISTER_VARIABLES()
  9914. {
  9915. SAVE_VARIABLE(evac_waypath_id, 1);
  9916. SAVE_VARIABLE(evac_helicopter_id, 2);
  9917. SAVE_VARIABLE(evac_rope_id, 3);
  9918. SAVE_VARIABLE(protectCivsConv, 4);
  9919. SAVE_VARIABLE(deadCivs, 5);
  9920. SAVE_VARIABLE(transportCalled, 6);
  9921. }
  9922. void Created( GameObject * obj )
  9923. {
  9924. deadCivs = 0;
  9925. transportCalled = false;
  9926. }
  9927. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9928. {
  9929. if ((param == M01_START_ACTING_JDG))//civs have been freed--play protect civs conversation
  9930. {
  9931. protectCivsConv = Commands->Create_Conversation( "M01_Protect_Clergy_Conversation", 100, 1000, false);
  9932. Commands->Join_Conversation( NULL, protectCivsConv, false, false );
  9933. //Commands->Join_Conversation( STAR, protectCivsConv, false, false );
  9934. Commands->Start_Conversation( protectCivsConv, protectCivsConv );
  9935. Commands->Monitor_Conversation (obj, protectCivsConv);
  9936. }
  9937. else if (param == M01_EVERYONES_ON_BOARD_JDG)//civs are on board--send aircraft away
  9938. {
  9939. GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
  9940. GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
  9941. GameObject * evacRope = Commands->Find_Object ( evac_rope_id );
  9942. if (evacChopper != NULL)
  9943. {
  9944. Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  9945. }
  9946. if (evacWaypath != NULL)
  9947. {
  9948. Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  9949. }
  9950. if (evacRope != NULL)
  9951. {
  9952. Commands->Send_Custom_Event ( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  9953. }
  9954. }
  9955. else if (param == M01_CIVILIAN_KILLED_JDG)
  9956. {
  9957. deadCivs++;
  9958. if (deadCivs == 3)
  9959. {
  9960. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CLEAR_CHURCH_OBJECTIVE_FAIL_JDG, 0 );
  9961. }
  9962. }
  9963. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
  9964. {
  9965. evac_helicopter_id = Commands->Get_ID ( sender );
  9966. Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
  9967. }
  9968. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
  9969. {
  9970. evac_waypath_id = Commands->Get_ID ( sender );
  9971. Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
  9972. }
  9973. else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
  9974. {
  9975. evac_rope_id = Commands->Get_ID ( sender );
  9976. Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
  9977. }
  9978. else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
  9979. {
  9980. Vector3 evacPosition = Commands->Get_Position ( obj );
  9981. GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
  9982. Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
  9983. Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
  9984. Commands->Innate_Disable(sender);
  9985. Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
  9986. if(troopbone)
  9987. {
  9988. Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
  9989. }
  9990. else
  9991. {
  9992. Commands->Debug_Message("troopbone not created yet");
  9993. }
  9994. Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
  9995. }
  9996. }
  9997. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  9998. {
  9999. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  10000. {
  10001. if (action_id == protectCivsConv)
  10002. {
  10003. if (transportCalled == false)
  10004. {
  10005. transportCalled = true;
  10006. Vector3 evacPosition = Commands->Get_Position ( obj );
  10007. GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  10008. Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_ChurchArea_EvacAnim.txt");
  10009. }
  10010. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-140.9f, 320.2f, 8.5f));
  10011. Commands->Set_Facing(chinook_obj1, -54.0f);
  10012. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_Church_TroopDrop.txt");
  10013. Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
  10014. }
  10015. }
  10016. }
  10017. };
  10018. DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Rope_JDG, "")
  10019. {
  10020. void Created( GameObject * obj )
  10021. {
  10022. Commands->Debug_Message ( "**********************script attached to evac rope\n" );
  10023. Commands->Enable_Hibernation( obj, false );
  10024. GameObject * myController = Commands->Find_Object ( 103394 );
  10025. if (myController != NULL)
  10026. {
  10027. Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  10028. }
  10029. }
  10030. void Animation_Complete(GameObject * obj, const char *anim)
  10031. {
  10032. if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
  10033. {
  10034. Commands->Destroy_Object ( obj );
  10035. }
  10036. }
  10037. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10038. {
  10039. switch (param)
  10040. {
  10041. case M01_MODIFY_YOUR_ACTION_JDG:
  10042. {
  10043. Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
  10044. Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
  10045. }
  10046. break;
  10047. }
  10048. }
  10049. };
  10050. DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Waypath_JDG, "")
  10051. {
  10052. void Created( GameObject * obj )
  10053. {
  10054. Commands->Enable_Hibernation( obj, false );
  10055. GameObject * myController = Commands->Find_Object ( 103394 );
  10056. if (myController != NULL)
  10057. {
  10058. Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  10059. }
  10060. }
  10061. void Animation_Complete(GameObject * obj, const char *anim)
  10062. {
  10063. if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
  10064. {
  10065. Commands->Destroy_Object ( obj );
  10066. }
  10067. }
  10068. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10069. {
  10070. switch (param)
  10071. {
  10072. case M01_MODIFY_YOUR_ACTION_JDG:
  10073. {
  10074. Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
  10075. Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
  10076. }
  10077. break;
  10078. }
  10079. }
  10080. };
  10081. DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Chopper_JDG, "")
  10082. {
  10083. void Created( GameObject * obj )
  10084. {
  10085. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
  10086. Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
  10087. Commands->Set_Shield_Type ( obj, "Blamo" );
  10088. Commands->Enable_Hibernation( obj, false );
  10089. Commands->Disable_Physical_Collisions ( obj );
  10090. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  10091. GameObject * myController = Commands->Find_Object ( 103394 );
  10092. if (myController != NULL)
  10093. {
  10094. Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  10095. }
  10096. }
  10097. void Damaged( GameObject * obj, GameObject * damager, float amount )
  10098. {
  10099. float myMaxHealth = Commands->Get_Max_Health ( obj );
  10100. Commands->Set_Health ( obj, myMaxHealth );
  10101. }
  10102. void Animation_Complete(GameObject * obj, const char *anim)
  10103. {
  10104. if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
  10105. {
  10106. Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
  10107. Vector3 evacLocation = Commands->Get_Position ( obj );
  10108. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
  10109. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  10110. GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  10111. GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  10112. if (loveshackNun != NULL)
  10113. {
  10114. Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10115. }
  10116. if (churchNun != NULL)
  10117. {
  10118. Commands->Send_Custom_Event( obj, churchNun, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10119. }
  10120. if (priest != NULL)
  10121. {
  10122. Commands->Send_Custom_Event( obj, priest, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10123. }
  10124. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  10125. }
  10126. else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
  10127. {
  10128. Commands->Destroy_Object ( obj );
  10129. }
  10130. }
  10131. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10132. {
  10133. switch (param)
  10134. {
  10135. case M01_MODIFY_YOUR_ACTION_JDG:
  10136. {
  10137. Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
  10138. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
  10139. }
  10140. break;
  10141. case M01_GOTO_IDLE_JDG:
  10142. {
  10143. Commands->Enable_Collisions ( obj );
  10144. }
  10145. break;
  10146. case M01_DO_END_MISSION_CHECK_JDG:
  10147. {
  10148. GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
  10149. GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
  10150. GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
  10151. if ((loveshackNun != NULL) || (churchNun != NULL) || (priest != NULL))
  10152. {
  10153. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  10154. }
  10155. else
  10156. {
  10157. Commands->Debug_Message ( "*******************************all barn civs on board--about to send cutom to controller\n" );
  10158. GameObject * controller = Commands->Find_Object ( 103394 );
  10159. if (controller != NULL)
  10160. {
  10161. Commands->Send_Custom_Event ( obj, controller, 0, M01_EVERYONES_ON_BOARD_JDG, 0 );
  10162. Commands->Debug_Message ( "*******************************all barn civs on board--sent cutom to controller\n" );
  10163. }
  10164. }
  10165. }
  10166. break;
  10167. }
  10168. }
  10169. };
  10170. DECLARE_SCRIPT(M01_Church_Priest_JDG, "")
  10171. {
  10172. int lucky_charms;
  10173. int prayerSound;
  10174. REGISTER_VARIABLES()
  10175. {
  10176. SAVE_VARIABLE(lucky_charms, 1);
  10177. SAVE_VARIABLE(prayerSound, 1);
  10178. }
  10179. void Created( GameObject * obj )
  10180. {
  10181. Commands->Innate_Disable(obj);
  10182. Vector3 myPosition = Commands->Get_Position ( obj );
  10183. prayerSound = Commands->Create_Sound ( "MX1DSGN_DSGN0020I1DSGN_SND", myPosition, obj );
  10184. }
  10185. void Killed( GameObject * obj, GameObject * killer )
  10186. {
  10187. Commands->Stop_Sound ( prayerSound, true );
  10188. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
  10189. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10190. }
  10191. void Poked( GameObject * obj, GameObject * poker )
  10192. {
  10193. if (poker == STAR)
  10194. {
  10195. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_PRIEST_CONVERSATION_JDG, 0 );
  10196. }
  10197. }
  10198. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10199. {
  10200. ActionParamsStruct params;
  10201. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  10202. {
  10203. params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
  10204. params.Set_Animation ("H_A_Host_L2b", true);
  10205. Commands->Action_Play_Animation (obj, params);
  10206. Commands->Start_Sound ( prayerSound );
  10207. }
  10208. else if ((param == M01_CHURCH_GUARD_IS_DEAD_JDG))//Your guard is dead--do something
  10209. {
  10210. Commands->Stop_Sound ( prayerSound, true );
  10211. Commands->Enable_Hibernation( obj, false );
  10212. params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
  10213. params.Set_Animation ("H_A_Host_L2c", false);
  10214. Commands->Action_Play_Animation (obj, params);
  10215. }
  10216. else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
  10217. {
  10218. Vector3 myPosition = Commands->Get_Position ( obj );
  10219. Vector3 starPosition = Commands->Get_Position ( STAR );
  10220. float distance = Commands->Get_Distance ( myPosition, starPosition );
  10221. if (distance <= 15)
  10222. {
  10223. lucky_charms = Commands->Create_Conversation( "M01_Priest_LuckyCharms_Conversation", 100, 1000, false);
  10224. Commands->Join_Conversation( obj, lucky_charms, false, true, true );
  10225. Commands->Join_Conversation( STAR, lucky_charms, false, false, false );
  10226. Commands->Start_Conversation( lucky_charms, lucky_charms );
  10227. Commands->Monitor_Conversation( obj, lucky_charms );
  10228. }
  10229. else
  10230. {
  10231. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
  10232. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10233. params.Set_Movement( evacSpot, RUN, 0.5f );
  10234. Commands->Action_Goto( obj, params );
  10235. }
  10236. //ActionParamsStruct params;
  10237. //Commands->Action_Reset ( obj, 100 );
  10238. //params.Set_Basic(this, 100, M01_PICK_A_NEW_LOCATION_JDG);
  10239. //params.Set_Movement( STAR, RUN, 8 );
  10240. //Commands->Action_Goto( obj, params );
  10241. }
  10242. }
  10243. void Animation_Complete(GameObject * obj, const char *anim)
  10244. {
  10245. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  10246. {
  10247. Commands->Destroy_Object ( obj );
  10248. }
  10249. }
  10250. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  10251. {
  10252. ActionParamsStruct params;
  10253. if (complete_reason == ACTION_COMPLETE_NORMAL)
  10254. {
  10255. if (action_id == M01_DOING_ANIMATION_01_JDG )//civ is standing up after guard is dead
  10256. {
  10257. params.Set_Basic( this, 90, M01_DOING_ANIMATION_02_JDG );
  10258. params.Set_Animation ("H_A_Host_L1b", false);
  10259. Commands->Action_Play_Animation (obj, params);
  10260. }
  10261. else if (action_id == M01_DOING_ANIMATION_02_JDG)//civ is standing up after guard is dead
  10262. {
  10263. params.Set_Basic( this, 90, M01_DOING_ANIMATION_03_JDG );
  10264. params.Set_Animation ("H_A_Host_L1c", false);
  10265. Commands->Action_Play_Animation (obj, params);
  10266. }
  10267. else if (action_id == M01_DOING_ANIMATION_03_JDG)//civ is standing up after guard is dead
  10268. {
  10269. params.Set_Basic( this, 90, M01_WALKING_WAYPATH_02_JDG );
  10270. params.Set_Movement( Vector3 (-135.571f, 340.213f, 9.608f), 0.9f, 0.5f );
  10271. Commands->Action_Goto( obj, params );
  10272. }
  10273. else if (action_id == M01_WALKING_WAYPATH_02_JDG)//civ is standing up after guard is dead
  10274. {
  10275. Commands->Enable_Hibernation( obj, true );
  10276. if (Commands->Find_Object ( 103395 ))//this is your conversation zone
  10277. {
  10278. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103395 ), 0, M01_START_ACTING_JDG, 0 );
  10279. }
  10280. }
  10281. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//Nun is by chinook--play getting on anim
  10282. {
  10283. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
  10284. Commands->Give_Points( STAR, 2000, false );
  10285. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  10286. powerupSpawnLocation.Z += 0.75f;
  10287. char *powerups[2] =
  10288. {//this is a list of potential powerups to be dropped by sniper target guys
  10289. "POW_Health_100",
  10290. "POW_Armor_100",
  10291. };
  10292. int random = Commands->Get_Random_Int(0, 2);
  10293. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  10294. GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
  10295. if (airdropController != NULL)
  10296. {
  10297. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10298. }
  10299. GameObject * myEvacController = Commands->Find_Object ( 103394 );
  10300. if (myEvacController != NULL)//tell controller to spawn a rope
  10301. {
  10302. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  10303. }
  10304. }
  10305. else if (action_id == M01_PICK_A_NEW_LOCATION_JDG)//priest is by Havoc--cue lucky charms conversation
  10306. {
  10307. //lucky_charms = Commands->Create_Conversation( "M01_Priest_LuckyCharms_Conversation", 100, 1000, false);
  10308. //Commands->Join_Conversation( obj, lucky_charms, true, true );
  10309. //Commands->Start_Conversation( lucky_charms, lucky_charms );
  10310. //Commands->Monitor_Conversation( obj, lucky_charms );
  10311. }
  10312. else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//priest is by Havoc--cue lucky charms conversation
  10313. {
  10314. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
  10315. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10316. params.Set_Movement( evacSpot, RUN, 0.5f );
  10317. Commands->Action_Goto( obj, params );
  10318. }
  10319. }
  10320. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)//priest is by Havoc--cue lucky charms conversation
  10321. {
  10322. if (action_id == lucky_charms)
  10323. {
  10324. params.Set_Basic(this, 100, M01_DOING_ANIMATION_04_JDG);
  10325. params.Set_Animation ("H_A_J12C", false);
  10326. Commands->Action_Play_Animation (obj, params);
  10327. Vector3 spawnPosition = Commands->Get_Position ( obj );
  10328. spawnPosition.Z += 0.75f;
  10329. int spawn_count = 1;
  10330. while (spawn_count <= 1)
  10331. {
  10332. spawnPosition.X += Commands->Get_Random( -2.0f , 2.0f);
  10333. spawnPosition.Y += Commands->Get_Random( -2.0f , 2.0f);
  10334. GameObject *luckycharm;
  10335. luckycharm = Commands->Create_Object ( "POW_Data_Disc", spawnPosition );
  10336. Commands->Attach_Script(luckycharm, "M01_Priest_Datadisc_JDG", "");
  10337. spawn_count++;
  10338. }
  10339. }
  10340. }
  10341. }
  10342. };
  10343. DECLARE_SCRIPT(M01_Church_Interior_Nun_JDG, "")
  10344. {
  10345. bool following_player;
  10346. int prayerSound;
  10347. REGISTER_VARIABLES()
  10348. {
  10349. SAVE_VARIABLE(following_player, 1);
  10350. SAVE_VARIABLE(prayerSound, 2);
  10351. }
  10352. void Created( GameObject * obj )
  10353. {
  10354. Commands->Innate_Disable(obj);
  10355. following_player = false;
  10356. Vector3 myPosition = Commands->Get_Position ( obj );
  10357. prayerSound = Commands->Create_Sound ( "MX1DSGN_DSGN0021I1DSGN_SND", myPosition, obj );
  10358. }
  10359. void Killed( GameObject * obj, GameObject * killer )
  10360. {
  10361. Commands->Stop_Sound ( prayerSound, true );
  10362. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
  10363. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10364. }
  10365. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10366. {
  10367. ActionParamsStruct params;
  10368. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  10369. {
  10370. params.Set_Basic( this, 90, 0 );
  10371. params.Set_Animation ("S_A_Human.H_A_Host_L2b", true);
  10372. Commands->Action_Play_Animation (obj, params);
  10373. Commands->Start_Sound ( prayerSound );
  10374. }
  10375. else if ((param == M01_CHURCH_GUARD_IS_DEAD_JDG))//Your guard is dead--do something
  10376. {
  10377. Commands->Stop_Sound ( prayerSound, true );
  10378. Commands->Enable_Hibernation( obj, false );
  10379. params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
  10380. params.Set_Animation ("S_A_Human.H_A_Host_L2c", false);
  10381. Commands->Action_Play_Animation (obj, params);
  10382. }
  10383. else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
  10384. {
  10385. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
  10386. ActionParamsStruct params;
  10387. Commands->Action_Reset ( obj, 100 );
  10388. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10389. params.Set_Movement( evacSpot, RUN, 1 );
  10390. Commands->Action_Goto( obj, params );
  10391. }
  10392. }
  10393. void Animation_Complete(GameObject * obj, const char *anim)
  10394. {
  10395. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  10396. {
  10397. Commands->Destroy_Object ( obj );
  10398. }
  10399. }
  10400. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  10401. {
  10402. ActionParamsStruct params;
  10403. if (complete_reason == ACTION_COMPLETE_NORMAL)
  10404. {
  10405. if (action_id == M01_DOING_ANIMATION_01_JDG)//civ is standing up after guard is dead
  10406. {
  10407. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  10408. params.Set_Animation ("S_A_Human.H_A_Host_L1b", false);
  10409. Commands->Action_Play_Animation (obj, params);
  10410. }
  10411. else if (action_id == M01_DOING_ANIMATION_02_JDG)//civ is standing up after guard is dead
  10412. {
  10413. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  10414. params.Set_Animation ("S_A_Human.H_A_Host_L1c", false);
  10415. Commands->Action_Play_Animation (obj, params);
  10416. Vector3 myPosition = Commands->Get_Position ( obj );
  10417. Commands->Create_Sound ( "MX1DSGN_DSGN0022I1DSGN_SND", myPosition, obj );
  10418. }
  10419. else if (action_id == M01_DOING_ANIMATION_03_JDG)//civ is standing up after guard is dead
  10420. {
  10421. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  10422. params.Set_Movement( Vector3 (-136.738f, 325.073f, 8.167f), RUN, 0.50f );
  10423. Commands->Action_Goto( obj, params );
  10424. }
  10425. else if (action_id == M01_WALKING_WAYPATH_02_JDG)//Nun is by chinook--play getting on anim
  10426. {
  10427. Commands->Enable_Hibernation( obj, true );
  10428. if (Commands->Find_Object ( 101370 ))//this is your conversation zone
  10429. {
  10430. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101370 ), 0, M01_START_ACTING_JDG, 1 );
  10431. }
  10432. }
  10433. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//Nun is by chinook--play getting on anim
  10434. {
  10435. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
  10436. Commands->Give_Points( STAR, 2000, false );
  10437. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  10438. powerupSpawnLocation.Z += 0.75f;
  10439. char *powerups[2] =
  10440. {//this is a list of potential powerups to be dropped by sniper target guys
  10441. "POW_Health_100",
  10442. "POW_Armor_100",
  10443. };
  10444. int random = Commands->Get_Random_Int(0, 2);
  10445. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  10446. GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
  10447. if (airdropController != NULL)
  10448. {
  10449. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10450. }
  10451. GameObject * myEvacController = Commands->Find_Object ( 103394 );
  10452. if (myEvacController != NULL)//tell controller to spawn a rope
  10453. {
  10454. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  10455. }
  10456. }
  10457. }
  10458. }
  10459. void Poked( GameObject * obj, GameObject * poker )
  10460. {
  10461. ActionParamsStruct params;
  10462. if (poker == STAR)
  10463. {
  10464. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_INTERIOR_NUN_CONVERSATION_JDG, 0 );
  10465. }
  10466. }
  10467. };
  10468. DECLARE_SCRIPT(M01_Church_LoveShack_Nun_JDG, "")
  10469. {
  10470. void Created( GameObject * obj )
  10471. {
  10472. Commands->Innate_Disable(obj);
  10473. }
  10474. void Killed( GameObject * obj, GameObject * killer )
  10475. {
  10476. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
  10477. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10478. GameObject * conversationZone = Commands->Find_Object ( 103392 );
  10479. if (conversationZone != NULL)
  10480. {
  10481. Commands->Destroy_Object ( conversationZone );
  10482. }
  10483. }
  10484. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10485. {
  10486. ActionParamsStruct params;
  10487. if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
  10488. {
  10489. params.Set_Basic(this, 90, M01_WALKING_WAYPATH_01_JDG);
  10490. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  10491. params.WaypathID = 100750;
  10492. params.WaypointStartID = 100753;
  10493. params.WaypointEndID = 100758;
  10494. Commands->Action_Goto( obj, params );
  10495. }
  10496. else if ((param == M01_LOVESHACK_GUARD_IS_DEAD_JDG))//Your guard is dead--follow havoc
  10497. {
  10498. Commands->Enable_Hibernation( obj, false );
  10499. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  10500. params.Set_Movement( Vector3 (0,0,0), RUN, 1.0f );
  10501. params.WaypathID = 103383;
  10502. params.WaypointStartID = 103384;
  10503. params.WaypointEndID = 103390;
  10504. Commands->Action_Goto( obj, params );
  10505. }
  10506. else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
  10507. {
  10508. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
  10509. ActionParamsStruct params;
  10510. Commands->Action_Reset ( obj, 100 );
  10511. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10512. params.Set_Movement( evacSpot, RUN, 1 );
  10513. Commands->Action_Goto( obj, params );
  10514. }
  10515. }
  10516. void Animation_Complete(GameObject * obj, const char *anim)
  10517. {
  10518. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  10519. {
  10520. Commands->Destroy_Object ( obj );
  10521. }
  10522. }
  10523. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  10524. {
  10525. ActionParamsStruct params;
  10526. if (complete_reason == ACTION_COMPLETE_NORMAL)
  10527. {
  10528. if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//Nun is by chinook--play getting on anim
  10529. {
  10530. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
  10531. Commands->Give_Points( STAR, 2000, false );
  10532. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  10533. powerupSpawnLocation.Z += 0.75f;
  10534. char *powerups[2] =
  10535. {//this is a list of potential powerups to be dropped by sniper target guys
  10536. "POW_Health_100",
  10537. "POW_Armor_100",
  10538. };
  10539. int random = Commands->Get_Random_Int(0, 2);
  10540. //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
  10541. //if (spawn_effect)
  10542. //{
  10543. // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
  10544. //}
  10545. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  10546. GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
  10547. if (airdropController != NULL)
  10548. {
  10549. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10550. }
  10551. GameObject * myEvacController = Commands->Find_Object ( 103394 );
  10552. if (myEvacController != NULL)//tell controller to spawn a rope
  10553. {
  10554. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  10555. }
  10556. }
  10557. else if (action_id == M01_WALKING_WAYPATH_02_JDG )//nun is at hide spot--play animation--cue havoc talk zone
  10558. {
  10559. Commands->Enable_Hibernation( obj, true );
  10560. if (Commands->Find_Object ( 101368 ))//this is your conversation zone
  10561. {
  10562. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101368 ), 0, M01_START_ACTING_JDG, 1 );
  10563. }
  10564. }
  10565. }
  10566. }
  10567. void Poked( GameObject * obj, GameObject * poker )
  10568. {
  10569. if (poker == STAR)
  10570. {
  10571. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG, 0 );
  10572. }
  10573. }
  10574. };
  10575. DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Rope_JDG, "")
  10576. {
  10577. void Created( GameObject * obj )
  10578. {
  10579. Commands->Debug_Message ( "**********************script attached to evac rope\n" );
  10580. Commands->Enable_Hibernation( obj, false );
  10581. GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10582. if (myController != NULL)
  10583. {
  10584. Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  10585. }
  10586. }
  10587. void Animation_Complete(GameObject * obj, const char *anim)
  10588. {
  10589. if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
  10590. {
  10591. Commands->Destroy_Object ( obj );
  10592. }
  10593. }
  10594. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10595. {
  10596. switch (param)
  10597. {
  10598. case M01_MODIFY_YOUR_ACTION_JDG:
  10599. {
  10600. Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
  10601. Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
  10602. }
  10603. break;
  10604. }
  10605. }
  10606. };
  10607. DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Waypath_JDG, "")
  10608. {
  10609. void Created( GameObject * obj )
  10610. {
  10611. Commands->Enable_Hibernation( obj, false );
  10612. GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10613. if (myController != NULL)
  10614. {
  10615. Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  10616. }
  10617. }
  10618. void Animation_Complete(GameObject * obj, const char *anim)
  10619. {
  10620. if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
  10621. {
  10622. Commands->Destroy_Object ( obj );
  10623. }
  10624. }
  10625. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10626. {
  10627. switch (param)
  10628. {
  10629. case M01_MODIFY_YOUR_ACTION_JDG:
  10630. {
  10631. Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
  10632. Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
  10633. }
  10634. break;
  10635. }
  10636. }
  10637. };
  10638. DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Chopper_JDG, "")
  10639. {
  10640. void Created( GameObject * obj )
  10641. {
  10642. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
  10643. Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
  10644. Commands->Set_Shield_Type ( obj, "Blamo" );
  10645. Commands->Enable_Hibernation( obj, false );
  10646. Commands->Disable_Physical_Collisions ( obj );
  10647. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  10648. GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10649. if (myController != NULL)
  10650. {
  10651. Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  10652. }
  10653. GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  10654. GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  10655. GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  10656. if (barnCiv01 != NULL)
  10657. {
  10658. Commands->Send_Custom_Event ( obj, barnCiv01, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  10659. }
  10660. if (barnCiv02 != NULL)
  10661. {
  10662. Commands->Send_Custom_Event ( obj, barnCiv02, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  10663. }
  10664. if (barnCiv03 != NULL)
  10665. {
  10666. Commands->Send_Custom_Event ( obj, barnCiv03, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
  10667. }
  10668. }
  10669. void Damaged( GameObject * obj, GameObject * damager, float amount )
  10670. {
  10671. float myMaxHealth = Commands->Get_Max_Health ( obj );
  10672. Commands->Set_Health ( obj, myMaxHealth );
  10673. }
  10674. void Animation_Complete(GameObject * obj, const char *anim)
  10675. {
  10676. if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
  10677. {
  10678. Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
  10679. Vector3 evacLocation = Commands->Get_Position ( obj );
  10680. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
  10681. GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  10682. GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  10683. GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  10684. if (barnCiv01 != NULL)
  10685. {
  10686. Commands->Send_Custom_Event ( obj, barnCiv01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  10687. }
  10688. if (barnCiv02 != NULL)
  10689. {
  10690. Commands->Send_Custom_Event ( obj, barnCiv02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  10691. }
  10692. if (barnCiv03 != NULL)
  10693. {
  10694. Commands->Send_Custom_Event ( obj, barnCiv03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 2 );
  10695. }
  10696. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  10697. }
  10698. else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
  10699. {
  10700. Commands->Destroy_Object ( obj );
  10701. }
  10702. }
  10703. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10704. {
  10705. switch (param)
  10706. {
  10707. case M01_MODIFY_YOUR_ACTION_JDG:
  10708. {
  10709. Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
  10710. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
  10711. }
  10712. break;
  10713. case M01_GOTO_IDLE_JDG:
  10714. {
  10715. Commands->Enable_Collisions ( obj );
  10716. }
  10717. break;
  10718. case M01_DO_END_MISSION_CHECK_JDG:
  10719. {
  10720. GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  10721. GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  10722. GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  10723. if ((barnCiv01 != NULL)||(barnCiv02 != NULL)||(barnCiv03 != NULL))
  10724. {
  10725. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );
  10726. }
  10727. else
  10728. {
  10729. Commands->Debug_Message ( "*******************************all barn civs on board--about to send cutom to controller\n" );
  10730. GameObject * controller = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10731. if (controller != NULL)
  10732. {
  10733. Commands->Send_Custom_Event ( obj, controller, 0, M01_EVERYONES_ON_BOARD_JDG, 0 );
  10734. Commands->Debug_Message ( "*******************************all barn civs on board--sent cutom to controller\n" );
  10735. }
  10736. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  10737. if (missionController != NULL)
  10738. {
  10739. Commands->Send_Custom_Event( obj, missionController, 0, M01_END_BARN_ROUNDUP_OBJECTIVE_JDG, 0 );
  10740. }
  10741. }
  10742. }
  10743. break;
  10744. }
  10745. }
  10746. };
  10747. DECLARE_SCRIPT(M01_Barn_Prisoner_01_JDG, "")//this guys ID is M01_BARN_PRISONER_01_ID 101442--this is female
  10748. {
  10749. bool talkingToHavoc;
  10750. bool chinookOnWay;
  10751. REGISTER_VARIABLES()
  10752. {
  10753. SAVE_VARIABLE(talkingToHavoc, 1);
  10754. SAVE_VARIABLE(chinookOnWay, 2);
  10755. }
  10756. void Created( GameObject * obj )
  10757. {
  10758. talkingToHavoc = false;
  10759. chinookOnWay = false;
  10760. Commands->Innate_Disable(obj);
  10761. ActionParamsStruct params;
  10762. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  10763. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
  10764. Commands->Action_Play_Animation ( obj, params );
  10765. }
  10766. void Killed( GameObject * obj, GameObject * killer ) //
  10767. {
  10768. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
  10769. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10770. if (talkingToHavoc == true)
  10771. {
  10772. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 2 );
  10773. }
  10774. GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10775. if (evacController != NULL)
  10776. {
  10777. Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10778. }
  10779. }
  10780. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10781. {
  10782. ActionParamsStruct params;
  10783. if (param == M01_MODIFY_YOUR_ACTION_JDG)//babushka runs to hide spot
  10784. {
  10785. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  10786. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
  10787. Commands->Action_Play_Animation ( obj, params );
  10788. }
  10789. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//you are now talking to havoc in your shed
  10790. {
  10791. talkingToHavoc = true;
  10792. }
  10793. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//your havoc conversation is now over
  10794. {
  10795. talkingToHavoc = false;
  10796. }
  10797. else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
  10798. {
  10799. chinookOnWay = true;
  10800. Commands->Enable_Hibernation( obj, false );
  10801. }
  10802. else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
  10803. {
  10804. Commands->Enable_Hibernation(obj, false );
  10805. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
  10806. ActionParamsStruct params;
  10807. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10808. params.Set_Movement( evacSpot, RUN, 1 );
  10809. Commands->Action_Goto( obj, params );
  10810. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
  10811. //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
  10812. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
  10813. GameObject * babushkazone = Commands->Find_Object ( 101662 );
  10814. if (babushkazone != NULL)//kill babushka talk zone
  10815. {
  10816. Commands->Destroy_Object ( babushkazone );
  10817. }
  10818. }
  10819. }
  10820. void Animation_Complete(GameObject * obj, const char *anim)
  10821. {
  10822. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  10823. {
  10824. Commands->Destroy_Object ( obj );
  10825. }
  10826. }
  10827. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  10828. {
  10829. ActionParamsStruct params;
  10830. if (complete_reason == ACTION_COMPLETE_NORMAL)
  10831. {
  10832. if (action_id == M01_WALKING_WAYPATH_02_JDG)//civ is at hiding spot--crouch
  10833. {
  10834. Commands->Set_Innate_Is_Stationary ( obj, true );
  10835. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  10836. params.Set_Attack (STAR, 0, 0, true);
  10837. params.Set_Animation ("S_A_HUMAN.H_A_A0C0", true);
  10838. Commands->Action_Play_Animation (obj, params);
  10839. if (Commands->Find_Object ( 101662 ))//sending custom to babushka conversation zone--okay to play conversation
  10840. {
  10841. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101662 ), 0, M01_START_ACTING_JDG, 0 );
  10842. }
  10843. if (chinookOnWay == false)
  10844. {
  10845. Commands->Enable_Hibernation( obj, true );
  10846. }
  10847. }
  10848. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//civ is at evac chopper--get on
  10849. {
  10850. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  10851. powerupSpawnLocation.Z += 0.75f;
  10852. char *powerups[2] =
  10853. {//this is a list of potential powerups to be dropped by sniper target guys
  10854. "POW_Health_100",
  10855. "POW_Armor_100",
  10856. };
  10857. int random = Commands->Get_Random_Int(0, 2);
  10858. //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
  10859. //if (spawn_effect)
  10860. //{
  10861. // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
  10862. //}
  10863. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  10864. //Commands->Give_Points( STAR, 2000, false );
  10865. GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10866. if (airdropController != NULL)
  10867. {
  10868. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10869. }
  10870. GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10871. if (myEvacController != NULL)//tell controller to spawn a rope
  10872. {
  10873. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  10874. }
  10875. }
  10876. else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
  10877. {
  10878. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  10879. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
  10880. Commands->Action_Play_Animation ( obj, params );
  10881. Commands->Set_Innate_Is_Stationary ( obj, true );
  10882. }
  10883. else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
  10884. {
  10885. Commands->Enable_Hibernation( obj, false );
  10886. Commands->Action_Reset ( obj, 100 );
  10887. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  10888. params.Set_Movement( Vector3(-51.0f, 214.2f, 5.5f), 1.0f, 0.5f );
  10889. Commands->Action_Goto( obj, params );
  10890. }
  10891. }
  10892. }
  10893. };
  10894. DECLARE_SCRIPT(M01_Barn_Prisoner_02_JDG, "")//this guys ID is M01_BARN_PRISONER_02_ID 101444--this is Billy
  10895. {
  10896. bool chinookOnWay;
  10897. REGISTER_VARIABLES()
  10898. {
  10899. SAVE_VARIABLE(chinookOnWay, 1);
  10900. }
  10901. void Created( GameObject * obj )
  10902. {
  10903. chinookOnWay = false;
  10904. Commands->Innate_Disable(obj);
  10905. ActionParamsStruct params;
  10906. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  10907. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
  10908. Commands->Action_Play_Animation ( obj, params );
  10909. }
  10910. void Killed( GameObject * obj, GameObject * killer )
  10911. {
  10912. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
  10913. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10914. GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10915. if (evacController != NULL)
  10916. {
  10917. Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
  10918. }
  10919. }
  10920. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  10921. {
  10922. ActionParamsStruct params;
  10923. if (param == M01_MODIFY_YOUR_ACTION_JDG)//goto your hiding spot
  10924. {
  10925. Commands->Enable_Hibernation( obj, false );
  10926. Commands->Action_Reset ( obj, 100 );
  10927. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  10928. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
  10929. Commands->Action_Play_Animation ( obj, params );
  10930. }
  10931. else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
  10932. {
  10933. chinookOnWay = true;
  10934. Commands->Enable_Hibernation( obj, false );
  10935. }
  10936. else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
  10937. {
  10938. Commands->Enable_Hibernation(obj, false );
  10939. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
  10940. ActionParamsStruct params;
  10941. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  10942. params.Set_Movement( evacSpot, RUN, 1 );
  10943. Commands->Action_Goto( obj, params );
  10944. GameObject * billyszone = Commands->Find_Object ( 101661 );
  10945. if (billyszone != NULL)//kill billy's talk zone
  10946. {
  10947. Commands->Destroy_Object ( billyszone );
  10948. }
  10949. }
  10950. }
  10951. void Animation_Complete(GameObject * obj, const char *anim)
  10952. {
  10953. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  10954. {
  10955. Commands->Destroy_Object ( obj );
  10956. }
  10957. }
  10958. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  10959. {
  10960. ActionParamsStruct params;
  10961. if (complete_reason == ACTION_COMPLETE_NORMAL)
  10962. {
  10963. if (action_id == M01_WALKING_WAYPATH_01_JDG)//billys at his hide spot
  10964. {
  10965. if (Commands->Find_Object ( 101661 ))//sending custom to billys conversation zone--okay to play conversation
  10966. {
  10967. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101661 ), 0, M01_START_ACTING_JDG, 0 );
  10968. }
  10969. if (chinookOnWay == false)
  10970. {
  10971. Commands->Enable_Hibernation( obj, true );
  10972. }
  10973. }
  10974. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//civ is at evac chopper--get on
  10975. {
  10976. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  10977. powerupSpawnLocation.Z += 0.75f;
  10978. char *powerups[2] =
  10979. {//this is a list of potential powerups to be dropped by sniper target guys
  10980. "POW_Health_100",
  10981. "POW_Armor_100",
  10982. };
  10983. int random = Commands->Get_Random_Int(0, 2);
  10984. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  10985. Commands->Give_Points( STAR, 2000, false );
  10986. GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10987. if (airdropController != NULL)
  10988. {
  10989. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  10990. }
  10991. GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  10992. if (myEvacController != NULL)//tell controller to spawn a rope
  10993. {
  10994. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  10995. }
  10996. }
  10997. else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
  10998. {
  10999. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  11000. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
  11001. Commands->Action_Play_Animation ( obj, params );
  11002. Commands->Set_Innate_Is_Stationary ( obj, true );
  11003. }
  11004. else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
  11005. {
  11006. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  11007. params.Set_Movement( Vector3(-73.572f, 138.013f, 0.329f), RUN, .5f );
  11008. Commands->Action_Goto( obj, params );
  11009. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
  11010. //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
  11011. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
  11012. }
  11013. }
  11014. }
  11015. };
  11016. DECLARE_SCRIPT(M01_Barn_Prisoner_03_JDG, "")//this guys ID is M01_BARN_PRISONER_03_ID 101443--this is pierre
  11017. {
  11018. bool chinookOnWay;
  11019. REGISTER_VARIABLES()
  11020. {
  11021. SAVE_VARIABLE(chinookOnWay, 1);
  11022. }
  11023. void Created( GameObject * obj )
  11024. {
  11025. chinookOnWay = false;
  11026. //Commands->Innate_Disable(obj);
  11027. Commands->Set_Innate_Is_Stationary ( obj, true );
  11028. ActionParamsStruct params;
  11029. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  11030. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
  11031. Commands->Action_Play_Animation ( obj, params );
  11032. }
  11033. void Killed( GameObject * obj, GameObject * killer )
  11034. {
  11035. Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
  11036. //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
  11037. GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  11038. if (evacController != NULL)
  11039. {
  11040. Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
  11041. }
  11042. }
  11043. void Animation_Complete(GameObject * obj, const char *anim)
  11044. {
  11045. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  11046. {
  11047. Commands->Destroy_Object ( obj );
  11048. }
  11049. }
  11050. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11051. {
  11052. ActionParamsStruct params;
  11053. if (param == M01_MODIFY_YOUR_ACTION_JDG)//guy runs to back shed
  11054. {
  11055. Commands->Set_Innate_Is_Stationary ( obj, false );
  11056. Commands->Enable_Hibernation( obj, false );
  11057. Commands->Action_Reset ( obj, 100 );
  11058. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  11059. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
  11060. Commands->Action_Play_Animation ( obj, params );
  11061. }//M01_MODIFY_YOUR_ACTION_11_JDG
  11062. else if (param == M01_MODIFY_YOUR_ACTION_11_JDG)//babushka is talking ot havoc--turn and face him
  11063. {
  11064. Commands->Action_Reset ( obj, 100 );
  11065. //ActionParamsStruct params;
  11066. //params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
  11067. //params.Set_Look( STAR, 15 );
  11068. //params.Set_Attack( STAR, 0, 0, true );
  11069. //Commands->Action_Attack ( obj, params );
  11070. //Commands->Action_Face_Location ( obj, params );
  11071. ActionParamsStruct params;
  11072. params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
  11073. //params.Set_Look( STAR, 15 );
  11074. params.Set_Attack( STAR, 0, 0, true );
  11075. Commands->Action_Attack ( obj, params );
  11076. }
  11077. else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
  11078. {
  11079. chinookOnWay = true;
  11080. Commands->Enable_Hibernation( obj, false );
  11081. Commands->Set_Innate_Is_Stationary ( obj, false );
  11082. }
  11083. else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
  11084. {
  11085. Commands->Debug_Message ( "***************************barn civ 3 has received evac chopper call--should now be going to evac spot\n" );
  11086. Commands->Enable_Hibernation(obj, false );
  11087. Commands->Set_Innate_Is_Stationary ( obj, false );
  11088. Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
  11089. ActionParamsStruct params;
  11090. params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
  11091. params.Set_Movement( evacSpot, RUN, 1 );
  11092. Commands->Action_Goto( obj, params );
  11093. }
  11094. }
  11095. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  11096. {
  11097. ActionParamsStruct params;
  11098. if (complete_reason == ACTION_COMPLETE_NORMAL)
  11099. {
  11100. if (action_id == M01_WALKING_WAYPATH_01_JDG)//civ is at hiding spot--crouch
  11101. {
  11102. Commands->Set_Innate_Is_Stationary ( obj, true );
  11103. ActionParamsStruct params;
  11104. params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
  11105. params.Set_Look( STAR, 15 );
  11106. //params.Set_Attack( STAR, 0, 0, true );
  11107. //Commands->Action_Attack ( obj, params );
  11108. Commands->Action_Face_Location ( obj, params );
  11109. if (Commands->Find_Object ( 101662 ))//sending custom to babushka conversation zone--okay to play conversation
  11110. {
  11111. Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101662 ), 0, M01_START_ACTING_JDG, 0 );
  11112. }
  11113. if (chinookOnWay == false)
  11114. {
  11115. Commands->Enable_Hibernation( obj, true );
  11116. }
  11117. }
  11118. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//civ is at evac chopper--get on
  11119. {
  11120. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  11121. powerupSpawnLocation.Z += 0.75f;
  11122. char *powerups[2] =
  11123. {//this is a list of potential powerups to be dropped by sniper target guys
  11124. "POW_Health_100",
  11125. "POW_Armor_100",
  11126. };
  11127. int random = Commands->Get_Random_Int(0, 2);
  11128. //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
  11129. //if (spawn_effect)
  11130. //{
  11131. // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
  11132. //}
  11133. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  11134. //Commands->Give_Points( STAR, 2000, false );
  11135. GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  11136. if (airdropController != NULL)
  11137. {
  11138. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  11139. }
  11140. GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
  11141. if (myEvacController != NULL)//tell controller to spawn a rope
  11142. {
  11143. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  11144. }
  11145. }
  11146. else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
  11147. {
  11148. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  11149. params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
  11150. Commands->Action_Play_Animation ( obj, params );
  11151. Commands->Set_Innate_Is_Stationary ( obj, true );
  11152. }
  11153. else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
  11154. {
  11155. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  11156. params.Set_Movement( Vector3(-56.8f, 213.2f, 5.5f), 1.0f, 0.5f );
  11157. Commands->Action_Goto( obj, params );
  11158. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
  11159. //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
  11160. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
  11161. }
  11162. }
  11163. }
  11164. };
  11165. DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Rope_JDG, "")
  11166. {
  11167. void Created( GameObject * obj )
  11168. {
  11169. Commands->Debug_Message ( "**********************script attached to evac rope\n" );
  11170. Commands->Enable_Hibernation( obj, false );
  11171. GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11172. if (myController != NULL)
  11173. {
  11174. Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  11175. }
  11176. }
  11177. void Animation_Complete(GameObject * obj, const char *anim)
  11178. {
  11179. if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
  11180. {
  11181. Commands->Destroy_Object ( obj );
  11182. }
  11183. }
  11184. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11185. {
  11186. switch (param)
  11187. {
  11188. case M01_MODIFY_YOUR_ACTION_JDG:
  11189. {
  11190. Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
  11191. Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
  11192. }
  11193. break;
  11194. }
  11195. }
  11196. };
  11197. DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Waypath_JDG, "")
  11198. {
  11199. void Created( GameObject * obj )
  11200. {
  11201. Commands->Enable_Hibernation( obj, false );
  11202. GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11203. if (myController != NULL)
  11204. {
  11205. Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  11206. }
  11207. }
  11208. void Animation_Complete(GameObject * obj, const char *anim)
  11209. {
  11210. if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
  11211. {
  11212. Commands->Destroy_Object ( obj );
  11213. }
  11214. }
  11215. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11216. {
  11217. switch (param)
  11218. {
  11219. case M01_MODIFY_YOUR_ACTION_JDG:
  11220. {
  11221. Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
  11222. Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
  11223. }
  11224. break;
  11225. }
  11226. }
  11227. };
  11228. DECLARE_SCRIPT(M01_Evac_TroopBone_JDG, "")
  11229. {
  11230. void Animation_Complete(GameObject * obj, const char *anim)
  11231. {
  11232. if (stricmp(anim, "XG_EV5_troopBN.XG_EV5_troopBN") == 0)
  11233. {
  11234. Commands->Destroy_Object ( obj );
  11235. }
  11236. }
  11237. };
  11238. DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Waypath_JDG, "")
  11239. {
  11240. void Created( GameObject * obj )
  11241. {
  11242. Commands->Enable_Hibernation( obj, false );
  11243. GameObject * myController = Commands->Find_Object ( 106694 );
  11244. if (myController != NULL)
  11245. {
  11246. Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  11247. }
  11248. }
  11249. void Animation_Complete(GameObject * obj, const char *anim)
  11250. {
  11251. if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
  11252. {
  11253. Commands->Destroy_Object ( obj );
  11254. }
  11255. }
  11256. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11257. {
  11258. switch (param)
  11259. {
  11260. case M01_MODIFY_YOUR_ACTION_JDG:
  11261. {
  11262. Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
  11263. Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
  11264. }
  11265. break;
  11266. }
  11267. }
  11268. };
  11269. DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Rope_JDG, "")
  11270. {
  11271. void Created( GameObject * obj )
  11272. {
  11273. Commands->Debug_Message ( "**********************script attached to evac rope\n" );
  11274. Commands->Enable_Hibernation( obj, false );
  11275. GameObject * myController = Commands->Find_Object ( 106694 );
  11276. if (myController != NULL)
  11277. {
  11278. Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
  11279. }
  11280. }
  11281. void Animation_Complete(GameObject * obj, const char *anim)
  11282. {
  11283. if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
  11284. {
  11285. Commands->Destroy_Object ( obj );
  11286. }
  11287. }
  11288. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11289. {
  11290. switch (param)
  11291. {
  11292. case M01_MODIFY_YOUR_ACTION_JDG:
  11293. {
  11294. Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
  11295. Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
  11296. }
  11297. break;
  11298. }
  11299. }
  11300. };
  11301. DECLARE_SCRIPT(M01_TriggerZone_GDIBase_BaseCommander_JDG, "")//106267 and 106268
  11302. {
  11303. void Entered( GameObject * obj, GameObject * enterer )
  11304. {
  11305. if (enterer == STAR)
  11306. {
  11307. GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
  11308. if (gdiBaseCommander != NULL)
  11309. {
  11310. Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_START_ACTING_JDG, 0 );
  11311. }
  11312. GameObject * zone01 = Commands->Find_Object ( 106267 );//trigger zone 01 for base commander
  11313. if (zone01 != NULL)
  11314. {
  11315. Commands->Destroy_Object ( zone01 );//this is a one-time only zone--cleaning up
  11316. }
  11317. GameObject * zone02 = Commands->Find_Object ( 106268 );//trigger zone 02 for base commander
  11318. if (zone02 != NULL)
  11319. {
  11320. Commands->Destroy_Object ( zone02 );//this is a one-time only zone--cleaning up
  11321. }
  11322. GameObject * zone03 = Commands->Find_Object ( 105615 );//trigger zone 01 for this is the path lets go
  11323. if (zone03 != NULL)
  11324. {
  11325. Commands->Destroy_Object ( zone03 );//this is a one-time only zone--cleaning up
  11326. }
  11327. GameObject * zone04 = Commands->Find_Object ( 113733 );//trigger zone 02 for this is the path lets go
  11328. if (zone04 != NULL)
  11329. {
  11330. Commands->Destroy_Object ( zone04 );//this is a one-time only zone--cleaning up
  11331. }
  11332. GameObject * pow01 = Commands->Find_Object ( 103328 );
  11333. GameObject * pow02 = Commands->Find_Object ( 103327 );
  11334. if (pow01 != NULL && pow02 != NULL)
  11335. {
  11336. Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  11337. }
  11338. if (pow01 != NULL)
  11339. {
  11340. Commands->Destroy_Object ( pow01 );
  11341. }
  11342. if (pow02 != NULL)
  11343. {
  11344. Commands->Destroy_Object ( pow02 );
  11345. }
  11346. GameObject * pow_guard01 = Commands->Find_Object ( 103334 );
  11347. if (pow_guard01 != NULL)
  11348. {
  11349. Commands->Destroy_Object ( pow_guard01 );
  11350. }
  11351. GameObject * pow_guard02 = Commands->Find_Object ( 103329 );
  11352. if (pow_guard02 != NULL)
  11353. {
  11354. Commands->Destroy_Object ( pow_guard02 );
  11355. }
  11356. GameObject * pow_guard03 = Commands->Find_Object ( 103330 );
  11357. if (pow_guard03 != NULL)
  11358. {
  11359. Commands->Destroy_Object ( pow_guard03 );
  11360. }
  11361. GameObject * pow_guard04 = Commands->Find_Object ( 103332 );
  11362. if (pow_guard04 != NULL)
  11363. {
  11364. Commands->Destroy_Object ( pow_guard04 );
  11365. }
  11366. GameObject * pow_triggerzone = Commands->Find_Object ( 114348 );//
  11367. if (pow_triggerzone != NULL)
  11368. {
  11369. Commands->Destroy_Object ( pow_triggerzone );
  11370. }
  11371. GameObject * gdi_minigunner_escort = Commands->Find_Object ( 104685 );//M01_GDI_BASE_POWS_OVER_JDG
  11372. if (gdi_minigunner_escort != NULL)
  11373. {
  11374. Commands->Send_Custom_Event( obj, gdi_minigunner_escort, 0, M01_GDI_BASE_POWS_OVER_JDG, 0 );
  11375. Commands->Send_Custom_Event( obj, gdi_minigunner_escort, 0, M01_WALKING_WAYPATH_05_JDG, 0 );
  11376. }
  11377. //GameObject * gdi_grenadier_escort = Commands->Find_Object ( 104686 );
  11378. //if (gdi_grenadier_escort != NULL)
  11379. //{
  11380. // Commands->Send_Custom_Event( obj, gdi_grenadier_escort, 0, M01_GDI_BASE_POWS_OVER_JDG, 0 );
  11381. //}
  11382. }
  11383. }
  11384. };
  11385. DECLARE_SCRIPT(M01_GDIBase_FirstChinookFlamethrowerGuy_JDG, "")
  11386. {
  11387. void Created( GameObject * obj )
  11388. {
  11389. GameObject * gdiGuy01 = Commands->Find_Object ( 104685 );
  11390. GameObject * gdiGuy02 = Commands->Find_Object ( 104686 );
  11391. if (gdiGuy01 != NULL)
  11392. {
  11393. Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
  11394. }
  11395. if (gdiGuy02 != NULL)
  11396. {
  11397. Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
  11398. }
  11399. }
  11400. };
  11401. /*DECLARE_SCRIPT(M01_GDIBase_SecondChinookFlamethrowerGuy_JDG, "")
  11402. {
  11403. void Created( GameObject * obj )
  11404. {
  11405. GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11406. if (powController != NULL)
  11407. {
  11408. Commands->Send_Custom_Event( obj, powController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  11409. }
  11410. }
  11411. void Animation_Complete(GameObject * obj, const char *anim)
  11412. {
  11413. if (stricmp(anim, "S_A_Human.h_a_troopdrop") == 0)
  11414. {
  11415. Vector3 myHomeSpot (-22.604f, 25.125f, 1.605f);
  11416. ActionParamsStruct params;
  11417. params.Set_Basic(this, 60, M01_START_ATTACKING_03_JDG);
  11418. params.Set_Movement(myHomeSpot, RUN, 5);
  11419. Commands->Action_Attack (obj, params);
  11420. Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
  11421. }
  11422. }
  11423. void Killed( GameObject * obj, GameObject * killer )
  11424. {
  11425. GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11426. if (powController != NULL)
  11427. {
  11428. Commands->Send_Custom_Event( obj, powController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  11429. }
  11430. }
  11431. };
  11432. DECLARE_SCRIPT(M01_GDIBase_SecondChinookMinigunnerGuy_JDG, "")
  11433. {
  11434. void Created( GameObject * obj )
  11435. {
  11436. GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11437. if (powController != NULL)
  11438. {
  11439. Commands->Send_Custom_Event( obj, powController, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  11440. }
  11441. }
  11442. void Animation_Complete(GameObject * obj, const char *anim)
  11443. {
  11444. if (stricmp(anim, "S_A_Human.h_a_troopdrop") == 0)
  11445. {
  11446. Vector3 myHomeSpot (-16.144f, 19.274f, 2.312f);
  11447. ActionParamsStruct params;
  11448. params.Set_Basic(this, 60, M01_START_ATTACKING_03_JDG);
  11449. params.Set_Movement(myHomeSpot, RUN, 2);
  11450. Commands->Action_Attack (obj, params);
  11451. Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
  11452. }
  11453. }
  11454. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11455. {
  11456. ActionParamsStruct params;
  11457. if (type == 0)
  11458. {
  11459. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  11460. {
  11461. params.Set_Basic(this, 100, M01_START_ATTACKING_03_JDG);
  11462. params.Set_Movement(STAR, RUN, 5);
  11463. params.Set_Attack( STAR, 15, 1, true );
  11464. Commands->Action_Attack (obj, params);
  11465. }
  11466. }
  11467. }
  11468. void Killed( GameObject * obj, GameObject * killer )
  11469. {
  11470. GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  11471. if (powController != NULL)
  11472. {
  11473. Commands->Send_Custom_Event( obj, powController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  11474. }
  11475. }
  11476. };*/
  11477. DECLARE_SCRIPT(M01_TibCave_StartZone_JDG, "")//108922
  11478. {
  11479. void Entered( GameObject * obj, GameObject * enterer )
  11480. {
  11481. if (enterer == STAR)
  11482. {
  11483. GameObject * visceroid01 = Commands->Find_Object ( 106908 );
  11484. GameObject * visceroid02 = Commands->Find_Object ( 106909 );
  11485. GameObject * visceroid03 = Commands->Find_Object ( 106907 );
  11486. GameObject * visceroidNodGuy01 = Commands->Find_Object ( 106910 );
  11487. GameObject * visceroidNodGuy02 = Commands->Find_Object ( 106911 );
  11488. if (visceroid01 != NULL)
  11489. {
  11490. Commands->Send_Custom_Event ( obj, visceroid01, 0, M01_START_ACTING_JDG, 0 );
  11491. }
  11492. if (visceroid02 != NULL)
  11493. {
  11494. Commands->Send_Custom_Event ( obj, visceroid02, 0, M01_START_ACTING_JDG, 0 );
  11495. }
  11496. if (visceroid03 != NULL)
  11497. {
  11498. Commands->Send_Custom_Event ( obj, visceroid03, 0, M01_START_ACTING_JDG, 0 );
  11499. }
  11500. if (visceroidNodGuy01 != NULL)
  11501. {
  11502. Commands->Send_Custom_Event ( obj, visceroidNodGuy01, 0, M01_START_ACTING_JDG, 0 );
  11503. }
  11504. if (visceroidNodGuy02 != NULL)
  11505. {
  11506. Commands->Send_Custom_Event ( obj, visceroidNodGuy02, 0, M01_START_ACTING_JDG, 1 );
  11507. }
  11508. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  11509. }
  11510. }
  11511. };
  11512. DECLARE_SCRIPT(M01_Visceroid01_JDG, "")//106908
  11513. {
  11514. void Created( GameObject * obj )
  11515. {
  11516. Commands->Innate_Disable(obj);
  11517. }
  11518. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11519. {
  11520. if (type == 0)
  11521. {
  11522. if (param == M01_START_ACTING_JDG)
  11523. {
  11524. Commands->Innate_Enable(obj);
  11525. Vector3 myPosition = Commands->Get_Position ( obj );
  11526. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11527. GameObject * nodguy01 = Commands->Find_Object ( 106910 );
  11528. if (nodguy01 != NULL)
  11529. {
  11530. ActionParamsStruct params;
  11531. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  11532. params.Set_Attack( nodguy01, 10, 0, true );
  11533. params.AttackCheckBlocked = false;
  11534. Commands->Action_Attack ( obj, params );
  11535. }
  11536. }
  11537. }
  11538. }
  11539. };
  11540. DECLARE_SCRIPT(M01_Visceroid02_JDG, "")//106909
  11541. {
  11542. void Created( GameObject * obj )
  11543. {
  11544. Commands->Innate_Disable(obj);
  11545. }
  11546. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11547. {
  11548. if (type == 0)
  11549. {
  11550. if (param == M01_START_ACTING_JDG)
  11551. {
  11552. Commands->Innate_Enable(obj);
  11553. Vector3 myPosition = Commands->Get_Position ( obj );
  11554. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11555. GameObject * nodguy01 = Commands->Find_Object ( 106910 );
  11556. if (nodguy01 != NULL)
  11557. {
  11558. ActionParamsStruct params;
  11559. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  11560. params.Set_Attack( nodguy01, 10, 0, true );
  11561. params.AttackCheckBlocked = false;
  11562. Commands->Action_Attack ( obj, params );
  11563. }
  11564. }
  11565. }
  11566. }
  11567. };
  11568. DECLARE_SCRIPT(M01_Visceroid03_JDG, "")//106907
  11569. {
  11570. void Created( GameObject * obj )
  11571. {
  11572. Commands->Innate_Disable(obj);
  11573. }
  11574. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11575. {
  11576. if (type == 0)
  11577. {
  11578. if (param == M01_START_ACTING_JDG)
  11579. {
  11580. Commands->Innate_Enable(obj);
  11581. Vector3 myPosition = Commands->Get_Position ( obj );
  11582. //Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11583. ActionParamsStruct params;
  11584. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  11585. params.Set_Attack( STAR, 10, 0, true );
  11586. params.Set_Movement( STAR, RUN, 2 );
  11587. params.AttackCheckBlocked = false;
  11588. Commands->Action_Attack ( obj, params );
  11589. }
  11590. }
  11591. }
  11592. };
  11593. DECLARE_SCRIPT(M01_Visceroid_NodGuy01_JDG, "")//106910
  11594. {
  11595. void Created( GameObject * obj )
  11596. {
  11597. Commands->Innate_Disable(obj);
  11598. }
  11599. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11600. {
  11601. if (type == 0)
  11602. {
  11603. if (param == M01_START_ACTING_JDG)
  11604. {
  11605. Commands->Innate_Enable(obj);
  11606. Vector3 myPosition = Commands->Get_Position ( obj );
  11607. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11608. Commands->Create_Sound ( "MX1DSGN_DSGN0017I1DSGN_SND", myPosition, obj );
  11609. GameObject * visceroid01 = Commands->Find_Object ( 106908 );
  11610. if (visceroid01 != NULL)
  11611. {
  11612. ActionParamsStruct params;
  11613. params.Set_Basic( this, 90, M01_START_ACTING_JDG );
  11614. params.Set_Attack( visceroid01, 25, 0, true );
  11615. params.AttackCheckBlocked = false;
  11616. Commands->Action_Attack ( obj, params );
  11617. }
  11618. }
  11619. }
  11620. }
  11621. };
  11622. DECLARE_SCRIPT(M01_Visceroid_NodGuy02_JDG, "")//106911
  11623. {
  11624. void Created( GameObject * obj )
  11625. {
  11626. Commands->Innate_Disable(obj);
  11627. }
  11628. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11629. {
  11630. if (type == 0)
  11631. {
  11632. if (param == M01_START_ACTING_JDG)
  11633. {
  11634. Commands->Innate_Enable(obj);
  11635. Vector3 myPosition = Commands->Get_Position ( obj );
  11636. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11637. Commands->Create_Sound ( "MX1DSGN_DSGN0018I1DSGN_SND", myPosition, obj );
  11638. GameObject * visceroid01 = Commands->Find_Object ( 106908 );
  11639. if (visceroid01 != NULL)
  11640. {
  11641. ActionParamsStruct params;
  11642. params.Set_Basic( this, 90, M01_START_ACTING_JDG );
  11643. params.Set_Attack( visceroid01, 25, 0, true );
  11644. params.AttackCheckBlocked = false;
  11645. Commands->Action_Attack ( obj, params );
  11646. }
  11647. }
  11648. }
  11649. }
  11650. };
  11651. DECLARE_SCRIPT(M01_Tiberium_Cave_Spawn_Helicopter_Zone_JDG, "")//M01_TIB_TUNNEL_HELICOPTER_ZONE_JDG...this guys ID is 100955
  11652. {
  11653. void Entered( GameObject * obj, GameObject * enterer )
  11654. {
  11655. if (enterer == STAR )
  11656. {
  11657. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_TIB_CAVE_HELICOPTER_JDG, 0 );
  11658. int apacheConv = Commands->Create_Conversation( "M01_Announce_Apache_Conversation", 100, 1000, false);
  11659. Commands->Join_Conversation( NULL, apacheConv, false, false );
  11660. Commands->Join_Conversation( STAR, apacheConv, false, false );
  11661. Commands->Start_Conversation( apacheConv, apacheConv );
  11662. GameObject * tunnelGuy = Commands->Find_Object ( 103274 );
  11663. if (tunnelGuy != NULL)
  11664. {
  11665. Commands->Send_Custom_Event( obj, tunnelGuy, 0, M01_START_ACTING_JDG, 0 );
  11666. }
  11667. Commands->Destroy_Object ( obj );
  11668. }
  11669. }
  11670. };
  11671. DECLARE_SCRIPT(M01_TiberiumCave_UpThere_NodGuy_JDG, "")//103274
  11672. {
  11673. void Created( GameObject * obj )
  11674. {
  11675. Vector3 myPosition = Commands->Get_Position ( obj );
  11676. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  11677. }
  11678. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11679. {
  11680. if (type == 0)
  11681. {
  11682. if (param == M01_START_ACTING_JDG)
  11683. {
  11684. ActionParamsStruct params;
  11685. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  11686. params.Set_Attack( STAR, 0, 0, true );
  11687. Commands->Action_Attack (obj, params);
  11688. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 3 );
  11689. }
  11690. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  11691. {
  11692. Vector3 myPosition = Commands->Get_Position ( obj );
  11693. Commands->Create_Sound ( "MX1DSGN_DSGN0019I1DSGN_SND", myPosition, obj );
  11694. ActionParamsStruct params;
  11695. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  11696. params.Set_Attack( STAR, 50, 0, true );
  11697. Commands->Action_Attack (obj, params);
  11698. }
  11699. }
  11700. }
  11701. };
  11702. DECLARE_SCRIPT(M01_Detention_GuardTower_Enter_Zone_JDG, "")
  11703. {
  11704. void Entered( GameObject * obj, GameObject * enterer )
  11705. {
  11706. if (enterer == STAR)
  11707. {
  11708. GameObject * detentionCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
  11709. if (detentionCiv01 != NULL)
  11710. {
  11711. Commands->Send_Custom_Event( obj, detentionCiv01, 0, M01_START_ACTING_JDG, 0 );
  11712. }
  11713. GameObject * detentionCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
  11714. if (detentionCiv02 != NULL)
  11715. {
  11716. Commands->Send_Custom_Event( obj, detentionCiv02, 0, M01_START_ACTING_JDG, 0 );
  11717. }
  11718. GameObject * detentionCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
  11719. if (detentionCiv03 != NULL)
  11720. {
  11721. Commands->Send_Custom_Event( obj, detentionCiv03, 0, M01_START_ACTING_JDG, 0 );
  11722. }
  11723. GameObject * detentionGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
  11724. if (detentionGDI01 != NULL)
  11725. {
  11726. Commands->Send_Custom_Event( obj, detentionGDI01, 0, M01_START_ACTING_JDG, 0 );
  11727. }
  11728. GameObject * detentionGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
  11729. if (detentionGDI02 != NULL)
  11730. {
  11731. Commands->Send_Custom_Event( obj, detentionGDI02, 0, M01_START_ACTING_JDG, 0 );
  11732. }
  11733. GameObject * detentionGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
  11734. if (detentionGDI03 != NULL)
  11735. {
  11736. Commands->Send_Custom_Event( obj, detentionGDI03, 0, M01_START_ACTING_JDG, 0 );
  11737. }
  11738. }
  11739. }
  11740. void Exited( GameObject * obj, GameObject * exiter )
  11741. {
  11742. if (exiter == STAR)
  11743. {
  11744. GameObject * detentionCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
  11745. if (detentionCiv01 != NULL)
  11746. {
  11747. Commands->Send_Custom_Event( obj, detentionCiv01, 0, M01_GOTO_IDLE_JDG, 0 );
  11748. }
  11749. GameObject * detentionCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
  11750. if (detentionCiv02 != NULL)
  11751. {
  11752. Commands->Send_Custom_Event( obj, detentionCiv02, 0, M01_GOTO_IDLE_JDG, 0 );
  11753. }
  11754. GameObject * detentionCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
  11755. if (detentionCiv03 != NULL)
  11756. {
  11757. Commands->Send_Custom_Event( obj, detentionCiv03, 0, M01_GOTO_IDLE_JDG, 0 );
  11758. }
  11759. GameObject * detentionGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
  11760. if (detentionGDI01 != NULL)
  11761. {
  11762. Commands->Send_Custom_Event( obj, detentionGDI01, 0, M01_GOTO_IDLE_JDG, 0 );
  11763. }
  11764. GameObject * detentionGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
  11765. if (detentionGDI02 != NULL)
  11766. {
  11767. Commands->Send_Custom_Event( obj, detentionGDI02, 0, M01_GOTO_IDLE_JDG, 0 );
  11768. }
  11769. GameObject * detentionGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
  11770. if (detentionGDI03 != NULL)
  11771. {
  11772. Commands->Send_Custom_Event( obj, detentionGDI03, 0, M01_GOTO_IDLE_JDG, 0 );
  11773. }
  11774. }
  11775. }
  11776. };
  11777. DECLARE_SCRIPT(M01_PrisonPen_POW_JDG, "")
  11778. {
  11779. bool okayToReact;
  11780. bool heardHavocAlert;
  11781. bool gateIsDown;
  11782. bool sam_is_destroyed;
  11783. int pow_guy01_id;//101927
  11784. REGISTER_VARIABLES()
  11785. {
  11786. SAVE_VARIABLE(okayToReact, 1);
  11787. SAVE_VARIABLE(heardHavocAlert, 2);
  11788. SAVE_VARIABLE(gateIsDown, 3);
  11789. SAVE_VARIABLE(sam_is_destroyed, 4);
  11790. SAVE_VARIABLE(pow_guy01_id, 5);
  11791. }
  11792. void Created( GameObject * obj )
  11793. {
  11794. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
  11795. pow_guy01_id = 101927;
  11796. okayToReact = false;
  11797. heardHavocAlert = false;
  11798. gateIsDown = false;
  11799. sam_is_destroyed = false;
  11800. Commands->Set_Innate_Is_Stationary ( obj, true );
  11801. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
  11802. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  11803. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  11804. }
  11805. void Killed( GameObject * obj, GameObject * killer )
  11806. {
  11807. }
  11808. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  11809. {
  11810. ActionParamsStruct params;
  11811. switch (param)
  11812. {
  11813. case M01_START_ACTING_JDG:
  11814. {
  11815. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, true );
  11816. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, true );
  11817. okayToReact = true;
  11818. }
  11819. break;
  11820. case M01_GOTO_IDLE_JDG:
  11821. {
  11822. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  11823. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  11824. okayToReact = false;
  11825. }
  11826. break;
  11827. case M01_FACING_SPECIFIED_DIRECTION_01_JDG:
  11828. {
  11829. Commands->Innate_Disable(obj);
  11830. params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  11831. params.Set_Attack( STAR, 0, 0, true );
  11832. Commands->Action_Attack ( obj, params );
  11833. float delayTimer = Commands->Get_Random ( 0.25f, 2.5f );
  11834. Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, delayTimer );
  11835. }
  11836. break;
  11837. case M01_DOING_ANIMATION_01_JDG:
  11838. {
  11839. char *animationName = M01_Choose_Cheer_Animation ( );
  11840. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  11841. params.Set_Animation( animationName, false );
  11842. Commands->Action_Play_Animation ( obj, params );
  11843. }
  11844. break;
  11845. }
  11846. }
  11847. void Poked( GameObject * obj, GameObject * poker )
  11848. {
  11849. if (gateIsDown == true)
  11850. {
  11851. if (sam_is_destroyed == false)
  11852. {
  11853. int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Poke_Conversation01", 100, 1000, false);
  11854. Commands->Join_Conversation( obj, apacheConv, false, true, true );
  11855. Commands->Start_Conversation( apacheConv, apacheConv );
  11856. }
  11857. }
  11858. }
  11859. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  11860. {
  11861. ActionParamsStruct params;
  11862. if (action_id == M01_WALKING_WAYPATH_02_JDG)
  11863. {
  11864. GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );//
  11865. if (obj == gdipow01)
  11866. {
  11867. Commands->Set_Innate_Is_Stationary ( obj, true );
  11868. int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Hello_Conversation01", 100, 1000, false);
  11869. Commands->Join_Conversation( obj, apacheConv, false, true, true );
  11870. Commands->Start_Conversation( apacheConv, apacheConv );
  11871. }
  11872. }
  11873. else if (action_id == M01_DOING_ANIMATION_01_JDG)
  11874. {
  11875. GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );
  11876. if (obj == gdipow01)
  11877. {
  11878. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  11879. params.Set_Movement( Vector3 (-297.801f, 572.799f, 27.458f), RUN, 1);
  11880. Commands->Action_Goto ( obj, params );
  11881. }
  11882. }
  11883. else if (action_id == M01_WALKING_WAYPATH_03_JDG)
  11884. {
  11885. char *animationName = M01_Choose_Cheer_Animation ( );
  11886. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  11887. params.Set_Animation( animationName, false );
  11888. Commands->Action_Play_Animation ( obj, params );
  11889. }
  11890. else if (action_id == M01_WALKING_WAYPATH_04_JDG)
  11891. {
  11892. char *animationName = M01_Choose_Cheer_Animation ( );
  11893. params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
  11894. params.Set_Animation( animationName, false );
  11895. Commands->Action_Play_Animation ( obj, params );
  11896. GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );
  11897. if (obj == gdipow01)
  11898. {
  11899. int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Evac_Conversation01", 100, 1000, false);
  11900. Commands->Join_Conversation( obj, apacheConv, true, true, true );
  11901. Commands->Start_Conversation( apacheConv, apacheConv );
  11902. }
  11903. }
  11904. else if (action_id == M01_DOING_ANIMATION_03_JDG)
  11905. {
  11906. Commands->Set_Innate_Is_Stationary ( obj, true );
  11907. }
  11908. else if (action_id == M01_DOING_ANIMATION_04_JDG)
  11909. {
  11910. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
  11911. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  11912. params.Set_Movement( Vector3 (-328.136f, 548.518f, 30.044f), RUN, 3);
  11913. Commands->Action_Goto ( obj, params );
  11914. }
  11915. else if (action_id == M01_WALKING_WAYPATH_05_JDG)
  11916. {
  11917. Commands->Set_Innate_Is_Stationary ( obj, true );
  11918. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  11919. if (missionController != NULL)
  11920. {
  11921. Commands->Send_Custom_Event( obj, missionController, 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
  11922. }
  11923. }
  11924. }
  11925. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  11926. {
  11927. ActionParamsStruct params;
  11928. if (sound.Type == M01_DETENTION_GATE_IS_DOWN_JDG && gateIsDown == false)
  11929. {
  11930. gateIsDown = true;
  11931. Commands->Set_Innate_Is_Stationary ( obj, false );
  11932. Commands->Action_Reset ( obj, 100 );
  11933. GameObject * commCenterSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
  11934. if (commCenterSamSite != NULL)
  11935. {
  11936. Vector3 myGotoSpot;
  11937. int myIdNumber = Commands->Get_ID ( obj );
  11938. if (myIdNumber == M01_DETENTION_GDI_GUY_01_JDG)
  11939. {
  11940. myGotoSpot.Set (-312.413f, 577.030f, 27.567f);
  11941. }
  11942. else if (myIdNumber == M01_DETENTION_GDI_GUY_02_JDG)
  11943. {
  11944. myGotoSpot.Set (-311.138f, 578.398f, 27.687f);
  11945. }
  11946. else
  11947. {
  11948. myGotoSpot.Set (-309.667f, 576.016f, 27.753f);
  11949. }
  11950. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  11951. params.Set_Movement( myGotoSpot, RUN, 0.5f);
  11952. Commands->Action_Goto ( obj, params );
  11953. }
  11954. }
  11955. else if (sound.Type == M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG)
  11956. {
  11957. sam_is_destroyed = true;
  11958. Commands->Set_Innate_Is_Stationary ( obj, false );
  11959. Commands->Action_Reset ( obj, 100 );
  11960. Vector3 myGotoSpot;
  11961. int myIdNumber = Commands->Get_ID ( obj );
  11962. if (myIdNumber == M01_DETENTION_GDI_GUY_01_JDG)
  11963. {
  11964. myGotoSpot.Set (-312.413f, 577.030f, 27.567f);
  11965. }
  11966. else if (myIdNumber == M01_DETENTION_GDI_GUY_02_JDG)
  11967. {
  11968. myGotoSpot.Set (-311.138f, 578.398f, 27.687f);
  11969. }
  11970. else
  11971. {
  11972. myGotoSpot.Set (-309.667f, 576.016f, 27.753f);
  11973. }
  11974. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  11975. params.Set_Movement( myGotoSpot, RUN, 0.5f);
  11976. Commands->Action_Goto ( obj, params );
  11977. }
  11978. else if (sound.Creator == STAR && okayToReact == true && heardHavocAlert == false)
  11979. {
  11980. if (sound.Type == SOUND_TYPE_GUNSHOT)
  11981. {
  11982. heardHavocAlert = true;
  11983. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
  11984. }
  11985. else if (sound.Type == SOUND_TYPE_BULLET_HIT)
  11986. {
  11987. heardHavocAlert = true;
  11988. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
  11989. }
  11990. }
  11991. }
  11992. };
  11993. DECLARE_SCRIPT(M01_PrisonPen_Civilian_JDG, "")
  11994. {
  11995. Vector3 wanderSpot[10];
  11996. int gdi_pow_id;
  11997. int my_id;
  11998. int prisoner_2_id;
  11999. int prisoner_3_id;
  12000. int last;
  12001. float loiterTimeMin;
  12002. float loiterTimeMax;
  12003. bool okayToReact;
  12004. bool heardHavocAlert;
  12005. bool gateIsDown;
  12006. bool sam_is_destroyed;
  12007. REGISTER_VARIABLES()
  12008. {
  12009. SAVE_VARIABLE(gdi_pow_id, 1);
  12010. SAVE_VARIABLE(my_id, 2);
  12011. SAVE_VARIABLE(prisoner_2_id, 3);
  12012. SAVE_VARIABLE(prisoner_3_id, 4);
  12013. SAVE_VARIABLE(last, 5);
  12014. SAVE_VARIABLE(loiterTimeMin, 6);
  12015. SAVE_VARIABLE(loiterTimeMax, 7);
  12016. SAVE_VARIABLE(okayToReact, 8);
  12017. SAVE_VARIABLE(heardHavocAlert, 9);
  12018. SAVE_VARIABLE(gateIsDown, 10);
  12019. SAVE_VARIABLE(sam_is_destroyed, 11);
  12020. }
  12021. void Created( GameObject * obj )
  12022. {
  12023. okayToReact = false;
  12024. heardHavocAlert = false;
  12025. gateIsDown = false;
  12026. sam_is_destroyed = false;
  12027. Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
  12028. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  12029. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  12030. wanderSpot[0].Set (-313.881f, 589.854f, 27.457f);
  12031. wanderSpot[1].Set (-303.287f, 587.881f, 27.457f);
  12032. wanderSpot[2].Set (-296.290f, 595.483f, 27.458f);
  12033. wanderSpot[3].Set (-295.055f, 589.244f, 27.458f);
  12034. wanderSpot[4].Set (-309.122f, 578.526f, 27.741f);
  12035. wanderSpot[5].Set (-299.833f, 578.027f, 27.735f);
  12036. wanderSpot[6].Set (-297.657f, 571.844f, 27.458f);
  12037. wanderSpot[7].Set (-289.746f, 578.258f, 27.781f);
  12038. wanderSpot[8].Set (-280.325f, 579.701f, 27.458f);
  12039. wanderSpot[9].Set (-286.094f, 585.007f, 27.720f);
  12040. loiterTimeMin = 5;
  12041. loiterTimeMax = 30;
  12042. last = 20;
  12043. gdi_pow_id = 101927;
  12044. my_id = Commands->Get_ID ( obj );
  12045. if (my_id == 101929)
  12046. {
  12047. prisoner_2_id = 101930;
  12048. prisoner_3_id = 101931;
  12049. }
  12050. else if (my_id == 101930)
  12051. {
  12052. prisoner_2_id = 101929;
  12053. prisoner_3_id = 101931;
  12054. }
  12055. else if (my_id == 101931)
  12056. {
  12057. prisoner_2_id = 101929;
  12058. prisoner_3_id = 101930;
  12059. }
  12060. Commands->Start_Timer ( obj, this, 5, M01_PICK_A_NEW_LOCATION_JDG );
  12061. }
  12062. void Timer_Expired(GameObject * obj, int timer_id)
  12063. {
  12064. ActionParamsStruct params;
  12065. int random = int(Commands->Get_Random(0, 13-WWMATH_EPSILON));
  12066. while (random == last)
  12067. {
  12068. random = int(Commands->Get_Random(0, 13-WWMATH_EPSILON));
  12069. }
  12070. if (random <= 9)
  12071. {
  12072. Vector3 shinGotoSpot = wanderSpot[random];
  12073. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  12074. params.Set_Movement( shinGotoSpot, WALK, 1 );
  12075. Commands->Action_Goto( obj, params );
  12076. loiterTimeMin = 5;
  12077. loiterTimeMax = 30;
  12078. }
  12079. else if (random == 10 && Commands->Find_Object ( prisoner_2_id ))
  12080. {
  12081. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  12082. params.Set_Movement( Commands->Find_Object ( prisoner_2_id ), WALK, 2 );
  12083. Commands->Action_Goto( obj, params );
  12084. loiterTimeMin = 5;
  12085. loiterTimeMax = 30;
  12086. }
  12087. else if (random == 11 && Commands->Find_Object ( prisoner_3_id ))
  12088. {
  12089. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  12090. params.Set_Movement( Commands->Find_Object ( prisoner_3_id ), WALK, 2 );
  12091. Commands->Action_Goto( obj, params );
  12092. loiterTimeMin = 5;
  12093. loiterTimeMax = 30;
  12094. }
  12095. else
  12096. {
  12097. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  12098. params.Set_Movement( Commands->Find_Object ( gdi_pow_id ), WALK, 2 );
  12099. Commands->Action_Goto( obj, params );
  12100. loiterTimeMin = 1;
  12101. loiterTimeMax = 3;
  12102. }
  12103. last = random;
  12104. }
  12105. void Poked( GameObject * obj, GameObject * poker )
  12106. {
  12107. if (gateIsDown == true)
  12108. {
  12109. if (sam_is_destroyed == false)
  12110. {
  12111. GameObject * babushka = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
  12112. GameObject * pierre = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
  12113. GameObject * farmerJohn = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
  12114. if (obj == babushka)
  12115. {
  12116. int apacheConv = Commands->Create_Conversation( "M01_Detention_Babushka_Poke_Conversation01", 100, 1000, false);
  12117. Commands->Join_Conversation( obj, apacheConv, false, true, true );
  12118. Commands->Start_Conversation( apacheConv, apacheConv );
  12119. }
  12120. else if (obj == pierre)
  12121. {
  12122. int apacheConv = Commands->Create_Conversation( "M01_Detention_Pierre_Poke_Conversation01", 100, 1000, false);
  12123. Commands->Join_Conversation( obj, apacheConv, false, true, true );
  12124. Commands->Start_Conversation( apacheConv, apacheConv );
  12125. }
  12126. else if (obj == farmerJohn)
  12127. {
  12128. int apacheConv = Commands->Create_Conversation( "M01_Detention_FarmerJohn_Poke_Conversation01", 100, 1000, false);
  12129. Commands->Join_Conversation( obj, apacheConv, false, true, true );
  12130. Commands->Start_Conversation( apacheConv, apacheConv );
  12131. }
  12132. }
  12133. }
  12134. }
  12135. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12136. {
  12137. ActionParamsStruct params;
  12138. switch (param)
  12139. {
  12140. case M01_START_ACTING_JDG:
  12141. {
  12142. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, true );
  12143. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, true );
  12144. okayToReact = true;
  12145. }
  12146. break;
  12147. case M01_GOTO_IDLE_JDG:
  12148. {
  12149. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  12150. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  12151. okayToReact = false;
  12152. }
  12153. break;
  12154. case M01_FACING_SPECIFIED_DIRECTION_01_JDG:
  12155. {
  12156. Commands->Innate_Disable(obj);
  12157. params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  12158. params.Set_Attack( STAR, 0, 0, true );
  12159. Commands->Action_Attack ( obj, params );
  12160. float delayTimer = Commands->Get_Random ( 1.25f, 3.5f );
  12161. Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, delayTimer );
  12162. }
  12163. break;
  12164. case M01_DOING_ANIMATION_01_JDG:
  12165. {
  12166. char *animationName = M01_Choose_Cheer_Animation ( );
  12167. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  12168. params.Set_Animation( animationName, false );
  12169. Commands->Action_Play_Animation ( obj, params );
  12170. }
  12171. break;
  12172. }
  12173. }
  12174. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  12175. {
  12176. ActionParamsStruct params;
  12177. if (sound.Type == M01_DETENTION_GATE_IS_DOWN_JDG && gateIsDown == false)
  12178. {
  12179. gateIsDown = true;
  12180. Commands->Action_Reset ( obj, 100 );
  12181. GameObject * commCenterSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
  12182. if (commCenterSamSite != NULL)
  12183. {
  12184. Vector3 myGotoSpot;
  12185. int myIdNumber = Commands->Get_ID ( obj );
  12186. if (myIdNumber == M01_DETENTION_CIVILIAN_01_JDG)//babushka
  12187. {
  12188. myGotoSpot.Set (-303.867f, 579.217f, 27.604f);
  12189. }
  12190. else if (myIdNumber == M01_DETENTION_CIVILIAN_02_JDG)//pierre
  12191. {
  12192. myGotoSpot.Set (-304.901f, 575.936f, 27.724f);
  12193. }
  12194. else//farmer john
  12195. {
  12196. myGotoSpot.Set (-304.887f, 582.889f, 27.457f);
  12197. }
  12198. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  12199. params.Set_Movement( myGotoSpot, RUN, 0.5f);
  12200. Commands->Action_Goto ( obj, params );
  12201. }
  12202. }
  12203. else if (sound.Type == M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG )
  12204. {
  12205. sam_is_destroyed = true;
  12206. Commands->Set_Innate_Is_Stationary ( obj, false );
  12207. Commands->Action_Reset ( obj, 100 );
  12208. Vector3 myGotoSpot;
  12209. int myIdNumber = Commands->Get_ID ( obj );
  12210. if (myIdNumber == M01_DETENTION_CIVILIAN_01_JDG)//babushka
  12211. {
  12212. myGotoSpot.Set (-303.867f, 579.217f, 27.604f);
  12213. }
  12214. else if (myIdNumber == M01_DETENTION_CIVILIAN_02_JDG)//pierre
  12215. {
  12216. myGotoSpot.Set (-304.901f, 575.936f, 27.724f);
  12217. }
  12218. else//farmer john
  12219. {
  12220. myGotoSpot.Set (-304.887f, 582.889f, 27.457f);
  12221. }
  12222. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  12223. params.Set_Movement( myGotoSpot, RUN, 0.5f);
  12224. Commands->Action_Goto ( obj, params );
  12225. }
  12226. else if (sound.Creator == STAR && okayToReact == true && heardHavocAlert == false)
  12227. {
  12228. if (sound.Type == SOUND_TYPE_GUNSHOT)
  12229. {
  12230. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
  12231. heardHavocAlert = true;
  12232. }
  12233. else if (sound.Type == SOUND_TYPE_BULLET_HIT)
  12234. {
  12235. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
  12236. heardHavocAlert = true;
  12237. }
  12238. }
  12239. }
  12240. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  12241. {
  12242. ActionParamsStruct params;
  12243. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  12244. {
  12245. float delayTimer = Commands->Get_Random ( loiterTimeMin, loiterTimeMax );
  12246. Commands->Start_Timer(obj, this, delayTimer, 0);
  12247. }
  12248. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  12249. {
  12250. char *animationName = M01_Choose_Cheer_Animation ( );
  12251. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  12252. params.Set_Animation( animationName, false );
  12253. Commands->Action_Play_Animation ( obj, params );
  12254. }
  12255. else if (action_id == M01_WALKING_WAYPATH_03_JDG)//civ is running to gate
  12256. {
  12257. char *animationName = M01_Choose_Cheer_Animation ( );
  12258. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  12259. params.Set_Animation( animationName, false );
  12260. Commands->Action_Play_Animation ( obj, params );
  12261. }
  12262. else if (action_id == M01_DOING_ANIMATION_03_JDG)
  12263. {
  12264. Commands->Set_Innate_Is_Stationary ( obj, true );
  12265. }
  12266. else if (action_id == M01_WALKING_WAYPATH_04_JDG)
  12267. {
  12268. char *animationName = M01_Choose_Cheer_Animation ( );
  12269. params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
  12270. params.Set_Animation( animationName, false );
  12271. Commands->Action_Play_Animation ( obj, params );//M01_Detention_Babushka_Evac_Conversation01
  12272. GameObject * babushka = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
  12273. if (obj == babushka)
  12274. {
  12275. int apacheConv = Commands->Create_Conversation( "M01_Detention_Babushka_Evac_Conversation01", 100, 1000, false);
  12276. Commands->Join_Conversation( obj, apacheConv, true, true, true );
  12277. Commands->Join_Conversation( STAR, apacheConv, false, false, false );
  12278. Commands->Start_Conversation( apacheConv, apacheConv );
  12279. }
  12280. }
  12281. else if (action_id == M01_DOING_ANIMATION_04_JDG)
  12282. {
  12283. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
  12284. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  12285. params.Set_Movement( Vector3 (-328.136f, 548.518f, 30.044f), RUN, 3);
  12286. Commands->Action_Goto ( obj, params );
  12287. }
  12288. else if (action_id == M01_WALKING_WAYPATH_05_JDG)
  12289. {
  12290. Commands->Set_Innate_Is_Stationary ( obj, true );
  12291. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  12292. if (missionController != NULL)
  12293. {
  12294. Commands->Send_Custom_Event( obj, missionController, 0, M01_DO_END_MISSION_CHECK_JDG, 0 );
  12295. }
  12296. }
  12297. }
  12298. };
  12299. DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_Trigger_Zone_JDG, "")//M01_BARNAREA_NOD_COMMANDER_JDG
  12300. {
  12301. void Entered( GameObject * obj, GameObject * enterer )
  12302. {
  12303. if (enterer == STAR )
  12304. {
  12305. GameObject * firstFieldCommander = Commands->Find_Object (M01_BARNAREA_NOD_COMMANDER_JDG);
  12306. if (firstFieldCommander != NULL)
  12307. {
  12308. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ), 0, M01_START_ACTING_JDG, 0 );
  12309. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG, 5 );
  12310. }
  12311. GameObject * zone01 = Commands->Find_Object (102361);
  12312. GameObject * zone02 = Commands->Find_Object (103343);
  12313. if (zone01 != NULL)
  12314. {
  12315. Commands->Destroy_Object ( zone01 );//one time zone
  12316. }
  12317. if (zone02 != NULL)
  12318. {
  12319. Commands->Destroy_Object ( zone02 );//one time zone
  12320. }
  12321. }
  12322. }
  12323. };
  12324. DECLARE_SCRIPT(M01_GDI_GuardTower_NOD_Commander_JDG, "")//M01_BARNAREA_NOD_COMMANDER_JDG
  12325. {
  12326. int guardTowerIntro;
  12327. bool deadYet;
  12328. bool introConvPlaying;
  12329. bool firstTimeDamaged;
  12330. bool playerSeen;
  12331. REGISTER_VARIABLES()
  12332. {
  12333. SAVE_VARIABLE(guardTowerIntro, 1);
  12334. SAVE_VARIABLE(deadYet, 2);
  12335. SAVE_VARIABLE(introConvPlaying, 3);
  12336. SAVE_VARIABLE(firstTimeDamaged, 4);
  12337. SAVE_VARIABLE(playerSeen, 5);
  12338. }
  12339. void Created( GameObject * obj )
  12340. {
  12341. introConvPlaying = false;
  12342. firstTimeDamaged = true;
  12343. playerSeen = false;
  12344. deadYet = false;
  12345. Commands->Set_Innate_Is_Stationary ( obj, true );
  12346. }
  12347. void Damaged( GameObject * obj, GameObject * damager, float amount )
  12348. {
  12349. if (obj)
  12350. {
  12351. if (damager == STAR && deadYet == false && firstTimeDamaged == true)
  12352. {
  12353. Vector3 myPosition = Commands->Get_Position ( obj );
  12354. Vector3 playerPosition = Commands->Get_Position ( STAR );
  12355. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  12356. if (playerDistance >= 15)
  12357. {
  12358. char *animationName = M01_Choose_Duck_Animation();
  12359. firstTimeDamaged = false;
  12360. ActionParamsStruct params;
  12361. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  12362. params.Set_Animation( animationName, false );
  12363. Commands->Action_Play_Animation ( obj, params );
  12364. }
  12365. }
  12366. }
  12367. }
  12368. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  12369. {
  12370. if (enemy == STAR)
  12371. {
  12372. playerSeen = true;
  12373. }
  12374. }
  12375. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  12376. {
  12377. if (sound.Creator == STAR)
  12378. {
  12379. if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
  12380. {
  12381. if (obj)
  12382. {
  12383. if (deadYet == false && playerSeen == false)
  12384. {
  12385. Vector3 myPosition = Commands->Get_Position ( obj );
  12386. Vector3 playerPosition = Commands->Get_Position ( STAR );
  12387. float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
  12388. if (playerDistance >= 15)
  12389. {
  12390. char *animationName = M01_Choose_Duck_Animation();
  12391. //firstTimeDamaged = false;
  12392. ActionParamsStruct params;
  12393. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  12394. params.Set_Animation( animationName, false );
  12395. Commands->Action_Play_Animation ( obj, params );
  12396. }
  12397. }
  12398. }
  12399. }
  12400. }
  12401. }
  12402. void Killed( GameObject * obj, GameObject * killer )
  12403. {
  12404. if (introConvPlaying == true)
  12405. {
  12406. Commands->Stop_Conversation( guardTowerIntro );
  12407. }
  12408. GameObject * zone01 = Commands->Find_Object (102361);
  12409. GameObject * zone02 = Commands->Find_Object (103343);
  12410. if (zone01 != NULL)
  12411. {
  12412. Commands->Destroy_Object ( zone01 );//one time zone
  12413. }
  12414. if (zone02 != NULL)
  12415. {
  12416. Commands->Destroy_Object ( zone02 );//one time zone
  12417. }
  12418. deadYet = true;
  12419. GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID );
  12420. if (artilleryController != NULL)
  12421. {
  12422. Commands->Send_Custom_Event( obj, artilleryController, 0, M01_GOTO_IDLE_JDG, 0 );
  12423. }
  12424. GameObject * objectiveController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  12425. if (objectiveController != NULL)
  12426. {
  12427. Commands->Send_Custom_Event( obj, objectiveController, 0, M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG, 5 );
  12428. }
  12429. if (STAR)
  12430. {
  12431. int guardTowerOutro = Commands->Create_Conversation( "M01_GuardTower_Outro_Conversation", 100, 1000, false);
  12432. Commands->Join_Conversation( NULL, guardTowerOutro, false, false );
  12433. //Commands->Join_Conversation( STAR, guardTowerOutro, false, false );
  12434. Commands->Start_Conversation( guardTowerOutro, guardTowerOutro );
  12435. }
  12436. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  12437. powerupSpawnLocation.Z += 0.75f;
  12438. char *powerups[2] =
  12439. {//this is a list of potential powerups to be dropped by sniper target guys
  12440. "POW_Health_100",
  12441. "POW_Armor_100",
  12442. };
  12443. int random = Commands->Get_Random_Int(0, 2);
  12444. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  12445. }
  12446. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  12447. {
  12448. ActionParamsStruct params;
  12449. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  12450. {
  12451. if (action_id == guardTowerIntro)
  12452. {
  12453. introConvPlaying = false;
  12454. }
  12455. }
  12456. }
  12457. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12458. {
  12459. if (type == 0)
  12460. {
  12461. switch (param)
  12462. {
  12463. case M01_START_ACTING_JDG: //here comes player start calling in reinforcements
  12464. {
  12465. GameObject * zone01 = Commands->Find_Object (102361);
  12466. GameObject * zone02 = Commands->Find_Object (103343);
  12467. if (sender == zone01)
  12468. {
  12469. Commands->Debug_Message ( "**********************Nod gdi tower commander has recieved command to start acting\n" );
  12470. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  12471. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 2 );
  12472. }
  12473. else if (sender == zone02)
  12474. {
  12475. Commands->Debug_Message ( "**********************Nod gdi tower commander has recieved command to start acting\n" );
  12476. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 20 );
  12477. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 20 );
  12478. }
  12479. if (STAR && deadYet == false)
  12480. {
  12481. introConvPlaying = true;
  12482. guardTowerIntro = Commands->Create_Conversation( "M01_GuardTower_Intro_Conversation", 95, 1000, true);
  12483. Commands->Join_Conversation( NULL, guardTowerIntro, false, false );
  12484. //Commands->Join_Conversation( STAR, guardTowerIntro, false, false );
  12485. Commands->Start_Conversation( guardTowerIntro, guardTowerIntro );
  12486. Commands->Monitor_Conversation( obj, guardTowerIntro );
  12487. }
  12488. }
  12489. break;
  12490. case M01_MODIFY_YOUR_ACTION_JDG://set timer--then call in next reinforcements
  12491. {
  12492. if (obj)
  12493. {
  12494. int currentDifficulty = Commands->Get_Difficulty_Level( );
  12495. int medium = 1;
  12496. int hard = 2;
  12497. float delayTimer;
  12498. if (currentDifficulty == hard)
  12499. {
  12500. delayTimer = 60;
  12501. }
  12502. else if (currentDifficulty == medium)
  12503. {
  12504. delayTimer = 90;
  12505. }
  12506. else
  12507. {
  12508. delayTimer = 120;
  12509. }
  12510. Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, delayTimer );
  12511. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  12512. }
  12513. }
  12514. break;
  12515. case M01_SEND_GUARD_TOWER_CHINOOK_JDG: //here comes player start calling in reinforcements
  12516. {
  12517. if (obj)
  12518. {
  12519. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, 0 );
  12520. }
  12521. }
  12522. break;
  12523. case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
  12524. {
  12525. if (obj && deadYet == false)
  12526. {
  12527. GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
  12528. if (nodCommanderDialogController != NULL)
  12529. {
  12530. Commands->Debug_Message ( "**********************Nod gdi tower commander is sending custom to dialog controller\n" );
  12531. Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  12532. }
  12533. float delayTimer = Commands->Get_Random ( 15, 30 );
  12534. Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
  12535. }
  12536. }
  12537. break;
  12538. }
  12539. }
  12540. }
  12541. };
  12542. DECLARE_SCRIPT(M01_Nod_Commander_Conversation_Controller_GDI, "")// 103398
  12543. {
  12544. bool first_call;
  12545. int initialCommanderConv;
  12546. REGISTER_VARIABLES()
  12547. {
  12548. SAVE_VARIABLE(first_call, 1);
  12549. SAVE_VARIABLE(initialCommanderConv, 2);
  12550. }
  12551. void Created( GameObject * obj )
  12552. {
  12553. first_call = true;
  12554. }
  12555. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12556. {
  12557. if (param == M01_MODIFY_YOUR_ACTION_JDG)//nod commander is calling in reinforcements
  12558. {
  12559. GameObject * guardTower01Commander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
  12560. if (sender == guardTower01Commander && first_call == true)
  12561. {
  12562. first_call = false;
  12563. initialCommanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv04", 100, 300, true);
  12564. Commands->Join_Conversation( sender, initialCommanderConv, false, false, false );
  12565. Commands->Start_Conversation( initialCommanderConv, initialCommanderConv );
  12566. Commands->Monitor_Conversation( obj, initialCommanderConv );
  12567. }
  12568. else
  12569. {
  12570. int random = Commands->Get_Random_Int(0, 5);
  12571. if (random == 0)
  12572. {
  12573. int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv01", 90, 200, true);
  12574. Commands->Join_Conversation( sender, commanderConv, false, false, false );
  12575. Commands->Start_Conversation( commanderConv, commanderConv );
  12576. }
  12577. else if (random == 1)
  12578. {
  12579. int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv02", 90, 200, true);
  12580. Commands->Join_Conversation( sender, commanderConv, false, false, false );
  12581. Commands->Start_Conversation( commanderConv, commanderConv );
  12582. }
  12583. else if (random == 2)
  12584. {
  12585. int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv03", 90, 200, true);
  12586. Commands->Join_Conversation( sender, commanderConv, false, false, false );
  12587. Commands->Start_Conversation( commanderConv, commanderConv );
  12588. }
  12589. else if (random == 3)
  12590. {
  12591. int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv04", 90, 200, true);
  12592. Commands->Join_Conversation( sender, commanderConv, false, false, false );
  12593. Commands->Start_Conversation( commanderConv, commanderConv );
  12594. }
  12595. else
  12596. {
  12597. int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv05", 90, 200, true);
  12598. Commands->Join_Conversation( sender, commanderConv, false, false, false );
  12599. Commands->Start_Conversation( commanderConv, commanderConv );
  12600. }
  12601. }
  12602. }
  12603. }
  12604. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  12605. {
  12606. if (action_id == initialCommanderConv)
  12607. {
  12608. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, 0 );
  12609. }
  12610. }
  12611. };
  12612. DECLARE_SCRIPT(M01_GDIBase_LightTank_PastTunnelZone_JDG, "")
  12613. {
  12614. void Entered( GameObject * obj, GameObject * enterer )
  12615. {
  12616. GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG );
  12617. if (enterer == lightTank)
  12618. {
  12619. Commands->Send_Custom_Event( obj, lightTank, 0, M01_GOTO_IDLE_JDG, 0 );
  12620. Commands->Destroy_Object ( obj );
  12621. }
  12622. }
  12623. };
  12624. DECLARE_SCRIPT(M01_KeyCard01_Script_JDG, "")
  12625. {
  12626. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12627. {
  12628. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  12629. {
  12630. int lockeKeycard = Commands->Create_Conversation( "M01_First_Keycard_Conversation", 100, 1000, true);
  12631. Commands->Join_Conversation( NULL, lockeKeycard, false, false );
  12632. Commands->Start_Conversation( lockeKeycard, lockeKeycard );
  12633. }
  12634. }
  12635. };
  12636. DECLARE_SCRIPT(M01_GDIBase_AI_ExitZone_JDG, "")
  12637. {
  12638. void Entered( GameObject * obj, GameObject * enterer )
  12639. {
  12640. GameObject * gdiFollower = Commands->Find_Object ( 104686 );
  12641. GameObject * gdiCommander = Commands->Find_Object ( 106050 );
  12642. GameObject * gdiLeader = Commands->Find_Object ( 104685 );
  12643. GameObject * pow01 = Commands->Find_Object ( 103327 );
  12644. GameObject * pow02 = Commands->Find_Object ( 103328 );
  12645. if (enterer == gdiFollower)
  12646. {
  12647. if (gdiFollower != NULL)
  12648. {
  12649. Commands->Send_Custom_Event( obj, gdiFollower, 0, M01_HOLD_YOUR_POSITION_JDG, 0 );
  12650. }
  12651. }
  12652. else if (enterer == gdiCommander)
  12653. {
  12654. if (gdiCommander != NULL)//
  12655. {
  12656. Commands->Send_Custom_Event( obj, gdiCommander, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  12657. //Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  12658. }
  12659. if (gdiFollower != NULL)
  12660. {
  12661. Commands->Send_Custom_Event( obj, gdiFollower, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  12662. }
  12663. if (gdiLeader != NULL)
  12664. {
  12665. Commands->Send_Custom_Event( obj, gdiLeader, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  12666. }
  12667. }
  12668. else if (enterer == pow01)
  12669. {
  12670. if (pow01 != NULL)
  12671. {
  12672. Commands->Send_Custom_Event( obj, pow01, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  12673. }
  12674. if (pow02 != NULL)
  12675. {
  12676. Commands->Send_Custom_Event( obj, pow02, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  12677. }
  12678. }
  12679. }
  12680. };
  12681. DECLARE_SCRIPT(M01_GDIBase_LightTank_JDG, "")//M01_TAILGUNAREA_NOD_LIGHTTANK_JDG 102435
  12682. {
  12683. void Killed( GameObject * obj, GameObject * killer )
  12684. {
  12685. int tankReward = Commands->Create_Conversation( "M01_TankReward_Conversation", 100, 1000, false);
  12686. Commands->Join_Conversation( NULL, tankReward, false, false );
  12687. //Commands->Join_Conversation( STAR, tankReward, false, false );
  12688. Commands->Start_Conversation( tankReward, tankReward );
  12689. Vector3 tankDeathSpot (4.2f, 279.8f, 3.2f);
  12690. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", tankDeathSpot);
  12691. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  12692. Vector3 myPosition = Commands->Get_Position ( obj );
  12693. myPosition.Z += 0.25f;
  12694. Commands->Create_Object ( "POW_Medal_Armor", myPosition );
  12695. }
  12696. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12697. {
  12698. ActionParamsStruct params;
  12699. switch (param)
  12700. {
  12701. case M01_START_ACTING_JDG:
  12702. {
  12703. if (STAR)
  12704. {
  12705. int currentDifficulty = Commands->Get_Difficulty_Level( );
  12706. int medium = 1;
  12707. int hard = 2;
  12708. float tankSpeed;
  12709. if (currentDifficulty == hard)
  12710. {
  12711. tankSpeed = 0.6f;
  12712. }
  12713. else if (currentDifficulty == medium)
  12714. {
  12715. tankSpeed = 0.4f;
  12716. }
  12717. else
  12718. {
  12719. tankSpeed = 0.2f;
  12720. }
  12721. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  12722. params.Set_Movement( Vector3(0,0,0), tankSpeed, 2 );
  12723. params.WaypathID = 102233;
  12724. //params.WaypointStartID = 102235;
  12725. params.AttackCheckBlocked = false;
  12726. params.AttackActive = false;
  12727. Commands->Action_Attack( obj, params );
  12728. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 3 );
  12729. }
  12730. else
  12731. {
  12732. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 3 );
  12733. }
  12734. }
  12735. break;
  12736. case M01_MODIFY_YOUR_ACTION_03_JDG:
  12737. {
  12738. int currentDifficulty = Commands->Get_Difficulty_Level( );
  12739. int medium = 1;
  12740. int hard = 2;
  12741. float tankSpeed;
  12742. float tankRange;
  12743. float tankAccuracy;
  12744. if (currentDifficulty == hard)
  12745. {
  12746. tankSpeed = 0.5f;
  12747. tankRange = 100;
  12748. tankAccuracy = 0;
  12749. }
  12750. else if (currentDifficulty == medium)
  12751. {
  12752. tankSpeed = 0.3f;
  12753. tankRange = 75;
  12754. tankAccuracy = 1;
  12755. }
  12756. else
  12757. {
  12758. tankSpeed = 0.1f;
  12759. tankRange = 50;
  12760. tankAccuracy = 3;
  12761. }
  12762. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  12763. params.Set_Movement( Vector3(0,0,0), tankSpeed, 2 );
  12764. params.WaypathID = 102233;
  12765. //params.WaypointStartID = 102235;
  12766. params.Set_Attack( STAR, tankRange, tankAccuracy, true );
  12767. params.AttackActive = true;
  12768. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_02_JDG, params );
  12769. }
  12770. break;
  12771. }
  12772. }
  12773. };
  12774. DECLARE_SCRIPT(M01_GDIBase_BackPath_NodGuy_JDG, "")//103337
  12775. {
  12776. void Created( GameObject * obj )
  12777. {
  12778. Commands->Set_Innate_Is_Stationary ( obj, true );
  12779. }
  12780. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12781. {
  12782. if (type == 0)
  12783. {
  12784. if (param == M01_START_ACTING_JDG)
  12785. {
  12786. Commands->Set_Innate_Is_Stationary ( obj, false );
  12787. ActionParamsStruct params;
  12788. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  12789. params.Set_Movement(Vector3 (57.651f, 54.752f, -0.449f), RUN, 1);
  12790. Commands->Action_Goto(obj, params);
  12791. }
  12792. }
  12793. }
  12794. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  12795. {
  12796. ActionParamsStruct params;
  12797. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  12798. {
  12799. Commands->Set_Innate_Is_Stationary ( obj, true );
  12800. params.Set_Basic( this, 100, 20 );
  12801. params.Set_Attack( STAR, 50, 3, true );
  12802. params.AttackCheckBlocked = true;
  12803. Commands->Action_Attack (obj, params);
  12804. }
  12805. }
  12806. };
  12807. DECLARE_SCRIPT(M01_Sinking_Gunboat_JDG, "")
  12808. {
  12809. void Created( GameObject * obj )
  12810. {
  12811. Commands->Set_Animation ( obj, "V_GDI_GBOAT.XG_GBOAT_SINK", false, NULL, 0, 60 );
  12812. }
  12813. void Animation_Complete(GameObject * obj, const char *anim)
  12814. {
  12815. if (stricmp(anim, "V_GDI_GBOAT.XG_GBOAT_SINK") == 0)
  12816. {
  12817. Commands->Destroy_Object ( obj );
  12818. }
  12819. }
  12820. };
  12821. DECLARE_SCRIPT(M01_PlayerEntering_BarnArea_Zone_JDG, "")
  12822. {
  12823. void Entered( GameObject * obj, GameObject * enterer )
  12824. {
  12825. if (enterer == STAR)
  12826. {
  12827. GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
  12828. if (gunboatController != NULL)
  12829. {
  12830. Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_START_ACTING_JDG, 0 );
  12831. }
  12832. GameObject *hovercraftController = Commands->Find_Object ( 121630 );
  12833. if (hovercraftController != NULL)
  12834. {
  12835. Commands->Send_Custom_Event ( obj, hovercraftController, 0, M01_START_ACTING_JDG, 10 );
  12836. }
  12837. }
  12838. }
  12839. };
  12840. DECLARE_SCRIPT(M01_PlayerLeaving_BarnArea_Zone_JDG, "")
  12841. {
  12842. void Entered( GameObject * obj, GameObject * enterer )
  12843. {
  12844. if (enterer == STAR)
  12845. {
  12846. GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
  12847. if (gunboatController != NULL)
  12848. {
  12849. Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_GOTO_IDLE_JDG, 0 );
  12850. }
  12851. }
  12852. }
  12853. };
  12854. DECLARE_SCRIPT(M01_Barn_EntryZone_JDG, "")//113734
  12855. {
  12856. void Entered( GameObject * obj, GameObject * enterer )
  12857. {
  12858. if (enterer == STAR)//
  12859. {
  12860. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  12861. if (missionController != NULL)
  12862. {
  12863. Commands->Send_Custom_Event ( obj, missionController, 0, M01_END_BARN_OBJECTIVE_JDG, 0 );
  12864. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  12865. }
  12866. }
  12867. }
  12868. };
  12869. DECLARE_SCRIPT(M01_GDI_BaseCommander_Backside_EntryZone_JDG, "")//113733
  12870. {
  12871. bool entered;
  12872. REGISTER_VARIABLES()
  12873. {
  12874. SAVE_VARIABLE(entered, 1);
  12875. }
  12876. void Created( GameObject * obj )
  12877. {
  12878. entered = false;
  12879. }
  12880. void Entered( GameObject * obj, GameObject * enterer )
  12881. {
  12882. if (enterer == STAR && entered == false)
  12883. {
  12884. entered = true;
  12885. GameObject * gdiBaseLeaderGuy = Commands->Find_Object ( 104685 );//
  12886. if (gdiBaseLeaderGuy != NULL)
  12887. {
  12888. Commands->Send_Custom_Event ( obj, gdiBaseLeaderGuy, 0, M01_MODIFY_YOUR_ACTION_10_JDG, 0 );
  12889. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  12890. }
  12891. }
  12892. }
  12893. };
  12894. DECLARE_SCRIPT(M01_Obelisk_UpdateDisc_JDG, "")
  12895. {
  12896. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  12897. {
  12898. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  12899. {
  12900. Commands->Reveal_Encyclopedia_Building ( 12 );
  12901. Commands->Set_HUD_Help_Text ( IDS_M00EVAG_DSGN0104I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  12902. }
  12903. }
  12904. };
  12905. DECLARE_SCRIPT(M01_BarnArea_EvacMonitor_JDG, "")//M01_BARNAREA_EVAC_MONITOR_JDG
  12906. {
  12907. int unitsEvacuated;
  12908. int evac_helicopter_id;
  12909. int evac_waypath_id;
  12910. int evac_rope_id;
  12911. bool transportCalled;
  12912. int barnAirdrop_conv;
  12913. bool failed;
  12914. REGISTER_VARIABLES()
  12915. {
  12916. SAVE_VARIABLE(unitsEvacuated, 1);
  12917. SAVE_VARIABLE(evac_helicopter_id, 2);
  12918. SAVE_VARIABLE(evac_waypath_id, 3);
  12919. SAVE_VARIABLE(evac_rope_id, 4);
  12920. SAVE_VARIABLE(transportCalled, 5);
  12921. SAVE_VARIABLE(barnAirdrop_conv, 6);
  12922. SAVE_VARIABLE(failed, 7);
  12923. }
  12924. void Created( GameObject * obj )
  12925. {
  12926. unitsEvacuated = 0;
  12927. transportCalled = false;
  12928. failed = false;
  12929. }
  12930. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  12931. {
  12932. ActionParamsStruct params;
  12933. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  12934. {
  12935. if (action_id == barnAirdrop_conv)
  12936. {
  12937. int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
  12938. Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
  12939. //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
  12940. Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
  12941. }
  12942. }
  12943. }
  12944. void Custom( GameObject * obj, int type, int param, GameObject * sender ) //
  12945. {
  12946. if (param == M01_CIVILIAN_KILLED_JDG)//
  12947. {
  12948. GameObject * civ01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
  12949. GameObject * civ02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
  12950. GameObject * civ03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
  12951. if (sender == civ01)
  12952. {
  12953. failed = true;
  12954. }
  12955. else if (sender == civ02)
  12956. {
  12957. failed = true;
  12958. }
  12959. else if (sender == civ03)
  12960. {
  12961. failed = true;
  12962. }
  12963. }
  12964. else if (param == M01_GOING_TO_EVAC_SPOT_JDG)
  12965. {
  12966. unitsEvacuated++;
  12967. if (unitsEvacuated == 3 && failed == false)
  12968. {
  12969. barnAirdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
  12970. Commands->Join_Conversation( NULL, barnAirdrop_conv, false, false );
  12971. Commands->Start_Conversation( barnAirdrop_conv, barnAirdrop_conv );
  12972. Commands->Monitor_Conversation( obj, barnAirdrop_conv );
  12973. Vector3 airDropSpot (-0.923f, 143.580f, 0.647f);
  12974. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
  12975. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
  12976. }
  12977. }
  12978. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
  12979. {
  12980. evac_helicopter_id = Commands->Get_ID ( sender );
  12981. Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
  12982. }
  12983. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
  12984. {
  12985. evac_waypath_id = Commands->Get_ID ( sender );
  12986. Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
  12987. }
  12988. else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
  12989. {
  12990. evac_rope_id = Commands->Get_ID ( sender );
  12991. Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
  12992. }
  12993. else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
  12994. {
  12995. Vector3 evacPosition = Commands->Get_Position ( obj );
  12996. GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
  12997. Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
  12998. Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
  12999. Commands->Innate_Disable(sender);
  13000. Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
  13001. if(troopbone)
  13002. {
  13003. Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
  13004. }
  13005. else
  13006. {
  13007. Commands->Debug_Message("troopbone not created yet");
  13008. }
  13009. Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
  13010. }
  13011. else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//a gdi guy is waiting for evac--call in a helicopter
  13012. {
  13013. if (transportCalled == false)
  13014. {
  13015. transportCalled = true;
  13016. Vector3 evacPosition = Commands->Get_Position ( obj );
  13017. GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  13018. Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_BarnArea_EvacAnim.txt");
  13019. }
  13020. }
  13021. else if (param == M01_EVERYONES_ON_BOARD_JDG)//chinook is ready to go--give clearance
  13022. {
  13023. Commands->Debug_Message ( "*******************************all barn civs on board--custom received by controller\n" );
  13024. GameObject *evacWaypath = Commands->Find_Object ( evac_waypath_id );
  13025. if (evacWaypath != NULL)
  13026. {
  13027. Commands->Send_Custom_Event( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13028. }
  13029. GameObject *evacChopper = Commands->Find_Object ( evac_helicopter_id );
  13030. if (evacChopper != NULL)
  13031. {
  13032. Commands->Send_Custom_Event( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13033. }
  13034. GameObject *evacRope = Commands->Find_Object ( evac_rope_id );
  13035. if (evacChopper != NULL)
  13036. {
  13037. Commands->Send_Custom_Event( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13038. }
  13039. if (failed == true)
  13040. {
  13041. int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
  13042. Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
  13043. //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
  13044. Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
  13045. }
  13046. }
  13047. }
  13048. };
  13049. DECLARE_SCRIPT(M01_HON_RedKey_Zone_JDG, "")
  13050. {
  13051. void Entered( GameObject * obj, GameObject * enterer )
  13052. {
  13053. if (enterer == STAR)
  13054. {
  13055. bool playerHasRedKey = Commands->Has_Key( STAR, 3 );
  13056. if (playerHasRedKey == false)
  13057. {
  13058. Vector3 keyCardLocation (-168.195f, 527.489f, -31.130f);
  13059. Commands->Create_Object ( "Level_03_Keycard", keyCardLocation );
  13060. Commands->Destroy_Object ( obj );
  13061. }
  13062. }
  13063. }
  13064. };
  13065. DECLARE_SCRIPT(M01_Comm_Center_Pen_Gate, "")
  13066. {
  13067. bool samDead;
  13068. REGISTER_VARIABLES()
  13069. {
  13070. SAVE_VARIABLE(samDead, 1);
  13071. }
  13072. void Created( GameObject * obj )
  13073. {
  13074. samDead = false;
  13075. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  13076. }
  13077. void Poked( GameObject * obj, GameObject * poker ) //
  13078. {
  13079. if (poker == STAR && samDead == true)
  13080. {
  13081. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_HAS_POKED_PEN_GATE_JDG, 0 );
  13082. }
  13083. }
  13084. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  13085. {
  13086. if (type == 0)
  13087. {
  13088. if (param == M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG)
  13089. {
  13090. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
  13091. }
  13092. else if (param == M01_START_ACTING_JDG)
  13093. {
  13094. samDead = true;
  13095. }
  13096. }
  13097. }
  13098. };
  13099. DECLARE_SCRIPT(M01_CommCenter_SAMSite_Script, "")
  13100. {
  13101. void Damaged( GameObject * obj, GameObject * damager, float amount )
  13102. {
  13103. if (damager == (STAR))
  13104. {
  13105. if (obj)
  13106. {
  13107. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  13108. }
  13109. }
  13110. }
  13111. void Killed( GameObject * obj, GameObject * killer )
  13112. {
  13113. Commands->Send_Custom_Event( obj, Commands->Find_Object (M01_MISSION_CONTROLLER_JDG), 0, M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG, 0 );
  13114. GameObject * detentionGate = Commands->Find_Object ( 101117 );
  13115. if (detentionGate != NULL)
  13116. {
  13117. Commands->Send_Custom_Event( obj, detentionGate, 0, M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG, 0 );
  13118. }
  13119. }
  13120. };
  13121. DECLARE_SCRIPT(M01_Commander_Shack_Zone_JDG, "")//115985
  13122. {
  13123. bool commanderAlive;
  13124. bool playerinZone;
  13125. bool commandClearance;
  13126. bool convStarted;
  13127. REGISTER_VARIABLES()
  13128. {
  13129. SAVE_VARIABLE(commanderAlive, 1);
  13130. SAVE_VARIABLE(playerinZone, 2);
  13131. SAVE_VARIABLE(commandClearance, 3);
  13132. SAVE_VARIABLE(convStarted, 4);
  13133. }
  13134. void Created( GameObject * obj )
  13135. {
  13136. commanderAlive = true;
  13137. playerinZone = false;
  13138. commandClearance = false;
  13139. convStarted = false;
  13140. }
  13141. void Entered( GameObject * obj, GameObject * enterer )
  13142. {
  13143. if (enterer == STAR)
  13144. {
  13145. playerinZone = true;
  13146. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13147. GameObject * convController = Commands->Find_Object ( 125857 );
  13148. if (convController != NULL)
  13149. {
  13150. Commands->Send_Custom_Event( obj, convController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13151. }
  13152. }
  13153. }
  13154. void Exited( GameObject * obj, GameObject * exiter )
  13155. {
  13156. if (exiter == STAR)
  13157. {
  13158. playerinZone = false;
  13159. }
  13160. }
  13161. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  13162. {
  13163. if (type == 0)
  13164. {
  13165. if (param == M01_START_ACTING_JDG)
  13166. {
  13167. commandClearance = true;
  13168. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  13169. }
  13170. else if (param == M01_IVE_BEEN_KILLED_JDG)
  13171. {
  13172. commanderAlive = false;
  13173. }
  13174. else if (param == M01_MODIFY_YOUR_ACTION_JDG && convStarted == false)
  13175. {
  13176. if (playerinZone == true && commanderAlive == true && commandClearance == true)//M01_MODIFY_YOUR_ACTION_JDG
  13177. {
  13178. GameObject * gdiCommander = Commands->Find_Object ( 106050);
  13179. if (gdiCommander != NULL)
  13180. {
  13181. convStarted = true;
  13182. Commands->Send_Custom_Event( obj, gdiCommander, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  13183. }
  13184. }
  13185. else
  13186. {
  13187. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0.25f );
  13188. }
  13189. }
  13190. }
  13191. }
  13192. };
  13193. DECLARE_SCRIPT(M01_TurretBeach_Engineer_JDG, "")//this guys ID is M01_TURRETBEACH_ENGINEER_ID 101654
  13194. {
  13195. bool working_here_boss;
  13196. bool first_time;
  13197. float last_health;
  13198. bool killedYet;
  13199. bool turret01_dead;
  13200. bool turret02_dead;
  13201. REGISTER_VARIABLES()
  13202. {
  13203. SAVE_VARIABLE(working_here_boss, 1);
  13204. SAVE_VARIABLE(first_time, 2);
  13205. SAVE_VARIABLE(killedYet, 3);
  13206. SAVE_VARIABLE(turret01_dead, 4);
  13207. SAVE_VARIABLE(turret02_dead, 5);
  13208. }
  13209. void Created( GameObject * obj )
  13210. {
  13211. turret01_dead = false;
  13212. turret02_dead = false;
  13213. killedYet = false;
  13214. working_here_boss = false;
  13215. first_time = true;
  13216. Commands->Innate_Disable(obj);
  13217. last_health = Commands->Get_Max_Health ( obj );
  13218. }
  13219. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  13220. {
  13221. if (enemy == STAR && working_here_boss == false)
  13222. {
  13223. if (obj)
  13224. {
  13225. Commands->Action_Reset ( obj, 100 );
  13226. Commands->Innate_Enable(obj);
  13227. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  13228. }
  13229. }
  13230. }
  13231. void Damaged( GameObject * obj, GameObject * damager, float amount )
  13232. {
  13233. int damager_id = Commands->Get_ID ( damager );
  13234. if (damager_id != NULL)
  13235. {
  13236. Commands->Debug_Message ( "***************************engineers damager is ID %d\n", damager_id );
  13237. }
  13238. else
  13239. {
  13240. Commands->Debug_Message ( "***************************engineers damager is NULL\n" );
  13241. }
  13242. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  13243. if (damager == gunboat)
  13244. {
  13245. Commands->Set_Health ( obj, last_health );
  13246. }
  13247. else if (damager == STAR)
  13248. {
  13249. if (obj)
  13250. {
  13251. last_health = Commands->Get_Health ( obj );
  13252. if (first_time == true)
  13253. {
  13254. working_here_boss = false;
  13255. Commands->Action_Reset ( obj, 100 );
  13256. Commands->Innate_Enable(obj);
  13257. ActionParamsStruct params;
  13258. params.Set_Basic(this, 100, M01_DOING_ANIMATION_03_JDG);
  13259. params.Set_Animation( "H_A_862A", false );
  13260. Commands->Action_Play_Animation ( obj, params );
  13261. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  13262. first_time = false;
  13263. }
  13264. else
  13265. {
  13266. working_here_boss = false;
  13267. Commands->Action_Reset ( obj, 100 );
  13268. Commands->Innate_Enable(obj);
  13269. Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
  13270. }
  13271. }
  13272. }
  13273. }
  13274. void Killed( GameObject * obj, GameObject * killer )
  13275. {
  13276. killedYet = true;
  13277. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG, 5 );
  13278. }
  13279. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  13280. {
  13281. ActionParamsStruct params;
  13282. if (param == M01_START_ACTING_JDG)
  13283. {
  13284. Commands->Debug_Message ( "***************************original engineer custom received--start acting\n" );
  13285. Commands->Enable_Hibernation( obj, false );
  13286. }
  13287. else if (param == M01_GOTO_IDLE_JDG)
  13288. {
  13289. Commands->Debug_Message ( "***************************original engineer custom received--STOP acting\n" );
  13290. Commands->Enable_Hibernation( obj, true );
  13291. }
  13292. else if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
  13293. {
  13294. if (working_here_boss == false)
  13295. {
  13296. Commands->Debug_Message ( "***************************engineers has received custom to go heal turret\n" );
  13297. Commands->Innate_Disable(obj);
  13298. Commands->Action_Reset ( obj, 100 );
  13299. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13300. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13301. float turret01_health = 0;
  13302. float turret02_health = 0;
  13303. if (turret01 != NULL)
  13304. {
  13305. turret01_health = Commands->Get_Health ( turret01 );
  13306. }
  13307. if (turret02 != NULL)
  13308. {
  13309. turret02_health = Commands->Get_Health ( turret02 );
  13310. }
  13311. if ((turret02_health > turret01_health) && (turret01_health > 0))
  13312. {
  13313. if (turret01 != NULL && turret01_dead == false)
  13314. {
  13315. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  13316. params.Set_Movement( Vector3 (-86.5f, 95.5f, 2.3f), 1.0f, 0.5f, false );
  13317. params.MovePathfind = false;
  13318. Commands->Action_Goto ( obj, params );
  13319. working_here_boss = true;
  13320. }
  13321. }
  13322. else if ((turret01_health > turret02_health) && (turret02_health > 0))
  13323. {
  13324. if (turret02 != NULL && turret02_dead == false)
  13325. {
  13326. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  13327. params.Set_Movement( Vector3 (-101.5f, 111.7f, 2.3f), 1.0f, 0.5f, false );
  13328. params.MovePathfind = false;
  13329. Commands->Action_Goto ( obj, params );
  13330. working_here_boss = true;
  13331. }
  13332. }
  13333. else
  13334. {
  13335. Commands->Send_Custom_Event( obj, sender, 0, M01_BUSY_TRY_AGAIN_JDG, 1 );
  13336. }
  13337. }
  13338. else if (working_here_boss == true)
  13339. {
  13340. Commands->Send_Custom_Event( obj, sender, 0, M01_BUSY_TRY_AGAIN_JDG, 1 );
  13341. }
  13342. }
  13343. else if (param == M01_START_ATTACKING_01_JDG)
  13344. {
  13345. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13346. if (turret01 != NULL && killedYet == false && turret01_dead == false)
  13347. {
  13348. Vector3 sound_position = Commands->Get_Position ( turret01 );
  13349. Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
  13350. float turretMaxHealth = Commands->Get_Max_Health ( turret01 );
  13351. Commands->Set_Health ( turret01, turretMaxHealth );
  13352. }
  13353. Commands->Debug_Message ( "***************************turret engineer has fixed turret one--going back to hiding spot\n" );
  13354. Commands->Action_Reset ( obj, 100 );
  13355. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13356. params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
  13357. params.MovePathfind = false;
  13358. Commands->Action_Goto ( obj, params );
  13359. }
  13360. else if (param == M01_START_ATTACKING_02_JDG)
  13361. {
  13362. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13363. if (turret02 != NULL && killedYet == false && turret02_dead == false)
  13364. {
  13365. Vector3 sound_position = Commands->Get_Position ( turret02 );
  13366. Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
  13367. float turretMaxHealth = Commands->Get_Max_Health ( turret02 );
  13368. Commands->Set_Health ( turret02, turretMaxHealth );
  13369. }
  13370. Commands->Action_Reset ( obj, 100 );
  13371. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13372. params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
  13373. params.MovePathfind = false;
  13374. Commands->Action_Goto ( obj, params );
  13375. }
  13376. else if (param == M01_TURRET_HAS_BEEN_DESTROYED_JDG)
  13377. {
  13378. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13379. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13380. if (sender == turret01)
  13381. {
  13382. turret01_dead = true;
  13383. }
  13384. if (sender == turret02)
  13385. {
  13386. turret02_dead = true;
  13387. }
  13388. }
  13389. }
  13390. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  13391. {
  13392. ActionParamsStruct params;
  13393. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 01--play fixing animation
  13394. {
  13395. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13396. if (turret01 != NULL)
  13397. {
  13398. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  13399. params.Set_Attack( turret01, 50, 0, false );
  13400. params.AttackCheckBlocked = false;
  13401. Commands->Action_Attack ( obj, params );
  13402. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 1.5f );
  13403. }
  13404. }
  13405. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 02--play fixing animation
  13406. {
  13407. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13408. if (turret02 != NULL)
  13409. {
  13410. params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
  13411. params.Set_Attack( turret02, 50, 0, false );
  13412. params.AttackCheckBlocked = false;
  13413. Commands->Action_Attack ( obj, params );
  13414. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 0.5f );
  13415. }
  13416. }
  13417. else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer has been damaged look around
  13418. {
  13419. char *animationName = M01_Choose_Duck_Animation();
  13420. Commands->Action_Reset ( obj, 100 );
  13421. params.Set_Basic(this, 60, M01_DOING_ANIMATION_04_JDG);
  13422. params.Set_Animation( animationName, false );
  13423. Commands->Action_Play_Animation ( obj, params );
  13424. }
  13425. else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  13426. {
  13427. working_here_boss = false;
  13428. //Commands->Enable_Hibernation( obj, true );
  13429. }
  13430. }
  13431. };
  13432. DECLARE_SCRIPT(M01_TurretBeach_Chinook_Spawned_Soldier_NOD, "")
  13433. {
  13434. bool killedYet;
  13435. bool atTurretsYet;
  13436. REGISTER_VARIABLES()
  13437. {
  13438. SAVE_VARIABLE(killedYet, 1);
  13439. SAVE_VARIABLE(atTurretsYet, 2);
  13440. }
  13441. void Created( GameObject * obj )
  13442. {
  13443. killedYet = false;
  13444. atTurretsYet = false;
  13445. GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
  13446. if (gunboatController != NULL)
  13447. {
  13448. Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  13449. }
  13450. GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13451. if (turret01 != NULL)
  13452. {
  13453. Commands->Send_Custom_Event ( obj, turret01, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  13454. }
  13455. GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13456. if (turret02 != NULL)
  13457. {
  13458. Commands->Send_Custom_Event ( obj, turret02, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  13459. }
  13460. }
  13461. void Animation_Complete(GameObject * obj, const char *anim)
  13462. {
  13463. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  13464. {
  13465. GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13466. GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13467. if (turret01 != NULL || turret02 != NULL)
  13468. {
  13469. ActionParamsStruct params;
  13470. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13471. params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  13472. params.WaypathID = 109629;
  13473. Commands->Action_Goto(obj, params);
  13474. Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
  13475. }
  13476. else
  13477. {
  13478. ActionParamsStruct params;
  13479. params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
  13480. params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  13481. params.WaypathID = 109629;
  13482. Commands->Action_Goto(obj, params);
  13483. //Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
  13484. }
  13485. }
  13486. }
  13487. void Damaged( GameObject * obj, GameObject * damager, float amount )
  13488. {
  13489. if (damager == STAR)
  13490. {
  13491. Commands->Innate_Enable(obj);
  13492. }
  13493. }
  13494. void Killed( GameObject * obj, GameObject * killer )
  13495. {
  13496. killedYet = true;
  13497. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG, 5 );
  13498. }
  13499. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  13500. {
  13501. ActionParamsStruct params;
  13502. if (param == M01_WALKING_WAYPATH_03_JDG && atTurretsYet == false)
  13503. {
  13504. GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13505. GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13506. if (turret01 != NULL || turret02 != NULL)
  13507. {
  13508. //ActionParamsStruct params;
  13509. //params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13510. //params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  13511. //params.WaypathID = 109629;
  13512. //Commands->Action_Goto(obj, params);
  13513. Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
  13514. }
  13515. else
  13516. {
  13517. Commands->Action_Reset ( obj, 100 );
  13518. //ActionParamsStruct params;
  13519. //params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
  13520. //params.Set_Movement(Vector3 (0,0,0), RUN, 1);
  13521. //params.WaypathID = 109629;
  13522. //Commands->Action_Goto(obj, params);
  13523. //Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
  13524. }
  13525. }
  13526. else if (param == M01_START_ACTING_JDG)
  13527. {
  13528. Commands->Debug_Message ( "***************************new engineer custom received--start acting\n" );
  13529. Commands->Enable_Hibernation( obj, false );
  13530. Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
  13531. }
  13532. else if (param == M01_GOTO_IDLE_JDG)
  13533. {
  13534. Commands->Debug_Message ( "***************************new engineer custom received--STOP acting\n" );
  13535. Commands->Enable_Hibernation( obj, true );
  13536. }
  13537. else if (param == M01_CHECK_TURRETS_HEALTH_JDG)
  13538. {
  13539. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13540. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13541. float turret01_health = 0;
  13542. float turret02_health = 0;
  13543. if (turret01 != NULL)
  13544. {
  13545. turret01_health = Commands->Get_Health ( turret01 );
  13546. }
  13547. if (turret02 != NULL)
  13548. {
  13549. turret02_health = Commands->Get_Health ( turret02 );
  13550. }
  13551. if (turret01_health < turret02_health)
  13552. {
  13553. Commands->Action_Reset ( obj, 100 );
  13554. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  13555. params.Set_Movement( Vector3 (-86.5f, 95.5f, 2.3f), 1.0f, 0.5f, false );
  13556. //params.MovePathfind = false;
  13557. Commands->Action_Goto ( obj, params );
  13558. }
  13559. if (turret02_health < turret01_health)
  13560. {
  13561. Commands->Action_Reset ( obj, 100 );
  13562. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  13563. params.Set_Movement( Vector3 (-101.5f, 111.7f, 2.3f), 1.0f, 0.5f, false );
  13564. //params.MovePathfind = false;
  13565. Commands->Action_Goto ( obj, params );
  13566. }
  13567. else
  13568. {
  13569. Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
  13570. }
  13571. }
  13572. else if (param == M01_START_ATTACKING_01_JDG)
  13573. {
  13574. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13575. if (turret01 != NULL && killedYet == false)
  13576. {
  13577. Vector3 sound_position = Commands->Get_Position ( turret01 );
  13578. Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
  13579. float turretMaxHealth = Commands->Get_Max_Health ( turret01 );
  13580. Commands->Set_Health ( turret01, turretMaxHealth );
  13581. }
  13582. Commands->Debug_Message ( "***************************turret engineer has fixed turret one--going back to hiding spot\n" );
  13583. Commands->Action_Reset ( obj, 100 );
  13584. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13585. params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
  13586. params.MovePathfind = false;
  13587. Commands->Action_Goto ( obj, params );
  13588. }
  13589. else if (param == M01_START_ATTACKING_02_JDG)
  13590. {
  13591. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13592. if (turret02 != NULL && killedYet == false)
  13593. {
  13594. Vector3 sound_position = Commands->Get_Position ( turret02 );
  13595. Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
  13596. float turretMaxHealth = Commands->Get_Max_Health ( turret02 );
  13597. Commands->Set_Health ( turret02, turretMaxHealth );
  13598. }
  13599. Commands->Action_Reset ( obj, 100 );
  13600. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  13601. params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
  13602. params.MovePathfind = false;
  13603. Commands->Action_Goto ( obj, params );
  13604. }
  13605. }
  13606. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  13607. {
  13608. ActionParamsStruct params;
  13609. if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 01--play fixing animation
  13610. {
  13611. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  13612. if (turret01 != NULL)
  13613. {
  13614. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  13615. params.Set_Attack( turret01, 50, 0, false );
  13616. params.AttackCheckBlocked = false;
  13617. Commands->Action_Attack ( obj, params );
  13618. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 0.5f );
  13619. }
  13620. }
  13621. else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 02--play fixing animation
  13622. {
  13623. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  13624. if (turret02 != NULL)
  13625. {
  13626. params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
  13627. params.Set_Attack( turret02, 50, 0, false );
  13628. params.AttackCheckBlocked = false;
  13629. Commands->Action_Attack ( obj, params );
  13630. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 0.5f );
  13631. }
  13632. }
  13633. else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer has been damaged look around
  13634. {
  13635. char *animationName = M01_Choose_Duck_Animation();
  13636. Commands->Action_Reset ( obj, 100 );
  13637. params.Set_Basic(this, 60, M01_DOING_ANIMATION_04_JDG);
  13638. params.Set_Animation( animationName, false );
  13639. Commands->Action_Play_Animation ( obj, params );
  13640. }
  13641. else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  13642. {
  13643. atTurretsYet = true;
  13644. Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
  13645. }
  13646. else if (action_id == M01_WALKING_WAYPATH_05_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
  13647. {
  13648. Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
  13649. }
  13650. }
  13651. };
  13652. DECLARE_SCRIPT(M01_FP_NodBase_Dogfight_Contoller_JDG, "")
  13653. {
  13654. int last;
  13655. REGISTER_VARIABLES()
  13656. {
  13657. SAVE_VARIABLE(last, 1);
  13658. }
  13659. void Created(GameObject * obj)
  13660. {
  13661. Commands->Start_Timer(obj, this, 60.0f, 0);
  13662. last = 21;
  13663. }
  13664. void Timer_Expired(GameObject * obj, int timer_id)
  13665. {
  13666. char *flyovers[28] =
  13667. {
  13668. //these are the level 01 dogfights
  13669. "X1A_Apache_Orca_Chase_01.txt",
  13670. "X1A_Apache_Orca_Chase_02.txt",
  13671. "X1A_Apache_Orca_Chase_03.txt",
  13672. "X1A_Apache_Orca_Chase_04.txt",
  13673. //this is a low level flyover in nod base
  13674. //it goes from the refinery to the waterfall N->S
  13675. //chinooks look kinda odd on this one
  13676. "X1A_Solo_Orca_01.txt",
  13677. "X1A_Solo_Orca_01.txt",
  13678. "X1A_Solo_Orca_01.txt",
  13679. "X1A_Solo_Orca_01.txt",
  13680. "X1A_Solo_Orca_01.txt",
  13681. "X1A_Solo_Apache_01.txt",
  13682. "X1A_Solo_Apache_01.txt",
  13683. "X1A_Solo_Apache_01.txt",
  13684. "X1A_Solo_Apache_01.txt",
  13685. "X1A_Solo_Apache_01.txt",
  13686. "X1A_Solo_Nod_Chinook_01.txt",
  13687. "X1A_Solo_GDI_Chinook_01.txt",
  13688. //this is a low level flyover in nod base
  13689. //it goes from the waterfall to the refinery S->N
  13690. "X1A_Solo_Orca_02.txt",
  13691. "X1A_Solo_Apache_02.txt",
  13692. "X1A_Solo_Apache_02.txt",
  13693. "X1A_Solo_Apache_02.txt",
  13694. "X1A_Solo_Apache_02.txt",
  13695. "X1A_Solo_Apache_02.txt",
  13696. "X1A_Solo_Nod_Chinook_02.txt",
  13697. "X1A_Solo_Nod_Chinook_02.txt",
  13698. "X1A_Solo_Nod_Chinook_02.txt",
  13699. "X1A_Solo_Nod_Chinook_02.txt",
  13700. "X1A_Solo_Nod_Chinook_02.txt",
  13701. "X1A_Solo_GDI_Chinook_02.txt",
  13702. };
  13703. int random = Commands->Get_Random_Int(0, 28);
  13704. while (random == last) {
  13705. random = Commands->Get_Random_Int(0, 28);
  13706. }
  13707. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  13708. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  13709. float delayTimer = Commands->Get_Random ( 30, 60 );
  13710. Commands->Start_Timer(obj, this, delayTimer, 0);
  13711. last = random;
  13712. }
  13713. };
  13714. DECLARE_SCRIPT(M01_FP_BaseToBase_NorthSouth_Contoller_JDG, "")
  13715. {
  13716. int last;
  13717. REGISTER_VARIABLES()
  13718. {
  13719. SAVE_VARIABLE(last, 1);
  13720. }
  13721. void Created(GameObject * obj)
  13722. {
  13723. Commands->Start_Timer(obj, this, 60.0f, 0);
  13724. last = 21;
  13725. }
  13726. void Timer_Expired(GameObject * obj, int timer_id)
  13727. {
  13728. char *flyovers[28] =
  13729. {
  13730. //this is a low level traffic lane from nod comm to gdi ocean-- N->S
  13731. "X1A_Solo_Orca_03.txt",
  13732. "X1A_Solo_Apache_03.txt",
  13733. "X1A_Solo_Apache_03.txt",
  13734. "X1A_Solo_Apache_03.txt",
  13735. "X1A_Solo_Apache_03.txt",
  13736. "X1A_Solo_Apache_03.txt",
  13737. "X1A_Solo_Nod_Chinook_03.txt",
  13738. "X1A_Solo_Nod_Chinook_03.txt",
  13739. "X1A_Solo_Nod_Chinook_03.txt",
  13740. "X1A_Solo_Nod_Chinook_03.txt",
  13741. "X1A_Solo_Nod_Chinook_03.txt",
  13742. "X1A_Solo_GDI_Chinook_03.txt",
  13743. "X1A_Solo_NodCargo_03.txt",
  13744. "X1A_Solo_A10_03.txt",
  13745. //this is a low level traffic lane from nod refinery to gdi ocean-- N->S
  13746. "X1A_Solo_Orca_04.txt",
  13747. "X1A_Solo_Apache_04.txt",
  13748. "X1A_Solo_Apache_04.txt",
  13749. "X1A_Solo_Apache_04.txt",
  13750. "X1A_Solo_Apache_04.txt",
  13751. "X1A_Solo_Apache_04.txt",
  13752. "X1A_Solo_Nod_Chinook_04.txt",
  13753. "X1A_Solo_Nod_Chinook_04.txt",
  13754. "X1A_Solo_Nod_Chinook_04.txt",
  13755. "X1A_Solo_Nod_Chinook_04.txt",
  13756. "X1A_Solo_Nod_Chinook_04.txt",
  13757. "X1A_Solo_GDI_Chinook_04.txt",
  13758. "X1A_Solo_NodCargo_04.txt",
  13759. "X1A_Solo_A10_04.txt",
  13760. };
  13761. int random = Commands->Get_Random_Int(0, 28);
  13762. while (random == last) {
  13763. random = Commands->Get_Random_Int(0, 28);
  13764. }
  13765. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  13766. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  13767. float delayTimer = Commands->Get_Random ( 30, 60 );
  13768. Commands->Start_Timer(obj, this, delayTimer, 0);
  13769. last = random;
  13770. }
  13771. };
  13772. DECLARE_SCRIPT(M01_FP_BaseToBase_SouthNorth_Contoller_JDG, "")
  13773. {
  13774. int last;
  13775. REGISTER_VARIABLES()
  13776. {
  13777. SAVE_VARIABLE(last, 1);
  13778. }
  13779. void Created(GameObject * obj)
  13780. {
  13781. last = 21;
  13782. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  13783. Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Solo_NodCargo_06.txt");
  13784. Commands->Start_Timer(obj, this, 60.0f, 0);
  13785. }
  13786. void Timer_Expired(GameObject * obj, int timer_id)
  13787. {
  13788. char *flyovers[56] =
  13789. {
  13790. //this is a low level traffic lane from gdi ocean to nod comm center-- S->N
  13791. "X1A_Solo_Orca_05.txt",
  13792. "X1A_Solo_Orca_05.txt",
  13793. "X1A_Solo_Orca_05.txt",
  13794. "X1A_Solo_Orca_05.txt",
  13795. "X1A_Solo_Orca_05.txt",
  13796. "X1A_Solo_Apache_05.txt",
  13797. "X1A_Solo_Nod_Chinook_05.txt",
  13798. "X1A_Solo_GDI_Chinook_05.txt",
  13799. "X1A_Solo_GDI_Chinook_05.txt",
  13800. "X1A_Solo_GDI_Chinook_05.txt",
  13801. "X1A_Solo_GDI_Chinook_05.txt",
  13802. "X1A_Solo_GDI_Chinook_05.txt",
  13803. "X1A_Solo_NodCargo_05.txt",
  13804. "X1A_Solo_A10_05.txt",
  13805. //this is a low level traffic lane from gdi ocean to nod refinery-- S->N
  13806. "X1A_Solo_Orca_06.txt",
  13807. "X1A_Solo_Orca_06.txt",
  13808. "X1A_Solo_Orca_06.txt",
  13809. "X1A_Solo_Orca_06.txt",
  13810. "X1A_Solo_Orca_06.txt",
  13811. "X1A_Solo_Apache_06.txt",
  13812. "X1A_Solo_Nod_Chinook_06.txt",
  13813. "X1A_Solo_GDI_Chinook_06.txt",
  13814. "X1A_Solo_GDI_Chinook_06.txt",
  13815. "X1A_Solo_GDI_Chinook_06.txt",
  13816. "X1A_Solo_GDI_Chinook_06.txt",
  13817. "X1A_Solo_GDI_Chinook_06.txt",
  13818. "X1A_Solo_NodCargo_06.txt",
  13819. "X1A_Solo_A10_06.txt",
  13820. //this is a low/med level traffic lane from gdi ocean to nod refinery-- S->N
  13821. "X1A_Solo_Orca_07.txt",
  13822. "X1A_Solo_Orca_07.txt",
  13823. "X1A_Solo_Orca_07.txt",
  13824. "X1A_Solo_Orca_07.txt",
  13825. "X1A_Solo_Orca_07.txt",
  13826. "X1A_Solo_Apache_07.txt",
  13827. "X1A_Solo_Nod_Chinook_07.txt",
  13828. "X1A_Solo_GDI_Chinook_07.txt",
  13829. "X1A_Solo_GDI_Chinook_07.txt",
  13830. "X1A_Solo_GDI_Chinook_07.txt",
  13831. "X1A_Solo_GDI_Chinook_07.txt",
  13832. "X1A_Solo_GDI_Chinook_07.txt",
  13833. "X1A_Solo_NodCargo_07.txt",
  13834. "X1A_Solo_A10_07.txt",
  13835. //this is a low level traffic lane from gdi ocean to nod comm center-- S->N
  13836. "X1A_Solo_Orca_08.txt",
  13837. "X1A_Solo_Orca_08.txt",
  13838. "X1A_Solo_Orca_08.txt",
  13839. "X1A_Solo_Orca_08.txt",
  13840. "X1A_Solo_Orca_08.txt",
  13841. "X1A_Solo_Apache_08.txt",
  13842. "X1A_Solo_GDI_Chinook_08.txt",
  13843. "X1A_Solo_GDI_Chinook_08.txt",
  13844. "X1A_Solo_GDI_Chinook_08.txt",
  13845. "X1A_Solo_GDI_Chinook_08.txt",
  13846. "X1A_Solo_GDI_Chinook_08.txt",
  13847. "X1A_Solo_Nod_Chinook_08.txt",
  13848. "X1A_Solo_NodCargo_08.txt",
  13849. "X1A_Solo_A10_08.txt",
  13850. };
  13851. int random = Commands->Get_Random_Int(0, 56);
  13852. while (random == last) {
  13853. random = Commands->Get_Random_Int(0, 56);
  13854. }
  13855. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  13856. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  13857. float delayTimer = Commands->Get_Random ( 30, 60 );
  13858. Commands->Start_Timer(obj, this, delayTimer, 0);
  13859. last = random;
  13860. }
  13861. };
  13862. DECLARE_SCRIPT(M01_FP_NodBase_EastWest_Contoller_JDG, "")
  13863. {
  13864. int last;
  13865. REGISTER_VARIABLES()
  13866. {
  13867. SAVE_VARIABLE(last, 1);
  13868. }
  13869. void Created(GameObject * obj)
  13870. {
  13871. Commands->Start_Timer(obj, this, 60.0f, 0);
  13872. last = 21;
  13873. }
  13874. void Timer_Expired(GameObject * obj, int timer_id)
  13875. {
  13876. char *flyovers[72] =
  13877. {
  13878. //this is a flyover at nod base it goes from the comm to the refinery-- E->W
  13879. "X1A_Solo_Orca_09.txt",
  13880. "X1A_Solo_Apache_09.txt",
  13881. "X1A_Solo_Apache_09.txt",
  13882. "X1A_Solo_Apache_09.txt",
  13883. "X1A_Solo_Apache_09.txt",
  13884. "X1A_Solo_Apache_09.txt",
  13885. "X1A_Solo_Apache_09.txt",
  13886. "X1A_Solo_Apache_09.txt",
  13887. "X1A_Solo_Apache_09.txt",
  13888. "X1A_Solo_Apache_09.txt",
  13889. "X1A_Solo_Apache_09.txt",
  13890. "X1A_Solo_Nod_Chinook_09.txt",
  13891. "X1A_Solo_Nod_Chinook_09.txt",
  13892. "X1A_Solo_Nod_Chinook_09.txt",
  13893. "X1A_Solo_Nod_Chinook_09.txt",
  13894. "X1A_Solo_Nod_Chinook_09.txt",
  13895. "X1A_Solo_Nod_Chinook_09.txt",
  13896. "X1A_Solo_Nod_Chinook_09.txt",
  13897. "X1A_Solo_Nod_Chinook_09.txt",
  13898. "X1A_Solo_Nod_Chinook_09.txt",
  13899. "X1A_Solo_Nod_Chinook_09.txt",
  13900. "X1A_Solo_GDI_Chinook_09.txt",
  13901. "X1A_Solo_NodCargo_09.txt",
  13902. "X1A_Solo_A10_09.txt",
  13903. //this is a flyover at nod base it goes from the comm to the refinery-- E->W
  13904. "X1A_Solo_Orca_10.txt",
  13905. "X1A_Solo_Apache_10.txt",
  13906. "X1A_Solo_Apache_10.txt",
  13907. "X1A_Solo_Apache_10.txt",
  13908. "X1A_Solo_Apache_10.txt",
  13909. "X1A_Solo_Apache_10.txt",
  13910. "X1A_Solo_Apache_10.txt",
  13911. "X1A_Solo_Apache_10.txt",
  13912. "X1A_Solo_Apache_10.txt",
  13913. "X1A_Solo_Apache_10.txt",
  13914. "X1A_Solo_Apache_10.txt",
  13915. "X1A_Solo_Nod_Chinook_10.txt",
  13916. "X1A_Solo_Nod_Chinook_10.txt",
  13917. "X1A_Solo_Nod_Chinook_10.txt",
  13918. "X1A_Solo_Nod_Chinook_10.txt",
  13919. "X1A_Solo_Nod_Chinook_10.txt",
  13920. "X1A_Solo_Nod_Chinook_10.txt",
  13921. "X1A_Solo_Nod_Chinook_10.txt",
  13922. "X1A_Solo_Nod_Chinook_10.txt",
  13923. "X1A_Solo_Nod_Chinook_10.txt",
  13924. "X1A_Solo_Nod_Chinook_10.txt",
  13925. "X1A_Solo_GDI_Chinook_10.txt",
  13926. "X1A_Solo_NodCargo_10.txt",
  13927. "X1A_Solo_A10_10.txt",
  13928. //this is a flyover at nod base it goes from the comm to the refinery-- E->W
  13929. "X1A_Solo_Orca_11.txt",
  13930. "X1A_Solo_Apache_11.txt",
  13931. "X1A_Solo_Apache_11.txt",
  13932. "X1A_Solo_Apache_11.txt",
  13933. "X1A_Solo_Apache_11.txt",
  13934. "X1A_Solo_Apache_11.txt",
  13935. "X1A_Solo_Apache_11.txt",
  13936. "X1A_Solo_Apache_11.txt",
  13937. "X1A_Solo_Apache_11.txt",
  13938. "X1A_Solo_Apache_11.txt",
  13939. "X1A_Solo_Apache_11.txt",
  13940. "X1A_Solo_Nod_Chinook_11.txt",
  13941. "X1A_Solo_Nod_Chinook_11.txt",
  13942. "X1A_Solo_Nod_Chinook_11.txt",
  13943. "X1A_Solo_Nod_Chinook_11.txt",
  13944. "X1A_Solo_Nod_Chinook_11.txt",
  13945. "X1A_Solo_Nod_Chinook_11.txt",
  13946. "X1A_Solo_Nod_Chinook_11.txt",
  13947. "X1A_Solo_Nod_Chinook_11.txt",
  13948. "X1A_Solo_Nod_Chinook_11.txt",
  13949. "X1A_Solo_Nod_Chinook_11.txt",
  13950. "X1A_Solo_GDI_Chinook_11.txt",
  13951. "X1A_Solo_NodCargo_11.txt",
  13952. "X1A_Solo_A10_11.txt",
  13953. };
  13954. int random = Commands->Get_Random_Int(0, 72);
  13955. while (random == last) {
  13956. random = Commands->Get_Random_Int(0, 72);
  13957. }
  13958. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  13959. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  13960. float delayTimer = Commands->Get_Random ( 30, 60 );
  13961. Commands->Start_Timer(obj, this, delayTimer, 0);
  13962. last = random;
  13963. }
  13964. };
  13965. DECLARE_SCRIPT(M01_FP_NodBase_WestEast_Contoller_JDG, "")
  13966. {
  13967. int last;
  13968. REGISTER_VARIABLES()
  13969. {
  13970. SAVE_VARIABLE(last, 1);
  13971. }
  13972. void Created(GameObject * obj)
  13973. {
  13974. Commands->Start_Timer(obj, this, 60.0f, 0);
  13975. last = 21;
  13976. }
  13977. void Timer_Expired(GameObject * obj, int timer_id)
  13978. {
  13979. char *flyovers[48] =
  13980. {
  13981. //this is a flyover at nod base it goes from the refinery to the comm W->E
  13982. "X1A_Solo_Orca_12.txt",
  13983. "X1A_Solo_Apache_12.txt",
  13984. "X1A_Solo_Apache_12.txt",
  13985. "X1A_Solo_Apache_12.txt",
  13986. "X1A_Solo_Apache_12.txt",
  13987. "X1A_Solo_Apache_12.txt",
  13988. "X1A_Solo_Apache_12.txt",
  13989. "X1A_Solo_Apache_12.txt",
  13990. "X1A_Solo_Apache_12.txt",
  13991. "X1A_Solo_Apache_12.txt",
  13992. "X1A_Solo_Apache_12.txt",
  13993. "X1A_Solo_Nod_Chinook_12.txt",
  13994. "X1A_Solo_Nod_Chinook_12.txt",
  13995. "X1A_Solo_Nod_Chinook_12.txt",
  13996. "X1A_Solo_Nod_Chinook_12.txt",
  13997. "X1A_Solo_Nod_Chinook_12.txt",
  13998. "X1A_Solo_Nod_Chinook_12.txt",
  13999. "X1A_Solo_Nod_Chinook_12.txt",
  14000. "X1A_Solo_Nod_Chinook_12.txt",
  14001. "X1A_Solo_Nod_Chinook_12.txt",
  14002. "X1A_Solo_Nod_Chinook_12.txt",
  14003. "X1A_Solo_GDI_Chinook_12.txt",
  14004. "X1A_Solo_NodCargo_12.txt",
  14005. "X1A_Solo_A10_12.txt",
  14006. //this is a flyover at nod base it goes from the refinery to the comm W->E
  14007. "X1A_Solo_Orca_13.txt",
  14008. "X1A_Solo_Apache_13.txt",
  14009. "X1A_Solo_Apache_13.txt",
  14010. "X1A_Solo_Apache_13.txt",
  14011. "X1A_Solo_Apache_13.txt",
  14012. "X1A_Solo_Apache_13.txt",
  14013. "X1A_Solo_Apache_13.txt",
  14014. "X1A_Solo_Apache_13.txt",
  14015. "X1A_Solo_Apache_13.txt",
  14016. "X1A_Solo_Apache_13.txt",
  14017. "X1A_Solo_Apache_13.txt",
  14018. "X1A_Solo_Nod_Chinook_13.txt",
  14019. "X1A_Solo_Nod_Chinook_13.txt",
  14020. "X1A_Solo_Nod_Chinook_13.txt",
  14021. "X1A_Solo_Nod_Chinook_13.txt",
  14022. "X1A_Solo_Nod_Chinook_13.txt",
  14023. "X1A_Solo_Nod_Chinook_13.txt",
  14024. "X1A_Solo_Nod_Chinook_13.txt",
  14025. "X1A_Solo_Nod_Chinook_13.txt",
  14026. "X1A_Solo_Nod_Chinook_13.txt",
  14027. "X1A_Solo_Nod_Chinook_13.txt",
  14028. "X1A_Solo_GDI_Chinook_13.txt",
  14029. "X1A_Solo_NodCargo_13.txt",
  14030. "X1A_Solo_A10_13.txt",
  14031. };
  14032. int random = Commands->Get_Random_Int(0, 48);
  14033. while (random == last) {
  14034. random = Commands->Get_Random_Int(0, 48);
  14035. }
  14036. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  14037. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  14038. float delayTimer = Commands->Get_Random ( 30, 60 );
  14039. Commands->Start_Timer(obj, this, delayTimer, 0);
  14040. last = random;
  14041. }
  14042. };
  14043. DECLARE_SCRIPT(M01_FP_NodBase_NorthSouth_Contoller_JDG, "")
  14044. {
  14045. int last;
  14046. REGISTER_VARIABLES()
  14047. {
  14048. SAVE_VARIABLE(last, 1);
  14049. }
  14050. void Created(GameObject * obj)
  14051. {
  14052. Commands->Start_Timer(obj, this, 60.0f, 0);
  14053. last = 21;
  14054. }
  14055. void Timer_Expired(GameObject * obj, int timer_id)
  14056. {
  14057. char *flyovers[48] =
  14058. {
  14059. //this is a flyover at nod base it goes from the comm to the waterfall N->S
  14060. "X1A_Solo_Orca_14.txt",
  14061. "X1A_Solo_Apache_14.txt",
  14062. "X1A_Solo_Apache_14.txt",
  14063. "X1A_Solo_Apache_14.txt",
  14064. "X1A_Solo_Apache_14.txt",
  14065. "X1A_Solo_Apache_14.txt",
  14066. "X1A_Solo_Apache_14.txt",
  14067. "X1A_Solo_Apache_14.txt",
  14068. "X1A_Solo_Apache_14.txt",
  14069. "X1A_Solo_Apache_14.txt",
  14070. "X1A_Solo_Apache_14.txt",
  14071. "X1A_Solo_Nod_Chinook_14.txt",
  14072. "X1A_Solo_Nod_Chinook_14.txt",
  14073. "X1A_Solo_Nod_Chinook_14.txt",
  14074. "X1A_Solo_Nod_Chinook_14.txt",
  14075. "X1A_Solo_Nod_Chinook_14.txt",
  14076. "X1A_Solo_Nod_Chinook_14.txt",
  14077. "X1A_Solo_Nod_Chinook_14.txt",
  14078. "X1A_Solo_Nod_Chinook_14.txt",
  14079. "X1A_Solo_Nod_Chinook_14.txt",
  14080. "X1A_Solo_Nod_Chinook_14.txt",
  14081. "X1A_Solo_GDI_Chinook_14.txt",
  14082. "X1A_Solo_NodCargo_14.txt",
  14083. "X1A_Solo_A10_14.txt",
  14084. //this is a flyover at nod base it goes from the comm to the waterfall N->S
  14085. "X1A_Solo_Orca_15.txt",
  14086. "X1A_Solo_Apache_15.txt",
  14087. "X1A_Solo_Apache_15.txt",
  14088. "X1A_Solo_Apache_15.txt",
  14089. "X1A_Solo_Apache_15.txt",
  14090. "X1A_Solo_Apache_15.txt",
  14091. "X1A_Solo_Apache_15.txt",
  14092. "X1A_Solo_Apache_15.txt",
  14093. "X1A_Solo_Apache_15.txt",
  14094. "X1A_Solo_Apache_15.txt",
  14095. "X1A_Solo_Apache_15.txt",
  14096. "X1A_Solo_Nod_Chinook_15.txt",
  14097. "X1A_Solo_Nod_Chinook_15.txt",
  14098. "X1A_Solo_Nod_Chinook_15.txt",
  14099. "X1A_Solo_Nod_Chinook_15.txt",
  14100. "X1A_Solo_Nod_Chinook_15.txt",
  14101. "X1A_Solo_Nod_Chinook_15.txt",
  14102. "X1A_Solo_Nod_Chinook_15.txt",
  14103. "X1A_Solo_Nod_Chinook_15.txt",
  14104. "X1A_Solo_Nod_Chinook_15.txt",
  14105. "X1A_Solo_Nod_Chinook_15.txt",
  14106. "X1A_Solo_GDI_Chinook_15.txt",
  14107. "X1A_Solo_NodCargo_15.txt",
  14108. "X1A_Solo_A10_15.txt",
  14109. };
  14110. int random = Commands->Get_Random_Int(0, 48);
  14111. while (random == last) {
  14112. random = Commands->Get_Random_Int(0, 48);
  14113. }
  14114. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  14115. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  14116. float delayTimer = Commands->Get_Random ( 30, 60 );
  14117. Commands->Start_Timer(obj, this, delayTimer, 0);
  14118. last = random;
  14119. }
  14120. };
  14121. DECLARE_SCRIPT(M01_FP_NodBase_SouthNorth_Contoller_JDG, "")
  14122. {
  14123. int last;
  14124. REGISTER_VARIABLES()
  14125. {
  14126. SAVE_VARIABLE(last, 1);
  14127. }
  14128. void Created(GameObject * obj)
  14129. {
  14130. Commands->Start_Timer(obj, this, 60.0f, 0);
  14131. last = 21;
  14132. }
  14133. void Timer_Expired(GameObject * obj, int timer_id)
  14134. {
  14135. char *flyovers[48] =
  14136. {
  14137. //this is a flyover at nod base it goes from guard tower 01 to the comm center S-N
  14138. "X1A_Solo_Orca_16.txt",
  14139. "X1A_Solo_Apache_16.txt",
  14140. "X1A_Solo_Apache_16.txt",
  14141. "X1A_Solo_Apache_16.txt",
  14142. "X1A_Solo_Apache_16.txt",
  14143. "X1A_Solo_Apache_16.txt",
  14144. "X1A_Solo_Apache_16.txt",
  14145. "X1A_Solo_Apache_16.txt",
  14146. "X1A_Solo_Apache_16.txt",
  14147. "X1A_Solo_Apache_16.txt",
  14148. "X1A_Solo_Apache_16.txt",
  14149. "X1A_Solo_Nod_Chinook_16.txt",
  14150. "X1A_Solo_Nod_Chinook_16.txt",
  14151. "X1A_Solo_Nod_Chinook_16.txt",
  14152. "X1A_Solo_Nod_Chinook_16.txt",
  14153. "X1A_Solo_Nod_Chinook_16.txt",
  14154. "X1A_Solo_Nod_Chinook_16.txt",
  14155. "X1A_Solo_Nod_Chinook_16.txt",
  14156. "X1A_Solo_Nod_Chinook_16.txt",
  14157. "X1A_Solo_Nod_Chinook_16.txt",
  14158. "X1A_Solo_Nod_Chinook_16.txt",
  14159. "X1A_Solo_GDI_Chinook_16.txt",
  14160. "X1A_Solo_NodCargo_16.txt",
  14161. "X1A_Solo_A10_16.txt",
  14162. //this is a flyover at nod base it goes from guard tower 01 to the comm center S-N
  14163. "X1A_Solo_Orca_17.txt",
  14164. "X1A_Solo_Apache_17.txt",
  14165. "X1A_Solo_Apache_17.txt",
  14166. "X1A_Solo_Apache_17.txt",
  14167. "X1A_Solo_Apache_17.txt",
  14168. "X1A_Solo_Apache_17.txt",
  14169. "X1A_Solo_Apache_17.txt",
  14170. "X1A_Solo_Apache_17.txt",
  14171. "X1A_Solo_Apache_17.txt",
  14172. "X1A_Solo_Apache_17.txt",
  14173. "X1A_Solo_Apache_17.txt",
  14174. "X1A_Solo_Nod_Chinook_17.txt",
  14175. "X1A_Solo_Nod_Chinook_17.txt",
  14176. "X1A_Solo_Nod_Chinook_17.txt",
  14177. "X1A_Solo_Nod_Chinook_17.txt",
  14178. "X1A_Solo_Nod_Chinook_17.txt",
  14179. "X1A_Solo_Nod_Chinook_17.txt",
  14180. "X1A_Solo_Nod_Chinook_17.txt",
  14181. "X1A_Solo_Nod_Chinook_17.txt",
  14182. "X1A_Solo_Nod_Chinook_17.txt",
  14183. "X1A_Solo_Nod_Chinook_17.txt",
  14184. "X1A_Solo_GDI_Chinook_17.txt",
  14185. "X1A_Solo_NodCargo_17.txt",
  14186. "X1A_Solo_A10_17.txt",
  14187. };
  14188. int random = Commands->Get_Random_Int(0, 48);
  14189. while (random == last) {
  14190. random = Commands->Get_Random_Int(0, 48);
  14191. }
  14192. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  14193. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  14194. float delayTimer = Commands->Get_Random ( 30, 60 );
  14195. Commands->Start_Timer(obj, this, delayTimer, 0);
  14196. last = random;
  14197. }
  14198. };
  14199. DECLARE_SCRIPT(M01_FP_GDIOcean_NorthSouth_Contoller_JDG, "")
  14200. {
  14201. int last;
  14202. REGISTER_VARIABLES()
  14203. {
  14204. SAVE_VARIABLE(last, 1);
  14205. }
  14206. void Created(GameObject * obj)
  14207. {
  14208. Commands->Start_Timer(obj, this, 60.0f, 0);
  14209. last = 21;
  14210. }
  14211. void Timer_Expired(GameObject * obj, int timer_id)
  14212. {
  14213. char *flyovers[28] =
  14214. {
  14215. //this is a GDI ocean traffic lane N->S
  14216. "X1A_Solo_Orca_18.txt",
  14217. "X1A_Solo_Orca_18.txt",
  14218. "X1A_Solo_Orca_18.txt",
  14219. "X1A_Solo_Orca_18.txt",
  14220. "X1A_Solo_Orca_18.txt",
  14221. "X1A_Solo_Apache_18.txt",
  14222. "X1A_Solo_Nod_Chinook_18.txt",
  14223. "X1A_Solo_GDI_Chinook_18.txt",
  14224. "X1A_Solo_GDI_Chinook_18.txt",
  14225. "X1A_Solo_GDI_Chinook_18.txt",
  14226. "X1A_Solo_GDI_Chinook_18.txt",
  14227. "X1A_Solo_GDI_Chinook_18.txt",
  14228. "X1A_Solo_NodCargo_18.txt",
  14229. "X1A_Solo_A10_18.txt",
  14230. //this is a GDI ocean traffic lane N->S
  14231. "X1A_Solo_Orca_19.txt",
  14232. "X1A_Solo_Orca_19.txt",
  14233. "X1A_Solo_Orca_19.txt",
  14234. "X1A_Solo_Orca_19.txt",
  14235. "X1A_Solo_Orca_19.txt",
  14236. "X1A_Solo_Apache_19.txt",
  14237. "X1A_Solo_Nod_Chinook_19.txt",
  14238. "X1A_Solo_GDI_Chinook_19.txt",
  14239. "X1A_Solo_GDI_Chinook_19.txt",
  14240. "X1A_Solo_GDI_Chinook_19.txt",
  14241. "X1A_Solo_GDI_Chinook_19.txt",
  14242. "X1A_Solo_GDI_Chinook_19.txt",
  14243. "X1A_Solo_NodCargo_19.txt",
  14244. "X1A_Solo_A10_19.txt",
  14245. };
  14246. int random = Commands->Get_Random_Int(0, 28);
  14247. while (random == last) {
  14248. random = Commands->Get_Random_Int(0, 28);
  14249. }
  14250. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  14251. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  14252. float delayTimer = Commands->Get_Random ( 30, 60 );
  14253. Commands->Start_Timer(obj, this, delayTimer, 0);
  14254. last = random;
  14255. }
  14256. };
  14257. DECLARE_SCRIPT(M01_FP_GDIOcean_SouthNorth_Contoller_JDG, "")
  14258. {
  14259. int last;
  14260. REGISTER_VARIABLES()
  14261. {
  14262. SAVE_VARIABLE(last, 1);
  14263. }
  14264. void Created(GameObject * obj)
  14265. {
  14266. Commands->Start_Timer(obj, this, 60.0f, 0);
  14267. last = 21;
  14268. }
  14269. void Timer_Expired(GameObject * obj, int timer_id)
  14270. {
  14271. char *flyovers[26] =
  14272. {
  14273. //this is a GDI ocean traffic lane S->N
  14274. "X1A_Solo_Orca_20.txt",
  14275. "X1A_Solo_Orca_20.txt",
  14276. "X1A_Solo_Orca_20.txt",
  14277. "X1A_Solo_Orca_20.txt",
  14278. "X1A_Solo_Orca_20.txt",
  14279. "X1A_Solo_Apache_20.txt",
  14280. "X1A_Solo_Nod_Chinook_20.txt",
  14281. "X1A_Solo_GDI_Chinook_20.txt",
  14282. "X1A_Solo_GDI_Chinook_20.txt",
  14283. "X1A_Solo_GDI_Chinook_20.txt",
  14284. "X1A_Solo_GDI_Chinook_20.txt",
  14285. "X1A_Solo_GDI_Chinook_20.txt",
  14286. "X1A_Solo_A10_20.txt",
  14287. //this is a GDI ocean traffic lane S->N
  14288. "X1A_Solo_Orca_21.txt",
  14289. "X1A_Solo_Orca_21.txt",
  14290. "X1A_Solo_Orca_21.txt",
  14291. "X1A_Solo_Orca_21.txt",
  14292. "X1A_Solo_Orca_21.txt",
  14293. "X1A_Solo_Apache_21.txt",
  14294. "X1A_Solo_Nod_Chinook_21.txt",
  14295. "X1A_Solo_GDI_Chinook_21.txt",
  14296. "X1A_Solo_GDI_Chinook_21.txt",
  14297. "X1A_Solo_GDI_Chinook_21.txt",
  14298. "X1A_Solo_GDI_Chinook_21.txt",
  14299. "X1A_Solo_GDI_Chinook_21.txt",
  14300. "X1A_Solo_A10_21.txt",
  14301. };
  14302. int random = Commands->Get_Random_Int(0, 26);
  14303. while (random == last) {
  14304. random = Commands->Get_Random_Int(0, 26);
  14305. }
  14306. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  14307. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
  14308. float delayTimer = Commands->Get_Random ( 30, 60 );
  14309. Commands->Start_Timer(obj, this, delayTimer, 0);
  14310. last = random;
  14311. }
  14312. };
  14313. DECLARE_SCRIPT(M01_Deco_LightTanks_JDG, "")//119424 119426 119425
  14314. {
  14315. void Created( GameObject * obj )
  14316. {
  14317. Vector3 myTarget (-27.746f, 52.823f, 1.071f);
  14318. ActionParamsStruct params;
  14319. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  14320. params.Set_Attack( myTarget, 100, 3, true );
  14321. params.AttackCheckBlocked = false;
  14322. Commands->Action_Attack (obj, params);
  14323. }
  14324. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14325. {
  14326. if (type == 0)
  14327. {
  14328. if (param == M01_START_ATTACKING_01_JDG)
  14329. {
  14330. ActionParamsStruct params;
  14331. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  14332. params.Set_Attack( STAR, 100, 8, true );
  14333. params.AttackCheckBlocked = false;
  14334. Commands->Action_Attack (obj, params);
  14335. }
  14336. else if (param == M01_START_ATTACKING_02_JDG)
  14337. {
  14338. if (obj)
  14339. {
  14340. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  14341. }
  14342. }
  14343. }
  14344. }
  14345. };
  14346. DECLARE_SCRIPT(M01_Airstrike_Controller_JDG, "")//121041
  14347. {
  14348. int decoTank01_id;
  14349. int decoTank02_id;
  14350. int decoTank03_id;
  14351. REGISTER_VARIABLES()
  14352. {
  14353. SAVE_VARIABLE(decoTank01_id, 1);
  14354. SAVE_VARIABLE(decoTank02_id, 2);
  14355. SAVE_VARIABLE(decoTank03_id, 3);
  14356. }
  14357. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14358. {
  14359. if (type == 0)
  14360. {
  14361. if (param == 0)//airstrike text file is sendyou the command to play explosions
  14362. {
  14363. GameObject * realtank = Commands->Find_Object ( 120022 );
  14364. if (realtank != NULL)
  14365. {
  14366. Commands->Send_Custom_Event( obj, realtank, 0, M01_START_ATTACKING_01_JDG, 0.5f );
  14367. }
  14368. GameObject * tank01 = Commands->Find_Object ( decoTank01_id );
  14369. GameObject * tank02 = Commands->Find_Object ( decoTank02_id );
  14370. GameObject * tank03 = Commands->Find_Object ( decoTank03_id );
  14371. if (tank01 != NULL)
  14372. {
  14373. Commands->Send_Custom_Event( obj, tank01, 0, M01_START_ATTACKING_02_JDG, 0.5f );
  14374. }
  14375. if (tank02 != NULL)
  14376. {
  14377. Commands->Send_Custom_Event( obj, tank02, 0, M01_START_ATTACKING_02_JDG, 0.75f );
  14378. }
  14379. if (tank03 != NULL)
  14380. {
  14381. Commands->Send_Custom_Event( obj, tank03, 0, M01_START_ATTACKING_02_JDG, 1.0f );
  14382. }
  14383. }
  14384. else if (param == M01_START_ACTING_JDG)
  14385. {
  14386. Vector3 tank01Spot (-12.175f, 68.280f, 3.009f);
  14387. Vector3 tank02Spot (-14.948f, 61.305f, 3.259f);
  14388. Vector3 tank03Spot (-22.011f, 66.635f, 2.959f);
  14389. GameObject * decoTank01 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank01Spot );
  14390. Commands->Set_Facing ( decoTank01, -145 );
  14391. GameObject * decoTank02 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank02Spot );
  14392. Commands->Set_Facing ( decoTank02, -150 );
  14393. GameObject * decoTank03 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank03Spot );
  14394. Commands->Set_Facing ( decoTank03, -115 );
  14395. Commands->Attach_Script(decoTank01, "M01_Deco_LightTanks_JDG", "");
  14396. Commands->Attach_Script(decoTank02, "M01_Deco_LightTanks_JDG", "");
  14397. Commands->Attach_Script(decoTank03, "M01_Deco_LightTanks_JDG", "");
  14398. decoTank01_id = Commands->Get_ID ( decoTank01 );
  14399. decoTank02_id = Commands->Get_ID ( decoTank02 );
  14400. decoTank03_id = Commands->Get_ID ( decoTank03 );
  14401. }
  14402. else if (param == M01_START_ATTACKING_01_JDG)
  14403. {
  14404. GameObject * tank01 = Commands->Find_Object ( decoTank01_id );
  14405. GameObject * tank02 = Commands->Find_Object ( decoTank02_id );
  14406. GameObject * tank03 = Commands->Find_Object ( decoTank03_id );
  14407. if (tank01 != NULL)
  14408. {
  14409. Commands->Send_Custom_Event( obj, tank01, 0, M01_START_ATTACKING_01_JDG, 0.5f );
  14410. }
  14411. if (tank02 != NULL)
  14412. {
  14413. Commands->Send_Custom_Event( obj, tank02, 0, M01_START_ATTACKING_01_JDG, 0.5f );
  14414. }
  14415. if (tank03 != NULL)
  14416. {
  14417. Commands->Send_Custom_Event( obj, tank03, 0, M01_START_ATTACKING_01_JDG, 0.5f );
  14418. }
  14419. }
  14420. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  14421. {
  14422. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 0 );
  14423. GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(0,0,0));
  14424. Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1G_A-10_Strike.txt");
  14425. }
  14426. }
  14427. }
  14428. };
  14429. DECLARE_SCRIPT(M01_GDIBase_RealLightTank_JDG, "")//120022
  14430. {//waypath 120218
  14431. void Killed( GameObject * obj, GameObject * killer )
  14432. {
  14433. //int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
  14434. //Commands->Join_Conversation( NULL, airdrop_conv, false, false );
  14435. //Commands->Start_Conversation( airdrop_conv, airdrop_conv );
  14436. }
  14437. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14438. {
  14439. if (type == 0)
  14440. {
  14441. if (param == M01_START_ACTING_JDG)
  14442. {
  14443. ActionParamsStruct params;
  14444. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  14445. params.Set_Movement( Vector3(0,0,0), .7f, 10 );
  14446. params.WaypathID = 120218;
  14447. //params.AttackActive = false;
  14448. Commands->Action_Goto( obj, params );
  14449. GameObject * airstrikeController = Commands->Find_Object ( 121041 );
  14450. if (airstrikeController != NULL)
  14451. {
  14452. Commands->Send_Custom_Event( obj, airstrikeController, 0, M01_START_ACTING_JDG, 0 );
  14453. Commands->Send_Custom_Event( obj, airstrikeController, 0, M01_MODIFY_YOUR_ACTION_JDG, 15 );
  14454. }
  14455. }
  14456. else if (param == M01_START_ATTACKING_01_JDG)
  14457. {
  14458. if (obj)
  14459. {
  14460. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  14461. }
  14462. }
  14463. }
  14464. }
  14465. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  14466. {
  14467. ActionParamsStruct params;
  14468. if (complete_reason == ACTION_COMPLETE_NORMAL)
  14469. {
  14470. if (action_id == M01_WALKING_WAYPATH_01_JDG )
  14471. {
  14472. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  14473. params.Set_Attack( STAR, 100, 10, true );
  14474. params.AttackCheckBlocked = false;
  14475. Commands->Action_Attack (obj, params);
  14476. //Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 4 );
  14477. }
  14478. }
  14479. }
  14480. };
  14481. DECLARE_SCRIPT(M01_RealLightTank_TriggerZone_JDG, "")
  14482. {
  14483. bool entered;
  14484. REGISTER_VARIABLES()
  14485. {
  14486. SAVE_VARIABLE(entered, 1);
  14487. }
  14488. void Created( GameObject * obj )
  14489. {
  14490. entered = false;
  14491. }
  14492. void Entered( GameObject * obj, GameObject * enterer )
  14493. {
  14494. if (entered == false)
  14495. {
  14496. if (enterer == STAR)
  14497. {
  14498. entered = true;
  14499. GameObject * lightTank = Commands->Find_Object ( 120022 );//00-N036E
  14500. if (lightTank != NULL)
  14501. {
  14502. Commands->Send_Custom_Event( obj, lightTank, 0, M01_START_ACTING_JDG, 0 );
  14503. //Commands->Create_2D_Sound ( "00-N036E" );
  14504. }
  14505. }
  14506. }
  14507. }
  14508. };
  14509. DECLARE_SCRIPT(M01_First_AutoRifle_JDG, "")
  14510. {
  14511. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14512. {
  14513. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  14514. {
  14515. int pressEnterConv = Commands->Create_Conversation( "M01_Press_Enter_Conversation", 100, 1000, true);
  14516. Commands->Join_Conversation( NULL, pressEnterConv, false, false );
  14517. Commands->Start_Conversation( pressEnterConv, pressEnterConv );
  14518. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0520I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  14519. }
  14520. }
  14521. };
  14522. DECLARE_SCRIPT(M01_Announce_First_ObjectiveZone_JDG, "")//116380
  14523. {
  14524. void Created( GameObject * obj )
  14525. {
  14526. int pressF1Conv = Commands->Create_Conversation( "M01_Press_F1_Conversation", 100, 1000, true);
  14527. Commands->Join_Conversation( NULL, pressF1Conv, false, false );
  14528. Commands->Start_Conversation( pressF1Conv, pressF1Conv );
  14529. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0515I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  14530. GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(0,0,0));
  14531. Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1H_Hover_Troop.txt");
  14532. }
  14533. void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
  14534. {
  14535. if (enterer == STAR)
  14536. {
  14537. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  14538. if (pogController != NULL)
  14539. {
  14540. Commands->Send_Custom_Event( obj, pogController, 0, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 0 );
  14541. }
  14542. Commands->Destroy_Object ( obj );
  14543. }
  14544. }
  14545. };
  14546. DECLARE_SCRIPT(M01_SniperRifle_01_JDG, "")//on powerplant
  14547. {
  14548. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14549. {
  14550. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  14551. {
  14552. GameObject * c4TextController = Commands->Find_Object ( 117188 );
  14553. if (c4TextController != NULL)
  14554. {
  14555. Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
  14556. }
  14557. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-53.217f, -68.049f, 13.701f));
  14558. Commands->Attach_Script(sniperTarget01, "M01_SniperRifle_01_Target_JDG", "");
  14559. }
  14560. }
  14561. };
  14562. DECLARE_SCRIPT(M01_SniperRifle_01_Target_JDG, "")//on lighthouse
  14563. {
  14564. void Created( GameObject * obj )
  14565. {
  14566. Commands->Attach_Script(obj, "M00_Soldier_Powerup_Disable", "");
  14567. Commands->Enable_Hibernation( obj, false );
  14568. ActionParamsStruct params;
  14569. params.Set_Basic(this, 90, M01_WALKING_WAYPATH_01_JDG);
  14570. params.Set_Movement( Vector3(0,0,0), WALK, .25f );
  14571. params.WaypathID = 118434;
  14572. Commands->Action_Goto( obj, params );
  14573. }
  14574. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  14575. {
  14576. ActionParamsStruct params;
  14577. if (complete_reason == ACTION_COMPLETE_NORMAL)
  14578. {
  14579. if (action_id == M01_WALKING_WAYPATH_01_JDG )
  14580. {
  14581. Commands->Enable_Hibernation( obj, true );
  14582. Commands->Set_Innate_Is_Stationary ( obj, true );
  14583. }
  14584. }
  14585. }
  14586. };
  14587. DECLARE_SCRIPT(M01_SniperRifle_02_JDG, "")//in guard tower 01
  14588. {
  14589. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14590. {
  14591. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  14592. {
  14593. GameObject * c4TextController = Commands->Find_Object ( 117188 );
  14594. if (c4TextController != NULL)
  14595. {
  14596. Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
  14597. }
  14598. }
  14599. }
  14600. };
  14601. DECLARE_SCRIPT(M01_SniperRifle_02_AirdropZone_JDG, "")//in guard tower 01
  14602. {
  14603. void Entered( GameObject * obj, GameObject * enterer )
  14604. {
  14605. if (enterer == STAR)
  14606. {
  14607. Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
  14608. GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(-12.031f, -42.150f, -1.252f));
  14609. Commands->Set_Facing(chinook_obj3, -45.0f);
  14610. Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1I_GDIBasePrimaryNodChinook.txt");
  14611. Commands->Destroy_Object (obj );
  14612. }
  14613. }
  14614. };
  14615. DECLARE_SCRIPT(M01_C4_TutorialScript_JDG, "")//
  14616. {
  14617. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14618. {
  14619. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  14620. {
  14621. GameObject * c4TextController = Commands->Find_Object ( 117188 );
  14622. if (c4TextController != NULL)
  14623. {
  14624. Commands->Send_Custom_Event( obj, c4TextController, 1, 1, 0 );
  14625. }
  14626. }
  14627. }
  14628. };
  14629. DECLARE_SCRIPT(M01_Use_Ladder_Zone_JDG, "")
  14630. {
  14631. void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
  14632. {
  14633. if (enterer == STAR)
  14634. {
  14635. int pressF1Conv = Commands->Create_Conversation( "M01_Press_E_For_Ladders_Conversation", 100, 1000, true);
  14636. Commands->Join_Conversation( NULL, pressF1Conv, false, false );
  14637. Commands->Start_Conversation( pressF1Conv, pressF1Conv );
  14638. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0514I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  14639. }
  14640. }
  14641. };
  14642. DECLARE_SCRIPT(M01_AccessDenied_Zone_JDG, "")
  14643. {
  14644. void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
  14645. {
  14646. if (enterer == STAR)
  14647. {
  14648. int pressF1Conv = Commands->Create_Conversation( "M01_Lockdown_Conversation", 100, 1000, true);
  14649. Commands->Join_Conversation( NULL, pressF1Conv, false, false );
  14650. Commands->Start_Conversation( pressF1Conv, pressF1Conv );
  14651. //Commands->Set_HUD_Help_Text ( IDS_M00EVAG_DSGN0039I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  14652. }
  14653. }
  14654. };
  14655. DECLARE_SCRIPT(M01_GDIBase_FirstChinookMinigunnerGuy_JDG, "")
  14656. {
  14657. void Created( GameObject * obj )
  14658. {
  14659. Vector3 myPosition = Commands->Get_Position ( obj );
  14660. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  14661. }
  14662. };
  14663. DECLARE_SCRIPT(M01_QuickSave_Zone_JDG, "")
  14664. {
  14665. void Entered( GameObject * obj, GameObject * enterer )
  14666. {
  14667. if (enterer == STAR)
  14668. {
  14669. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0525I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  14670. Commands->Destroy_Object ( obj );
  14671. }
  14672. }
  14673. };
  14674. DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Chopper_JDG, "")
  14675. {
  14676. void Created( GameObject * obj )
  14677. {
  14678. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
  14679. Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
  14680. Commands->Set_Shield_Type ( obj, "Blamo" );
  14681. Commands->Enable_Hibernation( obj, false );
  14682. Commands->Disable_Physical_Collisions ( obj );
  14683. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  14684. GameObject * myController = Commands->Find_Object ( 106694 );
  14685. if (myController != NULL)
  14686. {
  14687. Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  14688. }
  14689. }
  14690. void Damaged( GameObject * obj, GameObject * damager, float amount )
  14691. {
  14692. float myMaxHealth = Commands->Get_Max_Health ( obj );
  14693. Commands->Set_Health ( obj, myMaxHealth );
  14694. }
  14695. void Animation_Complete(GameObject * obj, const char *anim)
  14696. {
  14697. if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
  14698. {
  14699. Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
  14700. Vector3 evacLocation = Commands->Get_Position ( obj );
  14701. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
  14702. GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
  14703. if (gdiBaseCommander != NULL)
  14704. {
  14705. Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  14706. }
  14707. GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
  14708. if (gdiBaseMinigunner != NULL)
  14709. {
  14710. Commands->Send_Custom_Event( obj, gdiBaseMinigunner, 0, M01_GOING_TO_EVAC_SPOT_JDG, 3 );
  14711. }
  14712. GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
  14713. if (gdiBaseGrenadier != NULL)
  14714. {
  14715. Commands->Send_Custom_Event( obj, gdiBaseGrenadier, 0, M01_GOING_TO_EVAC_SPOT_JDG, 6 );
  14716. }
  14717. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  14718. }
  14719. else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
  14720. {
  14721. Commands->Destroy_Object ( obj );
  14722. }
  14723. }
  14724. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14725. {
  14726. switch (param)
  14727. {
  14728. case M01_MODIFY_YOUR_ACTION_JDG:
  14729. {
  14730. Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
  14731. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
  14732. }
  14733. break;
  14734. case M01_GOTO_IDLE_JDG:
  14735. {
  14736. Commands->Enable_Collisions ( obj );
  14737. }
  14738. break;
  14739. case M01_DO_END_MISSION_CHECK_JDG:
  14740. {
  14741. GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
  14742. GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
  14743. GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
  14744. if ((gdiBaseCommander != NULL) || (gdiBaseMinigunner != NULL) || (gdiBaseGrenadier != NULL))
  14745. {
  14746. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );
  14747. }
  14748. else
  14749. {
  14750. GameObject * controller = Commands->Find_Object ( 106694 );
  14751. if (controller != NULL)
  14752. {
  14753. Commands->Send_Custom_Event ( obj, controller, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  14754. }
  14755. }
  14756. }
  14757. break;
  14758. }
  14759. }
  14760. };
  14761. DECLARE_SCRIPT(M01_GDIBaseCommander_EvacController_JDG, "")//106694
  14762. {
  14763. bool evacing;
  14764. int evac_waypath_id;
  14765. int evac_helicopter_id;
  14766. int evac_rope_id;
  14767. REGISTER_VARIABLES()
  14768. {
  14769. SAVE_VARIABLE(evacing, 1);
  14770. SAVE_VARIABLE(evac_waypath_id, 2);
  14771. SAVE_VARIABLE(evac_helicopter_id, 3);
  14772. SAVE_VARIABLE(evac_rope_id, 4);
  14773. }
  14774. void Created( GameObject * obj )
  14775. {
  14776. evacing = false;
  14777. Commands->Enable_Hibernation( obj, false );
  14778. }
  14779. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14780. {
  14781. ActionParamsStruct params;
  14782. if (type == 0)//
  14783. {
  14784. if (param == M01_START_ACTING_JDG)//gdi commander is done giving ion beacon--start evac scenario
  14785. {
  14786. GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
  14787. GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
  14788. GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
  14789. if (gdiBaseCommander != NULL)
  14790. {
  14791. Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  14792. }
  14793. if (gdiBaseMinigunner != NULL)
  14794. {
  14795. Commands->Send_Custom_Event( obj, gdiBaseMinigunner, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  14796. }
  14797. if (gdiBaseGrenadier != NULL)
  14798. {
  14799. Commands->Send_Custom_Event( obj, gdiBaseGrenadier, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
  14800. }
  14801. }
  14802. else if (param == M01_MODIFY_YOUR_ACTION_JDG && evacing == false)//one of your guys is at his wait spot--call in chopper
  14803. {
  14804. evacing = true;
  14805. Vector3 evacPosition = Commands->Get_Position ( obj );
  14806. GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  14807. Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_GDIBaseCommander_EvacAnim.txt");
  14808. }
  14809. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG && evacing == true)//everyone is on or dead--give take off orders
  14810. {
  14811. GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
  14812. GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
  14813. GameObject * evacRope = Commands->Find_Object ( evac_rope_id );
  14814. if (evacChopper != NULL)
  14815. {
  14816. Commands->Debug_Message ( "**********************sending custom to chopper to leave.....%d\n",evac_helicopter_id );
  14817. Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14818. }
  14819. if (evacWaypath != NULL)
  14820. {
  14821. Commands->Debug_Message ( "**********************sending custom to waypath to leave.....%d\n",evac_waypath_id );
  14822. Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14823. }
  14824. if (evacRope != NULL)
  14825. {
  14826. Commands->Debug_Message ( "**********************sending custom to rope to leave.....%d\n",evac_rope_id );
  14827. Commands->Send_Custom_Event ( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14828. }
  14829. }
  14830. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//chopper is sending you his ID
  14831. {
  14832. evac_helicopter_id = Commands->Get_ID ( sender );
  14833. Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
  14834. }
  14835. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//waypath is sending you his ID
  14836. {
  14837. evac_waypath_id = Commands->Get_ID ( sender );
  14838. Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
  14839. }
  14840. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//rope is sending you his ID
  14841. {
  14842. evac_rope_id = Commands->Get_ID ( sender );
  14843. Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
  14844. }
  14845. else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
  14846. {
  14847. Vector3 evacPosition = Commands->Get_Position ( obj );
  14848. GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
  14849. Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
  14850. Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
  14851. Commands->Innate_Disable(sender);
  14852. Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
  14853. if(troopbone)
  14854. {
  14855. Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
  14856. }
  14857. else
  14858. {
  14859. Commands->Debug_Message("troopbone not created yet");
  14860. }
  14861. Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
  14862. }
  14863. }
  14864. }
  14865. };
  14866. DECLARE_SCRIPT(M01_Base_Nod_Minigunner_JDG, "")//116384
  14867. {
  14868. void Created( GameObject * obj )
  14869. {
  14870. Commands->Set_Innate_Is_Stationary ( obj, true );
  14871. }
  14872. };
  14873. DECLARE_SCRIPT(M01_POW_Nod_Minigunner01_JDG, "")//116388
  14874. {
  14875. void Created( GameObject * obj )
  14876. {
  14877. Commands->Set_Innate_Is_Stationary ( obj, true );
  14878. }
  14879. void Killed( GameObject * obj, GameObject * killer )
  14880. {
  14881. GameObject * pow01 = Commands->Find_Object ( 116386 );
  14882. if (pow01 != NULL)
  14883. {
  14884. Commands->Send_Custom_Event( obj, pow01, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  14885. }
  14886. }
  14887. };
  14888. DECLARE_SCRIPT(M01_GDIBase_POWEncounter02_Controller_JDG, "")//M01_GDIBASE_POWSCENE02_MONITOR_JDG 103331
  14889. {
  14890. bool transportCalled;
  14891. bool powGuy01isDead;
  14892. bool powGuy02isDead;
  14893. bool objective_failed;
  14894. int evac_waypath_id;
  14895. int evac_helicopter_id;
  14896. int evac_rope_id;
  14897. REGISTER_VARIABLES()
  14898. {
  14899. SAVE_VARIABLE(transportCalled, 1);
  14900. SAVE_VARIABLE(powGuy01isDead, 2);
  14901. SAVE_VARIABLE(powGuy02isDead, 3);
  14902. SAVE_VARIABLE(objective_failed, 4);
  14903. SAVE_VARIABLE(evac_waypath_id, 5);
  14904. SAVE_VARIABLE(evac_helicopter_id, 6);
  14905. SAVE_VARIABLE(evac_rope_id, 7);
  14906. }
  14907. void Created( GameObject * obj )
  14908. {
  14909. powGuy01isDead = false;
  14910. powGuy02isDead = false;
  14911. objective_failed = false;
  14912. transportCalled = false;
  14913. }
  14914. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  14915. {
  14916. if (param == M01_IVE_BEEN_KILLED_JDG)//one of the gt1 guys has been killed..see who it is
  14917. {
  14918. GameObject * pow01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
  14919. GameObject * pow02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
  14920. if (sender == pow01)
  14921. {
  14922. powGuy01isDead = true;
  14923. }
  14924. if (sender == pow02)
  14925. {
  14926. powGuy02isDead = true;
  14927. }
  14928. if (powGuy01isDead == true && powGuy02isDead == true)
  14929. {
  14930. Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  14931. objective_failed = true;
  14932. }
  14933. }
  14934. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
  14935. {
  14936. evac_helicopter_id = Commands->Get_ID ( sender );
  14937. //Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
  14938. }
  14939. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
  14940. {
  14941. evac_waypath_id = Commands->Get_ID ( sender );
  14942. //Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
  14943. }
  14944. else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
  14945. {
  14946. evac_rope_id = Commands->Get_ID ( sender );
  14947. //Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
  14948. }
  14949. else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
  14950. {
  14951. Vector3 evacPosition = Commands->Get_Position ( obj );
  14952. GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
  14953. Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
  14954. Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
  14955. Commands->Innate_Disable(sender);
  14956. Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
  14957. if(troopbone)
  14958. {
  14959. Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
  14960. }
  14961. else
  14962. {
  14963. Commands->Debug_Message("troopbone not created yet");
  14964. }
  14965. Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
  14966. }
  14967. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//a gdi guy is waiting for evac--call in a helicopter
  14968. {
  14969. if (transportCalled == false)
  14970. {
  14971. transportCalled = true;
  14972. Vector3 evacPosition = Commands->Get_Position ( obj );
  14973. GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
  14974. Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_GDIBasePow_EvacAnim.txt");
  14975. }
  14976. }
  14977. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//chinook is ready to go--give clearance
  14978. {
  14979. GameObject *evacWaypath = Commands->Find_Object ( evac_waypath_id );
  14980. if (evacWaypath != NULL)
  14981. {
  14982. Commands->Send_Custom_Event( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14983. }
  14984. GameObject *evacChopper = Commands->Find_Object ( evac_helicopter_id );
  14985. if (evacChopper != NULL)
  14986. {
  14987. Commands->Send_Custom_Event( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14988. }
  14989. GameObject *evacRope = Commands->Find_Object ( evac_rope_id );
  14990. if (evacChopper != NULL)
  14991. {
  14992. Commands->Send_Custom_Event( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  14993. }
  14994. if (objective_failed != true)
  14995. {
  14996. Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  14997. }
  14998. }
  14999. }
  15000. };
  15001. DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Chopper_JDG, "")
  15002. {
  15003. void Created( GameObject * obj )
  15004. {
  15005. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
  15006. Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
  15007. Commands->Set_Shield_Type ( obj, "Blamo" );
  15008. Commands->Enable_Hibernation( obj, false );
  15009. Commands->Disable_Physical_Collisions ( obj );
  15010. Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
  15011. GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  15012. if (myController != NULL)
  15013. {
  15014. Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  15015. }
  15016. }
  15017. void Damaged( GameObject * obj, GameObject * damager, float amount )
  15018. {
  15019. float myMaxHealth = Commands->Get_Max_Health ( obj );
  15020. Commands->Set_Health ( obj, myMaxHealth );
  15021. }
  15022. void Animation_Complete(GameObject * obj, const char *anim)
  15023. {
  15024. if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
  15025. {
  15026. Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
  15027. Vector3 evacLocation = Commands->Get_Position ( obj );
  15028. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
  15029. GameObject * gdiGuy01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
  15030. GameObject * gdiGuy02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
  15031. if (gdiGuy01 != NULL)
  15032. {
  15033. Commands->Send_Custom_Event ( obj, gdiGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 3 );
  15034. }
  15035. if (gdiGuy02 != NULL)
  15036. {
  15037. Commands->Send_Custom_Event ( obj, gdiGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
  15038. }
  15039. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  15040. }
  15041. else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
  15042. {
  15043. Commands->Destroy_Object ( obj );
  15044. }
  15045. }
  15046. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15047. {
  15048. switch (param)
  15049. {
  15050. case M01_MODIFY_YOUR_ACTION_JDG:
  15051. {
  15052. Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
  15053. Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
  15054. }
  15055. break;
  15056. case M01_GOTO_IDLE_JDG:
  15057. {
  15058. Commands->Enable_Collisions ( obj );
  15059. }
  15060. break;
  15061. case M01_DO_END_MISSION_CHECK_JDG:
  15062. {
  15063. GameObject * gdiGuy01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
  15064. GameObject * gdiGuy02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
  15065. if ((gdiGuy01 != NULL)||(gdiGuy02 != NULL))
  15066. {
  15067. Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
  15068. }
  15069. else
  15070. {
  15071. GameObject * controller = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  15072. if (controller != NULL)
  15073. {
  15074. Commands->Send_Custom_Event ( obj, controller, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
  15075. }
  15076. }
  15077. }
  15078. break;
  15079. }
  15080. }
  15081. };
  15082. DECLARE_SCRIPT(M01_ConDropZone_JDG, "")
  15083. {
  15084. void Entered( GameObject * obj, GameObject * enterer )
  15085. {
  15086. if (enterer == STAR)
  15087. {
  15088. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(54.835f, -3.011f, 13.105f));
  15089. Commands->Set_Facing ( controller1, 45 );
  15090. Commands->Attach_Script(controller1, "Test_Cinematic", "X01_ConYardDrop.txt");
  15091. Commands->Destroy_Object ( obj );
  15092. }
  15093. }
  15094. };
  15095. DECLARE_SCRIPT(M01_ConYard_Dropoff_Dude_JDG, "")
  15096. {
  15097. void Animation_Complete(GameObject * obj, const char *anim)
  15098. {
  15099. if (stricmp(anim, "S_A_Human.H_A_TroopDrop") == 0)
  15100. {
  15101. Commands->Destroy_Object ( obj );
  15102. }
  15103. }
  15104. };
  15105. DECLARE_SCRIPT(M01_C130_Dropoff_Dude_JDG, "")
  15106. {
  15107. void Animation_Complete(GameObject * obj, const char *anim)
  15108. {
  15109. if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_1") == 0)
  15110. {
  15111. Commands->Destroy_Object ( obj );
  15112. }
  15113. else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_2") == 0)
  15114. {
  15115. Commands->Destroy_Object ( obj );
  15116. }
  15117. else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_3") == 0)
  15118. {
  15119. Commands->Destroy_Object ( obj );
  15120. }
  15121. }
  15122. };
  15123. DECLARE_SCRIPT(M01_Base_GDI_Fodder_JDG, "")
  15124. {
  15125. void Created( GameObject * obj )
  15126. {
  15127. Vector3 myTarget (72.223f, -24.751f, -0.296f);
  15128. ActionParamsStruct params;
  15129. Commands->Set_Innate_Is_Stationary ( obj, true );
  15130. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  15131. params.Set_Attack( myTarget, 1000, 0, true );
  15132. params.AttackCrouched = true;
  15133. params.AttackCheckBlocked = false;
  15134. Commands->Action_Attack (obj, params);
  15135. float delayTimer = Commands->Get_Random ( 10, 15 );
  15136. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );//kill yourself
  15137. }
  15138. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15139. {
  15140. ActionParamsStruct params;
  15141. if (type == 0)
  15142. {
  15143. if (param == M01_MODIFY_YOUR_ACTION_JDG)//kill yourself
  15144. {
  15145. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  15146. }
  15147. }
  15148. }
  15149. };
  15150. DECLARE_SCRIPT(M01_Base_StartZone_JDG, "")//119628
  15151. {
  15152. void Entered( GameObject * obj, GameObject * enterer )
  15153. {
  15154. if (enterer == STAR)
  15155. {
  15156. GameObject * minigunner = Commands->Find_Object ( 116382 );
  15157. GameObject * grenadier = Commands->Find_Object ( 116383 );
  15158. if (minigunner != NULL)
  15159. {
  15160. Commands->Send_Custom_Event( obj, minigunner, 0, M01_START_ATTACKING_01_JDG, 0 );//tell minigunner to greet havoc
  15161. }
  15162. if (grenadier != NULL)
  15163. {
  15164. Commands->Send_Custom_Event( obj, grenadier, 0, M01_START_ATTACKING_01_JDG, 0 );//tell grenadier to greet havoc
  15165. }
  15166. Commands->Destroy_Object ( obj );
  15167. }
  15168. }
  15169. };
  15170. DECLARE_SCRIPT(M01_Nod_Truck_JDG, "")
  15171. {
  15172. void Created( GameObject * obj )
  15173. {
  15174. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NEUTRAL );
  15175. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NOD );
  15176. }
  15177. };
  15178. DECLARE_SCRIPT(M01_C4_Tutorial_Zone_JDG, "")
  15179. {
  15180. void Entered( GameObject * obj, GameObject * enterer )
  15181. {
  15182. if (enterer == STAR)
  15183. {
  15184. GameObject * c4TextController = Commands->Find_Object ( 117188 );
  15185. if (c4TextController != NULL)
  15186. {
  15187. Commands->Send_Custom_Event( obj, c4TextController, 1, 1, 0 );
  15188. }
  15189. Commands->Destroy_Object ( obj );
  15190. }
  15191. }
  15192. };
  15193. DECLARE_SCRIPT(M01_Mainframe_Tutorial_Zone_JDG, "")
  15194. {
  15195. void Entered( GameObject * obj, GameObject * enterer )
  15196. {
  15197. if (enterer == STAR)
  15198. {
  15199. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0527I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  15200. Commands->Destroy_Object ( obj );
  15201. }
  15202. }
  15203. };
  15204. DECLARE_SCRIPT(M01_GateSwitch_Tutorial_Zone_JDG, "")//120844
  15205. {
  15206. bool command_clearance;
  15207. REGISTER_VARIABLES()
  15208. {
  15209. SAVE_VARIABLE(command_clearance, 1);
  15210. }
  15211. void Created( GameObject * obj )
  15212. {
  15213. command_clearance = false;
  15214. }
  15215. void Entered( GameObject * obj, GameObject * enterer )
  15216. {
  15217. if (enterer == STAR && command_clearance == true)
  15218. {
  15219. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0528I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  15220. Commands->Destroy_Object ( obj );
  15221. }
  15222. }
  15223. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15224. {
  15225. if (type == 0)
  15226. {
  15227. if (param == M01_START_ACTING_JDG)
  15228. {
  15229. command_clearance = true;
  15230. }
  15231. }
  15232. }
  15233. };
  15234. DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_Trigger_Zone02_JDG, "")//103343
  15235. {
  15236. bool entered;
  15237. REGISTER_VARIABLES()
  15238. {
  15239. SAVE_VARIABLE(entered, 1);
  15240. }
  15241. void Created( GameObject * obj )
  15242. {
  15243. entered = false;
  15244. }
  15245. void Entered( GameObject * obj, GameObject * enterer )
  15246. {
  15247. if (enterer == STAR && entered == false)
  15248. {
  15249. entered = true;
  15250. GameObject * firstFieldCommander = Commands->Find_Object (M01_BARNAREA_NOD_COMMANDER_JDG);
  15251. if (firstFieldCommander != NULL)
  15252. {
  15253. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ), 0, M01_START_ACTING_JDG, 0 );
  15254. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG, 5 );
  15255. }
  15256. }
  15257. }
  15258. };
  15259. DECLARE_SCRIPT(M01_TurretBeach_Turret_01_Script_JDG, "")//M01_TURRETBEACH_TURRET_01_ID 101434
  15260. {
  15261. int engineer_id;
  15262. int fodderHovercraft_ID;
  15263. REGISTER_VARIABLES()
  15264. {
  15265. SAVE_VARIABLE(engineer_id, 1);
  15266. SAVE_VARIABLE(fodderHovercraft_ID, 2);
  15267. }
  15268. void Created( GameObject * obj )
  15269. {
  15270. engineer_id = M01_TURRETBEACH_ENGINEER_ID;
  15271. }
  15272. void Killed( GameObject * obj, GameObject * killer ) //M01_IVE_BEEN_KILLED_JDG
  15273. {
  15274. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  15275. if (pogController != NULL)
  15276. {
  15277. Commands->Send_Custom_Event( obj, pogController, M01_CHANGE_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, 0 );
  15278. }
  15279. GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
  15280. if (turretEngineer != NULL)
  15281. {
  15282. Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_TURRET_HAS_BEEN_DESTROYED_JDG, 0 );
  15283. }
  15284. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_HAS_BEEN_DESTROYED_JDG, 5 );
  15285. Vector3 myPositon = Commands->Get_Position ( obj );
  15286. float myFacing = Commands->Get_Facing ( obj );
  15287. GameObject * destroyedTurret = Commands->Create_Object ( "Nod_Turret_Destroyed", myPositon);
  15288. Commands->Set_Facing ( destroyedTurret, myFacing );
  15289. }
  15290. void Damaged( GameObject * obj, GameObject * damager, float amount )
  15291. {
  15292. if (obj)
  15293. {
  15294. GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
  15295. if (damager != NULL && damager == turretEngineer)
  15296. {
  15297. float myMaxHealth = Commands->Get_Max_Health ( obj );
  15298. Commands->Set_Health ( obj, myMaxHealth );
  15299. }
  15300. else if (turretEngineer != NULL)
  15301. {
  15302. Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
  15303. }
  15304. }
  15305. }
  15306. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15307. {
  15308. if (type == 0)
  15309. {
  15310. if (param == M01_START_ACTING_JDG)
  15311. {
  15312. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  15313. if (gunboat != NULL)
  15314. {
  15315. ActionParamsStruct params;
  15316. params.Set_Basic(this, 100, M01_START_ACTING_JDG);
  15317. params.Set_Attack( gunboat, 3000, 3, true );
  15318. params.AttackCheckBlocked = false;
  15319. Commands->Action_Attack ( obj, params );
  15320. }
  15321. }
  15322. else if (param == M01_BUSY_TRY_AGAIN_JDG)//engineer is busy--call back in 2 seconds
  15323. {
  15324. GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
  15325. if (turretEngineer != NULL)
  15326. {
  15327. Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 1 );
  15328. }
  15329. }
  15330. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//new engineer is actually sending id
  15331. {
  15332. engineer_id = Commands->Get_ID ( sender );
  15333. }
  15334. }
  15335. else if (type == M01_FODDER_HOVERCRAFT_IS_HERE)
  15336. {
  15337. fodderHovercraft_ID = param;
  15338. GameObject * fodderHovercraft = Commands->Find_Object ( fodderHovercraft_ID );
  15339. if (fodderHovercraft != NULL)
  15340. {
  15341. Commands->Action_Reset ( obj, 100 );
  15342. ActionParamsStruct params;
  15343. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  15344. params.Set_Attack( fodderHovercraft, 3000, 0, true );
  15345. params.AttackCheckBlocked = false;
  15346. Commands->Action_Attack ( obj, params );
  15347. }
  15348. }
  15349. }
  15350. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  15351. {
  15352. ActionParamsStruct params;
  15353. if (action_id == M01_START_ATTACKING_01_JDG)//hovercraft is dead...go back to attacking gunboat
  15354. {
  15355. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  15356. if (gunboat != NULL)
  15357. {
  15358. ActionParamsStruct params;
  15359. params.Set_Basic(this, 100, M01_START_ACTING_JDG);
  15360. params.Set_Attack( gunboat, 3000, 3, true );
  15361. params.AttackCheckBlocked = false;
  15362. Commands->Action_Attack ( obj, params );
  15363. }
  15364. }
  15365. }
  15366. };
  15367. DECLARE_SCRIPT(M01_GunboatAction_Controller_JDG, "")//M01_TURRETBEACH_CONTROLLER_ID
  15368. {
  15369. bool active;
  15370. int engineer_id;
  15371. REGISTER_VARIABLES()
  15372. {
  15373. SAVE_VARIABLE(active, 1);
  15374. SAVE_VARIABLE(engineer_id, 2);
  15375. }
  15376. void Created( GameObject * obj )
  15377. {
  15378. active = false;
  15379. engineer_id = M01_TURRETBEACH_ENGINEER_ID;
  15380. }
  15381. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15382. {
  15383. if (type == 0)
  15384. {
  15385. if (param == M01_START_ACTING_JDG)
  15386. {
  15387. if (active == false)
  15388. {
  15389. active = true;
  15390. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  15391. GameObject * engineer = Commands->Find_Object ( engineer_id );
  15392. //GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  15393. if (gunboat != NULL)
  15394. {
  15395. Commands->Send_Custom_Event ( obj, gunboat, 0, M01_START_ACTING_JDG, 0 );
  15396. }
  15397. if (engineer != NULL)
  15398. {
  15399. Commands->Send_Custom_Event ( obj, engineer, 0, M01_START_ACTING_JDG, 0 );
  15400. }
  15401. }
  15402. }
  15403. else if (param == M01_GOTO_IDLE_JDG)//M01_CHOPPER_IS_SENDING_ID_JDG
  15404. {
  15405. if (active == true)
  15406. {
  15407. active = false;
  15408. GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
  15409. GameObject * engineer = Commands->Find_Object ( engineer_id );
  15410. if (gunboat != NULL)
  15411. {
  15412. Commands->Send_Custom_Event ( obj, gunboat, 0, M01_GOTO_IDLE_JDG, 0 );
  15413. }
  15414. if (engineer != NULL)
  15415. {
  15416. Commands->Send_Custom_Event ( obj, engineer, 0, M01_GOTO_IDLE_JDG, 0 );
  15417. }
  15418. }
  15419. }
  15420. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//new engineer is actually sending ID
  15421. {
  15422. engineer_id = Commands->Get_ID ( sender );
  15423. }
  15424. }
  15425. }
  15426. };
  15427. DECLARE_SCRIPT(M01_Initial_Gunboat_Script_JDG, "")//M01_TURRETBEACH_GUNBOAT_ID 101477
  15428. {
  15429. bool firstHealthWarningPlayed;
  15430. bool secondHealthWarningPlayed;
  15431. Vector3 myPosition;
  15432. float myFacing;
  15433. REGISTER_VARIABLES()
  15434. {
  15435. SAVE_VARIABLE(firstHealthWarningPlayed, 1);
  15436. SAVE_VARIABLE(secondHealthWarningPlayed, 2);
  15437. SAVE_VARIABLE(myPosition, 3);
  15438. SAVE_VARIABLE(myFacing, 4);
  15439. }
  15440. void Created( GameObject * obj )
  15441. {
  15442. firstHealthWarningPlayed = false;
  15443. secondHealthWarningPlayed = false;
  15444. myPosition = Commands->Get_Position ( obj );
  15445. myFacing = Commands->Get_Facing ( obj );
  15446. ActionParamsStruct params;
  15447. params.Set_Basic(this, 90, M01_WALKING_WAYPATH_02_JDG);
  15448. //params.Set_Movement( Vector3(0,0,0), .1f, 3 );
  15449. //params.WaypathID = 101497;
  15450. params.AttackActive = false;
  15451. params.AttackCheckBlocked = false;
  15452. Commands->Action_Attack (obj, params);
  15453. }
  15454. void Killed( GameObject * obj, GameObject * killer ) //
  15455. {
  15456. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  15457. if (missionController != NULL)
  15458. {
  15459. Commands->Send_Custom_Event( obj, missionController, 0, M01_END_TURRETS_OBJECTIVE_FAIL_JDG, 0 );
  15460. }
  15461. GameObject * sinkingGunboat = Commands->Create_Object ( "M01_GDI_Gunboat", myPosition );
  15462. Commands->Set_Facing ( sinkingGunboat, myFacing );
  15463. Commands->Attach_Script(sinkingGunboat, "M01_Sinking_Gunboat_JDG", "");
  15464. }
  15465. void Damaged( GameObject * obj, GameObject * damager, float amount )
  15466. {
  15467. if (obj)
  15468. {
  15469. float myCurrentHealth = Commands->Get_Health (obj);
  15470. float myMaxHealth = Commands->Get_Max_Health (obj);
  15471. float healthPercentage = (myCurrentHealth/myMaxHealth) * 100;
  15472. if (myCurrentHealth <= 10)
  15473. {
  15474. Commands->Set_Health ( obj, 10 );
  15475. }
  15476. if (healthPercentage <= 50)
  15477. {
  15478. if (secondHealthWarningPlayed == false)
  15479. {
  15480. secondHealthWarningPlayed = true;
  15481. int gunboatHealthWarning02 = Commands->Create_Conversation( "M01_Gunboat_HealthWarning_02", 100, 1000, false);
  15482. Commands->Join_Conversation( NULL, gunboatHealthWarning02, false, false );
  15483. Commands->Join_Conversation( NULL, gunboatHealthWarning02, false, false );
  15484. Commands->Join_Conversation( STAR, gunboatHealthWarning02, false, false );
  15485. Commands->Start_Conversation( gunboatHealthWarning02, gunboatHealthWarning02 );
  15486. }
  15487. }
  15488. else if (healthPercentage <= 75)
  15489. {
  15490. if (firstHealthWarningPlayed == false)
  15491. {
  15492. firstHealthWarningPlayed = true;
  15493. int gunboatHealthWarning01 = Commands->Create_Conversation( "M01_Gunboat_HealthWarning_01", 100, 1000, false);
  15494. Commands->Join_Conversation( NULL, gunboatHealthWarning01, false, false );
  15495. Commands->Join_Conversation( NULL, gunboatHealthWarning01, false, false );
  15496. Commands->Start_Conversation( gunboatHealthWarning01, gunboatHealthWarning01 );
  15497. }
  15498. }
  15499. }
  15500. }
  15501. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15502. {
  15503. ActionParamsStruct params;
  15504. if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
  15505. {
  15506. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  15507. //params.Set_Movement( Vector3(0,0,0), .2f, 6 );
  15508. //params.WaypathID = 101497;
  15509. float pickTarget = Commands->Get_Random ( 0.5f, 2.5f );
  15510. if (pickTarget >= 0.5f && pickTarget < 1.5f)
  15511. {
  15512. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  15513. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  15514. if (turret01 != NULL)
  15515. {
  15516. Vector3 myTarget = Commands->Get_Position ( turret01 );
  15517. myTarget.Z += 2;
  15518. params.Set_Attack( myTarget, 2000, 0, true );
  15519. }
  15520. else if (turret02 != NULL)
  15521. {
  15522. Vector3 myTarget = Commands->Get_Position ( turret02 );
  15523. myTarget.Z += 2;
  15524. params.Set_Attack( myTarget, 2000, 0, true );
  15525. }
  15526. }
  15527. else
  15528. {
  15529. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  15530. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  15531. if (turret02 != NULL)
  15532. {
  15533. Vector3 myTarget = Commands->Get_Position ( turret02 );
  15534. myTarget.Z += 2;
  15535. params.Set_Attack( myTarget, 2000, 0, true );
  15536. }
  15537. else if (turret01 != NULL)
  15538. {
  15539. Vector3 myTarget = Commands->Get_Position ( turret01 );
  15540. myTarget.Z += 2;
  15541. params.Set_Attack( myTarget, 2000, 0, true );
  15542. }
  15543. }
  15544. params.AttackActive = true;
  15545. params.AttackCheckBlocked = false;
  15546. Commands->Modify_Action (obj, M01_WALKING_WAYPATH_02_JDG, params);
  15547. float delayTimer = Commands->Get_Random ( 4, 6 );
  15548. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
  15549. }
  15550. else if (param == M01_START_ACTING_JDG)
  15551. {
  15552. Commands->Debug_Message ( "***************************gunboat custom received--start acting\n" );
  15553. Commands->Enable_Hibernation( obj, false );
  15554. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  15555. //params.Set_Movement( Vector3(0,0,0), .2f, 6 );
  15556. //params.WaypathID = 101497;
  15557. params.AttackActive = false;
  15558. Commands->Modify_Action (obj, M01_WALKING_WAYPATH_02_JDG, params);
  15559. float delayTimer = Commands->Get_Random ( 0, 2 );
  15560. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
  15561. }
  15562. else if (param == M01_GOTO_IDLE_JDG)
  15563. {
  15564. Commands->Debug_Message ( "***************************gunboat custom received--STOP acting\n" );
  15565. Commands->Enable_Hibernation( obj, true );
  15566. }
  15567. else if (param == M01_END_TURRETS_OBJECTIVE_PASS_JDG)
  15568. {
  15569. Commands->Action_Reset ( obj, 100 );
  15570. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  15571. params.Set_Movement( Vector3(0,0,0), .7f, 10 );
  15572. params.WaypathID = 103454;
  15573. Commands->Action_Goto( obj, params );
  15574. GameObject * tankZone = Commands->Find_Object ( 102500 );
  15575. if (tankZone != NULL)
  15576. {
  15577. Commands->Send_Custom_Event( obj, tankZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  15578. }
  15579. }
  15580. }
  15581. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  15582. {
  15583. ActionParamsStruct params;
  15584. if (action_id == M01_WALKING_WAYPATH_03_JDG)//gunboat is at end of final waypath--delete it
  15585. {
  15586. Commands->Destroy_Object ( obj );
  15587. }
  15588. }
  15589. };
  15590. DECLARE_SCRIPT(M01_GDIBase_BaseCommander_JDG, "")//106050 Capt Duncan
  15591. {
  15592. int gdi04conv01;
  15593. bool gaveIonBeacon;
  15594. int gdi04conv02;
  15595. bool powsRescued;
  15596. REGISTER_VARIABLES()
  15597. {
  15598. SAVE_VARIABLE(gdi04conv01, 1);
  15599. SAVE_VARIABLE(gaveIonBeacon, 2);
  15600. SAVE_VARIABLE(gdi04conv02, 3);
  15601. SAVE_VARIABLE(powsRescued, 4);
  15602. }
  15603. void Created( GameObject * obj )
  15604. {
  15605. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
  15606. powsRescued = false;
  15607. gaveIonBeacon = false;
  15608. Commands->Set_Innate_Is_Stationary ( obj, true );
  15609. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NEUTRAL );
  15610. }
  15611. void Killed( GameObject * obj, GameObject * killer )
  15612. {
  15613. if (gaveIonBeacon == false)
  15614. {
  15615. Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  15616. }
  15617. GameObject * shackzone = Commands->Find_Object ( 115985 );
  15618. if (shackzone != NULL)
  15619. {
  15620. Commands->Send_Custom_Event( obj, shackzone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  15621. }
  15622. GameObject * pow01 = Commands->Find_Object ( 116386 );
  15623. if (pow01 != NULL)
  15624. {
  15625. Commands->Apply_Damage( pow01, 10000, "Steel", NULL );
  15626. }
  15627. GameObject * pow02 = Commands->Find_Object ( 116385 );
  15628. if (pow02 != NULL)
  15629. {
  15630. Commands->Apply_Damage( pow02, 10000, "Steel", NULL );
  15631. }
  15632. GameObject * baseMinigunner = Commands->Find_Object ( 116382 );
  15633. if (baseMinigunner != NULL)
  15634. {
  15635. Commands->Send_Custom_Event( obj, baseMinigunner, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  15636. }
  15637. GameObject * baseGrenadier = Commands->Find_Object ( 116383 );
  15638. if (baseGrenadier != NULL)
  15639. {
  15640. Commands->Send_Custom_Event( obj, baseGrenadier, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  15641. }
  15642. Vector3 nodGuy01_spot (28.566f, 29.790f, 1.792f);
  15643. Vector3 nodGuy02_spot (65.899f, 46.347f, -0.294f);
  15644. Vector3 nodGuy03_spot (24.776f, 44.863f, 0.708f);
  15645. GameObject * nodGuy01 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy01_spot );
  15646. GameObject * nodGuy02 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy02_spot );
  15647. GameObject * nodGuy03 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy03_spot );
  15648. Commands->Set_Innate_Soldier_Home_Location ( nodGuy01, nodGuy01_spot, 10 );
  15649. Commands->Set_Innate_Soldier_Home_Location ( nodGuy02, nodGuy02_spot, 10 );
  15650. Commands->Set_Innate_Soldier_Home_Location ( nodGuy03, nodGuy03_spot, 10 );
  15651. }
  15652. void Damaged( GameObject * obj, GameObject * damager, float amount )
  15653. {
  15654. float myHealth = Commands->Get_Health ( obj );
  15655. if (myHealth <= 10)
  15656. {
  15657. Commands->Set_Health ( obj, 10 );
  15658. }
  15659. }
  15660. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15661. {
  15662. ActionParamsStruct params;
  15663. if (type == 0)
  15664. {
  15665. if (param == M01_START_ACTING_JDG)
  15666. {
  15667. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
  15668. Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );//
  15669. }
  15670. else if (param == M01_GDI_BASE_POWS_RESCUED_JDG)
  15671. {
  15672. powsRescued = true;
  15673. }
  15674. else if (param == M01_DO_END_MISSION_CHECK_JDG)
  15675. {
  15676. GameObject * nodGuy01 = Commands->Find_Object ( 101399 );
  15677. GameObject * nodGuy02 = Commands->Find_Object ( 103335 );
  15678. GameObject * nodGuy03 = Commands->Find_Object ( 103340 );
  15679. GameObject * nodGuy04 = Commands->Find_Object ( 102185 );
  15680. if ( (nodGuy01 == NULL) && (nodGuy02 == NULL) && (nodGuy03 == NULL) && (nodGuy04 == NULL) )
  15681. {
  15682. GameObject * letsgozone = Commands->Find_Object ( 105615 );
  15683. if (letsgozone != NULL)
  15684. {
  15685. Commands->Destroy_Object ( letsgozone );
  15686. }
  15687. GameObject * shackzone = Commands->Find_Object ( 115985 );
  15688. if (shackzone != NULL)
  15689. {
  15690. Commands->Send_Custom_Event( obj, shackzone, 0, M01_START_ACTING_JDG, 0 );
  15691. }
  15692. }
  15693. else
  15694. {
  15695. Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 0.25f );
  15696. }
  15697. }
  15698. else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)//
  15699. {
  15700. Commands->Enable_Hibernation( obj, false );
  15701. Commands->Action_Reset ( obj, 100 );
  15702. Vector3 myHomeSpot (55.9f, 40.3f, -0.2f);
  15703. params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
  15704. params.Set_Movement(myHomeSpot, RUN, 1);
  15705. Commands->Action_Goto(obj, params);
  15706. }
  15707. else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
  15708. {
  15709. Commands->Action_Reset ( obj, 100 );
  15710. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  15711. if (myEvacController != NULL)
  15712. {
  15713. Commands->Set_Innate_Is_Stationary ( obj, false );
  15714. Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
  15715. params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
  15716. params.Set_Movement(myHomeSpot, RUN, 1);
  15717. Commands->Action_Goto(obj, params);
  15718. }
  15719. }
  15720. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//havoc has saved you--start conversation
  15721. {
  15722. gdi04conv01 = Commands->Create_Conversation( "M01_GDI04_Conversation_01", 100, 1000, false);
  15723. Commands->Join_Conversation( obj, gdi04conv01, false, true, true );
  15724. Commands->Join_Conversation( STAR, gdi04conv01, false, false, false );
  15725. Commands->Start_Conversation( gdi04conv01, gdi04conv01 );
  15726. Commands->Monitor_Conversation( obj, gdi04conv01 );
  15727. }
  15728. }
  15729. }
  15730. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  15731. {
  15732. ActionParamsStruct params;
  15733. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  15734. {
  15735. if (action_id == gdi04conv01)
  15736. {
  15737. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  15738. params.Set_Animation ("H_A_J12C", false);
  15739. Commands->Action_Play_Animation (obj, params);//
  15740. Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  15741. /*GameObject * POW01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
  15742. if (POW01 != NULL)
  15743. {
  15744. Commands->Send_Custom_Event( obj, POW01, 0, M01_CAPT_DUNCAN_HAS_BEEN_FOUND_JDG, 0 );
  15745. }
  15746. GameObject * POW02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
  15747. if (POW02 != NULL)
  15748. {
  15749. Commands->Send_Custom_Event( obj, POW02, 0, M01_CAPT_DUNCAN_HAS_BEEN_FOUND_JDG, 0 );
  15750. }*/
  15751. }
  15752. if (action_id == gdi04conv02)
  15753. {
  15754. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  15755. if (myEvacController != NULL)
  15756. {
  15757. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_START_ACTING_JDG, 0 );
  15758. }
  15759. }
  15760. }
  15761. else if (complete_reason == ACTION_COMPLETE_NORMAL)
  15762. {
  15763. if (action_id == M01_WALKING_WAYPATH_02_JDG)
  15764. {
  15765. }
  15766. else if (action_id == M01_DOING_ANIMATION_01_JDG)
  15767. {
  15768. Vector3 myPostion (114.848f, 95.401f, 8.923f);
  15769. Commands->Create_Object ( "POW_IonCannonBeacon_Player", myPostion );
  15770. gaveIonBeacon = true;
  15771. gdi04conv02 = Commands->Create_Conversation( "M01_GDI04_Conversation_02", 100, 1000, false);
  15772. Commands->Join_Conversation( obj, gdi04conv02, false, true, true );
  15773. Commands->Join_Conversation( STAR, gdi04conv02, false, false, false );
  15774. Commands->Start_Conversation( gdi04conv02, gdi04conv02 );
  15775. Commands->Monitor_Conversation( obj, gdi04conv02 );
  15776. }
  15777. else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
  15778. {
  15779. Commands->Set_Innate_Is_Stationary ( obj, true );
  15780. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  15781. if (myEvacController != NULL)//tell controller to call in a chopper
  15782. {
  15783. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  15784. }
  15785. }
  15786. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
  15787. {
  15788. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  15789. powerupSpawnLocation.Z += 0.75f;
  15790. char *powerups[2] =
  15791. {//this is a list of potential powerups to be dropped by sniper target guys
  15792. "POW_Health_100",
  15793. "POW_Armor_100",
  15794. };
  15795. int random = Commands->Get_Random_Int(0, 2);
  15796. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  15797. Commands->Give_Points( STAR, 2000, false );
  15798. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  15799. if (myEvacController != NULL)//tell controller to spawn a rope
  15800. {
  15801. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  15802. }
  15803. }
  15804. }
  15805. }
  15806. void Animation_Complete(GameObject * obj, const char *anim)
  15807. {
  15808. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  15809. {
  15810. if (gaveIonBeacon == false)
  15811. {
  15812. Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
  15813. }
  15814. Commands->Destroy_Object ( obj );
  15815. }
  15816. }
  15817. };
  15818. DECLARE_SCRIPT(M01_Base_GDI_Grenadier_JDG, "")//116383
  15819. {
  15820. float currentHealth;
  15821. bool invincible;
  15822. bool ducanRescued;
  15823. bool headingDownBackPath;
  15824. bool still_in_GDI_Base;
  15825. bool damagedByNod;
  15826. REGISTER_VARIABLES()
  15827. {
  15828. SAVE_VARIABLE(currentHealth, 1);
  15829. SAVE_VARIABLE(invincible, 2);
  15830. SAVE_VARIABLE(ducanRescued, 3);
  15831. SAVE_VARIABLE(headingDownBackPath, 4);
  15832. SAVE_VARIABLE(still_in_GDI_Base, 5);
  15833. SAVE_VARIABLE(damagedByNod, 6);
  15834. }
  15835. void Created( GameObject * obj ) //this guy starts in the guard tower firing over at the conyard
  15836. {
  15837. damagedByNod = false;
  15838. still_in_GDI_Base = true;
  15839. invincible = true;
  15840. ducanRescued = false;
  15841. currentHealth = Commands->Get_Health ( obj );
  15842. Commands->Set_Innate_Is_Stationary ( obj, true );
  15843. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 10 );//in 2 seconds run to a new position
  15844. }
  15845. void Damaged( GameObject * obj, GameObject * damager, float amount )
  15846. {
  15847. GameObject * nodGuy01 = Commands->Find_Object ( 116388 );
  15848. GameObject * nodGuy02 = Commands->Find_Object ( 116387 );
  15849. if (damager == nodGuy01 || damager == nodGuy02)
  15850. {
  15851. if (damagedByNod == false)
  15852. {
  15853. damagedByNod = true;
  15854. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
  15855. }
  15856. }
  15857. if (invincible == true)
  15858. {
  15859. //Commands->Set_Health ( obj, currentHealth );
  15860. float myCurrentHealth = Commands->Get_Health ( obj );
  15861. if (myCurrentHealth <= 10)
  15862. {
  15863. Commands->Set_Health ( obj, 10 );
  15864. }
  15865. }
  15866. else if (obj && damager == obj)
  15867. {
  15868. Commands->Set_Health ( obj, currentHealth );
  15869. }
  15870. else if (obj)
  15871. {
  15872. currentHealth = Commands->Get_Health ( obj );
  15873. }
  15874. }
  15875. void Animation_Complete(GameObject * obj, const char *anim)
  15876. {
  15877. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  15878. {
  15879. Commands->Destroy_Object ( obj );
  15880. }
  15881. }
  15882. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  15883. {
  15884. ActionParamsStruct params;
  15885. if (type == 0)
  15886. {
  15887. if (param == M01_MODIFY_YOUR_ACTION_JDG)//run over next to ladder
  15888. {
  15889. Vector3 newPosition (38.873f, -42.180f, -0.432f);
  15890. Commands->Set_Innate_Is_Stationary ( obj, false );
  15891. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  15892. params.Set_Movement(newPosition, RUN, 1);
  15893. Commands->Action_Goto ( obj, params );
  15894. }
  15895. else if (param == M01_START_ATTACKING_01_JDG)//player is at top of ladders...check if nod minigunner is still alive
  15896. {
  15897. GameObject * nodMinigunner = Commands->Find_Object ( 116384 );
  15898. if (nodMinigunner != NULL)
  15899. {
  15900. params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
  15901. params.Set_Attack( nodMinigunner, 1000, 0, true );
  15902. params.AttackCrouched = true;
  15903. params.AttackCheckBlocked = false;
  15904. Commands->Action_Attack (obj, params);
  15905. }
  15906. else
  15907. {
  15908. Commands->Action_Reset ( obj, 100 );
  15909. }
  15910. }
  15911. else if (param == M01_START_ACTING_JDG)//
  15912. {
  15913. Commands->Action_Reset ( obj, 100 );
  15914. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  15915. params.Set_Attack( STAR, 0, 0, true );
  15916. Commands->Action_Attack (obj, params);
  15917. float delayTimer = Commands->Get_Random ( 1, 2 );
  15918. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  15919. }
  15920. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  15921. {
  15922. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  15923. params.Set_Animation( "H_A_J19A", false );
  15924. Commands->Action_Play_Animation ( obj, params );
  15925. }
  15926. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
  15927. {
  15928. //invincible = false;
  15929. Vector3 newPosition (26.767f, 18.529f, 3.139f);
  15930. Commands->Set_Innate_Is_Stationary ( obj, false );
  15931. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  15932. params.Set_Movement(newPosition, RUN, 1);
  15933. Commands->Action_Goto ( obj, params );
  15934. }
  15935. else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)
  15936. {
  15937. Commands->Enable_Hibernation( obj, false );
  15938. //evacing = true;
  15939. ducanRescued = true;
  15940. Commands->Action_Reset ( obj, 100 );
  15941. Vector3 myHomeSpot (41.3f, 27.4f, -0.2f);
  15942. params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
  15943. params.Set_Movement(myHomeSpot, RUN, 1);
  15944. Commands->Action_Goto(obj, params);
  15945. }
  15946. else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
  15947. {
  15948. Commands->Action_Reset ( obj, 100 );
  15949. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  15950. if (myEvacController != NULL)
  15951. {
  15952. Commands->Set_Innate_Is_Stationary ( obj, false );
  15953. Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
  15954. params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
  15955. params.Set_Movement(myHomeSpot, RUN, 1);
  15956. Commands->Action_Goto(obj, params);
  15957. }
  15958. }
  15959. else if (param == M01_MODIFY_YOUR_ACTION_06_JDG && ducanRescued == false)//Head down the path
  15960. {
  15961. still_in_GDI_Base = false;
  15962. Commands->Action_Reset ( obj, 100 );
  15963. headingDownBackPath = true;
  15964. Vector3 newGotoSpot (111.210f, 85.507f, 8.934f);
  15965. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  15966. params.Set_Movement(newGotoSpot, RUN, 1);
  15967. params.AttackActive = false;
  15968. Commands->Action_Attack (obj, params);
  15969. }
  15970. else if (param == M01_IVE_BEEN_KILLED_JDG)
  15971. {
  15972. if (still_in_GDI_Base == true)
  15973. {
  15974. invincible = false;
  15975. Commands->Apply_Damage( obj, 100000, "Steel", NULL );
  15976. }
  15977. }
  15978. else if (param == M01_WALKING_WAYPATH_04_JDG)
  15979. {
  15980. GameObject * nodguy02 = Commands->Find_Object ( 116387 );
  15981. if (nodguy02 != NULL)
  15982. {
  15983. Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
  15984. Commands->Set_Innate_Is_Stationary ( obj, false );
  15985. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  15986. params.Set_Movement(myNewSpot, RUN, 1);
  15987. params.Set_Attack( nodguy02, 20, 0, true );
  15988. params.AttackCheckBlocked = false;
  15989. Commands->Action_Attack (obj, params);
  15990. }
  15991. else
  15992. {
  15993. Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
  15994. Commands->Set_Innate_Is_Stationary ( obj, false );
  15995. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  15996. params.Set_Movement(myNewSpot, RUN, 1);
  15997. Commands->Action_Goto (obj, params);
  15998. }
  15999. }
  16000. }
  16001. }
  16002. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  16003. {
  16004. if (headingDownBackPath == true)
  16005. {
  16006. ActionParamsStruct params;
  16007. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  16008. params.Set_Movement(enemy, WALK, 5);
  16009. params.Set_Attack( enemy, 1000, 0, true );
  16010. params.AttackActive = true;
  16011. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_06_JDG, params, true, true );
  16012. }
  16013. }
  16014. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16015. {
  16016. ActionParamsStruct params;
  16017. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16018. {
  16019. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  16020. {
  16021. Vector3 myTarget (28.449f, -23.325f, 3.032f);
  16022. Commands->Set_Innate_Is_Stationary ( obj, true );
  16023. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  16024. params.Set_Attack( myTarget, 1000, 0, true );
  16025. params.AttackCrouched = true;
  16026. params.AttackCheckBlocked = false;
  16027. Commands->Action_Attack (obj, params);
  16028. }
  16029. else if (action_id == M01_DOING_ANIMATION_01_JDG)
  16030. {
  16031. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  16032. params.Set_Animation( "H_A_J19S", false );
  16033. Commands->Action_Play_Animation ( obj, params );
  16034. }
  16035. else if (action_id == M01_DOING_ANIMATION_02_JDG)
  16036. {
  16037. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  16038. params.Set_Animation( "H_A_J19C", false );
  16039. Commands->Action_Play_Animation ( obj, params );
  16040. }
  16041. else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
  16042. {
  16043. Commands->Set_Innate_Is_Stationary ( obj, true );
  16044. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  16045. if (myEvacController != NULL)//tell controller to call in a chopper
  16046. {
  16047. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  16048. }
  16049. }
  16050. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
  16051. {
  16052. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  16053. powerupSpawnLocation.Z += 0.75f;
  16054. char *powerups[2] =
  16055. {//this is a list of potential powerups to be dropped by sniper target guys
  16056. "POW_Health_100",
  16057. "POW_Armor_100",
  16058. };
  16059. int random = Commands->Get_Random_Int(0, 2);
  16060. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  16061. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  16062. if (myEvacController != NULL)//tell controller to spawn a rope
  16063. {
  16064. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  16065. }
  16066. }
  16067. else if (action_id == M01_WALKING_WAYPATH_03_JDG)//you're over by the pows now...check if nod guy 02 is still alive
  16068. {
  16069. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
  16070. }
  16071. else if (action_id == M01_WALKING_WAYPATH_04_JDG)//your target is dead...make sure you go over to path
  16072. {
  16073. Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
  16074. Commands->Set_Innate_Is_Stationary ( obj, false );
  16075. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  16076. params.Set_Movement(myNewSpot, RUN, 1);
  16077. Commands->Action_Goto (obj, params);
  16078. }
  16079. else if (action_id == M01_WALKING_WAYPATH_05_JDG)//you're by path entrance...goto stationary
  16080. {
  16081. Commands->Set_Innate_Is_Stationary ( obj, true );
  16082. }
  16083. else if (action_id == M01_WALKING_WAYPATH_06_JDG)//you just killed a back path guy...continue your journey
  16084. {
  16085. Vector3 newGotoSpot (111.210f, 85.507f, 8.934f);
  16086. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  16087. params.Set_Movement(newGotoSpot, RUN, 1);
  16088. params.AttackActive = false;
  16089. Commands->Action_Attack (obj, params);
  16090. }
  16091. }
  16092. }
  16093. };
  16094. DECLARE_SCRIPT(M01_MediumTank_ReminderZone_JDG, "")//122848
  16095. {
  16096. bool commandClearance;
  16097. bool player_in_tank;
  16098. int reminderConv;
  16099. int tank_id;
  16100. int reminders;
  16101. REGISTER_VARIABLES()
  16102. {
  16103. SAVE_VARIABLE(commandClearance, 1);
  16104. SAVE_VARIABLE(player_in_tank, 2);
  16105. SAVE_VARIABLE(tank_id, 3);
  16106. SAVE_VARIABLE(reminders, 4);
  16107. }
  16108. void Created( GameObject * obj )
  16109. {
  16110. commandClearance = false;
  16111. player_in_tank = false;
  16112. reminders = 0;
  16113. }
  16114. void Entered( GameObject * obj, GameObject * enterer )
  16115. {
  16116. if (enterer == STAR)
  16117. {
  16118. if (commandClearance == true)
  16119. {
  16120. if (player_in_tank == true)//
  16121. {
  16122. }
  16123. else
  16124. {
  16125. int tunnelConv = Commands->Create_Conversation( "M01_TunnelTank_Reminder_Conversation", 100, 30, false );
  16126. Commands->Join_Conversation( NULL, tunnelConv, false, true, true );
  16127. Commands->Start_Conversation( tunnelConv, tunnelConv );
  16128. Commands->Destroy_Object ( obj );
  16129. }
  16130. }
  16131. }
  16132. }
  16133. void Timer_Expired( GameObject * obj, int timer_id )
  16134. {
  16135. if (player_in_tank == false)
  16136. {
  16137. reminders++;
  16138. if (reminders == 1)
  16139. {
  16140. GameObject * mediumTank = Commands->Find_Object ( tank_id );
  16141. if (mediumTank != NULL)
  16142. {
  16143. reminderConv = Commands->Create_Conversation( "M01_GetInTheTank_01_Conversation", 100, 30, false );
  16144. Commands->Join_Conversation( NULL, reminderConv, false, true, true );
  16145. Commands->Start_Conversation( reminderConv, reminderConv );
  16146. Commands->Monitor_Conversation( obj, reminderConv );
  16147. }
  16148. }
  16149. else if (reminders == 2)
  16150. {
  16151. GameObject * mediumTank = Commands->Find_Object ( tank_id );
  16152. if (mediumTank != NULL)
  16153. {
  16154. reminderConv = Commands->Create_Conversation( "M01_GetInTheTank_02_Conversation", 100, 30, false );
  16155. Commands->Join_Conversation( NULL, reminderConv, false, true, true );
  16156. Commands->Start_Conversation( reminderConv, reminderConv );
  16157. Commands->Monitor_Conversation( obj, reminderConv );
  16158. }
  16159. }
  16160. }
  16161. }
  16162. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16163. {
  16164. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  16165. {
  16166. if (action_id == reminderConv)
  16167. {
  16168. Commands->Start_Timer ( obj, this, 30, 0 );
  16169. }
  16170. }
  16171. }
  16172. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16173. {
  16174. if (type == 0)
  16175. {
  16176. if (param == M01_START_ACTING_JDG)//tank is here
  16177. {
  16178. commandClearance = true;
  16179. Commands->Start_Timer ( obj, this, 10, 0 );
  16180. tank_id = Commands->Get_ID ( obj );
  16181. }
  16182. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//player is in the tank
  16183. {
  16184. player_in_tank = true;
  16185. }
  16186. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//player is out of the tank
  16187. {
  16188. player_in_tank = false;
  16189. }
  16190. }
  16191. }
  16192. };
  16193. DECLARE_SCRIPT(M01_Base_POW01_JDG, "")//116386
  16194. {
  16195. int deadGuards;
  16196. bool pokable;
  16197. REGISTER_VARIABLES()
  16198. {
  16199. SAVE_VARIABLE(deadGuards, 1);
  16200. SAVE_VARIABLE(pokable, 2);
  16201. }
  16202. void Created( GameObject * obj )
  16203. {
  16204. deadGuards = 0;
  16205. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
  16206. Commands->Set_Loiters_Allowed( obj, false );
  16207. ActionParamsStruct params;
  16208. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  16209. params.Set_Animation( "H_A_HOST_L2B", true );
  16210. Commands->Action_Play_Animation ( obj, params );
  16211. pokable = false;
  16212. }
  16213. void Damaged( GameObject * obj, GameObject * damager, float amount )
  16214. {
  16215. float currentHealth = Commands->Get_Health ( obj );
  16216. if (currentHealth <= 10)
  16217. {
  16218. Commands->Set_Health ( obj, 10 );
  16219. }
  16220. }
  16221. void Killed( GameObject * obj, GameObject * killer )
  16222. {
  16223. GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  16224. if (evacController != NULL)
  16225. {
  16226. Commands->Send_Custom_Event( obj, evacController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16227. }
  16228. }
  16229. void Animation_Complete(GameObject * obj, const char *anim)
  16230. {
  16231. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  16232. {
  16233. Commands->Destroy_Object ( obj );
  16234. }
  16235. }
  16236. void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
  16237. {
  16238. ActionParamsStruct params;
  16239. if (type == 0)
  16240. {
  16241. if (param == M01_IVE_BEEN_KILLED_JDG)
  16242. {
  16243. deadGuards++;
  16244. if (deadGuards == 2)
  16245. {
  16246. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  16247. params.Set_Animation( "H_A_HOST_L2C", false );
  16248. Commands->Action_Play_Animation ( obj, params );
  16249. GameObject * pow02 = Commands->Find_Object ( 116385 );
  16250. if (pow02 != NULL)
  16251. {
  16252. Commands->Send_Custom_Event( obj, pow02, 0, M01_START_ACTING_JDG, 1 );
  16253. }
  16254. Vector3 airdropPosition (55.062f, 60.164f, -1);
  16255. GameObject *controller = Commands->Create_Object("Invisible_Object", airdropPosition);
  16256. Commands->Set_Facing ( controller, -45 );
  16257. Commands->Attach_Script(controller, "Test_Cinematic", "X1D_GDIPOW_FlareDrop.txt");
  16258. }
  16259. }
  16260. else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
  16261. {
  16262. Commands->Enable_Hibernation( obj, false );
  16263. Commands->Set_Innate_Is_Stationary ( obj, false );
  16264. Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG ) );
  16265. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  16266. params.Set_Movement( myEvacSpot, RUN, 1 );
  16267. Commands->Action_Goto( obj, params );
  16268. }
  16269. else if (param == M01_GOTO_INNATE_JDG)
  16270. {
  16271. pokable = false;
  16272. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  16273. }
  16274. }
  16275. }
  16276. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16277. {
  16278. ActionParamsStruct params;
  16279. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16280. {
  16281. if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
  16282. {
  16283. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  16284. params.Set_Animation( "H_A_HOST_L1C", false );
  16285. Commands->Action_Play_Animation ( obj, params );
  16286. Commands->Set_Innate_Is_Stationary ( obj, true );
  16287. }
  16288. else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
  16289. {
  16290. GameObject * convController = Commands->Find_Object ( 121237 );
  16291. if (convController != NULL)
  16292. {
  16293. Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
  16294. }
  16295. }
  16296. else if (action_id == M01_WALKING_WAYPATH_02_JDG)//gdi guy is at evac chopper--delete him
  16297. {
  16298. GameObject * airdropController = Commands->Find_Object ( M01_GDIBASE_EVAC_MONITOR_JDG );
  16299. if (airdropController != NULL)
  16300. {
  16301. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  16302. }
  16303. GameObject * myEvacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  16304. if (myEvacController != NULL)//tell controller to spawn a rope
  16305. {
  16306. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  16307. }
  16308. }
  16309. }
  16310. }
  16311. };
  16312. DECLARE_SCRIPT(M01_Base_POW02_JDG, "")//116385
  16313. {
  16314. bool pokable;
  16315. int pow02conv01;
  16316. REGISTER_VARIABLES()
  16317. {
  16318. SAVE_VARIABLE(pokable, 1);
  16319. SAVE_VARIABLE(pow02conv01, 2);
  16320. }
  16321. void Created( GameObject * obj )
  16322. {
  16323. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
  16324. Commands->Set_Loiters_Allowed( obj, false );
  16325. ActionParamsStruct params;
  16326. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  16327. params.Set_Animation( "H_A_HOST_L2B", true );
  16328. Commands->Action_Play_Animation ( obj, params );
  16329. pokable = false;
  16330. }
  16331. void Damaged( GameObject * obj, GameObject * damager, float amount )
  16332. {
  16333. float currentHealth = Commands->Get_Health ( obj );
  16334. if (currentHealth <= 10)
  16335. {
  16336. Commands->Set_Health ( obj, 10 );
  16337. }
  16338. }
  16339. void Animation_Complete(GameObject * obj, const char *anim)
  16340. {
  16341. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  16342. {
  16343. Commands->Destroy_Object ( obj );
  16344. }
  16345. }
  16346. void Killed( GameObject * obj, GameObject * killer )
  16347. {
  16348. GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  16349. if (evacController != NULL)
  16350. {
  16351. Commands->Send_Custom_Event( obj, evacController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16352. }
  16353. }
  16354. void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
  16355. {
  16356. ActionParamsStruct params;
  16357. if (type == 0)
  16358. {
  16359. if (param == M01_START_ACTING_JDG)
  16360. {
  16361. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  16362. params.Set_Animation( "H_A_HOST_L2C", false );
  16363. Commands->Action_Play_Animation ( obj, params );
  16364. }
  16365. else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
  16366. {
  16367. Commands->Enable_Hibernation( obj, false );
  16368. Commands->Set_Innate_Is_Stationary ( obj, false );
  16369. Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG ) );
  16370. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  16371. params.Set_Movement( myEvacSpot, RUN, 1 );
  16372. Commands->Action_Goto( obj, params );
  16373. }
  16374. else if (param == M01_GOTO_INNATE_JDG)
  16375. {
  16376. pokable = false;
  16377. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  16378. }
  16379. }
  16380. }
  16381. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16382. {
  16383. ActionParamsStruct params;
  16384. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16385. {
  16386. if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
  16387. {
  16388. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  16389. params.Set_Animation( "H_A_HOST_L1C", false );
  16390. Commands->Action_Play_Animation ( obj, params );
  16391. Commands->Set_Innate_Is_Stationary ( obj, true );
  16392. }
  16393. else if (action_id == M01_DOING_ANIMATION_03_JDG )//pow guy is standingup -- do cheer anim
  16394. {
  16395. char *animationName = M01_Choose_Cheer_Animation ( );
  16396. params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
  16397. params.Set_Animation( animationName, false );
  16398. Commands->Action_Play_Animation ( obj, params );
  16399. }
  16400. else if (action_id == M01_DOING_ANIMATION_04_JDG )//pow guy is standingup -- play havoc anim if pow01 is dead
  16401. {
  16402. GameObject * pow01 = Commands->Find_Object ( 116386 );
  16403. if (pow01 == NULL)
  16404. {
  16405. GameObject * convController = Commands->Find_Object ( 121237 );
  16406. if (convController != NULL)
  16407. {
  16408. Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
  16409. }
  16410. }
  16411. }
  16412. else if (action_id == M01_WALKING_WAYPATH_02_JDG)//gdi guy is at evac chopper--delete him
  16413. {
  16414. GameObject * airdropController = Commands->Find_Object ( M01_GDIBASE_EVAC_MONITOR_JDG );
  16415. if (airdropController != NULL)
  16416. {
  16417. Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
  16418. }
  16419. GameObject * myEvacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  16420. if (myEvacController != NULL)//tell controller to spawn a rope
  16421. {
  16422. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  16423. }
  16424. }
  16425. }
  16426. }
  16427. };
  16428. DECLARE_SCRIPT(M01_GDIBase_POW_Conversation_Controller_JDG, "")//121237
  16429. {
  16430. bool convPlayed;
  16431. int pow02conv01;
  16432. REGISTER_VARIABLES()
  16433. {
  16434. SAVE_VARIABLE(convPlayed, 1);
  16435. SAVE_VARIABLE(pow02conv01, 2);
  16436. }
  16437. void Created( GameObject * obj )
  16438. {
  16439. convPlayed = false;
  16440. }
  16441. void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
  16442. {
  16443. ActionParamsStruct params;
  16444. if (type == 0)
  16445. {
  16446. if (param == M01_START_ACTING_JDG && convPlayed == false)
  16447. {
  16448. convPlayed = true;
  16449. GameObject * pow01 = Commands->Find_Object ( 116386 );
  16450. GameObject * pow02 = Commands->Find_Object ( 116385 );
  16451. if (sender == pow01 && pow01 != NULL)
  16452. {
  16453. pow02conv01 = Commands->Create_Conversation( "M01_POW02_Conversation_01", 100, 1000, false );
  16454. Commands->Join_Conversation( pow01, pow02conv01, false, true, true );
  16455. Commands->Join_Conversation( STAR, pow02conv01, false, false, false );
  16456. Commands->Start_Conversation( pow02conv01, pow02conv01 );
  16457. Commands->Monitor_Conversation( obj, pow02conv01 );
  16458. }
  16459. else if (sender == pow02 && pow02 != NULL)
  16460. {
  16461. pow02conv01 = Commands->Create_Conversation( "M01_POW02_Conversation_01", 100, 1000, false );
  16462. Commands->Join_Conversation( pow02, pow02conv01, false, true, true );
  16463. Commands->Join_Conversation( STAR, pow02conv01, false, false, false );
  16464. Commands->Start_Conversation( pow02conv01, pow02conv01 );
  16465. Commands->Monitor_Conversation( obj, pow02conv01 );
  16466. }
  16467. if (pow01 != NULL)//M01_GOTO_INNATE_JDG
  16468. {
  16469. Commands->Send_Custom_Event( obj, pow01, 0, M01_GOTO_INNATE_JDG, 0 );
  16470. }
  16471. if (pow02 != NULL)
  16472. {
  16473. Commands->Send_Custom_Event( obj, pow02, 0, M01_GOTO_INNATE_JDG, 0 );
  16474. }
  16475. }
  16476. }
  16477. }
  16478. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16479. {
  16480. ActionParamsStruct params;
  16481. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  16482. {
  16483. if (action_id == pow02conv01)
  16484. {
  16485. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  16486. if (pogController != NULL)
  16487. {
  16488. Commands->Send_Custom_Event( obj, pogController, M01_CHANGE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 0 );
  16489. }
  16490. GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
  16491. if (evacController != NULL)
  16492. {
  16493. Commands->Send_Custom_Event( obj, evacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  16494. }
  16495. GameObject * gdiMinigunner = Commands->Find_Object ( 116382 );
  16496. if (gdiMinigunner != NULL)
  16497. {
  16498. Commands->Send_Custom_Event( obj, gdiMinigunner, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 2 );
  16499. //this tells him to start the "this is the path" routine
  16500. }
  16501. GameObject * backPathZone = Commands->Find_Object ( 121433 );
  16502. if (backPathZone != NULL)
  16503. {
  16504. Commands->Send_Custom_Event( obj, backPathZone, 0, M01_START_ACTING_JDG, 0 );
  16505. }
  16506. }
  16507. }
  16508. }
  16509. };
  16510. DECLARE_SCRIPT(M01_GDI_BeachGuy01_JDG, "")
  16511. {
  16512. void Created( GameObject * obj )
  16513. {
  16514. Commands->Innate_Disable(obj);
  16515. ActionParamsStruct params;
  16516. Commands->Enable_Hibernation( obj, false );
  16517. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  16518. params.Set_Movement( Vector3(36.231f, 28.471f, 0.131f), RUN, 2 );
  16519. Commands->Action_Goto( obj, params );
  16520. }
  16521. void Damaged( GameObject * obj, GameObject * damager, float amount )
  16522. {
  16523. float currentHealth = Commands->Get_Health ( obj );
  16524. if (currentHealth <= 10 && damager == STAR)
  16525. {
  16526. Commands->Set_Health ( obj, 10 );
  16527. }
  16528. }
  16529. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16530. {
  16531. ActionParamsStruct params;
  16532. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16533. {
  16534. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  16535. {
  16536. Commands->Apply_Damage( obj, 10000, "STEEL", NULL );
  16537. }
  16538. }
  16539. }
  16540. };
  16541. DECLARE_SCRIPT(M01_Announce_TankAirstrikeZone_JDG, "")
  16542. {
  16543. void Entered( GameObject * obj, GameObject * enterer )
  16544. {
  16545. if (enterer == STAR)
  16546. {
  16547. GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
  16548. if (missionController != NULL)
  16549. {
  16550. Commands->Send_Custom_Event( obj, missionController, 0, M01_ANNOUNCE_AIRSTRIKE_JDG, 0 );
  16551. }
  16552. Commands->Destroy_Object ( obj );
  16553. }
  16554. }
  16555. };
  16556. DECLARE_SCRIPT(M01_GDI_GuardTower_02_Enter_Zone_JDG, "")
  16557. {
  16558. void Entered( GameObject * obj, GameObject * enterer )
  16559. {
  16560. if (enterer == STAR)
  16561. {
  16562. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
  16563. Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-90.385 124.308 1.610, -79.477 139.201 0.947");
  16564. GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
  16565. Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-85.499 117.221 1.915, -79.477 139.201 0.947");
  16566. GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
  16567. Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-93.364 113.202 1.701, -79.477 139.201 0.947");
  16568. Commands->Destroy_Object ( obj );
  16569. }
  16570. }
  16571. };
  16572. DECLARE_SCRIPT(M01_GDI_GuardTower02_SniperRifle_JDG, "")
  16573. {
  16574. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16575. {
  16576. if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //sniper rifle has been picked up--spawn the actors
  16577. {
  16578. GameObject * c4TextController = Commands->Find_Object ( 117188 );
  16579. if (c4TextController != NULL)
  16580. {
  16581. Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
  16582. }
  16583. Vector3 spawnLocation01 (-79.182f, 141.927f, 1.763f);
  16584. GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation01);
  16585. Commands->Attach_Script(sniperTarget01, "M01_GuardTower02_Sniper_Target01_JDG", "");
  16586. }
  16587. }
  16588. };
  16589. DECLARE_SCRIPT(M01_GuardTower02_Sniper_Target01_JDG, "")
  16590. {
  16591. int guy02_id;
  16592. int sniperConv;
  16593. bool acting;
  16594. REGISTER_VARIABLES()
  16595. {
  16596. SAVE_VARIABLE(guy02_id, 1);
  16597. SAVE_VARIABLE(sniperConv, 2);
  16598. SAVE_VARIABLE(acting, 3);
  16599. }
  16600. void Created( GameObject * obj )
  16601. {
  16602. acting = true;
  16603. Commands->Enable_Hibernation( obj, false );
  16604. Vector3 spawnLocation02 (-93.882f, 110.504f, 1.644f);
  16605. GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation02);
  16606. Commands->Attach_Script(sniperTarget02, "M01_GuardTower02_Sniper_Target02_JDG", "");
  16607. Commands->Send_Custom_Event( obj, sniperTarget02, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 1 );
  16608. guy02_id = Commands->Get_ID ( sniperTarget02 );
  16609. Vector3 myGotoSpot (-92.496f, 117.750f, 1.752f);
  16610. ActionParamsStruct params;
  16611. params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
  16612. params.Set_Movement( myGotoSpot, RUN, 1 );
  16613. Commands->Action_Goto( obj, params );
  16614. }
  16615. void Killed( GameObject * obj, GameObject * killer )
  16616. {
  16617. GameObject * reinforceController = Commands->Find_Object ( 123645 );
  16618. if (reinforceController != NULL)
  16619. {
  16620. Commands->Send_Custom_Event( obj, reinforceController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16621. }
  16622. if (acting == true)
  16623. {
  16624. GameObject * guy02 = Commands->Find_Object ( guy02_id );
  16625. if (guy02 != NULL)
  16626. {
  16627. Commands->Send_Custom_Event( obj, guy02, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16628. }
  16629. }
  16630. }
  16631. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16632. {
  16633. ActionParamsStruct params;
  16634. if (type == 0)
  16635. {
  16636. if (param == M01_IVE_BEEN_KILLED_JDG)//your buddy's been capped--do look around anim
  16637. {
  16638. Commands->Action_Reset ( obj, 100 );
  16639. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  16640. params.Set_Animation ("H_A_A0A0_L21", false);
  16641. Commands->Action_Play_Animation (obj, params);
  16642. }
  16643. }
  16644. }
  16645. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16646. {
  16647. ActionParamsStruct params;
  16648. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16649. {
  16650. if (action_id == M01_WALKING_WAYPATH_01_JDG )//youre now in middle of field--start conversation
  16651. {
  16652. Commands->Set_Innate_Is_Stationary ( obj, true );
  16653. GameObject * guy02 = Commands->Find_Object ( guy02_id );
  16654. if (guy02 != NULL)
  16655. {
  16656. sniperConv = Commands->Create_Conversation( "M01_SniperTower_Conversation", 100, 80, true);
  16657. Commands->Join_Conversation( obj, sniperConv, false, true, true );
  16658. Commands->Join_Conversation( guy02, sniperConv, false, true, true );
  16659. Commands->Start_Conversation( sniperConv, sniperConv );
  16660. Commands->Monitor_Conversation( obj, sniperConv );
  16661. }
  16662. }
  16663. else if (action_id == M01_WALKING_WAYPATH_02_JDG )//youre now at the tailguns--allow hibernation
  16664. {
  16665. Commands->Enable_Hibernation( obj, true );
  16666. }
  16667. else if (action_id == M01_DOING_ANIMATION_01_JDG )//youre looked around--now set curent position as home spot
  16668. {
  16669. Commands->Set_Innate_Is_Stationary ( obj, false );
  16670. Vector3 myPosition = Commands->Get_Position ( obj );
  16671. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  16672. }
  16673. }
  16674. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  16675. {
  16676. if (action_id == sniperConv )//conversation is over--go away
  16677. {
  16678. acting = false;
  16679. Commands->Set_Innate_Is_Stationary ( obj, false );
  16680. Vector3 myGotoSpot (46.749f, 197.062f, 6.211f);
  16681. ActionParamsStruct params;
  16682. params.Set_Basic( this, 50, M01_WALKING_WAYPATH_02_JDG );
  16683. params.Set_Movement( myGotoSpot, RUN, 1 );
  16684. Commands->Action_Goto( obj, params );
  16685. GameObject * guy02 = Commands->Find_Object ( guy02_id );
  16686. if (guy02 != NULL)
  16687. {
  16688. Commands->Send_Custom_Event( obj, guy02, 0, M01_START_ACTING_JDG, 0 );
  16689. }
  16690. }
  16691. }
  16692. }
  16693. };
  16694. DECLARE_SCRIPT(M01_GuardTower02_Sniper_TowerZone_JDG, "")//123645
  16695. {
  16696. bool player_in_zone;
  16697. int targets_killed;
  16698. REGISTER_VARIABLES()
  16699. {
  16700. SAVE_VARIABLE(player_in_zone, 1);
  16701. SAVE_VARIABLE(targets_killed, 2);
  16702. }
  16703. void Created( GameObject * obj )
  16704. {
  16705. player_in_zone = false;
  16706. targets_killed = 0;
  16707. }
  16708. void Entered( GameObject * obj, GameObject * enterer )
  16709. {
  16710. if (enterer == STAR)
  16711. {
  16712. player_in_zone = true;
  16713. }
  16714. }
  16715. void Exited( GameObject * obj, GameObject * exiter )
  16716. {
  16717. if (exiter == STAR)
  16718. {
  16719. player_in_zone = false;
  16720. }
  16721. }
  16722. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16723. {
  16724. if (type == 0)
  16725. {
  16726. if (param == M01_IVE_BEEN_KILLED_JDG)//a sniper targets been killed--check player position and spawn new target if needed
  16727. {
  16728. if (player_in_zone == true)
  16729. {
  16730. targets_killed++;
  16731. if (targets_killed == 1)
  16732. {
  16733. Vector3 spawnLocation02 (-51.423f, 126.198f, 2.537f);
  16734. GameObject * new_sniperTarget = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation02);
  16735. Commands->Attach_Script(new_sniperTarget, "M01_GuardTower02_NewSniperTarget_JDG", "");
  16736. }
  16737. else if (targets_killed == 2)
  16738. {
  16739. }
  16740. }
  16741. }
  16742. }
  16743. }
  16744. };
  16745. DECLARE_SCRIPT(M01_GuardTower02_NewSniperTarget_JDG, "")
  16746. {
  16747. void Created( GameObject * obj )
  16748. {
  16749. Commands->Enable_Hibernation( obj, false );
  16750. Vector3 runToPosition (-67.347f, 118.048f, 2.641f);
  16751. ActionParamsStruct params;
  16752. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  16753. params.Set_Movement( runToPosition, RUN, 1);
  16754. Commands->Action_Goto ( obj, params );
  16755. }
  16756. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16757. {
  16758. ActionParamsStruct params;
  16759. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16760. {
  16761. if (action_id == M01_WALKING_WAYPATH_01_JDG )//now look over at Havoc
  16762. {
  16763. params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  16764. params.Set_Attack( STAR, 0, 0, true );
  16765. Commands->Action_Attack ( obj, params );
  16766. Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 1 );
  16767. }
  16768. else if (action_id == M01_DOING_ANIMATION_02_JDG )//now do neck chop anim
  16769. {
  16770. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
  16771. params.Set_Animation ("H_A_A0A0_L56", false);
  16772. Commands->Action_Play_Animation (obj, params);
  16773. }
  16774. else if (action_id == M01_DOING_ANIMATION_03_JDG )//now go attack havoc
  16775. {
  16776. params.Set_Basic( this, 50, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
  16777. params.Set_Attack( STAR, 20, 0, true );
  16778. params.Set_Movement( STAR, RUN, 5);
  16779. Commands->Action_Attack ( obj, params );
  16780. }
  16781. }
  16782. }
  16783. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16784. {
  16785. ActionParamsStruct params;
  16786. if (type == 0)
  16787. {
  16788. if (param == M01_FACING_SPECIFIED_DIRECTION_01_JDG)
  16789. {
  16790. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  16791. params.Set_Animation ("H_A_A0A0_L34", false);
  16792. Commands->Action_Play_Animation (obj, params);
  16793. }
  16794. }
  16795. }
  16796. };
  16797. DECLARE_SCRIPT(M01_GuardTower02_Sniper_Target02_JDG, "")
  16798. {
  16799. int guy01_id;
  16800. bool acting;
  16801. REGISTER_VARIABLES()
  16802. {
  16803. SAVE_VARIABLE(guy01_id, 1);
  16804. SAVE_VARIABLE(acting, 2);
  16805. }
  16806. void Created( GameObject * obj )
  16807. {
  16808. acting = true;
  16809. Commands->Enable_Hibernation( obj, false );
  16810. Vector3 myGotoSpot (-92.927f, 115.587f, 1.847f);
  16811. ActionParamsStruct params;
  16812. params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
  16813. params.Set_Movement( myGotoSpot, WALK, 1 );
  16814. Commands->Action_Goto( obj, params );
  16815. }
  16816. void Killed( GameObject * obj, GameObject * killer )
  16817. {
  16818. GameObject * reinforceController = Commands->Find_Object ( 123645 );
  16819. if (reinforceController != NULL)
  16820. {
  16821. Commands->Send_Custom_Event( obj, reinforceController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16822. }
  16823. if (acting == true)
  16824. {
  16825. GameObject * guy01 = Commands->Find_Object ( guy01_id );
  16826. if (guy01 != NULL)
  16827. {
  16828. Commands->Send_Custom_Event( obj, guy01, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16829. }
  16830. }
  16831. }
  16832. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  16833. {
  16834. ActionParamsStruct params;
  16835. if (complete_reason == ACTION_COMPLETE_NORMAL)
  16836. {
  16837. if (action_id == M01_WALKING_WAYPATH_01_JDG )//youre now in middle of field--start conversation
  16838. {
  16839. Commands->Set_Innate_Is_Stationary ( obj, true );
  16840. }
  16841. else if (action_id == M01_DOING_ANIMATION_01_JDG )//youre looked around--now set curent position as home spot
  16842. {
  16843. Commands->Set_Innate_Is_Stationary ( obj, false );
  16844. Vector3 myPosition = Commands->Get_Position ( obj );
  16845. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
  16846. }
  16847. }
  16848. }
  16849. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16850. {
  16851. ActionParamsStruct params;
  16852. if (type == 0)
  16853. {
  16854. if (param == M01_START_ACTING_JDG)
  16855. {
  16856. acting = false;
  16857. Commands->Set_Innate_Is_Stationary ( obj, false );
  16858. Vector3 myGotoSpot (-79.399f, 112.473f, 2.373f);
  16859. params.Set_Basic( this, 50, M01_WALKING_WAYPATH_01_JDG );
  16860. params.Set_Movement( myGotoSpot, WALK, 1 );
  16861. Commands->Action_Goto( obj, params );
  16862. }
  16863. else if (param == M01_IVE_BEEN_KILLED_JDG)//your buddy's been capped--do look around anim
  16864. {
  16865. Commands->Action_Reset ( obj, 100 );
  16866. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  16867. params.Set_Animation ("H_A_A0A0_L21", false);
  16868. Commands->Action_Play_Animation (obj, params);
  16869. }
  16870. else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//guy 1 is actually sending his id
  16871. {
  16872. guy01_id = Commands->Get_ID ( sender );
  16873. }
  16874. }
  16875. }
  16876. };
  16877. DECLARE_SCRIPT(M01_TurnOff_TankReminder_Zone_JDG, "")
  16878. {
  16879. void Entered( GameObject * obj, GameObject * enterer )
  16880. {
  16881. if (enterer == STAR)
  16882. {
  16883. GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
  16884. if (tankReminderZone != NULL)
  16885. {
  16886. Commands->Destroy_Object ( tankReminderZone );
  16887. Commands->Destroy_Object ( obj );
  16888. }
  16889. }
  16890. }
  16891. };
  16892. DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_ZoneController_JDG, "")//103378
  16893. {
  16894. void Entered( GameObject * obj, GameObject * enterer )
  16895. {
  16896. if (enterer == STAR)
  16897. {
  16898. GameObject * mctCommander = Commands->Find_Object ( 103373 );
  16899. GameObject * mctProtector01 = Commands->Find_Object ( 103374 );
  16900. GameObject * mctProtector02 = Commands->Find_Object ( 103375 );
  16901. if (mctCommander != NULL)
  16902. {
  16903. Commands->Send_Custom_Event ( obj, mctCommander, 0, M01_START_ACTING_JDG, 0 );
  16904. if ((mctProtector01 != NULL) && (mctProtector02 != NULL))
  16905. {
  16906. int protectMct_conv = Commands->Create_Conversation( "M01_Protect_The_MCT", 100, 1000, true);
  16907. Commands->Join_Conversation( mctProtector02, protectMct_conv, false, false );
  16908. Commands->Join_Conversation( mctProtector01, protectMct_conv, false, false );
  16909. Commands->Start_Conversation( protectMct_conv, protectMct_conv );
  16910. }
  16911. }
  16912. Commands->Destroy_Object ( obj );
  16913. }
  16914. }
  16915. };
  16916. DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_01_GDI_JDG, "")
  16917. {
  16918. bool player_in_warroom;
  16919. bool at_final_destination;
  16920. bool escorting;
  16921. int dialogs_said;
  16922. int dialogs_said_to_havoc;
  16923. REGISTER_VARIABLES()
  16924. {
  16925. SAVE_VARIABLE(player_in_warroom, 1);
  16926. SAVE_VARIABLE(at_final_destination, 2);
  16927. SAVE_VARIABLE(escorting, 3);
  16928. SAVE_VARIABLE(dialogs_said, 4);
  16929. SAVE_VARIABLE(dialogs_said_to_havoc, 5);
  16930. }
  16931. void Created( GameObject * obj )
  16932. {
  16933. dialogs_said = 0;
  16934. dialogs_said_to_havoc = 0;
  16935. player_in_warroom = false;
  16936. at_final_destination = false;
  16937. escorting = true;
  16938. Commands->Enable_Hibernation( obj, false );
  16939. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  16940. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  16941. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  16942. if (HON_MonitorZone != NULL)
  16943. {
  16944. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  16945. }
  16946. GameObject * MCT_talkZone = Commands->Find_Object ( 124260 );
  16947. if (MCT_talkZone != NULL)
  16948. {
  16949. Commands->Send_Custom_Event( obj, MCT_talkZone, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  16950. }
  16951. }
  16952. //Vector3 myGotoLocation (-187.848f, 526.480f, 3.518f);
  16953. void Animation_Complete(GameObject * obj, const char *anim)
  16954. {
  16955. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  16956. {
  16957. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 0 );
  16958. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
  16959. }
  16960. }
  16961. void Killed( GameObject * obj, GameObject * killer )
  16962. {
  16963. if (escorting == true)
  16964. {
  16965. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  16966. if (HON_MonitorZone != NULL)
  16967. {
  16968. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  16969. }
  16970. }
  16971. }
  16972. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  16973. {
  16974. if (obj && type == 0)
  16975. {
  16976. if (param == M01_WALKING_WAYPATH_01_JDG && player_in_warroom == false)
  16977. {
  16978. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  16979. if (handOfNodHealth > 0)
  16980. {
  16981. Vector3 myGotoLocation (-187.848f, 526.480f, 3.518f);
  16982. ActionParamsStruct params;
  16983. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
  16984. params.Set_Movement(myGotoLocation, RUN, 1);
  16985. Commands->Action_Goto(obj, params);
  16986. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 5 );
  16987. }
  16988. else
  16989. {
  16990. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  16991. }
  16992. }
  16993. else if (param == M01_START_ACTING_JDG && at_final_destination == false)
  16994. {
  16995. player_in_warroom = true;
  16996. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  16997. if (handOfNodHealth > 0)
  16998. {
  16999. Vector3 myGotoLocation (-181.084f, 541.058f, 3.518f);
  17000. ActionParamsStruct params;
  17001. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_02_JDG);
  17002. params.Set_Movement(myGotoLocation, WALK, 1);
  17003. Commands->Action_Goto(obj, params);
  17004. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
  17005. }
  17006. else
  17007. {
  17008. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  17009. }
  17010. }
  17011. else if (param == M01_GOTO_INNATE_JDG)//escort scenario is over--go to top of HON and goto innate
  17012. {
  17013. escorting = false;
  17014. Commands->Set_Innate_Is_Stationary ( obj, false );
  17015. Commands->Enable_Hibernation( obj, true );
  17016. Vector3 myGotoLocation (-181.163f, 534.529f, 10.034f);
  17017. ActionParamsStruct params;
  17018. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_03_JDG);
  17019. params.Set_Movement(myGotoLocation, RUN, 5);
  17020. Commands->Action_Goto(obj, params);
  17021. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 5 );
  17022. }
  17023. else if (param == M01_MODIFY_YOUR_ACTION_JDG && escorting == true)//pick a sound to play
  17024. {
  17025. /*Vector3 myPosition = Commands->Get_Position ( obj );
  17026. Vector3 playerPosition = Commands->Get_Position ( STAR );
  17027. float distance = Commands->Get_Distance ( myPosition, playerPosition );
  17028. if (distance <= 8)
  17029. {
  17030. if (dialogs_said_to_havoc == 0)
  17031. {
  17032. Commands->Create_Sound ( "MX1DSGN_DSGN0024I1DSGN_SND", myPosition, obj );//follow us inside
  17033. }
  17034. else if (dialogs_said_to_havoc == 1)
  17035. {
  17036. Commands->Create_Sound ( "MX1DSGN_DSGN0027I1DSGN_SND", myPosition, obj );//this way sir
  17037. }
  17038. dialogs_said_to_havoc++;
  17039. if (dialogs_said_to_havoc >= 2)
  17040. {
  17041. dialogs_said_to_havoc = 1;
  17042. }
  17043. }
  17044. else
  17045. {
  17046. if (dialogs_said == 0)
  17047. {
  17048. Commands->Create_Sound ( "MX1DSGN_DSGN0025I1DSGN_SND", myPosition, obj );//lets do it
  17049. }
  17050. else if (dialogs_said == 1)
  17051. {
  17052. Commands->Create_Sound ( "MX1DSGN_DSGN0026I1DSGN_SND", myPosition, obj );
  17053. }
  17054. else if (dialogs_said == 2)
  17055. {
  17056. Commands->Create_Sound ( "MX1DSGN_DSGN0028I1DSGN_SND", myPosition, obj );
  17057. }
  17058. dialogs_said++;
  17059. if (dialogs_said >= 3)
  17060. {
  17061. dialogs_said = 0;
  17062. }
  17063. }
  17064. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );*/
  17065. }
  17066. }
  17067. }
  17068. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  17069. {
  17070. if (complete_reason == ACTION_COMPLETE_NORMAL)
  17071. {
  17072. if (action_id == M01_WALKING_WAYPATH_02_JDG)
  17073. {
  17074. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  17075. if (handOfNodHealth > 0)
  17076. {
  17077. at_final_destination = true;
  17078. Commands->Set_Innate_Is_Stationary ( obj, true );
  17079. GameObject * MCTspeechZone = Commands->Find_Object ( 124260 );
  17080. if (MCTspeechZone != NULL)
  17081. {
  17082. Commands->Send_Custom_Event( obj, MCTspeechZone, 0, M01_START_ACTING_JDG, 0 );
  17083. }
  17084. }
  17085. else
  17086. {
  17087. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  17088. }
  17089. }
  17090. }
  17091. }
  17092. };
  17093. DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_02_GDI_JDG, "")
  17094. {
  17095. bool player_in_warroom;
  17096. bool at_final_destination;
  17097. bool escorting;
  17098. REGISTER_VARIABLES()
  17099. {
  17100. SAVE_VARIABLE(player_in_warroom, 1);
  17101. SAVE_VARIABLE(at_final_destination, 2);
  17102. SAVE_VARIABLE(escorting, 3);
  17103. }
  17104. void Created( GameObject * obj )
  17105. {
  17106. player_in_warroom = false;
  17107. at_final_destination = false;
  17108. escorting = true;
  17109. Commands->Enable_Hibernation( obj, false );
  17110. Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
  17111. Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
  17112. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  17113. if (HON_MonitorZone != NULL)
  17114. {
  17115. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  17116. }
  17117. GameObject * MCT_talkZone = Commands->Find_Object ( 124260 );
  17118. if (MCT_talkZone != NULL)
  17119. {
  17120. Commands->Send_Custom_Event( obj, MCT_talkZone, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  17121. }
  17122. }
  17123. //Vector3 myGotoLocation (-188.670f, 530.083f, 3.518f);
  17124. void Animation_Complete(GameObject * obj, const char *anim)
  17125. {
  17126. if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
  17127. {
  17128. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 0 );
  17129. }
  17130. }
  17131. void Killed( GameObject * obj, GameObject * killer )
  17132. {
  17133. if (escorting == true)
  17134. {
  17135. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  17136. if (HON_MonitorZone != NULL)
  17137. {
  17138. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  17139. }
  17140. }
  17141. }
  17142. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17143. {
  17144. if (obj && type == 0)
  17145. {
  17146. if (param == M01_WALKING_WAYPATH_01_JDG && player_in_warroom == false)
  17147. {
  17148. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  17149. if (handOfNodHealth > 0)
  17150. {
  17151. Vector3 myGotoLocation (-188.670f, 530.083f, 3.518f);
  17152. ActionParamsStruct params;
  17153. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
  17154. params.Set_Movement(myGotoLocation, RUN, 1);
  17155. Commands->Action_Goto(obj, params);
  17156. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 5 );
  17157. }
  17158. else
  17159. {
  17160. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  17161. }
  17162. }
  17163. else if (param == M01_START_ACTING_JDG && at_final_destination == false)
  17164. {
  17165. player_in_warroom = true;
  17166. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  17167. if (handOfNodHealth > 0)
  17168. {
  17169. Vector3 myGotoLocation (-179.440f, 535.697f, 3.518f);
  17170. ActionParamsStruct params;
  17171. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_02_JDG);
  17172. params.Set_Movement(myGotoLocation, WALK, 0);
  17173. Commands->Action_Goto(obj, params);
  17174. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
  17175. }
  17176. else
  17177. {
  17178. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  17179. }
  17180. }
  17181. else if (param == M01_GOTO_INNATE_JDG)//escort scenario is over--go to top of HON and goto innate
  17182. {
  17183. escorting = false;
  17184. Commands->Set_Innate_Is_Stationary ( obj, false );
  17185. Commands->Enable_Hibernation( obj, true );
  17186. Vector3 myGotoLocation (-178.263f, 528.363f, 10.034f);
  17187. ActionParamsStruct params;
  17188. params.Set_Basic(this, 60, M01_WALKING_WAYPATH_03_JDG);
  17189. params.Set_Movement(myGotoLocation, RUN, 5);
  17190. Commands->Action_Goto(obj, params);
  17191. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 5 );
  17192. }
  17193. }
  17194. }
  17195. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  17196. {
  17197. if (complete_reason == ACTION_COMPLETE_NORMAL)
  17198. {
  17199. if (action_id == M01_WALKING_WAYPATH_02_JDG)
  17200. {
  17201. float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
  17202. if (handOfNodHealth > 0)
  17203. {
  17204. at_final_destination = true;
  17205. Commands->Set_Innate_Is_Stationary ( obj, true );
  17206. GameObject * MCTspeechZone = Commands->Find_Object ( 124260 );
  17207. if (MCTspeechZone != NULL)
  17208. {
  17209. Commands->Send_Custom_Event( obj, MCTspeechZone, 0, M01_START_ACTING_JDG, 0 );
  17210. }
  17211. }
  17212. else
  17213. {
  17214. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
  17215. }
  17216. }
  17217. }
  17218. }
  17219. };
  17220. DECLARE_SCRIPT(M01_GiveMCTSpeech_Zone_JDG, "")//124260
  17221. {
  17222. bool commandClearance;
  17223. bool player_in_warroom;
  17224. int gdiGuy01_id;
  17225. int gdiGuy02_id;
  17226. bool convPlaying;
  17227. int hon_gdi_guy_conv1;
  17228. REGISTER_VARIABLES()
  17229. {
  17230. SAVE_VARIABLE(commandClearance, 1);
  17231. SAVE_VARIABLE(player_in_warroom, 2);
  17232. SAVE_VARIABLE(gdiGuy01_id, 3);
  17233. SAVE_VARIABLE(gdiGuy02_id, 4);
  17234. SAVE_VARIABLE(convPlaying, 5);
  17235. SAVE_VARIABLE(hon_gdi_guy_conv1, 6);
  17236. }
  17237. void Created( GameObject * obj )
  17238. {
  17239. player_in_warroom = false;
  17240. commandClearance = false;
  17241. convPlaying = false;
  17242. gdiGuy01_id = 0;
  17243. gdiGuy02_id = 0;
  17244. }
  17245. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  17246. {
  17247. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  17248. {
  17249. if (action_id == hon_gdi_guy_conv1)
  17250. {
  17251. GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
  17252. GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
  17253. if (gdiGuy01 != NULL)
  17254. {
  17255. Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_GOTO_INNATE_JDG, 0 );
  17256. }
  17257. if (gdiGuy02 != NULL)
  17258. {
  17259. Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_GOTO_INNATE_JDG, 0 );
  17260. }
  17261. Commands->Destroy_Object ( obj );
  17262. }
  17263. }
  17264. }
  17265. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17266. {
  17267. if (obj && type == 0)
  17268. {
  17269. if (param == M01_ROPE_IS_SENDING_ID_JDG)//gdi guy 01 is actually sending his id
  17270. {
  17271. gdiGuy01_id = Commands->Get_ID ( sender );
  17272. }
  17273. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//gdi guy 02 is actually sending his id
  17274. {
  17275. gdiGuy02_id = Commands->Get_ID ( sender );
  17276. }
  17277. else if (param == M01_START_ACTING_JDG)
  17278. {
  17279. commandClearance = true;
  17280. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  17281. }
  17282. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  17283. {
  17284. if (commandClearance == true && player_in_warroom == true)
  17285. {
  17286. GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
  17287. GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
  17288. if (gdiGuy01 != NULL && convPlaying == false)
  17289. {
  17290. convPlaying = true;
  17291. hon_gdi_guy_conv1 = Commands->Create_Conversation( "M01_GDI_HON_MCT", 100, 1000, false);
  17292. Commands->Join_Conversation( gdiGuy01, hon_gdi_guy_conv1, false, true, true );
  17293. Commands->Join_Conversation( STAR, hon_gdi_guy_conv1, false, false, false );
  17294. Commands->Start_Conversation( hon_gdi_guy_conv1, hon_gdi_guy_conv1 );
  17295. Commands->Monitor_Conversation( obj, hon_gdi_guy_conv1 );
  17296. }
  17297. else if (gdiGuy02 != NULL && convPlaying == false)
  17298. {
  17299. convPlaying = true;
  17300. hon_gdi_guy_conv1 = Commands->Create_Conversation( "M01_GDI_HON_MCT", 100, 1000, false);
  17301. Commands->Join_Conversation( gdiGuy02, hon_gdi_guy_conv1, false, true, true );
  17302. Commands->Join_Conversation( STAR, hon_gdi_guy_conv1, false, false, false );
  17303. Commands->Start_Conversation( hon_gdi_guy_conv1, hon_gdi_guy_conv1 );
  17304. Commands->Monitor_Conversation( obj, hon_gdi_guy_conv1 );
  17305. }
  17306. }
  17307. }
  17308. }
  17309. }
  17310. void Entered( GameObject * obj, GameObject * enterer )
  17311. {
  17312. if (enterer == STAR)
  17313. {
  17314. player_in_warroom = true;
  17315. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  17316. }
  17317. }
  17318. void Exited( GameObject * obj, GameObject * exiter )
  17319. {
  17320. if (exiter == STAR)
  17321. {
  17322. player_in_warroom = false;
  17323. }
  17324. }
  17325. };
  17326. DECLARE_SCRIPT(M01_Havoc_In_WarroomZone_JDG, "")
  17327. {
  17328. void Entered( GameObject * obj, GameObject * enterer )
  17329. {
  17330. if (enterer == STAR)
  17331. {
  17332. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  17333. if (HON_MonitorZone != NULL)
  17334. {
  17335. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_PLAYER_IS_INSIDE_REFINERY_JDG, 0 );
  17336. }
  17337. }
  17338. }
  17339. };
  17340. DECLARE_SCRIPT(M01_Havoc_Out_WarroomZone_JDG, "")
  17341. {
  17342. void Entered( GameObject * obj, GameObject * enterer )
  17343. {
  17344. if (enterer == STAR)
  17345. {
  17346. GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
  17347. if (HON_MonitorZone != NULL)
  17348. {
  17349. Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_PLAYER_IS_OUTSIDE_REFINERY_JDG, 0 );
  17350. }
  17351. }
  17352. }
  17353. };
  17354. DECLARE_SCRIPT(M01_HON_WarroomController_JDG, "")//124044
  17355. {
  17356. int gdiGuy01_id;
  17357. int gdiGuy02_id;
  17358. bool player_in_warroom;
  17359. bool scenario_over;
  17360. int dead_soldier_tally;
  17361. REGISTER_VARIABLES()
  17362. {
  17363. SAVE_VARIABLE(gdiGuy01_id, 1);
  17364. SAVE_VARIABLE(gdiGuy02_id, 2);
  17365. SAVE_VARIABLE(player_in_warroom, 3);
  17366. SAVE_VARIABLE(scenario_over, 4);
  17367. SAVE_VARIABLE(dead_soldier_tally, 5);
  17368. }
  17369. void Created( GameObject * obj )
  17370. {
  17371. gdiGuy01_id = 0;
  17372. gdiGuy02_id = 0;
  17373. player_in_warroom = false;
  17374. scenario_over = false;
  17375. dead_soldier_tally = 0;
  17376. }
  17377. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17378. {
  17379. if (obj && type == 0)
  17380. {
  17381. if (param == M01_ROPE_IS_SENDING_ID_JDG)//gdi guy 01 is actually sending his id
  17382. {
  17383. gdiGuy01_id = Commands->Get_ID ( sender );
  17384. }
  17385. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//gdi guy 02 is actually sending his id
  17386. {
  17387. gdiGuy02_id = Commands->Get_ID ( sender );
  17388. }
  17389. else if (param == M01_PLAYER_IS_INSIDE_REFINERY_JDG)//player is actually in warroom
  17390. {
  17391. player_in_warroom = true;
  17392. }
  17393. else if (param == M01_PLAYER_IS_OUTSIDE_REFINERY_JDG)//player just left the warroom
  17394. {
  17395. player_in_warroom = false;
  17396. }
  17397. else if (param == M01_IVE_BEEN_KILLED_JDG)
  17398. {
  17399. dead_soldier_tally++;
  17400. if (dead_soldier_tally == 2)
  17401. {
  17402. dead_soldier_tally = 0;
  17403. GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-147.1f, 558.8f, 4.4f));
  17404. Commands->Set_Facing(chinook_obj1, -130.00f);
  17405. Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01a.txt");
  17406. }
  17407. }
  17408. }
  17409. }
  17410. void Entered( GameObject * obj, GameObject * enterer )
  17411. {
  17412. GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
  17413. GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
  17414. if (enterer == gdiGuy01)
  17415. {
  17416. if (player_in_warroom == false)
  17417. {
  17418. Commands->Apply_Damage( gdiGuy01, 10000.0f, "STEEL");
  17419. }
  17420. else if (gdiGuy01 != NULL)
  17421. {
  17422. Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_START_ACTING_JDG, 0 );
  17423. }
  17424. }
  17425. else if (enterer == gdiGuy02)
  17426. {
  17427. if (player_in_warroom == false)
  17428. {
  17429. Commands->Apply_Damage( gdiGuy02, 10000.0f, "STEEL");
  17430. }
  17431. else if (gdiGuy02 != NULL)
  17432. {
  17433. Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_START_ACTING_JDG, 0 );
  17434. }
  17435. }
  17436. }
  17437. };
  17438. DECLARE_SCRIPT(M01_Medium_Tank01_JDG, "")
  17439. {
  17440. void Created( GameObject * obj )
  17441. {
  17442. GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
  17443. if (hovercraftExplosionController != NULL)
  17444. {
  17445. Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
  17446. }
  17447. }
  17448. };
  17449. DECLARE_SCRIPT(M01_CantBring_MediumTank_ThroughHereZone_JDG, "")
  17450. {
  17451. bool player_in_tank;
  17452. int tank_id;
  17453. REGISTER_VARIABLES()
  17454. {
  17455. SAVE_VARIABLE(player_in_tank, 1);
  17456. SAVE_VARIABLE(tank_id, 2);
  17457. }
  17458. void Created( GameObject * obj )
  17459. {
  17460. player_in_tank = false;
  17461. }
  17462. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17463. {
  17464. if (type == 0)
  17465. {
  17466. if (param == M01_MODIFY_YOUR_ACTION_JDG )
  17467. {
  17468. player_in_tank = true;
  17469. }
  17470. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG )
  17471. {
  17472. player_in_tank = false;
  17473. }
  17474. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG )//medium tank is sending his id
  17475. {
  17476. tank_id = Commands->Get_ID ( sender );
  17477. }
  17478. }
  17479. }
  17480. void Entered( GameObject * obj, GameObject * enterer )
  17481. {
  17482. GameObject * tank = Commands->Find_Object ( tank_id );
  17483. if (enterer == tank)
  17484. {
  17485. if (player_in_tank == true)//M01_Must_Leave_Tank_Conversation
  17486. {
  17487. int hoofit_conv = Commands->Create_Conversation( "M01_Must_Leave_Tank_Conversation", 100, 100, true);
  17488. Commands->Join_Conversation( NULL, hoofit_conv, true, true );
  17489. Commands->Start_Conversation( hoofit_conv, hoofit_conv );
  17490. Commands->Destroy_Object ( obj );
  17491. }
  17492. }
  17493. }
  17494. };
  17495. DECLARE_SCRIPT(M01_Medium_Tank_JDG, "")
  17496. {
  17497. bool firstTimeEntered;
  17498. REGISTER_VARIABLES()
  17499. {
  17500. SAVE_VARIABLE(firstTimeEntered, 1);
  17501. }
  17502. void Created( GameObject * obj )
  17503. {
  17504. Commands->Create_Sound ( "m00evag_dsgn0009i1evag_snd", Vector3 (0,0,0), obj);
  17505. firstTimeEntered = true;
  17506. int m01_medium_tank_ID = Commands->Get_ID ( obj );
  17507. GameObject * tunnelZone = Commands->Find_Object ( M01_TANK_TUNNEL_ZONE_ID );
  17508. if (tunnelZone != NULL)
  17509. {
  17510. Commands->Send_Custom_Event( obj, tunnelZone, M01_MEDIUM_TANK_IS_HERE_JDG, m01_medium_tank_ID, 0 );
  17511. }
  17512. GameObject * honSamSite = Commands->Find_Object ( M01_HON_SAM_SITE_JDG );
  17513. if (honSamSite != NULL)
  17514. {
  17515. Commands->Send_Custom_Event( obj, honSamSite, M00_CUSTOM_SAM_SITE_IGNORE, m01_medium_tank_ID, 0 );
  17516. }
  17517. GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
  17518. if (fodderHovercraftController != NULL)
  17519. {
  17520. Commands->Destroy_Object ( fodderHovercraftController );
  17521. }
  17522. GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
  17523. if (tankReminderZone != NULL)
  17524. {
  17525. Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_START_ACTING_JDG, 0 );
  17526. }
  17527. GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
  17528. if (tankBarrierZone != NULL)
  17529. {
  17530. Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  17531. }
  17532. }
  17533. void Custom( GameObject * obj, int type, int param, GameObject * sender ) //
  17534. {
  17535. if (type == CUSTOM_EVENT_VEHICLE_ENTERED )
  17536. {
  17537. if (firstTimeEntered == true)
  17538. {
  17539. firstTimeEntered = false;
  17540. Vector3 guy01Position (40.286f, 151.346f, 2.107f);
  17541. Vector3 guy02Position (47.476f, 163.355f, 2.458f);
  17542. Vector3 guy03Position (59.446f, 175.107f, -0.453f);
  17543. GameObject * tunnelGuy01 = Commands->Create_Object ( "Nod_Minigunner_0", guy01Position );
  17544. GameObject * tunnelGuy02 = Commands->Create_Object ( "Nod_Minigunner_0", guy02Position );
  17545. GameObject * tunnelGuy03 = Commands->Create_Object ( "Nod_Minigunner_0", guy03Position );
  17546. Commands->Attach_Script(tunnelGuy01, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
  17547. Commands->Attach_Script(tunnelGuy02, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
  17548. Commands->Attach_Script(tunnelGuy03, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
  17549. Commands->Action_Reset ( obj, 100 );
  17550. }
  17551. GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
  17552. if (tankReminderZone != NULL)
  17553. {
  17554. Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  17555. }
  17556. GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
  17557. if (tankBarrierZone != NULL)
  17558. {
  17559. Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  17560. }
  17561. }
  17562. else if (type == CUSTOM_EVENT_VEHICLE_EXITED )
  17563. {
  17564. GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
  17565. if (tankReminderZone != NULL)
  17566. {
  17567. Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  17568. }
  17569. GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
  17570. if (tankBarrierZone != NULL)
  17571. {
  17572. Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  17573. }
  17574. }
  17575. }
  17576. };
  17577. DECLARE_SCRIPT(M01_TurretBeach_FodderHovercraft_Controller_JDG, "")//121630 M01_START_ACTING_JDG
  17578. {
  17579. int hovercraft_ID;
  17580. bool hovercraftAlive;
  17581. REGISTER_VARIABLES()
  17582. {
  17583. SAVE_VARIABLE(hovercraftAlive, 1);
  17584. SAVE_VARIABLE(hovercraft_ID, 2);
  17585. }
  17586. void Created( GameObject * obj )
  17587. {
  17588. hovercraftAlive = false;
  17589. }
  17590. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17591. {
  17592. if (type == 0)
  17593. {
  17594. if (param == M01_START_ACTING_JDG && hovercraftAlive == false)//turret objective has been added--start bringing in hovercraft
  17595. {
  17596. GameObject * oldHovercraft = Commands->Find_Object ( hovercraft_ID );
  17597. if (oldHovercraft == NULL)
  17598. {
  17599. hovercraftAlive = true;
  17600. GameObject * hovercraft = Commands->Create_Object ( "Invisible_Object", Vector3 (0,0,0));
  17601. Commands->Attach_Script(hovercraft, "Test_Cinematic", "X1D_FodderHover_MTank.txt");
  17602. }
  17603. else
  17604. {
  17605. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
  17606. }
  17607. }
  17608. else if (param == M01_IVE_BEEN_KILLED_JDG)
  17609. {
  17610. hovercraftAlive = false;
  17611. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 15 );
  17612. }
  17613. else if (param == 0)//hovercraft is sending you its ID
  17614. {
  17615. hovercraft_ID = Commands->Get_ID ( sender );
  17616. hovercraftAlive = true;
  17617. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  17618. if (turret01 != NULL)
  17619. {
  17620. Commands->Send_Custom_Event( obj, turret01, M01_FODDER_HOVERCRAFT_IS_HERE, hovercraft_ID, 1 );
  17621. }
  17622. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  17623. if (turret02 != NULL)
  17624. {
  17625. Commands->Send_Custom_Event( obj, turret02, M01_FODDER_HOVERCRAFT_IS_HERE, hovercraft_ID, 1 );
  17626. }
  17627. //Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 15 );
  17628. }
  17629. }
  17630. }
  17631. };
  17632. DECLARE_SCRIPT(M01_Hovercraft_Explosion_Controller_JDG, "")//121839
  17633. {
  17634. int tank_id;
  17635. REGISTER_VARIABLES()
  17636. {
  17637. SAVE_VARIABLE(tank_id, 1);
  17638. }
  17639. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17640. {
  17641. if (type == 0)
  17642. {
  17643. if (param == M01_MEDIUM_TANK_IS_HERE_JDG)//medium tank is sending its id
  17644. {
  17645. tank_id = Commands->Get_ID ( sender );
  17646. }
  17647. else if (param == M01_IVE_BEEN_KILLED_JDG)//hovercraft has been destroyed--delete tank and play explosion
  17648. {
  17649. GameObject * mediumTank = Commands->Find_Object ( tank_id );
  17650. if (mediumTank != NULL)
  17651. {
  17652. //Commands->Destroy_Object ( mediumTank );
  17653. Commands->Apply_Damage( mediumTank, 100000, "Steel", NULL );
  17654. }
  17655. }
  17656. }
  17657. }
  17658. };
  17659. DECLARE_SCRIPT(M01_FodderHovercraft_Script_JDG, "")
  17660. {
  17661. void Created( GameObject * obj )
  17662. {
  17663. GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
  17664. if (fodderHovercraftController != NULL)
  17665. {
  17666. Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, 0, 0 );
  17667. }
  17668. //GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
  17669. //if (hovercraftExplosionController != NULL)
  17670. //{
  17671. // Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
  17672. //}
  17673. float delayTimer = Commands->Get_Random ( 5, 8 );
  17674. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  17675. }
  17676. void Damaged( GameObject * obj, GameObject * damager, float amount )
  17677. {
  17678. //GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  17679. //GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  17680. //if ((damager == turret01) || (damager == turret02))
  17681. //{
  17682. // Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
  17683. //}
  17684. }
  17685. void Killed( GameObject * obj, GameObject * killer )
  17686. {
  17687. //Vector3 myPosition = Commands->Get_Position ( obj );
  17688. //Commands->Create_Explosion ( "Ground Explosions Twiddler", myPosition, NULL );
  17689. GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
  17690. if (fodderHovercraftController != NULL)
  17691. {
  17692. Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  17693. }
  17694. //GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
  17695. //if (fodderHovercraftController != NULL)
  17696. //{
  17697. // Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, M01_START_ACTING_JDG, 5 );
  17698. //}
  17699. GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
  17700. if (hovercraftExplosionController != NULL)
  17701. {
  17702. Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  17703. }
  17704. }
  17705. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17706. {
  17707. if (type == 0)
  17708. {
  17709. if (param == M01_START_ACTING_JDG)
  17710. {
  17711. GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
  17712. GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
  17713. if (turret01 != NULL)
  17714. {
  17715. Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
  17716. }
  17717. else if (turret02 != NULL)
  17718. {
  17719. Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
  17720. }
  17721. }
  17722. }
  17723. }
  17724. };
  17725. DECLARE_SCRIPT(M01_Beach_Datadisc_JDG, "")
  17726. {
  17727. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17728. {
  17729. if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the GDI base
  17730. {
  17731. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17732. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17733. if (dataDiskController != NULL)
  17734. {
  17735. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17736. }
  17737. Commands->Clear_Map_Cell ( 10, 15 );
  17738. Commands->Clear_Map_Cell ( 10, 16 );
  17739. Commands->Clear_Map_Cell ( 10, 17 );
  17740. Commands->Clear_Map_Cell ( 10, 18 );
  17741. Commands->Clear_Map_Cell ( 10, 19 );
  17742. Commands->Clear_Map_Cell ( 10, 20 );
  17743. Commands->Clear_Map_Cell ( 11, 15 );
  17744. Commands->Clear_Map_Cell ( 11, 16 );
  17745. Commands->Clear_Map_Cell ( 11, 17 );
  17746. Commands->Clear_Map_Cell ( 11, 18 );
  17747. Commands->Clear_Map_Cell ( 11, 19 );
  17748. Commands->Clear_Map_Cell ( 11, 20 );
  17749. Commands->Clear_Map_Cell ( 12, 15 );
  17750. Commands->Clear_Map_Cell ( 12, 16 );
  17751. Commands->Clear_Map_Cell ( 12, 17 );
  17752. Commands->Clear_Map_Cell ( 12, 18 );
  17753. Commands->Clear_Map_Cell ( 12, 19 );
  17754. Commands->Clear_Map_Cell ( 12, 20 );
  17755. Commands->Clear_Map_Cell ( 13, 15 );
  17756. Commands->Clear_Map_Cell ( 13, 16 );
  17757. Commands->Clear_Map_Cell ( 13, 17 );
  17758. Commands->Clear_Map_Cell ( 13, 18 );
  17759. Commands->Clear_Map_Cell ( 13, 19 );
  17760. Commands->Clear_Map_Cell ( 13, 20 );
  17761. Commands->Clear_Map_Cell ( 14, 15 );
  17762. Commands->Clear_Map_Cell ( 14, 16 );
  17763. Commands->Clear_Map_Cell ( 14, 17 );
  17764. Commands->Clear_Map_Cell ( 14, 18 );
  17765. Commands->Clear_Map_Cell ( 14, 19 );
  17766. Commands->Clear_Map_Cell ( 14, 20 );
  17767. }
  17768. }
  17769. };
  17770. DECLARE_SCRIPT(M01_TibCave01_Datadisc_JDG, "")//shows the barn area
  17771. {
  17772. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17773. {
  17774. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  17775. {
  17776. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17777. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17778. if (dataDiskController != NULL)
  17779. {
  17780. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17781. }
  17782. Commands->Clear_Map_Cell ( 6, 13 );
  17783. Commands->Clear_Map_Cell ( 6, 14 );
  17784. Commands->Clear_Map_Cell ( 7, 11 );
  17785. Commands->Clear_Map_Cell ( 7, 12 );
  17786. Commands->Clear_Map_Cell ( 7, 13 );
  17787. Commands->Clear_Map_Cell ( 7, 14 );
  17788. Commands->Clear_Map_Cell ( 7, 15 );
  17789. Commands->Clear_Map_Cell ( 8, 11 );
  17790. Commands->Clear_Map_Cell ( 8, 12 );
  17791. Commands->Clear_Map_Cell ( 8, 13 );
  17792. Commands->Clear_Map_Cell ( 8, 14 );
  17793. Commands->Clear_Map_Cell ( 8, 15 );
  17794. Commands->Clear_Map_Cell ( 9, 11 );
  17795. Commands->Clear_Map_Cell ( 9, 12 );
  17796. Commands->Clear_Map_Cell ( 9, 13 );
  17797. Commands->Clear_Map_Cell ( 9, 14 );
  17798. Commands->Clear_Map_Cell ( 9, 15 );
  17799. Commands->Clear_Map_Cell ( 10, 11 );
  17800. Commands->Clear_Map_Cell ( 10, 12 );
  17801. Commands->Clear_Map_Cell ( 10, 13 );
  17802. Commands->Clear_Map_Cell ( 10, 14 );
  17803. Commands->Clear_Map_Cell ( 10, 15 );
  17804. Commands->Clear_Map_Cell ( 11, 12 );
  17805. Commands->Clear_Map_Cell ( 11, 13 );
  17806. Commands->Clear_Map_Cell ( 11, 14 );
  17807. Commands->Clear_Map_Cell ( 11, 15 );
  17808. }
  17809. }
  17810. };
  17811. DECLARE_SCRIPT(M01_Shed_Datadisc_JDG, "")//shows the light tank area
  17812. {
  17813. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17814. {
  17815. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  17816. {
  17817. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17818. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17819. if (dataDiskController != NULL)
  17820. {
  17821. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17822. }
  17823. Commands->Clear_Map_Cell ( 9, 9 );
  17824. Commands->Clear_Map_Cell ( 9, 10 );
  17825. Commands->Clear_Map_Cell ( 10, 9 );
  17826. Commands->Clear_Map_Cell ( 10, 10 );
  17827. Commands->Clear_Map_Cell ( 10, 11 );
  17828. Commands->Clear_Map_Cell ( 11, 9 );
  17829. Commands->Clear_Map_Cell ( 11, 10 );
  17830. Commands->Clear_Map_Cell ( 11, 11 );
  17831. Commands->Clear_Map_Cell ( 11, 12 );
  17832. Commands->Clear_Map_Cell ( 12, 9 );
  17833. Commands->Clear_Map_Cell ( 12, 10 );
  17834. Commands->Clear_Map_Cell ( 12, 11 );
  17835. Commands->Clear_Map_Cell ( 12, 12 );
  17836. Commands->Clear_Map_Cell ( 13, 9 );
  17837. Commands->Clear_Map_Cell ( 13, 10 );
  17838. Commands->Clear_Map_Cell ( 13, 11 );
  17839. Commands->Clear_Map_Cell ( 13, 12 );
  17840. Commands->Clear_Map_Cell ( 14, 10 );
  17841. Commands->Clear_Map_Cell ( 14, 11 );
  17842. Commands->Clear_Map_Cell ( 14, 12 );
  17843. }
  17844. }
  17845. };
  17846. DECLARE_SCRIPT(M01_TibCave02_Datadisc_JDG, "")//tib cave no
  17847. {
  17848. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17849. {
  17850. if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the church and tib field
  17851. {
  17852. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17853. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17854. if (dataDiskController != NULL)
  17855. {
  17856. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17857. }
  17858. Commands->Clear_Map_Cell ( 6, 5 );
  17859. Commands->Clear_Map_Cell ( 6, 6 );
  17860. Commands->Clear_Map_Cell ( 6, 7 );
  17861. Commands->Clear_Map_Cell ( 6, 8 );
  17862. Commands->Clear_Map_Cell ( 6, 9 );
  17863. Commands->Clear_Map_Cell ( 7, 5 );
  17864. Commands->Clear_Map_Cell ( 7, 6 );
  17865. Commands->Clear_Map_Cell ( 7, 7 );
  17866. Commands->Clear_Map_Cell ( 7, 8 );
  17867. Commands->Clear_Map_Cell ( 7, 9 );
  17868. Commands->Clear_Map_Cell ( 8, 5 );
  17869. Commands->Clear_Map_Cell ( 8, 6 );
  17870. Commands->Clear_Map_Cell ( 8, 7 );
  17871. Commands->Clear_Map_Cell ( 8, 8 );
  17872. Commands->Clear_Map_Cell ( 8, 9 );
  17873. Commands->Clear_Map_Cell ( 9, 5 );
  17874. Commands->Clear_Map_Cell ( 9, 6 );
  17875. Commands->Clear_Map_Cell ( 9, 7 );
  17876. Commands->Clear_Map_Cell ( 9, 8 );
  17877. Commands->Clear_Map_Cell ( 9, 9 );
  17878. Commands->Clear_Map_Cell ( 10, 5 );
  17879. Commands->Clear_Map_Cell ( 10, 6 );
  17880. Commands->Clear_Map_Cell ( 10, 7 );
  17881. Commands->Clear_Map_Cell ( 10, 8 );
  17882. Commands->Clear_Map_Cell ( 10, 9 );
  17883. Commands->Clear_Map_Cell ( 11, 6 );
  17884. Commands->Clear_Map_Cell ( 11, 7 );
  17885. Commands->Clear_Map_Cell ( 11, 8 );
  17886. Commands->Clear_Map_Cell ( 11, 9 );
  17887. }
  17888. }
  17889. };
  17890. DECLARE_SCRIPT(M01_Priest_Datadisc_JDG, "")
  17891. {
  17892. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17893. {
  17894. if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the hand of nod
  17895. {
  17896. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17897. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17898. if (dataDiskController != NULL)
  17899. {
  17900. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17901. }
  17902. Commands->Clear_Map_Cell ( 5, 1 );
  17903. Commands->Clear_Map_Cell ( 5, 2 );
  17904. Commands->Clear_Map_Cell ( 5, 3 );
  17905. Commands->Clear_Map_Cell ( 5, 4 );
  17906. Commands->Clear_Map_Cell ( 5, 5 );
  17907. Commands->Clear_Map_Cell ( 6, 1 );
  17908. Commands->Clear_Map_Cell ( 6, 2 );
  17909. Commands->Clear_Map_Cell ( 6, 3 );
  17910. Commands->Clear_Map_Cell ( 6, 4 );
  17911. Commands->Clear_Map_Cell ( 6, 5 );
  17912. Commands->Clear_Map_Cell ( 7, 1 );
  17913. Commands->Clear_Map_Cell ( 7, 2 );
  17914. Commands->Clear_Map_Cell ( 7, 3 );
  17915. Commands->Clear_Map_Cell ( 7, 4 );
  17916. Commands->Clear_Map_Cell ( 7, 5 );
  17917. Commands->Clear_Map_Cell ( 8, 1 );
  17918. Commands->Clear_Map_Cell ( 8, 2 );
  17919. Commands->Clear_Map_Cell ( 8, 3 );
  17920. Commands->Clear_Map_Cell ( 8, 4 );
  17921. Commands->Clear_Map_Cell ( 8, 5 );
  17922. Commands->Clear_Map_Cell ( 9, 1 );
  17923. Commands->Clear_Map_Cell ( 9, 2 );
  17924. Commands->Clear_Map_Cell ( 9, 3 );
  17925. Commands->Clear_Map_Cell ( 9, 4 );
  17926. Commands->Clear_Map_Cell ( 9, 5 );
  17927. }
  17928. }
  17929. };
  17930. DECLARE_SCRIPT(M01_Medlab_Datadisc_JDG, "")
  17931. {
  17932. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17933. {
  17934. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  17935. {
  17936. Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
  17937. Commands->Reveal_Map ( );
  17938. GameObject * dataDiskController = Commands->Find_Object ( 117188 );
  17939. if (dataDiskController != NULL)
  17940. {
  17941. Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
  17942. }
  17943. }
  17944. }
  17945. };
  17946. DECLARE_SCRIPT(M01_DataDisc_TextController_JDG, "")//117188
  17947. {
  17948. bool playingText;
  17949. REGISTER_VARIABLES()
  17950. {
  17951. SAVE_VARIABLE(playingText, 1);
  17952. }
  17953. void Created( GameObject * obj )
  17954. {
  17955. playingText = false;
  17956. }
  17957. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  17958. {
  17959. if ( type == 0 )
  17960. {
  17961. if (param == 10)//now show the text message for ESC key
  17962. {
  17963. playingText = true;
  17964. int pressEnterConv = Commands->Create_Conversation( "M01_Press_ESC_for_Map_Conversation", 100, 1000, true);
  17965. Commands->Join_Conversation( NULL, pressEnterConv, false, false );
  17966. Commands->Start_Conversation( pressEnterConv, pressEnterConv );
  17967. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0517I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  17968. Commands->Send_Custom_Event( obj, obj, 0, 11, 2 );
  17969. }
  17970. else if (param == 11)
  17971. {
  17972. playingText = false;
  17973. }
  17974. }
  17975. else if (type == 1)
  17976. {
  17977. if (param == 1 && playingText == false)//player has picked up a C4 -- start text routine
  17978. {
  17979. int pressF1Conv = Commands->Create_Conversation( "M01_C4_Tutorial_Conversation", 100, 1000, true);
  17980. Commands->Join_Conversation( NULL, pressF1Conv, false, false );
  17981. Commands->Start_Conversation( pressF1Conv, pressF1Conv );
  17982. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0519I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Press '9' to select Remote C4.\n
  17983. Commands->Send_Custom_Event( obj, obj, 1, 2, 2 );
  17984. playingText = true;
  17985. }
  17986. else if (param == 2)
  17987. {
  17988. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0523I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Left-click your mouse to place C4.\n
  17989. Commands->Send_Custom_Event( obj, obj, 1, 3, 2 );
  17990. }
  17991. else if (param == 3)
  17992. {
  17993. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0524I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Right-click your mouse to detonate.\n
  17994. Commands->Send_Custom_Event( obj, obj, 1, 4, 2 );
  17995. }
  17996. else if (param == 4)
  17997. {
  17998. playingText = false;
  17999. }
  18000. }
  18001. else if (type == 2)//player has picked up sniper rifle
  18002. {
  18003. if (param == 1 && playingText == false)//player has picked up a C4 -- start text routine
  18004. {
  18005. int pressF1Conv = Commands->Create_Conversation( "M01_Sniper_Tutorial_Conversation", 100, 1000, true);
  18006. Commands->Join_Conversation( NULL, pressF1Conv, false, false );
  18007. Commands->Start_Conversation( pressF1Conv, pressF1Conv );
  18008. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0518I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Press '3' to select your Sniper Rifle.\n
  18009. Commands->Send_Custom_Event( obj, obj, 2, 2, 2 );
  18010. playingText = true;
  18011. }
  18012. else if (param == 2)
  18013. {
  18014. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0521I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Right-click your mouse for sniper mode.\n
  18015. Commands->Send_Custom_Event( obj, obj, 2, 3, 2 );
  18016. }
  18017. else if (param == 3)
  18018. {
  18019. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0522I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Use the mouse wheel or 'G' and 'T' to zoom.\n
  18020. Commands->Send_Custom_Event( obj, obj, 2, 4, 2 );
  18021. }
  18022. else if (param == 4)
  18023. {
  18024. playingText = false;
  18025. }
  18026. }
  18027. }
  18028. };
  18029. DECLARE_SCRIPT(M01_Duncan_Assailer_JDG, "")
  18030. {
  18031. void Killed( GameObject * obj, GameObject * killer )
  18032. {
  18033. GameObject * convController = Commands->Find_Object ( 125857 );
  18034. if (convController != NULL)
  18035. {
  18036. Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  18037. }
  18038. }
  18039. };
  18040. DECLARE_SCRIPT(M01_Duncan_InHere_ConvController_JDG, "")
  18041. {
  18042. int deadNodGuys;
  18043. bool duncanDiscovered;
  18044. REGISTER_VARIABLES()
  18045. {
  18046. SAVE_VARIABLE(deadNodGuys, 1);
  18047. SAVE_VARIABLE(duncanDiscovered, 2);
  18048. }
  18049. void Created( GameObject * obj )
  18050. {
  18051. deadNodGuys = 0;
  18052. duncanDiscovered = false;
  18053. }
  18054. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  18055. {
  18056. if (type == 0)
  18057. {
  18058. if (param == M01_IVE_BEEN_KILLED_JDG)
  18059. {
  18060. deadNodGuys++;
  18061. if (deadNodGuys >= 4)
  18062. {
  18063. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 2 );
  18064. }
  18065. }
  18066. else if (param == M01_START_ACTING_JDG && duncanDiscovered == false)//start playing "in here" conversation
  18067. {
  18068. GameObject * captDuncan = Commands->Find_Object ( 106050 );
  18069. if (captDuncan)
  18070. {
  18071. int inhere_conv = Commands->Create_Conversation( "M01_DuncanInHere_Conversation", 100, 20, false);
  18072. Commands->Join_Conversation( captDuncan, inhere_conv, false, true, true );
  18073. Commands->Join_Conversation( STAR, inhere_conv, false, false, false );
  18074. Commands->Start_Conversation( inhere_conv, inhere_conv );
  18075. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 10 );
  18076. }
  18077. }
  18078. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  18079. {
  18080. duncanDiscovered = true;
  18081. }
  18082. }
  18083. }
  18084. };
  18085. DECLARE_SCRIPT(M01_BackPath_EntranceZone_JDG, "")//121433
  18086. {
  18087. void Entered( GameObject * obj, GameObject * enterer )
  18088. {
  18089. if (enterer == STAR)
  18090. {
  18091. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  18092. }
  18093. }
  18094. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  18095. {
  18096. if (type == 0)
  18097. {
  18098. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  18099. {
  18100. GameObject * gdiMinigunner = Commands->Find_Object ( 116382 );
  18101. if (gdiMinigunner != NULL)
  18102. {
  18103. Commands->Send_Custom_Event( obj, gdiMinigunner, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0 );
  18104. //this tells him to start the "this is the path" routine
  18105. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 2 );
  18106. }
  18107. }
  18108. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  18109. {
  18110. GameObject * grenadier = Commands->Find_Object ( 116383 );
  18111. if (grenadier != NULL)
  18112. {
  18113. Commands->Send_Custom_Event( obj, grenadier, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0 );//tell grenadier to go down back path too
  18114. }
  18115. Commands->Destroy_Object ( obj );
  18116. }
  18117. }
  18118. }
  18119. };
  18120. DECLARE_SCRIPT(M01_Base_GDI_Minigunner_JDG, "")//116382
  18121. {
  18122. int gdi01conv01;
  18123. int gdi01conv02;
  18124. int gdi01conv03;
  18125. float currentHealth;
  18126. bool invincible;
  18127. bool ducanRescued;
  18128. bool headingDownBackPath;
  18129. bool still_in_GDI_Base;
  18130. bool damagedByNod;
  18131. bool havocDownPath;
  18132. REGISTER_VARIABLES()
  18133. {
  18134. SAVE_VARIABLE(gdi01conv01, 1);
  18135. SAVE_VARIABLE(gdi01conv02, 2);
  18136. SAVE_VARIABLE(currentHealth, 3);
  18137. SAVE_VARIABLE(invincible, 4);
  18138. SAVE_VARIABLE(gdi01conv03, 5);
  18139. SAVE_VARIABLE(ducanRescued, 6);
  18140. SAVE_VARIABLE(headingDownBackPath, 7);
  18141. SAVE_VARIABLE(still_in_GDI_Base, 8);
  18142. SAVE_VARIABLE(damagedByNod, 9);
  18143. SAVE_VARIABLE(havocDownPath, 10);
  18144. }
  18145. void Created( GameObject * obj ) //this guy starts in the guard tower firing over at the conyard
  18146. {
  18147. havocDownPath = false;
  18148. damagedByNod = false;
  18149. invincible = true;
  18150. ducanRescued = false;
  18151. still_in_GDI_Base = true;
  18152. headingDownBackPath = false;
  18153. currentHealth = Commands->Get_Health ( obj );
  18154. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  18155. Commands->Attach_Script(controller1, "Test_Cinematic", "X1C_Intro.txt");
  18156. Vector3 myTarget (72.223f, -24.751f, -0.296f);
  18157. ActionParamsStruct params;
  18158. Commands->Set_Innate_Is_Stationary ( obj, true );
  18159. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  18160. params.Set_Attack( myTarget, 1000, 0, true );
  18161. params.AttackCheckBlocked = false;
  18162. Commands->Action_Attack (obj, params);
  18163. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );//in 2 seconds run to a new position
  18164. }
  18165. void Animation_Complete(GameObject * obj, const char *anim)
  18166. {
  18167. if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
  18168. {
  18169. Commands->Destroy_Object ( obj );
  18170. }
  18171. }
  18172. void Damaged( GameObject * obj, GameObject * damager, float amount )
  18173. {
  18174. GameObject * grenadier = Commands->Find_Object ( 116383 );
  18175. GameObject * nodGuy01 = Commands->Find_Object ( 116388 );
  18176. GameObject * nodGuy02 = Commands->Find_Object ( 116387 );
  18177. if (damager == nodGuy01 || damager == nodGuy02)
  18178. {
  18179. if (damagedByNod == false)
  18180. {
  18181. damagedByNod = true;
  18182. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
  18183. }
  18184. }
  18185. if (invincible == true)
  18186. {
  18187. float myCurrentHealth = Commands->Get_Health ( obj );
  18188. if (myCurrentHealth <= 10)
  18189. {
  18190. Commands->Set_Health ( obj, 10 );
  18191. }
  18192. }
  18193. else if (obj && damager == grenadier)
  18194. {
  18195. Commands->Set_Health ( obj, currentHealth );
  18196. }
  18197. else if (obj)
  18198. {
  18199. currentHealth = Commands->Get_Health ( obj );
  18200. }
  18201. }
  18202. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  18203. {
  18204. ActionParamsStruct params;
  18205. if (type == 0)
  18206. {
  18207. if (param == M01_MODIFY_YOUR_ACTION_JDG)//leave the guard tower and take up second position outside guard tower
  18208. {
  18209. Vector3 newPosition (66.771f, -38.435f, -0.058f);
  18210. Vector3 myTarget (72.223f, -24.751f, -0.296f);
  18211. Commands->Set_Innate_Is_Stationary ( obj, false );
  18212. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  18213. params.Set_Attack( myTarget, 1000, 0, true );
  18214. params.Set_Movement(newPosition, RUN, 1);
  18215. Commands->Action_Goto ( obj, params );
  18216. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-74.184f, -28.372f, 3.157f));
  18217. Commands->Set_Facing ( controller1, 90 );
  18218. Commands->Attach_Script(controller1, "Test_Cinematic", "X01D_C130Troopdrop.txt");
  18219. }
  18220. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//leave outside guard tower and take up third position beside the ladder
  18221. {
  18222. Vector3 newPosition (40.893f, -39.773f, -0.179f);
  18223. Vector3 myTarget (28.449f, -23.325f, 3.032f);
  18224. Commands->Set_Innate_Is_Stationary ( obj, false );
  18225. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  18226. params.Set_Attack( myTarget, 1000, 0, true );
  18227. params.Set_Movement(newPosition, RUN + 0.25f, 1);
  18228. Commands->Action_Goto ( obj, params );
  18229. }
  18230. else if (param == M01_START_ATTACKING_01_JDG)//player is at top of ladders...check if nod minigunner is still alive
  18231. {
  18232. GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(34.165f,41.909f,-10));
  18233. Commands->Attach_Script(controller1, "Test_Cinematic", "XG_Ap_vs_Trn.txt");
  18234. GameObject * nodMinigunner = Commands->Find_Object ( 116384 );
  18235. if (nodMinigunner != NULL)
  18236. {
  18237. Vector3 newPosition (40.893f, -39.773f, -0.179f);
  18238. params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
  18239. params.Set_Movement(newPosition, RUN + 0.25f, 1);
  18240. params.Set_Attack( nodMinigunner, 1000, 0, true );
  18241. params.AttackCrouched = true;
  18242. params.AttackCheckBlocked = false;
  18243. Commands->Action_Attack (obj, params);
  18244. }
  18245. else
  18246. {
  18247. Commands->Action_Reset ( obj, 100 );
  18248. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );//look at havoc
  18249. }
  18250. }
  18251. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//greet havoc M01_GDI01_Conversation_01
  18252. {
  18253. Vector3 playersPosition = Commands->Get_Position ( STAR );
  18254. ActionParamsStruct params;
  18255. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  18256. params.Set_Face_Location( playersPosition, 2 );
  18257. Commands->Action_Face_Location ( obj, params );
  18258. gdi01conv01 = Commands->Create_Conversation( "M01_GDI01_Conversation_01", 100, 1000, false);
  18259. Commands->Join_Conversation( obj, gdi01conv01, true, true, true );
  18260. Commands->Join_Conversation( STAR, gdi01conv01, false, false, false );
  18261. Commands->Start_Conversation( gdi01conv01, gdi01conv01 );
  18262. Commands->Monitor_Conversation( obj, gdi01conv01 );
  18263. GameObject * grenadier = Commands->Find_Object ( 116383 );
  18264. if (grenadier != NULL)
  18265. {
  18266. Commands->Send_Custom_Event( obj, grenadier, 0, M01_START_ACTING_JDG, 0 );//tell grenadier to greet havoc
  18267. }
  18268. }
  18269. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//now add the pow objective
  18270. {
  18271. GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
  18272. if (pogController != NULL)
  18273. {
  18274. Commands->Send_Custom_Event ( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_GDI_BASE_POW_OBJECTIVE_JDG, 0 );
  18275. }
  18276. }
  18277. else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)
  18278. {
  18279. Commands->Enable_Hibernation( obj, false );
  18280. ducanRescued = true;
  18281. headingDownBackPath = false;
  18282. Commands->Action_Reset ( obj, 100 );
  18283. Vector3 myHomeSpot (56.0f, 28.2f, -0.2f);
  18284. Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
  18285. params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
  18286. params.Set_Movement(myHomeSpot, RUN, 1);
  18287. Commands->Action_Goto(obj, params);
  18288. }
  18289. else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
  18290. {
  18291. Commands->Action_Reset ( obj, 100 );
  18292. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  18293. if (myEvacController != NULL)
  18294. {
  18295. Commands->Set_Innate_Is_Stationary ( obj, false );
  18296. Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
  18297. params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
  18298. params.Set_Movement(myHomeSpot, RUN, 1);
  18299. Commands->Action_Goto(obj, params);
  18300. }
  18301. }
  18302. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG && headingDownBackPath == false)//POW conversation is over---wave at havoc
  18303. {
  18304. if (havocDownPath == false)
  18305. {
  18306. Vector3 playersPosition = Commands->Get_Position ( STAR );
  18307. ActionParamsStruct params;
  18308. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  18309. params.Set_Face_Location( playersPosition, 2 );
  18310. Commands->Action_Face_Location ( obj, params );
  18311. gdi01conv03 = Commands->Create_Conversation( "M01_GDI01_Conversation_05", 100, 1000, false);
  18312. Commands->Join_Conversation( obj, gdi01conv03, true, true, true );
  18313. Commands->Join_Conversation( STAR, gdi01conv03, false, false, false );
  18314. Commands->Start_Conversation( gdi01conv03, gdi01conv03 );
  18315. Commands->Monitor_Conversation( obj, gdi01conv03 );//M01_MODIFY_YOUR_ACTION_06_JDG
  18316. }
  18317. else
  18318. {
  18319. still_in_GDI_Base = false;
  18320. Commands->Action_Reset ( obj, 100 );
  18321. headingDownBackPath = true;
  18322. Vector3 newGotoSpot (95.229f, 101.136f, 8.934f);
  18323. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  18324. params.Set_Movement(newGotoSpot, RUN, 1);
  18325. params.AttackActive = false;
  18326. Commands->Action_Attack (obj, params);
  18327. }
  18328. }
  18329. else if (param == M01_MODIFY_YOUR_ACTION_06_JDG && ducanRescued == false)//Head down the path
  18330. {
  18331. havocDownPath = true;
  18332. //Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0.25f );
  18333. }
  18334. else if (param == M01_IVE_BEEN_KILLED_JDG)
  18335. {
  18336. if (still_in_GDI_Base == true)
  18337. {
  18338. invincible = false;
  18339. Commands->Apply_Damage( obj, 100000, "Steel", NULL );
  18340. }
  18341. }
  18342. else if (param == M01_WALKING_WAYPATH_04_JDG)
  18343. {
  18344. GameObject * nodguy01 = Commands->Find_Object ( 116388 );
  18345. if (nodguy01 != NULL)
  18346. {
  18347. Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
  18348. Commands->Set_Innate_Is_Stationary ( obj, false );
  18349. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  18350. params.Set_Movement(myNewSpot, RUN, 1);
  18351. params.Set_Attack( nodguy01, 50, 2, true );
  18352. params.AttackCheckBlocked = false;
  18353. Commands->Action_Attack (obj, params);
  18354. }
  18355. else
  18356. {
  18357. Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
  18358. Commands->Set_Innate_Is_Stationary ( obj, false );
  18359. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  18360. params.Set_Movement(myNewSpot, RUN, 1);
  18361. //params.Set_Attack( nodguy01, 50, 2, true );
  18362. params.AttackCheckBlocked = false;
  18363. Commands->Action_Attack (obj, params);
  18364. }
  18365. }
  18366. }
  18367. }
  18368. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  18369. {
  18370. if (headingDownBackPath == true)
  18371. {
  18372. ActionParamsStruct params;
  18373. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  18374. params.Set_Movement(enemy, WALK, 5);
  18375. params.Set_Attack( enemy, 1000, 0, true );
  18376. params.AttackActive = true;
  18377. Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_06_JDG, params, true, true );
  18378. }
  18379. }
  18380. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  18381. {
  18382. ActionParamsStruct params;
  18383. if (complete_reason == ACTION_COMPLETE_NORMAL)
  18384. {
  18385. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  18386. {
  18387. Vector3 myTarget (72.223f, -24.751f, -0.296f);
  18388. Commands->Set_Innate_Is_Stationary ( obj, true );
  18389. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  18390. params.Set_Attack( myTarget, 1000, 0, true );
  18391. params.AttackCrouched = true;
  18392. params.AttackCheckBlocked = false;
  18393. Commands->Action_Attack (obj, params);
  18394. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 2 );
  18395. }
  18396. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  18397. {
  18398. Vector3 myTarget (28.449f, -23.325f, 3.032f);
  18399. Commands->Set_Innate_Is_Stationary ( obj, true );
  18400. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  18401. params.Set_Attack( myTarget, 1000, 0, true );
  18402. params.AttackCrouched = true;
  18403. params.AttackCheckBlocked = false;
  18404. Commands->Action_Attack (obj, params);
  18405. }
  18406. else if (action_id == M01_START_ATTACKING_01_JDG)
  18407. {
  18408. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  18409. }
  18410. else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
  18411. {
  18412. Commands->Set_Innate_Is_Stationary ( obj, true );
  18413. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  18414. if (myEvacController != NULL)//tell controller to call in a chopper
  18415. {
  18416. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  18417. }
  18418. }
  18419. else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
  18420. {
  18421. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  18422. powerupSpawnLocation.Z += 0.75f;
  18423. char *powerups[2] =
  18424. {//this is a list of potential powerups to be dropped by sniper target guys
  18425. "POW_Health_100",
  18426. "POW_Armor_100",
  18427. };
  18428. int random = Commands->Get_Random_Int(0, 2);
  18429. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  18430. GameObject * myEvacController = Commands->Find_Object ( 106694 );
  18431. if (myEvacController != NULL)//tell controller to spawn a rope
  18432. {
  18433. Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
  18434. }
  18435. }
  18436. else if (action_id == M01_WALKING_WAYPATH_03_JDG)//you are by pows now...run to path entrance and attack nod guy 01 if still alive
  18437. {
  18438. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
  18439. }
  18440. else if (action_id == M01_WALKING_WAYPATH_04_JDG)//Youre target is dead....make sure you goto path entrance.
  18441. {
  18442. Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
  18443. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  18444. params.Set_Movement(myNewSpot, RUN, 1);
  18445. Commands->Action_Goto (obj, params);
  18446. }
  18447. else if (action_id == M01_WALKING_WAYPATH_05_JDG)//Youre at the back path entrance now....goto stationary
  18448. {
  18449. Commands->Set_Innate_Is_Stationary ( obj, true );
  18450. }
  18451. else if (action_id == M01_WALKING_WAYPATH_06_JDG)//you just killed a back path guy...continue your journey
  18452. {
  18453. Vector3 newGotoSpot (95.229f, 101.136f, 8.934f);
  18454. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  18455. params.Set_Movement(newGotoSpot, RUN, 1);
  18456. params.AttackActive = false;
  18457. Commands->Action_Attack (obj, params);
  18458. }
  18459. }
  18460. else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  18461. {
  18462. if (action_id == gdi01conv01)
  18463. {
  18464. gdi01conv02 = Commands->Create_Conversation( "M01_GDI01_Conversation_02", 100, 1000, false);
  18465. Commands->Join_Conversation( obj, gdi01conv02, true, true, true );
  18466. Commands->Join_Conversation( STAR, gdi01conv02, false, false, false );
  18467. Commands->Start_Conversation( gdi01conv02, gdi01conv02 );
  18468. Commands->Monitor_Conversation( obj, gdi01conv02 );
  18469. }
  18470. else if (action_id == gdi01conv02)
  18471. {
  18472. //invincible = false;
  18473. Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0506I1GCP1_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  18474. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 2 );
  18475. Vector3 newPosition (31.697f, 16.155f, 2.200f);
  18476. Commands->Set_Innate_Is_Stationary ( obj, false );
  18477. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  18478. params.Set_Movement(newPosition, RUN, 1);
  18479. Commands->Action_Goto ( obj, params );
  18480. GameObject * grenadier = Commands->Find_Object ( 116383 );
  18481. if (grenadier != NULL)
  18482. {
  18483. Commands->Send_Custom_Event( obj, grenadier, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );//tell grenadier to greet havoc
  18484. }
  18485. }
  18486. else if (action_id == gdi01conv03)
  18487. {
  18488. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 5 );
  18489. }
  18490. }
  18491. }
  18492. };