Mission11.cpp 343 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /******************************************************************************
  19. *
  20. * FILE
  21. * Mission11.cpp
  22. *
  23. * DESCRIPTION
  24. * Mission 11 scripts
  25. *
  26. * PROGRAMMER
  27. * Design Team
  28. *
  29. * VERSION INFO
  30. * $Author: Joe_g $
  31. * $Revision: 108 $
  32. * $Modtime: 2/19/02 12:09p $
  33. * $Archive: /Commando/Code/Scripts/Mission11.cpp $
  34. *
  35. ******************************************************************************/
  36. #include "scripts.h"
  37. #include <string.h>
  38. #include "toolkit.h"
  39. #include "mission1.h"
  40. #include "mission11.h"
  41. /***********************************************************************************************************************
  42. Putting level specific character scripts here...sydney, petrova, havoc, etc...
  43. ************************************************************************************************************************/
  44. DECLARE_SCRIPT(M11_VoltRifleGuy_Script_JDG, "")
  45. {
  46. bool player_has_volt_rifle;
  47. REGISTER_VARIABLES()
  48. {
  49. SAVE_VARIABLE( player_has_volt_rifle, 1 );
  50. }
  51. void Created( GameObject * obj )
  52. {
  53. player_has_volt_rifle = false;
  54. GameObject * voltPowerupMonitor = Commands->Find_Object ( 101883 );
  55. if (voltPowerupMonitor != NULL)
  56. {
  57. Commands->Send_Custom_Event ( obj, voltPowerupMonitor, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );//checking if player has volt rifle
  58. }
  59. }
  60. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  61. {
  62. if (type == 0)
  63. {
  64. if (param == M01_START_ACTING_JDG)//player has volt rifle--allow powerup drop
  65. {
  66. player_has_volt_rifle = true;
  67. }
  68. }
  69. }
  70. void Killed( GameObject * obj, GameObject * killer )
  71. {
  72. if (player_has_volt_rifle == true)
  73. {
  74. Vector3 myPosition = Commands->Get_Position ( obj );
  75. myPosition.Z += 0.75;
  76. Commands->Create_Object ( "POW_VoltAutoRifle_Player", myPosition );
  77. }
  78. }
  79. };
  80. DECLARE_SCRIPT(M11_VoltRifle_Monitor_Script_JDG, "")
  81. {
  82. bool player_has_volt_rifle;
  83. REGISTER_VARIABLES()
  84. {
  85. SAVE_VARIABLE( player_has_volt_rifle, 1 );
  86. }
  87. void Created( GameObject * obj )
  88. {
  89. Commands->Enable_Hibernation( obj, false );
  90. player_has_volt_rifle = false;
  91. }
  92. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  93. {
  94. if (type == 0)
  95. {
  96. if (param == M01_START_ACTING_JDG)//player has picked up volt rifle
  97. {
  98. player_has_volt_rifle = true;
  99. }
  100. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//volt guy is checking on rifle status
  101. {
  102. if (player_has_volt_rifle == true)
  103. {
  104. Commands->Send_Custom_Event ( obj, sender, 0, M01_START_ACTING_JDG, 0 );
  105. }
  106. else
  107. {
  108. }
  109. }
  110. }
  111. }
  112. };
  113. DECLARE_SCRIPT(M11_VoltRifle_Script_JDG, "")
  114. {
  115. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  116. {
  117. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  118. {
  119. Vector3 spawn_location01 (-2.44f, 6.189f, -38.536f);//these are in the barracks
  120. Vector3 spawn_location02 (-4.079f, 6.207f, -38.536f);
  121. Vector3 spawn_location03 (-5.857f, 6.199f, -38.536f);
  122. Vector3 spawn_location04 (-25.948f, 10.923f, -29.670f);//these are in seth's room
  123. Vector3 spawn_location05 (-24.676f, 13.208f, -29.855f);
  124. Vector3 spawn_location06 (-22.492f, 14.631f, -29.855f);
  125. Vector3 spawn_location07 (-19.753f, 14.540f, -29.855f);
  126. Vector3 spawn_location08 (-17.378f, 13.195f, -29.855f);
  127. Vector3 spawn_location09 (-17.567f, 11.051f, -29.658f);
  128. Vector3 spawn_location10 (20.696f, 1.720f, -29.855f);
  129. Vector3 spawn_location11 (20.648f, -0.227f, -29.855f);
  130. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location01 );
  131. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location02 );
  132. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location03 );
  133. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location04 );
  134. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location05 );
  135. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location06 );
  136. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location07 );
  137. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location08 );
  138. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location09 );
  139. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location10 );
  140. Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location11 );
  141. GameObject * voltPowerupMonitor = Commands->Find_Object ( 101883 );
  142. if (voltPowerupMonitor != NULL)
  143. {
  144. Commands->Send_Custom_Event ( obj, voltPowerupMonitor, 0, M01_START_ACTING_JDG, 0 );
  145. }
  146. }
  147. }
  148. };
  149. DECLARE_SCRIPT(M11_KeyCard_01_Carrier_JDG, "")
  150. {
  151. void Created( GameObject * obj )
  152. {
  153. Commands->Set_Innate_Is_Stationary ( obj, true );
  154. Commands->Send_Custom_Event ( obj, obj, M00_CUSTOM_POWERUP_GRANT_DISABLE, 0, 0 );
  155. }
  156. void Killed( GameObject * obj, GameObject * killer )
  157. {
  158. Vector3 spawn_location = Commands->Get_Position (obj);
  159. spawn_location.Z = spawn_location.Z + 0.75f;
  160. GameObject * powerup = Commands->Create_Object ( "POW_VoltAutoRifle_Player", spawn_location );
  161. Commands->Attach_Script(powerup, "M11_VoltRifle_Script_JDG", "");
  162. }
  163. };
  164. /***********************************************************************************************************************
  165. Putting MISSION CONTROLLER here
  166. ************************************************************************************************************************/
  167. DECLARE_SCRIPT(M11_Mission_Controller_JDG, "")
  168. {
  169. int evaPingedSydneyConv;
  170. int missionIntroConv02;
  171. int missionIntroConv;
  172. int evaNukeConv;
  173. bool player_has_reached_musuem;
  174. REGISTER_VARIABLES()
  175. {
  176. SAVE_VARIABLE( evaPingedSydneyConv, 1 );
  177. SAVE_VARIABLE( missionIntroConv02, 2 );
  178. SAVE_VARIABLE( missionIntroConv, 3 );
  179. SAVE_VARIABLE( evaNukeConv, 4 );
  180. SAVE_VARIABLE( player_has_reached_musuem, 5 );
  181. }
  182. void Created( GameObject * obj )
  183. {
  184. player_has_reached_musuem = false;
  185. Commands->Show_Player_Map_Marker ( false );
  186. Commands->Reveal_Map ( );
  187. Commands->Enable_Hibernation( obj, false );
  188. Commands->Send_Custom_Event ( obj, obj, 0, M11_ATTACH_HAVOCS_SCRIPT_JDG, 0 );
  189. }
  190. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  191. {
  192. switch (complete_reason)
  193. {
  194. case ACTION_COMPLETE_CONVERSATION_ENDED:
  195. {
  196. if (action_id == missionIntroConv) //introduce rescue sydney objective here
  197. {
  198. Commands->Send_Custom_Event( obj, obj, 0, M11_ADD_SECOND_OBJECTIVE_JDG, 0 );
  199. Commands->Send_Custom_Event( obj, obj, 0, M11_PLAY_SECOND_INTRO_CONVERSATION_JDG, 3 );
  200. }
  201. else if (action_id == missionIntroConv02) //introduce rescue sydney objective here
  202. {
  203. Commands->Send_Custom_Event( obj, obj, 0, M11_ADD_FIRST_OBJECTIVE_JDG, 0 );
  204. }
  205. else if (action_id == evaPingedSydneyConv)
  206. {
  207. Commands->Send_Custom_Event( obj, obj, 0, M11_ADD_SECOND_OBJECTIVE_POG_JDG, 0 );
  208. }
  209. else if (action_id == evaNukeConv)
  210. {
  211. Commands->Add_Objective( M11_FIFTH_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_05, NULL, IDS_Enc_Obj_Primary_M11_05 );
  212. GameObject * nukeSwitch = Commands->Find_Object ( M11_END_MISSION_SWITCH_JDG );
  213. if (nukeSwitch != NULL)
  214. {
  215. Commands->Set_Objective_Radar_Blip_Object( M11_FIFTH_OBJECTIVE_JDG, nukeSwitch );
  216. Commands->Set_Objective_HUD_Info( M11_FIFTH_OBJECTIVE_JDG, 94, "POG_M11_1_04.tga", IDS_POG_SABOTAGE );
  217. }
  218. else
  219. {
  220. Commands->Debug_Message ( "***************************M11 mission controller cannot find sydnee to ping her on radar--add forth objective\n" );
  221. }
  222. }
  223. }
  224. break;
  225. }
  226. }
  227. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  228. {
  229. if (type == CUSTOM_EVENT_SOUND_ENDED )
  230. {
  231. }
  232. else if (type == 0)
  233. {
  234. switch (param)
  235. {
  236. case M11_ATTACH_HAVOCS_SCRIPT_JDG:
  237. {
  238. if (STAR)
  239. {
  240. //Commands->Attach_Script(STAR, "M11_Havocs_Script_JDG", "");
  241. missionIntroConv = Commands->Create_Conversation( "M11_Level_Intro_Conversation", 100, 1000, false);
  242. Commands->Join_Conversation( NULL, missionIntroConv, false, false );
  243. Commands->Join_Conversation( STAR, missionIntroConv, false, false );
  244. //Commands->Join_Conversation( NULL, missionIntroConv, false, false );
  245. Commands->Start_Conversation( missionIntroConv, missionIntroConv );
  246. Commands->Monitor_Conversation (obj, missionIntroConv);
  247. }
  248. else
  249. {
  250. Commands->Send_Custom_Event( obj, obj, 0, M11_ATTACH_HAVOCS_SCRIPT_JDG, 1 );
  251. }
  252. }
  253. break;
  254. case M11_PLAY_SECOND_INTRO_CONVERSATION_JDG: //play locke-havoc-cabal conv
  255. {
  256. if (STAR)
  257. {
  258. missionIntroConv02 = Commands->Create_Conversation( "M11_Level_Intro_Conversation02", 100, 1000, false);
  259. Commands->Join_Conversation( NULL, missionIntroConv02, false, false );
  260. Commands->Join_Conversation( NULL, missionIntroConv02, false, false );
  261. //Commands->Join_Conversation( STAR, missionIntroConv02, false, false );
  262. Commands->Start_Conversation( missionIntroConv02, missionIntroConv02 );
  263. Commands->Monitor_Conversation (obj, missionIntroConv02);
  264. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_FLOOR01_SECURITY_CONTROLLER_JDG), 0, M01_START_ACTING_JDG, 5 );
  265. }
  266. }
  267. break;
  268. case M11_END_MISSION_PASS_JDG: //end mission when all objectives have been met
  269. {
  270. Commands->Mission_Complete ( true );
  271. }
  272. break;
  273. case M11_END_MISSION_FAIL_JDG: //end mission when critical objective failed
  274. {
  275. Commands->Mission_Complete ( false );
  276. }
  277. break;
  278. case M11_ADD_FIRST_OBJECTIVE_JDG: //player's first objective is to get into lower levels
  279. {
  280. if (player_has_reached_musuem == false)
  281. {
  282. Commands->Add_Objective( M11_FIRST_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_02, NULL, IDS_Enc_Obj_Primary_M11_02 );
  283. Vector3 musemLocation (2.072f, 16.705f, -24.531f);
  284. Commands->Set_Objective_HUD_Info_Position( M11_FIRST_OBJECTIVE_JDG, 91, "POG_M11_1_02.tga", IDS_POG_INFILTRATE, musemLocation );
  285. }
  286. }
  287. break;
  288. case M11_END_FIRST_OBJECTIVE_JDG: //player has reached museum area--clear first objective
  289. {
  290. player_has_reached_musuem = true;
  291. Commands->Set_Objective_Status( M11_FIRST_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  292. //Commands->Send_Custom_Event ( obj, obj, 0, M11_ADD_SECOND_OBJECTIVE_JDG, 5 );
  293. evaPingedSydneyConv = Commands->Create_Conversation( "M11_EVA_SydneyPinged_Conversation", 100, 1000, false);
  294. Commands->Join_Conversation( NULL, evaPingedSydneyConv, false, false );;
  295. Commands->Start_Conversation( evaPingedSydneyConv, evaPingedSydneyConv );
  296. Commands->Monitor_Conversation (obj, evaPingedSydneyConv);
  297. }
  298. break;//
  299. case M11_ADD_SECOND_OBJECTIVE_JDG: //player's second objective is to locate sydney mobius
  300. {
  301. Vector3 sydenysLocation (0.000f, 96.000f, -34.250f);
  302. //Commands->Add_Objective( M11_SECOND_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_01 );
  303. Commands->Add_Objective( M11_SECOND_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_01, NULL, IDS_Enc_Obj_Primary_M11_01 );
  304. Commands->Set_Objective_HUD_Info_Position( M11_SECOND_OBJECTIVE_JDG, -1, "POG_M11_1_01.tga", IDS_POG_RESCUE, sydenysLocation );
  305. }
  306. break;
  307. case M11_ADD_SECOND_OBJECTIVE_POG_JDG: //player's second objective is to locate sydney mobius
  308. {
  309. GameObject * sydney = Commands->Find_Object ( M11_SIMPLE_SYDNEY_MOBIUS_JDG );
  310. if (sydney != NULL)
  311. {
  312. Vector3 sydenysLocation (0.000f, 96.000f, -34.250f);
  313. //Commands->Set_Objective_Radar_Blip_Object( M11_SECOND_OBJECTIVE_JDG, sydney );
  314. Commands->Set_Objective_HUD_Info_Position( M11_SECOND_OBJECTIVE_JDG, 90, "POG_M11_1_01.tga", IDS_POG_RESCUE, sydenysLocation );
  315. }
  316. else
  317. {
  318. Commands->Debug_Message ( "***************************M11 mission controller cannot find sydnee to ping her on radar--add second objective\n" );
  319. }
  320. }
  321. break;
  322. case M11_END_SECOND_OBJECTIVE_JDG: //player has reached Sydney's cell area--clear 2nd objective
  323. {
  324. Commands->Set_Objective_Status( M11_SECOND_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  325. Commands->Send_Custom_Event( obj, obj, 0, M11_ADD_FORTH_OBJECTIVE_JDG, 5 );
  326. //nukeIntroConv = Commands->Create_Conversation( "M11_EVA_Activate_Nuke_Conversation", 100, 1000, false);
  327. //Commands->Join_Conversation( NULL, nukeIntroConv, false, false );
  328. //Commands->Start_Conversation( nukeIntroConv, nukeIntroConv );
  329. //Commands->Monitor_Conversation (obj, nukeIntroConv);
  330. }
  331. break;
  332. case M11_ADD_THIRD_OBJECTIVE_JDG: //player's third objective is to acess the power core
  333. {
  334. Commands->Add_Objective( M11_THIRD_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_03, NULL, IDS_Enc_Obj_Primary_M11_03 );
  335. GameObject * entryZone = Commands->Find_Object ( 100688 );
  336. if (entryZone != NULL)
  337. {
  338. Vector3 pogLocation = Commands->Get_Position ( entryZone );
  339. Commands->Set_Objective_Radar_Blip_Object( M11_THIRD_OBJECTIVE_JDG, entryZone );
  340. Commands->Set_Objective_HUD_Info_Position( M11_THIRD_OBJECTIVE_JDG, 91, "POG_M11_1_03.tga", IDS_POG_INFILTRATE, pogLocation );
  341. }
  342. }
  343. break;
  344. case M11_END_THIRD_OBJECTIVE_JDG: //player has reached power core--clear 3rd objective
  345. {
  346. Commands->Set_Objective_Status( M11_THIRD_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  347. GameObject * entryZone = Commands->Find_Object ( 100012 );
  348. if (entryZone != NULL)
  349. {
  350. Commands->Destroy_Object ( entryZone );//cleaning up this zone
  351. }
  352. }
  353. break;
  354. case M11_ADD_FORTH_OBJECTIVE_JDG: //player's forth objective is to PROTECT SYDNEY
  355. {
  356. Commands->Add_Objective( M11_FORTH_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M11_04, NULL, IDS_Enc_Obj_Primary_M11_04 );
  357. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  358. if (sydney != NULL)
  359. {
  360. Commands->Set_Objective_Radar_Blip_Object( M11_FORTH_OBJECTIVE_JDG, sydney );
  361. Commands->Set_Objective_HUD_Info( M11_FORTH_OBJECTIVE_JDG, 93, "POG_M07_1_04.tga", IDS_POG_PROTECT );
  362. }
  363. else
  364. {
  365. Commands->Debug_Message ( "***************************M11 mission controller cannot find sydnee to ping her on radar--add forth objective\n" );
  366. }
  367. }
  368. break;
  369. case M11_END_FORTH_OBJECTIVE_JDG: //nuke switch has been poked--end protect sydney objective then end sabotage
  370. {
  371. Commands->Set_Objective_Status( M11_FORTH_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  372. Commands->Send_Custom_Event( obj, obj, 0, M11_END_FIFTH_OBJECTIVE_JDG, 3 );
  373. }
  374. break;
  375. case M11_ADD_FIFTH_OBJECTIVE_JDG: //player's fifth objective is to sabotage the nuclear missle
  376. {
  377. evaNukeConv = Commands->Create_Conversation( "M11_EVA_Activate_Nuke_Conversation", 100, 1000, false);
  378. Commands->Join_Conversation( NULL, evaNukeConv, false, false );;
  379. Commands->Start_Conversation( evaNukeConv, evaNukeConv );
  380. Commands->Monitor_Conversation (obj, evaNukeConv);
  381. }
  382. break;
  383. case M11_END_FIFTH_OBJECTIVE_JDG: //nuke switch has been poked--end protect sydney objective then end sabotage
  384. {
  385. Commands->Set_Objective_Status( M11_FIFTH_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
  386. Commands->Send_Custom_Event( obj, obj, 0, M11_END_MISSION_PASS_JDG, 3 );
  387. }
  388. break;
  389. }
  390. }
  391. }
  392. };
  393. /***********************************************************************************************************************
  394. Putting scripts dealing with level 01 security turrets here
  395. ************************************************************************************************************************/
  396. DECLARE_SCRIPT(M11_Floor01_SecurityTurrets_Controller_JDG, "")
  397. {
  398. int deadTurrets;
  399. bool powerupsGranted;
  400. REGISTER_VARIABLES()
  401. {
  402. SAVE_VARIABLE( deadTurrets, 1 );
  403. SAVE_VARIABLE( powerupsGranted, 2 );
  404. }
  405. void Created( GameObject * obj )
  406. {
  407. powerupsGranted = false;
  408. deadTurrets = 0;
  409. }
  410. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  411. {
  412. if (param == M01_START_ACTING_JDG)
  413. {
  414. //Commands->Create_Sound ( "M11_Cabal_InsectDetected", Vector3(0,0,0), obj );
  415. GameObject * turret01 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_01_JDG);
  416. GameObject * turret03 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_03_JDG);
  417. GameObject * turret05 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_05_JDG);
  418. GameObject * turret08 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_08_JDG);
  419. GameObject * turret10 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_10_JDG);
  420. GameObject * turret12 = Commands->Find_Object (M11_FLOOR01_SECURITY_TURRET_12_JDG);
  421. if (turret01 != NULL)
  422. {
  423. float delayTimer = Commands->Get_Random ( 2, 5 );
  424. Commands->Send_Custom_Event( obj, turret01, 0, M01_START_ACTING_JDG, delayTimer );
  425. }
  426. if (turret03 != NULL)
  427. {
  428. float delayTimer = Commands->Get_Random ( 2, 5 );
  429. Commands->Send_Custom_Event( obj, turret03, 0, M01_START_ACTING_JDG, delayTimer );
  430. }
  431. if (turret05 != NULL)
  432. {
  433. float delayTimer = Commands->Get_Random ( 2, 5 );
  434. Commands->Send_Custom_Event( obj, turret05, 0, M01_START_ACTING_JDG, delayTimer );
  435. }
  436. if (turret08 != NULL)
  437. {
  438. float delayTimer = Commands->Get_Random ( 2, 5 );
  439. Commands->Send_Custom_Event( obj, turret08, 0, M01_START_ACTING_JDG, delayTimer );
  440. }
  441. if (turret10 != NULL)
  442. {
  443. float delayTimer = Commands->Get_Random ( 2, 5 );
  444. Commands->Send_Custom_Event( obj, turret10, 0, M01_START_ACTING_JDG, delayTimer );
  445. }
  446. if (turret12 != NULL)
  447. {
  448. float delayTimer = Commands->Get_Random ( 2, 5 );
  449. Commands->Send_Custom_Event( obj, turret12, 0, M01_START_ACTING_JDG, delayTimer );
  450. }
  451. }
  452. else if (param == M01_YOUR_OPERATOR_IS_DEAD_JDG)//this is custom recieved when a turret gets destroyed
  453. {
  454. deadTurrets++;
  455. if (deadTurrets >= 6)
  456. {
  457. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  458. }
  459. }
  460. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG && powerupsGranted == false)
  461. {
  462. powerupsGranted = true;
  463. Vector3 health100_spawnLocation (0.812f, 17.135f, 0.67f);
  464. Vector3 armor100_spawnLocation (-0.743f, 17.130f, 0.67f);
  465. Commands->Create_Object ( "POW_Health_100", health100_spawnLocation );
  466. Commands->Create_Object ( "POW_Armor_100", armor100_spawnLocation );
  467. }
  468. }
  469. };
  470. DECLARE_SCRIPT(M11_Floor01_SecurityTurret_JDG, "")
  471. {
  472. bool active;
  473. int alarmSound;
  474. REGISTER_VARIABLES()
  475. {
  476. SAVE_VARIABLE( alarmSound, 1 );
  477. SAVE_VARIABLE( active, 2 );
  478. }
  479. void Created( GameObject * obj )
  480. {
  481. active = false;
  482. Vector3 myPosition = Commands->Get_Position ( obj );
  483. alarmSound = Commands->Create_Sound ( "SFX.Klaxon_Alert_01", myPosition, obj );
  484. Commands->Stop_Sound ( alarmSound, false );
  485. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_IDLE_JDG, 1 );
  486. }
  487. void Killed( GameObject * obj, GameObject * killer )
  488. {
  489. if (active == true)
  490. {
  491. Commands->Stop_Sound ( alarmSound, true );
  492. Vector3 powerupSpawnLocation;
  493. Vector3 turret01_spawnLocation (19.065f, 22.042f, 0.67f);
  494. Vector3 turret03_spawnLocation (19, -3.620f, 0.67f);
  495. Vector3 turret05_spawnLocation (18.901f, -29.477f, 0.67f);
  496. Vector3 turret08_spawnLocation (-18.315f, -29.750f, 0.67f);
  497. Vector3 turret10_spawnLocation (-18.295f, -3.482f, 0.67f);
  498. Vector3 turret12_spawnLocation (-18.031f, 22.403f, 0.67f);
  499. int myID = Commands->Get_ID ( obj );
  500. if (myID == M11_FLOOR01_SECURITY_TURRET_01_JDG)
  501. {
  502. powerupSpawnLocation = turret01_spawnLocation;
  503. }
  504. else if (myID == M11_FLOOR01_SECURITY_TURRET_03_JDG)
  505. {
  506. powerupSpawnLocation = turret03_spawnLocation;
  507. }
  508. else if (myID == M11_FLOOR01_SECURITY_TURRET_05_JDG)
  509. {
  510. powerupSpawnLocation = turret05_spawnLocation;
  511. }
  512. else if (myID == M11_FLOOR01_SECURITY_TURRET_08_JDG)
  513. {
  514. powerupSpawnLocation = turret08_spawnLocation;
  515. }
  516. else if (myID == M11_FLOOR01_SECURITY_TURRET_10_JDG)
  517. {
  518. powerupSpawnLocation = turret10_spawnLocation;
  519. }
  520. else if (myID == M11_FLOOR01_SECURITY_TURRET_12_JDG)
  521. {
  522. powerupSpawnLocation = turret12_spawnLocation;
  523. }
  524. char *powerups[9] =
  525. {
  526. //this is a list of potential powerups to be dropped by destroyed security turrets
  527. "POW_Health_100",
  528. "POW_Armor_100",
  529. "POW_RocketLauncher_Player",
  530. "POW_SniperRifle_Player",
  531. "POW_TiberiumFlechetteGun_Player",
  532. "POW_LaserChaingun_Player",
  533. "POW_GrenadeLauncher_Player",
  534. "POW_LaserRifle_Player",
  535. "POW_TiberiumAutoRifle_Player",
  536. //more to be added later
  537. };
  538. int random = Commands->Get_Random_Int(0, 9);
  539. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  540. }
  541. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_FLOOR01_SECURITY_CONTROLLER_JDG), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
  542. }
  543. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  544. {
  545. ActionParamsStruct params;
  546. if (param == M01_START_ACTING_JDG)
  547. {
  548. //int myID = Commands->Get_ID ( obj );
  549. /*if (obj && myID == M11_FLOOR01_SECURITY_TURRET_01_JDG || myID == M11_FLOOR01_SECURITY_TURRET_10_JDG)
  550. {
  551. Vector3 myTarget = Commands->Get_Position ( obj );
  552. myTarget.X += Commands->Get_Random ( -5, 5 );
  553. myTarget.Y += Commands->Get_Random ( -5, 5 );
  554. myTarget.Z += Commands->Get_Random ( -5, 0 );
  555. params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
  556. params.Set_Attack( myTarget, 100, 0, true );
  557. params.AttackCheckBlocked = false;
  558. Commands->Action_Attack( obj, params );
  559. float delayTimer = Commands->Get_Random ( 3, 5 );
  560. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  561. }
  562. else */if (obj)
  563. {
  564. float myAccuracy = Commands->Get_Random ( 0, 1 );
  565. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  566. params.Set_Attack( STAR, 100, myAccuracy, true );
  567. Commands->Action_Attack( obj, params );
  568. }
  569. Commands->Start_Sound ( alarmSound );
  570. active = true;
  571. }
  572. else if (obj && param == M01_YOUR_OPERATOR_IS_DEAD_JDG)
  573. {
  574. active = false;
  575. Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  576. }
  577. else if (obj && param == M01_MODIFY_YOUR_ACTION_JDG)
  578. {
  579. Vector3 myTarget = Commands->Get_Position ( obj );
  580. myTarget.X += Commands->Get_Random ( -5, 5 );
  581. myTarget.Y += Commands->Get_Random ( -5, 5 );
  582. myTarget.Z += Commands->Get_Random ( -5, 0 );
  583. params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
  584. params.Set_Attack( myTarget, 100, 0, true );
  585. params.AttackCheckBlocked = false;
  586. Commands->Action_Attack( obj, params );
  587. float delayTimer = Commands->Get_Random ( 1, 2 );
  588. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  589. }
  590. }
  591. };
  592. /***********************************************************************************************************************
  593. Putting remaining scripts dealing with first few minutes of mision here--including C130 drop off stuff
  594. ************************************************************************************************************************/
  595. DECLARE_SCRIPT(M11_FirstFloor_Stuff_Controller_JDG, "")//M11_FIRSTFLOOR_STUFF_CONTROLLER_JDG 100593
  596. {
  597. typedef enum {
  598. FIRST_FLOOR,
  599. SECOND_FLOOR
  600. } M11_Location;
  601. M11_Location playersPosition;
  602. REGISTER_VARIABLES()
  603. {
  604. SAVE_VARIABLE( playersPosition, 1 );
  605. }
  606. void Created( GameObject * obj )
  607. {
  608. Commands->Enable_Hibernation( obj, false );
  609. playersPosition = FIRST_FLOOR;
  610. }
  611. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  612. {
  613. if (param == M01_GOTO_IDLE_JDG)
  614. {
  615. if (playersPosition == FIRST_FLOOR)
  616. {
  617. playersPosition = SECOND_FLOOR;
  618. Commands->Send_Custom_Event( obj, Commands->Find_Object (100569), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  619. Commands->Send_Custom_Event( obj, Commands->Find_Object (100570), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  620. Commands->Send_Custom_Event( obj, Commands->Find_Object (100571), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  621. Commands->Send_Custom_Event( obj, Commands->Find_Object (100572), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  622. Commands->Send_Custom_Event( obj, Commands->Find_Object (100573), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  623. Commands->Send_Custom_Event( obj, Commands->Find_Object (100574), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  624. Commands->Send_Custom_Event( obj, Commands->Find_Object (100575), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  625. Commands->Send_Custom_Event( obj, Commands->Find_Object (100576), 0, M01_GOTO_IDLE_JDG, 0 );//sound controller
  626. Commands->Send_Custom_Event( obj, Commands->Find_Object (100568), 0, M01_GOTO_IDLE_JDG, 0 );//artillery controller
  627. Commands->Send_Custom_Event( obj, Commands->Find_Object (100633), 0, M01_GOTO_IDLE_JDG, 0 );//ion cannon controller
  628. Commands->Send_Custom_Event( obj, Commands->Find_Object (101805), 0, M01_GOTO_IDLE_JDG, 0 );//obelisk explosion controller
  629. }
  630. }
  631. else if (param == M01_START_ACTING_JDG)
  632. {
  633. if (playersPosition == SECOND_FLOOR)
  634. {
  635. playersPosition = FIRST_FLOOR;
  636. Commands->Send_Custom_Event( obj, Commands->Find_Object (100569), 0, M01_START_ACTING_JDG, 0 );//sound controller
  637. Commands->Send_Custom_Event( obj, Commands->Find_Object (100570), 0, M01_START_ACTING_JDG, 0 );//sound controller
  638. Commands->Send_Custom_Event( obj, Commands->Find_Object (100571), 0, M01_START_ACTING_JDG, 0 );//sound controller
  639. Commands->Send_Custom_Event( obj, Commands->Find_Object (100572), 0, M01_START_ACTING_JDG, 0 );//sound controller
  640. Commands->Send_Custom_Event( obj, Commands->Find_Object (100573), 0, M01_START_ACTING_JDG, 0 );//sound controller
  641. Commands->Send_Custom_Event( obj, Commands->Find_Object (100574), 0, M01_START_ACTING_JDG, 0 );//sound controller
  642. Commands->Send_Custom_Event( obj, Commands->Find_Object (100575), 0, M01_START_ACTING_JDG, 0 );//sound controller
  643. Commands->Send_Custom_Event( obj, Commands->Find_Object (100576), 0, M01_START_ACTING_JDG, 0 );//sound controller
  644. Commands->Send_Custom_Event( obj, Commands->Find_Object (100568), 0, M01_START_ACTING_JDG, 0 );//artillery controller
  645. Commands->Send_Custom_Event( obj, Commands->Find_Object (100633), 0, M01_START_ACTING_JDG, 0 );//ion cannon controller
  646. Commands->Send_Custom_Event( obj, Commands->Find_Object (101805), 0, M01_START_ACTING_JDG, 0 );//obelisk explosion controller
  647. }
  648. }
  649. }
  650. };
  651. DECLARE_SCRIPT(M11_Turn_Off_FirstFloor_Stuff_JDG, "")
  652. {
  653. void Entered( GameObject * obj, GameObject * enterer )
  654. {
  655. if (enterer == STAR)
  656. {
  657. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_FIRSTFLOOR_STUFF_CONTROLLER_JDG), 0, M01_GOTO_IDLE_JDG, 0 );
  658. }
  659. }
  660. };
  661. DECLARE_SCRIPT(M11_Turn_On_FirstFloor_Stuff_JDG, "")
  662. {
  663. void Entered( GameObject * obj, GameObject * enterer )
  664. {
  665. if (enterer == STAR)
  666. {
  667. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_FIRSTFLOOR_STUFF_CONTROLLER_JDG), 0, M01_START_ACTING_JDG, 0 );
  668. }
  669. }
  670. };
  671. Vector3 ionCannonlocations[10] = {
  672. Vector3 (35.916f, -74.797f, -0.115f),
  673. Vector3 (30.173f, -108.692f, 9.706f),
  674. Vector3 (16.727f, -88.545f, 1.839f),
  675. Vector3 (9.679f, -97.887f, 4.033f),
  676. Vector3 (2.377f, -74.329f, -0.097f),
  677. Vector3 (3.579f, -108.123f, 9.657f),
  678. Vector3 (-6.437f, -107.906f, 9.731f),
  679. Vector3 (-17.015f, -91.3109f, 3.493f),
  680. Vector3 (-31.627f, -87.764f, 6.168f),
  681. Vector3 (-22.152f, -73.552f, -0.079f),
  682. };
  683. DECLARE_SCRIPT(M11_ExternalIonCannon_Controller_JDG, "")//this guys id is 100633
  684. {
  685. /*int last;
  686. bool commandClearance;
  687. REGISTER_VARIABLES()
  688. {
  689. SAVE_VARIABLE( last, 1 );
  690. SAVE_VARIABLE( commandClearance, 2 );
  691. }
  692. void Created( GameObject * obj )
  693. {
  694. Commands->Enable_Hibernation( obj, false );
  695. commandClearance = true;
  696. float delayTimer = Commands->Get_Random ( 45, 60 );
  697. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ATTACKING_01_JDG, delayTimer );
  698. last = 12;
  699. }
  700. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  701. {
  702. if (param == M01_GOTO_IDLE_JDG)
  703. {
  704. commandClearance = false;
  705. Commands->Enable_Hibernation( obj, true );
  706. }
  707. else if (param == M01_START_ACTING_JDG)
  708. {
  709. commandClearance = true;
  710. Commands->Enable_Hibernation( obj, false );
  711. float delayTimer = Commands->Get_Random ( 0, 5 );
  712. Commands->Start_Timer(obj, this, delayTimer, 0);
  713. }
  714. else if (param == M01_START_ATTACKING_01_JDG)
  715. {
  716. if (commandClearance == true)
  717. {
  718. Vector3 speaker01position = Commands->Get_Position ( STAR );
  719. Vector3 speaker02position = Commands->Get_Position ( STAR );
  720. Vector3 speaker03position = Commands->Get_Position ( STAR );
  721. speaker01position.X += Commands->Get_Random(-10,10);
  722. speaker01position.Y += Commands->Get_Random(-10,10);
  723. speaker01position.Z += Commands->Get_Random(0,10);
  724. speaker02position.X += Commands->Get_Random(-10,10);
  725. speaker02position.Y += Commands->Get_Random(-10,10);
  726. speaker02position.Z += Commands->Get_Random(0,10);
  727. speaker03position.X += Commands->Get_Random(-10,10);
  728. speaker03position.Y += Commands->Get_Random(-10,10);
  729. speaker03position.Z += Commands->Get_Random(0,10);
  730. Commands->Create_Sound ( "M11DSGN_DSGN0095I1EVAC_SND", speaker01position, obj );
  731. Commands->Create_Sound ( "M11DSGN_DSGN0095I1EVAC_SND", speaker02position, obj );
  732. Commands->Create_Sound ( "M11DSGN_DSGN0095I1EVAC_SND", speaker03position, obj );
  733. float delayTimer = Commands->Get_Random ( 5, 10 );
  734. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ATTACKING_02_JDG, delayTimer );
  735. }
  736. }
  737. else if (param == M01_START_ATTACKING_02_JDG)
  738. {
  739. if (commandClearance == true)
  740. {
  741. int random = Commands->Get_Random_Int(0, 10);
  742. while (random == last) {
  743. random = Commands->Get_Random_Int(0, 10);
  744. }
  745. last = random;
  746. GameObject *ionCannonGuy = Commands->Create_Object("GDI_MiniGunner_IonCannon_JDG", ionCannonlocations[random]);
  747. Commands->Attach_Script(ionCannonGuy, "M11_IonCannon_Guy_JDG", "");
  748. float delayTimer = Commands->Get_Random ( 60, 120 );
  749. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ATTACKING_01_JDG, delayTimer );
  750. }
  751. }
  752. }*/
  753. };
  754. DECLARE_SCRIPT(M11_IonCannon_Guy_JDG, "")
  755. {
  756. void Created( GameObject * obj )
  757. {
  758. Commands->Enable_Hibernation( obj, false );
  759. Vector3 myPosition = Commands->Get_Position ( obj );
  760. ActionParamsStruct params;
  761. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  762. params.Set_Attack( myPosition, 10, 0, true );
  763. params.AttackCheckBlocked = false;
  764. Commands->Action_Attack ( obj, params );
  765. }
  766. };
  767. DECLARE_SCRIPT(M11_ExternalSound_Controller_NodTanks_JDG, "")
  768. {
  769. bool commandClearance;
  770. REGISTER_VARIABLES()
  771. {
  772. SAVE_VARIABLE( commandClearance, 1 );
  773. }
  774. void Created( GameObject * obj )
  775. {
  776. commandClearance = true;
  777. float delayTimer = Commands->Get_Random ( 0, 3 );
  778. Commands->Start_Timer(obj, this, delayTimer, 0);
  779. }
  780. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  781. {
  782. if (param == M01_GOTO_IDLE_JDG)
  783. {
  784. commandClearance = false;
  785. }
  786. else if (param == M01_START_ACTING_JDG)
  787. {
  788. commandClearance = true;
  789. float delayTimer = Commands->Get_Random ( 0, 3 );
  790. Commands->Start_Timer(obj, this, delayTimer, 0);
  791. }
  792. }
  793. void Timer_Expired(GameObject * obj, int timer_id)
  794. {
  795. if (commandClearance == true)
  796. {
  797. Vector3 soundLocation = Commands->Get_Position ( obj );
  798. soundLocation.X += Commands->Get_Random ( -10, 10 );
  799. soundLocation.Y += Commands->Get_Random ( -10, 10 );
  800. soundLocation.Z += Commands->Get_Random ( 0, 10 );
  801. Commands->Create_Sound ( "M11_Exterior_NODTank_Twiddler_JDG", soundLocation, obj );
  802. float delayTimer = Commands->Get_Random ( 5, 10 );
  803. Commands->Start_Timer(obj, this, delayTimer, 0);
  804. }
  805. }
  806. };
  807. DECLARE_SCRIPT(M11_ExternalSound_Controller_GDITanks_JDG, "")
  808. {
  809. bool commandClearance;
  810. REGISTER_VARIABLES()
  811. {
  812. SAVE_VARIABLE( commandClearance, 1 );
  813. }
  814. void Created( GameObject * obj )
  815. {
  816. commandClearance = true;
  817. float delayTimer = Commands->Get_Random ( 0, 3 );
  818. Commands->Start_Timer(obj, this, delayTimer, 0);
  819. }
  820. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  821. {
  822. if (param == M01_GOTO_IDLE_JDG)
  823. {
  824. commandClearance = false;
  825. }
  826. else if (param == M01_START_ACTING_JDG)
  827. {
  828. commandClearance = true;
  829. float delayTimer = Commands->Get_Random ( 0, 3 );
  830. Commands->Start_Timer(obj, this, delayTimer, 0);
  831. }
  832. }
  833. void Timer_Expired(GameObject * obj, int timer_id)
  834. {
  835. if (commandClearance == true)
  836. {
  837. Vector3 soundLocation = Commands->Get_Position ( obj );
  838. soundLocation.X += Commands->Get_Random ( -10, 10 );
  839. soundLocation.Y += Commands->Get_Random ( -10, 10 );
  840. soundLocation.Z += Commands->Get_Random ( 0, 10 );
  841. Commands->Create_Sound ( "M11_Exterior_GDITank_Twiddler_JDG", soundLocation, obj );
  842. float delayTimer = Commands->Get_Random ( 5, 10 );
  843. Commands->Start_Timer(obj, this, delayTimer, 0);
  844. }
  845. }
  846. };
  847. DECLARE_SCRIPT(M11_ExternalSound_Controller_NodTroops_JDG, "")
  848. {
  849. bool commandClearance;
  850. REGISTER_VARIABLES()
  851. {
  852. SAVE_VARIABLE( commandClearance, 1 );
  853. }
  854. void Created( GameObject * obj )
  855. {
  856. commandClearance = true;
  857. float delayTimer = Commands->Get_Random ( 0, 3 );
  858. Commands->Start_Timer(obj, this, delayTimer, 0);
  859. }
  860. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  861. {
  862. if (param == M01_GOTO_IDLE_JDG)
  863. {
  864. commandClearance = false;
  865. }
  866. else if (param == M01_START_ACTING_JDG)
  867. {
  868. commandClearance = true;
  869. float delayTimer = Commands->Get_Random ( 0, 3 );
  870. Commands->Start_Timer(obj, this, delayTimer, 0);
  871. }
  872. }
  873. void Timer_Expired(GameObject * obj, int timer_id)
  874. {
  875. if (commandClearance == true)
  876. {
  877. Vector3 soundLocation = Commands->Get_Position ( obj );
  878. soundLocation.X += Commands->Get_Random ( -10, 10 );
  879. soundLocation.Y += Commands->Get_Random ( -10, 10 );
  880. soundLocation.Z += Commands->Get_Random ( 0, 10 );
  881. Commands->Create_Sound ( "M11_Exterior_NODTroops_Twiddler_JDG", soundLocation, obj );
  882. float delayTimer = Commands->Get_Random ( 5, 10 );
  883. Commands->Start_Timer(obj, this, delayTimer, 0);
  884. }
  885. }
  886. };
  887. DECLARE_SCRIPT(M11_ExternalSound_Controller_GDITroops_JDG, "")
  888. {
  889. bool commandClearance;
  890. REGISTER_VARIABLES()
  891. {
  892. SAVE_VARIABLE( commandClearance, 1 );
  893. }
  894. void Created( GameObject * obj )
  895. {
  896. commandClearance = true;
  897. float delayTimer = Commands->Get_Random ( 0, 3 );
  898. Commands->Start_Timer(obj, this, delayTimer, 0);
  899. }
  900. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  901. {
  902. if (param == M01_GOTO_IDLE_JDG)
  903. {
  904. commandClearance = false;
  905. }
  906. else if (param == M01_START_ACTING_JDG)
  907. {
  908. commandClearance = true;
  909. float delayTimer = Commands->Get_Random ( 0, 3 );
  910. Commands->Start_Timer(obj, this, delayTimer, 0);
  911. }
  912. }
  913. void Timer_Expired(GameObject * obj, int timer_id)
  914. {
  915. if (commandClearance == true)
  916. {
  917. Vector3 soundLocation = Commands->Get_Position ( obj );
  918. soundLocation.X += Commands->Get_Random ( -10, 10 );
  919. soundLocation.Y += Commands->Get_Random ( -10, 10 );
  920. soundLocation.Z += Commands->Get_Random ( 0, 10 );
  921. Commands->Create_Sound ( "M11_Exterior_GDITroops_Twiddler_JDG", soundLocation, obj );
  922. float delayTimer = Commands->Get_Random ( 5, 10 );
  923. Commands->Start_Timer(obj, this, delayTimer, 0);
  924. }
  925. }
  926. };
  927. Vector3 m11Artillerylocations[35] = {
  928. Vector3 (3.486f, -53.794f, 3.799f),
  929. Vector3 (-20.923f, -31.001f, 26.833f),
  930. Vector3 (-23.338f, 2.514f, 26.502f),
  931. Vector3 (-23.097f, 32.220f, 38.927f),
  932. Vector3 (-12.618f, -21.520f, 12.796f),
  933. Vector3 (-2.253f, 5.014f, 23.738f),
  934. Vector3 (7.692f, 7.967f, 19.242f),
  935. Vector3 (0.726f, 20.706f, 24.670f),
  936. Vector3 (-11.148f, 50.407f, 38.031f),
  937. Vector3 (4.330f, 49.481f, 48.165f),
  938. Vector3 (9.350f, 48.324f, 40.018f),
  939. Vector3 (20.210f, 45.413f, 32.186f),
  940. Vector3 (21.162f, 31.207f, 26.841f),
  941. Vector3 (21.673f, 1.765f, 36.254f),
  942. Vector3 (19.174f, -28.685f, 21.450f),
  943. Vector3 (4.334f, -16.692f, 0),
  944. Vector3 (-3.070f, -4.271f, 0),
  945. Vector3 (-0.372f, -5.744f, -18.765f),
  946. Vector3 (43.437f, -64.747f, 51.465f),
  947. Vector3 (54.511f, -32.046f, 59.763f),
  948. Vector3 (48.525f, -14.851f, 50.524f),
  949. Vector3 (47.396f, 4.976f, 54.233f),
  950. Vector3 (-47.600f, 19.498f, 48.110f),
  951. Vector3 (-51.750f, -1.745f, 54.846f),
  952. Vector3 (-47.856f, -25.844f, 45.516f),
  953. Vector3 (4.559f, -123.847f, 28.179f),
  954. Vector3 (11.093f, -125.641f, 37.388f),
  955. Vector3 (8.425f, -127.718f, 45.484f),
  956. Vector3 (-11.490f, -165.685f, 42.821f),
  957. Vector3 (-35.123f, -155.089f, 34.401f),
  958. Vector3 (29.645f, -165.685f, 42.816f),
  959. Vector3 (-1.107f, -163.946f, 19.644f),
  960. Vector3 (-21.683f, -141.336f, 19),
  961. Vector3 (42.883f, -165.685f, 26.360f),
  962. Vector3 (-24.331f, -107.697f, 15.882f),
  963. };
  964. DECLARE_SCRIPT(M11_ExternalArtillery_Controller_JDG, "")
  965. {
  966. Vector3 sound_location;
  967. int last;
  968. int bomb_sound;
  969. float delayTimerMin;
  970. float delayTimerMax;
  971. bool command_clearance;
  972. int bombcount;
  973. REGISTER_VARIABLES()
  974. {
  975. SAVE_VARIABLE(sound_location, 1);
  976. SAVE_VARIABLE(last, 2);
  977. SAVE_VARIABLE(bomb_sound, 3);
  978. SAVE_VARIABLE(command_clearance, 4);
  979. SAVE_VARIABLE(delayTimerMin, 5);
  980. SAVE_VARIABLE(delayTimerMax, 6);
  981. SAVE_VARIABLE(bombcount, 7);
  982. }
  983. void Created( GameObject * obj )
  984. {
  985. last = 40;
  986. delayTimerMin = 0;
  987. delayTimerMax = 10;
  988. command_clearance = true;
  989. bombcount = 0;
  990. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
  991. }
  992. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  993. {
  994. if (type == CUSTOM_EVENT_SOUND_ENDED )
  995. {
  996. if (param == bomb_sound)
  997. {
  998. Vector3 explosion_location = sound_location;
  999. explosion_location.Z -= 10;
  1000. Commands->Create_Explosion("Ground Explosions Twiddler", explosion_location);
  1001. float delayTimer = Commands->Get_Random ( delayTimerMin, delayTimerMax );
  1002. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
  1003. }
  1004. }
  1005. switch (param)
  1006. {
  1007. case M01_PICK_A_NEW_LOCATION_JDG:
  1008. {
  1009. if (command_clearance == true && (bombcount < 10))
  1010. {
  1011. bombcount++;
  1012. int random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
  1013. while (random == last)
  1014. {
  1015. random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
  1016. }
  1017. last = random;
  1018. sound_location = m11Artillerylocations[random];
  1019. sound_location.Z += 5;
  1020. bomb_sound = Commands->Create_Sound ( "Bomb_Falling_Sound_Twiddler", sound_location, obj );
  1021. Commands->Monitor_Sound ( obj, bomb_sound );
  1022. }
  1023. }
  1024. break;
  1025. case M01_GOTO_IDLE_JDG:
  1026. {
  1027. command_clearance = false;
  1028. }
  1029. break;
  1030. case M01_START_ACTING_JDG:
  1031. {
  1032. command_clearance = true;
  1033. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
  1034. }
  1035. break;
  1036. }
  1037. }
  1038. };
  1039. DECLARE_SCRIPT(M11_Floor01_StealthSoldier01_JDG, "")
  1040. {
  1041. bool attackingPlayer;
  1042. REGISTER_VARIABLES()
  1043. {
  1044. SAVE_VARIABLE( attackingPlayer, 1 );
  1045. }
  1046. void Created( GameObject * obj )
  1047. {
  1048. attackingPlayer = false;
  1049. Commands->Enable_Stealth(obj, false);
  1050. ActionParamsStruct params;
  1051. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  1052. params.Set_Movement( Vector3(-6.242f, 28.340f, -10.015f), RUN, 0.25f);
  1053. Commands->Action_Goto( obj, params );
  1054. float delayTimer = Commands->Get_Random ( 1, 3 );
  1055. Commands->Start_Timer(obj, this, delayTimer, 0);
  1056. }
  1057. void Timer_Expired(GameObject * obj, int timer_id)
  1058. {
  1059. if (obj)
  1060. {
  1061. Commands->Enable_Stealth(obj, true);
  1062. }
  1063. }
  1064. void Poked( GameObject * obj, GameObject * poker )
  1065. {
  1066. if (poker == STAR && attackingPlayer == false)
  1067. {
  1068. attackingPlayer = true;
  1069. Commands->Action_Reset ( obj, 100 );
  1070. ActionParamsStruct params;
  1071. Commands->Set_Innate_Is_Stationary ( obj, false );
  1072. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1073. params.Set_Movement( STAR, RUN, 10);
  1074. params.Set_Attack( STAR, 10, 0, true );
  1075. Commands->Action_Attack (obj, params);
  1076. }
  1077. }
  1078. void Damaged( GameObject * obj, GameObject * damager, float amount )
  1079. {
  1080. if (damager == STAR && attackingPlayer == false)
  1081. {
  1082. attackingPlayer = true;
  1083. Commands->Action_Reset ( obj, 100 );
  1084. ActionParamsStruct params;
  1085. Commands->Set_Innate_Is_Stationary ( obj, false );
  1086. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1087. params.Set_Movement( STAR, RUN, 10);
  1088. params.Set_Attack( STAR, 10, 0, true );
  1089. Commands->Action_Attack (obj, params);
  1090. }
  1091. }
  1092. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  1093. {
  1094. ActionParamsStruct params;
  1095. if (action_id == M01_WALKING_WAYPATH_01_JDG && attackingPlayer == false)
  1096. {
  1097. Commands->Set_Innate_Is_Stationary ( obj, true );
  1098. Vector3 playersPosition = Commands->Get_Position ( STAR );
  1099. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  1100. params.Set_Face_Location( playersPosition, 1 );
  1101. Commands->Action_Face_Location ( obj, params );
  1102. }
  1103. else if (action_id == M01_DOING_ANIMATION_01_JDG && attackingPlayer == false)
  1104. {
  1105. Vector3 playersPosition = Commands->Get_Position ( STAR );
  1106. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  1107. params.Set_Face_Location( playersPosition, 1 );
  1108. Commands->Action_Face_Location ( obj, params );
  1109. }
  1110. }
  1111. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1112. {
  1113. if (obj)
  1114. {
  1115. if (param == M01_MODIFY_YOUR_ACTION_JDG && attackingPlayer == false)
  1116. {
  1117. attackingPlayer = true;
  1118. Commands->Action_Reset ( obj, 100 );
  1119. Vector3 myPosition = Commands->Get_Position ( obj );
  1120. Commands->Create_Sound ( "CnC_Cloaking", myPosition, obj );
  1121. Commands->Debug_Message ( "***************************m11 stealth guy 01 has received custom to attack player\n" );
  1122. ActionParamsStruct params;
  1123. Commands->Set_Innate_Is_Stationary ( obj, false );
  1124. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1125. params.Set_Attack( STAR, 10, 0, true );
  1126. Commands->Action_Attack (obj, params);
  1127. }
  1128. }
  1129. }
  1130. };
  1131. DECLARE_SCRIPT(M11_Floor01_StealthSoldier02_JDG, "")
  1132. {
  1133. bool attackingPlayer;
  1134. REGISTER_VARIABLES()
  1135. {
  1136. SAVE_VARIABLE( attackingPlayer, 1 );
  1137. }
  1138. void Created( GameObject * obj )
  1139. {
  1140. attackingPlayer = false;
  1141. Commands->Enable_Stealth(obj, false);
  1142. ActionParamsStruct params;
  1143. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  1144. params.Set_Movement( Vector3(6.014f, 27.870f, -10.015f), RUN, 0.25f);
  1145. Commands->Action_Goto( obj, params );
  1146. float delayTimer = Commands->Get_Random ( 1, 3 );
  1147. Commands->Start_Timer(obj, this, delayTimer, 0);
  1148. }
  1149. void Timer_Expired(GameObject * obj, int timer_id)
  1150. {
  1151. if (obj)
  1152. {
  1153. Commands->Enable_Stealth(obj, true);
  1154. }
  1155. }
  1156. void Poked( GameObject * obj, GameObject * poker )
  1157. {
  1158. if (poker == STAR)
  1159. {
  1160. Commands->Action_Reset ( obj, 100 );
  1161. ActionParamsStruct params;
  1162. Commands->Set_Innate_Is_Stationary ( obj, false );
  1163. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1164. params.Set_Movement( STAR, RUN, 10);
  1165. params.Set_Attack( STAR, 10, 0, true );
  1166. Commands->Action_Attack (obj, params);
  1167. }
  1168. }
  1169. void Damaged( GameObject * obj, GameObject * damager, float amount )
  1170. {
  1171. if (damager == STAR)
  1172. {
  1173. Commands->Action_Reset ( obj, 100 );
  1174. ActionParamsStruct params;
  1175. Commands->Set_Innate_Is_Stationary ( obj, false );
  1176. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1177. params.Set_Movement( STAR, RUN, 10);
  1178. params.Set_Attack( STAR, 10, 0, true );
  1179. Commands->Action_Attack (obj, params);
  1180. }
  1181. }
  1182. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  1183. {
  1184. ActionParamsStruct params;
  1185. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  1186. {
  1187. Commands->Set_Innate_Is_Stationary ( obj, true );
  1188. Vector3 playersPosition = Commands->Get_Position ( STAR );
  1189. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  1190. params.Set_Face_Location( playersPosition, 1 );
  1191. Commands->Action_Face_Location ( obj, params );
  1192. }
  1193. else if (action_id == M01_DOING_ANIMATION_01_JDG && attackingPlayer == false)
  1194. {
  1195. Vector3 playersPosition = Commands->Get_Position ( STAR );
  1196. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  1197. params.Set_Face_Location( playersPosition, 1 );
  1198. Commands->Action_Face_Location ( obj, params );
  1199. }
  1200. }
  1201. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1202. {
  1203. if (obj)
  1204. {
  1205. if (param == M01_MODIFY_YOUR_ACTION_JDG && attackingPlayer == false)
  1206. {
  1207. attackingPlayer = true;
  1208. Commands->Action_Reset ( obj, 100 );
  1209. Vector3 myPosition = Commands->Get_Position ( obj );
  1210. Commands->Create_Sound ( "CnC_Cloaking", myPosition, obj );
  1211. ActionParamsStruct params;
  1212. Commands->Set_Innate_Is_Stationary ( obj, false );
  1213. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1214. params.Set_Movement( STAR, RUN, 10);
  1215. params.Set_Attack( STAR, 10, 0, true );
  1216. Commands->Action_Attack (obj, params);
  1217. }
  1218. }
  1219. }
  1220. };
  1221. DECLARE_SCRIPT(M11_Floor01_FireGuy_JDG, "")
  1222. {
  1223. void Created( GameObject * obj )
  1224. {
  1225. float myHealth = Commands->Get_Health ( obj );
  1226. float healthFudge = Commands->Get_Random ( 0.25f, 0.5f );
  1227. myHealth = myHealth * healthFudge;
  1228. Commands->Set_Health ( obj, myHealth );
  1229. Commands->Apply_Damage( obj, 10, "Flamethrower", NULL );
  1230. Commands->Enable_Hibernation( obj, false );
  1231. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  1232. }
  1233. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1234. {
  1235. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  1236. {
  1237. Commands->Apply_Damage( obj, 10, "Flamethrower", NULL );
  1238. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  1239. }
  1240. }
  1241. };
  1242. DECLARE_SCRIPT(M11_Floor01_ChaseGuy_JDG, "")
  1243. {
  1244. void Created( GameObject * obj )
  1245. {
  1246. ActionParamsStruct params;
  1247. Commands->Set_Innate_Is_Stationary ( obj, false );
  1248. params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
  1249. params.Set_Movement( STAR, RUN, 10);
  1250. params.Set_Attack( STAR, 50, 1, true );
  1251. Commands->Action_Attack (obj, params);
  1252. }
  1253. };
  1254. DECLARE_SCRIPT(M11_C130_Dropoff_Controller_JDG, "")//M11_C130_DROPOFF_CONTROLLER_JDG 100221
  1255. {
  1256. int last;
  1257. int active_unit_count;
  1258. int dropoffcount;
  1259. int dropoffMax;
  1260. REGISTER_VARIABLES()
  1261. {
  1262. SAVE_VARIABLE(last, 1);
  1263. SAVE_VARIABLE(active_unit_count, 2);
  1264. SAVE_VARIABLE(dropoffcount, 3);
  1265. SAVE_VARIABLE(dropoffMax, 4);
  1266. }
  1267. void Created(GameObject * obj)
  1268. {
  1269. Commands->Start_Timer(obj, this, 10.0f, 0);
  1270. active_unit_count = 0;
  1271. last = 20;
  1272. dropoffcount = 0;
  1273. }
  1274. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1275. {
  1276. if (param == M01_SPAWNER_IS_DEAD_JDG)
  1277. {
  1278. active_unit_count--;
  1279. float delayTimer = Commands->Get_Random ( 0, 30 );
  1280. Commands->Start_Timer(obj, this, delayTimer, 0);
  1281. }
  1282. }
  1283. void Timer_Expired(GameObject * obj, int timer_id)
  1284. {
  1285. if (obj && active_unit_count <= 1)
  1286. {
  1287. int easy = 0;
  1288. int medium = 1;
  1289. int currentDifficulty = Commands->Get_Difficulty_Level( );
  1290. if (currentDifficulty == easy)
  1291. {
  1292. dropoffMax = M11_C130_EASY_SPAWN_CAP_JDG;
  1293. }
  1294. else if (currentDifficulty == medium)
  1295. {
  1296. dropoffMax = M11_C130_MEDIUM_SPAWN_CAP_JDG;
  1297. }
  1298. else
  1299. {
  1300. dropoffMax = M11_C130_HARD_SPAWN_CAP_JDG;
  1301. }
  1302. if (dropoffcount <= dropoffMax)
  1303. {
  1304. dropoffcount++;
  1305. active_unit_count += 3;
  1306. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0.2f, -25.5f, -10.0f));
  1307. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_C130Troopdrop.txt");
  1308. Commands->Set_Facing ( controller, 90);
  1309. }
  1310. }
  1311. }
  1312. };
  1313. DECLARE_SCRIPT(M11_C130_Dropoff_Dude_JDG, "")//also have M01_Hunt_The_Player_JDG script attached to these guys
  1314. {
  1315. void Animation_Complete(GameObject * obj, const char *anim)
  1316. {
  1317. if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_1") == 0)
  1318. {
  1319. Commands->Attach_Script(obj, "M01_Hunt_The_Player_JDG","");
  1320. }
  1321. else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_2") == 0)
  1322. {
  1323. Commands->Attach_Script(obj, "M01_Hunt_The_Player_JDG","");
  1324. }
  1325. else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_3") == 0)
  1326. {
  1327. Commands->Attach_Script(obj, "M01_Hunt_The_Player_JDG","");
  1328. }
  1329. }
  1330. void Killed( GameObject * obj, GameObject * killer )
  1331. {
  1332. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_C130_DROPOFF_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  1333. }
  1334. };
  1335. /***********************************************************************************************************************
  1336. Putting scripts dealing with the netrunner room here
  1337. ************************************************************************************************************************/
  1338. DECLARE_SCRIPT(M11_NetRunnerRoom_EntryZone_JDG, "")
  1339. {
  1340. bool entered;
  1341. REGISTER_VARIABLES()
  1342. {
  1343. SAVE_VARIABLE(entered, 1);
  1344. }
  1345. void Created( GameObject * obj )
  1346. {
  1347. entered = false;
  1348. }
  1349. void Entered( GameObject * obj, GameObject * enterer )
  1350. {
  1351. if (enterer == STAR && entered == false)
  1352. {
  1353. entered = true;
  1354. GameObject * exitZone = Commands->Find_Object ( 100228 );
  1355. if (exitZone != NULL)
  1356. {
  1357. Commands->Send_Custom_Event ( obj, exitZone, 0, M01_START_ACTING_JDG, 0 );
  1358. }
  1359. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  1360. }
  1361. }
  1362. };
  1363. DECLARE_SCRIPT(M11_NetRunnerRoom_ExitZone_JDG, "")
  1364. {
  1365. bool okay_to_trigger;
  1366. REGISTER_VARIABLES()
  1367. {
  1368. SAVE_VARIABLE(okay_to_trigger, 1);
  1369. }
  1370. void Created( GameObject * obj )
  1371. {
  1372. okay_to_trigger = false;
  1373. }
  1374. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1375. {
  1376. if (param == M01_START_ACTING_JDG)
  1377. {
  1378. okay_to_trigger = true;
  1379. }
  1380. }
  1381. void Entered( GameObject * obj, GameObject * enterer )
  1382. {
  1383. if (enterer == STAR && okay_to_trigger == true)
  1384. {
  1385. GameObject * stealthSoldier01 = Commands->Find_Object ( 100225 );
  1386. GameObject * stealthSoldier02 = Commands->Find_Object ( 100227 );
  1387. if (stealthSoldier01 != NULL)
  1388. {
  1389. float delayTimer01 = Commands->Get_Random ( 0, 1 );
  1390. Commands->Send_Custom_Event ( obj, stealthSoldier01, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer01 );
  1391. }
  1392. if (stealthSoldier02 != NULL)
  1393. {
  1394. float delayTimer02 = Commands->Get_Random ( 0, 1 );
  1395. Commands->Send_Custom_Event ( obj, stealthSoldier02, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer02 );
  1396. }
  1397. }
  1398. }
  1399. };
  1400. /***********************************************************************************************************************
  1401. Putting scripts dealing with the museum and the bar-area rooms here
  1402. ************************************************************************************************************************/
  1403. DECLARE_SCRIPT(M11_MuseumLevel_EntryZone_JDG, "")
  1404. {
  1405. void Entered( GameObject * obj, GameObject * enterer )
  1406. {
  1407. if (enterer == STAR)
  1408. {
  1409. GameObject * museumGuard01 = Commands->Find_Object ( M11_MUSEUM_GUARD_01_JDG );
  1410. GameObject * museumGuard02 = Commands->Find_Object ( M11_MUSEUM_GUARD_02_JDG );
  1411. GameObject * museumGuard03 = Commands->Find_Object ( M11_MUSEUM_GUARD_03_JDG );
  1412. GameObject * museumGuard04 = Commands->Find_Object ( M11_MUSEUM_GUARD_04_JDG );
  1413. GameObject * museumGuard05 = Commands->Find_Object ( M11_MUSEUM_GUARD_05_JDG );
  1414. GameObject * museumGuard06 = Commands->Find_Object ( M11_MUSEUM_GUARD_06_JDG );
  1415. if (museumGuard01 != NULL)
  1416. {
  1417. Commands->Send_Custom_Event ( obj, museumGuard01, 0, M01_START_ACTING_JDG, 0 );
  1418. }
  1419. if (museumGuard02 != NULL)
  1420. {
  1421. Commands->Send_Custom_Event ( obj, museumGuard02, 0, M01_START_ACTING_JDG, 0 );
  1422. }
  1423. if (museumGuard03 != NULL)
  1424. {
  1425. Commands->Send_Custom_Event ( obj, museumGuard03, 0, M01_START_ACTING_JDG, 0 );
  1426. }
  1427. if (museumGuard04 != NULL)
  1428. {
  1429. Commands->Send_Custom_Event ( obj, museumGuard04, 0, M01_START_ACTING_JDG, 0 );
  1430. }
  1431. if (museumGuard05 != NULL)
  1432. {
  1433. Commands->Send_Custom_Event ( obj, museumGuard05, 0, M01_START_ACTING_JDG, 0 );
  1434. }
  1435. if (museumGuard06 != NULL)
  1436. {
  1437. Commands->Send_Custom_Event ( obj, museumGuard06, 0, M01_START_ACTING_JDG, 0 );
  1438. }
  1439. GameObject * zone01 = Commands->Find_Object ( 100254 );
  1440. GameObject * zone02 = Commands->Find_Object ( 100255 );
  1441. if (zone01 != NULL)
  1442. {
  1443. Commands->Destroy_Object ( zone01 );
  1444. }
  1445. if (zone02 != NULL)
  1446. {
  1447. Commands->Destroy_Object ( zone02 );
  1448. }
  1449. }
  1450. }
  1451. };
  1452. DECLARE_SCRIPT(M11_MuseumLevel_Spawner_JDG, "")
  1453. {
  1454. void Created( GameObject * obj )
  1455. {
  1456. Commands->Enable_Hibernation( obj, false );
  1457. Commands->Start_Timer ( obj, this, 30, M01_GOTO_IDLE_JDG );
  1458. }
  1459. void Timer_Expired( GameObject * obj, int timer_id )
  1460. {
  1461. if (obj)
  1462. {
  1463. if (timer_id == M01_GOTO_IDLE_JDG)
  1464. {
  1465. Commands->Enable_Hibernation( obj, true );
  1466. }
  1467. }
  1468. }
  1469. };
  1470. DECLARE_SCRIPT(M11_MuseumLevel_Defender_Aggressive_JDG, "")
  1471. {
  1472. bool okay_to_spawn;
  1473. REGISTER_VARIABLES()
  1474. {
  1475. SAVE_VARIABLE(okay_to_spawn, 1);
  1476. }
  1477. void Created( GameObject * obj )
  1478. {
  1479. okay_to_spawn = true;
  1480. Commands->Innate_Disable(obj);
  1481. }
  1482. void Killed( GameObject * obj, GameObject * killer )
  1483. {
  1484. if (okay_to_spawn == true)
  1485. {
  1486. GameObject * newGuy = Commands->Trigger_Spawner( M11_MUSEUM_SPAWNER_JDG );
  1487. Commands->Attach_Script(newGuy, "M11_MuseumLevel_Spawner_JDG", "");
  1488. }
  1489. }
  1490. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1491. {
  1492. if (param == M01_START_ACTING_JDG)
  1493. {
  1494. Commands->Innate_Enable(obj);
  1495. Commands->Set_Innate_Aggressiveness ( obj, 1 );
  1496. Commands->Set_Innate_Take_Cover_Probability ( obj, 0 );
  1497. }
  1498. else if (param == M01_GOTO_IDLE_JDG)
  1499. {
  1500. okay_to_spawn = false;
  1501. }
  1502. }
  1503. };
  1504. DECLARE_SCRIPT(M11_MuseumLevel_Defender_Defensive_JDG, "")
  1505. {
  1506. bool okay_to_spawn;
  1507. REGISTER_VARIABLES()
  1508. {
  1509. SAVE_VARIABLE(okay_to_spawn, 1);
  1510. }
  1511. void Created( GameObject * obj )
  1512. {
  1513. okay_to_spawn = true;
  1514. Commands->Innate_Disable(obj);
  1515. }
  1516. void Killed( GameObject * obj, GameObject * killer )
  1517. {
  1518. if (okay_to_spawn == true)
  1519. {
  1520. GameObject * newGuy = Commands->Trigger_Spawner( M11_MUSEUM_SPAWNER_JDG );
  1521. Commands->Attach_Script(newGuy, "M11_MuseumLevel_Spawner_JDG", "");
  1522. }
  1523. }
  1524. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1525. {
  1526. if (param == M01_START_ACTING_JDG)
  1527. {
  1528. Commands->Innate_Enable(obj);
  1529. Commands->Set_Innate_Aggressiveness ( obj, 1 );
  1530. Commands->Set_Innate_Take_Cover_Probability ( obj, 1 );
  1531. }
  1532. else if (param == M01_GOTO_IDLE_JDG)
  1533. {
  1534. okay_to_spawn = false;
  1535. }
  1536. }
  1537. };
  1538. DECLARE_SCRIPT(M11_MuseumLevel_Disable_Spawners_Zone_JDG, "")
  1539. {
  1540. void Entered( GameObject * obj, GameObject * enterer )
  1541. {
  1542. if (enterer == STAR)
  1543. {
  1544. GameObject * museumGuard01 = Commands->Find_Object ( M11_MUSEUM_GUARD_01_JDG );
  1545. GameObject * museumGuard02 = Commands->Find_Object ( M11_MUSEUM_GUARD_02_JDG );
  1546. GameObject * museumGuard03 = Commands->Find_Object ( M11_MUSEUM_GUARD_03_JDG );
  1547. GameObject * museumGuard04 = Commands->Find_Object ( M11_MUSEUM_GUARD_04_JDG );
  1548. GameObject * museumGuard05 = Commands->Find_Object ( M11_MUSEUM_GUARD_05_JDG );
  1549. GameObject * museumGuard06 = Commands->Find_Object ( M11_MUSEUM_GUARD_06_JDG );
  1550. if (museumGuard01 != NULL)
  1551. {
  1552. Commands->Send_Custom_Event ( obj, museumGuard01, 0, M01_GOTO_IDLE_JDG, 0 );
  1553. }
  1554. if (museumGuard02 != NULL)
  1555. {
  1556. Commands->Send_Custom_Event ( obj, museumGuard02, 0, M01_GOTO_IDLE_JDG, 0 );
  1557. }
  1558. if (museumGuard03 != NULL)
  1559. {
  1560. Commands->Send_Custom_Event ( obj, museumGuard03, 0, M01_GOTO_IDLE_JDG, 0 );
  1561. }
  1562. if (museumGuard04 != NULL)
  1563. {
  1564. Commands->Send_Custom_Event ( obj, museumGuard04, 0, M01_GOTO_IDLE_JDG, 0 );
  1565. }
  1566. if (museumGuard05 != NULL)
  1567. {
  1568. Commands->Send_Custom_Event ( obj, museumGuard05, 0, M01_GOTO_IDLE_JDG, 0 );
  1569. }
  1570. if (museumGuard06 != NULL)
  1571. {
  1572. Commands->Send_Custom_Event ( obj, museumGuard06, 0, M01_GOTO_IDLE_JDG, 0 );
  1573. }
  1574. GameObject * zone01 = Commands->Find_Object ( 100324 );
  1575. GameObject * zone02 = Commands->Find_Object ( 100325 );
  1576. if (zone01 != NULL)
  1577. {
  1578. Commands->Destroy_Object ( zone01 );
  1579. }
  1580. if (zone02 != NULL)
  1581. {
  1582. Commands->Destroy_Object ( zone02 );
  1583. }
  1584. }
  1585. }
  1586. };
  1587. DECLARE_SCRIPT(M11_WetBar_NeighborRoom_EntryZone_JDG, "")
  1588. {
  1589. void Entered( GameObject * obj, GameObject * enterer )
  1590. {
  1591. if (enterer == STAR)
  1592. {
  1593. GameObject * controller = Commands->Find_Object ( M11_WETBAR_SPAWNER_CONTROLLER_JDG );
  1594. if (controller != NULL)
  1595. {
  1596. Commands->Send_Custom_Event ( obj, controller, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  1597. }
  1598. }
  1599. }
  1600. };
  1601. DECLARE_SCRIPT(M11_WetBar_NeighborRoom_SpawnerController_JDG, "")
  1602. {
  1603. int activeSoldiers;
  1604. int spawn_01_ID;
  1605. int spawn_02_ID;
  1606. int spawn_03_ID;
  1607. REGISTER_VARIABLES()
  1608. {
  1609. SAVE_VARIABLE(activeSoldiers, 1);
  1610. SAVE_VARIABLE(spawn_01_ID, 2);
  1611. SAVE_VARIABLE(spawn_02_ID, 3);
  1612. SAVE_VARIABLE(spawn_03_ID, 4);
  1613. }
  1614. void Created( GameObject * obj )
  1615. {
  1616. activeSoldiers = 0;
  1617. }
  1618. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1619. {
  1620. if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)
  1621. {
  1622. GameObject * spawnedGuy01 = Commands->Find_Object ( spawn_01_ID );
  1623. GameObject * spawnedGuy02 = Commands->Find_Object ( spawn_02_ID );
  1624. GameObject * spawnedGuy03 = Commands->Find_Object ( spawn_03_ID );
  1625. if (spawnedGuy01 == NULL)
  1626. {
  1627. GameObject * spawnedGuy01 = Commands->Trigger_Spawner( M11_WETBAR_SPAWNER_01_JDG );
  1628. spawn_01_ID = Commands->Get_ID ( spawnedGuy01 );
  1629. }
  1630. if (spawnedGuy02 == NULL)
  1631. {
  1632. GameObject * spawnedGuy02 = Commands->Trigger_Spawner( M11_WETBAR_SPAWNER_02_JDG );
  1633. spawn_02_ID = Commands->Get_ID ( spawnedGuy02 );
  1634. }
  1635. if (spawnedGuy03 == NULL)
  1636. {
  1637. GameObject * spawnedGuy03 = Commands->Trigger_Spawner( M11_WETBAR_SPAWNER_03_JDG );
  1638. spawn_03_ID = Commands->Get_ID ( spawnedGuy03 );
  1639. }
  1640. }
  1641. }
  1642. };
  1643. DECLARE_SCRIPT(M11_WetBar_MutantGuard_JDG, "")
  1644. {
  1645. void Created( GameObject * obj )
  1646. {
  1647. Commands->Set_Innate_Is_Stationary ( obj, true );
  1648. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
  1649. }
  1650. void Killed( GameObject * obj, GameObject * killer )
  1651. {
  1652. Vector3 powerupSpawnLocation = Commands->Get_Position (obj);
  1653. powerupSpawnLocation.Z += 0.75f;
  1654. Commands->Create_Object ("POW_TiberiumAutoRifle_Player", powerupSpawnLocation );
  1655. }
  1656. };
  1657. Vector3 m11WetBarSeachLocations[12] = {
  1658. Vector3(-9.862f, -10.541f, -29.855f),
  1659. Vector3(-0.757f, -12.594f, -29.855f),
  1660. Vector3(9.187f, -12.521f, -29.855f),
  1661. Vector3(8.002f, -2.370f, -29.855f),
  1662. Vector3(0.163f, -2.219f, -29.855f),
  1663. Vector3(-8.423f, -3.841f, -29.855f),
  1664. Vector3(-9.398f, 5.363f, -29.855f),
  1665. Vector3(0.583f, 10.380f, -29.855f),
  1666. Vector3(9.479f, 4.651f, -29.855f),
  1667. Vector3(12.758f, -1.367f, -24.531f),
  1668. Vector3(-13.295f, -1.080f, -24.531f),
  1669. Vector3(-2.069f, -15.477f, -24.531f),
  1670. };
  1671. DECLARE_SCRIPT(M11_WetBar_NeighborRoom_SpawnedDude_JDG, "")
  1672. {
  1673. int last;
  1674. REGISTER_VARIABLES()
  1675. {
  1676. SAVE_VARIABLE(last, 1);
  1677. }
  1678. void Created( GameObject * obj )
  1679. {
  1680. last = 20;
  1681. Commands->Set_Innate_Aggressiveness ( obj, 0.3f );
  1682. Commands->Set_Innate_Take_Cover_Probability ( obj, 1 );
  1683. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 3 );
  1684. }
  1685. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1686. {
  1687. switch (param)
  1688. {
  1689. case M01_PICK_A_NEW_LOCATION_JDG:
  1690. {
  1691. int random = Commands->Get_Random_Int(0, 12);
  1692. while (random == last) {
  1693. random = Commands->Get_Random_Int(0, 12);
  1694. }
  1695. last = random;
  1696. Vector3 NewGotoLocation = m11WetBarSeachLocations[random];
  1697. ActionParamsStruct params;
  1698. params.Set_Basic( this, INNATE_PRIORITY_BULLET_HEARD - 5, M01_WALKING_WAYPATH_01_JDG );
  1699. params.Set_Movement( NewGotoLocation, WALK, 1, false );
  1700. Commands->Action_Goto( obj, params );
  1701. }
  1702. break;
  1703. }
  1704. }
  1705. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  1706. {
  1707. ActionParamsStruct params;
  1708. switch (complete_reason)
  1709. {
  1710. case ACTION_COMPLETE_NORMAL:
  1711. {
  1712. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  1713. {
  1714. char *animationName = M01_Choose_Search_Animation ( );
  1715. params.Set_Basic( this, INNATE_PRIORITY_BULLET_HEARD - 5, M01_DOING_ANIMATION_01_JDG );
  1716. params.Set_Animation (animationName, false);
  1717. Commands->Action_Play_Animation (obj, params);
  1718. }
  1719. else if (action_id == M01_DOING_ANIMATION_01_JDG)
  1720. {
  1721. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  1722. }
  1723. }
  1724. break;
  1725. }
  1726. }
  1727. };
  1728. DECLARE_SCRIPT(M11_GreenRoom_EntryZone_JDG, "")
  1729. {
  1730. void Entered( GameObject * obj, GameObject * enterer )
  1731. {
  1732. if (enterer == STAR)
  1733. {
  1734. GameObject * surpriseGuy01 = Commands->Create_Object ( "Nod_RocketSoldier_2SF_Chaingun", Vector3 (-10.408f, 32.538f, -29.855f) );
  1735. Commands->Attach_Script(surpriseGuy01, "M11_GreenRoom_SurpriseGuy_JDG", "");
  1736. GameObject * surpriseGuy02 = Commands->Create_Object ( "Nod_RocketSoldier_2SF_Chaingun", Vector3 (10.796f, 32.476f, -29.855f) );
  1737. Commands->Attach_Script(surpriseGuy02, "M11_GreenRoom_SurpriseGuy_JDG", "");
  1738. Commands->Destroy_Object (obj );//one-time event--cleaning up zone
  1739. }
  1740. }
  1741. };
  1742. DECLARE_SCRIPT(M11_GreenRoom_SurpriseGuy_JDG, "")
  1743. {
  1744. void Created( GameObject * obj )
  1745. {
  1746. Commands->Grant_Key( obj, 2, true );
  1747. Commands->Grant_Key( obj, 3, true );
  1748. ActionParamsStruct params;
  1749. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_02_JDG);
  1750. params.Set_Movement(Vector3 (-0.471f, 23.168f, -29.855f), RUN, 2);
  1751. Commands->Action_Goto(obj, params);
  1752. }
  1753. };
  1754. /***********************************************************************************************************************
  1755. Putting scripts dealing with war room encounters here
  1756. ************************************************************************************************************************/
  1757. DECLARE_SCRIPT(M11_WarRoom_EntryZone_JDG, "")
  1758. {
  1759. void Entered( GameObject * obj, GameObject * enterer )
  1760. {
  1761. if (enterer == STAR)
  1762. {
  1763. GameObject * engineer = Commands->Find_Object ( M11_WARROOM_ENGINEER_JDG );
  1764. if (engineer != NULL)
  1765. {
  1766. Commands->Send_Custom_Event( obj, engineer, 0, M01_START_ACTING_JDG, 0 );
  1767. }
  1768. GameObject * turret01 = Commands->Find_Object (M11_WARROOM_SECURITY_TURRET_01_JDG);
  1769. GameObject * turret02 = Commands->Find_Object (M11_WARROOM_SECURITY_TURRET_02_JDG);
  1770. if (turret01 != NULL)
  1771. {
  1772. float delayTimer = Commands->Get_Random ( 2, 5 );
  1773. Commands->Send_Custom_Event( obj, turret01, 0, M01_START_ACTING_JDG, delayTimer );
  1774. }
  1775. if (turret02 != NULL)
  1776. {
  1777. float delayTimer = Commands->Get_Random ( 2, 5 );
  1778. Commands->Send_Custom_Event( obj, turret02, 0, M01_START_ACTING_JDG, delayTimer );
  1779. }
  1780. GameObject * zone01 = Commands->Find_Object ( 100628 );
  1781. GameObject * zone02 = Commands->Find_Object ( 100629 );
  1782. if (zone01 != NULL)
  1783. {
  1784. Commands->Destroy_Object ( zone01 );
  1785. }
  1786. if (zone02 != NULL)
  1787. {
  1788. Commands->Destroy_Object ( zone02 );
  1789. }
  1790. }
  1791. }
  1792. };
  1793. DECLARE_SCRIPT(M11_WarRoom_Engineer_JDG, "")//M11_WARROOM_ENGINEER_JDG 100353
  1794. {
  1795. void Created( GameObject * obj )
  1796. {
  1797. Commands->Set_Innate_Is_Stationary ( obj, true );
  1798. }
  1799. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1800. {
  1801. if (param == M01_START_ACTING_JDG)
  1802. {
  1803. ActionParamsStruct params;
  1804. params.Set_Basic(this, INNATE_PRIORITY_GUNSHOT_HEARD-5, 100);
  1805. params.Set_Animation ("H_A_CON2", true);
  1806. Commands->Action_Play_Animation (obj, params);
  1807. }
  1808. }
  1809. void Killed( GameObject * obj, GameObject * killer )
  1810. {
  1811. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_WARROOM_SECURITY_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  1812. }
  1813. };
  1814. DECLARE_SCRIPT(M11_WarRoom_StationaryTech_JDG, "")
  1815. {
  1816. void Created( GameObject * obj )
  1817. {
  1818. ActionParamsStruct params;
  1819. params.Set_Basic(this, INNATE_PRIORITY_GUNSHOT_HEARD-5, 100);
  1820. params.Set_Animation ("H_A_CON2", true);
  1821. Commands->Action_Play_Animation (obj, params);
  1822. Commands->Set_Innate_Is_Stationary ( obj, true );
  1823. }
  1824. void Killed( GameObject * obj, GameObject * killer )
  1825. {
  1826. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_WARROOM_SECURITY_CONTROLLER_JDG ), 0, M01_START_ACTING_JDG, 0 );
  1827. }
  1828. };
  1829. DECLARE_SCRIPT(M11_WarRoom_SecurityTurret_JDG, "")
  1830. {
  1831. bool active;
  1832. int alarmSound;
  1833. REGISTER_VARIABLES()
  1834. {
  1835. SAVE_VARIABLE(active, 1);
  1836. SAVE_VARIABLE(alarmSound, 2);
  1837. }
  1838. void Created( GameObject * obj )
  1839. {
  1840. active = false;
  1841. Vector3 myPosition = Commands->Get_Position ( obj );
  1842. alarmSound = Commands->Create_Sound ( "SFX.Klaxon_Alert_01", myPosition, obj );
  1843. Commands->Stop_Sound ( alarmSound, false );
  1844. }
  1845. void Killed( GameObject * obj, GameObject * killer )
  1846. {
  1847. if (active == true)
  1848. {
  1849. Commands->Stop_Sound ( alarmSound, true );
  1850. Vector3 powerupSpawnLocation = Commands->Get_Position (obj);
  1851. powerupSpawnLocation.Z = -34.539f;
  1852. Commands->Create_Object ( "POW_RocketLauncher_Player", powerupSpawnLocation );
  1853. }
  1854. }
  1855. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1856. {
  1857. ActionParamsStruct params;
  1858. if (param == M01_START_ACTING_JDG)
  1859. {
  1860. if (obj)
  1861. {
  1862. active = true;
  1863. Commands->Start_Sound ( alarmSound );
  1864. float myAccuracy = Commands->Get_Random ( 0, 1 );
  1865. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  1866. params.Set_Attack( STAR, 100, myAccuracy, true );
  1867. Commands->Action_Attack( obj, params );
  1868. }
  1869. }
  1870. }
  1871. };
  1872. DECLARE_SCRIPT(M11_WarRoom_BattleController_JDG, "")//M11_WARROOM_SECURITY_CONTROLLER_JDG 100361
  1873. {
  1874. bool okay_to_spawn_warroom;
  1875. bool okay_to_spawn_barracks;
  1876. int active_soldier_count;
  1877. int alarmSound;
  1878. int spawnedSoldierCount;
  1879. int maxSpawnedSoldierCount;
  1880. REGISTER_VARIABLES()
  1881. {
  1882. SAVE_VARIABLE(okay_to_spawn_warroom, 1);
  1883. SAVE_VARIABLE(okay_to_spawn_barracks, 2);
  1884. SAVE_VARIABLE(active_soldier_count, 3);
  1885. SAVE_VARIABLE(alarmSound, 4);
  1886. SAVE_VARIABLE(spawnedSoldierCount, 5);
  1887. SAVE_VARIABLE(maxSpawnedSoldierCount, 6);
  1888. }
  1889. void Created( GameObject * obj )
  1890. {
  1891. okay_to_spawn_warroom = false;
  1892. okay_to_spawn_barracks = false;
  1893. active_soldier_count = 4;
  1894. spawnedSoldierCount = 0;
  1895. }
  1896. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1897. {
  1898. if (param == M01_SPAWNER_IS_DEAD_JDG)
  1899. {
  1900. active_soldier_count--;
  1901. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  1902. }
  1903. else if (param == M01_START_ACTING_JDG)
  1904. {
  1905. okay_to_spawn_warroom = true;
  1906. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  1907. }
  1908. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)
  1909. {
  1910. int currentDifficulty = Commands->Get_Difficulty_Level();;
  1911. int hard = 2;
  1912. int med = 1;
  1913. if (currentDifficulty == hard)
  1914. {
  1915. maxSpawnedSoldierCount = 18;
  1916. }
  1917. else if (currentDifficulty == med)
  1918. {
  1919. maxSpawnedSoldierCount = 12;
  1920. }
  1921. else
  1922. {
  1923. maxSpawnedSoldierCount = 6;
  1924. }
  1925. if (spawnedSoldierCount < maxSpawnedSoldierCount)
  1926. {
  1927. if (active_soldier_count < 8)
  1928. {
  1929. if (okay_to_spawn_warroom == true)//M11_WARROOM_SECURITY_SPAWNER_02_JDG
  1930. {
  1931. active_soldier_count++;
  1932. spawnedSoldierCount++;
  1933. active_soldier_count++;
  1934. spawnedSoldierCount++;
  1935. GameObject * newGuy = Commands->Trigger_Spawner( M11_WARROOM_SECURITY_SPAWNER_JDG );
  1936. Commands->Attach_Script(newGuy, "M11_WarRoom_SpawnedDude_JDG", "");
  1937. GameObject * newGuy02 = Commands->Trigger_Spawner( M11_WARROOM_SECURITY_SPAWNER_02_JDG );
  1938. Commands->Attach_Script(newGuy02, "M11_WarRoom_SpawnedDude_JDG", "");
  1939. }
  1940. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 1 );
  1941. }
  1942. }
  1943. }
  1944. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//player is leaving room--disable warroom spawn ability
  1945. {
  1946. okay_to_spawn_warroom = false;
  1947. okay_to_spawn_barracks = true;
  1948. }
  1949. }
  1950. };
  1951. DECLARE_SCRIPT(M11_WarRoom_SpawnedDude_JDG, "")//M11_WARROOM_SECURITY_SPAWNER_JDG 100362
  1952. {
  1953. void Created( GameObject * obj )
  1954. {
  1955. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
  1956. Commands->Enable_Hibernation( obj, false );
  1957. ActionParamsStruct params;
  1958. params.Set_Basic(this, 100, M01_GOING_TO_HAVOC_JDG);
  1959. params.Set_Movement( STAR, RUN, 10 );
  1960. params.Set_Attack( STAR, 10, 0, true );
  1961. Commands->Action_Attack ( obj, params );
  1962. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_IDLE_JDG, 60 );
  1963. }
  1964. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  1965. {
  1966. if (obj && param == M01_GOTO_IDLE_JDG)
  1967. {
  1968. Commands->Enable_Hibernation( obj, true );
  1969. }
  1970. }
  1971. void Killed( GameObject * obj, GameObject * killer )
  1972. {
  1973. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_WARROOM_SECURITY_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  1974. }
  1975. };
  1976. DECLARE_SCRIPT(M11_WarRoom_ExitZone_JDG, "")
  1977. {
  1978. void Entered( GameObject * obj, GameObject * enterer )
  1979. {
  1980. if (enterer == STAR)
  1981. {
  1982. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_WARROOM_SECURITY_CONTROLLER_JDG ), 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  1983. GameObject * zone01 = Commands->Find_Object ( 100363 );
  1984. GameObject * zone02 = Commands->Find_Object ( 100364 );
  1985. if (zone01 != NULL)
  1986. {
  1987. Commands->Destroy_Object ( zone01 );
  1988. }
  1989. if (zone02 != NULL)
  1990. {
  1991. Commands->Destroy_Object ( zone02 );
  1992. }
  1993. }
  1994. }
  1995. };
  1996. /***********************************************************************************************************************
  1997. Putting scripts dealing with the barracks/living quarters encounters here
  1998. ************************************************************************************************************************/
  1999. DECLARE_SCRIPT(M11_Barracks_SpawnerController_JDG, "")//M11_BARRACKS_SPAWNER_CONTROLLER_JDG 100430
  2000. {
  2001. int spawn_01_ID;
  2002. int spawn_02_ID;
  2003. int spawn_03_ID;
  2004. REGISTER_VARIABLES()
  2005. {
  2006. SAVE_VARIABLE(spawn_01_ID, 1);
  2007. SAVE_VARIABLE(spawn_02_ID, 2);
  2008. SAVE_VARIABLE(spawn_03_ID, 3);
  2009. }
  2010. void Created( GameObject * obj )
  2011. {
  2012. spawn_01_ID = 0;
  2013. spawn_02_ID = 0;
  2014. spawn_03_ID = 0;
  2015. }
  2016. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2017. {
  2018. if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)
  2019. {
  2020. GameObject * spawnedGuy01 = Commands->Find_Object ( spawn_01_ID );
  2021. GameObject * spawnedGuy02 = Commands->Find_Object ( spawn_02_ID );
  2022. GameObject * spawnedGuy03 = Commands->Find_Object ( spawn_03_ID );
  2023. if (spawnedGuy01 == NULL)
  2024. {
  2025. GameObject * spawnedGuy01 = Commands->Trigger_Spawner( M11_BARRACKS_SPAWNER_01_JDG );
  2026. Commands->Attach_Script(spawnedGuy01, "M11_Barracks_SpawnedDude_JDG", "");
  2027. spawn_01_ID = Commands->Get_ID ( spawnedGuy01 );
  2028. }
  2029. if (spawnedGuy02 == NULL)
  2030. {
  2031. GameObject * spawnedGuy02 = Commands->Trigger_Spawner( M11_BARRACKS_SPAWNER_02_JDG );
  2032. Commands->Attach_Script(spawnedGuy02, "M11_Barracks_SpawnedDude_JDG", "");
  2033. spawn_02_ID = Commands->Get_ID ( spawnedGuy02 );
  2034. }
  2035. if (spawnedGuy03 == NULL)
  2036. {
  2037. GameObject * spawnedGuy03 = Commands->Trigger_Spawner( M11_BARRACKS_SPAWNER_03_JDG );
  2038. Commands->Attach_Script(spawnedGuy03, "M11_Barracks_SpawnedDude_JDG", "");
  2039. spawn_03_ID = Commands->Get_ID ( spawnedGuy03 );
  2040. }
  2041. }
  2042. }
  2043. };
  2044. Vector3 m11BarracksSeachLocations[9] = {
  2045. Vector3(-12.2f, 1.3f, -34.2f),
  2046. Vector3(1.2f, -11.1f, -34.2f),
  2047. Vector3(13.2f, 2.0f, -34.2f),
  2048. Vector3(0.2f, -16.6f, -34.2f),
  2049. Vector3(-9.8f, -9.0f, -38.2f),
  2050. Vector3(-10, 2.5f, -38.2f),
  2051. Vector3(0.7f, -11.0f, -38.2f),
  2052. Vector3(10.8f, -8.9f, -38.2f),
  2053. Vector3(10.4f, 2.4f, -38.2f),
  2054. };
  2055. DECLARE_SCRIPT(M11_Barracks_SpawnedDude_JDG, "")//
  2056. {
  2057. int last;
  2058. REGISTER_VARIABLES()
  2059. {
  2060. SAVE_VARIABLE(last, 1);
  2061. }
  2062. void Created( GameObject * obj )
  2063. {
  2064. last = 20;
  2065. Commands->Set_Innate_Aggressiveness ( obj, 1 );
  2066. Commands->Set_Innate_Take_Cover_Probability ( obj, 0 );
  2067. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 3 );
  2068. }
  2069. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2070. {
  2071. switch (param)
  2072. {
  2073. case M01_PICK_A_NEW_LOCATION_JDG:
  2074. {
  2075. int random = Commands->Get_Random_Int(0, 9);
  2076. while (random == last) {
  2077. random = Commands->Get_Random_Int(0, 9);
  2078. }
  2079. last = random;
  2080. Vector3 NewGotoLocation = m11BarracksSeachLocations[random];
  2081. ActionParamsStruct params;
  2082. params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, M01_WALKING_WAYPATH_01_JDG );
  2083. params.Set_Movement( NewGotoLocation, RUN, 3, false );
  2084. Commands->Action_Goto( obj, params );
  2085. }
  2086. break;
  2087. }
  2088. }
  2089. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2090. {
  2091. ActionParamsStruct params;
  2092. switch (complete_reason)
  2093. {
  2094. case ACTION_COMPLETE_NORMAL:
  2095. {
  2096. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  2097. {
  2098. char *animationName = M01_Choose_Search_Animation ( );
  2099. params.Set_Basic( this, INNATE_PRIORITY_ENEMY_SEEN - 5, M01_DOING_ANIMATION_01_JDG );
  2100. params.Set_Animation (animationName, false);
  2101. Commands->Action_Play_Animation (obj, params);
  2102. }
  2103. else if (action_id == M01_DOING_ANIMATION_01_JDG)
  2104. {
  2105. Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  2106. }
  2107. }
  2108. break;
  2109. }
  2110. }
  2111. };
  2112. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T20_EntryZone_JDG, "")//100414 entry to mutant reject w/volt ammo
  2113. {
  2114. //THESE ARE THE DUDES YOU CONTROL
  2115. //M11_BARRACKS_MUTANT_REJECT_JDG 100415
  2116. bool firstEntry;
  2117. REGISTER_VARIABLES()
  2118. {
  2119. SAVE_VARIABLE(firstEntry, 1);
  2120. }
  2121. void Created( GameObject * obj )
  2122. {
  2123. firstEntry = true;
  2124. }
  2125. void Entered( GameObject * obj, GameObject * enterer )
  2126. {
  2127. if (enterer == STAR)
  2128. {
  2129. if (firstEntry == true)
  2130. {
  2131. firstEntry = false;
  2132. GameObject * mutantReject = Commands->Find_Object ( M11_BARRACKS_MUTANT_REJECT_JDG );
  2133. if (mutantReject != NULL)
  2134. {
  2135. Commands->Send_Custom_Event ( obj, mutantReject, 0, M01_START_ACTING_JDG, 0 );
  2136. }
  2137. }
  2138. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2139. }
  2140. }
  2141. };
  2142. DECLARE_SCRIPT(M11_Barracks_MutantReject_JDG, "")//M11_BARRACKS_MUTANT_REJECT_JDG 100415
  2143. {
  2144. void Created( GameObject * obj )
  2145. {
  2146. Commands->Innate_Disable(obj);
  2147. }
  2148. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2149. {
  2150. if (param == M01_START_ACTING_JDG)
  2151. {
  2152. //this guys orders are to charge the player upon entry to this room
  2153. Commands->Innate_Enable(obj);
  2154. ActionParamsStruct params;
  2155. params.Set_Basic(this, 100, M01_GOING_TO_HAVOC_JDG);
  2156. params.Set_Movement( STAR, RUN, 1 );
  2157. params.Set_Attack( STAR, 1, 0, true );
  2158. Commands->Action_Attack ( obj, params );
  2159. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  2160. Vector3 myPosition = Commands->Get_Position ( obj );
  2161. Commands->Create_Sound ( soundName, myPosition, obj );
  2162. }
  2163. }
  2164. };
  2165. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T19_EntryZone_JDG, "")//100404 entry to scientist guy
  2166. {
  2167. //THESE ARE THE DUDES YOU CONTROL
  2168. //M11_BARRACKS_SCIENTIST_JDG 100405
  2169. bool firstEntry;
  2170. REGISTER_VARIABLES()
  2171. {
  2172. SAVE_VARIABLE(firstEntry, 1);
  2173. }
  2174. void Created( GameObject * obj )
  2175. {
  2176. firstEntry = true;
  2177. }
  2178. void Entered( GameObject * obj, GameObject * enterer )
  2179. {
  2180. if (enterer == STAR)
  2181. {
  2182. if (firstEntry == true)
  2183. {
  2184. firstEntry = false;
  2185. GameObject * scientist = Commands->Find_Object ( M11_BARRACKS_SCIENTIST_JDG );
  2186. if (scientist != NULL)
  2187. {
  2188. Commands->Send_Custom_Event ( obj, scientist, 0, M01_START_ACTING_JDG, 0 );
  2189. }
  2190. }
  2191. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2192. }
  2193. }
  2194. };
  2195. DECLARE_SCRIPT(M11_Barracks_Scientist_JDG, "")//M11_BARRACKS_SCIENTIST_JDG 100405
  2196. {
  2197. int scientist_conv01;
  2198. int scientist_conv02;
  2199. int scientist_conv03;
  2200. int scientist_conv04;
  2201. bool deadYet;
  2202. REGISTER_VARIABLES()
  2203. {
  2204. SAVE_VARIABLE(scientist_conv01, 1);
  2205. SAVE_VARIABLE(scientist_conv02, 2);
  2206. SAVE_VARIABLE(scientist_conv03, 3);
  2207. SAVE_VARIABLE(scientist_conv04, 4);
  2208. SAVE_VARIABLE(deadYet, 5);
  2209. }
  2210. void Created( GameObject * obj )
  2211. {
  2212. deadYet = false;
  2213. ActionParamsStruct params;
  2214. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  2215. params.Set_Animation ("H_A_HOST_L2B", true);
  2216. Commands->Action_Play_Animation (obj, params);
  2217. }
  2218. void Killed( GameObject * obj, GameObject * killer )
  2219. {
  2220. deadYet = true;
  2221. }
  2222. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2223. {
  2224. if (type == CUSTOM_EVENT_CONVERSATION_BEGAN || type == CUSTOM_EVENT_CONVERSATION_REMARK_STARTED || type == CUSTOM_EVENT_CONVERSATION_REMARK_ENDED)
  2225. {
  2226. }
  2227. else if (param == M01_START_ACTING_JDG)
  2228. {
  2229. if (obj && STAR && deadYet == false)
  2230. {
  2231. scientist_conv01 = Commands->Create_Conversation( "M11_Barracks_M19_Conversation_01_JDG", 100, 30, true);
  2232. Commands->Join_Conversation( obj, scientist_conv01, false, true, false );
  2233. Commands->Join_Conversation( STAR, scientist_conv01, false, false, false );
  2234. Commands->Start_Conversation( scientist_conv01, scientist_conv01 );
  2235. Commands->Monitor_Conversation( obj, scientist_conv01 );
  2236. ActionParamsStruct params;
  2237. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  2238. params.Set_Animation ("H_A_HOST_L2B", true);
  2239. Commands->Action_Play_Animation (obj, params);
  2240. }
  2241. }
  2242. }
  2243. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2244. {
  2245. ActionParamsStruct params;
  2246. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  2247. {
  2248. if (action_id == scientist_conv01)
  2249. {
  2250. if (obj && STAR && deadYet == false)
  2251. {
  2252. scientist_conv02 = Commands->Create_Conversation( "M11_Barracks_M19_Conversation_02_JDG", 100, 30, true);
  2253. Commands->Join_Conversation( obj, scientist_conv02, false, true, false );
  2254. Commands->Join_Conversation( STAR, scientist_conv02, false, false, false );
  2255. Commands->Start_Conversation( scientist_conv02, scientist_conv02 );
  2256. Commands->Monitor_Conversation( obj, scientist_conv02 );
  2257. ActionParamsStruct params;
  2258. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  2259. params.Set_Animation ("H_A_HOST_L2B", true);
  2260. Commands->Action_Play_Animation (obj, params);
  2261. }
  2262. }
  2263. else if (action_id == scientist_conv02)
  2264. {
  2265. if (obj && STAR && deadYet == false)
  2266. {
  2267. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );//stand up hands over head
  2268. params.Set_Animation ("H_A_HOST_L2C", false);
  2269. Commands->Action_Play_Animation (obj, params);
  2270. }
  2271. }
  2272. else if (action_id == scientist_conv03)
  2273. {
  2274. if (obj && STAR && deadYet == false)
  2275. {
  2276. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
  2277. params.Set_Movement( Vector3 (14.045f, -8.178f, -38.236f), WALK, 1 );
  2278. Commands->Action_Goto( obj, params );
  2279. }
  2280. }
  2281. else if (action_id == scientist_conv04)
  2282. {
  2283. if (obj && STAR && deadYet == false)
  2284. {
  2285. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
  2286. params.Set_Movement( Vector3 (0.115f, -10.796f, -34.233f), RUN, 1 );
  2287. Commands->Action_Goto( obj, params );
  2288. }
  2289. }
  2290. }
  2291. else if (action_id == M01_DOING_ANIMATION_02_JDG)
  2292. {
  2293. if (obj && STAR && deadYet == false)
  2294. {
  2295. params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );//stand up loop--one time
  2296. params.Set_Animation ("H_A_HOST_L1B", false);
  2297. Commands->Action_Play_Animation (obj, params);
  2298. }
  2299. }
  2300. else if (action_id == M01_DOING_ANIMATION_03_JDG)
  2301. {
  2302. if (obj && STAR && deadYet == false)
  2303. {
  2304. params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );//stand up--put hands down
  2305. params.Set_Animation ("H_A_HOST_L1C", false);
  2306. Commands->Action_Play_Animation (obj, params);
  2307. }
  2308. }
  2309. else if (action_id == M01_DOING_ANIMATION_04_JDG)
  2310. {
  2311. if (obj && STAR && deadYet == false)
  2312. {
  2313. scientist_conv03 = Commands->Create_Conversation( "M11_Barracks_M19_Conversation_03_JDG", 100, 30, true);
  2314. Commands->Join_Conversation( obj, scientist_conv03, false, true, true );
  2315. Commands->Join_Conversation( STAR, scientist_conv03, false, false, false );
  2316. Commands->Start_Conversation( scientist_conv03, scientist_conv03 );
  2317. Commands->Monitor_Conversation( obj, scientist_conv03 );
  2318. }
  2319. }
  2320. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  2321. {
  2322. if (obj && STAR && deadYet == false)
  2323. {
  2324. scientist_conv04 = Commands->Create_Conversation( "M11_Barracks_M19_Conversation_04_JDG", 100, 100, true);
  2325. Commands->Join_Conversation( obj, scientist_conv04, false, true, true );
  2326. Commands->Start_Conversation( scientist_conv04, scientist_conv04 );
  2327. Commands->Monitor_Conversation( obj, scientist_conv04 );
  2328. }
  2329. }
  2330. else if (action_id == M01_WALKING_WAYPATH_03_JDG)
  2331. {
  2332. Commands->Set_Innate_Is_Stationary (obj, true);
  2333. }
  2334. }
  2335. };
  2336. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T18_EntryZone_JDG, "")//100401 this is room where black hand rags on tech
  2337. {
  2338. //THESE ARE THE DUDES YOU CONTROL
  2339. //M11_BARRACKS_RAGSESSION_TECH_JDG 100402
  2340. //M11_BARRACKS_RAGSESSION_BLACKHAND_JDG 100403
  2341. bool firstEntry;
  2342. REGISTER_VARIABLES()
  2343. {
  2344. SAVE_VARIABLE(firstEntry, 1);
  2345. }
  2346. void Created( GameObject * obj )
  2347. {
  2348. firstEntry = true;
  2349. }
  2350. void Entered( GameObject * obj, GameObject * enterer )
  2351. {
  2352. if (enterer == STAR)
  2353. {
  2354. if (firstEntry == true)
  2355. {
  2356. firstEntry = false;
  2357. GameObject * blackhand = Commands->Find_Object ( M11_BARRACKS_RAGSESSION_BLACKHAND_JDG );
  2358. GameObject * tech = Commands->Find_Object ( M11_BARRACKS_RAGSESSION_TECH_JDG );
  2359. if (blackhand != NULL)
  2360. {
  2361. Commands->Send_Custom_Event ( obj, blackhand, 0, M01_START_ACTING_JDG, 0 );
  2362. }
  2363. if (tech != NULL)
  2364. {
  2365. Commands->Send_Custom_Event ( obj, tech, 0, M01_START_ACTING_JDG, 0 );
  2366. }
  2367. }
  2368. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2369. }
  2370. }
  2371. };
  2372. DECLARE_SCRIPT(M11_Barracks_TechnicianConversation_Blackhand_JDG, "")//M11_BARRACKS_RAGSESSION_BLACKHAND_JDG 100403
  2373. {
  2374. int rag_conv;
  2375. REGISTER_VARIABLES()
  2376. {
  2377. SAVE_VARIABLE(rag_conv, 1);
  2378. }
  2379. void Created( GameObject * obj )
  2380. {
  2381. Commands->Innate_Disable(obj);
  2382. }
  2383. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2384. {
  2385. if (param == M01_START_ACTING_JDG)
  2386. {
  2387. Commands->Innate_Enable(obj);
  2388. GameObject * tech = Commands->Find_Object ( M11_BARRACKS_RAGSESSION_TECH_JDG );
  2389. if (tech != NULL)
  2390. {
  2391. rag_conv = Commands->Create_Conversation( "M11_Barracks_M18_Conversation_JDG", 100, 50, true);
  2392. Commands->Join_Conversation( obj, rag_conv, false, true, true );
  2393. Commands->Join_Conversation( tech, rag_conv, false, true, true );
  2394. Commands->Start_Conversation( rag_conv, rag_conv );
  2395. Commands->Monitor_Conversation( obj, rag_conv );
  2396. }
  2397. }
  2398. }
  2399. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2400. {
  2401. ActionParamsStruct params;
  2402. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  2403. {
  2404. if (action_id == rag_conv)
  2405. {
  2406. GameObject * tech = Commands->Find_Object ( M11_BARRACKS_RAGSESSION_TECH_JDG );
  2407. if (tech != NULL)
  2408. {
  2409. Commands->Send_Custom_Event ( obj, tech, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  2410. }
  2411. params.Set_Basic(this, 60, M01_GOING_TO_HAVOC_JDG);
  2412. params.Set_Attack( STAR, 10, 0, true );
  2413. Commands->Action_Attack ( obj, params );
  2414. }
  2415. }
  2416. }
  2417. };
  2418. DECLARE_SCRIPT(M11_Barracks_TechnicianConversation_Tech_JDG, "")//M11_BARRACKS_RAGSESSION_TECH_JDG 100402
  2419. {
  2420. void Created( GameObject * obj )
  2421. {
  2422. Commands->Innate_Disable(obj);
  2423. }
  2424. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2425. {
  2426. if (param == M01_START_ACTING_JDG)
  2427. {
  2428. Commands->Innate_Enable(obj);
  2429. }
  2430. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  2431. {
  2432. ActionParamsStruct params;
  2433. params.Set_Basic(this, 60, M01_GOING_TO_HAVOC_JDG);
  2434. params.Set_Attack( STAR, 10, 0, true );
  2435. Commands->Action_Attack ( obj, params );
  2436. }
  2437. }
  2438. };
  2439. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T14_EntryZone_JDG, "")//100399 this is the showers
  2440. {
  2441. //THESE ARE THE DUDES YOU CONTROL
  2442. //M11_BARRACKS_STEALTHSOLDIER_JDG 100400
  2443. bool firstEntry;
  2444. REGISTER_VARIABLES()
  2445. {
  2446. SAVE_VARIABLE(firstEntry, 1);
  2447. }
  2448. void Created( GameObject * obj )
  2449. {
  2450. firstEntry = true;
  2451. }
  2452. void Entered( GameObject * obj, GameObject * enterer )
  2453. {
  2454. if (enterer == STAR)
  2455. {
  2456. if (firstEntry == true)
  2457. {
  2458. firstEntry = false;
  2459. GameObject * stealthSoldier = Commands->Find_Object ( M11_BARRACKS_STEALTHSOLDIER_JDG );
  2460. if (stealthSoldier != NULL)
  2461. {
  2462. Commands->Send_Custom_Event ( obj, stealthSoldier, 0, M01_START_ACTING_JDG, 0 );
  2463. }
  2464. }
  2465. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2466. }
  2467. }
  2468. };
  2469. DECLARE_SCRIPT(M11_Barracks_ShowerStealthSoldier_JDG, "")//M11_BARRACKS_STEALTHSOLDIER_JDG 100400
  2470. {
  2471. bool killedYet;
  2472. REGISTER_VARIABLES()
  2473. {
  2474. SAVE_VARIABLE(killedYet, 1);
  2475. }
  2476. void Created( GameObject * obj )
  2477. {
  2478. killedYet = false;
  2479. Commands->Enable_Stealth (obj, false);
  2480. Commands->Set_Innate_Is_Stationary ( obj, true );
  2481. Commands->Set_Loiters_Allowed(obj, false );
  2482. }
  2483. void Killed( GameObject * obj, GameObject * killer )
  2484. {
  2485. killedYet = true;
  2486. }
  2487. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2488. {
  2489. ActionParamsStruct params;
  2490. if (param == M01_START_ACTING_JDG)
  2491. {
  2492. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  2493. }
  2494. else if (param == M01_MODIFY_YOUR_ACTION_JDG && killedYet == false)
  2495. {
  2496. int showerConv = Commands->Create_Conversation( "M11_Shower_StealthGuy_Conversation", 90, 30, true);
  2497. Commands->Join_Conversation( obj, showerConv, false, true, true );
  2498. Commands->Start_Conversation( showerConv, showerConv );
  2499. Commands->Enable_Stealth (obj, true);
  2500. Commands->Set_Innate_Is_Stationary ( obj, false );
  2501. }
  2502. }
  2503. };
  2504. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T17_EntryZone_JDG, "")//100393 this is entrance to visceroid room
  2505. {
  2506. bool firstEntry;
  2507. REGISTER_VARIABLES()
  2508. {
  2509. SAVE_VARIABLE(firstEntry, 1);
  2510. }
  2511. void Created( GameObject * obj )
  2512. {
  2513. firstEntry = true;
  2514. }
  2515. void Entered( GameObject * obj, GameObject * enterer )
  2516. {
  2517. if (enterer == STAR)
  2518. {
  2519. if (firstEntry == true)
  2520. {
  2521. firstEntry = false;
  2522. GameObject * visceroid = Commands->Find_Object ( 100394 );
  2523. if (visceroid != NULL)
  2524. {
  2525. Commands->Send_Custom_Event ( obj, visceroid, 0, M01_START_ACTING_JDG, 1 );
  2526. }
  2527. GameObject * visceroid02 = Commands->Find_Object ( 101402 );
  2528. if (visceroid02 != NULL)
  2529. {
  2530. Commands->Send_Custom_Event ( obj, visceroid02, 0, M01_START_ACTING_JDG, 1 );
  2531. }
  2532. GameObject * visceroid03 = Commands->Find_Object ( 101403 );
  2533. if (visceroid03 != NULL)
  2534. {
  2535. Commands->Send_Custom_Event ( obj, visceroid03, 0, M01_START_ACTING_JDG, 1 );
  2536. }
  2537. GameObject * visceroid04 = Commands->Find_Object ( 101404 );
  2538. if (visceroid04 != NULL)
  2539. {
  2540. Commands->Send_Custom_Event ( obj, visceroid04, 0, M01_START_ACTING_JDG, 0 );
  2541. }
  2542. }
  2543. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2544. }
  2545. }
  2546. };
  2547. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T15_EntryZone_JDG, "")//this is a bedroom on left side 100377 2 nod soldiers talking about escaped mutants
  2548. {
  2549. //THESE ARE THE DUDES YOU CONTROL
  2550. //M11_BARRACKS_MUTANTCONVERSATION_GUY01_JDG 100378
  2551. //M11_BARRACKS_MUTANTCONVERSATION_GUY02_JDG 100379
  2552. bool firstEntry;
  2553. REGISTER_VARIABLES()
  2554. {
  2555. SAVE_VARIABLE(firstEntry, 1);
  2556. }
  2557. void Created( GameObject * obj )
  2558. {
  2559. firstEntry = true;
  2560. }
  2561. void Entered( GameObject * obj, GameObject * enterer )
  2562. {
  2563. if (enterer == STAR)
  2564. {
  2565. if (firstEntry == true)
  2566. {
  2567. firstEntry = false;
  2568. GameObject * conversationGuy01 = Commands->Find_Object ( M11_BARRACKS_MUTANTCONVERSATION_GUY01_JDG );
  2569. GameObject * conversationGuy02 = Commands->Find_Object ( M11_BARRACKS_MUTANTCONVERSATION_GUY02_JDG );
  2570. if (conversationGuy01 != NULL)
  2571. {
  2572. Commands->Send_Custom_Event ( obj, conversationGuy01, 0, M01_START_ACTING_JDG, 0 );
  2573. }
  2574. if (conversationGuy02 != NULL)
  2575. {
  2576. Commands->Send_Custom_Event ( obj, conversationGuy02, 0, M01_START_ACTING_JDG, 0 );
  2577. }
  2578. }
  2579. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2580. }
  2581. }
  2582. };
  2583. DECLARE_SCRIPT(M11_Barracks_MutantConversationGuy_01_JDG, "")//M11_BARRACKS_MUTANTCONVERSATION_GUY01_JDG 100378
  2584. {
  2585. bool killedYet;
  2586. int mutant_conv;
  2587. REGISTER_VARIABLES()
  2588. {
  2589. SAVE_VARIABLE(killedYet, 1);
  2590. SAVE_VARIABLE(mutant_conv, 2);
  2591. }
  2592. void Created( GameObject * obj )
  2593. {
  2594. killedYet = false;
  2595. Commands->Innate_Disable(obj);
  2596. }
  2597. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2598. {
  2599. if (type == CUSTOM_EVENT_CONVERSATION_BEGAN || type == CUSTOM_EVENT_CONVERSATION_REMARK_STARTED || type == CUSTOM_EVENT_CONVERSATION_REMARK_ENDED)
  2600. {
  2601. }
  2602. else if (param == M01_START_ACTING_JDG)
  2603. {
  2604. Commands->Innate_Enable(obj);
  2605. GameObject * conversationGuy02 = Commands->Find_Object ( M11_BARRACKS_MUTANTCONVERSATION_GUY02_JDG );
  2606. if (obj && conversationGuy02 != NULL)
  2607. {
  2608. mutant_conv = Commands->Create_Conversation( "M11_Barracks_M15_Conversation_JDG", 100, 30, true);
  2609. Commands->Join_Conversation( obj, mutant_conv, true, true, true );
  2610. Commands->Join_Conversation( conversationGuy02, mutant_conv, true, true, true );
  2611. Commands->Start_Conversation( mutant_conv, mutant_conv );
  2612. Commands->Monitor_Conversation( obj, mutant_conv );
  2613. }
  2614. }
  2615. }
  2616. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  2617. {
  2618. ActionParamsStruct params;
  2619. if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
  2620. {
  2621. if (action_id == mutant_conv)
  2622. {
  2623. GameObject * conversationGuy02 = Commands->Find_Object ( M11_BARRACKS_MUTANTCONVERSATION_GUY02_JDG );
  2624. if (conversationGuy02 != NULL)
  2625. {
  2626. Commands->Send_Custom_Event ( obj, conversationGuy02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  2627. }
  2628. Commands->Action_Reset ( obj, 100 );
  2629. params.Set_Basic(this, 60, M01_GOING_TO_HAVOC_JDG);
  2630. params.Set_Movement( STAR, RUN, 1, false );
  2631. Commands->Action_Goto( obj, params );
  2632. }
  2633. }
  2634. }
  2635. };
  2636. DECLARE_SCRIPT(M11_Barracks_MutantConversationGuy_02_JDG, "")//M11_BARRACKS_MUTANTCONVERSATION_GUY02_JDG 100379
  2637. {
  2638. void Created( GameObject * obj )
  2639. {
  2640. Commands->Innate_Disable(obj);
  2641. }
  2642. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2643. {
  2644. ActionParamsStruct params;
  2645. if (param == M01_START_ACTING_JDG)
  2646. {
  2647. Commands->Innate_Enable(obj);
  2648. }
  2649. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  2650. {
  2651. Commands->Action_Reset ( obj, 100 );
  2652. params.Set_Basic(this, 60, M01_GOING_TO_HAVOC_JDG);
  2653. params.Set_Movement( STAR, RUN, 1, false );
  2654. Commands->Action_Goto( obj, params );
  2655. }
  2656. }
  2657. };
  2658. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T13_EntryZone_JDG, "")//this is entry into mutant/toilet bathroom 100376
  2659. {
  2660. //THESE ARE THE DUDES YOU CONTROL
  2661. //M11_BARRACKS_TOILET_MUTANT_01_JDG 100374
  2662. //M11_BARRACKS_TOILET_MUTANT_02_JDG 100375
  2663. bool firstEntry;
  2664. REGISTER_VARIABLES()
  2665. {
  2666. SAVE_VARIABLE(firstEntry, 1);
  2667. }
  2668. void Created( GameObject * obj )
  2669. {
  2670. firstEntry = true;
  2671. }
  2672. void Entered( GameObject * obj, GameObject * enterer )
  2673. {
  2674. if (enterer == STAR)
  2675. {
  2676. if (firstEntry == true)
  2677. {
  2678. firstEntry = false;
  2679. GameObject * mutant01 = Commands->Find_Object ( M11_BARRACKS_TOILET_MUTANT_01_JDG );
  2680. GameObject * mutant02 = Commands->Find_Object ( M11_BARRACKS_TOILET_MUTANT_02_JDG );
  2681. if (mutant01 != NULL)
  2682. {
  2683. Commands->Send_Custom_Event ( obj, mutant01, 0, M01_START_ACTING_JDG, 0 );
  2684. }
  2685. if (mutant02 != NULL)
  2686. {
  2687. Commands->Send_Custom_Event ( obj, mutant02, 0, M01_START_ACTING_JDG, 0 );
  2688. }
  2689. }
  2690. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2691. }
  2692. }
  2693. };
  2694. DECLARE_SCRIPT(M11_Barracks_ToiletMutant01_JDG, "")//this guys ID is M11_BARRACKS_TOILET_MUTANT_01_JDG 100374
  2695. {
  2696. void Created( GameObject * obj )
  2697. {
  2698. Commands->Set_Loiters_Allowed( obj, false );
  2699. ActionParamsStruct params;
  2700. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  2701. params.Set_Animation ("S_A_HUMAN.H_A_A0A0_L28B", true);
  2702. Commands->Action_Play_Animation (obj, params);
  2703. }
  2704. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2705. {
  2706. ActionParamsStruct params;
  2707. if (param == M01_START_ACTING_JDG)
  2708. {
  2709. Commands->Innate_Enable(obj);
  2710. float delayTimer = Commands->Get_Random ( 0, 1 );
  2711. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  2712. }
  2713. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  2714. {
  2715. Vector3 myPosition = Commands->Get_Position ( obj );
  2716. Commands->Create_Sound ("M11DSGN_DSGN0052I1MEIN_SND", myPosition, obj );
  2717. float delayTimer = Commands->Get_Random ( 1, 3 );
  2718. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  2719. }
  2720. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  2721. {
  2722. ActionParamsStruct params;
  2723. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  2724. params.Set_Animation ("S_A_HUMAN.H_A_A0A0_L28C", false);
  2725. Commands->Action_Play_Animation (obj, params);
  2726. }
  2727. }
  2728. };
  2729. DECLARE_SCRIPT(M11_Barracks_ToiletMutant02_JDG, "")//this guys ID is M11_BARRACKS_TOILET_MUTANT_02_JDG 100375
  2730. {
  2731. void Created( GameObject * obj )
  2732. {
  2733. Commands->Set_Loiters_Allowed( obj, false );
  2734. ActionParamsStruct params;
  2735. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  2736. params.Set_Animation ("S_A_HUMAN.H_A_A0A0_L28B", true);
  2737. Commands->Action_Play_Animation (obj, params);
  2738. }
  2739. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2740. {
  2741. ActionParamsStruct params;
  2742. if (param == M01_START_ACTING_JDG)
  2743. {
  2744. Commands->Innate_Enable(obj);
  2745. float delayTimer = Commands->Get_Random ( 0, 1 );
  2746. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  2747. }
  2748. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  2749. {
  2750. Vector3 myPosition = Commands->Get_Position ( obj );
  2751. Commands->Create_Sound ("M11DSGN_DSGN0051I1MEIN_SND", myPosition, obj );
  2752. float delayTimer = Commands->Get_Random ( 1, 3 );
  2753. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  2754. }
  2755. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  2756. {
  2757. ActionParamsStruct params;
  2758. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  2759. params.Set_Animation ("S_A_HUMAN.H_A_A0A0_L28C", false);
  2760. Commands->Action_Play_Animation (obj, params);
  2761. }
  2762. }
  2763. };
  2764. DECLARE_SCRIPT(M11_Barracks_LivingQuarters_T16_EntryZone_JDG, "")//100385 this is where 2 mutants are attacking a blackhand guy
  2765. {
  2766. //THESE ARE THE DUDES YOU CONTROL
  2767. //M11_BARRACKS_MUTANTUPRISING_BLACKHAND_JDG 100387
  2768. //M11_BARRACKS_MUTANTUPRISING_MUTANT01_JDG 100388
  2769. //M11_BARRACKS_MUTANTUPRISING_MUTANT02_JDG 100389
  2770. bool firstEntry;
  2771. REGISTER_VARIABLES()
  2772. {
  2773. SAVE_VARIABLE(firstEntry, 1);
  2774. }
  2775. void Created( GameObject * obj )
  2776. {
  2777. firstEntry = true;
  2778. }
  2779. void Entered( GameObject * obj, GameObject * enterer )
  2780. {
  2781. if (enterer == STAR)
  2782. {
  2783. if (firstEntry == true)
  2784. {
  2785. firstEntry = false;
  2786. GameObject * mutant01 = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_MUTANT01_JDG );
  2787. GameObject * mutant02 = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_MUTANT02_JDG );
  2788. GameObject * blackhand = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_BLACKHAND_JDG );
  2789. if (mutant01 != NULL)
  2790. {
  2791. Commands->Send_Custom_Event ( obj, mutant01, 0, M01_START_ACTING_JDG, 0 );
  2792. }
  2793. if (mutant02 != NULL)
  2794. {
  2795. Commands->Send_Custom_Event ( obj, mutant02, 0, M01_START_ACTING_JDG, 0 );
  2796. }
  2797. if (blackhand != NULL)
  2798. {
  2799. Commands->Send_Custom_Event ( obj, blackhand, 0, M01_START_ACTING_JDG, 0 );
  2800. }
  2801. }
  2802. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_BARRACKS_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2803. }
  2804. }
  2805. };
  2806. /***********************************************************************************************************************
  2807. Putting main laboratory related scripts here
  2808. ************************************************************************************************************************/
  2809. DECLARE_SCRIPT(M11_Laboratory_EntryZone_JDG, "")
  2810. {
  2811. void Entered( GameObject * obj, GameObject * enterer )
  2812. {
  2813. if (enterer == STAR)
  2814. {
  2815. GameObject * mutant01 = Commands->Find_Object ( 100450 );
  2816. GameObject * mutant02 = Commands->Find_Object ( 100451 );
  2817. GameObject * scientist01 = Commands->Find_Object ( 100449 );
  2818. GameObject * scientist02 = Commands->Find_Object ( 100958 );
  2819. if (mutant01 != NULL)
  2820. {
  2821. Commands->Send_Custom_Event( obj, mutant01, 0, M01_START_ACTING_JDG, 0 );
  2822. }
  2823. if (mutant02 != NULL)
  2824. {
  2825. Commands->Send_Custom_Event( obj, mutant02, 0, M01_START_ACTING_JDG, 0 );
  2826. }
  2827. if (scientist01 != NULL)
  2828. {
  2829. Commands->Send_Custom_Event( obj, scientist01, 0, M01_START_ACTING_JDG, 0 );
  2830. }
  2831. if (scientist02 != NULL)
  2832. {
  2833. Commands->Send_Custom_Event( obj, scientist02, 0, M01_START_ACTING_JDG, 0 );
  2834. }
  2835. Commands->Destroy_Object (obj);//one time only zone--cleaning up
  2836. }
  2837. }
  2838. };
  2839. DECLARE_SCRIPT(M11_Mutant_TrajectoryBone_JDG, "")//
  2840. {
  2841. void Created( GameObject * obj )
  2842. {
  2843. Commands->Enable_Hibernation(obj, false );
  2844. Commands->Set_Animation ( obj, "X11E_Trajectory.X11E_Trajectory", false, NULL, 0, 120 );
  2845. }
  2846. void Animation_Complete(GameObject * obj, const char *anim)
  2847. {
  2848. if (stricmp(anim, "X11E_Trajectory.X11E_Trajectory") == 0)
  2849. {
  2850. Commands->Destroy_Object ( obj );
  2851. }
  2852. }
  2853. };
  2854. DECLARE_SCRIPT(M11_Mutant_ShatterGlass_JDG, "")
  2855. {
  2856. void Created( GameObject * obj )
  2857. {
  2858. Commands->Enable_Hibernation(obj, false );
  2859. Commands->Set_Animation ( obj, "X11E_Shatter.X11E_Shatter", false, NULL, 0, 120 );
  2860. }
  2861. void Animation_Complete(GameObject * obj, const char *anim)
  2862. {
  2863. if (stricmp(anim, "X11E_Shatter.X11E_Shatter") == 0)
  2864. {
  2865. Commands->Destroy_Object ( obj );
  2866. }
  2867. }
  2868. };
  2869. DECLARE_SCRIPT(M11_Cryochamber_DestroyedSimple_JDG, "")
  2870. {
  2871. void Created( GameObject * obj )
  2872. {
  2873. Vector3 myPosition = Commands->Get_Position ( obj );
  2874. Commands->Set_Shield_Type ( obj, "Blamo" );
  2875. Commands->Set_Animation_Frame ( obj, "DSP_CRYOBIGD.DSP_CRYOBIGD", 0 );
  2876. Commands->Set_Health ( obj, 0.25f );
  2877. }
  2878. void Damaged( GameObject * obj, GameObject * damager, float amount )
  2879. {
  2880. Commands->Set_Animation ( obj, "DSP_CRYOBIGD.DSP_CRYOBIGD", false, NULL, 0, 5 );
  2881. Commands->Set_Health ( obj, 0.25f );
  2882. }
  2883. };
  2884. /***********************************************************************************************************************
  2885. Putting Mutant crypt related scripts here...turn on spawner--turn off spawners etc...
  2886. ************************************************************************************************************************/
  2887. DECLARE_SCRIPT(M11_Turn_On_Mutant_Crypt_Spawners_Zone_JDG, "")
  2888. {
  2889. void Entered( GameObject * obj, GameObject * enterer )
  2890. {
  2891. if (enterer == STAR)
  2892. {
  2893. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  2894. if (mutantController != NULL)
  2895. {
  2896. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  2897. }
  2898. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  2899. }
  2900. }
  2901. };
  2902. DECLARE_SCRIPT(M11_Mutant_Crypt_Spawners_Controller_JDG, "")//this guys ID is M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG 100013
  2903. {
  2904. int mutantSpawner01_guy_ID;
  2905. int mutantSpawner02_guy_ID;
  2906. int mutantSpawner03_guy_ID;
  2907. int mutantSpawner04_guy_ID;
  2908. int mutantSpawner05_guy_ID;
  2909. int mutantSpawner06_guy_ID;
  2910. bool okay_to_spawn;
  2911. REGISTER_VARIABLES()
  2912. {
  2913. SAVE_VARIABLE(mutantSpawner01_guy_ID, 1);
  2914. SAVE_VARIABLE(mutantSpawner02_guy_ID, 2);
  2915. SAVE_VARIABLE(mutantSpawner03_guy_ID, 3);
  2916. SAVE_VARIABLE(mutantSpawner04_guy_ID, 4);
  2917. SAVE_VARIABLE(mutantSpawner05_guy_ID, 5);
  2918. SAVE_VARIABLE(mutantSpawner06_guy_ID, 6);
  2919. SAVE_VARIABLE(okay_to_spawn, 7);
  2920. }
  2921. void Created( GameObject * obj )
  2922. {
  2923. okay_to_spawn = false;
  2924. }
  2925. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  2926. {
  2927. if (type == 0)
  2928. {
  2929. switch (param)
  2930. {
  2931. case M01_SPAWNER_SPAWN_PLEASE_JDG: //M00_Select_Empty_Hands
  2932. {
  2933. okay_to_spawn = true;
  2934. GameObject * mutantSpawner01_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_01_JDG );
  2935. Commands->Attach_Script(mutantSpawner01_guy, "M11_MutantCrypt_Spawner02_Guy_JDG", "");
  2936. mutantSpawner01_guy_ID = Commands->Get_ID ( mutantSpawner01_guy );
  2937. Commands->Attach_Script(mutantSpawner01_guy, "M00_Select_Empty_Hands", "");
  2938. GameObject * mutantSpawner02_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_02_JDG );
  2939. Commands->Attach_Script(mutantSpawner02_guy, "M11_MutantCrypt_Spawner02_Guy_JDG", "");
  2940. mutantSpawner02_guy_ID = Commands->Get_ID ( mutantSpawner02_guy );
  2941. Commands->Attach_Script(mutantSpawner02_guy, "M00_Select_Empty_Hands", "");
  2942. GameObject * mutantSpawner03_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_03_JDG );
  2943. Commands->Attach_Script(mutantSpawner03_guy, "M11_MutantCrypt_Spawner03_Guy_JDG", "");
  2944. mutantSpawner03_guy_ID = Commands->Get_ID ( mutantSpawner03_guy );
  2945. Commands->Attach_Script(mutantSpawner03_guy, "M00_Select_Empty_Hands", "");
  2946. GameObject * mutantSpawner04_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_04_JDG );
  2947. Commands->Attach_Script(mutantSpawner04_guy, "M11_MutantCrypt_Spawner04_Guy_JDG", "");
  2948. mutantSpawner04_guy_ID = Commands->Get_ID ( mutantSpawner04_guy );
  2949. Commands->Attach_Script(mutantSpawner04_guy, "M00_Select_Empty_Hands", "");
  2950. GameObject * mutantSpawner05_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_05_JDG );
  2951. Commands->Attach_Script(mutantSpawner05_guy, "M11_MutantCrypt_Spawner05_Guy_JDG", "");
  2952. mutantSpawner05_guy_ID = Commands->Get_ID ( mutantSpawner05_guy );
  2953. Commands->Attach_Script(mutantSpawner05_guy, "M00_Select_Empty_Hands", "");
  2954. GameObject * mutantSpawner06_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_06_JDG );
  2955. Commands->Attach_Script(mutantSpawner06_guy, "M11_MutantCrypt_Spawner06_Guy_JDG", "");
  2956. mutantSpawner06_guy_ID = Commands->Get_ID ( mutantSpawner06_guy );
  2957. Commands->Attach_Script(mutantSpawner06_guy, "M00_Select_Empty_Hands", "");
  2958. }
  2959. break;
  2960. case M01_QUIT_SPAWNING_PLEASE_JDG:
  2961. {
  2962. okay_to_spawn = false;
  2963. }
  2964. break;
  2965. case M01_SPAWNER_IS_DEAD_JDG:
  2966. {
  2967. if (okay_to_spawn == true)
  2968. {
  2969. GameObject * mutantSpawner01_guy = Commands->Find_Object ( mutantSpawner01_guy_ID );
  2970. GameObject * mutantSpawner02_guy = Commands->Find_Object ( mutantSpawner02_guy_ID );
  2971. GameObject * mutantSpawner03_guy = Commands->Find_Object ( mutantSpawner03_guy_ID );
  2972. GameObject * mutantSpawner04_guy = Commands->Find_Object ( mutantSpawner04_guy_ID );
  2973. GameObject * mutantSpawner05_guy = Commands->Find_Object ( mutantSpawner05_guy_ID );
  2974. GameObject * mutantSpawner06_guy = Commands->Find_Object ( mutantSpawner06_guy_ID );
  2975. if (sender == mutantSpawner01_guy)
  2976. {
  2977. GameObject * newMutantSpawner01_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_01_JDG );
  2978. Commands->Attach_Script(newMutantSpawner01_guy, "M11_MutantCrypt_Spawner02_Guy_JDG", "");
  2979. mutantSpawner01_guy_ID = Commands->Get_ID ( newMutantSpawner01_guy );
  2980. Commands->Attach_Script(mutantSpawner01_guy, "M00_Select_Empty_Hands", "");
  2981. }
  2982. else if (sender == mutantSpawner02_guy)
  2983. {
  2984. GameObject * newMutantSpawner02_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_02_JDG );
  2985. Commands->Attach_Script(newMutantSpawner02_guy, "M11_MutantCrypt_Spawner02_Guy_JDG", "");
  2986. mutantSpawner02_guy_ID = Commands->Get_ID ( newMutantSpawner02_guy );
  2987. Commands->Attach_Script(mutantSpawner02_guy, "M00_Select_Empty_Hands", "");
  2988. }
  2989. else if (sender == mutantSpawner03_guy)
  2990. {
  2991. GameObject * newMutantSpawner03_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_03_JDG );
  2992. Commands->Attach_Script(newMutantSpawner03_guy, "M11_MutantCrypt_Spawner03_Guy_JDG", "");
  2993. mutantSpawner03_guy_ID = Commands->Get_ID ( newMutantSpawner03_guy );
  2994. Commands->Attach_Script(mutantSpawner03_guy, "M00_Select_Empty_Hands", "");
  2995. }
  2996. else if (sender == mutantSpawner04_guy)
  2997. {
  2998. GameObject * newMutantSpawner04_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_04_JDG );
  2999. Commands->Attach_Script(newMutantSpawner04_guy, "M11_MutantCrypt_Spawner04_Guy_JDG", "");
  3000. mutantSpawner04_guy_ID = Commands->Get_ID ( newMutantSpawner04_guy );
  3001. Commands->Attach_Script(mutantSpawner04_guy, "M00_Select_Empty_Hands", "");
  3002. }
  3003. else if (sender == mutantSpawner05_guy)
  3004. {
  3005. GameObject * newMutantSpawner05_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_05_JDG );
  3006. Commands->Attach_Script(newMutantSpawner05_guy, "M11_MutantCrypt_Spawner05_Guy_JDG", "");
  3007. mutantSpawner05_guy_ID = Commands->Get_ID ( newMutantSpawner05_guy );
  3008. Commands->Attach_Script(mutantSpawner05_guy, "M00_Select_Empty_Hands", "");
  3009. }
  3010. else if (sender == mutantSpawner06_guy)
  3011. {
  3012. GameObject * newMutantSpawner06_guy = Commands->Trigger_Spawner( M11_MUTANT_CRYPT_SPAWNER_06_JDG );
  3013. Commands->Attach_Script(newMutantSpawner06_guy, "M11_MutantCrypt_Spawner06_Guy_JDG", "");
  3014. mutantSpawner06_guy_ID = Commands->Get_ID ( newMutantSpawner06_guy );
  3015. Commands->Attach_Script(mutantSpawner06_guy, "M00_Select_Empty_Hands", "");
  3016. }
  3017. }
  3018. }
  3019. break;
  3020. }
  3021. }
  3022. }
  3023. };
  3024. DECLARE_SCRIPT(M11_MutantCrypt_Spawner06_Guy_JDG, "")//this one has been fixed for wacky findpath bug
  3025. {
  3026. typedef enum {
  3027. IDLE,
  3028. ATTACKING,
  3029. DEAD,
  3030. } M11_Mutant_State;
  3031. M11_Mutant_State myState;
  3032. REGISTER_VARIABLES()
  3033. {
  3034. SAVE_VARIABLE(myState, 1);
  3035. }
  3036. void Created( GameObject * obj )
  3037. {
  3038. Commands->Select_Weapon(obj, NULL );
  3039. myState = IDLE;
  3040. float delayTimer = Commands->Get_Random ( 10, 20 );
  3041. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3042. Commands->Send_Custom_Event ( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  3043. }
  3044. void Killed( GameObject * obj, GameObject * killer )
  3045. {
  3046. myState = DEAD;
  3047. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  3048. if (mutantController != NULL)
  3049. {
  3050. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  3051. }
  3052. }
  3053. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3054. {
  3055. if (obj && enemy == STAR && myState == IDLE)//
  3056. {
  3057. myState = ATTACKING;
  3058. char *soundName = M11_Choose_Mutant_Alerted_Sound ( );
  3059. Vector3 myPosition = Commands->Get_Position ( obj );
  3060. Commands->Create_Sound ( soundName, myPosition, obj );
  3061. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3062. Commands->Create_Logical_Sound (obj, M11_MUTANT_IS_NEARBY_JDG, myPosition, 50 );
  3063. }
  3064. }
  3065. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3066. {
  3067. if ( sound.Type == M11_MUTANT_IS_NEARBY_JDG )
  3068. {
  3069. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3070. }
  3071. }
  3072. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3073. {
  3074. if (param == M01_START_ACTING_JDG)
  3075. {
  3076. if (obj && myState == IDLE)
  3077. {
  3078. char *soundName = M11_Choose_Mutant_Idle_Sound ( );
  3079. Vector3 myPosition = Commands->Get_Position ( obj );
  3080. Commands->Create_Sound ( soundName, myPosition, obj );
  3081. float delayTimer = Commands->Get_Random ( 10, 20 );
  3082. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3083. }
  3084. else if (obj && myState != DEAD)
  3085. {
  3086. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3087. Vector3 myPosition = Commands->Get_Position ( obj );
  3088. Commands->Create_Sound ( soundName, myPosition, obj );
  3089. float delayTimer = Commands->Get_Random ( 0, 10 );
  3090. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3091. }
  3092. }
  3093. else if (obj && param == M01_PICK_A_NEW_LOCATION_JDG)
  3094. {
  3095. ActionParamsStruct params;
  3096. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3097. params.Set_Movement( Vector3(66.505f, 47.147f, -62.686f), .1f, 1 );
  3098. Commands->Action_Goto( obj, params );
  3099. }
  3100. else if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3101. {
  3102. if (STAR)
  3103. {
  3104. ActionParamsStruct params;
  3105. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3106. params.Set_Movement(STAR, 2, 1);
  3107. Commands->Action_Goto ( obj, params );
  3108. }
  3109. else
  3110. {
  3111. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3112. }
  3113. }
  3114. }
  3115. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3116. {
  3117. ActionParamsStruct params;
  3118. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3119. {
  3120. if (obj && action_id == M01_PICK_A_NEW_LOCATION_JDG)
  3121. {
  3122. ActionParamsStruct params;
  3123. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
  3124. params.Set_Movement( Vector3(0,0,0), .1f, 1 );
  3125. int random = Commands->Get_Random_Int(0, 3);
  3126. if (random == 0)
  3127. {
  3128. params.WaypathID = 100021;
  3129. params.WaypointStartID = 100022;
  3130. params.WaypointEndID = 100028;
  3131. }
  3132. else if (random == 1)
  3133. {
  3134. params.WaypathID = 100021;
  3135. params.WaypointStartID = 100028;
  3136. params.WaypointEndID = 100022;
  3137. }
  3138. else
  3139. {
  3140. params.WaypathID = 100030;
  3141. params.WaypointStartID = 100031;
  3142. params.WaypointEndID = 100040;
  3143. }
  3144. Commands->Action_Goto( obj, params );
  3145. }
  3146. else if (obj && action_id == M01_WALKING_WAYPATH_01_JDG)
  3147. {
  3148. char *animationName = M01_Choose_Idle_Animation ( );
  3149. params.Set_Basic( this, 60, M01_DOING_ANIMATION_01_JDG );
  3150. params.Set_Animation (animationName, false);
  3151. Commands->Action_Play_Animation (obj, params);
  3152. }
  3153. else if (obj && action_id == M01_DOING_ANIMATION_01_JDG)
  3154. {
  3155. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3156. params.Set_Movement( Vector3(66.505f, 47.147f, -62.686f), .1f, 1 );
  3157. Commands->Action_Goto( obj, params );
  3158. }
  3159. else if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3160. {
  3161. if (STAR)
  3162. {
  3163. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3164. Vector3 myPosition = Commands->Get_Position ( obj );
  3165. Commands->Create_Sound ( soundName, myPosition, obj );
  3166. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3167. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3168. params.Set_Animation (animationName, false);
  3169. Commands->Action_Play_Animation (obj, params);
  3170. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3171. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3172. }
  3173. }
  3174. }
  3175. }
  3176. };
  3177. DECLARE_SCRIPT(M11_MutantCrypt_Spawner05_Guy_JDG, "")
  3178. {
  3179. typedef enum {
  3180. IDLE,
  3181. ATTACKING,
  3182. DEAD,
  3183. } M11_Mutant_State;
  3184. M11_Mutant_State myState;
  3185. REGISTER_VARIABLES()
  3186. {
  3187. SAVE_VARIABLE(myState, 1);
  3188. }
  3189. void Created( GameObject * obj )
  3190. {
  3191. Commands->Select_Weapon(obj, NULL );
  3192. myState = IDLE;
  3193. float delayTimer = Commands->Get_Random ( 10, 20 );
  3194. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3195. Commands->Send_Custom_Event ( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  3196. }
  3197. void Killed( GameObject * obj, GameObject * killer )
  3198. {
  3199. myState = DEAD;
  3200. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  3201. if (mutantController != NULL)
  3202. {
  3203. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  3204. }
  3205. }
  3206. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3207. {
  3208. if (obj && enemy == STAR && myState == IDLE)//
  3209. {
  3210. myState = ATTACKING;
  3211. char *soundName = M11_Choose_Mutant_Alerted_Sound ( );
  3212. Vector3 myPosition = Commands->Get_Position ( obj );
  3213. Commands->Create_Sound ( soundName, myPosition, obj );
  3214. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3215. Commands->Create_Logical_Sound (obj, M11_MUTANT_IS_NEARBY_JDG, myPosition, 50 );
  3216. }
  3217. }
  3218. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3219. {
  3220. if ( sound.Type == M11_MUTANT_IS_NEARBY_JDG )
  3221. {
  3222. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3223. }
  3224. }
  3225. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3226. {
  3227. if (param == M01_START_ACTING_JDG)
  3228. {
  3229. if (obj && myState == IDLE)
  3230. {
  3231. char *soundName = M11_Choose_Mutant_Idle_Sound ( );
  3232. Vector3 myPosition = Commands->Get_Position ( obj );
  3233. Commands->Create_Sound ( soundName, myPosition, obj );
  3234. float delayTimer = Commands->Get_Random ( 10, 20 );
  3235. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3236. }
  3237. else if (obj && myState != DEAD)
  3238. {
  3239. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3240. Vector3 myPosition = Commands->Get_Position ( obj );
  3241. Commands->Create_Sound ( soundName, myPosition, obj );
  3242. float delayTimer = Commands->Get_Random ( 0, 10 );
  3243. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3244. }
  3245. }
  3246. else if (obj && param == M01_PICK_A_NEW_LOCATION_JDG)
  3247. {
  3248. ActionParamsStruct params;
  3249. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3250. params.Set_Movement( Vector3(27.367f, 18.382f, -63.748f), .1f, 1 );
  3251. Commands->Action_Goto( obj, params );
  3252. }
  3253. else if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3254. {
  3255. if (STAR)
  3256. {
  3257. ActionParamsStruct params;
  3258. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3259. params.Set_Movement(STAR, 2, 1);
  3260. Commands->Action_Goto ( obj, params );
  3261. }
  3262. else
  3263. {
  3264. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3265. }
  3266. }
  3267. }
  3268. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3269. {
  3270. ActionParamsStruct params;
  3271. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3272. {
  3273. if (obj && action_id == M01_PICK_A_NEW_LOCATION_JDG)
  3274. {
  3275. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
  3276. params.Set_Movement( Vector3(0,0,0), .1f, 1 );
  3277. int random = Commands->Get_Random_Int(0, 4);
  3278. if (random == 0)
  3279. {
  3280. params.WaypathID = 100041;
  3281. params.WaypointStartID = 100042;
  3282. params.WaypointEndID = 100049;
  3283. }
  3284. else if (random == 1)
  3285. {
  3286. params.WaypathID = 100041;
  3287. params.WaypointStartID = 100049;
  3288. params.WaypointEndID = 100042;
  3289. }
  3290. else if (random == 3)
  3291. {
  3292. params.WaypathID = 100051;
  3293. params.WaypointStartID = 100052;
  3294. params.WaypointEndID = 100061;
  3295. }
  3296. else
  3297. {
  3298. params.WaypathID = 100051;
  3299. params.WaypointStartID = 100061;
  3300. params.WaypointEndID = 100052;
  3301. }
  3302. Commands->Action_Goto( obj, params );
  3303. }
  3304. else if (obj && action_id == M01_WALKING_WAYPATH_01_JDG)
  3305. {
  3306. char *animationName = M01_Choose_Idle_Animation ( );
  3307. params.Set_Basic( this, 60, M01_DOING_ANIMATION_01_JDG );
  3308. params.Set_Animation (animationName, false);
  3309. Commands->Action_Play_Animation (obj, params);
  3310. }
  3311. else if (obj && action_id == M01_DOING_ANIMATION_01_JDG)
  3312. {
  3313. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3314. params.Set_Movement( Vector3(27.367f, 18.382f, -63.748f), .1f, 1 );
  3315. Commands->Action_Goto( obj, params );
  3316. }
  3317. else if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3318. {
  3319. if (STAR)
  3320. {
  3321. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3322. Vector3 myPosition = Commands->Get_Position ( obj );
  3323. Commands->Create_Sound ( soundName, myPosition, obj );
  3324. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3325. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3326. params.Set_Animation (animationName, false);
  3327. Commands->Action_Play_Animation (obj, params);
  3328. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3329. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3330. }
  3331. }
  3332. }
  3333. }
  3334. };
  3335. DECLARE_SCRIPT(M11_MutantCrypt_Spawner04_Guy_JDG, "")
  3336. {
  3337. typedef enum {
  3338. IDLE,
  3339. ATTACKING,
  3340. DEAD,
  3341. } M11_Mutant_State;
  3342. M11_Mutant_State myState;
  3343. REGISTER_VARIABLES()
  3344. {
  3345. SAVE_VARIABLE(myState, 1);
  3346. }
  3347. void Created( GameObject * obj )
  3348. {
  3349. Commands->Select_Weapon(obj, NULL );
  3350. myState = IDLE;
  3351. float delayTimer = Commands->Get_Random ( 10, 20 );
  3352. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3353. ActionParamsStruct params;
  3354. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3355. params.Set_Movement( Vector3(5.531f, -10.830f, -63.749f), .1f, 1 );
  3356. Commands->Action_Goto( obj, params );
  3357. }
  3358. void Killed( GameObject * obj, GameObject * killer )
  3359. {
  3360. myState = DEAD;
  3361. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  3362. if (mutantController != NULL)
  3363. {
  3364. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  3365. }
  3366. }
  3367. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3368. {
  3369. if (obj && enemy == STAR && myState == IDLE)//
  3370. {
  3371. myState = ATTACKING;
  3372. char *soundName = M11_Choose_Mutant_Alerted_Sound ( );
  3373. Vector3 myPosition = Commands->Get_Position ( obj );
  3374. Commands->Create_Sound ( soundName, myPosition, obj );
  3375. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3376. Commands->Create_Logical_Sound (obj, M11_MUTANT_IS_NEARBY_JDG, myPosition, 50 );
  3377. }
  3378. }
  3379. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3380. {
  3381. if ( sound.Type == M11_MUTANT_IS_NEARBY_JDG )
  3382. {
  3383. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3384. }
  3385. }
  3386. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3387. {
  3388. if (param == M01_START_ACTING_JDG)
  3389. {
  3390. if (obj && myState == IDLE)
  3391. {
  3392. char *soundName = M11_Choose_Mutant_Idle_Sound ( );
  3393. Vector3 myPosition = Commands->Get_Position ( obj );
  3394. Commands->Create_Sound ( soundName, myPosition, obj );
  3395. float delayTimer = Commands->Get_Random ( 10, 20 );
  3396. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3397. }
  3398. else if (obj && myState != DEAD)
  3399. {
  3400. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3401. Vector3 myPosition = Commands->Get_Position ( obj );
  3402. Commands->Create_Sound ( soundName, myPosition, obj );
  3403. float delayTimer = Commands->Get_Random ( 0, 10 );
  3404. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3405. }
  3406. }
  3407. else if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3408. {
  3409. if (STAR)
  3410. {
  3411. ActionParamsStruct params;
  3412. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3413. params.Set_Movement(STAR, 2, 1);
  3414. Commands->Action_Goto ( obj, params );
  3415. }
  3416. else
  3417. {
  3418. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3419. }
  3420. }
  3421. }
  3422. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3423. {
  3424. ActionParamsStruct params;
  3425. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3426. {
  3427. if (obj && action_id == M01_PICK_A_NEW_LOCATION_JDG)
  3428. {
  3429. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3430. params.Set_Movement( Vector3(0,0,0), .1f, 1 );
  3431. params.WaypathID = 100063;
  3432. Commands->Action_Goto( obj, params );
  3433. }
  3434. else if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3435. {
  3436. if (STAR)
  3437. {
  3438. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3439. Vector3 myPosition = Commands->Get_Position ( obj );
  3440. Commands->Create_Sound ( soundName, myPosition, obj );
  3441. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3442. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3443. params.Set_Animation (animationName, false);
  3444. Commands->Action_Play_Animation (obj, params);
  3445. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3446. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3447. }
  3448. }
  3449. }
  3450. }
  3451. };
  3452. DECLARE_SCRIPT(M11_MutantCrypt_Spawner03_Guy_JDG, "")
  3453. {
  3454. typedef enum {
  3455. IDLE,
  3456. ATTACKING,
  3457. DEAD,
  3458. } M11_Mutant_State;
  3459. M11_Mutant_State myState;
  3460. REGISTER_VARIABLES()
  3461. {
  3462. SAVE_VARIABLE(myState, 1);
  3463. }
  3464. void Created( GameObject * obj )
  3465. {
  3466. Commands->Select_Weapon(obj, NULL );
  3467. myState = IDLE;
  3468. float delayTimer = Commands->Get_Random ( 10, 20 );
  3469. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3470. Commands->Send_Custom_Event ( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
  3471. }
  3472. void Killed( GameObject * obj, GameObject * killer )
  3473. {
  3474. myState = DEAD;
  3475. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  3476. if (mutantController != NULL)
  3477. {
  3478. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  3479. }
  3480. }
  3481. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3482. {
  3483. if (obj && enemy == STAR && myState == IDLE)//
  3484. {
  3485. myState = ATTACKING;
  3486. char *soundName = M11_Choose_Mutant_Alerted_Sound ( );
  3487. Vector3 myPosition = Commands->Get_Position ( obj );
  3488. Commands->Create_Sound ( soundName, myPosition, obj );
  3489. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3490. Commands->Create_Logical_Sound (obj, M11_MUTANT_IS_NEARBY_JDG, myPosition, 50 );
  3491. }
  3492. }
  3493. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3494. {
  3495. if ( sound.Type == M11_MUTANT_IS_NEARBY_JDG )
  3496. {
  3497. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3498. }
  3499. }
  3500. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3501. {
  3502. if (param == M01_START_ACTING_JDG)
  3503. {
  3504. if (obj && myState == IDLE)
  3505. {
  3506. char *soundName = M11_Choose_Mutant_Idle_Sound ( );
  3507. Vector3 myPosition = Commands->Get_Position ( obj );
  3508. Commands->Create_Sound ( soundName, myPosition, obj );
  3509. float delayTimer = Commands->Get_Random ( 10, 20 );
  3510. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3511. }
  3512. else if (obj && myState != DEAD)
  3513. {
  3514. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3515. Vector3 myPosition = Commands->Get_Position ( obj );
  3516. Commands->Create_Sound ( soundName, myPosition, obj );
  3517. float delayTimer = Commands->Get_Random ( 0, 10 );
  3518. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3519. }
  3520. }
  3521. else if (obj && param == M01_PICK_A_NEW_LOCATION_JDG)
  3522. {
  3523. ActionParamsStruct params;
  3524. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3525. params.Set_Movement( Vector3(-15.128f, 17.965f, -63.748f), .1f, 1 );
  3526. Commands->Action_Goto( obj, params );
  3527. }
  3528. else if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3529. {
  3530. if (STAR)
  3531. {
  3532. ActionParamsStruct params;
  3533. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3534. params.Set_Movement(STAR, 2, 1);
  3535. Commands->Action_Goto ( obj, params );
  3536. }
  3537. else
  3538. {
  3539. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3540. }
  3541. }
  3542. }
  3543. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3544. {
  3545. ActionParamsStruct params;
  3546. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3547. {
  3548. if (obj && action_id == M01_PICK_A_NEW_LOCATION_JDG)
  3549. {
  3550. ActionParamsStruct params;
  3551. params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
  3552. params.Set_Movement( Vector3(0,0,0), .1f, 1 );
  3553. int random = Commands->Get_Random_Int(0, 4);
  3554. if (random == 0)
  3555. {
  3556. params.WaypathID = 100076;
  3557. params.WaypointStartID = 100077;
  3558. params.WaypointEndID = 100085;
  3559. }
  3560. else if (random == 1)
  3561. {
  3562. params.WaypathID = 100087;
  3563. params.WaypointStartID = 100088;
  3564. params.WaypointEndID = 100096;
  3565. }
  3566. else if (random == 3)
  3567. {
  3568. params.WaypathID = 100076;
  3569. params.WaypointStartID = 100085;
  3570. params.WaypointEndID = 100077;
  3571. }
  3572. else
  3573. {
  3574. params.WaypathID = 100087;
  3575. params.WaypointStartID = 100096;
  3576. params.WaypointEndID = 100088;
  3577. }
  3578. Commands->Action_Goto( obj, params );
  3579. }
  3580. else if (obj && action_id == M01_WALKING_WAYPATH_01_JDG)
  3581. {
  3582. char *animationName = M01_Choose_Idle_Animation ( );
  3583. params.Set_Basic( this, 60, M01_DOING_ANIMATION_01_JDG );
  3584. params.Set_Animation (animationName, false);
  3585. Commands->Action_Play_Animation (obj, params);
  3586. }
  3587. else if (obj && action_id == M01_DOING_ANIMATION_01_JDG)
  3588. {
  3589. ActionParamsStruct params;
  3590. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3591. params.Set_Movement( Vector3(-15.128f, 17.965f, -63.748f), .1f, 1 );
  3592. Commands->Action_Goto( obj, params );
  3593. }
  3594. else if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3595. {
  3596. if (STAR)
  3597. {
  3598. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3599. Vector3 myPosition = Commands->Get_Position ( obj );
  3600. Commands->Create_Sound ( soundName, myPosition, obj );
  3601. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3602. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3603. params.Set_Animation (animationName, false);
  3604. Commands->Action_Play_Animation (obj, params);
  3605. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3606. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3607. }
  3608. }
  3609. }
  3610. }
  3611. };
  3612. DECLARE_SCRIPT(M11_MutantCrypt_Spawner02_Guy_JDG, "")//this script goes on mutant 1 and 2--just hunting player with this guy
  3613. {
  3614. typedef enum {
  3615. IDLE,
  3616. ATTACKING,
  3617. DEAD,
  3618. } M11_Mutant_State;
  3619. M11_Mutant_State myState;
  3620. REGISTER_VARIABLES()
  3621. {
  3622. SAVE_VARIABLE(myState, 1);
  3623. }
  3624. void Created( GameObject * obj )
  3625. {
  3626. Commands->Select_Weapon(obj, NULL );
  3627. myState = IDLE;
  3628. float delayTimer = Commands->Get_Random ( 10, 20 );
  3629. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3630. ActionParamsStruct params;
  3631. params.Set_Basic(this, 80, M01_PICK_A_NEW_LOCATION_JDG);
  3632. params.Set_Movement( STAR, .1f, 1 );
  3633. Commands->Action_Goto( obj, params );
  3634. }
  3635. void Killed( GameObject * obj, GameObject * killer )
  3636. {
  3637. myState = DEAD;
  3638. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  3639. if (mutantController != NULL)
  3640. {
  3641. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  3642. }
  3643. }
  3644. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3645. {
  3646. if (obj && enemy == STAR && myState == IDLE)//
  3647. {
  3648. myState = ATTACKING;
  3649. char *soundName = M11_Choose_Mutant_Alerted_Sound ( );
  3650. Vector3 myPosition = Commands->Get_Position ( obj );
  3651. Commands->Create_Sound ( soundName, myPosition, obj );
  3652. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3653. Commands->Create_Logical_Sound (obj, M11_MUTANT_IS_NEARBY_JDG, myPosition, 50 );
  3654. }
  3655. }
  3656. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3657. {
  3658. if ( sound.Type == M11_MUTANT_IS_NEARBY_JDG )
  3659. {
  3660. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3661. }
  3662. }
  3663. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3664. {
  3665. if (param == M01_START_ACTING_JDG)
  3666. {
  3667. if (obj && myState == IDLE)
  3668. {
  3669. char *soundName = M11_Choose_Mutant_Idle_Sound ( );
  3670. Vector3 myPosition = Commands->Get_Position ( obj );
  3671. Commands->Create_Sound ( soundName, myPosition, obj );
  3672. float delayTimer = Commands->Get_Random ( 10, 20 );
  3673. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3674. }
  3675. else if (obj && myState != DEAD)
  3676. {
  3677. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3678. Vector3 myPosition = Commands->Get_Position ( obj );
  3679. Commands->Create_Sound ( soundName, myPosition, obj );
  3680. float delayTimer = Commands->Get_Random ( 0, 10 );
  3681. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
  3682. }
  3683. }
  3684. else if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3685. {
  3686. if (STAR)
  3687. {
  3688. ActionParamsStruct params;
  3689. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3690. params.Set_Movement(STAR, 2, 1);
  3691. Commands->Action_Goto ( obj, params );
  3692. }
  3693. else
  3694. {
  3695. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3696. }
  3697. }
  3698. }
  3699. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3700. {
  3701. ActionParamsStruct params;
  3702. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3703. {
  3704. if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3705. {
  3706. if (STAR)
  3707. {
  3708. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3709. Vector3 myPosition = Commands->Get_Position ( obj );
  3710. Commands->Create_Sound ( soundName, myPosition, obj );
  3711. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3712. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3713. params.Set_Animation (animationName, false);
  3714. Commands->Action_Play_Animation (obj, params);
  3715. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3716. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3717. }
  3718. }
  3719. }
  3720. }
  3721. };
  3722. /***********************************************************************************************************************
  3723. Putting POWERCORE related scripts here
  3724. ************************************************************************************************************************/
  3725. DECLARE_SCRIPT(M11_PowerCore_WanderingMutant_JDG, "")//
  3726. {
  3727. void Created( GameObject * obj )
  3728. {
  3729. Vector3 myPosition = Commands->Get_Position ( obj );
  3730. GameObject * myTarget = Commands->Find_Closest_Soldier ( myPosition, 0, 50, true );
  3731. if (myTarget != NULL)
  3732. {
  3733. ActionParamsStruct params;
  3734. params.Set_Basic( this, 95, M01_WALKING_WAYPATH_01_JDG );
  3735. params.Set_Movement( myTarget, RUN, .25f );
  3736. Commands->Action_Goto( obj, params );
  3737. }
  3738. }
  3739. };
  3740. DECLARE_SCRIPT(M11_PowerCore_WanderingMutantSpawner_JDG, "")//
  3741. {
  3742. void Created( GameObject * obj )
  3743. {
  3744. Commands->Enable_Hibernation( obj, false );
  3745. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 30 );
  3746. ActionParamsStruct params;
  3747. params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
  3748. params.Set_Movement( STAR, 1.0f, 1.0f );
  3749. Commands->Action_Goto( obj, params );
  3750. }
  3751. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3752. {
  3753. if (obj && param == M01_HUNT_THE_PLAYER_JDG)
  3754. {
  3755. if (STAR)
  3756. {
  3757. ActionParamsStruct params;
  3758. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3759. params.Set_Movement(STAR, 1.0f, 1);
  3760. Commands->Action_Goto ( obj, params );
  3761. }
  3762. else
  3763. {
  3764. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3765. }
  3766. }
  3767. else if (obj && param == M01_MODIFY_YOUR_ACTION_JDG)
  3768. {
  3769. Commands->Enable_Hibernation( obj, true );
  3770. }
  3771. }
  3772. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  3773. {
  3774. ActionParamsStruct params;
  3775. if (complete_reason == ACTION_COMPLETE_NORMAL)
  3776. {
  3777. if (obj && action_id == M01_HUNT_THE_PLAYER_JDG)
  3778. {
  3779. if (STAR)
  3780. {
  3781. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  3782. Vector3 myPosition = Commands->Get_Position ( obj );
  3783. Commands->Create_Sound ( soundName, myPosition, obj );
  3784. char *animationName = M11_Choose_Mutant_Attack_Animation ( );
  3785. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  3786. params.Set_Animation (animationName, false);
  3787. Commands->Action_Play_Animation (obj, params);
  3788. Commands->Apply_Damage( STAR, 5, "TiberiumRaw", obj );
  3789. Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
  3790. }
  3791. }
  3792. }
  3793. }
  3794. };
  3795. DECLARE_SCRIPT(M11_PowerCore_StealthSoldier_Group2_JDG, "")
  3796. {
  3797. void Created( GameObject * obj )
  3798. {
  3799. Commands->Set_Innate_Is_Stationary ( obj, true );
  3800. Commands->Enable_Stealth(obj, true);
  3801. Commands->Innate_Disable(obj);
  3802. }
  3803. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  3804. {
  3805. if (sound.Creator == STAR)
  3806. {
  3807. Commands->Set_Innate_Is_Stationary ( obj, false );
  3808. }
  3809. }
  3810. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3811. {
  3812. if (type == 0)
  3813. {
  3814. if (param == M01_START_ACTING_JDG)
  3815. {
  3816. Commands->Innate_Enable(obj);
  3817. }
  3818. }
  3819. }
  3820. void Killed( GameObject * obj, GameObject * killer )
  3821. {
  3822. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  3823. powerupSpawnLocation.Z += 0.75f;
  3824. char *powerups[2] =
  3825. {
  3826. //this is a list of potential powerups to be dropped by destroyed security turrets
  3827. "POW_Health_100",
  3828. "POW_Armor_100",
  3829. };
  3830. int random = Commands->Get_Random_Int(0, 2);
  3831. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  3832. }
  3833. };
  3834. DECLARE_SCRIPT(M11_PowerCore_StealthSoldier_JDG, "")//
  3835. {
  3836. void Created( GameObject * obj )
  3837. {
  3838. ActionParamsStruct params;
  3839. params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
  3840. params.Set_Movement(STAR, RUN, 10);
  3841. Commands->Action_Goto ( obj, params );
  3842. }
  3843. };
  3844. DECLARE_SCRIPT(M11_PowerCore_Initial_StealthSoldier_JDG, "")//
  3845. {
  3846. void Created( GameObject * obj )
  3847. {
  3848. Commands->Innate_Disable(obj);
  3849. Commands->Enable_Stealth(obj, false);
  3850. }
  3851. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  3852. {
  3853. if (enemy == STAR)
  3854. {
  3855. Commands->Enable_Stealth(obj, true);
  3856. }
  3857. }
  3858. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3859. {
  3860. if (param == M01_START_ACTING_JDG)
  3861. {
  3862. Commands->Innate_Enable(obj);
  3863. Vector3 myPosition = Commands->Get_Position ( obj );
  3864. Commands->Create_Sound ( "CnC_Cloaking", myPosition, obj );
  3865. Commands->Set_Innate_Is_Stationary ( obj, true );
  3866. }
  3867. }
  3868. };
  3869. DECLARE_SCRIPT(M11_PowerCore_Powerup_Zone_JDG, "")//
  3870. {
  3871. bool spawnClearance;
  3872. REGISTER_VARIABLES()
  3873. {
  3874. SAVE_VARIABLE(spawnClearance, 1);
  3875. }
  3876. void Created( GameObject * obj )
  3877. {
  3878. spawnClearance = true;
  3879. }
  3880. void Entered( GameObject * obj, GameObject * enterer )
  3881. {
  3882. if (enterer == STAR && spawnClearance == true)
  3883. {
  3884. spawnClearance = false;
  3885. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 15 );
  3886. float delayTimer = Commands->Get_Random ( 0, 5 );
  3887. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, delayTimer );
  3888. }
  3889. }
  3890. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  3891. {
  3892. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  3893. {
  3894. spawnClearance = true;
  3895. }
  3896. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)//give powerup
  3897. {
  3898. Vector3 powerupSpawnLocation (-5.568f, 57.285f, -38.736f);
  3899. char *powerups[9] =
  3900. {
  3901. //this is a list of potential powerups to be dropped by destroyed security turrets
  3902. "POW_Health_100",
  3903. "POW_Armor_100",
  3904. "POW_RocketLauncher_Player",
  3905. "POW_SniperRifle_Player",
  3906. "POW_TiberiumFlechetteGun_Player",
  3907. "POW_LaserChaingun_Player",
  3908. "POW_GrenadeLauncher_Player",
  3909. "POW_LaserRifle_Player",
  3910. "POW_TiberiumAutoRifle_Player",
  3911. //more to be added later
  3912. };
  3913. int random = Commands->Get_Random_Int(0, 9);
  3914. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  3915. }
  3916. }
  3917. };
  3918. DECLARE_SCRIPT(M11_PowerCore_EntryZone_JDG, "")
  3919. {
  3920. //THESE ARE THE GUYS YOU CONTROL
  3921. //M11_POWERCORE_INITAL_STEALTHGUY01_JDG 100536
  3922. //M11_POWERCORE_INITAL_STEALTHGUY02_JDG 100537
  3923. //M11_POWERCORE_INITAL_STEALTHGUY03_JDG 100538
  3924. void Entered( GameObject * obj, GameObject * enterer )
  3925. {
  3926. if (enterer == STAR)
  3927. {
  3928. //deleting the two "There's Sydney!" zones once entered into powercore
  3929. GameObject * zone01 = Commands->Find_Object ( 101327 );
  3930. GameObject * zone02 = Commands->Find_Object ( 101328 );
  3931. if (zone01 != NULL)
  3932. {
  3933. Commands->Destroy_Object ( zone01 );
  3934. }
  3935. if (zone02 != NULL)
  3936. {
  3937. Commands->Destroy_Object ( zone02 );
  3938. }
  3939. GameObject * stealthGuy01 = Commands->Find_Object ( M11_POWERCORE_INITAL_STEALTHGUY01_JDG );
  3940. GameObject * stealthGuy02 = Commands->Find_Object ( M11_POWERCORE_INITAL_STEALTHGUY02_JDG );
  3941. GameObject * stealthGuy03 = Commands->Find_Object ( M11_POWERCORE_INITAL_STEALTHGUY03_JDG );
  3942. GameObject * stealthGuy04 = Commands->Find_Object ( 100662 );
  3943. GameObject * stealthGuy05 = Commands->Find_Object ( 100663 );
  3944. GameObject * stealthGuy06 = Commands->Find_Object ( 100664 );
  3945. GameObject * stealthGuy07 = Commands->Find_Object ( 100665 );
  3946. GameObject * stealthGuy08 = Commands->Find_Object ( 100666 );
  3947. GameObject * stealthGuy09 = Commands->Find_Object ( 100667 );
  3948. if (stealthGuy01 != NULL)
  3949. {
  3950. Commands->Send_Custom_Event( obj, stealthGuy01, 0, M01_START_ACTING_JDG, 0 );
  3951. }
  3952. if (stealthGuy02 != NULL)
  3953. {
  3954. Commands->Send_Custom_Event( obj, stealthGuy02, 0, M01_START_ACTING_JDG, 0 );
  3955. }
  3956. if (stealthGuy03 != NULL)
  3957. {
  3958. Commands->Send_Custom_Event( obj, stealthGuy03, 0, M01_START_ACTING_JDG, 0 );
  3959. }
  3960. if (stealthGuy04 != NULL)
  3961. {
  3962. Commands->Send_Custom_Event( obj, stealthGuy04, 0, M01_START_ACTING_JDG, 0 );
  3963. }
  3964. if (stealthGuy05 != NULL)
  3965. {
  3966. Commands->Send_Custom_Event( obj, stealthGuy05, 0, M01_START_ACTING_JDG, 0 );
  3967. }
  3968. if (stealthGuy06 != NULL)
  3969. {
  3970. Commands->Send_Custom_Event( obj, stealthGuy06, 0, M01_START_ACTING_JDG, 0 );
  3971. }
  3972. if (stealthGuy07 != NULL)
  3973. {
  3974. Commands->Send_Custom_Event( obj, stealthGuy07, 0, M01_START_ACTING_JDG, 0 );
  3975. }
  3976. if (stealthGuy08 != NULL)
  3977. {
  3978. Commands->Send_Custom_Event( obj, stealthGuy08, 0, M01_START_ACTING_JDG, 0 );
  3979. }
  3980. if (stealthGuy09 != NULL)
  3981. {
  3982. Commands->Send_Custom_Event( obj, stealthGuy09, 0, M01_START_ACTING_JDG, 0 );
  3983. }
  3984. Vector3 mutant01spot (6.339f, 64.212f, -52.114f);
  3985. Vector3 mutant02spot (4.095f, 76.237f, -50.782f);
  3986. Vector3 mutant03spot (-6.129f, 73.340f, -52.114f);
  3987. GameObject * mutant01 = Commands->Create_Object ( "Mutant_0_Mutant", mutant01spot );
  3988. Commands->Attach_Script(mutant01, "M11_PowerCore_WanderingMutant_JDG", "");
  3989. GameObject * mutant02 = Commands->Create_Object ( "Mutant_0_Mutant", mutant02spot );
  3990. Commands->Attach_Script(mutant02, "M11_PowerCore_WanderingMutant_JDG", "");
  3991. GameObject * mutant03 = Commands->Create_Object ( "Mutant_0_Mutant", mutant03spot );
  3992. Commands->Attach_Script(mutant03, "M11_PowerCore_WanderingMutant_JDG", "");
  3993. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  3994. }
  3995. }
  3996. };
  3997. /***********************************************************************************************************************
  3998. Putting SYNDEY Escort related stuff here
  3999. ************************************************************************************************************************/
  4000. DECLARE_SCRIPT(M11_NukeSilo_Protector_JDG, "")
  4001. {
  4002. void Created( GameObject * obj )
  4003. {
  4004. Vector3 myPosition = Commands->Get_Position ( obj );
  4005. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 3 );
  4006. }
  4007. };
  4008. /***********************************************************************************************************************
  4009. Putting OBJECTIVE related stuff here--zones etc.
  4010. ************************************************************************************************************************/
  4011. DECLARE_SCRIPT(M11_End_First_Objective_Zone_JDG, "")//player has reached museum area--clear first objective
  4012. {
  4013. void Entered( GameObject * obj, GameObject * enterer )
  4014. {
  4015. if (enterer == STAR)
  4016. {
  4017. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_END_FIRST_OBJECTIVE_JDG, 0 );//
  4018. GameObject * cabalController = Commands->Find_Object (101204);
  4019. if (cabalController != NULL)
  4020. {
  4021. float delayTimer = Commands->Get_Random ( 5, 10 );
  4022. Commands->Send_Custom_Event ( obj, cabalController, 0, M01_START_ACTING_JDG, delayTimer );
  4023. }
  4024. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  4025. }
  4026. }
  4027. };
  4028. DECLARE_SCRIPT(M11_Start_Third_Objective_Zone_JDG, "")//player's third objective is to acess the power core
  4029. {
  4030. int addThirdObjectiveConv;
  4031. bool entered;
  4032. REGISTER_VARIABLES()
  4033. {
  4034. SAVE_VARIABLE(addThirdObjectiveConv, 1);
  4035. SAVE_VARIABLE(entered, 2);
  4036. }
  4037. void Created( GameObject * obj )
  4038. {
  4039. entered = false;
  4040. }
  4041. void Entered( GameObject * obj, GameObject * enterer )
  4042. {
  4043. if (enterer == STAR && entered == false)
  4044. {
  4045. entered = true;
  4046. addThirdObjectiveConv = Commands->Create_Conversation( "M11_Add_Third_Objective_Conversation", 100, 1000, false);
  4047. Commands->Join_Conversation( NULL, addThirdObjectiveConv, false, false );;
  4048. Commands->Start_Conversation( addThirdObjectiveConv, addThirdObjectiveConv );
  4049. Commands->Monitor_Conversation (obj, addThirdObjectiveConv);
  4050. }
  4051. }
  4052. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4053. {
  4054. switch (complete_reason)
  4055. {
  4056. case ACTION_COMPLETE_CONVERSATION_ENDED:
  4057. {
  4058. if (action_id == addThirdObjectiveConv) //introduce acess powercore objective here
  4059. {
  4060. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_ADD_THIRD_OBJECTIVE_JDG, 0 );
  4061. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  4062. }
  4063. }
  4064. break;
  4065. }
  4066. }
  4067. };
  4068. DECLARE_SCRIPT(M11_Start_Fifth_Objective_Zone_JDG, "")//player's fifth objective is to sabotage the nuke
  4069. {
  4070. void Entered( GameObject * obj, GameObject * enterer )
  4071. {
  4072. if (enterer == STAR)
  4073. {
  4074. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_ADD_FIFTH_OBJECTIVE_JDG, 0 );
  4075. GameObject * zoneOne = Commands->Find_Object ( 100105 );
  4076. if (zoneOne != NULL)
  4077. {
  4078. Commands->Destroy_Object ( zoneOne );//one time only zone--cleaning up
  4079. }
  4080. GameObject * zoneTwo = Commands->Find_Object ( 100107 );
  4081. if (zoneTwo != NULL)
  4082. {
  4083. Commands->Destroy_Object ( zoneTwo );//one time only zone--cleaning up
  4084. }
  4085. }
  4086. }
  4087. };
  4088. DECLARE_SCRIPT(M11_End_Mission_Switch_JDG, "")//this guys ID is M11_END_MISSION_SWITCH_JDG 100106
  4089. {
  4090. float myHealth;
  4091. REGISTER_VARIABLES()
  4092. {
  4093. SAVE_VARIABLE(myHealth, 1);
  4094. }
  4095. void Created( GameObject * obj )
  4096. {
  4097. myHealth = Commands->Get_Health ( obj );
  4098. Commands->Set_Shield_Type (obj, "Blamo");
  4099. }
  4100. void Killed( GameObject * obj, GameObject * killer )
  4101. {
  4102. Commands->Mission_Complete ( false );
  4103. }
  4104. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4105. {
  4106. if (obj)
  4107. {
  4108. Commands->Set_Health ( obj, myHealth );
  4109. }
  4110. }
  4111. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4112. {
  4113. if (param == M01_START_ACTING_JDG)
  4114. {
  4115. Commands->Set_Animation ( obj, "DSP_MINICONSEL.DSP_MINICONSEL", false, NULL, 0, 13 );
  4116. }
  4117. }
  4118. };
  4119. DECLARE_SCRIPT(M11_KanesRoom_SecurityTurret_JDG, "")
  4120. {
  4121. int alarmSound;
  4122. bool active;
  4123. REGISTER_VARIABLES()
  4124. {
  4125. SAVE_VARIABLE(alarmSound, 1);
  4126. SAVE_VARIABLE(active, 2);
  4127. }
  4128. void Created( GameObject * obj )
  4129. {
  4130. active = false;
  4131. Vector3 myPosition = Commands->Get_Position ( obj );
  4132. alarmSound = Commands->Create_Sound ( "SFX.Klaxon_Alert_01", myPosition, obj );
  4133. Commands->Stop_Sound ( alarmSound, false );
  4134. Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_IDLE_JDG, 1 );
  4135. }
  4136. void Killed( GameObject * obj, GameObject * killer )
  4137. {
  4138. if (active == true)
  4139. {
  4140. Commands->Stop_Sound ( alarmSound, true );
  4141. Vector3 powerupSpawnLocation = Commands->Get_Position (obj);
  4142. powerupSpawnLocation.Z = -28.705f;
  4143. char *powerups[9] =
  4144. {
  4145. //this is a list of potential powerups to be dropped by destroyed security turrets
  4146. "POW_Health_100",
  4147. "POW_Armor_100",
  4148. "POW_RocketLauncher_Player",
  4149. "POW_SniperRifle_Player",
  4150. "POW_TiberiumFlechetteGun_Player",
  4151. "POW_LaserChaingun_Player",
  4152. "POW_GrenadeLauncher_Player",
  4153. "POW_LaserRifle_Player",
  4154. "POW_TiberiumAutoRifle_Player",
  4155. //more to be added later
  4156. };
  4157. int random = Commands->Get_Random_Int(0, 9);
  4158. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  4159. }
  4160. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_KANESROOM_SECURITY_CONTROLLER_JDG), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
  4161. }
  4162. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4163. {
  4164. ActionParamsStruct params;
  4165. if (param == M01_START_ACTING_JDG)
  4166. {
  4167. if (obj)
  4168. {
  4169. active = true;
  4170. float myAccuracy = Commands->Get_Random ( 0, 1 );
  4171. params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
  4172. params.Set_Attack( STAR, 100, myAccuracy, true );
  4173. Commands->Action_Attack( obj, params );
  4174. Commands->Start_Sound ( alarmSound );
  4175. }
  4176. }
  4177. }
  4178. };
  4179. DECLARE_SCRIPT(M11_KanesRoom_SecurityZone_JDG, "")//this guys ID is M11_KANESROOM_SECURITY_CONTROLLER_JDG 100351
  4180. {
  4181. bool entered;
  4182. int deadTurrets;
  4183. int deadCameras;
  4184. bool powerupsGranted;
  4185. REGISTER_VARIABLES()
  4186. {
  4187. SAVE_VARIABLE(entered, 1);
  4188. SAVE_VARIABLE(deadTurrets, 2);
  4189. SAVE_VARIABLE(deadCameras, 3);
  4190. SAVE_VARIABLE(powerupsGranted, 4);
  4191. }
  4192. void Created( GameObject * obj )
  4193. {
  4194. entered = false;
  4195. powerupsGranted = false;
  4196. deadTurrets = 0;
  4197. deadCameras = 0;
  4198. }
  4199. void Entered( GameObject * obj, GameObject * enterer )
  4200. {
  4201. if (enterer == STAR && entered == false)
  4202. {
  4203. entered = true;
  4204. Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 0 );
  4205. }
  4206. }
  4207. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4208. {
  4209. if (param == M01_START_ACTING_JDG)
  4210. {
  4211. GameObject * turret01 = Commands->Find_Object (M11_KANESROOM_SECURITY_TURRET_01_JDG);
  4212. GameObject * turret03 = Commands->Find_Object (M11_KANESROOM_SECURITY_TURRET_03_JDG);
  4213. if (turret01 != NULL)
  4214. {
  4215. float delayTimer = Commands->Get_Random ( 0, 2 );
  4216. Commands->Send_Custom_Event( obj, turret01, 0, M01_START_ACTING_JDG, delayTimer );
  4217. }
  4218. if (turret03 != NULL)
  4219. {
  4220. float delayTimer = Commands->Get_Random ( 0, 2 );
  4221. Commands->Send_Custom_Event( obj, turret03, 0, M01_START_ACTING_JDG, delayTimer );
  4222. }
  4223. }
  4224. else if (param == M01_YOUR_OPERATOR_IS_DEAD_JDG)//this is custom recieved when a turret gets destroyed
  4225. {
  4226. deadTurrets++;
  4227. if (deadTurrets >= 2)
  4228. {
  4229. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  4230. }
  4231. }
  4232. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG && powerupsGranted == false)
  4233. {
  4234. powerupsGranted = true;
  4235. Vector3 health100_spawnLocation (27.571f, 7.687f, -29.205f);
  4236. Vector3 armor100_spawnLocation (18.841f, 7.694f, -29.205f);
  4237. Commands->Create_Object ( "POW_Health_100", health100_spawnLocation );
  4238. Commands->Create_Object ( "POW_Armor_100", armor100_spawnLocation );
  4239. }
  4240. }
  4241. };
  4242. DECLARE_SCRIPT(M00_MutantHeal_Script_JDG, "")
  4243. {
  4244. float myLastHealth;
  4245. REGISTER_VARIABLES()
  4246. {
  4247. SAVE_VARIABLE(myLastHealth, 1);
  4248. }
  4249. void Created( GameObject * obj )
  4250. {
  4251. myLastHealth = Commands->Get_Health ( obj );
  4252. }
  4253. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4254. {
  4255. if (obj)
  4256. {
  4257. float myCurrentHealth = Commands->Get_Health ( obj );
  4258. if (myCurrentHealth > myLastHealth)
  4259. {
  4260. ActionParamsStruct params;
  4261. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  4262. params.Set_Animation( "H_A_4243", false );
  4263. Commands->Action_Play_Animation ( obj, params );
  4264. Vector3 myPosition = Commands->Get_Position ( obj );
  4265. Commands->Create_Sound ( "Mutant_Heal_Cry", myPosition, obj );
  4266. }
  4267. myLastHealth = myCurrentHealth;
  4268. }
  4269. }
  4270. };
  4271. DECLARE_SCRIPT(M11_Lab_Cryochamber_Switch01_JDG, "")
  4272. {
  4273. bool poked;
  4274. REGISTER_VARIABLES()
  4275. {
  4276. SAVE_VARIABLE(poked, 1);
  4277. }
  4278. void Created( GameObject * obj )
  4279. {
  4280. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  4281. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  4282. poked = false;
  4283. }
  4284. void Poked( GameObject * obj, GameObject * poker )
  4285. {
  4286. if ( poker == STAR && poked == false)
  4287. {
  4288. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  4289. poked = true;
  4290. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  4291. //Commands->Create_Sound ( "bombit1", Vector3 (0,0,0), obj );
  4292. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4293. }
  4294. }
  4295. };
  4296. DECLARE_SCRIPT(M11_Laboratory_Scientist_JDG, "")
  4297. {
  4298. bool hiding;
  4299. REGISTER_VARIABLES()
  4300. {
  4301. SAVE_VARIABLE(hiding, 1);
  4302. }
  4303. void Created( GameObject * obj )
  4304. {
  4305. Commands->Innate_Disable(obj);
  4306. hiding = false;
  4307. }
  4308. void Damaged( GameObject * obj, GameObject * damager, float amount )
  4309. {
  4310. if (obj)
  4311. {
  4312. if (damager == STAR)
  4313. {
  4314. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4315. }
  4316. }
  4317. }
  4318. void Sound_Heard( GameObject * obj, const CombatSound & sound )
  4319. {
  4320. if (obj)
  4321. {
  4322. if (sound.Creator == STAR)
  4323. {
  4324. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4325. }
  4326. }
  4327. }
  4328. void Enemy_Seen( GameObject * obj, GameObject * enemy )
  4329. {
  4330. if (obj)
  4331. {
  4332. if (enemy == STAR)
  4333. {
  4334. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4335. }
  4336. }
  4337. }
  4338. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4339. {
  4340. ActionParamsStruct params;
  4341. if (type == 0)
  4342. {
  4343. if (param == M01_START_ACTING_JDG)
  4344. {
  4345. Commands->Innate_Enable(obj);
  4346. params.Set_Basic(this, 85, M01_START_ACTING_JDG);
  4347. params.Set_Animation ("H_A_CON2", true);
  4348. Commands->Action_Play_Animation (obj, params);
  4349. }
  4350. else if (param == M01_MODIFY_YOUR_ACTION_JDG && hiding == false)
  4351. {
  4352. hiding = true;
  4353. Commands->Action_Reset ( obj, 100 );
  4354. int myIdNumber = Commands->Get_ID ( obj );
  4355. if (myIdNumber == 100958)
  4356. {
  4357. params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
  4358. params.Set_Movement( Vector3 (-20.306f, 17.693f, -39.486f), RUN, 1 );
  4359. Commands->Action_Goto (obj, params);
  4360. }
  4361. else if (myIdNumber == 100449)
  4362. {
  4363. params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
  4364. params.Set_Movement( Vector3 (-3.576f, 29.472f, -39.482f), RUN, 1 );
  4365. Commands->Action_Goto (obj, params);
  4366. }
  4367. }
  4368. }
  4369. }
  4370. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4371. {
  4372. if (action_id == M01_MODIFY_YOUR_ACTION_JDG)
  4373. {
  4374. ActionParamsStruct params;
  4375. params.Set_Basic(this, 100, M01_START_ACTING_JDG);
  4376. params.Set_Animation ("H_A_A0C0", true);
  4377. Commands->Action_Play_Animation (obj, params);
  4378. }
  4379. }
  4380. void Killed( GameObject * obj, GameObject * killer )
  4381. {
  4382. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  4383. }
  4384. };
  4385. DECLARE_SCRIPT(M11_Laboratory_Mutant_JDG, "")
  4386. {
  4387. void Created( GameObject * obj )
  4388. {
  4389. Vector3 myPosition = Commands->Get_Position ( obj );
  4390. Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
  4391. }
  4392. void Killed( GameObject * obj, GameObject * killer )
  4393. {
  4394. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  4395. }
  4396. };
  4397. DECLARE_SCRIPT(M11_Seths_Room_Conversation_Zone_JDG, "")//101103
  4398. {
  4399. void Entered( GameObject * obj, GameObject * enterer )
  4400. {
  4401. if (enterer == STAR)
  4402. {
  4403. int sethConv = Commands->Create_Conversation( "M11_Kane_Regarding_Seth_Conversation", 100, 1000, false);
  4404. Commands->Join_Conversation( NULL, sethConv, false, false );
  4405. Commands->Join_Conversation( STAR, sethConv, false, false );
  4406. Commands->Start_Conversation( sethConv, sethConv );
  4407. Commands->Destroy_Object ( obj );
  4408. }
  4409. }
  4410. };
  4411. DECLARE_SCRIPT(M11_CeilingRepellers_Controller_JDG, "")//M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG 101125
  4412. {
  4413. int spawned_units;
  4414. int rope_A_id;
  4415. int rope_B_id;
  4416. Vector3 ropeA_v3;
  4417. Vector3 ropeB_v3;
  4418. bool rope_A_spawned;
  4419. REGISTER_VARIABLES()
  4420. {
  4421. SAVE_VARIABLE(spawned_units, 1);
  4422. SAVE_VARIABLE(rope_A_id, 2);
  4423. SAVE_VARIABLE(rope_B_id, 3);
  4424. SAVE_VARIABLE(ropeA_v3, 4);
  4425. SAVE_VARIABLE(ropeB_v3, 5);
  4426. SAVE_VARIABLE(rope_A_spawned, 6);
  4427. }
  4428. void Created( GameObject * obj )
  4429. {
  4430. Commands->Enable_Hibernation( obj, false );
  4431. rope_A_spawned = false;
  4432. spawned_units = 0;
  4433. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
  4434. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 15 );
  4435. ropeA_v3.Set (-6.230f, 3.584f, 4.5f);
  4436. ropeB_v3.Set (8.368f, -35.439f, 1);
  4437. }
  4438. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4439. {
  4440. if (type == 0)
  4441. {
  4442. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  4443. {
  4444. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeB_v3);
  4445. Commands->Set_Facing ( controller, -10 );
  4446. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part1b.txt");
  4447. spawned_units++;
  4448. }
  4449. else if (param == M01_START_ACTING_JDG)
  4450. {
  4451. rope_A_spawned = true;
  4452. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeA_v3);
  4453. Commands->Set_Facing ( controller, 75 );
  4454. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part1.txt");
  4455. spawned_units++;
  4456. }
  4457. else if (param == M01_ROPE_IS_SENDING_ID_JDG)
  4458. {
  4459. rope_A_id = Commands->Get_ID ( sender );
  4460. }
  4461. else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//this is actually rope-b sending id
  4462. {
  4463. rope_B_id = Commands->Get_ID ( sender );
  4464. }
  4465. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  4466. {
  4467. GameObject * rope_A = Commands->Find_Object ( rope_A_id );
  4468. if (rope_A != NULL)
  4469. {
  4470. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeA_v3);
  4471. Commands->Set_Facing ( controller, 75 );
  4472. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part2.txt");
  4473. Commands->Set_Animation ( rope_A, "X11D_Rope.X11D_Rope_L", false);
  4474. spawned_units++;
  4475. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, (95/30) );
  4476. }
  4477. }
  4478. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
  4479. {
  4480. GameObject * rope_B = Commands->Find_Object ( rope_B_id );
  4481. if (rope_B != NULL)
  4482. {
  4483. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeB_v3);
  4484. Commands->Set_Facing ( controller, -10 );
  4485. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part2.txt");
  4486. Commands->Set_Animation ( rope_B, "X11D_Rope.X11D_Rope_L", true);
  4487. spawned_units++;
  4488. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, (95/30) );
  4489. }
  4490. }
  4491. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//set rope "A" to idle anim
  4492. {
  4493. GameObject * rope_A = Commands->Find_Object ( rope_A_id );
  4494. if (rope_A != NULL)
  4495. {
  4496. Commands->Set_Animation ( rope_A, "X11D_Rope.X11D_Rope_Z", true);
  4497. }
  4498. }
  4499. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//set rope "B" to idle anim
  4500. {
  4501. GameObject * rope_B = Commands->Find_Object ( rope_B_id );
  4502. if (rope_B != NULL)
  4503. {
  4504. Commands->Set_Animation ( rope_B, "X11D_Rope.X11D_Rope_Z", true);
  4505. }
  4506. }
  4507. else if (param == M01_IVE_BEEN_KILLED_JDG && spawned_units <= 8 )
  4508. {
  4509. int random = Commands->Get_Random_Int(0, 2);
  4510. if (random == 0 && rope_A_spawned == true)
  4511. {
  4512. float delayTimer = Commands->Get_Random ( 5, 15 );
  4513. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  4514. }
  4515. else
  4516. {
  4517. float delayTimer = Commands->Get_Random ( 5, 15 );
  4518. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
  4519. }
  4520. }
  4521. }
  4522. }
  4523. };
  4524. DECLARE_SCRIPT(M11_CeilingRepellers_RopeA_JDG, "")
  4525. {
  4526. void Created( GameObject * obj ) //M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG
  4527. {
  4528. Commands->Enable_Hibernation( obj, false );
  4529. GameObject * myController = Commands->Find_Object ( M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG );
  4530. if (myController != NULL)
  4531. {
  4532. Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  4533. }
  4534. }
  4535. };
  4536. DECLARE_SCRIPT(M11_CeilingRepellers_RopeB_JDG, "")
  4537. {
  4538. void Created( GameObject * obj ) //M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG
  4539. {
  4540. Commands->Enable_Hibernation( obj, false );
  4541. GameObject * myController = Commands->Find_Object ( M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG );
  4542. if (myController != NULL)
  4543. {
  4544. Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
  4545. }
  4546. }
  4547. };
  4548. DECLARE_SCRIPT(M11_CeilingRepeller_JDG, "")
  4549. {
  4550. void Animation_Complete(GameObject * obj, const char *anim)
  4551. {
  4552. if (stricmp(anim, "S_a_Human.H_a_X11D_repel") == 0)
  4553. {
  4554. Commands->Attach_Script(obj, "M01_Hunt_The_Player_JDG","");
  4555. }
  4556. }
  4557. void Killed( GameObject * obj, GameObject * killer )
  4558. {
  4559. GameObject * myController = Commands->Find_Object ( M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG );
  4560. if (myController != NULL)
  4561. {
  4562. Commands->Send_Custom_Event ( obj, myController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  4563. }
  4564. }
  4565. };
  4566. DECLARE_SCRIPT(M11_Theres_Sydney_Zone_JDG, "")//101327 and 101328
  4567. {
  4568. void Entered( GameObject * obj, GameObject * enterer )
  4569. {
  4570. if (enterer == STAR)
  4571. {
  4572. int theresSydneyConversation = Commands->Create_Conversation( "M11_Theres_Sydney_Conversation", 100, 1000, false);
  4573. Commands->Join_Conversation( STAR, theresSydneyConversation, false, false, false );
  4574. Commands->Join_Conversation( NULL, theresSydneyConversation, false, false, false );
  4575. Commands->Start_Conversation( theresSydneyConversation, theresSydneyConversation );
  4576. GameObject * zone01 = Commands->Find_Object ( 101327 );
  4577. GameObject * zone02 = Commands->Find_Object ( 101328 );
  4578. if (zone01 != NULL)
  4579. {
  4580. Commands->Destroy_Object ( zone01 );
  4581. }
  4582. if (zone02 != NULL)
  4583. {
  4584. Commands->Destroy_Object ( zone02 );
  4585. }
  4586. }
  4587. }
  4588. };
  4589. DECLARE_SCRIPT(M11_End_Third_Objective_Zone_JDG, "")//this guys ID is 100012--using to stop mutant spawners and end objective 3
  4590. {
  4591. bool entered;
  4592. REGISTER_VARIABLES()
  4593. {
  4594. SAVE_VARIABLE(entered, 1);
  4595. }
  4596. void Created( GameObject * obj )
  4597. {
  4598. entered = false;
  4599. }
  4600. void Entered( GameObject * obj, GameObject * enterer ) //
  4601. {
  4602. if (enterer == STAR && entered == false)
  4603. {
  4604. entered = true;
  4605. int powerCoreEntry = Commands->Create_Conversation( "M11_PowerCore_Entry_Conversation", 100, 1000, false);
  4606. Commands->Join_Conversation( NULL, powerCoreEntry, false, false, false );
  4607. Commands->Start_Conversation( powerCoreEntry, powerCoreEntry );
  4608. GameObject * mutantController = Commands->Find_Object ( M11_MUTANT_CRYPT_SPAWNER_CONTROLLER_JDG );
  4609. if (mutantController != NULL)
  4610. {
  4611. Commands->Send_Custom_Event ( obj, mutantController, 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
  4612. }
  4613. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_END_THIRD_OBJECTIVE_JDG, 0 );
  4614. //one time only zone--Destroying it in mission controller to avoid potential bugs
  4615. }
  4616. }
  4617. };
  4618. DECLARE_SCRIPT(M11_SecurityCamera_JDG, "")//
  4619. {
  4620. void Created( GameObject * obj )
  4621. {
  4622. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4623. ActionParamsStruct params;
  4624. params.Set_Basic( this, 100, M01_START_ATTACKING_02_JDG );
  4625. params.Set_Face_Location( playersPosition, 1 );
  4626. Commands->Action_Face_Location ( obj, params );
  4627. }
  4628. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4629. {
  4630. switch (complete_reason)
  4631. {
  4632. case ACTION_COMPLETE_NORMAL:
  4633. {
  4634. if (action_id == M01_START_ATTACKING_02_JDG)
  4635. {
  4636. Vector3 playersPosition = Commands->Get_Position ( STAR );
  4637. ActionParamsStruct params;
  4638. params.Set_Basic( this, 100, M01_START_ATTACKING_02_JDG );
  4639. params.Set_Face_Location( playersPosition, 1 );
  4640. Commands->Action_Face_Location ( obj, params );
  4641. }
  4642. }
  4643. break;
  4644. }
  4645. }
  4646. };
  4647. DECLARE_SCRIPT(M11_Temple_Commander_JDG, "")//101250
  4648. {
  4649. void Created( GameObject * obj )
  4650. {
  4651. Commands->Set_Innate_Is_Stationary ( obj, true );
  4652. GameObject * hologram01 = Commands->Find_Object ( 100252 );
  4653. if (hologram01 != NULL)
  4654. {
  4655. ActionParamsStruct params;
  4656. params.Set_Basic( this, 80, M01_START_ATTACKING_01_JDG );
  4657. params.Set_Attack( hologram01, 0, 0, true );
  4658. Commands->Action_Attack ( obj, params );
  4659. }
  4660. }
  4661. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4662. {
  4663. if (type == 0)
  4664. {
  4665. if (param == M01_MODIFY_YOUR_ACTION_JDG)//conversation is over--goto innate
  4666. {
  4667. Commands->Action_Reset ( obj, 100 );
  4668. }
  4669. }
  4670. }
  4671. void Killed( GameObject * obj, GameObject * killer )
  4672. {
  4673. GameObject * c130Controller = Commands->Find_Object ( M11_C130_DROPOFF_CONTROLLER_JDG );
  4674. if (c130Controller != NULL)
  4675. {
  4676. Commands->Destroy_Object ( c130Controller );
  4677. }
  4678. GameObject * hologramController = Commands->Find_Object ( 101251 );
  4679. if (hologramController != NULL)
  4680. {
  4681. Commands->Send_Custom_Event ( obj, hologramController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  4682. }
  4683. }
  4684. };
  4685. DECLARE_SCRIPT(M11_Temple_Hologram_Controller_JDG, "")//101251
  4686. {
  4687. int kane01_ID;
  4688. int kane02_ID;
  4689. int kane_conversation01;
  4690. int kane_conversation01b;
  4691. int kane_conversation02;
  4692. bool kane_conversation01_playing;
  4693. bool kane_conversation02_playing;
  4694. REGISTER_VARIABLES()
  4695. {
  4696. SAVE_VARIABLE(kane01_ID, 1);
  4697. SAVE_VARIABLE(kane02_ID, 2);
  4698. SAVE_VARIABLE(kane_conversation01, 3);
  4699. SAVE_VARIABLE(kane_conversation01b, 4);
  4700. SAVE_VARIABLE(kane_conversation02, 5);
  4701. SAVE_VARIABLE(kane_conversation01_playing, 6);
  4702. SAVE_VARIABLE(kane_conversation02_playing, 7);
  4703. }
  4704. void Created( GameObject * obj )
  4705. {
  4706. Commands->Enable_Hibernation( obj, false );
  4707. kane_conversation01_playing = false;
  4708. kane_conversation02_playing = false;
  4709. GameObject * hologram01 = Commands->Find_Object ( 100252 );
  4710. if (hologram01 != NULL)
  4711. {
  4712. GameObject * commander = Commands->Find_Object ( 101250 );
  4713. if (commander != NULL)
  4714. {
  4715. GameObject * kane01 = Commands->Create_Object_At_Bone ( hologram01, "Nod_Kane_HologramHead", "KANEBONE" );
  4716. Commands->Disable_All_Collisions ( kane01 );
  4717. Commands->Attach_To_Object_Bone( kane01, hologram01, "KANEBONE" );
  4718. Commands->Set_Loiters_Allowed( kane01, false );
  4719. Commands->Attach_Script(kane01, "M11_BattleStationAlpha_CommanderEncounter_KaneHead_JDG", "");
  4720. kane01_ID = Commands->Get_ID ( kane01 );
  4721. }
  4722. }
  4723. }
  4724. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4725. {
  4726. if (type == 0)
  4727. {
  4728. if (param == M01_MODIFY_YOUR_ACTION_JDG)//starting first kane-commander encounter
  4729. {
  4730. GameObject * kane01 = Commands->Find_Object ( kane01_ID );
  4731. GameObject * commander = Commands->Find_Object ( 101250 );
  4732. if (commander != NULL)
  4733. {
  4734. kane_conversation01 = Commands->Create_Conversation( "M11_Kane_and_Blackhand_Conversation_01", 100, 1000, true);
  4735. Commands->Join_Conversation( kane01, kane_conversation01, false, true, true );
  4736. Commands->Join_Conversation( commander, kane_conversation01, false, true, true );
  4737. Commands->Start_Conversation( kane_conversation01, kane_conversation01 );
  4738. Commands->Monitor_Conversation( obj, kane_conversation01 );
  4739. kane_conversation01_playing = true;
  4740. }
  4741. }
  4742. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//havoc has entered first zone--start first havoc conv
  4743. {
  4744. if (kane_conversation01_playing == true)
  4745. {
  4746. kane_conversation01_playing = false;
  4747. Commands->Stop_Conversation( kane_conversation01 );
  4748. GameObject * commander = Commands->Find_Object ( 101250 );
  4749. if (commander != NULL)
  4750. {
  4751. Commands->Send_Custom_Event ( obj, commander, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4752. }
  4753. GameObject * kane01 = Commands->Find_Object ( kane01_ID );
  4754. if (kane01 != NULL)
  4755. {
  4756. kane_conversation01b = Commands->Create_Conversation( "M11_Kane_and_Havoc_Conversation_01", 90, 30, true);
  4757. Commands->Join_Conversation( kane01, kane_conversation01b, false, true, true );
  4758. Commands->Join_Conversation( STAR, kane_conversation01b, false, false, false );
  4759. Commands->Start_Conversation( kane_conversation01b, kane_conversation01b );
  4760. Commands->Monitor_Conversation( obj, kane_conversation01b );
  4761. kane_conversation02_playing = true;
  4762. }
  4763. }
  4764. else if (kane_conversation01_playing == false)
  4765. {
  4766. GameObject * hologram01 = Commands->Find_Object ( 100252 );
  4767. if (hologram01 != NULL)
  4768. {
  4769. GameObject * kane02 = Commands->Create_Object_At_Bone ( hologram01, "Nod_Kane_HologramHead", "KANEBONE" );
  4770. Commands->Disable_All_Collisions ( kane02 );
  4771. Commands->Attach_To_Object_Bone( kane02, hologram01, "KANEBONE" );
  4772. Commands->Set_Loiters_Allowed( kane02, false );
  4773. Commands->Attach_Script(kane02, "M11_BattleStationAlpha_HavocEncounter_KaneHead_JDG", "");
  4774. kane02_ID = Commands->Get_ID ( kane02 );
  4775. }
  4776. }
  4777. }
  4778. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG && kane_conversation02_playing == false)//kane head01 is giving clearance to start havoc conv
  4779. {
  4780. kane_conversation02 = Commands->Create_Conversation( "M11_Kane_and_Havoc_Conversation_01", 90, 30, true);
  4781. Commands->Join_Conversation( sender, kane_conversation02, false, true, true );
  4782. Commands->Join_Conversation( STAR, kane_conversation02, false, false, false );
  4783. Commands->Start_Conversation( kane_conversation02, kane_conversation02 );
  4784. Commands->Monitor_Conversation( obj, kane_conversation02 );
  4785. kane_conversation02_playing = true;
  4786. }
  4787. else if (param == M01_IVE_BEEN_KILLED_JDG)
  4788. {
  4789. GameObject * commander = Commands->Find_Object ( 101250 );
  4790. if (sender == commander)
  4791. {
  4792. if (kane_conversation01_playing == true)
  4793. {
  4794. kane_conversation01_playing = false;
  4795. Commands->Stop_Conversation( kane_conversation01 );
  4796. GameObject * kane01 = Commands->Find_Object ( kane01_ID );
  4797. if (kane01 != NULL)
  4798. {
  4799. Commands->Send_Custom_Event ( obj, kane01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4800. }
  4801. }
  4802. }
  4803. }
  4804. }
  4805. }
  4806. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4807. {
  4808. switch (complete_reason)
  4809. {
  4810. case ACTION_COMPLETE_CONVERSATION_ENDED:
  4811. {
  4812. if (action_id == kane_conversation01 && kane_conversation01_playing == true)
  4813. {
  4814. kane_conversation01_playing = false;
  4815. GameObject * kane01 = Commands->Find_Object ( kane01_ID );
  4816. if (kane01 != NULL)
  4817. {
  4818. Commands->Send_Custom_Event ( obj, kane01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4819. }
  4820. GameObject * commander = Commands->Find_Object ( 101250 );
  4821. if (commander != NULL)
  4822. {
  4823. Commands->Send_Custom_Event ( obj, commander, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4824. }
  4825. }
  4826. else if (action_id == kane_conversation01b && kane_conversation02_playing == true)
  4827. {
  4828. kane_conversation02_playing = false;
  4829. GameObject * kane01 = Commands->Find_Object ( kane01_ID );
  4830. if (kane01 != NULL)
  4831. {
  4832. Commands->Send_Custom_Event ( obj, kane01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4833. }
  4834. }
  4835. else if (action_id == kane_conversation02 && kane_conversation02_playing == true)
  4836. {
  4837. kane_conversation02_playing = false;
  4838. GameObject * kane02 = Commands->Find_Object ( kane02_ID );
  4839. if (kane02 != NULL)
  4840. {
  4841. Commands->Send_Custom_Event ( obj, kane02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  4842. }
  4843. }
  4844. }
  4845. break;
  4846. }
  4847. }
  4848. };
  4849. DECLARE_SCRIPT(M11_BattleStationAlpha_CommanderEncounter_KaneHead_JDG, "")
  4850. {
  4851. void Created( GameObject * obj )
  4852. {
  4853. GameObject * hologramController = Commands->Find_Object ( 101251 );
  4854. if (hologramController != NULL)
  4855. {
  4856. Commands->Send_Custom_Event ( obj, hologramController, 0, M01_MODIFY_YOUR_ACTION_JDG, 4 );
  4857. }
  4858. }
  4859. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4860. {
  4861. if (param == M01_MODIFY_YOUR_ACTION_JDG)//conversation is over--go away
  4862. {
  4863. Commands->Destroy_Object ( obj );
  4864. }
  4865. }
  4866. };
  4867. DECLARE_SCRIPT(M11_BattleStationAlpha_HavocEncounter_KaneHead_JDG, "")
  4868. {
  4869. void Created( GameObject * obj )
  4870. {
  4871. GameObject * hologramController = Commands->Find_Object ( 101251 );
  4872. if (hologramController != NULL)
  4873. {
  4874. Commands->Send_Custom_Event ( obj, hologramController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  4875. }
  4876. }
  4877. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  4878. {
  4879. if (param == M01_MODIFY_YOUR_ACTION_JDG)//conversation is over--go away
  4880. {
  4881. Commands->Destroy_Object ( obj );
  4882. }
  4883. }
  4884. };
  4885. DECLARE_SCRIPT(M11_Temple_Hologram_01_JDG, "")//100252
  4886. {
  4887. void Created( GameObject * obj )
  4888. {
  4889. Commands->Set_Animation (obj, "DSP_HOLO_BIG.DSP_HOLO_BIG", true);
  4890. }
  4891. };
  4892. DECLARE_SCRIPT(M11_SecondHolograph_EntryZone_JDG, "")
  4893. {
  4894. void Entered( GameObject * obj, GameObject * enterer )
  4895. {
  4896. if (enterer == STAR)
  4897. {
  4898. GameObject * hologramController = Commands->Find_Object ( 101251 );
  4899. if (hologramController != NULL)
  4900. {
  4901. Commands->Send_Custom_Event ( obj, hologramController, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  4902. }
  4903. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  4904. }
  4905. }
  4906. };
  4907. DECLARE_SCRIPT(M11_Floor01_InitialPatrol_Left01_JDG, "")
  4908. {
  4909. void Created( GameObject * obj )
  4910. {
  4911. Commands->Enable_Hibernation( obj, false );
  4912. ActionParamsStruct params;
  4913. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4914. params.Set_Movement( Vector3(0,0,0), RUN, 0.25f);
  4915. params.WaypathID = 100210;
  4916. params.WaypointStartID = 100211;
  4917. params.WaypointEndID = 100218;
  4918. Commands->Action_Goto( obj, params );
  4919. }
  4920. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4921. {
  4922. ActionParamsStruct params;
  4923. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  4924. {
  4925. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  4926. params.Set_Movement( Vector3(-7.989f, 16.986f, -18), RUN, 0.25f);
  4927. Commands->Action_Goto( obj, params );
  4928. }
  4929. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  4930. {
  4931. Commands->Enable_Hibernation( obj, true );
  4932. Commands->Set_Innate_Is_Stationary (obj, true );
  4933. }
  4934. }
  4935. };
  4936. DECLARE_SCRIPT(M11_Floor01_InitialPatrol_Right01_JDG, "")
  4937. {
  4938. void Created( GameObject * obj )
  4939. {
  4940. Commands->Enable_Hibernation( obj, false );
  4941. ActionParamsStruct params;
  4942. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  4943. params.Set_Movement( Vector3(0,0,0), RUN, 0.25f);
  4944. params.WaypathID = 100199;
  4945. params.WaypointStartID = 100200;
  4946. params.WaypointEndID = 100208;
  4947. Commands->Action_Goto( obj, params );
  4948. }
  4949. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  4950. {
  4951. ActionParamsStruct params;
  4952. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  4953. {
  4954. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  4955. params.Set_Movement( Vector3(1.354f, 15.273f, -18), RUN, 0.25f);
  4956. Commands->Action_Goto( obj, params );
  4957. }
  4958. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  4959. {
  4960. Commands->Enable_Hibernation( obj, true );
  4961. Commands->Set_Innate_Is_Stationary (obj, true );
  4962. }
  4963. }
  4964. };
  4965. DECLARE_SCRIPT(M11_KaneRoom_KaneEncounter_Zone_JDG, "")//
  4966. {
  4967. int kane_ID;
  4968. REGISTER_VARIABLES()
  4969. {
  4970. SAVE_VARIABLE(kane_ID, 1);
  4971. }
  4972. void Entered( GameObject * obj, GameObject * enterer )
  4973. {
  4974. if (enterer == STAR)
  4975. {
  4976. GameObject * holograph = Commands->Find_Object ( 101226 );
  4977. if (holograph != NULL)
  4978. {
  4979. GameObject * kane = Commands->Create_Object_At_Bone ( holograph, "Nod_Kane_HologramHead_small", "KANEBONE" );
  4980. Commands->Disable_All_Collisions ( kane );
  4981. Commands->Attach_To_Object_Bone( kane, holograph, "KANEBONE" );
  4982. Commands->Set_Loiters_Allowed( kane, false );
  4983. Commands->Attach_Script(kane, "M11_KaneRoom_KaneEncounter_Kane_JDG", "");
  4984. kane_ID = Commands->Get_ID ( kane );
  4985. Commands->Destroy_Object ( obj );
  4986. }
  4987. }
  4988. }
  4989. };
  4990. DECLARE_SCRIPT(M11_KaneRoom_KaneEncounter_Kane_JDG, "")//M11_KanesRoom_Kane_Conversation
  4991. {
  4992. int kane_conversation02;
  4993. REGISTER_VARIABLES()
  4994. {
  4995. SAVE_VARIABLE(kane_conversation02, 1);
  4996. }
  4997. void Created( GameObject * obj )
  4998. {
  4999. if (STAR)
  5000. {
  5001. kane_conversation02 = Commands->Create_Conversation( "M11_KanesRoom_Kane_Conversation", 100, 1000, false);
  5002. Commands->Join_Conversation( obj, kane_conversation02, false, true, true );
  5003. Commands->Join_Conversation( STAR, kane_conversation02, false, false );
  5004. Commands->Start_Conversation( kane_conversation02, kane_conversation02 );
  5005. Commands->Monitor_Conversation( obj, kane_conversation02 );
  5006. }
  5007. }
  5008. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  5009. {
  5010. switch (complete_reason)
  5011. {
  5012. case ACTION_COMPLETE_CONVERSATION_ENDED:
  5013. {
  5014. if (action_id == kane_conversation02)
  5015. {
  5016. Commands->Debug_Message ( "***************************kane conversation 02 is over--sending delete custom\n" );
  5017. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 2 );
  5018. }
  5019. }
  5020. break;
  5021. }
  5022. }
  5023. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5024. {
  5025. if (param == M01_START_ACTING_JDG)//conversation is over--go away
  5026. {
  5027. Commands->Debug_Message ( "***************************delete custom received--kane should now vanish\n" );
  5028. Commands->Destroy_Object ( obj );
  5029. }
  5030. }
  5031. };
  5032. DECLARE_SCRIPT(M11_KaneRoom_KaneEncounter_Hologram_JDG, "")//101226
  5033. {
  5034. void Created( GameObject * obj )
  5035. {
  5036. Commands->Set_Animation (obj, "DSP_HOLO.DSP_HOLO", true);
  5037. }
  5038. };
  5039. DECLARE_SCRIPT(M11_CABAL_Babble_Contoller_JDG, "")// 101204
  5040. {
  5041. int last;
  5042. REGISTER_VARIABLES()
  5043. {
  5044. SAVE_VARIABLE(last, 1);
  5045. }
  5046. void Created( GameObject * obj )
  5047. {
  5048. last = 20;
  5049. Commands->Enable_Hibernation( obj, false);
  5050. }
  5051. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5052. {
  5053. if (type == 0)
  5054. {
  5055. if (obj && param == M01_START_ACTING_JDG)
  5056. {
  5057. Vector3 speaker01position = Commands->Get_Position ( STAR );
  5058. Vector3 speaker02position = Commands->Get_Position ( STAR );
  5059. Vector3 speaker03position = Commands->Get_Position ( STAR );
  5060. speaker01position.X += Commands->Get_Random(-10,10);
  5061. speaker01position.Y += Commands->Get_Random(-10,10);
  5062. speaker01position.Z += Commands->Get_Random(0,10);
  5063. speaker02position.X += Commands->Get_Random(-10,10);
  5064. speaker02position.Y += Commands->Get_Random(-10,10);
  5065. speaker02position.Z += Commands->Get_Random(0,10);
  5066. speaker03position.X += Commands->Get_Random(-10,10);
  5067. speaker03position.Y += Commands->Get_Random(-10,10);
  5068. speaker03position.Z += Commands->Get_Random(0,10);
  5069. Commands->Create_Sound ( "M11DSGN_DSGN0089I1EVAC_SND", speaker01position, obj );
  5070. Commands->Create_Sound ( "M11DSGN_DSGN0089I1EVAC_SND", speaker02position, obj );
  5071. Commands->Create_Sound ( "M11DSGN_DSGN0089I1EVAC_SND", speaker03position, obj );
  5072. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 6 );
  5073. }
  5074. else if (obj && param == M01_MODIFY_YOUR_ACTION_JDG)
  5075. {
  5076. Vector3 speaker01position = Commands->Get_Position ( STAR );
  5077. Vector3 speaker02position = Commands->Get_Position ( STAR );
  5078. Vector3 speaker03position = Commands->Get_Position ( STAR );
  5079. speaker01position.X += Commands->Get_Random(-10,10);
  5080. speaker01position.Y += Commands->Get_Random(-10,10);
  5081. speaker01position.Z += Commands->Get_Random(0,10);
  5082. speaker02position.X += Commands->Get_Random(-10,10);
  5083. speaker02position.Y += Commands->Get_Random(-10,10);
  5084. speaker02position.Z += Commands->Get_Random(0,10);
  5085. speaker03position.X += Commands->Get_Random(-10,10);
  5086. speaker03position.Y += Commands->Get_Random(-10,10);
  5087. speaker03position.Z += Commands->Get_Random(0,10);
  5088. Commands->Create_Sound ( "M11DSGN_DSGN0097I1EVAC_SND", speaker01position, obj );
  5089. Commands->Create_Sound ( "M11DSGN_DSGN0097I1EVAC_SND", speaker02position, obj );
  5090. Commands->Create_Sound ( "M11DSGN_DSGN0097I1EVAC_SND", speaker03position, obj );
  5091. float delayTimer = Commands->Get_Random ( 15, 60 );
  5092. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  5093. }
  5094. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  5095. {
  5096. Vector3 speaker01position = Commands->Get_Position ( STAR );
  5097. Vector3 speaker02position = Commands->Get_Position ( STAR );
  5098. Vector3 speaker03position = Commands->Get_Position ( STAR );
  5099. speaker01position.X += Commands->Get_Random(-10,10);
  5100. speaker01position.Y += Commands->Get_Random(-10,10);
  5101. speaker01position.Z += Commands->Get_Random(0,10);
  5102. speaker02position.X += Commands->Get_Random(-10,10);
  5103. speaker02position.Y += Commands->Get_Random(-10,10);
  5104. speaker02position.Z += Commands->Get_Random(0,10);
  5105. speaker03position.X += Commands->Get_Random(-10,10);
  5106. speaker03position.Y += Commands->Get_Random(-10,10);
  5107. speaker03position.Z += Commands->Get_Random(0,10);
  5108. char *cabalSounds[6] =
  5109. {
  5110. //this is a list of potential cabal sayings
  5111. "M11DSGN_DSGN0088I1EVAC_SND",
  5112. "M11DSGN_DSGN0090I1EVAC_SND",
  5113. "M11DSGN_DSGN0091I1EVAC_SND",
  5114. "M11DSGN_DSGN0092I1EVAC_SND",
  5115. "M11DSGN_DSGN0094I1EVAC_SND",
  5116. "M11DSGN_DSGN0096I1EVAC_SND",
  5117. };
  5118. int random = Commands->Get_Random_Int(0, 6);
  5119. while (random == last)
  5120. {
  5121. random = Commands->Get_Random_Int(0, 6);
  5122. }
  5123. Commands->Create_Sound ( cabalSounds[random], speaker01position, obj );
  5124. Commands->Create_Sound ( cabalSounds[random], speaker02position, obj );
  5125. Commands->Create_Sound ( cabalSounds[random], speaker03position, obj );
  5126. float delayTimer = Commands->Get_Random ( 15, 60 );
  5127. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  5128. last = random;
  5129. }
  5130. }
  5131. }
  5132. };
  5133. DECLARE_SCRIPT(M11_AblesTomb_TalkZone_JDG, "")//M11_Ables_Tomb_Conversation
  5134. {
  5135. void Entered( GameObject * obj, GameObject * enterer )
  5136. {
  5137. if (enterer == STAR)
  5138. {
  5139. int able_conv = Commands->Create_Conversation( "M11_Ables_Tomb_Conversation", 100, 2000, false);
  5140. Commands->Join_Conversation( NULL, able_conv, false, false, false );
  5141. Commands->Join_Conversation( STAR, able_conv, false, false, false );
  5142. Commands->Start_Conversation( able_conv, able_conv );
  5143. Commands->Destroy_Object ( obj );
  5144. }
  5145. }
  5146. };
  5147. DECLARE_SCRIPT(M11_Barracks_Visceroid_JDG, "")//100394 (for now)
  5148. {
  5149. void Created( GameObject * obj )
  5150. {
  5151. Commands->Innate_Disable(obj);
  5152. }
  5153. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5154. {
  5155. if (param == M01_START_ACTING_JDG)
  5156. {
  5157. Commands->Innate_Enable(obj);
  5158. ActionParamsStruct params;
  5159. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  5160. params.Set_Movement(STAR, RUN, 1);
  5161. params.Set_Attack( STAR, 2, 0, true );
  5162. params.AttackCheckBlocked = false;
  5163. Commands->Action_Attack ( obj, params );
  5164. }
  5165. }
  5166. };
  5167. DECLARE_SCRIPT(M11_Barracks_Visceroid_KeyCarrier_JDG, "")//
  5168. {
  5169. void Created( GameObject * obj )
  5170. {
  5171. Commands->Innate_Disable(obj);
  5172. }
  5173. void Killed( GameObject * obj, GameObject * killer )
  5174. {
  5175. Vector3 spawnLocation = Commands->Get_Position ( obj );
  5176. spawnLocation.Z += 0.75f;
  5177. Commands->Create_Object ( "Level_02_Keycard", spawnLocation );
  5178. }
  5179. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5180. {
  5181. if (param == M01_START_ACTING_JDG)
  5182. {
  5183. Commands->Innate_Enable(obj);
  5184. ActionParamsStruct params;
  5185. params.Set_Basic( this, 100, M01_START_ACTING_JDG );
  5186. params.Set_Movement(STAR, RUN, 1);
  5187. params.Set_Attack( STAR, 2, 0, true );
  5188. params.AttackCheckBlocked = false;
  5189. Commands->Action_Attack ( obj, params );
  5190. }
  5191. }
  5192. };
  5193. DECLARE_SCRIPT(M11_Barracks_Visceroid_Morpher_JDG, "")//
  5194. {
  5195. void Created( GameObject * obj )
  5196. {
  5197. Commands->Innate_Disable(obj);
  5198. }
  5199. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5200. {
  5201. if (param == M01_START_ACTING_JDG)
  5202. {
  5203. ActionParamsStruct params;
  5204. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  5205. params.Set_Animation( "H_A_7002", true );
  5206. Commands->Action_Play_Animation ( obj, params );
  5207. Vector3 myPosition = Commands->Get_Position ( obj );
  5208. Commands->Create_Object ( "Visceroid", myPosition );
  5209. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0.5f );
  5210. }
  5211. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  5212. {
  5213. Commands->Apply_Damage( obj, 10000, "TiberiumRaw", NULL );
  5214. }
  5215. }
  5216. };
  5217. DECLARE_SCRIPT(M11_Petrova_Script_JDG, "")//Petrova's ID is M11_MUTANT_PETROVA_JDG 100690
  5218. {
  5219. enum LocationEnum {
  5220. UNDEFINED_LOCATION = -1,
  5221. SOUTH0,
  5222. EAST0,
  5223. WEST0,
  5224. EAST1,
  5225. NORTH1,
  5226. WEST1,
  5227. SOUTH2,
  5228. EAST2,
  5229. WEST2
  5230. };
  5231. enum WaypathEnum {
  5232. INITIAL_TO_SOUTH0 = 300325,
  5233. SOUTH0_TO_EAST0 = 300117,
  5234. SOUTH0_TO_WEST0 = 300113,
  5235. EAST0_TO_SOUTH0 = 300149,
  5236. EAST0_TO_WEST0 = 300153,
  5237. EAST0_TO_WEST1 = 300121,
  5238. WEST0_TO_SOUTH0 = 300145,
  5239. WEST0_TO_EAST0 = 300157,
  5240. EAST1_TO_WEST1 = 300201,
  5241. EAST1_TO_WEST2 = 300243,
  5242. NORTH1_TO_WEST1 = 300238,
  5243. WEST1_TO_EAST0 = 300125,
  5244. WEST1_TO_NORTH1 = 300233,
  5245. WEST1_TO_EAST1 = 300193,
  5246. SOUTH2_TO_EAST2 = 300285,
  5247. SOUTH2_TO_WEST2 = 300299,
  5248. EAST2_TO_SOUTH2 = 300281,
  5249. EAST2_TO_WEST2 = 300277,
  5250. WEST2_TO_EAST1 = 300249,
  5251. WEST2_TO_SOUTH2 = 300294,
  5252. WEST2_TO_EAST2 = 300273
  5253. };
  5254. LocationEnum CurrentLocation;
  5255. bool midtro01_over;
  5256. REGISTER_VARIABLES()
  5257. {
  5258. SAVE_VARIABLE (CurrentLocation, 1);
  5259. SAVE_VARIABLE (midtro01_over, 2);
  5260. }
  5261. void Created (GameObject *obj)
  5262. {
  5263. Commands->Select_Weapon ( obj, NULL );
  5264. midtro01_over = false;
  5265. CurrentLocation = UNDEFINED_LOCATION;
  5266. Commands->Innate_Disable (obj);
  5267. Commands->Enable_Stealth (obj, false);
  5268. ActionParamsStruct params;
  5269. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  5270. params.Set_Animation( "S_A_HUMAN.H_A_CON2", true );
  5271. Commands->Action_Play_Animation ( obj, params );
  5272. }
  5273. void Damaged( GameObject * obj, GameObject * damager, float amount )
  5274. {
  5275. if (midtro01_over == false)
  5276. {
  5277. float myMaxHealth = Commands->Get_Max_Health ( obj );
  5278. float myMaxShield = Commands->Get_Max_Shield_Strength ( obj );
  5279. Commands->Set_Health ( obj, myMaxHealth );
  5280. Commands->Set_Shield_Strength ( obj, myMaxShield );
  5281. GameObject * midtro01Controller = Commands->Find_Object ( 101449 );
  5282. if (midtro01Controller != NULL)
  5283. {
  5284. Commands->Send_Custom_Event ( obj, midtro01Controller, 0, M01_START_ACTING_JDG, 0 );
  5285. }
  5286. }
  5287. }
  5288. void Killed( GameObject * obj, GameObject * killer ) //
  5289. {
  5290. Vector3 spawn_location (3.6f, 87.9f, -34.2f);
  5291. spawn_location.Z = spawn_location.Z + 0.75f;
  5292. GameObject * keycard = Commands->Create_Object ( "Level_03_Keycard", spawn_location );
  5293. if (keycard != NULL)
  5294. {
  5295. Commands->Attach_Script(keycard, "M11_Level03Key_Script_JDG", "");
  5296. }
  5297. GameObject * tauntController = Commands->Find_Object ( 103797 );
  5298. if (tauntController != NULL)
  5299. {
  5300. Commands->Send_Custom_Event ( obj, tauntController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  5301. }
  5302. GameObject * stealthController = Commands->Find_Object ( 106230 );
  5303. if (stealthController != NULL)
  5304. {
  5305. Commands->Destroy_Object ( stealthController );
  5306. }
  5307. }
  5308. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5309. {
  5310. static LocationEnum _locations [][3][2] = {
  5311. // Player level Player above Player below.
  5312. {{EAST0 , WEST0}, {EAST0 , WEST0}, {EAST0, EAST0}}, // Destinations from SOUTH0.
  5313. {{SOUTH0, WEST0}, {SOUTH0, WEST0}, {WEST1, WEST1}}, // Destinations from EAST0.
  5314. {{SOUTH0, EAST0}, {SOUTH0, EAST0}, {EAST0, EAST0}}, // Destinations from WEST0.
  5315. {{WEST1, WEST1}, {WEST1, WEST1}, {WEST2, WEST2}}, // Destinations from EAST1.
  5316. {{WEST1, WEST1}, {WEST1, WEST1}, {WEST1, WEST1}}, // Destinations from NORTH1.
  5317. {{EAST1, NORTH1}, {EAST0, EAST0}, {EAST1, EAST1}}, // Destinations from WEST1.
  5318. {{EAST2, WEST2}, {WEST2, WEST2}, {EAST2, WEST2}}, // Destinations from SOUTH2.
  5319. {{SOUTH2, WEST2}, {WEST2, WEST2}, {SOUTH2, WEST2}}, // Destinations from EAST2.
  5320. {{SOUTH2, EAST2}, {EAST1, EAST1}, {SOUTH2, EAST2}}, // Destinations from WEST2.
  5321. };
  5322. static WaypathEnum _waypaths [][3][2] = {
  5323. {{SOUTH0_TO_EAST0, SOUTH0_TO_WEST0}, {SOUTH0_TO_EAST0, SOUTH0_TO_WEST0}, {SOUTH0_TO_EAST0, SOUTH0_TO_EAST0}}, // Waypaths from SOUTH0.
  5324. {{EAST0_TO_SOUTH0, EAST0_TO_WEST0} , {EAST0_TO_SOUTH0, EAST0_TO_WEST0} , {EAST0_TO_WEST1 , EAST0_TO_WEST1}}, // Waypaths from EAST0.
  5325. {{WEST0_TO_SOUTH0, WEST0_TO_EAST0} , {WEST0_TO_SOUTH0, WEST0_TO_EAST0} , {WEST0_TO_EAST0 , WEST0_TO_EAST0}}, // Waypaths from WEST0.
  5326. {{EAST1_TO_WEST1, EAST1_TO_WEST1} , {EAST1_TO_WEST1, EAST1_TO_WEST1} , {EAST1_TO_WEST2, EAST1_TO_WEST2}}, // Waypaths from EAST1.
  5327. {{NORTH1_TO_WEST1, NORTH1_TO_WEST1}, {NORTH1_TO_WEST1, NORTH1_TO_WEST1}, {NORTH1_TO_WEST1, NORTH1_TO_WEST1}}, // Waypaths from NORTH1.
  5328. {{WEST1_TO_EAST1, WEST1_TO_NORTH1}, {WEST1_TO_EAST0, WEST1_TO_EAST0}, {WEST1_TO_EAST1, WEST1_TO_EAST1}}, // Waypaths from WEST1.
  5329. {{SOUTH2_TO_EAST2, SOUTH2_TO_WEST2}, {SOUTH2_TO_WEST2, SOUTH2_TO_WEST2}, {SOUTH2_TO_EAST2, SOUTH2_TO_WEST2}}, // Waypaths from SOUTH2.
  5330. {{EAST2_TO_SOUTH2, EAST2_TO_WEST2} , {EAST2_TO_WEST2, EAST2_TO_WEST2} , {EAST2_TO_SOUTH2, EAST2_TO_WEST2}}, // Waypaths from EAST2.
  5331. {{WEST2_TO_SOUTH2, WEST2_TO_EAST2} , {WEST2_TO_EAST1, WEST2_TO_EAST1} , {WEST2_TO_SOUTH2, WEST2_TO_EAST2}} // Waypaths from WEST2.
  5332. };
  5333. ActionParamsStruct params;
  5334. if (type == 0)
  5335. {
  5336. switch (param)
  5337. {
  5338. case M11_PETROVA_START_ACTING_JDG:
  5339. {
  5340. GameObject * tauntController = Commands->Find_Object ( 103797 );
  5341. if (tauntController != NULL)
  5342. {
  5343. Commands->Send_Custom_Event ( obj, tauntController, 0, M01_START_ACTING_JDG, 0 );
  5344. }
  5345. Vector3 myPosition = Commands->Get_Position ( obj );
  5346. //Commands->Create_Logical_Sound (obj, M11_STEALTHS_START_ACTING_JDG, myPosition, 150 );
  5347. midtro01_over = true;
  5348. Commands->Enable_Stealth (obj, true);
  5349. Commands->Select_Weapon ( obj, "Weapon_TiberiumAutoRifle_Ai" );
  5350. const float priority = 100.0f;
  5351. const float normalizedspeed = 2.0f; // Maximum speed.
  5352. Commands->Debug_Message ( "***************************Petrova--received custom to start acting\n" );
  5353. params.Set_Basic (this, priority, M11_PETROVA_PICK_NEW_LOCATION_JDG);
  5354. params.Set_Movement (Vector3 (0.0f, 0.0f, 0.0f), normalizedspeed, 1.0f);
  5355. params.WaypathID = INITIAL_TO_SOUTH0;
  5356. Commands->Action_Goto (obj, params);
  5357. CurrentLocation = SOUTH0;
  5358. break;
  5359. }
  5360. case M11_PETROVA_PICK_NEW_LOCATION_JDG:
  5361. {
  5362. const float heightthreshold = 1.0f;
  5363. const float priority = 100.0f;
  5364. float heightdelta;
  5365. unsigned heightselector;
  5366. int binaryselector;
  5367. heightdelta = Commands->Get_Position (STAR).Z - Commands->Get_Position (obj).Z;
  5368. if (heightdelta < -heightthreshold) {
  5369. heightselector = 2; // Player is below Petrova.
  5370. } else {
  5371. if (heightdelta > heightthreshold) {
  5372. heightselector = 1; // Player is above Petrova.
  5373. } else {
  5374. heightselector = 0; // Player is level with Petrova.
  5375. }
  5376. }
  5377. binaryselector = Commands->Get_Random_Int (0, 2);
  5378. params.Set_Basic (this, priority, M11_PETROVA_PICK_NEW_LOCATION_JDG);
  5379. params.Set_Movement (Vector3 (0.0f, 0.0f, 0.0f), RUN, 1.0f);
  5380. params.WaypathID = _waypaths [CurrentLocation][heightselector][binaryselector];
  5381. Commands->Action_Goto (obj, params);
  5382. CurrentLocation = _locations [CurrentLocation][heightselector][binaryselector];
  5383. break;
  5384. }
  5385. case M11_PETROVA_ATTACK_PLAYER_JDG:
  5386. {
  5387. const float priority = 100.0f;
  5388. const float range = 300.0f;
  5389. const float error = 0.0f;
  5390. const float attackdelay = 0.25f;
  5391. const float pickdelay = 0.25f;
  5392. params.Set_Basic (this, priority, M11_PETROVA_ATTACK_PLAYER_JDG);
  5393. params.Set_Attack (STAR, range, error, false);
  5394. Commands->Action_Attack (obj, params);
  5395. if (Commands->Is_Object_Visible (obj, STAR)) {
  5396. Commands->Send_Custom_Event (obj, obj, 0, M11_PETROVA_ATTACK_PLAYER_JDG, attackdelay);
  5397. } else {
  5398. Commands->Send_Custom_Event (obj, obj, 0, M11_PETROVA_PICK_NEW_LOCATION_JDG, pickdelay);
  5399. }
  5400. break;
  5401. }
  5402. default:
  5403. break;
  5404. }
  5405. }
  5406. }
  5407. void Action_Complete (GameObject *obj, int actionid, ActionCompleteReason completereason)
  5408. {
  5409. switch (completereason) {
  5410. case ACTION_COMPLETE_NORMAL:
  5411. {
  5412. if (actionid == M11_PETROVA_PICK_NEW_LOCATION_JDG) {
  5413. const float priority = 100.0f;
  5414. const float turnduration = 1.0f;
  5415. ActionParamsStruct params;
  5416. params.Set_Basic (this, priority, M11_PETROVA_FACE_PLAYER_IML);
  5417. params.Set_Face_Location (Commands->Get_Position (STAR), turnduration);
  5418. Commands->Action_Face_Location (obj, params);
  5419. } else {
  5420. if (actionid == M11_PETROVA_FACE_PLAYER_IML) {
  5421. Commands->Send_Custom_Event (obj, obj, 0, M11_PETROVA_ATTACK_PLAYER_JDG, 0.0f);
  5422. }
  5423. }
  5424. break;
  5425. }
  5426. default:
  5427. // Do nothing.
  5428. break;
  5429. }
  5430. }
  5431. };
  5432. DECLARE_SCRIPT(M11_Level03Key_Script_JDG, "")
  5433. {
  5434. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5435. {
  5436. if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
  5437. {
  5438. GameObject * midtro01Controller = Commands->Find_Object ( 101449 );
  5439. if (midtro01Controller != NULL)
  5440. {
  5441. Commands->Send_Custom_Event ( obj, midtro01Controller, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5442. }
  5443. }
  5444. }
  5445. };
  5446. DECLARE_SCRIPT(M11_Okay_ToPlay_MidtroZone_JDG, "")
  5447. {
  5448. void Entered( GameObject * obj, GameObject * enterer )
  5449. {
  5450. if (enterer == STAR)
  5451. {
  5452. GameObject * midtro01Controller = Commands->Find_Object ( 101449 );
  5453. if (midtro01Controller != NULL)
  5454. {
  5455. Commands->Send_Custom_Event ( obj, midtro01Controller, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  5456. }
  5457. Commands->Destroy_Object ( obj );
  5458. }
  5459. }
  5460. };
  5461. DECLARE_SCRIPT(M11_Start_FirstMidtro_Zone_JDG, "")//101449
  5462. {
  5463. bool entered;
  5464. bool command_clearance;
  5465. REGISTER_VARIABLES()
  5466. {
  5467. SAVE_VARIABLE(entered, 1);
  5468. SAVE_VARIABLE(command_clearance, 2);
  5469. }
  5470. void Created( GameObject * obj )
  5471. {
  5472. entered = false;
  5473. command_clearance = false;
  5474. }
  5475. void Entered( GameObject * obj, GameObject * enterer )
  5476. {
  5477. if (enterer == STAR)
  5478. {
  5479. if (entered == false && command_clearance == true)
  5480. {
  5481. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 0 );
  5482. }
  5483. }
  5484. }
  5485. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5486. {
  5487. if (type == 0)
  5488. {
  5489. if (param == 0)//first midtro is over--set everyone back to visible
  5490. {
  5491. Commands->Set_Position ( STAR, Vector3(-2.124f, 84.915f, -34.233f) );
  5492. Commands->Set_Facing ( STAR, 87 );
  5493. Commands->Control_Enable ( STAR, true );
  5494. Commands->Set_Is_Rendered( STAR, true );
  5495. GameObject *petrova = Commands->Find_Object ( M11_MUTANT_PETROVA_JDG );
  5496. if (petrova != NULL)
  5497. {
  5498. Commands->Set_Is_Rendered( petrova, true );
  5499. Commands->Send_Custom_Event( obj, petrova, 0, M11_PETROVA_START_ACTING_JDG, 0 );
  5500. }
  5501. GameObject *mutant01 = Commands->Find_Object ( 101964 );
  5502. GameObject *mutant02 = Commands->Find_Object ( 101997 );
  5503. //GameObject *visceroid01 = Commands->Find_Object ( 101966 );
  5504. //GameObject *visceroid02 = Commands->Find_Object ( 101996 );
  5505. //GameObject *visceroid03 = Commands->Find_Object ( 101965 );
  5506. if (mutant01 != NULL)
  5507. {
  5508. Commands->Send_Custom_Event( obj, mutant01, 0, M01_START_ACTING_JDG, 0 );
  5509. }
  5510. if (mutant02 != NULL)
  5511. {
  5512. Commands->Send_Custom_Event( obj, mutant02, 0, M01_START_ACTING_JDG, 3 );
  5513. }
  5514. GameObject * visceroid01 = Commands->Find_Object (101995);
  5515. GameObject * visceroid02 = Commands->Find_Object (101996);
  5516. if (visceroid01 != NULL)
  5517. {
  5518. Commands->Send_Custom_Event( obj, visceroid01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5519. }
  5520. if (visceroid02 != NULL)
  5521. {
  5522. Commands->Send_Custom_Event( obj, visceroid02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5523. }
  5524. /*if (visceroid01 != NULL)
  5525. {
  5526. Commands->Send_Custom_Event( obj, visceroid01, 0, M01_START_ACTING_JDG, 0 );
  5527. }
  5528. if (visceroid02 != NULL)
  5529. {
  5530. Commands->Send_Custom_Event( obj, visceroid02, 0, M01_START_ACTING_JDG, 3 );
  5531. }
  5532. if (visceroid03 != NULL)
  5533. {
  5534. Commands->Send_Custom_Event( obj, visceroid03, 0, M01_START_ACTING_JDG, 5 );
  5535. }*/
  5536. }
  5537. else if (param == 1)//second midtro is over--set everyone back to visible
  5538. {
  5539. GameObject * simpleSydney = Commands->Find_Object (M11_SIMPLE_SYDNEY_MOBIUS_JDG);
  5540. if (simpleSydney != NULL)
  5541. {
  5542. Vector3 sydnesLocation (0.084f, 91.860f, -34.233f);
  5543. GameObject * realSydney = Commands->Find_Object (M11_REAL_SYDNEY_MOBIUS_JDG);
  5544. if (realSydney != NULL)
  5545. {
  5546. Commands->Set_Shield_Strength ( realSydney, 100 );
  5547. Commands->Set_Obj_Radar_Blip_Shape (realSydney, RADAR_BLIP_SHAPE_HUMAN );
  5548. Commands->Set_Obj_Radar_Blip_Color ( realSydney, RADAR_BLIP_COLOR_GDI );
  5549. Commands->Set_Is_Visible( realSydney, true );
  5550. Commands->Set_Is_Rendered( realSydney, true );
  5551. Commands->Set_Position ( realSydney, sydnesLocation );
  5552. Commands->Send_Custom_Event( obj, realSydney, 0, M01_START_ACTING_JDG, 0.5f );
  5553. }
  5554. Commands->Destroy_Object ( simpleSydney );//get rid of simple version of Sydney
  5555. }
  5556. Commands->Set_Position ( STAR, Vector3(2.2f, 91.8f, -34.2f) );
  5557. Commands->Set_Facing ( STAR, 127 );
  5558. Commands->Control_Enable ( STAR, true );
  5559. Commands->Set_Is_Rendered( STAR, true );
  5560. }
  5561. else if (param == M01_START_ACTING_JDG && entered == false && command_clearance == true)
  5562. {
  5563. entered = true;
  5564. GameObject *petrova = Commands->Find_Object ( M11_MUTANT_PETROVA_JDG );
  5565. if (petrova != NULL)
  5566. {
  5567. Commands->Set_Is_Rendered( petrova, false );
  5568. }
  5569. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  5570. Commands->Attach_Script(controller, "Test_Cinematic", "X11M_MIDTRO.txt");
  5571. Commands->Control_Enable ( STAR, false );
  5572. Commands->Set_Is_Rendered( STAR, false );
  5573. Commands->Set_Position ( STAR, Vector3(-2.124f, 84.915f, -34.233f) );
  5574. Commands->Set_Facing ( STAR, 87 );
  5575. Commands->Static_Anim_Phys_Goto_Frame ( 1300001124, 6, "SHP_DOORP01.SHP_DOORP01" );
  5576. Commands->Static_Anim_Phys_Goto_Frame ( 1300001123, 6, "SHP_DOORP01.SHP_DOORP01" );
  5577. GameObject * visceroid01 = Commands->Find_Object (101995);
  5578. GameObject * visceroid02 = Commands->Find_Object (101996);
  5579. if (visceroid01 != NULL)
  5580. {
  5581. Commands->Send_Custom_Event( obj, visceroid01, 0, M01_START_ACTING_JDG, 5 );
  5582. }
  5583. if (visceroid02 != NULL)
  5584. {
  5585. Commands->Send_Custom_Event( obj, visceroid02, 0, M01_START_ACTING_JDG, 5 );
  5586. }
  5587. }
  5588. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  5589. {
  5590. Commands->Control_Enable ( STAR, false );
  5591. Commands->Set_Is_Rendered( STAR, false );
  5592. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  5593. Commands->Attach_Script(controller, "Test_Cinematic", "X11N_MIDTRO.txt");
  5594. }
  5595. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  5596. {
  5597. command_clearance = true;
  5598. }
  5599. }
  5600. }
  5601. };
  5602. DECLARE_SCRIPT(M11_PowerCore_TriggerPetrova_EnterZone_JDG, "")
  5603. {
  5604. void Entered( GameObject * obj, GameObject * enterer )
  5605. {
  5606. if (enterer == STAR)
  5607. {
  5608. GameObject * petrova = Commands->Find_Object (M11_MUTANT_PETROVA_JDG);
  5609. if (petrova != NULL)
  5610. {
  5611. Commands->Debug_Message ( "***************************M11-Petrova trigger zone sending custom to petrova--jdg\n" );
  5612. Commands->Send_Custom_Event( obj, petrova, 0, M11_PETROVA_START_ACTING_JDG, 0 );
  5613. Commands->Destroy_Object ( obj );//one time zone--cleaning up
  5614. }
  5615. else
  5616. {
  5617. Commands->Debug_Message ( "***************************M11-Petrova trigger zone cannot find petrova--jdg\n" );
  5618. }
  5619. }
  5620. }
  5621. };
  5622. DECLARE_SCRIPT(M11_Barracks_MutantUprising_BlackhandGuy_JDG, "")//M11_BARRACKS_MUTANTUPRISING_BLACKHAND_JDG 100387
  5623. {
  5624. void Created( GameObject * obj )
  5625. {
  5626. Commands->Innate_Disable(obj);
  5627. }
  5628. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5629. {
  5630. if (param == M01_START_ACTING_JDG)
  5631. {
  5632. Commands->Innate_Enable(obj);
  5633. GameObject * mutant01 = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_MUTANT01_JDG );
  5634. if (mutant01 != NULL)
  5635. {
  5636. ActionParamsStruct params;
  5637. params.Set_Basic(this, 45, M01_START_ATTACKING_01_JDG);
  5638. params.Set_Attack( mutant01, 50, 0, true );
  5639. params.AttackCrouched = true;
  5640. Commands->Action_Attack ( obj, params );
  5641. }
  5642. }
  5643. }
  5644. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  5645. {
  5646. ActionParamsStruct params;
  5647. switch (complete_reason)
  5648. {
  5649. case ACTION_COMPLETE_NORMAL:
  5650. {
  5651. if (action_id == M01_START_ATTACKING_01_JDG)
  5652. {
  5653. GameObject * mutant02 = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_MUTANT02_JDG );
  5654. if (mutant02 != NULL)
  5655. {
  5656. ActionParamsStruct params;
  5657. params.Set_Basic(this, 45, M01_START_ATTACKING_02_JDG);
  5658. params.Set_Attack( mutant02, 50, 0, true );
  5659. params.AttackCrouched = true;
  5660. Commands->Action_Attack ( obj, params );
  5661. }
  5662. }
  5663. }
  5664. break;
  5665. }
  5666. }
  5667. };
  5668. DECLARE_SCRIPT(M11_Barracks_MutantUprising_Mutant01_JDG, "")//M11_BARRACKS_MUTANTUPRISING_MUTANT01_JDG 100388
  5669. {
  5670. void Created( GameObject * obj )
  5671. {
  5672. Commands->Innate_Disable(obj);
  5673. }
  5674. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5675. {
  5676. if (param == M01_START_ACTING_JDG)
  5677. {
  5678. Commands->Innate_Enable(obj);
  5679. GameObject * blackhand = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_BLACKHAND_JDG );
  5680. if (blackhand != NULL)
  5681. {
  5682. ActionParamsStruct params;
  5683. params.Set_Basic(this, 45, M01_GOING_TO_HAVOC_JDG);
  5684. params.Set_Movement( blackhand, RUN, 0.5f, false );
  5685. params.Set_Attack( blackhand, 0.5f, 0, true );
  5686. Commands->Action_Attack ( obj, params );
  5687. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  5688. Vector3 myPosition = Commands->Get_Position ( obj );
  5689. Commands->Create_Sound ( soundName, myPosition, obj );
  5690. }
  5691. }
  5692. }
  5693. };
  5694. DECLARE_SCRIPT(M11_Barracks_MutantUprising_Mutant02_JDG, "")//M11_BARRACKS_MUTANTUPRISING_MUTANT02_JDG 100389
  5695. {
  5696. void Created( GameObject * obj )
  5697. {
  5698. Commands->Innate_Disable(obj);
  5699. }
  5700. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5701. {
  5702. if (param == M01_START_ACTING_JDG)
  5703. {
  5704. Commands->Innate_Enable(obj);
  5705. GameObject * blackhand = Commands->Find_Object ( M11_BARRACKS_MUTANTUPRISING_BLACKHAND_JDG );
  5706. if (blackhand != NULL)
  5707. {
  5708. ActionParamsStruct params;
  5709. params.Set_Basic(this, 45, M01_GOING_TO_HAVOC_JDG);
  5710. params.Set_Movement( blackhand, RUN, 0.5f, false );
  5711. params.Set_Attack( blackhand, 0.5f, 0, true );
  5712. Commands->Action_Attack ( obj, params );
  5713. char *soundName = M11_Choose_Mutant_Attack_Sound ( );
  5714. Vector3 myPosition = Commands->Get_Position ( obj );
  5715. Commands->Create_Sound ( soundName, myPosition, obj );
  5716. }
  5717. }
  5718. }
  5719. };
  5720. DECLARE_SCRIPT(M11_Flyover_Contoller_JDG, "")
  5721. {
  5722. int last;
  5723. REGISTER_VARIABLES()
  5724. {
  5725. SAVE_VARIABLE(last, 1);
  5726. }
  5727. void Created(GameObject * obj)
  5728. {
  5729. Commands->Start_Timer(obj, this, 5.0f, 0);
  5730. last = 0;
  5731. }
  5732. void Timer_Expired(GameObject * obj, int timer_id)
  5733. {
  5734. if (last >= 4)
  5735. {
  5736. last = 0;
  5737. }
  5738. char *flyovers[4] =
  5739. {
  5740. //this is a low level traffic lane from nod comm to gdi ocean-- N->S
  5741. "X11A_Flyover_01.txt",
  5742. "X11A_Flyover_02.txt",
  5743. "X11A_Flyover_03.txt",
  5744. "X11A_Flyover_04.txt",
  5745. };
  5746. GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
  5747. Commands->Attach_Script(controller, "Test_Cinematic", flyovers[last]);
  5748. Commands->Start_Timer(obj, this, 10, 5);
  5749. last++;
  5750. }
  5751. };
  5752. DECLARE_SCRIPT(M11_Cinematic_Havoc_Script_JDG, "")
  5753. {
  5754. void Created( GameObject * obj )
  5755. {
  5756. Commands->Select_Weapon ( obj, NULL );
  5757. }
  5758. };
  5759. DECLARE_SCRIPT(M11_Cinematic_Petrova_Script_JDG, "")
  5760. {
  5761. void Created( GameObject * obj )
  5762. {
  5763. Commands->Enable_Stealth (obj, false);
  5764. Commands->Select_Weapon ( obj, NULL );
  5765. }
  5766. };
  5767. DECLARE_SCRIPT(M11_Sydney_SandM_Machine_Script_JDG, "")//157366
  5768. {
  5769. void Created( GameObject * obj )
  5770. {
  5771. Commands->Enable_Cinematic_Freeze( obj, false );
  5772. Commands->Set_Animation ( obj, "DSP_TORTURE.DSP_TORTURE_01", true );
  5773. }
  5774. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5775. {
  5776. if (type == 0)
  5777. {
  5778. if (param == 0)//DO FREE SYDNEY ANIM
  5779. {
  5780. Commands->Enable_Hibernation( obj, false );
  5781. Commands->Enable_Cinematic_Freeze( obj, false );
  5782. Commands->Set_Animation ( obj, "DSP_TORTURE.DSP_TORTURE_02", false );
  5783. }
  5784. }
  5785. }
  5786. };
  5787. DECLARE_SCRIPT(M11_Sydney_SandM_Chair_Script_JDG, "")//101606
  5788. {
  5789. void Created( GameObject * obj )
  5790. {
  5791. //Commands->Enable_Hibernation( obj, false );
  5792. Commands->Enable_Cinematic_Freeze( obj, false );
  5793. }
  5794. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5795. {
  5796. if (type == 0)
  5797. {
  5798. if (param == 0)//DO FREE SYDNEY ANIM
  5799. {
  5800. Commands->Enable_Hibernation( obj, false );
  5801. Commands->Enable_Cinematic_Freeze( obj, false );
  5802. Commands->Set_Animation ( obj, "DSP_TORTURE_TBL.DSP_TORTURE_T01", false );
  5803. }
  5804. }
  5805. }
  5806. };
  5807. DECLARE_SCRIPT(M11_Sydney_SandM_Wall_Script_JDG, "")//101607
  5808. {
  5809. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5810. {
  5811. if (type == 0)
  5812. {
  5813. if (param == 0)//wall goes away
  5814. {
  5815. Commands->Destroy_Object ( obj );
  5816. }
  5817. }
  5818. }
  5819. };
  5820. DECLARE_SCRIPT(M11_Sydney_SandM_Sydney_Bone_JDG, "")
  5821. {
  5822. void Created( GameObject * obj )
  5823. {
  5824. Commands->Enable_Cinematic_Freeze( obj, false );
  5825. //Commands->Enable_Hibernation( obj, false );
  5826. }
  5827. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5828. {
  5829. if (type == 0)
  5830. {
  5831. if (param == M01_MODIFY_YOUR_ACTION_JDG)//play animation A
  5832. {
  5833. Commands->Enable_Hibernation( obj, false );
  5834. Commands->Debug_Message ( "**********************Sydney bone custom received....going to anim A\n" );
  5835. Commands->Set_Animation ( obj, "X11C_BN_Sydney.X11C_SYD_A", false);
  5836. }
  5837. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//play animation B
  5838. {
  5839. Commands->Enable_Hibernation( obj, false );
  5840. Commands->Debug_Message ( "**********************Sydney bone custom received....going to anim B\n" );
  5841. Commands->Set_Animation ( obj, "X11C_BN_Sydney.X11C_SYD_B", false);
  5842. }
  5843. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//play animation c
  5844. {
  5845. Commands->Enable_Hibernation( obj, false );
  5846. Commands->Debug_Message ( "**********************Sydney bone custom received....going to anim C\n" );
  5847. Commands->Set_Animation ( obj, "X11C_BN_Sydney.X11C_SYD_C", false);
  5848. }
  5849. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//play animation d
  5850. {
  5851. Commands->Enable_Hibernation( obj, false );
  5852. Commands->Debug_Message ( "**********************Sydney bone custom received....going to anim D\n" );
  5853. Commands->Set_Animation ( obj, "X11C_BN_Sydney.X11C_SYD_D", false);
  5854. }
  5855. }
  5856. }
  5857. };
  5858. DECLARE_SCRIPT(M11_SimpleSydney_Script_JDG, "")//M11_SIMPLE_SYDNEY_MOBIUS_JDG 100697
  5859. {
  5860. int bone_id;
  5861. REGISTER_VARIABLES()
  5862. {
  5863. SAVE_VARIABLE(bone_id, 1);
  5864. }
  5865. void Created( GameObject * obj )
  5866. {
  5867. Commands->Enable_Cinematic_Freeze( obj, false );
  5868. GameObject * tortureMachine = Commands->Find_Object ( 157366 );
  5869. if (tortureMachine != NULL)
  5870. {
  5871. Vector3 machinePosition = Commands->Get_Position ( tortureMachine );
  5872. float machineFacing = Commands->Get_Facing ( tortureMachine );
  5873. GameObject * troopbone = Commands->Create_Object("Invisible_Object", machinePosition );
  5874. Commands->Set_Model ( troopbone, "X11C_BN_Sydney" );
  5875. Commands->Set_Facing ( troopbone, machineFacing );
  5876. Commands->Attach_Script(troopbone, "M11_Sydney_SandM_Sydney_Bone_JDG", "");
  5877. bone_id = Commands->Get_ID ( troopbone );
  5878. Commands->Attach_To_Object_Bone( obj, troopbone, "BN_SYDNEY" );
  5879. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5880. Commands->Debug_Message ( "**********************bone created with ID....................%d\n", bone_id );
  5881. }
  5882. }
  5883. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  5884. {
  5885. if (type == 0)
  5886. {
  5887. if (param == 0)//now do free sydney anim
  5888. {
  5889. GameObject * troopbone = Commands->Find_Object ( bone_id );
  5890. if (troopbone != NULL)
  5891. {
  5892. Commands->Debug_Message ( "**********************Sydney anim D sending custom to bone\n" );
  5893. Commands->Send_Custom_Event ( obj, troopbone, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
  5894. Commands->Set_Animation ( obj, "S_B_HUMAN.H_B_X11C_SYD_D", false);
  5895. }
  5896. else
  5897. {
  5898. Commands->Debug_Message ( "**********************Sydney anim D cannot find bone\n" );
  5899. }
  5900. }
  5901. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//play animation A
  5902. {
  5903. GameObject * troopbone = Commands->Find_Object ( bone_id );
  5904. if (troopbone != NULL)
  5905. {
  5906. Commands->Debug_Message ( "**********************Sydney anim A sending custom to bone\n" );
  5907. Commands->Send_Custom_Event ( obj, troopbone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5908. Commands->Set_Animation ( obj, "S_B_HUMAN.H_B_X11C_SYD_A", false);
  5909. }
  5910. else
  5911. {
  5912. Commands->Debug_Message ( "**********************Sydney anim A cannot find bone\n" );
  5913. }
  5914. }
  5915. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//play animation B
  5916. {
  5917. GameObject * troopbone = Commands->Find_Object ( bone_id );
  5918. if (troopbone != NULL)
  5919. {
  5920. Commands->Debug_Message ( "**********************Sydney anim B sending custom to bone\n" );
  5921. Commands->Send_Custom_Event ( obj, troopbone, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  5922. Commands->Set_Animation ( obj, "S_B_HUMAN.H_B_X11C_SYD_B", false);
  5923. }
  5924. else
  5925. {
  5926. Commands->Debug_Message ( "**********************Sydney anim B cannot find bone\n" );
  5927. }
  5928. }
  5929. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//play animation c
  5930. {
  5931. GameObject * troopbone = Commands->Find_Object ( bone_id );
  5932. if (troopbone != NULL)
  5933. {
  5934. Commands->Debug_Message ( "**********************Sydney anim C sending custom to bone\n" );
  5935. Commands->Send_Custom_Event ( obj, troopbone, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  5936. Commands->Set_Animation ( obj, "S_B_HUMAN.H_B_X11C_SYD_C", false);
  5937. }
  5938. else
  5939. {
  5940. Commands->Debug_Message ( "**********************Sydney anim C cannot find bone\n" );
  5941. }
  5942. }
  5943. //else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//play animation d
  5944. //{
  5945. //}
  5946. }
  5947. }
  5948. void Animation_Complete(GameObject * obj, const char *anim)
  5949. {
  5950. if (stricmp(anim, "S_B_HUMAN.H_B_X11C_SYD_A") == 0)
  5951. {
  5952. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  5953. }
  5954. else if (stricmp(anim, "S_B_HUMAN.H_B_X11C_SYD_B") == 0)
  5955. {
  5956. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  5957. }
  5958. else if (stricmp(anim, "S_B_HUMAN.H_B_X11C_SYD_C") == 0)
  5959. {
  5960. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5961. }
  5962. else if (stricmp(anim, "S_B_HUMAN.H_B_X11C_SYD_D") == 0)
  5963. {
  5964. //Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  5965. }
  5966. }
  5967. };
  5968. Vector3 m11ObeliskExplosionLocs[13] = {
  5969. Vector3 (-10.432f, -96.805f, 4.504f),
  5970. Vector3 (-15.732f, -106.739f, 10.572f),
  5971. Vector3 (0.665f, -105.108f, 8.224f),
  5972. Vector3 (14.913f, -99.565f, 4.977f),
  5973. Vector3 (33.114f, -103.768f, 7.549f),
  5974. Vector3 (34.822f, -114.184f, 12.776f),
  5975. Vector3 (24.790f, -116.226f, 13.617f),
  5976. Vector3 (12.581f, -111.634f, 11.247f),
  5977. Vector3 (-5.196f, -116.416f, 13.689f),
  5978. Vector3 (-9.931f, -136.410f, 18.047f),
  5979. Vector3 (8.336f, -122.921f, 21.475f),
  5980. Vector3 (12.898f, -123.847f, 27.640f),
  5981. Vector3 (6.441f, -125.543f, 36.824f),
  5982. };
  5983. DECLARE_SCRIPT(M11_ObeliskBattle_Contoller_JDG, "")//101805
  5984. {
  5985. int last;
  5986. bool commandClearance;
  5987. REGISTER_VARIABLES()
  5988. {
  5989. SAVE_VARIABLE( last, 1 );
  5990. SAVE_VARIABLE( commandClearance, 2 );
  5991. }
  5992. void Created( GameObject * obj )
  5993. {
  5994. Commands->Enable_Hibernation( obj, false );
  5995. commandClearance = true;
  5996. float delayTimer = Commands->Get_Random ( 0, 5 );
  5997. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ATTACKING_01_JDG, delayTimer );
  5998. last = 20;
  5999. }
  6000. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6001. {
  6002. if (param == M01_GOTO_IDLE_JDG)
  6003. {
  6004. commandClearance = false;
  6005. Commands->Enable_Hibernation( obj, true );
  6006. }
  6007. else if (param == M01_START_ACTING_JDG)
  6008. {
  6009. commandClearance = true;
  6010. Commands->Enable_Hibernation( obj, false );
  6011. float delayTimer = Commands->Get_Random ( 0, 5 );
  6012. Commands->Start_Timer(obj, this, delayTimer, 0);
  6013. }
  6014. else if (param == M01_START_ATTACKING_01_JDG)
  6015. {
  6016. if (commandClearance == true)
  6017. {
  6018. int random = Commands->Get_Random_Int(0, 13);
  6019. while (random == last) {
  6020. random = Commands->Get_Random_Int(0, 13);
  6021. }
  6022. last = random;
  6023. Commands->Create_Explosion ( "Ground Explosions - Harmless", m11ObeliskExplosionLocs[random], NULL );
  6024. float delayTimer = Commands->Get_Random ( 5, 10 );
  6025. Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ATTACKING_01_JDG, delayTimer );
  6026. }
  6027. }
  6028. }
  6029. };
  6030. DECLARE_SCRIPT(M11_Cell_Mutant01_JDG, "")
  6031. {
  6032. void Created( GameObject * obj )
  6033. {
  6034. Commands->Innate_Disable(obj);
  6035. Commands->Set_Loiters_Allowed( obj, false );
  6036. ActionParamsStruct params;
  6037. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  6038. params.Set_Animation( "S_A_HUMAN.H_A_7002", true );
  6039. Commands->Action_Play_Animation ( obj, params );
  6040. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
  6041. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_MUTANT );
  6042. }
  6043. };
  6044. DECLARE_SCRIPT(M11_Cell_Mutant02_JDG, "")
  6045. {
  6046. void Created( GameObject * obj )
  6047. {
  6048. Commands->Set_Loiters_Allowed( obj, false );
  6049. ActionParamsStruct params;
  6050. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  6051. params.Set_Animation ("H_A_A0A0_L28B", true);
  6052. Commands->Action_Play_Animation (obj, params);
  6053. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
  6054. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_MUTANT );
  6055. }
  6056. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6057. {
  6058. ActionParamsStruct params;
  6059. if (param == M01_START_ACTING_JDG)
  6060. {
  6061. ActionParamsStruct params;
  6062. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  6063. params.Set_Animation ("H_A_A0A0_L28C", false);
  6064. Commands->Action_Play_Animation (obj, params);
  6065. //Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_MUTANT );
  6066. //Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_MUTANT );
  6067. }
  6068. }
  6069. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  6070. {
  6071. if (complete_reason == ACTION_COMPLETE_NORMAL)
  6072. {
  6073. if (action_id == M01_DOING_ANIMATION_02_JDG)
  6074. {
  6075. ActionParamsStruct params;
  6076. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6077. params.Set_Movement(Vector3 (0, 0, 0), RUN, 3);
  6078. params.WaypathID = 104142;
  6079. Commands->Action_Goto(obj, params);
  6080. }
  6081. else if (action_id == M01_WALKING_WAYPATH_01_JDG)
  6082. {
  6083. GameObject * petrova = Commands->Find_Object ( M11_MUTANT_PETROVA_JDG );
  6084. if (petrova != NULL)
  6085. {
  6086. ActionParamsStruct params;
  6087. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6088. params.Set_Movement(petrova, RUN, 15);
  6089. params.Set_Attack( petrova, 20, 0, true );
  6090. Commands->Action_Attack(obj, params);
  6091. }
  6092. }
  6093. }
  6094. }
  6095. };
  6096. DECLARE_SCRIPT(M11_Cell_Visceroid_JDG, "")
  6097. {
  6098. bool deadYet;
  6099. REGISTER_VARIABLES()
  6100. {
  6101. SAVE_VARIABLE( deadYet, 1 );
  6102. }
  6103. void Created( GameObject * obj )
  6104. {
  6105. deadYet = false;
  6106. Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NOD );
  6107. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_MUTANT );
  6108. //Commands->Enable_Cinematic_Freeze( obj, false );
  6109. }
  6110. void Killed( GameObject * obj, GameObject * killer )
  6111. {
  6112. deadYet = true;
  6113. }
  6114. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6115. {
  6116. ActionParamsStruct params;
  6117. if (param == M01_START_ACTING_JDG)
  6118. {
  6119. //Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_MUTANT );
  6120. //Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_MUTANT );
  6121. int myId = Commands->Get_ID ( obj );
  6122. if (myId == 101995 && deadYet == false)
  6123. {
  6124. Vector3 warpSpot (-4.544f, 86.890f, -34);
  6125. Commands->Set_Position ( obj, warpSpot );
  6126. ActionParamsStruct params;
  6127. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6128. //params.Set_Movement(Vector3 (-10.635f, 68.057f, -34.233f), RUN, 1);
  6129. //making first change here...run to walk
  6130. Commands->Action_Goto(obj, params);
  6131. params.Set_Movement(Vector3 (-10.635f, 68.057f, -34.233f), WALK, 1);
  6132. }
  6133. else if (myId == 101996 && deadYet == false)
  6134. {
  6135. //Vector3 warpSpot (-2.457f, 84, -34);
  6136. //change 2 going here
  6137. Vector3 warpSpot (-7.272f, 77.365f, -34);
  6138. Commands->Set_Position ( obj, warpSpot );
  6139. ActionParamsStruct params;
  6140. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6141. //params.Set_Movement(Vector3 (10.745f, 66.866f, -34.233f), RUN, 1);
  6142. //making first change here...run to walk
  6143. params.Set_Movement(Vector3 (10.745f, 66.866f, -34.233f), WALK, 1);
  6144. Commands->Action_Goto(obj, params);
  6145. }
  6146. Commands->Enable_Cinematic_Freeze( obj, true );
  6147. }
  6148. else if (param == M01_MODIFY_YOUR_ACTION_JDG)
  6149. {
  6150. GameObject * petrova = Commands->Find_Object ( M11_MUTANT_PETROVA_JDG );
  6151. if (petrova != NULL)
  6152. {
  6153. ActionParamsStruct params;
  6154. params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
  6155. params.Set_Movement(petrova, RUN, 4);
  6156. params.Set_Attack( petrova, 10, 0, true );
  6157. Commands->Action_Attack(obj, params);
  6158. }
  6159. }
  6160. }
  6161. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  6162. {
  6163. if (complete_reason == ACTION_COMPLETE_NORMAL)
  6164. {
  6165. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  6166. {
  6167. Commands->Set_Innate_Is_Stationary ( obj, true );
  6168. }
  6169. }
  6170. }
  6171. };
  6172. DECLARE_SCRIPT(M11_PowerupDifficulty_Manager_JDG, "")
  6173. {
  6174. void Created( GameObject * obj )
  6175. {
  6176. int easy = 0;
  6177. int medium = 1;
  6178. int currentDifficulty = Commands->Get_Difficulty_Level( );
  6179. if (currentDifficulty == easy)
  6180. {
  6181. Commands->Create_Object ( "POW_SniperRifle_Player", Vector3(17.778f, -41.716f, 0.000f) );
  6182. Commands->Create_Object ( "POW_SniperRifle_Player", Vector3(-17.799f, -41.177f, 0.000f) );
  6183. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-11.209f, -16.475f, 0.000f) );
  6184. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(10.747f, -16.773f, 0.000f) );
  6185. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-3.467f, -33.332f, -10.015f) );
  6186. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(3.651f, -33.292f, -10.015f) );
  6187. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(1.954f, 19.875f, -18.000f) );
  6188. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-1.897f, 20.016f, -18.000f) );
  6189. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(12.768f, 5.348f, -24.531f) );
  6190. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-13.378f, 5.055f, -24.531f) );
  6191. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(7.661f, -17.279f, -29.855f) );
  6192. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-8.177f, -17.193f, -29.855f) );
  6193. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(2.911f, -32.665f, -34.789f) );
  6194. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-1.058f, -32.588f, -34.789f) );
  6195. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-14.646f, 40.156f, 0.000f) );
  6196. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(15.466f, 40.827f, 0.000f) );
  6197. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(7.671f, 23.377f, 1.594f) );
  6198. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-8.166f, 23.366f, 1.256f) );
  6199. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(6.072f, 13.298f, -10.015f) );
  6200. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-6.474f, 13.163f, -10.015f) );
  6201. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-9.831f, -17.845f, -18.000f) );
  6202. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(9.240f, -17.551f, -18.000f) );
  6203. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-3.556f, 16.234f, -24.531f) );
  6204. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(3.966f, 15.895f, -24.530f) );
  6205. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-10.515f, 33.298f, -29.855f) );
  6206. Commands->Create_Object ( "POW_SniperRifle_Player", Vector3(10.585f, 31.592f, -29.855f) );
  6207. Commands->Create_Object ( "POW_MineRemote_Player", Vector3(1.538f, -15.786f, -29.855f) );
  6208. Commands->Create_Object ( "POW_MineRemote_Player", Vector3(-0.604f, -15.760f, -29.855f) );
  6209. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-13.821f, 8.995f, -34.233f) );
  6210. //Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-13.821f, 8.995f, -34.233f) );
  6211. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(14.085f, 9.259f, -34.233f) );
  6212. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(19.320f, 17.879f, -39.484f) );
  6213. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-19.301f, 17.910f, -39.484f) );
  6214. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-12.110f, 54.177f, -39.486f) );
  6215. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(11.853f, 54.077f, -39.486f) );
  6216. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(96.844f, 51.430f, -62.686f) );
  6217. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(94.033f, 43.255f, -62.686f) );
  6218. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(27.027f, 60.014f, -55.106f) );
  6219. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(14.259f, 58.072f, -53.022f) );
  6220. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(3.860f, 98.276f, -34.233f) );
  6221. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-3.987f, 97.681f, -34.233f) );
  6222. Commands->Enable_Spawner( 102364, true );//lev 01 health
  6223. Commands->Enable_Spawner( 102367, true );//lev 01 armor
  6224. Commands->Enable_Spawner( 102370, true );//netrunner health
  6225. Commands->Enable_Spawner( 102373, true );//netrunner armor
  6226. Commands->Enable_Spawner( 102378, true );//wetbar armor
  6227. Commands->Enable_Spawner( 102381, true );//wetbar health
  6228. Commands->Enable_Spawner( 102384, true );//warroom armor
  6229. Commands->Enable_Spawner( 102387, true );//warroom health
  6230. Commands->Enable_Spawner( 102390, true );//mutant lab armor
  6231. Commands->Enable_Spawner( 102393, true );//mutant lab health
  6232. Commands->Enable_Spawner( 102396, true );//mutant crypt health01
  6233. Commands->Enable_Spawner( 102399, true );//mutant crypt armor01
  6234. Commands->Enable_Spawner( 102402, true );//mutant crypt health02
  6235. Commands->Enable_Spawner( 102405, true );//mutant crypt health03
  6236. Commands->Enable_Spawner( 102408, true );//mutant crypt armor02
  6237. Commands->Enable_Spawner( 102411, true );//abel's tomb armor
  6238. Commands->Enable_Spawner( 102414, true );//abel's tomb health
  6239. Commands->Enable_Spawner( 102417, true );//powercore bottom health
  6240. Commands->Enable_Spawner( 102420, true );//powercore bottom armor
  6241. Commands->Enable_Spawner( 102423, true );//powercore top health
  6242. Commands->Enable_Spawner( 102426, true );//powercore top armor
  6243. Commands->Enable_Spawner( 102429, true );//powercore center health
  6244. Commands->Enable_Spawner( 102432, true );//powercore center armor
  6245. }
  6246. else if (currentDifficulty == medium)
  6247. {
  6248. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-14.646f, 40.156f, 0.000f) );
  6249. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(15.466f, 40.827f, 0.000f) );
  6250. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(7.671f, 23.377f, 1.594f) );
  6251. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-8.166f, 23.366f, 1.256f) );
  6252. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(6.072f, 13.298f, -10.015f) );
  6253. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-6.474f, 13.163f, -10.015f) );
  6254. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-9.831f, -17.845f, -18.000f) );
  6255. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(9.240f, -17.551f, -18.000f) );
  6256. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-3.556f, 16.234f, -24.531f) );
  6257. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(3.966f, 15.895f, -24.530f) );
  6258. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-10.515f, 33.298f, -29.855f) );
  6259. Commands->Create_Object ( "POW_SniperRifle_Player", Vector3(10.585f, 31.592f, -29.855f) );
  6260. Commands->Create_Object ( "POW_MineRemote_Player", Vector3(1.538f, -15.786f, -29.855f) );
  6261. Commands->Create_Object ( "POW_MineRemote_Player", Vector3(-0.604f, -15.760f, -29.855f) );
  6262. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-13.821f, 8.995f, -34.233f) );
  6263. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(-13.821f, 8.995f, -34.233f) );
  6264. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(14.085f, 9.259f, -34.233f) );
  6265. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(19.320f, 17.879f, -39.484f) );
  6266. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-19.301f, 17.910f, -39.484f) );
  6267. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-12.110f, 54.177f, -39.486f) );
  6268. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(11.853f, 54.077f, -39.486f) );
  6269. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(96.844f, 51.430f, -62.686f) );
  6270. Commands->Create_Object ( "POW_RocketLauncher_Player", Vector3(94.033f, 43.255f, -62.686f) );
  6271. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(27.027f, 60.014f, -55.106f) );
  6272. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(14.259f, 58.072f, -53.022f) );
  6273. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(3.860f, 98.276f, -34.233f) );
  6274. Commands->Create_Object ( "POW_LaserChaingun_Player", Vector3(-3.987f, 97.681f, -34.233f) );
  6275. Commands->Enable_Spawner( 102360, true );//lev 01 health
  6276. Commands->Enable_Spawner( 102366, true );//lev 01 armor
  6277. Commands->Enable_Spawner( 102369, true );//netrunner health
  6278. Commands->Enable_Spawner( 102372, true );//netrunner armor
  6279. Commands->Enable_Spawner( 102377, true );//wetbar armor
  6280. Commands->Enable_Spawner( 102380, true );//wetbar health
  6281. Commands->Enable_Spawner( 102383, true );//warroom armor
  6282. Commands->Enable_Spawner( 102386, true );//warroom health
  6283. Commands->Enable_Spawner( 102389, true );//mutant lab armor
  6284. Commands->Enable_Spawner( 102392, true );//mutant lab health
  6285. Commands->Enable_Spawner( 102395, true );//mutant crypt health01
  6286. Commands->Enable_Spawner( 102398, true );//mutant crypt armor01
  6287. Commands->Enable_Spawner( 102401, true );//mutant crypt health02
  6288. Commands->Enable_Spawner( 102404, true );//mutant crypt health03
  6289. Commands->Enable_Spawner( 102407, true );//mutant crypt armor02
  6290. Commands->Enable_Spawner( 102410, true );//abel's tomb armor
  6291. Commands->Enable_Spawner( 102413, true );//abel's tomb health
  6292. Commands->Enable_Spawner( 102416, true );//powercore bottom health
  6293. Commands->Enable_Spawner( 102419, true );//powercore bottom armor
  6294. Commands->Enable_Spawner( 102422, true );//powercore top health
  6295. Commands->Enable_Spawner( 102425, true );//powercore top armor
  6296. Commands->Enable_Spawner( 102428, true );//powercore center health
  6297. Commands->Enable_Spawner( 102431, true );//powercore center armor
  6298. }
  6299. else
  6300. {
  6301. Commands->Enable_Spawner( 102359, true );//lev 01 health
  6302. Commands->Enable_Spawner( 102365, true );//lev 01 armor
  6303. Commands->Enable_Spawner( 102368, true );//netrunner health
  6304. Commands->Enable_Spawner( 102371, true );//netrunner armor
  6305. Commands->Enable_Spawner( 102376, true );//wetbar armor
  6306. Commands->Enable_Spawner( 102379, true );//wetbar health
  6307. Commands->Enable_Spawner( 102382, true );//warroom armor
  6308. Commands->Enable_Spawner( 102385, true );//warroom health
  6309. Commands->Enable_Spawner( 102388, true );//mutant lab armor
  6310. Commands->Enable_Spawner( 102391, true );//mutant lab health
  6311. Commands->Enable_Spawner( 102394, true );//mutant crypt health01
  6312. Commands->Enable_Spawner( 102397, true );//mutant crypt armor01
  6313. Commands->Enable_Spawner( 102400, true );//mutant crypt health02
  6314. Commands->Enable_Spawner( 102403, true );//mutant crypt health03
  6315. Commands->Enable_Spawner( 102406, true );//mutant crypt armor02
  6316. Commands->Enable_Spawner( 102409, true );//abel's tomb armor
  6317. Commands->Enable_Spawner( 102412, true );//abel's tomb health
  6318. Commands->Enable_Spawner( 102415, true );//powercore bottom health
  6319. Commands->Enable_Spawner( 102418, true );//powercore bottom armor
  6320. Commands->Enable_Spawner( 102421, true );//powercore top health
  6321. Commands->Enable_Spawner( 102424, true );//powercore top armor
  6322. Commands->Enable_Spawner( 102427, true );//powercore center health
  6323. Commands->Enable_Spawner( 102430, true );//powercore center armor
  6324. }
  6325. }
  6326. };
  6327. DECLARE_SCRIPT(M11_Petrova_Taunt_Controller_JDG, "")//103797
  6328. {
  6329. bool commandClearance;
  6330. bool PetrovaDead;
  6331. int last;
  6332. REGISTER_VARIABLES()
  6333. {
  6334. SAVE_VARIABLE(commandClearance, 1);
  6335. SAVE_VARIABLE(PetrovaDead, 2);
  6336. SAVE_VARIABLE(last, 2);
  6337. }
  6338. void Created( GameObject * obj )
  6339. {
  6340. commandClearance = false;
  6341. PetrovaDead = false;
  6342. last = 20;
  6343. }
  6344. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6345. {
  6346. if (type == 0)
  6347. {
  6348. if (param == M01_IVE_BEEN_KILLED_JDG)
  6349. {
  6350. PetrovaDead = true;
  6351. }
  6352. else if (param == M01_START_ACTING_JDG)
  6353. {
  6354. commandClearance = true;
  6355. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  6356. }
  6357. else if (param == M01_MODIFY_YOUR_ACTION_JDG && commandClearance == true && PetrovaDead == false)
  6358. {
  6359. char *taunt_sound[9] =
  6360. {
  6361. "M00MBPT_ATOC0001I1MBPT_SND",
  6362. "M00MBPT_ATOS0001I1MBPT_SND",
  6363. "M00MBPT_DECX0001I1MBPT_SND",
  6364. "M00MBPT_TFEA0001I1MBPT_SND",
  6365. "M00ASQR_KILL0018I1MBPT_SND",
  6366. "M00GSEN_KIOV0004I1MBPT_SND",
  6367. "M00GCTK_KIOV0004I1MBPT_SND",
  6368. "M00GSRS_KITB0004I1MBPT_SND",
  6369. "M00GSRS_KITB0004I1MBPT_SND",
  6370. };
  6371. int random = Commands->Get_Random_Int(0, 9);
  6372. while (random == last) {
  6373. random = Commands->Get_Random_Int(0, 9);
  6374. }
  6375. GameObject * petrova = Commands->Find_Object ( M11_MUTANT_PETROVA_JDG );
  6376. if (petrova != NULL)
  6377. {
  6378. Vector3 petrovaLocation = Commands->Get_Position ( petrova );
  6379. Commands->Create_Sound ( taunt_sound[random], petrovaLocation, petrova );
  6380. float delayTimer = Commands->Get_Random ( 5, 10 );
  6381. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  6382. }
  6383. }
  6384. }
  6385. }
  6386. };
  6387. DECLARE_SCRIPT(M11_Lab_Cryochamber_Switch02_JDG, "")
  6388. {
  6389. bool poked;
  6390. REGISTER_VARIABLES()
  6391. {
  6392. SAVE_VARIABLE(poked, 1);
  6393. }
  6394. void Created( GameObject * obj )
  6395. {
  6396. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  6397. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  6398. poked = false;
  6399. }
  6400. void Poked( GameObject * obj, GameObject * poker )
  6401. {
  6402. if ( poker == STAR && poked == false)
  6403. {
  6404. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  6405. poked = true;
  6406. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  6407. //Commands->Create_Sound ( "bombit1", Vector3 (0,0,0), obj );
  6408. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  6409. }
  6410. }
  6411. };
  6412. Vector3 m11cryoChamberLocs[15] = {
  6413. Vector3(-17.385f, 34.254f, -39.486f),
  6414. Vector3(-17.373f, 40.853f, -39.486f),
  6415. Vector3(-17.362f, 50.281f, -39.486f),
  6416. Vector3(-17.377f, 56.349f, -39.486f),
  6417. Vector3(-9.668f, 59.078f, -39.486f),
  6418. Vector3(-7.215f, 54.836f, -39.486f),
  6419. Vector3(-5.012f, 48.971f, -39.486f),
  6420. Vector3(-5.669f, 44.153f, -39.486f),
  6421. Vector3(4.735f, 30.950f, -39.486f),
  6422. Vector3(6.117f, 43.680f, -39.486f),
  6423. Vector3(5.037f, 49.157f, -39.486f),
  6424. Vector3(5.849f, 52.512f, -39.486f),
  6425. Vector3(8.617f, 57.247f, -39.486f),
  6426. Vector3(17.392f, 55.537f, -39.486f),
  6427. Vector3(17.386f, 44.152f, -39.486f),
  6428. };
  6429. float cryoChamberFacing[15] = {
  6430. 90,
  6431. 90,
  6432. 90,
  6433. 90,
  6434. -60,
  6435. -60,
  6436. -90,
  6437. -135,
  6438. 40,
  6439. 140,
  6440. 90,
  6441. 60,
  6442. 60,
  6443. -90,
  6444. -90,
  6445. };
  6446. Vector3 destroyedCryoChamberLocs[3] = {
  6447. Vector3(-4.544f, 30.811f, -39.486f),
  6448. Vector3(17.399f, 50.261f, -39.486f),
  6449. Vector3(17.400f, 38.322f, -39.486f),
  6450. };
  6451. float destroyedChamberFacing[3] = {
  6452. -45,
  6453. -90,
  6454. -90,
  6455. };
  6456. DECLARE_SCRIPT(M11_Lab_Cryochamber_Controller_JDG, "")//100910 M11_LABORATORY_MUTANT_CONTROLLER_JDG
  6457. {
  6458. int cryoChamber_id[15];
  6459. int simpleMutant_id[15];
  6460. int activeUnitCount;
  6461. int deadMutantCount;
  6462. REGISTER_VARIABLES()
  6463. {
  6464. SAVE_VARIABLE(activeUnitCount, 1);
  6465. SAVE_VARIABLE(deadMutantCount, 2);
  6466. SAVE_VARIABLE(cryoChamber_id[0], 3);
  6467. SAVE_VARIABLE(cryoChamber_id[1], 4);
  6468. SAVE_VARIABLE(cryoChamber_id[2], 5);
  6469. SAVE_VARIABLE(cryoChamber_id[3], 6);
  6470. SAVE_VARIABLE(cryoChamber_id[4], 7);
  6471. SAVE_VARIABLE(cryoChamber_id[5], 8);
  6472. SAVE_VARIABLE(cryoChamber_id[6], 9);
  6473. SAVE_VARIABLE(cryoChamber_id[7], 10);
  6474. SAVE_VARIABLE(cryoChamber_id[8], 11);
  6475. SAVE_VARIABLE(cryoChamber_id[9], 12);
  6476. SAVE_VARIABLE(cryoChamber_id[10], 13);
  6477. SAVE_VARIABLE(cryoChamber_id[11], 14);
  6478. SAVE_VARIABLE(cryoChamber_id[12], 15);
  6479. SAVE_VARIABLE(cryoChamber_id[13], 16);
  6480. SAVE_VARIABLE(cryoChamber_id[14], 17);
  6481. SAVE_VARIABLE(simpleMutant_id[0], 18);
  6482. SAVE_VARIABLE(simpleMutant_id[1], 19);
  6483. SAVE_VARIABLE(simpleMutant_id[2], 20);
  6484. SAVE_VARIABLE(simpleMutant_id[3], 21);
  6485. SAVE_VARIABLE(simpleMutant_id[4], 22);
  6486. SAVE_VARIABLE(simpleMutant_id[5], 23);
  6487. SAVE_VARIABLE(simpleMutant_id[6], 24);
  6488. SAVE_VARIABLE(simpleMutant_id[7], 25);
  6489. SAVE_VARIABLE(simpleMutant_id[8], 26);
  6490. SAVE_VARIABLE(simpleMutant_id[9], 27);
  6491. SAVE_VARIABLE(simpleMutant_id[10], 28);
  6492. SAVE_VARIABLE(simpleMutant_id[11], 29);
  6493. SAVE_VARIABLE(simpleMutant_id[12], 30);
  6494. SAVE_VARIABLE(simpleMutant_id[13], 31);
  6495. SAVE_VARIABLE(simpleMutant_id[14], 32);
  6496. }
  6497. void Created( GameObject * obj )
  6498. {
  6499. GameObject * cryoChamber_00 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[0] );
  6500. Commands->Set_Facing ( cryoChamber_00, cryoChamberFacing[0] );
  6501. cryoChamber_id[0] = Commands->Get_ID ( cryoChamber_00 );
  6502. Commands->Attach_Script(cryoChamber_00, "M11_Cryochamber_Simple_JDG", "0");
  6503. GameObject * cryoChamber_01 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[1] );
  6504. Commands->Set_Facing ( cryoChamber_01, cryoChamberFacing[1] );
  6505. cryoChamber_id[1] = Commands->Get_ID ( cryoChamber_01 );
  6506. Commands->Attach_Script(cryoChamber_01, "M11_Cryochamber_Simple_JDG", "1");
  6507. GameObject * cryoChamber_02 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[2] );
  6508. Commands->Set_Facing ( cryoChamber_02, cryoChamberFacing[2] );
  6509. cryoChamber_id[2] = Commands->Get_ID ( cryoChamber_02 );
  6510. Commands->Attach_Script(cryoChamber_02, "M11_Cryochamber_Simple_JDG", "2");
  6511. GameObject * cryoChamber_03 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[3] );
  6512. Commands->Set_Facing ( cryoChamber_03, cryoChamberFacing[3] );
  6513. cryoChamber_id[3] = Commands->Get_ID ( cryoChamber_03 );
  6514. Commands->Attach_Script(cryoChamber_03, "M11_Cryochamber_Simple_JDG", "3");
  6515. GameObject * cryoChamber_04 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[4] );
  6516. Commands->Set_Facing ( cryoChamber_04, cryoChamberFacing[4] );
  6517. cryoChamber_id[4] = Commands->Get_ID ( cryoChamber_04 );
  6518. Commands->Attach_Script(cryoChamber_04, "M11_Cryochamber_Simple_JDG", "4");
  6519. GameObject * cryoChamber_05 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[5] );
  6520. Commands->Set_Facing ( cryoChamber_05, cryoChamberFacing[5] );
  6521. cryoChamber_id[5] = Commands->Get_ID ( cryoChamber_05 );
  6522. Commands->Attach_Script(cryoChamber_05, "M11_Cryochamber_Simple_JDG", "5");
  6523. GameObject * cryoChamber_06 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[6] );
  6524. Commands->Set_Facing ( cryoChamber_06, cryoChamberFacing[6] );
  6525. cryoChamber_id[6] = Commands->Get_ID ( cryoChamber_06 );
  6526. Commands->Attach_Script(cryoChamber_06, "M11_Cryochamber_Simple_JDG", "6");
  6527. GameObject * cryoChamber_07 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[7] );
  6528. Commands->Set_Facing ( cryoChamber_07, cryoChamberFacing[7] );
  6529. cryoChamber_id[7] = Commands->Get_ID ( cryoChamber_07 );
  6530. Commands->Attach_Script(cryoChamber_07, "M11_Cryochamber_Simple_JDG", "7");
  6531. GameObject * cryoChamber_08 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[8] );
  6532. Commands->Set_Facing ( cryoChamber_08, cryoChamberFacing[8] );
  6533. cryoChamber_id[8] = Commands->Get_ID ( cryoChamber_08 );
  6534. Commands->Attach_Script(cryoChamber_08, "M11_Cryochamber_Simple_JDG", "8");
  6535. GameObject * cryoChamber_09 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[9] );
  6536. Commands->Set_Facing ( cryoChamber_09, cryoChamberFacing[9] );
  6537. cryoChamber_id[9] = Commands->Get_ID ( cryoChamber_09 );
  6538. Commands->Attach_Script(cryoChamber_09, "M11_Cryochamber_Simple_JDG", "9");
  6539. GameObject * cryoChamber_10 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[10] );
  6540. Commands->Set_Facing ( cryoChamber_10, cryoChamberFacing[10] );
  6541. cryoChamber_id[10] = Commands->Get_ID ( cryoChamber_10 );
  6542. Commands->Attach_Script(cryoChamber_10, "M11_Cryochamber_Simple_JDG", "10");
  6543. GameObject * cryoChamber_11 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[11] );
  6544. Commands->Set_Facing ( cryoChamber_11, cryoChamberFacing[11] );
  6545. cryoChamber_id[11] = Commands->Get_ID ( cryoChamber_11 );
  6546. Commands->Attach_Script(cryoChamber_11, "M11_Cryochamber_Simple_JDG", "11");
  6547. GameObject * cryoChamber_12 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[12] );
  6548. Commands->Set_Facing ( cryoChamber_12, cryoChamberFacing[12] );
  6549. cryoChamber_id[12] = Commands->Get_ID ( cryoChamber_12 );
  6550. Commands->Attach_Script(cryoChamber_12, "M11_Cryochamber_Simple_JDG", "12");
  6551. GameObject * cryoChamber_13 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[13] );
  6552. Commands->Set_Facing ( cryoChamber_13, cryoChamberFacing[13] );
  6553. cryoChamber_id[13] = Commands->Get_ID ( cryoChamber_13 );
  6554. Commands->Attach_Script(cryoChamber_13, "M11_Cryochamber_Simple_JDG", "13");
  6555. GameObject * cryoChamber_14 = Commands->Create_Object ( "Simple_Large_CryoChamber", m11cryoChamberLocs[14] );
  6556. Commands->Set_Facing ( cryoChamber_14, cryoChamberFacing[14] );
  6557. cryoChamber_id[14] = Commands->Get_ID ( cryoChamber_14 );
  6558. Commands->Attach_Script(cryoChamber_14, "M11_Cryochamber_Simple_JDG", "14");
  6559. GameObject * cryoTrajectory_00 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[0] );
  6560. Commands->Set_Model ( cryoTrajectory_00, "X11E_Trajectory" );
  6561. Commands->Set_Facing ( cryoTrajectory_00, cryoChamberFacing[0] );
  6562. GameObject * simpleMutant_00 = Commands->Create_Object_At_Bone ( cryoTrajectory_00, "Mutant_2SF_Templar", "BN_Trajectory" );
  6563. Commands->Attach_To_Object_Bone( simpleMutant_00, cryoTrajectory_00, "BN_Trajectory" );
  6564. Commands->Attach_Script(simpleMutant_00, "M11_LabMutant_Simple_JDG", "");
  6565. simpleMutant_id[0] = Commands->Get_ID ( simpleMutant_00 );
  6566. if (cryoTrajectory_00 != NULL)
  6567. {
  6568. Commands->Destroy_Object ( cryoTrajectory_00 );
  6569. }
  6570. GameObject * cryoTrajectory_01 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[1] );
  6571. Commands->Set_Model ( cryoTrajectory_01, "X11E_Trajectory" );
  6572. Commands->Set_Facing ( cryoTrajectory_01, cryoChamberFacing[1] );
  6573. GameObject * simpleMutant_01 = Commands->Create_Object_At_Bone ( cryoTrajectory_01, "Mutant_2SF_Templar", "BN_Trajectory" );
  6574. Commands->Attach_To_Object_Bone( simpleMutant_01, cryoTrajectory_01, "BN_Trajectory" );
  6575. Commands->Attach_Script(simpleMutant_01, "M11_LabMutant_Simple_JDG", "");
  6576. simpleMutant_id[1] = Commands->Get_ID ( simpleMutant_01 );
  6577. if (cryoTrajectory_01 != NULL)
  6578. {
  6579. Commands->Destroy_Object ( cryoTrajectory_01 );
  6580. }
  6581. GameObject * cryoTrajectory_02 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[2] );
  6582. Commands->Set_Model ( cryoTrajectory_02, "X11E_Trajectory" );
  6583. Commands->Set_Facing ( cryoTrajectory_02, cryoChamberFacing[2] );
  6584. GameObject * simpleMutant_02 = Commands->Create_Object_At_Bone ( cryoTrajectory_02, "Mutant_2SF_Templar", "BN_Trajectory" );
  6585. Commands->Attach_To_Object_Bone( simpleMutant_02, cryoTrajectory_02, "BN_Trajectory" );
  6586. Commands->Attach_Script(simpleMutant_02, "M11_LabMutant_Simple_JDG", "");
  6587. simpleMutant_id[2] = Commands->Get_ID ( simpleMutant_02 );
  6588. if (cryoTrajectory_02 != NULL)
  6589. {
  6590. Commands->Destroy_Object ( cryoTrajectory_02 );
  6591. }
  6592. GameObject * cryoTrajectory_03 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[3] );
  6593. Commands->Set_Model ( cryoTrajectory_03, "X11E_Trajectory" );
  6594. Commands->Set_Facing ( cryoTrajectory_03, cryoChamberFacing[3] );
  6595. GameObject * simpleMutant_03 = Commands->Create_Object_At_Bone ( cryoTrajectory_03, "Mutant_2SF_Templar", "BN_Trajectory" );
  6596. Commands->Attach_To_Object_Bone( simpleMutant_03, cryoTrajectory_03, "BN_Trajectory" );
  6597. Commands->Attach_Script(simpleMutant_03, "M11_LabMutant_Simple_JDG", "");
  6598. simpleMutant_id[3] = Commands->Get_ID ( simpleMutant_03 );
  6599. if (cryoTrajectory_03 != NULL)
  6600. {
  6601. Commands->Destroy_Object ( cryoTrajectory_03 );
  6602. }
  6603. GameObject * cryoTrajectory_04 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[4] );
  6604. Commands->Set_Model ( cryoTrajectory_04, "X11E_Trajectory" );
  6605. Commands->Set_Facing ( cryoTrajectory_04, cryoChamberFacing[4] );
  6606. GameObject * simpleMutant_04 = Commands->Create_Object_At_Bone ( cryoTrajectory_04, "Mutant_2SF_Templar", "BN_Trajectory" );
  6607. Commands->Attach_To_Object_Bone( simpleMutant_04, cryoTrajectory_04, "BN_Trajectory" );
  6608. Commands->Attach_Script(simpleMutant_04, "M11_LabMutant_Simple_JDG", "");
  6609. simpleMutant_id[4] = Commands->Get_ID ( simpleMutant_04 );
  6610. if (cryoTrajectory_04 != NULL)
  6611. {
  6612. Commands->Destroy_Object ( cryoTrajectory_04 );
  6613. }
  6614. GameObject * cryoTrajectory_05 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[5] );
  6615. Commands->Set_Model ( cryoTrajectory_05, "X11E_Trajectory" );
  6616. Commands->Set_Facing ( cryoTrajectory_05, cryoChamberFacing[5] );
  6617. GameObject * simpleMutant_05 = Commands->Create_Object_At_Bone ( cryoTrajectory_05, "Mutant_2SF_Templar", "BN_Trajectory" );
  6618. Commands->Attach_To_Object_Bone( simpleMutant_05, cryoTrajectory_05, "BN_Trajectory" );
  6619. Commands->Attach_Script(simpleMutant_05, "M11_LabMutant_Simple_JDG", "");
  6620. simpleMutant_id[5] = Commands->Get_ID ( simpleMutant_05 );
  6621. if (cryoTrajectory_05 != NULL)
  6622. {
  6623. Commands->Destroy_Object ( cryoTrajectory_05 );
  6624. }
  6625. GameObject * cryoTrajectory_06 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[6] );
  6626. Commands->Set_Model ( cryoTrajectory_06, "X11E_Trajectory" );
  6627. Commands->Set_Facing ( cryoTrajectory_06, cryoChamberFacing[6] );
  6628. GameObject * simpleMutant_06 = Commands->Create_Object_At_Bone ( cryoTrajectory_06, "Mutant_2SF_Templar", "BN_Trajectory" );
  6629. Commands->Attach_To_Object_Bone( simpleMutant_06, cryoTrajectory_06, "BN_Trajectory" );
  6630. Commands->Attach_Script(simpleMutant_06, "M11_LabMutant_Simple_JDG", "");
  6631. simpleMutant_id[6] = Commands->Get_ID ( simpleMutant_06 );
  6632. if (cryoTrajectory_06 != NULL)
  6633. {
  6634. Commands->Destroy_Object ( cryoTrajectory_06 );
  6635. }
  6636. GameObject * cryoTrajectory_07 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[7] );
  6637. Commands->Set_Model ( cryoTrajectory_07, "X11E_Trajectory" );
  6638. Commands->Set_Facing ( cryoTrajectory_07, cryoChamberFacing[7] );
  6639. GameObject * simpleMutant_07 = Commands->Create_Object_At_Bone ( cryoTrajectory_07, "Mutant_2SF_Templar", "BN_Trajectory" );
  6640. Commands->Attach_To_Object_Bone( simpleMutant_07, cryoTrajectory_07, "BN_Trajectory" );
  6641. Commands->Attach_Script(simpleMutant_07, "M11_LabMutant_Simple_JDG", "");
  6642. simpleMutant_id[7] = Commands->Get_ID ( simpleMutant_07 );
  6643. if (cryoTrajectory_07 != NULL)
  6644. {
  6645. Commands->Destroy_Object ( cryoTrajectory_07 );
  6646. }
  6647. GameObject * cryoTrajectory_08 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[8] );
  6648. Commands->Set_Model ( cryoTrajectory_08, "X11E_Trajectory" );
  6649. Commands->Set_Facing ( cryoTrajectory_08, cryoChamberFacing[8] );
  6650. GameObject * simpleMutant_08 = Commands->Create_Object_At_Bone ( cryoTrajectory_08, "Mutant_2SF_Templar", "BN_Trajectory" );
  6651. Commands->Attach_To_Object_Bone( simpleMutant_08, cryoTrajectory_08, "BN_Trajectory" );
  6652. Commands->Attach_Script(simpleMutant_08, "M11_LabMutant_Simple_JDG", "");
  6653. simpleMutant_id[8] = Commands->Get_ID ( simpleMutant_08 );
  6654. if (cryoTrajectory_08 != NULL)
  6655. {
  6656. Commands->Destroy_Object ( cryoTrajectory_08 );
  6657. }
  6658. GameObject * cryoTrajectory_09 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[9] );
  6659. Commands->Set_Model ( cryoTrajectory_09, "X11E_Trajectory" );
  6660. Commands->Set_Facing ( cryoTrajectory_09, cryoChamberFacing[9] );
  6661. GameObject * simpleMutant_09 = Commands->Create_Object_At_Bone ( cryoTrajectory_09, "Mutant_2SF_Templar", "BN_Trajectory" );
  6662. Commands->Attach_To_Object_Bone( simpleMutant_09, cryoTrajectory_09, "BN_Trajectory" );
  6663. Commands->Attach_Script(simpleMutant_09, "M11_LabMutant_Simple_JDG", "");
  6664. simpleMutant_id[9] = Commands->Get_ID ( simpleMutant_09 );
  6665. if (cryoTrajectory_09 != NULL)
  6666. {
  6667. Commands->Destroy_Object ( cryoTrajectory_09 );
  6668. }
  6669. GameObject * cryoTrajectory_10 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[10] );
  6670. Commands->Set_Model ( cryoTrajectory_10, "X11E_Trajectory" );
  6671. Commands->Set_Facing ( cryoTrajectory_10, cryoChamberFacing[10] );
  6672. GameObject * simpleMutant_10 = Commands->Create_Object_At_Bone ( cryoTrajectory_10, "Mutant_2SF_Templar", "BN_Trajectory" );
  6673. Commands->Attach_To_Object_Bone( simpleMutant_10, cryoTrajectory_10, "BN_Trajectory" );
  6674. Commands->Attach_Script(simpleMutant_10, "M11_LabMutant_Simple_JDG", "");
  6675. simpleMutant_id[10] = Commands->Get_ID ( simpleMutant_10 );
  6676. if (cryoTrajectory_10 != NULL)
  6677. {
  6678. Commands->Destroy_Object ( cryoTrajectory_10 );
  6679. }
  6680. GameObject * cryoTrajectory_11 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[11] );
  6681. Commands->Set_Model ( cryoTrajectory_11, "X11E_Trajectory" );
  6682. Commands->Set_Facing ( cryoTrajectory_11, cryoChamberFacing[11] );
  6683. GameObject * simpleMutant_11 = Commands->Create_Object_At_Bone ( cryoTrajectory_11, "Mutant_2SF_Templar", "BN_Trajectory" );
  6684. Commands->Attach_To_Object_Bone( simpleMutant_11, cryoTrajectory_11, "BN_Trajectory" );
  6685. Commands->Attach_Script(simpleMutant_11, "M11_LabMutant_Simple_JDG", "");
  6686. simpleMutant_id[11] = Commands->Get_ID ( simpleMutant_11 );
  6687. if (cryoTrajectory_11 != NULL)
  6688. {
  6689. Commands->Destroy_Object ( cryoTrajectory_11 );
  6690. }
  6691. GameObject * cryoTrajectory_12 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[12] );
  6692. Commands->Set_Model ( cryoTrajectory_12, "X11E_Trajectory" );
  6693. Commands->Set_Facing ( cryoTrajectory_12, cryoChamberFacing[12] );
  6694. GameObject * simpleMutant_12 = Commands->Create_Object_At_Bone ( cryoTrajectory_12, "Mutant_2SF_Templar", "BN_Trajectory" );
  6695. Commands->Attach_To_Object_Bone( simpleMutant_12, cryoTrajectory_12, "BN_Trajectory" );
  6696. Commands->Attach_Script(simpleMutant_12, "M11_LabMutant_Simple_JDG", "");
  6697. simpleMutant_id[12] = Commands->Get_ID ( simpleMutant_12 );
  6698. if (cryoTrajectory_12 != NULL)
  6699. {
  6700. Commands->Destroy_Object ( cryoTrajectory_12 );
  6701. }
  6702. GameObject * cryoTrajectory_13 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[13] );
  6703. Commands->Set_Model ( cryoTrajectory_13, "X11E_Trajectory" );
  6704. Commands->Set_Facing ( cryoTrajectory_13, cryoChamberFacing[13] );
  6705. GameObject * simpleMutant_13 = Commands->Create_Object_At_Bone ( cryoTrajectory_13, "Mutant_2SF_Templar", "BN_Trajectory" );
  6706. Commands->Attach_To_Object_Bone( simpleMutant_13, cryoTrajectory_13, "BN_Trajectory" );
  6707. Commands->Attach_Script(simpleMutant_13, "M11_LabMutant_Simple_JDG", "");
  6708. simpleMutant_id[13] = Commands->Get_ID ( simpleMutant_13 );
  6709. if (cryoTrajectory_13 != NULL)
  6710. {
  6711. Commands->Destroy_Object ( cryoTrajectory_13 );
  6712. }
  6713. GameObject * cryoTrajectory_14 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[14] );
  6714. Commands->Set_Model ( cryoTrajectory_14, "X11E_Trajectory" );
  6715. Commands->Set_Facing ( cryoTrajectory_14, cryoChamberFacing[14] );
  6716. GameObject * simpleMutant_14 = Commands->Create_Object_At_Bone ( cryoTrajectory_14, "Mutant_2SF_Templar", "BN_Trajectory" );
  6717. Commands->Attach_To_Object_Bone( simpleMutant_14, cryoTrajectory_14, "BN_Trajectory" );
  6718. Commands->Attach_Script(simpleMutant_14, "M11_LabMutant_Simple_JDG", "");
  6719. simpleMutant_id[14] = Commands->Get_ID ( simpleMutant_14 );
  6720. if (cryoTrajectory_14 != NULL)
  6721. {
  6722. Commands->Destroy_Object ( cryoTrajectory_14 );
  6723. }
  6724. GameObject * destroyedCryoChamber_01 = Commands->Create_Object ( "Simple_Large_CryoChamber_Destroyed", destroyedCryoChamberLocs[0] );
  6725. Commands->Set_Facing ( destroyedCryoChamber_01, destroyedChamberFacing[0] );
  6726. Commands->Attach_Script(destroyedCryoChamber_01, "M11_Cryochamber_DestroyedSimple_JDG", "");
  6727. GameObject * destroyedCryoChamber_02 = Commands->Create_Object ( "Simple_Large_CryoChamber_Destroyed", destroyedCryoChamberLocs[1] );
  6728. Commands->Set_Facing ( destroyedCryoChamber_02, destroyedChamberFacing[1] );
  6729. Commands->Attach_Script(destroyedCryoChamber_02, "M11_Cryochamber_DestroyedSimple_JDG", "");
  6730. GameObject * destroyedCryoChamber_03 = Commands->Create_Object ( "Simple_Large_CryoChamber_Destroyed", destroyedCryoChamberLocs[2] );
  6731. Commands->Set_Facing ( destroyedCryoChamber_03, destroyedChamberFacing[2] );
  6732. Commands->Attach_Script(destroyedCryoChamber_03, "M11_Cryochamber_DestroyedSimple_JDG", "");
  6733. activeUnitCount = 3;
  6734. deadMutantCount = 0;
  6735. }
  6736. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  6737. {
  6738. if (type == M01_IVE_BEEN_KILLED_JDG)//a chamber has been destroyed--kill the hibernating mutant
  6739. {
  6740. if (param == 0)//cryo chamber 00 is destroyed
  6741. {
  6742. GameObject * cryoTrajectory_00 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[0] );
  6743. Commands->Set_Model ( cryoTrajectory_00, "X11E_Trajectory" );
  6744. Commands->Attach_Script(cryoTrajectory_00, "M11_Mutant_TrajectoryBone_JDG", "");//"Mutant_2SF_Templar"
  6745. Commands->Set_Facing ( cryoTrajectory_00, cryoChamberFacing[0] );
  6746. if (cryoTrajectory_00 != NULL)
  6747. {
  6748. GameObject * simpleMutant_00 = Commands->Find_Object ( simpleMutant_id[0] );
  6749. if (simpleMutant_00 != NULL)
  6750. {
  6751. Commands->Attach_To_Object_Bone( simpleMutant_00, cryoTrajectory_00, "BN_Trajectory" );
  6752. deadMutantCount++;
  6753. Commands->Send_Custom_Event ( obj, simpleMutant_00, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6754. }
  6755. }
  6756. }
  6757. else if (param == 1)//cryo chamber 01 is destroyed
  6758. {
  6759. GameObject * cryoTrajectory_01 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[1] );
  6760. Commands->Set_Model ( cryoTrajectory_01, "X11E_Trajectory" );
  6761. Commands->Attach_Script(cryoTrajectory_01, "M11_Mutant_TrajectoryBone_JDG", "");
  6762. Commands->Set_Facing ( cryoTrajectory_01, cryoChamberFacing[1] );
  6763. if (cryoTrajectory_01 != NULL)
  6764. {
  6765. GameObject * simpleMutant_01 = Commands->Find_Object ( simpleMutant_id[1] );
  6766. if (simpleMutant_01 != NULL)
  6767. {
  6768. Commands->Attach_To_Object_Bone( simpleMutant_01, cryoTrajectory_01, "BN_Trajectory" );
  6769. deadMutantCount++;
  6770. Commands->Send_Custom_Event ( obj, simpleMutant_01, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6771. }
  6772. }
  6773. }
  6774. else if (param == 2)//cryo chamber 02 is destroyed
  6775. {
  6776. GameObject * cryoTrajectory_02 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[2] );
  6777. Commands->Set_Model ( cryoTrajectory_02, "X11E_Trajectory" );
  6778. Commands->Attach_Script(cryoTrajectory_02, "M11_Mutant_TrajectoryBone_JDG", "");
  6779. Commands->Set_Facing ( cryoTrajectory_02, cryoChamberFacing[2] );
  6780. if (cryoTrajectory_02 != NULL)
  6781. {
  6782. GameObject * simpleMutant_02 = Commands->Find_Object ( simpleMutant_id[2] );
  6783. if (simpleMutant_02 != NULL)
  6784. {
  6785. Commands->Attach_To_Object_Bone( simpleMutant_02, cryoTrajectory_02, "BN_Trajectory" );
  6786. deadMutantCount++;
  6787. Commands->Send_Custom_Event ( obj, simpleMutant_02, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6788. }
  6789. }
  6790. }
  6791. else if (param == 3)//cryo chamber 03 is destroyed
  6792. {
  6793. GameObject * cryoTrajectory_03 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[3] );
  6794. Commands->Set_Model ( cryoTrajectory_03, "X11E_Trajectory" );
  6795. Commands->Attach_Script(cryoTrajectory_03, "M11_Mutant_TrajectoryBone_JDG", "");
  6796. Commands->Set_Facing ( cryoTrajectory_03, cryoChamberFacing[3] );
  6797. if (cryoTrajectory_03 != NULL)
  6798. {
  6799. GameObject * simpleMutant_03 = Commands->Find_Object ( simpleMutant_id[3] );
  6800. if (simpleMutant_03 != NULL)
  6801. {
  6802. Commands->Attach_To_Object_Bone( simpleMutant_03, cryoTrajectory_03, "BN_Trajectory" );
  6803. deadMutantCount++;
  6804. Commands->Send_Custom_Event ( obj, simpleMutant_03, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6805. }
  6806. }
  6807. }
  6808. else if (param == 4)//cryo chamber 04 is destroyed
  6809. {
  6810. GameObject * cryoTrajectory_04 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[4] );
  6811. Commands->Set_Model ( cryoTrajectory_04, "X11E_Trajectory" );
  6812. Commands->Attach_Script(cryoTrajectory_04, "M11_Mutant_TrajectoryBone_JDG", "");
  6813. Commands->Set_Facing ( cryoTrajectory_04, cryoChamberFacing[4] );
  6814. if (cryoTrajectory_04 != NULL)
  6815. {
  6816. GameObject * simpleMutant_04 = Commands->Find_Object ( simpleMutant_id[4] );
  6817. if (simpleMutant_04 != NULL)
  6818. {
  6819. Commands->Attach_To_Object_Bone( simpleMutant_04, cryoTrajectory_04, "BN_Trajectory" );
  6820. deadMutantCount++;
  6821. Commands->Send_Custom_Event ( obj, simpleMutant_04, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6822. }
  6823. }
  6824. }
  6825. else if (param == 5)//cryo chamber 05 is destroyed
  6826. {
  6827. GameObject * cryoTrajectory_05 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[5] );
  6828. Commands->Set_Model ( cryoTrajectory_05, "X11E_Trajectory" );
  6829. Commands->Attach_Script(cryoTrajectory_05, "M11_Mutant_TrajectoryBone_JDG", "");
  6830. Commands->Set_Facing ( cryoTrajectory_05, cryoChamberFacing[5] );
  6831. if (cryoTrajectory_05 != NULL)
  6832. {
  6833. GameObject * simpleMutant_05 = Commands->Find_Object ( simpleMutant_id[5] );
  6834. if (simpleMutant_05 != NULL)
  6835. {
  6836. Commands->Attach_To_Object_Bone( simpleMutant_05, cryoTrajectory_05, "BN_Trajectory" );
  6837. deadMutantCount++;
  6838. Commands->Send_Custom_Event ( obj, simpleMutant_05, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6839. }
  6840. }
  6841. }
  6842. else if (param == 6)//cryo chamber 06 is destroyed
  6843. {
  6844. GameObject * cryoTrajectory_06 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[6] );
  6845. Commands->Set_Model ( cryoTrajectory_06, "X11E_Trajectory" );
  6846. Commands->Attach_Script(cryoTrajectory_06, "M11_Mutant_TrajectoryBone_JDG", "");
  6847. Commands->Set_Facing ( cryoTrajectory_06, cryoChamberFacing[6] );
  6848. if (cryoTrajectory_06 != NULL)
  6849. {
  6850. GameObject * simpleMutant_06 = Commands->Find_Object ( simpleMutant_id[6] );
  6851. if (simpleMutant_06 != NULL)
  6852. {
  6853. Commands->Attach_To_Object_Bone( simpleMutant_06, cryoTrajectory_06, "BN_Trajectory" );
  6854. deadMutantCount++;
  6855. Commands->Send_Custom_Event ( obj, simpleMutant_06, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6856. }
  6857. }
  6858. }
  6859. else if (param == 7)//cryo chamber 07 is destroyed
  6860. {
  6861. GameObject * cryoTrajectory_07 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[7] );
  6862. Commands->Set_Model ( cryoTrajectory_07, "X11E_Trajectory" );
  6863. Commands->Attach_Script(cryoTrajectory_07, "M11_Mutant_TrajectoryBone_JDG", "");
  6864. Commands->Set_Facing ( cryoTrajectory_07, cryoChamberFacing[7] );
  6865. if (cryoTrajectory_07 != NULL)
  6866. {
  6867. GameObject * simpleMutant_07 = Commands->Find_Object ( simpleMutant_id[7] );
  6868. if (simpleMutant_07 != NULL)
  6869. {
  6870. Commands->Attach_To_Object_Bone( simpleMutant_07, cryoTrajectory_07, "BN_Trajectory" );
  6871. deadMutantCount++;
  6872. Commands->Send_Custom_Event ( obj, simpleMutant_07, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6873. }
  6874. }
  6875. }
  6876. else if (param == 8)//cryo chamber 08 is destroyed
  6877. {
  6878. GameObject * cryoTrajectory_08 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[8] );
  6879. Commands->Set_Model ( cryoTrajectory_08, "X11E_Trajectory" );
  6880. Commands->Attach_Script(cryoTrajectory_08, "M11_Mutant_TrajectoryBone_JDG", "");
  6881. Commands->Set_Facing ( cryoTrajectory_08, cryoChamberFacing[8] );
  6882. if (cryoTrajectory_08 != NULL)
  6883. {
  6884. GameObject * simpleMutant_08 = Commands->Find_Object ( simpleMutant_id[8] );
  6885. if (simpleMutant_08 != NULL)
  6886. {
  6887. Commands->Attach_To_Object_Bone( simpleMutant_08, cryoTrajectory_08, "BN_Trajectory" );
  6888. deadMutantCount++;
  6889. Commands->Send_Custom_Event ( obj, simpleMutant_08, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6890. }
  6891. }
  6892. }
  6893. else if (param == 9)//cryo chamber 09 is destroyed
  6894. {
  6895. GameObject * cryoTrajectory_09 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[9] );
  6896. Commands->Set_Model ( cryoTrajectory_09, "X11E_Trajectory" );
  6897. Commands->Attach_Script(cryoTrajectory_09, "M11_Mutant_TrajectoryBone_JDG", "");
  6898. Commands->Set_Facing ( cryoTrajectory_09, cryoChamberFacing[9] );
  6899. if (cryoTrajectory_09 != NULL)
  6900. {
  6901. GameObject * simpleMutant_09 = Commands->Find_Object ( simpleMutant_id[9] );
  6902. if (simpleMutant_09 != NULL)
  6903. {
  6904. Commands->Attach_To_Object_Bone( simpleMutant_09, cryoTrajectory_09, "BN_Trajectory" );
  6905. deadMutantCount++;
  6906. Commands->Send_Custom_Event ( obj, simpleMutant_09, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6907. }
  6908. }
  6909. }
  6910. else if (param == 10)//cryo chamber 10 is destroyed
  6911. {
  6912. GameObject * cryoTrajectory_10 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[10] );
  6913. Commands->Set_Model ( cryoTrajectory_10, "X11E_Trajectory" );
  6914. Commands->Attach_Script(cryoTrajectory_10, "M11_Mutant_TrajectoryBone_JDG", "");
  6915. Commands->Set_Facing ( cryoTrajectory_10, cryoChamberFacing[10] );
  6916. if (cryoTrajectory_10 != NULL)
  6917. {
  6918. GameObject * simpleMutant_10 = Commands->Find_Object ( simpleMutant_id[10] );
  6919. if (simpleMutant_10 != NULL)
  6920. {
  6921. Commands->Attach_To_Object_Bone( simpleMutant_10, cryoTrajectory_10, "BN_Trajectory" );
  6922. deadMutantCount++;
  6923. Commands->Send_Custom_Event ( obj, simpleMutant_10, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6924. }
  6925. }
  6926. }
  6927. else if (param == 11)//cryo chamber 11 is destroyed
  6928. {
  6929. GameObject * cryoTrajectory_11 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[11] );
  6930. Commands->Set_Model ( cryoTrajectory_11, "X11E_Trajectory" );
  6931. Commands->Attach_Script(cryoTrajectory_11, "M11_Mutant_TrajectoryBone_JDG", "");
  6932. Commands->Set_Facing ( cryoTrajectory_11, cryoChamberFacing[11] );
  6933. if (cryoTrajectory_11 != NULL)
  6934. {
  6935. GameObject * simpleMutant_11 = Commands->Find_Object ( simpleMutant_id[11] );
  6936. if (simpleMutant_11 != NULL)
  6937. {
  6938. Commands->Attach_To_Object_Bone( simpleMutant_11, cryoTrajectory_11, "BN_Trajectory" );
  6939. deadMutantCount++;
  6940. Commands->Send_Custom_Event ( obj, simpleMutant_11, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6941. }
  6942. }
  6943. }
  6944. else if (param == 12)//cryo chamber 12 is destroyed
  6945. {
  6946. GameObject * cryoTrajectory_12 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[12] );
  6947. Commands->Set_Model ( cryoTrajectory_12, "X11E_Trajectory" );
  6948. Commands->Attach_Script(cryoTrajectory_12, "M11_Mutant_TrajectoryBone_JDG", "");
  6949. Commands->Set_Facing ( cryoTrajectory_12, cryoChamberFacing[12] );
  6950. if (cryoTrajectory_12 != NULL)
  6951. {
  6952. GameObject * simpleMutant_12 = Commands->Find_Object ( simpleMutant_id[12] );
  6953. if (simpleMutant_12 != NULL)
  6954. {
  6955. Commands->Attach_To_Object_Bone( simpleMutant_12, cryoTrajectory_12, "BN_Trajectory" );
  6956. deadMutantCount++;
  6957. Commands->Send_Custom_Event ( obj, simpleMutant_12, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6958. }
  6959. }
  6960. }
  6961. else if (param == 13)//cryo chamber 13 is destroyed
  6962. {
  6963. GameObject * cryoTrajectory_13 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[13] );
  6964. Commands->Set_Model ( cryoTrajectory_13, "X11E_Trajectory" );
  6965. Commands->Attach_Script(cryoTrajectory_13, "M11_Mutant_TrajectoryBone_JDG", "");
  6966. Commands->Set_Facing ( cryoTrajectory_13, cryoChamberFacing[13] );
  6967. if (cryoTrajectory_13 != NULL)
  6968. {
  6969. GameObject * simpleMutant_13 = Commands->Find_Object ( simpleMutant_id[13] );
  6970. if (simpleMutant_13 != NULL)
  6971. {
  6972. Commands->Attach_To_Object_Bone( simpleMutant_13, cryoTrajectory_13, "BN_Trajectory" );
  6973. deadMutantCount++;
  6974. Commands->Send_Custom_Event ( obj, simpleMutant_13, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6975. }
  6976. }
  6977. }
  6978. else if (param == 14)//cryo chamber 14 is destroyed
  6979. {
  6980. GameObject * cryoTrajectory_14 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[14] );
  6981. Commands->Set_Model ( cryoTrajectory_14, "X11E_Trajectory" );
  6982. Commands->Attach_Script(cryoTrajectory_14, "M11_Mutant_TrajectoryBone_JDG", "");
  6983. Commands->Set_Facing ( cryoTrajectory_14, cryoChamberFacing[14] );
  6984. if (cryoTrajectory_14 != NULL)
  6985. {
  6986. GameObject * simpleMutant_14 = Commands->Find_Object ( simpleMutant_id[14] );
  6987. if (simpleMutant_14 != NULL)
  6988. {
  6989. Commands->Attach_To_Object_Bone( simpleMutant_14, cryoTrajectory_14, "BN_Trajectory" );
  6990. deadMutantCount++;
  6991. Commands->Send_Custom_Event ( obj, simpleMutant_14, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  6992. }
  6993. }
  6994. }
  6995. }
  6996. else if (type == 0)
  6997. {
  6998. if (param == M01_SPAWNER_IS_DEAD_JDG)
  6999. {
  7000. activeUnitCount--;
  7001. deadMutantCount++;
  7002. Commands->Send_Custom_Event ( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  7003. }
  7004. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)
  7005. {
  7006. if (activeUnitCount <= 6 && deadMutantCount < 15)
  7007. {
  7008. int random = Commands->Get_Random_Int(0, 15);
  7009. GameObject * mutant = Commands->Find_Object ( simpleMutant_id[random] );
  7010. GameObject * cryoChamber = Commands->Find_Object ( cryoChamber_id[random] );
  7011. if (mutant == NULL)
  7012. {
  7013. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  7014. }
  7015. else
  7016. {
  7017. simpleMutant_id[random] = 0;
  7018. Commands->Send_Custom_Event( obj, mutant, M01_SPAWNER_SPAWN_PLEASE_JDG, random, 0 );
  7019. Commands->Send_Custom_Event( obj, cryoChamber, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 1 );
  7020. activeUnitCount++;
  7021. }
  7022. if (activeUnitCount <= 3)
  7023. {
  7024. Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
  7025. }
  7026. }
  7027. else
  7028. {
  7029. }
  7030. }
  7031. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//switch 01 has been pushed--kill all related chambers
  7032. {
  7033. GameObject * cryoChamber_00 = Commands->Find_Object ( cryoChamber_id[0] );
  7034. GameObject * cryoChamber_01 = Commands->Find_Object ( cryoChamber_id[1] );
  7035. GameObject * cryoChamber_02 = Commands->Find_Object ( cryoChamber_id[2] );
  7036. GameObject * cryoChamber_03 = Commands->Find_Object ( cryoChamber_id[3] );
  7037. GameObject * cryoChamber_04 = Commands->Find_Object ( cryoChamber_id[4] );
  7038. GameObject * cryoChamber_05 = Commands->Find_Object ( cryoChamber_id[5] );
  7039. GameObject * cryoChamber_06 = Commands->Find_Object ( cryoChamber_id[6] );
  7040. GameObject * cryoChamber_07 = Commands->Find_Object ( cryoChamber_id[7] );
  7041. if (cryoChamber_00 != NULL)
  7042. {
  7043. float delayTimer = Commands->Get_Random ( 1, 3);
  7044. Commands->Send_Custom_Event( obj, cryoChamber_00, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7045. }
  7046. if (cryoChamber_01 != NULL)
  7047. {
  7048. float delayTimer = Commands->Get_Random ( 1, 3);
  7049. Commands->Send_Custom_Event( obj, cryoChamber_01, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7050. }
  7051. if (cryoChamber_02 != NULL)
  7052. {
  7053. float delayTimer = Commands->Get_Random ( 1, 3);
  7054. Commands->Send_Custom_Event( obj, cryoChamber_02, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7055. }
  7056. if (cryoChamber_03 != NULL)
  7057. {
  7058. float delayTimer = Commands->Get_Random ( 1, 3);
  7059. Commands->Send_Custom_Event( obj, cryoChamber_03, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7060. }
  7061. if (cryoChamber_04 != NULL)
  7062. {
  7063. float delayTimer = Commands->Get_Random ( 1, 3);
  7064. Commands->Send_Custom_Event( obj, cryoChamber_04, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7065. }
  7066. if (cryoChamber_05 != NULL)
  7067. {
  7068. float delayTimer = Commands->Get_Random ( 1, 3);
  7069. Commands->Send_Custom_Event( obj, cryoChamber_05, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7070. }
  7071. if (cryoChamber_06 != NULL)
  7072. {
  7073. float delayTimer = Commands->Get_Random ( 1, 3);
  7074. Commands->Send_Custom_Event( obj, cryoChamber_06, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7075. }
  7076. if (cryoChamber_07 != NULL)
  7077. {
  7078. float delayTimer = Commands->Get_Random ( 1, 3);
  7079. Commands->Send_Custom_Event( obj, cryoChamber_07, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7080. }
  7081. }
  7082. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//switch 02 has been pushed--kill all related chambers
  7083. {
  7084. GameObject * cryoChamber_08 = Commands->Find_Object ( cryoChamber_id[8] );
  7085. GameObject * cryoChamber_09 = Commands->Find_Object ( cryoChamber_id[9] );
  7086. GameObject * cryoChamber_10 = Commands->Find_Object ( cryoChamber_id[10] );
  7087. GameObject * cryoChamber_11 = Commands->Find_Object ( cryoChamber_id[11] );
  7088. GameObject * cryoChamber_12 = Commands->Find_Object ( cryoChamber_id[12] );
  7089. GameObject * cryoChamber_13 = Commands->Find_Object ( cryoChamber_id[13] );
  7090. GameObject * cryoChamber_14 = Commands->Find_Object ( cryoChamber_id[14] );
  7091. if (cryoChamber_08 != NULL)
  7092. {
  7093. float delayTimer = Commands->Get_Random ( 1, 3);
  7094. Commands->Send_Custom_Event( obj, cryoChamber_08, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7095. }
  7096. if (cryoChamber_09 != NULL)
  7097. {
  7098. float delayTimer = Commands->Get_Random ( 1, 3);
  7099. Commands->Send_Custom_Event( obj, cryoChamber_09, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7100. }
  7101. if (cryoChamber_10 != NULL)
  7102. {
  7103. float delayTimer = Commands->Get_Random ( 1, 3);
  7104. Commands->Send_Custom_Event( obj, cryoChamber_10, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7105. }
  7106. if (cryoChamber_11 != NULL)
  7107. {
  7108. float delayTimer = Commands->Get_Random ( 1, 3);
  7109. Commands->Send_Custom_Event( obj, cryoChamber_11, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7110. }
  7111. if (cryoChamber_12 != NULL)
  7112. {
  7113. float delayTimer = Commands->Get_Random ( 1, 3);
  7114. Commands->Send_Custom_Event( obj, cryoChamber_12, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7115. }
  7116. if (cryoChamber_13 != NULL)
  7117. {
  7118. float delayTimer = Commands->Get_Random ( 1, 3);
  7119. Commands->Send_Custom_Event( obj, cryoChamber_13, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7120. }
  7121. if (cryoChamber_14 != NULL)
  7122. {
  7123. float delayTimer = Commands->Get_Random ( 1, 3);
  7124. Commands->Send_Custom_Event( obj, cryoChamber_14, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
  7125. }
  7126. }
  7127. }
  7128. }
  7129. };
  7130. DECLARE_SCRIPT(M11_Cryochamber_Simple_JDG, "chamber_number:int")
  7131. {
  7132. int my_number;
  7133. bool destroyed;
  7134. REGISTER_VARIABLES()
  7135. {
  7136. SAVE_VARIABLE(my_number, 1);
  7137. SAVE_VARIABLE(destroyed, 2);
  7138. }
  7139. void Created( GameObject * obj )
  7140. {
  7141. my_number = Get_Int_Parameter("chamber_number");
  7142. destroyed = false;
  7143. Commands->Set_Animation_Frame ( obj, "DSP_CRYOBIG2.DSP_CRYOBIG2", 0 );
  7144. }
  7145. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7146. {
  7147. if (param == M01_MODIFY_YOUR_ACTION_JDG)//M01_SPAWNER_SPAWN_PLEASE_JDG
  7148. {
  7149. if (obj && destroyed == false)
  7150. {
  7151. destroyed = true;
  7152. Vector3 myPosition = Commands->Get_Position ( obj );
  7153. float myFacing = Commands->Get_Facing ( obj );
  7154. Commands->Create_Explosion ( "Explosion_Barrel_Toxic", myPosition, NULL );
  7155. Commands->Set_Animation ( obj, "DSP_CRYOBIG2.DSP_CRYOBIG2", false, NULL, 0, 15 );
  7156. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), M01_IVE_BEEN_KILLED_JDG, my_number, 0 );
  7157. Commands->Set_Health ( obj, 1 );
  7158. GameObject * destroyedCryoChamber = Commands->Create_Object ( "Simple_Large_CryoChamber_Destroyed", myPosition );
  7159. Commands->Set_Facing ( destroyedCryoChamber, myFacing );
  7160. Commands->Attach_Script(destroyedCryoChamber, "M11_Cryochamber_DestroyedSimple_JDG", "");
  7161. Commands->Destroy_Object ( obj );
  7162. }
  7163. }
  7164. else if (param == M01_SPAWNER_SPAWN_PLEASE_JDG)//
  7165. {
  7166. Vector3 myPosition = Commands->Get_Position ( obj );
  7167. float myFacing = Commands->Get_Facing ( obj );
  7168. GameObject * glass = Commands->Create_Object("Invisible_Object", myPosition );
  7169. Commands->Set_Model ( glass, "X11E_Shatter" );
  7170. Commands->Attach_Script(glass, "M11_Mutant_ShatterGlass_JDG", "");
  7171. Commands->Set_Facing ( glass, myFacing );
  7172. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  7173. }
  7174. }
  7175. void Damaged( GameObject * obj, GameObject * damager, float amount )
  7176. {
  7177. float myCurrentHealth = Commands->Get_Health ( obj );
  7178. float myMaxHeatlh = Commands->Get_Max_Health ( obj );
  7179. float myHealthPercentage = (myCurrentHealth/myMaxHeatlh) * 100;
  7180. if (myHealthPercentage > 25 && destroyed == false)
  7181. {
  7182. Commands->Set_Animation ( obj, "DSP_CRYOBIG2.DSP_CRYOBIG2", false, NULL, 0, 9 );
  7183. }
  7184. else if (destroyed == true)
  7185. {
  7186. Commands->Set_Animation ( obj, "DSP_CRYOBIG2.DSP_CRYOBIG2", false, NULL, 12, 15 );
  7187. Commands->Set_Health ( obj, 1 );
  7188. }
  7189. else if (destroyed == false)
  7190. {
  7191. destroyed = true;
  7192. Vector3 myPosition = Commands->Get_Position ( obj );
  7193. float myFacing = Commands->Get_Facing ( obj );
  7194. Commands->Create_Explosion ( "Explosion_Barrel_Toxic", myPosition, NULL );
  7195. Commands->Set_Animation ( obj, "DSP_CRYOBIG2.DSP_CRYOBIG2", false, NULL, 0, 15 );
  7196. Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), M01_IVE_BEEN_KILLED_JDG, my_number, 0 );
  7197. Commands->Set_Health ( obj, 1 );
  7198. GameObject * destroyedCryoChamber = Commands->Create_Object ( "Simple_Large_CryoChamber_Destroyed", myPosition );
  7199. Commands->Set_Facing ( destroyedCryoChamber, myFacing );
  7200. Commands->Attach_Script(destroyedCryoChamber, "M11_Cryochamber_DestroyedSimple_JDG", "");
  7201. Commands->Destroy_Object ( obj );
  7202. }
  7203. }
  7204. };
  7205. DECLARE_SCRIPT(M11_LabMutant_Simple_JDG, "")
  7206. {
  7207. bool freed;
  7208. bool sabotaged;
  7209. REGISTER_VARIABLES()
  7210. {
  7211. SAVE_VARIABLE(freed, 1);
  7212. SAVE_VARIABLE(sabotaged, 2);
  7213. }
  7214. void Created( GameObject * obj )
  7215. {
  7216. sabotaged = false;
  7217. freed = false;
  7218. Commands->Innate_Disable(obj);
  7219. Commands->Set_Loiters_Allowed( obj, false );
  7220. Commands->Select_Weapon ( obj, NULL );
  7221. Commands->Set_Animation_Frame ( obj, "S_A_HUMAN.H_A_822A", 15 );
  7222. }
  7223. void Damaged( GameObject * obj, GameObject * damager, float amount )
  7224. {
  7225. if (freed != true)
  7226. {
  7227. float myMaxHealth = Commands->Get_Max_Health ( obj );
  7228. float myMaxShield = Commands->Get_Max_Shield_Strength ( obj );
  7229. Commands->Set_Health ( obj, myMaxHealth );
  7230. Commands->Set_Shield_Strength ( obj, myMaxShield );
  7231. }
  7232. }
  7233. void Killed( GameObject * obj, GameObject * killer )
  7234. {
  7235. if (sabotaged == false)
  7236. {
  7237. if (freed == true)
  7238. {
  7239. Commands->Send_Custom_Event( obj, Commands->Find_Object ( M11_LABORATORY_MUTANT_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
  7240. }
  7241. Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
  7242. powerupSpawnLocation.Z += 0.75f;
  7243. int easy = 0;
  7244. int medium = 1;
  7245. int currentDifficulty = Commands->Get_Difficulty_Level( );
  7246. if (currentDifficulty == easy)
  7247. {
  7248. char *powerups[2] =
  7249. {
  7250. //this is a list of potential powerups to be dropped by lab mutants
  7251. "POW_Health_100",
  7252. "POW_Armor_100",
  7253. };
  7254. int random = Commands->Get_Random_Int(0, 2);
  7255. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  7256. }
  7257. else if (currentDifficulty == medium)
  7258. {
  7259. char *powerups[2] =
  7260. {
  7261. //this is a list of potential powerups to be dropped by lab mutants
  7262. "POW_Health_050",
  7263. "POW_Armor_050",
  7264. };
  7265. int random = Commands->Get_Random_Int(0, 2);
  7266. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  7267. }
  7268. else
  7269. {
  7270. char *powerups[2] =
  7271. {
  7272. //this is a list of potential powerups to be dropped by lab mutants
  7273. "POW_Health_025",
  7274. "POW_Armor_025",
  7275. };
  7276. int random = Commands->Get_Random_Int(0, 2);
  7277. Commands->Create_Object ( powerups[random], powerupSpawnLocation );
  7278. }
  7279. }
  7280. }
  7281. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7282. {
  7283. if (type == M01_SPAWNER_SPAWN_PLEASE_JDG)//you are being requested to come out and play--break out
  7284. {
  7285. Commands->Enable_Hibernation(obj, false );
  7286. GameObject * cryoTrajectory_00 = Commands->Create_Object("Invisible_Object", m11cryoChamberLocs[param] );
  7287. Commands->Set_Model ( cryoTrajectory_00, "X11E_Trajectory" );
  7288. Commands->Attach_Script(cryoTrajectory_00, "M11_Mutant_TrajectoryBone_JDG", "");//"Mutant_2SF_Templar"
  7289. Commands->Set_Facing ( cryoTrajectory_00, cryoChamberFacing[param] );
  7290. if (cryoTrajectory_00 != NULL)
  7291. {
  7292. if (obj)
  7293. {
  7294. Commands->Attach_To_Object_Bone( obj, cryoTrajectory_00, "BN_Trajectory" );
  7295. Commands->Set_Animation ( obj, "S_C_Human.H_C_X11E_Escape", false, NULL, 0, 120 );
  7296. freed = true;
  7297. }
  7298. }
  7299. }
  7300. else if (type == 0)
  7301. {
  7302. if (param == M01_IVE_BEEN_KILLED_JDG)//your chambers been destroyed--die please
  7303. {
  7304. sabotaged = true;
  7305. freed = true;
  7306. //Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
  7307. Commands->Set_Animation ( obj, "S_C_Human.H_C_Tubedie", false, NULL, 0, 22 );
  7308. }
  7309. }
  7310. }
  7311. void Animation_Complete(GameObject * obj, const char *anim)
  7312. {
  7313. if (stricmp(anim, "S_C_Human.H_C_X11E_Escape") == 0)
  7314. {
  7315. Commands->Enable_Hibernation(obj, true );
  7316. Commands->Select_Weapon ( obj, "Weapon_TiberiumAutoRifle_Ai" );
  7317. Commands->Innate_Enable(obj);
  7318. ActionParamsStruct params;
  7319. params.Set_Basic( this, 85, M01_HUNT_THE_PLAYER_JDG );
  7320. params.Set_Movement( STAR, RUN, 1 );
  7321. params.Set_Attack( STAR, 15, 2, true );
  7322. Commands->Action_Attack ( obj, params );
  7323. }
  7324. else if (stricmp(anim, "S_C_Human.H_C_Tubedie") == 0)
  7325. {
  7326. Commands->Destroy_Object ( obj );
  7327. }
  7328. }
  7329. };
  7330. DECLARE_SCRIPT(M11_Silo_ElevatorController_JDG, "")//100698
  7331. {
  7332. void Created( GameObject * obj )
  7333. {
  7334. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 45, "MISS_ELEV1.MISS_ELEV1" );
  7335. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 45, "MISS_ELEV2.MISS_ELEV2" );
  7336. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 45, "MISS_ELEV3.MISS_ELEV3" );
  7337. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 45, "MISS_ELEV4.MISS_ELEV4" );
  7338. }
  7339. };
  7340. DECLARE_SCRIPT(M11_Silo_ElevatorZone01_JDG, "")//100699
  7341. {
  7342. bool sydeyIsInTheZone;
  7343. bool havocIsInTheZone;
  7344. REGISTER_VARIABLES()
  7345. {
  7346. SAVE_VARIABLE(sydeyIsInTheZone, 1);
  7347. SAVE_VARIABLE(havocIsInTheZone, 2);
  7348. }
  7349. void Created( GameObject * obj )
  7350. {
  7351. sydeyIsInTheZone = false;
  7352. havocIsInTheZone = false;
  7353. }
  7354. void Entered( GameObject * obj, GameObject * enterer )
  7355. {
  7356. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7357. if (enterer == sydney)
  7358. {
  7359. sydeyIsInTheZone = true;
  7360. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7361. }
  7362. else if (enterer == STAR)
  7363. {
  7364. havocIsInTheZone = true;
  7365. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7366. }
  7367. }
  7368. void Exited( GameObject * obj, GameObject * exiter )
  7369. {
  7370. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7371. if (exiter == sydney)
  7372. {
  7373. sydeyIsInTheZone = false;
  7374. }
  7375. else if (exiter == STAR)
  7376. {
  7377. havocIsInTheZone = false;
  7378. }
  7379. }
  7380. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7381. {
  7382. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7383. {
  7384. if ((sydeyIsInTheZone == true) && (havocIsInTheZone == true))
  7385. {
  7386. Vector3 myPosition = Commands->Get_Position ( STAR );
  7387. Commands->Create_Sound ( "Air_Compressor_01", myPosition, obj );
  7388. Commands->Create_Sound ( "Metal_Thunk_03", myPosition, obj );
  7389. Commands->Shake_Camera( myPosition, 25, 0.25f, 0.5f );
  7390. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0.25f );
  7391. }
  7392. else
  7393. {
  7394. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  7395. }
  7396. }
  7397. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  7398. {
  7399. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 0, "MISS_ELEV4.MISS_ELEV4" );
  7400. Commands->Destroy_Object ( obj );//your job is over--clean up
  7401. }
  7402. }
  7403. };
  7404. DECLARE_SCRIPT(M11_Silo_ElevatorZone02_JDG, "")//100700
  7405. {
  7406. bool sydeyIsInTheZone;
  7407. bool havocIsInTheZone;
  7408. REGISTER_VARIABLES()
  7409. {
  7410. SAVE_VARIABLE(sydeyIsInTheZone, 1);
  7411. SAVE_VARIABLE(havocIsInTheZone, 2);
  7412. }
  7413. void Created( GameObject * obj )
  7414. {
  7415. sydeyIsInTheZone = false;
  7416. havocIsInTheZone = false;
  7417. }
  7418. void Entered( GameObject * obj, GameObject * enterer )
  7419. {
  7420. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7421. if (enterer == sydney)
  7422. {
  7423. sydeyIsInTheZone = true;
  7424. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7425. }
  7426. else if (enterer == STAR)
  7427. {
  7428. havocIsInTheZone = true;
  7429. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7430. }
  7431. }
  7432. void Exited( GameObject * obj, GameObject * exiter )
  7433. {
  7434. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7435. if (exiter == sydney)
  7436. {
  7437. sydeyIsInTheZone = false;
  7438. }
  7439. else if (exiter == STAR)
  7440. {
  7441. havocIsInTheZone = false;
  7442. }
  7443. }
  7444. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7445. {
  7446. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7447. {
  7448. if ((sydeyIsInTheZone == true) && (havocIsInTheZone == true))
  7449. {
  7450. Vector3 myPosition = Commands->Get_Position ( STAR );
  7451. Commands->Create_Sound ( "Air_Compressor_01", myPosition, obj );
  7452. Commands->Create_Sound ( "Metal_Thunk_03", myPosition, obj );
  7453. Commands->Shake_Camera( myPosition, 25, 0.25f, 0.5f );
  7454. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0.25f );
  7455. }
  7456. else
  7457. {
  7458. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  7459. }
  7460. }
  7461. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  7462. {
  7463. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 0, "MISS_ELEV3.MISS_ELEV3" );
  7464. Commands->Destroy_Object ( obj );//your job is over--clean up
  7465. }
  7466. }
  7467. };
  7468. DECLARE_SCRIPT(M11_Silo_ElevatorZone03_JDG, "")//100701
  7469. {
  7470. bool sydeyIsInTheZone;
  7471. bool havocIsInTheZone;
  7472. REGISTER_VARIABLES()
  7473. {
  7474. SAVE_VARIABLE(sydeyIsInTheZone, 1);
  7475. SAVE_VARIABLE(havocIsInTheZone, 2);
  7476. }
  7477. void Created( GameObject * obj )
  7478. {
  7479. sydeyIsInTheZone = false;
  7480. havocIsInTheZone = false;
  7481. }
  7482. void Entered( GameObject * obj, GameObject * enterer )
  7483. {
  7484. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7485. if (enterer == sydney)
  7486. {
  7487. sydeyIsInTheZone = true;
  7488. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7489. }
  7490. else if (enterer == STAR)
  7491. {
  7492. havocIsInTheZone = true;
  7493. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7494. }
  7495. }
  7496. void Exited( GameObject * obj, GameObject * exiter )
  7497. {
  7498. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7499. if (exiter == sydney)
  7500. {
  7501. sydeyIsInTheZone = false;
  7502. }
  7503. else if (exiter == STAR)
  7504. {
  7505. havocIsInTheZone = false;
  7506. }
  7507. }
  7508. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7509. {
  7510. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7511. {
  7512. if ((sydeyIsInTheZone == true) && (havocIsInTheZone == true))
  7513. {
  7514. Vector3 myPosition = Commands->Get_Position ( STAR );
  7515. Commands->Create_Sound ( "Air_Compressor_01", myPosition, obj );
  7516. Commands->Create_Sound ( "Metal_Thunk_03", myPosition, obj );
  7517. Commands->Shake_Camera( myPosition, 25, 0.25f, 0.5f );
  7518. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0.25f );
  7519. }
  7520. else
  7521. {
  7522. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  7523. }
  7524. }
  7525. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  7526. {
  7527. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 0, "MISS_ELEV2.MISS_ELEV2" );
  7528. Commands->Destroy_Object ( obj );//your job is over--clean up
  7529. }
  7530. }
  7531. };
  7532. DECLARE_SCRIPT(M11_Silo_ElevatorZone04_JDG, "")//100702
  7533. {
  7534. bool sydeyIsInTheZone;
  7535. bool havocIsInTheZone;
  7536. REGISTER_VARIABLES()
  7537. {
  7538. SAVE_VARIABLE(sydeyIsInTheZone, 1);
  7539. SAVE_VARIABLE(havocIsInTheZone, 2);
  7540. }
  7541. void Created( GameObject * obj )
  7542. {
  7543. sydeyIsInTheZone = false;
  7544. havocIsInTheZone = false;
  7545. }
  7546. void Entered( GameObject * obj, GameObject * enterer )
  7547. {
  7548. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7549. if (enterer == sydney)
  7550. {
  7551. sydeyIsInTheZone = true;
  7552. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7553. }
  7554. else if (enterer == STAR)
  7555. {
  7556. havocIsInTheZone = true;
  7557. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7558. }
  7559. }
  7560. void Exited( GameObject * obj, GameObject * exiter )
  7561. {
  7562. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7563. if (exiter == sydney)
  7564. {
  7565. sydeyIsInTheZone = false;
  7566. }
  7567. else if (exiter == STAR)
  7568. {
  7569. havocIsInTheZone = false;
  7570. }
  7571. }
  7572. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7573. {
  7574. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7575. {
  7576. if ((sydeyIsInTheZone == true) && (havocIsInTheZone == true))
  7577. {
  7578. Vector3 myPosition = Commands->Get_Position ( STAR );
  7579. Commands->Create_Sound ( "Air_Compressor_01", myPosition, obj );
  7580. Commands->Create_Sound ( "Metal_Thunk_03", myPosition, obj );
  7581. Commands->Shake_Camera( myPosition, 25, 0.25f, 0.5f );
  7582. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0.25f );
  7583. }
  7584. else
  7585. {
  7586. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
  7587. }
  7588. }
  7589. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  7590. {
  7591. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 0, "MISS_ELEV1.MISS_ELEV1" );
  7592. Commands->Destroy_Object ( obj );//your job is over--clean up
  7593. }
  7594. }
  7595. };
  7596. DECLARE_SCRIPT(M11_Sydney_Rally_Zone_01_JDG, "")
  7597. {
  7598. bool sydneyInPosition;
  7599. REGISTER_VARIABLES()
  7600. {
  7601. SAVE_VARIABLE(sydneyInPosition, 1);
  7602. }
  7603. void Created( GameObject * obj )
  7604. {
  7605. sydneyInPosition = false;
  7606. }
  7607. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7608. {
  7609. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7610. {
  7611. sydneyInPosition = true;
  7612. }
  7613. }
  7614. void Entered( GameObject * obj, GameObject * enterer )
  7615. {
  7616. if (enterer == STAR && sydneyInPosition == true)
  7617. {
  7618. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7619. if (sydney != NULL )
  7620. {
  7621. Commands->Send_Custom_Event( obj, sydney, 0, M01_WALKING_WAYPATH_02_JDG, 0 );
  7622. }
  7623. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  7624. }
  7625. }
  7626. };
  7627. DECLARE_SCRIPT(M11_Sydney_Rally_Zone_02_JDG, "")
  7628. {
  7629. bool sydneyInPosition;
  7630. REGISTER_VARIABLES()
  7631. {
  7632. SAVE_VARIABLE(sydneyInPosition, 1);
  7633. }
  7634. void Created( GameObject * obj )
  7635. {
  7636. sydneyInPosition = false;
  7637. }
  7638. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7639. {
  7640. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7641. {
  7642. sydneyInPosition = true;
  7643. }
  7644. }
  7645. void Entered( GameObject * obj, GameObject * enterer )
  7646. {
  7647. if (enterer == STAR && sydneyInPosition == true)
  7648. {
  7649. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7650. if (sydney != NULL )
  7651. {
  7652. Commands->Send_Custom_Event( obj, sydney, 0, M01_WALKING_WAYPATH_03_JDG, 0 );
  7653. }
  7654. Commands->Destroy_Object ( obj );//one time only zone--cleaning up
  7655. }
  7656. }
  7657. };
  7658. DECLARE_SCRIPT(M11_Sydney_Rally_Zone_03_JDG, "")
  7659. {
  7660. bool sydneyInPosition;
  7661. REGISTER_VARIABLES()
  7662. {
  7663. SAVE_VARIABLE(sydneyInPosition, 1);
  7664. }
  7665. void Created( GameObject * obj )
  7666. {
  7667. sydneyInPosition = false;
  7668. }
  7669. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7670. {
  7671. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7672. {
  7673. sydneyInPosition = true;
  7674. }
  7675. }
  7676. void Entered( GameObject * obj, GameObject * enterer )
  7677. {
  7678. if (enterer == STAR && sydneyInPosition == true)
  7679. {
  7680. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7681. if (sydney != NULL )
  7682. {
  7683. Commands->Send_Custom_Event( obj, sydney, 0, M01_WALKING_WAYPATH_05_JDG, 0 );
  7684. }
  7685. GameObject * zoneOne = Commands->Find_Object ( 100133 );
  7686. if (zoneOne != NULL)
  7687. {
  7688. Commands->Destroy_Object ( zoneOne );//one time only zone--cleaning up
  7689. }
  7690. GameObject * zoneTwo = Commands->Find_Object ( 100134 );
  7691. if (zoneTwo != NULL)
  7692. {
  7693. Commands->Destroy_Object ( zoneTwo );//one time only zone--cleaning up
  7694. }
  7695. }
  7696. }
  7697. };
  7698. DECLARE_SCRIPT(M11_Sydney_Rally_Zone_03b_JDG, "")
  7699. {
  7700. bool sydneyInPosition;
  7701. REGISTER_VARIABLES()
  7702. {
  7703. SAVE_VARIABLE(sydneyInPosition, 1);
  7704. }
  7705. void Created( GameObject * obj )
  7706. {
  7707. sydneyInPosition = false;
  7708. }
  7709. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7710. {
  7711. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  7712. {
  7713. sydneyInPosition = true;
  7714. }
  7715. }
  7716. void Entered( GameObject * obj, GameObject * enterer )
  7717. {
  7718. if (enterer == STAR && sydneyInPosition == true)
  7719. {
  7720. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  7721. if (sydney != NULL )
  7722. {
  7723. Commands->Send_Custom_Event( obj, sydney, 0, M01_WALKING_WAYPATH_07_JDG, 0 );
  7724. }
  7725. GameObject * zoneOne = Commands->Find_Object ( 100133 );
  7726. if (zoneOne != NULL)
  7727. {
  7728. Commands->Destroy_Object ( zoneOne );//one time only zone--cleaning up
  7729. }
  7730. GameObject * zoneTwo = Commands->Find_Object ( 100134 );
  7731. if (zoneTwo != NULL)
  7732. {
  7733. Commands->Destroy_Object ( zoneTwo );//one time only zone--cleaning up
  7734. }
  7735. }
  7736. }
  7737. };
  7738. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Controller_JDG, "")//106230
  7739. {//M11_PETROVA_STEALTHSPAWNER_01_JDG
  7740. int initialSteatlthGuy01_id;
  7741. int initialSteatlthGuy02_id;
  7742. int initialSteatlthGuy03_id;
  7743. REGISTER_VARIABLES()
  7744. {
  7745. SAVE_VARIABLE(initialSteatlthGuy01_id, 1);
  7746. SAVE_VARIABLE(initialSteatlthGuy02_id, 2);
  7747. SAVE_VARIABLE(initialSteatlthGuy03_id, 3);
  7748. }
  7749. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7750. {
  7751. if (type == 0)
  7752. {
  7753. if (param == 0)//text file is telling you to spawn initial guys
  7754. {
  7755. GameObject * initialSteatlthGuy01 = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_01_JDG );
  7756. Commands->Attach_Script(initialSteatlthGuy01, "M11_Petrova_StealthSoldier_Initial01_JDG", "");
  7757. initialSteatlthGuy01_id = Commands->Get_ID ( initialSteatlthGuy01 );
  7758. GameObject * initialSteatlthGuy02 = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_02_JDG );
  7759. Commands->Attach_Script(initialSteatlthGuy02, "M11_Petrova_StealthSoldier_Initial02_JDG", "");
  7760. initialSteatlthGuy02_id = Commands->Get_ID ( initialSteatlthGuy02 );
  7761. GameObject * initialSteatlthGuy03 = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_03_JDG );
  7762. Commands->Attach_Script(initialSteatlthGuy03, "M11_Petrova_StealthSoldier_Initial03_JDG", "");
  7763. initialSteatlthGuy03_id = Commands->Get_ID ( initialSteatlthGuy03 );
  7764. }
  7765. else if (param == 1)
  7766. {
  7767. GameObject * initialSteatlthGuy01 = Commands->Find_Object ( initialSteatlthGuy01_id );
  7768. if (initialSteatlthGuy01 != NULL)
  7769. {
  7770. Commands->Send_Custom_Event( obj, initialSteatlthGuy01, 0, M01_START_ACTING_JDG, 0 );
  7771. }
  7772. GameObject * initialSteatlthGuy02 = Commands->Find_Object ( initialSteatlthGuy02_id );
  7773. if (initialSteatlthGuy02 != NULL)
  7774. {
  7775. Commands->Send_Custom_Event( obj, initialSteatlthGuy02, 0, M01_START_ACTING_JDG, 0 );
  7776. }
  7777. GameObject * initialSteatlthGuy03 = Commands->Find_Object ( initialSteatlthGuy03_id );
  7778. if (initialSteatlthGuy03 != NULL)
  7779. {
  7780. Commands->Send_Custom_Event( obj, initialSteatlthGuy03, 0, M01_START_ACTING_JDG, 0 );
  7781. }
  7782. }
  7783. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//trigger spawner 01
  7784. {
  7785. GameObject * newSteatlthGuy = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_01_JDG );
  7786. Commands->Attach_Script(newSteatlthGuy, "M11_Petrova_StealthSoldier_Reinforcement01_JDG", "");
  7787. }
  7788. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//trigger spawner 02
  7789. {
  7790. GameObject * newSteatlthGuy = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_02_JDG );
  7791. Commands->Attach_Script(newSteatlthGuy, "M11_Petrova_StealthSoldier_Reinforcement02_JDG", "");
  7792. }
  7793. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//trigger spawner 02
  7794. {
  7795. GameObject * newSteatlthGuy = Commands->Trigger_Spawner( M11_PETROVA_STEALTHSPAWNER_03_JDG );
  7796. Commands->Attach_Script(newSteatlthGuy, "M11_Petrova_StealthSoldier_Reinforcement03_JDG", "");
  7797. }
  7798. }
  7799. }
  7800. };
  7801. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Initial01_JDG, "")//M11_PETROVA_STEALTHSPAWNER_01_JDG
  7802. {
  7803. void Created( GameObject * obj )
  7804. {
  7805. Commands->Enable_Cinematic_Freeze( obj, false );
  7806. ActionParamsStruct params;
  7807. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7808. params.Set_Attack (STAR, 0, 0, true);
  7809. Commands->Action_Attack (obj, params);
  7810. }//
  7811. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7812. {
  7813. if (type == 0)
  7814. {
  7815. if (param == M01_START_ACTING_JDG)
  7816. {
  7817. Commands->Action_Reset ( obj, 100 );
  7818. ActionParamsStruct params;
  7819. params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
  7820. params.Set_Attack (STAR, 20, 0, true);
  7821. Commands->Action_Attack (obj, params);
  7822. }
  7823. }
  7824. }
  7825. void Killed( GameObject * obj, GameObject * killer )
  7826. {
  7827. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7828. if (stealthController != NULL)
  7829. {
  7830. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7831. }
  7832. }
  7833. };
  7834. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Initial02_JDG, "")//M11_PETROVA_STEALTHSPAWNER_02_JDG
  7835. {
  7836. void Created( GameObject * obj )
  7837. {
  7838. Commands->Enable_Cinematic_Freeze( obj, false );
  7839. ActionParamsStruct params;
  7840. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7841. params.Set_Attack (STAR, 0, 0, true);
  7842. Commands->Action_Attack (obj, params);
  7843. }//
  7844. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7845. {
  7846. if (type == 0)
  7847. {
  7848. if (param == M01_START_ACTING_JDG)
  7849. {
  7850. Commands->Action_Reset ( obj, 100 );
  7851. ActionParamsStruct params;
  7852. params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
  7853. params.Set_Attack (STAR, 20, 0, true);
  7854. Commands->Action_Attack (obj, params);
  7855. }
  7856. }
  7857. }
  7858. void Killed( GameObject * obj, GameObject * killer )
  7859. {
  7860. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7861. if (stealthController != NULL)
  7862. {
  7863. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  7864. }
  7865. }
  7866. };
  7867. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Initial03_JDG, "")//M11_PETROVA_STEALTHSPAWNER_03_JDG
  7868. {
  7869. void Created( GameObject * obj )
  7870. {
  7871. Commands->Enable_Cinematic_Freeze( obj, false );
  7872. ActionParamsStruct params;
  7873. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7874. params.Set_Attack (STAR, 0, 0, true);
  7875. Commands->Action_Attack (obj, params);
  7876. }//
  7877. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  7878. {
  7879. if (type == 0)
  7880. {
  7881. if (param == M01_START_ACTING_JDG)
  7882. {
  7883. Commands->Action_Reset ( obj, 100 );
  7884. ActionParamsStruct params;
  7885. params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
  7886. params.Set_Attack (STAR, 20, 0, true);
  7887. Commands->Action_Attack (obj, params);
  7888. }
  7889. }
  7890. }
  7891. void Killed( GameObject * obj, GameObject * killer )
  7892. {
  7893. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7894. if (stealthController != NULL)
  7895. {
  7896. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  7897. }
  7898. }
  7899. };
  7900. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Reinforcement01_JDG, "")//M11_PETROVA_STEALTHSPAWNER_01_JDG
  7901. {
  7902. void Created( GameObject * obj )
  7903. {
  7904. Commands->Enable_Hibernation( obj, false );
  7905. Commands->Grant_Key( obj, 3, true );
  7906. ActionParamsStruct params;
  7907. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7908. params.Set_Movement( STAR, RUN, 10 );
  7909. params.Set_Attack (STAR, 20, 0, true);
  7910. Commands->Action_Attack (obj, params);
  7911. }
  7912. void Killed( GameObject * obj, GameObject * killer )
  7913. {
  7914. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7915. if (stealthController != NULL)
  7916. {
  7917. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  7918. }
  7919. }
  7920. };
  7921. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Reinforcement02_JDG, "")//M11_PETROVA_STEALTHSPAWNER_02_JDG
  7922. {
  7923. void Created( GameObject * obj )
  7924. {
  7925. Commands->Enable_Hibernation( obj, false );
  7926. Commands->Grant_Key( obj, 3, true );
  7927. ActionParamsStruct params;
  7928. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7929. params.Set_Movement( STAR, RUN, 10 );
  7930. params.Set_Attack (STAR, 20, 0, true);
  7931. Commands->Action_Attack (obj, params);
  7932. }
  7933. void Killed( GameObject * obj, GameObject * killer )
  7934. {
  7935. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7936. if (stealthController != NULL)
  7937. {
  7938. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
  7939. }
  7940. }
  7941. };
  7942. DECLARE_SCRIPT(M11_Petrova_StealthSoldier_Reinforcement03_JDG, "")//M11_PETROVA_STEALTHSPAWNER_03_JDG
  7943. {
  7944. void Created( GameObject * obj )
  7945. {
  7946. Commands->Enable_Hibernation( obj, false );
  7947. Commands->Grant_Key( obj, 3, true );
  7948. ActionParamsStruct params;
  7949. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  7950. params.Set_Movement( STAR, RUN, 10 );
  7951. params.Set_Attack (STAR, 20, 0, true);
  7952. Commands->Action_Attack (obj, params);
  7953. }
  7954. void Killed( GameObject * obj, GameObject * killer )
  7955. {
  7956. GameObject * stealthController = Commands->Find_Object ( 106230 );
  7957. if (stealthController != NULL)
  7958. {
  7959. Commands->Send_Custom_Event( obj, stealthController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
  7960. }
  7961. }
  7962. };
  7963. DECLARE_SCRIPT(M11_Sydney_Script_JDG, "")//M11_REAL_SYDNEY_MOBIUS_JDG 100644
  7964. {
  7965. typedef enum {
  7966. IDLE,
  7967. GOING_TO_RALLY_POINT01,
  7968. GOING_TO_RALLY_POINT02,
  7969. GOING_TO_RALLY_POINT03,
  7970. GOING_TO_ELEVATOR01,
  7971. GOING_TO_ELEVATOR02,
  7972. GOING_TO_ELEVATOR03,
  7973. GOING_TO_ELEVATOR04,
  7974. GOING_TO_MISSILE_SWITCH,
  7975. } M11_Location;
  7976. M11_Location sydneys_location;
  7977. int sydney_conv01;
  7978. int sydney_damaged_conv01;
  7979. int sydney_damaged_conv02;
  7980. int sydney_damaged_conv03;
  7981. int missionEndConv;
  7982. bool first_time_damaged;
  7983. bool second_time_damaged;
  7984. bool third_time_damaged;
  7985. bool killedYet;
  7986. bool sydney_damaged_conv01_playing;
  7987. bool sydney_damaged_conv02_playing;
  7988. bool sydney_damaged_conv03_playing;
  7989. REGISTER_VARIABLES()
  7990. {
  7991. SAVE_VARIABLE(sydneys_location, 1);
  7992. SAVE_VARIABLE(sydney_conv01, 2);
  7993. SAVE_VARIABLE(sydney_damaged_conv01, 3);
  7994. SAVE_VARIABLE(sydney_damaged_conv02, 4);
  7995. SAVE_VARIABLE(sydney_damaged_conv03, 5);
  7996. SAVE_VARIABLE(missionEndConv, 6);
  7997. SAVE_VARIABLE(first_time_damaged, 7);
  7998. SAVE_VARIABLE(second_time_damaged, 8);
  7999. SAVE_VARIABLE(third_time_damaged, 9);
  8000. SAVE_VARIABLE(killedYet, 10);
  8001. SAVE_VARIABLE(sydney_damaged_conv01_playing, 11);
  8002. SAVE_VARIABLE(sydney_damaged_conv02_playing, 12);
  8003. SAVE_VARIABLE(sydney_damaged_conv03_playing, 13);
  8004. }
  8005. void Created( GameObject * obj )
  8006. {
  8007. Commands->Set_Shield_Type ( obj, "Blamo" );
  8008. sydneys_location = IDLE;
  8009. Commands->Innate_Disable(obj);
  8010. Commands->Set_Obj_Radar_Blip_Shape (obj, RADAR_BLIP_SHAPE_NONE );
  8011. Commands->Set_Is_Visible( obj, false );
  8012. Commands->Set_Is_Rendered( obj, false );
  8013. Commands->Grant_Key( obj, 1, true );
  8014. Commands->Grant_Key( obj, 2, true );
  8015. Commands->Grant_Key( obj, 3, true );
  8016. first_time_damaged = true;
  8017. second_time_damaged = false;
  8018. third_time_damaged = false;
  8019. killedYet = false;
  8020. sydney_damaged_conv01_playing = false;
  8021. sydney_damaged_conv02_playing = false;
  8022. sydney_damaged_conv03_playing = false;
  8023. }
  8024. void Damaged( GameObject * obj, GameObject * damager, float amount )
  8025. { //M11_Sydney_Damaged_Conversation_01
  8026. //M11_Sydney_Damaged_Conversation_02
  8027. //M11_Sydney_Damaged_Conversation_03
  8028. if (obj && killedYet == false)
  8029. {
  8030. if (first_time_damaged == true)
  8031. {
  8032. Commands->Set_HUD_Help_Text ( IDS_M11DSGN_DSGN1007I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  8033. first_time_damaged = false;
  8034. sydney_damaged_conv01 = Commands->Create_Conversation( "M11_Sydney_Damaged_Conversation_01", 90, 1000, true);
  8035. Commands->Join_Conversation( obj, sydney_damaged_conv01, false, true, true );
  8036. Commands->Start_Conversation( sydney_damaged_conv01, sydney_damaged_conv01 );
  8037. Commands->Monitor_Conversation( obj, sydney_damaged_conv01 );
  8038. sydney_damaged_conv01_playing = true;
  8039. }
  8040. else if (second_time_damaged == true)
  8041. {
  8042. Commands->Set_HUD_Help_Text ( IDS_M11DSGN_DSGN1007I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  8043. second_time_damaged = false;
  8044. sydney_damaged_conv02 = Commands->Create_Conversation( "M11_Sydney_Damaged_Conversation_02", 90, 1000, true);
  8045. Commands->Join_Conversation( NULL, sydney_damaged_conv02, false, false, false );
  8046. Commands->Start_Conversation( sydney_damaged_conv02, sydney_damaged_conv02 );
  8047. Commands->Monitor_Conversation( obj, sydney_damaged_conv02 );
  8048. sydney_damaged_conv02_playing = true;
  8049. }
  8050. else if (third_time_damaged == true)
  8051. {
  8052. Commands->Set_HUD_Help_Text ( IDS_M11DSGN_DSGN1007I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  8053. third_time_damaged = false;
  8054. sydney_damaged_conv03 = Commands->Create_Conversation( "M11_Sydney_Damaged_Conversation_03", 90, 1000, true);
  8055. Commands->Join_Conversation( NULL, sydney_damaged_conv03, false, false, false );
  8056. Commands->Start_Conversation( sydney_damaged_conv03, sydney_damaged_conv03 );
  8057. Commands->Monitor_Conversation( obj, sydney_damaged_conv03 );
  8058. sydney_damaged_conv03_playing = true;
  8059. }
  8060. }
  8061. }
  8062. void Killed( GameObject * obj, GameObject * killer ) //M11_Sydney_Dead_Conversation_01 and/or M11_Sydney_Dead_Conversation_02
  8063. {
  8064. Commands->Set_HUD_Help_Text ( IDS_M11DSGN_DSGN1008I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
  8065. killedYet = true;
  8066. if (sydney_damaged_conv01_playing == true)
  8067. {
  8068. Commands->Stop_Conversation(sydney_damaged_conv01);
  8069. }
  8070. else if (sydney_damaged_conv02_playing == true)
  8071. {
  8072. Commands->Stop_Conversation(sydney_damaged_conv02);
  8073. }
  8074. else if (sydney_damaged_conv03_playing == true)
  8075. {
  8076. Commands->Stop_Conversation(sydney_damaged_conv03);
  8077. }
  8078. int random = Commands->Get_Random_Int(0, 2);
  8079. if (random == 0)
  8080. {
  8081. Commands->Create_2D_Sound ( "M11DSGN_DSGN0086I1GBRS_SND" );
  8082. }
  8083. else
  8084. {
  8085. Commands->Create_2D_Sound ( "M11DSGN_DSGN0022I1EVAG_SND" );
  8086. }
  8087. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_END_MISSION_FAIL_JDG, 5 );
  8088. }
  8089. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8090. {
  8091. ActionParamsStruct params;
  8092. if (type == 0)
  8093. {
  8094. if (param == M01_START_ACTING_JDG)//start initial conversation
  8095. {
  8096. if (obj && STAR)
  8097. {
  8098. Commands->Set_Shield_Type ( obj, "ShieldKevlar" );
  8099. Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
  8100. //Commands->Innate_Enable(obj);
  8101. sydney_conv01 = Commands->Create_Conversation( "M11_Initial_Sydney_Conversation_JDG", 100, 1000, false);
  8102. Commands->Join_Conversation( obj, sydney_conv01, false, true, true );
  8103. Commands->Join_Conversation( STAR, sydney_conv01, false, false, false );
  8104. Commands->Join_Conversation( NULL, sydney_conv01, false, false, false );
  8105. Commands->Start_Conversation( sydney_conv01, sydney_conv01 );
  8106. Commands->Monitor_Conversation( obj, sydney_conv01 );
  8107. Vector3 siloProtector01_spot (-6.307f, 39.101f, 0);
  8108. Vector3 siloProtector02_spot (-7.002f, 38.229f, -10.015f);
  8109. Vector3 siloProtector03_spot (-6.596f, 38.117f, -10.015f);
  8110. Vector3 siloProtector05_spot (7.324f, 38.026f, -18);
  8111. Vector3 siloProtector07_spot (7.1f, 37.690f, -29.854f);
  8112. Vector3 siloProtector08_spot (-0.197f, 44.313f, -29.854f);
  8113. Vector3 siloProtector09_spot (-1.203f, 31.698f, -39.486f);
  8114. GameObject * siloProtector01 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector01_spot );
  8115. GameObject * siloProtector02 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector02_spot );
  8116. GameObject * siloProtector03 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector03_spot );
  8117. GameObject * siloProtector05 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector05_spot );
  8118. GameObject * siloProtector07 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector07_spot );
  8119. GameObject * siloProtector08 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector08_spot );
  8120. GameObject * siloProtector09 = Commands->Create_Object ( "Nod_FlameThrower_2SF", siloProtector09_spot );
  8121. Commands->Attach_Script(siloProtector01, "M11_NukeSilo_Protector_JDG", "");
  8122. Commands->Attach_Script(siloProtector02, "M11_NukeSilo_Protector_JDG", "");
  8123. Commands->Attach_Script(siloProtector03, "M11_NukeSilo_Protector_JDG", "");
  8124. Commands->Attach_Script(siloProtector05, "M11_NukeSilo_Protector_JDG", "");
  8125. Commands->Attach_Script(siloProtector07, "M11_NukeSilo_Protector_JDG", "");
  8126. Commands->Attach_Script(siloProtector08, "M11_NukeSilo_Protector_JDG", "");
  8127. Commands->Attach_Script(siloProtector09, "M11_NukeSilo_Protector_JDG", "");
  8128. Vector3 labProtector01_spot (-0.722f, 20.642f, -34.233f);
  8129. Vector3 labProtector02_spot (9.455f, 28.227f, -39.486f);
  8130. Commands->Create_Object ( "Nod_FlameThrower_2SF", labProtector01_spot );
  8131. Commands->Create_Object ( "Nod_FlameThrower_2SF", labProtector02_spot );
  8132. }
  8133. }
  8134. else if (param == M01_WALKING_WAYPATH_02_JDG)
  8135. {
  8136. Commands->Set_Innate_Is_Stationary ( obj, false );
  8137. int sydney_letsgo_conv = Commands->Create_Conversation( "M11_Sydney_WatchMyBack_Conversation", 100, 1000, false);
  8138. Commands->Join_Conversation( obj, sydney_letsgo_conv, false, true, true );
  8139. Commands->Start_Conversation( sydney_letsgo_conv, sydney_letsgo_conv );
  8140. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
  8141. params.Set_Movement( Vector3 (0,0,0), RUN, 0.5f );
  8142. int random = Commands->Get_Random_Int(0, 2);
  8143. if (random == 0)
  8144. {
  8145. params.WaypathID = 100110;
  8146. params.WaypointStartID = 100111;
  8147. params.WaypointEndID = 100119;
  8148. }
  8149. else
  8150. {
  8151. params.WaypathID = 100121;
  8152. params.WaypointStartID = 100122;
  8153. params.WaypointEndID = 100130;
  8154. }
  8155. Commands->Action_Goto(obj, params);
  8156. }
  8157. else if (param == M01_WALKING_WAYPATH_03_JDG)
  8158. {
  8159. Commands->Set_Innate_Is_Stationary ( obj, false );
  8160. int random = Commands->Get_Random_Int(0, 2);
  8161. if (random == 0)
  8162. {
  8163. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
  8164. params.Set_Movement( Vector3 (0,0,0), RUN, 0.5f );
  8165. params.WaypathID = 100135;
  8166. params.WaypointStartID = 100136;
  8167. params.WaypointEndID = 100149;
  8168. }
  8169. else
  8170. {
  8171. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
  8172. params.Set_Movement( Vector3 (0,0,0), RUN, 0.5f );
  8173. params.WaypathID = 100151;
  8174. params.WaypointStartID = 100152;
  8175. params.WaypointEndID = 100162;
  8176. }
  8177. Commands->Action_Goto(obj, params);
  8178. }
  8179. else if (param == M01_WALKING_WAYPATH_05_JDG)//now goto first silo elevator platform
  8180. {
  8181. sydneys_location = GOING_TO_ELEVATOR01;
  8182. Commands->Set_Innate_Is_Stationary ( obj, false );
  8183. Commands->Debug_Message ( "***************************SYDNEY has received command to goto first elevator lift\n" );
  8184. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  8185. //params.Set_Movement( Vector3 (3.342f, 43.458f, -39.462f), RUN, 0.25f );
  8186. params.Set_Movement( Vector3 (0,0,0), WALK, 0.25f );
  8187. params.WaypathID = 105199;
  8188. Commands->Action_Goto(obj, params);
  8189. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8190. if (elevatorDisabler != NULL)
  8191. {
  8192. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8193. }
  8194. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8195. if (elevatorController != NULL)
  8196. {
  8197. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  8198. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  8199. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  8200. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  8201. }
  8202. }
  8203. else if (param == M01_WALKING_WAYPATH_07_JDG)//now goto first silo elevator platform
  8204. {
  8205. sydneys_location = GOING_TO_ELEVATOR01;
  8206. Commands->Set_Innate_Is_Stationary ( obj, false );
  8207. Commands->Debug_Message ( "***************************SYDNEY has received command to goto first elevator lift\n" );
  8208. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  8209. //params.Set_Movement( Vector3 (3.342f, 43.458f, -39.462f), RUN, 0.25f );
  8210. params.Set_Movement( Vector3 (0,0,0), RUN, 0.25f );
  8211. params.WaypathID = 105205;
  8212. Commands->Action_Goto(obj, params);
  8213. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8214. if (elevatorDisabler != NULL)
  8215. {
  8216. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8217. }
  8218. //Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 45, "MISS_ELEV4.MISS_ELEV4" );
  8219. //Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 45, "MISS_ELEV3.MISS_ELEV3" );
  8220. //Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 45, "MISS_ELEV2.MISS_ELEV2" );
  8221. //Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 45, "MISS_ELEV1.MISS_ELEV1" );
  8222. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8223. if (elevatorController != NULL)
  8224. {
  8225. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  8226. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  8227. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  8228. Commands->Send_Custom_Event ( obj, elevatorController, 1, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  8229. }
  8230. }
  8231. else if (param == M01_MODIFY_YOUR_ACTION_JDG)//sydney on level 2--goto next elevator
  8232. {
  8233. sydneys_location = GOING_TO_ELEVATOR02;
  8234. Commands->Set_Innate_Is_Stationary ( obj, false );
  8235. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  8236. //params.Set_Movement( Vector3 (-4.767f, 42.337f, -29.854f), RUN, 0.5f );
  8237. params.Set_Movement( Vector3 (0,0,0), RUN, 0.25f );
  8238. params.WaypathID = 104839;
  8239. Commands->Action_Goto(obj, params);
  8240. //GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8241. //if (elevatorDisabler != NULL)
  8242. //{
  8243. // Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8244. //}
  8245. }
  8246. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//sydney on level 3--goto next elevator
  8247. {
  8248. sydneys_location = GOING_TO_ELEVATOR03;
  8249. Commands->Set_Innate_Is_Stationary ( obj, false );
  8250. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  8251. //params.Set_Movement( Vector3 (-4.632f, 33.498f, -18), RUN, 0.5f );
  8252. params.Set_Movement( Vector3 (0,0,0), RUN, 0.25f );
  8253. params.WaypathID = 104845;
  8254. Commands->Action_Goto(obj, params);
  8255. GameObject * ropeController = Commands->Find_Object ( 106908 );
  8256. if (ropeController != NULL)
  8257. {
  8258. Commands->Send_Custom_Event ( obj, ropeController, 0, M01_START_ACTING_JDG, 3 );
  8259. }
  8260. //GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8261. //if (elevatorDisabler != NULL)
  8262. //{
  8263. // Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8264. //}
  8265. }
  8266. else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//sydney on level 4--goto next elevator
  8267. {
  8268. sydneys_location = GOING_TO_ELEVATOR04;
  8269. Commands->Set_Innate_Is_Stationary ( obj, false );
  8270. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
  8271. //params.Set_Movement( Vector3 (4.042f, 32.885f, -10.015f), RUN, 0.5f );
  8272. params.Set_Movement( Vector3 (0,0,0), RUN, 0.25f );
  8273. params.WaypathID = 104850;
  8274. Commands->Action_Goto(obj, params);
  8275. //GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8276. //if (elevatorDisabler != NULL)
  8277. //{
  8278. // Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8279. //}
  8280. }
  8281. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//sydney on top level 4--goto nuke switch
  8282. {
  8283. sydneys_location = GOING_TO_MISSILE_SWITCH;
  8284. GameObject * nukeSwitch = Commands->Find_Object ( M11_END_MISSION_SWITCH_JDG );
  8285. if (nukeSwitch != NULL)
  8286. {
  8287. Vector3 nukePosition (-0.113f, 29.391f, 0.046f);
  8288. Commands->Set_Innate_Is_Stationary ( obj, false );
  8289. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
  8290. params.Set_Movement( nukePosition, RUN, 0.25f );
  8291. Commands->Action_Goto(obj, params);
  8292. }
  8293. }
  8294. else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//sydney should now be facing nuke console--play anim
  8295. {
  8296. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  8297. params.Set_Animation ("S_A_HUMAN.H_A_CON2", false);
  8298. Commands->Action_Play_Animation (obj, params);
  8299. }
  8300. }
  8301. }
  8302. void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
  8303. {
  8304. ActionParamsStruct params;
  8305. switch (complete_reason)
  8306. {
  8307. case ACTION_COMPLETE_CONVERSATION_ENDED:
  8308. {
  8309. if (action_id == sydney_conv01)
  8310. {
  8311. Commands->Set_Innate_Is_Stationary (obj, false);
  8312. Commands->Grant_Key( obj, 1, true );
  8313. Commands->Grant_Key( obj, 2, true );
  8314. Commands->Grant_Key( obj, 3, true );
  8315. Commands->Grant_Key( obj, 4, true );
  8316. Commands->Debug_Message ( "***************************initial SYDNEY conversation is over--going to zone 01\n" );
  8317. params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
  8318. params.Set_Movement( Vector3 (0,0,0), RUN, 0.5f );
  8319. params.WaypathID = 100541;
  8320. params.WaypointStartID = 100542;
  8321. params.WaypointEndID = 100544;
  8322. Commands->Action_Goto(obj, params);
  8323. GameObject * objectiveController = Commands->Find_Object ( M11_MISSION_CONTROLLER_JDG );
  8324. if (objectiveController != NULL)
  8325. {
  8326. Commands->Send_Custom_Event( obj, objectiveController, 0, M11_END_SECOND_OBJECTIVE_JDG, 0 );
  8327. }
  8328. }
  8329. else if (action_id == sydney_damaged_conv01)
  8330. {
  8331. second_time_damaged = true;
  8332. sydney_damaged_conv01_playing = false;
  8333. }
  8334. else if (action_id == sydney_damaged_conv02)
  8335. {
  8336. third_time_damaged = true;
  8337. sydney_damaged_conv02_playing = false;
  8338. }
  8339. else if (action_id == sydney_damaged_conv03) //missionEndConv
  8340. {
  8341. third_time_damaged = true;
  8342. sydney_damaged_conv03_playing = false;
  8343. }
  8344. else if (action_id == missionEndConv)
  8345. {
  8346. params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
  8347. params.Set_Animation ("S_A_HUMAN.H_A_CON2", false);
  8348. Commands->Action_Play_Animation (obj, params);
  8349. }
  8350. }
  8351. break;
  8352. case ACTION_COMPLETE_PATH_BAD_START:
  8353. {
  8354. if (sydneys_location == GOING_TO_ELEVATOR01)
  8355. {
  8356. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_05_JDG, 1 );
  8357. }
  8358. else if (sydneys_location == GOING_TO_ELEVATOR02)
  8359. {
  8360. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  8361. }
  8362. else if (sydneys_location == GOING_TO_ELEVATOR03)
  8363. {
  8364. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 1 );
  8365. }
  8366. else if (sydneys_location == GOING_TO_ELEVATOR04)
  8367. {
  8368. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 1 );
  8369. }
  8370. else if (sydneys_location == GOING_TO_MISSILE_SWITCH)
  8371. {
  8372. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 1 );
  8373. }
  8374. }
  8375. break;
  8376. case ACTION_COMPLETE_PATH_BAD_DEST:
  8377. {
  8378. if (sydneys_location == GOING_TO_ELEVATOR01)
  8379. {
  8380. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_05_JDG, 1 );
  8381. }
  8382. else if (sydneys_location == GOING_TO_ELEVATOR02)
  8383. {
  8384. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  8385. }
  8386. else if (sydneys_location == GOING_TO_ELEVATOR03)
  8387. {
  8388. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 1 );
  8389. }
  8390. else if (sydneys_location == GOING_TO_ELEVATOR04)
  8391. {
  8392. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 1 );
  8393. }
  8394. else if (sydneys_location == GOING_TO_MISSILE_SWITCH)
  8395. {
  8396. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 1 );
  8397. }
  8398. }
  8399. break;
  8400. case ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE:
  8401. {
  8402. if (sydneys_location == GOING_TO_ELEVATOR01)
  8403. {
  8404. Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_05_JDG, 1 );
  8405. }
  8406. else if (sydneys_location == GOING_TO_ELEVATOR02)
  8407. {
  8408. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
  8409. }
  8410. else if (sydneys_location == GOING_TO_ELEVATOR03)
  8411. {
  8412. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 1 );
  8413. }
  8414. else if (sydneys_location == GOING_TO_ELEVATOR04)
  8415. {
  8416. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 1 );
  8417. }
  8418. else if (sydneys_location == GOING_TO_MISSILE_SWITCH)
  8419. {
  8420. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 1 );
  8421. }
  8422. }
  8423. break;
  8424. case ACTION_COMPLETE_NORMAL:
  8425. {
  8426. if (action_id == M01_WALKING_WAYPATH_01_JDG)
  8427. {
  8428. Commands->Set_Innate_Is_Stationary (obj, true);
  8429. GameObject * rallyZone01 = Commands->Find_Object ( M11_SYDNEY_RALLY_ZONE_01_JDG );
  8430. if (rallyZone01 != NULL)
  8431. {
  8432. Commands->Send_Custom_Event( obj, rallyZone01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8433. }
  8434. else
  8435. {
  8436. Commands->Debug_Message ( "**********************SYDNEY--cannot find rally zone 01\n" );
  8437. }
  8438. }
  8439. else if (action_id == M01_WALKING_WAYPATH_02_JDG)
  8440. {
  8441. Commands->Set_Innate_Is_Stationary (obj, true);
  8442. GameObject * rallyZone02 = Commands->Find_Object ( M11_SYDNEY_RALLY_ZONE_02_JDG );
  8443. if (rallyZone02 != NULL)
  8444. {
  8445. Commands->Send_Custom_Event( obj, rallyZone02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8446. }
  8447. else
  8448. {
  8449. Commands->Debug_Message ( "**********************SYDNEY--cannot find rally zone 02\n" );
  8450. }
  8451. GameObject * objectiveController = Commands->Find_Object ( M11_MISSION_CONTROLLER_JDG );
  8452. if (objectiveController != NULL)
  8453. {
  8454. Commands->Send_Custom_Event( obj, objectiveController, 0, M11_ADD_FIFTH_OBJECTIVE_JDG, 0 );
  8455. }
  8456. }
  8457. else if (action_id == M01_WALKING_WAYPATH_03_JDG)
  8458. {
  8459. Commands->Set_Innate_Is_Stationary (obj, true);
  8460. GameObject * rallyZone03 = Commands->Find_Object ( M11_SYDNEY_RALLY_ZONE_03A_JDG );
  8461. if (rallyZone03 != NULL)
  8462. {
  8463. Commands->Send_Custom_Event( obj, rallyZone03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8464. }
  8465. else
  8466. {
  8467. Commands->Debug_Message ( "**********************SYDNEY--cannot find rally zone 03a\n" );
  8468. }
  8469. }
  8470. else if (action_id == M01_WALKING_WAYPATH_04_JDG)
  8471. {
  8472. Commands->Set_Innate_Is_Stationary (obj, true);
  8473. GameObject * rallyZone03 = Commands->Find_Object ( M11_SYDNEY_RALLY_ZONE_03B_JDG );
  8474. if (rallyZone03 != NULL)
  8475. {
  8476. Commands->Send_Custom_Event( obj, rallyZone03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8477. }
  8478. else
  8479. {
  8480. Commands->Debug_Message ( "**********************SYDNEY--cannot find rally zone 03b\n" );
  8481. }
  8482. }
  8483. else if (action_id == M01_WALKING_WAYPATH_05_JDG)//sydneys at first elevator--goto stationary for now
  8484. {
  8485. Commands->Set_Innate_Is_Stationary (obj, true);
  8486. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8487. if (elevatorDisabler != NULL)
  8488. {
  8489. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_START_ACTING_JDG, 0 );
  8490. }
  8491. }
  8492. else if (action_id == M01_WALKING_WAYPATH_06_JDG)//sydneys at missile switch-play animation
  8493. {
  8494. GameObject * nukeconsole = Commands->Find_Object ( 100106 );
  8495. if (nukeconsole != NULL)
  8496. {
  8497. Commands->Set_Innate_Is_Stationary (obj, true);
  8498. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  8499. params.Set_Attack (nukeconsole, 0, 0, true);
  8500. Commands->Action_Attack (obj, params);
  8501. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 1 );
  8502. }
  8503. }
  8504. else if (action_id == M01_DOING_ANIMATION_01_JDG)//play end mission conversation
  8505. {
  8506. GameObject * nukeconsole = Commands->Find_Object ( 100106 );
  8507. if (nukeconsole != NULL)
  8508. {
  8509. Commands->Send_Custom_Event( obj, nukeconsole, 0, M01_START_ACTING_JDG, 0 );
  8510. }
  8511. missionEndConv = Commands->Create_Conversation( "M11_End_Mission_Conversation", 100, 1000, false);
  8512. Commands->Join_Conversation( STAR, missionEndConv, false, false );
  8513. Commands->Join_Conversation( obj, missionEndConv, false, false, true );
  8514. Commands->Start_Conversation( missionEndConv, missionEndConv );
  8515. Commands->Monitor_Conversation (obj, missionEndConv);
  8516. }
  8517. else if (action_id == M01_DOING_ANIMATION_02_JDG)//end mission--success
  8518. {
  8519. Commands->Send_Custom_Event( obj, Commands->Find_Object (M11_MISSION_CONTROLLER_JDG), 0, M11_END_MISSION_PASS_JDG, 0 );
  8520. }
  8521. }
  8522. break;
  8523. }
  8524. }
  8525. };
  8526. DECLARE_SCRIPT(M11_Silo_ElevatorDeactivator_JDG, "")//105192
  8527. {
  8528. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8529. {
  8530. if (type == 0)
  8531. {
  8532. if (param == M11_START_ACTING_JDG)//allow switch usage
  8533. {
  8534. GameObject * elevator01_switch01 = Commands->Find_Object ( 101689 );
  8535. if (elevator01_switch01 != NULL)
  8536. {
  8537. Commands->Send_Custom_Event( obj, elevator01_switch01, 0, M11_START_ACTING_JDG, 0 );
  8538. }
  8539. GameObject * elevator01_switch02 = Commands->Find_Object ( 101651 );
  8540. if (elevator01_switch02 != NULL)
  8541. {
  8542. Commands->Send_Custom_Event( obj, elevator01_switch02, 0, M11_START_ACTING_JDG, 0 );
  8543. }
  8544. GameObject * elevator01_switch03 = Commands->Find_Object ( 101690 );
  8545. if (elevator01_switch03 != NULL)
  8546. {
  8547. Commands->Send_Custom_Event( obj, elevator01_switch03, 0, M11_START_ACTING_JDG, 0 );
  8548. }
  8549. GameObject * elevator01_switch04 = Commands->Find_Object ( 101691 );
  8550. if (elevator01_switch04 != NULL)
  8551. {
  8552. Commands->Send_Custom_Event( obj, elevator01_switch04, 0, M11_START_ACTING_JDG, 0 );
  8553. }
  8554. //101692 101693 101694 101695
  8555. GameObject * elevator02_switch01 = Commands->Find_Object ( 101692 );
  8556. if (elevator02_switch01 != NULL)
  8557. {
  8558. Commands->Send_Custom_Event( obj, elevator02_switch01, 0, M11_START_ACTING_JDG, 0 );
  8559. }
  8560. GameObject * elevator02_switch02 = Commands->Find_Object ( 101693 );
  8561. if (elevator02_switch02 != NULL)
  8562. {
  8563. Commands->Send_Custom_Event( obj, elevator02_switch02, 0, M11_START_ACTING_JDG, 0 );
  8564. }
  8565. GameObject * elevator02_switch03 = Commands->Find_Object ( 101694 );
  8566. if (elevator02_switch03 != NULL)
  8567. {
  8568. Commands->Send_Custom_Event( obj, elevator02_switch03, 0, M11_START_ACTING_JDG, 0 );
  8569. }
  8570. GameObject * elevator02_switch04 = Commands->Find_Object ( 101695 );
  8571. if (elevator02_switch04 != NULL)
  8572. {
  8573. Commands->Send_Custom_Event( obj, elevator02_switch04, 0, M11_START_ACTING_JDG, 0 );
  8574. }
  8575. //101717 101718 101719 101720
  8576. GameObject * elevator03_switch01 = Commands->Find_Object ( 101717 );
  8577. if (elevator03_switch01 != NULL)
  8578. {
  8579. Commands->Send_Custom_Event( obj, elevator03_switch01, 0, M11_START_ACTING_JDG, 0 );
  8580. }
  8581. GameObject * elevator03_switch02 = Commands->Find_Object ( 101718 );
  8582. if (elevator03_switch02 != NULL)
  8583. {
  8584. Commands->Send_Custom_Event( obj, elevator03_switch02, 0, M11_START_ACTING_JDG, 0 );
  8585. }
  8586. GameObject * elevator03_switch03 = Commands->Find_Object ( 101719 );
  8587. if (elevator03_switch03 != NULL)
  8588. {
  8589. Commands->Send_Custom_Event( obj, elevator03_switch03, 0, M11_START_ACTING_JDG, 0 );
  8590. }
  8591. GameObject * elevator03_switch04 = Commands->Find_Object ( 101720 );
  8592. if (elevator03_switch04 != NULL)
  8593. {
  8594. Commands->Send_Custom_Event( obj, elevator03_switch04, 0, M11_START_ACTING_JDG, 0 );
  8595. }
  8596. //101721 101722 101723
  8597. GameObject * elevator04_switch01 = Commands->Find_Object ( 101721 );
  8598. if (elevator04_switch01 != NULL)
  8599. {
  8600. Commands->Send_Custom_Event( obj, elevator04_switch01, 0, M11_START_ACTING_JDG, 0 );
  8601. }
  8602. GameObject * elevator04_switch02 = Commands->Find_Object ( 101722 );
  8603. if (elevator04_switch02 != NULL)
  8604. {
  8605. Commands->Send_Custom_Event( obj, elevator04_switch02, 0, M11_START_ACTING_JDG, 0 );
  8606. }
  8607. GameObject * elevator04_switch03 = Commands->Find_Object ( 101723 );
  8608. if (elevator04_switch03 != NULL)
  8609. {
  8610. Commands->Send_Custom_Event( obj, elevator04_switch03, 0, M11_START_ACTING_JDG, 0 );
  8611. }
  8612. }
  8613. if (param == M11_GOTO_IDLE_JDG)//disallow switch usage
  8614. {
  8615. GameObject * elevator01_switch01 = Commands->Find_Object ( 101689 );
  8616. if (elevator01_switch01 != NULL)
  8617. {
  8618. Commands->Send_Custom_Event( obj, elevator01_switch01, 0, M11_GOTO_IDLE_JDG, 0 );
  8619. }
  8620. GameObject * elevator01_switch02 = Commands->Find_Object ( 101651 );
  8621. if (elevator01_switch02 != NULL)
  8622. {
  8623. Commands->Send_Custom_Event( obj, elevator01_switch02, 0, M11_GOTO_IDLE_JDG, 0 );
  8624. }
  8625. GameObject * elevator01_switch03 = Commands->Find_Object ( 101690 );
  8626. if (elevator01_switch03 != NULL)
  8627. {
  8628. Commands->Send_Custom_Event( obj, elevator01_switch03, 0, M11_GOTO_IDLE_JDG, 0 );
  8629. }
  8630. GameObject * elevator01_switch04 = Commands->Find_Object ( 101691 );
  8631. if (elevator01_switch04 != NULL)
  8632. {
  8633. Commands->Send_Custom_Event( obj, elevator01_switch04, 0, M11_GOTO_IDLE_JDG, 0 );
  8634. }
  8635. //101692 101693 101694 101695
  8636. GameObject * elevator02_switch01 = Commands->Find_Object ( 101692 );
  8637. if (elevator02_switch01 != NULL)
  8638. {
  8639. Commands->Send_Custom_Event( obj, elevator02_switch01, 0, M11_GOTO_IDLE_JDG, 0 );
  8640. }
  8641. GameObject * elevator02_switch02 = Commands->Find_Object ( 101693 );
  8642. if (elevator02_switch02 != NULL)
  8643. {
  8644. Commands->Send_Custom_Event( obj, elevator02_switch02, 0, M11_GOTO_IDLE_JDG, 0 );
  8645. }
  8646. GameObject * elevator02_switch03 = Commands->Find_Object ( 101694 );
  8647. if (elevator02_switch03 != NULL)
  8648. {
  8649. Commands->Send_Custom_Event( obj, elevator02_switch03, 0, M11_GOTO_IDLE_JDG, 0 );
  8650. }
  8651. GameObject * elevator02_switch04 = Commands->Find_Object ( 101695 );
  8652. if (elevator02_switch04 != NULL)
  8653. {
  8654. Commands->Send_Custom_Event( obj, elevator02_switch04, 0, M11_GOTO_IDLE_JDG, 0 );
  8655. }
  8656. //101717 101718 101719 101720
  8657. GameObject * elevator03_switch01 = Commands->Find_Object ( 101717 );
  8658. if (elevator03_switch01 != NULL)
  8659. {
  8660. Commands->Send_Custom_Event( obj, elevator03_switch01, 0, M11_GOTO_IDLE_JDG, 0 );
  8661. }
  8662. GameObject * elevator03_switch02 = Commands->Find_Object ( 101718 );
  8663. if (elevator03_switch02 != NULL)
  8664. {
  8665. Commands->Send_Custom_Event( obj, elevator03_switch02, 0, M11_GOTO_IDLE_JDG, 0 );
  8666. }
  8667. GameObject * elevator03_switch03 = Commands->Find_Object ( 101719 );
  8668. if (elevator03_switch03 != NULL)
  8669. {
  8670. Commands->Send_Custom_Event( obj, elevator03_switch03, 0, M11_GOTO_IDLE_JDG, 0 );
  8671. }
  8672. GameObject * elevator03_switch04 = Commands->Find_Object ( 101720 );
  8673. if (elevator03_switch04 != NULL)
  8674. {
  8675. Commands->Send_Custom_Event( obj, elevator03_switch04, 0, M11_GOTO_IDLE_JDG, 0 );
  8676. }
  8677. //101721 101722 101723
  8678. GameObject * elevator04_switch01 = Commands->Find_Object ( 101721 );
  8679. if (elevator04_switch01 != NULL)
  8680. {
  8681. Commands->Send_Custom_Event( obj, elevator04_switch01, 0, M11_GOTO_IDLE_JDG, 0 );
  8682. }
  8683. GameObject * elevator04_switch02 = Commands->Find_Object ( 101722 );
  8684. if (elevator04_switch02 != NULL)
  8685. {
  8686. Commands->Send_Custom_Event( obj, elevator04_switch02, 0, M11_GOTO_IDLE_JDG, 0 );
  8687. }
  8688. GameObject * elevator04_switch03 = Commands->Find_Object ( 101723 );
  8689. if (elevator04_switch03 != NULL)
  8690. {
  8691. Commands->Send_Custom_Event( obj, elevator04_switch03, 0, M11_GOTO_IDLE_JDG, 0 );
  8692. }
  8693. }
  8694. }
  8695. }
  8696. };
  8697. DECLARE_SCRIPT(M11_Silo_ElevatorZone01_Top_JDG, "")//100705
  8698. {
  8699. bool sydney_in_zone;
  8700. bool havoc_in_zone;
  8701. REGISTER_VARIABLES()
  8702. {
  8703. SAVE_VARIABLE(sydney_in_zone, 1);
  8704. SAVE_VARIABLE(havoc_in_zone, 2);
  8705. }
  8706. void Created( GameObject * obj )
  8707. {
  8708. sydney_in_zone = false;
  8709. havoc_in_zone = false;
  8710. }
  8711. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8712. {
  8713. if (type == 0)
  8714. {
  8715. if (param == M01_MODIFY_YOUR_ACTION_JDG)
  8716. {
  8717. if (sydney_in_zone == true && havoc_in_zone == true)
  8718. {
  8719. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8720. if (elevatorDisabler != NULL)
  8721. {
  8722. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8723. }
  8724. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  8725. if (sydney != NULL )
  8726. {
  8727. Commands->Send_Custom_Event( obj, sydney, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8728. }
  8729. }
  8730. }
  8731. }
  8732. }
  8733. void Entered( GameObject * obj, GameObject * enterer )
  8734. {
  8735. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  8736. if (enterer == sydney)
  8737. {
  8738. sydney_in_zone = true;
  8739. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0);
  8740. }
  8741. else if (enterer == STAR)
  8742. {
  8743. havoc_in_zone = true;
  8744. Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
  8745. }
  8746. }
  8747. };
  8748. DECLARE_SCRIPT(M11_Silo_ElevatorZone02_Top_JDG, "")//100707
  8749. {
  8750. void Entered( GameObject * obj, GameObject * enterer )
  8751. {
  8752. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  8753. if (enterer == sydney)
  8754. {
  8755. if (sydney != NULL )
  8756. {
  8757. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8758. if (elevatorDisabler != NULL)
  8759. {
  8760. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8761. }
  8762. Commands->Send_Custom_Event( obj, sydney, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0.25f );
  8763. //Commands->Destroy_Object ( obj );//your job is over--clean up
  8764. }
  8765. }
  8766. }
  8767. };
  8768. DECLARE_SCRIPT(M11_Silo_ElevatorZone03_Top_JDG, "")//100710
  8769. {
  8770. void Entered( GameObject * obj, GameObject * enterer )
  8771. {
  8772. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  8773. if (enterer == sydney)
  8774. {
  8775. if (sydney != NULL )
  8776. {
  8777. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8778. if (elevatorDisabler != NULL)
  8779. {
  8780. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8781. }
  8782. Commands->Send_Custom_Event( obj, sydney, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0.25f );
  8783. //Commands->Destroy_Object ( obj );//your job is over--clean up
  8784. }
  8785. }
  8786. }
  8787. };
  8788. DECLARE_SCRIPT(M11_Silo_ElevatorZone04_Top_JDG, "")//100712
  8789. {
  8790. void Entered( GameObject * obj, GameObject * enterer )
  8791. {
  8792. GameObject * sydney = Commands->Find_Object ( M11_REAL_SYDNEY_MOBIUS_JDG );
  8793. if (enterer == sydney)
  8794. {
  8795. if (sydney != NULL )
  8796. {
  8797. GameObject * elevatorDisabler = Commands->Find_Object ( 105192 );
  8798. if (elevatorDisabler != NULL)
  8799. {
  8800. Commands->Send_Custom_Event( obj, elevatorDisabler, 0, M11_GOTO_IDLE_JDG, 0 );
  8801. }
  8802. Commands->Send_Custom_Event( obj, sydney, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0.25f );
  8803. //Commands->Destroy_Object ( obj );//your job is over--clean up
  8804. }
  8805. }
  8806. }
  8807. };
  8808. DECLARE_SCRIPT(M11_ForthFloor_Elevator_Switch_Script_JDG, "")//101689 101651 101690 101691
  8809. {
  8810. bool sydney_in_motion;
  8811. REGISTER_VARIABLES()
  8812. {
  8813. SAVE_VARIABLE(sydney_in_motion, 1);
  8814. }
  8815. void Created( GameObject * obj )
  8816. {
  8817. sydney_in_motion = false;
  8818. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8819. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8820. }
  8821. void Poked( GameObject * obj, GameObject * poker )
  8822. {
  8823. if (poker == STAR && sydney_in_motion == false)
  8824. {
  8825. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8826. if (elevatorController != NULL)
  8827. {
  8828. Commands->Send_Custom_Event ( obj, elevatorController, 0, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  8829. }
  8830. }
  8831. }
  8832. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8833. {
  8834. if (param == M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG)
  8835. {
  8836. if (type == 0)//elevator is moving--flash lights
  8837. {
  8838. Commands->Set_Animation ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", true);
  8839. }
  8840. else if (type == 1)//elevator is at top--goto green
  8841. {
  8842. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  8843. }
  8844. else if (type == 2)//elevator is at bottom--goto red
  8845. {
  8846. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8847. }
  8848. }
  8849. else if (type == 0)
  8850. {
  8851. if (param == M11_GOTO_IDLE_JDG)
  8852. {
  8853. sydney_in_motion = true;
  8854. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  8855. Commands->Send_Custom_Event( obj, obj, 0, M11_START_ACTING_JDG, 8 );
  8856. }
  8857. else if (param == M11_START_ACTING_JDG)
  8858. {
  8859. sydney_in_motion = false;
  8860. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8861. }
  8862. }
  8863. }
  8864. };
  8865. DECLARE_SCRIPT(M11_ThirdFloor_Elevator_Switch_Script_JDG, "")//101692 101693 101694 101695
  8866. {
  8867. bool sydney_in_motion;
  8868. REGISTER_VARIABLES()
  8869. {
  8870. SAVE_VARIABLE(sydney_in_motion, 1);
  8871. }
  8872. void Created( GameObject * obj )
  8873. {
  8874. sydney_in_motion = false;
  8875. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8876. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8877. }
  8878. void Poked( GameObject * obj, GameObject * poker )
  8879. {
  8880. if (poker == STAR && sydney_in_motion == false)
  8881. {
  8882. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8883. if (elevatorController != NULL)
  8884. {
  8885. Commands->Send_Custom_Event ( obj, elevatorController, 0, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  8886. }
  8887. }
  8888. }
  8889. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8890. {
  8891. if (param == M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG)
  8892. {
  8893. if (type == 0)//elevator is moving--flash lights
  8894. {
  8895. Commands->Set_Animation ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", true);
  8896. }
  8897. else if (type == 1)//elevator is at top--goto green
  8898. {
  8899. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  8900. }
  8901. else if (type == 2)//elevator is at bottom--goto red
  8902. {
  8903. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8904. }
  8905. }
  8906. else if (type == 0)
  8907. {
  8908. if (param == M11_GOTO_IDLE_JDG)
  8909. {
  8910. sydney_in_motion = true;
  8911. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  8912. Commands->Send_Custom_Event( obj, obj, 0, M11_START_ACTING_JDG, 8 );
  8913. }
  8914. else if (param == M11_START_ACTING_JDG)
  8915. {
  8916. sydney_in_motion = false;
  8917. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8918. }
  8919. }
  8920. }
  8921. };
  8922. DECLARE_SCRIPT(M11_SecondFloor_Elevator_Switch_Script_JDG, "")//101717 101718 101719 101720
  8923. {
  8924. bool sydney_in_motion;
  8925. REGISTER_VARIABLES()
  8926. {
  8927. SAVE_VARIABLE(sydney_in_motion, 1);
  8928. }
  8929. void Created( GameObject * obj )
  8930. {
  8931. sydney_in_motion = false;
  8932. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8933. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8934. }
  8935. void Poked( GameObject * obj, GameObject * poker )
  8936. {
  8937. if (poker == STAR && sydney_in_motion == false)
  8938. {
  8939. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8940. if (elevatorController != NULL)
  8941. {
  8942. Commands->Send_Custom_Event ( obj, elevatorController, 0, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  8943. }
  8944. }
  8945. }
  8946. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  8947. {
  8948. if (param == M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG)
  8949. {
  8950. if (type == 0)//elevator is moving--flash lights
  8951. {
  8952. Commands->Set_Animation ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", true);
  8953. }
  8954. else if (type == 1)//elevator is at top--goto green
  8955. {
  8956. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  8957. }
  8958. else if (type == 2)//elevator is at bottom--goto red
  8959. {
  8960. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8961. }
  8962. }
  8963. else if (type == 0)
  8964. {
  8965. if (param == M11_GOTO_IDLE_JDG)
  8966. {
  8967. sydney_in_motion = true;
  8968. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  8969. Commands->Send_Custom_Event( obj, obj, 0, M11_START_ACTING_JDG, 8 );
  8970. }
  8971. else if (param == M11_START_ACTING_JDG)
  8972. {
  8973. sydney_in_motion = false;
  8974. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8975. }
  8976. }
  8977. }
  8978. };
  8979. DECLARE_SCRIPT(M11_FirstFloor_Elevator_Switch_Script_JDG, "")//101721 101722 101723
  8980. {
  8981. bool sydney_in_motion;
  8982. REGISTER_VARIABLES()
  8983. {
  8984. sydney_in_motion = false;
  8985. SAVE_VARIABLE(sydney_in_motion, 1);
  8986. }
  8987. void Created( GameObject * obj )
  8988. {
  8989. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  8990. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  8991. }
  8992. void Poked( GameObject * obj, GameObject * poker )
  8993. {
  8994. if (poker == STAR && sydney_in_motion == false)
  8995. {
  8996. GameObject * elevatorController = Commands->Find_Object ( M11_MISSILE_LIFT_CONTROLLER_JDG );
  8997. if (elevatorController != NULL)
  8998. {
  8999. Commands->Send_Custom_Event ( obj, elevatorController, 0, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9000. }
  9001. }
  9002. }
  9003. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9004. {
  9005. if (param == M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG)
  9006. {
  9007. if (type == 0)//elevator is moving--flash lights
  9008. {
  9009. Commands->Set_Animation ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", true);
  9010. }
  9011. else if (type == 1)//elevator is at top--goto green
  9012. {
  9013. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 0 );//green
  9014. }
  9015. else if (type == 2)//elevator is at bottom--goto red
  9016. {
  9017. Commands->Set_Animation_Frame ( obj, "DSP_DOORSWITCH.DSP_DOORSWITCH", 1 );//red
  9018. }
  9019. }
  9020. else if (type == 0)
  9021. {
  9022. if (param == M11_GOTO_IDLE_JDG)
  9023. {
  9024. sydney_in_motion = true;
  9025. Commands->Enable_HUD_Pokable_Indicator ( obj, false );
  9026. Commands->Send_Custom_Event( obj, obj, 0, M11_START_ACTING_JDG, 8 );
  9027. }
  9028. else if (param == M11_START_ACTING_JDG)
  9029. {
  9030. sydney_in_motion = false;
  9031. Commands->Enable_HUD_Pokable_Indicator ( obj, true );
  9032. }
  9033. }
  9034. }
  9035. };
  9036. DECLARE_SCRIPT(M11_Elevator_Switch_MasterControllerScript_JDG, "")//101673
  9037. {
  9038. bool level4_lift_down;
  9039. bool level4_lift_up;
  9040. bool level4_lift_moving;
  9041. bool level3_lift_down;
  9042. bool level3_lift_up;
  9043. bool level3_lift_moving;
  9044. bool level2_lift_down;
  9045. bool level2_lift_up;
  9046. bool level2_lift_moving;
  9047. bool level1_lift_down;
  9048. bool level1_lift_up;
  9049. bool level1_lift_moving;
  9050. REGISTER_VARIABLES()
  9051. {
  9052. SAVE_VARIABLE(level4_lift_down, 1);
  9053. SAVE_VARIABLE(level4_lift_up, 2);
  9054. SAVE_VARIABLE(level4_lift_moving, 3);
  9055. SAVE_VARIABLE(level3_lift_down, 4);
  9056. SAVE_VARIABLE(level3_lift_up, 5);
  9057. SAVE_VARIABLE(level3_lift_moving, 6);
  9058. SAVE_VARIABLE(level2_lift_down, 7);
  9059. SAVE_VARIABLE(level2_lift_up, 8);
  9060. SAVE_VARIABLE(level2_lift_moving, 9);
  9061. SAVE_VARIABLE(level1_lift_down, 10);
  9062. SAVE_VARIABLE(level1_lift_up, 11);
  9063. SAVE_VARIABLE(level1_lift_moving, 12);
  9064. }
  9065. void Created( GameObject * obj )
  9066. {
  9067. level4_lift_down = true;
  9068. level4_lift_up = false;
  9069. level4_lift_moving = false;
  9070. level3_lift_down = true;
  9071. level3_lift_up = false;
  9072. level3_lift_moving = false;
  9073. level2_lift_down = true;
  9074. level2_lift_up = false;
  9075. level2_lift_moving = false;
  9076. level1_lift_down = true;
  9077. level1_lift_up = false;
  9078. level1_lift_moving = false;
  9079. }
  9080. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9081. {
  9082. if (type == 1)
  9083. {
  9084. if (param == M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG)//sydney is coming...force elevator down
  9085. {
  9086. level4_lift_moving = true;
  9087. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG );
  9088. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 45, "MISS_ELEV4.MISS_ELEV4" );
  9089. level4_lift_down = true;
  9090. }
  9091. else if (param == M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG)//sydney is coming...force elevator down
  9092. {
  9093. level3_lift_moving = true;
  9094. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG );
  9095. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 45, "MISS_ELEV3.MISS_ELEV3" );
  9096. level3_lift_down = true;
  9097. }
  9098. else if (param == M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG)//sydney is coming...force elevator down
  9099. {
  9100. level2_lift_moving = true;
  9101. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG );
  9102. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 45, "MISS_ELEV2.MISS_ELEV2" );
  9103. level2_lift_down = true;
  9104. }
  9105. else if (param == M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG)//sydney is coming...force elevator down
  9106. {
  9107. level1_lift_moving = true;
  9108. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG );
  9109. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 45, "MISS_ELEV1.MISS_ELEV1" );
  9110. level1_lift_down = true;
  9111. }
  9112. }
  9113. else if (type == 0)
  9114. {
  9115. if (param == M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG && level4_lift_moving == false)
  9116. {
  9117. level4_lift_moving = true;
  9118. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG );
  9119. if (level4_lift_down == true)
  9120. {
  9121. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 0, "MISS_ELEV4.MISS_ELEV4" );
  9122. }
  9123. else if (level4_lift_up == true)
  9124. {
  9125. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_04_JDG , 45, "MISS_ELEV4.MISS_ELEV4" );
  9126. }//101689 101651 101690 101691
  9127. GameObject * lev4switch01 = Commands->Find_Object ( 101689 );
  9128. GameObject * lev4switch02 = Commands->Find_Object ( 101651 );
  9129. GameObject * lev4switch03 = Commands->Find_Object ( 101690 );
  9130. GameObject * lev4switch04 = Commands->Find_Object ( 101691 );
  9131. if (lev4switch01 != NULL)
  9132. {
  9133. Commands->Send_Custom_Event ( obj, lev4switch01, 0, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9134. }
  9135. if (lev4switch02 != NULL)
  9136. {
  9137. Commands->Send_Custom_Event ( obj, lev4switch02, 0, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9138. }
  9139. if (lev4switch03 != NULL)
  9140. {
  9141. Commands->Send_Custom_Event ( obj, lev4switch03, 0, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9142. }
  9143. if (lev4switch04 != NULL)
  9144. {
  9145. Commands->Send_Custom_Event ( obj, lev4switch04, 0, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9146. }
  9147. }
  9148. else if (param == M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG && level3_lift_moving == false)
  9149. {
  9150. level3_lift_moving = true;
  9151. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG );
  9152. if (level3_lift_down == true)
  9153. {
  9154. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 0, "MISS_ELEV3.MISS_ELEV3" );
  9155. }
  9156. else if (level3_lift_up == true)
  9157. {
  9158. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_03_JDG , 45, "MISS_ELEV3.MISS_ELEV3" );
  9159. }//101692 101693 101694 101695
  9160. GameObject * lev3switch01 = Commands->Find_Object ( 101692 );
  9161. GameObject * lev3switch02 = Commands->Find_Object ( 101693 );
  9162. GameObject * lev3switch03 = Commands->Find_Object ( 101694 );
  9163. GameObject * lev3switch04 = Commands->Find_Object ( 101695 );
  9164. if (lev3switch01 != NULL)
  9165. {
  9166. Commands->Send_Custom_Event ( obj, lev3switch01, 0, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9167. }
  9168. if (lev3switch02 != NULL)
  9169. {
  9170. Commands->Send_Custom_Event ( obj, lev3switch02, 0, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9171. }
  9172. if (lev3switch03 != NULL)
  9173. {
  9174. Commands->Send_Custom_Event ( obj, lev3switch03, 0, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9175. }
  9176. if (lev3switch04 != NULL)
  9177. {
  9178. Commands->Send_Custom_Event ( obj, lev3switch04, 0, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9179. }
  9180. }
  9181. else if (param == M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG && level2_lift_moving == false)
  9182. {
  9183. level2_lift_moving = true;
  9184. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG );
  9185. if (level2_lift_down == true)
  9186. {
  9187. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 0, "MISS_ELEV2.MISS_ELEV2" );
  9188. }
  9189. else if (level2_lift_up == true)
  9190. {
  9191. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_02_JDG , 45, "MISS_ELEV2.MISS_ELEV2" );
  9192. }//101717 101718 101719 101720
  9193. GameObject * lev2switch01 = Commands->Find_Object ( 101717 );
  9194. GameObject * lev2switch02 = Commands->Find_Object ( 101718 );
  9195. GameObject * lev2switch03 = Commands->Find_Object ( 101719 );
  9196. GameObject * lev2switch04 = Commands->Find_Object ( 101720 );
  9197. if (lev2switch01 != NULL)
  9198. {
  9199. Commands->Send_Custom_Event ( obj, lev2switch01, 0, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9200. }
  9201. if (lev2switch02 != NULL)
  9202. {
  9203. Commands->Send_Custom_Event ( obj, lev2switch02, 0, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9204. }
  9205. if (lev2switch03 != NULL)
  9206. {
  9207. Commands->Send_Custom_Event ( obj, lev2switch03, 0, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9208. }
  9209. if (lev2switch04 != NULL)
  9210. {
  9211. Commands->Send_Custom_Event ( obj, lev2switch04, 0, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9212. }
  9213. }
  9214. else if (param == M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG && level1_lift_moving == false)
  9215. {
  9216. level1_lift_moving = true;
  9217. Commands->Start_Timer ( obj, this, 3, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG );
  9218. if (level1_lift_down == true)
  9219. {
  9220. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 0, "MISS_ELEV1.MISS_ELEV1" );
  9221. }
  9222. else if (level1_lift_up == true)
  9223. {
  9224. Commands->Static_Anim_Phys_Goto_Frame ( M11_MISSILE_LIFT_01_JDG , 45, "MISS_ELEV1.MISS_ELEV1" );
  9225. }//101721 101722 101723
  9226. GameObject * lev1switch01 = Commands->Find_Object ( 101721 );
  9227. GameObject * lev1switch02 = Commands->Find_Object ( 101722 );
  9228. GameObject * lev1switch03 = Commands->Find_Object ( 101723 );
  9229. if (lev1switch01 != NULL)
  9230. {
  9231. Commands->Send_Custom_Event ( obj, lev1switch01, 0, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9232. }
  9233. if (lev1switch02 != NULL)
  9234. {
  9235. Commands->Send_Custom_Event ( obj, lev1switch02, 0, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9236. }
  9237. if (lev1switch03 != NULL)
  9238. {
  9239. Commands->Send_Custom_Event ( obj, lev1switch03, 0, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9240. }
  9241. }
  9242. }
  9243. }
  9244. void Timer_Expired( GameObject * obj, int timer_id )
  9245. {
  9246. if (timer_id == M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG)
  9247. {
  9248. level4_lift_moving = false;
  9249. if (level4_lift_down == true)
  9250. {
  9251. level4_lift_down = false;
  9252. level4_lift_up = true;
  9253. GameObject * lev4switch01 = Commands->Find_Object ( 101689 );
  9254. GameObject * lev4switch02 = Commands->Find_Object ( 101651 );
  9255. GameObject * lev4switch03 = Commands->Find_Object ( 101690 );
  9256. GameObject * lev4switch04 = Commands->Find_Object ( 101691 );
  9257. if (lev4switch01 != NULL)
  9258. {
  9259. Commands->Send_Custom_Event ( obj, lev4switch01, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9260. }
  9261. if (lev4switch02 != NULL)
  9262. {
  9263. Commands->Send_Custom_Event ( obj, lev4switch02, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9264. }
  9265. if (lev4switch03 != NULL)
  9266. {
  9267. Commands->Send_Custom_Event ( obj, lev4switch03, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9268. }
  9269. if (lev4switch04 != NULL)
  9270. {
  9271. Commands->Send_Custom_Event ( obj, lev4switch04, 1, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9272. }
  9273. }
  9274. else if (level4_lift_up == true)
  9275. {
  9276. level4_lift_up = false;
  9277. level4_lift_down = true;
  9278. GameObject * lev4switch01 = Commands->Find_Object ( 101689 );
  9279. GameObject * lev4switch02 = Commands->Find_Object ( 101651 );
  9280. GameObject * lev4switch03 = Commands->Find_Object ( 101690 );
  9281. GameObject * lev4switch04 = Commands->Find_Object ( 101691 );
  9282. if (lev4switch01 != NULL)
  9283. {
  9284. Commands->Send_Custom_Event ( obj, lev4switch01, 2, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9285. }
  9286. if (lev4switch02 != NULL)
  9287. {
  9288. Commands->Send_Custom_Event ( obj, lev4switch02, 2, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9289. }
  9290. if (lev4switch03 != NULL)
  9291. {
  9292. Commands->Send_Custom_Event ( obj, lev4switch03, 2, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9293. }
  9294. if (lev4switch04 != NULL)
  9295. {
  9296. Commands->Send_Custom_Event ( obj, lev4switch04, 2, M11_PLAYER_HAS_POKED_LEVEL4_ELEVATOR_SWITCH_JDG, 0 );
  9297. }
  9298. }
  9299. }
  9300. else if (timer_id == M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG)
  9301. {
  9302. level3_lift_moving = false;
  9303. if (level3_lift_down == true)
  9304. {
  9305. level3_lift_down = false;
  9306. level3_lift_up = true;
  9307. GameObject * lev3switch01 = Commands->Find_Object ( 101692 );
  9308. GameObject * lev3switch02 = Commands->Find_Object ( 101693 );
  9309. GameObject * lev3switch03 = Commands->Find_Object ( 101694 );
  9310. GameObject * lev3switch04 = Commands->Find_Object ( 101695 );
  9311. if (lev3switch01 != NULL)
  9312. {
  9313. Commands->Send_Custom_Event ( obj, lev3switch01, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9314. }
  9315. if (lev3switch02 != NULL)
  9316. {
  9317. Commands->Send_Custom_Event ( obj, lev3switch02, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9318. }
  9319. if (lev3switch03 != NULL)
  9320. {
  9321. Commands->Send_Custom_Event ( obj, lev3switch03, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9322. }
  9323. if (lev3switch04 != NULL)
  9324. {
  9325. Commands->Send_Custom_Event ( obj, lev3switch04, 1, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9326. }
  9327. }
  9328. else if (level3_lift_up == true)
  9329. {
  9330. level3_lift_up = false;
  9331. level3_lift_down = true;
  9332. GameObject * lev3switch01 = Commands->Find_Object ( 101692 );
  9333. GameObject * lev3switch02 = Commands->Find_Object ( 101693 );
  9334. GameObject * lev3switch03 = Commands->Find_Object ( 101694 );
  9335. GameObject * lev3switch04 = Commands->Find_Object ( 101695 );
  9336. if (lev3switch01 != NULL)
  9337. {
  9338. Commands->Send_Custom_Event ( obj, lev3switch01, 2, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9339. }
  9340. if (lev3switch02 != NULL)
  9341. {
  9342. Commands->Send_Custom_Event ( obj, lev3switch02, 2, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9343. }
  9344. if (lev3switch03 != NULL)
  9345. {
  9346. Commands->Send_Custom_Event ( obj, lev3switch03, 2, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9347. }
  9348. if (lev3switch04 != NULL)
  9349. {
  9350. Commands->Send_Custom_Event ( obj, lev3switch04, 2, M11_PLAYER_HAS_POKED_LEVEL3_ELEVATOR_SWITCH_JDG, 0 );
  9351. }
  9352. }
  9353. }
  9354. else if (timer_id == M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG)
  9355. {
  9356. level2_lift_moving = false;
  9357. if (level2_lift_down == true)
  9358. {
  9359. level2_lift_down = false;
  9360. level2_lift_up = true;
  9361. GameObject * lev2switch01 = Commands->Find_Object ( 101717 );
  9362. GameObject * lev2switch02 = Commands->Find_Object ( 101718 );
  9363. GameObject * lev2switch03 = Commands->Find_Object ( 101719 );
  9364. GameObject * lev2switch04 = Commands->Find_Object ( 101720 );
  9365. if (lev2switch01 != NULL)
  9366. {
  9367. Commands->Send_Custom_Event ( obj, lev2switch01, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9368. }
  9369. if (lev2switch02 != NULL)
  9370. {
  9371. Commands->Send_Custom_Event ( obj, lev2switch02, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9372. }
  9373. if (lev2switch03 != NULL)
  9374. {
  9375. Commands->Send_Custom_Event ( obj, lev2switch03, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9376. }
  9377. if (lev2switch04 != NULL)
  9378. {
  9379. Commands->Send_Custom_Event ( obj, lev2switch04, 1, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9380. }
  9381. }
  9382. else if (level2_lift_up == true)
  9383. {
  9384. level2_lift_up = false;
  9385. level2_lift_down = true;
  9386. GameObject * lev2switch01 = Commands->Find_Object ( 101717 );
  9387. GameObject * lev2switch02 = Commands->Find_Object ( 101718 );
  9388. GameObject * lev2switch03 = Commands->Find_Object ( 101719 );
  9389. GameObject * lev2switch04 = Commands->Find_Object ( 101720 );
  9390. if (lev2switch01 != NULL)
  9391. {
  9392. Commands->Send_Custom_Event ( obj, lev2switch01, 2, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9393. }
  9394. if (lev2switch02 != NULL)
  9395. {
  9396. Commands->Send_Custom_Event ( obj, lev2switch02, 2, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9397. }
  9398. if (lev2switch03 != NULL)
  9399. {
  9400. Commands->Send_Custom_Event ( obj, lev2switch03, 2, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9401. }
  9402. if (lev2switch04 != NULL)
  9403. {
  9404. Commands->Send_Custom_Event ( obj, lev2switch04, 2, M11_PLAYER_HAS_POKED_LEVEL2_ELEVATOR_SWITCH_JDG, 0 );
  9405. }
  9406. }
  9407. }
  9408. else if (timer_id == M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG)
  9409. {
  9410. level1_lift_moving = false;
  9411. if (level1_lift_down == true)
  9412. {
  9413. level1_lift_down = false;
  9414. level1_lift_up = true;
  9415. GameObject * lev1switch01 = Commands->Find_Object ( 101721 );
  9416. GameObject * lev1switch02 = Commands->Find_Object ( 101722 );
  9417. GameObject * lev1switch03 = Commands->Find_Object ( 101723 );
  9418. if (lev1switch01 != NULL)
  9419. {
  9420. Commands->Send_Custom_Event ( obj, lev1switch01, 1, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9421. }
  9422. if (lev1switch02 != NULL)
  9423. {
  9424. Commands->Send_Custom_Event ( obj, lev1switch02, 1, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9425. }
  9426. if (lev1switch03 != NULL)
  9427. {
  9428. Commands->Send_Custom_Event ( obj, lev1switch03, 1, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9429. }
  9430. }
  9431. else if (level1_lift_up == true)
  9432. {
  9433. level1_lift_up = false;
  9434. level1_lift_down = true;
  9435. GameObject * lev1switch01 = Commands->Find_Object ( 101721 );
  9436. GameObject * lev1switch02 = Commands->Find_Object ( 101722 );
  9437. GameObject * lev1switch03 = Commands->Find_Object ( 101723 );
  9438. if (lev1switch01 != NULL)
  9439. {
  9440. Commands->Send_Custom_Event ( obj, lev1switch01, 2, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9441. }
  9442. if (lev1switch02 != NULL)
  9443. {
  9444. Commands->Send_Custom_Event ( obj, lev1switch02, 2, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9445. }
  9446. if (lev1switch03 != NULL)
  9447. {
  9448. Commands->Send_Custom_Event ( obj, lev1switch03, 2, M11_PLAYER_HAS_POKED_LEVEL1_ELEVATOR_SWITCH_JDG, 0 );
  9449. }
  9450. }
  9451. }
  9452. }
  9453. };
  9454. DECLARE_SCRIPT(M11_CeilingRepellers_Controller2_JDG, "")//106908
  9455. {
  9456. int spawned_units;
  9457. int rope_C_id;
  9458. Vector3 ropeC_v3;
  9459. bool rope_C_spawned;
  9460. REGISTER_VARIABLES()
  9461. {
  9462. SAVE_VARIABLE(spawned_units, 1);
  9463. SAVE_VARIABLE(rope_C_id, 2);
  9464. SAVE_VARIABLE(ropeC_v3, 4);
  9465. SAVE_VARIABLE(rope_C_spawned, 6);
  9466. }
  9467. void Created( GameObject * obj )
  9468. {
  9469. Commands->Enable_Hibernation( obj, false );
  9470. rope_C_spawned = false;
  9471. spawned_units = 0;
  9472. //Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
  9473. //Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 15 );
  9474. ropeC_v3.Set (4.753f, 38.483f, 8.044f);
  9475. }
  9476. void Custom( GameObject * obj, int type, int param, GameObject * sender )
  9477. {
  9478. if (type == 0)
  9479. {
  9480. if (param == M01_START_ACTING_JDG)
  9481. {
  9482. rope_C_spawned = true;
  9483. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeC_v3);
  9484. //Commands->Set_Facing ( controller, 75 );
  9485. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part3.txt");
  9486. spawned_units++;
  9487. }
  9488. else if (param == M01_ROPE_IS_SENDING_ID_JDG)
  9489. {
  9490. rope_C_id = Commands->Get_ID ( sender );
  9491. }
  9492. else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
  9493. {
  9494. GameObject * rope_C = Commands->Find_Object ( rope_C_id );
  9495. if (rope_C != NULL)
  9496. {
  9497. GameObject *controller = Commands->Create_Object("Invisible_Object", ropeC_v3);
  9498. //Commands->Set_Facing ( controller, 75 );
  9499. Commands->Attach_Script(controller, "Test_Cinematic", "X11D_Repel_Part4.txt");
  9500. Commands->Set_Animation ( rope_C, "X11D_Rope.X11D_Rope_L", false);
  9501. spawned_units++;
  9502. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, (95/30) );
  9503. }
  9504. }
  9505. else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//set rope "C" to idle anim
  9506. {
  9507. GameObject * rope_C = Commands->Find_Object ( rope_C_id );
  9508. if (rope_C != NULL)
  9509. {
  9510. Commands->Set_Animation ( rope_C, "X11D_Rope.X11D_Rope_Z", true);
  9511. }
  9512. }
  9513. else if (param == M01_IVE_BEEN_KILLED_JDG )
  9514. {
  9515. if (rope_C_spawned == true)
  9516. {
  9517. float delayTimer = Commands->Get_Random ( 2, 5 );
  9518. Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
  9519. }
  9520. }
  9521. }
  9522. }
  9523. };
  9524. DECLARE_SCRIPT(M11_CeilingRepellers_RopeC_JDG, "")
  9525. {
  9526. void Created( GameObject * obj ) //M11_FIRSTFLOOR_REPELER_CONTROLLER_JDG
  9527. {
  9528. Commands->Enable_Hibernation( obj, false );
  9529. GameObject * myController = Commands->Find_Object ( 106908 );
  9530. if (myController != NULL)
  9531. {
  9532. Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
  9533. }
  9534. }
  9535. };
  9536. DECLARE_SCRIPT(M11_CeilingRepeller2_JDG, "")
  9537. {
  9538. void Created( GameObject * obj )
  9539. {
  9540. ActionParamsStruct params;
  9541. params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
  9542. params.Set_Attack (STAR, 100, 0, true);
  9543. Commands->Action_Attack (obj, params);
  9544. }
  9545. void Animation_Complete(GameObject * obj, const char *anim)
  9546. {
  9547. if (stricmp(anim, "S_a_Human.H_a_X11D_repel") == 0)
  9548. {
  9549. Commands->Attach_Script(obj, "M01_Hunt_The_Player_JDG","");
  9550. }
  9551. }
  9552. void Killed( GameObject * obj, GameObject * killer )
  9553. {
  9554. GameObject * myController = Commands->Find_Object ( 106908 );
  9555. if (myController != NULL)
  9556. {
  9557. Commands->Send_Custom_Event ( obj, myController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
  9558. }
  9559. }
  9560. };