| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /******************************************************************************
- *
- * FILE
- * Mission01.cpp
- *
- * DESCRIPTION
- * Mission 1 scripts
- *
- * PROGRAMMER
- * Design Team
- *
- * VERSION INFO
- * $Author: Joe_g $
- * $Revision: 268 $
- * $Modtime: 1/23/02 12:00p $
- * $Archive: /Commando/Code/Scripts/Mission01.cpp $
- *
- ******************************************************************************/
- #include "scripts.h"
- #include <string.h>
- #include "toolkit.h"
- #include "mission1.h"
- DECLARE_SCRIPT(M01_Mission_Controller_JDG, "")//this guys ID number is 100376
- {
- typedef enum {
- IDLE,
- ACTIVE,
- UNDER_ATTACK,
- DESTROYED,
- } M01_Building_State;
- typedef enum {
- LANDING_BEACH,
- INSIDE_GDI_CON,
- AT_GDI_BASE,
- INSIDE_GDI_POWERPLANT,
- BY_HAND_OF_NOD,
- INSIDE_HAND_OF_NOD,
- BY_REFINERY,
- INSIDE_REFINERY,
- BY_COMM_CENTER,
- INSIDE_COMM_CENTER,
- BY_TUNNEL,
- INSIDE_TUNNEL,
- BY_WATERFALL,
- INSIDE_WATERFALL,
- AT_SNIPER_SCENARIO,
- } M01_Location;
- bool is_startup;
- bool first_time_in_handofnod;
- bool first_time_in_hon_gruntlevel;
- bool first_time_in_hon_dojolevel;
- bool first_time_poking_gate_lock;
- bool players_first_time_by_commcenter;
- bool first_time_at_barn;
- bool gate_objective_done;
- bool church_guard_is_dead;
- bool loveshack_guard_is_dead;
- bool player_has_an_escort;
- bool clergy_are_boarding;
- bool church_pickup_chinook_is_on_its_way;
- bool player_has_unlocked_pen;
- bool radar_is_scrambled;
- bool unlock_gate_objective_active;
- bool commcenter_sam_objective_active;
- bool prisoners_are_freed;
- bool m01_hon_spawned_guy_01_alive;
- bool m01_hon_spawned_guy_02_alive;
- bool m01_hon_spawned_guy_03_alive;
- bool turret_01_is_dead;
- bool turret_02_is_dead;
- bool medium_tank_spawned;
- bool barn_prisoner_01_is_dead;
- bool barn_prisoner_02_is_dead;
- bool barn_prisoner_03_is_dead;
- bool barn_objective_active;
- bool kane_and_no2_conv01_active;
- bool kane_and_no2_conv02_active;
- bool kane_and_havoc_conv_active;
- bool m01_bridgeWeather_is_Set;
- bool m01_nodBase_weather_is_Set;
- bool missionStart;
- bool barn_objective_failed;
- bool barn_announcement_active;
- bool barn_objective_ended;
- bool turret_objective_over;
- bool final_conv_played;
- int m01_church_interior_nun02_ID;
- int m01_whack_a_mole_guy_ID;
- int m01_hon_spawned_guy_01_ID;
- int m01_hon_spawned_guy_02_ID;
- int m01_hon_spawned_guy_03_ID;
- int m01_medium_tank_ID;
- int m01_hon_spawners_tally;
- int m01_hon_total_spawners_tally;
- int m01_HON_SpawnRate;
- int new_turretbeach_engineers;
- int kane_ID;
- int eva_comm_center_line_01;
- int eva_comm_center_line_02;
- int eva_comm_center_line_03;
- int eva_comm_center_line_04;
- int eva_comm_center_line_05;
- int billy_conv;
- int babushka_conv;
- int start_conv;
- int start_conv2;
- int kane_and_no2_conv01;
- int kane_and_no2_conv02;
- int kane_and_havoc_conv;
- int lockes_hon_mct_conv1;
- int lockes_hon_mct_conv2;
- int barnEvac_conv;
- int barnfailed_conv;
- int civ3_conv;
- int missionIntro;
- int endMission_conv;
- int unlocked_gate_conv;
- int turrets_conv;
- int players_escorts_ID;
- int havocs_targets_ID;
- int m01_hon_chinook_guys_killed;
- int dead_barn_guard_tally;
- int dead_barn_prisoner_tally;
- //new stuff
- bool firstNodCommanderKilled;
- int loveshack_conv;
- bool loveshack_conv_playing;
- int priest_conv;
- bool priest_conv_playing;
- int interior_nun_conv;
- bool interior_nun_conv_playing;
- bool player_has_reached_grunt_level;
- bool civs_scattered;
- bool commcenter_sam_destroyed;
- M01_Building_State hand_of_nod_state, comm_center_state;
- M01_Location players_location;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(is_startup, 1);
- SAVE_VARIABLE(first_time_in_handofnod, 2);
- SAVE_VARIABLE(first_time_in_hon_gruntlevel, 3);
- SAVE_VARIABLE(first_time_in_hon_dojolevel, 4);
- SAVE_VARIABLE(first_time_poking_gate_lock, 5);
- SAVE_VARIABLE(players_first_time_by_commcenter, 6);
- SAVE_VARIABLE(first_time_at_barn, 7);
- SAVE_VARIABLE(gate_objective_done, 8);
- SAVE_VARIABLE(church_guard_is_dead, 9);
- SAVE_VARIABLE(loveshack_guard_is_dead, 10);
- SAVE_VARIABLE(player_has_an_escort, 11);
- SAVE_VARIABLE(clergy_are_boarding, 12);
- SAVE_VARIABLE(church_pickup_chinook_is_on_its_way, 13);
- SAVE_VARIABLE(player_has_unlocked_pen, 14);
- SAVE_VARIABLE(radar_is_scrambled, 15);
- SAVE_VARIABLE(unlock_gate_objective_active, 16);
- SAVE_VARIABLE(commcenter_sam_objective_active, 17);
- SAVE_VARIABLE(prisoners_are_freed, 18);
- SAVE_VARIABLE(m01_hon_spawned_guy_01_alive, 19);
- SAVE_VARIABLE(m01_hon_spawned_guy_02_alive, 20);
- SAVE_VARIABLE(m01_hon_spawned_guy_03_alive, 21);
- SAVE_VARIABLE(turret_01_is_dead, 22);
- SAVE_VARIABLE(turret_02_is_dead, 23);
- SAVE_VARIABLE(medium_tank_spawned, 24);
- SAVE_VARIABLE(barn_prisoner_01_is_dead, 25);
- SAVE_VARIABLE(barn_prisoner_02_is_dead, 26);
- SAVE_VARIABLE(barn_prisoner_03_is_dead, 27);
- SAVE_VARIABLE(barn_objective_active, 28);
- SAVE_VARIABLE(kane_and_no2_conv01_active, 29);
- SAVE_VARIABLE(kane_and_no2_conv02_active, 30);
- SAVE_VARIABLE(kane_and_havoc_conv_active, 31);
- SAVE_VARIABLE(m01_bridgeWeather_is_Set, 32);
- SAVE_VARIABLE(m01_nodBase_weather_is_Set, 33);
- SAVE_VARIABLE(missionStart, 34);
- SAVE_VARIABLE(barn_objective_failed, 35);
- SAVE_VARIABLE(barn_announcement_active, 36);
- SAVE_VARIABLE(barn_objective_ended, 37);
- SAVE_VARIABLE(turret_objective_over, 38);
- SAVE_VARIABLE(final_conv_played, 39);
- SAVE_VARIABLE(m01_church_interior_nun02_ID, 40);
- SAVE_VARIABLE(m01_whack_a_mole_guy_ID, 41);
- SAVE_VARIABLE(m01_hon_spawned_guy_01_ID, 42);
- SAVE_VARIABLE(m01_hon_spawned_guy_02_ID, 43);
- SAVE_VARIABLE(m01_hon_spawned_guy_03_ID, 44);
- SAVE_VARIABLE(m01_medium_tank_ID, 45);
- SAVE_VARIABLE(m01_hon_spawners_tally, 46);
- SAVE_VARIABLE(m01_hon_total_spawners_tally, 47);
- SAVE_VARIABLE(m01_HON_SpawnRate, 48);
- SAVE_VARIABLE(new_turretbeach_engineers, 49);
- SAVE_VARIABLE(kane_ID, 50);
- SAVE_VARIABLE(eva_comm_center_line_01, 51);
- SAVE_VARIABLE(eva_comm_center_line_02, 52);
- SAVE_VARIABLE(eva_comm_center_line_03, 53);
- SAVE_VARIABLE(eva_comm_center_line_04, 54);
- SAVE_VARIABLE(eva_comm_center_line_05, 55);
- SAVE_VARIABLE(billy_conv, 56);
- SAVE_VARIABLE(babushka_conv, 57);
- SAVE_VARIABLE(start_conv, 58);
- SAVE_VARIABLE(start_conv2, 59);
- SAVE_VARIABLE(kane_and_no2_conv01, 60);
- SAVE_VARIABLE(kane_and_no2_conv02, 61);
- SAVE_VARIABLE(kane_and_havoc_conv, 62);
- SAVE_VARIABLE(lockes_hon_mct_conv1, 63);
- SAVE_VARIABLE(lockes_hon_mct_conv2, 64);
- SAVE_VARIABLE(barnEvac_conv, 65);
- SAVE_VARIABLE(barnfailed_conv, 66);
- SAVE_VARIABLE(civ3_conv, 67);
- SAVE_VARIABLE(missionIntro, 68);
- SAVE_VARIABLE(endMission_conv, 69);
- SAVE_VARIABLE(unlocked_gate_conv, 70);
- SAVE_VARIABLE(turrets_conv, 71);
- SAVE_VARIABLE(players_escorts_ID, 72);
- SAVE_VARIABLE(havocs_targets_ID, 73);
- SAVE_VARIABLE(m01_hon_chinook_guys_killed, 74);
- SAVE_VARIABLE(dead_barn_guard_tally, 75);
- SAVE_VARIABLE(dead_barn_prisoner_tally, 76);
- SAVE_VARIABLE(hand_of_nod_state, 77);
- SAVE_VARIABLE(comm_center_state, 78);
- SAVE_VARIABLE(players_location, 79);
- SAVE_VARIABLE(firstNodCommanderKilled, 80);
- SAVE_VARIABLE(loveshack_conv, 81);
- SAVE_VARIABLE(loveshack_conv_playing, 82);
- SAVE_VARIABLE(priest_conv, 83);
- SAVE_VARIABLE(priest_conv_playing, 84);//
- SAVE_VARIABLE(interior_nun_conv, 85);
- SAVE_VARIABLE(interior_nun_conv_playing, 86);
- SAVE_VARIABLE(player_has_reached_grunt_level, 87);
- SAVE_VARIABLE(civs_scattered, 88);
- SAVE_VARIABLE(commcenter_sam_destroyed, 89);
- }
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- hand_of_nod_state = IDLE;
- comm_center_state = IDLE;
- players_location = LANDING_BEACH;
- is_startup = true;
- first_time_in_handofnod = true;
- first_time_in_hon_gruntlevel = true;
- first_time_in_hon_dojolevel = true;
- first_time_poking_gate_lock = true;
- players_first_time_by_commcenter = true;
- first_time_at_barn = true;
- missionStart = true;
- church_guard_is_dead = false;
- loveshack_guard_is_dead = false;
- player_has_an_escort = false;
- church_pickup_chinook_is_on_its_way = false;
- clergy_are_boarding = false;
- player_has_unlocked_pen = false;
- radar_is_scrambled = false;
- unlock_gate_objective_active = false;
- commcenter_sam_objective_active = false;
- prisoners_are_freed = false;
- m01_hon_spawned_guy_01_alive = false;
- m01_hon_spawned_guy_02_alive = false;
- m01_hon_spawned_guy_03_alive = false;
- turret_01_is_dead = false;
- turret_02_is_dead = false;
- medium_tank_spawned = false;
- barn_prisoner_01_is_dead = false;
- barn_prisoner_02_is_dead = false;
- barn_prisoner_03_is_dead = false;
- barn_objective_active = false;
- kane_and_no2_conv01_active = false;
- kane_and_no2_conv02_active = false;
- kane_and_havoc_conv_active = false;
- m01_bridgeWeather_is_Set = false;
- m01_nodBase_weather_is_Set = false;
- barn_objective_failed = false;
- barn_announcement_active = false;
- barn_objective_ended = false;
- turret_objective_over = false;
- final_conv_played = false;
- gate_objective_done = false;
- firstNodCommanderKilled = false;
- loveshack_conv_playing = false;
- priest_conv_playing = false;
- interior_nun_conv_playing = false;
- player_has_reached_grunt_level = false;
- civs_scattered = false;
- commcenter_sam_destroyed = false;
- m01_hon_chinook_guys_killed = 0;
- m01_hon_spawners_tally = 0;
- m01_hon_total_spawners_tally = 0;
- new_turretbeach_engineers = 0;
- dead_barn_guard_tally = 0;
- dead_barn_prisoner_tally = 0;
- m01_HON_SpawnRate = 14;
- players_escorts_ID = 0;
- havocs_targets_ID = 0;
- //Commands->Set_Clouds (0.25f, 0.25f, 0);
- Commands->Set_Wind (0, 0, 0, 0);
- Commands->Set_Rain (0, 0, true);
- Commands->Set_Lightning (0.25f, 0.75f, 1, 0, 0.10f, 0);
- //putting datalink updates here
- Commands->Reveal_Encyclopedia_Character ( 19 );//gdi minigunner
- Commands->Reveal_Encyclopedia_Character ( 21 );//gdi minigunner officer
- Commands->Reveal_Encyclopedia_Character ( 14 );//gdi grenadier
- Commands->Reveal_Encyclopedia_Character ( 38 );//nod minigunner
- Commands->Reveal_Encyclopedia_Character ( 18 );//Lt Maus -- whoever that is
- Commands->Reveal_Encyclopedia_Character ( 16 );//General Locke
- Commands->Reveal_Encyclopedia_Character ( 39 );//sakura
- Commands->Reveal_Encyclopedia_Character ( 13 );//hotwire
- Commands->Reveal_Encyclopedia_Character ( 15 );//patch
- Commands->Reveal_Encyclopedia_Character ( 22 );//deadeye
- Commands->Reveal_Encyclopedia_Character ( 26 );//gunner
- Commands->Reveal_Encyclopedia_Character ( 24 );//gdi rocket guy
- Commands->Reveal_Encyclopedia_Character ( 25 );//gdi rocket guy officer
- Commands->Reveal_Encyclopedia_Character ( 23 );//gdi POW
- Commands->Reveal_Encyclopedia_Weapon ( 14 );//pistol
- Commands->Reveal_Encyclopedia_Weapon ( 20 );//sniper rifle
- Commands->Reveal_Encyclopedia_Weapon ( 5 );//remote c4
- Commands->Reveal_Encyclopedia_Vehicle ( 18 );//orca
- Commands->Reveal_Encyclopedia_Vehicle ( 19 );//gdi transport helicopter
- Commands->Reveal_Encyclopedia_Building ( 4 );//gdi powerplant
- Commands->Reveal_Encyclopedia_Building ( 2 );//gdi con yard
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == CUSTOM_EVENT_SOUND_ENDED )
- {
- if (param == eva_comm_center_line_01)
- {
- eva_comm_center_line_02 = Commands->Create_Sound ( "00-N002E", Vector3 (0,0,0), obj );//please stand by
- Commands->Monitor_Sound ( obj, eva_comm_center_line_02 );
- }
- else if (param == eva_comm_center_line_02)
- {
- eva_comm_center_line_03 = Commands->Create_Sound ( "00-N026E", Vector3 (0,0,0), obj );//transmitting
- Commands->Monitor_Sound ( obj, eva_comm_center_line_03 );
- }
- else if (param == eva_comm_center_line_03)
- {
- eva_comm_center_line_04 = Commands->Create_Sound ( "00-N028E", Vector3 (0,0,0), obj );//receiving
- Commands->Monitor_Sound ( obj, eva_comm_center_line_04 );
- }
- else if (param == eva_comm_center_line_04)
- {
- eva_comm_center_line_05 = Commands->Create_Sound ( "00-N030E", Vector3 (0,0,0), obj );//data acquisition complete
- Commands->Monitor_Sound ( obj, eva_comm_center_line_05 );
- }
- else if (param == eva_comm_center_line_05)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
- player_has_unlocked_pen = true;
- }
- }
- else if (type == 0)
- {
- switch (param)
- {
- case 0://mission is over--end pass
- {
- Commands->Mission_Complete ( true );
- }
- break;
- case M01_HON_HAS_BEEN_DESTROYED_JDG://Hand of Nod has been destroyed
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_HON_OBJECTIVE_PASS_JDG, 2 );
- float pick_a_sound = Commands->Get_Random ( 0.5f, 2.5f );
- if (pick_a_sound >= 0.5 && pick_a_sound < 1.5)
- {
- Commands->Create_Sound ( "EVA_Enemy_Structure_Destroyed", Vector3 (0,0,0), obj);
- }
- else
- {
- Commands->Create_Sound ( "EVA_Nod_Structure_Destroyed", Vector3 (0,0,0), obj);
- }
- hand_of_nod_state = DESTROYED;
- Commands->Give_Points( STAR, 5000, false );
- GameObject * honCafeteriaGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_EATING_GUY_ID );
- if (honCafeteriaGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honCafeteriaGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honCafeteriaGuy02 = Commands->Find_Object ( M01_HON_CAFETERIA_WALKING_GUY_ID );
- if (honCafeteriaGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honCafeteriaGuy02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honJudoGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_JUDO_GUY_ID );
- if (honJudoGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honJudoGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDormGuy01 = Commands->Find_Object ( M01_HON_DORMROOM_MINIGUNNER_ID );
- if (honDormGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDormGuy02 = Commands->Find_Object ( M01_HON_DORMROOM_ROCKET_GUY_ID );
- if (honDormGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDormGuy03 = Commands->Find_Object ( M01_HON_DORMROOM_CHEM_GUY_ID );
- if (honDormGuy03 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy03, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDormGuy04 = Commands->Find_Object ( M01_HON_DORMROOM_FLAME_GUY_ID );
- if (honDormGuy04 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy04, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDormGuy05 = Commands->Find_Object ( M01_HON_DORMROOM_CRAPPER_ID );
- if (honDormGuy05 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy05, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDojoSensei = Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG );
- if (honDojoSensei != NULL)
- {
- Commands->Send_Custom_Event( obj, honDojoSensei, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDojoCiv01 = Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG );
- if (honDojoCiv01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDojoCiv01, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDojoCiv02 = Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG );
- if (honDojoCiv02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDojoCiv02, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * honDojoCiv03 = Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG );
- if (honDojoCiv03 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDojoCiv03, 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- if (players_location != INSIDE_HAND_OF_NOD)
- {
- if (player_has_reached_grunt_level == false)
- {
- GameObject * m01_hon_evacuator_guy01 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy01, "M01_HON_FrontDoor_Evacuator_JDG", "");
- GameObject * m01_hon_evacuator_guy02 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy02, "M01_HON_FrontDoor_Evacuator_JDG", "");
- GameObject * m01_hon_evacuator_guy03 = Commands->Trigger_Spawner( M01_HON_FRONTDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy03, "M01_HON_FrontDoor_Evacuator_JDG", "");
- GameObject * m01_hon_evacuator_guy04 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy04, "M01_HON_BackDoor_Evacuator_JDG", "");
- GameObject * m01_hon_evacuator_guy05 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy05, "M01_HON_BackDoor_Evacuator_JDG", "");
- GameObject * m01_hon_evacuator_guy06 = Commands->Trigger_Spawner( M01_HON_BACKDOOR_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_hon_evacuator_guy06, "M01_HON_BackDoor_Evacuator_JDG", "");
- }
- }
- }
- break;
- case M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG://Comm Center has been destroyed
- {
- if (players_location != INSIDE_COMM_CENTER)
- {
- GameObject * m01_commcenter_evacuator_guy01 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_commcenter_evacuator_guy01, "M01_CommCenter_Evacuator_JDG", "");
- GameObject * m01_commcenter_evacuator_guy02 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_commcenter_evacuator_guy02, "M01_CommCenter_Evacuator_JDG", "");
- GameObject * m01_commcenter_evacuator_guy03 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_commcenter_evacuator_guy03, "M01_CommCenter_Evacuator_JDG", "");
- GameObject * m01_commcenter_evacuator_guy04 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_commcenter_evacuator_guy04, "M01_CommCenter_Evacuator_JDG", "");
- GameObject * m01_commcenter_evacuator_guy05 = Commands->Trigger_Spawner( M01_COMMCENTER_DESTROYED_SPAWNER_JDG );
- Commands->Attach_Script(m01_commcenter_evacuator_guy05, "M01_CommCenter_Evacuator_JDG", "");
- }
- if (player_has_unlocked_pen == false)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
- player_has_unlocked_pen = true;
- }
- if (radar_is_scrambled == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_UNSCRAMBLE_THE_RADAR_JDG, 0 );
- }
- float pick_a_sound = Commands->Get_Random ( 0.5f, 2.5f );
- if (pick_a_sound >= 0.5 && pick_a_sound < 1.5)
- {
- Commands->Create_Sound ( "EVA_Enemy_Structure_Destroyed", Vector3 (0,0,0), obj);
- }
- else if (pick_a_sound >= 1.5 && pick_a_sound <= 2.5)
- {
- Commands->Create_Sound ( "EVA_Nod_Structure_Destroyed", Vector3 (0,0,0), obj);
- }
- comm_center_state = DESTROYED;
- }
- break;
- case M01_PLAYER_IS_INSIDE_HON_JDG://Player is inside HON--kill rain sounds
- {
- players_location = INSIDE_HAND_OF_NOD;
- GameObject * soundController = Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG );
- if (soundController != NULL)
- {
- Commands->Send_Custom_Event( obj, soundController, 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
- Commands->Send_Custom_Event( obj, soundController, 0, M01_PLAYER_IS_INSIDE_HON_JDG, 0 );
- }
- if (first_time_in_handofnod == true)
- {
- first_time_in_handofnod = false;
- Commands->Send_Custom_Event( obj, obj, 0, M01_HON_CUE_WARROOM_LEVEL_ACTORS_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_OUTSIDE_HON_JDG://Player is outside HON--restart rain sounds
- {
- players_location = BY_HAND_OF_NOD;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG://Player is inside Comm Center--kill rain sounds--start internal pagings
- {
- players_location = INSIDE_COMM_CENTER;
- GameObject * soundController = Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG );
- if (soundController != NULL)
- {
- Commands->Send_Custom_Event( obj, soundController, 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
- Commands->Send_Custom_Event( obj, soundController, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
-
- GameObject * baseCommander = Commands->Find_Object ( M01_COMMCENTER_BASE_COMMANDER_JDG );
- if (baseCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, baseCommander, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * baseScapeGoat = Commands->Find_Object ( M01_COMMCENTER_BASE_SCAPEGOAT_JDG );
- if (baseScapeGoat != NULL)
- {
- Commands->Send_Custom_Event( obj, baseScapeGoat, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * upstairsTech = Commands->Find_Object ( M01_COMMCENTER_UPSTAIRS_TECH_JDG );
- if (upstairsTech != NULL)
- {
- Commands->Send_Custom_Event( obj, upstairsTech, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * warroomTech01 = Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_01_JDG );
- if (warroomTech01 != NULL)
- {
- Commands->Send_Custom_Event( obj, warroomTech01, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * warroomTech02 = Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_02_JDG );
- if (warroomTech02 != NULL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_COMMCENTER_WAROOM_TECH_02_JDG ), 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * mainframeTech = Commands->Find_Object ( M01_COMMCENTER_COMPUTERROOM_TECH_JDG );
- if (mainframeTech != NULL)
- {
- Commands->Send_Custom_Event( obj, mainframeTech, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- GameObject * upstairsGuard = Commands->Find_Object ( M01_COMMCENTER_UPSTAIRS_GUARD_JDG );
- if (upstairsGuard != NULL)
- {
- Commands->Send_Custom_Event( obj, upstairsGuard, 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_OUTSIDE_COMM_CENTER_JDG://Player is outside Comm Center--restart rain sounds
- {
- players_location = BY_COMM_CENTER;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_INSIDE_TUNNEL_JDG://Player is inside TUNNEL leading to tailgun run--stop rain sounds
- {
- players_location = INSIDE_TUNNEL;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_OUTSIDE_TUNNEL_JDG://Player is outside TUNNEL--restart rain sounds
- {
- players_location = BY_TUNNEL;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_INSIDE_WATERFALL_JDG://Player is inside WATERFALL cave--stop rain sounds
- {
- players_location = INSIDE_WATERFALL;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_OUTSIDE_WATERFALL_JDG://Player is outside WATERFALL cave--restart rain sounds
- {
- players_location = BY_WATERFALL;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
- }
- break;
- case M01_PLAYER_IS_IN_HON_GRUNT_LEVEL_JDG://Player is entering Grunt level--cue actors
- {
- player_has_reached_grunt_level = true;
- if ((hand_of_nod_state != DESTROYED) && (first_time_in_hon_gruntlevel == true))
- {
- first_time_in_hon_gruntlevel = false;
- GameObject * honCafeteriaGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_EATING_GUY_ID );
- if (honCafeteriaGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honCafeteriaGuy01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honCafeteriaGuy02 = Commands->Find_Object ( M01_HON_CAFETERIA_WALKING_GUY_ID );
- if (honCafeteriaGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honCafeteriaGuy02, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honJudoGuy01 = Commands->Find_Object ( M01_HON_CAFETERIA_JUDO_GUY_ID );
- if (honJudoGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honJudoGuy01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honDormGuy01 = Commands->Find_Object ( M01_HON_DORMROOM_MINIGUNNER_ID );
- if (honDormGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honDormGuy02 = Commands->Find_Object ( M01_HON_DORMROOM_ROCKET_GUY_ID );
- if (honDormGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy02, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honDormGuy03 = Commands->Find_Object ( M01_HON_DORMROOM_CHEM_GUY_ID );
- if (honDormGuy03 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy03, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honDormGuy04 = Commands->Find_Object ( M01_HON_DORMROOM_FLAME_GUY_ID );
- if (honDormGuy04 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy04, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * honDormGuy05 = Commands->Find_Object ( M01_HON_DORMROOM_CRAPPER_ID );
- if (honDormGuy05 != NULL)
- {
- Commands->Send_Custom_Event( obj, honDormGuy05, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- break;
- case M01_PLAYER_IS_IN_HON_DOJO_JDG://Player is entering DOJO--cue actors
- {
- if ((hand_of_nod_state != DESTROYED) && (first_time_in_hon_dojolevel == true))
- {
- first_time_in_hon_dojolevel = false;
- if (Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_SENSEI_JDG ), 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- break;
- case M01_HON_SAMSITE_HAS_BEEN_DESTROYED_JDG://hand of nod sam site has been destroyed--duh!
- {
- //Commands->Set_Objective_Status( M01_HON_SAM_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- GameObject * handOfNod = Commands->Find_Object ( M01_HAND_OF_NOD_JDG );
- float handOfNodHealth = Commands->Get_Health ( handOfNod );
- if (handOfNodHealth > 0)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 3 );
- float delayTimer_A = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_A_JDG, delayTimer_A );
- float delayTimer_B = Commands->Get_Random ( 2, 4 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_B_JDG, delayTimer_B );
- }
- }
- break;
- case M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG://Comm Center sam site has been destroyed--duh!
- {
- commcenter_sam_destroyed = true;
- if (commcenter_sam_objective_active == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_COMM_SAM_OBJECTIVE_JDG, 0 );
- }
- if (player_has_unlocked_pen == true)
- {
- unlocked_gate_conv = Commands->Create_Conversation( "M01_Remove_Unlock_Gate_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, unlocked_gate_conv, false, false );
- Commands->Start_Conversation( unlocked_gate_conv, unlocked_gate_conv );
- Commands->Monitor_Conversation( obj, unlocked_gate_conv );
- }
- //Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 5 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_COMMCENTER_REINFORCEMENTS_JDG, 10 );
- }
- break;
- case M01_ANNOUNCE_AIRSTRIKE_JDG://EVA announces incoming airstrike
- {
- Commands->Create_Sound ( "00-N036E", Vector3 (0,0,0), obj);
- }
- break;
- case M01_ANNOUNCE_REINFORCEMENTS_JDG://EVA announces incoming reinforcements
- {
- Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
- }
- break;
- case M01_SEND_COMMCENTER_REINFORCEMENTS_JDG://Starting Elie drop off animation at Comm Center
- {
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-296.388f, 497.455f, 29.122f));
- Commands->Set_Facing(chinook_obj1, -130.00f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_CommCenter_TroopDrop.txt");
- }
- break;
- case M01_SEND_HON_REINFORCEMENTS_A_JDG://Starting Elie drop off animation at Hand of Nod
- {
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-147.1f, 558.8f, 4.4f));
- Commands->Set_Facing(chinook_obj1, -130.00f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01a.txt");
- }
- break;
- case M01_SEND_HON_REINFORCEMENTS_B_JDG://Starting Elie drop off animation at Hand of Nod
- {
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-154.679f, 519.009f, 4.97f));
- Commands->Set_Facing(chinook_obj1, 130.00f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01b.txt");
- }
- break;
- case M01_HON_CHINOOK_GUY_HAS_BEEN_KILLED_JDG://a reinforcement guy's been killed--spawn more if needed
- {
- m01_hon_chinook_guys_killed++;
- if (m01_hon_chinook_guys_killed == 3)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_REINFORCEMENTS_JDG, 3 );
- float pick_a_chinook = Commands->Get_Random ( 0.5f, 2.5f );
- if (pick_a_chinook >= 0.5 && pick_a_chinook < 1.5)
- {
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_A_JDG, delayTimer );
- }
- else
- {
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_HON_REINFORCEMENTS_B_JDG, delayTimer );
- }
- }
- }
- break;
- case M01_PLAYER_IS_APPROACHING_CHURCH_JDG://cue church actors
- {
- if (m01_bridgeWeather_is_Set == false)
- {
- m01_bridgeWeather_is_Set = true;
- //Commands->Set_Clouds (0.75f, 0.75f, 30);
- Commands->Set_Wind (60, 3.0f, 0.5f, 15);
- Commands->Set_Rain (0.75f, 30, false);
- Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
- Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
- GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
- Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
- GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
- if (chemGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
- }
- }
- int church_upadate = Commands->Create_Conversation( "M01_Add_Church_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, church_upadate, false, false );
- //Commands->Join_Conversation( STAR, church_upadate, false, false );
- Commands->Start_Conversation( church_upadate, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_CHURCH_OBJECTIVE_JDG, 8 );
- GameObject * loveshackGuard = Commands->Find_Object ( M01_CHURCH_LOVESHACK_MINIGUNNER_ID );
- if (loveshackGuard != NULL)
- {
- Commands->Send_Custom_Event( obj, loveshackGuard, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- if (loveshackNun != NULL)
- {
- Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * exteriorGuard = Commands->Find_Object ( M01_CHURCH_EXTERIOR_MINIGUNNER_ID );
- if (exteriorGuard != NULL)
- {
- Commands->Send_Custom_Event( obj, exteriorGuard, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * balconyGuard = Commands->Find_Object ( M01_CHURCH_BALCONY_MINIGUNNER_ID );
- if (balconyGuard != NULL)
- {
- Commands->Send_Custom_Event( obj, balconyGuard, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * rectoryGuard = Commands->Find_Object ( M01_CHURCH_GUARD_MINIGUNNER_ID );
- if (rectoryGuard != NULL)
- {
- Commands->Send_Custom_Event( obj, rectoryGuard, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- if (churchNun != NULL)
- {
- Commands->Send_Custom_Event( obj, churchNun, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if (churchPriest != NULL)
- {
- Commands->Send_Custom_Event( obj, churchPriest, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- break;
- case M01_ADD_CHURCH_OBJECTIVE_JDG://Loveshack guard is dead--let nun know
- {
- Commands->Add_Objective( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_05, NULL, IDS_Enc_Obj_Secondary_M01_05 );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_CHURCH_OBJECTIVE_JDG, 0 );
- }
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- if (loveshackNun != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( loveshackNun, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( loveshackNun, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- if (churchNun != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( churchNun, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( churchNun, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if (churchPriest != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( churchPriest, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( churchPriest, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- }
- break;
- case M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG://guard tower commander is destroyed--clear objective
- {
- Commands->Set_Objective_Status( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- firstNodCommanderKilled = true;
- }
- break;
- case M01_CLEAR_HON_OBJECTIVE_PASS_JDG://HON is destroyed--clear objective
- {
- Commands->Set_Objective_Status( M01_HON_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- }
- break;
- case M01_CLEAR_CHURCH_OBJECTIVE_PASS_JDG://player has rescued clergy
- {
- Commands->Set_Objective_Status( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- }
- break;
- case M01_CLEAR_CHURCH_OBJECTIVE_FAIL_JDG://player has rescued clergy
- {
- Commands->Set_Objective_Status( M01_CHURCH_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- break;
- case M01_LOVESHACK_GUARD_IS_DEAD_JDG://Loveshack guard is dead--let nun know
- {
- loveshack_guard_is_dead = true;
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- if (loveshackNun != NULL)
- {
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_LOVESHACK_GUARD_IS_DEAD_JDG, delayTimer );
- }
- if ((loveshack_guard_is_dead == true) && (church_guard_is_dead == true) && (church_pickup_chinook_is_on_its_way == false))
- {
- GameObject * churchEvacController = Commands->Find_Object ( 103394 );
- if (churchEvacController != NULL)
- {
- Commands->Send_Custom_Event( obj, churchEvacController, 0, M01_START_ACTING_JDG, 3 );//giving clearance to havoc exit zone for conversation
- }
- church_pickup_chinook_is_on_its_way = true;
- }
- }
- break;
- case M01_CHURCH_GUARD_IS_DEAD_JDG://inner guard is dead--let nuns & prist know
- {
- church_guard_is_dead = true;
- GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- if (churchNun != NULL)
- {
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, churchNun, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, delayTimer );
- }
- GameObject * churchPriest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if (churchPriest != NULL)
- {
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, churchPriest, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, delayTimer );
- }
- if ((loveshack_guard_is_dead == true) && (church_guard_is_dead == true) && (church_pickup_chinook_is_on_its_way == false))
- {
- church_pickup_chinook_is_on_its_way = true;
- GameObject * churchEvacController = Commands->Find_Object ( 103394 );
- if (churchEvacController != NULL)
- {
- Commands->Send_Custom_Event( obj, churchEvacController, 0, M01_START_ACTING_JDG, 3 );//giving clearance to havoc exit zone for conversation
- }
- }
- }
- break;
- case M01_CHURCH_CLERGY_HAS_BOARDED_JDG://when all clergy have boarded--tell chinook to take off
- {
- if (Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID ) || (Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID )) || (Commands->Find_Object ( m01_church_interior_nun02_ID )) || (Commands->Find_Object ( M01_CHURCH_PRIEST_ID )))
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 2 );
- }
- else
- {
- if ((clergy_are_boarding == false))
- {
- clergy_are_boarding = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_CHURCH_OBJECTIVE_PASS_JDG, 2 );
- }
- }
- }
- break;
- case M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG://a card carrier has been killed--drop necessary card
- {
- bool playerHasLevel01KeyCard = Commands->Has_Key( STAR, 1 );;
- bool playerHasLevel02KeyCard = Commands->Has_Key( STAR, 2 );;
- bool playerHasLevel03KeyCard = Commands->Has_Key( STAR, 3 );;
- if (playerHasLevel01KeyCard == false)
- {
- Vector3 spawn_location = Commands->Get_Position ( sender );
- spawn_location.Z = spawn_location.Z + 0.75f;
- GameObject * keycard01 = Commands->Create_Object ( "Level_01_Keycard", spawn_location );
- Commands->Attach_Script(keycard01, "M01_KeyCard01_Script_JDG", "");
- }
- else if (playerHasLevel02KeyCard == false)
- {
- Vector3 spawn_location = Commands->Get_Position ( sender );
- spawn_location.Z = spawn_location.Z + 0.75f;
- Commands->Create_Object ( "Level_02_Keycard", spawn_location );
- }
- else if (playerHasLevel03KeyCard == false)
- {
- Vector3 spawn_location = Commands->Get_Position ( sender );
- spawn_location.Z = spawn_location.Z + 0.75f;
- Commands->Create_Object ( "Level_03_Keycard", spawn_location );
- }
- else
- {
- Vector3 spawn_location = Commands->Get_Position ( sender );
- spawn_location.Z = spawn_location.Z + 0.75f;
- Commands->Create_Object ( "POW_Health_100", spawn_location );
- }
- }
- break;
- case M01_GDI_GUY_HAS_BEEN_POKED_JDG://player has poked a GDI soldier--if player is alone assign escort
- {
- int poked_guys_ID = Commands->Get_ID ( sender );
- if (player_has_an_escort == false)
- {
- Commands->Send_Custom_Event( obj, sender, 0, M01_PLEASE_START_ESCORTING_PLAYER_JDG, 0 );
- players_escorts_ID = poked_guys_ID;
- player_has_an_escort = true;
- }
- else if (player_has_an_escort == true)
- {
- if (poked_guys_ID == players_escorts_ID)//this guy is escorting player--tell him to hold position
- {
- Commands->Send_Custom_Event( obj, sender, 0, M01_PLEASE_STOP_ESCORTING_PLAYER_JDG, 0 );
- player_has_an_escort = false;
- }
- }
- }
- break;
- case M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG://player's escort has been killed--reset escort parameters
- {
- player_has_an_escort = false;
- }
- break;
- case M01_PLAYER_IS_ATTACKING_ME_JDG://if player is being escorted--tell escort who havoc's target is
- {
- if (player_has_an_escort == true)
- {
- havocs_targets_ID = Commands->Get_ID ( sender );
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), M01_PLAYER_IS_ATTACKING_ME_JDG, havocs_targets_ID, delayTimer );
- }
- }
- break;
- case M01_PLAYER_IS_LEAVING_CHURCH_01_JDG://if havoc has escort--tell them to go somewhere else
- {
- if (player_has_an_escort == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_CHURCH_01_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_LEAVING_CHURCH_02_JDG://if havoc has escort--tell them to go somewhere else
- {
- if (player_has_an_escort == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_CHURCH_02_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_LEAVING_HON_01_JDG://if havoc has escort--tell them to go somewhere else
- {
- if (player_has_an_escort == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_HON_01_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_LEAVING_HON_02_JDG://if havoc has escort--tell them to go somewhere else
- {
- if (player_has_an_escort == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( players_escorts_ID ), 0, M01_PLAYER_IS_LEAVING_HON_02_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG://havoc is crossing bridge for first time--cue driveby actors
- {
- if (m01_bridgeWeather_is_Set == false)
- {
- m01_bridgeWeather_is_Set = true;
- //Commands->Set_Clouds (0.75f, 0.75f, 30);
- Commands->Set_Wind (60, 3.0f, 0.5f, 15);
- Commands->Set_Rain (0.75f, 30, false);
- Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
- Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
- GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
- Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
- GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
- if (chemGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
- }
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, 10 );
- GameObject * churchAreaCommander = Commands->Find_Object ( M01_CHURCHAREA_NOD_COMMANDER_JDG );
- if (churchAreaCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, churchAreaCommander, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- break;
- case M01_PLAYER_IS_CROSSING_THE_BRIDGE_VIA_CAVE_JDG://havoc is crossing bridge for first time--cue actors driveby actors
- {
- if (m01_bridgeWeather_is_Set == false)
- {
- m01_bridgeWeather_is_Set = true;
- //Commands->Set_Clouds (0.75f, 0.75f, 30);
- Commands->Set_Wind (60, 3.0f, 0.5f, 15);
- Commands->Set_Rain (0.75f, 30, false);
- Commands->Set_Lightning (0.5f, 0.25f, 0.75f, 10, 0.33f, 5);
- Vector3 spawnLocation (-98.937f, 380.721f, 20.022f);
- GameObject * harvester = Commands->Create_Object ( "Nod_Harvester", spawnLocation );
- Commands->Attach_Script(harvester, "M01_HarvesterScript_New_JDG", "");
- GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
- if (chemGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, chemGuy01, 0, M01_START_ACTING_JDG, 5 );
- }
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, 10 );
- GameObject * churchAreaCommander = Commands->Find_Object ( M01_CHURCHAREA_NOD_COMMANDER_JDG );
- if (churchAreaCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, churchAreaCommander, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- break;
- case M01_SPAWN_TIB_CAVE_HELICOPTER_JDG://player is in tib cave--spawn surprise helicopter
- {
- GameObject * m01_tiberium_cave_helicopter = Commands->Create_Object ( "NOD_Apache", Vector3(-40.708f, 375.387f, 30.275f) );
- Commands->Set_Facing ( m01_tiberium_cave_helicopter, -30 );
- Commands->Attach_Script(m01_tiberium_cave_helicopter, "M01_Tiberium_Cave_Helicopter_JDG", "");
- }
- break;
- case M01_ANNOUNCE_HON_OBJECTIVE_JDG://player is approaching hand of nod--give objective
- {
- if (m01_nodBase_weather_is_Set == false)
- {
- m01_nodBase_weather_is_Set = true;
- //Commands->Set_Clouds (1.0f, 1.0f, 15);
- Commands->Set_Wind (60, 5.0f, 1.0f, 15);
- Commands->Set_Rain (1.0f, 15, false);
- Commands->Set_Lightning (0.5f, 0, 0.25f, 0, 1, 15);
- }
- int hand_of_nod_conv = Commands->Create_Conversation( "M01_Add_HON_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, hand_of_nod_conv, false, false );
- Commands->Start_Conversation( hand_of_nod_conv, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_HON_OBJECTIVE_JDG, 10 );
- }
- break;
- case M01_ADD_HON_OBJECTIVE_JDG://adding objective
- {
- Commands->Add_Objective( M01_HON_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_07, NULL, IDS_Enc_Obj_Secondary_M01_07 );
- Commands->Set_Objective_Radar_Blip( M01_HON_OBJECTIVE_JDG, Vector3 (-179.3f, 541.9f, 3.518f) );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_HON_OBJECTIVE_JDG, 0 );
- }
- }
- break;
- case M01_KILL_THE_COMM_JDG://apply damage to COMM CENTER
- {
- if (comm_center_state != DESTROYED)
- {
- Commands->Apply_Damage( Commands->Find_Object ( M01_COMM_CENTER_JDG ), 100000000, "BlamoKiller", obj );
- }
- }
- break;
- case M01_KILL_THE_HON_JDG://apply damage to HON
- {
- if (hand_of_nod_state != DESTROYED)
- {
- Commands->Apply_Damage( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ), 100000000, "BlamoKiller", obj );
- }
- }
- break;
- case M01_PLAYER_HAS_POKED_COMM_CENTER_PCT_JDG:
- {
- if (player_has_unlocked_pen == false)//player is poking PCT--play EVA messages
- {
- eva_comm_center_line_01 = Commands->Create_Sound ( "00-N000E", Vector3 (0,0,0), obj );//accessing
- Commands->Monitor_Sound ( obj, eva_comm_center_line_01 );
- //Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG, 0 );
- //player_has_unlocked_pen = true;
- }
- }
- break;
- case M01_PLAYER_HAS_POKED_PEN_GATE_JDG:
- {
- if (player_has_unlocked_pen != true)
- {
- if (first_time_poking_gate_lock == true)
- {
- first_time_poking_gate_lock = false;
- int prisoner_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, prisoner_conv, false, false );
- Commands->Start_Conversation( prisoner_conv, prisoner_conv );
- }
- else
- {
- Commands->Create_Sound ( "00-N008E", Vector3 (0,0,0), obj );//access denied
- }
- }
- else if (gate_objective_done == false)
- {
- gate_objective_done = true;
- Commands->Set_Objective_Status( M01_OPEN_THE_GATE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- Commands->Static_Anim_Phys_Goto_Last_Frame (M01_COMMCENTER_DETENTION_GATE_JDG, NULL );
-
- //Vector3 gatePosition = Commands->Get_Position ( Commands->Find_Object ( M01_COMMCENTER_DETENTION_GATE_JDG ) );
- //Vector3 gatePosition = Commands->Get_Position ( STAR );
- Vector3 gatePosition (-313.060f, 575.220f, 28.513f);
- Commands->Create_Sound ( "Gate_Down_01", gatePosition, obj );
- if (Commands->Find_Object ( M01_COMMCENTER_SAM_JDG ))
- {
- Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_IS_DOWN_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG, 0 );
- }
- else
- {
- Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
- }
- if (prisoners_are_freed == false)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_PRISONERS_PASS_JDG, 0 );
- prisoners_are_freed = true;
- }
-
- }
- }
- break;
- case M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG:
- {
- int comm_sam_conv = Commands->Create_Conversation( "M01_Add_Comm_SAM_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, comm_sam_conv, false, false );
- //Commands->Join_Conversation( STAR, comm_sam_conv, false, false );
- Commands->Start_Conversation( comm_sam_conv, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_COMM_SAM_OBJECTIVE_JDG, 6 );
- commcenter_sam_objective_active = true;
- }
- break;
- case M01_ADD_COMM_SAM_OBJECTIVE_JDG:
- {
- GameObject * commSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
- if (commSamSite != NULL)
- {
- Commands->Add_Objective( M01_COMM_SAM_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_04, NULL, IDS_Enc_Obj_Primary_M01_04 );
- Commands->Set_Objective_Radar_Blip_Object( M01_COMM_SAM_OBJECTIVE_JDG, commSamSite );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_COMM_SAM_OBJECTIVE_JDG, 0 );
- }
- }
- }
- break;
- case M01_ANNOUNCE_UNLOCK_GATE_OBJECTIVE_JDG:
- {
- int unlock_gate_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, unlock_gate_conv, false, false );
- Commands->Start_Conversation( unlock_gate_conv, 0 );
- }
- break;
- case M01_ADD_UNLOCK_GATE_OBJECTIVE_JDG:
- {
- Vector3 pogMarker (-296.505f, 521.090f, 27.090f);
- Commands->Add_Objective( M01_UNLOCK_GATE_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_02, NULL, IDS_Enc_Obj_Primary_M01_02 );
- Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_HACK, pogMarker );
- unlock_gate_objective_active = true;
- //Vector3 green (0,1,0);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_02, TEXT_COLOR_OBJECTIVE_PRIMARY );
- GameObject * invisibleCrate = Commands->Find_Object ( 107809 );
- if (invisibleCrate != NULL)
- {
- Commands->Send_Custom_Event( obj, invisibleCrate, 0, M01_COMM_SAM_OBJECTIVE_JDG, 0 );
- }
- }
- break;
- case M01_CLEAR_UNLOCK_GATE_OBJECTIVE_JDG:
- {
- if (commcenter_sam_destroyed == true)
- {
- unlocked_gate_conv = Commands->Create_Conversation( "M01_Remove_Unlock_Gate_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, unlocked_gate_conv, false, false );
- Commands->Start_Conversation( unlocked_gate_conv, unlocked_gate_conv );
- Commands->Monitor_Conversation( obj, unlocked_gate_conv );
- }
- else if (commcenter_sam_destroyed == false)//
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_COMMCENTER_SAM_OBJECTIVE_JDG, 0 );
- }
-
- if (unlock_gate_objective_active == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_UNLOCK_GATE_OBJECTIVE_JDG, 6 );
- }
- }
- break;
- case M01_PASS_UNLOCK_GATE_OBJECTIVE_JDG:
- {
- Commands->Set_Objective_Status( M01_UNLOCK_GATE_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- }
- break;
- case M01_PASS_COMM_SAM_OBJECTIVE_JDG:
- {
- Commands->Set_Objective_Status( M01_COMM_SAM_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- commcenter_sam_objective_active = false;
-
- if (prisoners_are_freed == true)
- {
- Commands->Create_Logical_Sound ( obj, M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG, Vector3 (-315.383f, 572.805f, 27.623f), 50.0f );
- Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 60 );
- }
- }
- break;
- case M01_SCRAMBLE_THE_RADAR_JDG:
- {
- if (players_first_time_by_commcenter == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103099 ), 0, M01_START_ACTING_JDG, 0 );//telling propaganda to start up
- players_first_time_by_commcenter = false;
- int radar_conv = Commands->Create_Conversation( "M01_Radar_Scrambled_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, radar_conv, false, false, false );
- Commands->Join_Conversation( NULL, radar_conv, false, false, false );
- Commands->Start_Conversation( radar_conv, radar_conv );
- }
- if ((radar_is_scrambled == false) && (comm_center_state != DESTROYED) )
- {
- radar_is_scrambled = true;
- Commands->Enable_Radar ( false );
- }
- }
- break;
- case M01_UNSCRAMBLE_THE_RADAR_JDG:
- {
- if (radar_is_scrambled == true)
- {
- Commands->Enable_Radar ( true);
- radar_is_scrambled = false;
- }
- }
- break;
- case M01_ANNOUNCE_PRISONER_OBJECTIVE_JDG:
- {
- int prisoner_conv = Commands->Create_Conversation( "M01_Add_Unlock_Gate_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, prisoner_conv, false, false );
- Commands->Start_Conversation( prisoner_conv, prisoner_conv );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_UNLOCK_GATE_OBJECTIVE_JDG, 10 );
- Commands->Set_Objective_Status( M01_PRISONER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- }
- break;
- case M01_CLEAR_PRISONERS_PASS_JDG://prisoners have been freed
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 0 );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG://see if any primary objectives are active
- {
- if ( (commcenter_sam_objective_active != true) && (prisoners_are_freed == true) )
- {
- //Commands->Set_Clouds (0, 0, 5);
- Commands->Set_Wind (0, 0, 0, 5);
- Commands->Set_Rain (0, 5, false);
- Commands->Set_Lightning (0, 0, 0, 0, 0, 5);
- if (final_conv_played == false)
- {
- final_conv_played = true;
- //GameObject * evacController01 = Commands->Find_Object ( 103380 );
- //GameObject * evacController02 = Commands->Find_Object ( 103381 );
- //if (evacController01 != NULL)
- //{
- // Commands->Send_Custom_Event( obj, evacController01, 0, M01_START_ACTING_JDG, 0 );
- //}
- //if (evacController02 != NULL)
- //{
- // Commands->Send_Custom_Event( obj, evacController02, 0, M01_START_ACTING_JDG, 0 );
- //}
- GameObject * detentionPenCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
- GameObject * detentionPenCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
- GameObject * detentionPenCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
- GameObject * detentionPenGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
- GameObject * detentionPenGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
- GameObject * detentionPenGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
- if (detentionPenCiv01 != NULL)
- {
- Commands->Destroy_Object ( detentionPenCiv01 );
- }
- if (detentionPenCiv02 != NULL)
- {
- Commands->Destroy_Object ( detentionPenCiv02 );
- }
- if (detentionPenCiv03 != NULL)
- {
- Commands->Destroy_Object ( detentionPenCiv03 );
- }
- if (detentionPenGDI01 != NULL)
- {
- Commands->Destroy_Object ( detentionPenGDI01 );
- }
- if (detentionPenGDI02 != NULL)
- {
- Commands->Destroy_Object ( detentionPenGDI02 );
- }
- if (detentionPenGDI03 != NULL)
- {
- Commands->Destroy_Object ( detentionPenGDI03 );
- }
- Vector3 newPosition (51.023f, -35.918f, 0.246f);
- Commands->Set_Position ( STAR, newPosition );
- Commands->Set_Is_Rendered( obj, false );
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller1, "Test_Cinematic", "X1Z_Finale.txt");
- Commands->Send_Custom_Event( obj, obj, 0, M01_END_MISSION_PASS_JDG, 20 );
- }
- }
- }
- break;
- case M01_END_MISSION_PASS_JDG://see if any primary objectives are active
- {
- GameObject * propagandaController = Commands->Find_Object ( 103099 );
- if (propagandaController != NULL)
- {
- Commands->Send_Custom_Event( obj, propagandaController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- Commands->Mission_Complete ( true );
-
- }
- break;
- case M01_SPAWN_WHACK_A_MOLE_GUY_JDG:
- {
- GameObject * m01_whack_a_mole_guy = Commands->Create_Object ( "Nod_MiniGunner_1Off", Vector3(-198.088f, 525.828f, 10.035f) );
- Commands->Attach_Script(m01_whack_a_mole_guy, "M01_Whack_A_Mole_Minigunner_JDG", "");
- m01_whack_a_mole_guy_ID = Commands->Get_ID ( m01_whack_a_mole_guy );
- }
- break;
- case M01_CHANGE_WHACK_A_MOLE_GUY_JDG:
- {
- GameObject * whackAmole = Commands->Find_Object ( m01_whack_a_mole_guy_ID );
- if (whackAmole != NULL)
- {
- Commands->Send_Custom_Event( obj, whackAmole, 0, M01_CHANGE_WHACK_A_MOLE_GUY_JDG, 0 );
- }
- }
- break;
- case M01_HON_SPAWNS_MINIGUNNER_JDG:
- {
- if (hand_of_nod_state != DESTROYED)
- {
- m01_HON_SpawnRate = 21;
- if (m01_hon_total_spawners_tally <= 6)
- {
- if ((m01_hon_spawned_guy_01_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
- {
- GameObject * m01_hon_spawned_guy_01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-212.6f, 541.1f, 4));
- Commands->Attach_Script(m01_hon_spawned_guy_01, "M01_HON_Easy_Spawned_Guy_01_JDG", "");
- m01_hon_spawned_guy_01_ID = Commands->Get_ID ( m01_hon_spawned_guy_01 );
- m01_hon_spawned_guy_01_alive = true;
- m01_hon_spawners_tally++;
- m01_hon_total_spawners_tally++;
- }
- else if ((m01_hon_spawned_guy_02_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
- {
- GameObject * m01_hon_spawned_guy_02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-217.2f, 540.2f, 4) );
- Commands->Attach_Script(m01_hon_spawned_guy_02, "M01_HON_Easy_Spawned_Guy_02_JDG", "");
- m01_hon_spawned_guy_02_ID = Commands->Get_ID ( m01_hon_spawned_guy_02 );
- m01_hon_spawned_guy_02_alive = true;
- m01_hon_spawners_tally++;
- m01_hon_total_spawners_tally++;
- }
- else if ((m01_hon_spawned_guy_03_alive == false) && (players_location != INSIDE_HAND_OF_NOD))
- {
- GameObject * m01_hon_spawned_guy_03 = Commands->Create_Object ( "Nod_FlameThrower_0", Vector3(-217.6f, 533.6f, 4));
- Commands->Attach_Script(m01_hon_spawned_guy_03, "M01_HON_Easy_Spawned_Guy_03_JDG", "");
- m01_hon_spawned_guy_03_ID = Commands->Get_ID ( m01_hon_spawned_guy_03 );
- m01_hon_spawned_guy_03_alive = true;
- m01_hon_spawners_tally++;
- m01_hon_total_spawners_tally++;
- }
- }
-
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNS_MINIGUNNER_JDG, m01_HON_SpawnRate );
- }
- }
- break;
- case M01_HON_SPAWNER_IN_POSITION_JDG:
- {
- if (m01_hon_spawners_tally == 3)
- {
- GameObject * honSpawn01 = Commands->Find_Object ( m01_hon_spawned_guy_01_ID );
- if (honSpawn01 != NULL)
- {
- Commands->Send_Custom_Event( obj, honSpawn01, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
- m01_hon_spawned_guy_01_alive = false;
- m01_hon_spawned_guy_01_ID = NULL;
- }
- GameObject * honSpawn02 = Commands->Find_Object ( m01_hon_spawned_guy_02_ID );
- if (honSpawn02 != NULL)
- {
- Commands->Send_Custom_Event( obj, honSpawn02, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
- m01_hon_spawned_guy_02_alive = false;
- m01_hon_spawned_guy_02_ID = NULL;
- }
- GameObject * honSpawn03 = Commands->Find_Object ( m01_hon_spawned_guy_03_ID );
- if (honSpawn03 != NULL)
- {
- Commands->Send_Custom_Event( obj, honSpawn03, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
- m01_hon_spawned_guy_03_alive = false;
- m01_hon_spawned_guy_03_ID = NULL;
- }
- m01_hon_spawners_tally = 0;
- }
- }
- break;
- case M01_HON_SPAWNER_01_IS_DEAD_JDG:
- {
- m01_hon_spawned_guy_01_alive = false;
- m01_hon_spawners_tally--;
- }
- break;
- case M01_HON_SPAWNER_02_IS_DEAD_JDG:
- {
- m01_hon_spawned_guy_02_alive = false;
- m01_hon_spawners_tally--;
- }
- break;
- case M01_HON_SPAWNER_03_IS_DEAD_JDG:
- {
- m01_hon_spawned_guy_03_alive = false;
- m01_hon_spawners_tally--;
- }
- break;
- case M01_HON_SPAWNER_IS_DEAD_JDG:
- {
- m01_hon_total_spawners_tally--;
- }
- break;
- case M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG:
- {
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- if (loveshackNun != NULL && (church_guard_is_dead != true))
- {
- if (loveshack_conv_playing == false)
- {
- loveshack_conv_playing = true;
- loveshack_conv = Commands->Create_Conversation( "M01_Locke_ChurchReminder_Conversation", 45, 1000, true);
- Commands->Join_Conversation( NULL, loveshack_conv, false, false );
- //Commands->Join_Conversation( STAR, loveshack_conv, false, false );
- Commands->Start_Conversation( loveshack_conv, loveshack_conv );
- Commands->Monitor_Conversation( obj, loveshack_conv );
- }
- }
- }
- break;
- case M01_CUE_PRIEST_CONVERSATION_JDG:
- {
- GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if (priest != NULL && (loveshack_guard_is_dead != true))
- {
- if (priest_conv_playing == false)
- {
- priest_conv_playing = true;
- priest_conv = Commands->Create_Conversation( "M01_PriestReminder_Conversation", 100, 1000, false);
- Commands->Join_Conversation( priest, priest_conv, false, true, true );
- Commands->Join_Conversation( STAR, priest_conv, false, false, false );
- Commands->Start_Conversation( priest_conv, priest_conv );
- Commands->Monitor_Conversation( obj, priest_conv );
- }
- }
- }
- break;
- case M01_CUE_INTERIOR_NUN_CONVERSATION_JDG:
- {
- GameObject * interiorNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- if (interiorNun != NULL && (loveshack_guard_is_dead != true))
- {
- if (interior_nun_conv_playing == false)
- {
- interior_nun_conv_playing = true;
- interior_nun_conv = Commands->Create_Conversation( "M01_Interior_Nun_Conversation", 100, 1000, false);
- Commands->Join_Conversation( interiorNun, interior_nun_conv, false, true, true );
- Commands->Join_Conversation( STAR, interior_nun_conv, false, false, false);
- Commands->Start_Conversation( interior_nun_conv, interior_nun_conv);
- Commands->Monitor_Conversation( obj, interior_nun_conv );
- }
- }
- }
- break;
- case M01_TURRET_HAS_BEEN_DESTROYED_JDG:
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 == NULL)
- {
- turret_01_is_dead = true;
- }
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 == NULL)
- {
- turret_02_is_dead = true;
- }
- if ((turret_01_is_dead == true) && (turret_02_is_dead == true) )
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_END_TURRETS_OBJECTIVE_PASS_JDG, 0 );
- }
- }
- break;
- case M01_SPAWN_THE_MEDIUM_TANK_JDG:
- {
- if (medium_tank_spawned == false)
- {
- //Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
- medium_tank_spawned = true;
-
- //GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-85.808f, 125.455f, 3.927f));
- //Commands->Set_Facing ( controller1, 180 );
- //Commands->Attach_Script(controller1, "Test_Cinematic", "X1I_GDI_Drop_MediumTank.txt");
- //GameObject *controller2 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- //Commands->Attach_Script(controller2, "Test_Cinematic", "X1D_Hover_MTank.txt");
- }
- }
- break;
- case M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG:
- {
- GameObject * barnCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
- if (barnCommander != NULL )
- {
- Commands->Add_Objective( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_01, NULL, IDS_Enc_Obj_Secondary_M01_01 );
- Commands->Set_Obj_Radar_Blip_Shape ( barnCommander, RADAR_BLIP_SHAPE_OBJECTIVE ); // Set to -1 to reset default
- Commands->Set_Obj_Radar_Blip_Color ( barnCommander, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, 0 );
- }
- if (firstNodCommanderKilled == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG, 3 );
- }
- }
- }
- break;
- case M01_PLAYER_APPROACHING_BARN_AREA_JDG:
- {
- if (first_time_at_barn == true)
- {
- first_time_at_barn = false;
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- Commands->Send_Custom_Event( obj, turret01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- Commands->Send_Custom_Event( obj, turret02, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * turretGunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (turretGunboat != NULL)
- {
- Commands->Send_Custom_Event( obj, turretGunboat, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * turretEngineer = Commands->Find_Object ( M01_TURRETBEACH_ENGINEER_ID );
- if (turretEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_START_ACTING_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_TURRETS_OBJECTIVE_JDG, 0 );
- GameObject * barnAreaCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_02_JDG );
- if (barnAreaCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, barnAreaCommander, 0, M01_START_ACTING_JDG, 5 );
- }
- //Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CHINOOK_JDG, 30 );
- //Setting new weather values for barn area
- //Commands->Set_Clouds (0.5f, 0.5f, 120);
- Commands->Set_Wind (60, 1.0f, 0.5f, 120);
- Commands->Set_Rain (0.5f, 120, false);
- }
- }
- break;
- case M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG:
- {
- GameObject * tailgunCommander = Commands->Find_Object ( M01_TAILGUNAREA_NOD_COMMANDER_JDG);
- if (tailgunCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, tailgunCommander, 0, M01_START_ACTING_JDG, 8 );
- }
- GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID);
- if (artilleryController != NULL)
- {
- Commands->Send_Custom_Event( obj, artilleryController, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG);
- if (lightTank != NULL)
- {
- Commands->Send_Custom_Event( obj, lightTank, 0, M01_START_ACTING_JDG, 0 );
- }
-
- }
- break;
- case M01_PLAYER_APPROACHING_GDI_BASE_AREA_JDG:
- {
- GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID);
- if (artilleryController != NULL)
- {
- Commands->Send_Custom_Event( obj, artilleryController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- break;
- case M01_ANNOUNCE_TURRETS_OBJECTIVE_JDG:
- {
- turrets_conv = Commands->Create_Conversation( "M01_Add_Turrets_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, turrets_conv, false, false );
- Commands->Join_Conversation( NULL, turrets_conv, false, false );
- Commands->Start_Conversation( turrets_conv, turrets_conv );
- Commands->Monitor_Conversation( obj, turrets_conv );
- }
- break;
- case M01_ADD_TURRETS_OBJECTIVE_JDG:
- {
- Commands->Add_Objective( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_02, NULL, IDS_Enc_Obj_Secondary_M01_02 );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, 0 );
- }
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( turret01, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( turret01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( turret02, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( turret02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- int c4_conv = Commands->Create_Conversation( "M01_Locke_Sending_C4_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, c4_conv, false, false );
- Commands->Start_Conversation( c4_conv, c4_conv );
- Vector3 airdropPosition (-82.786f, 113.665f, 2.221f);
- GameObject *controller = Commands->Create_Object("Invisible_Object", airdropPosition);
- Commands->Attach_Script(controller, "Test_Cinematic", "X1D_GTower_FlareDrop.txt");
- }
- break;
- case M01_END_TURRETS_OBJECTIVE_FAIL_JDG:
- {
- if (turret_objective_over == false)
- {
- turret_objective_over = true;
- Commands->Set_Objective_Status( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- }
- break;
- case M01_END_TURRETS_OBJECTIVE_PASS_JDG:
- {
- if (turret_objective_over == false)
- {
- turret_objective_over = true;
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (gunboat != NULL)
- {
- Commands->Send_Custom_Event( obj, gunboat, 0, M01_END_TURRETS_OBJECTIVE_PASS_JDG, 0 );
- int turrets_conv_02 = Commands->Create_Conversation( "M01_Remove_Turrets_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, turrets_conv_02, false, false );
- Commands->Start_Conversation( turrets_conv_02, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_TURRETS_OBJECTIVE_JDG, 5 );
- }
- else
- {
- //turrets_hummVee_conv = Commands->Create_Conversation( "M01_Locke_GiveHummVee_Conversation", 100, 1000, false);
- //Commands->Join_Conversation( NULL, turrets_hummVee_conv, false, false );
- //Commands->Join_Conversation( STAR, turrets_hummVee_conv, false, false );
- //Commands->Start_Conversation( turrets_hummVee_conv, turrets_hummVee_conv );
- //Commands->Monitor_Conversation( obj, turrets_hummVee_conv );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PASS_TURRETS_OBJECTIVE_JDG, 5 );
- }
- }
- }
- break;
- case M01_PASS_TURRETS_OBJECTIVE_JDG:
- {
- Commands->Set_Objective_Status( M01_TURRETS_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_THE_MEDIUM_TANK_JDG, 0 );
- }
- break;
- /*case M01_START_BARN_OBJECTIVE_JDG:
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_ANNOUNCE_BARN_OBJECTIVE_JDG, 0 );
- }
- break;
- case M01_ANNOUNCE_BARN_OBJECTIVE_JDG:
- {
- if (barn_announcement_active == false)
- {
- int barn_conv = Commands->Create_Conversation( "M01_Add_Barn_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, barn_conv, false, false );
- Commands->Join_Conversation( STAR, barn_conv, false, false );
- Commands->Start_Conversation( barn_conv, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_BARN_OBJECTIVE_JDG, 6 );
- barn_announcement_active = true;
- GameObject * barnObjectiveZone = Commands->Find_Object ( M01_BARN_OBJECTIVE_ZONE_ID );
- if (barnObjectiveZone != NULL)
- {
- Commands->Destroy_Object ( barnObjectiveZone );
- }
- }
- }
- break;*/
- /*case M01_ADD_BARN_OBJECTIVE_JDG:
- {
- if (barn_objective_active == false)
- {
- barn_objective_active = true;
- Commands->Add_Objective( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_03, NULL, IDS_Enc_Obj_Secondary_M01_03 );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_BARN_OBJECTIVE_JDG, 0 );
- }
- GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- if (barnPrisoner01 != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner01, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- if (barnPrisoner02 != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner02, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if (barnPrisoner03 != NULL)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner03, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner03, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- }
- }
- }
- break;*/
- case M01_END_BARN_OBJECTIVE_JDG:
- {
- if (barn_objective_failed != true && civs_scattered == false)
- {
- civs_scattered = true;
- //Commands->Send_Custom_Event( obj, obj, 0, M01_CHANGE_BARN_OBJECTIVE_JDG, 5 );
-
- GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- if (barnPrisoner01 != NULL)
- {
- //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner01, RADAR_BLIP_SHAPE_OBJECTIVE );
- //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner01, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- if (barnPrisoner02 != NULL)
- {
- //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner02, RADAR_BLIP_SHAPE_OBJECTIVE );
- //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner02, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- Commands->Send_Custom_Event( obj, barnPrisoner02, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if (barnPrisoner03 != NULL)
- {
- //Commands->Set_Obj_Radar_Blip_Shape ( barnPrisoner03, RADAR_BLIP_SHAPE_OBJECTIVE );
- //Commands->Set_Obj_Radar_Blip_Color ( barnPrisoner03, RADAR_BLIP_COLOR_SECONDARY_OBJECTIVE );
- Commands->Send_Custom_Event( obj, barnPrisoner03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- break;
- /*case M01_CHANGE_BARN_OBJECTIVE_JDG:
- {
- if (barn_objective_failed != true)
- {
- int roundupcivs_conv = Commands->Create_Conversation( "M01_Add_Barn_Roundup_Objective", 100, 1000, false);
- Commands->Join_Conversation( NULL, roundupcivs_conv, false, false );
- Commands->Start_Conversation( roundupcivs_conv, roundupcivs_conv );
- Commands->Set_Objective_Status( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- Commands->Add_Objective( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_04, NULL, IDS_Enc_Obj_Secondary_M01_04 );
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_BARN_ROUNDUP_OBJECTIVE_JGD, 0 );
- }
- }
- }
- break;*/
- case M01_END_BARN_ROUNDUP_OBJECTIVE_JDG:
- {
- if (barn_objective_ended == false)
- {
- barn_objective_ended = true;
- /*if (barn_objective_failed == true)
- {
- Commands->Set_Objective_Status( M01_BARN_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- Commands->Set_Objective_Status( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_STATUS_FAILED );
- barnfailed_conv = Commands->Create_Conversation( "M01_Locke_3CivsDead_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, barnfailed_conv, false, false );
- Commands->Join_Conversation( STAR, barnfailed_conv, false, false );
- Commands->Start_Conversation( barnfailed_conv, barnfailed_conv );
- Commands->Monitor_Conversation( obj, barnfailed_conv );
- }*/
- if (barn_objective_failed != true)
- {
- //Commands->Set_Objective_Status( M01_BARN_ROUNDUP_OBJECTIVE_JGD, OBJECTIVE_STATUS_ACCOMPLISHED );
- //barnfailed_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
- //Commands->Join_Conversation( NULL, barnfailed_conv, false, false );
- //Commands->Start_Conversation( barnfailed_conv, barnfailed_conv );
- //Commands->Monitor_Conversation( obj, barnfailed_conv );
- }
- }
- }
- break;
- case M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG:
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if ( (turret01 != NULL) || (turret02 != NULL) )
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-93.689f, 52.850f, -1.95f));
- Commands->Set_Facing(chinook_obj1, 60.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_Nod_TurretBeach_TroopDrop.txt");
- }
- }
- break;
- case M01_CUE_BILLYS_CONVERSATION_JDG:
- {
- GameObject * barnPrisoner02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- if ( barnPrisoner02 != NULL && barn_prisoner_02_is_dead != true) //this is billy
- {
- billy_conv = Commands->Create_Conversation( "M01_Billys_Conversation", 100, 1000, true);
- Commands->Join_Conversation( barnPrisoner02, billy_conv, true, true );
- Commands->Join_Conversation( STAR, billy_conv, false, true, true );
- Commands->Join_Conversation( NULL, billy_conv, false, false );
- Commands->Start_Conversation( billy_conv, billy_conv );
- Commands->Monitor_Conversation( obj, billy_conv );
- }
- }
- break;
- case M01_CUE_BABUSHKA_CONVERSATION_JDG:
- {
- GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- GameObject * barnPrisoner03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if ( barnPrisoner01 != NULL && barn_prisoner_01_is_dead != true) //this is babushka
- {
- babushka_conv = Commands->Create_Conversation( "M01_Barn_Babushka_Conversation", 100, 1000, true);
- Commands->Join_Conversation( barnPrisoner01, babushka_conv, true, true, true );
- Commands->Join_Conversation( STAR, babushka_conv, false, false, false );
- Commands->Join_Conversation( NULL, babushka_conv, false, false, false );
- Commands->Start_Conversation( babushka_conv, babushka_conv );
- Commands->Monitor_Conversation( obj, babushka_conv );
- Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
- if ( barnPrisoner03 != NULL && barn_prisoner_03_is_dead != true) //this is babushka
- {
- Commands->Send_Custom_Event( obj, barnPrisoner03, 0, M01_MODIFY_YOUR_ACTION_11_JDG, 0 );
- }
- }
- else if ( barnPrisoner03 != NULL && barn_prisoner_03_is_dead != true) //this is babushka
- {
- civ3_conv = Commands->Create_Conversation( "M01_Civ03_Conversation", 100, 1000, true);
- Commands->Join_Conversation( barnPrisoner03, civ3_conv, true, true, true );
- Commands->Join_Conversation( STAR, civ3_conv, false, false, false );
- Commands->Join_Conversation( NULL, civ3_conv, false, true, true );
- Commands->Start_Conversation( civ3_conv, civ3_conv );
- Commands->Monitor_Conversation( obj, civ3_conv );
- }
-
- }
- break;
- case M01_BARN_GUARD_IS_DEAD_JDG:
- {
- dead_barn_guard_tally++;
- if (dead_barn_guard_tally >= 4)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_END_BARN_OBJECTIVE_JDG, 0 );
- }
- }
- break;
- case M01_CIVILIAN_KILLED_JDG:
- {
- /*if (sender == Commands->Find_Object ( M01_BARN_PRISONER_01_ID ))//this is babushka
- {
- barn_prisoner_01_is_dead = true;
- dead_barn_prisoner_tally++;
- }
- else if (sender == Commands->Find_Object ( M01_BARN_PRISONER_02_ID ))//this is billy
- {
- barn_prisoner_02_is_dead = true;
- dead_barn_prisoner_tally++;
- }
- else if (sender == Commands->Find_Object ( M01_BARN_PRISONER_03_ID ))//this is pierre
- {
- barn_prisoner_03_is_dead = true;
- dead_barn_prisoner_tally++;
- }
- if (dead_barn_prisoner_tally > 2)
- {
- barn_objective_failed = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_END_BARN_ROUNDUP_OBJECTIVE_JDG, 0 );
- }*/
- }
- break;
- case M01_KILL_THE_GDI_POWER_PLANT_JDG:
- {
- Commands->Debug_Message ( "***************************Starting the GDI base encounter\n" );
- if (missionStart == true)
- {
- missionStart = false;
-
- }
- //GameObject * crashed_orca = Commands->Find_Object ( 103121 );
- //if (crashed_orca != NULL)
- //{
- // Commands->Send_Custom_Event( obj, crashed_orca, 0, M01_START_ACTING_JDG, 0 );
- //}
- }
- break;
- case M01_DO_DAMAGE_CHECK_JDG://a building has been damaged--take appropriate action
- {
- if (sender == Commands->Find_Object(M01_HAND_OF_NOD_JDG))//hand of nod under attack--refinery okay--send engineer
- {
- GameObject * honEngineer = Commands->Find_Object ( M01_HON_REPAIR_ENGINEER_ID );
- if (honEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, honEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- else if (sender == Commands->Find_Object(M01_COMM_CENTER_JDG))
- {
- GameObject * commEngineer = Commands->Find_Object ( M01_COMM_CENTER_ENGINEER_ID );
- if (commEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, commEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- break;
- case M01_CUE_KANE_AND_NUMBER2_CONVERSATION_JDG://player is in comm center--cue kane encounter
- {
- GameObject * holograph = Commands->Find_Object ( 157978 );
- if (holograph != NULL)
- {
- GameObject * kane = Commands->Create_Object_At_Bone ( holograph, "Nod_Kane_HologramHead", "KANEBONE" );
- Commands->Attach_To_Object_Bone( kane, holograph, "KANEBONE" );
- Commands->Set_Loiters_Allowed( kane, false );
- kane_ID = Commands->Get_ID ( kane );
- GameObject * commBaseCommander = Commands->Find_Object ( M01_COMMCENTER_BASE_COMMANDER_JDG );
- if (commBaseCommander != NULL)
- {
- kane_and_no2_conv01_active = true;
- kane_and_no2_conv01 = Commands->Create_Conversation( "M01_Kane_and_Number02_Conversation_01", 100, 1000, true);
- Commands->Join_Conversation( kane, kane_and_no2_conv01, false, true );
- Commands->Join_Conversation( commBaseCommander, kane_and_no2_conv01, false, true );
- Commands->Start_Conversation( kane_and_no2_conv01, kane_and_no2_conv01 );
- }
- }
- }
- break;
- case M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG://player is in comm center war room--cue kane encounter
- {
- if (kane_and_no2_conv01_active == true)
- {
- }
- else if (kane_and_no2_conv02_active == true)
- {
- }
- if (kane_and_havoc_conv_active == false)
- {
- GameObject * kane = Commands->Find_Object ( kane_ID );
- if (kane != NULL)
- {
- kane_and_havoc_conv_active = true;
- kane_and_havoc_conv = Commands->Create_Conversation( "M01_Kane_and_Havoc_Conversation", 100, 1000, false);
- Commands->Join_Conversation( kane, kane_and_havoc_conv, false, true );
- Commands->Join_Conversation( STAR, kane_and_havoc_conv, false, false );
- Commands->Start_Conversation( kane_and_havoc_conv, kane_and_havoc_conv );
-
- Commands->Monitor_Conversation( obj, kane_and_havoc_conv );
- }
-
- }
- }
- break;
- case M01_SEND_BARN_CHINOOK_JDG://havoc is in barn area--send reinforcements
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-87.561f, 114.225f, 1.874f));
- Commands->Set_Facing(chinook_obj1, 0.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
- }
- break;
- case M01_SEND_GUARD_TOWER_CHINOOK_JDG://havoc is at GDI guard tower
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(12.703f, 84.163f, 1.898f));
- Commands->Set_Facing(chinook_obj1, -130.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
- }
- break;
- case M01_SEND_TAILGUN_CHINOOK_JDG://havoc is in tailgun area--send reinforcementsM01_SEND_CHURCH_CHINOOK_JDG
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-7.831f, 292.034f, 2.665f));
- Commands->Set_Facing(chinook_obj1, 0.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook01.txt");
- }
- break;
- case M01_SEND_CHURCH_CHINOOK_JDG://havoc is in church area--send reinforcements
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-91.898f, 424.178f, 20.761f));
- Commands->Set_Facing(chinook_obj1, 0.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_EasyNodChinook.txt");
- }
- break;
- case M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG://havoc has found one of the barn civs--send in the chinook
- {
- GameObject * barnEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (barnEvacController != NULL)
- {
- Commands->Send_Custom_Event( obj, barnEvacController, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- }
- break;
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- switch (complete_reason)
- {
- case ACTION_COMPLETE_CONVERSATION_ENDED:
- {
- if (action_id == billy_conv)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- else if (action_id == babushka_conv)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- GameObject * barnPrisoner01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- if ( barnPrisoner01 != NULL && barn_prisoner_01_is_dead != true) //this is babushka
- {
- Commands->Send_Custom_Event( obj, barnPrisoner01, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
- }//int
- }
- else if (action_id == civ3_conv)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- else if (action_id == turrets_conv)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_ADD_TURRETS_OBJECTIVE_JDG, 0 );
- }
- //else if (action_id == turrets_hummVee_conv) //send in the humm vee
- //{
- //GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-96.744f, 138.498f, 1));
- //Commands->Set_Facing(chinook_obj1, 60.0f);
- //Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "XG_M01_HumveeDrop.txt");
- //}
- else if (action_id == barnfailed_conv)
- {
- //int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
- //Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
- //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
- //Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
- }
- else if (action_id == kane_and_no2_conv01)
- {
- kane_and_no2_conv01_active = false;
- GameObject * securityCamera = Commands->Find_Object ( M01_COMMCENTER_CEILING_CAMERA_JDG);
- if (securityCamera != NULL)
- {
- Commands->Send_Custom_Event( obj, securityCamera, 0, M01_START_ATTACKING_01_JDG, 0 );
- }
- }
- else if (action_id == kane_and_no2_conv02)
- {
- kane_and_no2_conv02_active = false;
- }
- else if (action_id == kane_and_havoc_conv)
- {
-
- GameObject * kane = Commands->Find_Object ( kane_ID);
- if (kane != NULL)
- {
- Commands->Destroy_Object ( kane );
- }
- }
- else if (action_id == unlocked_gate_conv) //
- {
- Vector3 radarMarker (-310.727f, 571.824f, 28.484f);
- Commands->Add_Objective( M01_OPEN_THE_GATE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_03, NULL, IDS_Enc_Obj_Primary_M01_03 );
- Commands->Set_Objective_Radar_Blip( M01_OPEN_THE_GATE_JDG, radarMarker );
- Commands->Set_Objective_HUD_Info_Position( M01_OPEN_THE_GATE_JDG, 95, "POG_M01_1_03.tga", IDS_POG_OPEN, radarMarker );
- //Vector3 green (0,1,0);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_03, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (action_id == endMission_conv)
- {
- Commands->Create_2D_Sound ( "00-N048E" );//eva primary accomplished
- Commands->Send_Custom_Event( obj, obj, 0, M01_END_MISSION_PASS_JDG, 3 );
- }
- else if (action_id == loveshack_conv)
- {
- loveshack_conv_playing = false;
- }
- else if (action_id == priest_conv)
- {
- priest_conv_playing = false;
- }
- else if (action_id == interior_nun_conv)
- {
- interior_nun_conv_playing = false;
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Medlab_DropOff_Guy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Enable_Hibernation( obj, false );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.H_A_TroopDrop") == 0)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- params.WaypathID = 125265;
- Commands->Action_Goto(obj, params);
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Destroy_Object ( obj );
- }
- else
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- params.WaypathID = 125265;
- Commands->Action_Goto(obj, params);
- }
- }
- };
- DECLARE_SCRIPT(M01_Hand_of_Nod_Building_Script_JDG, "")
- {
- int memorial_sound;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(memorial_sound, 1);
- }
- void Created( GameObject * obj )
- {
- Vector3 memorialSpot (-195.053f, 533.737f, 10.953f);
- memorial_sound = Commands->Create_Sound ( "m01eval_dsgn0254r1ncxk_snd", memorialSpot, obj );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Stop_Sound ( memorial_sound, true );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103371 ), 0, M01_HON_HAS_BEEN_DESTROYED_JDG, 0 );//this is the final escort zone
- Commands->Create_Object ( "POW_Medal_Armor", Vector3 (-180.312f, 541.400f, 3.518f) );
- Commands->Create_Object ( "POW_Medal_Health", Vector3 (-178.349f, 541.471f, 3.518f) );
-
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj )
- {
- GameObject * myEngineer = Commands->Find_Object ( M01_HON_REPAIR_ENGINEER_ID );
- if (myEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_DAMAGE_CHECK_JDG, 0 );
- if (damager == myEngineer)
- {
- float MyMaxHealth = Commands->Get_Max_Health ( obj );
- float MyMaxShield = Commands->Get_Max_Shield_Strength ( obj );
- Commands->Set_Health ( obj, MyMaxHealth );
- Commands->Set_Shield_Strength ( obj, MyMaxShield );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Flyover_Generic_Script_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Enable_Hibernation( obj, false );
- Commands->Enable_Cinematic_Freeze( obj, false );
- float MyMaxHealth = Commands->Get_Max_Health ( obj );
- float fudgeFactor = Commands->Get_Random ( .05f, 1.0f);
- float myNewHealth = MyMaxHealth * fudgeFactor;
- float MyMaxShield = Commands->Get_Max_Shield_Strength ( obj );
- float fudgeFactor2 = Commands->Get_Random ( .05f, 1.0f);
- float myNewShield = MyMaxShield * fudgeFactor2;
- Commands->Set_Health ( obj, myNewHealth );
- Commands->Set_Shield_Strength ( obj, myNewShield );
- }
- };
- DECLARE_SCRIPT(M01_Ambient_Sound_Controller_JDG, "")
- {
- enum
- {
- play_destroyed_building_sound = 101,
- pick_refinery_sound,
- play_refinery_klaxon,
- play_refinery_sound,
- pick_commcenter_sound,
- play_commcenter_klaxon,
- play_commcenter_sound,
- };
- typedef enum {
- ACTIVE,
- DESTROYED,
- } M01_Building_State;
- typedef enum {
- INSIDE_GDI_CON,
- INSIDE_GDI_POWERPLANT,
- INSIDE_HAND_OF_NOD,
- INSIDE_REFINERY,
- INSIDE_COMM_CENTER,
- OUTSIDE,
- } M01_Location;
- M01_Building_State hand_of_nod_state, comm_center_state;
- M01_Location players_location;
- int building_sound;
- int destroyed_building_sound;
- int klaxon;
- int sound;
- bool outside_ambients_playing;
- bool building_ambients_playing;
- bool destroyed_building_ambients_playing;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hand_of_nod_state, 1);
- SAVE_VARIABLE(comm_center_state, 2);
- SAVE_VARIABLE(players_location, 3);
- SAVE_VARIABLE(building_sound, 4);
- SAVE_VARIABLE(destroyed_building_sound, 5);
- SAVE_VARIABLE(klaxon, 6);
- SAVE_VARIABLE(sound, 7);
- SAVE_VARIABLE(outside_ambients_playing, 8);
- SAVE_VARIABLE(building_ambients_playing, 9);
- SAVE_VARIABLE(destroyed_building_ambients_playing, 10);
- }
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- hand_of_nod_state = ACTIVE;
- comm_center_state = ACTIVE;
- klaxon = 0;
- sound = 0;
- outside_ambients_playing = false;
- building_ambients_playing = false;
- destroyed_building_ambients_playing = false;
- players_location = OUTSIDE;
- Commands->Send_Custom_Event( obj, obj, 0, M01_TURN_ON_OUTSIDE_AMBIENTS_JDG, 0 );
-
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ((param == M01_TURN_ON_OUTSIDE_AMBIENTS_JDG) && (outside_ambients_playing == false))
- {
- players_location = OUTSIDE;
- outside_ambients_playing = true;
- if (building_ambients_playing == true /*&& building_sound != NULL*/)
- {
- Commands->Stop_Sound ( building_sound, true );
- }
- building_ambients_playing = false;
- destroyed_building_ambients_playing = false;
- }
- else if ((param == M01_TURN_OFF_OUTSIDE_AMBIENTS_JDG) && (outside_ambients_playing == true))
- {
- outside_ambients_playing = false;
- }
- else if ((param == M01_HON_HAS_BEEN_DESTROYED_JDG))//Hand of Nod has been destroyed
- {
- hand_of_nod_state = DESTROYED;
- }
- else if ((param == M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG))//Comm Center has been destroyed
- {
- comm_center_state = DESTROYED;
- }
- else if (param == M01_PLAYER_IS_INSIDE_GDI_CON_JDG)
- {
- players_location = INSIDE_GDI_CON;
- }
- else if (param == M01_PLAYER_IS_INSIDE_GDI_POWERPLANT_JDG)
- {
- players_location = INSIDE_GDI_POWERPLANT;
- }
- else if (param == M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG)
- {
- players_location = INSIDE_COMM_CENTER;
- if ((comm_center_state == ACTIVE) && (building_ambients_playing != true) )
- {
- Commands->Debug_Message ( "**********************turning on active Comm Center ambient noise\n" );
- building_sound = Commands->Create_Sound ("CC_Ambient_M01", Vector3 (0,0,0), obj );
- building_ambients_playing = true;
- float delayTimer = Commands->Get_Random ( 5, 10 );
- Commands->Send_Custom_Event( obj, obj, 0, pick_commcenter_sound, delayTimer );
- }
- }
- else if (param == M01_PLAYER_IS_INSIDE_HON_JDG)
- {
- players_location = INSIDE_HAND_OF_NOD;
- if ((hand_of_nod_state == ACTIVE) && (building_ambients_playing != true) )
- {
- building_ambients_playing = true;
- }
- }
- else if ((param == play_commcenter_klaxon) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
- {
- char *klaxonNames[2] = {
- "Klaxon Warning",
- "Klaxon Info"
- };
- char *klaxonName = klaxonNames[klaxon];
- GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
- if ( star != NULL )
- {
- Vector3 playerPosition = Commands->Get_Position ( star );
- float x_factor = Commands->Get_Random(-5,5);
- float y_factor = Commands->Get_Random(-5,5);
- playerPosition.X += x_factor;
- playerPosition.Y += y_factor;
- playerPosition.Z += 3;
- Commands->Create_Sound ( klaxonName, playerPosition, obj );
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 1.5 );
- }
- }
- else if ((param == play_commcenter_sound) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
- {
- char *sounds[15] = {
- "01-I022E",
- "01-I028E",
- "01-I030E",
- "01-I032E",
- "01-I034E",
- "01-I036E",
- "01-I038E",
- "01-I040E",
- "01-I042E",
- "01-I044E",
- "01-I046E",
- "01-I048E",
- "01-I050E",
- "01-I062E",
- "01-I066E"
- };
- char *soundName = sounds[sound];
- GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
- if ( star != NULL )
- {
- Vector3 playerPosition = Commands->Get_Position ( star );
- float x_factor = Commands->Get_Random(-5,5);
- float y_factor = Commands->Get_Random(-5,5);
- playerPosition.X += x_factor;
- playerPosition.Y += y_factor;
- playerPosition.Z += 3;
- Commands->Create_Sound ( soundName, playerPosition, obj );
- float delayTimer = Commands->Get_Random ( 10, 25 );
- Commands->Send_Custom_Event( obj, obj, 0, pick_commcenter_sound, delayTimer );
- }
- }
- else if ((param == pick_commcenter_sound) && (players_location == INSIDE_COMM_CENTER) && (comm_center_state != DESTROYED))
- {
- float lineNumber = Commands->Get_Random ( 0.5f, 15.5f);
- if ((lineNumber >= 0.5) && (lineNumber < 1.5))
- {
- sound = 0;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 1.5) && (lineNumber < 2.5))
- {
- sound = 1;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 2.5) && (lineNumber < 3.5))
- {
- sound = 2;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 3.5) && (lineNumber < 4.5))
- {
- klaxon = 1;
- sound = 3;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 4.5) && (lineNumber < 5.5))
- {
- sound = 4;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 5.5) && (lineNumber < 6.5))
- {
- klaxon = 1;
- sound = 5;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 6.5) && (lineNumber < 7.5))
- {
- klaxon = 1;
- sound = 6;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 7.5) && (lineNumber < 8.5))
- {
- klaxon = 0;
- sound = 7;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 8.5) && (lineNumber < 9.5))
- {
- sound = 8;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 9.5) && (lineNumber < 10.5))
- {
- klaxon = 0;
- sound = 9;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 10.5) && (lineNumber < 11.5))
- {
- klaxon = 0;
- sound = 10;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 11.5) && (lineNumber < 12.5))
- {
- klaxon = 1;
- sound = 11;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_klaxon, 0 );
- }
- else if ((lineNumber >= 12.5) && (lineNumber < 13.5))
- {
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else if ((lineNumber >= 13.5) && (lineNumber < 14.5))
- {
- sound = 13;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- else
- {
- sound = 14;
- Commands->Send_Custom_Event( obj, obj, 0, play_commcenter_sound, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Entering_Church_Area_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_CHURCH_JDG, 0 );
- if (Commands->Find_Object ( 100801 ))//these are the three zones leading to the church--clean them up
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100801 ) );
- }
- if (Commands->Find_Object ( 100802 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100802 ) );
- }
- if (Commands->Find_Object ( 100803 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100803 ) );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Hand_Of_Nod_Interior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_HON_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Hand_Of_Nod_Exterior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_HON_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Center_Interior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Center_Exterior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_COMM_CENTER_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Tunnel_Interior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_TUNNEL_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Tunnel_Exterior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_TUNNEL_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Waterfall_Interior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_INSIDE_WATERFALL_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Waterfall_Exterior_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_OUTSIDE_WATERFALL_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_is_Leaving_GDI_Base_Zone, "")
- {
- bool firstEntry;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(firstEntry, 1);
- }
- void Created( GameObject * obj )
- {
- firstEntry = true;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (firstEntry == true)
- {
- firstEntry = false;
- GameObject * barnSpawnerController = Commands->Find_Object (M01_GDIBASE_SPAWNER_CONTROLLER_JDG);
- if (barnSpawnerController != NULL)
- {
- Commands->Send_Custom_Event( obj, barnSpawnerController, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_APPROACHING_BARN_AREA_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_is_Entering_GDI_Base_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_APPROACHING_GDI_BASE_AREA_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Lose_Any_Church_Escorts_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_CHURCH_01_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Lose_Any_Church_Escorts_Zone_02, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_CHURCH_02_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Lose_Any_HON_Escorts_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_HON_01_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Lose_Any_HON_Escorts_Zone_02, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_LEAVING_HON_02_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Announce_Prisoner_Objective_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ANNOUNCE_PRISONER_OBJECTIVE_JDG, 0 );
- Commands->Destroy_Object ( obj );//this is a one-time only zone--clean it up
- }
- }
- };
- DECLARE_SCRIPT(M01_Scramble_Radar_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SCRAMBLE_THE_RADAR_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_UnScramble_Radar_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_UNSCRAMBLE_THE_RADAR_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Commander_Guy, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
- }
- };
- DECLARE_SCRIPT(M01_COMM_Commander_Guy, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
- }
- };
- DECLARE_SCRIPT(M01_HandOfNod_SAMSite_Script, "")//M01_HON_SAM_SITE_JDG==100031
- {
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == (STAR))
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (M01_MISSION_CONTROLLER_JDG), 0, M01_HON_SAMSITE_HAS_BEEN_DESTROYED_JDG, 5 );
- }
- };
- DECLARE_SCRIPT(M01_Destroyed_SAMSITE_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- Vector3 my_target = Commands->Get_Position ( obj );
- my_target.Z -= -5;
- params.Set_Basic( this, 100, 20 );
- params.Set_Attack( my_target, 0, 0, true );
- params.AttackCheckBlocked = true;
- Commands->Action_Attack (obj, params);
- }
- };
- DECLARE_SCRIPT(M01_CommCenter_Evacuator_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 2.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-286.904f, 557.896f, 27.616f);
- }
- else
- {
- evac_spot.Set(-318.149f, 530.868f, 27.971f);
- }
- float x_factor = Commands->Get_Random(-5,5);
- float y_factor = Commands->Get_Random(-5,5);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 2 );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is at workstation--face monitor
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_FrontDoor_Evacuator_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_PICK_A_NEW_LOCATION_JDG);
- params.Set_Movement( Vector3(-150.3f, 532.0f, 4.2f), 1.0f, 0.25f );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- if (action_id == M01_PICK_A_NEW_LOCATION_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 3.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
-
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is evac'd allow hibernation
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_BackDoor_Evacuator_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//Tech is evac'd allow hibernation
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Dorm_Crapper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, -120 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- //params.Set_Basic(this, 60, 100);
- //params.Set_Animation ("H_A_V22A", true);
- //Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- GameObject * star = Commands->Get_A_Star (Vector3(0.0f,0.0f,0.0f));
- if ( star != NULL )
- {
- int players_ID_number = Commands->Get_ID ( star );
- params.Set_Basic( this, 90, 50 );
- params.Set_Movement( Commands->Find_Object ( players_ID_number ), .8f, 1.5f );
- params.MoveFollow = true;
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
- }
- };
- DECLARE_SCRIPT(M01_HON_Dorm_FlameGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, 90 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 60, 100);
- params.Set_Animation ("H_A_601A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Dorm_ChemGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, -90 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 60, 100);
- params.Set_Animation ("H_A_613A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Dorm_RocketGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, -90 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 60, 100);
- params.Set_Animation ("H_A_601A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Dorm_MiniGunner_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, 180 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 60, 100);
- params.Set_Animation ("H_A_442A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Cafeteria_Eating_Guy_JDG, "")
- {
- int enemy_detected;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE( enemy_detected, 1 );
- }
-
- void Created( GameObject * obj )
- {
- enemy_detected = 0;
- Commands->Innate_Disable(obj);
- Commands->Set_Facing ( obj, -125 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 60, 100);
- params.Set_Animation ("H_A_V11A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Cafeteria_Walking_Guy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering Grunt level--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100661;
- params.WaypointStartID = 100662;
- params.WaypointEndID = 100663;
- Commands->Action_Goto( obj, params );
- }
- }
- else if ((param == M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG))//Your building has been destroyed--evacuate
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Enable_Hibernation( obj, false );
- Vector3 evac_spot;
- float evac_location = Commands->Get_Random ( 0.5, 4.5f );
- if (evac_location >= 0.5 && evac_location < 1.5)
- {
- evac_spot.Set(-156.637f, 553.163f, 4.295f);
- }
- else if (evac_location >= 1.5 && evac_location < 2.5)
- {
- evac_spot.Set(-145.746f, 531.964f, 4.271f);
- }
- else if (evac_location >= 2.5 && evac_location < 3.5)
- {
- evac_spot.Set(-163.828f, 515.290f, 4.258f);
- }
- else
- {
- evac_spot.Set(-221.947f, 515.124f, 4.012f);
- }
- float x_factor = Commands->Get_Random(-10,10);
- float y_factor = Commands->Get_Random(-10,10);
- evac_spot.X += x_factor;
- evac_spot.Y += y_factor;
- params.Set_Basic(this, M01_EVAC_PRIORITY_JDG, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evac_spot, 1.0f, 3 );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG);
- params.Set_Face_Location( Vector3(-170.179f, 520.595f, 5.999f), 1 );
- Commands->Action_Face_Location ( obj, params );
- }
- else if (action_id == M01_FACING_SPECIFIED_DIRECTION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 45, M01_DOING_ANIMATION_01_JDG);
- params.Set_Animation ("H_A_J17C", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3(0,0,0), .35f, .25f );
- params.WaypathID = 100674;
- params.WaypointStartID = 100676;
- params.WaypointEndID = 100682;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 45, M01_DOING_ANIMATION_02_JDG);
- params.Set_Animation ("H_A_V42A", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Vector3 sitspot(-176.299f, 532.229f, -4.6f);
- Commands->Set_Position ( obj, sitspot );
- Commands->Set_Facing ( obj, 60 );
- params.Set_Basic(this, 45, 100);
- params.Set_Animation ("H_A_V11A", true);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_Hand_Of_Nod_Grunt_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_IN_HON_GRUNT_LEVEL_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Hand_Of_Nod_Dojo_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_IN_HON_DOJO_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_LoveShack_MiniGunner_JDG, "")//M01_CHURCH_LOVESHACK_MINIGUNNER_ID 101305
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- ActionParamsStruct params;
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( STAR, RUN, 5 );
- params.Set_Attack( STAR, 15, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * conversationZone = Commands->Find_Object ( 103392 );
- if (conversationZone != NULL)
- {
- Commands->Destroy_Object ( conversationZone );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_LOVESHACK_GUARD_IS_DEAD_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG), 0, M01_CARD_CARRIER_HAS_BEEN_KILLED_JDG, 0 );//tell controller you've been killed
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 85, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, 2 );
- params.WaypathID = 100760;
- params.WaypointStartID = 100761;
- params.WaypointEndID = 100769;
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Exterior_MiniGunner_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), .2f, .25f );
- params.WaypathID = 100771;
- params.WaypointStartID = 100772;
- params.WaypointEndID = 100776;
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 0);
- params.Set_Movement( STAR, WALK, 5 );
- params.Set_Attack( STAR, 15, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100778;
- params.WaypointStartID = 100779;
- params.WaypointEndID = 100782;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100778;
- params.WaypointStartID = 100782;
- params.WaypointEndID = 100779;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_04_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100771;
- params.WaypointStartID = 100776;
- params.WaypointEndID = 100772;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100771;
- params.WaypointStartID = 100772;
- params.WaypointEndID = 100776;
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Balcony_MiniGunner_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100784;
- params.WaypointStartID = 100785;
- params.WaypointEndID = 100786;
- Commands->Action_Goto( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100788;
- params.WaypointStartID = 100789;
- params.WaypointEndID = 100790;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100792;
- params.WaypointStartID = 100793;
- params.WaypointEndID = 100794;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_04_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100796;
- params.WaypointStartID = 100797;
- params.WaypointEndID = 100799;
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is at animation point--choose and do animation
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 45, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//minigunner is done with animation--keep moving
- {
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100784;
- params.WaypointStartID = 100785;
- params.WaypointEndID = 100786;
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Announce_Hand_of_Nod_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Apache_Orca_Chase_01.txt");
- GameObject * buggyController = Commands->Find_Object ( 103367 );
- if (buggyController != NULL)
- {
- Commands->Send_Custom_Event( obj, buggyController, 0, M01_START_ACTING_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ANNOUNCE_HON_OBJECTIVE_JDG, 0 );
-
- Commands->Destroy_Object ( obj);//this is a 1-time only zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Announce_Barn_Objective_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
- Commands->Destroy_Object ( obj);//this is a 1-time only zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Tiberium_Cave_Helicopter_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- Commands->Innate_Disable(obj);
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Movement( Vector3(-42.883f, 376.457f, 18.025f), 0.005f, 0.25f );
- params.AttackActive = false;
- params.AttackCheckBlocked = false;
- params.MovePathfind = false;
- Commands->Action_Attack (obj, params);
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_MODIFY_YOUR_ACTION_JDG )
- {
- params.Set_Basic(this, 100, M01_START_ACTING_JDG);
- params.Set_Movement( Vector3(-42.883f, 376.457f, 18.025f), 0.05f, 0.25f );
- params.AttackActive = true;
- params.AttackCheckBlocked = false;
- params.MovePathfind = false;
- params.Set_Attack (STAR, 100, 0, true);
-
- Commands->Modify_Action (obj, M01_START_ACTING_JDG, params);
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG )
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 1.0f, 0.75f );
- params.WaypathID = 100964;
- params.WaypointStartID = 100965;
- params.WaypointEndID = 101366;
- params.WaypathSplined = true;
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- params.MovePathfind = false;
- params.Set_Attack (STAR, 100, 0, true);
- Commands->Action_Attack (obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 15 );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG )
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG, 0 );
- if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
-
- //this is a one-time only zone--cleaning up
- if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
- }
- if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
- }
- if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Via_Cave_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_VIA_CAVE_JDG, 0 );
-
- if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- //this is a one-time only zone--cleaning up
- if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
- }
- if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
- }
- if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_Is_Crossing_Bridge_Via_Church_Zone, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_CROSSING_THE_BRIDGE_JDG, 0 );
-
- if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- //this is a one-time only zone--cleaning up
- if (Commands->Find_Object ( 100922 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100922 ));
- }
- if (Commands->Find_Object ( 100934 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100934 ));
- }
- if (Commands->Find_Object ( 100972 ))//clean up all zones associated with the driveby scenario
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 100972 ));
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Flamethrower_Point_Guard_JDG, "")
- {
- Vector3 myPosition;
- float myFacing;
- float leftFacing;
- float rightFacing;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(myPosition, 1);
- SAVE_VARIABLE(myFacing, 2);
- SAVE_VARIABLE(leftFacing, 3);
- SAVE_VARIABLE(rightFacing, 4);
- }
- void Created( GameObject * obj )
- {
- myPosition = Commands->Get_Position ( obj );
- myFacing = Commands->Get_Facing ( obj );
- leftFacing = myFacing - 45;
- rightFacing = myFacing + 45;
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 20.0f );
- Commands->Set_Innate_Aggressiveness ( obj, 0.5f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
- float delayTimer = Commands->Get_Random ( 5, 10 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_PICK_A_NEW_LOCATION_JDG)
- {
- float atarashiLookSpot = Commands->Get_Random ( leftFacing, rightFacing );
- float delayTimer = Commands->Get_Random ( 5, 10 );
- params.Set_Basic( this, 45, 20 );
- params.Set_Face_Location( myPosition, DEG_TO_RAD(atarashiLookSpot), delayTimer );
- Commands->Action_Face_Location ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if ((sound.Type == SOUND_TYPE_BULLET_HIT) || (sound.Type == SOUND_TYPE_GUNSHOT))
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- if (obj)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_MiniGunner_Point_Guard_JDG, "")
- {
- /*Vector3 myPosition;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(myPosition, 1);
- }
- void Created( GameObject * obj )
- {
- myPosition.Set (Commands->Get_Position ( obj ));
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 3 );
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- int current_difficulty = Commands->Get_Difficulty_Level();
- int easy = 0;
- int medium = 1;
- int hard = 2;
- if (current_difficulty == easy)
- {
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_EASY_DIFFICULTY_HOMERANGE_JDG );
- Commands->Set_Innate_Aggressiveness ( obj, M01_EASY_DIFFICULTY_AGGRESSION_JDG );
- Commands->Set_Innate_Take_Cover_Probability ( obj, M01_EASY_DIFFICULTY_TAKECOVER_JDG );
- }
- else if (current_difficulty == medium)
- {
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_MEDIUM_DIFFICULTY_HOMERANGE_JDG );
- Commands->Set_Innate_Aggressiveness ( obj, M01_MEDIUM_DIFFICULTY_AGGRESSION_JDG );
- Commands->Set_Innate_Take_Cover_Probability ( obj, M01_MEDIUM_DIFFICULTY_TAKECOVER_JDG );
- }
- else if (current_difficulty == hard)
- {
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, M01_HARD_DIFFICULTY_HOMERANGE_JDG );
- Commands->Set_Innate_Aggressiveness ( obj, M01_HARD_DIFFICULTY_AGGRESSION_JDG );
- Commands->Set_Innate_Take_Cover_Probability ( obj, M01_HARD_DIFFICULTY_TAKECOVER_JDG );
- }
- }*/
- };
- DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_01_JDG, "")
- {
- bool hunting;
- bool fighting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hunting, 1);
- SAVE_VARIABLE(fighting, 2);
- }
- void Created( GameObject * obj )
- {
- hunting = false;
- fighting = false;
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(-218.772f, 510.932f, 4.017f), RUN, 0.05f );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- if (fighting == false)
- {
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- fighting = true;
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (hunting != true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_01_IS_DEAD_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR && fighting == false)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
- Commands->Enable_Hibernation( obj, true );
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR && fighting == false)
- {
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- if (sound.Type == SOUND_TYPE_GUNSHOT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
- }
- else if (sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_HUNT_THE_PLAYER_JDG )
- {
- if (obj && STAR)
- {
- hunting = true;
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
- params.Set_Movement( playersPosition, RUN, 5, false );
- Commands->Action_Goto( obj, params );
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_02_JDG, "")
- {
- bool hunting;
- bool fighting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hunting, 1);
- SAVE_VARIABLE(fighting, 2);
- }
- void Created( GameObject * obj )
- {
- hunting = false;
- fighting = false;
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(-224.418f, 510.944f, 4.006f), RUN, 0.05f );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- if (fighting == false)
- {
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- fighting = true;
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (hunting != true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_02_IS_DEAD_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR && fighting == false)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
- Commands->Enable_Hibernation( obj, true );
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR && fighting == false)
- {
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- if (sound.Type == SOUND_TYPE_GUNSHOT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
- }
- else if (sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_HUNT_THE_PLAYER_JDG )
- {
- if (obj && STAR)
- {
- hunting = true;
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
- params.Set_Movement( playersPosition, RUN, 5, false );
- Commands->Action_Goto( obj, params );
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Easy_Spawned_Guy_03_JDG, "")
- {
- bool hunting;
- bool fighting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hunting, 1);
- SAVE_VARIABLE(fighting, 2);
- }
- void Created( GameObject * obj )
- {
- hunting = false;
- fighting = false;
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 85, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(-221.754f, 514.833f, 4.015f), RUN, 0.05f );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR )
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- if (fighting == false)
- {
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- fighting = true;
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (hunting != true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_03_IS_DEAD_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IS_DEAD_JDG, 0 );
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR && fighting == false)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Set_Innate_Aggressiveness ( obj, 0.25f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.75f );
- Commands->Enable_Hibernation( obj, true );
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR && fighting == false)
- {
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- if (sound.Type == SOUND_TYPE_GUNSHOT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Gunshots_Heard ( obj, playersPosition );
- }
- else if (sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- fighting = true;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Bullet_Heard ( obj, playersPosition );
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_HUNT_THE_PLAYER_JDG )
- {
- if (obj && STAR)
- {
- hunting = true;
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
- params.Set_Movement( playersPosition, RUN, 5, false );
- Commands->Action_Goto( obj, params );
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 30 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_HUNT_THE_PLAYER_JDG && (complete_reason == ACTION_COMPLETE_PATH_BAD_START || complete_reason == ACTION_COMPLETE_PATH_BAD_DEST || complete_reason == ACTION_COMPLETE_MOVE_NO_PROGRESS_MADE))
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- else if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNER_IN_POSITION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Whack_A_Mole_Enter_Zone_JDG, "")//this guys ID is 101209
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_WHACK_A_MOLE_GUY_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101207 ), 0, M01_SPAWN_WHACK_A_MOLE_GUY_JDG, 0 );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Whack_A_Mole_Exit_Zone_JDG, "")//this guys ID is 101207
- {
- bool okayToAct;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okayToAct, 1);
- }
- void Created( GameObject * obj )
- {
- okayToAct = false;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (param == M01_SPAWN_WHACK_A_MOLE_GUY_JDG )
- {
- okayToAct = true;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR && okayToAct == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHANGE_WHACK_A_MOLE_GUY_JDG, 0 );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Whack_A_Mole_Minigunner_JDG, "")
- {
- typedef enum {
- Left_To_Right,
- Right_To_Left,
- } Walking_State;
- bool invincible;
- bool attacked;
- float base_health;
- float speed;
- int points_given;
- Walking_State Whack_a_Mole_State;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(invincible, 1);
- SAVE_VARIABLE(attacked, 2);
- SAVE_VARIABLE(base_health, 3);
- SAVE_VARIABLE(speed, 4);
- SAVE_VARIABLE(points_given, 5);
- SAVE_VARIABLE(Whack_a_Mole_State, 6);
- }
- void Created( GameObject * obj )
- {
- //Commands->Innate_Disable(obj);
- invincible = false;
- attacked = false;
- base_health = Commands->Get_Max_Health ( obj );
- speed = 0.3f;
- points_given = 1;
- ActionParamsStruct params;
- params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
- params.WaypathID = 101221;
- Commands->Action_Goto( obj, params );
- Whack_a_Mole_State = Right_To_Left;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_CHANGE_WHACK_A_MOLE_GUY_JDG )
- {
- if (obj)
- {
- invincible = false;
- Commands->Innate_Enable(obj);
- }
- }
- else if (param == M01_DOING_ANIMATION_01_JDG )
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "H_A_J21C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (param == M01_PICK_A_NEW_LOCATION_JDG )
- {
- Commands->Action_Reset ( obj, 100 );
- if (Whack_a_Mole_State == Right_To_Left)
- {
- params.Set_Basic( this, 45, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
- params.WaypathID = 101210;
- Commands->Action_Goto( obj, params );
- Whack_a_Mole_State = Left_To_Right;
- }
- else if (Whack_a_Mole_State == Left_To_Right)
- {
- params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
- params.WaypathID = 101221;
- Commands->Action_Goto( obj, params );
- Whack_a_Mole_State = Right_To_Left;
- }
- }
- else if (param == M01_HUNT_THE_PLAYER_JDG )
- {
- if (obj)
- {
- invincible = false;
- Commands->Innate_Enable(obj);
- Commands->Grant_Key( obj, 1, true );
- params.Set_Basic(this, 45, M01_HUNT_THE_PLAYER_JDG);
- params.Set_Movement( STAR, WALK, 5 );
- params.Set_Attack( STAR, 15, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (attacked == false)
- {
- params.Set_Basic( this, 45, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
- params.WaypathID = 101221;
- Commands->Action_Goto( obj, params );
- Whack_a_Mole_State = Right_To_Left;
- }
- else if (attacked == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 0 );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, 45, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(0,0,0), speed, 0.25f );
- params.WaypathID = 101210;
- Commands->Action_Goto( obj, params );
- Whack_a_Mole_State = Left_To_Right;
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR && invincible == true)
- {
- if (obj)
- {
- attacked = true;
- Commands->Set_Health ( obj, base_health );
- points_given = 2 * points_given;
- speed = speed + .1;
- if (speed > 1)
- {
- speed = 1;
- }
- Commands->Give_Points( damager, points_given, false );
- Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Left_Interrogation_Room_Enter_Zone_JDG, "")//this guys ID is 101354
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ), 0, M01_PLAYER_ENTERING_LEFT_INTEROG_ROOM_JDG, 0 );
- }
- if (Commands->Find_Object ( 101354 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
- }
- if (Commands->Find_Object ( 101355 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Right_Interrogation_Room_Enter_Zone_JDG, "")//this guys ID is 101355
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_INTERROGATION_ROOM_GUY_ID ), 0, M01_PLAYER_ENTERING_RIGHT_INTEROG_ROOM_JDG, 0 );
- }
- if (Commands->Find_Object ( 101354 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
- }
- if (Commands->Find_Object ( 101355 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Interrogation_Room_L03_Keycard_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_NONE );
- }
- };
- DECLARE_SCRIPT(M01_Interrogation_Room_Surprise_Guy_JDG, "")//this guys ID is 101357
- {
- Vector3 myPostion;
- bool onGuard;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(myPostion, 1);
- SAVE_VARIABLE(onGuard, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- onGuard = true;
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- ActionParamsStruct params;
- if (onGuard == true)
- {
- if (obj)
- {
- Commands->Innate_Enable( obj );
- Commands->Create_Sound ( "Huh_2", Commands->Get_Position ( obj ), obj );
- float delayTimer = Commands->Get_Random ( 0.5f, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- onGuard = false;
- if (Commands->Find_Object ( 101354 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101354 ) );//cleaning up the 2 interogation room zones
- }
- if (Commands->Find_Object ( 101355 ))
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101355 ) );
- }
- }
- }
- else
- {
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
- if (param == M01_PLAYER_ENTERING_LEFT_INTEROG_ROOM_JDG )
- {
- myPostion.Set (-182.199f, 529.167f, -31.130f);
- params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myPostion, 0.75f, 0.05f );
- Commands->Action_Goto( obj, params );
- onGuard = false;
- }
- else if (param == M01_PLAYER_ENTERING_RIGHT_INTEROG_ROOM_JDG )
- {
- myPostion.Set (-182.753f, 539.906f, -31.130f);
- params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myPostion, 0.75f, 0.05f );
- Commands->Action_Goto( obj, params );
- onGuard = false;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG )
- {
- if (obj)
- {
- Commands->Grant_Key( obj, 1, true );
- Commands->Grant_Key( obj, 2, true );
- Commands->Grant_Key( obj, 3, true );
- Commands->Innate_Enable( obj );
- params.Set_Basic( this, 80, M01_HUNT_THE_PLAYER_JDG );
- params.Set_Attack( STAR, 20, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Create_Sound ( "TargetHasBeenEngaged_2", myPostion, obj );
- params.Set_Basic( this, 80, M01_HUNT_THE_PLAYER_JDG );
- params.Set_Attack( STAR, 20, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- float delayTimer = Commands->Get_Random ( 1, 3 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- }
- };
- DECLARE_SCRIPT(M01_Medium_Tank_Tunnel_Squish_Guy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Vector3 myPositon = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPositon, 10.0f );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_MEDIUM_TANK_IS_HERE_JDG )
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 1.0f, .25f );
- params.WaypathID = 101554;
- params.WaypointStartID = 101561;
- Commands->Action_Goto( obj, params );
- Commands->Create_3D_Sound_At_Bone ( "M01_Nod_HupHup", obj, "ROOTTRANSFORM" );
- }
- }
- };
- DECLARE_SCRIPT(M01_Billys_Conversation_Zone_JDG, "")//this guys ID is 101661
- {
- bool okay_to_play_conversation;
- bool playerEntered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_play_conversation, 1);
- SAVE_VARIABLE(playerEntered, 2);
- }
- void Created( GameObject * obj )
- {
- okay_to_play_conversation = false;
- playerEntered = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//billy is in position--give okay for conversation
- {
- okay_to_play_conversation = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
- }
- else if ((param == M01_CUE_BILLYS_CONVERSATION_JDG))//see if billy and havoc are present
- {
- if (playerEntered == true && okay_to_play_conversation == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
- GameObject * babushkaZone = Commands->Find_Object ( 101662 );
- GameObject * billyZone = Commands->Find_Object ( 101661 );
- if (babushkaZone != NULL)
- {
- Commands->Destroy_Object ( babushkaZone );//this is one-time only zone--cleaning up
- }
- if (billyZone != NULL)
- {
- Commands->Destroy_Object ( billyZone );//this is one-time only zone--cleaning up
- }
- }
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- playerEntered = false;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- playerEntered = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BILLYS_CONVERSATION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Tank_Entering_Tunnel_Zone_JDG, "")//this guys ID is
- {
- int gdi_medium_tank;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(gdi_medium_tank, 1);
- }
- void Created( GameObject * obj )
- {
- gdi_medium_tank = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == M01_MEDIUM_TANK_IS_HERE_JDG )
- {
- gdi_medium_tank = param;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- /*GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG );
- if (lightTank != NULL && enterer == lightTank)
- {
- Commands->Send_Custom_Event( obj, lightTank, 0, M01_GOTO_IDLE_JDG, 0 );
- Vector3 newTankPosition (14.208f, 225.943f, 4.0f);
- Commands->Set_Position ( lightTank, newTankPosition );
- }*/
- if (enterer == Commands->Find_Object ( gdi_medium_tank ))
- {
- if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_01_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_01_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_02_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_02_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_03_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TANK_TUNNEL_SQUISH_GUY_03_ID ), 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
- }
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_Is_Entering_Tailgun_Alley_JDG, "")//this guys ID is 101692
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- int tankWarning = Commands->Create_Conversation( "M01_Announce_LightTank_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, tankWarning, false, false );
- Commands->Join_Conversation( NULL, tankWarning, false, false );
- //Commands->Join_Conversation( STAR, tankWarning, false, false );
- Commands->Start_Conversation( tankWarning, tankWarning );
- if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
-
- if ( Commands->Find_Object ( 101718 ))//this is the backway enter zone
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101718 ) );
- }
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Player_Is_Entering_Tailgun_Alley_Backway_JDG, "")//this guys ID is 101691
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_APPROACHING_TAILGUN_ALLEY_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_START_ACTING_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( 101692 ))//this is the enter zone in the tunnel
- {
- Commands->Destroy_Object ( Commands->Find_Object ( 101692 ) );
- }
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGunner_01_JDG, "")//M01_TAILGUNNER_01_ID 101470
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
- {
- ActionParamsStruct params;
- Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_01_ID ) );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( tailgunPosition, .25f, .25f );
-
- Commands->Action_Goto( obj, params );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if ( Commands->Find_Object ( M01_TAILGUN_01_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_01_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- Commands->Action_Enter_Exit ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGunner_02_JDG, "")//M01_TAILGUNNER_02_ID 101471
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
- {
- ActionParamsStruct params;
- Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_02_ID ) );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( tailgunPosition, .25f, .25f );
-
- Commands->Action_Goto( obj, params );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if ( Commands->Find_Object ( M01_TAILGUN_02_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_02_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- Commands->Action_Enter_Exit ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGunner_03_JDG, "")//M01_TAILGUNNER_03_ID 101472
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
- {
- ActionParamsStruct params;
- Vector3 tailgunPosition = Commands->Get_Position ( Commands->Find_Object ( M01_TAILGUN_03_ID ) );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( tailgunPosition, .25f, .35f );
-
- Commands->Action_Goto( obj, params );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if ( Commands->Find_Object ( M01_TAILGUN_03_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUN_03_ID ), 0, M01_YOUR_OPERATOR_IS_DEAD_JDG, 0 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- Commands->Action_Enter_Exit ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGun_01_JDG, "")//M01_TAILGUN_01_ID 100243
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_START_ACTING_JDG )
- {
- params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
- params.Set_Attack( STAR, 50, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGun_02_JDG, "")//M01_TAILGUN_02_ID 100244
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_START_ACTING_JDG )
- {
- params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
- params.Set_Attack( STAR, 50, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_TailGun_03_JDG, "")//M01_TAILGUN_03_ID 100245
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_START_ACTING_JDG )
- {
- params.Set_Basic( this, 100, M01_HUNT_THE_PLAYER_JDG );
- params.Set_Attack( STAR, 50, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Tailgun_02_SpawnApache_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Tailgun_Apache_02.txt");
- Commands->Destroy_Object ( obj );//this is a one-time zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Civ_To_Minigunner_Guy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- if (Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG))
- {
- Vector3 myGotoSpot = Commands->Get_Position ( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG) );
- params.Set_Basic( this, 50, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myGotoSpot, RUN, 20 );
-
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Base_Commander_JDG, "")//this guys ID is M01_COMMCENTER_BASE_COMMANDER_JDG 101936
- {
- bool enemyEngaged;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(enemyEngaged, 1);
- }
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- enemyEngaged = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR && enemyEngaged == false)
- {
- enemyEngaged = true;
- Commands->Innate_Enable(obj);
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- Commands->Enable_Hibernation( obj, true );
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR && enemyEngaged == false)
- {
- enemyEngaged = true;
- Commands->Innate_Enable(obj);
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- Commands->Enable_Hibernation( obj, true );
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (killer == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
- Vector3 spawn_location = Commands->Get_Position ( obj );
- spawn_location.Z = spawn_location.Z + 0.75f;
- bool player_has_level02_card = Commands->Has_Key( STAR, 2 );
- if (player_has_level02_card == false)
- {
- Commands->Create_Object ( "Level_02_Keycard", spawn_location );
- }
- }
- }
-
- };
- /*DECLARE_SCRIPT(M01_Comm_Base_Scapegoat_JDG, "")//this guys ID is M01_COMMCENTER_BASE_SCAPEGOAT_JDG 101938
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- };
- DECLARE_SCRIPT(M01_Comm_Ceiling_Camera_JDG, "")//this guys ID is M01_COMMCENTER_CEILING_CAMERA_JDG 101937
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG), 0, 0, true );
- Commands->Action_Attack( obj, params );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_START_ATTACKING_01_JDG: //kane has told you to kill the scapegoat
- {
- if (Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG))
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( Commands->Find_Object (M01_COMMCENTER_BASE_SCAPEGOAT_JDG), 100, 0, true );
- Commands->Action_Attack( obj, params );
- }
- }
- break;
- }
- }
- };*/
- DECLARE_SCRIPT(M01_Comm_Stationary_Tech_JDG, "")
- {
- //these guys IDs are M01_COMMCENTER_UPSTAIRS_TECH_JDG 101168
- //M01_COMMCENTER_WAROOM_TECH_01_JDG 101170
- //M01_COMMCENTER_WAROOM_TECH_02_JDG 101171
- Vector3 myLocation;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(myLocation, 1);
- }
- void Created( GameObject * obj )
- {
- myLocation = Commands->Get_Position ( obj );
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 0.15f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( myLocation, WALK, 0 );
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 30, M01_DOING_ANIMATION_01_JDG);
- params.Set_Animation( "H_A_CON2", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( myLocation, WALK, 0 );
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_ComputerRoom_Tech_JDG, "")//this guys ID is M01_COMMCENTER_COMPUTERROOM_TECH_JDG 101172
- {
- Vector3 myLocation;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(myLocation, 1);
- }
- void Created( GameObject * obj )
- {
- myLocation = Commands->Get_Position ( obj );
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 0.15f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( myLocation, WALK, 0 );
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 30, M01_DOING_ANIMATION_01_JDG);
- params.Set_Animation( "H_A_CON2", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( myLocation, WALK, 0 );
- Commands->Action_Goto( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Upstairs_Guard_JDG, "")//this guys ID is M01_COMMCENTER_UPSTAIRS_GUARD_JDG 101946
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_PLAYER_IS_INSIDE_COMM_CENTER_JDG:
- {
- Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 0.75f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
- params.WaypathID = 101940;
- params.WaypointStartID = 101944;
- params.WaypointEndID = 101941;
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- float delayTimer = Commands->Get_Random ( 1, 10 );
- Commands->Start_Timer(obj, this, delayTimer, M01_WALKING_WAYPATH_01_JDG);
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- float delayTimer = Commands->Get_Random ( 1, 10 );
- Commands->Start_Timer(obj, this, delayTimer, M01_WALKING_WAYPATH_02_JDG);
- }
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- ActionParamsStruct params;
- switch (timer_id)
- {
- case M01_WALKING_WAYPATH_01_JDG:
- {
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
- params.WaypathID = 101940;
- params.WaypointStartID = 101944;
- params.WaypointEndID = 101941;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_02_JDG:
- {
- params.Set_Basic(this, 30, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3 (0,0,0), WALK, 0 );
- params.WaypathID = 101940;
- params.WaypointStartID = 101941;
- params.WaypointEndID = 101944;
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
-
- };
- DECLARE_SCRIPT(M01_Comm_Base_Commander_Conv_Start_Zone_JDG, "")//this guys ID is 101947
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_NUMBER2_CONVERSATION_JDG, 0 );
- GameObject * zone01 = Commands->Find_Object ( 101947 );
- if (zone01 != NULL)
- {
- Commands->Destroy_Object ( zone01 );//this is a one-time only zone--cleaning up
- }
- GameObject * zone02 = Commands->Find_Object ( 111809 );
- if (zone02 != NULL)
- {
- Commands->Destroy_Object ( zone02 );//this is a one-time only zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Kane_n_Havoc_Conv_Start_Zone_JDG, "")//this guys ID is 101947
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_KANE_AND_HAVOC_CONVERSATION_JDG, 0 );
- Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_MCT_Placeholder_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_KILL_THE_HON_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_Comm_MCT_Placeholder_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_KILL_THE_COMM_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_GDI_Toolshed_PatrolGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102153;
- params.WaypointStartID = 102154;
- params.WaypointEndID = 102157;
- Commands->Action_Goto( obj, params );
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- ActionParamsStruct params;
- switch (complete_reason)
- {
- case ACTION_COMPLETE_NORMAL:
- {
- switch (action_id)
- {
- case M01_WALKING_WAYPATH_01_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_01_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102159;
- params.WaypointStartID = 102160;
- params.WaypointEndID = 102168;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_02_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_02_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102176;
- params.WaypointStartID = 102177;
- params.WaypointEndID = 102183;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_03_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_03_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102176;
- params.WaypointStartID = 102183;
- params.WaypointEndID = 102177;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_04_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_04_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102159;
- params.WaypointStartID = 102168;
- params.WaypointEndID = 102160;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_05_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_05_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_05_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102153;
- params.WaypointStartID = 102157;
- params.WaypointEndID = 102154;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_06_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 30, M01_DOING_ANIMATION_06_JDG );
- params.Set_Animation (animationName, false);
- Commands->Action_Play_Animation (obj, params);
- }
- break;
- case M01_DOING_ANIMATION_06_JDG:
- {
- params.Set_Basic( this, 30, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, .05f );
- params.WaypathID = 102153;
- params.WaypointStartID = 102154;
- params.WaypointEndID = 102157;
- Commands->Action_Goto( obj, params );
- }
- break;
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_Base_Spawner_Controller_JDG, "")//this guys ID is M01_GDIBASE_SPAWNER_CONTROLLER_JDG
- {
- int active_unit_count;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(active_unit_count, 1);
- }
- void Created( GameObject * obj )
- {
- active_unit_count = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_SPAWNER_IS_DEAD_JDG:
- {
- active_unit_count--;
- Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- Commands->Debug_Message ( "***************************GDI Base spawner has recieved custom that someone is dead\n" );
- }
- break;
- case M01_SPAWNER_SPAWN_PLEASE_JDG:
- {
- Commands->Enable_Hibernation( obj, false );
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int easy = 0;
- int medium = 1;
- int hard = 2;
- if (currentDifficulty == easy)
- {
- if (active_unit_count == 0)
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
- active_unit_count++;
- Commands->Debug_Message ( "***************************GDI Base spawner has spawned an easy guy\n" );
- }
- }
- else if (currentDifficulty == medium)
- {
- if (active_unit_count < 2)
- {
- int random = Commands->Get_Random(0.5f, 2.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_B_JDG );
- active_unit_count++;
- }
- Commands->Debug_Message ( "***************************GDI Base spawner has spawned a medium guy\n" );
- }
- }
- else if (currentDifficulty == hard)
- {
- if (active_unit_count < 3)
- {
- int random = Commands->Get_Random(0.5f, 3.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else if ((random >= 1.5f) && (random < 2.5f))
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_B_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_GDIBASE_SPAWNER_C_JDG );
- active_unit_count++;
- }
- Commands->Debug_Message ( "***************************GDI Base spawner has spawned a hard guy\n" );
- }
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 10 );
- }
- break;
- case M01_QUIT_SPAWNING_PLEASE_JDG:
- {
- if (Commands->Find_Object (M01_GDIBASE_SPAWNER_A_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_A_JDG) );
- }
- if (Commands->Find_Object (M01_GDIBASE_SPAWNER_B_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_B_JDG) );
- }
- if (Commands->Find_Object (M01_GDIBASE_SPAWNER_C_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_GDIBASE_SPAWNER_C_JDG) );
- }
- Commands->Destroy_Object ( obj );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_Base_Spawner_Guy_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Debug_Message ( "***************************GDI Base/barn area spawner has been killed--sending custom\n" );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_GDIBASE_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Tailgun_Run_Spawner_Controller_JDG, "")//this guys ID is M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG
- {
- int active_unit_count;
- bool startup;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(active_unit_count, 1);
- SAVE_VARIABLE(startup, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- active_unit_count = 0;
- startup = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_SPAWNER_IS_DEAD_JDG:
- {
- active_unit_count--;
- Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- break;
- case M01_SPAWNER_SPAWN_PLEASE_JDG:
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int easy = 0;
- int medium = 1;
- int hard = 2;
- if (startup == true)
- {
- startup = false;
- if (currentDifficulty == easy)
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else if (currentDifficulty == medium)
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
- active_unit_count += 2;
- }
- else if (currentDifficulty == hard)
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_C_JDG );
- active_unit_count += 3;
- }
- }
- else
- {
- if (currentDifficulty == easy)
- {
- if (active_unit_count == 0)
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- active_unit_count++;
- }
- }
- else if (currentDifficulty == medium)
- {
- if (active_unit_count < 2)
- {
- int random = Commands->Get_Random(0.5f, 2.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
- active_unit_count++;
- }
- }
- }
- else if (currentDifficulty == hard)
- {
- if (active_unit_count < 3)
- {
- int random = Commands->Get_Random(0.5f, 3.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else if ((random >= 1.5f) && (random < 2.5f))
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_B_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_TAILGUNRUN_SPAWNER_C_JDG );
- active_unit_count++;
- }
- }
- }
- }
- }
- break;
- case M01_QUIT_SPAWNING_PLEASE_JDG:
- {
- if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_A_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_A_JDG) );
- }
- if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_B_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_B_JDG) );
- }
- if (Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_C_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_TAILGUNRUN_SPAWNER_C_JDG) );
- }
- Commands->Destroy_Object ( obj );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_TailgunRun_Spawner_Guy_JDG, "")//Innate_Disable)(GameObject* object);(*Innate_Enable)(GameObject* object);
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Debug_Message ( "***************************taigun run area spawner has been killed--sending custom\n" );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_TAILGUNRUN_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_Spawner_Controller_JDG, "")//this guys ID is M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG
- {
- int active_unit_count;
- bool startup;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(active_unit_count, 1);
- SAVE_VARIABLE(startup, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- active_unit_count = 0;
- startup = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_SPAWNER_IS_DEAD_JDG:
- {
- active_unit_count--;
- Commands->Send_Custom_Event( obj, obj, 0, M01_SPAWNER_SPAWN_PLEASE_JDG, 0 );
- }
- break;
- case M01_SPAWNER_SPAWN_PLEASE_JDG:
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int easy = 0;
- int medium = 1;
- int hard = 2;
- if (startup == true)
- {
- startup = false;
- if (currentDifficulty == easy)
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else if (currentDifficulty == medium)
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
- active_unit_count += 2;
- }
- else if (currentDifficulty == hard)
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_C_JDG );
- active_unit_count += 3;
- }
- }
- else
- {
- if (currentDifficulty == easy)
- {
- if (active_unit_count == 0)
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- active_unit_count++;
- }
- }
- else if (currentDifficulty == medium)
- {
- if (active_unit_count < 2)
- {
- int random = Commands->Get_Random(0.5f, 2.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
- active_unit_count++;
- }
- }
- }
- else if (currentDifficulty == hard)
- {
- if (active_unit_count < 3)
- {
- int random = Commands->Get_Random(0.5f, 3.5f);
- if ((random >= 0.5f) && (random < 1.5f))
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_A_JDG );
- active_unit_count++;
- }
- else if ((random >= 1.5f) && (random < 2.5f))
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_B_JDG );
- active_unit_count++;
- }
- else
- {
- Commands->Trigger_Spawner( M01_CHURCHAREA_SPAWNER_C_JDG );
- active_unit_count++;
- }
- }
- }
- }
- }
- break;
- case M01_QUIT_SPAWNING_PLEASE_JDG:
- {
- if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_A_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_A_JDG) );
- }
- if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_B_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_B_JDG) );
- }
- if (Commands->Find_Object (M01_CHURCHAREA_SPAWNER_C_JDG))
- {
- Commands->Destroy_Object ( Commands->Find_Object (M01_CHURCHAREA_SPAWNER_C_JDG) );
- }
- Commands->Destroy_Object ( obj );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_Spawner_Guy_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Debug_Message ( "***************************church area spawner has been killed--sending custom\n" );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_SPAWNER_IS_DEAD_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Turn_on_the_Hand_of_Nod_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if ( Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_CHURCHAREA_SPAWNER_CONTROLLER_JDG ), 0, M01_QUIT_SPAWNING_PLEASE_JDG, 0 );
- }
- if ( Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_HON_SPAWNS_MINIGUNNER_JDG, 0 );
- }
-
- if (obj)
- {
- Commands->Destroy_Object ( obj);//this is a one-time only zone--cleaning up
- }
- }
- }
- };
- /*DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_JDG, "")//M01_BARNAREA_NOD_COMMANDER_02_JDG 102476
- {
- bool deadYet;
- bool firstTimeDamaged;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(deadYet, 1);
- SAVE_VARIABLE(firstTimeDamaged, 2);
- }
- void Created( GameObject * obj )
- {
- deadYet = false;
- firstTimeDamaged = true;
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR && deadYet == false && firstTimeDamaged == true)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- firstTimeDamaged = false;
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "H_A_J21C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- deadYet = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- switch (param)
- {
- case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
- {
- if (obj)
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int medium = 1;
- int hard = 2;
- float delayTimer;
- if (currentDifficulty == hard)
- {
- delayTimer = 60;
- }
- else if (currentDifficulty == medium)
- {
- delayTimer = 90;
- }
- else
- {
- delayTimer = 120;
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_BARN_CHINOOK_JDG, delayTimer );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- }
- break;
- case M01_SEND_BARN_CHINOOK_JDG: //here comes player start calling in reinforcements
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_BARN_CHINOOK_JDG, 0 );
- }
- }
- break;
- case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
- {
- if (obj && deadYet == false)
- {
- GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
- if (nodCommanderDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- float delayTimer = Commands->Get_Random ( 15, 30 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
- }
- }
- break;
- }
- }
- }
- };*/
- DECLARE_SCRIPT(M01_TailgunRun_NOD_Commander_JDG, "")//this guys ID is M01_TAILGUNAREA_NOD_COMMANDER_JDG 102358
- {
- bool deadYet;
- bool firstTimeDamaged;
- bool playerSeen;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(deadYet, 1);
- SAVE_VARIABLE(firstTimeDamaged, 2);
- SAVE_VARIABLE(playerSeen, 2);
- }
- void Created( GameObject * obj )
- {
- deadYet = false;
- firstTimeDamaged = true;
- playerSeen = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR && deadYet == false && firstTimeDamaged == true)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 35)
- {
- firstTimeDamaged = false;
- char *animationName = M01_Choose_Duck_Animation();
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR)
- {
- playerSeen = true;
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR)
- {
- if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- if (obj)
- {
- if (deadYet == false && playerSeen == false)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- //firstTimeDamaged = false;
- char *animationName = M01_Choose_Duck_Animation();
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- deadYet = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- switch (param)
- {
- case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
- {
- if (obj)
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int medium = 1;
- int hard = 2;
- float delayTimer;
- if (currentDifficulty == hard)
- {
- delayTimer = 60;
- }
- else if (currentDifficulty == medium)
- {
- delayTimer = 90;
- }
- else
- {
- delayTimer = 120;
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_TAILGUN_CHINOOK_JDG, delayTimer );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- }
- break;
- case M01_SEND_TAILGUN_CHINOOK_JDG: //here comes player start calling in reinforcements
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_TAILGUN_CHINOOK_JDG, 0 );
- }
- }
- break;
- case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
- {
- if (obj && deadYet == false)
- {
- GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
- if (nodCommanderDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- float delayTimer = Commands->Get_Random ( 15, 30 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
- }
- }
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_NOD_Commander_JDG, "")//M01_CHURCHAREA_NOD_COMMANDER_JDG 102357
- {
- bool deadYet;
- bool firstTimeDamaged;
- bool playerSeen;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(deadYet, 1);
- SAVE_VARIABLE(firstTimeDamaged, 2);
- SAVE_VARIABLE(playerSeen, 3);
- }
- void Created( GameObject * obj )
- {
- deadYet = false;
- firstTimeDamaged = true;
- playerSeen = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
-
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR && deadYet == false && firstTimeDamaged == true && playerSeen == false)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- firstTimeDamaged = false;
- char *animationName = M01_Choose_Duck_Animation();
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR)
- {
- playerSeen = true;
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR)
- {
- if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- if (obj)
- {
- if (deadYet == false && playerSeen == false)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- //firstTimeDamaged = false;
- char *animationName = M01_Choose_Duck_Animation();
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- deadYet = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- switch (param)
- {
- case M01_START_ACTING_JDG: //set timer--then call in next reinforcements
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 0 );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG://here comes player start calling in reinforcements
- {
- if (obj)
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int medium = 1;
- int hard = 2;
- float delayTimer;
- if (currentDifficulty == hard)
- {
- delayTimer = 60;
- }
- else if (currentDifficulty == medium)
- {
- delayTimer = 90;
- }
- else
- {
- delayTimer = 120;
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_CHURCH_CHINOOK_JDG, delayTimer );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- }
- break;
- case M01_SEND_CHURCH_CHINOOK_JDG: //here comes player start calling in reinforcements
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_CHURCH_CHINOOK_JDG, 0 );
- }
- }
- break;
- case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
- {
- if (obj && deadYet == false)
- {
- GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
- if (nodCommanderDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- float delayTimer = Commands->Get_Random ( 15, 30 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
- }
- }
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_Base_Artillery_Controller_JDG, "")//M01_GDIBASE_ARTILLERY_CONTROLLER_ID 102294
- {
- Vector3 locs[35];
- Vector3 sound_location;
- int last;
- int bomb_sound;
- float delayTimerMin;
- float delayTimerMax;
- bool command_clearance;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(sound_location, 1);
- SAVE_VARIABLE(last, 2);
- SAVE_VARIABLE(bomb_sound, 3);
- SAVE_VARIABLE(command_clearance, 4);
- SAVE_VARIABLE(delayTimerMin, 5);
- SAVE_VARIABLE(delayTimerMax, 6);
- }
- void Created( GameObject * obj )
- {
- locs[0] = Vector3(96.983f, -75.433f, -7.894f);
- locs[1] = Vector3(64.778f,-70.692f, -7.917f );
- locs[2] = Vector3(39.923f, -55.085f, -6.986f);
- locs[3] = Vector3(64.088f, -51.238f, -1.130f);
- locs[4] = Vector3(90.243f, -42.054f, 7.820f);
- locs[5] = Vector3(101.932f, -22.724f, 3.892f);
- locs[6] = Vector3(110.260f, 6.870f, 11.455f);
- locs[7] = Vector3(104.993f, 34.865f, 7.102f);
- locs[8] = Vector3(88.132f, 31.827f, 9.156f);
- locs[9] = Vector3(82.538f, -2.162f, 7.260f);
- locs[10] = Vector3(73.697f, 10.886f, 10.622f);
- locs[11] = Vector3(61.373f, -9.328f, 9.156f);
- locs[12] = Vector3(45.354f, -11.552f, 7.243f);
- locs[13] = Vector3(53.740f, -1.580f, 13.105f);
- locs[14] = Vector3(53.059f, 17.069f, 13.105f);
- locs[15] = Vector3(24.016f, 8.417f, 7.113f);
- locs[16] = Vector3(22.190f, -4.718f, 10.245f);
- locs[17] = Vector3(1.074f, -48.981f, -1.604f);
- locs[18] = Vector3(-17.956f, -48.856f, 3.441f);
- locs[19] = Vector3(-46.404f, -26.827f, 6.827f);
- locs[20] = Vector3(-40.934f, -20.838f, 2.387f);
- locs[21] = Vector3(9.578f, -17.054f, 7.419f);
- locs[22] = Vector3(-6.474f, -17.783f, 5.052f);
- locs[23] = Vector3(-8.360f, -6.935f, 11.862f);
- locs[24] = Vector3(5.836f, -4.874f, 17.664f);
- locs[25] = Vector3(-40.130f, -1.333f, 6.052f);
- locs[26] = Vector3(-43.953f, 5.812f, 14.117f);
- locs[27] = Vector3(-50.261f, 32.361f, 5.410f);
- locs[28] = Vector3(-50.813f, 48.439f, 11.585f);
- locs[29] = Vector3(-40.847f, 60.449f, 5.454f);
- locs[30] = Vector3(-36.209f, 68.892f, 14.059f);
- locs[31] = Vector3(-14.355f, 40.254f, 3.190f);
- locs[32] = Vector3(9.023f, 39.898f, 4.112f);
- locs[33] = Vector3(-5.525f, 41.241f, 12.043f);
- locs[34] = Vector3(24.496f, 52.051f, 9.968f);
- last = 40;
- delayTimerMin = 20;
- delayTimerMax = 30;
- command_clearance = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_PICK_A_NEW_LOCATION_JDG:
- {
- if (command_clearance == true)
- {
- int random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
- while (random == last)
- {
- random = int(Commands->Get_Random(0, 35-WWMATH_EPSILON));
- }
- last = random;
- sound_location = locs[random];
- sound_location.Z += 10;
- bomb_sound = Commands->Create_Sound ( "Bomb_Falling_Sound_Twiddler", sound_location, obj );
- Commands->Monitor_Sound ( obj, bomb_sound );
- }
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- command_clearance = false;
- if (sender == Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ))//your "commander" is dead--destroy yourself
- {
- Commands->Destroy_Object ( obj );
- }
- }
- break;
- case M01_START_ACTING_JDG:
- {
- command_clearance = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 2 );
- }
- break;
- }
- if (type == CUSTOM_EVENT_SOUND_ENDED )
- {
- if (param == bomb_sound)
- {
- Vector3 explosion_location = sound_location;
-
- explosion_location.Z -= 10;
- Commands->Create_Explosion("Ground Explosions Twiddler", explosion_location);
- float delayTimer = Commands->Get_Random ( delayTimerMin, delayTimerMax );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_GuardTower_01_Enter_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-148.379f, 342.954f, 9.656f));
- Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-157.390 363.504 10.695, 148.379 342.954 9.656");
- GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-149.930f, 338.900f, 9.170f));
- Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-158.760 357.590 10.695, -149.930 338.900 9.170");
- GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-146.812f, 339.745f, 9.345f));
- Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-162.892 357.941 10.655, -146.812 339.745 9.345");
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_GuardTower_02_Enter_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-153.944f, 602.434f, 4.226f));
- Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-141.665 573.039 4.409, -153.944 602.434 4.226");
- GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-156.672f, 605.082f, 4.163f));
- Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-138.653 576.128 4.889, -156.672 605.082 4.163");
- GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-160.792f, 606.559f, 4.075f));
- Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-143.313 580.514 4.337, -160.792 606.559 4.075");
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_GuardTower_03_Enter_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-254.164f, 564.968f, 30.630f));
- Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-221.487 556.431 25.927, -254.164 564.968 30.630");
- GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-253.935f, 561.105f, 30.922f));
- Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-221.169 561.729 25.662, -253.935 561.105 30.922");
- GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-257.185f, 562.242f, 30.540f));
- Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-225.770 558.924 26.635, -257.185 562.242 30.540");
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-200.897f, 533.210f, 19.5f));
- Commands->Attach_Script(controller1, "Test_Cinematic", "X1I_HON_Medlab_Chinook.txt");
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GuardTower_Sniper_Target_JDG, "wave_location:vector3, delete_location:vector3")
- {
- Vector3 runToPosition;
- Vector3 leavePosition;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(runToPosition, 1);
- SAVE_VARIABLE(leavePosition, 2);
- }
- void Created( GameObject * obj )
- {
- runToPosition = Get_Vector3_Parameter("wave_location");
- leavePosition = Get_Vector3_Parameter("delete_location");
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( runToPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
- //if (spawn_effect)
- //{
- // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
- //}
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_FACING_SPECIFIED_DIRECTION_01_JDG)
- {
- char *animationName = M01_Choose_Search_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- switch (complete_reason)
- {
- case ACTION_COMPLETE_NORMAL:
- {
- switch (action_id)
- {
- case M01_WALKING_WAYPATH_01_JDG:
- {
- params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Attack( STAR, 0, 0, true );
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 1 );
- }
- break;
- case M01_DOING_ANIMATION_01_JDG:
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( leavePosition, RUN, 5);
- Commands->Action_Goto ( obj, params );
- }
- break;
- case M01_WALKING_WAYPATH_02_JDG:
- {
- Commands->Destroy_Object ( obj );
- }
- break;
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Gunboat_Spawn_Hovercraft_Zone_JDG, "")//this guys id is 102500
- {
- /*bool okay_to_trigger;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_trigger, 1);
- }
- void Created( GameObject * obj )
- {
- okay_to_trigger = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- okay_to_trigger = true;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (okay_to_trigger == true)
- {
- if (enterer == Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_THE_MEDIUM_TANK_JDG, 0 );
- }
- }
- }*/
- };
- DECLARE_SCRIPT(M01_BasalBuilding_Population_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- float myHomeRadius = Commands->Get_Random ( 2, 10 );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRadius );
- }
- };
- DECLARE_SCRIPT(M01_HarvesterScript_New_JDG, "")
- {
- int animation_count;
- bool damagedYet;
- bool deadYet;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(animation_count, 1);
- SAVE_VARIABLE(damagedYet, 2);
- SAVE_VARIABLE(deadYet, 3);
- }
- void Created( GameObject * obj )
- {
- animation_count = 0;
- damagedYet = false;
- deadYet = false;
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- Vector3 loc (-103.5f, 375.6f, 19.0f);
- loc.X += Commands->Get_Random(-1.0f, 1.0f);
- loc.Y += Commands->Get_Random(-1.0f, 1.0f);
- params.Set_Movement(loc, 0.25f, 1);
- Commands->Action_Goto(obj, params);
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj && damager == STAR)
- {
- if (damagedYet == false)
- {
- if (deadYet == false)
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_START_ACTING_JDG, 0.25 );
- }
- damagedYet = true;
-
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- if (deadYet == false)
- {
- int lockeHarvester = Commands->Create_Conversation( "M01_Add_Harvester_Objective", 100, 1000, true);
- Commands->Join_Conversation( NULL, lockeHarvester, false, false );
- Commands->Start_Conversation( lockeHarvester, lockeHarvester );
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- deadYet = true;
- Commands->Create_Sound ( "EVA_Nod_Unit_Destroyed", Vector3 (0,0,0), obj);
- Vector3 HarvesterDeathSpot (-93.9f, 426.6f, 21.0f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", HarvesterDeathSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- }
- void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- animation_count = 0;
- Commands->Set_Animation(obj, "V_NOD_HRVSTR.V_NOD_HRVSTR", false);
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (animation_count <= 2)
- {
- Commands->Set_Animation(obj, "V_NOD_HRVSTR.V_NOD_HRVSTR", false);
- animation_count++;
- }
- else
- {
- Gather_Tiberium();
- }
- }
- void Gather_Tiberium(void)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- Vector3 loc (-103.5f, 375.6f, 19.0f);
- loc.X += Commands->Get_Random(-3.0f, 3.0f);
- loc.Y += Commands->Get_Random(-3.0f, 3.0f);
- params.Set_Movement(loc, 0.25f, 2);
- Commands->Action_Goto(Owner(), params);
- }
- };
- DECLARE_SCRIPT(M01_TibField_Guard01_New_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_START_ACTING_JDG)
- {
- GameObject * chemGuy01 = Commands->Find_Object ( 103270 );
- GameObject * chemGuy02 = Commands->Find_Object ( 103271 );
- GameObject * chemGuy03 = Commands->Find_Object ( 103272 );
- if (chemGuy01 != NULL)
- {
- if (chemGuy02 != NULL)
- {
- if (chemGuy03 != NULL)
- {
- int tibFieldConv = Commands->Create_Conversation( "M01_TiberiumField_Conversation", 80, 25, true);
- Commands->Join_Conversation( chemGuy01, tibFieldConv);
- Commands->Join_Conversation( chemGuy02, tibFieldConv);
- Commands->Join_Conversation( chemGuy03, tibFieldConv);
- Commands->Start_Conversation( tibFieldConv, tibFieldConv );
- }
- }
- }
- }
- }
-
- };
- DECLARE_SCRIPT(M01_Barn_Babushkas_Conversation_Zone_JDG, "")//this guys ID is 101662
- {
- bool okay_to_play_conversation;
- bool playerEntered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_play_conversation, 1);
- SAVE_VARIABLE(playerEntered, 2);
- }
- void Created( GameObject * obj )
- {
- okay_to_play_conversation = false;
- playerEntered = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//babushka is in position--give okay for conversation
- {
- okay_to_play_conversation = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
- }
- else if (param == M01_CUE_BABUSHKA_CONVERSATION_JDG)
- {
- if (playerEntered == true && okay_to_play_conversation == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
- GameObject * babushkaZone = Commands->Find_Object ( 101662 );
- GameObject * billyZone = Commands->Find_Object ( 101661 );
- if (babushkaZone != NULL)
- {
- Commands->Destroy_Object ( babushkaZone );//this is one-time only zone--cleaning up
- }
- if (billyZone != NULL)
- {
- Commands->Destroy_Object ( billyZone );//this is one-time only zone--cleaning up
- }
- }
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- playerEntered = false;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- playerEntered = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_Point_Guard_01_JDG, "")//this guys ID is 101439
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- if (Commands->Find_Object ( 101658 ))
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101658 ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );//this is sent to his nearby buddy
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_Barn_Point_Guard_02_JDG, "")//this guys ID is 101658
- {
- bool retreating;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(retreating, 1);
- }
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- retreating = false;
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 2.0f );
- }
- /*void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3 (-44.8f, 117.8f, 2.6f), .8f, 1 );
- params.Set_Attack( STAR, 15, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- }*/
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR)
- {
- if (obj && retreating == false)
- {
- if (Commands->Get_Health (obj) > 0)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Sound ( "WereOutGunned_2", myPosition, obj );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- //ActionParamsStruct params;
- //params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- //params.Set_Movement( Commands->Find_Object ( M01_BARN_PRISONER_01_ID ), 1, 5 );
- //params.Set_Attack( STAR, 50, 0, true );
- //Commands->Action_Attack ( obj, params );
- retreating = true;
- }
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_Barn_Door_Guard_JDG, "")//this guys ID is M01_BARN_DOOR_GUARD_ID 101512
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5.0f );
- }
- //void Damaged( GameObject * obj, GameObject * damager, float amount )
- //{
- // Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
- //}
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_Barn_Talk_Guard_01_JDG, "")//this guys ID is M01_BARN_TALK_GUARD_01_ID 103318
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5.0f );
- }
- //void Damaged( GameObject * obj, GameObject * damager, float amount )
- //{
- // Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_START_BARN_OBJECTIVE_JDG, 0 );
- //}
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_BARN_GUARD_IS_DEAD_JDG, 0 );
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_AI_ExitZone_JDG, "")//112015 -- tunnel 112016 -- shack
- {
- int hovercraftGuyId;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hovercraftGuyId, 1);
- }
- void Created( GameObject * obj )
- {
- hovercraftGuyId = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == M01_ROPE_IS_SENDING_ID_JDG)
- {
- hovercraftGuyId = param;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- GameObject * hovercraftGuy = Commands->Find_Object ( hovercraftGuyId );
- if (hovercraftGuy != NULL && enterer == hovercraftGuy)
- {
- Commands->Send_Custom_Event( obj, hovercraftGuy, 0, M01_HOLD_YOUR_POSITION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_GDI_Guy_01_JDG, "")//
- {
- int turretbeach_conv;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(turretbeach_conv, 1);
- }
- void Created( GameObject * obj )
- {
- int myId = Commands->Get_ID ( obj );
- GameObject * myExitZone01 = Commands->Find_Object ( 112015 );
- GameObject * myExitZone02 = Commands->Find_Object ( 112016 );
- if (myExitZone01 != NULL)
- {
- Commands->Send_Custom_Event( obj, myExitZone01, M01_ROPE_IS_SENDING_ID_JDG, myId, 0 );
- }
- if (myExitZone02 != NULL)
- {
- Commands->Send_Custom_Event( obj, myExitZone02, M01_ROPE_IS_SENDING_ID_JDG, myId, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_HOLD_YOUR_POSITION_JDG)
- {
- ActionParamsStruct params;
- Commands->Action_Reset ( obj, 100 );
- Vector3 myGuardSpot (-49.146f, 201.741f, 1.590f);
- params.Set_Basic( this, 55, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myGuardSpot, RUN, 1 );
- Commands->Action_Goto( obj, params );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myGuardSpot, 5 );
- }
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.H_A_X1E_Run") == 0)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_HUNT_THE_PLAYER_JDG);
- params.Set_Movement(STAR, RUN, 6);
- Commands->Action_Goto(obj, params);
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_HUNT_THE_PLAYER_JDG)
- {
- turretbeach_conv = Commands->Create_Conversation( "M01_TurretBeach_TurnOverTank_Conversation", 100, 50, true);
- Commands->Join_Conversation( obj, turretbeach_conv, true, true );
- Commands->Start_Conversation( turretbeach_conv, turretbeach_conv );
- Commands->Monitor_Conversation (obj, turretbeach_conv);
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == turretbeach_conv)
- {
- params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(Vector3 (-49.7f, 109.7f, 2.0f), RUN, 0.5f);
- Commands->Action_Goto(obj, params);
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_GDI_Guy_02_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.H_A_X1E_Run") == 0)
- {
- ActionParamsStruct params;
- GameObject * nearbyTailgun = Commands->Find_Object ( 101448 );
- if (nearbyTailgun != NULL)
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(nearbyTailgun, RUN, 0.5f);
- Commands->Action_Goto(obj, params);
- }
- else
- {
- params.Set_Basic(this, 80, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(Vector3 (-65.4f, 204.6f, 3.7f), RUN, 0.5f);
- Commands->Action_Goto(obj, params);
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 10 );
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionPen_CivDeathMonitor, "")
- {
- bool damagedYet;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(damagedYet, 1);
- }
- void Created( GameObject * obj )
- {
- damagedYet = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj && damagedYet == false)
- {
- damagedYet = true;
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0512I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0513I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Mission_Complete ( false );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103380 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_GOING_TO_EVAC_SPOT02_JDG:
- {
- Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( 103380 ) );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT02_JDG);
- params.Set_Movement(myEvacSpot, RUN, 0.25f);
- Commands->Action_Goto(obj, params);
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionPen_GDIDeathMonitor, "")
- {
- bool damagedYet;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(damagedYet, 1);
- }
- void Created( GameObject * obj )
- {
- damagedYet = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj && damagedYet == false)
- {
- damagedYet = true;
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0512I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0513I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Mission_Complete ( false );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103380 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_GOING_TO_EVAC_SPOT02_JDG:
- {
- Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( 103381 ) );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT02_JDG);
- params.Set_Movement(myEvacSpot, RUN, 0.25f);
- Commands->Action_Goto(obj, params);
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionPen_Evac_Controller01_JDG, "")//103380
- {
- //civGuy01 = 101929
- //civGuy02 = 101930
- //civGuy03 = 101931
- int evac_waypath_id;
- int evac_helicopter_id;
- int deadPrisonerTally;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(evac_waypath_id, 1);
- SAVE_VARIABLE(evac_helicopter_id, 2);
- SAVE_VARIABLE(deadPrisonerTally, 3);
- }
- void Created( GameObject * obj )
- {
- deadPrisonerTally = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_START_ACTING_JDG)//prisoner have been freed--call in air evac
- {
- GameObject * civGuy01 = Commands->Find_Object ( 101929 );
- GameObject * civGuy02 = Commands->Find_Object ( 101930 );
- GameObject * civGuy03 = Commands->Find_Object ( 101931 );
- if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
- {
- //Vector3 evacPosition = Commands->Get_Position ( obj );
- //GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- //Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_Detention_EvacAnim.txt");
- }
- }
- else if (param == M01_CIVILIAN_KILLED_JDG)
- {
- deadPrisonerTally++;
- if (deadPrisonerTally == 1)
- {
- Commands->Mission_Complete ( false );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)//civs are on board--send aircraft away
- {
- GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
- GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacWaypath != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionCiv_Air_Evac_Waypath_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathA") == 0)
- {
- Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_Pathloop", true );
- }
- else if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionCiv_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsA") == 0)
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsloop", true );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- GameObject * civGuy01 = Commands->Find_Object ( 101929 );
- GameObject * civGuy02 = Commands->Find_Object ( 101930 );
- GameObject * civGuy03 = Commands->Find_Object ( 101931 );
- if (civGuy01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, civGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (civGuy02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, civGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (civGuy03 != NULL)
- {
- Commands->Send_Custom_Event ( obj, civGuy03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * civGuy01 = Commands->Find_Object ( 101929 );
- GameObject * civGuy02 = Commands->Find_Object ( 101930 );
- GameObject * civGuy03 = Commands->Find_Object ( 101931 );
- if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else
- {
- GameObject * civController = Commands->Find_Object ( 103380 );
- if (civController != NULL)
- {
- Commands->Send_Custom_Event ( obj, civController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionPen_Evac_Controller02_JDG, "")//103381
- {
- //gdiGuy01 = 101926
- //gdiGuy02 = 101927
- //gdiGuy03 = 101928
- int evac_waypath_id;
- int evac_helicopter_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(evac_waypath_id, 1);
- SAVE_VARIABLE(evac_helicopter_id, 2);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_START_ACTING_JDG)//prisoner have been freed--call in air evac
- {
- GameObject * civGuy01 = Commands->Find_Object ( 101929 );
- GameObject * civGuy02 = Commands->Find_Object ( 101930 );
- GameObject * civGuy03 = Commands->Find_Object ( 101931 );
- if ((civGuy01 != NULL) || (civGuy02 != NULL) || (civGuy03 != NULL) )
- {
- //Vector3 evacPosition = Commands->Get_Position ( obj );
- //GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- //Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_Detention_EvacAnim.txt");
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)//civs are on board--send aircraft away
- {
- GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
- GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacWaypath != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionGDI_Air_Evac_Waypath_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathA") == 0)
- {
- Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_Pathloop", true );
- }
- else if (stricmp(anim, "XG_TransprtBone.XG_EV1_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Set_Animation ( obj, "XG_TransprtBone.XG_EV1_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_DetentionGDI_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsA") == 0)
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsloop", true );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- GameObject * GDIGuy01 = Commands->Find_Object ( 101926 );
- GameObject * GDIGuy02 = Commands->Find_Object ( 101927 );
- GameObject * GDIGuy03 = Commands->Find_Object ( 101928 );
- if (GDIGuy01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, GDIGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (GDIGuy02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, GDIGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (GDIGuy03 != NULL)
- {
- Commands->Send_Custom_Event ( obj, GDIGuy03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV1_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV1_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * GDIGuy01 = Commands->Find_Object ( 101926 );
- GameObject * GDIGuy02 = Commands->Find_Object ( 101927 );
- GameObject * GDIGuy03 = Commands->Find_Object ( 101928 );
- if ((GDIGuy01 != NULL) || (GDIGuy02 != NULL) || (GDIGuy03 != NULL) )
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else
- {
- GameObject * civController = Commands->Find_Object ( 103381 );
- if (civController != NULL)
- {
- Commands->Send_Custom_Event ( obj, civController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_Chinook_Reinforcement_Guy_JDG, "")//
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Vector3 offset;
- offset.X = Commands->Get_Random(1, 3);
- offset.Y = Commands->Get_Random(1, 3);
- offset.Z = 0;
- ActionParamsStruct params;
- params.Set_Basic(this, 100, 10);
- params.Set_Movement(Commands->Get_Position(obj) + offset, 1.0f, 0.25f);
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_HUNT_THE_PLAYER_JDG, 1 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Hunt_The_Player_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Start_Timer ( obj, this, 60, M01_GOTO_IDLE_JDG );
- Commands->Start_Timer ( obj, this, 5, M01_HUNT_THE_PLAYER_JDG );
- ActionParamsStruct params;
- params.Set_Basic( this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Movement( STAR, RUN, 1, false );
- Commands->Action_Goto ( obj, params );
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- if (timer_id == M01_GOTO_IDLE_JDG)
- {
- Commands->Enable_Hibernation( obj, true );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float distanceFromStar = Commands->Get_Distance ( myPosition, playerPosition );
- if (distanceFromStar >= 80)
- {
- bool visible = Commands->Is_Object_Visible( obj, STAR );
- if (visible != true)
- {
- Commands->Apply_Damage( obj, 100000, "BlamoKiller", NULL );
- }
- else
- {
- Commands->Start_Timer ( obj, this, 20, M01_GOTO_IDLE_JDG );
- }
- }
- else
- {
- Commands->Start_Timer ( obj, this, 20, M01_GOTO_IDLE_JDG );
- }
- }
- else if (timer_id == M01_HUNT_THE_PLAYER_JDG)
- {
- if (obj)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 45, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Movement( STAR, RUN, 1, false );
- Commands->Action_Goto ( obj, params );
- Commands->Start_Timer ( obj, this, 5, M01_HUNT_THE_PLAYER_JDG );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Commander_JDG, "")//103373
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_START_ACTING_JDG)//here come the mct escorts--run into mct room
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myHomeSpot(-181.1f, 541.4f, 3.5f);
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(myHomeSpot, RUN, 0.25f);
- Commands->Action_Goto(obj, params);
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- ActionParamsStruct params;
- params.Set_Basic(this, 45, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( STAR, 50, 0, false );
- Commands->Action_Attack (obj, params);
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Protector01_JDG, "")//103374
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- };
- DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_Protector02_JDG, "")//103375
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- };
- DECLARE_SCRIPT(M01_HON_Engineer02_JDG, "")//101948
- {
- bool repairSoundPlaying;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(repairSoundPlaying, 1);
- }
- void Created( GameObject * obj )
- {
- repairSoundPlaying = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
- {
- Commands->Enable_Hibernation( obj, false );
- Vector3 myRepairSpot (-178.925f, 542.943f, 4.932f);
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myRepairSpot, 10, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Start_Timer ( obj, this, 2, M01_START_ACTING_JDG );
- }
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- if (timer_id == M01_START_ACTING_JDG)
- {
- Commands->Enable_Hibernation( obj, true );
-
- Commands->Action_Reset ( obj, 100 );
- Vector3 repair_sound_spot (-175.074f, 533.086f, 19.327f);
-
- GameObject * handOfNod = Commands->Find_Object ( M01_HAND_OF_NOD_JDG );
- float hon_max_health = Commands->Get_Max_Health ( handOfNod );
- float hon_max_shield = Commands->Get_Max_Shield_Strength ( handOfNod );
- float hon_current_health = Commands->Get_Health ( handOfNod );
- if (hon_current_health > 0)
- {
- Commands->Set_Health ( handOfNod, hon_max_health );
- Commands->Set_Shield_Strength ( handOfNod, hon_max_shield );
- if (repairSoundPlaying == false)
- {
- Commands->Create_Sound ( "CnC_Healer_Sound", repair_sound_spot, obj );
-
- repairSoundPlaying = true;
- Commands->Start_Timer ( obj, this, 5, M01_GOTO_IDLE_JDG );
- }
- }
- }
- else if (timer_id == M01_GOTO_IDLE_JDG)
- {
- repairSoundPlaying = false;
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_03_GDI_JDG, "")
- {
- int buggy_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(buggy_id, 1);
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Vector3 myHomeSpot(-209.853f, 505.532f, 4.017f);//going to hand of nod backside
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(myHomeSpot, RUN, 3);
- Commands->Action_Goto(obj, params);
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- GameObject * buggyController = Commands->Find_Object ( 103367 );
- if (buggyController != NULL)
- {
- Commands->Send_Custom_Event ( obj, buggyController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == M01_MODIFY_YOUR_ACTION_JDG)
- {
- buggy_id = param;
- GameObject * buggy = Commands->Find_Object ( buggy_id );
- if (buggy != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
- params.Set_Attack( buggy, 20, 3, true );
- Commands->Action_Attack( obj, params );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_04_GDI_JDG, "")
- {
- int buggy_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(buggy_id, 1);
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Vector3 myHomeSpot(-204.157f, 508.650f, 4.017f);//going to hand of nod backside
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(myHomeSpot, RUN, 3);
- Commands->Action_Goto(obj, params);
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == M01_MODIFY_YOUR_ACTION_JDG)
- {
- buggy_id = param;
- GameObject * buggy = Commands->Find_Object ( buggy_id );
- if (buggy != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
- params.Set_Attack( buggy, 20, 3, true );
- Commands->Action_Attack( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- GameObject * buggyController = Commands->Find_Object ( 103367 );
- if (buggyController != NULL)
- {
- Commands->Send_Custom_Event ( obj, buggyController, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BuggyNew_Controller_JDG, "")//this guys id is 103367
- {
- int buggy_id;
- bool gdi_minigunner_01_inPlace;
- bool gdi_minigunner_02_inPlace;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(buggy_id, 1);
- SAVE_VARIABLE(gdi_minigunner_01_inPlace, 2);
- SAVE_VARIABLE(gdi_minigunner_02_inPlace, 3);
- }
- void Created( GameObject * obj )
- {
- gdi_minigunner_01_inPlace = false;
- gdi_minigunner_02_inPlace = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_START_ACTING_JDG)
- {
- Vector3 spawnLocation (-233.946f, 494.424f, 5.234f);
- GameObject *buggy = Commands->Create_Object("Nod_Buggy", spawnLocation);
- Commands->Set_Facing ( buggy, -135 );
- Commands->Attach_Script(buggy, "M01_BuggyScript_New_JDG", "");
- buggy_id = Commands->Get_ID ( buggy );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- gdi_minigunner_01_inPlace = true;
- int minigunner01_id = Commands->Get_ID ( sender );
- GameObject *buggy = Commands->Find_Object ( buggy_id );
- if (buggy != NULL)
- {
- Commands->Send_Custom_Event ( obj, buggy, M01_MODIFY_YOUR_ACTION_02_JDG, minigunner01_id, 0 );
- Commands->Send_Custom_Event ( obj, sender, M01_MODIFY_YOUR_ACTION_JDG, buggy_id, 0 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
- {
- gdi_minigunner_02_inPlace = true;
- int minigunner02_id = Commands->Get_ID ( sender );
- GameObject *buggy = Commands->Find_Object ( buggy_id );
- if (buggy != NULL)
- {
- Commands->Send_Custom_Event ( obj, buggy, M01_MODIFY_YOUR_ACTION_03_JDG, minigunner02_id, 0 );
- Commands->Send_Custom_Event ( obj, sender, M01_MODIFY_YOUR_ACTION_JDG, buggy_id, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BuggyScript_New_JDG, "")
- {
- int minigunner01_id;
- int minigunner02_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(minigunner01_id, 1);
- SAVE_VARIABLE(minigunner02_id, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.WaypointStartID = 103290;
- params.AttackActive = false;
- Commands->Action_Attack( obj, params );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- float myNewHealth = myMaxHealth / 2;
- Commands->Set_Health ( obj, myNewHealth );
- float myMaxShield = Commands->Get_Max_Shield_Strength ( obj );
- float myNewShield = myMaxShield / 2;
- Commands->Set_Shield_Strength ( obj, myNewShield );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Create_Sound ( "EVA_Nod_Unit_Destroyed", Vector3 (0,0,0), obj);
-
- Vector3 buggyDeathSpot (-217.0f, 499.4f, 4.0f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", buggyDeathSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.AttackActive = false;
- Commands->Action_Attack( obj, params );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 1 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == M01_MODIFY_YOUR_ACTION_02_JDG)
- {
- minigunner01_id = param;
- Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
- }
- else if (type == M01_MODIFY_YOUR_ACTION_03_JDG)
- {
- minigunner02_id = param;
- Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.Set_Attack( STAR, 50, 2, true );
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)
- {
- GameObject * minigunner01 = Commands->Find_Object ( minigunner01_id );
- GameObject * minigunner02 = Commands->Find_Object ( minigunner02_id );
- if (minigunner01 != NULL)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.Set_Attack( minigunner01, 50, 2, true );
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
- }
- else if (minigunner02 != NULL)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.Set_Attack( minigunner02, 50, 2, true );
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
- }
- else
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), 0.5f, 5 );
- params.WaypathID = 103289;
- params.Set_Attack( STAR, 50, 2, true );
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_01_JDG, params, false, true );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Priest_Conversation_Zone_JDG, "")//this guys ID is 103395 M01_PriestReminder_Conversation
- {
- bool okay_to_play_conversation;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_play_conversation, 1);
- }
- void Created( GameObject * obj )
- {
- okay_to_play_conversation = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//priest is in position--give okay for conversation
- {
- okay_to_play_conversation = true;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (okay_to_play_conversation == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_PRIEST_CONVERSATION_JDG, 0 );
- Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Loveshack_Nun_Conversation_Zone_JDG, "")//this guys ID is 101368
- {
- bool okay_to_play_conversation;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_play_conversation, 1);
- }
- void Created( GameObject * obj )
- {
- okay_to_play_conversation = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//nun is in position--give okay for conversation
- {
- okay_to_play_conversation = true;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (okay_to_play_conversation == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG, 0 );
- Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Interior_Nun_Conversation_Zone_JDG, "")//this guys ID is #101370
- {
- bool okay_to_play_conversation;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okay_to_play_conversation, 1);
- }
- void Created( GameObject * obj )
- {
- okay_to_play_conversation = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ((param == M01_START_ACTING_JDG))//nun is in position--give okay for conversation
- {
- okay_to_play_conversation = true;
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- if (okay_to_play_conversation == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_INTERIOR_NUN_CONVERSATION_JDG, 0 );
- Commands->Destroy_Object ( obj );//this is one-time only zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Guard_MiniGunner_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- if (obj)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( STAR, WALK, 5 );
- params.Set_Attack( STAR, 15, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_GUARD_IS_DEAD_JDG, 0 );
- GameObject * havocExitZone = Commands->Find_Object ( 103393 );
- if (havocExitZone != NULL)
- {
- Commands->Send_Custom_Event( obj, havocExitZone, 0, M01_CHURCH_GUARD_IS_DEAD_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Loveshack_InterrogationConv_Zone_JDG, "")//103392
- {
- bool conversation_triggered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(conversation_triggered, 1);
- }
- void Created( GameObject * obj )
- {
- conversation_triggered = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR && conversation_triggered == false)
- {
- conversation_triggered = true;
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- GameObject * loveshackGuard = Commands->Find_Object ( M01_CHURCH_LOVESHACK_MINIGUNNER_ID );
- if ((loveshackNun != NULL) && (loveshackGuard != NULL))
- {
- int loveshackConv = Commands->Create_Conversation( "M01_Loveshack_Conversation_JDG", 90, 50, true);
- Commands->Join_Conversation( loveshackGuard, loveshackConv, false, true, true );
- Commands->Join_Conversation( loveshackNun, loveshackConv, false, true, true );
- Commands->Start_Conversation( loveshackConv, loveshackConv );
- }
- Commands->Destroy_Object ( obj );//cleaning up this zone
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_Escort_Conversation_Controller_GDI, "")//103396
- {
- bool first_time_at_escort_limit;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(first_time_at_escort_limit, 1);
- }
- void Created( GameObject * obj )
- {
- first_time_at_escort_limit = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//gdi escort has been poked to follow player
- {
- int random = Commands->Get_Random_Int(0, 3);
- if (random == 0)
- {
- int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes01", 90, 50, true);
- Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
- Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
- Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
- }
- else if (random == 1)
- {
- int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes02", 90, 50, true);
- Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
- Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
- Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
- }
- else
- {
- int pokeYesConv01 = Commands->Create_Conversation( "M01_GDI_Escort_Yes03", 90, 50, true);
- Commands->Join_Conversation( STAR, pokeYesConv01, false, false, false );
- Commands->Join_Conversation( sender, pokeYesConv01, false, false, false );
- Commands->Start_Conversation( pokeYesConv01, pokeYesConv01 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//gdi escort has been poked to stop following player
- {
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//gdi escort has reached his escort limits
- {
- if (first_time_at_escort_limit == true)
- {
- first_time_at_escort_limit = false;
- int pokeLimitConv01 = Commands->Create_Conversation( "M01_GDI_Escort_MustStayHere01", 90, 50, true);
- Commands->Join_Conversation( sender, pokeLimitConv01, false, false, false );
- Commands->Join_Conversation( STAR, pokeLimitConv01, false, false, false );
- Commands->Start_Conversation( pokeLimitConv01, pokeLimitConv01 );
- }
- else
- {
- int pokeLimitConv01 = Commands->Create_Conversation( "M01_GDI_Escort_MustStayHere02", 90, 50, true);
- Commands->Join_Conversation( sender, pokeLimitConv01, false, false, false );
- Commands->Join_Conversation( STAR, pokeLimitConv01, false, false, false );
- Commands->Start_Conversation( pokeLimitConv01, pokeLimitConv01 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_CHURCH_Chinook_Spawned_Soldier01_GDI, "")
- {
- typedef enum {
- ESCORTING,
- NOT_ESCORTING,
-
- } M01_State;
- M01_State thisGuysState;
- int initialEscortConv;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(thisGuysState, 1);
- SAVE_VARIABLE(initialEscortConv, 2);
- }
- void Created( GameObject * obj )
- {
- thisGuysState = NOT_ESCORTING;
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (thisGuysState == ESCORTING)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(STAR, RUN, 5);
- Commands->Action_Goto(obj, params);
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- if (obj && STAR)
- {
- initialEscortConv = Commands->Create_Conversation( "M01_FirstEscort_Conversation", 100, 50, true);
- Commands->Join_Conversation( obj, initialEscortConv, true, true, true );
- Commands->Join_Conversation( STAR, initialEscortConv, true, true, true );
- Commands->Start_Conversation( initialEscortConv, initialEscortConv );
- Commands->Monitor_Conversation (obj, initialEscortConv);
- }
- }
- if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- }
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == initialEscortConv)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
-
- if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState != ESCORTING) )
- {
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-139.048f, 318.861f, 9.066f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-81.160f, 333.117f, 10.131f);
- }
- else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
- {
- homeSpot.Set (-138.786f, 388.250f, 15.093f);
- }
- else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
- {
- homeSpot.Set (-140.785f, 348.389f, 21.931f);
- }
- else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
- {
- homeSpot.Set (-140.792f, 342.980f, 10.387f);
- }
- else
- {
- homeSpot.Set (-126.169f, 335.223f, 8.997f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
- params.Set_Basic(this, 50, M01_PICK_A_NEW_LOCATION_JDG);
- params.Set_Movement(homeSpot, RUN, 3);
- Commands->Action_Goto(obj, params);
- float delayTimer = Commands->Get_Random ( 10, 60 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- thisGuysState = ESCORTING;
- }
- else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
- {
- Commands->Action_Reset ( obj, 100 );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- thisGuysState = NOT_ESCORTING;
- }
- else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
- {
- GameObject * myTarget = Commands->Find_Object ( param );
- if (myTarget != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( myTarget, RUN, 5 );
- params.AttackActive = true;
- params.Set_Attack (myTarget, 50, 0, true);
-
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_01_JDG) && (thisGuysState == ESCORTING))
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- thisGuysState = NOT_ESCORTING;
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-160.217f, 446.353f, 34.976f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-173.371f, 437.383f, 29.711f);
- }
- else
- {
- homeSpot.Set (-138.958f, 435.696f, 27.001f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
- params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(homeSpot, WALK, 3);
- Commands->Action_Goto(obj, params);
-
- }
- else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_02_JDG) && (thisGuysState == ESCORTING))
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- thisGuysState = NOT_ESCORTING;
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-36.192f, 319.671f, 5.226f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-49.614f, 363.304f, 10.816f);
- }
- else
- {
- homeSpot.Set (-66.361f, 339.288f, 8.772f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
- params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(homeSpot, WALK, 3);
- Commands->Action_Goto(obj, params);
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- ActionParamsStruct params;
- if (thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( enemy, RUN, 5 );
- params.Set_Attack( enemy, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if (damager != NULL)
- {
- int attackersType = Commands->Get_Player_Type ( damager );
- if (attackersType != SCRIPT_PLAYERTYPE_NOD)
- {
- }
- else
- {
- if (thisGuysState == ESCORTING && damager != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( damager, RUN, 5 );
- params.Set_Attack( damager, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_CHURCH_Chinook_Spawned_Soldier02_GDI, "")
- {
- typedef enum {
- ESCORTING,
- NOT_ESCORTING,
-
- } M01_State;
- M01_State thisGuysState;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(thisGuysState, 1);
- }
- void Created( GameObject * obj )
- {
- thisGuysState = NOT_ESCORTING;
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (thisGuysState == ESCORTING)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- }
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
-
- if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState != ESCORTING) )
- {
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-139.048f, 318.861f, 9.066f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-81.160f, 333.117f, 10.131f);
- }
- else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
- {
- homeSpot.Set (-138.786f, 388.250f, 15.093f);
- }
- else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
- {
- homeSpot.Set (-140.785f, 348.389f, 21.931f);
- }
- else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
- {
- homeSpot.Set (-140.792f, 342.980f, 10.387f);
- }
- else
- {
- homeSpot.Set (-126.169f, 335.223f, 8.997f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
- params.Set_Basic(this, 50, M01_PICK_A_NEW_LOCATION_JDG);
- params.Set_Movement(homeSpot, RUN, 3);
- Commands->Action_Goto(obj, params);
- float delayTimer = Commands->Get_Random ( 10, 60 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- thisGuysState = ESCORTING;
- }
- else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
- {
- Commands->Action_Reset ( obj, 100 );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- thisGuysState = NOT_ESCORTING;
- }
- else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
- {
- GameObject * myTarget = Commands->Find_Object ( param );
- if (myTarget != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( myTarget, RUN, 5 );
- params.AttackActive = true;
- params.Set_Attack (myTarget, 50, 0, true);
-
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_01_JDG) && (thisGuysState == ESCORTING))
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- thisGuysState = NOT_ESCORTING;
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-160.217f, 446.353f, 34.976f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-173.371f, 437.383f, 29.711f);
- }
- else
- {
- homeSpot.Set (-138.958f, 435.696f, 27.001f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
- params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(homeSpot, WALK, 3);
- Commands->Action_Goto(obj, params);
- }
- else if ((param == M01_PLAYER_IS_LEAVING_CHURCH_02_JDG) && (thisGuysState == ESCORTING))
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- thisGuysState = NOT_ESCORTING;
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 3.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-36.192f, 319.671f, 5.226f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-49.614f, 363.304f, 10.816f);
- }
- else
- {
- homeSpot.Set (-66.361f, 339.288f, 8.772f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 3 );
- params.Set_Basic(this, 50, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(homeSpot, WALK, 3);
- Commands->Action_Goto(obj, params);
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- ActionParamsStruct params;
- if (thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( enemy, RUN, 5 );
- params.Set_Attack( enemy, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if (damager != NULL)
- {
- int attackersType = Commands->Get_Player_Type ( damager );
- if (attackersType != SCRIPT_PLAYERTYPE_NOD)
- {
- }
- else
- {
- if (thisGuysState == ESCORTING && damager != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( damager, RUN, 5 );
- params.Set_Attack( damager, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_COMM_Chinook_Spawned_Soldier_GDI, "")
- {
- typedef enum {
- ESCORTING,
- NOT_ESCORTING,
-
- } M01_State;
- M01_State thisGuysState;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(thisGuysState, 1);
- }
- void Created( GameObject * obj )
- {
- thisGuysState = NOT_ESCORTING;
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_GDI_GUY_HAS_BEEN_POKED_JDG, 0 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (thisGuysState == ESCORTING)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYERS_ESCORT_HAS_BEEN_KILLED_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 0 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_GOING_TO_HAVOC_JDG && thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- }
- }
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- ActionParamsStruct params;
-
- if ((param == M01_PICK_A_NEW_LOCATION_JDG) && (thisGuysState == NOT_ESCORTING) )
- {
- Vector3 homeSpot;
- Commands->Action_Reset ( obj, 100 );
- float pick_my_home_spot = Commands->Get_Random ( 0.5f, 6.5f );
- if (pick_my_home_spot >= 0.5 && pick_my_home_spot < 1.5)
- {
- homeSpot.Set (-277.309f, 468.428f, 18.553f);
- }
- else if (pick_my_home_spot >= 1.5 && pick_my_home_spot < 2.5)
- {
- homeSpot.Set (-271.237f, 535.962f, 27.935f);
- }
- else if (pick_my_home_spot >= 2.5 && pick_my_home_spot < 3.5)
- {
- homeSpot.Set (-247.278f, 563.557f, 30.610f);
- }
- else if (pick_my_home_spot >= 3.5 && pick_my_home_spot < 4.5)
- {
- homeSpot.Set (-296.349f, 583.760f, 27.739f);
- }
- else if (pick_my_home_spot >= 4.5 && pick_my_home_spot < 5.5)
- {
- homeSpot.Set (-313.597f, 568.022f, 27.740f);
- }
- else
- {
- homeSpot.Set (-301.160f, 523.405f, 16.583f);
- }
- Commands->Set_Innate_Soldier_Home_Location ( obj, homeSpot, 10 );
- params.Set_Basic(this, 50, 20);
- params.Set_Movement(homeSpot, RUN, 3);
- Commands->Action_Goto(obj, params);
- float delayTimer = Commands->Get_Random ( 10, 60 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, delayTimer );
- }
- else if (param == M01_PLEASE_START_ESCORTING_PLAYER_JDG)
- {
- GameObject * escortDialogController = Commands->Find_Object ( 103396 );
- if (escortDialogController != NULL)
- {
- Commands->Send_Custom_Event( obj, escortDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( STAR, RUN + 0.2f, 2 );
- Commands->Action_Attack (obj, params);
- thisGuysState = ESCORTING;
- }
- else if (param == M01_PLEASE_STOP_ESCORTING_PLAYER_JDG)
- {
- Commands->Action_Reset ( obj, 100 );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- thisGuysState = NOT_ESCORTING;
- }
- else if ((type == M01_PLAYER_IS_ATTACKING_ME_JDG) && (thisGuysState == ESCORTING) )
- {
- GameObject * myTarget = Commands->Find_Object ( param );
- if (myTarget != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( myTarget, RUN, 5 );
- params.AttackActive = true;
- params.Set_Attack (myTarget, 50, 0, true);
-
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- Commands->Debug_Message ( "**********************Player's escort has received orders to attack havocs target\n" );
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- ActionParamsStruct params;
- if (thisGuysState == ESCORTING)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( enemy, RUN, 5 );
- params.Set_Attack( enemy, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- ActionParamsStruct params;
- if (damager != NULL)
- {
- int attackersType = Commands->Get_Player_Type ( damager );
- if (attackersType != SCRIPT_PLAYERTYPE_NOD)
- {
- }
- else
- {
- if (thisGuysState == ESCORTING && damager != NULL)
- {
- params.Set_Basic( this, 100, M01_GOING_TO_HAVOC_JDG );
- params.Set_Movement( damager, RUN, 5 );
- params.Set_Attack( damager, 50, 0, true );
- params.AttackActive = true;
- params.AttackCheckBlocked = true;
- Commands->Modify_Action ( obj, M01_GOING_TO_HAVOC_JDG, params, true, true );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_Truck_JDG, "")//
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Explosion ( "Explosion_Vehicle", myPosition, NULL );
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_EvacMonitor_JDG, "")//M01_GDIBASE_EVAC_MONITOR_JDG
- {
- int unitsEvacuated;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(unitsEvacuated, 1);
- }
- void Created( GameObject * obj )
- {
- unitsEvacuated = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_GOING_TO_EVAC_SPOT_JDG)
- {
- unitsEvacuated++;
- if (unitsEvacuated == 4)
- {
- int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, airdrop_conv, false, false );
- Commands->Start_Conversation( airdrop_conv, airdrop_conv );
- Vector3 airDropSpot (-32.247f, 36.075f, 0.547f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_EvacMonitor_JDG, "")//M01_CHURCHAREA_EVAC_MONITOR_JDG
- {
- int unitsEvacuated;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(unitsEvacuated, 1);
- }
- void Created( GameObject * obj )
- {
- unitsEvacuated = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_GOING_TO_EVAC_SPOT_JDG)
- {
- unitsEvacuated++;
- if (unitsEvacuated == 3)
- {
- int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, airdrop_conv, false, false );
- Commands->Start_Conversation( airdrop_conv, airdrop_conv );
- Vector3 airDropSpot (-158.807f, 351.532f, 10.353f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_MovieProjector_JDG, "")//103942
- {//
- bool destroyed;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(destroyed, 1);
- }
- void Created( GameObject * obj )
- {
- destroyed = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR && destroyed == false)
- {
- destroyed = true;
- Commands->Set_Animation ( obj, "DSP_PROJECTOR.DSP_PROJECTOR", false, NULL, 0, 9 );
- GameObject * propagandaController = Commands->Find_Object ( 103099 );
- if (propagandaController != NULL)
- {
- Commands->Send_Custom_Event( obj, propagandaController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Explosion ( "Explosion_Barrel_Fuel", myPosition, NULL );
- }
- Commands->Set_Health ( obj, 0.25f );
- }
- };
- DECLARE_SCRIPT(M01_Propaganda_Sounds_Controller_JDG, "")//this guys ID is 103099
- {
- int last;
- int displayScreen_ID;
- int monitor_sound01;
- int monitor_sound02;
- int monitor_sound03;
- bool destroyed;
- int propaganda_number;
- bool soundPlaying;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- SAVE_VARIABLE(displayScreen_ID, 2);
- SAVE_VARIABLE(monitor_sound01, 3);
- SAVE_VARIABLE(destroyed, 4);
- SAVE_VARIABLE(propaganda_number, 5);
- SAVE_VARIABLE(soundPlaying, 6);
- SAVE_VARIABLE(monitor_sound02, 7);
- SAVE_VARIABLE(monitor_sound03, 8);
- }
- void Created(GameObject * obj)
- {
- last = 0;
- displayScreen_ID = 0;
- monitor_sound01 = 0;
- monitor_sound02 = 0;
- monitor_sound03 = 0;
- destroyed = false;
- propaganda_number = 0;
- soundPlaying = false;
- }
- void Custom(GameObject * obj, int type, int param, GameObject * sender)
- {
- if (type == 0)
- {
- if (obj && param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- soundPlaying = false;
- GameObject * oldDisplayScreen = Commands->Find_Object ( displayScreen_ID);
- if (oldDisplayScreen != NULL)
- {
- Commands->Destroy_Object ( oldDisplayScreen );
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 2 );
- }
-
- //if (obj && type == CUSTOM_EVENT_SOUND_ENDED )
- //{
- // if (obj && param == monitor_sound01)
- //{
-
- //}
- //}
-
- else if (param == M01_START_ACTING_JDG && destroyed == false)
- {
- char *propaganda_screen[10] =
- {
- "M01_Propaganda_Screen_01",
- "M01_Propaganda_Screen_02",
- "M01_Propaganda_Screen_03",
- "M01_Propaganda_Screen_04",
- "M01_Propaganda_Screen_05",
- "M01_Propaganda_Screen_06",
- "M01_Propaganda_Screen_07",
- "M01_Propaganda_Screen_08",
- "M01_Propaganda_Screen_10",
- "M01_Propaganda_Screen_11",
- };
- char *propaganda_sound[10] =
- {
- "M01NCXS_DSGN0270I1NCXS_SND",
- "M01NCXS_DSGN0271I1NCXS_SND",
- "M01NCXS_DSGN0272I1NCXS_SND",
- "M01NCXS_DSGN0273I1NCXS_SND",
- "M01NCXS_DSGN0279I1NCXS_SND",
- "M01NCXS_DSGN0275I1NCXS_SND",
- "M01NCXS_DSGN0276I1NCXS_SND",
- "M01NCXS_DSGN0277I1NCXS_SND",
- "M01NCXS_DSGN0278I1NCXS_SND",
- "M01NCXS_DSGN0274I1NCXS_SND",
- };
- Vector3 propagandaSpeaker01 (-319.283f, 589.265f, 35.385f);
- Vector3 propagandaSpeaker02 (-277.730f, 581.935f, 35.724f);
- Vector3 propagandaSpeaker03 (-296.269f, 612.473f, 35.468f);
- propaganda_number++;// = Commands->Get_Random_Int(0, 11);
- if (propaganda_number >= 10)
- {
- propaganda_number = 0;
- }
- GameObject * displayScreen = Commands->Create_Object ( propaganda_screen[propaganda_number], Vector3 (0,0,0) );
- displayScreen_ID = Commands->Get_ID ( displayScreen );
- monitor_sound03 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker01, obj );
- monitor_sound02 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker02, obj );
- monitor_sound01 = Commands->Create_Sound ( propaganda_sound[propaganda_number], propagandaSpeaker03, obj );
- //Commands->Monitor_Sound ( obj, monitor_sound01 );
- soundPlaying = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 10 );
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)//projector is dead--stop playing propaganda stuff
- {
- destroyed = true;
- GameObject * oldDisplayScreen = Commands->Find_Object ( displayScreen_ID);
- if (oldDisplayScreen != NULL)
- {
- Commands->Destroy_Object ( oldDisplayScreen );
- }
- if (soundPlaying == true)
- {
- Commands->Stop_Sound ( monitor_sound01, true );
- Commands->Stop_Sound ( monitor_sound02, true );
- Commands->Stop_Sound ( monitor_sound03, true );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BackPath_NodGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
- if (gdiBaseCommander != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 75, M01_START_ACTING_JDG );
- params.Set_Attack( gdiBaseCommander, 30, 5, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Repair_Engineer_JDG, "")//this guys ID is M01_COMM_CENTER_ENGINEER_ID 101949
- {
- int healer_sound;
- bool healing;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(healer_sound, 1);
- SAVE_VARIABLE(healing, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- healing = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == CUSTOM_EVENT_SOUND_ENDED )
- {
- if (param == healer_sound)
- {
- healing = false;
- }
- }
- else if (type == 0)
- {
- if (param == M01_PLAYER_IS_ATTACKING_ME_JDG && healing == false)
- {
- healing = true;
- Commands->Enable_Hibernation( obj, false );
- Vector3 myRepairSpot (-301.382f, 551.366f, 18.205f);
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myRepairSpot, 30, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Start_Timer ( obj, this, 2, M01_START_ACTING_JDG );
- }
- }
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- if (timer_id == M01_START_ACTING_JDG)
- {
- Commands->Enable_Hibernation( obj, true );
-
- Commands->Action_Reset ( obj, 100 );
- GameObject * commCenter = Commands->Find_Object ( M01_COMM_CENTER_JDG );
- Vector3 repair_sound_spot (-297.633f, 532.144f, 35.458f);
- float commCenter_max_health = Commands->Get_Max_Health ( commCenter );;
- float commCenter_max_shield = Commands->Get_Max_Shield_Strength ( commCenter );
- float commCenter_current_health = Commands->Get_Health ( commCenter );
- if (commCenter_current_health > 0)
- {
- Commands->Set_Health ( commCenter, commCenter_max_health );
- Commands->Set_Shield_Strength ( commCenter, commCenter_max_shield );
- healer_sound = Commands->Create_Sound ( "CnC_Healer_Sound", repair_sound_spot, obj );
- Commands->Monitor_Sound ( obj, healer_sound );
-
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Center_Building_Script_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_AMBIENT_SOUND_CONTROLLER_JDG ), 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
- GameObject * mainframe = Commands->Find_Object ( 107809 );
- if (mainframe != NULL)
- {
- Commands->Send_Custom_Event( obj, mainframe, 0, M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- GameObject * gateTutorialZone = Commands->Find_Object ( 120844 );
- if (gateTutorialZone != NULL)
- {
- Commands->Send_Custom_Event( obj, gateTutorialZone, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- GameObject * myEngineer = Commands->Find_Object ( M01_COMM_CENTER_ENGINEER_ID );
- if (myEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_DAMAGE_CHECK_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_PaintballRoom_ChatterController_JDG, "")//107554
- {
- int nodguy01_id;//
- int nodguy02_id;
- int nodguy03_id;
- int nodguy04_id;
- int nodguy05_id;
- int nodguy06_id;
- bool nodguy01_dead;
- bool nodguy02_dead;
- bool nodguy03_dead;
- bool nodguy04_dead;
- bool nodguy05_dead;
- bool nodguy06_dead;
- bool acting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(nodguy01_id, 1);
- SAVE_VARIABLE(nodguy02_id, 2);
- SAVE_VARIABLE(nodguy03_id, 3);
- SAVE_VARIABLE(nodguy04_id, 4);
- SAVE_VARIABLE(nodguy05_id, 5);
- SAVE_VARIABLE(nodguy06_id, 6);
- SAVE_VARIABLE(nodguy01_dead, 7);
- SAVE_VARIABLE(nodguy02_dead, 8);
- SAVE_VARIABLE(nodguy03_dead, 9);
- SAVE_VARIABLE(nodguy04_dead, 10);
- SAVE_VARIABLE(nodguy05_dead, 11);
- SAVE_VARIABLE(nodguy06_dead, 12);
- SAVE_VARIABLE(acting, 13);
- }
- void Created( GameObject * obj )
- {
- nodguy01_id = 102001;
- nodguy02_id = 101998;
- nodguy03_id = 102000;
- nodguy04_id = 101999;
- nodguy05_id = 102002;
- nodguy06_id = 102003;
- nodguy01_dead = false;
- nodguy02_dead = false;
- nodguy03_dead = false;
- nodguy04_dead = false;
- nodguy05_dead = false;
- nodguy06_dead = false;
- acting = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG && acting == false)
- {
- acting = true;
- if (nodguy01_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- else if (nodguy01_dead == true)
- {
- if (nodguy02_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
- }
- }
- if (nodguy03_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
- }
- else if (nodguy03_dead == true)
- {
- if (nodguy04_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, delayTimer );
- }
- }
- if (nodguy05_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, delayTimer );
- }
- else if (nodguy05_dead == true)
- {
- if (nodguy06_dead == false)
- {
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_06_JDG, delayTimer );
- }
- }
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- GameObject * nodguy01 = Commands->Find_Object ( nodguy01_id );
- GameObject * nodguy02 = Commands->Find_Object ( nodguy02_id );
- GameObject * nodguy03 = Commands->Find_Object ( nodguy03_id );
- GameObject * nodguy04 = Commands->Find_Object ( nodguy04_id );
- GameObject * nodguy05 = Commands->Find_Object ( nodguy05_id );
- GameObject * nodguy06 = Commands->Find_Object ( nodguy06_id );
- if (sender == nodguy01)
- {
- nodguy01_dead = true;
- }
- else if (sender == nodguy02)
- {
- nodguy02_dead = true;
- }
- else if (sender == nodguy03)
- {
- nodguy03_dead = true;
- }
- else if (sender == nodguy04)
- {
- nodguy04_dead = true;
- }
- else if (sender == nodguy05)
- {
- nodguy05_dead = true;
- }
- else if (sender == nodguy06)
- {
- nodguy06_dead = true;
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- GameObject * nodguy01 = Commands->Find_Object ( nodguy01_id );
- if (nodguy01 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_02", 95, 20, true);
- Commands->Join_Conversation( nodguy01, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
- {
- GameObject * nodguy02 = Commands->Find_Object ( nodguy02_id );
- if (nodguy02 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_02", 95, 20, true);
- Commands->Join_Conversation( nodguy02, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
- {
- GameObject * nodguy03 = Commands->Find_Object ( nodguy03_id );
- if (nodguy03 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_01", 95, 20, true);
- Commands->Join_Conversation( nodguy03, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)
- {
- GameObject * nodguy04 = Commands->Find_Object ( nodguy04_id );
- if (nodguy04 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_01", 95, 20, true);
- Commands->Join_Conversation( nodguy04, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)
- {
- GameObject * nodguy05 = Commands->Find_Object ( nodguy05_id );
- if (nodguy05 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_03", 95, 20, true);
- Commands->Join_Conversation( nodguy05, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_06_JDG)
- {
- GameObject * nodguy06 = Commands->Find_Object ( nodguy06_id );
- if (nodguy06 != NULL)
- {
- int paintball_alert_conv = Commands->Create_Conversation( "M01_Paintball_Intruder_Conversation_03", 95, 20, true);
- Commands->Join_Conversation( nodguy06, paintball_alert_conv);
- Commands->Start_Conversation( paintball_alert_conv, paintball_alert_conv );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Paintball_Team_01_JDG, "")//this is the grunt team
- {
- int enemySniperId;
- float myAggressiveness;
- float myCoverProbability;
- float myTimerMax;
- float myTimerMin;
- float myHomeRange;
- Vector3 myPosition;
- bool retreating;
- bool starEncountered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(enemySniperId, 1);
- SAVE_VARIABLE(myAggressiveness, 2);
- SAVE_VARIABLE(myCoverProbability, 3);
- SAVE_VARIABLE(myTimerMax, 4);
- SAVE_VARIABLE(myTimerMin, 5);
- SAVE_VARIABLE(myHomeRange, 6);
- SAVE_VARIABLE(myPosition, 7);
- SAVE_VARIABLE(retreating, 8);
- SAVE_VARIABLE(starEncountered, 9);
- }
- void Created( GameObject * obj )
- {
- enemySniperId = 102001;
- retreating = false;
- starEncountered = false;
- int myIdNumber = Commands->Get_ID ( obj );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_RENEGADE );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NOD );
- if (myIdNumber == 101998)//team one sniper
- {
- }
- else
- {
- myPosition = Commands->Get_Position ( obj );
- myTimerMin = 5;
- myTimerMax = 10;
- myAggressiveness = Commands->Get_Random ( 0, 0.5f );
- myCoverProbability = Commands->Get_Random ( 0.5f, 1 );
- myHomeRange = Commands->Get_Random ( 0, 20 );
- Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
- Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * convController = Commands->Find_Object ( 107554 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- starEncountered = true;
- GameObject * convController = Commands->Find_Object ( 107554 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else if (damager == Commands->Find_Object ( enemySniperId ))
- {
- retreating = true;
- Commands->Set_Innate_Aggressiveness ( obj, 0.2f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 1 );
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_02_JDG );
- if (starEncountered == false)
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- }
- else
- {
- if (starEncountered == false)
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- }
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- switch (timer_id)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- if (retreating == false)
- {
- myAggressiveness = Commands->Get_Random ( 0, 0.5f );
- myCoverProbability = Commands->Get_Random ( 0.5f, 1 );
- myHomeRange = Commands->Get_Random ( 0, 20 );
- Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
- Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- }
- break;
- case M01_MODIFY_YOUR_ACTION_02_JDG:
- {
- retreating = false;
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- break;
- }
-
- }
- };
- DECLARE_SCRIPT(M01_HON_Paintball_Team_02_JDG, "")//this is the officer team
- {
- int enemySniperId;
- float myAggressiveness;
- float myCoverProbability;
- float myTimerMax;
- float myTimerMin;
- float myHomeRange;
- Vector3 myPosition;
- bool retreating;
- bool starEncountered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(enemySniperId, 1);
- SAVE_VARIABLE(myAggressiveness, 2);
- SAVE_VARIABLE(myCoverProbability, 3);
- SAVE_VARIABLE(myTimerMax, 4);
- SAVE_VARIABLE(myTimerMin, 5);
- SAVE_VARIABLE(myHomeRange, 6);
- SAVE_VARIABLE(myPosition, 7);
- SAVE_VARIABLE(retreating, 8);
- SAVE_VARIABLE(starEncountered, 9);
- }
- void Created( GameObject * obj )
- {
- enemySniperId= 101998;
- retreating = false;
- starEncountered = false;
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == 102001)//team two sniper
- {
- }
- else
- {
- myPosition = Commands->Get_Position ( obj );
- myTimerMin = 5;
- myTimerMax = 10;
- myAggressiveness = Commands->Get_Random ( 0.75f, 1 );
- myCoverProbability = Commands->Get_Random ( 0, 0.25f );
- myHomeRange = Commands->Get_Random ( 0, 20 );
- Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
- Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR)
- {
- starEncountered = true;
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * convController = Commands->Find_Object ( 107554 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- starEncountered = true;
- GameObject * convController = Commands->Find_Object ( 107554 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else if (damager == Commands->Find_Object ( enemySniperId ))
- {
- retreating = true;
- Commands->Set_Innate_Aggressiveness ( obj, 0.2f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 1.0f );
- float delayTimer = Commands->Get_Random ( 1, 3 );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_02_JDG );
- if (starEncountered == false)
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- }
- else
- {
- if (starEncountered == false)
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- }
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- switch (timer_id)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- if (retreating == false)
- {
- myAggressiveness = Commands->Get_Random ( 0.75f, 1 );
- myCoverProbability = Commands->Get_Random ( 0, 0.25f );
- myHomeRange = Commands->Get_Random ( 0, 20 );
- Commands->Set_Innate_Aggressiveness ( obj, myAggressiveness );
- Commands->Set_Innate_Take_Cover_Probability ( obj, myCoverProbability );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, myHomeRange );
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- }
- break;
- case M01_MODIFY_YOUR_ACTION_02_JDG:
- {
- retreating = false;
- float delayTimer = Commands->Get_Random ( myTimerMin, myTimerMax );
- Commands->Start_Timer ( obj, this, delayTimer, M01_MODIFY_YOUR_ACTION_JDG );
- }
- break;
- }
-
- }
- };
- DECLARE_SCRIPT(M01_HON_Dojo_Trainer_JDG, "")//this guys ID is M01_HON_DOJO_SENSEI_JDG 102051
- {
- int dojo_conv;
- bool first_time;
- bool handOfNodDead;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(dojo_conv, 1);
- SAVE_VARIABLE(first_time, 2);
- SAVE_VARIABLE(handOfNodDead, 3);
- }
- void Created( GameObject * obj )
- {
- handOfNodDead = false;
- first_time = true;
- Commands->Innate_Disable(obj);
- //Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (handOfNodDead == false)
- {
- if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
- {
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
- {
- float delayTimer2 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer2 );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
- {
- float delayTimer3 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer3 );
- }
- }
- else
- {
- if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
- {
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
- {
- float delayTimer2 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer2 );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
- {
- float delayTimer3 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG, delayTimer3 );
- }
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR && first_time == true)
- {
- first_time = false;
- if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
- {
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
- {
- float delayTimer2 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer2 );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
- {
- float delayTimer3 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, delayTimer3 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_START_ACTING_JDG: //here comes the player--start your routine
- {
- //Commands->Set_Innate_Is_Stationary ( obj, false );
- //Commands->Innate_Enable(obj);
- Commands->Set_Innate_Aggressiveness ( obj, 0.50f );
- Commands->Set_Innate_Take_Cover_Probability ( obj, 0.5f );
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
- Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, false );
- dojo_conv = Commands->Create_Conversation( "M01_Dojo_Sensei_Conversation", 100, 1000, true);
- Commands->Join_Conversation( obj, dojo_conv, false, true );
- Commands->Start_Conversation( dojo_conv, dojo_conv );
-
- Commands->Monitor_Conversation( obj, dojo_conv);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
- {
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
- Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, true );
- }
- break;
- case M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
- {
- handOfNodDead = true;
- Commands->Innate_Enable(obj);
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, true );
- Commands->Innate_Soldier_Enable_Footsteps_Heard ( obj, true );
- }
- break;
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- switch (complete_reason)
- {
- case ACTION_COMPLETE_CONVERSATION_ENDED:
- {
- if (action_id == dojo_conv)//your initial conv is over--tell civs to do pushups
- {
- if (Commands->Find_Object (M01_HON_DOJO_CIV_01_JDG))
- {
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_01_JDG ), 0, M01_START_ACTING_JDG, delayTimer );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_02_JDG))
- {
- float delayTimer2 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_02_JDG ), 0, M01_START_ACTING_JDG, delayTimer2 );
- }
- if (Commands->Find_Object (M01_HON_DOJO_CIV_03_JDG))
- {
- float delayTimer3 = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_HON_DOJO_CIV_03_JDG ), 0, M01_START_ACTING_JDG, delayTimer3 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Dojo_Civ_01_JDG, "")
- {
- /*#define M01_HON_DOJO_CIV_01_JDG 102048
- #define M01_HON_DOJO_CIV_02_JDG 102049
- #define M01_HON_DOJO_CIV_03_JDG 102050*/
- int i_am;
- int dojo_civ_01;
- int dojo_civ_02;
- int dojo_civ_03;
- int pushups_done;
- int thanks_conv;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(i_am, 1);
- SAVE_VARIABLE(dojo_civ_01, 2);
- SAVE_VARIABLE(dojo_civ_02, 3);
- SAVE_VARIABLE(dojo_civ_03, 4);
- SAVE_VARIABLE(pushups_done, 5);
- SAVE_VARIABLE(thanks_conv, 6);
- }
- void Created( GameObject * obj )
- {
- dojo_civ_01 = 102048;//babushka
- dojo_civ_02 = 102049;//billy
- dojo_civ_03 = 102050;//farmerjohn
- pushups_done = 0;
- Commands->Innate_Disable(obj);
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == dojo_civ_01)
- {
- i_am = dojo_civ_01;
- }
- else if (myIdNumber == dojo_civ_02)
- {
- i_am = dojo_civ_02;
- }
- else if (myIdNumber == dojo_civ_03)
- {
- i_am = dojo_civ_03;
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_START_ACTING_JDG: //you've been told to do pushups--DO THEM!
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );//this is animation of guy going into pushup position
- params.Set_Animation( "H_A_J13A", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG: //you're done with pushups--report to the armory
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(0,0,0), WALK, 2 );
- params.WaypathID = 102056;
- params.WaypointStartID = 102058;
- params.WaypointEndID = 102062;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_PLAYER_IS_ATTACKING_ME_JDG: //your guard is alerted to Havoc--stop whatever you are doing
- {
- Commands->Action_Reset ( obj, 100 );
- Vector3 myPosition = Commands->Get_Position ( obj );
- myPosition.X += Commands->Get_Random ( 0.5f, 1 );
- myPosition.Y += Commands->Get_Random ( 0.5f, 2 );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( myPosition, WALK, 0 );
- params.MoveCrouched = true;
- Commands->Action_Goto( obj, params );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_02_JDG: //your guard is dead--flock Havoc and say thanks
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Look( STAR, 5 );
-
- Commands->Action_Face_Location ( obj, params );
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, delayTimer );
- }
- break;
- case M01_MODIFY_YOUR_ACTION_03_JDG: //play thanks conv
- {
- if (obj)
- {
- Commands->Join_Conversation( obj, thanks_conv, false, true, true );
- Commands->Join_Conversation( STAR, thanks_conv, false, false, false );
- Commands->Start_Conversation( thanks_conv, thanks_conv );
- Commands->Monitor_Conversation( obj, thanks_conv );
- }
- }
- break;
- case M01_MODIFY_YOUR_ACTION_04_JDG: //play thanks conv
- {
- if (i_am == dojo_civ_01)//babushka
- {
- thanks_conv = Commands->Create_Conversation( "M01_Dojo_Babushka_Thanks_Conversation", 100, 1000, true);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- else if (i_am == dojo_civ_02)
- {
- thanks_conv = Commands->Create_Conversation( "M01_Dojo_Billy_Thanks_Conversation", 100, 1000, true);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 2 );
- }
- else
- {
- thanks_conv = Commands->Create_Conversation( "M01_Dojo_FarmerJohn_Thanks_Conversation", 100, 1000, true);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 4 );
- }
-
- }
- break;
- case M01_PICK_A_NEW_LOCATION_JDG: //see how far you are from havoc
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float myDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (myDistance > 75)
- {
- bool starVisible = Commands->Is_Object_Visible( STAR, obj );
- if (starVisible == true)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );
- }
- else
- {
- Commands->Destroy_Object ( obj );
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );
- }
- }
- break;
- case M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG: //turn your sight and hearing back on M01_YOUR_BUILDING_HAS_BEEN_DESTROYED_JDG
- {
- Commands->Action_Reset ( obj, 100 );
- Vector3 newGotoSpot(-54.512f, 183.109f, 0.774f);//this is at the landing beach
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement( newGotoSpot, RUN, 5 );
-
- Commands->Action_Goto( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );//do distance check from star
- }
- break;
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- switch (complete_reason)
- {
- case ACTION_COMPLETE_CONVERSATION_ENDED:
- {
- if (action_id == thanks_conv)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Sound ( "M01_GDI_Thanks_Twiddler", myPosition, obj );
- Vector3 newGotoSpot(-54.512f, 183.109f, 0.774f);//this is at the landing beach
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement( newGotoSpot, RUN, 5 );
-
- Commands->Action_Goto( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_PICK_A_NEW_LOCATION_JDG, 10 );//do distance check from star
- }
- }
- break;
- case ACTION_COMPLETE_NORMAL:
- {
- switch (action_id)
- {
- case M01_DOING_ANIMATION_01_JDG:
- {
- if (pushups_done < 2)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );//this is pushup animation animation
- params.Set_Animation( "H_A_J13B", false );
- Commands->Action_Play_Animation ( obj, params );
- pushups_done++;
- }
- else
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );//this is guy standing up
- params.Set_Animation( "H_A_J13C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- break;
- case M01_DOING_ANIMATION_02_JDG:
- {
- char *animationName = M01_Choose_Idle_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );//this is guy standing up
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- break;
- case M01_DOING_ANIMATION_03_JDG:
- {
- if (i_am == dojo_civ_01)
- {
- float delayTimer = Commands->Get_Random ( 0, 1 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- else if (i_am == dojo_civ_02)
- {
- float delayTimer2 = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer2 );
- }
- else if (i_am == dojo_civ_03)
- {
- float delayTimer3 = Commands->Get_Random ( 2, 3 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer3 );
- }
- }
- break;
- case M01_WALKING_WAYPATH_01_JDG:
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );//this is guy placing C$
- params.Set_Animation( "H_A_J12C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- break;
- case M01_DOING_ANIMATION_04_JDG:
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- GameObject *newsoldier = Commands->Create_Object("Nod_MiniGunner_0", myPosition);
- Commands->Attach_Script(newsoldier, "M01_Civ_To_Minigunner_Guy_JDG", "");
- Commands->Destroy_Object ( obj );
- }
- break;
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_GuardTower_Tailgun_JDG, "")//100246
- {
- void Created( GameObject * obj )
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
- params.Set_Attack( STAR, 30, 1, true);
- Commands->Action_Attack(obj, params);
- }
- };
- DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_01_JDG, "")//108024
- {//target location ()
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Vector3 radarMarker (-293.163f, 499.787f, 19.959f);
- Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_02_JDG, "")//108026
- {//target location ()
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Vector3 radarMarker (-292.135f, 522.740f, 16.448f);
- Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Mainframe_PogZone_03_JDG, "")//108028
- {//target location ()
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Vector3 radarMarker (-314.578f, 517.124f, 16.447f);
- Commands->Set_Objective_HUD_Info_Position( M01_UNLOCK_GATE_OBJECTIVE_JDG, 93, "POG_M01_1_02.tga", IDS_POG_ACCESS, radarMarker );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Center_Player_Terminal_Zone, "")//107809
- {
- bool poked;
- bool commCenterDead;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(poked, 1);
- SAVE_VARIABLE(commCenterDead, 2);
- }
- void Created( GameObject * obj )
- {
- commCenterDead = false;
- Commands->Enable_HUD_Pokable_Indicator ( obj, true );
- Commands->Display_Health_Bar( obj, false );
- poked = false;
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR && poked == false)
- {
- if (commCenterDead == false)
- {
- poked = true;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_HAS_POKED_COMM_CENTER_PCT_JDG, 0 );
- Commands->Set_Obj_Radar_Blip_Shape ( obj, -1 );
- Commands->Set_Obj_Radar_Blip_Color ( obj, -1 );
- GameObject * gateTutorialZone = Commands->Find_Object ( 120844 );
- if (gateTutorialZone != NULL)
- {
- Commands->Send_Custom_Event( obj, gateTutorialZone, 0, M01_START_ACTING_JDG, 0 );
- }
- Commands->Enable_HUD_Pokable_Indicator ( obj, false );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_COMM_SAM_OBJECTIVE_JDG)
- {
- Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_PRIMARY_OBJECTIVE );
- }
- else if (param == M01_COMM_CENTER_HAS_BEEN_DESTROYED_JDG)//comm center has been destroyed
- {
- commCenterDead = true;
- Commands->Enable_HUD_Pokable_Indicator ( obj, false );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Objective_Pog_Controller_JDG, "")//M01_MISSION_POG_CONTROLLER_JDG 105828
- {
- int missionIntro;
- int escKeyConv;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(missionIntro, 1);
- SAVE_VARIABLE(escKeyConv, 2);
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- switch (complete_reason)
- {
- case ACTION_COMPLETE_CONVERSATION_ENDED:
- {
- if (action_id == missionIntro) //add first objective pog here
- {
- Vector3 prisonerPenLocation (-312.725f, 575.887f, 27.221f);
- Commands->Add_Objective( M01_PRISONER_OBJECTIVE_JDG, OBJECTIVE_TYPE_PRIMARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Primary_M01_01, NULL, IDS_Enc_Obj_Primary_M01_01 );
- Commands->Set_Objective_Radar_Blip( M01_PRISONER_OBJECTIVE_JDG, prisonerPenLocation );
-
- Commands->Set_Objective_HUD_Info_Position( M01_PRISONER_OBJECTIVE_JDG, 80, "POG_M01_1_01.tga", IDS_POG_LOCATE, prisonerPenLocation );
- Commands->Set_HUD_Help_Text ( IDS_M00DSGN_DSGN1004I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- escKeyConv = Commands->Create_Conversation( "M01_Press_ESC_For_Objectives_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, escKeyConv, false, false );
- Commands->Start_Conversation( escKeyConv, escKeyConv );
- Commands->Monitor_Conversation( obj, escKeyConv );
- }
- else if (action_id == escKeyConv)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0516I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- break;
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG)
- {
- missionIntro = Commands->Create_Conversation( "M01_Start_Mission_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, missionIntro, false, false );
- //Commands->Join_Conversation( STAR, missionIntro, false, false );
- Commands->Start_Conversation( missionIntro, missionIntro );
- Commands->Monitor_Conversation( obj, missionIntro );//M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG
- }
- if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- escKeyConv = Commands->Create_Conversation( "M01_Press_ESC_For_Objectives_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, escKeyConv, false, false );
- Commands->Start_Conversation( escKeyConv, escKeyConv );
- Commands->Monitor_Conversation( obj, escKeyConv );
- }
- }
- else if (type == M01_ADD_OBJECTIVE_POG_JDG)
- {
- if (param == M01_GDI_BASE_POW_OBJECTIVE_JDG)
- {
- Vector3 initialCaptainLocation (47.128f, 36.584f, -0.930f);
- Commands->Add_Objective( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_06, NULL, IDS_Enc_Obj_Secondary_M01_06 );
- Commands->Set_Objective_Radar_Blip( M01_GDI_BASE_POW_OBJECTIVE_JDG, initialCaptainLocation );
- Commands->Set_Objective_HUD_Info_Position( M01_GDI_BASE_POW_OBJECTIVE_JDG, 85, "POG_M01_2_08.tga", IDS_POG_RESCUE, initialCaptainLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_M00DSGN_DSGN1005I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
- }
- else if (param == M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG)
- {
- GameObject * barnCommander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
- if (barnCommander != NULL)
- {
- Vector3 commanderPosition = Commands->Get_Position ( barnCommander );
- Commands->Set_Objective_HUD_Info_Position( M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, 86, "POG_M01_2_01.tga", IDS_POG_ELIMINATE, commanderPosition );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_FIRST_NOD_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_01, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- else if (param == M01_TURRETS_OBJECTIVE_JDG)
- {
- Vector3 turretsLocation;
- GameObject * turret01 = Commands->Find_Object ( 101434 );
- GameObject * turret02 = Commands->Find_Object ( 101435 );
- if (turret01 != NULL)
- {
- turretsLocation.Set (-83.916f, 91.667f, 2.807f);
- }
- else if (turret02 != NULL)
- {
- turretsLocation.Set (-105.024f, 113.658f, 1.872f);
- }
-
- Commands->Set_Objective_HUD_Info_Position( M01_TURRETS_OBJECTIVE_JDG, 91, "POG_M01_2_02.tga", IDS_POG_DESTROY, turretsLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_02, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (param == M01_BARN_OBJECTIVE_JDG)
- {
- Vector3 barnLocation (-49.910f, 183.860f, 0.774f);
- Commands->Set_Objective_HUD_Info_Position( M01_BARN_OBJECTIVE_JDG, 92, "POG_M01_2_03.tga", IDS_POG_RESCUE, barnLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_BARN_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_03, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (param == M01_BARN_ROUNDUP_OBJECTIVE_JGD)
- {
- Vector3 barnLocation (-54.786f, 213.816f, 6.453f);
- Commands->Set_Objective_HUD_Info_Position( M01_BARN_ROUNDUP_OBJECTIVE_JGD, 93, "POG_M01_2_04.tga", IDS_POG_EVACUATE, barnLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_BARN_ROUNDUP_OBJECTIVE_JGD, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_04, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (param == M01_CHURCH_OBJECTIVE_JDG)//
- {
- Vector3 churchLocation = Commands->Get_Position ( Commands->Find_Object ( M01_CHURCH_PRIEST_ID ) );
- Commands->Set_Objective_HUD_Info_Position( M01_CHURCH_OBJECTIVE_JDG, 94, "POG_M01_2_06.tga", IDS_POG_RESCUE, churchLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_CHURCH_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_05, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (param == M01_HON_OBJECTIVE_JDG)
- {
- Vector3 mctLocation (-179.3f, 541.9f, 3.518f);
- Commands->Set_Objective_HUD_Info_Position( M01_HON_OBJECTIVE_JDG, 95, "POG_M02_2_01.tga", IDS_POG_DESTROY, mctLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_HON_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_07, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- else if (param == M01_COMM_SAM_OBJECTIVE_JDG)
- {
- Vector3 samLocation (-337.169f, 549.232f, 31.949f);
- Commands->Set_Objective_HUD_Info_Position( M01_COMM_SAM_OBJECTIVE_JDG, 96, "POG_M01_1_04.tga", IDS_POG_DESTROY, samLocation );
- //Vector3 green (0,1,0);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Primary_M01_04, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- else if (type == M01_CHANGE_OBJECTIVE_POG_JDG)
- {
- GameObject * captDuncan = Commands->Find_Object ( 106050 );
- if (captDuncan != NULL)
- {
- if (param == M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG)
- {
- //Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- Commands->Add_Objective( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_TYPE_SECONDARY, OBJECTIVE_STATUS_PENDING, IDS_Enc_ObjTitle_Secondary_M01_08, NULL, IDS_Enc_Obj_Secondary_M01_08 );
- Vector3 realCaptainLocation (109.959f, 97.340f, 8.923f);
- Commands->Set_Objective_HUD_Info_Position( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 91, "POG_M01_2_05.tga", IDS_POG_CONTACT, realCaptainLocation );
- Commands->Set_Objective_Radar_Blip( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, realCaptainLocation );
- //Commands->Send_Custom_Event( obj, obj, M01_REMOVE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, SECONDARY_POG_DELAY );
- GameObject * triggerZone03 = Commands->Find_Object ( 106052 );
- if (triggerZone03 != NULL)
- {
- Commands->Send_Custom_Event( obj, triggerZone03, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- //Vector3 blue (0,0,1);
- Commands->Set_HUD_Help_Text ( IDS_Enc_ObjTitle_Secondary_M01_08, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
-
- else if (param == M01_TURRETS_OBJECTIVE_JDG)
- {
- Vector3 turretsLocation;
- GameObject * turret02 = Commands->Find_Object ( 101435 );
- if (turret02 != NULL)
- {
- turretsLocation.Set (-105.024f, 113.658f, 1.872f);
- }
-
- Commands->Set_Objective_HUD_Info_Position( M01_TURRETS_OBJECTIVE_JDG, 91, "POG_M01_2_02.tga", IDS_POG_DESTROY, turretsLocation );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_FirstChinook_Script_JDG, "")//
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( 104685 );
- if (gdiGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_MODIFY_YOUR_ACTION_07_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_EvacController_JDG, "")//103394
- {
- int evac_waypath_id;
- int evac_helicopter_id;
- int evac_rope_id;
- int protectCivsConv;
- int deadCivs;
- bool transportCalled;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(evac_waypath_id, 1);
- SAVE_VARIABLE(evac_helicopter_id, 2);
- SAVE_VARIABLE(evac_rope_id, 3);
- SAVE_VARIABLE(protectCivsConv, 4);
- SAVE_VARIABLE(deadCivs, 5);
- SAVE_VARIABLE(transportCalled, 6);
- }
- void Created( GameObject * obj )
- {
- deadCivs = 0;
- transportCalled = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ((param == M01_START_ACTING_JDG))//civs have been freed--play protect civs conversation
- {
- protectCivsConv = Commands->Create_Conversation( "M01_Protect_Clergy_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, protectCivsConv, false, false );
- //Commands->Join_Conversation( STAR, protectCivsConv, false, false );
- Commands->Start_Conversation( protectCivsConv, protectCivsConv );
- Commands->Monitor_Conversation (obj, protectCivsConv);
- }
- else if (param == M01_EVERYONES_ON_BOARD_JDG)//civs are on board--send aircraft away
- {
- GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
- GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
- GameObject * evacRope = Commands->Find_Object ( evac_rope_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacWaypath != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacRope != NULL)
- {
- Commands->Send_Custom_Event ( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- else if (param == M01_CIVILIAN_KILLED_JDG)
- {
- deadCivs++;
- if (deadCivs == 3)
- {
- Commands->Send_Custom_Event ( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CLEAR_CHURCH_OBJECTIVE_FAIL_JDG, 0 );
- }
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
- {
- evac_helicopter_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
- }
- else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
- {
- evac_waypath_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
- }
- else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
- {
- evac_rope_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
- }
- else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
- {
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
- Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
-
- Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
- Commands->Innate_Disable(sender);
- Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
- if(troopbone)
- {
- Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
- }
- else
- {
- Commands->Debug_Message("troopbone not created yet");
- }
-
- Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == protectCivsConv)
- {
- if (transportCalled == false)
- {
- transportCalled = true;
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_ChurchArea_EvacAnim.txt");
- }
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-140.9f, 320.2f, 8.5f));
- Commands->Set_Facing(chinook_obj1, -54.0f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_Church_TroopDrop.txt");
- Commands->Create_Sound ( "00-N180E", Vector3 (0,0,0), obj);
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Rope_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Debug_Message ( "**********************script attached to evac rope\n" );
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( 103394 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Waypath_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( 103394 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_ChurchArea_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
- Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- GameObject * myController = Commands->Find_Object ( 103394 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
- {
- Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
- Vector3 evacLocation = Commands->Get_Position ( obj );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if (loveshackNun != NULL)
- {
- Commands->Send_Custom_Event( obj, loveshackNun, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- if (churchNun != NULL)
- {
- Commands->Send_Custom_Event( obj, churchNun, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- if (priest != NULL)
- {
- Commands->Send_Custom_Event( obj, priest, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * loveshackNun = Commands->Find_Object ( M01_CHURCH_LOVESHACK_NUN_ID );
- GameObject * churchNun = Commands->Find_Object ( M01_CHURCH_INTERIOR_NUN_ID );
- GameObject * priest = Commands->Find_Object ( M01_CHURCH_PRIEST_ID );
- if ((loveshackNun != NULL) || (churchNun != NULL) || (priest != NULL))
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else
- {
- Commands->Debug_Message ( "*******************************all barn civs on board--about to send cutom to controller\n" );
- GameObject * controller = Commands->Find_Object ( 103394 );
- if (controller != NULL)
- {
- Commands->Send_Custom_Event ( obj, controller, 0, M01_EVERYONES_ON_BOARD_JDG, 0 );
- Commands->Debug_Message ( "*******************************all barn civs on board--sent cutom to controller\n" );
- }
-
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Priest_JDG, "")
- {
- int lucky_charms;
- int prayerSound;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(lucky_charms, 1);
- SAVE_VARIABLE(prayerSound, 1);
- }
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- prayerSound = Commands->Create_Sound ( "MX1DSGN_DSGN0020I1DSGN_SND", myPosition, obj );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Stop_Sound ( prayerSound, true );
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_PRIEST_CONVERSATION_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("H_A_Host_L2b", true);
- Commands->Action_Play_Animation (obj, params);
- Commands->Start_Sound ( prayerSound );
- }
- else if ((param == M01_CHURCH_GUARD_IS_DEAD_JDG))//Your guard is dead--do something
- {
- Commands->Stop_Sound ( prayerSound, true );
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("H_A_Host_L2c", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 starPosition = Commands->Get_Position ( STAR );
- float distance = Commands->Get_Distance ( myPosition, starPosition );
- if (distance <= 15)
- {
- lucky_charms = Commands->Create_Conversation( "M01_Priest_LuckyCharms_Conversation", 100, 1000, false);
- Commands->Join_Conversation( obj, lucky_charms, false, true, true );
- Commands->Join_Conversation( STAR, lucky_charms, false, false, false );
- Commands->Start_Conversation( lucky_charms, lucky_charms );
- Commands->Monitor_Conversation( obj, lucky_charms );
- }
- else
- {
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 0.5f );
- Commands->Action_Goto( obj, params );
- }
-
- //ActionParamsStruct params;
- //Commands->Action_Reset ( obj, 100 );
- //params.Set_Basic(this, 100, M01_PICK_A_NEW_LOCATION_JDG);
- //params.Set_Movement( STAR, RUN, 8 );
- //Commands->Action_Goto( obj, params );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_DOING_ANIMATION_01_JDG )//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 90, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation ("H_A_Host_L1b", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG)//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 90, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation ("H_A_Host_L1c", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG)//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 90, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3 (-135.571f, 340.213f, 9.608f), 0.9f, 0.5f );
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)//civ is standing up after guard is dead
- {
- Commands->Enable_Hibernation( obj, true );
- if (Commands->Find_Object ( 103395 ))//this is your conversation zone
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103395 ), 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//Nun is by chinook--play getting on anim
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
- Commands->Give_Points( STAR, 2000, false );
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( 103394 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_PICK_A_NEW_LOCATION_JDG)//priest is by Havoc--cue lucky charms conversation
- {
- //lucky_charms = Commands->Create_Conversation( "M01_Priest_LuckyCharms_Conversation", 100, 1000, false);
- //Commands->Join_Conversation( obj, lucky_charms, true, true );
- //Commands->Start_Conversation( lucky_charms, lucky_charms );
- //Commands->Monitor_Conversation( obj, lucky_charms );
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//priest is by Havoc--cue lucky charms conversation
- {
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 0.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)//priest is by Havoc--cue lucky charms conversation
- {
- if (action_id == lucky_charms)
- {
- params.Set_Basic(this, 100, M01_DOING_ANIMATION_04_JDG);
- params.Set_Animation ("H_A_J12C", false);
- Commands->Action_Play_Animation (obj, params);
- Vector3 spawnPosition = Commands->Get_Position ( obj );
- spawnPosition.Z += 0.75f;
- int spawn_count = 1;
- while (spawn_count <= 1)
- {
- spawnPosition.X += Commands->Get_Random( -2.0f , 2.0f);
- spawnPosition.Y += Commands->Get_Random( -2.0f , 2.0f);
- GameObject *luckycharm;
- luckycharm = Commands->Create_Object ( "POW_Data_Disc", spawnPosition );
- Commands->Attach_Script(luckycharm, "M01_Priest_Datadisc_JDG", "");
- spawn_count++;
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_Interior_Nun_JDG, "")
- {
- bool following_player;
- int prayerSound;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(following_player, 1);
- SAVE_VARIABLE(prayerSound, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- following_player = false;
- Vector3 myPosition = Commands->Get_Position ( obj );
- prayerSound = Commands->Create_Sound ( "MX1DSGN_DSGN0021I1DSGN_SND", myPosition, obj );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Stop_Sound ( prayerSound, true );
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- params.Set_Basic( this, 90, 0 );
- params.Set_Animation ("S_A_Human.H_A_Host_L2b", true);
- Commands->Action_Play_Animation (obj, params);
- Commands->Start_Sound ( prayerSound );
- }
- else if ((param == M01_CHURCH_GUARD_IS_DEAD_JDG))//Your guard is dead--do something
- {
- Commands->Stop_Sound ( prayerSound, true );
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic( this, 90, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("S_A_Human.H_A_Host_L2c", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
- {
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
- ActionParamsStruct params;
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 1 );
-
- Commands->Action_Goto( obj, params );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_DOING_ANIMATION_01_JDG)//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation ("S_A_Human.H_A_Host_L1b", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG)//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation ("S_A_Human.H_A_Host_L1c", false);
- Commands->Action_Play_Animation (obj, params);
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Sound ( "MX1DSGN_DSGN0022I1DSGN_SND", myPosition, obj );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG)//civ is standing up after guard is dead
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3 (-136.738f, 325.073f, 8.167f), RUN, 0.50f );
- Commands->Action_Goto( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)//Nun is by chinook--play getting on anim
- {
- Commands->Enable_Hibernation( obj, true );
- if (Commands->Find_Object ( 101370 ))//this is your conversation zone
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101370 ), 0, M01_START_ACTING_JDG, 1 );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//Nun is by chinook--play getting on anim
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
- Commands->Give_Points( STAR, 2000, false );
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( 103394 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- }
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- ActionParamsStruct params;
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_INTERIOR_NUN_CONVERSATION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Church_LoveShack_Nun_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj);
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 103394 ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- GameObject * conversationZone = Commands->Find_Object ( 103392 );
- if (conversationZone != NULL)
- {
- Commands->Destroy_Object ( conversationZone );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if ((param == M01_START_ACTING_JDG))//Player is entering church area--cue actors
- {
- params.Set_Basic(this, 90, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 100750;
- params.WaypointStartID = 100753;
- params.WaypointEndID = 100758;
- Commands->Action_Goto( obj, params );
- }
- else if ((param == M01_LOVESHACK_GUARD_IS_DEAD_JDG))//Your guard is dead--follow havoc
- {
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3 (0,0,0), RUN, 1.0f );
- params.WaypathID = 103383;
- params.WaypointStartID = 103384;
- params.WaypointEndID = 103390;
- Commands->Action_Goto( obj, params );
- }
- else if ((param == M01_GOING_TO_EVAC_SPOT_JDG))//your ride is here--go get in
- {
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( 103394 ) );
- ActionParamsStruct params;
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 1 );
-
- Commands->Action_Goto( obj, params );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//Nun is by chinook--play getting on anim
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CHURCH_CLERGY_HAS_BOARDED_JDG, 1 );
- Commands->Give_Points( STAR, 2000, false );
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
- //if (spawn_effect)
- //{
- // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
- //}
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- GameObject * airdropController = Commands->Find_Object ( M01_CHURCHAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( 103394 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG )//nun is at hide spot--play animation--cue havoc talk zone
- {
- Commands->Enable_Hibernation( obj, true );
- if (Commands->Find_Object ( 101368 ))//this is your conversation zone
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101368 ), 0, M01_START_ACTING_JDG, 1 );
- }
- }
- }
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (poker == STAR)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_LOVESHACK_NUN_CONVERSATION_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Rope_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Debug_Message ( "**********************script attached to evac rope\n" );
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Waypath_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
- Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- GameObject * myController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if (barnCiv01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv01, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- if (barnCiv02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv02, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- if (barnCiv03 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv03, 0, M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
- {
- Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
- Vector3 evacLocation = Commands->Get_Position ( obj );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
- GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if (barnCiv01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (barnCiv02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- if (barnCiv03 != NULL)
- {
- Commands->Send_Custom_Event ( obj, barnCiv03, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 2 );
- }
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * barnCiv01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- GameObject * barnCiv02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- GameObject * barnCiv03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if ((barnCiv01 != NULL)||(barnCiv02 != NULL)||(barnCiv03 != NULL))
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );
- }
- else
- {
- Commands->Debug_Message ( "*******************************all barn civs on board--about to send cutom to controller\n" );
- GameObject * controller = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (controller != NULL)
- {
- Commands->Send_Custom_Event ( obj, controller, 0, M01_EVERYONES_ON_BOARD_JDG, 0 );
- Commands->Debug_Message ( "*******************************all barn civs on board--sent cutom to controller\n" );
- }
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event( obj, missionController, 0, M01_END_BARN_ROUNDUP_OBJECTIVE_JDG, 0 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_Prisoner_01_JDG, "")//this guys ID is M01_BARN_PRISONER_01_ID 101442--this is female
- {
- bool talkingToHavoc;
- bool chinookOnWay;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(talkingToHavoc, 1);
- SAVE_VARIABLE(chinookOnWay, 2);
- }
- void Created( GameObject * obj )
- {
- talkingToHavoc = false;
- chinookOnWay = false;
- Commands->Innate_Disable(obj);
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
- Commands->Action_Play_Animation ( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer ) //
- {
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- if (talkingToHavoc == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CUE_BABUSHKA_CONVERSATION_JDG, 2 );
- }
- GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//babushka runs to hide spot
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//you are now talking to havoc in your shed
- {
- talkingToHavoc = true;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//your havoc conversation is now over
- {
- talkingToHavoc = false;
- }
- else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
- {
- chinookOnWay = true;
- Commands->Enable_Hibernation( obj, false );
- }
- else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
- {
- Commands->Enable_Hibernation(obj, false );
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 1 );
-
- Commands->Action_Goto( obj, params );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
- //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
- GameObject * babushkazone = Commands->Find_Object ( 101662 );
- if (babushkazone != NULL)//kill babushka talk zone
- {
- Commands->Destroy_Object ( babushkazone );
- }
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_02_JDG)//civ is at hiding spot--crouch
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Attack (STAR, 0, 0, true);
- params.Set_Animation ("S_A_HUMAN.H_A_A0C0", true);
- Commands->Action_Play_Animation (obj, params);
- if (Commands->Find_Object ( 101662 ))//sending custom to babushka conversation zone--okay to play conversation
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101662 ), 0, M01_START_ACTING_JDG, 0 );
- }
- if (chinookOnWay == false)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//civ is at evac chopper--get on
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
- //if (spawn_effect)
- //{
- // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
- //}
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- //Commands->Give_Points( STAR, 2000, false );
- GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(-51.0f, 214.2f, 5.5f), 1.0f, 0.5f );
- Commands->Action_Goto( obj, params );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_Prisoner_02_JDG, "")//this guys ID is M01_BARN_PRISONER_02_ID 101444--this is Billy
- {
- bool chinookOnWay;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(chinookOnWay, 1);
- }
- void Created( GameObject * obj )
- {
- chinookOnWay = false;
- Commands->Innate_Disable(obj);
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
- Commands->Action_Play_Animation ( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//goto your hiding spot
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
- Commands->Action_Play_Animation ( obj, params );
-
- }
- else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
- {
- chinookOnWay = true;
- Commands->Enable_Hibernation( obj, false );
- }
- else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
- {
- Commands->Enable_Hibernation(obj, false );
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 1 );
-
- Commands->Action_Goto( obj, params );
- GameObject * billyszone = Commands->Find_Object ( 101661 );
- if (billyszone != NULL)//kill billy's talk zone
- {
- Commands->Destroy_Object ( billyszone );
- }
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)//billys at his hide spot
- {
- if (Commands->Find_Object ( 101661 ))//sending custom to billys conversation zone--okay to play conversation
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101661 ), 0, M01_START_ACTING_JDG, 0 );
- }
- if (chinookOnWay == false)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//civ is at evac chopper--get on
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- Commands->Give_Points( STAR, 2000, false );
- GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(-73.572f, 138.013f, 0.329f), RUN, .5f );
-
- Commands->Action_Goto( obj, params );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
- //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_Prisoner_03_JDG, "")//this guys ID is M01_BARN_PRISONER_03_ID 101443--this is pierre
- {
- bool chinookOnWay;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(chinookOnWay, 1);
- }
- void Created( GameObject * obj )
- {
- chinookOnWay = false;
- //Commands->Innate_Disable(obj);
- Commands->Set_Innate_Is_Stationary ( obj, true );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2B", true );
- Commands->Action_Play_Animation ( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Create_Sound ( "EVA_Civilian_Killed", Vector3 (0,0,0), obj );
- //Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_CIVILIAN_KILLED_JDG, 0 );
- GameObject * evacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_CIVILIAN_KILLED_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//guy runs to back shed
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Enable_Hibernation( obj, false );
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L2C", false );
- Commands->Action_Play_Animation ( obj, params );
-
- }//M01_MODIFY_YOUR_ACTION_11_JDG
- else if (param == M01_MODIFY_YOUR_ACTION_11_JDG)//babushka is talking ot havoc--turn and face him
- {
- Commands->Action_Reset ( obj, 100 );
- //ActionParamsStruct params;
- //params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
- //params.Set_Look( STAR, 15 );
- //params.Set_Attack( STAR, 0, 0, true );
- //Commands->Action_Attack ( obj, params );
- //Commands->Action_Face_Location ( obj, params );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
- //params.Set_Look( STAR, 15 );
- params.Set_Attack( STAR, 0, 0, true );
- Commands->Action_Attack ( obj, params );
- }
- else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//your ride is on the way--disable hibernation
- {
- chinookOnWay = true;
- Commands->Enable_Hibernation( obj, false );
- Commands->Set_Innate_Is_Stationary ( obj, false );
- }
- else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
- {
- Commands->Debug_Message ( "***************************barn civ 3 has received evac chopper call--should now be going to evac spot\n" );
- Commands->Enable_Hibernation(obj, false );
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 evacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG ) );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_GOING_TO_EVAC_SPOT_JDG);
- params.Set_Movement( evacSpot, RUN, 1 );
-
- Commands->Action_Goto( obj, params );
-
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)//civ is at hiding spot--crouch
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_MODIFY_YOUR_ACTION_JDG);
- params.Set_Look( STAR, 15 );
- //params.Set_Attack( STAR, 0, 0, true );
- //Commands->Action_Attack ( obj, params );
- Commands->Action_Face_Location ( obj, params );
- if (Commands->Find_Object ( 101662 ))//sending custom to babushka conversation zone--okay to play conversation
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( 101662 ), 0, M01_START_ACTING_JDG, 0 );
- }
- if (chinookOnWay == false)
- {
- Commands->Enable_Hibernation( obj, true );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG )//civ is at evac chopper--get on
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- //GameObject *spawn_effect = Commands->Create_Object( "Spawner Created Special Effect", powerupSpawnLocation );
- //if (spawn_effect)
- //{
- // Commands->Attach_Script( spawn_effect, "M00_Create_Anim_Effect_DAY", "C4_EX1A.C4_EX1A");
- //}
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- //Commands->Give_Points( STAR, 2000, false );
- GameObject * airdropController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( M01_BARNAREA_EVAC_MONITOR_JDG );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "S_A_HUMAN.H_A_HOST_L1C", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( Vector3(-56.8f, 213.2f, 5.5f), 1.0f, 0.5f );
- Commands->Action_Goto( obj, params );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
- //Commands->Set_Obj_Radar_Blip_Shape ( obj, RADAR_BLIP_SHAPE_OBJECTIVE );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NEUTRAL );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Rope_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Debug_Message ( "**********************script attached to evac rope\n" );
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Waypath_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_Evac_TroopBone_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_troopBN.XG_EV5_troopBN") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Waypath_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( 106694 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_Path.XG_EV5_PathZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************waypath has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_Path.XG_EV5_PathZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Rope_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Debug_Message ( "**********************script attached to evac rope\n" );
- Commands->Enable_Hibernation( obj, false );
- GameObject * myController = Commands->Find_Object ( 106694 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "XG_EV5_rope.XG_EV5_ropeZ") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************rope has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "XG_EV5_rope.XG_EV5_ropeZ", false );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_TriggerZone_GDIBase_BaseCommander_JDG, "")//106267 and 106268
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
- if (gdiBaseCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * zone01 = Commands->Find_Object ( 106267 );//trigger zone 01 for base commander
- if (zone01 != NULL)
- {
- Commands->Destroy_Object ( zone01 );//this is a one-time only zone--cleaning up
- }
- GameObject * zone02 = Commands->Find_Object ( 106268 );//trigger zone 02 for base commander
- if (zone02 != NULL)
- {
- Commands->Destroy_Object ( zone02 );//this is a one-time only zone--cleaning up
- }
- GameObject * zone03 = Commands->Find_Object ( 105615 );//trigger zone 01 for this is the path lets go
- if (zone03 != NULL)
- {
- Commands->Destroy_Object ( zone03 );//this is a one-time only zone--cleaning up
- }
- GameObject * zone04 = Commands->Find_Object ( 113733 );//trigger zone 02 for this is the path lets go
- if (zone04 != NULL)
- {
- Commands->Destroy_Object ( zone04 );//this is a one-time only zone--cleaning up
- }
- GameObject * pow01 = Commands->Find_Object ( 103328 );
- GameObject * pow02 = Commands->Find_Object ( 103327 );
- if (pow01 != NULL && pow02 != NULL)
- {
- Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- if (pow01 != NULL)
- {
- Commands->Destroy_Object ( pow01 );
- }
- if (pow02 != NULL)
- {
- Commands->Destroy_Object ( pow02 );
- }
- GameObject * pow_guard01 = Commands->Find_Object ( 103334 );
- if (pow_guard01 != NULL)
- {
- Commands->Destroy_Object ( pow_guard01 );
- }
- GameObject * pow_guard02 = Commands->Find_Object ( 103329 );
- if (pow_guard02 != NULL)
- {
- Commands->Destroy_Object ( pow_guard02 );
- }
- GameObject * pow_guard03 = Commands->Find_Object ( 103330 );
- if (pow_guard03 != NULL)
- {
- Commands->Destroy_Object ( pow_guard03 );
- }
- GameObject * pow_guard04 = Commands->Find_Object ( 103332 );
- if (pow_guard04 != NULL)
- {
- Commands->Destroy_Object ( pow_guard04 );
- }
- GameObject * pow_triggerzone = Commands->Find_Object ( 114348 );//
- if (pow_triggerzone != NULL)
- {
- Commands->Destroy_Object ( pow_triggerzone );
- }
- GameObject * gdi_minigunner_escort = Commands->Find_Object ( 104685 );//M01_GDI_BASE_POWS_OVER_JDG
- if (gdi_minigunner_escort != NULL)
- {
- Commands->Send_Custom_Event( obj, gdi_minigunner_escort, 0, M01_GDI_BASE_POWS_OVER_JDG, 0 );
- Commands->Send_Custom_Event( obj, gdi_minigunner_escort, 0, M01_WALKING_WAYPATH_05_JDG, 0 );
- }
- //GameObject * gdi_grenadier_escort = Commands->Find_Object ( 104686 );
- //if (gdi_grenadier_escort != NULL)
- //{
- // Commands->Send_Custom_Event( obj, gdi_grenadier_escort, 0, M01_GDI_BASE_POWS_OVER_JDG, 0 );
- //}
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_FirstChinookFlamethrowerGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( 104685 );
- GameObject * gdiGuy02 = Commands->Find_Object ( 104686 );
- if (gdiGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
- }
- if (gdiGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
- }
- }
- };
- /*DECLARE_SCRIPT(M01_GDIBase_SecondChinookFlamethrowerGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (powController != NULL)
- {
- Commands->Send_Custom_Event( obj, powController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.h_a_troopdrop") == 0)
- {
- Vector3 myHomeSpot (-22.604f, 25.125f, 1.605f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_START_ATTACKING_03_JDG);
- params.Set_Movement(myHomeSpot, RUN, 5);
- Commands->Action_Attack (obj, params);
- Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (powController != NULL)
- {
- Commands->Send_Custom_Event( obj, powController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_SecondChinookMinigunnerGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (powController != NULL)
- {
- Commands->Send_Custom_Event( obj, powController, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.h_a_troopdrop") == 0)
- {
- Vector3 myHomeSpot (-16.144f, 19.274f, 2.312f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_START_ATTACKING_03_JDG);
- params.Set_Movement(myHomeSpot, RUN, 2);
- Commands->Action_Attack (obj, params);
- Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_03_JDG);
- params.Set_Movement(STAR, RUN, 5);
- params.Set_Attack( STAR, 15, 1, true );
- Commands->Action_Attack (obj, params);
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * powController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (powController != NULL)
- {
- Commands->Send_Custom_Event( obj, powController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- };*/
- DECLARE_SCRIPT(M01_TibCave_StartZone_JDG, "")//108922
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * visceroid01 = Commands->Find_Object ( 106908 );
- GameObject * visceroid02 = Commands->Find_Object ( 106909 );
- GameObject * visceroid03 = Commands->Find_Object ( 106907 );
- GameObject * visceroidNodGuy01 = Commands->Find_Object ( 106910 );
- GameObject * visceroidNodGuy02 = Commands->Find_Object ( 106911 );
- if (visceroid01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, visceroid01, 0, M01_START_ACTING_JDG, 0 );
- }
- if (visceroid02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, visceroid02, 0, M01_START_ACTING_JDG, 0 );
- }
- if (visceroid03 != NULL)
- {
- Commands->Send_Custom_Event ( obj, visceroid03, 0, M01_START_ACTING_JDG, 0 );
- }
- if (visceroidNodGuy01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, visceroidNodGuy01, 0, M01_START_ACTING_JDG, 0 );
- }
- if (visceroidNodGuy02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, visceroidNodGuy02, 0, M01_START_ACTING_JDG, 1 );
- }
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- };
- DECLARE_SCRIPT(M01_Visceroid01_JDG, "")//106908
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Innate_Enable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- GameObject * nodguy01 = Commands->Find_Object ( 106910 );
- if (nodguy01 != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( nodguy01, 10, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Visceroid02_JDG, "")//106909
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Innate_Enable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- GameObject * nodguy01 = Commands->Find_Object ( 106910 );
- if (nodguy01 != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( nodguy01, 10, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Visceroid03_JDG, "")//106907
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Innate_Enable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- //Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( STAR, 10, 0, true );
- params.Set_Movement( STAR, RUN, 2 );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Visceroid_NodGuy01_JDG, "")//106910
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Innate_Enable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- Commands->Create_Sound ( "MX1DSGN_DSGN0017I1DSGN_SND", myPosition, obj );
- GameObject * visceroid01 = Commands->Find_Object ( 106908 );
- if (visceroid01 != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 90, M01_START_ACTING_JDG );
- params.Set_Attack( visceroid01, 25, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Visceroid_NodGuy02_JDG, "")//106911
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Innate_Enable(obj);
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- Commands->Create_Sound ( "MX1DSGN_DSGN0018I1DSGN_SND", myPosition, obj );
- GameObject * visceroid01 = Commands->Find_Object ( 106908 );
- if (visceroid01 != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 90, M01_START_ACTING_JDG );
- params.Set_Attack( visceroid01, 25, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Tiberium_Cave_Spawn_Helicopter_Zone_JDG, "")//M01_TIB_TUNNEL_HELICOPTER_ZONE_JDG...this guys ID is 100955
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SPAWN_TIB_CAVE_HELICOPTER_JDG, 0 );
- int apacheConv = Commands->Create_Conversation( "M01_Announce_Apache_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, apacheConv, false, false );
- Commands->Join_Conversation( STAR, apacheConv, false, false );
- Commands->Start_Conversation( apacheConv, apacheConv );
- GameObject * tunnelGuy = Commands->Find_Object ( 103274 );
- if (tunnelGuy != NULL)
- {
- Commands->Send_Custom_Event( obj, tunnelGuy, 0, M01_START_ACTING_JDG, 0 );
- }
- Commands->Destroy_Object ( obj );
- }
-
- }
- };
- DECLARE_SCRIPT(M01_TiberiumCave_UpThere_NodGuy_JDG, "")//103274
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( STAR, 0, 0, true );
- Commands->Action_Attack (obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 3 );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Create_Sound ( "MX1DSGN_DSGN0019I1DSGN_SND", myPosition, obj );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( STAR, 50, 0, true );
- Commands->Action_Attack (obj, params);
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Detention_GuardTower_Enter_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * detentionCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
- if (detentionCiv01 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * detentionCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
- if (detentionCiv02 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv02, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * detentionCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
- if (detentionCiv03 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv03, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * detentionGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
- if (detentionGDI01 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI01, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * detentionGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
- if (detentionGDI02 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI02, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * detentionGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
- if (detentionGDI03 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI03, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- GameObject * detentionCiv01 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
- if (detentionCiv01 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv01, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * detentionCiv02 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
- if (detentionCiv02 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv02, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * detentionCiv03 = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
- if (detentionCiv03 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionCiv03, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * detentionGDI01 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_01_JDG );
- if (detentionGDI01 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI01, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * detentionGDI02 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_02_JDG );
- if (detentionGDI02 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI02, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * detentionGDI03 = Commands->Find_Object ( M01_DETENTION_GDI_GUY_03_JDG );
- if (detentionGDI03 != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGDI03, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_PrisonPen_POW_JDG, "")
- {
- bool okayToReact;
- bool heardHavocAlert;
- bool gateIsDown;
- bool sam_is_destroyed;
- int pow_guy01_id;//101927
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(okayToReact, 1);
- SAVE_VARIABLE(heardHavocAlert, 2);
- SAVE_VARIABLE(gateIsDown, 3);
- SAVE_VARIABLE(sam_is_destroyed, 4);
- SAVE_VARIABLE(pow_guy01_id, 5);
- }
- void Created( GameObject * obj )
- {
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
- pow_guy01_id = 101927;
- okayToReact = false;
- heardHavocAlert = false;
- gateIsDown = false;
- sam_is_destroyed = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_START_ACTING_JDG:
- {
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, true );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, true );
- okayToReact = true;
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- okayToReact = false;
- }
- break;
- case M01_FACING_SPECIFIED_DIRECTION_01_JDG:
- {
- Commands->Innate_Disable(obj);
- params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Attack( STAR, 0, 0, true );
-
- Commands->Action_Attack ( obj, params );
- float delayTimer = Commands->Get_Random ( 0.25f, 2.5f );
- Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, delayTimer );
- }
- break;
- case M01_DOING_ANIMATION_01_JDG:
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- break;
- }
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (gateIsDown == true)
- {
- if (sam_is_destroyed == false)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Poke_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, false, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
- GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );//
- if (obj == gdipow01)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Hello_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, false, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG)
- {
- GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );
- if (obj == gdipow01)
- {
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3 (-297.801f, 572.799f, 27.458f), RUN, 1);
- Commands->Action_Goto ( obj, params );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG)
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG)
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- GameObject * gdipow01 = Commands->Find_Object ( pow_guy01_id );
- if (obj == gdipow01)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_GDI_Evac_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, true, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement( Vector3 (-328.136f, 548.518f, 30.044f), RUN, 3);
- Commands->Action_Goto ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_05_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
-
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event( obj, missionController, 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
- }
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- ActionParamsStruct params;
- if (sound.Type == M01_DETENTION_GATE_IS_DOWN_JDG && gateIsDown == false)
- {
- gateIsDown = true;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Action_Reset ( obj, 100 );
- GameObject * commCenterSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
- if (commCenterSamSite != NULL)
- {
- Vector3 myGotoSpot;
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == M01_DETENTION_GDI_GUY_01_JDG)
- {
- myGotoSpot.Set (-312.413f, 577.030f, 27.567f);
- }
- else if (myIdNumber == M01_DETENTION_GDI_GUY_02_JDG)
- {
- myGotoSpot.Set (-311.138f, 578.398f, 27.687f);
- }
- else
- {
- myGotoSpot.Set (-309.667f, 576.016f, 27.753f);
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Movement( myGotoSpot, RUN, 0.5f);
- Commands->Action_Goto ( obj, params );
- }
- }
- else if (sound.Type == M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG)
- {
- sam_is_destroyed = true;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Action_Reset ( obj, 100 );
- Vector3 myGotoSpot;
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == M01_DETENTION_GDI_GUY_01_JDG)
- {
- myGotoSpot.Set (-312.413f, 577.030f, 27.567f);
- }
- else if (myIdNumber == M01_DETENTION_GDI_GUY_02_JDG)
- {
- myGotoSpot.Set (-311.138f, 578.398f, 27.687f);
- }
- else
- {
- myGotoSpot.Set (-309.667f, 576.016f, 27.753f);
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Movement( myGotoSpot, RUN, 0.5f);
- Commands->Action_Goto ( obj, params );
-
- }
- else if (sound.Creator == STAR && okayToReact == true && heardHavocAlert == false)
- {
- if (sound.Type == SOUND_TYPE_GUNSHOT)
- {
- heardHavocAlert = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
- }
- else if (sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- heardHavocAlert = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_PrisonPen_Civilian_JDG, "")
- {
- Vector3 wanderSpot[10];
- int gdi_pow_id;
- int my_id;
- int prisoner_2_id;
- int prisoner_3_id;
- int last;
- float loiterTimeMin;
- float loiterTimeMax;
- bool okayToReact;
- bool heardHavocAlert;
- bool gateIsDown;
- bool sam_is_destroyed;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(gdi_pow_id, 1);
- SAVE_VARIABLE(my_id, 2);
- SAVE_VARIABLE(prisoner_2_id, 3);
- SAVE_VARIABLE(prisoner_3_id, 4);
- SAVE_VARIABLE(last, 5);
- SAVE_VARIABLE(loiterTimeMin, 6);
- SAVE_VARIABLE(loiterTimeMax, 7);
- SAVE_VARIABLE(okayToReact, 8);
- SAVE_VARIABLE(heardHavocAlert, 9);
- SAVE_VARIABLE(gateIsDown, 10);
- SAVE_VARIABLE(sam_is_destroyed, 11);
- }
- void Created( GameObject * obj )
- {
- okayToReact = false;
- heardHavocAlert = false;
- gateIsDown = false;
- sam_is_destroyed = false;
- Commands->Innate_Soldier_Enable_Enemy_Seen ( obj, false );
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- wanderSpot[0].Set (-313.881f, 589.854f, 27.457f);
- wanderSpot[1].Set (-303.287f, 587.881f, 27.457f);
- wanderSpot[2].Set (-296.290f, 595.483f, 27.458f);
- wanderSpot[3].Set (-295.055f, 589.244f, 27.458f);
- wanderSpot[4].Set (-309.122f, 578.526f, 27.741f);
- wanderSpot[5].Set (-299.833f, 578.027f, 27.735f);
- wanderSpot[6].Set (-297.657f, 571.844f, 27.458f);
- wanderSpot[7].Set (-289.746f, 578.258f, 27.781f);
- wanderSpot[8].Set (-280.325f, 579.701f, 27.458f);
- wanderSpot[9].Set (-286.094f, 585.007f, 27.720f);
- loiterTimeMin = 5;
- loiterTimeMax = 30;
- last = 20;
- gdi_pow_id = 101927;
- my_id = Commands->Get_ID ( obj );
- if (my_id == 101929)
- {
- prisoner_2_id = 101930;
- prisoner_3_id = 101931;
- }
- else if (my_id == 101930)
- {
- prisoner_2_id = 101929;
- prisoner_3_id = 101931;
- }
- else if (my_id == 101931)
- {
- prisoner_2_id = 101929;
- prisoner_3_id = 101930;
- }
- Commands->Start_Timer ( obj, this, 5, M01_PICK_A_NEW_LOCATION_JDG );
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- ActionParamsStruct params;
- int random = int(Commands->Get_Random(0, 13-WWMATH_EPSILON));
-
- while (random == last)
- {
- random = int(Commands->Get_Random(0, 13-WWMATH_EPSILON));
- }
- if (random <= 9)
- {
- Vector3 shinGotoSpot = wanderSpot[random];
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( shinGotoSpot, WALK, 1 );
- Commands->Action_Goto( obj, params );
- loiterTimeMin = 5;
- loiterTimeMax = 30;
- }
- else if (random == 10 && Commands->Find_Object ( prisoner_2_id ))
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Commands->Find_Object ( prisoner_2_id ), WALK, 2 );
- Commands->Action_Goto( obj, params );
- loiterTimeMin = 5;
- loiterTimeMax = 30;
- }
- else if (random == 11 && Commands->Find_Object ( prisoner_3_id ))
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Commands->Find_Object ( prisoner_3_id ), WALK, 2 );
- Commands->Action_Goto( obj, params );
- loiterTimeMin = 5;
- loiterTimeMax = 30;
- }
- else
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Commands->Find_Object ( gdi_pow_id ), WALK, 2 );
- Commands->Action_Goto( obj, params );
- loiterTimeMin = 1;
- loiterTimeMax = 3;
- }
- last = random;
- }
- void Poked( GameObject * obj, GameObject * poker )
- {
- if (gateIsDown == true)
- {
- if (sam_is_destroyed == false)
- {
- GameObject * babushka = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
- GameObject * pierre = Commands->Find_Object ( M01_DETENTION_CIVILIAN_02_JDG );
- GameObject * farmerJohn = Commands->Find_Object ( M01_DETENTION_CIVILIAN_03_JDG );
- if (obj == babushka)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_Babushka_Poke_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, false, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- else if (obj == pierre)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_Pierre_Poke_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, false, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- else if (obj == farmerJohn)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_FarmerJohn_Poke_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, false, true, true );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_START_ACTING_JDG:
- {
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, true );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, true );
- okayToReact = true;
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- okayToReact = false;
- }
- break;
- case M01_FACING_SPECIFIED_DIRECTION_01_JDG:
- {
- Commands->Innate_Disable(obj);
- params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Attack( STAR, 0, 0, true );
-
- Commands->Action_Attack ( obj, params );
- float delayTimer = Commands->Get_Random ( 1.25f, 3.5f );
- Commands->Send_Custom_Event( obj, obj, 0, M01_DOING_ANIMATION_01_JDG, delayTimer );
- }
- break;
- case M01_DOING_ANIMATION_01_JDG:
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- break;
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- ActionParamsStruct params;
- if (sound.Type == M01_DETENTION_GATE_IS_DOWN_JDG && gateIsDown == false)
- {
- gateIsDown = true;
- Commands->Action_Reset ( obj, 100 );
- GameObject * commCenterSamSite = Commands->Find_Object ( M01_COMMCENTER_SAM_JDG );
- if (commCenterSamSite != NULL)
- {
- Vector3 myGotoSpot;
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == M01_DETENTION_CIVILIAN_01_JDG)//babushka
- {
- myGotoSpot.Set (-303.867f, 579.217f, 27.604f);
- }
- else if (myIdNumber == M01_DETENTION_CIVILIAN_02_JDG)//pierre
- {
- myGotoSpot.Set (-304.901f, 575.936f, 27.724f);
- }
- else//farmer john
- {
- myGotoSpot.Set (-304.887f, 582.889f, 27.457f);
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement( myGotoSpot, RUN, 0.5f);
- Commands->Action_Goto ( obj, params );
- }
- }
- else if (sound.Type == M01_DETENTION_GATE_DOWN_SAM_DEAD_JDG )
- {
- sam_is_destroyed = true;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Action_Reset ( obj, 100 );
- Vector3 myGotoSpot;
- int myIdNumber = Commands->Get_ID ( obj );
- if (myIdNumber == M01_DETENTION_CIVILIAN_01_JDG)//babushka
- {
- myGotoSpot.Set (-303.867f, 579.217f, 27.604f);
- }
- else if (myIdNumber == M01_DETENTION_CIVILIAN_02_JDG)//pierre
- {
- myGotoSpot.Set (-304.901f, 575.936f, 27.724f);
- }
- else//farmer john
- {
- myGotoSpot.Set (-304.887f, 582.889f, 27.457f);
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement( myGotoSpot, RUN, 0.5f);
- Commands->Action_Goto ( obj, params );
- }
- else if (sound.Creator == STAR && okayToReact == true && heardHavocAlert == false)
- {
- if (sound.Type == SOUND_TYPE_GUNSHOT)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
- heardHavocAlert = true;
- }
- else if (sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 0 );
- heardHavocAlert = true;
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- float delayTimer = Commands->Get_Random ( loiterTimeMin, loiterTimeMax );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG)//civ is running to gate
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG)
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );//M01_Detention_Babushka_Evac_Conversation01
- GameObject * babushka = Commands->Find_Object ( M01_DETENTION_CIVILIAN_01_JDG );
- if (obj == babushka)
- {
- int apacheConv = Commands->Create_Conversation( "M01_Detention_Babushka_Evac_Conversation01", 100, 1000, false);
- Commands->Join_Conversation( obj, apacheConv, true, true, true );
- Commands->Join_Conversation( STAR, apacheConv, false, false, false );
- Commands->Start_Conversation( apacheConv, apacheConv );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_DO_END_MISSION_CHECK_JDG, 5 );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement( Vector3 (-328.136f, 548.518f, 30.044f), RUN, 3);
- Commands->Action_Goto ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_05_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event( obj, missionController, 0, M01_DO_END_MISSION_CHECK_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_Trigger_Zone_JDG, "")//M01_BARNAREA_NOD_COMMANDER_JDG
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR )
- {
- GameObject * firstFieldCommander = Commands->Find_Object (M01_BARNAREA_NOD_COMMANDER_JDG);
- if (firstFieldCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ), 0, M01_START_ACTING_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG, 5 );
- }
- GameObject * zone01 = Commands->Find_Object (102361);
- GameObject * zone02 = Commands->Find_Object (103343);
- if (zone01 != NULL)
- {
- Commands->Destroy_Object ( zone01 );//one time zone
- }
-
- if (zone02 != NULL)
- {
- Commands->Destroy_Object ( zone02 );//one time zone
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_GuardTower_NOD_Commander_JDG, "")//M01_BARNAREA_NOD_COMMANDER_JDG
- {
- int guardTowerIntro;
- bool deadYet;
- bool introConvPlaying;
- bool firstTimeDamaged;
- bool playerSeen;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(guardTowerIntro, 1);
- SAVE_VARIABLE(deadYet, 2);
- SAVE_VARIABLE(introConvPlaying, 3);
- SAVE_VARIABLE(firstTimeDamaged, 4);
- SAVE_VARIABLE(playerSeen, 5);
- }
- void Created( GameObject * obj )
- {
- introConvPlaying = false;
- firstTimeDamaged = true;
- playerSeen = false;
- deadYet = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- if (damager == STAR && deadYet == false && firstTimeDamaged == true)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- char *animationName = M01_Choose_Duck_Animation();
- firstTimeDamaged = false;
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR)
- {
- playerSeen = true;
- }
- }
- void Sound_Heard( GameObject * obj, const CombatSound & sound )
- {
- if (sound.Creator == STAR)
- {
- if (/*sound.Type == SOUND_TYPE_GUNSHOT ||*/ sound.Type == SOUND_TYPE_BULLET_HIT)
- {
- if (obj)
- {
- if (deadYet == false && playerSeen == false)
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float playerDistance = Commands->Get_Distance ( myPosition, playerPosition );
- if (playerDistance >= 15)
- {
- char *animationName = M01_Choose_Duck_Animation();
- //firstTimeDamaged = false;
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- }
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (introConvPlaying == true)
- {
- Commands->Stop_Conversation( guardTowerIntro );
- }
- GameObject * zone01 = Commands->Find_Object (102361);
- GameObject * zone02 = Commands->Find_Object (103343);
- if (zone01 != NULL)
- {
- Commands->Destroy_Object ( zone01 );//one time zone
- }
-
- if (zone02 != NULL)
- {
- Commands->Destroy_Object ( zone02 );//one time zone
- }
- deadYet = true;
- GameObject * artilleryController = Commands->Find_Object ( M01_GDIBASE_ARTILLERY_CONTROLLER_ID );
- if (artilleryController != NULL)
- {
- Commands->Send_Custom_Event( obj, artilleryController, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- GameObject * objectiveController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (objectiveController != NULL)
- {
- Commands->Send_Custom_Event( obj, objectiveController, 0, M01_CLEAR_FIRST_NOD_COMMANDER_PASS_JDG, 5 );
- }
- if (STAR)
- {
- int guardTowerOutro = Commands->Create_Conversation( "M01_GuardTower_Outro_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, guardTowerOutro, false, false );
- //Commands->Join_Conversation( STAR, guardTowerOutro, false, false );
- Commands->Start_Conversation( guardTowerOutro, guardTowerOutro );
- }
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == guardTowerIntro)
- {
- introConvPlaying = false;
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- switch (param)
- {
- case M01_START_ACTING_JDG: //here comes player start calling in reinforcements
- {
- GameObject * zone01 = Commands->Find_Object (102361);
- GameObject * zone02 = Commands->Find_Object (103343);
- if (sender == zone01)
- {
- Commands->Debug_Message ( "**********************Nod gdi tower commander has recieved command to start acting\n" );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 2 );
- }
- else if (sender == zone02)
- {
- Commands->Debug_Message ( "**********************Nod gdi tower commander has recieved command to start acting\n" );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 20 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, 20 );
- }
-
- if (STAR && deadYet == false)
- {
- introConvPlaying = true;
- guardTowerIntro = Commands->Create_Conversation( "M01_GuardTower_Intro_Conversation", 95, 1000, true);
- Commands->Join_Conversation( NULL, guardTowerIntro, false, false );
- //Commands->Join_Conversation( STAR, guardTowerIntro, false, false );
- Commands->Start_Conversation( guardTowerIntro, guardTowerIntro );
- Commands->Monitor_Conversation( obj, guardTowerIntro );
- }
- }
- break;
- case M01_MODIFY_YOUR_ACTION_JDG://set timer--then call in next reinforcements
- {
- if (obj)
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
- int medium = 1;
- int hard = 2;
- float delayTimer;
- if (currentDifficulty == hard)
- {
- delayTimer = 60;
- }
- else if (currentDifficulty == medium)
- {
- delayTimer = 90;
- }
- else
- {
- delayTimer = 120;
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, delayTimer );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );
- }
- }
- break;
- case M01_SEND_GUARD_TOWER_CHINOOK_JDG: //here comes player start calling in reinforcements
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, 0 );
- }
- }
- break;
- case M01_CALL_IN_REINFORCEMENTS_JDG: //here comes player start calling in reinforcements
- {
- if (obj && deadYet == false)
- {
- GameObject * nodCommanderDialogController = Commands->Find_Object ( 103398 );
- if (nodCommanderDialogController != NULL)
- {
- Commands->Debug_Message ( "**********************Nod gdi tower commander is sending custom to dialog controller\n" );
- Commands->Send_Custom_Event( obj, nodCommanderDialogController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- float delayTimer = Commands->Get_Random ( 15, 30 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CALL_IN_REINFORCEMENTS_JDG, delayTimer );
- }
- }
- break;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_Commander_Conversation_Controller_GDI, "")// 103398
- {
- bool first_call;
- int initialCommanderConv;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(first_call, 1);
- SAVE_VARIABLE(initialCommanderConv, 2);
- }
- void Created( GameObject * obj )
- {
- first_call = true;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//nod commander is calling in reinforcements
- {
- GameObject * guardTower01Commander = Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG );
- if (sender == guardTower01Commander && first_call == true)
- {
- first_call = false;
- initialCommanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv04", 100, 300, true);
- Commands->Join_Conversation( sender, initialCommanderConv, false, false, false );
- Commands->Start_Conversation( initialCommanderConv, initialCommanderConv );
- Commands->Monitor_Conversation( obj, initialCommanderConv );
- }
- else
- {
- int random = Commands->Get_Random_Int(0, 5);
- if (random == 0)
- {
- int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv01", 90, 200, true);
- Commands->Join_Conversation( sender, commanderConv, false, false, false );
- Commands->Start_Conversation( commanderConv, commanderConv );
- }
- else if (random == 1)
- {
- int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv02", 90, 200, true);
- Commands->Join_Conversation( sender, commanderConv, false, false, false );
- Commands->Start_Conversation( commanderConv, commanderConv );
- }
- else if (random == 2)
- {
- int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv03", 90, 200, true);
- Commands->Join_Conversation( sender, commanderConv, false, false, false );
- Commands->Start_Conversation( commanderConv, commanderConv );
- }
- else if (random == 3)
- {
- int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv04", 90, 200, true);
- Commands->Join_Conversation( sender, commanderConv, false, false, false );
- Commands->Start_Conversation( commanderConv, commanderConv );
- }
- else
- {
- int commanderConv = Commands->Create_Conversation( "M01_Nod_Commander_Conv05", 90, 200, true);
- Commands->Join_Conversation( sender, commanderConv, false, false, false );
- Commands->Start_Conversation( commanderConv, commanderConv );
- }
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (action_id == initialCommanderConv)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_SEND_GUARD_TOWER_CHINOOK_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_LightTank_PastTunnelZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- GameObject * lightTank = Commands->Find_Object ( M01_TAILGUNAREA_NOD_LIGHTTANK_JDG );
- if (enterer == lightTank)
- {
- Commands->Send_Custom_Event( obj, lightTank, 0, M01_GOTO_IDLE_JDG, 0 );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_KeyCard01_Script_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- int lockeKeycard = Commands->Create_Conversation( "M01_First_Keycard_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, lockeKeycard, false, false );
- Commands->Start_Conversation( lockeKeycard, lockeKeycard );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_AI_ExitZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- GameObject * gdiFollower = Commands->Find_Object ( 104686 );
- GameObject * gdiCommander = Commands->Find_Object ( 106050 );
- GameObject * gdiLeader = Commands->Find_Object ( 104685 );
- GameObject * pow01 = Commands->Find_Object ( 103327 );
- GameObject * pow02 = Commands->Find_Object ( 103328 );
- if (enterer == gdiFollower)
- {
- if (gdiFollower != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiFollower, 0, M01_HOLD_YOUR_POSITION_JDG, 0 );
- }
- }
- else if (enterer == gdiCommander)
- {
- if (gdiCommander != NULL)//
- {
- Commands->Send_Custom_Event( obj, gdiCommander, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- //Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- if (gdiFollower != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiFollower, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- if (gdiLeader != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiLeader, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- }
- else if (enterer == pow01)
- {
- if (pow01 != NULL)
- {
- Commands->Send_Custom_Event( obj, pow01, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- if (pow02 != NULL)
- {
- Commands->Send_Custom_Event( obj, pow02, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_LightTank_JDG, "")//M01_TAILGUNAREA_NOD_LIGHTTANK_JDG 102435
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- int tankReward = Commands->Create_Conversation( "M01_TankReward_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, tankReward, false, false );
- //Commands->Join_Conversation( STAR, tankReward, false, false );
- Commands->Start_Conversation( tankReward, tankReward );
-
- Vector3 tankDeathSpot (4.2f, 279.8f, 3.2f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", tankDeathSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- Vector3 myPosition = Commands->Get_Position ( obj );
- myPosition.Z += 0.25f;
- Commands->Create_Object ( "POW_Medal_Armor", myPosition );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- switch (param)
- {
- case M01_START_ACTING_JDG:
- {
- if (STAR)
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
-
- int medium = 1;
- int hard = 2;
- float tankSpeed;
-
- if (currentDifficulty == hard)
- {
- tankSpeed = 0.6f;
- }
- else if (currentDifficulty == medium)
- {
- tankSpeed = 0.4f;
- }
- else
- {
- tankSpeed = 0.2f;
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(0,0,0), tankSpeed, 2 );
- params.WaypathID = 102233;
- //params.WaypointStartID = 102235;
- params.AttackCheckBlocked = false;
- params.AttackActive = false;
- Commands->Action_Attack( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 3 );
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 3 );
- }
- }
- break;
- case M01_MODIFY_YOUR_ACTION_03_JDG:
- {
- int currentDifficulty = Commands->Get_Difficulty_Level( );
-
- int medium = 1;
- int hard = 2;
- float tankSpeed;
- float tankRange;
- float tankAccuracy;
-
- if (currentDifficulty == hard)
- {
- tankSpeed = 0.5f;
- tankRange = 100;
- tankAccuracy = 0;
- }
- else if (currentDifficulty == medium)
- {
- tankSpeed = 0.3f;
- tankRange = 75;
- tankAccuracy = 1;
- }
- else
- {
- tankSpeed = 0.1f;
- tankRange = 50;
- tankAccuracy = 3;
- }
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( Vector3(0,0,0), tankSpeed, 2 );
- params.WaypathID = 102233;
- //params.WaypointStartID = 102235;
- params.Set_Attack( STAR, tankRange, tankAccuracy, true );
- params.AttackActive = true;
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_02_JDG, params );
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_BackPath_NodGuy_JDG, "")//103337
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(Vector3 (57.651f, 54.752f, -0.449f), RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, 20 );
- params.Set_Attack( STAR, 50, 3, true );
- params.AttackCheckBlocked = true;
- Commands->Action_Attack (obj, params);
- }
- }
- };
- DECLARE_SCRIPT(M01_Sinking_Gunboat_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Animation ( obj, "V_GDI_GBOAT.XG_GBOAT_SINK", false, NULL, 0, 60 );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "V_GDI_GBOAT.XG_GBOAT_SINK") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_PlayerEntering_BarnArea_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
- if (gunboatController != NULL)
- {
- Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject *hovercraftController = Commands->Find_Object ( 121630 );
- if (hovercraftController != NULL)
- {
- Commands->Send_Custom_Event ( obj, hovercraftController, 0, M01_START_ACTING_JDG, 10 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_PlayerLeaving_BarnArea_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
- if (gunboatController != NULL)
- {
- Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Barn_EntryZone_JDG, "")//113734
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)//
- {
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event ( obj, missionController, 0, M01_END_BARN_OBJECTIVE_JDG, 0 );
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_BaseCommander_Backside_EntryZone_JDG, "")//113733
- {
- bool entered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(entered, 1);
- }
- void Created( GameObject * obj )
- {
- entered = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR && entered == false)
- {
- entered = true;
- GameObject * gdiBaseLeaderGuy = Commands->Find_Object ( 104685 );//
- if (gdiBaseLeaderGuy != NULL)
- {
- Commands->Send_Custom_Event ( obj, gdiBaseLeaderGuy, 0, M01_MODIFY_YOUR_ACTION_10_JDG, 0 );
- Commands->Destroy_Object ( obj );//one time zone--cleaning up
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Obelisk_UpdateDisc_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Reveal_Encyclopedia_Building ( 12 );
- Commands->Set_HUD_Help_Text ( IDS_M00EVAG_DSGN0104I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_EvacMonitor_JDG, "")//M01_BARNAREA_EVAC_MONITOR_JDG
- {
- int unitsEvacuated;
- int evac_helicopter_id;
- int evac_waypath_id;
- int evac_rope_id;
- bool transportCalled;
- int barnAirdrop_conv;
- bool failed;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(unitsEvacuated, 1);
- SAVE_VARIABLE(evac_helicopter_id, 2);
- SAVE_VARIABLE(evac_waypath_id, 3);
- SAVE_VARIABLE(evac_rope_id, 4);
- SAVE_VARIABLE(transportCalled, 5);
- SAVE_VARIABLE(barnAirdrop_conv, 6);
- SAVE_VARIABLE(failed, 7);
- }
- void Created( GameObject * obj )
- {
- unitsEvacuated = 0;
- transportCalled = false;
- failed = false;
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == barnAirdrop_conv)
- {
- int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
- //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
- Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender ) //
- {
- if (param == M01_CIVILIAN_KILLED_JDG)//
- {
- GameObject * civ01 = Commands->Find_Object ( M01_BARN_PRISONER_01_ID );
- GameObject * civ02 = Commands->Find_Object ( M01_BARN_PRISONER_02_ID );
- GameObject * civ03 = Commands->Find_Object ( M01_BARN_PRISONER_03_ID );
- if (sender == civ01)
- {
- failed = true;
- }
- else if (sender == civ02)
- {
- failed = true;
- }
- else if (sender == civ03)
- {
- failed = true;
- }
- }
- else if (param == M01_GOING_TO_EVAC_SPOT_JDG)
- {
- unitsEvacuated++;
- if (unitsEvacuated == 3 && failed == false)
- {
- barnAirdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, barnAirdrop_conv, false, false );
- Commands->Start_Conversation( barnAirdrop_conv, barnAirdrop_conv );
- Commands->Monitor_Conversation( obj, barnAirdrop_conv );
- Vector3 airDropSpot (-0.923f, 143.580f, 0.647f);
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", airDropSpot);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1D_GDIPowerUpDrop.txt");
- }
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
- {
- evac_helicopter_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
- }
- else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
- {
- evac_waypath_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
- }
- else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
- {
- evac_rope_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
- }
- else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
- {
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
- Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
-
- Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
- Commands->Innate_Disable(sender);
- Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
- if(troopbone)
- {
- Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
- }
- else
- {
- Commands->Debug_Message("troopbone not created yet");
- }
-
- Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
- }
- else if (param == M01_SEND_BARN_CIVILIANS_RESCUE_CHINOOK_JDG)//a gdi guy is waiting for evac--call in a helicopter
- {
- if (transportCalled == false)
- {
- transportCalled = true;
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_BarnArea_EvacAnim.txt");
- }
- }
- else if (param == M01_EVERYONES_ON_BOARD_JDG)//chinook is ready to go--give clearance
- {
- Commands->Debug_Message ( "*******************************all barn civs on board--custom received by controller\n" );
- GameObject *evacWaypath = Commands->Find_Object ( evac_waypath_id );
- if (evacWaypath != NULL)
- {
- Commands->Send_Custom_Event( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject *evacChopper = Commands->Find_Object ( evac_helicopter_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject *evacRope = Commands->Find_Object ( evac_rope_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (failed == true)
- {
- int honAlerted_conv = Commands->Create_Conversation( "M01_HandOfNod_Alerted_Conversation", 100, 1000, false);
- Commands->Join_Conversation( NULL, honAlerted_conv, false, false );
- //Commands->Join_Conversation( STAR, honAlerted_conv, false, false );
- Commands->Start_Conversation( honAlerted_conv, honAlerted_conv );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_RedKey_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- bool playerHasRedKey = Commands->Has_Key( STAR, 3 );
- if (playerHasRedKey == false)
- {
- Vector3 keyCardLocation (-168.195f, 527.489f, -31.130f);
- Commands->Create_Object ( "Level_03_Keycard", keyCardLocation );
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Comm_Center_Pen_Gate, "")
- {
- bool samDead;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(samDead, 1);
- }
- void Created( GameObject * obj )
- {
- samDead = false;
- Commands->Enable_HUD_Pokable_Indicator ( obj, true );
- }
- void Poked( GameObject * obj, GameObject * poker ) //
- {
- if (poker == STAR && samDead == true)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_HAS_POKED_PEN_GATE_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
- }
- else if (param == M01_START_ACTING_JDG)
- {
- samDead = true;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_CommCenter_SAMSite_Script, "")
- {
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == (STAR))
- {
- if (obj)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object (M01_MISSION_CONTROLLER_JDG), 0, M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG, 0 );
- GameObject * detentionGate = Commands->Find_Object ( 101117 );
- if (detentionGate != NULL)
- {
- Commands->Send_Custom_Event( obj, detentionGate, 0, M01_COMMCENTER_SAMSITE_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Commander_Shack_Zone_JDG, "")//115985
- {
- bool commanderAlive;
- bool playerinZone;
- bool commandClearance;
- bool convStarted;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(commanderAlive, 1);
- SAVE_VARIABLE(playerinZone, 2);
- SAVE_VARIABLE(commandClearance, 3);
- SAVE_VARIABLE(convStarted, 4);
- }
- void Created( GameObject * obj )
- {
- commanderAlive = true;
- playerinZone = false;
- commandClearance = false;
- convStarted = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- playerinZone = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- GameObject * convController = Commands->Find_Object ( 125857 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- playerinZone = false;
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- commandClearance = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- commanderAlive = false;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG && convStarted == false)
- {
- if (playerinZone == true && commanderAlive == true && commandClearance == true)//M01_MODIFY_YOUR_ACTION_JDG
- {
- GameObject * gdiCommander = Commands->Find_Object ( 106050);
- if (gdiCommander != NULL)
- {
- convStarted = true;
- Commands->Send_Custom_Event( obj, gdiCommander, 0, M01_MODIFY_YOUR_ACTION_JDG, 1 );
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0.25f );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_Engineer_JDG, "")//this guys ID is M01_TURRETBEACH_ENGINEER_ID 101654
- {
- bool working_here_boss;
- bool first_time;
- float last_health;
- bool killedYet;
- bool turret01_dead;
- bool turret02_dead;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(working_here_boss, 1);
- SAVE_VARIABLE(first_time, 2);
- SAVE_VARIABLE(killedYet, 3);
- SAVE_VARIABLE(turret01_dead, 4);
- SAVE_VARIABLE(turret02_dead, 5);
- }
- void Created( GameObject * obj )
- {
- turret01_dead = false;
- turret02_dead = false;
- killedYet = false;
- working_here_boss = false;
- first_time = true;
- Commands->Innate_Disable(obj);
- last_health = Commands->Get_Max_Health ( obj );
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (enemy == STAR && working_here_boss == false)
- {
- if (obj)
- {
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Enable(obj);
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- }
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- int damager_id = Commands->Get_ID ( damager );
- if (damager_id != NULL)
- {
- Commands->Debug_Message ( "***************************engineers damager is ID %d\n", damager_id );
- }
- else
- {
- Commands->Debug_Message ( "***************************engineers damager is NULL\n" );
- }
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (damager == gunboat)
- {
- Commands->Set_Health ( obj, last_health );
- }
- else if (damager == STAR)
- {
- if (obj)
- {
- last_health = Commands->Get_Health ( obj );
- if (first_time == true)
- {
- working_here_boss = false;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Enable(obj);
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_DOING_ANIMATION_03_JDG);
- params.Set_Animation( "H_A_862A", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- first_time = false;
- }
- else
- {
- working_here_boss = false;
- Commands->Action_Reset ( obj, 100 );
- Commands->Innate_Enable(obj);
- Commands->Innate_Force_State_Enemy_Seen ( obj, STAR );
- }
- }
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- killedYet = true;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG, 5 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Debug_Message ( "***************************original engineer custom received--start acting\n" );
- Commands->Enable_Hibernation( obj, false );
- }
- else if (param == M01_GOTO_IDLE_JDG)
- {
- Commands->Debug_Message ( "***************************original engineer custom received--STOP acting\n" );
- Commands->Enable_Hibernation( obj, true );
- }
- else if (param == M01_PLAYER_IS_ATTACKING_ME_JDG)
- {
- if (working_here_boss == false)
- {
- Commands->Debug_Message ( "***************************engineers has received custom to go heal turret\n" );
- Commands->Innate_Disable(obj);
- Commands->Action_Reset ( obj, 100 );
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- float turret01_health = 0;
- float turret02_health = 0;
- if (turret01 != NULL)
- {
- turret01_health = Commands->Get_Health ( turret01 );
- }
- if (turret02 != NULL)
- {
- turret02_health = Commands->Get_Health ( turret02 );
- }
- if ((turret02_health > turret01_health) && (turret01_health > 0))
- {
- if (turret01 != NULL && turret01_dead == false)
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3 (-86.5f, 95.5f, 2.3f), 1.0f, 0.5f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- working_here_boss = true;
- }
- }
- else if ((turret01_health > turret02_health) && (turret02_health > 0))
- {
- if (turret02 != NULL && turret02_dead == false)
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3 (-101.5f, 111.7f, 2.3f), 1.0f, 0.5f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- working_here_boss = true;
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, sender, 0, M01_BUSY_TRY_AGAIN_JDG, 1 );
- }
- }
- else if (working_here_boss == true)
- {
- Commands->Send_Custom_Event( obj, sender, 0, M01_BUSY_TRY_AGAIN_JDG, 1 );
- }
- }
- else if (param == M01_START_ATTACKING_01_JDG)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL && killedYet == false && turret01_dead == false)
- {
- Vector3 sound_position = Commands->Get_Position ( turret01 );
- Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
- float turretMaxHealth = Commands->Get_Max_Health ( turret01 );
- Commands->Set_Health ( turret01, turretMaxHealth );
- }
- Commands->Debug_Message ( "***************************turret engineer has fixed turret one--going back to hiding spot\n" );
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_START_ATTACKING_02_JDG)
- {
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL && killedYet == false && turret02_dead == false)
- {
- Vector3 sound_position = Commands->Get_Position ( turret02 );
- Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
- float turretMaxHealth = Commands->Get_Max_Health ( turret02 );
- Commands->Set_Health ( turret02, turretMaxHealth );
- }
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_TURRET_HAS_BEEN_DESTROYED_JDG)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (sender == turret01)
- {
- turret01_dead = true;
- }
- if (sender == turret02)
- {
- turret02_dead = true;
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 01--play fixing animation
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( turret01, 50, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 1.5f );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 02--play fixing animation
- {
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
- params.Set_Attack( turret02, 50, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 0.5f );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer has been damaged look around
- {
- char *animationName = M01_Choose_Duck_Animation();
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 60, M01_DOING_ANIMATION_04_JDG);
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- working_here_boss = false;
- //Commands->Enable_Hibernation( obj, true );
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_Chinook_Spawned_Soldier_NOD, "")
- {
- bool killedYet;
- bool atTurretsYet;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(killedYet, 1);
- SAVE_VARIABLE(atTurretsYet, 2);
- }
- void Created( GameObject * obj )
- {
- killedYet = false;
- atTurretsYet = false;
- GameObject *gunboatController = Commands->Find_Object ( M01_TURRETBEACH_CONTROLLER_ID );
- if (gunboatController != NULL)
- {
- Commands->Send_Custom_Event ( obj, gunboatController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, turret01, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, turret02, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret01 != NULL || turret02 != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- params.WaypathID = 109629;
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
- }
- else
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- params.WaypathID = 109629;
- Commands->Action_Goto(obj, params);
- //Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
- }
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (damager == STAR)
- {
- Commands->Innate_Enable(obj);
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- killedYet = true;
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_BEACH_ENGINEER_IS_DEAD_JDG, 5 );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (param == M01_WALKING_WAYPATH_03_JDG && atTurretsYet == false)
- {
- GameObject *turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject *turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret01 != NULL || turret02 != NULL)
- {
- //ActionParamsStruct params;
- //params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- //params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- //params.WaypathID = 109629;
- //Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
- }
- else
- {
- Commands->Action_Reset ( obj, 100 );
- //ActionParamsStruct params;
- //params.Set_Basic(this, 45, M01_WALKING_WAYPATH_03_JDG);
- //params.Set_Movement(Vector3 (0,0,0), RUN, 1);
- //params.WaypathID = 109629;
- //Commands->Action_Goto(obj, params);
- //Commands->Send_Custom_Event ( obj, obj, 0, M01_WALKING_WAYPATH_03_JDG, 5 );
- }
- }
- else if (param == M01_START_ACTING_JDG)
- {
- Commands->Debug_Message ( "***************************new engineer custom received--start acting\n" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
- }
- else if (param == M01_GOTO_IDLE_JDG)
- {
- Commands->Debug_Message ( "***************************new engineer custom received--STOP acting\n" );
- Commands->Enable_Hibernation( obj, true );
- }
- else if (param == M01_CHECK_TURRETS_HEALTH_JDG)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- float turret01_health = 0;
- float turret02_health = 0;
- if (turret01 != NULL)
- {
- turret01_health = Commands->Get_Health ( turret01 );
- }
- if (turret02 != NULL)
- {
- turret02_health = Commands->Get_Health ( turret02 );
- }
- if (turret01_health < turret02_health)
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3 (-86.5f, 95.5f, 2.3f), 1.0f, 0.5f, false );
- //params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
- if (turret02_health < turret01_health)
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement( Vector3 (-101.5f, 111.7f, 2.3f), 1.0f, 0.5f, false );
- //params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
-
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
- }
- }
- else if (param == M01_START_ATTACKING_01_JDG)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL && killedYet == false)
- {
- Vector3 sound_position = Commands->Get_Position ( turret01 );
- Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
- float turretMaxHealth = Commands->Get_Max_Health ( turret01 );
- Commands->Set_Health ( turret01, turretMaxHealth );
- }
- Commands->Debug_Message ( "***************************turret engineer has fixed turret one--going back to hiding spot\n" );
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_START_ATTACKING_02_JDG)
- {
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL && killedYet == false)
- {
- Vector3 sound_position = Commands->Get_Position ( turret02 );
- Commands->Create_Sound ( "CnC_Healer_Sound", sound_position, obj );
- float turretMaxHealth = Commands->Get_Max_Health ( turret02 );
- Commands->Set_Health ( turret02, turretMaxHealth );
- }
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3 (-91.1f, 106.562f, 1.7f), 1.0f, 0.25f, false );
- params.MovePathfind = false;
- Commands->Action_Goto ( obj, params );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_01_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 01--play fixing animation
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( turret01, 50, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 0.5f );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer is at damaged turret 02--play fixing animation
- {
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_02_JDG);
- params.Set_Attack( turret02, 50, 0, false );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 0.5f );
- }
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)//engineer has been damaged look around
- {
- char *animationName = M01_Choose_Duck_Animation();
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 60, M01_DOING_ANIMATION_04_JDG);
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- atTurretsYet = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
- }
- else if (action_id == M01_WALKING_WAYPATH_05_JDG && complete_reason == ACTION_COMPLETE_NORMAL)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_CHECK_TURRETS_HEALTH_JDG, 1 );
- }
- }
- };
- DECLARE_SCRIPT(M01_FP_NodBase_Dogfight_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[28] =
- {
- //these are the level 01 dogfights
- "X1A_Apache_Orca_Chase_01.txt",
- "X1A_Apache_Orca_Chase_02.txt",
- "X1A_Apache_Orca_Chase_03.txt",
- "X1A_Apache_Orca_Chase_04.txt",
- //this is a low level flyover in nod base
- //it goes from the refinery to the waterfall N->S
- //chinooks look kinda odd on this one
- "X1A_Solo_Orca_01.txt",
- "X1A_Solo_Orca_01.txt",
- "X1A_Solo_Orca_01.txt",
- "X1A_Solo_Orca_01.txt",
- "X1A_Solo_Orca_01.txt",
- "X1A_Solo_Apache_01.txt",
- "X1A_Solo_Apache_01.txt",
- "X1A_Solo_Apache_01.txt",
- "X1A_Solo_Apache_01.txt",
- "X1A_Solo_Apache_01.txt",
- "X1A_Solo_Nod_Chinook_01.txt",
- "X1A_Solo_GDI_Chinook_01.txt",
-
- //this is a low level flyover in nod base
- //it goes from the waterfall to the refinery S->N
- "X1A_Solo_Orca_02.txt",
- "X1A_Solo_Apache_02.txt",
- "X1A_Solo_Apache_02.txt",
- "X1A_Solo_Apache_02.txt",
- "X1A_Solo_Apache_02.txt",
- "X1A_Solo_Apache_02.txt",
- "X1A_Solo_Nod_Chinook_02.txt",
- "X1A_Solo_Nod_Chinook_02.txt",
- "X1A_Solo_Nod_Chinook_02.txt",
- "X1A_Solo_Nod_Chinook_02.txt",
- "X1A_Solo_Nod_Chinook_02.txt",
- "X1A_Solo_GDI_Chinook_02.txt",
-
- };
- int random = Commands->Get_Random_Int(0, 28);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 28);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_BaseToBase_NorthSouth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[28] =
- {
- //this is a low level traffic lane from nod comm to gdi ocean-- N->S
- "X1A_Solo_Orca_03.txt",
- "X1A_Solo_Apache_03.txt",
- "X1A_Solo_Apache_03.txt",
- "X1A_Solo_Apache_03.txt",
- "X1A_Solo_Apache_03.txt",
- "X1A_Solo_Apache_03.txt",
- "X1A_Solo_Nod_Chinook_03.txt",
- "X1A_Solo_Nod_Chinook_03.txt",
- "X1A_Solo_Nod_Chinook_03.txt",
- "X1A_Solo_Nod_Chinook_03.txt",
- "X1A_Solo_Nod_Chinook_03.txt",
- "X1A_Solo_GDI_Chinook_03.txt",
- "X1A_Solo_NodCargo_03.txt",
- "X1A_Solo_A10_03.txt",
- //this is a low level traffic lane from nod refinery to gdi ocean-- N->S
- "X1A_Solo_Orca_04.txt",
- "X1A_Solo_Apache_04.txt",
- "X1A_Solo_Apache_04.txt",
- "X1A_Solo_Apache_04.txt",
- "X1A_Solo_Apache_04.txt",
- "X1A_Solo_Apache_04.txt",
- "X1A_Solo_Nod_Chinook_04.txt",
- "X1A_Solo_Nod_Chinook_04.txt",
- "X1A_Solo_Nod_Chinook_04.txt",
- "X1A_Solo_Nod_Chinook_04.txt",
- "X1A_Solo_Nod_Chinook_04.txt",
- "X1A_Solo_GDI_Chinook_04.txt",
- "X1A_Solo_NodCargo_04.txt",
- "X1A_Solo_A10_04.txt",
- };
- int random = Commands->Get_Random_Int(0, 28);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 28);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
-
- }
- };
- DECLARE_SCRIPT(M01_FP_BaseToBase_SouthNorth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- last = 21;
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", "X1A_Solo_NodCargo_06.txt");
- Commands->Start_Timer(obj, this, 60.0f, 0);
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[56] =
- {
- //this is a low level traffic lane from gdi ocean to nod comm center-- S->N
- "X1A_Solo_Orca_05.txt",
- "X1A_Solo_Orca_05.txt",
- "X1A_Solo_Orca_05.txt",
- "X1A_Solo_Orca_05.txt",
- "X1A_Solo_Orca_05.txt",
- "X1A_Solo_Apache_05.txt",
- "X1A_Solo_Nod_Chinook_05.txt",
- "X1A_Solo_GDI_Chinook_05.txt",
- "X1A_Solo_GDI_Chinook_05.txt",
- "X1A_Solo_GDI_Chinook_05.txt",
- "X1A_Solo_GDI_Chinook_05.txt",
- "X1A_Solo_GDI_Chinook_05.txt",
- "X1A_Solo_NodCargo_05.txt",
- "X1A_Solo_A10_05.txt",
- //this is a low level traffic lane from gdi ocean to nod refinery-- S->N
- "X1A_Solo_Orca_06.txt",
- "X1A_Solo_Orca_06.txt",
- "X1A_Solo_Orca_06.txt",
- "X1A_Solo_Orca_06.txt",
- "X1A_Solo_Orca_06.txt",
- "X1A_Solo_Apache_06.txt",
- "X1A_Solo_Nod_Chinook_06.txt",
- "X1A_Solo_GDI_Chinook_06.txt",
- "X1A_Solo_GDI_Chinook_06.txt",
- "X1A_Solo_GDI_Chinook_06.txt",
- "X1A_Solo_GDI_Chinook_06.txt",
- "X1A_Solo_GDI_Chinook_06.txt",
- "X1A_Solo_NodCargo_06.txt",
- "X1A_Solo_A10_06.txt",
- //this is a low/med level traffic lane from gdi ocean to nod refinery-- S->N
- "X1A_Solo_Orca_07.txt",
- "X1A_Solo_Orca_07.txt",
- "X1A_Solo_Orca_07.txt",
- "X1A_Solo_Orca_07.txt",
- "X1A_Solo_Orca_07.txt",
- "X1A_Solo_Apache_07.txt",
- "X1A_Solo_Nod_Chinook_07.txt",
- "X1A_Solo_GDI_Chinook_07.txt",
- "X1A_Solo_GDI_Chinook_07.txt",
- "X1A_Solo_GDI_Chinook_07.txt",
- "X1A_Solo_GDI_Chinook_07.txt",
- "X1A_Solo_GDI_Chinook_07.txt",
- "X1A_Solo_NodCargo_07.txt",
- "X1A_Solo_A10_07.txt",
-
- //this is a low level traffic lane from gdi ocean to nod comm center-- S->N
- "X1A_Solo_Orca_08.txt",
- "X1A_Solo_Orca_08.txt",
- "X1A_Solo_Orca_08.txt",
- "X1A_Solo_Orca_08.txt",
- "X1A_Solo_Orca_08.txt",
- "X1A_Solo_Apache_08.txt",
- "X1A_Solo_GDI_Chinook_08.txt",
- "X1A_Solo_GDI_Chinook_08.txt",
- "X1A_Solo_GDI_Chinook_08.txt",
- "X1A_Solo_GDI_Chinook_08.txt",
- "X1A_Solo_GDI_Chinook_08.txt",
- "X1A_Solo_Nod_Chinook_08.txt",
- "X1A_Solo_NodCargo_08.txt",
- "X1A_Solo_A10_08.txt",
-
- };
- int random = Commands->Get_Random_Int(0, 56);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 56);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_NodBase_EastWest_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[72] =
- {
- //this is a flyover at nod base it goes from the comm to the refinery-- E->W
- "X1A_Solo_Orca_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Apache_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_Nod_Chinook_09.txt",
- "X1A_Solo_GDI_Chinook_09.txt",
- "X1A_Solo_NodCargo_09.txt",
- "X1A_Solo_A10_09.txt",
- //this is a flyover at nod base it goes from the comm to the refinery-- E->W
- "X1A_Solo_Orca_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Apache_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_Nod_Chinook_10.txt",
- "X1A_Solo_GDI_Chinook_10.txt",
- "X1A_Solo_NodCargo_10.txt",
- "X1A_Solo_A10_10.txt",
- //this is a flyover at nod base it goes from the comm to the refinery-- E->W
- "X1A_Solo_Orca_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Apache_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_Nod_Chinook_11.txt",
- "X1A_Solo_GDI_Chinook_11.txt",
- "X1A_Solo_NodCargo_11.txt",
- "X1A_Solo_A10_11.txt",
- };
- int random = Commands->Get_Random_Int(0, 72);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 72);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_NodBase_WestEast_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[48] =
- {
- //this is a flyover at nod base it goes from the refinery to the comm W->E
- "X1A_Solo_Orca_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Apache_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_Nod_Chinook_12.txt",
- "X1A_Solo_GDI_Chinook_12.txt",
- "X1A_Solo_NodCargo_12.txt",
- "X1A_Solo_A10_12.txt",
- //this is a flyover at nod base it goes from the refinery to the comm W->E
- "X1A_Solo_Orca_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Apache_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_Nod_Chinook_13.txt",
- "X1A_Solo_GDI_Chinook_13.txt",
- "X1A_Solo_NodCargo_13.txt",
- "X1A_Solo_A10_13.txt",
- };
- int random = Commands->Get_Random_Int(0, 48);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 48);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
-
- }
- };
- DECLARE_SCRIPT(M01_FP_NodBase_NorthSouth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[48] =
- {
- //this is a flyover at nod base it goes from the comm to the waterfall N->S
- "X1A_Solo_Orca_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Apache_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_Nod_Chinook_14.txt",
- "X1A_Solo_GDI_Chinook_14.txt",
- "X1A_Solo_NodCargo_14.txt",
- "X1A_Solo_A10_14.txt",
- //this is a flyover at nod base it goes from the comm to the waterfall N->S
- "X1A_Solo_Orca_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Apache_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_Nod_Chinook_15.txt",
- "X1A_Solo_GDI_Chinook_15.txt",
- "X1A_Solo_NodCargo_15.txt",
- "X1A_Solo_A10_15.txt",
- };
- int random = Commands->Get_Random_Int(0, 48);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 48);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_NodBase_SouthNorth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[48] =
- {
- //this is a flyover at nod base it goes from guard tower 01 to the comm center S-N
- "X1A_Solo_Orca_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Apache_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_Nod_Chinook_16.txt",
- "X1A_Solo_GDI_Chinook_16.txt",
- "X1A_Solo_NodCargo_16.txt",
- "X1A_Solo_A10_16.txt",
- //this is a flyover at nod base it goes from guard tower 01 to the comm center S-N
- "X1A_Solo_Orca_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Apache_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_Nod_Chinook_17.txt",
- "X1A_Solo_GDI_Chinook_17.txt",
- "X1A_Solo_NodCargo_17.txt",
- "X1A_Solo_A10_17.txt",
- };
- int random = Commands->Get_Random_Int(0, 48);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 48);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_GDIOcean_NorthSouth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[28] =
- {
- //this is a GDI ocean traffic lane N->S
- "X1A_Solo_Orca_18.txt",
- "X1A_Solo_Orca_18.txt",
- "X1A_Solo_Orca_18.txt",
- "X1A_Solo_Orca_18.txt",
- "X1A_Solo_Orca_18.txt",
- "X1A_Solo_Apache_18.txt",
- "X1A_Solo_Nod_Chinook_18.txt",
- "X1A_Solo_GDI_Chinook_18.txt",
- "X1A_Solo_GDI_Chinook_18.txt",
- "X1A_Solo_GDI_Chinook_18.txt",
- "X1A_Solo_GDI_Chinook_18.txt",
- "X1A_Solo_GDI_Chinook_18.txt",
- "X1A_Solo_NodCargo_18.txt",
- "X1A_Solo_A10_18.txt",
- //this is a GDI ocean traffic lane N->S
- "X1A_Solo_Orca_19.txt",
- "X1A_Solo_Orca_19.txt",
- "X1A_Solo_Orca_19.txt",
- "X1A_Solo_Orca_19.txt",
- "X1A_Solo_Orca_19.txt",
- "X1A_Solo_Apache_19.txt",
- "X1A_Solo_Nod_Chinook_19.txt",
- "X1A_Solo_GDI_Chinook_19.txt",
- "X1A_Solo_GDI_Chinook_19.txt",
- "X1A_Solo_GDI_Chinook_19.txt",
- "X1A_Solo_GDI_Chinook_19.txt",
- "X1A_Solo_GDI_Chinook_19.txt",
- "X1A_Solo_NodCargo_19.txt",
- "X1A_Solo_A10_19.txt",
-
- };
- int random = Commands->Get_Random_Int(0, 28);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 28);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
- }
- };
- DECLARE_SCRIPT(M01_FP_GDIOcean_SouthNorth_Contoller_JDG, "")
- {
- int last;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(last, 1);
- }
-
- void Created(GameObject * obj)
- {
- Commands->Start_Timer(obj, this, 60.0f, 0);
- last = 21;
- }
- void Timer_Expired(GameObject * obj, int timer_id)
- {
- char *flyovers[26] =
- {
- //this is a GDI ocean traffic lane S->N
- "X1A_Solo_Orca_20.txt",
- "X1A_Solo_Orca_20.txt",
- "X1A_Solo_Orca_20.txt",
- "X1A_Solo_Orca_20.txt",
- "X1A_Solo_Orca_20.txt",
- "X1A_Solo_Apache_20.txt",
- "X1A_Solo_Nod_Chinook_20.txt",
- "X1A_Solo_GDI_Chinook_20.txt",
- "X1A_Solo_GDI_Chinook_20.txt",
- "X1A_Solo_GDI_Chinook_20.txt",
- "X1A_Solo_GDI_Chinook_20.txt",
- "X1A_Solo_GDI_Chinook_20.txt",
- "X1A_Solo_A10_20.txt",
- //this is a GDI ocean traffic lane S->N
- "X1A_Solo_Orca_21.txt",
- "X1A_Solo_Orca_21.txt",
- "X1A_Solo_Orca_21.txt",
- "X1A_Solo_Orca_21.txt",
- "X1A_Solo_Orca_21.txt",
- "X1A_Solo_Apache_21.txt",
- "X1A_Solo_Nod_Chinook_21.txt",
- "X1A_Solo_GDI_Chinook_21.txt",
- "X1A_Solo_GDI_Chinook_21.txt",
- "X1A_Solo_GDI_Chinook_21.txt",
- "X1A_Solo_GDI_Chinook_21.txt",
- "X1A_Solo_GDI_Chinook_21.txt",
- "X1A_Solo_A10_21.txt",
-
- };
- int random = Commands->Get_Random_Int(0, 26);
-
- while (random == last) {
- random = Commands->Get_Random_Int(0, 26);
- }
- GameObject *controller = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller, "Test_Cinematic", flyovers[random]);
- float delayTimer = Commands->Get_Random ( 30, 60 );
- Commands->Start_Timer(obj, this, delayTimer, 0);
- last = random;
-
- }
- };
- DECLARE_SCRIPT(M01_Deco_LightTanks_JDG, "")//119424 119426 119425
- {
- void Created( GameObject * obj )
- {
- Vector3 myTarget (-27.746f, 52.823f, 1.071f);
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( myTarget, 100, 3, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ATTACKING_01_JDG)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( STAR, 100, 8, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else if (param == M01_START_ATTACKING_02_JDG)
- {
- if (obj)
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Airstrike_Controller_JDG, "")//121041
- {
- int decoTank01_id;
- int decoTank02_id;
- int decoTank03_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(decoTank01_id, 1);
- SAVE_VARIABLE(decoTank02_id, 2);
- SAVE_VARIABLE(decoTank03_id, 3);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == 0)//airstrike text file is sendyou the command to play explosions
- {
- GameObject * realtank = Commands->Find_Object ( 120022 );
- if (realtank != NULL)
- {
- Commands->Send_Custom_Event( obj, realtank, 0, M01_START_ATTACKING_01_JDG, 0.5f );
- }
- GameObject * tank01 = Commands->Find_Object ( decoTank01_id );
- GameObject * tank02 = Commands->Find_Object ( decoTank02_id );
- GameObject * tank03 = Commands->Find_Object ( decoTank03_id );
- if (tank01 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank01, 0, M01_START_ATTACKING_02_JDG, 0.5f );
- }
- if (tank02 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank02, 0, M01_START_ATTACKING_02_JDG, 0.75f );
- }
- if (tank03 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank03, 0, M01_START_ATTACKING_02_JDG, 1.0f );
- }
- }
- else if (param == M01_START_ACTING_JDG)
- {
- Vector3 tank01Spot (-12.175f, 68.280f, 3.009f);
- Vector3 tank02Spot (-14.948f, 61.305f, 3.259f);
- Vector3 tank03Spot (-22.011f, 66.635f, 2.959f);
- GameObject * decoTank01 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank01Spot );
- Commands->Set_Facing ( decoTank01, -145 );
- GameObject * decoTank02 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank02Spot );
- Commands->Set_Facing ( decoTank02, -150 );
- GameObject * decoTank03 = Commands->Create_Object ( "Nod_Light_Tank_Dec", tank03Spot );
- Commands->Set_Facing ( decoTank03, -115 );
- Commands->Attach_Script(decoTank01, "M01_Deco_LightTanks_JDG", "");
- Commands->Attach_Script(decoTank02, "M01_Deco_LightTanks_JDG", "");
- Commands->Attach_Script(decoTank03, "M01_Deco_LightTanks_JDG", "");
- decoTank01_id = Commands->Get_ID ( decoTank01 );
- decoTank02_id = Commands->Get_ID ( decoTank02 );
- decoTank03_id = Commands->Get_ID ( decoTank03 );
- }
- else if (param == M01_START_ATTACKING_01_JDG)
- {
- GameObject * tank01 = Commands->Find_Object ( decoTank01_id );
- GameObject * tank02 = Commands->Find_Object ( decoTank02_id );
- GameObject * tank03 = Commands->Find_Object ( decoTank03_id );
- if (tank01 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank01, 0, M01_START_ATTACKING_01_JDG, 0.5f );
- }
- if (tank02 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank02, 0, M01_START_ATTACKING_01_JDG, 0.5f );
- }
- if (tank03 != NULL)
- {
- Commands->Send_Custom_Event( obj, tank03, 0, M01_START_ATTACKING_01_JDG, 0.5f );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_01_JDG, 0 );
-
- GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1G_A-10_Strike.txt");
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_RealLightTank_JDG, "")//120022
- {//waypath 120218
- void Killed( GameObject * obj, GameObject * killer )
- {
- //int airdrop_conv = Commands->Create_Conversation( "M01_AirDrop_Conversation", 100, 1000, false);
- //Commands->Join_Conversation( NULL, airdrop_conv, false, false );
- //Commands->Start_Conversation( airdrop_conv, airdrop_conv );
-
- }
-
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), .7f, 10 );
- params.WaypathID = 120218;
- //params.AttackActive = false;
- Commands->Action_Goto( obj, params );
- GameObject * airstrikeController = Commands->Find_Object ( 121041 );
- if (airstrikeController != NULL)
- {
- Commands->Send_Custom_Event( obj, airstrikeController, 0, M01_START_ACTING_JDG, 0 );
- Commands->Send_Custom_Event( obj, airstrikeController, 0, M01_MODIFY_YOUR_ACTION_JDG, 15 );
- }
- }
- else if (param == M01_START_ATTACKING_01_JDG)
- {
- if (obj)
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG )
- {
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( STAR, 100, 10, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- //Commands->Send_Custom_Event( obj, obj, 0, M01_START_ATTACKING_02_JDG, 4 );
-
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_RealLightTank_TriggerZone_JDG, "")
- {
- bool entered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(entered, 1);
- }
- void Created( GameObject * obj )
- {
- entered = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (entered == false)
- {
- if (enterer == STAR)
- {
- entered = true;
- GameObject * lightTank = Commands->Find_Object ( 120022 );//00-N036E
- if (lightTank != NULL)
- {
- Commands->Send_Custom_Event( obj, lightTank, 0, M01_START_ACTING_JDG, 0 );
- //Commands->Create_2D_Sound ( "00-N036E" );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_First_AutoRifle_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- int pressEnterConv = Commands->Create_Conversation( "M01_Press_Enter_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressEnterConv, false, false );
- Commands->Start_Conversation( pressEnterConv, pressEnterConv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0520I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- };
- DECLARE_SCRIPT(M01_Announce_First_ObjectiveZone_JDG, "")//116380
- {
- void Created( GameObject * obj )
- {
- int pressF1Conv = Commands->Create_Conversation( "M01_Press_F1_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressF1Conv, false, false );
- Commands->Start_Conversation( pressF1Conv, pressF1Conv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0515I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1H_Hover_Troop.txt");
- }
- void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
- {
- if (enterer == STAR)
- {
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, 0, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 0 );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_SniperRifle_01_JDG, "")//on powerplant
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- GameObject * c4TextController = Commands->Find_Object ( 117188 );
- if (c4TextController != NULL)
- {
- Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
- }
-
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3(-53.217f, -68.049f, 13.701f));
- Commands->Attach_Script(sniperTarget01, "M01_SniperRifle_01_Target_JDG", "");
- }
- }
- };
- DECLARE_SCRIPT(M01_SniperRifle_01_Target_JDG, "")//on lighthouse
- {
- void Created( GameObject * obj )
- {
- Commands->Attach_Script(obj, "M00_Soldier_Powerup_Disable", "");
- Commands->Enable_Hibernation( obj, false );
- ActionParamsStruct params;
- params.Set_Basic(this, 90, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(0,0,0), WALK, .25f );
- params.WaypathID = 118434;
- Commands->Action_Goto( obj, params );
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG )
- {
- Commands->Enable_Hibernation( obj, true );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_SniperRifle_02_JDG, "")//in guard tower 01
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- GameObject * c4TextController = Commands->Find_Object ( 117188 );
- if (c4TextController != NULL)
- {
- Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_SniperRifle_02_AirdropZone_JDG, "")//in guard tower 01
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Create_Sound ( "M01EVAG_DSGN0268I1EVAG_SND", Vector3 (0,0,0), obj );//enemy aircraft detected
- GameObject * chinook_obj3 = Commands->Create_Object ( "Invisible_Object", Vector3(-12.031f, -42.150f, -1.252f));
- Commands->Set_Facing(chinook_obj3, -45.0f);
- Commands->Attach_Script(chinook_obj3, "Test_Cinematic", "X1I_GDIBasePrimaryNodChinook.txt");
- Commands->Destroy_Object (obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_C4_TutorialScript_JDG, "")//
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- GameObject * c4TextController = Commands->Find_Object ( 117188 );
- if (c4TextController != NULL)
- {
- Commands->Send_Custom_Event( obj, c4TextController, 1, 1, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Use_Ladder_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
- {
- if (enterer == STAR)
- {
- int pressF1Conv = Commands->Create_Conversation( "M01_Press_E_For_Ladders_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressF1Conv, false, false );
- Commands->Start_Conversation( pressF1Conv, pressF1Conv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0514I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- };
- DECLARE_SCRIPT(M01_AccessDenied_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer ) //M01_Press_F1_Conversation
- {
- if (enterer == STAR)
- {
- int pressF1Conv = Commands->Create_Conversation( "M01_Lockdown_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressF1Conv, false, false );
- Commands->Start_Conversation( pressF1Conv, pressF1Conv );
- //Commands->Set_HUD_Help_Text ( IDS_M00EVAG_DSGN0039I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_FirstChinookMinigunnerGuy_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- };
- DECLARE_SCRIPT(M01_QuickSave_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0525I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBaseCommander_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
- Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- GameObject * myController = Commands->Find_Object ( 106694 );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
- {
- Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
- Vector3 evacLocation = Commands->Get_Position ( obj );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
- GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
- if (gdiBaseCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
- if (gdiBaseMinigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseMinigunner, 0, M01_GOING_TO_EVAC_SPOT_JDG, 3 );
- }
- GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
- if (gdiBaseGrenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseGrenadier, 0, M01_GOING_TO_EVAC_SPOT_JDG, 6 );
- }
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
- GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
- GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
- if ((gdiBaseCommander != NULL) || (gdiBaseMinigunner != NULL) || (gdiBaseGrenadier != NULL))
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );
- }
- else
- {
- GameObject * controller = Commands->Find_Object ( 106694 );
- if (controller != NULL)
- {
- Commands->Send_Custom_Event ( obj, controller, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBaseCommander_EvacController_JDG, "")//106694
- {
- bool evacing;
- int evac_waypath_id;
- int evac_helicopter_id;
- int evac_rope_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(evacing, 1);
- SAVE_VARIABLE(evac_waypath_id, 2);
- SAVE_VARIABLE(evac_helicopter_id, 3);
- SAVE_VARIABLE(evac_rope_id, 4);
- }
- void Created( GameObject * obj )
- {
- evacing = false;
- Commands->Enable_Hibernation( obj, false );
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)//
- {
- if (param == M01_START_ACTING_JDG)//gdi commander is done giving ion beacon--start evac scenario
- {
- GameObject * gdiBaseCommander = Commands->Find_Object ( 106050 );
- GameObject * gdiBaseMinigunner = Commands->Find_Object ( 116382 );
- GameObject * gdiBaseGrenadier = Commands->Find_Object ( 116383 );
- if (gdiBaseCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseCommander, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- if (gdiBaseMinigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseMinigunner, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- if (gdiBaseGrenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiBaseGrenadier, 0, M01_GOTO_YOUR_EVAC_SPOT_JDG, 0 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG && evacing == false)//one of your guys is at his wait spot--call in chopper
- {
- evacing = true;
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_GDIBaseCommander_EvacAnim.txt");
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG && evacing == true)//everyone is on or dead--give take off orders
- {
- GameObject * evacChopper = Commands->Find_Object ( evac_helicopter_id );
- GameObject * evacWaypath = Commands->Find_Object ( evac_waypath_id );
- GameObject * evacRope = Commands->Find_Object ( evac_rope_id );
- if (evacChopper != NULL)
- {
- Commands->Debug_Message ( "**********************sending custom to chopper to leave.....%d\n",evac_helicopter_id );
- Commands->Send_Custom_Event ( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacWaypath != NULL)
- {
- Commands->Debug_Message ( "**********************sending custom to waypath to leave.....%d\n",evac_waypath_id );
- Commands->Send_Custom_Event ( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (evacRope != NULL)
- {
- Commands->Debug_Message ( "**********************sending custom to rope to leave.....%d\n",evac_rope_id );
- Commands->Send_Custom_Event ( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//chopper is sending you his ID
- {
- evac_helicopter_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//waypath is sending you his ID
- {
- evac_waypath_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//rope is sending you his ID
- {
- evac_rope_id = Commands->Get_ID ( sender );
- Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
- }
- else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
- {
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
- Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
-
- Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
- Commands->Innate_Disable(sender);
- Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
- if(troopbone)
- {
- Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
- }
- else
- {
- Commands->Debug_Message("troopbone not created yet");
- }
-
- Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_Nod_Minigunner_JDG, "")//116384
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- };
- DECLARE_SCRIPT(M01_POW_Nod_Minigunner01_JDG, "")//116388
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * pow01 = Commands->Find_Object ( 116386 );
- if (pow01 != NULL)
- {
- Commands->Send_Custom_Event( obj, pow01, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_POWEncounter02_Controller_JDG, "")//M01_GDIBASE_POWSCENE02_MONITOR_JDG 103331
- {
- bool transportCalled;
- bool powGuy01isDead;
- bool powGuy02isDead;
- bool objective_failed;
- int evac_waypath_id;
- int evac_helicopter_id;
- int evac_rope_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(transportCalled, 1);
- SAVE_VARIABLE(powGuy01isDead, 2);
- SAVE_VARIABLE(powGuy02isDead, 3);
- SAVE_VARIABLE(objective_failed, 4);
- SAVE_VARIABLE(evac_waypath_id, 5);
- SAVE_VARIABLE(evac_helicopter_id, 6);
- SAVE_VARIABLE(evac_rope_id, 7);
- }
- void Created( GameObject * obj )
- {
- powGuy01isDead = false;
- powGuy02isDead = false;
- objective_failed = false;
- transportCalled = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (param == M01_IVE_BEEN_KILLED_JDG)//one of the gt1 guys has been killed..see who it is
- {
- GameObject * pow01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
- GameObject * pow02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
- if (sender == pow01)
- {
- powGuy01isDead = true;
- }
- if (sender == pow02)
- {
- powGuy02isDead = true;
- }
- if (powGuy01isDead == true && powGuy02isDead == true)
- {
- Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- objective_failed = true;
- }
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//chopper is sending you his ID
- {
- evac_helicopter_id = Commands->Get_ID ( sender );
- //Commands->Debug_Message ( "**********************chopper id received.....%d\n",evac_helicopter_id );
- }
- else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//waypath is sending you his ID
- {
- evac_waypath_id = Commands->Get_ID ( sender );
- //Commands->Debug_Message ( "**********************waypath id received.....%d\n", evac_waypath_id );
- }
- else if (param == M01_ROPE_IS_SENDING_ID_JDG)//rope is sending you his ID
- {
- evac_rope_id = Commands->Get_ID ( sender );
- //Commands->Debug_Message ( "**********************rope id received.....%d\n", evac_rope_id );
- }
- else if (param == M01_GIVE_ME_A_ROPE_JDG)//someone is waiting--pull him up
- {
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject * troopbone = Commands->Create_Object("Invisible_Object", evacPosition );
- Commands->Set_Model ( troopbone, "XG_EV5_troopBN" );
-
- Commands->Attach_Script(troopbone, "M01_Evac_TroopBone_JDG", "");
- Commands->Innate_Disable(sender);
- Commands->Attach_To_Object_Bone( sender, troopbone, "Troop_L" );
- if(troopbone)
- {
- Commands->Set_Animation ( troopbone, "XG_EV5_troopBN.XG_EV5_troopBN", false);
- }
- else
- {
- Commands->Debug_Message("troopbone not created yet");
- }
-
- Commands->Set_Animation ( sender, "S_A_Human.XG_EV5_troop", false );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)//a gdi guy is waiting for evac--call in a helicopter
- {
- if (transportCalled == false)
- {
- transportCalled = true;
- Vector3 evacPosition = Commands->Get_Position ( obj );
- GameObject *controller = Commands->Create_Object("Invisible_Object", evacPosition);
- Commands->Attach_Script(controller, "Test_Cinematic", "XG_M01_GDIBasePow_EvacAnim.txt");
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_05_JDG)//chinook is ready to go--give clearance
- {
- GameObject *evacWaypath = Commands->Find_Object ( evac_waypath_id );
- if (evacWaypath != NULL)
- {
- Commands->Send_Custom_Event( obj, evacWaypath, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject *evacChopper = Commands->Find_Object ( evac_helicopter_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event( obj, evacChopper, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject *evacRope = Commands->Find_Object ( evac_rope_id );
- if (evacChopper != NULL)
- {
- Commands->Send_Custom_Event( obj, evacRope, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- if (objective_failed != true)
- {
- Commands->Set_Objective_Status( M01_GDI_BASE_POW_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBasePOW_Air_Evac_Chopper_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsA", false );
- Commands->Debug_Message ( "**********************script attached to evac chopper\n" );
- Commands->Set_Shield_Type ( obj, "Blamo" );
- Commands->Enable_Hibernation( obj, false );
- Commands->Disable_Physical_Collisions ( obj );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_GOTO_IDLE_JDG, 3 );
- GameObject * myController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (myController != NULL)
- {
- Commands->Send_Custom_Event ( obj, myController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsA") == 0)
- {
- Commands->Debug_Message ( "**********************chopper has finished entry anim\n" );
- Vector3 evacLocation = Commands->Get_Position ( obj );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsL", true );
- GameObject * gdiGuy01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
- GameObject * gdiGuy02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
- if (gdiGuy01 != NULL)
- {
- Commands->Send_Custom_Event ( obj, gdiGuy01, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 3 );
- }
- if (gdiGuy02 != NULL)
- {
- Commands->Send_Custom_Event ( obj, gdiGuy02, 0, M01_GOING_TO_EVAC_SPOT02_JDG, 0 );
- }
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else if (stricmp(anim, "v_GDI_trnspt.XG_EV5_trnsz") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- switch (param)
- {
- case M01_MODIFY_YOUR_ACTION_JDG:
- {
- Commands->Debug_Message ( "*******************************helicopter has received custom to goto exit anim\n" );
- Commands->Set_Animation ( obj, "v_GDI_trnspt.XG_EV5_trnsz", false );
- }
- break;
- case M01_GOTO_IDLE_JDG:
- {
- Commands->Enable_Collisions ( obj );
- }
- break;
- case M01_DO_END_MISSION_CHECK_JDG:
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
- GameObject * gdiGuy02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
- if ((gdiGuy01 != NULL)||(gdiGuy02 != NULL))
- {
- Commands->Send_Custom_Event ( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 2 );
- }
- else
- {
- GameObject * controller = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (controller != NULL)
- {
- Commands->Send_Custom_Event ( obj, controller, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 0 );
- }
- }
- }
- break;
- }
- }
- };
- DECLARE_SCRIPT(M01_ConDropZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(54.835f, -3.011f, 13.105f));
- Commands->Set_Facing ( controller1, 45 );
- Commands->Attach_Script(controller1, "Test_Cinematic", "X01_ConYardDrop.txt");
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_ConYard_Dropoff_Dude_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.H_A_TroopDrop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_C130_Dropoff_Dude_JDG, "")
- {
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_1") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_2") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- else if (stricmp(anim, "S_a_Human.H_A_X5D_ParaT_3") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_GDI_Fodder_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Vector3 myTarget (72.223f, -24.751f, -0.296f);
- ActionParamsStruct params;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- float delayTimer = Commands->Get_Random ( 10, 15 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, delayTimer );//kill yourself
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//kill yourself
- {
- Commands->Apply_Damage( obj, 10000, "BlamoKiller", NULL );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_StartZone_JDG, "")//119628
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * minigunner = Commands->Find_Object ( 116382 );
- GameObject * grenadier = Commands->Find_Object ( 116383 );
- if (minigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, minigunner, 0, M01_START_ATTACKING_01_JDG, 0 );//tell minigunner to greet havoc
- }
- if (grenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, grenadier, 0, M01_START_ATTACKING_01_JDG, 0 );//tell grenadier to greet havoc
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Nod_Truck_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NEUTRAL );
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_NOD );
- }
- };
- DECLARE_SCRIPT(M01_C4_Tutorial_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * c4TextController = Commands->Find_Object ( 117188 );
- if (c4TextController != NULL)
- {
- Commands->Send_Custom_Event( obj, c4TextController, 1, 1, 0 );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Mainframe_Tutorial_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0527I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GateSwitch_Tutorial_Zone_JDG, "")//120844
- {
- bool command_clearance;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(command_clearance, 1);
- }
- void Created( GameObject * obj )
- {
- command_clearance = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR && command_clearance == true)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0528I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- command_clearance = true;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BarnArea_NOD_Commander_Trigger_Zone02_JDG, "")//103343
- {
- bool entered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(entered, 1);
- }
- void Created( GameObject * obj )
- {
- entered = false;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR && entered == false)
- {
- entered = true;
- GameObject * firstFieldCommander = Commands->Find_Object (M01_BARNAREA_NOD_COMMANDER_JDG);
- if (firstFieldCommander != NULL)
- {
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_BARNAREA_NOD_COMMANDER_JDG ), 0, M01_START_ACTING_JDG, 0 );
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_ADD_BARN_COMMANDER_OBJECTIVE_JDG, 5 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_Turret_01_Script_JDG, "")//M01_TURRETBEACH_TURRET_01_ID 101434
- {
- int engineer_id;
- int fodderHovercraft_ID;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(engineer_id, 1);
- SAVE_VARIABLE(fodderHovercraft_ID, 2);
- }
- void Created( GameObject * obj )
- {
- engineer_id = M01_TURRETBEACH_ENGINEER_ID;
- }
- void Killed( GameObject * obj, GameObject * killer ) //M01_IVE_BEEN_KILLED_JDG
- {
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_CHANGE_OBJECTIVE_POG_JDG, M01_TURRETS_OBJECTIVE_JDG, 0 );
- }
- GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
- if (turretEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_TURRET_HAS_BEEN_DESTROYED_JDG, 0 );
- }
- Commands->Send_Custom_Event( obj, Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG ), 0, M01_TURRET_HAS_BEEN_DESTROYED_JDG, 5 );
- Vector3 myPositon = Commands->Get_Position ( obj );
- float myFacing = Commands->Get_Facing ( obj );
- GameObject * destroyedTurret = Commands->Create_Object ( "Nod_Turret_Destroyed", myPositon);
- Commands->Set_Facing ( destroyedTurret, myFacing );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
- if (damager != NULL && damager == turretEngineer)
- {
- float myMaxHealth = Commands->Get_Max_Health ( obj );
- Commands->Set_Health ( obj, myMaxHealth );
- }
- else if (turretEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (gunboat != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ACTING_JDG);
- params.Set_Attack( gunboat, 3000, 3, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- else if (param == M01_BUSY_TRY_AGAIN_JDG)//engineer is busy--call back in 2 seconds
- {
- GameObject * turretEngineer = Commands->Find_Object ( engineer_id );
- if (turretEngineer != NULL)
- {
- Commands->Send_Custom_Event( obj, turretEngineer, 0, M01_PLAYER_IS_ATTACKING_ME_JDG, 1 );
- }
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//new engineer is actually sending id
- {
- engineer_id = Commands->Get_ID ( sender );
- }
- }
- else if (type == M01_FODDER_HOVERCRAFT_IS_HERE)
- {
- fodderHovercraft_ID = param;
- GameObject * fodderHovercraft = Commands->Find_Object ( fodderHovercraft_ID );
-
- if (fodderHovercraft != NULL)
- {
- Commands->Action_Reset ( obj, 100 );
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ATTACKING_01_JDG);
- params.Set_Attack( fodderHovercraft, 3000, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_START_ATTACKING_01_JDG)//hovercraft is dead...go back to attacking gunboat
- {
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (gunboat != NULL)
- {
- ActionParamsStruct params;
- params.Set_Basic(this, 100, M01_START_ACTING_JDG);
- params.Set_Attack( gunboat, 3000, 3, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GunboatAction_Controller_JDG, "")//M01_TURRETBEACH_CONTROLLER_ID
- {
- bool active;
- int engineer_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(active, 1);
- SAVE_VARIABLE(engineer_id, 2);
- }
- void Created( GameObject * obj )
- {
- active = false;
- engineer_id = M01_TURRETBEACH_ENGINEER_ID;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- if (active == false)
- {
- active = true;
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- GameObject * engineer = Commands->Find_Object ( engineer_id );
- //GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- if (gunboat != NULL)
- {
- Commands->Send_Custom_Event ( obj, gunboat, 0, M01_START_ACTING_JDG, 0 );
- }
- if (engineer != NULL)
- {
- Commands->Send_Custom_Event ( obj, engineer, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- else if (param == M01_GOTO_IDLE_JDG)//M01_CHOPPER_IS_SENDING_ID_JDG
- {
- if (active == true)
- {
- active = false;
- GameObject * gunboat = Commands->Find_Object ( M01_TURRETBEACH_GUNBOAT_ID );
- GameObject * engineer = Commands->Find_Object ( engineer_id );
- if (gunboat != NULL)
- {
- Commands->Send_Custom_Event ( obj, gunboat, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- if (engineer != NULL)
- {
- Commands->Send_Custom_Event ( obj, engineer, 0, M01_GOTO_IDLE_JDG, 0 );
- }
- }
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//new engineer is actually sending ID
- {
- engineer_id = Commands->Get_ID ( sender );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Initial_Gunboat_Script_JDG, "")//M01_TURRETBEACH_GUNBOAT_ID 101477
- {
- bool firstHealthWarningPlayed;
- bool secondHealthWarningPlayed;
- Vector3 myPosition;
- float myFacing;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(firstHealthWarningPlayed, 1);
- SAVE_VARIABLE(secondHealthWarningPlayed, 2);
- SAVE_VARIABLE(myPosition, 3);
- SAVE_VARIABLE(myFacing, 4);
- }
- void Created( GameObject * obj )
- {
- firstHealthWarningPlayed = false;
- secondHealthWarningPlayed = false;
- myPosition = Commands->Get_Position ( obj );
- myFacing = Commands->Get_Facing ( obj );
-
- ActionParamsStruct params;
- params.Set_Basic(this, 90, M01_WALKING_WAYPATH_02_JDG);
- //params.Set_Movement( Vector3(0,0,0), .1f, 3 );
- //params.WaypathID = 101497;
- params.AttackActive = false;
- params.AttackCheckBlocked = false;
-
- Commands->Action_Attack (obj, params);
- }
- void Killed( GameObject * obj, GameObject * killer ) //
- {
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event( obj, missionController, 0, M01_END_TURRETS_OBJECTIVE_FAIL_JDG, 0 );
- }
- GameObject * sinkingGunboat = Commands->Create_Object ( "M01_GDI_Gunboat", myPosition );
- Commands->Set_Facing ( sinkingGunboat, myFacing );
- Commands->Attach_Script(sinkingGunboat, "M01_Sinking_Gunboat_JDG", "");
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- if (obj)
- {
- float myCurrentHealth = Commands->Get_Health (obj);
- float myMaxHealth = Commands->Get_Max_Health (obj);
- float healthPercentage = (myCurrentHealth/myMaxHealth) * 100;
- if (myCurrentHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- if (healthPercentage <= 50)
- {
- if (secondHealthWarningPlayed == false)
- {
- secondHealthWarningPlayed = true;
- int gunboatHealthWarning02 = Commands->Create_Conversation( "M01_Gunboat_HealthWarning_02", 100, 1000, false);
- Commands->Join_Conversation( NULL, gunboatHealthWarning02, false, false );
- Commands->Join_Conversation( NULL, gunboatHealthWarning02, false, false );
- Commands->Join_Conversation( STAR, gunboatHealthWarning02, false, false );
- Commands->Start_Conversation( gunboatHealthWarning02, gunboatHealthWarning02 );
- }
- }
- else if (healthPercentage <= 75)
- {
- if (firstHealthWarningPlayed == false)
- {
- firstHealthWarningPlayed = true;
- int gunboatHealthWarning01 = Commands->Create_Conversation( "M01_Gunboat_HealthWarning_01", 100, 1000, false);
- Commands->Join_Conversation( NULL, gunboatHealthWarning01, false, false );
- Commands->Join_Conversation( NULL, gunboatHealthWarning01, false, false );
- Commands->Start_Conversation( gunboatHealthWarning01, gunboatHealthWarning01 );
- }
- }
-
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
-
- if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
- {
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
- //params.Set_Movement( Vector3(0,0,0), .2f, 6 );
- //params.WaypathID = 101497;
- float pickTarget = Commands->Get_Random ( 0.5f, 2.5f );
- if (pickTarget >= 0.5f && pickTarget < 1.5f)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret01 != NULL)
- {
- Vector3 myTarget = Commands->Get_Position ( turret01 );
- myTarget.Z += 2;
- params.Set_Attack( myTarget, 2000, 0, true );
- }
-
- else if (turret02 != NULL)
- {
- Vector3 myTarget = Commands->Get_Position ( turret02 );
- myTarget.Z += 2;
- params.Set_Attack( myTarget, 2000, 0, true );
- }
- }
- else
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- Vector3 myTarget = Commands->Get_Position ( turret02 );
- myTarget.Z += 2;
- params.Set_Attack( myTarget, 2000, 0, true );
- }
- else if (turret01 != NULL)
- {
- Vector3 myTarget = Commands->Get_Position ( turret01 );
- myTarget.Z += 2;
- params.Set_Attack( myTarget, 2000, 0, true );
- }
- }
- params.AttackActive = true;
- params.AttackCheckBlocked = false;
- Commands->Modify_Action (obj, M01_WALKING_WAYPATH_02_JDG, params);
- float delayTimer = Commands->Get_Random ( 4, 6 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
- }
- else if (param == M01_START_ACTING_JDG)
- {
- Commands->Debug_Message ( "***************************gunboat custom received--start acting\n" );
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
- //params.Set_Movement( Vector3(0,0,0), .2f, 6 );
- //params.WaypathID = 101497;
- params.AttackActive = false;
- Commands->Modify_Action (obj, M01_WALKING_WAYPATH_02_JDG, params);
- float delayTimer = Commands->Get_Random ( 0, 2 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, delayTimer );
- }
- else if (param == M01_GOTO_IDLE_JDG)
- {
- Commands->Debug_Message ( "***************************gunboat custom received--STOP acting\n" );
- Commands->Enable_Hibernation( obj, true );
- }
- else if (param == M01_END_TURRETS_OBJECTIVE_PASS_JDG)
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement( Vector3(0,0,0), .7f, 10 );
- params.WaypathID = 103454;
- Commands->Action_Goto( obj, params );
- GameObject * tankZone = Commands->Find_Object ( 102500 );
- if (tankZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (action_id == M01_WALKING_WAYPATH_03_JDG)//gunboat is at end of final waypath--delete it
- {
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_BaseCommander_JDG, "")//106050 Capt Duncan
- {
- int gdi04conv01;
- bool gaveIonBeacon;
- int gdi04conv02;
- bool powsRescued;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(gdi04conv01, 1);
- SAVE_VARIABLE(gaveIonBeacon, 2);
- SAVE_VARIABLE(gdi04conv02, 3);
- SAVE_VARIABLE(powsRescued, 4);
- }
- void Created( GameObject * obj )
- {
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
- powsRescued = false;
- gaveIonBeacon = false;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_NEUTRAL );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (gaveIonBeacon == false)
- {
- Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- GameObject * shackzone = Commands->Find_Object ( 115985 );
- if (shackzone != NULL)
- {
- Commands->Send_Custom_Event( obj, shackzone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- GameObject * pow01 = Commands->Find_Object ( 116386 );
- if (pow01 != NULL)
- {
- Commands->Apply_Damage( pow01, 10000, "Steel", NULL );
- }
- GameObject * pow02 = Commands->Find_Object ( 116385 );
- if (pow02 != NULL)
- {
- Commands->Apply_Damage( pow02, 10000, "Steel", NULL );
- }
- GameObject * baseMinigunner = Commands->Find_Object ( 116382 );
- if (baseMinigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, baseMinigunner, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- GameObject * baseGrenadier = Commands->Find_Object ( 116383 );
- if (baseGrenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, baseGrenadier, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- Vector3 nodGuy01_spot (28.566f, 29.790f, 1.792f);
- Vector3 nodGuy02_spot (65.899f, 46.347f, -0.294f);
- Vector3 nodGuy03_spot (24.776f, 44.863f, 0.708f);
- GameObject * nodGuy01 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy01_spot );
- GameObject * nodGuy02 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy02_spot );
- GameObject * nodGuy03 = Commands->Create_Object ( "Nod_MiniGunner_0", nodGuy03_spot );
- Commands->Set_Innate_Soldier_Home_Location ( nodGuy01, nodGuy01_spot, 10 );
- Commands->Set_Innate_Soldier_Home_Location ( nodGuy02, nodGuy02_spot, 10 );
- Commands->Set_Innate_Soldier_Home_Location ( nodGuy03, nodGuy03_spot, 10 );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float myHealth = Commands->Get_Health ( obj );
- if (myHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- Commands->Set_Player_Type ( obj, SCRIPT_PLAYERTYPE_GDI );
- Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 1 );//
- }
- else if (param == M01_GDI_BASE_POWS_RESCUED_JDG)
- {
- powsRescued = true;
- }
- else if (param == M01_DO_END_MISSION_CHECK_JDG)
- {
- GameObject * nodGuy01 = Commands->Find_Object ( 101399 );
- GameObject * nodGuy02 = Commands->Find_Object ( 103335 );
- GameObject * nodGuy03 = Commands->Find_Object ( 103340 );
- GameObject * nodGuy04 = Commands->Find_Object ( 102185 );
- if ( (nodGuy01 == NULL) && (nodGuy02 == NULL) && (nodGuy03 == NULL) && (nodGuy04 == NULL) )
- {
- GameObject * letsgozone = Commands->Find_Object ( 105615 );
- if (letsgozone != NULL)
- {
- Commands->Destroy_Object ( letsgozone );
- }
- GameObject * shackzone = Commands->Find_Object ( 115985 );
- if (shackzone != NULL)
- {
- Commands->Send_Custom_Event( obj, shackzone, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_DO_END_MISSION_CHECK_JDG, 0.25f );
- }
- }
- else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)//
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Action_Reset ( obj, 100 );
- Vector3 myHomeSpot (55.9f, 40.3f, -0.2f);
- params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
- {
- Commands->Action_Reset ( obj, 100 );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
- params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)//havoc has saved you--start conversation
- {
- gdi04conv01 = Commands->Create_Conversation( "M01_GDI04_Conversation_01", 100, 1000, false);
- Commands->Join_Conversation( obj, gdi04conv01, false, true, true );
- Commands->Join_Conversation( STAR, gdi04conv01, false, false, false );
- Commands->Start_Conversation( gdi04conv01, gdi04conv01 );
- Commands->Monitor_Conversation( obj, gdi04conv01 );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == gdi04conv01)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("H_A_J12C", false);
- Commands->Action_Play_Animation (obj, params);//
- Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_ACCOMPLISHED );
- /*GameObject * POW01 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY01_JDG );
- if (POW01 != NULL)
- {
- Commands->Send_Custom_Event( obj, POW01, 0, M01_CAPT_DUNCAN_HAS_BEEN_FOUND_JDG, 0 );
- }
- GameObject * POW02 = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_POWGUY02_JDG );
- if (POW02 != NULL)
- {
- Commands->Send_Custom_Event( obj, POW02, 0, M01_CAPT_DUNCAN_HAS_BEEN_FOUND_JDG, 0 );
- }*/
- }
- if (action_id == gdi04conv02)
- {
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- else if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
-
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG)
- {
- Vector3 myPostion (114.848f, 95.401f, 8.923f);
- Commands->Create_Object ( "POW_IonCannonBeacon_Player", myPostion );
- gaveIonBeacon = true;
- gdi04conv02 = Commands->Create_Conversation( "M01_GDI04_Conversation_02", 100, 1000, false);
- Commands->Join_Conversation( obj, gdi04conv02, false, true, true );
- Commands->Join_Conversation( STAR, gdi04conv02, false, false, false );
- Commands->Start_Conversation( gdi04conv02, gdi04conv02 );
- Commands->Monitor_Conversation( obj, gdi04conv02 );
- }
- else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to call in a chopper
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- Commands->Give_Points( STAR, 2000, false );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- if (gaveIonBeacon == false)
- {
- Commands->Set_Objective_Status( M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, OBJECTIVE_STATUS_FAILED );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_GDI_Grenadier_JDG, "")//116383
- {
- float currentHealth;
- bool invincible;
- bool ducanRescued;
- bool headingDownBackPath;
- bool still_in_GDI_Base;
- bool damagedByNod;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(currentHealth, 1);
- SAVE_VARIABLE(invincible, 2);
- SAVE_VARIABLE(ducanRescued, 3);
- SAVE_VARIABLE(headingDownBackPath, 4);
- SAVE_VARIABLE(still_in_GDI_Base, 5);
- SAVE_VARIABLE(damagedByNod, 6);
- }
- void Created( GameObject * obj ) //this guy starts in the guard tower firing over at the conyard
- {
- damagedByNod = false;
- still_in_GDI_Base = true;
- invincible = true;
- ducanRescued = false;
- currentHealth = Commands->Get_Health ( obj );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 10 );//in 2 seconds run to a new position
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- GameObject * nodGuy01 = Commands->Find_Object ( 116388 );
- GameObject * nodGuy02 = Commands->Find_Object ( 116387 );
- if (damager == nodGuy01 || damager == nodGuy02)
- {
- if (damagedByNod == false)
- {
- damagedByNod = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
- }
- }
- if (invincible == true)
- {
- //Commands->Set_Health ( obj, currentHealth );
- float myCurrentHealth = Commands->Get_Health ( obj );
- if (myCurrentHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- else if (obj && damager == obj)
- {
- Commands->Set_Health ( obj, currentHealth );
- }
- else if (obj)
- {
- currentHealth = Commands->Get_Health ( obj );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//run over next to ladder
- {
-
- Vector3 newPosition (38.873f, -42.180f, -0.432f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement(newPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_START_ATTACKING_01_JDG)//player is at top of ladders...check if nod minigunner is still alive
- {
- GameObject * nodMinigunner = Commands->Find_Object ( 116384 );
- if (nodMinigunner != NULL)
- {
- params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
- params.Set_Attack( nodMinigunner, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else
- {
- Commands->Action_Reset ( obj, 100 );
- }
- }
- else if (param == M01_START_ACTING_JDG)//
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Attack( STAR, 0, 0, true );
- Commands->Action_Attack (obj, params);
- float delayTimer = Commands->Get_Random ( 1, 2 );
- Commands->Send_Custom_Event ( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, delayTimer );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "H_A_J19A", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)
- {
- //invincible = false;
- Vector3 newPosition (26.767f, 18.529f, 3.139f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Movement(newPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)
- {
- Commands->Enable_Hibernation( obj, false );
- //evacing = true;
- ducanRescued = true;
- Commands->Action_Reset ( obj, 100 );
- Vector3 myHomeSpot (41.3f, 27.4f, -0.2f);
- params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
- {
- Commands->Action_Reset ( obj, 100 );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
- params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_06_JDG && ducanRescued == false)//Head down the path
- {
- still_in_GDI_Base = false;
- Commands->Action_Reset ( obj, 100 );
- headingDownBackPath = true;
- Vector3 newGotoSpot (111.210f, 85.507f, 8.934f);
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(newGotoSpot, RUN, 1);
- params.AttackActive = false;
- Commands->Action_Attack (obj, params);
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- if (still_in_GDI_Base == true)
- {
- invincible = false;
- Commands->Apply_Damage( obj, 100000, "Steel", NULL );
- }
- }
- else if (param == M01_WALKING_WAYPATH_04_JDG)
- {
- GameObject * nodguy02 = Commands->Find_Object ( 116387 );
- if (nodguy02 != NULL)
- {
- Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- params.Set_Attack( nodguy02, 20, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else
- {
- Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- Commands->Action_Goto (obj, params);
- }
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (headingDownBackPath == true)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(enemy, WALK, 5);
- params.Set_Attack( enemy, 1000, 0, true );
- params.AttackActive = true;
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_06_JDG, params, true, true );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Vector3 myTarget (28.449f, -23.325f, 3.032f);
-
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "H_A_J19S", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "H_A_J19C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to call in a chopper
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG)//you're over by the pows now...check if nod guy 02 is still alive
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG)//your target is dead...make sure you go over to path
- {
- Vector3 myNewSpot (53.363f, 54.018f, -0.439f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- Commands->Action_Goto (obj, params);
- }
- else if (action_id == M01_WALKING_WAYPATH_05_JDG)//you're by path entrance...goto stationary
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_WALKING_WAYPATH_06_JDG)//you just killed a back path guy...continue your journey
- {
- Vector3 newGotoSpot (111.210f, 85.507f, 8.934f);
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(newGotoSpot, RUN, 1);
- params.AttackActive = false;
- Commands->Action_Attack (obj, params);
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_MediumTank_ReminderZone_JDG, "")//122848
- {
- bool commandClearance;
- bool player_in_tank;
- int reminderConv;
- int tank_id;
- int reminders;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(commandClearance, 1);
- SAVE_VARIABLE(player_in_tank, 2);
- SAVE_VARIABLE(tank_id, 3);
- SAVE_VARIABLE(reminders, 4);
- }
- void Created( GameObject * obj )
- {
- commandClearance = false;
- player_in_tank = false;
- reminders = 0;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- if (commandClearance == true)
- {
- if (player_in_tank == true)//
- {
- }
- else
- {
- int tunnelConv = Commands->Create_Conversation( "M01_TunnelTank_Reminder_Conversation", 100, 30, false );
- Commands->Join_Conversation( NULL, tunnelConv, false, true, true );
- Commands->Start_Conversation( tunnelConv, tunnelConv );
- Commands->Destroy_Object ( obj );
- }
- }
- }
- }
- void Timer_Expired( GameObject * obj, int timer_id )
- {
- if (player_in_tank == false)
- {
- reminders++;
- if (reminders == 1)
- {
- GameObject * mediumTank = Commands->Find_Object ( tank_id );
- if (mediumTank != NULL)
- {
- reminderConv = Commands->Create_Conversation( "M01_GetInTheTank_01_Conversation", 100, 30, false );
- Commands->Join_Conversation( NULL, reminderConv, false, true, true );
- Commands->Start_Conversation( reminderConv, reminderConv );
- Commands->Monitor_Conversation( obj, reminderConv );
- }
- }
- else if (reminders == 2)
- {
- GameObject * mediumTank = Commands->Find_Object ( tank_id );
- if (mediumTank != NULL)
- {
- reminderConv = Commands->Create_Conversation( "M01_GetInTheTank_02_Conversation", 100, 30, false );
- Commands->Join_Conversation( NULL, reminderConv, false, true, true );
- Commands->Start_Conversation( reminderConv, reminderConv );
- Commands->Monitor_Conversation( obj, reminderConv );
- }
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == reminderConv)
- {
- Commands->Start_Timer ( obj, this, 30, 0 );
-
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)//tank is here
- {
- commandClearance = true;
- Commands->Start_Timer ( obj, this, 10, 0 );
- tank_id = Commands->Get_ID ( obj );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)//player is in the tank
- {
- player_in_tank = true;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//player is out of the tank
- {
- player_in_tank = false;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_POW01_JDG, "")//116386
- {
- int deadGuards;
- bool pokable;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(deadGuards, 1);
- SAVE_VARIABLE(pokable, 2);
- }
- void Created( GameObject * obj )
- {
- deadGuards = 0;
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
- Commands->Set_Loiters_Allowed( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "H_A_HOST_L2B", true );
- Commands->Action_Play_Animation ( obj, params );
- pokable = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float currentHealth = Commands->Get_Health ( obj );
- if (currentHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- deadGuards++;
- if (deadGuards == 2)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "H_A_HOST_L2C", false );
- Commands->Action_Play_Animation ( obj, params );
- GameObject * pow02 = Commands->Find_Object ( 116385 );
- if (pow02 != NULL)
- {
- Commands->Send_Custom_Event( obj, pow02, 0, M01_START_ACTING_JDG, 1 );
- }
- Vector3 airdropPosition (55.062f, 60.164f, -1);
- GameObject *controller = Commands->Create_Object("Invisible_Object", airdropPosition);
- Commands->Set_Facing ( controller, -45 );
- Commands->Attach_Script(controller, "Test_Cinematic", "X1D_GDIPOW_FlareDrop.txt");
- }
- }
- else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG ) );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( myEvacSpot, RUN, 1 );
- Commands->Action_Goto( obj, params );
- }
- else if (param == M01_GOTO_INNATE_JDG)
- {
- pokable = false;
- Commands->Enable_HUD_Pokable_Indicator ( obj, false );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "H_A_HOST_L1C", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//play the Havoc conversation
- {
- GameObject * convController = Commands->Find_Object ( 121237 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)//gdi guy is at evac chopper--delete him
- {
- GameObject * airdropController = Commands->Find_Object ( M01_GDIBASE_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_POW02_JDG, "")//116385
- {
- bool pokable;
- int pow02conv01;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(pokable, 1);
- SAVE_VARIABLE(pow02conv01, 2);
- }
- void Created( GameObject * obj )
- {
- Commands->Set_Obj_Radar_Blip_Color ( obj, RADAR_BLIP_COLOR_GDI );
- Commands->Set_Loiters_Allowed( obj, false );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation( "H_A_HOST_L2B", true );
- Commands->Action_Play_Animation ( obj, params );
- pokable = false;
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float currentHealth = Commands->Get_Health ( obj );
- if (currentHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation( "H_A_HOST_L2C", false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (param == M01_GOING_TO_EVAC_SPOT02_JDG)
- {
- Commands->Enable_Hibernation( obj, false );
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myEvacSpot = Commands->Get_Position ( Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG ) );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( myEvacSpot, RUN, 1 );
- Commands->Action_Goto( obj, params );
- }
- else if (param == M01_GOTO_INNATE_JDG)
- {
- pokable = false;
- Commands->Enable_HUD_Pokable_Indicator ( obj, false );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_DOING_ANIMATION_02_JDG )//pow guy is standingup
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation( "H_A_HOST_L1C", false );
- Commands->Action_Play_Animation ( obj, params );
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//pow guy is standingup -- do cheer anim
- {
- char *animationName = M01_Choose_Cheer_Animation ( );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_04_JDG );
- params.Set_Animation( animationName, false );
- Commands->Action_Play_Animation ( obj, params );
- }
- else if (action_id == M01_DOING_ANIMATION_04_JDG )//pow guy is standingup -- play havoc anim if pow01 is dead
- {
- GameObject * pow01 = Commands->Find_Object ( 116386 );
- if (pow01 == NULL)
- {
- GameObject * convController = Commands->Find_Object ( 121237 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)//gdi guy is at evac chopper--delete him
- {
- GameObject * airdropController = Commands->Find_Object ( M01_GDIBASE_EVAC_MONITOR_JDG );
- if (airdropController != NULL)
- {
- Commands->Send_Custom_Event( obj, airdropController, 0, M01_GOING_TO_EVAC_SPOT_JDG, 0 );
- }
- GameObject * myEvacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDIBase_POW_Conversation_Controller_JDG, "")//121237
- {
- bool convPlayed;
- int pow02conv01;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(convPlayed, 1);
- SAVE_VARIABLE(pow02conv01, 2);
- }
- void Created( GameObject * obj )
- {
- convPlayed = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender ) //M01_POW02_Conversation_01
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG && convPlayed == false)
- {
- convPlayed = true;
- GameObject * pow01 = Commands->Find_Object ( 116386 );
- GameObject * pow02 = Commands->Find_Object ( 116385 );
- if (sender == pow01 && pow01 != NULL)
- {
- pow02conv01 = Commands->Create_Conversation( "M01_POW02_Conversation_01", 100, 1000, false );
- Commands->Join_Conversation( pow01, pow02conv01, false, true, true );
- Commands->Join_Conversation( STAR, pow02conv01, false, false, false );
- Commands->Start_Conversation( pow02conv01, pow02conv01 );
- Commands->Monitor_Conversation( obj, pow02conv01 );
- }
- else if (sender == pow02 && pow02 != NULL)
- {
- pow02conv01 = Commands->Create_Conversation( "M01_POW02_Conversation_01", 100, 1000, false );
- Commands->Join_Conversation( pow02, pow02conv01, false, true, true );
- Commands->Join_Conversation( STAR, pow02conv01, false, false, false );
- Commands->Start_Conversation( pow02conv01, pow02conv01 );
- Commands->Monitor_Conversation( obj, pow02conv01 );
- }
- if (pow01 != NULL)//M01_GOTO_INNATE_JDG
- {
- Commands->Send_Custom_Event( obj, pow01, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- if (pow02 != NULL)
- {
- Commands->Send_Custom_Event( obj, pow02, 0, M01_GOTO_INNATE_JDG, 0 );
- }
-
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == pow02conv01)
- {
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event( obj, pogController, M01_CHANGE_OBJECTIVE_POG_JDG, M01_GDI_BASE_COMMANDER_OBJECTIVE_JDG, 0 );
- }
- GameObject * evacController = Commands->Find_Object ( M01_GDIBASE_POWSCENE02_MONITOR_JDG );
- if (evacController != NULL)
- {
- Commands->Send_Custom_Event( obj, evacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject * gdiMinigunner = Commands->Find_Object ( 116382 );
- if (gdiMinigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiMinigunner, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 2 );
- //this tells him to start the "this is the path" routine
- }
- GameObject * backPathZone = Commands->Find_Object ( 121433 );
- if (backPathZone != NULL)
- {
- Commands->Send_Custom_Event( obj, backPathZone, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_BeachGuy01_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Innate_Disable(obj);
- ActionParamsStruct params;
- Commands->Enable_Hibernation( obj, false );
- params.Set_Basic(this, 100, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement( Vector3(36.231f, 28.471f, 0.131f), RUN, 2 );
- Commands->Action_Goto( obj, params );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- float currentHealth = Commands->Get_Health ( obj );
- if (currentHealth <= 10 && damager == STAR)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Commands->Apply_Damage( obj, 10000, "STEEL", NULL );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Announce_TankAirstrikeZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * missionController = Commands->Find_Object ( M01_MISSION_CONTROLLER_JDG );
- if (missionController != NULL)
- {
- Commands->Send_Custom_Event( obj, missionController, 0, M01_ANNOUNCE_AIRSTRIKE_JDG, 0 );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_GuardTower_02_Enter_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
- Commands->Attach_Script(sniperTarget01, "M01_GuardTower_Sniper_Target_JDG", "-90.385 124.308 1.610, -79.477 139.201 0.947");
- GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
- Commands->Attach_Script(sniperTarget02, "M01_GuardTower_Sniper_Target_JDG", "-85.499 117.221 1.915, -79.477 139.201 0.947");
- GameObject * sniperTarget03 = Commands->Create_Object ( "Nod_MiniGunner_0", Vector3());
- Commands->Attach_Script(sniperTarget03, "M01_GuardTower_Sniper_Target_JDG", "-93.364 113.202 1.701, -79.477 139.201 0.947");
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_GDI_GuardTower02_SniperRifle_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //sniper rifle has been picked up--spawn the actors
- {
- GameObject * c4TextController = Commands->Find_Object ( 117188 );
- if (c4TextController != NULL)
- {
- Commands->Send_Custom_Event( obj, c4TextController, 2, 1, 0 );
- }
-
- Vector3 spawnLocation01 (-79.182f, 141.927f, 1.763f);
- GameObject * sniperTarget01 = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation01);
- Commands->Attach_Script(sniperTarget01, "M01_GuardTower02_Sniper_Target01_JDG", "");
- }
- }
- };
- DECLARE_SCRIPT(M01_GuardTower02_Sniper_Target01_JDG, "")
- {
- int guy02_id;
- int sniperConv;
- bool acting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(guy02_id, 1);
- SAVE_VARIABLE(sniperConv, 2);
- SAVE_VARIABLE(acting, 3);
- }
- void Created( GameObject * obj )
- {
- acting = true;
- Commands->Enable_Hibernation( obj, false );
- Vector3 spawnLocation02 (-93.882f, 110.504f, 1.644f);
- GameObject * sniperTarget02 = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation02);
- Commands->Attach_Script(sniperTarget02, "M01_GuardTower02_Sniper_Target02_JDG", "");
- Commands->Send_Custom_Event( obj, sniperTarget02, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 1 );
- guy02_id = Commands->Get_ID ( sniperTarget02 );
- Vector3 myGotoSpot (-92.496f, 117.750f, 1.752f);
- ActionParamsStruct params;
- params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myGotoSpot, RUN, 1 );
- Commands->Action_Goto( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * reinforceController = Commands->Find_Object ( 123645 );
- if (reinforceController != NULL)
- {
- Commands->Send_Custom_Event( obj, reinforceController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- if (acting == true)
- {
- GameObject * guy02 = Commands->Find_Object ( guy02_id );
- if (guy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, guy02, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_IVE_BEEN_KILLED_JDG)//your buddy's been capped--do look around anim
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("H_A_A0A0_L21", false);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG )//youre now in middle of field--start conversation
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * guy02 = Commands->Find_Object ( guy02_id );
- if (guy02 != NULL)
- {
- sniperConv = Commands->Create_Conversation( "M01_SniperTower_Conversation", 100, 80, true);
- Commands->Join_Conversation( obj, sniperConv, false, true, true );
- Commands->Join_Conversation( guy02, sniperConv, false, true, true );
- Commands->Start_Conversation( sniperConv, sniperConv );
- Commands->Monitor_Conversation( obj, sniperConv );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG )//youre now at the tailguns--allow hibernation
- {
- Commands->Enable_Hibernation( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG )//youre looked around--now set curent position as home spot
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == sniperConv )//conversation is over--go away
- {
- acting = false;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myGotoSpot (46.749f, 197.062f, 6.211f);
- ActionParamsStruct params;
- params.Set_Basic( this, 50, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Movement( myGotoSpot, RUN, 1 );
- Commands->Action_Goto( obj, params );
- GameObject * guy02 = Commands->Find_Object ( guy02_id );
- if (guy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, guy02, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GuardTower02_Sniper_TowerZone_JDG, "")//123645
- {
- bool player_in_zone;
- int targets_killed;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(player_in_zone, 1);
- SAVE_VARIABLE(targets_killed, 2);
- }
- void Created( GameObject * obj )
- {
- player_in_zone = false;
- targets_killed = 0;
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- player_in_zone = true;
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- player_in_zone = false;
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_IVE_BEEN_KILLED_JDG)//a sniper targets been killed--check player position and spawn new target if needed
- {
- if (player_in_zone == true)
- {
- targets_killed++;
- if (targets_killed == 1)
- {
- Vector3 spawnLocation02 (-51.423f, 126.198f, 2.537f);
- GameObject * new_sniperTarget = Commands->Create_Object ( "Nod_MiniGunner_0", spawnLocation02);
- Commands->Attach_Script(new_sniperTarget, "M01_GuardTower02_NewSniperTarget_JDG", "");
-
- }
- else if (targets_killed == 2)
- {
- }
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GuardTower02_NewSniperTarget_JDG, "")
- {
- void Created( GameObject * obj )
- {
- Commands->Enable_Hibernation( obj, false );
- Vector3 runToPosition (-67.347f, 118.048f, 2.641f);
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( runToPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG )//now look over at Havoc
- {
- params.Set_Basic( this, 100, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Attack( STAR, 0, 0, true );
- Commands->Action_Attack ( obj, params );
- Commands->Send_Custom_Event( obj, obj, 0, M01_FACING_SPECIFIED_DIRECTION_01_JDG, 1 );
- }
- else if (action_id == M01_DOING_ANIMATION_02_JDG )//now do neck chop anim
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_03_JDG );
- params.Set_Animation ("H_A_A0A0_L56", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (action_id == M01_DOING_ANIMATION_03_JDG )//now go attack havoc
- {
- params.Set_Basic( this, 50, M01_FACING_SPECIFIED_DIRECTION_01_JDG );
- params.Set_Attack( STAR, 20, 0, true );
- params.Set_Movement( STAR, RUN, 5);
- Commands->Action_Attack ( obj, params );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_FACING_SPECIFIED_DIRECTION_01_JDG)
- {
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_02_JDG );
- params.Set_Animation ("H_A_A0A0_L34", false);
- Commands->Action_Play_Animation (obj, params);
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GuardTower02_Sniper_Target02_JDG, "")
- {
- int guy01_id;
- bool acting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(guy01_id, 1);
- SAVE_VARIABLE(acting, 2);
- }
- void Created( GameObject * obj )
- {
- acting = true;
- Commands->Enable_Hibernation( obj, false );
-
- Vector3 myGotoSpot (-92.927f, 115.587f, 1.847f);
- ActionParamsStruct params;
- params.Set_Basic( this, 80, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myGotoSpot, WALK, 1 );
- Commands->Action_Goto( obj, params );
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * reinforceController = Commands->Find_Object ( 123645 );
- if (reinforceController != NULL)
- {
- Commands->Send_Custom_Event( obj, reinforceController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- if (acting == true)
- {
- GameObject * guy01 = Commands->Find_Object ( guy01_id );
- if (guy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, guy01, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG )//youre now in middle of field--start conversation
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_DOING_ANIMATION_01_JDG )//youre looked around--now set curent position as home spot
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myPosition = Commands->Get_Position ( obj );
- Commands->Set_Innate_Soldier_Home_Location ( obj, myPosition, 5 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- acting = false;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myGotoSpot (-79.399f, 112.473f, 2.373f);
-
- params.Set_Basic( this, 50, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Movement( myGotoSpot, WALK, 1 );
- Commands->Action_Goto( obj, params );
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)//your buddy's been capped--do look around anim
- {
- Commands->Action_Reset ( obj, 100 );
- params.Set_Basic( this, 100, M01_DOING_ANIMATION_01_JDG );
- params.Set_Animation ("H_A_A0A0_L21", false);
- Commands->Action_Play_Animation (obj, params);
- }
- else if (param == M01_CHOPPER_IS_SENDING_ID_JDG)//guy 1 is actually sending his id
- {
- guy01_id = Commands->Get_ID ( sender );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_TurnOff_TankReminder_Zone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
- if (tankReminderZone != NULL)
- {
- Commands->Destroy_Object ( tankReminderZone );
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Escorts_Warroom_MCT_ZoneController_JDG, "")//103378
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * mctCommander = Commands->Find_Object ( 103373 );
- GameObject * mctProtector01 = Commands->Find_Object ( 103374 );
- GameObject * mctProtector02 = Commands->Find_Object ( 103375 );
- if (mctCommander != NULL)
- {
- Commands->Send_Custom_Event ( obj, mctCommander, 0, M01_START_ACTING_JDG, 0 );
- if ((mctProtector01 != NULL) && (mctProtector02 != NULL))
- {
- int protectMct_conv = Commands->Create_Conversation( "M01_Protect_The_MCT", 100, 1000, true);
- Commands->Join_Conversation( mctProtector02, protectMct_conv, false, false );
- Commands->Join_Conversation( mctProtector01, protectMct_conv, false, false );
- Commands->Start_Conversation( protectMct_conv, protectMct_conv );
- }
- }
- Commands->Destroy_Object ( obj );
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_01_GDI_JDG, "")
- {
- bool player_in_warroom;
- bool at_final_destination;
- bool escorting;
- int dialogs_said;
- int dialogs_said_to_havoc;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(player_in_warroom, 1);
- SAVE_VARIABLE(at_final_destination, 2);
- SAVE_VARIABLE(escorting, 3);
- SAVE_VARIABLE(dialogs_said, 4);
- SAVE_VARIABLE(dialogs_said_to_havoc, 5);
- }
- void Created( GameObject * obj )
- {
- dialogs_said = 0;
- dialogs_said_to_havoc = 0;
- player_in_warroom = false;
- at_final_destination = false;
- escorting = true;
- Commands->Enable_Hibernation( obj, false );
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
- }
- GameObject * MCT_talkZone = Commands->Find_Object ( 124260 );
- if (MCT_talkZone != NULL)
- {
- Commands->Send_Custom_Event( obj, MCT_talkZone, 0, M01_ROPE_IS_SENDING_ID_JDG, 0 );
- }
- }
- //Vector3 myGotoLocation (-187.848f, 526.480f, 3.518f);
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 0 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (escorting == true)
- {
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (obj && type == 0)
- {
- if (param == M01_WALKING_WAYPATH_01_JDG && player_in_warroom == false)
- {
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- Vector3 myGotoLocation (-187.848f, 526.480f, 3.518f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(myGotoLocation, RUN, 1);
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 5 );
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
-
- }
- else if (param == M01_START_ACTING_JDG && at_final_destination == false)
- {
- player_in_warroom = true;
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- Vector3 myGotoLocation (-181.084f, 541.058f, 3.518f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(myGotoLocation, WALK, 1);
- Commands->Action_Goto(obj, params);
-
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- }
- else if (param == M01_GOTO_INNATE_JDG)//escort scenario is over--go to top of HON and goto innate
- {
- escorting = false;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Enable_Hibernation( obj, true );
- Vector3 myGotoLocation (-181.163f, 534.529f, 10.034f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement(myGotoLocation, RUN, 5);
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 5 );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG && escorting == true)//pick a sound to play
- {
- /*Vector3 myPosition = Commands->Get_Position ( obj );
- Vector3 playerPosition = Commands->Get_Position ( STAR );
- float distance = Commands->Get_Distance ( myPosition, playerPosition );
- if (distance <= 8)
- {
- if (dialogs_said_to_havoc == 0)
- {
- Commands->Create_Sound ( "MX1DSGN_DSGN0024I1DSGN_SND", myPosition, obj );//follow us inside
- }
- else if (dialogs_said_to_havoc == 1)
- {
- Commands->Create_Sound ( "MX1DSGN_DSGN0027I1DSGN_SND", myPosition, obj );//this way sir
- }
- dialogs_said_to_havoc++;
- if (dialogs_said_to_havoc >= 2)
- {
- dialogs_said_to_havoc = 1;
- }
- }
- else
- {
- if (dialogs_said == 0)
- {
- Commands->Create_Sound ( "MX1DSGN_DSGN0025I1DSGN_SND", myPosition, obj );//lets do it
- }
- else if (dialogs_said == 1)
- {
- Commands->Create_Sound ( "MX1DSGN_DSGN0026I1DSGN_SND", myPosition, obj );
- }
- else if (dialogs_said == 2)
- {
- Commands->Create_Sound ( "MX1DSGN_DSGN0028I1DSGN_SND", myPosition, obj );
- }
- dialogs_said++;
- if (dialogs_said >= 3)
- {
- dialogs_said = 0;
- }
- }
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 5 );*/
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- at_final_destination = true;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * MCTspeechZone = Commands->Find_Object ( 124260 );
- if (MCTspeechZone != NULL)
- {
- Commands->Send_Custom_Event( obj, MCTspeechZone, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_Chinook_Spawned_Soldier_02_GDI_JDG, "")
- {
- bool player_in_warroom;
- bool at_final_destination;
- bool escorting;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(player_in_warroom, 1);
- SAVE_VARIABLE(at_final_destination, 2);
- SAVE_VARIABLE(escorting, 3);
- }
- void Created( GameObject * obj )
- {
- player_in_warroom = false;
- at_final_destination = false;
- escorting = true;
- Commands->Enable_Hibernation( obj, false );
- Commands->Innate_Soldier_Enable_Gunshot_Heard ( obj, false );
- Commands->Innate_Soldier_Enable_Bullet_Heard ( obj, false );
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
- }
- GameObject * MCT_talkZone = Commands->Find_Object ( 124260 );
- if (MCT_talkZone != NULL)
- {
- Commands->Send_Custom_Event( obj, MCT_talkZone, 0, M01_WAYPATH_IS_SENDING_ID_JDG, 0 );
- }
- }
- //Vector3 myGotoLocation (-188.670f, 530.083f, 3.518f);
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "s_a_human.h_a_troopdrop") == 0)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 0 );
- }
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- if (escorting == true)
- {
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (obj && type == 0)
- {
- if (param == M01_WALKING_WAYPATH_01_JDG && player_in_warroom == false)
- {
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- Vector3 myGotoLocation (-188.670f, 530.083f, 3.518f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_01_JDG);
- params.Set_Movement(myGotoLocation, RUN, 1);
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_01_JDG, 5 );
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- }
- else if (param == M01_START_ACTING_JDG && at_final_destination == false)
- {
- player_in_warroom = true;
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- Vector3 myGotoLocation (-179.440f, 535.697f, 3.518f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_02_JDG);
- params.Set_Movement(myGotoLocation, WALK, 0);
- Commands->Action_Goto(obj, params);
-
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- }
- else if (param == M01_GOTO_INNATE_JDG)//escort scenario is over--go to top of HON and goto innate
- {
- escorting = false;
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Commands->Enable_Hibernation( obj, true );
- Vector3 myGotoLocation (-178.263f, 528.363f, 10.034f);
- ActionParamsStruct params;
- params.Set_Basic(this, 60, M01_WALKING_WAYPATH_03_JDG);
- params.Set_Movement(myGotoLocation, RUN, 5);
- Commands->Action_Goto(obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 5 );
- }
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
- float handOfNodHealth = Commands->Get_Health ( Commands->Find_Object ( M01_HAND_OF_NOD_JDG ) );
- if (handOfNodHealth > 0)
- {
- at_final_destination = true;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * MCTspeechZone = Commands->Find_Object ( 124260 );
- if (MCTspeechZone != NULL)
- {
- Commands->Send_Custom_Event( obj, MCTspeechZone, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_GiveMCTSpeech_Zone_JDG, "")//124260
- {
- bool commandClearance;
- bool player_in_warroom;
- int gdiGuy01_id;
- int gdiGuy02_id;
- bool convPlaying;
- int hon_gdi_guy_conv1;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(commandClearance, 1);
- SAVE_VARIABLE(player_in_warroom, 2);
- SAVE_VARIABLE(gdiGuy01_id, 3);
- SAVE_VARIABLE(gdiGuy02_id, 4);
- SAVE_VARIABLE(convPlaying, 5);
- SAVE_VARIABLE(hon_gdi_guy_conv1, 6);
- }
- void Created( GameObject * obj )
- {
- player_in_warroom = false;
- commandClearance = false;
- convPlaying = false;
- gdiGuy01_id = 0;
- gdiGuy02_id = 0;
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == hon_gdi_guy_conv1)
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
- GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
- if (gdiGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- if (gdiGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_GOTO_INNATE_JDG, 0 );
- }
- Commands->Destroy_Object ( obj );
- }
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (obj && type == 0)
- {
- if (param == M01_ROPE_IS_SENDING_ID_JDG)//gdi guy 01 is actually sending his id
- {
- gdiGuy01_id = Commands->Get_ID ( sender );
- }
- else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//gdi guy 02 is actually sending his id
- {
- gdiGuy02_id = Commands->Get_ID ( sender );
- }
- else if (param == M01_START_ACTING_JDG)
- {
- commandClearance = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- if (commandClearance == true && player_in_warroom == true)
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
- GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
- if (gdiGuy01 != NULL && convPlaying == false)
- {
- convPlaying = true;
- hon_gdi_guy_conv1 = Commands->Create_Conversation( "M01_GDI_HON_MCT", 100, 1000, false);
- Commands->Join_Conversation( gdiGuy01, hon_gdi_guy_conv1, false, true, true );
- Commands->Join_Conversation( STAR, hon_gdi_guy_conv1, false, false, false );
- Commands->Start_Conversation( hon_gdi_guy_conv1, hon_gdi_guy_conv1 );
-
- Commands->Monitor_Conversation( obj, hon_gdi_guy_conv1 );
- }
- else if (gdiGuy02 != NULL && convPlaying == false)
- {
- convPlaying = true;
- hon_gdi_guy_conv1 = Commands->Create_Conversation( "M01_GDI_HON_MCT", 100, 1000, false);
- Commands->Join_Conversation( gdiGuy02, hon_gdi_guy_conv1, false, true, true );
- Commands->Join_Conversation( STAR, hon_gdi_guy_conv1, false, false, false );
- Commands->Start_Conversation( hon_gdi_guy_conv1, hon_gdi_guy_conv1 );
-
- Commands->Monitor_Conversation( obj, hon_gdi_guy_conv1 );
- }
- }
-
- }
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- player_in_warroom = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- void Exited( GameObject * obj, GameObject * exiter )
- {
- if (exiter == STAR)
- {
- player_in_warroom = false;
- }
- }
- };
- DECLARE_SCRIPT(M01_Havoc_In_WarroomZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_PLAYER_IS_INSIDE_REFINERY_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Havoc_Out_WarroomZone_JDG, "")
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
- GameObject * HON_MonitorZone = Commands->Find_Object ( 124044 );
- if (HON_MonitorZone != NULL)
- {
- Commands->Send_Custom_Event( obj, HON_MonitorZone, 0, M01_PLAYER_IS_OUTSIDE_REFINERY_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_HON_WarroomController_JDG, "")//124044
- {
- int gdiGuy01_id;
- int gdiGuy02_id;
- bool player_in_warroom;
- bool scenario_over;
- int dead_soldier_tally;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(gdiGuy01_id, 1);
- SAVE_VARIABLE(gdiGuy02_id, 2);
- SAVE_VARIABLE(player_in_warroom, 3);
- SAVE_VARIABLE(scenario_over, 4);
- SAVE_VARIABLE(dead_soldier_tally, 5);
- }
- void Created( GameObject * obj )
- {
- gdiGuy01_id = 0;
- gdiGuy02_id = 0;
- player_in_warroom = false;
- scenario_over = false;
- dead_soldier_tally = 0;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (obj && type == 0)
- {
- if (param == M01_ROPE_IS_SENDING_ID_JDG)//gdi guy 01 is actually sending his id
- {
- gdiGuy01_id = Commands->Get_ID ( sender );
- }
- else if (param == M01_WAYPATH_IS_SENDING_ID_JDG)//gdi guy 02 is actually sending his id
- {
- gdiGuy02_id = Commands->Get_ID ( sender );
- }
- else if (param == M01_PLAYER_IS_INSIDE_REFINERY_JDG)//player is actually in warroom
- {
- player_in_warroom = true;
- }
- else if (param == M01_PLAYER_IS_OUTSIDE_REFINERY_JDG)//player just left the warroom
- {
- player_in_warroom = false;
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- dead_soldier_tally++;
- if (dead_soldier_tally == 2)
- {
- dead_soldier_tally = 0;
- GameObject * chinook_obj1 = Commands->Create_Object ( "Invisible_Object", Vector3(-147.1f, 558.8f, 4.4f));
- Commands->Set_Facing(chinook_obj1, -130.00f);
- Commands->Attach_Script(chinook_obj1, "Test_Cinematic", "X1I_GDI_HON_TroopDrop01a.txt");
- }
- }
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- GameObject * gdiGuy01 = Commands->Find_Object ( gdiGuy01_id );
- GameObject * gdiGuy02 = Commands->Find_Object ( gdiGuy02_id );
- if (enterer == gdiGuy01)
- {
- if (player_in_warroom == false)
- {
- Commands->Apply_Damage( gdiGuy01, 10000.0f, "STEEL");
- }
- else if (gdiGuy01 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy01, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- else if (enterer == gdiGuy02)
- {
- if (player_in_warroom == false)
- {
- Commands->Apply_Damage( gdiGuy02, 10000.0f, "STEEL");
- }
- else if (gdiGuy02 != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiGuy02, 0, M01_START_ACTING_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Medium_Tank01_JDG, "")
- {
- void Created( GameObject * obj )
- {
- GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
- if (hovercraftExplosionController != NULL)
- {
- Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_MEDIUM_TANK_IS_HERE_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_CantBring_MediumTank_ThroughHereZone_JDG, "")
- {
- bool player_in_tank;
- int tank_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(player_in_tank, 1);
- SAVE_VARIABLE(tank_id, 2);
- }
- void Created( GameObject * obj )
- {
- player_in_tank = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG )
- {
- player_in_tank = true;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG )
- {
- player_in_tank = false;
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG )//medium tank is sending his id
- {
- tank_id = Commands->Get_ID ( sender );
- }
- }
- }
- void Entered( GameObject * obj, GameObject * enterer )
- {
- GameObject * tank = Commands->Find_Object ( tank_id );
- if (enterer == tank)
- {
- if (player_in_tank == true)//M01_Must_Leave_Tank_Conversation
- {
- int hoofit_conv = Commands->Create_Conversation( "M01_Must_Leave_Tank_Conversation", 100, 100, true);
- Commands->Join_Conversation( NULL, hoofit_conv, true, true );
- Commands->Start_Conversation( hoofit_conv, hoofit_conv );
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Medium_Tank_JDG, "")
- {
- bool firstTimeEntered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(firstTimeEntered, 1);
- }
- void Created( GameObject * obj )
- {
- Commands->Create_Sound ( "m00evag_dsgn0009i1evag_snd", Vector3 (0,0,0), obj);
- firstTimeEntered = true;
- int m01_medium_tank_ID = Commands->Get_ID ( obj );
- GameObject * tunnelZone = Commands->Find_Object ( M01_TANK_TUNNEL_ZONE_ID );
- if (tunnelZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tunnelZone, M01_MEDIUM_TANK_IS_HERE_JDG, m01_medium_tank_ID, 0 );
- }
- GameObject * honSamSite = Commands->Find_Object ( M01_HON_SAM_SITE_JDG );
- if (honSamSite != NULL)
- {
- Commands->Send_Custom_Event( obj, honSamSite, M00_CUSTOM_SAM_SITE_IGNORE, m01_medium_tank_ID, 0 );
- }
- GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
- if (fodderHovercraftController != NULL)
- {
- Commands->Destroy_Object ( fodderHovercraftController );
- }
- GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
- if (tankReminderZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_START_ACTING_JDG, 0 );
- }
- GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
- if (tankBarrierZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender ) //
- {
- if (type == CUSTOM_EVENT_VEHICLE_ENTERED )
- {
- if (firstTimeEntered == true)
- {
- firstTimeEntered = false;
- Vector3 guy01Position (40.286f, 151.346f, 2.107f);
- Vector3 guy02Position (47.476f, 163.355f, 2.458f);
- Vector3 guy03Position (59.446f, 175.107f, -0.453f);
- GameObject * tunnelGuy01 = Commands->Create_Object ( "Nod_Minigunner_0", guy01Position );
- GameObject * tunnelGuy02 = Commands->Create_Object ( "Nod_Minigunner_0", guy02Position );
- GameObject * tunnelGuy03 = Commands->Create_Object ( "Nod_Minigunner_0", guy03Position );
- Commands->Attach_Script(tunnelGuy01, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
- Commands->Attach_Script(tunnelGuy02, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
- Commands->Attach_Script(tunnelGuy03, "M01_Medium_Tank_Tunnel_Squish_Guy_JDG", "");
- Commands->Action_Reset ( obj, 100 );
- }
- GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
- if (tankReminderZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
- if (tankBarrierZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
-
- }
- else if (type == CUSTOM_EVENT_VEHICLE_EXITED )
- {
- GameObject * tankReminderZone = Commands->Find_Object ( 122848 );
- if (tankReminderZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankReminderZone, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
- }
- GameObject * tankBarrierZone = Commands->Find_Object ( 125661 );
- if (tankBarrierZone != NULL)
- {
- Commands->Send_Custom_Event( obj, tankBarrierZone, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 0 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_TurretBeach_FodderHovercraft_Controller_JDG, "")//121630 M01_START_ACTING_JDG
- {
- int hovercraft_ID;
- bool hovercraftAlive;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(hovercraftAlive, 1);
- SAVE_VARIABLE(hovercraft_ID, 2);
- }
- void Created( GameObject * obj )
- {
- hovercraftAlive = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG && hovercraftAlive == false)//turret objective has been added--start bringing in hovercraft
- {
- GameObject * oldHovercraft = Commands->Find_Object ( hovercraft_ID );
- if (oldHovercraft == NULL)
- {
- hovercraftAlive = true;
- GameObject * hovercraft = Commands->Create_Object ( "Invisible_Object", Vector3 (0,0,0));
- Commands->Attach_Script(hovercraft, "Test_Cinematic", "X1D_FodderHover_MTank.txt");
- }
- else
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 5 );
- }
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- hovercraftAlive = false;
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 15 );
- }
- else if (param == 0)//hovercraft is sending you its ID
- {
- hovercraft_ID = Commands->Get_ID ( sender );
- hovercraftAlive = true;
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- if (turret01 != NULL)
- {
- Commands->Send_Custom_Event( obj, turret01, M01_FODDER_HOVERCRAFT_IS_HERE, hovercraft_ID, 1 );
- }
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret02 != NULL)
- {
- Commands->Send_Custom_Event( obj, turret02, M01_FODDER_HOVERCRAFT_IS_HERE, hovercraft_ID, 1 );
- }
- //Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 15 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Hovercraft_Explosion_Controller_JDG, "")//121839
- {
- int tank_id;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(tank_id, 1);
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_MEDIUM_TANK_IS_HERE_JDG)//medium tank is sending its id
- {
- tank_id = Commands->Get_ID ( sender );
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)//hovercraft has been destroyed--delete tank and play explosion
- {
- GameObject * mediumTank = Commands->Find_Object ( tank_id );
- if (mediumTank != NULL)
- {
- //Commands->Destroy_Object ( mediumTank );
- Commands->Apply_Damage( mediumTank, 100000, "Steel", NULL );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_FodderHovercraft_Script_JDG, "")
- {
- void Created( GameObject * obj )
- {
- GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
- if (fodderHovercraftController != NULL)
- {
- Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, 0, 0 );
- }
- //GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
- //if (hovercraftExplosionController != NULL)
- //{
- // Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_CHOPPER_IS_SENDING_ID_JDG, 0 );
- //}
-
- float delayTimer = Commands->Get_Random ( 5, 8 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, delayTimer );
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- //GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- //GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- //if ((damager == turret01) || (damager == turret02))
- //{
- // Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
- //}
- }
- void Killed( GameObject * obj, GameObject * killer )
- {
- //Vector3 myPosition = Commands->Get_Position ( obj );
- //Commands->Create_Explosion ( "Ground Explosions Twiddler", myPosition, NULL );
- GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
- if (fodderHovercraftController != NULL)
- {
- Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- //GameObject * fodderHovercraftController = Commands->Find_Object ( 121630 );
- //if (fodderHovercraftController != NULL)
- //{
- // Commands->Send_Custom_Event( obj, fodderHovercraftController, 0, M01_START_ACTING_JDG, 5 );
- //}
- GameObject * hovercraftExplosionController = Commands->Find_Object ( 121839 );
- if (hovercraftExplosionController != NULL)
- {
- Commands->Send_Custom_Event( obj, hovercraftExplosionController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_START_ACTING_JDG)
- {
- GameObject * turret01 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_01_ID );
- GameObject * turret02 = Commands->Find_Object ( M01_TURRETBEACH_TURRET_02_ID );
- if (turret01 != NULL)
- {
- Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
- }
- else if (turret02 != NULL)
- {
- Commands->Apply_Damage( obj, 100000, "STEEL", NULL );
- }
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Beach_Datadisc_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the GDI base
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- Commands->Clear_Map_Cell ( 10, 15 );
- Commands->Clear_Map_Cell ( 10, 16 );
- Commands->Clear_Map_Cell ( 10, 17 );
- Commands->Clear_Map_Cell ( 10, 18 );
- Commands->Clear_Map_Cell ( 10, 19 );
- Commands->Clear_Map_Cell ( 10, 20 );
- Commands->Clear_Map_Cell ( 11, 15 );
- Commands->Clear_Map_Cell ( 11, 16 );
- Commands->Clear_Map_Cell ( 11, 17 );
- Commands->Clear_Map_Cell ( 11, 18 );
- Commands->Clear_Map_Cell ( 11, 19 );
- Commands->Clear_Map_Cell ( 11, 20 );
- Commands->Clear_Map_Cell ( 12, 15 );
- Commands->Clear_Map_Cell ( 12, 16 );
- Commands->Clear_Map_Cell ( 12, 17 );
- Commands->Clear_Map_Cell ( 12, 18 );
- Commands->Clear_Map_Cell ( 12, 19 );
- Commands->Clear_Map_Cell ( 12, 20 );
- Commands->Clear_Map_Cell ( 13, 15 );
- Commands->Clear_Map_Cell ( 13, 16 );
- Commands->Clear_Map_Cell ( 13, 17 );
- Commands->Clear_Map_Cell ( 13, 18 );
- Commands->Clear_Map_Cell ( 13, 19 );
- Commands->Clear_Map_Cell ( 13, 20 );
- Commands->Clear_Map_Cell ( 14, 15 );
- Commands->Clear_Map_Cell ( 14, 16 );
- Commands->Clear_Map_Cell ( 14, 17 );
- Commands->Clear_Map_Cell ( 14, 18 );
- Commands->Clear_Map_Cell ( 14, 19 );
- Commands->Clear_Map_Cell ( 14, 20 );
- }
- }
- };
- DECLARE_SCRIPT(M01_TibCave01_Datadisc_JDG, "")//shows the barn area
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- Commands->Clear_Map_Cell ( 6, 13 );
- Commands->Clear_Map_Cell ( 6, 14 );
- Commands->Clear_Map_Cell ( 7, 11 );
- Commands->Clear_Map_Cell ( 7, 12 );
- Commands->Clear_Map_Cell ( 7, 13 );
- Commands->Clear_Map_Cell ( 7, 14 );
- Commands->Clear_Map_Cell ( 7, 15 );
- Commands->Clear_Map_Cell ( 8, 11 );
- Commands->Clear_Map_Cell ( 8, 12 );
- Commands->Clear_Map_Cell ( 8, 13 );
- Commands->Clear_Map_Cell ( 8, 14 );
- Commands->Clear_Map_Cell ( 8, 15 );
- Commands->Clear_Map_Cell ( 9, 11 );
- Commands->Clear_Map_Cell ( 9, 12 );
- Commands->Clear_Map_Cell ( 9, 13 );
- Commands->Clear_Map_Cell ( 9, 14 );
- Commands->Clear_Map_Cell ( 9, 15 );
- Commands->Clear_Map_Cell ( 10, 11 );
- Commands->Clear_Map_Cell ( 10, 12 );
- Commands->Clear_Map_Cell ( 10, 13 );
- Commands->Clear_Map_Cell ( 10, 14 );
- Commands->Clear_Map_Cell ( 10, 15 );
- Commands->Clear_Map_Cell ( 11, 12 );
- Commands->Clear_Map_Cell ( 11, 13 );
- Commands->Clear_Map_Cell ( 11, 14 );
- Commands->Clear_Map_Cell ( 11, 15 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Shed_Datadisc_JDG, "")//shows the light tank area
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- Commands->Clear_Map_Cell ( 9, 9 );
- Commands->Clear_Map_Cell ( 9, 10 );
- Commands->Clear_Map_Cell ( 10, 9 );
- Commands->Clear_Map_Cell ( 10, 10 );
- Commands->Clear_Map_Cell ( 10, 11 );
- Commands->Clear_Map_Cell ( 11, 9 );
- Commands->Clear_Map_Cell ( 11, 10 );
- Commands->Clear_Map_Cell ( 11, 11 );
- Commands->Clear_Map_Cell ( 11, 12 );
- Commands->Clear_Map_Cell ( 12, 9 );
- Commands->Clear_Map_Cell ( 12, 10 );
- Commands->Clear_Map_Cell ( 12, 11 );
- Commands->Clear_Map_Cell ( 12, 12 );
- Commands->Clear_Map_Cell ( 13, 9 );
- Commands->Clear_Map_Cell ( 13, 10 );
- Commands->Clear_Map_Cell ( 13, 11 );
- Commands->Clear_Map_Cell ( 13, 12 );
- Commands->Clear_Map_Cell ( 14, 10 );
- Commands->Clear_Map_Cell ( 14, 11 );
- Commands->Clear_Map_Cell ( 14, 12 );
- }
- }
- };
- DECLARE_SCRIPT(M01_TibCave02_Datadisc_JDG, "")//tib cave no
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the church and tib field
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- Commands->Clear_Map_Cell ( 6, 5 );
- Commands->Clear_Map_Cell ( 6, 6 );
- Commands->Clear_Map_Cell ( 6, 7 );
- Commands->Clear_Map_Cell ( 6, 8 );
- Commands->Clear_Map_Cell ( 6, 9 );
- Commands->Clear_Map_Cell ( 7, 5 );
- Commands->Clear_Map_Cell ( 7, 6 );
- Commands->Clear_Map_Cell ( 7, 7 );
- Commands->Clear_Map_Cell ( 7, 8 );
- Commands->Clear_Map_Cell ( 7, 9 );
- Commands->Clear_Map_Cell ( 8, 5 );
- Commands->Clear_Map_Cell ( 8, 6 );
- Commands->Clear_Map_Cell ( 8, 7 );
- Commands->Clear_Map_Cell ( 8, 8 );
- Commands->Clear_Map_Cell ( 8, 9 );
- Commands->Clear_Map_Cell ( 9, 5 );
- Commands->Clear_Map_Cell ( 9, 6 );
- Commands->Clear_Map_Cell ( 9, 7 );
- Commands->Clear_Map_Cell ( 9, 8 );
- Commands->Clear_Map_Cell ( 9, 9 );
- Commands->Clear_Map_Cell ( 10, 5 );
- Commands->Clear_Map_Cell ( 10, 6 );
- Commands->Clear_Map_Cell ( 10, 7 );
- Commands->Clear_Map_Cell ( 10, 8 );
- Commands->Clear_Map_Cell ( 10, 9 );
- Commands->Clear_Map_Cell ( 11, 6 );
- Commands->Clear_Map_Cell ( 11, 7 );
- Commands->Clear_Map_Cell ( 11, 8 );
- Commands->Clear_Map_Cell ( 11, 9 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Priest_Datadisc_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED ) //shows the hand of nod
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- Commands->Clear_Map_Cell ( 5, 1 );
- Commands->Clear_Map_Cell ( 5, 2 );
- Commands->Clear_Map_Cell ( 5, 3 );
- Commands->Clear_Map_Cell ( 5, 4 );
- Commands->Clear_Map_Cell ( 5, 5 );
- Commands->Clear_Map_Cell ( 6, 1 );
- Commands->Clear_Map_Cell ( 6, 2 );
- Commands->Clear_Map_Cell ( 6, 3 );
- Commands->Clear_Map_Cell ( 6, 4 );
- Commands->Clear_Map_Cell ( 6, 5 );
- Commands->Clear_Map_Cell ( 7, 1 );
- Commands->Clear_Map_Cell ( 7, 2 );
- Commands->Clear_Map_Cell ( 7, 3 );
- Commands->Clear_Map_Cell ( 7, 4 );
- Commands->Clear_Map_Cell ( 7, 5 );
- Commands->Clear_Map_Cell ( 8, 1 );
- Commands->Clear_Map_Cell ( 8, 2 );
- Commands->Clear_Map_Cell ( 8, 3 );
- Commands->Clear_Map_Cell ( 8, 4 );
- Commands->Clear_Map_Cell ( 8, 5 );
- Commands->Clear_Map_Cell ( 9, 1 );
- Commands->Clear_Map_Cell ( 9, 2 );
- Commands->Clear_Map_Cell ( 9, 3 );
- Commands->Clear_Map_Cell ( 9, 4 );
- Commands->Clear_Map_Cell ( 9, 5 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Medlab_Datadisc_JDG, "")
- {
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == CUSTOM_EVENT_POWERUP_GRANTED )
- {
- Commands->Set_HUD_Help_Text (IDS_M00EVAG_DSGN0103I1EVAG_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY);
- Commands->Reveal_Map ( );
- GameObject * dataDiskController = Commands->Find_Object ( 117188 );
- if (dataDiskController != NULL)
- {
- Commands->Send_Custom_Event( obj, dataDiskController, 0, 10, 2 );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_DataDisc_TextController_JDG, "")//117188
- {
- bool playingText;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(playingText, 1);
- }
- void Created( GameObject * obj )
- {
- playingText = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if ( type == 0 )
- {
- if (param == 10)//now show the text message for ESC key
- {
- playingText = true;
- int pressEnterConv = Commands->Create_Conversation( "M01_Press_ESC_for_Map_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressEnterConv, false, false );
- Commands->Start_Conversation( pressEnterConv, pressEnterConv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0517I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Send_Custom_Event( obj, obj, 0, 11, 2 );
- }
- else if (param == 11)
- {
- playingText = false;
- }
- }
- else if (type == 1)
- {
- if (param == 1 && playingText == false)//player has picked up a C4 -- start text routine
- {
- int pressF1Conv = Commands->Create_Conversation( "M01_C4_Tutorial_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressF1Conv, false, false );
- Commands->Start_Conversation( pressF1Conv, pressF1Conv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0519I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Press '9' to select Remote C4.\n
- Commands->Send_Custom_Event( obj, obj, 1, 2, 2 );
- playingText = true;
- }
- else if (param == 2)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0523I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Left-click your mouse to place C4.\n
- Commands->Send_Custom_Event( obj, obj, 1, 3, 2 );
- }
- else if (param == 3)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0524I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Right-click your mouse to detonate.\n
- Commands->Send_Custom_Event( obj, obj, 1, 4, 2 );
- }
- else if (param == 4)
- {
- playingText = false;
- }
- }
- else if (type == 2)//player has picked up sniper rifle
- {
- if (param == 1 && playingText == false)//player has picked up a C4 -- start text routine
- {
- int pressF1Conv = Commands->Create_Conversation( "M01_Sniper_Tutorial_Conversation", 100, 1000, true);
- Commands->Join_Conversation( NULL, pressF1Conv, false, false );
- Commands->Start_Conversation( pressF1Conv, pressF1Conv );
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0518I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Press '3' to select your Sniper Rifle.\n
- Commands->Send_Custom_Event( obj, obj, 2, 2, 2 );
- playingText = true;
- }
- else if (param == 2)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0521I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Right-click your mouse for sniper mode.\n
- Commands->Send_Custom_Event( obj, obj, 2, 3, 2 );
- }
- else if (param == 3)
- {
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0522I1DSGN_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );//Use the mouse wheel or 'G' and 'T' to zoom.\n
- Commands->Send_Custom_Event( obj, obj, 2, 4, 2 );
- }
- else if (param == 4)
- {
- playingText = false;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Duncan_Assailer_JDG, "")
- {
- void Killed( GameObject * obj, GameObject * killer )
- {
- GameObject * convController = Commands->Find_Object ( 125857 );
- if (convController != NULL)
- {
- Commands->Send_Custom_Event( obj, convController, 0, M01_IVE_BEEN_KILLED_JDG, 0 );
- }
- }
- };
- DECLARE_SCRIPT(M01_Duncan_InHere_ConvController_JDG, "")
- {
- int deadNodGuys;
- bool duncanDiscovered;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(deadNodGuys, 1);
- SAVE_VARIABLE(duncanDiscovered, 2);
- }
- void Created( GameObject * obj )
- {
- deadNodGuys = 0;
- duncanDiscovered = false;
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- deadNodGuys++;
- if (deadNodGuys >= 4)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 2 );
- }
- }
- else if (param == M01_START_ACTING_JDG && duncanDiscovered == false)//start playing "in here" conversation
- {
- GameObject * captDuncan = Commands->Find_Object ( 106050 );
- if (captDuncan)
- {
- int inhere_conv = Commands->Create_Conversation( "M01_DuncanInHere_Conversation", 100, 20, false);
- Commands->Join_Conversation( captDuncan, inhere_conv, false, true, true );
- Commands->Join_Conversation( STAR, inhere_conv, false, false, false );
- Commands->Start_Conversation( inhere_conv, inhere_conv );
- Commands->Send_Custom_Event( obj, obj, 0, M01_START_ACTING_JDG, 10 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- duncanDiscovered = true;
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_BackPath_EntranceZone_JDG, "")//121433
- {
- void Entered( GameObject * obj, GameObject * enterer )
- {
- if (enterer == STAR)
- {
-
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)
- {
- GameObject * gdiMinigunner = Commands->Find_Object ( 116382 );
- if (gdiMinigunner != NULL)
- {
- Commands->Send_Custom_Event( obj, gdiMinigunner, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0 );
- //this tells him to start the "this is the path" routine
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 2 );
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)
- {
- GameObject * grenadier = Commands->Find_Object ( 116383 );
- if (grenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, grenadier, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0 );//tell grenadier to go down back path too
- }
- Commands->Destroy_Object ( obj );
- }
- }
- }
- };
- DECLARE_SCRIPT(M01_Base_GDI_Minigunner_JDG, "")//116382
- {
- int gdi01conv01;
- int gdi01conv02;
- int gdi01conv03;
- float currentHealth;
- bool invincible;
- bool ducanRescued;
- bool headingDownBackPath;
- bool still_in_GDI_Base;
- bool damagedByNod;
- bool havocDownPath;
- REGISTER_VARIABLES()
- {
- SAVE_VARIABLE(gdi01conv01, 1);
- SAVE_VARIABLE(gdi01conv02, 2);
- SAVE_VARIABLE(currentHealth, 3);
- SAVE_VARIABLE(invincible, 4);
- SAVE_VARIABLE(gdi01conv03, 5);
- SAVE_VARIABLE(ducanRescued, 6);
- SAVE_VARIABLE(headingDownBackPath, 7);
- SAVE_VARIABLE(still_in_GDI_Base, 8);
- SAVE_VARIABLE(damagedByNod, 9);
- SAVE_VARIABLE(havocDownPath, 10);
- }
- void Created( GameObject * obj ) //this guy starts in the guard tower firing over at the conyard
- {
- havocDownPath = false;
- damagedByNod = false;
- invincible = true;
- ducanRescued = false;
- still_in_GDI_Base = true;
- headingDownBackPath = false;
- currentHealth = Commands->Get_Health ( obj );
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(0,0,0));
- Commands->Attach_Script(controller1, "Test_Cinematic", "X1C_Intro.txt");
- Vector3 myTarget (72.223f, -24.751f, -0.296f);
- ActionParamsStruct params;
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_JDG, 2 );//in 2 seconds run to a new position
- }
- void Animation_Complete(GameObject * obj, const char *anim)
- {
- if (stricmp(anim, "S_A_Human.XG_EV5_troop") == 0)
- {
- Commands->Destroy_Object ( obj );
- }
- }
- void Damaged( GameObject * obj, GameObject * damager, float amount )
- {
- GameObject * grenadier = Commands->Find_Object ( 116383 );
- GameObject * nodGuy01 = Commands->Find_Object ( 116388 );
- GameObject * nodGuy02 = Commands->Find_Object ( 116387 );
- if (damager == nodGuy01 || damager == nodGuy02)
- {
- if (damagedByNod == false)
- {
- damagedByNod = true;
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
- }
- }
- if (invincible == true)
- {
- float myCurrentHealth = Commands->Get_Health ( obj );
- if (myCurrentHealth <= 10)
- {
- Commands->Set_Health ( obj, 10 );
- }
- }
- else if (obj && damager == grenadier)
- {
- Commands->Set_Health ( obj, currentHealth );
- }
- else if (obj)
- {
- currentHealth = Commands->Get_Health ( obj );
- }
- }
- void Custom( GameObject * obj, int type, int param, GameObject * sender )
- {
- ActionParamsStruct params;
- if (type == 0)
- {
- if (param == M01_MODIFY_YOUR_ACTION_JDG)//leave the guard tower and take up second position outside guard tower
- {
- Vector3 newPosition (66.771f, -38.435f, -0.058f);
- Vector3 myTarget (72.223f, -24.751f, -0.296f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_01_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.Set_Movement(newPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(-74.184f, -28.372f, 3.157f));
- Commands->Set_Facing ( controller1, 90 );
- Commands->Attach_Script(controller1, "Test_Cinematic", "X01D_C130Troopdrop.txt");
- }
- else if (param == M01_MODIFY_YOUR_ACTION_02_JDG)//leave outside guard tower and take up third position beside the ladder
- {
- Vector3 newPosition (40.893f, -39.773f, -0.179f);
- Vector3 myTarget (28.449f, -23.325f, 3.032f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_02_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.Set_Movement(newPosition, RUN + 0.25f, 1);
- Commands->Action_Goto ( obj, params );
- }
- else if (param == M01_START_ATTACKING_01_JDG)//player is at top of ladders...check if nod minigunner is still alive
- {
- GameObject *controller1 = Commands->Create_Object("Invisible_Object", Vector3(34.165f,41.909f,-10));
- Commands->Attach_Script(controller1, "Test_Cinematic", "XG_Ap_vs_Trn.txt");
- GameObject * nodMinigunner = Commands->Find_Object ( 116384 );
- if (nodMinigunner != NULL)
- {
- Vector3 newPosition (40.893f, -39.773f, -0.179f);
- params.Set_Basic( this, 100, M01_START_ATTACKING_01_JDG );
- params.Set_Movement(newPosition, RUN + 0.25f, 1);
- params.Set_Attack( nodMinigunner, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else
- {
- Commands->Action_Reset ( obj, 100 );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );//look at havoc
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_03_JDG)//greet havoc M01_GDI01_Conversation_01
- {
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Face_Location( playersPosition, 2 );
- Commands->Action_Face_Location ( obj, params );
- gdi01conv01 = Commands->Create_Conversation( "M01_GDI01_Conversation_01", 100, 1000, false);
- Commands->Join_Conversation( obj, gdi01conv01, true, true, true );
- Commands->Join_Conversation( STAR, gdi01conv01, false, false, false );
- Commands->Start_Conversation( gdi01conv01, gdi01conv01 );
- Commands->Monitor_Conversation( obj, gdi01conv01 );
- GameObject * grenadier = Commands->Find_Object ( 116383 );
- if (grenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, grenadier, 0, M01_START_ACTING_JDG, 0 );//tell grenadier to greet havoc
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_04_JDG)//now add the pow objective
- {
- GameObject * pogController = Commands->Find_Object ( M01_MISSION_POG_CONTROLLER_JDG );
- if (pogController != NULL)
- {
- Commands->Send_Custom_Event ( obj, pogController, M01_ADD_OBJECTIVE_POG_JDG, M01_GDI_BASE_POW_OBJECTIVE_JDG, 0 );
- }
- }
- else if (param == M01_GOTO_YOUR_EVAC_SPOT_JDG)
- {
- Commands->Enable_Hibernation( obj, false );
- ducanRescued = true;
- headingDownBackPath = false;
- Commands->Action_Reset ( obj, 100 );
- Vector3 myHomeSpot (56.0f, 28.2f, -0.2f);
- Commands->Set_Innate_Soldier_Home_Location ( obj, myHomeSpot, 10 );
- params.Set_Basic( this, 100, M01_GOTO_YOUR_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- else if (param == M01_GOING_TO_EVAC_SPOT_JDG)//your ride is here--go get in
- {
- Commands->Action_Reset ( obj, 100 );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)
- {
- Commands->Set_Innate_Is_Stationary ( obj, false );
- Vector3 myHomeSpot = Commands->Get_Position ( myEvacController );
- params.Set_Basic( this, 100, M01_GOING_TO_EVAC_SPOT_JDG );
- params.Set_Movement(myHomeSpot, RUN, 1);
- Commands->Action_Goto(obj, params);
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_05_JDG && headingDownBackPath == false)//POW conversation is over---wave at havoc
- {
- if (havocDownPath == false)
- {
- Vector3 playersPosition = Commands->Get_Position ( STAR );
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Face_Location( playersPosition, 2 );
- Commands->Action_Face_Location ( obj, params );
- gdi01conv03 = Commands->Create_Conversation( "M01_GDI01_Conversation_05", 100, 1000, false);
- Commands->Join_Conversation( obj, gdi01conv03, true, true, true );
- Commands->Join_Conversation( STAR, gdi01conv03, false, false, false );
- Commands->Start_Conversation( gdi01conv03, gdi01conv03 );
- Commands->Monitor_Conversation( obj, gdi01conv03 );//M01_MODIFY_YOUR_ACTION_06_JDG
- }
- else
- {
- still_in_GDI_Base = false;
- Commands->Action_Reset ( obj, 100 );
- headingDownBackPath = true;
- Vector3 newGotoSpot (95.229f, 101.136f, 8.934f);
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(newGotoSpot, RUN, 1);
- params.AttackActive = false;
- Commands->Action_Attack (obj, params);
- }
- }
- else if (param == M01_MODIFY_YOUR_ACTION_06_JDG && ducanRescued == false)//Head down the path
- {
- havocDownPath = true;
-
- //Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_06_JDG, 0.25f );
- }
- else if (param == M01_IVE_BEEN_KILLED_JDG)
- {
- if (still_in_GDI_Base == true)
- {
- invincible = false;
- Commands->Apply_Damage( obj, 100000, "Steel", NULL );
- }
- }
- else if (param == M01_WALKING_WAYPATH_04_JDG)
- {
- GameObject * nodguy01 = Commands->Find_Object ( 116388 );
- if (nodguy01 != NULL)
- {
- Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- params.Set_Attack( nodguy01, 50, 2, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else
- {
- Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_04_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- //params.Set_Attack( nodguy01, 50, 2, true );
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- }
- }
- }
- void Enemy_Seen( GameObject * obj, GameObject * enemy )
- {
- if (headingDownBackPath == true)
- {
- ActionParamsStruct params;
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(enemy, WALK, 5);
- params.Set_Attack( enemy, 1000, 0, true );
- params.AttackActive = true;
- Commands->Modify_Action ( obj, M01_WALKING_WAYPATH_06_JDG, params, true, true );
- }
- }
- void Action_Complete( GameObject * obj, int action_id, ActionCompleteReason complete_reason )
- {
- ActionParamsStruct params;
- if (complete_reason == ACTION_COMPLETE_NORMAL)
- {
- if (action_id == M01_WALKING_WAYPATH_01_JDG)
- {
- Vector3 myTarget (72.223f, -24.751f, -0.296f);
-
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_02_JDG, 2 );
- }
- else if (action_id == M01_WALKING_WAYPATH_02_JDG)
- {
- Vector3 myTarget (28.449f, -23.325f, 3.032f);
-
- Commands->Set_Innate_Is_Stationary ( obj, true );
- params.Set_Basic( this, 100, M01_START_ACTING_JDG );
- params.Set_Attack( myTarget, 1000, 0, true );
- params.AttackCrouched = true;
- params.AttackCheckBlocked = false;
- Commands->Action_Attack (obj, params);
- }
- else if (action_id == M01_START_ATTACKING_01_JDG)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );
- }
- else if (action_id == M01_GOTO_YOUR_EVAC_SPOT_JDG)
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to call in a chopper
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_MODIFY_YOUR_ACTION_JDG, 0 );
- }
- }
- else if (action_id == M01_GOING_TO_EVAC_SPOT_JDG)//start load animation here
- {
- Vector3 powerupSpawnLocation = Commands->Get_Position (obj );
- powerupSpawnLocation.Z += 0.75f;
- char *powerups[2] =
- {//this is a list of potential powerups to be dropped by sniper target guys
- "POW_Health_100",
- "POW_Armor_100",
- };
- int random = Commands->Get_Random_Int(0, 2);
- Commands->Create_Object ( powerups[random], powerupSpawnLocation );
- GameObject * myEvacController = Commands->Find_Object ( 106694 );
- if (myEvacController != NULL)//tell controller to spawn a rope
- {
- Commands->Send_Custom_Event( obj, myEvacController, 0, M01_GIVE_ME_A_ROPE_JDG, 0 );
- }
- }
- else if (action_id == M01_WALKING_WAYPATH_03_JDG)//you are by pows now...run to path entrance and attack nod guy 01 if still alive
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_WALKING_WAYPATH_04_JDG, 0 );
- }
- else if (action_id == M01_WALKING_WAYPATH_04_JDG)//Youre target is dead....make sure you goto path entrance.
- {
- Vector3 myNewSpot (58.784f, 55.223f, -0.551f);
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_05_JDG );
- params.Set_Movement(myNewSpot, RUN, 1);
- Commands->Action_Goto (obj, params);
- }
- else if (action_id == M01_WALKING_WAYPATH_05_JDG)//Youre at the back path entrance now....goto stationary
- {
- Commands->Set_Innate_Is_Stationary ( obj, true );
- }
- else if (action_id == M01_WALKING_WAYPATH_06_JDG)//you just killed a back path guy...continue your journey
- {
- Vector3 newGotoSpot (95.229f, 101.136f, 8.934f);
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_06_JDG );
- params.Set_Movement(newGotoSpot, RUN, 1);
- params.AttackActive = false;
- Commands->Action_Attack (obj, params);
- }
- }
- else if (complete_reason == ACTION_COMPLETE_CONVERSATION_ENDED)
- {
- if (action_id == gdi01conv01)
- {
- gdi01conv02 = Commands->Create_Conversation( "M01_GDI01_Conversation_02", 100, 1000, false);
- Commands->Join_Conversation( obj, gdi01conv02, true, true, true );
- Commands->Join_Conversation( STAR, gdi01conv02, false, false, false );
- Commands->Start_Conversation( gdi01conv02, gdi01conv02 );
- Commands->Monitor_Conversation( obj, gdi01conv02 );
-
- }
- else if (action_id == gdi01conv02)
- {
- //invincible = false;
- Commands->Set_HUD_Help_Text ( IDS_M01DSGN_DSGN0506I1GCP1_TXT, TEXT_COLOR_OBJECTIVE_PRIMARY );
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_04_JDG, 2 );
- Vector3 newPosition (31.697f, 16.155f, 2.200f);
- Commands->Set_Innate_Is_Stationary ( obj, false );
- params.Set_Basic( this, 100, M01_WALKING_WAYPATH_03_JDG );
- params.Set_Movement(newPosition, RUN, 1);
- Commands->Action_Goto ( obj, params );
- GameObject * grenadier = Commands->Find_Object ( 116383 );
- if (grenadier != NULL)
- {
- Commands->Send_Custom_Event( obj, grenadier, 0, M01_MODIFY_YOUR_ACTION_03_JDG, 0 );//tell grenadier to greet havoc
- }
- }
- else if (action_id == gdi01conv03)
- {
- Commands->Send_Custom_Event( obj, obj, 0, M01_MODIFY_YOUR_ACTION_05_JDG, 5 );
- }
- }
- }
- };
|