| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380 |
- /*
- ** 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
- * Mission02.cpp
- *
- * DESCRIPTION
- * Mission 02 Specific Scripts
- *
- * PROGRAMMER
- * Ryan Vervack, Rich Donnelly
- *
- * VERSION INFO
- * $Author: Rich_d $
- * $Revision: 332 $
- * $Modtime: 1/13/02 5:40p $
- * $Archive: /Commando/Code/Scripts/Mission02.cpp $
- *
- ******************************************************************************/
- #include "scripts.h"
- #include "toolkit.h"
- #include "mission2.h"
- // Mission Objective Controller and Initializer
- DECLARE_SCRIPT(M02_Objective_Controller, "")
- {
- int convoy_trucks;
- int count_dead;
- int count_dead_09;
- bool rocket_soldier_speech;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (convoy_trucks, 1);
- SAVE_VARIABLE (count_dead, 2);
- SAVE_VARIABLE (count_dead_09, 3);
- }
- void Created(GameObject * obj)
- {
- Commands->Reveal_Encyclopedia_Character (37);
- Commands->Reveal_Encyclopedia_Character (4);
- Commands->Reveal_Encyclopedia_Character (10);
- Commands->Reveal_Encyclopedia_Character (8);
- Commands->Set_Background_Music ("02-Packing Iron.mp3");
- // Set the Dam MCT to animation frame 0
- GameObject * dam = Commands->Find_Object (1111116);
- if (dam)
- {
- Commands->Set_Animation_Frame (dam, "MCT_NOD.MCT_NOD", 0);
- }
- count_dead = 0;
- count_dead_09 = 0;
- rocket_soldier_speech = false;
- // Set up the expected number of convoy trucks for the objective.
- convoy_trucks = 3;
- // Prevent the Objective Controller from hibernating
- Commands->Enable_Hibernation(obj, false);
- // Turn on the first primary objective (Locate the Missing Scientists)
- // Turn on the tertiary objectives (if any)
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective (201, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M02_01, NULL, IDS_Enc_Obj_Primary_M02_01);
- Commands->Set_Objective_HUD_Info_Position (201, 50, "POG_M08_1_04.tga", IDS_POG_LOCATE, Vector3 (1208.31f,562.49f,55.02f));
- Commands->Add_Objective (223, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_Enc_ObjTitle_Hidden_M02_01, NULL, IDS_Enc_Obj_Hidden_M02_01);
- Commands->Add_Objective (222, OBJECTIVE_TYPE_TERTIARY, OBJECTIVE_STATUS_HIDDEN, IDS_Enc_ObjTitle_Hidden_M02_02, NULL, IDS_Enc_Obj_Hidden_M02_02);
- Commands->Start_Timer (obj, this, 2.0f, 201);
- }
- // This custom receives requests to activate and deactivate objectives
- // Type = Objective ID
- // Param 0 = Activate this objective (Pending)
- // Param 1 = Complete this objective (Accomplished)
- // Param 2 = Fail this objective (Failed)
- // Param 3 = Convoy truck special - counting
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type > 199)
- {
- switch (param)
- {
- case (0): // Activate and set radar marker
- {
- Add_An_Objective (obj, type);
- Commands->Start_Timer (obj, this, 2.0f, type);
- break;
- }
- case (1): // Success
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1006I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Set_Objective_Status (type, OBJECTIVE_STATUS_ACCOMPLISHED);
- Commands->Start_Timer (obj, this, 2.0f, (type + 200));
- break;
- }
- case (2): // Failure
- {
- Commands->Set_Objective_Status (type, OBJECTIVE_STATUS_FAILED);
- break;
- }
- case (3): // Counting Convoy Trucks
- {
- convoy_trucks--;
- if (!convoy_trucks)
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1006I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Set_Objective_Status (213, OBJECTIVE_STATUS_ACCOMPLISHED);
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation ("M02_SECONDARY_09_FINISH", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- break;
- }
- default:
- {
- if (type == 1000)
- {
- if (param == 1000)
- {
- count_dead++;
- if (count_dead > 1)
- {
- count_dead = 0;
- Vector3 drop_loc = Vector3(-10.6f,-25.1f,-38.2f);
- float facing = 70.5f;
- const char* textfile = "X2I_GDI_Drop02_Rocket.txt";
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", textfile);
- }
- if (!rocket_soldier_speech)
- {
- rocket_soldier_speech = true;
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_MORE_ROCKET_SOLDIERS", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- }
- else if (param == 1001)
- {
- count_dead_09++;
- if (count_dead_09 > 2)
- {
- count_dead_09 = 0;
- Vector3 drop_loc = Vector3(819.38f,884.05f,24.50f);
- float facing = 110.0f;
- const char* textfile = "X2I_GDI_Drop03_Minigunner.txt";
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", textfile);
- }
- }
- }
- else if (param == 1002)
- {
- Commands->Give_PowerUp (STAR, "Level_01_Keycard", true);
- }
- }
- break;
- }
- }
- }
- }
- void Timer_Expired (GameObject * obj, int timer_id)
- {
- int id = 0;
- Commands->Stop_All_Conversations ();
- switch (timer_id)
- {
- case (10): // Reminder for final objective.
- {
- id = Commands->Create_Conversation("M02_PRIMARY_04_REMIND", 100, 300, true);
- break;
- }
- // Initiation Conversations
- case (201):
- {
- id = Commands->Create_Conversation("M02_PRIMARY_01_START", 100, 300, true);
- break;
- }
- case (204):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_01_START", 100, 300, true);
- break;
- }
- case (205):
- {
- id = Commands->Create_Conversation("M02_PRIMARY_04_START", 100, 300, true);
- Commands->Start_Timer (obj, this, 120.0f, 10);
- break;
- }
- case (206):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_02_START", 100, 300, true);
- break;
- }
- case (208):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_04_START", 100, 300, true);
- break;
- }
- case (210):
- {
- id = Commands->Create_Conversation("MX2DSGN_DSGN0004", 100, 300, true);
- break;
- }
- case (211):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_07_START", 100, 300, true);
- break;
- }
- case (212):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_08_START", 100, 300, true);
- break;
- }
- case (214):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_10_START", 100, 300, true);
- break;
- }
- case (218):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_14_START", 100, 300, true);
- break;
- }
- // Success Conversations
- case (403):
- {
- id = Commands->Create_Conversation("M02_PRIMARY_03_FINISH", 100, 300, true);
- break;
- }
- case (404):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_01_FINISH", 100, 300, true);
- break;
- }
- case (406):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_02_FINISH", 100, 300, true);
- break;
- }
- case (407):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_03_FINISH", 100, 300, true);
- break;
- }
- case (408):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_04_FINISH", 100, 300, true);
- break;
- }
- case (409):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_05_FINISH", 100, 300, true);
- break;
- }
- case (410):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_06_FINISH", 100, 300, true);
- break;
- }
- case (411):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_07_FINISH", 100, 300, true);
- Commands->Start_Timer (obj, this, 5.0f, 11);
- break;
- }
- case (412):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_08_FINISH", 100, 300, true);
- break;
- }
- case (414):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_10_FINISH", 100, 300, true);
- break;
- }
- case (416):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_12_FINISH", 100, 300, true);
- break;
- }
- case (417):
- {
- id = Commands->Create_Conversation("M02_SECONDARY_13_FINISH", 100, 300, true);
- break;
- }
- }
- if (id)
- {
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- void Add_An_Objective(GameObject * obj, int id)
- {
- Vector3 objective_pos;
- objective_pos = Objective_Radar_Locations [(id - 202)];
- switch (id)
- {
- case 202:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M02_02, NULL, IDS_Enc_Obj_Primary_M02_02);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 66, "POG_M07_2_05.tga", IDS_POG_DISABLE, objective_pos);
- break;
- }
- case 203:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M02_03, NULL, IDS_Enc_Obj_Primary_M02_03);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 67, "POG_M02_1_03.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 204:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_01, NULL, IDS_Enc_Obj_Secondary_M02_01);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 80, "POG_M02_2_01.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 205:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M02_04, NULL, IDS_Enc_Obj_Primary_M02_04);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 80, "POG_M02_1_04.tga", IDS_POG_CAPTURE, objective_pos);
- break;
- }
- case 206:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_02, NULL, IDS_Enc_Obj_Secondary_M02_02);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 53, "POG_M02_2_02.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 207:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_03, NULL, IDS_Enc_Obj_Secondary_M02_03);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 54, "POG_M02_2_03.tga", IDS_POG_ELIMINATE, objective_pos);
- break;
- }
- case 208:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_05, NULL, IDS_Enc_Obj_Secondary_M02_05);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 56, "POG_M02_2_06.tga", IDS_POG_ELIMINATE, objective_pos);
- break;
- }
- case 209:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_04, NULL, IDS_Enc_Obj_Secondary_M02_04);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 55, "POG_M02_2_05.tga", IDS_POG_ELIMINATE, objective_pos);
- break;
- }
- case 210:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_06, NULL, IDS_Enc_Obj_Secondary_M02_06);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 57, "POG_M02_2_04.tga", IDS_POG_ELIMINATE, objective_pos);
- break;
- }
- case 211:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_07, NULL, IDS_Enc_Obj_Secondary_M02_07);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 61, "POG_M02_2_07.tga", IDS_POG_ELIMINATE, objective_pos);
- break;
- }
- case 212:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_08, NULL, IDS_Enc_Obj_Secondary_M02_08);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 59, "POG_M02_2_08.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 213:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_09, NULL, IDS_Enc_Obj_Secondary_M02_09);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 60, "POG_M02_2_09.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 214:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_10, NULL, IDS_Enc_Obj_Secondary_M02_10);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 62, "POG_M02_2_10.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 215:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_11, NULL, IDS_Enc_Obj_Secondary_M02_11);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 63, "POG_M02_2_11.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 216:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_12, NULL, IDS_Enc_Obj_Secondary_M02_12);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 64, "POG_M02_2_12.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 217:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_13, NULL, IDS_Enc_Obj_Secondary_M02_13);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 65, "POG_M02_2_13.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 218:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_14, NULL, IDS_Enc_Obj_Secondary_M02_14);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 70, "POG_M02_2_14.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 219:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_15, NULL, IDS_Enc_Obj_Secondary_M02_15);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 71, "POG_M02_2_14.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 220:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_16, NULL, IDS_Enc_Obj_Secondary_M02_16);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 72, "POG_M02_2_14.tga", IDS_POG_DESTROY, objective_pos);
- break;
- }
- case 221:
- {
- Commands->Set_HUD_Help_Text(IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Add_Objective(id, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M02_17, NULL, IDS_Enc_Obj_Secondary_M02_17);
- Commands->Set_Objective_Radar_Blip(id, objective_pos);
- Commands->Set_Objective_HUD_Info_Position (id, 58, "POG_M02_2_15.tga", IDS_POG_ACQUIRE, objective_pos);
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M02_Objective_Zone, "")
- {
- bool enemies_defeated;
- bool was_entered;
- bool gave_secure_warning;
- int mendoza_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (enemies_defeated, 1);
- SAVE_VARIABLE (mendoza_id, 2);
- SAVE_VARIABLE (was_entered, 3);
- SAVE_VARIABLE (gave_secure_warning, 4);
- }
- void Created(GameObject *obj)
- {
- gave_secure_warning = false;
- mendoza_id = 0;
- was_entered = false;
- enemies_defeated = false;
- }
- void Entered(GameObject *obj, GameObject *enterer)
- {
- // Send customs to activate the appropriate objectives
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- bool destroy_zone = false;
- int dual_zone = 0;
- int zone_id = Commands->Get_ID(obj);
- switch (zone_id)
- {
- case (301601):
- {
- if (!Commands->Has_Key(STAR, 6))
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_BAY_DOOR_WARNING", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- }
- break;
- }
- case (303203):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_PRIMARY_03_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- break;
- }
- case (304006):
- {
- if (!was_entered)
- {
- was_entered = true;
- int id = Commands->Create_Conversation("MX2DSGN_DSGN0001", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- Commands->Set_HUD_Help_Text(IDS_M02DSGN_DSGN0186I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- }
- break;
- }
- case (400184):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 206, 0);
- Commands->Send_Custom_Event(obj, object, 207, 0);
- // Turn on A00
- Commands->Send_Custom_Event(obj, object, 104, 0);
- // Call GDI Rocket Soldiers
- Call_GDI_Soldiers(0);
-
- // Call the Nod Apache
- Create_Apache(0);
- // Tell A00 units to wake up
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400286), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400287), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400288), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400292), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400293), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400285), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400206), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401004), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401005), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401006), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400185):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 208, 0);
- Commands->Send_Custom_Event(obj, object, 209, 0);
- // Turn on A01
-
- Commands->Send_Custom_Event(obj, object, 104, 1);
- // Create A01 Nod Buggy for Player
- Commands->Send_Custom_Event(obj, object, 112, 1);
- Commands->Send_Custom_Event(obj, object, 111, 1);
- // Tell the GDI Rocket Soldiers for A00 to go to the tower.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1100, obj_position, 1000.0f);
- // Tell A23 units to go to home points.
- Commands->Create_Logical_Sound (obj, 1073, obj_position, 1000.0f);
- // Tell A01 units to wake up.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400342), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400343), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400347), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400332), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400340), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400348), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400344), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400345), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400333), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400207), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400371), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401008), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400186):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 210, 0);
- Commands->Send_Custom_Event(obj, object, 221, 0);
- //Turn off A01, Turn on A02
- Commands->Send_Custom_Event(obj, object, 105, 1);
- Commands->Send_Custom_Event(obj, object, 104, 2);
-
- // Tell A01 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1051, obj_position, 1000.0f);
- // Turn on A02 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400372), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400373), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400374), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401167), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400208), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401014), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401015), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401016), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401017), 0, 0);
- // Create the A02 buggy
- Create_Buggy (2);
- // Bring in A02 Sakura
- Create_Sakura (2);
- // Start the tank conversation
- destroy_zone = true;
- break;
- }
- case (400187):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 211, 0);
- //Turn off A03, Turn on A04
- Commands->Send_Custom_Event(obj, object, 105, 3);
- Commands->Send_Custom_Event(obj, object, 104, 4);
- // Tell the GDI Rocket Soldiers for A02 to go to the house.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1102, obj_position, 1000.0f);
- // Tell A03 units to go to home points.
- Commands->Create_Logical_Sound (obj, 1053, obj_position, 1000.0f);
- // Wake up A04 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400210), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400451), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400452), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400453), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400499), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400500), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401025), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401026), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401027), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401028), 0, 0);
- // Create A04 Nod Light Tank for Player
- Commands->Send_Custom_Event(obj, object, 112, 4);
- Commands->Send_Custom_Event(obj, object, 111, 4);
- // Create the A04 Nod Buggy
- Create_Buggy (4);
- // Activate the A04 Medium Tank motion and destruction.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401018), 0, 0);
- // Start the tank speaking timer
- Commands->Start_Timer (obj, this, 0.1f, 10);
- destroy_zone = true;
- dual_zone = 400267;
- break;
- }
- case (400188):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 212, 0);
- Commands->Send_Custom_Event(obj, object, 213, 0);
- //Turn off A02, Turn on A03
- Commands->Send_Custom_Event(obj, object, 105, 2);
- Commands->Send_Custom_Event(obj, object, 104, 3);
- // Tell A02 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1052, obj_position, 1000.0f);
- // Create the Light Tank for A03
- Create_Light_Tank (3);
- // Wake up A03 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400410), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400209), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400411), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400412), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400413), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400414), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400415), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400189):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 215, 0);
- Commands->Send_Custom_Event(obj, object, 216, 0);
- //Turn on A06
- Commands->Send_Custom_Event(obj, object, 104, 6);
- // Wake up A06 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400211), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400976), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400975), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400977), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400978), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400979), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400980), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401036), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401037), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401038), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401045), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400192):
- {
- // Default shut off for A11, Power Plant spawns.
- Commands->Send_Custom_Event(obj, object, 105, 11);
-
- // Tell A11 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1061, obj_position, 1000.0f);
- destroy_zone = true;
- break;
- }
- case (400193):
- {
- GameObject * object = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (object)
- {
- Commands->Control_Enable (STAR, false);
- Commands->Start_Timer (obj, this, 1.0f, 9);
- GameObject * controller = Commands->Find_Object (M02_OBJCONTROLLER);
- if (controller)
- {
- Commands->Send_Custom_Event (obj, controller, 1000, 1002, 25.0f);
- }
- Commands->Attach_Script (object, "Test_Cinematic", "X2K_Midtro.txt");
- }
- break;
- }
- case (400194):
- {
- if (!was_entered)
- {
- was_entered = true;
- // Complete final objective
- Commands->Send_Custom_Event(obj, object, 205, 1);
- Commands->Mission_Complete (true);
- //Turn off A21
-
- Commands->Send_Custom_Event(obj, object, 105, 21);
- }
- break;
- }
- case (400195):
- {
- Check_For_Soldiers (obj, 3);
- break;
- }
- case (400196):
- {
- Check_For_Soldiers (obj, 4);
- break;
- }
- case (400197):
- {
- Check_For_Soldiers (obj, 5);
- break;
- }
- case (400198):
- {
- Check_For_Soldiers (obj, 6);
- break;
- }
- case (400201):
- {
- Check_For_Soldiers (obj, 7);
- break;
- }
- case (400267):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 211, 0);
- // Turn off A03, Turn on A04
- Commands->Send_Custom_Event(obj, object, 105, 3);
- Commands->Send_Custom_Event(obj, object, 104, 4);
- // Tell A03 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1053, obj_position, 1000.0f);
- // Tell the GDI Rocket Soldiers for A02 to go to the house.
- Commands->Create_Logical_Sound (obj, 1102, obj_position, 1000.0f);
- // Wake up A04 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400210), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400451), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400452), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400453), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400499), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400500), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401025), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401026), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401027), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401028), 0, 0);
- // Create A04 Nod Light Tank for Player
- Commands->Send_Custom_Event(obj, object, 112, 4);
- Commands->Send_Custom_Event(obj, object, 111, 4);
- // Create the A04 Nod Buggy
- Create_Buggy (4);
- // Activate the A04 Medium Tank motion and destruction.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401018), 0, 0);
- // Start the tank speaking timer
- Commands->Start_Timer (obj, this, 0.1f, 10);
- destroy_zone = true;
- dual_zone = 400187;
- break;
- }
- case (400268):
- {
- // Turn off A04
- Commands->Send_Custom_Event(obj, object, 105, 4);
- // Tell A04 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1054, obj_position, 1000.0f);
- // Turn on A05 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400552), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400553), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400560), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400555), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400558), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400559), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400557), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400554), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400556), 0, 0);
- //Turn off A24
- Commands->Send_Custom_Event(obj, object, 105, 24);
- destroy_zone = true;
- break;
- }
- case (400269):
- {
- // Turn on objectives
- Commands->Send_Custom_Event(obj, object, 202, 0);
- Commands->Send_Custom_Event(obj, object, 203, 0);
- Commands->Send_Custom_Event(obj, object, 217, 0);
- //Turn off A06, Turn on A09 (Dam Top)
- Commands->Send_Custom_Event(obj, object, 105, 6);
- Commands->Send_Custom_Event(obj, object, 104, 9);
- // Turn on A09 units.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400212), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400981), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400982), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400983), 0, 0);
- // Tell A06 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1056, obj_position, 1000.0f);
- // Create the GDI soldier set
- Call_GDI_Soldiers (9);
- // Primary 01 GUIDE Conversation
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_PRIMARY_01_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- break;
- }
- case (400270):
- {
- //Turn off A09, Turn on A08 (Dam Interior)
- Commands->Send_Custom_Event(obj, object, 105, 9);
- Commands->Send_Custom_Event(obj, object, 104, 8);
- // Wake up A08 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400275), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401046), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401047), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401048), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401049), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401050), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401051), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401052), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401053), 0, 0);
- // Tell A09 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1059, obj_position, 1000.0f);
- dual_zone = 400271;
- destroy_zone = true;
- break;
- }
- case (400271):
- {
- //Turn off A09, Turn on A08 (Dam Interior)
- Commands->Send_Custom_Event(obj, object, 105, 9);
- Commands->Send_Custom_Event(obj, object, 104, 8);
- // Wake up A08 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400275), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401046), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401047), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401048), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401049), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401050), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401051), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401052), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401053), 0, 0);
- // Tell A09 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1059, obj_position, 1000.0f);
- GameObject * deadzone = Commands->Find_Object (303203);
- if (deadzone)
- {
- Commands->Destroy_Object (deadzone);
- }
- dual_zone = 400270;
- destroy_zone = true;
- break;
- }
- case (400272):
- {
- //Turn off A08, Turn on A10
- Commands->Send_Custom_Event(obj, object, 105, 8);
- Commands->Send_Custom_Event(obj, object, 104, 10);
- // Tell A08 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1058, obj_position, 1000.0f);
- // Wake up A10 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400213), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400984), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401054), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401055), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401056), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401057), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400273):
- {
- //Turn off A10, Turn on A11
- Commands->Send_Custom_Event(obj, object, 105, 10);
- Commands->Send_Custom_Event(obj, object, 104, 11);
- // Force an A11 spawn
- Commands->Send_Custom_Event(obj, object, 114, 11);
- Commands->Send_Custom_Event(obj, object, 102, 11);
- // Wake up A11 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400276), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400199), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401065), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401058), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401059), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401060), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401061), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401063), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401064), 0, 0);
- // Tell A10 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1060, obj_position, 1000.0f);
- destroy_zone = true;
- break;
- }
- case (400274):
- {
- //Trigger A11 off only when Power Plant is destroyed.
- GameObject* power_plant_obj = Commands->Find_Object(1153846);
- if (power_plant_obj)
- {
- float health_check = Commands->Get_Health(power_plant_obj);
- if (health_check <= 0.0f)
- {
- Commands->Send_Custom_Event(obj, object, 105, 11);
- // Tell A11 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1061, obj_position, 1000.0f);
- // Force an A10 spawn.
- Commands->Send_Custom_Event(obj, object, 114, 10);
- Commands->Send_Custom_Event(obj, object, 102, 10);
- destroy_zone = true;
- }
- // Shut off the Power Plant announcement
- Commands->Send_Custom_Event(obj, power_plant_obj, 1, 0);
- }
- break;
- }
- case (400316):
- {
- // Make the A00 soldiers return to home points, turn of A00
- Commands->Send_Custom_Event(obj, object, 105, 0);
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1050, obj_position, 1000.0f);
- // Turn on A23 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400317), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400318), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400319), 0, 0);
- destroy_zone = true;
- break;
- }
- case (400501):
- {
- //Turn on A24
- // Wake up A24 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400503), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400504), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400505), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400506), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400507), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400508), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400509), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400510), 0, 0);
- Commands->Send_Custom_Event(obj, object, 104, 24);
- // Turn on objective - SAM Site
-
- Commands->Send_Custom_Event(obj, object, 214, 0);
- dual_zone = 400502;
- destroy_zone = true;
- break;
- }
- case (400502):
- {
- //Turn on A24
- Commands->Send_Custom_Event(obj, object, 104, 24);
- // Wake up A24 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400503), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400504), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400505), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400506), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400507), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400508), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400509), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400510), 0, 0);
- // Turn on objective - SAM Site
-
- Commands->Send_Custom_Event(obj, object, 214, 0);
- dual_zone = 400501;
- destroy_zone = true;
- break;
- }
- case (400551):
- {
- // Create the Apache for this area
- Create_Apache (24);
- destroy_zone = true;
- break;
- }
- case (400989):
- {
- destroy_zone = true;
- break;
- }
- case (400990):
- {
- // Trigger the Failed Drop Cinematic
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2E_C130Drop.txt");
- }
- destroy_zone = true;
- break;
- }
- case (400991):
- {
- // Trigger the Orca shootdown cinematic
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2F_OrcaSam.txt");
- }
- destroy_zone = true;
- break;
- }
- case (400992):
- {
- // Trigger the Apache Orca crash cinematic
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2G_AirCrash.txt");
- }
- destroy_zone = true;
- break;
- }
- case (401001):
- {
- // Trigger the Apache bridge crash cinematic.
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2H_ApacheSpray.txt");
- }
- destroy_zone = true;
- break;
- }
- case (401029):
- {
- // Trigger the crash cinematic in A01
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2D_MTank_Slip.txt");
- }
- destroy_zone = true;
- break;
- }
- case (401054):
- {
- // Force an A08 spawn
- Commands->Send_Custom_Event(obj, object, 114, 8);
- Commands->Send_Custom_Event(obj, object, 102, 8);
- destroy_zone = true;
- break;
- }
- case (401066):
- {
- // Wake up A13 Obelisk units. No spawns in here.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400200), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401067), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401068), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401069), 0, 0);
- // Shut off the Obelisk warning.
- GameObject * obelisk = Commands->Find_Object(1153845);
-
- if (obelisk)
- {
- Commands->Send_Custom_Event (obj, obelisk, 1, 0);
- }
- destroy_zone = true;
- break;
- }
- case (401070):
- {
- // Turn on A14, Turn off A11 as default.
- Commands->Send_Custom_Event(obj, object, 105, 11);
- Commands->Send_Custom_Event(obj, object, 104, 14);
- // Tell A11 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1061, obj_position, 1000.0f);
- // Wake up A14 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401071), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401072), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401073), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401074), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401075), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401076), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401077), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401078), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401192), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401193), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401194), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401195), 0, 0);
- dual_zone = 401196;
- destroy_zone = true;
- break;
- }
- case (401079):
- {
- // Turn off A14, Turn on A15
- Commands->Send_Custom_Event(obj, object, 105, 14);
- Commands->Send_Custom_Event(obj, object, 104, 15);
- // Tell A14 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1064, obj_position, 1000.0f);
- // Turn on A15 Objectives
- Commands->Send_Custom_Event(obj, object, 218, 0);
- Commands->Send_Custom_Event(obj, object, 219, 0);
- Commands->Send_Custom_Event(obj, object, 220, 0);
- // Wake up A15 Units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401089), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401087), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401086), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401088), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401085), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401090), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401091), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401092), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401094), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401095), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401096), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401097), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401189), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401190), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401191), 0, 0);
- dual_zone = 401080;
- destroy_zone = true;
- break;
- }
- case (401080):
- {
- // Turn off A14, Turn on A15
- Commands->Send_Custom_Event(obj, object, 105, 14);
- Commands->Send_Custom_Event(obj, object, 104, 15);
- // Tell A14 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1064, obj_position, 1000.0f);
- // Turn on A15 Objectives
- Commands->Send_Custom_Event(obj, object, 218, 0);
- Commands->Send_Custom_Event(obj, object, 219, 0);
- Commands->Send_Custom_Event(obj, object, 220, 0);
- // Wake up A15 Units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401089), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401087), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401086), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401088), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401085), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401090), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401091), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401092), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401094), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401095), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401096), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401097), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401189), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401190), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401191), 0, 0);
- dual_zone = 401079;
- destroy_zone = true;
- break;
- }
- case (401101):
- {
- // Turn on Hand of Nod objective
- Commands->Send_Custom_Event(obj, object, 204, 0);
- // Tell A15 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1065, obj_position, 1000.0f);
- // Turn off A15, Turn on A16 units - First HoN encounter set.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401103), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401104), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401105), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401106), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401107), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401108), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401109), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401110), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401112), 0, 0);
- dual_zone = 401102;
- destroy_zone = true;
- break;
- }
- case (401102):
- {
- // Turn on Hand of Nod objective
- Commands->Send_Custom_Event(obj, object, 204, 0);
- // Tell A15 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1065, obj_position, 1000.0f);
- // Turn off A15, Turn on A16 units - First HoN encounter set.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401103), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401104), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401105), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401106), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401107), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401108), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401109), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401110), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401112), 0, 0);
- dual_zone = 401101;
- destroy_zone = true;
- break;
- }
- case (401113):
- {
- // Turn on A17 Units, Hand of Nod underside.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401115), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401116), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401117), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401118), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401119), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401120), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401121), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401122), 0, 0);
- dual_zone = 401114;
- destroy_zone = true;
- break;
- }
- case (401114):
- {
- // Turn on A17 Units, Hand of Nod underside.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401115), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401116), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401117), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401118), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401119), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401120), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401121), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401122), 0, 0);
- dual_zone = 401113;
- destroy_zone = true;
- break;
- }
- case (401123):
- {
- // Turn on A18 Units, Hand of Nod Lowest Level
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401124), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401125), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401126), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401127), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401128), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401129), 0, 0);
- destroy_zone = true;
- break;
- }
- case (401130):
- {
- GameObject * controller = Commands->Find_Object (1157690);
- if (controller)
- {
- float health = Commands->Get_Health (controller);
- if (health)
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_01_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- // Turn on A19 Units, Hand of Nod area
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401132), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401133), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401134), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401135), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401136), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401137), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401138), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401139), 0, 0);
- dual_zone = 401131;
- destroy_zone = true;
- break;
- }
- case (401131):
- {
- GameObject * controller = Commands->Find_Object (1157690);
- if (controller)
- {
- float health = Commands->Get_Health (controller);
- if (health)
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_01_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- // Turn on A19 Units, Hand of Nod area
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401132), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401133), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401134), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401135), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401136), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401137), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401138), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401139), 0, 0);
- dual_zone = 401130;
- destroy_zone = true;
- break;
- }
- case (401186):
- {
- // Create the A15 Apache
- Create_Apache(15);
- // M02 Secondary 14 GUIDE Conversation
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_14_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- dual_zone = 401187;
- destroy_zone = true;
- break;
- }
- case (401187):
- {
- // Create the A15 Apache
- Create_Apache(15);
- // M02 Secondary 14 GUIDE Conversation
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_14_GUIDE", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- dual_zone = 401186;
- destroy_zone = true;
- break;
- }
- case (401196):
- {
- // Turn on A14, Turn off A11 as default.
- Commands->Send_Custom_Event(obj, object, 105, 11);
- Commands->Send_Custom_Event(obj, object, 104, 14);
- // Tell A11 units to go to home points.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1061, obj_position, 1000.0f);
- // Wake up A14 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401071), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401072), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401073), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401074), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401075), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401076), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401077), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401078), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401192), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401193), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401194), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401195), 0, 0);
- dual_zone = 401070;
- destroy_zone = true;
- break;
- }
- case (401982):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_13_START", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- // Fly the Lear Jet over
- GameObject * lear_jet = Commands->Create_Object ("Nod_Jet", Vector3(929.91f,1132.34f,70.5f));
- if (lear_jet)
- {
- Commands->Attach_Script (lear_jet, "M02_Nod_Jet", "");
- }
- destroy_zone = true;
- break;
- }
- case (405116):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_OBELISK_APPROACH", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- break;
- }
- case (405117):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_PRIMARY_02_REMIND", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- break;
- }
- case (405118):
- {
- destroy_zone = true;
- break;
- }
- case (405119):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_03_START", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- destroy_zone = true;
- break;
- }
- case (405120):
- {
- // Drop the A02 Mammoth Tank
- Vector3 droploc = Vector3(570.06f,261.47f,-55.0f);
- GameObject * chinook_obj1 = Commands->Create_Object("GDI_Mammoth_Tank_Player", droploc);
- if (chinook_obj1)
- {
- Commands->Set_Facing (chinook_obj1, 45.0f);
- Commands->Attach_Script(chinook_obj1, "M02_Player_Vehicle", "2");
- }
- destroy_zone = true;
- break;
- }
- case (405122):
- {
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_SECONDARY_11_START", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- Commands->Start_Timer (obj, this, 6.0f, 12);
- destroy_zone = true;
- break;
- }
- }
- if (dual_zone)
- {
- // Another zone is also associated with this trigger. Destroy it as well.
- GameObject* dual_zone_obj = Commands->Find_Object(dual_zone);
- if (dual_zone_obj)
- {
- Commands->Destroy_Object(dual_zone_obj);
- }
- }
- if (destroy_zone)
- {
- Commands->Destroy_Object(obj);
- }
- }
- }
- void Check_For_Soldiers (GameObject* obj, int timer_id)
- {
- enemies_defeated = true;
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1000, obj_position, 70.0f);
- Commands->Start_Timer(obj, this, 1.0f, timer_id);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 3)
- {
- Send_and_Destroy (obj, 207);
- }
- else if (timer_id == 4)
- {
- Send_and_Destroy (obj, 208);
- }
- else if (timer_id == 5)
- {
- Send_and_Destroy (obj, 209);
- }
- else if (timer_id == 6)
- {
- Send_and_Destroy (obj, 210);
- }
- else if (timer_id == 7)
- {
- Send_and_Destroy (obj, 211);
- }
- else if (timer_id == 9)
- {
- // Teleport the star to the rooftop area.
- Commands->Set_Position (STAR, Vector3(1190.268f,558.538f,32.5f));
- // Create the Nod Jet and fly it out
- GameObject * jet = Commands->Create_Object ("Nod_Jet", Vector3(1209.879f,528.647f,21.313f));
- if (jet)
- {
- Commands->Attach_Script(jet, "M02_Nod_Jet_Waypath", "");
- }
- // Turn on objectives
- GameObject * object = Commands->Find_Object (M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Control_Enable (STAR, true);
- ActionParamsStruct params;
- params.Set_Basic (this, 100, 0);
- Commands->Action_Follow_Input (STAR, params);
- Commands->Send_Custom_Event(obj, object, 201, 1);
- Commands->Send_Custom_Event(obj, object, 205, 0);
- //Turn on A21
- Commands->Send_Custom_Event(obj, object, 104, 21);
- // Wake up A21 units
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400277), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401141), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401142), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401143), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401144), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401145), 0, 0);
- Commands->Send_Custom_Event(obj, Commands->Find_Object(401146), 0, 0);
- // Create Mendoza
- GameObject * mendoza = Commands->Create_Object("Nod_FlameThrower_3Boss", Vector3(1260.007f,535.460f,18.428f));
- if (mendoza)
- {
- Commands->Attach_Script(mendoza, "M02_Mendoza", "");
- mendoza_id = Commands->Get_ID (mendoza);
- GameObject * endzone = Commands->Find_Object (400194);
- if (endzone)
- {
- Commands->Send_Custom_Event(obj, endzone, 999, mendoza_id);
- }
- }
- Commands->Destroy_Object(obj);
- }
- }
- else if (timer_id == 10)
- {
- GameObject * tank = Commands->Find_Object (401028);
- if (tank)
- {
- Vector3 tank_pos = Commands->Get_Position (tank);
- Vector3 my_pos = Commands->Get_Position (STAR);
- float distance = Commands->Get_Distance (tank_pos, my_pos);
- if (distance < 20.0f)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0009", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, 10);
- }
- }
- }
- else if (timer_id == 11)
- {
- GameObject * tank = Commands->Find_Object (401028);
- if (tank)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0010", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- }
- else if (timer_id == 12)
- {
- GameObject * tank = Commands->Find_Object (401036);
- if (tank)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0011", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- }
- }
- void Send_and_Destroy (GameObject *obj, int type)
- {
- if (enemies_defeated)
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, type, 1);
- enemies_defeated = false;
- Commands->Destroy_Object(obj);
-
- if (type == 207)
- {
- // Check if the commando needs a new vehicle.
- Commands->Send_Custom_Event(obj, object, 111, 0);
- // Tell the GDI rocket solders to go to the tower.
- Vector3 obj_position = Commands->Get_Position (obj);
- Commands->Create_Logical_Sound (obj, 1100, obj_position, 1000.0f);
- }
- else if (type == 210)
- {
- // Air drop GDI soldiers into A02
- Call_GDI_Soldiers (2);
- }
- }
- }
- else if (!gave_secure_warning)
- {
- gave_secure_warning = true;
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_EVAG_SECURE_WARNING", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- // Custom received from living units in an area.
- if ((type == 100) && (param == 1))
- {
- enemies_defeated = false;
- }
- else if (type == 999)
- {
- if (param == 999)
- {
- GameObject * mendoza = Commands->Find_Object (mendoza_id);
- if (mendoza)
- {
- mendoza_id = 0;
- Commands->Destroy_Object (mendoza);
- }
- }
- else
- {
- mendoza_id = param;
- }
- }
- }
- void Call_GDI_Soldiers (int area_id)
- {
- Vector3 drop_loc = Vector3(0.0f,0.0f,0.0f);
- float facing = 0.0f;
- const char* textfile = "X2I_GDI_Drop02_Rocket.txt";
- switch (area_id)
- {
- case (0):
- {
- drop_loc = Vector3(-10.6f,-25.1f,-38.2f);
- facing = 70.5f;
- textfile = "X2I_GDI_Drop02_Rocket.txt";
- break;
- }
- case (2):
- {
- drop_loc = Vector3(664.70f,312.57f,-59.65f);
- facing = -150.0f;
- textfile = "X2I_GDI_Drop02_Rocket_2.txt";
- break;
- }
- case (9): // Dam Top Rush
- {
- drop_loc = Vector3(869.320f,912.316f,30.150f);
- facing = 110.0f;
- textfile = "X2I_GDI_Drop03_Minigunner.txt";
- break;
- }
- }
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", textfile);
- }
- }
- void Create_Apache (int area_id)
- {
- GameObject *helipad = Commands->Find_Object(474463);
- if (helipad)
- {
- // This will stop working when the Power Plant goes down, but it won't matter by that time.
- float currenthealth = Commands->Get_Health (helipad);
- if (((Commands->Get_Building_Power (helipad)) && (currenthealth > 0.0f)) || (area_id == 15))
- {
- Vector3 create_pos = Vector3(0.0f, 0.0f, 0.0f);
- float facing = 0.0f;
- const char* apache_params = "0";
- switch(area_id)
- {
- case (0):
- {
- create_pos = Vector3(138.36f, -5.61f, -12.20f);
- facing = -80.0f;
- apache_params = "0";
- break;
- }
- case (15):
- {
- create_pos = Vector3(1300.898f,657.717f,67.364f);
- facing = 0.0f;
- apache_params = "15";
- break;
- }
- case (24):
- {
- create_pos = Vector3(610.03f,1036.35f,-15.676f);
- facing = 0.0f;
- apache_params = "24";
- break;
- }
- }
- GameObject * apache = Commands->Create_Object("Nod_Apache", create_pos);
- if (apache)
- {
- Commands->Set_Facing(apache, facing);
- Commands->Attach_Script(apache, "M02_Nod_Apache", apache_params);
- }
- }
- }
- }
- void Create_Light_Tank (int area_id)
- {
- Vector3 create_pos = Vector3(465.645f, 715.86f, -14.935f);
- float facing = -10.0f;
- const char* tank_params = "3";
- GameObject * tank = Commands->Create_Object("Nod_Light_Tank", create_pos);
- if (tank)
- {
- Commands->Set_Facing(tank, facing);
- Commands->Attach_Script(tank, "M02_Nod_Vehicle", tank_params);
- }
- }
- void Create_Sakura (int area_id)
- {
- GameObject *helipad = Commands->Find_Object(474463);
- if (helipad)
- {
- float currenthealth = Commands->Get_Health (helipad);
- if ((Commands->Get_Building_Power (helipad)) && (currenthealth > 0.0f))
- {
- Vector3 create_pos = Vector3(509.362f,473.582f,-40.0f);
- float facing = 0.0f;
- const char* sakura_params = "2";
- GameObject * sakura = Commands->Create_Object("Nod_Apache", create_pos);
-
- if (sakura)
- {
- Commands->Set_Facing(sakura, facing);
- Commands->Attach_Script(sakura, "M02_Nod_Sakura", sakura_params);
- }
- }
- }
- }
- void Create_Buggy (int area_id)
- {
- Vector3 create_pos = Vector3(0.0f, 0.0f, 0.0f);
- float facing = 0.0f;
- const char* buggy_params = "0";
- switch (area_id)
- {
- case (2):
- {
- create_pos = Vector3(674.622f,308.296f,-61.674f);
- facing = -90.0f;
- buggy_params = "2";
- break;
- }
- case (4):
- {
- create_pos = Vector3(366.209f,861.401f,6.488f);
- facing = -110.0f;
- buggy_params = "4";
- break;
- }
- }
- GameObject * buggy = Commands->Create_Object("Nod_Buggy", create_pos);
- if (buggy)
- {
- Commands->Set_Facing(buggy, facing);
- Commands->Attach_Script(buggy, "M02_Nod_Vehicle", buggy_params);
- }
- }
- };
- DECLARE_SCRIPT (M02_Respawn_Controller, "")
- {
- bool active_area [M02_AREACOUNT];
- bool area_spawn_heli_drop_01_active [M02_AREACOUNT];
- bool area_spawn_heli_drop_02_active [M02_AREACOUNT];
- bool area_spawn_parachute_active [M02_AREACOUNT];
- char area_unit_count [M02_AREACOUNT];
- char area_unit_max [M02_AREACOUNT];
- int area_officer [M02_AREACOUNT];
- int spawner_rotator;
- int replacement_vehicle;
- int destroyed_sam;
- int destroyed_silo;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( active_area, 1);
- SAVE_VARIABLE( area_spawn_heli_drop_01_active, 2);
- SAVE_VARIABLE( area_spawn_heli_drop_02_active, 3);
- SAVE_VARIABLE( area_spawn_parachute_active, 4);
- SAVE_VARIABLE( area_unit_count, 5);
- SAVE_VARIABLE( area_unit_max, 6);
- SAVE_VARIABLE( area_officer, 7);
- SAVE_VARIABLE( spawner_rotator, 8);
- SAVE_VARIABLE( replacement_vehicle, 9);
- SAVE_VARIABLE( destroyed_sam, 10);
- SAVE_VARIABLE( destroyed_silo, 11);
- }
- void Created (GameObject *obj)
- {
- int counter;
- counter = 0;
- spawner_rotator = 0;
- replacement_vehicle = -1;
- destroyed_sam = 0;
- destroyed_silo = 0;
- while (counter < ARRAY_ELEMENT_COUNT(active_area))
- {
- active_area [counter] = false;
- area_unit_count [counter] = 0;
- area_officer [counter] = 0;
- area_unit_max [counter] = 8;
- area_spawn_heli_drop_01_active [counter] = false;
- area_spawn_heli_drop_02_active [counter] = false;
- area_spawn_parachute_active [counter] = false;
- // Turning the actives to true in here means they do not occur in the area
- // provided you don't turn them off later on in the mission.
- switch (counter)
- {
- case (1):
- {
- area_unit_max [counter] = 7;
- break;
- }
- case (2):
- {
- area_unit_max [counter] = 7;
- break;
- }
- case (3):
- {
- area_unit_max [counter] = 5;
- break;
- }
- case (6):
- {
- area_unit_max [counter] = 6;
- break;
- }
- case (8):
- {
- area_spawn_heli_drop_01_active [counter] = true;
- area_spawn_heli_drop_02_active [counter] = true;
- area_spawn_parachute_active [counter] = true;
- area_unit_max [counter] = 3;
- break;
- }
- case (9):
- {
- area_unit_max [counter] = 7;
- break;
- }
- case (10):
- {
- area_spawn_parachute_active [counter] = true;
- break;
- }
- case (11):
- {
- area_spawn_heli_drop_01_active [counter] = true;
- area_spawn_heli_drop_02_active [counter] = true;
- area_spawn_parachute_active [counter] = true;
- area_unit_max [counter] = 3;
- break;
- }
- case (14):
- {
- area_spawn_heli_drop_01_active [counter] = true;
- area_spawn_heli_drop_02_active [counter] = true;
- area_spawn_parachute_active [counter] = true;
- area_unit_max [counter] = 3;
- break;
- }
- case (15):
- {
- area_spawn_heli_drop_01_active [counter] = true;
- area_spawn_heli_drop_02_active [counter] = true;
- area_spawn_parachute_active [counter] = true;
- area_unit_max [counter] = 3;
- break;
- }
- case (21):
- {
- area_unit_max [counter] = 5;
- break;
- }
- case (24):
- {
- area_spawn_heli_drop_01_active [counter] = true;
- area_spawn_heli_drop_02_active [counter] = true;
- area_spawn_parachute_active [counter] = true;
- area_unit_max [counter] = 3;
- break;
- }
- }
- counter++;
- }
- // Create the GDI Transport Helicopter and fly it out of scene.
- GameObject * helicopter = Commands->Create_Object ("GDI_Transport_Helicopter", Vector3(-26.87f,37.42f,20.75f));
- if (helicopter)
- {
- Commands->Set_Facing (helicopter, -155.0f);
- Commands->Attach_Script (helicopter, "M02_GDI_Helicopter", "");
- }
- // Drop the first Humm-Vee into the start area.
- Call_GDI_HummVee (0);
- // Wake up the A25 units.
- Commands->Send_Custom_Event(obj, Commands->Find_Object(400985), 0, 0);
- // Call the ORCA strike intro.
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2A_OrcaStrike.txt");
- }
- Commands->Start_Timer(obj, this, 3.0f, 2);
- }
- void Call_GDI_HummVee (int area_id)
- {
- Vector3 drop_loc = Vector3(-87.2f,-13.1f,-40.1f);
- float facing = 102.9f;
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2I_GDI_Drop_HummVee.txt");
- }
- }
- void Call_GDI_PowerUp (int area_id)
- {
- Vector3 drop_loc = Vector3(511.3f,680.3f,-21.2f);
- float facing = 146.6f;
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2I_GDI_Drop_PowerUp.txt");
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 2)
- {
- // Count through each area, check if it is active.
- int counter;
- counter = 0;
- while (counter < ARRAY_ELEMENT_COUNT(active_area))
- {
- if (active_area[counter])
- {
- // Check if the area still has an officer associated.
- if (area_officer[counter])
- {
- GameObject* officer = Commands->Find_Object(area_officer[counter]);
- if (officer)
- {
- Check_Respawns (counter);
- }
- }
- }
- counter++;
- }
- int players_difficulty = Commands->Get_Difficulty_Level();
- float timer_length = 25 - (10 * (players_difficulty));
- Commands->Start_Timer(obj, this, timer_length, 2);
- }
- }
- void Check_Respawns (int area_id)
- {
- // Can this particular area handle respawns?
- // Count through the spawn sequence until all units have been accounted for.
- int counter;
- int stop_point;
- bool stopped_counter;
- int spawner_buffer = 0;
- stopped_counter = false;
- counter = Get_Int_Random(0,2);
- stop_point = counter;
- int tempcount = area_unit_count[area_id];
- while (tempcount < area_unit_max [area_id])
- {
- if (!stopped_counter)
- {
- // Check which respawn type I can use.
- switch (counter)
- {
- case (0):
- {
- if (!area_spawn_heli_drop_01_active[area_id])
- {
- if ((area_unit_max[area_id] - tempcount) > 2)
- {
- area_spawn_heli_drop_01_active[area_id] = true;
- tempcount += 3;
- Use_Heli_Drop_01(area_id);
- }
- }
- break;
- }
- case (1):
- {
- if (!area_spawn_heli_drop_02_active[area_id])
- {
- if ((area_unit_max[area_id] - tempcount) > 1)
- {
- area_spawn_heli_drop_02_active[area_id] = true;
- tempcount += 2;
- Use_Heli_Drop_02(area_id);
- }
- }
- break;
- }
- case (2):
- {
- if (!area_spawn_parachute_active[area_id])
- {
- if ((area_unit_max[area_id] - tempcount) > 2)
- {
- area_spawn_parachute_active[area_id] = true;
- Use_Parachute_Drop(area_id);
- tempcount += 3;
- }
- }
- break;
- }
- }
- }
- else
- {
- spawner_buffer++;
- if (spawner_buffer < 3)
- {
- tempcount ++;
- Use_Spawners (area_id);
- }
- else
- {
- tempcount = area_unit_max[area_id];
- }
- }
- if (!stopped_counter)
- {
- counter++;
- if (counter > 2)
- {
- counter = 0;
- }
- if (counter == stop_point)
- {
- stopped_counter = true;
- }
- }
- }
- }
- // This uses a helicopter to drop three units.
- void Use_Heli_Drop_01 (int area_id)
- {
- Vector3 drop_location;
- float facing;
- const char* cinematic;
- const char* textfile;
- const char* parameters;
- cinematic = "Test_Cinematic";
- textfile = "X2I_Drop03_Area00.txt";
- parameters = "0,107";
- drop_location = Vector3(0.0f,0.0f,0.0f);
- facing = 0.0f;
- switch (area_id)
- {
- case (0): // A00 Guard Tower
- {
- parameters = "0,107";
- textfile = "X2I_Drop03_Area00.txt";
- drop_location = Vector3(119.5f,6.1f,-19.7f);
- facing = 140.0f;
- break;
- }
- case (1):
- {
- parameters = "1,107";
- textfile = "X2I_Drop03_Area01.txt";
- drop_location = Vector3(515.5f,17.1f,-58.9f);
- facing = 51.3f;
- break;
- }
- case (2):
- {
- parameters = "2,107";
- textfile = "X2I_Drop03_Area02.txt";
- drop_location = Vector3(619.9f,310.4f,-59.9f);
- facing = 0.0f;
- break;
- }
- case (3):
- {
- parameters = "3,107";
- textfile = "X2I_Drop03_Area03.txt";
- drop_location = Vector3(530.4f,690.8f,-19.2f);
- facing = -22.8f;
- break;
- }
- case (4):
- {
- parameters = "4,107";
- textfile = "X2I_Drop03_Area04.txt";
- drop_location = Vector3(461.5f,908.0f,5.3f);
- facing = -102.4f;
- break;
- }
- case (6):
- {
- parameters = "6,107";
- textfile = "X2I_Drop03_Area06.txt";
- drop_location = Vector3(772.1f,969.6f,21.4f);
- facing = 163.2f;
- break;
- }
- case (9):
- {
- parameters = "9,107";
- textfile = "X2I_Drop03_Area09.txt";
- drop_location = Vector3(957.638f,879.421f,34.220f);
- facing = 55.0f;
- break;
- }
- case (10):
- {
- parameters = "10,107";
- textfile = "X2I_Drop03_Area10.txt";
- drop_location = Vector3(1044.01f,947.144f,-37.816f);
- facing = -83.5f;
- break;
- }
- case (11):
- {
- parameters = "11,107";
- textfile = "X2I_Drop03_Area11.txt";
- drop_location = Vector3(1072.776f,997.836f,6.492f);
- facing = -35.0f;
- break;
- }
- case (21):
- {
- parameters = "21,107";
- textfile = "X2I_Drop03_Area21.txt";
- drop_location = Vector3(1173.998f,478.803f,22.657f);
- facing = 55.0f;
- break;
- }
- }
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_location);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "M02_Reset_Spawn", parameters);
- Commands->Attach_Script(chinook_obj1, cinematic, textfile);
- }
- }
- // This uses a different helicopter route to drop two units.
- void Use_Heli_Drop_02 (int area_id)
- {
- Vector3 drop_location;
- float facing;
- const char* cinematic;
- const char* textfile;
- const char* parameters;
- cinematic = "Test_Cinematic";
- textfile = "X2I_Drop02_Area00.txt";
- parameters = "0,108";
- drop_location = Vector3(0.0f,0.0f,0.0f);
- facing = 0.0f;
- switch (area_id)
- {
- case (0):
- {
- parameters = "0,108";
- textfile = "X2I_Drop02_Area00.txt";
- drop_location = Vector3(99.4f,-13.8f,-28.4f);
- facing = 25.1f;
- break;
- }
- case (1):
- {
- parameters = "1,108";
- textfile = "X2I_Drop02_Area01.txt";
- drop_location = Vector3(522.4f,128.1f,-58.7f);
- facing = -133.9f;
- break;
- }
- case (2):
- {
- parameters = "2,108";
- textfile = "X2I_Drop02_Area02.txt";
- drop_location = Vector3(614.8f,278.9f,-52.3f);
- facing = 22.8f;
- break;
- }
- case (3):
- {
- parameters = "3,108";
- textfile = "X2I_Drop02_Area03.txt";
- drop_location = Vector3(506.11f,567.12f,-39.60f);
- facing = 66.9f;
- break;
- }
- case (4):
- {
- parameters = "4,108";
- textfile = "X2I_Drop02_Area04.txt";
- drop_location = Vector3(471.1f,854.9f,3.7f);
- facing = -171.2f;
- break;
- }
- case (6):
- {
- parameters = "6,108";
- textfile = "X2I_Drop02_Area06.txt";
- drop_location = Vector3(786.0f,1032.3f,21.3f);
- facing = 168.7f;
- break;
- }
- case (9):
- {
- parameters = "9,108";
- textfile = "X2I_Drop02_Area09.txt";
- drop_location = Vector3(1047.111f,879.541f,34.220f);
- facing = 140.0f;
- break;
- }
- case (10):
- {
- parameters = "10,108";
- textfile = "X2I_Drop02_Area10.txt";
- drop_location = Vector3(970.504f,941.132f,-37.812f);
- facing = -130.0f;
- break;
- }
- case (11):
- {
- parameters = "11,108";
- textfile = "X2I_Drop02_Area11.txt";
- drop_location = Vector3(1092.028f,975.856f,4.14f);
- facing = 15.0f;
- break;
- }
- case (21):
- {
- parameters = "21,108";
- textfile = "X2I_Drop02_Area21.txt";
- drop_location = Vector3(1173.369f,562.608f,32.394f);
- facing = 0.0f;
- break;
- }
- }
- GameObject * chinook_obj2 = Commands->Create_Object("Invisible_Object", drop_location);
- if (chinook_obj2)
- {
- Commands->Set_Facing(chinook_obj2, facing);
- Commands->Attach_Script(chinook_obj2, "M02_Reset_Spawn", parameters);
- Commands->Attach_Script(chinook_obj2, cinematic, textfile);
- }
- }
- // This uses a cargo plane parachute drop to drop three units.
- void Use_Parachute_Drop (int area_id)
- {
- Vector3 drop_location;
- float facing;
- const char* cinematic;
- const char* textfile;
- const char* parameters;
- cinematic = "Test_Cinematic";
- textfile = "X2I_Para03_Area00.txt";
- parameters = "0,109";
- drop_location = Vector3(0.0f,0.0f,0.0f);
- facing = 0.0f;
- switch (area_id)
- {
- case (0):
- {
- textfile = "X2I_Para03_Area00.txt";
- parameters = "0,109";
- drop_location = Vector3(119.5f,38.2f,-15.6f);
- facing = -144.9f;
- break;
- }
- case (1):
- {
- textfile = "X2I_Para03_Area01.txt";
- parameters = "1,109";
- drop_location = Vector3(509.7f,78.3f,-55.2f);
- facing = -73.7f;
- break;
- }
- case (2):
- {
- textfile = "X2I_Para03_Area02.txt";
- parameters = "2,109";
- drop_location = Vector3(598.7f,342.2f,-62.7f);
- facing = -119.1f;
- break;
- }
- case (3):
- {
- textfile = "X2I_Para03_Area03.txt";
- parameters = "3,109";
- drop_location = Vector3(488.2f,608.4f,-41.2f);
- facing = -158.2f;
- break;
- }
- case (4):
- {
- textfile = "X2I_Para03_Area04.txt";
- parameters = "4,109";
- drop_location = Vector3(371.1f,794.0f,3.7f);
- facing = 90.0f;
- break;
- }
- case (6):
- {
- textfile = "X2I_Para03_Area06.txt";
- parameters = "6,109";
- drop_location = Vector3(765.5f,1004.0f,21.4f);
- facing = -14.4f;
- break;
- }
- case (9):
- {
- textfile = "X2I_Para03_Area09.txt";
- parameters = "9,109";
- drop_location = Vector3(1028.1f,876.4f,34.2f);
- facing = 87.2f;
- break;
- }
- case (21):
- {
- textfile = "X2I_Para03_Area21.txt";
- parameters = "21,109";
- drop_location = Vector3(1255.732f,565.134f,17.602f);
- facing = 150.0f;
- break;
- }
- }
- GameObject * plane_obj = Commands->Create_Object("Invisible_Object", drop_location);
- if (plane_obj)
- {
- Commands->Set_Facing(plane_obj, facing);
- Commands->Attach_Script(plane_obj, "M02_Reset_Spawn", parameters);
- Commands->Attach_Script(plane_obj, cinematic, textfile);
- }
- }
- // This uses the regular spawners to generate one unit.
- bool Use_Spawners (int area_id)
- {
- int spawner_id;
- const char *spawner_params;
- spawner_id = 0;
- spawner_params = "0,0,-1";
- spawner_rotator++;
- if (spawner_rotator > 2)
- {
- spawner_rotator = 0;
- }
- switch (area_id)
- {
- case (0):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400233;
- break;
- }
- case (1):
- {
- spawner_id = 400236;
- break;
- }
- default:
- {
- spawner_id = 400237;
- break;
- }
- }
- spawner_params = "0,0,-1";
- break;
- }
- case (1):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400234;
- break;
- }
- case (1):
- {
- spawner_id = 400238;
- break;
- }
- default:
- {
- spawner_id = 400239;
- break;
- }
- }
- spawner_params = "1,0,-1";
- break;
- }
- case (2):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400235;
- break;
- }
- case (1):
- {
- spawner_id = 400240;
- break;
- }
- default:
- {
- spawner_id = 400241;
- break;
- }
- }
- spawner_params = "2,0,-1";
- break;
- }
- case (3):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400242;
- break;
- }
- case (1):
- {
- spawner_id = 400243;
- break;
- }
- default:
- {
- spawner_id = 400244;
- break;
- }
- }
- spawner_params = "3,0,-1";
- break;
- }
- case (4):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400245;
- break;
- }
- case (1):
- {
- spawner_id = 400246;
- break;
- }
- default:
- {
- spawner_id = 400247;
- break;
- }
- }
- spawner_params = "4,0,-1";
- break;
- }
- case (6):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400248;
- break;
- }
- case (1):
- {
- spawner_id = 400249;
- break;
- }
- default:
- {
- spawner_id = 400250;
- break;
- }
- }
- spawner_params = "6,0,-1";
- break;
- }
- case (8):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400261;
- break;
- }
- case (1):
- {
- spawner_id = 400262;
- break;
- }
- default:
- {
- spawner_id = 400263;
- break;
- }
- }
- spawner_params = "8,0,-1";
- break;
- }
- case (9):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400251;
- break;
- }
- case (1):
- {
- spawner_id = 400252;
- break;
- }
- default:
- {
- spawner_id = 400253;
- break;
- }
- }
- spawner_params = "9,0,-1";
- break;
- }
- case (10):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400254;
- break;
- }
- case (1):
- {
- spawner_id = 400255;
- break;
- }
- default:
- {
- spawner_id = 400256;
- break;
- }
- }
- spawner_params = "10,0,-1";
- break;
- }
- case (11):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400257;
- break;
- }
- case (1):
- {
- spawner_id = 400258;
- break;
- }
- default:
- {
- spawner_id = 400259;
- break;
- }
- }
- spawner_params = "11,0,-1";
- break;
- }
- case (14):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 401081;
- break;
- }
- case (1):
- {
- spawner_id = 401082;
- break;
- }
- default:
- {
- spawner_id = 401083;
- break;
- }
- }
- spawner_params = "14,0,-1";
- break;
- }
- case (15):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 401098;
- break;
- }
- case (1):
- {
- spawner_id = 401099;
- break;
- }
- default:
- {
- spawner_id = 401100;
- break;
- }
- }
- spawner_params = "15,0,-1";
- break;
- }
- case (21):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400264;
- break;
- }
- case (1):
- {
- spawner_id = 400265;
- break;
- }
- default:
- {
- spawner_id = 400266;
- break;
- }
- }
- spawner_params = "21,0,-1";
- break;
- }
- case (24):
- {
- switch (spawner_rotator)
- {
- case (0):
- {
- spawner_id = 400540;
- break;
- }
- case (1):
- {
- spawner_id = 400541;
- break;
- }
- default:
- {
- spawner_id = 400542;
- break;
- }
- }
- spawner_params = "24,0,-1";
- break;
- }
- }
- GameObject * spawn1 = Commands->Trigger_Spawner(spawner_id);
- if (spawn1)
- {
- Commands->Attach_Script(spawn1, "M02_Nod_Soldier", spawner_params);
- return true;
- }
- else
- {
- return false;
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == 101)
- {
- // A unit has died, subtract him from his area (param).
- area_unit_count [param]--;
- if (area_unit_count [param] < 0)
- {
- area_unit_count [param] = 0;
- }
- }
- else if (type == 102)
- {
- // A specific area is requesting a forced spawn if possible.
- Check_Respawns (param);
- }
- else if (type == 103)
- {
- // A unit is registering with the area unit count.
- area_unit_count [param]++;
- }
- else if (type == 104)
- {
- // An area is being activated. Turn on the area.
- active_area [param] = true;
- }
- else if (type == 105)
- {
- // An area is being deactivated.
- active_area [param] = false;
- }
- else if (type == 106)
- {
- // An officer is registering with his area.
- if (sender)
- {
- area_officer[param] = Commands->Get_ID(sender);
- }
- }
- else if (type == 107)
- {
- // A Heli_01 spawner type is attempting to reset itself.
-
- area_spawn_heli_drop_01_active[param] = false;
- }
- else if (type == 108)
- {
- // A Heli_02 spawner type is attempting to reset itself.
- area_spawn_heli_drop_02_active[param] = false;
- }
- else if (type == 109)
- {
- // A Parachute spawner type is attempting to reset itself.
- area_spawn_parachute_active[param] = false;
- }
- else if (type == 111)
- {
- // A request to spawn a new vehicle for the commando has been made.
- Replacement_Vehicle (obj, param);
- }
- else if (type == 112)
- {
- // A player controlled vehicle has been destroyed, turn on the ability to make a new one
- replacement_vehicle = param;
- }
- else if (type == 113)
- {
- // A request has been made to call in a GDI power-up drop.
- Call_GDI_PowerUp (3);
- }
- else if (type == 114)
- {
- // Reset the unit area count to zero.
- area_unit_count [param] = 0;
- }
- else if (type == 115)
- {
- // Destroyed SAM on the bridge - add to count, determine if both are destroyed.
- destroyed_sam++;
- if (destroyed_sam > 1)
- {
- // Drop a Medium Tank on the bridge.
- replacement_vehicle = 6;
- Replacement_Vehicle (obj, 6);
- }
- }
- else if (type == 116)
- {
- // Destroyed Tiberium Silo - add to count, determine if both are destroyed.
- destroyed_silo++;
- if (destroyed_silo > 1)
- {
- // Complete this mission objective.
- Commands->Send_Custom_Event (obj, obj, 222, 1);
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_HIDDEN_02_FINISH", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- }
- // When a player controlled vehicle is destroyed, it sends a custom to this controller
- // to turn on the ability to create a new vehicle in a certain area.
- // Another object then sends a custom to check for new vehicle creation. If the flag for
- // creating a new vehicle for this area is active, it is reset and the vehicle is delivered.
- void Replacement_Vehicle (GameObject *obj, int area_id)
- {
- Vector3 drop_loc = Vector3(0.0f,0.0f,0.0f);
- float facing = 0.0f;
- const char* textfile = "X2I_GDI_Drop_HummVee.txt";
- bool nocinematic = false;
- switch (area_id)
- {
- case (0):
- {
- drop_loc = Vector3(161.6f,27.6f,-18.0f);
- facing = 115.4f;
- textfile = "X2I_GDI_Drop_HummVee.txt";
- break;
- }
- case (1):
- {
- drop_loc = Vector3(494.652f,128.786f,-56.159f);
- facing = 30.0f;
- GameObject *buggy = Commands->Create_Object ("Nod_Buggy_Player", drop_loc);
- if (buggy)
- {
- Commands->Set_Facing (buggy, facing);
- Commands->Attach_Script (buggy, "M02_Player_Vehicle", "3");
- }
- nocinematic = true;
- break;
- }
- case (2):
- {
- drop_loc = Vector3(448.32f,717.19f,-12.35f);
- facing = -30.0f;
- textfile = "X2I_GDI_Drop_MediumTank.txt";
- break;
- }
- case (4):
- {
- drop_loc = Vector3(429.672f, 894.045f, 4.354f);
- facing = -25.0f;
- GameObject *buggy = Commands->Create_Object ("Nod_Light_Tank_Player", drop_loc);
- if (buggy)
- {
- Commands->Set_Facing (buggy, facing);
- Commands->Attach_Script (buggy, "M02_Player_Vehicle", "5");
- }
- nocinematic = true;
- break;
- }
- case (5):
- {
- drop_loc = Vector3(611.1f, 1164.9f, 4.6f);
- facing = -39.7f;
- GameObject *buggy = Commands->Create_Object ("Nod_Recon_Bike_Player", drop_loc);
- if (buggy)
- {
- Commands->Set_Facing (buggy, facing);
- Commands->Attach_Script (buggy, "M02_Player_Vehicle", "6");
- }
- nocinematic = true;
- break;
- }
- case (6):
- {
- drop_loc = Vector3(785.3f,893.9f,21.8f);
- facing = 138.0f;
- textfile = "X2I_GDI_Drop_MediumTank.txt";
- break;
- }
- case (14):
- {
- drop_loc = Vector3(1229.37f, 742.89f, 27.03f);
- facing = 85.0f;
- GameObject *buggy = Commands->Create_Object ("Nod_Recon_Bike_Player", drop_loc);
- if (buggy)
- {
- Commands->Set_Facing (buggy, facing);
- Commands->Attach_Script (buggy, "M02_Player_Vehicle", "14");
- }
- nocinematic = true;
- break;
- }
- }
- if (!nocinematic)
- {
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", drop_loc);
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, facing);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", textfile);
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Reset_Spawn, "Area_ID:int,Spawn_Type:int")
- {
- void Destroyed (GameObject *obj)
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- int area_id;
- int spawn_type;
- area_id = Get_Int_Parameter("Area_ID");
- spawn_type = Get_Int_Parameter("Spawn_Type");
- Commands->Send_Custom_Event(obj, object, spawn_type, area_id);
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Soldier, "Area_Number:int,Area_Officer:int,Pre_Placed:int")
- {
- Vector3 my_home_point;
- bool no_return_home;
- int officeranimcounter;
- bool initial_damage;
- float initial_health;
- bool enemy_seen;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (my_home_point, 1);
- SAVE_VARIABLE (no_return_home, 2);
- SAVE_VARIABLE (officeranimcounter, 3);
- SAVE_VARIABLE (initial_damage, 4);
- SAVE_VARIABLE (initial_health, 5);
- SAVE_VARIABLE (enemy_seen, 6);
- }
- void Created (GameObject *obj)
- {
- officeranimcounter = 0;
- no_return_home = false;
- enemy_seen = false;
- initial_damage = false;
- initial_health = Commands->Get_Health(obj);
- // Set the unit's home point, save the value.
- Vector3 my_home_point = Commands->Get_Position(obj);
- Commands->Set_Innate_Soldier_Home_Location(obj, my_home_point, 20.0f);
- // Turn hibernation off for a moment.
-
- Commands->Enable_Hibernation (obj, 0);
- // Start the timer to register with the controller.
- Commands->Start_Timer(obj, this, 1.0f, 1);
- // If the unit is spawned, do not disturb it.
- // If the unit is preplaced, turn of actions.
- // If the unit is flown in, order it to move to the commando.
- int preplaced = Get_Int_Parameter("Pre_Placed");
- if (!preplaced)
- {
- // Give spawned units a green key for the Hand of Nod.
- Commands->Grant_Key (obj, 1, true);
- GameObject *starobj = Commands->Get_A_Star (my_home_point);
- if (starobj)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 71, 0);
- params.Set_Movement(starobj, RUN, 5.0f, 0);
- Commands->Action_Goto(obj, params);
- }
- }
- else
- {
- if (preplaced > 0)
- {
- // Turn off all actions for preplaced soldiers.
- Commands->Innate_Disable (obj);
- }
- }
- }
- void Enemy_Seen (GameObject * obj, GameObject * enemy)
- {
- enemy_seen = true;
- }
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- // If an objective shouts, respond to it, letting it know the area is not cleared.
- if (sound.Type == 1000)
- {
- if (sound.Creator)
- {
- Commands->Send_Custom_Event(obj, sound.Creator, 100, 1);
- }
- }
- // If a zone shouts to return to home points, do so.
- else if ((sound.Type > 1049) && (sound.Type < 1100) && (!no_return_home))
- {
- int area_id = (sound.Type - 1050);
- int area_num = Get_Int_Parameter("Area_Number");
- if (area_num == area_id)
- {
- // Tell this unit to return to its home point, conserving unit counts.
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 0);
- params.Set_Movement(my_home_point, RUN, 20.0f, false);
- Commands->Modify_Action (obj, 0, params, true, false);
- }
- }
- }
- void Timer_Expired (GameObject *obj, int timer_id)
- {
- if (timer_id == 1)
- {
- // Register with the respawn controller - send my area number.
- int officer = Get_Int_Parameter("Area_Officer");
- int preplaced = Get_Int_Parameter("Pre_Placed");
- int param = Get_Int_Parameter("Area_Number");
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- // Register with the respawn controller.
- Commands->Send_Custom_Event(obj, object, 103, param);
- if (officer)
- {
- // Unit is a preplaced officer. Register as an officer and hibernate.
-
- Commands->Set_Innate_Take_Cover_Probability (obj, 100.0f);
- Commands->Send_Custom_Event(obj, object, 106, param);
- Commands->Enable_Hibernation (obj, 1);
- }
- else
- {
- if (preplaced > 0)
- {
- // SPECIAL CASE SETUP: Force fire routine for Rocket Soldiers.
- if (preplaced == 4)
- {
- Commands->Attach_Script (obj, "M00_Soldier_Powerup_Disable", "");
- if ((param == 0) || (param == 3) || (param == 6) || (param == 10) || (param == 16) || (param == 21))
- {
- no_return_home = true;
- Commands->Start_Timer(obj, this, 15.0f, 4);
- }
- }
- // Soldiers in start cinematic begin self-destruct.
- if ((preplaced == 2) && (param == 99))
- {
- Commands->Start_Timer(obj, this, 5.0f, 6);
- }
- Commands->Enable_Hibernation (obj, 1);
- }
- else
- {
- // Unit is not pre-placed, activate cleanup code and do not hibernate if not in the interior areas.
- Commands->Start_Timer(obj, this, 15.0f, 2);
- }
- }
- }
- }
- else if (timer_id == 2)
- {
- // Cleanup code - find the nearest star, check distance, then check visibility
- Vector3 myloc = Commands->Get_Position(obj);
- GameObject *star_obj = Commands->Get_A_Star(myloc);
- if (star_obj)
- {
- Vector3 starloc = Commands->Get_Position(star_obj);
- float distance = Commands->Get_Distance (myloc, starloc);
-
- if (distance > 70.0f)
- {
- bool visibility = Commands->Is_Object_Visible(star_obj, obj);
- if (!visibility)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- else
- {
- Force_Move (obj);
- }
- }
- else
- {
- Force_Move (obj);
- }
- }
- Commands->Start_Timer(obj, this, 5.0f, 2);
- }
- else if (timer_id == 3)
- {
- // Force movement code to prevent irregular activity.
-
- Force_Move (obj);
- Commands->Start_Timer(obj, this, 15.0f, 3);
- }
- else if (timer_id == 4)
- {
- // Force fire at star code to prevent irregular activity.
- Vector3 myloc;
- myloc = Commands->Get_Position(obj);
- GameObject* starobj = Commands->Get_A_Star(myloc);
- if (starobj)
- {
- Vector3 starloc;
- float distance;
- starloc = Commands->Get_Position(starobj);
- distance = Commands->Get_Distance(myloc, starloc);
- if (distance < 150.0f)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- params.Set_Attack(starobj, 150.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 4);
- }
- else if (timer_id == 5)
- {
- // An officer is trying to play an animation.
- Vector3 playerloc = Commands->Get_Position (STAR);
- Vector3 myloc = Commands->Get_Position(obj);
- float distance = Commands->Get_Distance(myloc, playerloc);
- if ((distance > 10.0f) && (!Commands->Is_Performing_Pathfind_Action(obj)))
- {
- officeranimcounter++;
- if (officeranimcounter > 2)
- {
- officeranimcounter = 0;
- }
- switch (officeranimcounter)
- {
- case (0):
- {
- GameObject *nearsoldier = Commands->Find_Closest_Soldier (myloc, 1.0f, 50.0f);
- if ((nearsoldier) && (nearsoldier != STAR))
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 0);
- Vector3 soldierloc = Commands->Get_Position (nearsoldier);
- params.Set_Animation ("H_A_J18C", false);
- params.Set_Face_Location (soldierloc, 4.0f);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- }
- case (1):
- {
- if (STAR)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 0);
- params.Set_Animation ("H_A_J23C", false);
- params.Set_Face_Location (playerloc, 4.0f);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- }
- default:
- {
- if (STAR)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 0);
- params.Set_Animation ("H_A_J27C", false);
- params.Set_Face_Location (playerloc, 4.0f);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- }
- }
- }
- Commands->Start_Timer(obj, this, 10.0f, 5);
- }
- else if (timer_id == 6)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- else if (timer_id == 7)
- {
- if (!enemy_seen)
- {
- // Time to move the chem-warrior. Pick a new location.
-
- Vector3 newloc;
- int rndnum = (Get_Int_Random(0.0f,1.0f) * 5);
- switch (rndnum)
- {
- case (0):
- {
- newloc = Vector3(1301.55f,617.89f,19.66f);
- break;
- }
- case (1):
- {
- newloc = Vector3(1340.65f,655.04f,19.51f);
- break;
- }
- case (2):
- {
- newloc = Vector3(1310.67f,694.74f,19.71f);
- break;
- }
- default:
- {
- newloc = Vector3(1242.26f,646.04f,19.65f);
- break;
- }
- }
- ActionParamsStruct params;
- params.Set_Basic(this, 31, 0);
- params.Set_Movement(newloc, WALK, 10.0f, false);
- Commands->Action_Goto(obj, params);
- }
- else
- {
- Force_Move (obj);
- }
- Commands->Start_Timer(obj, this, 30.0f, 7);
- }
- else if (timer_id == 10)
- {
- Vector3 my_pos = Commands->Get_Position (obj);
- Vector3 star_pos = Commands->Get_Position (STAR);
- float distance = Commands->Get_Distance (my_pos, star_pos);
- if (distance < 20.0f)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0014", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- Commands->Start_Timer (obj, this, 3.0f, 11);
- }
- else
- {
- Commands->Start_Timer (obj, this, 2.0f, 10);
- }
- }
- else if (timer_id == 11)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0015", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- }
- void Force_Move (GameObject* obj)
- {
- if (!Commands->Is_Performing_Pathfind_Action(obj))
- {
- Vector3 mypos = Commands->Get_Position(obj);
- GameObject *starobj = Commands->Get_A_Star (mypos);
- if (starobj)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- params.Set_Movement(starobj, RUN, 10.0f, 0);
- params.Set_Attack(starobj, 150.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- }
- }
- }
- void Killed (GameObject *obj, GameObject *killer)
- {
- // Tell the respawn controller I am dead.
- int param;
- param = Get_Int_Parameter("Area_Number");
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, 101, param);
- }
- if (param == 3)
- {
- int officer = Get_Int_Parameter("Area_Officer");
- if (officer)
- {
- // If a Medium Tank is needed for A03, drop it.
-
- Commands->Send_Custom_Event (obj, object, 111, 2);
- }
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- int specific_id = Commands->Get_ID (obj);
- if (specific_id == 400276)
- {
- Commands->Start_Timer (obj, this, 2.0f, 10);
- }
- if ((type == 0) && (param == 0))
- {
- Commands->Innate_Enable (obj);
- // If the unit is a preplaced minigunner, forced movement code is activated for this unit.
-
- int preplaced = Get_Int_Parameter("Pre_Placed");
- if (preplaced == 2)
- {
- int myid = Commands->Get_ID(obj);
- if ((myid != 400512) || (myid != 400513))
- {
- Commands->Start_Timer(obj, this, 1.0f, 3);
- }
- }
- else if (preplaced == 1)
- {
- // Unit is an officer, start the animation timer.
- Commands->Start_Timer(obj, this, 10.0f, 5);
- }
- else if (preplaced == 6)
- {
- // Unit is a chem-warrior, start low priority wandering.
- Commands->Start_Timer(obj, this, 1.0f, 7);
- }
- else if (preplaced == 5)
- {
- int areanum = Get_Int_Parameter("Area_Number");
- if (areanum == 19)
- {
- // Unit is a technician, who plays an animation in front of a terminal.
- ActionParamsStruct params;
- params.Set_Basic(this, 31, 100);
- params.Set_Animation ("H_A_CON2", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- }
- if ((type == 99) && (!Commands->Is_Performing_Pathfind_Action(obj)))
- {
- if (param == 214)
- {
- // An Objective or Building is asking to be repaired.
- ActionParamsStruct params;
- params.Set_Basic(this, 71, 214);
- params.Set_Movement(sender, RUN, 10.0f, 0);
- Vector3 senderpos = Commands->Get_Position(sender);
- senderpos.Z -= 1.0f;
- params.Set_Attack(senderpos, 10.0f, 0.0f, false);
- Commands->Action_Attack(obj, params);
- }
- else if (param == 202)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 50, 214);
- params.Set_Movement(Vector3(1113.61f,877.4f,17.15f), RUN, 10.0f, 0);
- params.Set_Attack(Vector3(1113.61f,877.4f,17.15f), 10.0f, 0.0f, false);
- Commands->Action_Attack(obj, params);
- }
- else if (param == 217)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 50, 214);
- params.Set_Movement(Vector3(1062.24f,978.38f,-16.85f), RUN, 10.0f, 0);
- params.Set_Attack(Vector3(1062.24f,978.38f,-16.85f), 10.0f, 0.0f, false);
- Commands->Action_Attack(obj, params);
- }
- }
- if (!initial_damage)
- {
- if (type == CUSTOM_EVENT_FALLING_DAMAGE)
- {
- initial_health = Commands->Get_Max_Health(obj);
- }
- }
- }
- void Damaged( GameObject * obj, GameObject *damager, float amount)
- {
- if (!initial_damage && damager == NULL)
- {
- initial_damage = true;
- Commands->Set_Health(obj, initial_health);
- }
- }
- };
- DECLARE_SCRIPT(M02_Obelisk, "")
- {
- bool info_given;
- void Created(GameObject*obj)
- {
- info_given = false;
- }
- void Damaged(GameObject * obj, GameObject * damager, float amount)
- {
- if (Commands->Get_Building_Power (obj))
- {
- // Check if the engineer is alive
- GameObject * obj_engineer = Commands->Find_Object(400200);
- if (obj_engineer)
- {
- // Tell the Engineer to repair the building.
- Commands->Send_Custom_Event (obj, obj_engineer, 99, 202);
- //Actually repair the building.
- float maxhealth = Commands->Get_Max_Health (obj);
- Commands->Set_Health (obj, maxhealth);
- // Announce the returned health as an engineer repairing internally.
-
- if ((!info_given) && (damager == STAR))
- {
- info_given = true;
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_EVA_OBELISK_REPAIR", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- }
- }
- void Killed(GameObject * obj, GameObject * killer)
- {
- if (Commands->Get_Building_Power (obj))
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, 202, 1);
- }
- }
- GameObject * zone = Commands->Find_Object (405116);
- if (zone)
- {
- Commands->Destroy_Object (zone);
- }
- zone = Commands->Find_Object (405117);
- if (zone)
- {
- Commands->Destroy_Object (zone);
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == 1)
- {
- info_given = true;
- }
- }
- };
- DECLARE_SCRIPT (M02_Power_Plant, "")
- {
- bool info_given;
- void Created(GameObject*obj)
- {
- info_given = false;
- }
- void Damaged(GameObject * obj, GameObject * damager, float amount)
- {
- // Check if the engineer is alive
- GameObject * obj_engineer = Commands->Find_Object(400199);
- if (obj_engineer)
- {
- // Tell the Engineer to repair the building.
- Commands->Send_Custom_Event (obj, obj_engineer, 99, 217);
- //Actually repair the building.
- float maxhealth = Commands->Get_Max_Health (obj);
- Commands->Set_Health (obj, maxhealth);
- // Announce the returned health as an engineer repairing internally.
- if ((!info_given) && (damager == STAR))
- {
- info_given = true;
- Commands->Stop_All_Conversations ();
- int id = Commands->Create_Conversation("M02_EVA_POWER_REPAIR", 100, 300, true);
- Commands->Join_Conversation(NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation(id);
- }
- }
- }
- void Killed(GameObject * obj, GameObject * killer)
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, 217, 1);
- Commands->Send_Custom_Event(obj, object, 202, 1);
- }
- GameObject * obelisk = Commands->Find_Object(1153845);
-
- if (obelisk)
- {
- Commands->Set_Building_Power(obelisk, false);
- }
- GameObject * zone = Commands->Find_Object (405116);
- if (zone)
- {
- Commands->Destroy_Object (zone);
- }
- zone = Commands->Find_Object (405117);
- if (zone)
- {
- Commands->Destroy_Object (zone);
- }
- GameObject * hand_of_nod = Commands->Find_Object(1157690);
- if (hand_of_nod)
- {
- Commands->Set_Building_Power(hand_of_nod, false);
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if (type == 1)
- {
- info_given = true;
- }
- }
- };
- DECLARE_SCRIPT (M02_Dam_MCT, "")
- {
- bool destroyed;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (destroyed, 1);
- }
- void Created (GameObject * obj)
- {
- destroyed = false;
- }
- void Damaged (GameObject * obj, GameObject * damager, float amount)
- {
- float health = Commands->Get_Health(obj);
- if (health < 1.0f)
- {
- Commands->Set_Health (obj, 0.1f);
- if (!destroyed)
- {
- destroyed = true;
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, 203, 1);
- Commands->Grant_Key (STAR, 6, true);
- }
- Commands->Set_Animation_Frame (obj, "MCT_NOD.MCT_NOD", 7);
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Helipad, "")
- {
- void Killed(GameObject *obj, GameObject *killer)
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- Commands->Send_Custom_Event(obj, object, 206, 1);
- }
- }
- };
- DECLARE_SCRIPT (M02_Destroy_Objective, "Objective_ID:int")
- {
- void Killed(GameObject *obj, GameObject *killer)
- {
- int objective_id;
- objective_id = Get_Int_Parameter ("Objective_ID");
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- if (objective_id != 222)
- {
- Commands->Send_Custom_Event(obj, object, objective_id, 1);
- }
- // Special case items, mission is solved by above line!
- if (objective_id == 212)
- {
- // Drop powerups into A03.
- Commands->Send_Custom_Event(obj, object, 113, 3);
- }
- else if (objective_id == 214)
- {
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", Vector3(580.37f,889.69f,-0.57f));
- if (chinook_obj1)
- {
- Commands->Set_Facing(chinook_obj1, -180.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X2I_GDI_Drop02_Rocket_24.txt");
- }
- }
- else if ((objective_id == 215) || (objective_id == 216))
- {
- // Send a custom to the controller to count destroyed SAMs on the bridge.
- Commands->Send_Custom_Event(obj, object, 115, 0);
- }
- else if (objective_id == 204)
- {
- // Hand of Nod destroyed, turn off respawns in the area.
- Commands->Send_Custom_Event(obj, object, 105, 21);
- }
- else if (objective_id == 222)
- {
- // Send a custom to the controller to count destroyed Tiberium Silos.
- Commands->Send_Custom_Event(obj, object, 116, 0);
- }
- }
- }
- void Damaged(GameObject *obj, GameObject *damager, float amount)
- {
- int objective_id;
- objective_id = Get_Int_Parameter ("Objective_ID");
- if (objective_id == 214)
- {
- GameObject* engineer = Commands->Find_Object(400510);
- if (engineer)
- {
- Commands->Send_Custom_Event(obj, engineer, 99, 214);
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Convoy_Truck, "")
- {
- void Killed(GameObject *obj, GameObject *killer)
- {
- GameObject * object = Commands->Find_Object(M02_OBJCONTROLLER);
- if (object)
- {
- // Tell the controller to subtract a truck.
- Commands->Send_Custom_Event(obj, object, 900, 3);
- // Create an explosion here.
- Vector3 myloc;
- myloc = Commands->Get_Position(obj);
- }
- }
- };
- // SOLDIER TYPE PARAMETERS FOR GDI
- // 1 = Rocket Soldier
- // 2 = Minigunner Officer
- // 3 = Minigunner Enlisted
- // 4 = Grenadier Enlisted
- DECLARE_SCRIPT (M02_GDI_Soldier, "Area_ID:int, Soldier_Type=0:int")
- {
- bool stop_following;
- bool said_message;
- int shout_count;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (stop_following, 1);
- SAVE_VARIABLE (said_message, 2);
- SAVE_VARIABLE (shout_count, 3);
- }
- void Created(GameObject* obj)
- {
- Commands->Enable_Hibernation(obj, false);
- stop_following = false;
- said_message = false;
- shout_count = 0;
- // Special case checks for preplaced soldiers.
-
- int area_id = Get_Int_Parameter("Area_ID");
- if (area_id == 1)
- {
- Commands->Innate_Disable (obj);
- int soldier_type = Get_Int_Parameter ("Soldier_Type");
- if (soldier_type == 2)
- {
- Commands->Start_Timer(obj, this, 10.0f, 2);
- }
- }
- else
- {
- // Default spawned following unit - Give orders to stay near the commando on a timer.
- Commands->Start_Timer(obj, this, 1.0f, 1);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- int area_id = Get_Int_Parameter("Area_ID");
- if (area_id == 9)
- {
- // GDI soldiers in A09 Dam Top rush the Obelisk and die.
- GameObject * obelisk = Commands->Find_Object(1153845);
-
- if (obelisk)
- {
- bool power = Commands->Get_Building_Power (obelisk);
- if (power)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 71, 0);
- params.Set_Movement(Vector3(1105.78f,897.75f,35.05f), 1.0f, 20.0f, 0);
- Commands->Action_Goto(obj, params);
- }
- }
- }
- else if (!stop_following)
- {
- // Follow the commando. Start this check timer again.
- Vector3 mypos = Commands->Get_Position(obj);
- GameObject *starobj = Commands->Get_A_Star (mypos);
- if (starobj)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 71, 1);
- params.Set_Movement(starobj, 1.0f, 20.0f, 0);
- Commands->Action_Goto(obj, params);
- }
- else
- {
- stop_following = true;
- }
- }
- Commands->Start_Timer(obj, this, 10.0f, 1);
- }
- else if (timer_id == 2)
- {
- if(!said_message)
- {
- Vector3 mypos = Commands->Get_Position (obj);
- Vector3 starpos = Commands->Get_Position (STAR);
- float distance = Commands->Get_Distance (mypos, starpos);
- if (distance < 30.0f)
- {
- switch (shout_count)
- {
- case (0):
- {
- int id = Commands->Create_Conversation("M02_GOMG_RADIO_01", 99, 20, true);
- Commands->Join_Conversation (obj, id, true, true, true);
- Commands->Start_Conversation(id);
- shout_count++;
- break;
- }
- case (1):
- {
- int id = Commands->Create_Conversation("M02_GOMG_RADIO_02", 99, 20, true);
- Commands->Join_Conversation (obj, id, true, true, true);
- Commands->Start_Conversation(id);
- shout_count++;
- break;
- }
- case (2):
- {
- int id = Commands->Create_Conversation("M02_GOMG_RADIO_03", 99, 20, true);
- Commands->Join_Conversation (obj, id, true, true, true);
- Commands->Start_Conversation(id);
- shout_count++;
- break;
- }
- default:
- {
- break;
- }
- }
- }
- Commands->Start_Timer(obj, this, 10.0f, 2);
- }
- }
- }
- void Poked (GameObject * obj, GameObject * poker)
- {
- int soldier_type = Get_Int_Parameter ("Soldier_Type");
- if ((soldier_type == 2) && (!said_message))
- {
- said_message = true;
- int id = Commands->Create_Conversation("M02_GOMG_CONVERSATION", 99, 10, true);
- Commands->Join_Conversation (obj, id, true, true, true);
- Commands->Join_Conversation(STAR, id, true, true, false);
- Commands->Start_Conversation(id);
- }
- }
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- if ((sound.Type > 1099) && (sound.Type < 1199))
- {
- // Make sure this is the sound this unit is supposed to react to.
- int area_id = Get_Int_Parameter("Area_ID");
- if ((sound.Type - 1100) == area_id)
- {
- stop_following = true;
- switch (area_id)
- {
- case (0):
- {
- Commands->Action_Reset (obj, 100);
- break;
- }
- case (2):
- {
- Vector3 house_loc = Vector3(648.77f,300.74f,-59.99f);
- ActionParamsStruct params;
- params.Set_Basic(this, 81, 0);
- params.Set_Movement(house_loc, WALK, 1.0f, 0);
- Commands->Action_Goto(obj, params);
- break;
- }
- }
- }
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if ((type == 0) && (param == 0))
- {
- // A zone is trying to enable actions for this soldier.
- Commands->Innate_Enable (obj);
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int area_id = Get_Int_Parameter("Area_ID");
- if (area_id == 0)
- {
- GameObject * controller = Commands->Find_Object (M02_OBJCONTROLLER);
- if (controller)
- {
- Commands->Send_Custom_Event (obj, controller, 1000, 1000);
- }
- }
- else if (area_id == 9)
- {
- GameObject * controller = Commands->Find_Object (M02_OBJCONTROLLER);
- if (controller)
- {
- Commands->Send_Custom_Event (obj, controller, 1000, 1001);
- }
- }
- }
- void Action_Complete (GameObject * obj, int action_id, ActionCompleteReason complete_reason)
- {
- if ((action_id == 1) && (complete_reason == ACTION_COMPLETE_NORMAL))
- {
- if (!said_message)
- {
- said_message = true;
- int soldier_type = Get_Int_Parameter ("Soldier_Type");
- switch (soldier_type)
- {
- case (1): // Rocket Soldier
- {
- int id = Commands->Create_Conversation("M02_GERS_COVER_01", 99, 50, true);
- Commands->Join_Conversation (obj, id, true, true, false);
- Commands->Join_Conversation(STAR, id, true, true, false);
- Commands->Start_Conversation(id);
- break;
- }
- case (4): // Grenadier
- {
- int id = Commands->Create_Conversation("M02_GEGR_COVER_01", 99, 50, true);
- Commands->Join_Conversation (obj, id, true, true, false);
- Commands->Join_Conversation(STAR, id, true, true, false);
- Commands->Start_Conversation(id);
- break;
- }
- default:
- {
- break;
- }
- }
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Stationary_Vehicle,"Area_ID:int")
- {
- void Created (GameObject* obj)
- {
- int area_id;
- area_id = Get_Int_Parameter("Area_ID");
- // Area One is a conflict area, other stationary vehicles in conflict areas must be paused as well
- Commands->Enable_Enemy_Seen (obj, false);
- if (area_id == 99)
- {
- Commands->Innate_Disable (obj);
- Commands->Start_Timer (obj, this, 5.33f, 1);
- }
- }
- void Killed (GameObject * obj, GameObject * killer)
- {
- int area_id = Get_Int_Parameter ("Area_ID");
- int my_id = Commands->Get_ID (obj);
- if (area_id == 2)
- {
- if (my_id == 401016)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0008", 100, 300, true);
- Commands->Join_Conversation (NULL, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- else if (my_id == 401167)
- {
- GameObject * tank = Commands->Find_Object (401016);
- if (tank)
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0007", 100, 300, true);
- Commands->Join_Conversation (tank, id);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- }
- }
- }
- }
- void Enemy_Seen (GameObject * obj, GameObject * enemy)
- {
- int area_id;
- area_id = Get_Int_Parameter("Area_ID");
- if (area_id != 99)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- params.Set_Attack(enemy, 300.0f, 0.0f, true);
- params.AttackCheckBlocked = false;
- Commands->Action_Attack(obj, params);
- Commands->Start_Timer(obj, this, 5.0f, 2);
- }
- }
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- // If an objective shouts, respond to it, letting it know the area is not cleared.
- if (sound.Type == 1000)
- {
- if (sound.Creator)
- {
- int player_type = Commands->Get_Player_Type (obj);
- if (player_type == SCRIPT_PLAYERTYPE_NOD)
- {
- Commands->Send_Custom_Event(obj, sound.Creator, 100, 1);
- }
- }
- }
- }
- void Custom (GameObject *obj, int type, int param, GameObject *sender)
- {
- if ((type == 0) && (param == 0))
- {
- // A zone is trying to enable actions for this vehicle.
- Commands->Enable_Enemy_Seen (obj, true);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- Commands->Apply_Damage (obj, 10000.0f, "Blamokiller");
- }
- else if (timer_id == 2)
- {
- Commands->Action_Reset (obj, 100);
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Apache, "Area_ID:int")
- {
- int waypath_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( waypath_id, 1);
- }
- void Created (GameObject* obj)
- {
- int area_id = Get_Int_Parameter("Area_ID");
- float timer_len = 1.0f;
- //First waypath means area for looping Apaches, it is set when timer expires, and then uses real IDs.
-
- switch (area_id)
- {
- case (0):
- {
- waypath_id = 0;
- timer_len = 8.0f;
- break;
- }
- case (15):
- {
- waypath_id = 1;
- timer_len = 15.0f;
- break;
- }
- case (24):
- {
- waypath_id = 24;
- break;
- }
- }
- Commands->Enable_Engine(obj, true);
- Commands->Disable_Physical_Collisions(obj);
- Commands->Start_Timer(obj, this, timer_len, 1);
- Commands->Start_Timer(obj, this, 15.0f, 3);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- // Delayed initial action.
- switch (waypath_id)
- {
- case (0): // Area 0 Apache delay timer expired, start movement
- {
- waypath_id = 400296;
- break;
- }
- case (1): // Area 15 Apache delay timer expired, start movement.
- {
- waypath_id = 401169;
- break;
- }
- case (24):
- {
- waypath_id = 400544;
- break;
- }
- case (400296):
- {
- waypath_id = 400304;
- break;
- }
- case (400304):
- {
- waypath_id = 400310;
- break;
- }
- case (400310):
- {
- waypath_id = 400304;
- break;
- }
- case (400544):
- {
- waypath_id = -1;
- break;
- }
- case (401169):
- {
- waypath_id = 401173;
- break;
- }
- case (401173):
- {
- waypath_id = 401180;
- break;
- }
- case (401180):
- {
- waypath_id = 401173;
- break;
- }
- }
- if (waypath_id != -1)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- params.Set_Movement(Vector3(0,0,0), 0.2 + (0.1 * DIFFICULTY), 5.0f);
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- params.MovePathfind = false;
- params.Set_Attack(STAR, 200.0f, 0.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = false;
- Commands->Action_Attack(obj, params);
- }
- Commands->Start_Timer(obj, this, 5.0f, 2);
- }
- else if (timer_id == 2)
- {
- // Time to start firing, and move again in a second.
- Vector3 myloc = Commands->Get_Position(obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 0);
- params.Set_Movement(myloc, 0.0, 5.0f);
- params.MovePathfind = false;
- params.Set_Attack(STAR, 200.0f, 0.0f, true);
- params.AttackCheckBlocked = false;
- params.AttackActive = true;
- Commands->Action_Attack(obj, params);
- Commands->Start_Timer(obj, this, 5.0f, 1);
- }
- else if (timer_id == 3)
- {
- // Cleanup code - find the nearest star, check distance.
- float distance;
- Vector3 myloc;
- Vector3 starloc;
- myloc = Commands->Get_Position(obj);
- GameObject *star_obj = Commands->Get_A_Star(myloc);
- if (star_obj)
- {
- starloc = Commands->Get_Position(star_obj);
- distance = Commands->Get_Distance (myloc, starloc);
- if (distance > 300.0f)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 3);
- }
- }
- // If an objective shouts, respond to it, letting it know the area is not cleared.
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- if (sound.Type == 1000)
- {
- if (sound.Creator)
- {
- Commands->Send_Custom_Event(obj, sound.Creator, 100, 1);
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Vehicle, "Area_ID:int")
- {
- void Created (GameObject* obj)
- {
- Commands->Enable_Enemy_Seen (obj, true);
- Commands->Enable_Engine(obj, true);
- // Get my area id and determine what I need to to immediately.
- int area_id = Get_Int_Parameter("Area_ID");
- switch (area_id)
- {
- case (2):
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 98, 0);
- params.Set_Movement(Vector3(0,0,0), 1.0f, 5.0f);
- params.WaypathID = 400375;
- params.WaypathSplined = false;
- params.Set_Attack(STAR, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- break;
- }
- case (3):
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 98, 0);
- params.Set_Movement(Vector3(0,0,0), 1.0f, 5.0f);
- params.WaypathID = 400416;
- params.WaypathSplined = false;
- params.Set_Attack(STAR, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- break;
- }
- case (4):
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 98, 0);
- params.Set_Movement(Vector3(0,0,0), 1.0f, 5.0f);
- params.WaypathID = 400454;
- params.WaypathSplined = false;
- params.Set_Attack(STAR, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- break;
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 1);
- }
- // If an objective shouts, respond to it, letting it know the area is not cleared.
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- if (sound.Type == 1000)
- {
- if (sound.Creator)
- {
- Commands->Send_Custom_Event(obj, sound.Creator, 100, 1);
- }
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- // Cleanup code - find the nearest star, check distance, then check visibility
- float distance;
- Vector3 myloc;
- Vector3 starloc;
- myloc = Commands->Get_Position(obj);
- GameObject *star_obj = Commands->Get_A_Star(myloc);
- if (star_obj)
- {
- starloc = Commands->Get_Position(star_obj);
- distance = Commands->Get_Distance (myloc, starloc);
- if (distance > 300.0f)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 1);
- }
- }
- };
- DECLARE_SCRIPT (M02_Player_Vehicle, "Area_ID:int")
- {
- bool entered_me;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(entered_me, 1);
- }
- void Created (GameObject* obj)
- {
- entered_me = false;
- Commands->Enable_Vehicle_Transitions (obj, true);
- Commands->Set_Player_Type (obj, SCRIPT_PLAYERTYPE_NEUTRAL);
- Commands->Start_Timer(obj, this, 15.0f, 1);
- int unitid = Commands->Get_ID (obj);
- Send_Custom_To_SAM_Sites (obj, M00_CUSTOM_SAM_SITE_IGNORE, unitid);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- // Check if this vehicle needs to be removed.
- Vector3 myloc = Commands->Get_Position(obj);
- GameObject *star_obj = Commands->Get_A_Star(myloc);
- if (star_obj)
- {
- Vector3 starloc = Commands->Get_Position(star_obj);
- float distance = Commands->Get_Distance (myloc, starloc);
- if (distance > 300.0f)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 1);
- }
- }
- void Destroyed (GameObject* obj)
- {
- int area_id = Get_Int_Parameter ("Area_ID");
- GameObject* controller = Commands->Find_Object(M02_OBJCONTROLLER);
- if (controller)
- {
- Commands->Send_Custom_Event(obj, controller, 112, area_id);
- }
- if ((area_id == 2) && (!entered_me))
- {
- Commands->Send_Custom_Event(obj, controller, 221, 2);
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == CUSTOM_EVENT_VEHICLE_ENTERED)
- {
- int area_id = Get_Int_Parameter ("Area_ID");
- if ((area_id == 2) && (!entered_me))
- {
- entered_me = true;
- GameObject* controller = Commands->Find_Object(M02_OBJCONTROLLER);
- if (controller)
- {
- Commands->Send_Custom_Event(obj, controller, 221, 1);
- }
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Sakura, "Area_ID:int")
- {
- bool onmywayout;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(onmywayout, 1);
- }
- void Created (GameObject* obj)
- {
- onmywayout = false;
- int waypath_id = 400397;
- Commands->Enable_Enemy_Seen (obj, true);
- Commands->Enable_Engine(obj, true);
- Commands->Disable_Physical_Collisions(obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 91, 0);
- params.Set_Movement(Vector3(0,0,0), 2.5f, 1.0f);
- params.WaypathID = waypath_id;
- params.WaypathSplined = true;
- params.Set_Attack(STAR, 200.0f, 0.0f, true);
- Commands->Action_Goto(obj, params);
- Commands->Start_Timer(obj, this, 15.0f, 1);
- Commands->Start_Timer(obj, this, 10.0f, 3);
- }
- void Enemy_Seen (GameObject * obj, GameObject * enemy)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 92, 2);
- params.AttackCheckBlocked = false;
- params.Set_Attack(enemy, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- // Cleanup code - find the nearest star, check distance, then check visibility
- float distance;
- Vector3 myloc;
- Vector3 starloc;
- myloc = Commands->Get_Position(obj);
- GameObject *star_obj = Commands->Get_A_Star(myloc);
- if (star_obj)
- {
- starloc = Commands->Get_Position(star_obj);
- distance = Commands->Get_Distance (myloc, starloc);
- if (distance > 300.0f)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- Commands->Start_Timer(obj, this, 15.0f, 1);
- }
- else if (timer_id == 2)
- {
- Commands->Destroy_Object (obj);
- }
- else if (timer_id == 3)
- {
- Vector3 myloc = Commands->Get_Position(obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 93, 1);
- params.Set_Movement(myloc, 0.0, 5.0f);
- params.Set_Attack(STAR, 200.0f, 0.0f, true);
- params.AttackActive = true;
- Commands->Action_Attack(obj, params);
- }
- }
- // If an objective shouts, respond to it, letting it know the area is not cleared.
- void Sound_Heard (GameObject * obj, const CombatSound & sound)
- {
- if (sound.Type == 1000)
- {
- if (sound.Creator)
- {
- Commands->Send_Custom_Event(obj, sound.Creator, 100, 1);
- }
- }
- }
- };
- // This script handles approach vehicles.
- DECLARE_SCRIPT (M02_Approach_Vehicle, "Area_ID:int")
- {
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if ((type == 0) && (param == 0))
- {
- Commands->Enable_Engine (obj, true);
- // Unit is being activated. Determine waypath and follow it.
-
- int area_id = Get_Int_Parameter("Area_ID");
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 0);
- params.Set_Movement(Vector3(0,0,0), 1.0f, 1.0f);
- switch (area_id)
- {
- case (1):
- {
- params.WaypathID = 401009;
- break;
- }
- case (4):
- {
- params.WaypathID = 401031;
- break;
- }
- case (6):
- {
- params.WaypathID = 401039;
- break;
- }
- }
- Commands->Action_Goto(obj, params);
- Commands->Start_Timer(obj, this, 6.0f, 0);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- };
- // This script is currently only used for an Orca above a SAM Site objective, in A03.
- DECLARE_SCRIPT (M02_Destroy_Vehicle, "")
- {
- void Created (GameObject* obj)
- {
- Commands->Enable_Engine(obj, true);
- Commands->Disable_Physical_Collisions(obj);
- Commands->Start_Timer(obj, this, 4.0f, 1);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- if (timer_id == 1)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 0);
- params.Set_Movement(Vector3(0,0,0), 2.5f, 1.0f);
- params.WaypathID = 400993;
- params.WaypathSplined = true;
- Commands->Action_Goto(obj, params);
- Commands->Start_Timer(obj, this, 20.0f, 2);
- }
- else if (timer_id == 2)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- void Damaged (GameObject* obj, GameObject* damager, float amount)
- {
- if (damager != STAR)
- {
- Commands->Apply_Damage(obj, 10000.0f, "Blamokiller");
- }
- }
- void Enemy_Seen (GameObject * obj, GameObject * enemy)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 90, 1);
- params.Set_Attack(enemy, 200.0f, 0.0f, true);
- params.AttackActive = true;
- Commands->Action_Attack(obj, params);
- }
- };
- DECLARE_SCRIPT (M02_Mendoza, "")
- {
- bool calling_extraction;
- bool move_toggle;
- float start_health;
- float last_armor;
- int counter;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE (calling_extraction, 1);
- SAVE_VARIABLE (start_health, 2);
- SAVE_VARIABLE (last_armor, 3);
- SAVE_VARIABLE (counter, 4);
- SAVE_VARIABLE (move_toggle, 5);
- }
- void Created (GameObject * obj)
- {
- start_health = Commands->Get_Health (obj);
- last_armor = Commands->Get_Shield_Strength (obj);
- calling_extraction = false;
- move_toggle = false;
- counter = 0;
- Commands->Innate_Disable (obj);
- ActionParamsStruct params;
- params.Set_Basic (this, 98, 3);
- params.Set_Attack (STAR, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- Commands->Start_Timer (obj, this, 2.0f, 1);
- }
- void Damaged (GameObject * obj, GameObject * damager, float amount)
- {
- Commands->Set_Health (obj, start_health);
- last_armor -= 2.0f;
- Commands->Set_Shield_Strength (obj, last_armor);
- if (last_armor < 1.0f)
- {
- if (!calling_extraction)
- {
- calling_extraction = true;
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 1);
- params.Set_Movement(Vector3(1260.007f,535.460f,18.428f), RUN, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- }
- }
- void Action_Complete (GameObject * obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == 1)
- {
- Commands->Innate_Disable (obj);
- Vector3 my_location = Commands->Get_Position (obj);
- GameObject * chinook_obj1 = Commands->Create_Object("Invisible_Object", my_location);
- if (chinook_obj1)
- {
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "XG_ROPE_EVAC_F.txt");
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0025", 100, 300, true);
- Commands->Join_Conversation (obj, id, true, false, false);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Join_Conversation (NULL, id);
- Commands->Start_Conversation (id);
- }
- }
- else if (action_id == 2)
- {
- ActionParamsStruct params;
- params.Set_Basic (this, 98, 3);
- params.Set_Attack (STAR, 300.0f, 0.0f, true);
- Commands->Action_Attack(obj, params);
- }
- }
- void Timer_Expired (GameObject * obj, int timer_id)
- {
- if ((timer_id == 1) && (!calling_extraction))
- {
- int id = Commands->Create_Conversation ("MX2DSGN_DSGN0019", 100, 300, true);
- counter++;
- if (counter > 6)
- {
- counter = 1;
- }
- switch (counter)
- {
- case (1):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0019", 100, 300, true);
- break;
- }
- case (2):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0020", 100, 300, true);
- break;
- }
- case (3):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0021", 100, 300, true);
- break;
- }
- case (4):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0022", 100, 300, true);
- break;
- }
- case (5):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0023", 100, 300, true);
- break;
- }
- case (6):
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0024", 100, 300, true);
- break;
- }
- default:
- {
- id = Commands->Create_Conversation ("MX2DSGN_DSGN0024", 100, 300, true);
- break;
- }
- }
- Commands->Join_Conversation (obj, id, true, false, false);
- Commands->Join_Conversation (STAR, id, true, false, false);
- Commands->Start_Conversation (id);
- Commands->Start_Timer (obj, this, 7.0f, 1);
- if (!move_toggle)
- {
- move_toggle = true;
- Commands->Action_Reset (obj, 100);
- ActionParamsStruct params;
- params.Set_Basic(this, 99, 2);
- switch (Get_Int_Random (0,3))
- {
- case (0):
- {
- params.Set_Movement(Vector3(1248.592f,568.431f,17.396f), RUN, 5.0f);
- break;
- }
- case (1):
- {
- params.Set_Movement(Vector3(1264.680f,564.459f,17.816f), RUN, 5.0f);
- break;
- }
- case (2):
- {
- params.Set_Movement(Vector3(1270.220f,541.406f,17.978f), RUN, 5.0f);
- break;
- }
- case (3):
- {
- params.Set_Movement(Vector3(1251.213f,544.658f,17.854f), RUN, 5.0f);
- break;
- }
- default:
- {
- params.Set_Movement(Vector3(1260.007f,535.460f,18.428f), RUN, 5.0f);
- break;
- }
- }
- Commands->Action_Goto(obj, params);
- }
- else
- {
- move_toggle = false;
- }
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Jet, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Enable_Engine (obj, true);
- Commands->Disable_Physical_Collisions (obj);
- ActionParamsStruct params;
- params.MovePathfind = false;
- params.Set_Basic(this, 100, 1);
- params.Set_Movement(Vector3(1143.09f,702.08f,70.5f), 4.0f, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- void Action_Complete (GameObject * obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == 1)
- {
- Commands->Destroy_Object (obj);
- }
- }
- };
- DECLARE_SCRIPT (M02_Nod_Jet_Waypath, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Enable_Engine (obj, true);
- Commands->Disable_Physical_Collisions (obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 1);
- params.Set_Movement(Vector3(0,0,0), 4.0f, 5.0f);
- params.WaypathID = 403389;
- params.WaypathSplined = true;
- Commands->Action_Goto(obj, params);
- }
- void Action_Complete (GameObject * obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == 1)
- {
- Commands->Destroy_Object (obj);
- }
- }
- };
- DECLARE_SCRIPT (M02_GDI_Helicopter, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Enable_Engine (obj, true);
- Commands->Disable_Physical_Collisions (obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 1);
- params.Set_Movement(Vector3(-246.87f,17.42f,100.75f), 1.0f, 5.0f);
- Commands->Action_Goto(obj, params);
- }
- void Action_Complete (GameObject * obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == 1)
- {
- Commands->Destroy_Object (obj);
- }
- }
- };
- DECLARE_SCRIPT (M02_Commando_Start, "")
- {
- void Created (GameObject * obj)
- {
- Commands->Give_PowerUp (obj, "POW_MineRemote_Player", false);
- Commands->Give_PowerUp (obj, "POW_Chaingun_Player", false);
- Commands->Give_PowerUp (obj, "POW_SniperRifle_Player", false);
- }
- };
- DECLARE_SCRIPT (M02_Data_Disk, "Disk_ID:int")
- {
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == CUSTOM_EVENT_POWERUP_GRANTED)
- {
- int id = Get_Int_Parameter ("Disk_ID");
- Vector3 reveal_loc = Vector3 (0,0,0);
- int radius = 15;
- switch (id)
- {
- case (1): // Disk Reveals the Ski Resort
- {
- reveal_loc = Vector3(425.76f,840.78f,8.19f);
- radius = 15;
- break;
- }
- case (2): // Disk Reveals the Dam Area
- {
- reveal_loc = Vector3(1016.43f,885.96f,35.41f);
- radius = 30;
- break;
- }
- default: // Disk Reveals the Hand of Nod
- {
- reveal_loc = Vector3(1204.46f,565.35f,37.84f);
- radius = 15;
- break;
- }
- }
- Commands->Clear_Map_Region_By_Pos (reveal_loc, radius);
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- }
- }
- };
- DECLARE_SCRIPT (M02_Encyclopedia_Reveal, "Disk_ID:int")
- {
- void Custom (GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == CUSTOM_EVENT_POWERUP_GRANTED)
- {
- int id = Get_Int_Parameter ("Disk_ID");
- switch (id)
- {
- case (1):
- {
- Commands->Reveal_Encyclopedia_Vehicle (5);
- break;
- }
- default:
- {
- Commands->Reveal_Encyclopedia_Building (15);
- break;
- }
- }
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0104I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- }
- }
- };
|