| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /******************************************************************************
- *
- * FILE
- * Mission08.cpp
- *
- * DESCRIPTION
- * Mission 8 specific scripts
- *
- * PROGRAMMER
- * David Shuman
- *
- * VERSION INFO
- * $Author: Byon_g $
- * $Revision: 64 $
- * $Modtime: 2/08/02 3:20p $
- * $Archive: /Commando/Code/Scripts/mission08.cpp $
- *
- ******************************************************************************/
- #include "scripts.h"
- #include "toolkit.h"
- #include "mission8.h"
- #include <string.h>
- #include <stdio.h>
- // Objective Controller
- DECLARE_SCRIPT(M08_Objective_Controller, "") // 100002
- {
-
- enum {HAVOCS_SCRIPT};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
-
- }
- void Created(GameObject * obj)
- {
- // Background Music
- Commands->Set_Background_Music ("08-Sniper.mp3");
-
- Commands->Start_Timer (obj, this, 1.0f, HAVOCS_SCRIPT);
- Commands->Enable_Hibernation(obj, false);
-
- Add_An_Objective(801);
- Add_An_Objective(808);
- Add_An_Objective(809);
- }
- void Add_An_Objective(int id)
- {
- GameObject *object;
-
- switch (id)
- {
- // Escape Prison
- case 801:
- {
- Commands->Add_Objective(801, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M08_01, NULL, IDS_Enc_Obj_Primary_M08_01);
- object = Commands->Find_Object(108360);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(801, object);
- Commands->Set_Objective_HUD_Info_Position(801, 90.0f, "POG_M08_1_02.tga", IDS_POG_ESCAPE, Commands->Get_Position (object));
- }
- }
- break;
- // Infiltrate Research Facility
- case 802:
- {
- Commands->Add_Objective(802, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M08_02, NULL, IDS_Enc_Obj_Primary_M08_02);
- object = Commands->Find_Object(108361);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(802, object);
- Commands->Set_Objective_HUD_Info_Position(802, 90.0f, "POG_M08_1_03.tga", IDS_POG_INFILTRATE, Commands->Get_Position (object));
- }
- }
- break;
- // Rescue Scientists
- case 803:
- {
- Commands->Add_Objective(803, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M08_03, NULL, IDS_Enc_Obj_Primary_M08_03);
- // Now that Havoc is out of the prison area you must remove lock level 10 so that he cannot open the mutant pens
- Commands->Grant_Key (STAR, 10, false);
- object = Commands->Find_Object(108818);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(803, object);
- Commands->Set_Objective_HUD_Info_Position(803, 90.0f, "POG_M08_1_04.tga", IDS_POG_RESCUE, Commands->Get_Position (object));
- }
- }
- break;
- // Destroy Helipad
- case 804:
- {
- Commands->Add_Objective(804, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M08_01, NULL, IDS_Enc_Obj_Secondary_M08_05);
- object = Commands->Find_Object(106339);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(804, object);
- Commands->Set_Objective_HUD_Info_Position(804, 90.0f, "POG_M08_2_01.tga", IDS_POG_DESTROY, Commands->Get_Position (object));
- }
- }
- break;
- // Eliminate Raveshaw
- case 805:
- {
- Commands->Add_Objective(805, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M08_04, NULL, IDS_Enc_Obj_Primary_M08_04);
- Commands->Set_Objective_HUD_Info(805, 90.0f, "POG_M08_1_01.tga", IDS_POG_ELIMINATE);
-
- }
- break;
- // Disable Research Station Alpha
- case 806:
- {
- Commands->Add_Objective(806, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M08_02, NULL, IDS_Enc_Obj_Secondary_M08_06);
- object = Commands->Find_Object(100016);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(806, object);
- Commands->Set_Objective_HUD_Info_Position(806, 90.0f, "POG_M08_2_02.tga", IDS_POG_DISABLE, Commands->Get_Position (object));
- }
- }
- break;
- // Disable Research Station Beta
- case 807:
- {
- Commands->Add_Objective(807, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M08_03, NULL, IDS_Enc_Obj_Secondary_M08_07);
- object = Commands->Find_Object(100017);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(807, object);
- Commands->Set_Objective_HUD_Info_Position(807, 90.0f, "POG_M08_2_03.tga", IDS_POG_DISABLE, Commands->Get_Position (object));
- }
- }
- break;
- // Disable excavation mechanisms at archaeological dig
- case 808:
- {
- Commands->Add_Objective(808, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_Enc_ObjTitle_Hidden_M08_01, NULL, IDS_Enc_Obj_Hidden_M08_01);
- }
- break;
- // Destroy Tiberium cultivation center
- case 809:
- {
- Commands->Add_Objective(809, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_Enc_ObjTitle_Hidden_M08_02, NULL, IDS_Enc_Obj_Hidden_M08_02);
- }
- break;
-
- }
- }
- void Remove_Pog(int id)
- {
- switch (id)
- {
- // Escape from Nod Prison Facility
- case 801:
- {
- Commands->Set_Objective_HUD_Info(801, -1, "POG_M08_1_02.tga", IDS_POG_ESCAPE);
- }
- break;
- // Infiltrate Research Facility
- case 802:
- {
- Commands->Set_Objective_HUD_Info(802, -1, "POG_M08_1_03.tga", IDS_POG_INFILTRATE);
- }
- break;
- // Find and rescue kidnapped scientists
- case 803:
- {
- Commands->Set_Objective_HUD_Info(803, -1, "POG_M08_1_04.tga", IDS_POG_RESCUE);
- }
- break;
- // Destroy Nod Helipad
- case 804:
- {
- Commands->Set_Objective_HUD_Info(804, -1, "POG_M08_2_01.tga", IDS_POG_DESTROY);
- }
- break;
- // Destroy Mutated Raveshaw
- case 805:
- {
- Commands->Set_Objective_HUD_Info(806, -1, "POG_M08_1_02.tga", IDS_POG_DISABLE);
- }
- break;
- // Disable Research Station Alpha
- case 806:
- {
- Commands->Set_Objective_HUD_Info(801, -1, "POG_M08_1_02.tga", IDS_POG_ESCAPE);
- }
- break;
- // Disable Research Station Beta
- case 807:
- {
- Commands->Set_Objective_HUD_Info(807, -1, "POG_M08_1_03.tga", IDS_POG_DISABLE);
- }
- break;
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
-
- switch (param)
- {
- case 1:
- {
- Commands->Clear_Radar_Marker (type);
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_ACCOMPLISHED);
- Remove_Pog(type);
- if(type == 805)
- {
- Commands->Mission_Complete ( true );
- }
- }
- break;
- case 2:
- {
- Commands->Clear_Radar_Marker (type);
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_FAILED);
- Remove_Pog(type);
- }
- break;
- case 3:
- Add_An_Objective(type);
- break;
- case 4:
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_PENDING);
- break;
- case 5:
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_HIDDEN);
- break;
- }
- if(type == 666 && param == 666)
- {
-
- Commands->Start_Timer (obj, this, 2.0f, M08_DEAD_HAVOC);
- }
- // Relocate Havoc
- if(type == M08_RELOCATE)
- {
- // Accomplish rescue the scientists mission
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 803, 1, 1.0f);
- // Relocate Havoc
- Commands->Send_Custom_Event(obj, STAR, M08_RELOCATE, 0, 0.0f);
- // Turn Havoc off of immortal
- Commands->Send_Custom_Event(obj, STAR, M08_STAR_IMMORTAL, 0, 0.0f);
- }
- }
- };
- //Grants initial weapons
- DECLARE_SCRIPT(M08_Havoc_DLS, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- }
- void Created(GameObject * obj)
- {
- // Remove all of Havocs starting weapons except for the pistol
- Commands->Clear_Weapons(STAR);
- Commands->Give_PowerUp(obj, "POW_Pistol_Player");
- Commands->Grant_Key (obj, 10, true);
- Commands->Set_Shield_Strength(obj, 0.0f);
- // Reveal GDI Power Suit
- Commands->Reveal_Encyclopedia_Vehicle(16);
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if(type == M08_RELOCATE)
- {
- Commands->Set_Position (obj, Commands->Get_Position(Commands->Find_Object(108819)));
-
- // Mission objective to destroy raveshaw
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 805, 3, 2.0f);
- //
- // Play the boss music
- //
- Commands->Set_Background_Music ("Raveshaw_Act on Instinct.mp3");
- //
- // Create the Raveshaw Boss character
- //
- GameObject *raveshaw = Commands->Create_Object ("Raveshaw", Vector3 (-127.209F, 484.503F, -189.532F));
- if (raveshaw != NULL) {
- Commands->Set_Facing (raveshaw, 0.0F);
- }
- }
- }
- void Destroyed(GameObject * obj)
- {
- // Commands->Send_Custom_Event(obj, Commands->Find_Object(100001), 666, 666, 0.0f);
-
- }
-
- };
- DECLARE_SCRIPT(M08_Activate_Objective_802, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Nick, Those scientists you've been digging for are being held in a Nod Research Facility at the far end of the canyon. Figure'd you might want to know.\n
- const char *conv_name = ("M08_CON001");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(NULL, conv_id, false, true);
- Commands->Join_Conversation(STAR, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300502);
- Commands->Monitor_Conversation (obj, conv_id);
-
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == 100 && param == 100)
- {
- already_entered = true;
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == 300502 && (reason == ACTION_COMPLETE_CONVERSATION_ENDED || reason == ACTION_COMPLETE_CONVERSATION_INTERRUPTED))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 802, 3, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 801, 1, 3.0f);
- }
-
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_Objective_803, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Nick, we're going to lose contact when you head inside, there's no radio communication possible due to jamming signals.\n
- const char *conv_name = ("M08_CON002");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(NULL, conv_id, false, true);
- Commands->Join_Conversation(STAR, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300803);
- Commands->Monitor_Conversation (obj, conv_id);
-
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100008), 100, 100, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100009), 100, 100, 0.0f);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == 100 && param == 100)
- {
- already_entered = true;
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == 300803 && (reason == ACTION_COMPLETE_CONVERSATION_ENDED || reason == ACTION_COMPLETE_CONVERSATION_INTERRUPTED))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 803, 3, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 802, 1, 3.0f);
- }
-
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_Objective_804, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Don't know if you care, hon, but there's a Nod Helipad in back of the Prison Facility. Might help if you blow it up.\n
- const char *conv_name = ("M08_CON003");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(NULL, conv_id, false, true);
- Commands->Join_Conversation(STAR, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300804);
- Commands->Monitor_Conversation (obj, conv_id);
-
- // Disable all activate_804 zones
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100003), 100, 100, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100004), 100, 100, 0.0f);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == 100 && param == 100)
- {
- already_entered = true;
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == 300804 && (reason == ACTION_COMPLETE_CONVERSATION_ENDED || reason == ACTION_COMPLETE_CONVERSATION_INTERRUPTED))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 804, 3, 0.0f);
- }
-
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_Objective_806, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Disable Research Station Alpha.\n
- const char *conv_name = ("M08_CON004");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(STAR, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300806);
- Commands->Monitor_Conversation (obj, conv_id);
-
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == 300806 && (reason == ACTION_COMPLETE_CONVERSATION_ENDED || reason == ACTION_COMPLETE_CONVERSATION_INTERRUPTED))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 806, 3, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 807, 3, 2.0f);
- }
-
-
- }
- };
- DECLARE_SCRIPT(M08_Helipad, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- }
- void Created(GameObject * obj)
- {
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Create_Logical_Sound(obj, M08_HELIPAD_DESTROYED, Vector3 (0,0,0), 2500.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 804, 1, 0.0f);
- // Spawn armed prisoner for helipad area
- Commands->Enable_Spawner(100168, true);
- // Disable Apache Spawner
- Commands->Enable_Spawner(100311, false);
- }
- };
- DECLARE_SCRIPT(M08_Raveshaw, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- }
- void Created(GameObject * obj)
- {
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if(type == M08_RELOCATE)
- {
- Commands->Set_Position (obj, Commands->Get_Position(Commands->Find_Object(108818)));
- // Accomplish rescue the scientists mission
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 803, 1, 1.0f);
- // Relocate Havoc
- Commands->Send_Custom_Event(obj, STAR, M08_RELOCATE, 0, 0.0f);
-
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 805, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Prison_Patrol, "Waypath_ID=0:int, Waypath_Loc:Vector3")
- {
- int waypath_id;
- Vector3 waypath_loc;
- bool enemy_seen;
-
- enum {WAYPATH, GO_WAYPATH, GO_STAR};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- // SAVE_VARIABLE( waypath_loc, 2 );
- SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
- // No starting units can hear footsteps until otherwise alerted
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- enemy_seen = false;
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- Commands->Set_Innate_Soldier_Home_Location(obj, waypath_loc, 4.0f);
- ActionParamsStruct params;
-
- if(waypath_id == 0)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- else if(waypath_id == 1)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- else
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == GO_STAR && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, GO_STAR);
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if((Commands->Is_A_Star(enemy)) && (!enemy_seen))
- {
- enemy_seen = true;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, true);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == WAYPATH)
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(timer_id == GO_STAR)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M08_Initial_Prisoner, "Reinforcment_ID=0:int")
- {
- bool enemy_seen;
- int enemy_id;
- enum{GO_ENEMY, PUNCH_ENEMY};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_seen, 1 );
- SAVE_VARIABLE( enemy_id, 2 );
- }
- void Created(GameObject * obj)
- {
- Commands->Set_Innate_Soldier_Home_Location(obj, Commands->Get_Position(obj), 4.0f);
- enemy_seen = false;
- enemy_id = 0;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- enemy_seen = true;
- enemy_id = Commands->Get_ID(enemy);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_ENEMY );
- params.Set_Movement( enemy, RUN, 0.5f );
- Commands->Action_Goto( obj, params );
- Commands->Send_Custom_Event(obj, Commands->Find_Object(enemy_id), M08_DONT_MOVE, 1, 0.0f);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
-
- if(type == M08_NOD_ATTACKEE_KILLED)
- {
- enemy_seen = false;
- }
-
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- if ( sound.Type == M08_FREE_PRISONER )
- {
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_GDI );
- Commands->Grant_Key (obj, 1, true);
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if((action_id == GO_ENEMY) && (reason == ACTION_COMPLETE_NORMAL) && (enemy_seen))
- {
- params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN + 5, PUNCH_ENEMY);
- params.Set_Animation("S_A_HUMAN.H_A_J26C", false);
- Commands->Action_Play_Animation(obj, params);
-
- }
- if((action_id == PUNCH_ENEMY) && (reason == ACTION_COMPLETE_NORMAL))
- {
- Commands->Apply_Damage( Commands->Find_Object(enemy_id), 10000.0f, "STEEL");
- Commands->Give_PowerUp(obj, "MG Weapon 1 Clip PowerUp");
- Commands->Give_PowerUp(obj, "MiniGun 2 Clips PU");
- }
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- if(!enemy_seen)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(enemy_id), M08_PRISONER_ATTACKER_KILLED, 1, 0.0f);
- }
- int reinforcement_spawner_id = Get_Int_Parameter("Reinforcment_ID");
- Commands->Enable_Spawner(reinforcement_spawner_id, true);
- }
- };
- DECLARE_SCRIPT(M08_Reinforcement_Prisoner, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( enemy_seen, 1 );
- }
- void Created(GameObject * obj)
- {
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
-
- }
- };
- DECLARE_SCRIPT(M08_Nod_Prison_Unit, "")
- {
- int prisoner_attack_id;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( prisoner_attack_id, 1 );
- }
- void Created(GameObject * obj)
- {
- prisoner_attack_id = 0;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_DONT_MOVE)
- {
- prisoner_attack_id = Commands->Get_ID(sender);
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- if(type == M08_PRISONER_ATTACKER_KILLED)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
-
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(prisoner_attack_id), M08_NOD_ATTACKEE_KILLED, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Cell_Controller, "")
- {
- bool poked;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( poked, 1 );
- }
- void Created(GameObject * obj)
- {
- Commands->Debug_Message("Initialize Cell 1 Controller");
- Commands->Enable_HUD_Pokable_Indicator( obj, true );
- poked = false;
- }
- void Poked(GameObject * obj, GameObject * poker)
- {
- if (Commands->Is_A_Star(poker) && !poked)
- {
- poked = true;
- Commands->Create_Sound ( "SFX.Ambient_Jail_Cell_Release", Vector3 (0,0,0), obj);
- Commands->Grant_Key (STAR, 1, true);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100710), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100713), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100714), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Enable_HUD_Pokable_Indicator( obj, false );
- Commands->Destroy_Object(Commands->Find_Object(109282));
- Commands->Destroy_Object(Commands->Find_Object(109283));
- Commands->Destroy_Object(Commands->Find_Object(109273));
- }
- }
- };
- DECLARE_SCRIPT(M08_Prison_Storage_Guard, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( enemy_seen, 1 );
- }
- void Created(GameObject * obj)
- {
- Commands->Set_Innate_Soldier_Home_Location(obj, Commands->Get_Position(obj), 4.0f);
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Vector3 create_position = Commands->Get_Position( obj );
- Commands->Create_Object( "Level_02_Keycard", create_position );
- }
- };
- DECLARE_SCRIPT(M08_Sniper, "Waypath_ID=0:int, Waypath_Loc:Vector3")
- {
- int waypath_id;
- Vector3 waypath_loc;
- enum{GO_WAYPATH, WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- // SAVE_VARIABLE( waypath_loc, 2 );
- }
- void Created(GameObject * obj)
- {
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- ActionParamsStruct params;
- if(waypath_id != 0)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- else
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
-
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_Nod_Gun_Emplacement, "")
- {
- bool attacking;
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_NOD );
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (damager, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Nod_Turret, "")
- {
- bool attacking;
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_NOD );
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- if (Commands->Get_Player_Type (damager) != SCRIPT_PLAYERTYPE_NOD)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (damager, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Prison_Apache, "")
- {
- bool enemy_seen;
- bool flee;
- enum{WAYPATH, NEW_CLOSEST, FLEE, INITIAL};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_seen, 1 );
- SAVE_VARIABLE( flee, 2 );
- }
- void Created(GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- enemy_seen = false;
- flee = false;
- ActionParamsStruct params;
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, INITIAL );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100322;
- Commands->Action_Goto( obj, params );
- }
- int Closest_Waypath ()
- {
- Vector3 star_pos = Commands->Get_Position(STAR);
- Vector3 waypath1 = Vector3(-96.702f, 43.992f, 24.948f);
- Vector3 waypath2 = Vector3(-41.471f, 127.891f, 26.705f);
- Vector3 waypath3 = Vector3(4.254f, 77.652f, 14.441f);
- float dist_waypath1 = Commands->Get_Distance(star_pos, waypath1);
- float dist_waypath2 = Commands->Get_Distance(star_pos, waypath2);
- float dist_waypath3 = Commands->Get_Distance(star_pos, waypath3);
-
- float least_dist = WWMath::Min(WWMath::Min(dist_waypath1, dist_waypath2), dist_waypath3);
- if(least_dist == dist_waypath1)
- {
- return 100273;
- }
- else if (least_dist == dist_waypath2)
- {
- return 100287;
- }
- else
- {
- return 100297;
- }
-
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (enemy, 150.0f, 0.0f, 1);
- params.WaypathID = Closest_Waypath();
- Commands->Modify_Action (obj, WAYPATH, params);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == NEW_CLOSEST && !flee)
- {
- Commands->Start_Timer (obj, this, 30.0f, NEW_CLOSEST);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = Closest_Waypath();
- Commands->Action_Attack( obj, params );
-
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == FLEE)
- {
- Commands->Destroy_Object(obj);
- }
- if(action_id == INITIAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = Closest_Waypath();
- Commands->Action_Attack( obj, params );
- Commands->Start_Timer (obj, this, 30.0f, NEW_CLOSEST);
- }
-
-
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M08_HELIPAD_DESTROYED )
- {
- flee = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, FLEE );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100333;
- Commands->Action_Goto( obj, params );
- }
- }
-
- };
- DECLARE_SCRIPT(M08_GDI_Free_Prison, "Soldier_ID=0:int")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( soldier_id, 1 );
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int soldier_id = Get_Int_Parameter("Soldier_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100246), M08_GDI_FREE_PRISON_KILLED, soldier_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Prison_Controller, "") //100246
- {
- int gdi1;
- int gdi2;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( gdi1, 1 );
- SAVE_VARIABLE( gdi2, 2 );
- }
- void Created(GameObject * obj)
- {
- gdi1 = 0;
- gdi2 = 0;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_GDI_FREE_PRISON_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- gdi1++;
- if(gdi1%2 == 0)
- {
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(-13.121f, 57.855f, -0.091f));
- Commands->Set_Facing(controller, 90.000f);
- Commands->Attach_Script(controller, "Test_Cinematic", "X8D_CHTroopdrop1.txt");
- }
- }
- break;
- case 2:
- {
- gdi2++;
- if(gdi2%2 == 0)
- {
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(-43.266f, 110.230f, -0.238f));
- Commands->Set_Facing(controller, 90.000f);
- Commands->Attach_Script(controller, "Test_Cinematic", "X8D_CHTroopdrop2.txt");
- }
- }
- break;
- }
- }
-
- }
- };
- DECLARE_SCRIPT(M08_APC_Soldier, "APC_ID=0:int")
- {
- int apc_id;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( apc_id, 1 );
- }
- void Created (GameObject * obj)
- {
- apc_id = Get_Int_Parameter("APC_ID");
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- if(Commands->Find_Object(apc_id))
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(apc_id), M08_REINFORCEMENT_KILLED, apc_id, 0.0f);
- }
-
- }
- };
- DECLARE_SCRIPT(M08_PetraA21_Buggy, "")
- {
- bool attacking;
- int reinforce;
-
- enum{WAYPATH, CHECK_ENEMY};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( reinforce, 2 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
-
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (enemy, 50.0f, 0.0f, 1);
- params.WaypathID = 100290;
- params.WaypathSplined = true;
- Commands->Action_Attack( obj, params );
- Commands->Start_Timer (obj, this, 30.0f, CHECK_ENEMY);
- }
- }
-
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_CUSTOM_ACTIVATE)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100263;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = 100282;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
-
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
-
- if(timer_id == CHECK_ENEMY)
- {
- attacking = false;
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_PetraA21, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Custom to activate PetraA21_APC
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100262), M08_CUSTOM_ACTIVATE, 1, 0.0f);
- // Custom to activate PetraA21_Buggy
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100289), M08_CUSTOM_ACTIVATE, 1, 0.0f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(109.901f, 170.915f, -7.315f));
- Commands->Set_Facing(chinook_obj1, 100.000f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDrop1.txt");
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Activate_PetraA22, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- Commands->Enable_Spawner(100308, true);
- Commands->Enable_Spawner(100309, true);
- Commands->Enable_Spawner(100310, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_PetraA22_Stealth_Tank, "")
- {
-
- bool attacking;
-
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- Commands->Start_Timer (obj, this, 15.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- attacking = false;
- }
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_CUSTOM_ACTIVATE)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_Petra_Convoy, "")
- {
-
- enum{WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
-
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_CUSTOM_ACTIVATE)
- {
- switch(param)
- {
- case 1:
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 1.5f );
- params.WaypathID = 100318;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
- break;
- case 2:
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 1.5f );
- params.WaypathID = 100330;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
- break;
- case 3:
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 1.5f );
- params.WaypathID = 100339;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
-
- }
-
- };
- DECLARE_SCRIPT(M08_Activate_Convoy, "Param=0:int")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- int param = Get_Int_Parameter("Param");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100326), M08_CUSTOM_ACTIVATE, param, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100327), M08_CUSTOM_ACTIVATE, param, 0.5f);
-
- }
- }
-
- };
-
- DECLARE_SCRIPT(M08_Activate_Stealth_Trap, "")
- {
-
- bool already_entered;
- int crate1_id;
- int crate2_id;
- int crate3_id;
- int crate4_id;
- int crate5_id;
- int crate6_id;
- int crate7_id;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( crate1_id, 2 );
- SAVE_VARIABLE( crate2_id, 3 );
- SAVE_VARIABLE( crate3_id, 4 );
- SAVE_VARIABLE( crate4_id, 5 );
- SAVE_VARIABLE( crate5_id, 6 );
- SAVE_VARIABLE( crate6_id, 7 );
- SAVE_VARIABLE( crate7_id, 8 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- crate1_id = 0;
- crate2_id = 0;
- crate3_id = 0;
- crate4_id = 0;
- crate5_id = 0;
- crate6_id = 0;
- crate7_id = 0;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- // Front
- Commands->Create_Explosion( "Ground Explosions Twiddler", Vector3(224.119f, 218.876f, -13.746f), obj );
- Commands->Create_Explosion( "Ground Explosions Twiddler", Vector3(222.456f, 202.921f, -15.889f), obj );
- GameObject *crate1 = Commands->Create_Object("M08_Rubble_Stub", Vector3(224.119f, 218.876f, -13.746f));
- Commands->Set_Facing( crate1, 165.000f );
- crate1_id = Commands->Get_ID(crate1);
- GameObject *crate2 = Commands->Create_Object("M08_Rubble_Stub", Vector3(223.517f, 217.013f, -10.574f));
- Commands->Set_Facing( crate2, 165.000f );
- crate2_id = Commands->Get_ID(crate2);
- GameObject *crate3 = Commands->Create_Object("M08_Rubble_Stub_Destroyable", Vector3(221.917f, 212.589f, -15.192f));
- Commands->Set_Facing( crate3, 0.000f );
- crate3_id = Commands->Get_ID(crate3);
- GameObject *crate4 = Commands->Create_Object("M08_Rubble_Stub", Vector3(222.138f, 207.974f, -12.258f));
- Commands->Set_Facing( crate4, 0.000f );
- crate4_id = Commands->Get_ID(crate4);
- GameObject *crate5 = Commands->Create_Object("M08_Rubble_Stub", Vector3(221.850f, 196.753f, -15.421f));
- Commands->Set_Facing( crate5, 0.000f );
- crate5_id = Commands->Get_ID(crate5);
- GameObject *crate6 = Commands->Create_Object("M08_Rubble_Stub", Vector3(221.944f, 198.134f, -12.500f));
- Commands->Set_Facing( crate6, 0.000f );
- crate6_id = Commands->Get_ID(crate6);
- GameObject *crate7 = Commands->Create_Object("M08_Rubble_Stub", Vector3(222.456f, 202.921f, -15.889f));
- Commands->Set_Facing( crate7, 0.000f );
- crate7_id = Commands->Get_ID(crate7);
- // Rear
- Commands->Create_Explosion( "Generic Ground 01", Vector3(106.852f, 221.987f, -3.990f), obj );
- Commands->Create_Explosion( "Generic Ground 01", Vector3(89.681f, 218.165f, -8.951f), obj );
- GameObject *crate8 = Commands->Create_Object("M08_Rubble_Stub", Vector3(106.852f, 221.987f, -3.990f));
- Commands->Set_Facing( crate8, 105.000f );
- GameObject *crate9 = Commands->Create_Object("M08_Rubble_Stub", Vector3(99.245f, 220.195f, -5.858f));
- Commands->Set_Facing( crate9, 105.000f );
- GameObject *crate10 = Commands->Create_Object("M08_Rubble_Stub", Vector3(97.595f, 219.985f, -9.097f));
- Commands->Set_Facing( crate10, -75.000f );
- GameObject *crate11 = Commands->Create_Object("M08_Rubble_Stub", Vector3(89.813f, 217.622f, -5.894f));
- Commands->Set_Facing( crate11, 105.000f );
- GameObject *crate12 = Commands->Create_Object("M08_Rubble_Stub", Vector3(89.681f, 218.165f, -8.951f));
- Commands->Set_Facing( crate12, -80.000f );
-
- // Activate initial stealth tank
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100347), M08_CUSTOM_ACTIVATE, 1, 0.0f);
- //Enable stealth soldier spawners
- Commands->Enable_Spawner(100348, true);
- Commands->Enable_Spawner(100349, true);
- Commands->Enable_Spawner(100351, true);
- // Enable stealth tank at rear of trap
- Commands->Enable_Spawner(100354, true);
- // Enable stealth soldier at rear of trap
- Commands->Enable_Spawner(100351, true);
- // Enable damaged and emtpy stealth tank
- Commands->Enable_Spawner(100359, true);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_CUSTOM_ACTIVATE)
- {
- Commands->Destroy_Object(Commands->Find_Object(crate1_id));
- Commands->Destroy_Object(Commands->Find_Object(crate2_id));
- Commands->Destroy_Object(Commands->Find_Object(crate3_id));
- Commands->Destroy_Object(Commands->Find_Object(crate4_id));
- Commands->Destroy_Object(Commands->Find_Object(crate5_id));
- Commands->Destroy_Object(Commands->Find_Object(crate6_id));
- Commands->Destroy_Object(Commands->Find_Object(crate7_id));
- }
- };
- };
- DECLARE_SCRIPT(M08_Destroy_Stealth_Trap, "")
- {
-
- bool already_entered;
- int stealth_tank_id;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( stealth_tank_id, 2 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- stealth_tank_id = 0;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Get_ID(enterer) == stealth_tank_id)
- {
- already_entered = true;
-
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_CUSTOM_ACTIVATE, 1, 0.0f);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_UNIT_ID)
- {
- stealth_tank_id = param;
- }
- };
-
- };
- DECLARE_SCRIPT(M08_Player_Stealth_Tank, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100360), M08_UNIT_ID, Commands->Get_ID(obj), 0.0f);
- }
-
- };
- DECLARE_SCRIPT(M08_Nod_Light_Tank, "")
- {
-
- bool attacking;
-
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- Commands->Start_Timer (obj, this, 15.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- attacking = false;
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Nod_Stealth_Tank, "")
- {
-
- bool attacking;
-
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- Commands->Start_Timer (obj, this, 15.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN + 5), 1);
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- attacking = false;
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Archaelogical_Site_Patrol, "Waypath_ID=0:int, Waypath_Loc:Vector3, Unit_ID=0:int")
- {
- int waypath_id;
- Vector3 waypath_loc;
- int unit_id;
-
- enum {WAYPATH, GO_WAYPATH, INITIAL};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- // SAVE_VARIABLE( waypath_loc, 2 );
- }
- void Created (GameObject * obj)
- {
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- unit_id = Get_Int_Parameter("Unit_ID");
- if(waypath_id != 0)
- {
- Commands->Start_Timer(obj, this, 3.0f, INITIAL);
- }
- else
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == WAYPATH)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(timer_id == INITIAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
-
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100362), M08_ARCHAELOGICAL_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Archaelogical_Reinforcements, "Unit_ID=0:int")
- {
- int unit_id;
- enum{INITIAL};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 3.0f, INITIAL);
- unit_id = Get_Int_Parameter("Unit_ID");
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == INITIAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
-
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100362), M08_ARCHAELOGICAL_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Archaelogical_Site_Controller, "")
- {
-
- bool already_entered;
- int unit1_killed;
- int unit2_killed;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( unit1_killed, 2 );
- SAVE_VARIABLE( unit2_killed, 3 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- unit1_killed = 0;
- unit2_killed = 0;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_ARCHAELOGICAL_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- unit1_killed++;
- if(unit1_killed%2 == 0)
- {
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(280.143f, 256.055f, -18.745f));
- Commands->Set_Facing(chinook_obj1, 60.000f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDrop2.txt");
- }
- }
- break;
- case 2:
- {
- unit2_killed++;
- if(unit2_killed%2 == 0)
- {
- GameObject * chinook_obj2 = Commands->Create_Object ( "Invisible_Object", Vector3(270.498f, 394.061f, -12.328f));
- Commands->Set_Facing(chinook_obj2, 60.000f);
- Commands->Attach_Script(chinook_obj2, "Test_Cinematic", "X8I_TroopDrop3.txt");
- }
- }
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M08_Archaelogical_Site_Buggy, "")
- {
- bool attacking;
- enum{WAYPATH, ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = 100406;
- Commands->Action_Attack( obj, params );
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.WaypathID = 100406;
- Commands->Modify_Action (obj, WAYPATH, params);
- Commands->Start_Timer (obj, this, 10.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = 100406;
- Commands->Modify_Action (obj, WAYPATH, params);
-
- }
-
- }
-
- };
- DECLARE_SCRIPT(M08_Archaelogical_Site_Tomb, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- Commands->Enable_Spawner(100423, true);
- Commands->Enable_Spawner(100424, true);
- }
- }
- };
-
- DECLARE_SCRIPT(M08_PetraA25_Controller, "")
- {
- int unit1_killed;
- int unit2_killed;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( unit1_killed, 1 );
- SAVE_VARIABLE( unit2_killed, 2 );
- }
- void Created (GameObject * obj)
- {
- unit1_killed = 0;
- unit2_killed = 0;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_PETRAA25_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- unit1_killed++;
- if(unit1_killed < 4)
- {
- GameObject * chinook_obj2 = Commands->Create_Object ( "Invisible_Object", Vector3(161.429f, 419.470f, -11.413f));
- Commands->Set_Facing(chinook_obj2, 60.000f);
- Commands->Attach_Script(chinook_obj2, "Test_Cinematic", "M08_XG_VehicleDrop1.txt");
- }
- }
- break;
- case 2:
- {
- unit2_killed++;
- if(unit2_killed%2 == 0)
- {
-
- }
- }
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M08_PetraA25_Tank, "")
- {
- bool attacking;
- enum{WAYPATH, ATTACK_OVER, INITIAL};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- Commands->Start_Timer (obj, this, 4.0f, INITIAL);
-
- attacking = true;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), 0.0f, 1.5f );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.WaypathID = 100437;
- params.WaypathSplined = true;
- Commands->Modify_Action (obj, WAYPATH, params);
- Commands->Start_Timer (obj, this, 10.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == INITIAL)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = 100437;
- params.WaypathSplined = true;
- Commands->Action_Attack( obj, params );
- }
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = 100437;
- params.WaypathSplined = true;
- Commands->Modify_Action (obj, WAYPATH, params);
-
- }
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100436), M08_PETRAA25_KILLED, 1, 0.0f);
- }
-
- };
- DECLARE_SCRIPT(M08_PetraA25_Patrol, "Waypath_ID=0:int, Waypath_Loc:Vector3")
- {
- int waypath_id;
- Vector3 waypath_loc;
-
- enum {WAYPATH, GO_WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( waypath_id, 1 );
- SAVE_VARIABLE( waypath_loc, 2 );
- }
- void Created (GameObject * obj)
- {
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == WAYPATH)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M08_Excavation_Mechanism, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 808, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Tiberium_Cultivation_MCT, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Animation_Frame(obj, "mct_nod.mct_nod", 0);
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Create_Explosion("Explosion_Mine_Remote_01", Commands->Get_Position(obj));
- Vector3 myPositon = Commands->Get_Position ( obj );
- float myFacing = Commands->Get_Facing ( obj );
- GameObject * destroyedMCT = Commands->Create_Object ( "Nod_MCT_Alarm_Destroyed", myPositon);
- Commands->Set_Facing ( destroyedMCT, myFacing );
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 809, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Research_Station_A, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Animation_Frame(obj, "mct_nod.mct_nod", 0);
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Create_Explosion("Explosion_Mine_Remote_01", Commands->Get_Position(obj));
- Vector3 myPositon = Commands->Get_Position ( obj );
- float myFacing = Commands->Get_Facing ( obj );
- GameObject * destroyedMCT = Commands->Create_Object ( "Nod_MCT_Alarm_Destroyed", myPositon);
- Commands->Set_Facing ( destroyedMCT, myFacing );
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 806, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Research_Station_B, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Animation_Frame(obj, "mct_nod.mct_nod", 0);
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Create_Explosion("Explosion_Mine_Remote_01", Commands->Get_Position(obj));
- Vector3 myPositon = Commands->Get_Position ( obj );
- float myFacing = Commands->Get_Facing ( obj );
- GameObject * destroyedMCT = Commands->Create_Object ( "Nod_MCT_Alarm_Destroyed", myPositon);
- Commands->Set_Facing ( destroyedMCT, myFacing );
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100002), 807, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Facility_Patrol, "Waypath_ID=0:int, Waypath_Loc:Vector3")
- {
- int waypath_id;
- Vector3 waypath_loc;
- bool enemy_seen;
-
- enum {WAYPATH, GO_WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( waypath_id, 1 );
- SAVE_VARIABLE( waypath_loc, 2 );
- SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
- enemy_seen = false;
- // No starting units can hear footsteps until otherwise alerted
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(reason != ACTION_COMPLETE_NORMAL)
- {
- Commands->Start_Timer(obj, this, 30.0f, WAYPATH);
- return;
- }
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == WAYPATH)
- {
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if((Commands->Is_A_Star(enemy)) && (!enemy_seen))
- {
- enemy_seen = true;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_Facility_Go_Point, "Point1_ID=0:int, Point2_ID=0:int")
- {
- int point1_id;
- int point2_id;
- bool enemy_seen;
-
- enum {GO_POINT1, GO_POINT2};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( point1_id, 1 );
- SAVE_VARIABLE( point2_id, 2 );
- SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
- enemy_seen = false;
- // No starting units can hear footsteps until otherwise alerted
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- point1_id = Get_Int_Parameter("Point1_ID");
- point2_id = Get_Int_Parameter("Point2_ID");
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_POINT1 );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(reason != ACTION_COMPLETE_NORMAL)
- {
- Commands->Start_Timer(obj, this, 30.0f, GO_POINT1);
- return;
- }
- if(action_id == GO_POINT1 && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_POINT2 );
- params.Set_Movement( Commands->Find_Object(point2_id), WALK, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_POINT2 && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_POINT1 );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == GO_POINT1)
- {
- params.Set_Basic( this, INNATE_PRIORITY_FOOTSTEPS_HEARD - 5, GO_POINT1 );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if((Commands->Is_A_Star(enemy)) && (!enemy_seen))
- {
- enemy_seen = true;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_Facility_Tank, "Waypath_ID=0:int")
- {
- bool attacking;
- int waypath_id;
- enum{WAYPATH, ATTACK_OVER, INITIAL};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- // SAVE_VARIABLE( waypath_id, 2 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- Commands->Start_Timer (obj, this, 4.0f, INITIAL);
-
- waypath_id = Get_Int_Parameter("Waypath_ID");
- attacking = true;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), 0.0f, 1.5f );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- Commands->Modify_Action (obj, WAYPATH, params);
- Commands->Start_Timer (obj, this, 10.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == INITIAL)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- Commands->Action_Attack( obj, params );
- }
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- Commands->Modify_Action (obj, WAYPATH, params);
-
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Facility_Vehicle_Dec, "")
- {
- bool attacking;
-
- enum{ATTACK_OVER, ATTACKING};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
-
- attacking = true;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, ATTACKING );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- Commands->Action_Attack (obj, params);
- Commands->Start_Timer (obj, this, 10.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, ATTACKING );
- params.Set_Attack (NULL, 250.0f, 0.0f, 1);
- Commands->Modify_Action (obj, ATTACKING, params);
-
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_Encounter, "Spawner_ID1=0:int, Spawner_ID2=0:int, Spawner_ID3=0:int, Spawner_ID4=0:int, Spawner_ID5=0:int, Spawner_ID6=0:int")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- int spawner_id1 = Get_Int_Parameter("Spawner_ID1");
- int spawner_id2 = Get_Int_Parameter("Spawner_ID2");
- int spawner_id3 = Get_Int_Parameter("Spawner_ID3");
- int spawner_id4 = Get_Int_Parameter("Spawner_ID4");
- int spawner_id5 = Get_Int_Parameter("Spawner_ID5");
- int spawner_id6 = Get_Int_Parameter("Spawner_ID6");
-
- if(spawner_id1 != 0)
- {
- Commands->Enable_Spawner(spawner_id1, true);
- }
- if(spawner_id2 != 0)
- {
- Commands->Enable_Spawner(spawner_id2, true);
- }
- if(spawner_id3 != 0)
- {
- Commands->Enable_Spawner(spawner_id3, true);
- }
- if(spawner_id4 != 0)
- {
- Commands->Enable_Spawner(spawner_id4, true);
- }
- if(spawner_id5 != 0)
- {
- Commands->Enable_Spawner(spawner_id5, true);
- }
- if(spawner_id6 != 0)
- {
- Commands->Enable_Spawner(spawner_id6, true);
- }
-
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == M08_DEACTIVATE_ENCOUNTER)
- {
- int spawner_id1 = Get_Int_Parameter("Spawner_ID1");
- int spawner_id2 = Get_Int_Parameter("Spawner_ID2");
- int spawner_id3 = Get_Int_Parameter("Spawner_ID3");
- int spawner_id4 = Get_Int_Parameter("Spawner_ID4");
- int spawner_id5 = Get_Int_Parameter("Spawner_ID5");
- int spawner_id6 = Get_Int_Parameter("Spawner_ID6");
-
- if(spawner_id1 != 0)
- {
- Commands->Enable_Spawner(spawner_id1, false);
- }
- if(spawner_id2 != 0)
- {
- Commands->Enable_Spawner(spawner_id2, false);
- }
- if(spawner_id3 != 0)
- {
- Commands->Enable_Spawner(spawner_id3, false);
- }
- if(spawner_id4 != 0)
- {
- Commands->Enable_Spawner(spawner_id4, false);
- }
- if(spawner_id5 != 0)
- {
- Commands->Enable_Spawner(spawner_id5, false);
- }
- if(spawner_id6 != 0)
- {
- Commands->Enable_Spawner(spawner_id6, false);
- }
- }
- }
- };
- DECLARE_SCRIPT(M08_Deactivate_Encounter, "Activate_Zone=0:int")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- int activate_zone = Get_Int_Parameter("Activate_Zone");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(activate_zone), M08_DEACTIVATE_ENCOUNTER, 1);
- }
- }
- };
- DECLARE_SCRIPT(M08_Encounter_Unit, "Waypath_ID=0:int, Priority=0:int, Suicide=0:int, Stationary_at_End=0:int")
- {
- int waypath_id;
- int priority;
- bool suicide;
- bool stationary;
- enum{DIE_SURPRISE, GO_STAR, WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( poke_id, 1 );
- }
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- waypath_id = Get_Int_Parameter("Waypath_ID");
- priority = Get_Int_Parameter("Priority");
- suicide = (Get_Int_Parameter("Suicide") == 1) ? true : false;
- stationary = (Get_Int_Parameter("Stationary_at_End") == 1) ? true : false;
- if(waypath_id == 0)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- else if(waypath_id == 1)
- {
- params.Set_Basic( this, priority, GO_STAR );
- params.Set_Movement( STAR, RUN, 2.0f );
- Commands->Action_Goto ( obj, params );
- }
- else
- {
- params.Set_Basic( this, priority, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
-
- if(suicide)
- {
- Commands->Start_Timer (obj, this, 15.0f, DIE_SURPRISE);
- }
- }
- void Timer_Expired(GameObject* obj, int timer_id)
- {
-
- if(timer_id == DIE_SURPRISE)
- {
- Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
- Vector3 obj_pos = Commands->Get_Position(obj);
- Vector3 shot_pos;
- shot_pos.X = obj_pos.X + 4.0f;
- shot_pos.Y = obj_pos.Y + 4.0f;
- shot_pos.Z = obj_pos.Z + 4.0f;
- Commands->Create_Sound("Sniper_Fire_01", shot_pos, obj);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (reason != ACTION_COMPLETE_NORMAL)
- {
- return;
- }
- if (action_id == WAYPATH)
- {
- Commands->Innate_Force_State_Enemy_Seen(obj, STAR);
- if(stationary)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- }
- }
- };
- DECLARE_SCRIPT(M08_Warden_Announcement1, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- // This is the warden, we have a probable escape situation in solitary. Full lockdown, all personnel initiate response protocols.\n
- const char *conv_name = ("M08_CON006");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(NULL, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300502);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- };
- DECLARE_SCRIPT(M08_Warden_Announcement2, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- // This is the warden, we have a confirmed prison break, repeat, confirmed prison break! Assume all GDI as hostile, kill every last one of them!\n
- const char *conv_name = ("M08_CON007");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(NULL, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300502);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == 300502)
- {
- Commands->Create_Sound ( "M06_Alarm", Vector3 (0,0,0), obj);
- }
-
-
- }
- };
- DECLARE_SCRIPT(M08_Innate_Control, "")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Innate_Disable(obj);
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON)
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Soldier_Home_Location(obj, Commands->Get_Position(obj), 4.0f);
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Activate_Innate, "Unit_ID1=0:int, Unit_ID2=0:int, Unit_ID3=0:int, Unit_ID4=0:int, Unit_ID5=0:int, ")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- int unit_id1 = Get_Int_Parameter("Unit_ID1");
- int unit_id2 = Get_Int_Parameter("Unit_ID2");
- int unit_id3 = Get_Int_Parameter("Unit_ID3");
- int unit_id4 = Get_Int_Parameter("Unit_ID4");
- int unit_id5 = Get_Int_Parameter("Unit_ID5");
- if(unit_id1 != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(unit_id1), M08_INNATE_ON, 1, 0.0f);
- }
- if(unit_id2 != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(unit_id2), M08_INNATE_ON, 1, 0.0f);
- }
- if(unit_id3 != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(unit_id3), M08_INNATE_ON, 1, 0.0f);
- }
- if(unit_id4 != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(unit_id4), M08_INNATE_ON, 1, 0.0f);
- }
- if(unit_id5 != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(unit_id5), M08_INNATE_ON, 1, 0.0f);
- }
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Basketball_Court_Controller, "")
- {
- int m08_basketball_gun_emp_killed;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( m08_basketball_gun_emp_killed, 1 );
- }
- void Created (GameObject * obj)
- {
- m08_basketball_gun_emp_killed = 0;
- // Nod Soldiers
- // Commands->Enable_Spawner(100205, true);
- // Commands->Enable_Spawner(100206, true);
- Commands->Enable_Spawner(100207, true);
- Commands->Enable_Spawner(100208, true);
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_BASKETBALL_GUN_EMP_KILLED)
- {
- m08_basketball_gun_emp_killed++;
- if(m08_basketball_gun_emp_killed == 1)
- {
- // GDI Prisoner
- Commands->Enable_Spawner(100201, true);
- Commands->Enable_Spawner(100202, true);
-
- // Nod Soldiers
- // Commands->Enable_Spawner(100205, false);
- // Commands->Enable_Spawner(100206, false);
- }
- else
- {
- // GDI Prisoner
- // Commands->Enable_Spawner(100203, true);
- // Commands->Enable_Spawner(100204, true);
- // Nod Soldiers
- // Commands->Enable_Spawner(100207, false);
- }
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Basketball_Gun_Emp, "")
- {
- void Killed (GameObject * obj, GameObject * killer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100197), M08_BASKETBALL_GUN_EMP_KILLED, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Homepoint, "Homepoint_ID=0:int")
- {
- void Created (GameObject * obj)
- {
- int homepoint_id = Get_Int_Parameter("Homepoint_ID");
- Vector3 homepoint_loc = Commands->Get_Position(Commands->Find_Object(homepoint_id));
- Commands->Set_Innate_Soldier_Home_Location(obj, homepoint_loc, 4.0f);
- }
- };
- DECLARE_SCRIPT(M08_Nod_Buggy_Dec, "")
- {
- bool attacking;
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (damager, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Petra_A_Controller, "") //100346
- {
- int m08_petra_a1_unit;
- int m08_petra_a2_unit;
- int m08_petra_a3_unit;
- int a1_last_loc;
- int a2_last_loc;
- int a3_last_loc;
- bool petra_a_active;
- bool created_vehicle;
- int player_vehicle_id;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- SAVE_VARIABLE( m08_petra_a2_unit, 2 );
- SAVE_VARIABLE( m08_petra_a3_unit, 3 );
- SAVE_VARIABLE( a1_last_loc, 4 );
- SAVE_VARIABLE( a2_last_loc, 5 );
- SAVE_VARIABLE( a3_last_loc, 6 );
- SAVE_VARIABLE( petra_a_active, 7 );
- SAVE_VARIABLE( created_vehicle, 8 );
- SAVE_VARIABLE( player_vehicle_id, 9 );
- }
- void Created(GameObject * obj)
- {
- m08_petra_a1_unit = 0;
- m08_petra_a2_unit = 0;
- m08_petra_a3_unit = 0;
- a1_last_loc = 111522;
- a2_last_loc = 111524;
- a3_last_loc = 111526;
- petra_a_active = false;
- created_vehicle = false;
- player_vehicle_id = 0;
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if(type == M08_PETRA_A_UNIT_STATUS)
- {
- Commands->Send_Custom_Event(obj, sender, M08_PETRA_A_UNIT_STATUS, petra_a_active, 0.0f);
- }
- if(type == M08_PETRA_A_ACTIVATE && !petra_a_active)
- {
- petra_a_active = true;
- Commands->Create_Logical_Sound(obj, M08_PETRA_A_LOGICAL, Vector3 (0,0,0), 2500.0f);
- // Custom to bring in helo troop drop
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_HELO_KILLED, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_HELO_KILLED, 2, 1.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_HELO_KILLED, 3, 2.0f);
- }
- if(type == M08_PETRA_A_DEACTIVATE && petra_a_active)
- {
- petra_a_active = false;
- Commands->Create_Logical_Sound(obj, M08_PETRA_A_LOGICAL, Vector3 (0,0,0), 2500.0f);
- }
- if(type == M08_PETRA_A_CREATED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_a1_unit++;
- }
- break;
- case 2:
- {
- m08_petra_a2_unit++;
- }
- break;
- case 3:
- {
- m08_petra_a3_unit++;
- }
- break;
- }
- }
- if(type == M08_PETRA_A_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_a1_unit--;
- }
- break;
- case 2:
- {
- m08_petra_a2_unit--;
- }
- break;
- case 3:
- {
- m08_petra_a3_unit--;
- }
- break;
- }
- }
- if((type == M08_PETRA_A_KILLED || type == M08_PETRA_A_HELO_KILLED) && petra_a_active)
- {
-
- switch(param)
- {
- case 1:
- {
- if(m08_petra_a1_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111523);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(a1_last_loc == 111522)
- {
- drop_loc = Commands->Find_Object(111523);
- drop_facing = Commands->Get_Facing(drop_loc);
- a1_last_loc = 111523;
- }
- else if(a1_last_loc == 111523)
- {
- drop_loc = Commands->Find_Object(111522);
- drop_facing = Commands->Get_Facing(drop_loc);
- a1_last_loc = 111522;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropA1.txt");
- }
- }
- break;
- case 2:
- {
- if(m08_petra_a2_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111524);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(a2_last_loc == 111524)
- {
- drop_loc = Commands->Find_Object(111525);
- drop_facing = Commands->Get_Facing(drop_loc);
- a2_last_loc = 111525;
- }
- else if(a2_last_loc == 111525)
- {
- drop_loc = Commands->Find_Object(111524);
- drop_facing = Commands->Get_Facing(drop_loc);
- a2_last_loc = 111524;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropA2.txt");
- }
- }
- break;
- case 3:
- {
- if(m08_petra_a3_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111526);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(a3_last_loc == 111526)
- {
- drop_loc = Commands->Find_Object(111527);
- drop_facing = Commands->Get_Facing(drop_loc);
- a3_last_loc = 111527;
- }
- else if(a3_last_loc == 111527)
- {
- drop_loc = Commands->Find_Object(111522);
- drop_facing = Commands->Get_Facing(drop_loc);
- a3_last_loc = 111526;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropA3.txt");
- }
- }
- break;
- }
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Petra_A_Unit, "Unit_ID=0:int")
- {
-
- enum{GO_STAR, GO_PETRA_A};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
- ActionParamsStruct params;
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_CREATED, unit_id, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_UNIT_STATUS, unit_id, 0.0f);
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == GO_STAR)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_PETRA_A_UNIT_STATUS)
- {
- Commands->Action_Reset(obj, INNATE_PRIORITY_ENEMY_SEEN + 5);
- bool petra_a_active = (param == 1) ? true : false;
- if(petra_a_active)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- else
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_PETRA_A );
- params.Set_Movement( Commands->Find_Object(100346), RUN, 8.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M08_PETRA_A_LOGICAL )
- {
- int unit_id = Commands->Get_ID(obj);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_UNIT_STATUS, unit_id, 0.0f);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_PETRA_A && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Apply_Damage( obj, 10000.0f, "STEEL");
- }
-
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Petra_A_Helo, "Unit_ID=0:int")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
- Commands->Enable_Hibernation(obj, false);
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_HELO_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Activate_Petra_A, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_ACTIVATE, 1, 0.0f);
-
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Deactivate_Petra_A, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100346), M08_PETRA_A_DEACTIVATE, 1, 0.0f);
-
- }
- }
-
- };
- // Petra B
- DECLARE_SCRIPT(M08_Petra_B_Controller, "") //100346
- {
- int m08_petra_b1_unit;
- int m08_petra_b2_unit;
- int m08_petra_b3_unit;
- int b1_last_loc;
- int b2_last_loc;
- int b3_last_loc;
- bool petra_b_active;
- bool created_vehicle;
- int player_vehicle_id;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( m08_petra_b1_unit, 1 );
- SAVE_VARIABLE( m08_petra_b2_unit, 2 );
- SAVE_VARIABLE( m08_petra_b3_unit, 3 );
- SAVE_VARIABLE( b1_last_loc, 4 );
- SAVE_VARIABLE( b2_last_loc, 5 );
- SAVE_VARIABLE( b3_last_loc, 6 );
- SAVE_VARIABLE( petra_b_active, 7 );
- SAVE_VARIABLE( created_vehicle, 8 );
- SAVE_VARIABLE( player_vehicle_id, 9 );
- }
- void Created(GameObject * obj)
- {
- m08_petra_b1_unit = 0;
- m08_petra_b2_unit = 0;
- m08_petra_b3_unit = 0;
- b1_last_loc = 111753;
- b2_last_loc = 111756;
- b3_last_loc = 111757;
- petra_b_active = false;
- created_vehicle = false;
- player_vehicle_id = 0;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if(type == M08_PLAYER_VEHICLE_ID)
- {
- player_vehicle_id = param;
- }
- if(type == M08_PETRA_B_UNIT_STATUS)
- {
- Commands->Send_Custom_Event(obj, sender, M08_PETRA_B_UNIT_STATUS, petra_b_active, 0.0f);
- }
- if(type == M08_PETRA_B_ACTIVATE && !petra_b_active)
- {
- petra_b_active = true;
- Commands->Create_Logical_Sound(obj, M08_PETRA_B_LOGICAL, Vector3 (0,0,0), 2500.0f);
- // Custom to bring in helo troop drop
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_HELO_KILLED, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_HELO_KILLED, 2, 1.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_HELO_KILLED, 3, 2.0f);
- // Check if player has a vehicle, if not, create one
- if(!Commands->Find_Object(109047) && !created_vehicle)
- {
- created_vehicle = true;
- GameObject * player_vehicle = Commands->Create_Object("Nod_Stealth_Tank_Player", Vector3(145.898f, 269.404f, -14.918f));
- Commands->Set_Facing(player_vehicle, 150.000f);
- // Send the player vehicle id to Petra_C
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PLAYER_VEHICLE_ID, Commands->Get_ID(player_vehicle), 0.0f);
- }
- }
- if(type == M08_PETRA_B_DEACTIVATE && petra_b_active)
- {
- petra_b_active = false;
- Commands->Create_Logical_Sound(obj, M08_PETRA_B_LOGICAL, Vector3 (0,0,0), 2500.0f);
- }
- if(type == M08_PETRA_B_CREATED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_b1_unit++;
- }
- break;
- case 2:
- {
- m08_petra_b2_unit++;
- }
- break;
- case 3:
- {
- m08_petra_b3_unit++;
- }
- break;
- }
- }
- if(type == M08_PETRA_B_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_b1_unit--;
- }
- break;
- case 2:
- {
- m08_petra_b2_unit--;
- }
- break;
- case 3:
- {
- m08_petra_b3_unit--;
- }
- break;
- }
- }
- if((type == M08_PETRA_B_KILLED || type == M08_PETRA_B_HELO_KILLED) && petra_b_active)
- {
-
- switch(param)
- {
- case 1:
- {
- if(m08_petra_b1_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111753);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(b1_last_loc == 111753)
- {
- drop_loc = Commands->Find_Object(111754);
- drop_facing = Commands->Get_Facing(drop_loc);
- b1_last_loc = 111754;
- }
- else if(b1_last_loc == 111754)
- {
- drop_loc = Commands->Find_Object(111753);
- drop_facing = Commands->Get_Facing(drop_loc);
- b1_last_loc = 111753;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropB1.txt");
- }
- }
- break;
- case 2:
- {
- if(m08_petra_b2_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111755);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(b2_last_loc == 111755)
- {
- drop_loc = Commands->Find_Object(111756);
- drop_facing = Commands->Get_Facing(drop_loc);
- b2_last_loc = 111756;
- }
- else if(b2_last_loc == 111756)
- {
- drop_loc = Commands->Find_Object(111755);
- drop_facing = Commands->Get_Facing(drop_loc);
- b2_last_loc = 111755;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropB2.txt");
- }
- }
- break;
- case 3:
- {
- if(m08_petra_b3_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111757);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(b3_last_loc == 111757)
- {
- drop_loc = Commands->Find_Object(111758);
- drop_facing = Commands->Get_Facing(drop_loc);
- b3_last_loc = 111758;
- }
- else if(b3_last_loc == 111758)
- {
- drop_loc = Commands->Find_Object(111757);
- drop_facing = Commands->Get_Facing(drop_loc);
- b3_last_loc = 111757;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropB3.txt");
- }
- }
- break;
- }
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Petra_B_Unit, "Unit_ID=0:int")
- {
-
- enum{GO_STAR, GO_PETRA_B};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
- ActionParamsStruct params;
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_CREATED, unit_id, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_UNIT_STATUS, unit_id, 0.0f);
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == GO_STAR)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_PETRA_B_UNIT_STATUS)
- {
- Commands->Action_Reset(obj, INNATE_PRIORITY_ENEMY_SEEN + 5);
- bool petra_b_active = (param == 1) ? true : false;
- if(petra_b_active)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- else
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_PETRA_B );
- params.Set_Movement( Commands->Find_Object(100370), RUN, 8.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M08_PETRA_B_LOGICAL )
- {
- int unit_id = Commands->Get_ID(obj);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_UNIT_STATUS, unit_id, 0.0f);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_PETRA_B && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Apply_Damage( obj, 10000.0f, "STEEL");
- }
-
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Petra_B_Helo, "Unit_ID=0:int")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_HELO_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Activate_Petra_B, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_ACTIVATE, 1, 0.0f);
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Deactivate_Petra_B, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100370), M08_PETRA_B_DEACTIVATE, 1, 0.0f);
-
- }
- }
-
- };
- // Petra C
- DECLARE_SCRIPT(M08_Petra_C_Controller, "") //100389
- {
- int m08_petra_c1_unit;
- int m08_petra_c2_unit;
- int m08_petra_c3_unit;
- int c1_last_loc;
- int c2_last_loc;
- int c3_last_loc;
- bool petra_c_active;
- bool created_vehicle;
- int player_vehicle_id;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( m08_petra_c1_unit, 1 );
- SAVE_VARIABLE( m08_petra_c2_unit, 2 );
- SAVE_VARIABLE( m08_petra_c3_unit, 3 );
- SAVE_VARIABLE( c1_last_loc, 4 );
- SAVE_VARIABLE( c2_last_loc, 5 );
- SAVE_VARIABLE( c3_last_loc, 6 );
- SAVE_VARIABLE( petra_c_active, 7 );
- SAVE_VARIABLE( created_vehicle, 8 );
- SAVE_VARIABLE( player_vehicle_id, 9 );
- }
- void Created(GameObject * obj)
- {
- m08_petra_c1_unit = 0;
- m08_petra_c2_unit = 0;
- m08_petra_c3_unit = 0;
- c1_last_loc = 111759;
- c2_last_loc = 111761;
- c3_last_loc = 111763;
- petra_c_active = false;
- created_vehicle = false;
- player_vehicle_id = 0;
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if(type == M08_PLAYER_VEHICLE_ID)
- {
- player_vehicle_id = param;
- }
- if(type == M08_PETRA_C_UNIT_STATUS)
- {
- Commands->Send_Custom_Event(obj, sender, M08_PETRA_C_UNIT_STATUS, petra_c_active, 0.0f);
- }
- if(type == M08_PETRA_C_ACTIVATE && !petra_c_active)
- {
- petra_c_active = true;
- Commands->Create_Logical_Sound(obj, M08_PETRA_C_LOGICAL, Vector3 (0,0,0), 2500.0f);
- // Custom to bring in helo troop drop
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_HELO_KILLED, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_HELO_KILLED, 2, 1.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_HELO_KILLED, 3, 2.0f);
- }
- if(type == M08_PETRA_C_DEACTIVATE && petra_c_active)
- {
- petra_c_active = false;
- Commands->Create_Logical_Sound(obj, M08_PETRA_C_LOGICAL, Vector3 (0,0,0), 2500.0f);
- }
- if(type == M08_PETRA_C_CREATED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_c1_unit++;
- }
- break;
- case 2:
- {
- m08_petra_c2_unit++;
- }
- break;
- case 3:
- {
- m08_petra_c3_unit++;
- }
- break;
- }
- }
- if(type == M08_PETRA_C_KILLED)
- {
- switch(param)
- {
- case 1:
- {
- m08_petra_c1_unit--;
- }
- break;
- case 2:
- {
- m08_petra_c2_unit--;
- }
- break;
- case 3:
- {
- m08_petra_c3_unit--;
- }
- break;
- }
- }
- if((type == M08_PETRA_C_KILLED || type == M08_PETRA_C_HELO_KILLED) && petra_c_active)
- {
-
- switch(param)
- {
- case 1:
- {
- if(m08_petra_c1_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111759);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(c1_last_loc == 111759)
- {
- drop_loc = Commands->Find_Object(111760);
- drop_facing = Commands->Get_Facing(drop_loc);
- c1_last_loc = 111760;
- }
- else if(c1_last_loc == 111760)
- {
- drop_loc = Commands->Find_Object(111759);
- drop_facing = Commands->Get_Facing(drop_loc);
- c1_last_loc = 111759;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropC1.txt");
- }
- }
- break;
- case 2:
- {
- if(m08_petra_c2_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111761);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(c2_last_loc == 111761)
- {
- drop_loc = Commands->Find_Object(111762);
- drop_facing = Commands->Get_Facing(drop_loc);
- c2_last_loc = 111762;
- }
- else if(c2_last_loc == 111762)
- {
- drop_loc = Commands->Find_Object(111761);
- drop_facing = Commands->Get_Facing(drop_loc);
- c2_last_loc = 111761;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropC2.txt");
- }
- }
- break;
- case 3:
- {
- if(m08_petra_c3_unit == 0)
- {
- GameObject * drop_loc = Commands->Find_Object(111763);
- float drop_facing = Commands->Get_Facing(drop_loc);
- if(c3_last_loc == 111763)
- {
- drop_loc = Commands->Find_Object(111764);
- drop_facing = Commands->Get_Facing(drop_loc);
- c3_last_loc = 111764;
- }
- else if(c3_last_loc == 111764)
- {
- drop_loc = Commands->Find_Object(111763);
- drop_facing = Commands->Get_Facing(drop_loc);
- c3_last_loc = 111763;
- }
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position(drop_loc));
- Commands->Set_Facing(chinook_obj1, drop_facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X8I_TroopDropC3.txt");
- }
- }
- break;
- }
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Petra_C_Unit, "Unit_ID=0:int")
- {
-
- enum{GO_STAR, GO_PETRA_C};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
- ActionParamsStruct params;
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_CREATED, unit_id, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_UNIT_STATUS, unit_id, 0.0f);
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == GO_STAR)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_PETRA_C_UNIT_STATUS)
- {
- Commands->Action_Reset(obj, INNATE_PRIORITY_ENEMY_SEEN + 5);
- bool petra_c_active = (param == 1) ? true : false;
- if(petra_c_active)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- Commands->Start_Timer (obj, this, 20.0f, GO_STAR);
- }
- else
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_PETRA_C );
- params.Set_Movement( Commands->Find_Object(100370), RUN, 8.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M08_PETRA_C_LOGICAL )
- {
- int unit_id = Commands->Get_ID(obj);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_UNIT_STATUS, unit_id, 0.0f);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_PETRA_C && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Apply_Damage( obj, 10000.0f, "STEEL");
- }
-
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Petra_C_Helo, "Unit_ID=0:int")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( m08_petra_a1_unit, 1 );
- }
- void Created(GameObject * obj)
- {
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int unit_id = Get_Int_Parameter("Unit_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_HELO_KILLED, unit_id, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Activate_Petra_C, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(109626), M08_PETRA_C_ACTIVATE, 1, 0.0f);
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Deactivate_Petra_C, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100389), M08_PETRA_C_DEACTIVATE, 1, 0.0f);
-
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Facility_APC, "")
- {
- bool attacking;
- int reinforce;
- bool enemy_seen;
-
- enum{WAYPATH, DROP_SOLDIERS, ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( reinforce, 2 );
- SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- reinforce = 0;
- enemy_seen = false;
-
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- enemy_seen = true;
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 10 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
-
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_REINFORCEMENT_KILLED)
- {
- reinforce++;
- if(reinforce%2 == 0 && reinforce < 5)
- {
- enemy_seen = true;
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- }
- }
-
- void Timer_Expired(GameObject * obj, int timer_id )
- {
-
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
-
- }
- void Damaged (GameObject * obj, GameObject * damager, float amount)
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- enemy_seen = true;
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_MiniGunner_1Off", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- }
- };
- DECLARE_SCRIPT(M08_Patrol_Inactive, "Waypath_ID=0:int, Waypath_Loc:Vector3, Controller_ID=0:int")
- {
- int waypath_id;
- Vector3 waypath_loc;
- bool enemy_seen;
-
- enum {WAYPATH, GO_WAYPATH, GO_STAR};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- // SAVE_VARIABLE( waypath_loc, 2 );
- // SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = waypath_id;
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, WAYPATH);
- }
- if(action_id == GO_STAR && reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer(obj, this, 60.0f, GO_STAR);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON)
- {
- // No starting units can hear footsteps until otherwise alerted
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- enemy_seen = false;
- waypath_id = Get_Int_Parameter("Waypath_ID");
- waypath_loc = Get_Vector3_Parameter("Waypath_Loc");
- Commands->Set_Innate_Soldier_Home_Location(obj, waypath_loc, 4.0f);
- ActionParamsStruct params;
-
- if(waypath_id == 0)
- {
- Commands->Set_Innate_Is_Stationary(obj, true);
- }
- else if(waypath_id == 1)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- else
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
-
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if((Commands->Is_A_Star(enemy)) && (!enemy_seen))
- {
- enemy_seen = true;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, true);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == WAYPATH)
- {
- params.Set_Basic( this, INNATE_PRIORITY_GUNSHOT_HEARD - 5, GO_WAYPATH );
- params.Set_Movement( waypath_loc, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(timer_id == GO_STAR)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- params.Set_Movement( STAR, RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int controller_id = Get_Int_Parameter("Controller_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_PATROL_KILLED, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Scientist, "Controller_ID=0:int")
- {
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( waypath_id, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON)
- {
- Commands->Start_Random_Conversation(obj);
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int controller_id = Get_Int_Parameter("Controller_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_SCIENTIST_KILLED, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Observatory_Dome_Controller, "")
- {
- bool reinforcements;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( reinforcements, 1 );
- }
- void Created(GameObject * obj)
- {
- reinforcements = false;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_SCIENTIST_KILLED && reinforcements)
- {
- // Spawn units to pour into observatory
- Commands->Enable_Spawner(100473, true);
- Commands->Enable_Spawner(100474, true);
- Commands->Enable_Spawner(100475, true);
- Commands->Enable_Spawner(100476, true);
- }
- if(type == M08_REINFORCEMENTS)
- {
- reinforcements = (param == 1) ? true : false;
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Reinforcements_Active, "Controller_ID=0:int")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- int controller_id = Get_Int_Parameter("Controller_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_REINFORCEMENTS, 1, 0.0f);
-
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Reinforcements_Inactive, "Controller_ID=0:int")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- int controller_id = Get_Int_Parameter("Controller_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_REINFORCEMENTS, 0, 0.0f);
-
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Activate_Cavern_Entrance_Truck, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
-
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100516), M08_CAVERN_ENTRANCE_TRUCK, 1);
- }
- }
- };
- DECLARE_SCRIPT(M08_Cavern_Entrance_Truck, "")
- {
- enum{WAYPATH};
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_CAVERN_ENTRANCE_TRUCK)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.WaypathID = 100517;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
-
- if(action_id == WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Apply_Damage( obj, 10000.0f, "STEEL");
- }
- }
- };
- DECLARE_SCRIPT(M08_Facility_Scientist_Inactive, "Point1_ID=0:int, Point2_ID=0:int, Point3_ID=0:int, Controller_ID=0:int")
- {
- int point1_id;
- int point2_id;
- int point3_id;
- int controller_id;
- bool enemy_seen;
- enum {GO_POINT1, GO_POINT2, GO_POINT3, GO_POINT1A, GO_POINT2A, GO_POINT3A,
- FROM_HANDS_OVER_HEAD, TO_HANDS_OVER_HEAD};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_seen, 5 );
- }
- void Created (GameObject * obj)
- {
-
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON)
- {
- enemy_seen = false;
- // No starting units can hear footsteps until otherwise alerted
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- point1_id = Get_Int_Parameter("Point1_ID");
- point2_id = Get_Int_Parameter("Point2_ID");
- point3_id = Get_Int_Parameter("Point3_ID");
-
- ActionParamsStruct params;
-
- if(point1_id != 0)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT1A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
-
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(reason != ACTION_COMPLETE_NORMAL)
- {
- Commands->Start_Timer(obj, this, 30.0f, GO_POINT1);
- return;
- }
- // Play animation at point
- if(action_id == GO_POINT1A && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT2 );
- params.Set_Animation ("S_A_HUMAN.H_A_A0F0", false);
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == GO_POINT2A && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT3 );
- params.Set_Animation ("S_A_HUMAN.H_A_A0F0", false);
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == GO_POINT3A && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT1 );
- params.Set_Animation ("S_A_HUMAN.H_A_A0F0", false);
- Commands->Action_Play_Animation (obj, params);
- }
-
- // Goto point
- if(action_id == GO_POINT1 && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT1A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_POINT2 && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT2A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(action_id == GO_POINT3 && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT3A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if(action_id == TO_HANDS_OVER_HEAD && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 100);
- params.Set_Animation( "H_A_Host_L1b", true );
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == FROM_HANDS_OVER_HEAD && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT1A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == GO_POINT1 && !enemy_seen)
- {
- enemy_seen = false;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, false);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_POINT1A );
- params.Set_Movement( Commands->Find_Object(point1_id), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- else
- {
- Commands->Start_Timer(obj, this, 30.0f, GO_POINT1);
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if((Commands->Is_A_Star(enemy)) && (!enemy_seen))
- {
- enemy_seen = true;
- Commands->Innate_Soldier_Enable_Footsteps_Heard(obj, true);
- Commands->Set_Innate_Is_Stationary(obj, true);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, TO_HANDS_OVER_HEAD);
- params.Set_Animation( "H_A_Host_L1a", false );
- Commands->Action_Play_Animation (obj, params);
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int controller_id = Get_Int_Parameter("Controller_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_SCIENTIST_KILLED, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Cavern_Controller, "")
- {
- int cavern_unit;
- bool cavern_activated;
- bool first_apc;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( cavern_activated, 1 );
- SAVE_VARIABLE( first_apc, 2 );
- }
- void Created(GameObject * obj)
- {
- cavern_unit = 6;
- cavern_activated = false;
- first_apc = true;
- }
-
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (type == M08_DEACTIVATE_ENCOUNTER)
- {
- if(cavern_activated)
- {
- cavern_activated = false;
- }
- }
- if(type == M08_SCIENTIST_KILLED)
- {
- cavern_unit--;
- if(cavern_activated)
- {
- // Cavern_Reinforcements ();
- }
- }
- if(type == M08_PATROL_KILLED)
- {
-
- cavern_unit--;
- if(cavern_activated)
- {
- // Cavern_Reinforcements ();
- }
- }
- if(type == M08_CUSTOM_ACTIVATE)
- {
-
- cavern_activated = true;
- Commands->Enable_Spawner(100593, true);
- Commands->Enable_Spawner(100592, true);
- }
-
- }
- /* void Cavern_Reinforcements ()
- {
- if (cavern_unit < 5 && first_apc)
- {
- first_apc = false;
- Commands->Enable_Spawner(100593, true);
- Cavern_Reinforcements ();
-
- }
- else if (cavern_unit < 3 && !first_apc)
- {
- Commands->Enable_Spawner(100592, true);
- }
-
- }*/
- };
- DECLARE_SCRIPT(M08_Custom_Activate, "Controller_ID=0:int")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- int controller_id = Get_Int_Parameter("Controller_ID");
- // Custom to activate
- Commands->Send_Custom_Event(obj, Commands->Find_Object(controller_id), M08_CUSTOM_ACTIVATE, 1, 0.0f);
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Cavern_APC, "Waypath_ID=0:int")
- {
- bool attacking;
- int reinforce;
-
- enum{ATTACK_OVER, DROP_SOLDIERS};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( reinforce, 2 );
- }
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- int waypath_id = Get_Int_Parameter("Waypath_ID");
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, DROP_SOLDIERS );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- }
-
- };
- DECLARE_SCRIPT(M08_Cavern_Tunnel_APC, "")
- {
- bool attacking;
- int reinforce;
- bool enemy_seen;
-
- enum{WAYPATH, DROP_SOLDIERS, ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( reinforce, 2 );
- SAVE_VARIABLE( enemy_seen, 3 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- reinforce = 0;
- enemy_seen = false;
-
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- enemy_seen = true;
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 10 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
-
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_REINFORCEMENT_KILLED)
- {
- reinforce++;
- if(reinforce%2 == 0 && reinforce < 7)
- {
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- }
- }
-
- void Timer_Expired(GameObject * obj, int timer_id )
- {
-
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
-
- }
- void Damaged (GameObject * obj, GameObject * damager, float amount)
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- enemy_seen = true;
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(obj));
- Vector3 pos = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
- float a = cos(DEG_TO_RADF(facing)) * -4.0;
- float b = sin(DEG_TO_RADF(facing)) * -4.0;
-
- Vector3 soldier_loc1 = pos + Vector3(a, b + .5f, 0.5f);
- GameObject * soldier1 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc1);
- Commands->Attach_Script(soldier1, "M08_APC_Soldier", param1);
- Vector3 soldier_loc2 = pos + Vector3(a, (b - .5f), 0.5f);
- GameObject * soldier2 = Commands->Create_Object("Nod_FlameThrower_2SF", soldier_loc2);
- Commands->Attach_Script(soldier2, "M08_APC_Soldier", param1);
- }
- }
- };
- DECLARE_SCRIPT(M08_Cavern_Gun_Emplacement, "")
- {
- bool attacking;
- enum{ATTACK_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
-
- SAVE_VARIABLE( attacking, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_NOD );
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
-
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- // Spawn buggy to patrol lower cavern
- Commands->Enable_Spawner(100620, true);
- if(!attacking)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (damager, 250.0f, 0.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack( obj, params );
-
- Commands->Start_Timer(obj, this, 6.0f, ATTACK_OVER);
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
- }
-
- };
- DECLARE_SCRIPT(M08_Lower_Cavern_Buggy, "")
- {
- bool attacking;
- bool in_cavern;
- enum{WAYPATH, ATTACK_OVER, GO_WAYPATH};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( in_cavern, 2 );
- }
- void Created (GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100621;
- params.WaypathSplined = true;
- Commands->Action_Goto( obj, params );
- attacking = false;
- in_cavern = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!attacking && !in_cavern)
- {
- attacking = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), WALK, 1.5f );
- params.Set_Attack (enemy, 250.0f, 0.0f, 1);
- params.WaypathID = 100631;
- params.WaypathSplined = true;
- Commands->Modify_Action (obj, WAYPATH, params);
- Commands->Start_Timer (obj, this, 10.0f, ATTACK_OVER);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == GO_WAYPATH && reason == ACTION_COMPLETE_NORMAL)
- {
- in_cavern = true;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (STAR, 250.0f, 0.0f, 1);
- params.WaypathID = 100631;
- params.WaypathSplined = true;
- Commands->Action_Attack( obj, params );
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
- if(timer_id == ATTACK_OVER)
- {
- attacking = false;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (STAR, 250.0f, 0.0f, 1);
- params.WaypathID = 100631;
- Commands->Modify_Action (obj, WAYPATH, params);
-
- }
-
- }
-
- };
- DECLARE_SCRIPT(M08_Unarmed_Prisoner, "Exit_Cell_ID=0:int, Weapon_Loc_ID=0:int")
- {
- bool free;
- enum{EXIT_CELL, WEAPONS, KEEP_TRYING};
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( free, 1 );
- }
- void Created (GameObject * obj)
- {
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_NEUTRAL );
- Commands->Set_Innate_Is_Stationary(obj, true);
- free = false;
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == WEAPONS && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Give_PowerUp(obj, "POW_Chaingun_AI");
- Commands->Select_Weapon(obj, "Weapon_Chaingun_Ai" );
- }
- if(action_id == EXIT_CELL && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WEAPONS );
- params.Set_Movement( Commands->Find_Object(Get_Int_Parameter("Weapon_Loc_ID")), RUN, 1.0f );
- Commands->Action_Goto( obj, params );
- }
- if(reason == ACTION_COMPLETE_LOW_PRIORITY)
- {
- Commands->Start_Timer (obj, this, 1.0f, KEEP_TRYING);
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == KEEP_TRYING)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, EXIT_CELL );
- params.Set_Movement( Commands->Find_Object(Get_Int_Parameter("Exit_Cell_ID")), RUN, 1.0f );
- Commands->Action_Goto( obj, params );
- }
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_FREE_PRISONER && !free)
- {
- free = true;
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_GDI );
- Commands->Set_Innate_Is_Stationary(obj, false);
- Commands->Grant_Key (obj, 1, true);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, EXIT_CELL );
- params.Set_Movement( Commands->Find_Object(Get_Int_Parameter("Exit_Cell_ID")), RUN, 1.0f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Poked(GameObject * obj, GameObject * poker)
- {
- if (Commands->Is_A_Star(poker))
- {
- Commands->Give_PowerUp(obj, "POW_Chaingun_AI");
- Commands->Select_Weapon(obj, "Weapon_Chaingun_Ai" );
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
-
- }
- };
- DECLARE_SCRIPT(M08_Free_Prisoners_Zone, "Prisoner1_ID=0:int, Prisoner2_ID=0:int, Prisoner3_ID=0:int, Prisoner4_ID=0:int")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- int prisoner1_id = Get_Int_Parameter("Prisoner1_ID");
- int prisoner2_id = Get_Int_Parameter("Prisoner2_ID");
- int prisoner3_id = Get_Int_Parameter("Prisoner3_ID");
- int prisoner4_id = Get_Int_Parameter("Prisoner4_ID");
- Commands->Send_Custom_Event(obj, Commands->Find_Object(prisoner1_id), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(prisoner2_id), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(prisoner3_id), M08_FREE_PRISONER, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(prisoner4_id), M08_FREE_PRISONER, 1, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT(M08_Sakura, "")
- {
- bool enemy_seen;
- bool flee;
- int current_waypath;
- float health;
-
- enum{WAYPATH, TO_SECOND, INITIAL, FLEE};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_seen, 1 );
- SAVE_VARIABLE( flee, 2 );
- SAVE_VARIABLE( current_waypath, 3 );
- SAVE_VARIABLE( health, 4 );
- SAVE_VARIABLE( flee, 5 );
- }
- void Created(GameObject * obj)
- {
- // Send Sakura's id to the movement zones
- int sakura_id = Commands->Get_ID(obj);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(100356), M08_SAKURA_ID, sakura_id, 0.0f);
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_GDI );
- Commands->Enable_Enemy_Seen( obj, true);
- enemy_seen = true;
-
- ActionParamsStruct params;
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, INITIAL );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100774;
- Commands->Action_Goto( obj, params );
- current_waypath = 100774;
- health = Commands->Get_Max_Health(obj);
- flee = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- if(!enemy_seen)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.Set_Attack (enemy, 150.0f, 0.0f, 1);
- params.WaypathID = current_waypath;
- Commands->Modify_Action (obj, WAYPATH, params);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
-
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_MOVE_SAKURA)
- {
- switch(param)
- {
- case 2:
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, TO_SECOND );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100795;
- Commands->Action_Goto( obj, params );
- enemy_seen = false;
- }
- break;
- }
-
- }
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- if(action_id == INITIAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100780;
- Commands->Action_Attack( obj, params );
- enemy_seen = false;
- current_waypath = 100780;
- }
- if(action_id == TO_SECOND)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, WAYPATH );
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = 100800;
- Commands->Action_Attack( obj, params );
- enemy_seen = false;
- current_waypath = 100800;
- }
- if(action_id == FLEE)
- {
- Commands->Destroy_Object(obj);
- }
-
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
-
- if((Commands->Get_Health(obj) < (.2 * Commands->Get_Max_Health(obj))) && !flee)
- {
- flee = true;
-
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 6, FLEE );
- params.MovePathfind = false;
- params.Set_Movement( Commands->Get_Position(Commands->Find_Object(110337)), RUN, 1.5f );
- Commands->Action_Goto( obj, params );
- }
- if((Commands->Get_Health(obj) < (.2 * Commands->Get_Max_Health(obj))))
- {
- Commands->Set_Health(obj, health);
- }
- health = Commands->Get_Health(obj);
- }
- };
- DECLARE_SCRIPT(M08_Activate_Sakura, "")
- {
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created(GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Spawn Sakura
- Commands->Enable_Spawner(100773, true);
-
- }
- }
- };
- DECLARE_SCRIPT(M08_Nod_Warden, "")
- {
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE( already_entered, 1 );
- }
- void Created(GameObject * obj)
- {
- Commands->Innate_Disable(obj);
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON)
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Soldier_Home_Location(obj, Commands->Get_Position(obj), 4.0f);
- }
-
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- Vector3 create_position = Commands->Get_Position( obj );
- create_position.Z += 0.5f;
- Commands->Create_Object( "Level_02_Keycard", create_position );
- }
-
- };
- DECLARE_SCRIPT(M08_Move_Sakura, "Movement_Loc=0:int")
- {
- bool already_entered;
- int sakura_id;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( sakura_id, 2 );
- }
- void Created(GameObject * obj)
- {
- sakura_id = 0;
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- int movement_loc = Get_Int_Parameter("Movement_Loc");
-
- // Custom to Sakura to move to next location in the Petra canyon
- Commands->Send_Custom_Event(obj, Commands->Find_Object(sakura_id), M08_MOVE_SAKURA, movement_loc, 0.0f);
- }
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_SAKURA_ID)
- {
- sakura_id = param;
- }
-
- }
- };
- DECLARE_SCRIPT (M08_Mobile_Vehicle, "CheckBlocked=1:int, Attack_Loc0=0:int, Attack_Loc1=0:int, Attack_Loc2=0:int, Attack_Loc3=0:int, Attack_Loc4=0:int, Attack_Loc5=0:int, Attack_Loc6=0:int, Attack_Loc7=0:int, Attack_Loc8=0:int, Attack_Loc9=0:int, Attack_Loc10=0:int")
- {
- bool attacking;
- int attack_loc [11];
- float loc_dist;
- int loc;
- Vector3 current_loc;
- Vector3 enemy_loc;
- float health;
- enum{ATTACK_OVER, GOTO_LOC};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( attacking, 1 );
- SAVE_VARIABLE( current_loc, 4 );
- SAVE_VARIABLE( enemy_loc, 5 );
- SAVE_VARIABLE( loc_dist, 6 );
- SAVE_VARIABLE( loc, 7 );
- SAVE_VARIABLE( health, 8 );
- SAVE_VARIABLE( attack_loc, 9 );
- }
- void Created(GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
-
- attack_loc [0] = Get_Int_Parameter("Attack_Loc0");
- attack_loc [1] = Get_Int_Parameter("Attack_Loc1");
- attack_loc [2] = Get_Int_Parameter("Attack_Loc2");
- attack_loc [3] = Get_Int_Parameter("Attack_Loc3");
- attack_loc [4] = Get_Int_Parameter("Attack_Loc4");
- attack_loc [5] = Get_Int_Parameter("Attack_Loc5");
- attack_loc [6] = Get_Int_Parameter("Attack_Loc6");
- attack_loc [7] = Get_Int_Parameter("Attack_Loc7");
- attack_loc [8] = Get_Int_Parameter("Attack_Loc8");
- attack_loc [9] = Get_Int_Parameter("Attack_Loc9");
- attack_loc [10] = Get_Int_Parameter("Attack_Loc10");
-
- loc_dist = 1000.0f;
- loc = 100;
- Commands->Start_Timer(obj, this, 1.0f, GOTO_LOC);
- health = Commands->Get_Health(obj);
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- bool blocked;
- if (Get_Int_Parameter ("CheckBlocked") != 0)
- {
- blocked = true;
- }
- else
- {
- blocked = false;
- }
- ActionParamsStruct params;
- Commands->Debug_Message("Attack_Loc = %d /n", attack_loc[loc]);
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (attack_loc [loc])), 1.0f, 5.0f );
- params.Set_Attack(enemy, 100.0f, 5.0f, true);
- params.AttackCheckBlocked = blocked;
-
- Commands->Modify_Action(obj, 10, params);
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- if (timer_id == GOTO_LOC)
- {
- current_loc = Commands->Get_Position ( obj );
- Vector3 star_loc = Commands->Get_Position (STAR);
- for (int x = 0; x <= 10; x++)
- {
- if(attack_loc[x] != NULL)
- {
- float dist = Commands->Get_Distance(star_loc, Commands->Get_Position (Commands->Find_Object (attack_loc [x])));
-
- if (dist < loc_dist)
- {
- loc_dist = dist;
-
- loc = x;
- }
- }
- }
- loc_dist = 1000.0f;
-
- Commands->Action_Reset(obj, 99);
-
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN +5, 10 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (attack_loc [loc])), 1.0f, 5.0f );
-
- Commands->Action_Attack(obj, params);
-
- Commands->Start_Timer(obj, this, 5.0f, GOTO_LOC);
- }
- }
- };
- DECLARE_SCRIPT(M08_Flyover_Controller, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 10.0f, 0);
- last = 0;
-
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[8] =
- {
- "X8B_Apache_00.txt",
- "X8B_Apache_01.txt",
- "X8B_Apache_02.txt",
- "X8B_Apache_03.txt",
- "X8B_Trnspt_00.txt",
- "X8B_Trnspt_01.txt",
- "X8B_Trnspt_02.txt",
- "X8B_Trnspt_03.txt",
-
- };
- int random = Commands->Get_Random_Int ( 0, 7 );
-
- while (random == last)
- {
- random = Commands->Get_Random_Int ( 0, 7 );
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- Commands->Start_Timer(obj, this, 10.0f, 0);
-
- last = random;
- }
- };
- DECLARE_SCRIPT(M08_Activate_Excavation, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(210.156f, 301.252f, -7.404f));
- Commands->Set_Facing(chinook_obj1, 25.000f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "M08_XG_VehicleDrop1.txt");
- GameObject * chinook_obj2 = Commands->Create_Object ( "Invisible_Object", Vector3(202.507f, 308.211f, -6.972f));
- Commands->Set_Facing(chinook_obj2, 0.000f);
- Commands->Attach_Script(chinook_obj2, "Test_Cinematic", "M08_XG_VehicleDrop1.txt");
- }
- }
- };
- DECLARE_SCRIPT(M08_Facility_Scientist, "Loc1_ID=0:int, Loc2_ID=0:int, Loc3_ID=0:int, Animation:string, Spawner_ID=0:int")
- {
- bool enemy_seen;
- bool start_over;
-
- enum{GO_FIRST_LOC, FACING_FIRST_LOC, ANIMATE_FIRST_LOC, GO_SECOND_LOC, FACING_SECOND_LOC, ANIMATE_SECOND_LOC,
- GO_THIRD_LOC, FACING_THIRD_LOC, ANIMATE_THIRD_LOC, HANDS_OVER_HEAD, START_OVER};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_seen, 1 );
- SAVE_VARIABLE( start_over, 2 );
- }
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- start_over = false;
- enemy_seen = false;
- Commands->Set_Player_Type(obj, SCRIPT_PLAYERTYPE_NOD );
- params.Set_Basic (this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_FIRST_LOC);
- params.Set_Movement (Commands->Find_Object(Get_Int_Parameter("Loc1_ID")), WALK, 1.5f);
- Commands->Action_Goto (obj, params);
-
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- const char *anim = Get_Parameter("Animation");
- if(reason != ACTION_COMPLETE_NORMAL && action_id != Commands->Get_Action_ID(obj) && !start_over)
- {
- start_over = true;
- Commands->Start_Timer (obj, this, 10.0f, START_OVER);
- return;
- }
- // First Loc
- if(action_id == GO_FIRST_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, FACING_FIRST_LOC);
- params.Set_Face_Location( Commands->Get_Position(Commands->Find_Object(Get_Int_Parameter("Loc1_ID"))), 1.5f);
- Commands->Action_Face_Location ( obj, params );
- }
- if(action_id == FACING_FIRST_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, ANIMATE_FIRST_LOC );
- params.Set_Animation (anim, false);
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == ANIMATE_FIRST_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN - 5), GO_SECOND_LOC);
- params.Set_Movement (Commands->Find_Object(Get_Int_Parameter("Loc2_ID")), WALK, 1.5f);
- Commands->Action_Goto (obj, params);
- }
- // Second Loc
- if(action_id == GO_SECOND_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, FACING_SECOND_LOC);
- params.Set_Face_Location( Commands->Get_Position(Commands->Find_Object(Get_Int_Parameter("Loc2_ID"))), 1.5f);
- Commands->Action_Face_Location ( obj, params );
- }
- if(action_id == FACING_SECOND_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, ANIMATE_SECOND_LOC );
- params.Set_Animation (anim, false);
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == ANIMATE_SECOND_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN - 5), GO_THIRD_LOC);
- params.Set_Movement (Commands->Find_Object(Get_Int_Parameter("Loc3_ID")), WALK, 1.5f);
- Commands->Action_Goto (obj, params);
- }
-
- // Third Loc
- if(action_id == GO_THIRD_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, FACING_THIRD_LOC);
- params.Set_Face_Location( Commands->Get_Position(Commands->Find_Object(Get_Int_Parameter("Loc3_ID"))), 1.5f);
- Commands->Action_Face_Location ( obj, params );
- }
- if(action_id == FACING_THIRD_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, ANIMATE_THIRD_LOC );
- params.Set_Animation (anim, false);
- Commands->Action_Play_Animation (obj, params);
- }
- if(action_id == ANIMATE_THIRD_LOC && reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN - 5), GO_FIRST_LOC);
- params.Set_Movement (Commands->Find_Object(Get_Int_Parameter("Loc1_ID")), WALK, 1.5f);
- Commands->Action_Goto (obj, params);
- }
- if(action_id == HANDS_OVER_HEAD && reason == ACTION_COMPLETE_NORMAL)
- {
- // In hands over head anim
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10);
- params.Set_Animation( "H_A_HOST_L1B", true );
- Commands->Action_Play_Animation (obj, params);
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- Commands->Create_Logical_Sound(obj, SOUND_TYPE_GUNSHOT, Commands->Get_Position(obj), 8.0f);
- if(!enemy_seen)
- {
- // Help! Intruder! Help!\n
- const char *conv_name = ("M08_CON008");
- int conv_id = Commands->Create_Conversation (conv_name);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 1010211);
- // Assume hands over head anim
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, HANDS_OVER_HEAD);
- params.Set_Animation( "H_A_HOST_L1A", false );
- Commands->Action_Play_Animation (obj, params);
- enemy_seen = true;
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- // Spawn stealth soldier to come after STAR
- int spawner_id = Get_Int_Parameter("Spawner_ID");
- Commands->Enable_Spawner(spawner_id, true);
- }
- };
- DECLARE_SCRIPT(M08_Apache_Controller, "")
- {
- bool active;
- int area;
- bool destroyed[3];
- int apache_id[3];
- int attacking_apache;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(active, 1);
- SAVE_VARIABLE(area, 2);
- SAVE_VARIABLE(destroyed, 3);
- SAVE_VARIABLE(apache_id, 4);
- SAVE_VARIABLE(attacking_apache, 5);
- }
-
- void Created(GameObject * obj)
- {
- active = false;
- attacking_apache = 0;
- area = -1;
- destroyed[0] = destroyed[1] = destroyed[2] = false;
- //apache_id[0] = Commands->Get_ID(Commands->Create_Object("Nod_Apache_No_Idle", Vector3(-12.129f, -149.546f, 2.949f)));
- //GameObject * apache = Commands->Find_Object(apache_id[0]);
- //Commands->Attach_Script(apache, "M10_Apache", "0");
- apache_id[1] = Commands->Get_ID(Commands->Create_Object("Nod_Apache", Vector3(-45.993f, -66.675f, 12.382f)));
- GameObject * apache = Commands->Find_Object(apache_id[1]);
- Commands->Attach_Script(apache, "M08_Apache", "1");
- Commands->Send_Custom_Event(Owner(), apache, 400, 400);
-
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (param < -1 || param > 2)
- {
- return;
- }
-
- if (type == 1000)
- {
- destroyed[param] = true;
- if (Commands->Find_Object(apache_id[param]))
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(apache_id[param]), 300, 300);
- }
- }
- if (type == 2000)
- {
- apache_id[param] = 0;
- if (!destroyed[param])
- {
- Commands->Start_Timer(obj, this, 40.0f, param);
- }
- else
- {
- }
- }
- if (type == 3000)
- {
- if (param == area)
- {
- return;
- }
- if (area > -1)
- {
- Return_To_Helipad(area);
- }
- area = param;
- if (area > -1)
- {
- Attack_Player(area);
- }
- }
- if (type == 4000)
- {
- if (area == param)
- {
- Commands->Send_Custom_Event(obj, sender, 100, 100);
- attacking_apache = area;
- }
- }
- if (type == 5000)
- {
- Reload_At_Helipad(area);
- Commands->Start_Timer(obj, this, 25.0f, 10 + area);
- }
- }
- void Return_To_Helipad(int current_area)
- {
- GameObject * apache = Commands->Find_Object(apache_id[current_area]);
- if (apache)
- {
- Commands->Send_Custom_Event(Owner(), apache, 200, 200);
- }
- }
- void Reload_At_Helipad(int current_area)
- {
- GameObject * apache = Commands->Find_Object(apache_id[current_area]);
- if (apache)
- {
- Commands->Send_Custom_Event(Owner(), apache, 500, 500);
- }
- }
- void Attack_Player(int current_area)
- {
- GameObject * apache = Commands->Find_Object(apache_id[area]);
- if (apache)
- {
- Commands->Send_Custom_Event(Owner(), apache, 100, 100);
- attacking_apache = area;
- }
- }
- void Replace_Apache(int current_area)
- {
- Vector3 start_loc;
- start_loc.Set(-45.993f, -66.675f, 12.382f);
- GameObject * apache = Commands->Create_Object("Nod_Apache_No_Idle", start_loc);
- Commands->Enable_Engine(apache, true);
- char param[10];
- sprintf(param, "%d", current_area);
- Commands->Attach_Script(apache, "M08_Apache", param);
- Commands->Send_Custom_Event(Owner(), apache, 400, 400);
- apache_id[current_area] = Commands->Get_ID(apache);
- }
-
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id >= 10)
- {
- int current_area = timer_id - 10;
- if (current_area == area)
- {
- GameObject * apache = Commands->Find_Object(apache_id[area]);
- if (apache)
- {
- Commands->Send_Custom_Event(Owner(), apache, 100, 100);
- attacking_apache = area;
- }
- }
- return;
- }
- if (!destroyed[timer_id])
- {
- Replace_Apache(timer_id);
- }
- else
- {
- }
- }
- };
- DECLARE_SCRIPT(M08_Apache, "Area:int")
- {
- bool on_pad, pad_destroyed;
- int my_area;
-
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(on_pad, 1);
- SAVE_VARIABLE(my_area, 2);
- SAVE_VARIABLE(pad_destroyed, 3);
- }
-
- void Created(GameObject * obj)
- {
- //Commands->Enable_Vehicle_Transitions ( obj, false );
- Commands->Enable_Hibernation(obj, false);
-
- on_pad = true;
- pad_destroyed = false;
- my_area = Get_Int_Parameter("Area");
- }
-
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == 100 && param == 100)
- {
- on_pad = false;
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- Vector3 pos = Commands->Get_Position(obj);
- pos.Z += 10.0f;
- params.Set_Movement(pos, 1.0f, 1.0f);
- Commands->Action_Goto(obj, params);
- }
- if (type == 200 && param == 200)
- {
- int pad_obj = 106339;
-
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 2);
- params.Set_Movement(Commands->Find_Object(pad_obj), 1.0f, 0.1f);
- Commands->Action_Goto(obj, params);
- }
- if (type == 300 && param == 300)
- {
- pad_destroyed = true;
- if (on_pad)
- {
- Commands->Apply_Damage(obj, 10000.0f, "EXPLOSIVE");
- }
- }
- if (type == 400 && param == 400)
- {
- int waypath = 100322;
-
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 2);
- params.Set_Movement(Vector3(0,0,0), 1.0f, 1.0f);
- params.WaypathID = waypath;
- Commands->Action_Goto(obj, params);
- }
- if (type == 500 && param == 500)
- {
- int pad_obj = 106339;
-
- ActionParamsStruct params;
- params.Set_Basic(this, 91, 3);
- params.Set_Movement(Commands->Find_Object(pad_obj), 1.0f, 0.1f);
- Commands->Action_Goto(obj, params);
- }
- }
-
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 0)
- {
- Vector3 pos = Commands->Get_Position(STAR);
- float facing = Commands->Get_Facing(STAR);
- pos.X -= cos(DEG_TO_RADF(facing)) * 6.0f;
- pos.Y -= sin(DEG_TO_RADF(facing)) * 6.0f;
- pos.Z = WWMath::Max(pos.Z + 12.0f, Commands->Get_Safe_Flight_Height(pos.X, pos.Y) + 6.0f);
-
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 1);
- params.Set_Movement(pos, 1.0f, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- if (timer_id == 1)
- {
- if (!pad_destroyed && on_pad)
- {
- if (Commands->Get_Health(obj) < Commands->Get_Max_Health(obj))
- {
- Commands->Set_Health(obj, Commands->Get_Health(obj) + 5.0f);
- }
- Commands->Start_Timer(obj, this, 3.0f, 1);
- }
- }
- if (timer_id == 2)
- {
- Commands->Action_Reset(obj, 90);
- Commands->Start_Timer(obj, this, Commands->Get_Random(1.0f, 3.0f), 0);
- }
- if (timer_id == 3)
- {
- GameObject * controller = Commands->Find_Object(106339);
- if (controller)
- {
- Commands->Send_Custom_Event(obj, controller, 5000, Get_Int_Parameter("Area"));
- }
- }
- if (timer_id == 4)
- {
- Commands->Enable_Engine(obj, false);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (reason != ACTION_COMPLETE_NORMAL)
- {
- return;
- }
- if (action_id == 0)
- {
- Commands->Start_Timer(obj, this, 2.0f, 0);
- Commands->Start_Timer(obj, this, 60.0f, 3);
- }
- if (action_id == 1)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 2);
- params.Set_Attack(STAR, 150.0f, 2.0f, true);
- Commands->Action_Attack(obj, params);
-
- Commands->Start_Timer(obj, this, Commands->Get_Random(4.0f, 6.0f), 2);
- }
- if (action_id == 2)
- {
- Commands->Start_Timer(obj, this, 1.0f, 4);
- on_pad = true;
- Commands->Start_Timer(obj, this, 5.0f, 1);
- GameObject * controller = Commands->Find_Object(106339);
- if (controller)
- {
- Commands->Send_Custom_Event(obj, controller, 4000, Get_Int_Parameter("Area"));
- }
- }
- if (action_id == 3)
- {
- Commands->Start_Timer(obj, this, 1.0f, 4);
- on_pad = true;
- Commands->Start_Timer(obj, this, 5.0f, 1);
- }
- }
- void Killed(GameObject * obj, GameObject * killer)
- {
- GameObject * controller = Commands->Find_Object(106339);
- if (controller)
- {
- Commands->Send_Custom_Event(obj, controller, 2000, Get_Int_Parameter("Area"));
- }
- }
- };
- DECLARE_SCRIPT(M08_Mobile_Apache, "Entrance_Path_ID=0:int, Helipad_ID=0:int")
- {
-
- enum {ENTRANCE, GO_STAR, MOVE_TO_STAR, AIRBORNE, GO_HELIPAD, ARRIVED_HELIPAD, FLEE};
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE(on_pad, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Enable_Hibernation(obj, false);
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, ENTRANCE );
- params.MovePathfind = false;
- params.Set_Movement( Vector3(0,0,0), RUN, 1.5f );
- params.WaypathID = Get_Int_Parameter("Entrance_Path_ID");
- Commands->Action_Goto( obj, params );
- }
-
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(reason != ACTION_COMPLETE_NORMAL)
- {
- Commands->Start_Timer (obj, this, 2.0f, MOVE_TO_STAR);
- return;
- }
- if(action_id == ENTRANCE)
- {
- Go_Star(obj);
- Commands->Start_Timer (obj, this, 60.0f, GO_HELIPAD);
- }
- if(action_id == GO_STAR)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN + 5, 2);
- params.MovePathfind = false;
- params.Set_Attack(STAR, 150.0f, 2.0f, true);
- Commands->Action_Attack(obj, params);
- Commands->Start_Timer (obj, this, 2.0f, MOVE_TO_STAR);
- }
- if(action_id == ARRIVED_HELIPAD)
- {
- Commands->Enable_Engine(obj, false);
- Commands->Start_Timer (obj, this, 5.0f, AIRBORNE);
- }
- if(action_id == FLEE)
- {
- Commands->Destroy_Object(obj);
- }
-
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- ActionParamsStruct params;
-
- if(timer_id == MOVE_TO_STAR)
- {
- Go_Star(obj);
- }
- if(timer_id == GO_HELIPAD)
- {
-
- params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN + 6, ARRIVED_HELIPAD);
- params.MovePathfind = false;
- params.Set_Movement(Commands->Find_Object(Get_Int_Parameter("Helipad_ID")), 1.0f, 0.1f);
- Commands->Action_Goto(obj, params);
- }
- if(timer_id == AIRBORNE)
- {
- Commands->Enable_Engine(obj, true);
- Commands->Start_Timer (obj, this, 2.0f, MOVE_TO_STAR);
- Commands->Start_Timer (obj, this, 60.0f, GO_HELIPAD);
- }
-
- }
- void Go_Star(GameObject * obj)
- {
- Vector3 pos = Commands->Get_Position(STAR);
- float facing = Commands->Get_Facing(STAR);
- pos.X -= cos(DEG_TO_RADF(facing)) * 6.0f;
- pos.Y -= sin(DEG_TO_RADF(facing)) * 6.0f;
- pos.Z = WWMath::Max(pos.Z + 12.0f, Commands->Get_Safe_Flight_Height(pos.X, pos.Y) + 6.0f);
-
- ActionParamsStruct params;
- params.Set_Basic(this, INNATE_PRIORITY_ENEMY_SEEN + 5, GO_STAR);
- params.MovePathfind = false;
- params.Set_Movement(pos, 1.0f, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M08_HELIPAD_DESTROYED )
- {
- Vector3 pos = Commands->Get_Position(obj);
- pos.Z = pos.Z + 300.0f;
- params.Set_Basic(this, 100, FLEE);
- params.MovePathfind = false;
- params.Set_Movement(pos, 1.0f, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- }
- };
- DECLARE_SCRIPT(M08_Mutant_Behavior, "")
- {
- bool freed;
-
- enum {DOING_ANIMATION, GO_STAR};
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(freed, 1);
- }
-
- void Created(GameObject * obj)
- {
- // Commands->Innate_Disable(obj);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, DOING_ANIMATION );
- params.Set_Animation ("S_C_HUMAN.H_C_7001", true);
- Commands->Action_Play_Animation (obj, params);
- freed = false;
- }
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if(type == M08_INNATE_ON && !freed)
- {
-
- ActionParamsStruct params;
- params.Set_Basic( this, 99, DOING_ANIMATION );
- params.Set_Animation ("S_C_HUMAN.H_C_7001", false);
- Commands->Action_Play_Animation (obj, params);
- //Commands->Innate_Enable(obj);
- //params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, GO_STAR );
- //params.Set_Movement( STAR, RUN, 1.5f );
- //Commands->Action_Goto( obj, params );
- //freed = true;
- }
-
- }
- };
- DECLARE_SCRIPT(M08_Free_Jailed_Mutants, "")
- {
- REGISTER_VARIABLES()
- {
- // SAVE_VARIABLE(on_pad, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Enable_HUD_Pokable_Indicator( obj, true );
- }
- void Poked(GameObject * obj, GameObject * poker)
- {
- Commands->Enable_HUD_Pokable_Indicator( obj, false );
- Commands->Grant_Key (STAR, 10, true);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(106816), M08_INNATE_ON, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(106818), M08_INNATE_ON, 1, 0.0f);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(106819), M08_INNATE_ON, 1, 0.0f);
- }
- };
- DECLARE_SCRIPT(M08_Activate_Midtro, "")
- {
-
- bool already_entered;
-
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
-
- already_entered = true;
-
- Commands->Set_Position (STAR, Commands->Get_Position(Commands->Find_Object(111994)));
- //Commands->Static_Anim_Phys_Goto_Last_Frame (1450630, "res_elev06.res_elev06" );
- //Commands->Set_Animation_Frame ( Commands->Find_Object (1450630), "res_elev06.res_elev06", 51 );
- GameObject * cinematic_obj = Commands->Create_Object ( "Invisible_Object", Vector3(0.0f, 0.0f, 0.0f));
- Commands->Attach_Script(cinematic_obj, "Test_Cinematic", "X8A_MIDTRO.txt");
- }
- }
- };
- DECLARE_SCRIPT(M08_Prisoner_Conversation, "Orator_ID=0:int, Captive=0:int")
- {
-
- bool already_entered;
-
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
-
- int orator_id = Get_Int_Parameter("Orator_ID");
- bool captive = (Get_Int_Parameter("Captive") == 1) ? true : false;
- if(Commands->Find_Object(orator_id))
- {
- if(captive)
- {
- // Save us!\n
- const char *conv_name = ("M08_CON010");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(Commands->Find_Object(orator_id), conv_id, false, true);
- Commands->Start_Conversation (conv_id, 2);
-
- }
- else
- {
- // It's the Commando!\n
- const char *conv_name = ("M08_CON009");
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(Commands->Find_Object(orator_id), conv_id, false, true);
- Commands->Start_Conversation (conv_id, 2);
- }
- }
- }
- }
- };
- DECLARE_SCRIPT (M08_Elevator_Movement_Zone, "Direction:int, Anim_num:int, Elev_obj_num:int")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- char *elevators[1] =
- {
- "res_elev06.res_elev06",
-
- };
- if (enterer == STAR)
- {
- Commands->Attach_Script(STAR, "M00_No_Falling_Damage_DME", "");
- GameObject * blocker = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-100.952F, 483.541F, -155.645F));
- Commands->Set_Is_Rendered(blocker, false);
- int elev_obj_num = Get_Int_Parameter("Elev_obj_num");
- if (Get_Int_Parameter("Direction") == 0)
- {
- Commands->Static_Anim_Phys_Goto_Frame (elev_obj_num, 0, elevators [Get_Int_Parameter("Anim_num")] );
- }
- if (Get_Int_Parameter("Direction") == 1)
- {
- Commands->Static_Anim_Phys_Goto_Last_Frame (elev_obj_num, elevators [Get_Int_Parameter("Anim_num")] );
- }
- }
- }
- };
- DECLARE_SCRIPT (M08_Immortal_Star_DLS, "")
- {
- float health;
- bool immortal;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( health, 1 );
- SAVE_VARIABLE( immortal, 2 );
- }
- void Created (GameObject * obj)
- {
- health = Commands->Get_Health(obj);
- immortal = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == M08_STAR_IMMORTAL )
- {
- immortal = param ? true : false;
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if(immortal)
- {
- Commands->Set_Health(obj, health);
- }
- }
- };
- DECLARE_SCRIPT(M08_Enable_Stealth, "On=1:int")
- {
- void Created (GameObject * obj)
- {
- bool on = (Get_Int_Parameter("On")) ? true : false;
- if(on)
- {
- Commands->Enable_Stealth(obj, true);
- }
- else
- {
- Commands->Enable_Stealth(obj, false);
- }
- }
- };
- #define PRISONER_CONV_TABLE_SIZE ( sizeof(Prisoner_Conv_Table) / sizeof (Prisoner_Conv_Table[0]) )
- const char * Prisoner_Conv_Table[] =
- {
- "M08_CON011", //GCP1
- "M08_CON012",
- "M08_CON013",
- "M08_CON014",
- "M08_CON015",
- "M08_CON016",
- "M08_CON017",
- "M08_CON018",
- "M08_CON019",
- "M08_CON020", // [9]
- "M08_CON021", //GCP2
- "M08_CON022",
- "M08_CON023",
- "M08_CON024",
- "M08_CON025",
- "M08_CON026",
- "M08_CON027",
- "M08_CON028",
- "M08_CON029",
- "M08_CON030", // [19]
- "M08_CON031", //GCP3
- "M08_CON032",
- "M08_CON033",
- "M08_CON034",
- "M08_CON035",
- "M08_CON036",
- "M08_CON037",
- "M08_CON038",
- "M08_CON039",
- "M08_CON040" // [29]
- };
- DECLARE_SCRIPT(M08_Prisoner_Poke_Conversation, "")
- {
- int random;
- int last;
- bool conversation;
- enum{CONVERSATION};
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( random, 1 );
- SAVE_VARIABLE( last, 2 );
- SAVE_VARIABLE( conversation, 3 );
- }
- void Created (GameObject * obj)
- {
- random = Commands->Get_Random_Int(0, PRISONER_CONV_TABLE_SIZE);
- conversation = false;
- }
- void Poked(GameObject * obj, GameObject * poker)
- {
- if(conversation)
- {
- return;
- }
- conversation = true;
- const char * preset_name = Commands->Get_Preset_Name( obj );
-
- if((::strncmp( "GDI_Prisoner_v0a", preset_name, ::strlen( "GDI_Prisoner_v0a" ) ) == 0)
- || (::strncmp( "GDI_Prisoner_v0b", preset_name, ::strlen( "GDI_Prisoner_v0a" ) ) == 0))
- {
- Play_Conversation(obj, 10, 19);
- }
- else if((::strncmp( "GDI_Prisoner_v1a", preset_name, ::strlen( "GDI_Prisoner_v1a" ) ) == 0)
- || (::strncmp( "GDI_Prisoner_v1b", preset_name, ::strlen( "GDI_Prisoner_v1a" ) ) == 0))
- {
- Play_Conversation(obj, 10, 19);
- }
- else if((::strncmp( "GDI_Prisoner_v2a", preset_name, ::strlen( "GDI_Prisoner_v2a" ) ) == 0)
- || (::strncmp( "GDI_Prisoner_v2b", preset_name, ::strlen( "GDI_Prisoner_v2a" ) ) == 0))
- {
- Play_Conversation(obj, 20, 29);
- }
- }
-
- int Index(int Min, int Max)
- {
- while(random == last || random < Min || random > Max)
- {
- random = Commands->Get_Random_Int(0, PRISONER_CONV_TABLE_SIZE);
- }
- last = random;
- return last;
- }
- void Play_Conversation(GameObject * obj, int Min, int Max)
- {
- const char *conv_name = Prisoner_Conv_Table[Index(Min, Max)];
- int conv_id = Commands->Create_Conversation (conv_name, 100.0f, 200.0f, false);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 0);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- conversation = false;
- }
- }
- };
- DECLARE_SCRIPT(M08_Enable_KaneConversation, "")
- {
-
- bool already_entered;
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if ((Commands->Is_A_Star(enterer)) && (!already_entered))
- {
- already_entered = true;
- // Kane conversation
- GameObject * holograph = Commands->Find_Object(109884);
- GameObject * kane = Commands->Create_Object_At_Bone ( holograph, "Nod_Kane_HologramHead", "O_ARROW" );
- Commands->Attach_To_Object_Bone( kane, holograph, "O_ARROW" );
- Commands->Disable_All_Collisions ( kane );
- Commands->Set_Facing (kane, Commands->Get_Facing (holograph));
- Commands->Set_Loiters_Allowed( kane, false );
- Commands->Attach_Script(kane, "M08_KaneHead", "");
- }
- }
- };
- DECLARE_SCRIPT(M08_KaneHead, "")
- {
-
- bool already_entered;
-
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
-
- }
- void Created (GameObject * obj)
- {
- // Parker! Your interference is becoming troublesome.
- const char *conv_name = ("M08_CON041");
- int conv_id = Commands->Create_Conversation (conv_name, INNATE_PRIORITY_ENEMY_SEEN + 5);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Join_Conversation(STAR, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 300123);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if((action_id == 300123 && reason == ACTION_COMPLETE_CONVERSATION_ENDED) || (action_id == 300123 && reason == ACTION_COMPLETE_CONVERSATION_INTERRUPTED))
- {
- Commands->Destroy_Object(obj);
- // Spawn soldiers surrounding hologram
- Commands->Enable_Spawner(100695, true);
- Commands->Enable_Spawner(100692, true);
- Commands->Enable_Spawner(100693, true);
- }
- }
- };
- DECLARE_SCRIPT(M08_DataDisc_01_DLS, "")//
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0104I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- // Reveal Tiberium Flechette
- Commands->Reveal_Encyclopedia_Weapon(22);
- }
- }
- };
- DECLARE_SCRIPT(M08_DataDisc_02_DLS, "")//
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0104I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- // Reveal Tiberium Auto Rifle
- Commands->Reveal_Encyclopedia_Weapon(21);
- }
- }
- };
|