| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706 |
- /*
- ** 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
- * Mission09.cpp
- *
- * DESCRIPTION
- * Mission 9 specific scripts
- *
- * PROGRAMMER
- * Dan Etter
- *
- * VERSION INFO
- * $Author: Greg_h $
- * $Revision: 106 $
- * $Modtime: 1/20/02 11:10a $
- * $Archive: /Commando/Code/Scripts/Mission09.cpp $
- *
- ******************************************************************************/
- #include "scripts.h"
- #include "toolkit.h"
- #include "mission9.h"
- #include <string.h>
- #include <stdio.h>
- DECLARE_SCRIPT(M09_Objective_Controller, "") // Object Controller id: 2000071
- {
-
- enum {HAVOCS_SCRIPT};
- bool objective [3];
- int spawn_loc;
- int block1, block2, block3, block4;
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( spawn_loc, 1 );
- SAVE_VARIABLE( block1, 2 );
- SAVE_VARIABLE( block2, 3 );
- SAVE_VARIABLE( block3, 4 );
- SAVE_VARIABLE( block4, 5 );
- }
- void Created(GameObject * obj)
- {
- Commands->Set_Num_Tertiary_Objectives ( 1 );
- Commands->Start_Timer (obj, this, 1.0f, HAVOCS_SCRIPT);
- Commands->Enable_Hibernation(obj, false);
-
- spawn_loc = 0;
- for (int x = 0; x <= 2; x++)
- {
- objective [x] = false;
- }
- block1 = 0;
- block2 = 0;
- block3 = 0;
- block4 = 0;
-
- }
- void Remove_Pog(int id)
- {
- switch (id)
- {
- // New Primary Mission Objective: Retrieve the Mobile Power Suit for Dr. Mobius
- case 901:
- {
- Commands->Set_Objective_HUD_Info(id, -1, "POG_M09_1_01.tga", IDS_POG_RETRIEVE);
- }
- break;
- // New Primary Mission Objective: Escort Dr. Mobius to the Surface
- case 902:
- {
- Commands->Set_Objective_HUD_Info(id, -1, "POG_M09_1_02.tga", IDS_POG_ESCORT);
- }
- break;
- // New Primary Mission Objective: Escort Dr. Mobius to the Rendezvous Point
- case 903:
- {
- Commands->Set_Objective_HUD_Info(id, -1, "POG_M09_1_03.tga", IDS_POG_ESCORT);
- }
- break;
- }
- }
- void Add_An_Objective(int id)
- {
- GameObject *object;
-
- switch (id)
- {
- // New Primary Mission Objective: Protect Mobius
- case 900:
- {
- Commands->Add_Objective(900, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M09_04, NULL, IDS_Enc_Obj_Primary_M09_04);
-
- object = Commands->Find_Object(2000010);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(900, object);
- Commands->Set_Objective_HUD_Info_Position( 900, 90, "POG_M09_1_02.tga", IDS_POG_PROTECT, Commands->Get_Position (object));
- }
- }
- break;
- // New Primary Mission Objective: Retrieve the Mobile Power Suit for Dr. Mobius
- case 901:
- {
- Commands->Add_Objective(901, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M09_01, NULL, IDS_Enc_Obj_Primary_M09_01);
-
- object = Commands->Find_Object(2002239);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(901, object);
- Commands->Set_Objective_HUD_Info_Position( 901, 99, "POG_M09_1_01.tga", IDS_POG_RETRIEVE, Commands->Get_Position (object));
- }
- }
- break;
- // New Primary Mission Objective: Escort Dr. Mobius to the Surface
- case 902:
- {
- Commands->Add_Objective(902, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M09_02, NULL, IDS_Enc_Obj_Primary_M09_02);
- object = Commands->Find_Object(2000955);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(902, object);
- Commands->Set_Objective_HUD_Info_Position( 902, 98, "POG_M08_1_03.tga", IDS_POG_ESCORT, Commands->Get_Position (object));
- }
- }
- break;
- // New Primary Mission Objective: Escort Dr. Mobius to the Rendezvous Point
- case 903:
- {
- Commands->Add_Objective(903, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M09_03, NULL, IDS_Enc_Obj_Primary_M09_03);
- object = Commands->Find_Object(2000969);
- if(object)
- {
- Commands->Set_Objective_Radar_Blip_Object(903, object);
- Commands->Set_Objective_HUD_Info_Position( 903, 97, "POG_M09_1_03.tga", IDS_POG_ESCORT, Commands->Get_Position (object));
- }
- }
- break;
- // New Hidden Mission Objective: Eliminate the NOD Resistance at Checkpoint A
-
- case 904:
- {
- Commands->Add_Objective(904, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_Enc_ObjTitle_Hidden_M09_01, NULL, IDS_Enc_Obj_Hidden_M09_04); }
- break;/*
- // New Hidden Mission Objective: Comandeer the NOD Stealth Tank.
- case 905:
- {
- Commands->Add_Objective(905, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_M09_T02, NULL);
- }
- break;
- // New Hidden Mission Objective: Comandeer the NOD Stealth Tank.
- case 906:
- {
- Commands->Add_Objective(906, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_M09_P05, NULL);
- }
- break;*/
- case 1000:
- {
- break;
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == BLOCK_ON)
- {
- if ((block1 != 0) && (block2 != 0) && (block3 != 0) && (block4 != 0)) {
- Commands->Start_Timer (obj, this, 3.0f, 333);
- GameObject *rub1 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-108.066f, 483.917f, -191.022f));
- block1 = Commands->Get_ID (rub1);
- Commands->Set_Is_Rendered( rub1, false );
- GameObject *rub2 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-25.433f, 513.013f, -150.613f));
- block2 = Commands->Get_ID (rub2);
- Commands->Set_Is_Rendered( rub2, false );
- GameObject *rub3 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-47.948f, 535.216f, -103.284f));
- block3 = Commands->Get_ID (rub3);
- Commands->Set_Is_Rendered( rub3, false );
- Commands->Set_Facing (rub3, -90.0);
- GameObject *rub4 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (39.231f, 515.105f, -78.137f));
- block4 = Commands->Get_ID (rub4);
- Commands->Set_Is_Rendered( rub4, false );
- }
- }
- if (type == BLOCK_OFF)
- {
- Commands->Destroy_Object (Commands->Find_Object (block1));
- Commands->Destroy_Object (Commands->Find_Object (block2));
- Commands->Destroy_Object (Commands->Find_Object (block3));
- Commands->Destroy_Object (Commands->Find_Object (block4));
- block1 = block2 = block3 = block4 = 0;
- }
- if (type == MOBIUS_KILLED)
- {
- Commands->Set_HUD_Help_Text ( IDS_M09DSGN_DSGN0073I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Start_Timer (obj, this, 4.0f, 40);
- }
- if (type == check && param == check)
- {
- Commands->Send_Custom_Event (obj, sender, 901, objective [0], 0.0f);
- Commands->Send_Custom_Event (obj, sender, 902, objective [1], 0.0f);
- Commands->Send_Custom_Event (obj, sender, 903, objective [2], 0.0f);
- }
- if (type == 901 && param == 1)
- {
- objective [0] = true;
- Remove_Pog(901);
- }
- if (type == 902 && param == 1)
- {
- objective [1] = true;
- Remove_Pog(902);
- }
- if (type == 903 && param == 1)
- {
- objective [2] = true;
- Remove_Pog(903);
- }
- switch (param)
- {
- case 1:
- {
- //Commands->Clear_Radar_Marker (type);
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_ACCOMPLISHED);
- }
- break;
- case 2:
- {
- //Commands->Clear_Radar_Marker (type);
- Commands->Set_Objective_Status(type, OBJECTIVE_STATUS_FAILED);
- }
- 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, 0.10f, M09_DEAD_HAVOC);
- }
- if (type == SPAWN_LOC && param == INCREMENT)
- {
- spawn_loc++;
- }
- }
-
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == 333)
- {
- Commands->Destroy_Object (Commands->Find_Object (block1));
- Commands->Destroy_Object (Commands->Find_Object (block2));
- Commands->Destroy_Object (Commands->Find_Object (block3));
- Commands->Destroy_Object (Commands->Find_Object (block4));
- block1 = block2 = block3 = block4 = 0;
- }
- if (timer_id == 40)
- {
- Commands->Mission_Complete(false);
- }
- }
- };
- DECLARE_SCRIPT (M09_Havoc_Script, "")
- {
- void Created (GameObject *obj)
- {
- /*Commands->Give_PowerUp(obj, "Shotgun Weapon 3 Clips PU");
- Commands->Give_PowerUp(obj, "FlameThrower_Weapon_PowerUp");
- Commands->Give_PowerUp(obj, "Flame_Weapon_1_Clip_PowerUp");
- Commands->Give_PowerUp(obj, "Flame_Weapon_1_Clip_PowerUp");
- Commands->Give_PowerUp(obj, "ChemSprayer_Weapon_PowerUp");
- Commands->Give_PowerUp(obj, "Chem_Weapon_1_Clip_PowerUp");
- Commands->Give_PowerUp(obj, "Grenade Launcher Weapon PowerUps");
- Commands->Give_PowerUp(obj, "GL_Weapon_1_Clip_PowerUp");
- Commands->Give_PowerUp(obj, "Mine Weapons PowerUps");
- Commands->Give_PowerUp(obj, "Remote Mine Weapon 1 Clip PU");
- Commands->Give_PowerUp(obj, "Sniper Weapon 1 Clip PU");
- Commands->Give_PowerUp(obj, "Sniper Weapon 1 Clip PU");
- Commands->Give_PowerUp(obj, "MG Weapon 1 Clip PowerUp");
- Commands->Give_PowerUp(obj, "MiniGun 2 Clips PU");
- Commands->Give_PowerUp(obj, "Armor 100 PowerUp");
- Commands->Give_PowerUp(obj, "RL Weapon 1 Clip PowerUp");*/
- Commands->Start_Timer(obj, this, 0.5f, ACTIVATE);
- //Commands->Grant_Key ( STAR, 10, true);
- }
- void Timer_Expired (GameObject *obj, int timer_id)
- {
- if (timer_id == ACTIVATE)
- {
- Commands->Grant_Key ( STAR, 10, true);
- }
- }
- void Destroyed(GameObject * obj)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 666, 666, 0.0f);
- }
- };
- DECLARE_SCRIPT (M09_Mobius_Suit_Objective, "")
- {
- 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 Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == 8888)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- Vector3 havoc_loc = Commands->Get_Position (Commands->Find_Object (1100497));
- Vector3 mobius_loc = Commands->Get_Position (Commands->Find_Object (2002239));
- Commands->Set_Position (STAR, havoc_loc );
- Commands->Set_Position (mobius, mobius_loc );
- }
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (!already_entered)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- already_entered = true;
- //Commands->Destroy_Object (Commands->Find_Object (1202323));
-
- if (mobius)
- {
- Vector3 havoc_loc = Commands->Get_Position (STAR);
- Vector3 mobius_loc = Commands->Get_Position (mobius);
- havoc_loc.Z += 7.0f;
- mobius_loc.Z += 7.0f;
-
- Commands->Action_Reset(mobius, 100);
- Commands->Set_Position (STAR, havoc_loc );
- Commands->Set_Position (mobius, mobius_loc );
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), SPAWN_LOC, INCREMENT, 0.0f);
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 901, 1, 0.0f);
-
- GameObject * powermob = Commands->Create_Object ( "Invisible_Object", Vector3(0.0f, 0.0f, 0.0f));
- Commands->Set_Facing(powermob, 0.0f);
- Commands->Attach_Script(powermob, "Test_Cinematic", "X9C_MIDTRO.txt");
-
- Commands->Set_Model ( mobius, "c_ag_gdi_pmob" );
- Commands->Give_PowerUp(mobius, "POW_LaserChaingun_AI");
- Commands->Select_Weapon (mobius, "Weapon_LaserChaingun_Ai" );
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 901, 1, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 902, 3, 0.0f);
- Commands->Set_Health (mobius, 300.0f);
- Commands->Attach_Script(mobius, "M09_Damage_Modifier", ".05");
- }
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "h_a_a0a0_l26da") == 0)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- Commands->Set_Animation ( mobius, "h_a_a0a0_l26db", true);
- const char *conv_name = ("IDS_M09_D11");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 901);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 900 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- /*GameObject *mobius = Commands->Find_Object (2000010);
- Commands->Set_Model ( mobius, "c_ag_gdi_pmob" );
- Commands->Give_PowerUp(mobius, "POW_LaserChaingun_AI");
- Commands->Select_Weapon (mobius, "Weapon_LaserChaingun_Ai" );*/
-
- //Commands->Set_Animation ( mobius, "h_a_a0a0_l26da", false);
- }
- if(action_id == 901 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- Commands->Set_Animation ( mobius, "h_a_a0a0_l26dc", false);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 902, 3, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Surface_Objective, "")
- {
- 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 (!already_entered)
- {
- already_entered = true;
-
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), SPAWN_LOC, INCREMENT, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 902, 1, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 903, 3, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000955), FLYOVER, 0, 0.0f);
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 906, 3, 0.0f);
-
- Commands->Destroy_Object ( Commands->Find_Object (2000614));
- Commands->Destroy_Object ( Commands->Find_Object (2000954));
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == ENTERED && param == ENTERED)
- {
- already_entered = true;
- }
- }
- };
- DECLARE_SCRIPT (M09_Evac_Point_Objective, "")
- {
- bool star_in_zone;
- bool mobius_in_zone;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( star_in_zone, 1 );
- SAVE_VARIABLE( mobius_in_zone, 2 );
- }
- void Created (GameObject * obj)
- {
- star_in_zone = false;
- mobius_in_zone = false;
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- GameObject * mobius = Commands->Find_Object (2000010);
- if (exiter == STAR)
- {
- star_in_zone = false;
- }
- if (exiter == mobius)
- {
- mobius_in_zone = false;
- }
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- GameObject * mobius = Commands->Find_Object (2000010);
- if (enterer == STAR)
- {
- star_in_zone = true;
- if (mobius_in_zone)
- {
- Commands->Attach_Script(mobius, "M00_Damage_Modifier_DME", "0.05f, 1, 1, 0, 0");
- Commands->Start_Timer (obj, this, 1.0f, M09_MISSION_COMPLETE);
- }
- if (!mobius_in_zone)
- {
- Commands->Send_Custom_Event( obj, mobius, FOLLOW, 2000969, 0.0f );
- }
- }
- if (enterer == mobius)
- {
- mobius_in_zone = true;
- if (star_in_zone)
- {
- Commands->Attach_Script(mobius, "M00_Damage_Modifier_DME", "0.05f, 1, 1, 0, 0");
- Commands->Start_Timer (obj, this, 1.0f, M09_MISSION_COMPLETE);
- }
- }
-
- /*GameObject *mobius = Commands->Find_Object (2000010);
- float mobius_distance = Commands->Get_Distance(Commands->Get_Position (Commands->Find_Object (2000969)), Commands->Get_Position (mobius));
- if (mobius_distance < 15.0f)
- {
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 903, 1, 0.0f);
-
- Commands->Start_Timer (obj, this, 5.0f, M09_MISSION_COMPLETE);
- GameObject * chin_loc = Commands->Find_Object (2000259);
- float facing = Commands->Get_Facing (chin_loc);
- GameObject * chinook_obj = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position (chin_loc));
- Commands->Set_Facing(chinook_obj, facing);
- Commands->Attach_Script(chinook_obj, "Test_Cinematic", "M09_XG_EV4.txt");
- }
- else
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000969)), 1.2f, 0.8f );
- Commands->Action_Goto (mobius, params);
- Commands->Start_Timer (obj, this, 3.0f, TIMER_RESET);
- }*/
- }
-
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == M09_MISSION_COMPLETE)
- {
- Commands->Mission_Complete ( true );
- }
- if (timer_id == TIMER_RESET)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- float mobius_distance = Commands->Get_Distance(Commands->Get_Position (Commands->Find_Object (2000969)), Commands->Get_Position (mobius));
- if (mobius_distance < 15.0f)
- {
- //Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 903, 1, 0.0f);
-
- Commands->Start_Timer (obj, this, 1.0f, M09_MISSION_COMPLETE);
- GameObject * chin_loc = Commands->Find_Object (2000259);
- float facing = Commands->Get_Facing (chin_loc);
- GameObject * chinook_obj = Commands->Create_Object ( "Invisible_Object", Commands->Get_Position (chin_loc));
- Commands->Set_Facing(chinook_obj, facing);
- Commands->Attach_Script(chinook_obj, "Test_Cinematic", "M09_XG_EV4.txt");
- }
- else
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000969)), 1.2f, 0.8f );
- Commands->Action_Goto (mobius, params);
- Commands->Start_Timer (obj, this, 3.0f, TIMER_RESET);
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_LabRoom_Zones, "Mutant_Num:int, Mutant_Goto:int")
- {
- int mutant;
- 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 );
- SAVE_VARIABLE( mutant, 2 );
- }
- void Created (GameObject * obj)
- {
- mutant = Get_Int_Parameter("Mutant_Num");
- int anim_loc = Get_Int_Parameter("Mutant_Goto");
- //already_entered = false;
- Commands->Send_Custom_Event (obj, Commands->Find_Object(mutant), GOTO, anim_loc, 4.0f);
-
- }
-
- void Entered (GameObject * obj, GameObject * enterer)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000279), CONVERSATION, TRIGGERED);
-
- Commands->Action_Reset ( Commands->Find_Object (mutant), 100.0f );
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- //Commands->Grant_Key ( STAR, 10, false);
- }
- void Custom(GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == ALREADY_ENTERED)
- {
- already_entered = true;
- }
- }
- };
- DECLARE_SCRIPT (M09_Animating_Mutant, "Animation=0:int")
- {
- float face;
- void Custom(GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == GOTO)
- {
- //face = Commands->Get_Facing (Commands->Find_Object (param));
- //Vector3 loc = Commands->Get_Position (Commands->Find_Object (param));
- ActionParamsStruct params;
- params.Set_Basic( this, 99, MUTANT_GOTO );
- //params.Set_Movement( loc, RUN, 0.25f );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = param;
- Commands->Action_Goto (obj, params);
- }
- if (type == ANIMATION && param == RESET)
- {
- Commands->Action_Reset ( obj, 100 );
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- int animation = Get_Int_Parameter ("Animation");
- if (action_id == MUTANT_GOTO && reason == ACTION_COMPLETE_NORMAL)
- {
- if (animation == 0)
- {
- //Commands->Set_Facing (obj, face);
- 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);
- }
- if (animation == 1)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, DOING_ANIMATION );
- params.Set_Animation ("S_C_HUMAN.H_C_7002", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_LabRoom_Controller, "")
- {
- bool triggered;
- bool mobius_ready;
-
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( triggered, 1 );
- SAVE_VARIABLE( mobius_ready, 2 );
- }
- void Created (GameObject *obj)
- {
- triggered = false;
- mobius_ready = false;
- }
- void Custom(GameObject *obj, int type, int param, GameObject *sender)
- {
- if (!triggered && mobius_ready)
- {
- if (type == CONVERSATION && param == TRIGGERED)
- {
- triggered = true;
-
- GameObject *mobius = Commands->Find_Object (2000010);
-
- const char *conv_name = ("M09CON014");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, true, true);
- Commands->Join_Conversation(STAR, conv_id, true, true);
- Commands->Start_Conversation (conv_id, 904);
- Commands->Monitor_Conversation (mobius, conv_id);
- }
- }
- if (type == CONVERSATION && param == ENDED)
- {
- mobius_ready = true;
- }
- }
- };
- DECLARE_SCRIPT (M09_Mobius_Initial_Conversation, "")
- {
- float max_health;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( max_health, 1 );
- }
- void Created (GameObject *obj)
- {
- Commands->Set_HUD_Help_Text ( IDS_M09DSGN_DSGN0072I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Start_Timer (obj, this, 5.0f, 20);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 900, 3, 0.0f);
- Commands->Innate_Disable ( obj );
- max_health = Commands->Get_Health (obj);
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == 20)
- {
- const char *conv_name = ("IDS_M09_D07");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(obj, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 900);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- /*void Damaged (GameObject *obj, GameObject *damager, float amount)
- {
- Commands->Set_Health (obj, max_health);
- }*/
-
- void Killed(GameObject * obj, GameObject *killer )
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), MOBIUS_KILLED, 0, 0.0f);
- }
-
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 900 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- const char *conv_name = ("IDS_M09_P01");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(obj, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 903);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- if(action_id == 901 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 101 );
- params.Set_Movement( Vector3(0,0,0), WALK, 0.5f);
- params.WaypathID = 2000275;
-
- Commands->Action_Goto (obj, params);
- }
- if (action_id == 101)
- {
-
- /*ActionParamsStruct params;
- params.Set_Basic( this, 99, 150 );
- params.Set_Face_Location( Commands->Get_Position (STAR), 10.0f);
- Commands->Action_Face_Location ( obj, params );
- */
- const char *conv_name = ("IDS_M09_D07");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(obj, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 902);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- if(action_id == 902 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- const char *conv_name = ("IDS_M09_P01");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(obj, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 903);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- if(action_id == 903 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 901, 3, 0.0f);
- Commands->Innate_Enable(obj);
- Commands->Attach_Script(Commands->Find_Object (2000010), "M09_Mobius_Follow", "");
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000279), CONVERSATION, ENDED, 0.0f);
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, 2001012, 1.0f );
- Commands->Give_PowerUp(obj, "POW_Pistol_AI");
- Commands->Select_Weapon (obj, "Weapon_Pistol_Ai" );
- }
- }
- };
- DECLARE_SCRIPT (M09_Mobius_Follow, "") //Mobius (Pre-Suit): 2000010
- {
- int objective_901, objective_902, objective_903;
- int cover_id [3];
- int closest;
- int attack_path;
- int elev_num;
- float cover_distance [3];
- float current_health;
- float last_health, damage_tally;
- bool stationary;
- bool nofollow;
-
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( objective_901, 1 );
- SAVE_VARIABLE( objective_902, 2 );
- SAVE_VARIABLE( objective_903, 3 );
- SAVE_VARIABLE( closest, 4 );
- SAVE_VARIABLE( current_health, 5 );
- SAVE_VARIABLE( last_health, 6 );
- SAVE_VARIABLE( damage_tally, 7 );
- SAVE_VARIABLE( stationary, 8 );
- SAVE_VARIABLE( attack_path, 9 );
- SAVE_VARIABLE( nofollow, 10 );
- SAVE_VARIABLE( elev_num, 11 );
- }
-
- void Follow_Function (GameObject * obj, int waypath_id)
- {
- attack_path = waypath_id;
- //Vector3 loc = Commands->Get_Position (Commands->Find_Object (waypath_id));
- ActionParamsStruct params;
- params.Set_Basic( this, 96, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (waypath_id)), 1.2f, 0.8f );
- Commands->Action_Goto (obj, params);
- /*ActionParamsStruct params;
-
- params.Set_Basic (this, (INNATE_PRIORITY_ENEMY_SEEN - 5), 1);
- params.Set_Movement (STAR, RUN, 0.5f);
- params.MoveFollow = true;
- Commands->Action_Goto (obj, params);*/
- }
- /*void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN +5, 10 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (attack_path)), 1.2f, 1.0f );
- //params.WaypathID = attack_path;
- params.Set_Attack(enemy, 100.0f, 1.0f, true);
- params.AttackCheckBlocked = true;
- params.AttackActive = true;
-
- Commands->Action_Attack (obj, params);
- }*/
- void Killed(GameObject * obj, GameObject *killer )
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), check, check, 0.0f);
-
- if (objective_901 == false)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 901, 2, 0.0f);
- }
- else if (objective_902 == false)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 902, 2, 0.0f);
- }
- else if (objective_903 == false)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 903, 2, 0.0f);
- }
-
- Commands->Mission_Complete(false);
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == NO_FOLLOW)
- {
- if (param == ON)
- {
- nofollow = true;
- }
- if (param == OFF)
- {
- nofollow = false;
- }
- }
- if (sender == (Commands->Find_Object (2000071)))
- {
- switch (type)
- {
- case 901:
- {
- objective_901 = param;
- }
- break;
-
- case 902:
- {
- objective_902 = param;
- }
- break;
- case 903:
- {
- objective_903 = param;
- }
- break;
- }
- }
- if (type == WAYPATH)
- {
-
- ActionParamsStruct params;
-
- params.Set_Basic( this, 99, 951 );
- params.Set_Movement( Commands->Find_Object (param), 1.2f, 0.5f);
- Commands->Action_Goto( obj, params );
- }
- if (type == FOLLOW)
- {
- Follow_Function (obj, param);
- }
- if (type == ELEVATOR_EXIT)
- {
- attack_path = param;
-
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (param)), 1.2f, 0.8f );
- params.MovePathfind = false;
- Commands->Action_Goto (obj, params);
- }
- if (type == ELEVATOR)
- {
- elev_num = Commands->Get_ID (sender);
- Commands->Action_Reset ( obj, 100 );
- ActionParamsStruct params;
- params.Set_Basic( this, 99, ELEV_WAYPOINT );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (param)), 1.2f, 1.0f);
-
- Commands->Action_Goto (obj, params);
-
- }
- if (type == ELEVATOR_DOWN)
- {
- elev_num = Commands->Get_ID (sender);
- Commands->Action_Reset ( obj, 100 );
- ActionParamsStruct params;
- params.Set_Basic( this, 99, ELEV_WAYPOINT2 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (param)), 1.2f, 1.0f);
-
- Commands->Action_Goto (obj, params);
-
- }
- }
- void Created (GameObject *obj)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000279), CONVERSATION, ENDED, 0.0f);
- for (int x = 0; x <= 2; x++)
- {
- cover_distance [x] = 900;
- }
-
- cover_id [0] = 2000006;
- cover_id [1] = 2000007;
- cover_id [2] = 2000008;
- objective_901 = false;
- objective_902 = false;
- objective_903 = false;
- stationary = false;
- nofollow = false;
-
- closest = 0;
-
- last_health = Commands->Get_Max_Health(obj);
- damage_tally = 0;
- Commands->Start_Timer (obj, this, 5.0f, TOO_FAR);
- }
- /*void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- current_health = Commands->Get_Health (obj);
- float damage = ((last_health - current_health) + damage_tally);
- float mod_damage = (damage * .15);
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- if (current_health <= 75)
- {
- Commands->Set_Innate_Aggressiveness ( obj, 0.0 );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 100.0 );
- }
- }*/
-
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if((action_id == MOBIUS_GOTO) && (action_id != Commands->Get_Action_ID(obj)) && (!Commands->Is_Performing_Pathfind_Action(obj)) && (reason == ACTION_COMPLETE_LOW_PRIORITY))
- {
- Commands->Start_Timer (obj, this, 5.0f, RESEND_GOTO);
- }
- if (action_id == MOBIUS_GOTO && reason == ACTION_COMPLETE_PATH_BAD_DEST)
- {
- Commands->Start_Timer (obj, this, 0.5f, BAD_PATH);
- }
- /*if(action_id == 1 && reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- Follow_Function (obj);
- }
- if (action_id == 20)
- {
- Commands->Start_Timer (obj, this, 10.0f, 20);
- }
- if (action_id == 10000)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 10001);
- params.Set_Animation( "H_A_J20b", true );
- Commands->Action_Play_Animation (obj, params);
- }*/
- /*if (action_id == 951)
- {
- Commands->Set_Facing (obj, Commands->Get_Facing (Commands->Find_Object (2000462)));
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000453), VERIFY, GO, 4.0f );
- const char *conv_name = ("IDS_M09_D17");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(obj, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 952);
- Commands->Monitor_Conversation (obj, conv_id);
- }*/
- if(action_id == 952)
- {
- Commands->Start_Timer (obj, this, 0.0f, 953);
-
- }
- if (action_id == ELEV_WAYPOINT && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Send_Custom_Event( obj, Commands->Find_Object (elev_num), SET_MOBIUS, 0);
- }
- if (action_id == ELEV_WAYPOINT2 && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Send_Custom_Event( obj, Commands->Find_Object (elev_num), SET_MOBIUS, 0);
- }
- }
-
- /*void Poked(GameObject * obj, GameObject * poker)
- {
- if (poker == STAR)
- {
- if (stationary == false)
- {
- stationary = true;
-
- Commands->Set_Innate_Is_Stationary ( obj, true );
- const char *conv_name = ("IDS_M09_D03");
- int conv_id = Commands->Create_Conversation (conv_name);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 1);
- Commands->Monitor_Conversation (obj, conv_id);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 10000);
- params.Set_Animation( "H_A_J20a", false );
- Commands->Action_Play_Animation (obj, params);
- }
- else if (stationary == true)
- {
- stationary = false;
- Commands->Action_Reset ( obj, 100 );
-
- Commands->Set_Innate_Is_Stationary ( obj, false );
- const char *conv_name = ("IDS_M09_D04");
- int conv_id = Commands->Create_Conversation (conv_name);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 1);
- Commands->Monitor_Conversation (obj, conv_id);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 10002);
- params.Set_Animation( "H_A_J20c", false );
- Commands->Action_Play_Animation (obj, params);
- //Follow_Function (GameObject * obj, int waypath_id);
- }
- }
- }*/
-
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == RESEND_GOTO)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (attack_path)), 1.2f, 1.0f );
- Commands->Action_Goto (obj, params);
- }
- if (timer_id == BAD_PATH)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (attack_path)), 1.2f, 1.0f );
- params.MovePathfind = false;
- Commands->Action_Goto (obj, params);
- }
- if (timer_id == TOO_FAR)
- {
- if (!nofollow)
- {
- float distance = (Commands->Get_Distance ( Commands->Get_Position (STAR), Commands->Get_Position (Commands->Find_Object (2000010))) );
- if (distance >= 25.0f)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 96, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (STAR), 1.2f, 5.0f );
- //params.MovePathfind = false;
- Commands->Action_Goto (obj, params);
- }
- Commands->Start_Timer (obj, this, 5.0f, TOO_FAR);
- }
- }
- /*if (stationary == false)
- {
- int poke_id = Commands->Get_Random_Int(1, 3);
- Commands->Start_Timer (obj, this, 5.0f, CHECK_DISTANCE);
-
- // Don't leave me here
- if(timer_id == CHECK_DISTANCE && poke_id == 2)
- {
- Vector3 star_pos = Commands->Get_Position(STAR);
- Vector3 mobius_pos = Commands->Get_Position(obj);
- float distance_to_star = Commands->Get_Distance(star_pos, mobius_pos);
- if(distance_to_star > 15.0f)
- {
- const char *conv_name = ("IDS_M09_D01");
- int conv_id = Commands->Create_Conversation (conv_name);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 1);
- Commands->Monitor_Conversation (obj, conv_id);
- Follow_Function (obj);
- }
-
- }
- // Hey! Wait for me!
- else if(timer_id == CHECK_DISTANCE && poke_id == 1)
- {
- Vector3 star_pos = Commands->Get_Position(STAR);
- Vector3 mobius_pos = Commands->Get_Position(obj);
- float distance_to_star = Commands->Get_Distance(star_pos, mobius_pos);
- if(distance_to_star > 15.0f)
- {
- const char *conv_name = ("IDS_M09_D02");
- int conv_id = Commands->Create_Conversation (conv_name);
- Commands->Join_Conversation(obj, conv_id, false, true);
- Commands->Start_Conversation (conv_id, 1);
- Commands->Monitor_Conversation (obj, conv_id);
- Follow_Function (obj);
- }
- }
- else if(timer_id == 20)
- {
- Follow_Function (obj);
- }
- }*/
- if(timer_id == 953)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000453), VERIFY, STOP, 3.0f );
- }
-
- }
- };
- DECLARE_SCRIPT (M09_Stationary, "Reward_override=0:int")
- {
- int reward;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( reward, 1 );
- }
- void Created(GameObject *obj)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
-
- reward = Commands->Get_Random_Int ( 1, 101 );
- if (Get_Int_Parameter("Reward_override") == 1)
- {
- Commands->Set_Health ( obj, 5 );
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- }
-
- /*void Killed( GameObject * obj, GameObject * killer )
- {
- if (Get_Int_Parameter("Reward_override") == 0)
- {
- if (reward > 25)
- {
- Vector3 powerup_loc = Commands->Get_Position (obj);
- powerup_loc.Z += 1.0f;
- Commands->Create_Object("Health 025 PowerUp", powerup_loc);
- }
- if (reward > 80)
- {
- Vector3 powerup_loc = Commands->Get_Position (obj);
- powerup_loc.Z += 1.0f;
- Commands->Create_Object("Armor 025 PowerUp", powerup_loc);
- }
- }
- }*/
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == CHANGE_PLAYERTYPE)
- {
- if (param == MUTANT)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_MUTANT );
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_Stationary_Nod, "")
- {
- int reward;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( reward, 1 );
- }
- void Created(GameObject *obj)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
- reward = Commands->Get_Random_Int ( 1, 101 );
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- }
-
- /*void Killed( GameObject * obj, GameObject * killer )
- {
- if (reward > 25)
- {
- Vector3 powerup_loc = Commands->Get_Position (obj);
- powerup_loc.Z += 1.0f;
- Commands->Create_Object("Health 025 PowerUp", powerup_loc);
- }
- if (reward > 80)
- {
- Vector3 powerup_loc = Commands->Get_Position (obj);
- powerup_loc.Z += 1.0f;
- Commands->Create_Object("Armor 025 PowerUp", powerup_loc);
- }
- }*/
-
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == CHANGE_PLAYERTYPE)
- {
- if (param == MUTANT)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_MUTANT );
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_Home_Location_10, "")
- {
- void Created (GameObject *obj)
- {
- Commands->Set_Innate_Soldier_Home_Location(obj, Commands->Get_Position(obj), 10.0f);
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Ambush_Zone_01, "")
- {
- 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(2000071), SPAWN_LOC, INCREMENT, 0.0f);
- //Nod soldiers
- Commands->Attach_Script(Commands->Find_Object (2000126), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000126), false );
- Commands->Attach_Script(Commands->Find_Object (2000127), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000127), false );
- Commands->Attach_Script(Commands->Find_Object (2000128), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000128), false );
- Commands->Attach_Script(Commands->Find_Object (2000129), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000129), false );
- //Mutant soldiers
-
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000122), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000122), false );
- Commands->Attach_Script(Commands->Find_Object (2000122), "M09_Mutant_Damage_Mod_10", "");
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000123), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000123), false );
- Commands->Attach_Script(Commands->Find_Object (2000123), "M09_Mutant_Damage_Mod_10", "");
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000124), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000124), false );
- Commands->Attach_Script(Commands->Find_Object (2000124), "M09_Mutant_Damage_Mod_10", "");
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000125), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000125), false );
- Commands->Attach_Script(Commands->Find_Object (2000125), "M09_Mutant_Damage_Mod_10", "");
- }
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Damage_Mod_10, "")
- {
- float last_health, current_health, damage_tally;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( last_health, 1 );
- SAVE_VARIABLE( current_health, 2 );
- SAVE_VARIABLE( damage_tally, 3 );
- }
-
- void Created (GameObject * obj)
- {
- last_health = Commands->Get_Max_Health(obj);
- damage_tally = 0;
-
- }
-
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager != STAR)
- {
- current_health = Commands->Get_Health (obj);
- float damage = ((last_health - current_health) + damage_tally);
- float mod_damage = (damage * .10);
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- }
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Damage_Mod_50, "")
- {
- float last_health, current_health, damage_tally;
-
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( last_health, 1 );
- SAVE_VARIABLE( current_health, 2 );
- SAVE_VARIABLE( damage_tally, 3 );
- }
-
- void Created (GameObject * obj)
- {
- last_health = Commands->Get_Max_Health(obj);
- damage_tally = 0;
-
- }
-
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager != STAR)
- {
- current_health = Commands->Get_Health (obj);
- float damage = ((last_health - current_health) + damage_tally);
- float mod_damage = (damage * .25);
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- }
- }
- };
- DECLARE_SCRIPT (M09_Nod_Damage_Mod_10, "")
- {
- float last_health, current_health, damage_tally;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( last_health, 1 );
- SAVE_VARIABLE( current_health, 2 );
- SAVE_VARIABLE( damage_tally, 3 );
- }
-
- void Created (GameObject * obj)
- {
- last_health = Commands->Get_Max_Health(obj);
- damage_tally = 0;
-
- }
-
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager != STAR)
- {
- current_health = Commands->Get_Health (obj);
- float damage = ((last_health - current_health) + damage_tally);
- float mod_damage = (damage * .08);
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- }
- }
- };
- DECLARE_SCRIPT (M09_Stealth_Tank_Pilot, "")
- {
- void Created (GameObject *obj)
- {
- Commands->Set_Facing(obj, 35.0f);
- Commands->Innate_Disable ( obj );
- }
-
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if (enemy == STAR)
- {
- // Vector3 location = Commands->Get_Position (Commands->Find_Object (2000091));
-
- ActionParamsStruct params;
- params.Set_Basic( this, 99, RUN_TO_TANK );
- params.Set_Movement( Commands->Find_Object (2000090), RUN, 4.0f );
- Commands->Action_Goto( obj, params );
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (action_id == RUN_TO_TANK && reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Destroy_Object (obj);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000090), ATTACK, ATTACK, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Stationary_StealthTank, "")
- {
-
-
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == ATTACK && param == ATTACK)
- {
- Vector3 stealth_loc = Commands->Get_Position (obj);
- Commands->Destroy_Object (obj);
- GameObject *stealth_tank;
- stealth_tank = Commands->Create_Object ( "Nod_Stealth_Tank", stealth_loc );
- Commands->Attach_Script (stealth_tank, "M09_Vehicle_Attack_01", "");
- Commands->Attach_Script (stealth_tank, "M09_CheckpointA_Counter", "");
- }
-
- if (type == CUSTOM_EVENT_VEHICLE_ENTERED)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 905, 3, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 905, 1, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Vehicle_Attack_01, "")
- {
- bool attacking, charge, charging;
- Vector3 current_loc;
- Vector3 enemy_loc;
- 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 );
- SAVE_VARIABLE( charge, 2 );
- SAVE_VARIABLE( charging, 3 );
- SAVE_VARIABLE( current_loc, 4 );
- SAVE_VARIABLE( enemy_loc, 5 );
- }
- void Created(GameObject * obj)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- charge = false;
- charging = false;
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000095;
-
- Commands->Action_Attack (obj, params);
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- current_loc = Commands->Get_Position ( obj );
- enemy_loc = Commands->Get_Position ( enemy );
-
- if (!attacking && !charge)
- {
- if ((Commands->Get_Distance(current_loc, enemy_loc)) < 65)
- {
- attacking = true;
-
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN +5, 10 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000095;
- params.Set_Attack(STAR, 100.0f, 5.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Modify_Action(obj, 10, params);
-
- Commands->Start_Timer(obj, this, 5.0f, ATTACK_OVER);
-
- if (!charging)
- {
- charging = true;
- Commands->Start_Timer(obj, this, 16.0f, CHANGE_ATTACK);
- }
- }
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if (timer_id == ATTACK_OVER)
- {
- attacking = false;
- }
- else if (timer_id == CHANGE_ATTACK)
- {
- if ((Commands->Get_Distance(current_loc, enemy_loc)) < 65)
- {
- Commands->Action_Reset ( obj, 100 );
- charge = true;
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Movement( STAR, 1.5f, 0 );
- params.Set_Attack(STAR, 100.0f, 5.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Action_Attack (obj, params);
- Commands->Start_Timer(obj, this, 6.0f, CHARGE_COMPLETE);
- }
-
- }
- else if (timer_id == CHARGE_COMPLETE)
- {
- charge = false;
- charging = false;
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN +5, 10 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000095;
- params.Set_Attack(STAR, 100.0f, 5.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Action_Attack (obj, params);
- }
- }
-
- };
- DECLARE_SCRIPT (M09_Vehicle_Attack_02, "")
- {
- bool attacking, charge, charging;
- Vector3 current_loc;
- Vector3 enemy_loc;
- 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 );
- SAVE_VARIABLE( charge, 2 );
- SAVE_VARIABLE( charging, 3 );
- SAVE_VARIABLE( current_loc, 4 );
- SAVE_VARIABLE( enemy_loc, 5 );
- }
- void Created(GameObject * obj)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- charge = false;
- charging = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- current_loc = Commands->Get_Position ( obj );
- enemy_loc = Commands->Get_Position ( enemy );
-
- if (!attacking)
- {
- if ((Commands->Get_Distance(current_loc, enemy_loc)) < 200.0f)
- {
- attacking = true;
-
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Attack(STAR, 200.0f, 5.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Action_Attack (obj, params);
-
- Commands->Start_Timer(obj, this, 1.0f, ATTACK_OVER);
-
- }
- }
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- ActionParamsStruct params;
- if (timer_id == ATTACK_OVER)
- {
- attacking = false;
-
- }
- }
-
- };
- DECLARE_SCRIPT (M09_Sam_Engineer_1, "")
- {
- void Created(GameObject * obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 10 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000102)), RUN, 1.5f );
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (action_id == 10)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 1);
- params.Set_Animation( "H_A_a0f0", true );
- Commands->Action_Play_Animation (obj, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Sam_Engineer_2, "")
- {
- void Created(GameObject * obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 10 );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000103)), RUN, 1.5f );
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (action_id == 10)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 1);
- params.Set_Animation( "H_A_a0f0", true );
- Commands->Action_Play_Animation (obj, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Excavation_Tunnel_Encounter_On, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000406), ACTIVATE, ACTIVATE, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Excavation_Tunnel_Encounter_Off, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (Commands->Is_A_Star(enterer))
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000406), DEACTIVATE, DEACTIVATE, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Excavation_Tunnel_Controller, "") //2000406
- {
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == ACTIVATE && param == ACTIVATE)
- {
- //nod spawners
- Commands->Enable_Spawner(2000357, true);
- Commands->Enable_Spawner(2000354, true);
- Commands->Enable_Spawner(2000356, true);
- //mutant spawners
- Commands->Enable_Spawner(2000384, true);
- Commands->Enable_Spawner(2000383, true);
- Commands->Enable_Spawner(2000382, true);
- Commands->Enable_Spawner(2000381, true);
- }
- if (type == DEACTIVATE && param == DEACTIVATE)
- {
- //nod spawners
- Commands->Enable_Spawner(2000357, false);
- Commands->Enable_Spawner(2000354, false);
- Commands->Enable_Spawner(2000356, false);
- //mutant spawners
- Commands->Enable_Spawner(2000384, false);
- Commands->Enable_Spawner(2000383, false);
- Commands->Enable_Spawner(2000382, false);
- Commands->Enable_Spawner(2000381, false);
- }
- }
- };
- DECLARE_SCRIPT (M09_Vehicle_Attack_03, "")
- {
- bool attacking, charge, charging;
- Vector3 current_loc;
- Vector3 enemy_loc;
- 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 );
- SAVE_VARIABLE( charge, 2 );
- SAVE_VARIABLE( charging, 3 );
- SAVE_VARIABLE( current_loc, 4 );
- SAVE_VARIABLE( enemy_loc, 5 );
- }
- void Created(GameObject * obj)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
- Commands->Enable_Enemy_Seen( obj, true);
- attacking = false;
- charge = false;
- charging = false;
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- current_loc = Commands->Get_Position ( obj );
- enemy_loc = Commands->Get_Position ( enemy );
-
- if (!attacking)
- {
- if ((Commands->Get_Distance(current_loc, enemy_loc)) < 200.0f)
- {
- attacking = true;
-
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Attack(enemy, 200.0f, 10.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- 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;
-
- }
- }
-
- };
- DECLARE_SCRIPT (M09_Tunnel_Spawner_357, "")
- {
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0 );
- params.WaypathID = 2000364;
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 10)
- {
- Commands->Enable_Enemy_Seen( obj, true);
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- }
- };
- DECLARE_SCRIPT (M09_Tunnel_Spawner_354, "")
- {
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0 );
- params.WaypathID = 2000370;
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 10)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- }
- };
- DECLARE_SCRIPT (M09_Tunnel_Spawner_356, "")
- {
- void Created (GameObject * obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0 );
- params.WaypathID = 2000375;
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 10)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- }
- };
- DECLARE_SCRIPT (M09_Tunnel_Spawner_384_382, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Set_Innate_Aggressiveness ( obj, 1 );
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.25f );
- params.WaypathID = 2000385;
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- Commands->Debug_Message("Action Complete on M09_Tunnel_Spawner_383_381 %d %d.\n", action_id, reason);
- if(action_id == 10)
- {
- Commands->Action_Reset ( obj, 100 );
-
- Commands->Enable_Enemy_Seen( obj, true);
- }
- }
- };
- DECLARE_SCRIPT (M09_Tunnel_Spawner_383_381, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Set_Innate_Aggressiveness ( obj, 1 );
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Movement( Vector3(0,0,0), RUN, .25f );
- params.WaypathID = 2000397;
- Commands->Action_Goto (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- Commands->Debug_Message("Action Complete on M09_Tunnel_Spawner_383_381 %d %d.\n", action_id, reason);
- if(action_id == 10)
- {
- Commands->Action_Reset ( obj, 100 );
-
- Commands->Enable_Enemy_Seen( obj, true);
- }
- }
- };
- DECLARE_SCRIPT (M09_Excavation_Tunnel_3, "")
- {
- 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;
- //Nod soldiers
- Commands->Attach_Script(Commands->Find_Object (2000170), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000170), false );
- //Mutant soldiers
- Commands->Attach_Script(Commands->Find_Object (2000171), "M09_Mutant_Damage_Mod_10", "");
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000171), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000171), false );
- }
- }
- };
- DECLARE_SCRIPT (M09_Entrance_Zone, "")
- {
- 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(2000105, true);
- Commands->Enable_Spawner(2000106, true);
- //Nod soldiers
- Commands->Attach_Script(Commands->Find_Object (2000234), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000234), false );
- Commands->Attach_Script(Commands->Find_Object (2000235), "M09_Nod_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000235), false );
- Commands->Attach_Script(Commands->Find_Object (2000236), "M09_Nod_Damage_Mod_1", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000236), false );
- //Mutant soldiers
- Commands->Attach_Script(Commands->Find_Object (2000216), "M09_Mutant_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000216), false );
- Commands->Attach_Script(Commands->Find_Object (2000217), "M09_Mutant_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000217), false );
- Commands->Attach_Script(Commands->Find_Object (2000218), "M09_Mutant_Damage_Mod_10", "");
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000218), false );
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000222;
- Commands->Action_Goto (Commands->Find_Object (2000217), params);
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 11 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000230;
- Commands->Action_Goto (Commands->Find_Object (2000216), params);
-
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 12 );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0 );
- params.WaypathID = 2000226;
- Commands->Action_Goto (Commands->Find_Object (2000218), params);
- }
- }
- };
- DECLARE_SCRIPT (M09_CheckpointA_Controller, "") //2000969
- {
- int count;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( count, 1 );
- }
- void Created (GameObject *obj)
- {
- count = 0;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == COUNTER && param == COUNTER)
- {
- if (count++ >= 12)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 904, 3, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 904, 1, 0.0f);
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_CheckpointA_Counter, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000969), COUNTER, COUNTER, 0.0f);
- }
- };
- DECLARE_SCRIPT(M09_Chinook_ParaDrop, "Preset:string")
- {
- int chinook_id;
- bool dead;
- int out;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(chinook_id, 1);
- SAVE_VARIABLE(dead, 2);
- SAVE_VARIABLE(out, 3);
- }
-
- void Created(GameObject * obj)
- {
- Vector3 loc = Commands->Get_Position(obj);
- float facing = Commands->Get_Facing(obj);
-
- GameObject *chinook_rail = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Model(chinook_rail, "X5D_Chinookfly");
- Commands->Set_Facing(chinook_rail, facing);
- Commands->Set_Animation(chinook_rail, "X5D_Chinookfly.X5D_Chinookfly", false);
- GameObject *chinook = Commands->Create_Object("Nod_Chinook", loc);
- Commands->Set_Facing(chinook, facing);
- Commands->Set_Animation(chinook, "v_nod_chinook.vf_nod_chinook", true);
- Commands->Attach_To_Object_Bone(chinook, chinook_rail, "BN_Chinook_1");
- dead = false;
- out = 0;
- char params[10];
- sprintf(params, "%d", Commands->Get_ID(obj));
- Commands->Attach_Script(chinook, "M03_Reinforcement_Chinook", params);
- chinook_id = Commands->Get_ID(chinook);
-
- // Destroy Chinook
- Commands->Start_Timer(obj, this, 280.0f/30.0f, 0);
- // Parachutes
- Commands->Start_Timer(obj, this, 169.0f/30.0f, 1);
- Commands->Start_Timer(obj, this, 179.0f/30.0f, 2);
- Commands->Start_Timer(obj, this, 198.0f/30.0f, 3);
- // Soldiers
- Commands->Start_Timer(obj, this, 145.0f/30.0f, 4);
- Commands->Start_Timer(obj, this, 155.0f/30.0f, 5);
- Commands->Start_Timer(obj, this, 165.0f/30.0f, 6);
-
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- Vector3 loc = Commands->Get_Position(obj);
- const char * preset = Get_Parameter("Preset");
- float facing = Commands->Get_Facing(obj);
- switch (timer_id)
- {
- case 0:
- GameObject *chinook;
- chinook = Commands->Find_Object(chinook_id);
- Commands->Destroy_Object(chinook);
- break;
- case 1:
- if (out >= 1)
- {
- GameObject *para1;
- para1 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Facing(para1, facing);
- Commands->Set_Model(para1, "X5D_Parachute");
- Commands->Set_Animation(para1, "X5D_Parachute.X5D_ParaC_1", false);
- Commands->Create_3D_Sound_At_Bone("parachute_open", para1, "ROOTTRANSFORM");
- Commands->Attach_Script(para1, "M03_No_More_Parachute", "");
- }
- break;
- case 2:
- if (out >= 2)
- {
- GameObject *para2;
- para2 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Facing(para2, facing);
- Commands->Set_Model(para2, "X5D_Parachute");
- Commands->Set_Animation(para2, "X5D_Parachute.X5D_ParaC_2", false);
- Commands->Create_3D_Sound_At_Bone("parachute_open", para2, "ROOTTRANSFORM");
- Commands->Attach_Script(para2, "M03_No_More_Parachute", "");
- }
- break;
- case 3:
- if (out == 3)
- {
- GameObject *para3;
- para3 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Facing(para3, facing);
- Commands->Set_Model(para3, "X5D_Parachute");
- Commands->Set_Animation(para3, "X5D_Parachute.X5D_ParaC_3", false);
- Commands->Create_3D_Sound_At_Bone("parachute_open", para3, "ROOTTRANSFORM");
- Commands->Attach_Script(para3, "M03_No_More_Parachute", "");
- }
- break;
- case 4:
- if (!dead)
- {
-
- GameObject *box1 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Model(box1, "X5D_Box01");
- Commands->Set_Facing(box1, facing);
- Commands->Set_Animation(box1, "X5D_Box01.X5D_Box01", false);
- GameObject *soldier1;
- soldier1 = Commands->Create_Object_At_Bone(box1, preset, "Box01");
- Commands->Set_Facing(soldier1, facing);
- Commands->Attach_Script(soldier1, "RMV_Trigger_Killed", "1144444, 1000, 1000");
- Commands->Attach_Script(soldier1, "M09_CheckpointA_Counter", "");
- Commands->Attach_To_Object_Bone( soldier1, box1, "Box01" );
- Commands->Set_Animation(soldier1, "s_a_human.H_A_X5D_ParaT_1", false);
- out++;
- if ((out - 1) == DIFFICULTY)
- {
- dead = true;
- }
-
- }
- break;
- case 5:
- if (!dead)
- {
- GameObject *box2 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Model(box2, "X5D_Box02");
- Commands->Set_Facing(box2, facing);
- Commands->Set_Animation(box2, "X5D_Box02.X5D_Box02", false);
- GameObject *soldier2;
- soldier2 = Commands->Create_Object_At_Bone(box2, preset, "Box02");
- Commands->Set_Facing(soldier2, facing);
- Commands->Attach_Script(soldier2, "RMV_Trigger_Killed", "1144444, 1000, 1000");
- Commands->Attach_Script(soldier2, "M09_CheckpointA_Counter", "");
- Commands->Set_Animation(soldier2, "s_a_human.H_A_X5D_ParaT_2", false);
- Commands->Attach_To_Object_Bone( soldier2, box2, "Box02" );
- out++;
- if ((out - 1) == DIFFICULTY)
- {
- dead = true;
- }
-
- }
- break;
- case 6:
- if (!dead)
- {
- GameObject *box3 = Commands->Create_Object("Generic_Cinematic", loc);
- Commands->Set_Model(box3, "X5D_Box03");
- Commands->Set_Facing(box3, facing);
- Commands->Set_Animation(box3, "X5D_Box03.X5D_Box03", false);
- GameObject *soldier3;
- soldier3 = Commands->Create_Object_At_Bone(box3, preset, "Box03");
- Commands->Set_Facing(soldier3, facing);
- Commands->Attach_Script(soldier3, "RMV_Trigger_Killed", "1144444, 1000, 1000");
- Commands->Attach_Script(soldier3, "M09_CheckpointA_Counter", "");
- Commands->Set_Animation(soldier3, "s_a_human.H_A_X5D_ParaT_3", false);
- Commands->Attach_To_Object_Bone( soldier3, box3, "Box03" );
- out++;
- if ((out - 1) == DIFFICULTY)
- {
- dead = true;
- }
-
- }
- break;
-
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == 23000 && param == 23000)
- {
- dead = true;
- }
- }
- };
- DECLARE_SCRIPT (M09_First_Mutant_Encounter_Zone, "")
- {
- 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 (!already_entered)
- {
- GameObject *mutant1 = Commands->Find_Object (2000280);
-
- if (mutant1)
- {
-
- Commands->Attach_Script (mutant1, "M09_First_Mutant_Encounter", "");
- Commands->Start_Timer (obj, this, 1.0f, 100);
- }
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == 100)
- {
- GameObject *mutant2 = Commands->Find_Object (2000281);
- Commands->Attach_Script (mutant2, "M09_First_Mutant_Encounter", "");
- }
- }
- };
- DECLARE_SCRIPT (M09_First_Mutant_Encounter, "")
- {
-
- void Created (GameObject *obj)
- {
- Commands->Start_Timer (obj, this, 2.0f, 20);
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if (timer_id == 20)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 100);
- params.Set_Animation( "H_A_J26C", false );
- Commands->Action_Play_Animation (obj, params);
- Commands->Start_Timer (obj, this, 2.0f, 20);
- }
- }
- };
- DECLARE_SCRIPT (M09_Immobile, "")
- {
- void Created (GameObject *obj)
- {
- Commands->Innate_Disable ( obj );
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- if (enemy == STAR)
- {
- Commands->Innate_Enable(obj);
- ActionParamsStruct params;
- params.Set_Attack( STAR, 50.0f, 5.0f, true );
- Commands->Action_Attack( obj, params );
- }
- }
- };
- DECLARE_SCRIPT (M09_Mutant, "")
- {
- void Created (GameObject *obj)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_MUTANT );
- }
- };
- DECLARE_SCRIPT (M09_Explosion_Zone_Lab01, "")
- {
- 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 (!already_entered)
- {
- already_entered = true;
-
- Commands->Create_Explosion("Ground Explosions Twiddler", Vector3 (-102.560f, 483.462f ,-155.543f));
- Commands->Start_Timer (obj, this, 1.0f, 100);
- }
- }
- void Timer_Expired (GameObject *obj, int timer_id)
- {
- if (timer_id == 100)
- {
- /*Commands->Create_Explosion("Ground Explosions Twiddler", Vector3 (-102.560f, 483.462f ,-155.543f));
- GameObject *blocker;
- blocker = Commands->Create_Object ( "M08_Rubble_Stub", Vector3 (-102.560f, 483.462f ,-155.543f));*/
- }
- }
- };
- DECLARE_SCRIPT (M09_Explosion_Zone_Lab02, "")
- {
- 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 (!already_entered)
- {
- already_entered = true;
-
- Commands->Create_Explosion("Ground Explosions Twiddler", Vector3 (-6.151f, 494.846f ,-151.888f));
- GameObject *blocker1;
- blocker1 = Commands->Create_Object ( "M08_Rubble_Stub", Vector3 (-6.151f, 494.846f ,-151.888f));
- Commands->Set_Facing ( blocker1, 60.0f );
- }
- }
- };
- DECLARE_SCRIPT (M09_Explosion_Zone_Tunnel01, "")
- {
- 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 (!already_entered)
- {
- already_entered = true;
-
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), SPAWN_LOC, INCREMENT, 0.0f);
- Commands->Create_Explosion("Ground Explosions Twiddler", Vector3 (-70.356f, 475.905f ,-63.233f));
- GameObject *blocker1;
- blocker1 = Commands->Create_Object ( "M08_Rubble_Stub", Vector3 (-74.290f, 474.747f, -64.022f));
- Commands->Set_Facing(blocker1, 90.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Sam_Counter, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000331), COUNTER, COUNTER, 0.0f);
- }
- };
- DECLARE_SCRIPT (M09_Sam_Controller, "") //2000331
- {
- int count;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( count, 1 );
- }
- void Created (GameObject *obj)
- {
- count = 0;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == COUNTER && param == COUNTER)
- {
- count++;
- }
- if (count >= 3)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), 906, 1, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Unteamed, "")
- {
- void Created (GameObject *obj)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_SPECTATOR );
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Excavation_Zone_01, "")
- {
- 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;
- //Mutant soldiers
-
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000158), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000158), false );
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000159), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000159), false );
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000160), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000160), false );
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000161), CHANGE_PLAYERTYPE, MUTANT, 0.0f);
- Commands->Set_Innate_Is_Stationary ( Commands->Find_Object (2000161), false );
- //noddities
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000347), ATTACK, 2000158, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000175), ATTACK, 2000159, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000346), ATTACK, 2000160, 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000174), ATTACK, 2000161, 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Custom_Attack, "")
- {
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == ATTACK)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN + 5, 10 );
- params.Set_Attack(Commands->Find_Object (param), 200.0f, 5.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Action_Attack (obj, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Flamer_Attack_Zone, "")
- {
- 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;
- //Flamer Customs
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000185), ATTACK, (Commands->Get_ID (STAR)), 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000186), ATTACK, (Commands->Get_ID (STAR)), 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000187), ATTACK, (Commands->Get_ID (STAR)), 0.0f);
- Commands->Send_Custom_Event (obj, Commands->Find_Object (2000188), ATTACK, (Commands->Get_ID (STAR)), 0.0f);
- }
- }
- };
- DECLARE_SCRIPT (M09_Cryo_Mutant_Zone_01, "")
- {
- bool already_entered;
- 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->Start_Timer (obj, this, 1.0f, 1000);
- Commands->Enable_Spawner(2000417, true);
- Commands->Enable_Spawner(2000418, true);
- }
- }
- void Timer_Expired (GameObject *obj, int timer_id)
- {
- if (timer_id == 1000)
- {
- Commands->Enable_Spawner(2000416, true);
- Commands->Enable_Spawner(2000424, true);
- }
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Path_01, "")
- {
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 101 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = 2000425;
-
- Commands->Action_Goto (obj, params);
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Path_02, "")
- {
- void Created (GameObject *obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 101 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = 2000443;
-
- Commands->Action_Goto (obj, params);
- }
- };
- DECLARE_SCRIPT (M09_Key_Grant, "")
- {
- void Poked(GameObject * obj, GameObject * poker)
- {
- if (poker == STAR)
- {
-
- GameObject *key1 = Commands->Create_Object ( "Level_01_Keycard", Vector3 (-97.303f, 520.441f, -153.080f) );
- Commands->Attach_Script (key1, "M09_Containment_Key_1", "");
- }
- }
- };
- DECLARE_SCRIPT (M09_Lab_Key_Controller, "") //2000452
- {
- int key_counter;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( key_counter, 1 );
- }
-
- void Created (GameObject *obj)
- {
- key_counter = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == KEY_COUNTER )
- {
- if (param == INCREMENT)
- {
- key_counter++;
- }
- }
- if (type == CHECK)
- {
- Commands->Send_Custom_Event( obj, sender, COUNT, key_counter, 0.0f );
- }
- }
- };
- DECLARE_SCRIPT (M09_Containment_Key_1, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), KEY_COUNTER, INCREMENT, 0.0f );
- GameObject *mobius = Commands->Find_Object (2000010);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000988)), 1.2f, 0.8f );
- Commands->Action_Goto (mobius, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Containment_Key_2, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), KEY_COUNTER, INCREMENT, 0.0f );
- GameObject *mobius = Commands->Find_Object (2000010);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, MOBIUS_GOTO );
- params.Set_Movement( Commands->Get_Position (Commands->Find_Object (2000988)), 1.2f, 0.8f );
- Commands->Action_Goto (mobius, params);
- Commands->Destroy_Object (Commands->Find_Object (2000699));
- Commands->Destroy_Object (Commands->Find_Object (2001988));
- Commands->Destroy_Object (Commands->Find_Object (2000457));
- Commands->Destroy_Object (Commands->Find_Object (2000709));
- }
- }
- /*if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), KEY_COUNTER, INCREMENT, 0.0f );
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000709), GOAL, DECREMENT, 0.0f );
- }
- }*/
- };
- DECLARE_SCRIPT (M09_Key_Controller_Zones, "")
- {
- bool already_triggered;
- int key_count;
-
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_triggered, 1 );
- SAVE_VARIABLE( key_count, 2);
- }
- void Created (GameObject * obj)
- {
- already_triggered = false;
-
- }
-
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (!already_triggered)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), CHECK, 0, 0.0f );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == COUNT )
- {
- key_count = param;
- }
- }
- };
- DECLARE_SCRIPT (M09_Key_Box, "")
- {
- bool poke;
- bool opened;
-
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( poke, 1 );
- SAVE_VARIABLE( opened, 2 );
- }
- void Created (GameObject *obj)
- {
- poke = false;
- opened = false;
- }
- void Poked(GameObject * obj, GameObject * poker)
- {
- if (poke)
- {
- opened = true;
- Commands->Static_Anim_Phys_Goto_Frame ( 1265140, 0, "lab_spn_door08.lab_spn_door08" );
- GameObject *mobius;
- mobius = Commands->Find_Object (2000010);
- const char *conv_name = ("IDS_M09_D18");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 999);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (action_id == 999)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, 2000860, 0.0f );
- }
- }
-
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == VERIFY )
- {
- if (param == GO)
- {
- poke = true;
- }
- if (param == STOP)
- {
- poke = false;
- if (!opened)
- {
- GameObject *mobius;
- mobius = Commands->Find_Object (2000010);
- const char *conv_name = ("IDS_M09_D19");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 900);
- Commands->Monitor_Conversation (obj, conv_id);
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), WAYPATH, 2000462, 0.0f );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_MrShuman_Zone, "")
- {
- bool star_in_zone;
- bool fired_off;
- bool key;
-
-
- // Register variables to be Auto-Saved
- // All variables must have a unique ID, less than 256, that never changes
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( star_in_zone, 1);
- SAVE_VARIABLE( fired_off, 2);
- SAVE_VARIABLE( key, 3);
- }
- void Created (GameObject * obj)
- {
- star_in_zone = false;
- fired_off = false;
- key = false;
-
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == DIST_CHECK && star_in_zone)
- {
- float mobius_distance = Commands->Get_Distance(Commands->Get_Position (STAR), Commands->Get_Position (Commands->Find_Object (2000010)));
- if (mobius_distance <= 7.0 && star_in_zone && !fired_off)
- {
- fired_off = true;
- GameObject *shuman = Commands->Find_Object (2000456);
- GameObject *mobius = Commands->Find_Object (2000010);
- Commands->Send_Custom_Event ( obj, shuman, CLARK_KENT, 0);
- if (shuman)
- {
- const char *conv_name = ("IDS_M09_D14");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(shuman, conv_id, false, true, true);
- Commands->Join_Conversation(mobius, conv_id, false, true, true);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 954);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, DIST_CHECK);
- }
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- star_in_zone = false;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == LOCKBOX)
- {
- key = true;
- }
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- star_in_zone = true;
- float mobius_distance = Commands->Get_Distance(Commands->Get_Position (STAR), Commands->Get_Position (Commands->Find_Object (2000010)));
- if (mobius_distance <= 7.0 && star_in_zone && !fired_off)
- {
- fired_off = true;
- GameObject *shuman = Commands->Find_Object (2000456);
- GameObject *mobius = Commands->Find_Object (2000010);
- Commands->Send_Custom_Event ( obj, shuman, CLARK_KENT, 0);
- const char *conv_name = ("IDS_M09_D14");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(shuman, conv_id, false, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 954);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, DIST_CHECK);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if(action_id == 954)
- {
- /*GameObject *key2 = Commands->Create_Object ( "Level_02_Keycard", Vector3 (-76.473f, 457.493f, -153.807f) );
- Commands->Attach_Script (key2, "M09_Containment_Key_2", "");*/
- GameObject *shuman = Commands->Find_Object (2000456);
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 101 );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = 1200474;
- Commands->Action_Goto (shuman, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Invincible_MrShuman, "")
- {
- bool invincible;
- void Created (GameObject *obj)
- {
- invincible = true;
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == CLARK_KENT)
- {
- invincible = false;
- }
- }
- void Damaged (GameObject *obj, GameObject *damager, float amount)
- {
- if (invincible)
- {
- Commands->Set_Health (obj, 5.0f);
- }
- }
- };
-
- DECLARE_SCRIPT (M09_Elevator_Movement_Zone, "Direction:int, Anim_num:int, Elev_obj_num:int")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- char *elevators[9] =
- {
- "l09_res_elev06.l09_res_elev06",
- "elev01.elev01",
- "res_elev04.res_elev04",
- "l09_res_elev05.l09_res_elev05",
- "res_elev11.res_elev11",
- "l09_big_elev.l09_big_elev",
- "l09_big2_elev.l09_big2_elev",
- "cent_elev01.cent_elev01",
- "lab_spn_door08.lab_spn_door08",
- };
- if (enterer == STAR)
- {
- if (Get_Int_Parameter("Direction") == 0)
- {
- Commands->Static_Anim_Phys_Goto_Frame ( Get_Int_Parameter("Elev_obj_num"), 0, elevators [Get_Int_Parameter("Anim_num")] );
- }
- if (Get_Int_Parameter("Direction") == 1)
- {
- Commands->Static_Anim_Phys_Goto_Last_Frame ( Get_Int_Parameter("Elev_obj_num"), elevators [Get_Int_Parameter("Anim_num")] );
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_Elevator_All_Zone, "Controller_num:int")
- {
- bool star_in_zone;
- bool mobius_in_zone;
- GameObject * mobius;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( star_in_zone, 1 );
- SAVE_VARIABLE( mobius_in_zone, 2 );
- }
- void Created (GameObject *obj)
- {
- star_in_zone = false;
-
-
- mobius = Commands->Find_Object (2000010);
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (enterer == STAR)
- {
- star_in_zone = true;
- Commands->Send_Custom_Event(obj, Commands->Find_Object(Get_Int_Parameter("Controller_num")), SET_STAR, ENTER);
- }
- }
- void Exited(GameObject * obj, GameObject * exiter)
- {
- if (exiter == STAR)
- {
- star_in_zone = false;
- Commands->Send_Custom_Event(obj, Commands->Find_Object(Get_Int_Parameter("Controller_num")), SET_STAR, EXIT);
- }
- }
- };
- DECLARE_SCRIPT (M09_Elevator_All_Controller, "Waypoint_num:int, Elev_obj_num:int, Anim_num:int, Direction = 0:int, Mobius_exit_goto:int")
- {
- bool star_in_zone;
- bool mobius_in_zone;
- bool transition;
- int block1, block2, block3, block4;
-
- GameObject *mobius;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( star_in_zone, 1 );
- SAVE_VARIABLE( mobius_in_zone, 2 );
- SAVE_VARIABLE( transition, 3 );
- SAVE_VARIABLE( block1, 4 );
- SAVE_VARIABLE( block2, 5 );
- SAVE_VARIABLE( block3, 6 );
- SAVE_VARIABLE( block4, 7 );
- }
- void Created (GameObject *obj)
- {
- star_in_zone = false;
- mobius_in_zone = false;
- block1 = block2 = block3 = block4 = 0;
- char *elevators[9] =
- {
- "l09_res_elev06.l09_res_elev06",
- "elev01.elev01",
- "res_elev04.res_elev04",
- "l09_res_elev05.l09_res_elev05",
- "res_elev11.res_elev11",
- "l09_big_elev.l09_big_elev",
- "l09_big2_elev.l09_big2_elev",
- "cent_elev01.cent_elev01",
- "lab_spn_door08.lab_spn_door08",
- };
-
- mobius = Commands->Find_Object (2000010);
- Commands->Static_Anim_Phys_Goto_Last_Frame ( Get_Int_Parameter("Elev_obj_num"), elevators [Get_Int_Parameter("Anim_num")] );
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 333)
- {
- Commands->Destroy_Object (Commands->Find_Object (block1));
- Commands->Destroy_Object (Commands->Find_Object (block2));
- Commands->Destroy_Object (Commands->Find_Object (block3));
- Commands->Destroy_Object (Commands->Find_Object (block4));
- }
- }
- //
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- char *elevators[9] =
- {
- "l09_res_elev06.l09_res_elev06",
- "res_elev01.res_elev01",
- "res_elev04.res_elev04",
- "l09_res_elev05.l09_res_elev05",
- "res_elev11.res_elev11",
- "l09_big_elev.l09_big_elev",
- "l09_big2_elev.l09_big2_elev",
- "cent_elev01.cent_elev01",
- "lab_spn_door08.lab_spn_door08",
- };
- if (type == CHECK_STAR)
- {
- Commands->Send_Custom_Event(obj, sender, STAR_STATUS, star_in_zone);
- }
- if (type == CHECK_MOBIUS)
- {
- Commands->Send_Custom_Event(obj, sender, CHECK_MOBIUS, mobius_in_zone);
- }
- if (type == STAR_STATUS)
- {
- if (!param)
- {
- if (Get_Int_Parameter("Direction") == 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), ELEVATOR, (Get_Int_Parameter("Waypoint_num")));
- }
- if (Get_Int_Parameter("Direction") == 1)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), ELEVATOR_DOWN, (Get_Int_Parameter("Waypoint_num")));
- }
- }
- }
- if (type == SET_MOBIUS)
- {
- mobius_in_zone = true;
- if (star_in_zone)
- {
- if (Get_Int_Parameter("Direction") == 0)
- {
- Commands->Send_Custom_Event( obj, obj, ACTIVATE, 0);
- }
- if (Get_Int_Parameter("Direction") == 1)
- {
- Commands->Send_Custom_Event( obj, obj, ACTIVATEDOWN, 0);
- }
- }
- }
- if (type == SET_STAR)
- {
- if (param == ENTER)
- {
- star_in_zone = true;
- if (((Commands->Get_ID (obj)) != 2000607) && ((Commands->Get_ID (obj)) != 2000599))
- {
- if (Get_Int_Parameter("Direction") == 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), ELEVATOR, (Get_Int_Parameter("Waypoint_num")));
- }
- if (Get_Int_Parameter("Direction") == 1)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), ELEVATOR_DOWN, (Get_Int_Parameter("Waypoint_num")));
- }
- }
- if ((Commands->Get_ID (obj)) == 2000607)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000599), CHECK_STAR, 0);
- }
- if ((Commands->Get_ID (obj)) == 2000599)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000607), CHECK_STAR, 0);
- }
- }
-
- if (param == EXIT)
- {
- star_in_zone = false;
- //Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), FOLLOW, Get_Int_Parameter("Mobius_exit_goto"));
- }
- }
-
- if (type == ACTIVATE)
- {
- if (star_in_zone && mobius_in_zone)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), BLOCK_ON, 0, 0.0f);
- /* Commands->Start_Timer (obj, this, 3.0f, 333);
- GameObject *rub1 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-108.916f, 483.904f, -191.022f));
- block1 = Commands->Get_ID (rub1);
- Commands->Set_Is_Rendered( rub1, false );
- GameObject *rub2 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-25.433f, 513.013f, -150.613f));
- block2 = Commands->Get_ID (rub2);
- Commands->Set_Is_Rendered( rub2, false );
- GameObject *rub3 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (-47.948f, 535.216f, -103.284f));
- block3 = Commands->Get_ID (rub3);
- Commands->Set_Is_Rendered( rub3, false );
- Commands->Set_Facing (rub3, -90.0);
- GameObject *rub4 = Commands->Create_Object ("M08_Rubble_Stub", Vector3 (39.231f, 515.105f, -78.137f));
- block4 = Commands->Get_ID (rub4);
- Commands->Set_Is_Rendered( rub4, false );
- */ Commands->Static_Anim_Phys_Goto_Frame ( Get_Int_Parameter("Elev_obj_num"), 0, elevators [Get_Int_Parameter("Anim_num")] );
- }
- }
- if (type == ACTIVATEDOWN)
- {
- if (star_in_zone && mobius_in_zone)
- {
- Commands->Static_Anim_Phys_Goto_Last_Frame ( Get_Int_Parameter("Elev_obj_num"), elevators [Get_Int_Parameter("Anim_num")] );
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_Block_Off, "")
- {
- void Entered (GameObject *obj, GameObject *enterer)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000071), BLOCK_OFF, 0, 0.0f);
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Attack, "Target_num:int")
- {
- int target;
- void Created (GameObject *obj)
- {
- target = Get_Int_Parameter ("Target_num");
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- target = Get_Int_Parameter ("Target_num");
- ActionParamsStruct params;
-
- if ( sound.Type == M09_INNATE_ENABLE )
- {
- Vector3 loc = Commands->Get_Position (Commands->Find_Object (target));
- Commands->Set_Innate_Aggressiveness ( obj, 100.0f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 100.0 );
- ActionParamsStruct params;
- params.Set_Basic( this, 99, RUN_TO_TARGET );
- params.Set_Movement( loc, 1.2f, 0.75f);
-
- Commands->Action_Goto (obj, params);
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- float face = Commands->Get_Facing (Commands->Find_Object (target));
- if (action_id == RUN_TO_TARGET)
- {
- Commands->Set_Facing (obj, face);
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, ATTACKING );
- params.Set_Attack (Commands->Find_Object (2000626), 3.0f, 0.0f, 1);
- Commands->Action_Attack( obj, params );
- }
- }
- };
- DECLARE_SCRIPT (M09_Waypath_Run, "Waypath_num:int, Attacker_num:int, Controller_num:int")
- {
- int mutant_id;
- int attackee_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( mutant_id, 1 );
- SAVE_VARIABLE( attackee_id, 2 );
- }
- void Created (GameObject *obj)
- {
- Commands->Innate_Disable(obj);
- attackee_id = Commands->Get_ID(obj);
- Commands->Send_Custom_Event(obj, Commands->Find_Object (Get_Int_Parameter("Controller_num")), MUTANT_ATTACKEE, attackee_id);
- Commands->Start_Timer (obj, this, 1.0f, START);
-
- if (Get_Int_Parameter("Waypath_num") != 0)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, RUN_TO_TARGET );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = Get_Int_Parameter("Waypath_num");
-
- Commands->Action_Goto (obj, params);
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- Commands->Action_Reset ( obj, 100 );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, ANIMATION );
- params.Set_Animation ("h_a_891a", false);
- Commands->Action_Play_Animation (obj, params);
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- if (action_id == ANIMATION)
- {
- if (Get_Int_Parameter("Waypath_num") != 0)
- {
- Commands->Action_Reset ( obj, 100 );
- ActionParamsStruct params;
- params.Set_Basic( this, 99, RUN_TO_TARGET );
- params.Set_Movement( Vector3(0,0,0), RUN, 0.5f);
- params.WaypathID = Get_Int_Parameter("Waypath_num");
- Commands->Action_Goto ( obj, params );
- }
- }
- }
- void Killed(GameObject * obj, GameObject *killer )
- {
- Commands->Send_Custom_Event(obj, (Commands->Find_Object (mutant_id)), ATTACK_STAR, 0);
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == ATTACKER_CHECK)
- {
- mutant_id = param;
- }
- if (type == DEAD_MUTANT)
- {
- Commands->Action_Reset ( obj, 100 );
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
-
- if(timer_id == START)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (Get_Int_Parameter("Controller_num")), ATTACKER_CHECK, 0);
- }
- }
- };
- DECLARE_SCRIPT (M09_Mutant_Encounter_Controller, "")
- {
- int mutant_id;
- int attackee_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( mutant_id, 1 );
- SAVE_VARIABLE( attackee_id, 2 );
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == MUTANT_ATTACKER)
- {
- mutant_id = param;
- }
- if (type == MUTANT_ATTACKEE)
- {
- attackee_id = param;
- }
- if (type == ATTACKER_CHECK)
- {
- Commands->Send_Custom_Event(obj, sender, ATTACKER_CHECK, mutant_id);
- }
- if (type == ATTACKEE_CHECK)
- {
- Commands->Send_Custom_Event(obj, sender, ATTACKEE_CHECK, attackee_id);
- }
- }
- };
- DECLARE_SCRIPT (M09_Damage_Modifier, "Damage_multiplier:float")
- {
- float current_health, last_health, damage_tally;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( current_health, 1 );
- SAVE_VARIABLE( last_health, 2 );
- SAVE_VARIABLE( damage_tally, 3 );
- }
- void Created (GameObject *obj)
- {
- last_health = Commands->Get_Health (obj);
- damage_tally = 0;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float damage;
- if (damager == STAR)
- {
- last_health = Commands->Get_Health (obj);
- }
- if (damager != STAR)
- {
- current_health = Commands->Get_Health (obj);
- if (current_health == 0)
- {
- damage = ((last_health - current_health) + damage_tally);
- damage_tally = 0;
- }
- else
- {
- damage = (last_health - current_health);
- damage_tally = 0;
- }
- float mod_damage = (damage * (Get_Float_Parameter("Damage_multiplier")));
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- }
- }
- };
- DECLARE_SCRIPT (M09_Zone_Enabled_Mobius, "Waypath_id:int, Condition=0:int")
- {
- bool already_entered;
- int goal;
-
- // 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( goal, 2 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- goal = Get_Int_Parameter("Condition");
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (goal <= 0)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, Get_Int_Parameter("Waypath_id"), 0.0f );
- goal = 1;
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == GOAL)
- {
- if (param == INCREMENT)
- {
- goal++;
- }
- if (param == DECREMENT)
- {
- goal--;
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_No_Obj_Damage, "")
- {
- float curr_health;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( curr_health, 1 );
- }
- void Created (GameObject *obj)
- {
- curr_health = Commands->Get_Health (obj);
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- Commands->Set_Health (obj, curr_health);
- }
- };
- DECLARE_SCRIPT (M09_Flyover_Controller, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( last, 1 );
- }
- void Created (GameObject *obj)
- {
- last = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == FLYOVER)
- {
- char *flyovers[8] =
- {
- "X9A_Apache_00.txt",
- "X9A_Apache_01.txt",
- "X9A_Apache_02.txt",
- "X9A_Apache_03.txt",
-
- "X9A_Trnspt_00.txt",
- "X9A_Trnspt_01.txt",
- "X9A_Trnspt_02.txt",
- "X9A_Trnspt_03.txt",
-
- };
- int random = int(Commands->Get_Random(0, 8-WWMATH_EPSILON));
-
- while (random == last) {
- random = int(Commands->Get_Random(0, 8-WWMATH_EPSILON));
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- last = random;
- }
- }
- };
- DECLARE_SCRIPT (M09_Flyover_Recycle, "")
- {
- void Destroyed(GameObject * obj)
- {
- Commands->Send_Custom_Event (obj, Commands->Find_Object(2000955), FLYOVER, 0, 0.0f);
- }
- };
- DECLARE_SCRIPT (M09_Weather_On, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- Commands->Set_Fog_Enable ( true );
- Commands->Set_Fog_Range (0.0, 150.0, 2.0);
- Commands->Set_Lightning (0.25f, 0.0f, 0.2f, 265.0f, 0.3f, 2.0f);
- Commands->Set_Rain ( 10.0, 2.0, false);
- }
- };
- DECLARE_SCRIPT (M09_Weather_Off, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- //Commands->Set_Fog_Enable ( false );
- Commands->Set_Fog_Range (0.0, 1000.0, 2.0);
- Commands->Set_Lightning (0.0f, 0.0f, 0.2f, 265.0f, 0.3f, 2.0f);
- Commands->Set_Rain ( 0.0, 2.0, false);
- }
- };
- DECLARE_SCRIPT(M09_Evac_Transport, "") //2000969
- {
- bool already_entered;
- float facing;
-
- // 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( facing, 2 );
- }
- void Created (GameObject * obj)
- {
- already_entered = false;
- facing = 0.0f;
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (!already_entered)
- {
- already_entered = true;
- facing = Commands->Get_Facing (Commands->Find_Object (2000969));
- Vector3 loc = Commands->Get_Position (Commands->Find_Object (2000969));
-
- GameObject * bone = Commands->Create_Object ( "Invisible_Object", loc );
- Commands->Set_Facing(bone, facing);
- Commands->Attach_Script(bone, "M09_Evac_Bone", "");
- Commands->Set_Model ( bone, "XG_TransprtBone" );
- Commands->Set_Animation ( bone, "XG_TransprtBone.XG_EV2_PathA", false );
-
- GameObject * chinook = Commands->Create_Object_At_Bone( bone, "GDI_Transport_Helicopter", "XG_TransprtBone" );
- GameObject * troop = Commands->Create_Object_At_Bone( bone, "GDI_RocketSoldier_2SF", "SPAWNER" );
- Commands->Attach_Script(troop, "M00_Damage_Modifier_DME", "0.05f, 1, 1, 0, 0");
-
- char param1[10];
- sprintf(param1, "%d", Commands->Get_ID(troop));
-
- Commands->Set_Facing(chinook, facing);
- Commands->Attach_Script(chinook, "M09_Evac_Helicopter", param1);
- Commands->Attach_To_Object_Bone ( chinook, bone, "BN_Trajectory" );
- Commands->Set_Animation ( chinook, "v_GDI_trnspt.XG_EV2_trnsA", false );
-
- Commands->Attach_Script(troop, "M09_Gunner", "");
- Commands->Attach_Script(chinook, "M09_No_Obj_Damage", "");
- Commands->Attach_To_Object_Bone ( troop, chinook, "SPAWNER" );
- //Commands->Set_Facing(troop, facing - 180.0);
- }
- }
- };
- DECLARE_SCRIPT(M09_Evac_Bone, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_TransprtBone.XG_EV2_PathA") == 0)
- {
- Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV2_Pathloop", true );
- }
- }
- };
- DECLARE_SCRIPT(M09_Evac_Helicopter, "Gunner:int")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV2_trnsA") == 0)
- {
- int gunner_id = Get_Int_Parameter("Gunner");
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Start_Timer (obj, this, 3.0f, COLLISION);
- Commands->Send_Custom_Event (obj, Commands->Find_Object(gunner_id), GO, 0, 0.0f);
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV2_trnsloop", true );
- }
- }
- void Killed(GameObject * obj, GameObject * killer)
- {
- Commands->Mission_Complete(false);
- }
-
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- if (timer_id == COLLISION)
- {
- Commands->Enable_Collisions ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M09_Gunner, "")
- {
- float full_health;
- void Created ( GameObject *obj)
- {
- full_health = Commands->Get_Health (obj);
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == GO)
- {
- Commands->Attach_To_Object_Bone( obj, NULL, NULL );
- //Commands->Enable_Collisions ( obj );
- ActionParamsStruct params;
- params.Set_Basic( this, 99, 101 );
- params.Set_Movement( Commands->Find_Object (2000970), RUN, 1.5f);
-
- Commands->Action_Goto (obj, params);
- //Commands->Set_Innate_Aggressiveness ( obj, 1.0f );
- }
- }
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN +5, 10 );
- params.Set_Attack(enemy, 100.0f, 5.0f, true);
- params.AttackCheckBlocked = true;
- params.AttackActive = true;
-
- Commands->Modify_Action(obj, 10, params);
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- Commands->Set_Health (obj, full_health);
- }
- };
- DECLARE_SCRIPT(M09_Mobius_Goto, "GotoObject:int")
- {
- void Entered (GameObject *obj, GameObject *enterer)
- {
- GameObject * mobius = Commands->Find_Object (2000010);
- Commands->Send_Custom_Event( obj, mobius, FOLLOW, Get_Int_Parameter("GotoObject"), 0.0f );
- }
- };
- DECLARE_SCRIPT(M09_Innate_Disable, "")
- {
- float current_health, last_health, damage_tally;
- //GameObject * mobius;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( current_health, 1 );
- SAVE_VARIABLE( last_health, 2 );
- SAVE_VARIABLE( damage_tally, 3 );
- }
- void Created (GameObject *obj)
- {
- Commands->Innate_Disable(obj);
- //GameObject * mobius = Commands->Find_Object (2000010);
- last_health = Commands->Get_Health (obj);
- damage_tally = 0;
- }
- void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- ActionParamsStruct params;
-
- if ( sound.Type == M09_INNATE_ENABLE )
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 100.0f );
- //Commands->Innate_Force_State_Gunshots_Heard ( obj, Commands->Get_Position (obj) );
- Vector3 projector = Commands->Get_Position (obj);
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == M09_INNATE_ENABLE )
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 100.0f );
- //Commands->Innate_Force_State_Gunshots_Heard ( obj, Commands->Get_Position (obj) );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- GameObject * mobius = Commands->Find_Object (2000010);
- if (damager == STAR || damager == mobius)
- {
- last_health = Commands->Get_Health (obj);
- }
- if (damager != STAR && damager != mobius)
- {
- current_health = Commands->Get_Health (obj);
- float damage = ((last_health - current_health) + damage_tally);
- float mod_damage = (damage * 0.05f);
- damage_tally += mod_damage;
-
- Commands->Set_Health (obj, (last_health - mod_damage));
- last_health = Commands->Get_Health (obj);
- current_health = Commands->Get_Health (obj);
- }
- }
- };
- DECLARE_SCRIPT(M09_Innate_Enable_Zone, "SoundProjector:int, Radius=7.0:float, Total_Enemies:int")
- {
- bool already_entered, all_checked_in;
- int enemies;
-
- // 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;
- enemies = 0;
- }
- /*void Sound_Heard(GameObject* obj, const CombatSound & sound)
- {
- if ( sound.Type == M09_CHECK_IN )
- {
- enemies++;
- if (enemies == Get_Int_Parameter ("Total_Enemies"))
- {
- all_checked_in = true;
- }
- }
- }*/
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- if (timer_id == INNATE_RECYCLE && !all_checked_in)
- {
- Vector3 projector = Commands->Get_Position (Commands->Find_Object (Get_Int_Parameter ("SoundProjector")));
- float rad = Get_Float_Parameter("Radius");
-
- Commands->Create_Logical_Sound (obj, M09_INNATE_ENABLE, projector, rad);
- //Commands->Start_Timer (obj, this, 4.0f, INNATE_RECYCLE);
- }
- }
- void Entered (GameObject * obj, GameObject * enterer)
- {
- if (!already_entered)
- {
- already_entered = true;
- Vector3 projector = Commands->Get_Position (Commands->Find_Object (Get_Int_Parameter ("SoundProjector")));
- float rad = Get_Float_Parameter("Radius");
-
- Commands->Create_Logical_Sound (obj, M09_INNATE_ENABLE, projector, rad);
- Commands->Start_Timer (obj, this, 4.0f, INNATE_RECYCLE);
- }
- }
- };
- DECLARE_SCRIPT(M09_Zone_Destroy, "")
- {
- void Entered (GameObject *obj, GameObject *enterer)
- {
- Commands->Destroy_Object(obj);
- }
- };
- DECLARE_SCRIPT (M09_Lab_Powerup, "Target:int")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Grant_Key (Commands->Find_Object (Get_Int_Parameter("Target")), 10, true);
- Commands->Debug_Message("Key granted to %d.\n", Get_Int_Parameter("Target"));
- //Commands->Send_Custom_Event (obj, Commands->Find_Object (Get_Int_Parameter("Target")), 0, 0);
- Commands->Action_Reset ( Commands->Find_Object (Get_Int_Parameter("Target")), 100 );
- Commands->Attach_Script( Commands->Find_Object (Get_Int_Parameter("Target")), "M03_Goto_Star", "");
- }
- }
- };
- DECLARE_SCRIPT (M09_Ambient_Clutter, "")
- {
- int alarm;
- Vector3 sound_loc;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( alarm, 1 );
- SAVE_VARIABLE( sound_loc, 2 );
- }
- void Created (GameObject *obj)
- {
-
- float delayTimer = Commands->Get_Random ( 1, 5 );
- /*int chooser = Commands->Get_Random_Int (0, 7);
- float rand_dist = Commands->Get_Random ( 15, 20 );
- sound_loc = Commands->Get_Position (STAR);
- sound_loc.X += rand_dist;
- sound_loc.Y += rand_dist;
- sound_loc.Z += rand_dist;
- //Commands->Create_Sound ( ambients [chooser], sound_loc, obj );*/
-
- Commands->Start_Timer(obj, this, (20.0f - delayTimer), AMB_SOUND);
- Commands->Start_Timer(obj, this, (8.0f + delayTimer), AMB_EXPLOSION);
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- if (timer_id == AMB_SOUND)
- {
- char *ambients[7] =
- {
- "Ambient_Screams_03",
- "Ambient_Screams_04",
- "Explosion_Glass_02",
- "Explosion_Glass_03",
- "Explosion_Large_01",
- "Vehicle_Explo_Med2",
- "Vehicle_Explo_Med1",
- };
- int chooser = Commands->Get_Random_Int (0, 7);
- float delayTimer = Commands->Get_Random ( 1, 5 );
- float rand_dist = Commands->Get_Random ( 15, 30 );
- sound_loc = Commands->Get_Position (STAR);
- sound_loc.X += rand_dist;
- sound_loc.Y += rand_dist;
- sound_loc.Z += rand_dist;
- Commands->Create_Sound ( ambients [chooser], sound_loc, obj );
- Commands->Start_Timer(obj, this, (20.0f - delayTimer), AMB_SOUND);
- }
- if (timer_id == AMB_EXPLOSION)
- {
- int exp_point [5];
- exp_point [0] = 2006120;
- exp_point [1] = 2006121;
- exp_point [2] = 2006122;
- exp_point [3] = 2006123;
- exp_point [4] = 2006124;
- int exp_num = Commands->Get_Random_Int (0, 5);
- Commands->Create_Explosion("Air Explosions Twiddler", Commands->Get_Position (Commands->Find_Object (exp_point [exp_num])));
- float delayTimer = Commands->Get_Random ( 1, 5 );
- Commands->Start_Timer(obj, this, (8.0f + delayTimer), AMB_EXPLOSION);
- }
- }
- };
- DECLARE_SCRIPT (M09_Scientist_Cower, "")
- {
- void Created (GameObject *obj)
- {
- float delay = Commands->Get_Random ( 1, 3 );
- Commands->Start_Timer(obj, this, (delay), ANIM_DELAY);
- }
- void Timer_Expired (GameObject* obj, int timer_id)
- {
- if (timer_id == ANIM_DELAY)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 99, DOING_ANIMATION );
- params.Set_Animation ("S_A_HUMAN.H_A_A0A0_L51", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- };
- DECLARE_SCRIPT (M09_Destroy_Self_Zone, "")
- {
- 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)
- {
- GameObject *mobius = Commands->Find_Object (2000010);
- if (!already_entered)
- {
- already_entered = true;
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), NO_FOLLOW, ON);
- const char *conv_name = ("IDS_M09_D13");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(NULL, conv_id, false, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 900);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- }
- };
- DECLARE_SCRIPT (M09_KeyCard_Zone, "")
- {
- bool initiation;
- GameObject *mobius;
- float mobius_distance;
- bool star_in_zone;
- bool fired_off;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( initiation, 1 );
- SAVE_VARIABLE( mobius_distance, 2 );
- SAVE_VARIABLE( star_in_zone, 3 );
- SAVE_VARIABLE( fired_off, 4 );
- }
-
- void Created (GameObject *obj)
- {
- star_in_zone = false;
- fired_off = false;
- initiation = false;
- mobius = Commands->Find_Object (2000010);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == DIST_CHECK && star_in_zone)
- {
- if (mobius_distance <= 15.0/* && !fired_off*/)
- {
- //fired_off = true;
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), CHECK, 0, 0.0f );
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, DIST_CHECK);
- }
- }
- }
-
- void Entered (GameObject * obj, GameObject * enterer)
- {
- star_in_zone = true;
- mobius = Commands->Find_Object (2000010);
- mobius_distance = Commands->Get_Distance(Commands->Get_Position (STAR), Commands->Get_Position (mobius));
- if (mobius_distance <= 15.0/* && !fired_off*/)
- {
- //fired_off = true;
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), CHECK, 0, 0.0f );
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, DIST_CHECK);
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- star_in_zone = false;
- }
-
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == INITIATION)
- {
- //initiation = true;
- }
-
- if ( type == COUNT )
- {
- if (param == 0)
- {
- //initiation = true;
- /*const char *conv_name = ("IDS_M09_D13");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(NULL, conv_id, false, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 900);
- Commands->Monitor_Conversation (obj, conv_id);*/
- }
- if (param == 1)
- {
- //initiation = true;
-
- const char *conv_name = ("IDS_M09_D15");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 905);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- if (param == 2)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000452), KEY_COUNTER, INCREMENT, 0.0f );
-
- Commands->Static_Anim_Phys_Goto_Frame ( 1265140, 0, "lab_spn_door08.lab_spn_door08" );
-
- const char *conv_name = ("IDS_M09_D18");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 910);
- Commands->Monitor_Conversation (obj, conv_id);
-
- }
- }
- }
- void Action_Complete(GameObject * obj, int action_id, ActionCompleteReason reason)
- {
- mobius = Commands->Find_Object (2000010);
- if(action_id == 900)
- {
- const char *conv_name = ("IDS_M09_D13");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 950);
- Commands->Monitor_Conversation (obj, conv_id);
- //Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, 0, 0.0f );
- }
-
- if(action_id == 906)
- {
- const char *conv_name = ("IDS_M09_D13");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 908);
- Commands->Monitor_Conversation (obj, conv_id);
- //Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, 0, 0.0f );
- }
- if(action_id == 907)
- {
- const char *conv_name = ("IDS_M09_D15");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 909);
- Commands->Monitor_Conversation (obj, conv_id);
- //Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), FOLLOW, 0, 0.0f );
- }
- if(action_id == 908)
- {
- const char *conv_name = ("IDS_M09_D16");
- int conv_id = Commands->Create_Conversation (conv_name, 99, 200, false);
- Commands->Join_Conversation(mobius, conv_id, false, false);
- Commands->Join_Conversation(STAR, conv_id, false, false);
- Commands->Start_Conversation (conv_id, 910);
- Commands->Monitor_Conversation (obj, conv_id);
- }
- /*if(action_id == 910)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (2000010), WAYPATH, 2000462, 0.0f );
-
- }*/
-
- }
- };
- DECLARE_SCRIPT (M09_Innate_Activate, "Target0=0:int, Target1=0:int, Target2=0:int, Target3=0:int, Target4=0:int, Target5=0:int, Target6=0:int, Target7=0:int, Target8=0:int, Target9=0:int")
- {
- int target [10];
- bool already_entered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( target [0], 2 );
- SAVE_VARIABLE( target [1], 3 );
- SAVE_VARIABLE( target [2], 4 );
- SAVE_VARIABLE( target [3], 5 );
- SAVE_VARIABLE( target [4], 6 );
- SAVE_VARIABLE( target [5], 7 );
- SAVE_VARIABLE( target [6], 8 );
- SAVE_VARIABLE( target [7], 9 );
- SAVE_VARIABLE( target [8], 10 );
- SAVE_VARIABLE( target [9], 11 );
- }
- void Created (GameObject *obj)
- {
- already_entered = false;
- target [0] = Get_Int_Parameter ("Target0");
- target [1] = Get_Int_Parameter ("Target1");
- target [2] = Get_Int_Parameter ("Target2");
- target [3] = Get_Int_Parameter ("Target3");
- target [4] = Get_Int_Parameter ("Target4");
- target [5] = Get_Int_Parameter ("Target5");
- target [6] = Get_Int_Parameter ("Target6");
- target [7] = Get_Int_Parameter ("Target7");
- target [8] = Get_Int_Parameter ("Target8");
- target [9] = Get_Int_Parameter ("Target9");
- }
- void Entered (GameObject *obj, GameObject *enterer)
- {
- if (!already_entered)
- {
- already_entered = true;
- for (int x = 0; x < 10; x++)
- {
- if (target [x] != 0)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object(target [x]), M09_INNATE_ENABLE, 0);
- }
- }
- }
- }
- };
- DECLARE_SCRIPT (M09_Camera_Activate, "Camera0=0:int, Camera1=0:int, Camera2=0:int, Camera3=0:int, Camera4=0:int")
- {
- int camera [5];
- bool already_entered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( already_entered, 1 );
- SAVE_VARIABLE( camera [0], 2 );
- SAVE_VARIABLE( camera [1], 3 );
- SAVE_VARIABLE( camera [2], 4 );
- SAVE_VARIABLE( camera [3], 5 );
- SAVE_VARIABLE( camera [4], 6 );
- }
- void Created (GameObject *obj)
- {
- already_entered = false;
- camera [0] = Get_Int_Parameter ("Camera0");
- camera [1] = Get_Int_Parameter ("Camera1");
- camera [2] = Get_Int_Parameter ("Camera2");
- camera [3] = Get_Int_Parameter ("Camera3");
- camera [4] = Get_Int_Parameter ("Camera4");
- }
- void Entered (GameObject *obj, GameObject *enterer)
- {
- if (!already_entered)
- {
- already_entered = true;
- for (int x = 0; x < 10; x++)
- {
- if (camera [x] != 0)
- {
- Commands->Attach_Script (Commands->Find_Object (camera [x]), "RMV_Camera_Behavior", "90.0, 0, 1, 0.0");
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M09_Level10Key, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- Commands->Grant_Key ( STAR, 10, true);
- }
- };
- DECLARE_SCRIPT(M09_Destroy_Zone, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- Commands->Start_Timer (obj, this, 2.0f, 10);
- }
- void Timer_Expired(GameObject * obj, int timer_id )
- {
- if(timer_id == 10)
- {
- Commands->Destroy_Object (obj);
- }
- }
- };
- DECLARE_SCRIPT(M09_Elevator_Exit, "Mobius_exit_goto: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)
- {
- //already_entered = true;
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), ELEVATOR_EXIT, Get_Int_Parameter("Mobius_exit_goto"));
- }
- };
- DECLARE_SCRIPT(M09_Attack_Blocked_False, "")
- {
- void Enemy_Seen(GameObject * obj, GameObject *enemy )
- {
- ActionParamsStruct params;
- params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN, 1 );
- params.Set_Attack (enemy, 200.0f, 5.0f, 1);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- };
- DECLARE_SCRIPT(M09_Mobius_OnFollow, "")
- {
- void Entered (GameObject * obj, GameObject * enterer)
- {
- Commands->Send_Custom_Event(obj, Commands->Find_Object (2000010), NO_FOLLOW, OFF);
- }
- };
- DECLARE_SCRIPT(M09_PSuitAnim, "")
- {
- void Created (GameObject *obj)
- {
- /*ActionParamsStruct params;
- params.Set_Basic( this, 99, DOING_ANIMATION );
- params.Set_Animation ("S_A_HUMAN.H_A_X9C_SUIT", true);
- Commands->Action_Play_Animation (obj, params);*/
- Commands->Set_Animation ( obj, "S_A_HUMAN.H_A_X9C_SUIT", true, NULL, 0.0f, -1.0f, false );
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == 666)
- {
- Commands->Destroy_Object (obj);
- }
- }
- };
|