//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//==============================================================================
// OIDs -- OrderIDs by Cohadar -- v1.0
//==============================================================================
//
// PURPOUSE:
// * Just a bounch of usefull constants
// * I guess the most common use would be ordering a dummy caster
//
// THANKS TO: ???
// * I totally stole these constants from someones .xls file.
// * Unfortunately I forgot whose file it was (probably PipeDream or PitzerMike)
//
// * If someone finds an order not mentioned here please let me know so I can add it.
//
// HOW TO IMPORT:
// * Just create a trigger named OIDs
// * then convert it to text and replace the whole trigger text with this one
//
//==============================================================================
globals
constant integer OID_absorb = 852529
constant integer OID_acolyteharvest = 852185
constant integer OID_AImove = 851988
constant integer OID_ambush = 852131
constant integer OID_ancestralspirit = 852490
constant integer OID_ancestralspirittarget = 852491
constant integer OID_animatedead = 852217
constant integer OID_antimagicshell = 852186
constant integer OID_attack = 851983
constant integer OID_attackground = 851984
constant integer OID_attackonce = 851985
constant integer OID_attributemodskill = 852576
constant integer OID_auraunholy = 852215
constant integer OID_auravampiric = 852216
constant integer OID_autodispel = 852132
constant integer OID_autodispeloff = 852134
constant integer OID_autodispelon = 852133
constant integer OID_autoentangle = 852505
constant integer OID_autoentangleinstant = 852506
constant integer OID_autoharvestgold = 852021
constant integer OID_autoharvestlumber = 852022
constant integer OID_avatar = 852086
constant integer OID_avengerform = 852531
constant integer OID_awaken = 852466
constant integer OID_banish = 852486
constant integer OID_barkskin = 852135
constant integer OID_barkskinoff = 852137
constant integer OID_barkskinon = 852136
constant integer OID_battleroar = 852599
constant integer OID_battlestations = 852099
constant integer OID_bearform = 852138
constant integer OID_berserk = 852100
constant integer OID_blackarrow = 852577
constant integer OID_blackarrowoff = 852579
constant integer OID_blackarrowon = 852578
constant integer OID_blight = 852187
constant integer OID_blink = 852525
constant integer OID_blizzard = 852089
constant integer OID_bloodlust = 852101
constant integer OID_bloodlustoff = 852103
constant integer OID_bloodluston = 852102
constant integer OID_board = 852043
constant integer OID_breathoffire = 852580
constant integer OID_breathoffrost = 852560
constant integer OID_build = 851994
constant integer OID_burrow = 852533
constant integer OID_cannibalize = 852188
constant integer OID_carrionscarabs = 852551
constant integer OID_carrionscarabsinstant = 852554
constant integer OID_carrionscarabsoff = 852553
constant integer OID_carrionscarabson = 852552
constant integer OID_carrionswarm = 852218
constant integer OID_chainlightning = 852119
constant integer OID_channel = 852600
constant integer OID_charm = 852581
constant integer OID_cloudoffog = 852473
constant integer OID_clusterrockets = 852652
constant integer OID_coldarrows = 852244
constant integer OID_coldarrowstarg = 852243
constant integer OID_controlmagic = 852474
constant integer OID_corporealform = 852493
constant integer OID_corrosivebreath = 852140
constant integer OID_coupleinstant = 852508
constant integer OID_coupletarget = 852507
constant integer OID_creepanimatedead = 852246
constant integer OID_creepdevour = 852247
constant integer OID_creepheal = 852248
constant integer OID_creephealoff = 852250
constant integer OID_creephealon = 852249
constant integer OID_creepthunderbolt = 852252
constant integer OID_creepthunderclap = 852253
constant integer OID_cripple = 852189
constant integer OID_curse = 852190
constant integer OID_curseoff = 852192
constant integer OID_curseon = 852191
constant integer OID_cyclone = 852144
constant integer OID_darkconversion = 852228
constant integer OID_darkportal = 852229
constant integer OID_darkritual = 852219
constant integer OID_darksummoning = 852220
constant integer OID_deathanddecay = 852221
constant integer OID_deathcoil = 852222
constant integer OID_deathpact = 852223
constant integer OID_decouple = 852509
constant integer OID_defend = 852055
constant integer OID_detectaoe = 852015
constant integer OID_detonate = 852145
constant integer OID_devour = 852104
constant integer OID_devourmagic = 852536
constant integer OID_disassociate = 852240
constant integer OID_disenchant = 852495
constant integer OID_dismount = 852470
constant integer OID_dispel = 852057
constant integer OID_divineshield = 852090
constant integer OID_doom = 852583
constant integer OID_drain = 852487
constant integer OID_dreadlordinferno = 852224
constant integer OID_dropitem = 852001
constant integer OID_drunkenhaze = 852585
constant integer OID_earthquake = 852121
constant integer OID_eattree = 852146
constant integer OID_elementalfury = 852586
constant integer OID_ensnare = 852106
constant integer OID_ensnareoff = 852108
constant integer OID_ensnareon = 852107
constant integer OID_entangle = 852147
constant integer OID_entangleinstant = 852148
constant integer OID_entanglingroots = 852171
constant integer OID_etherealform = 852496
constant integer OID_evileye = 852105
constant integer OID_faeriefire = 852149
constant integer OID_faeriefireoff = 852151
constant integer OID_faeriefireon = 852150
constant integer OID_fanofknives = 852526
constant integer OID_farsight = 852122
constant integer OID_fingerofdeath = 852230
constant integer OID_firebolt = 852231
constant integer OID_flamestrike = 852488
constant integer OID_flamingarrows = 852174
constant integer OID_flamingarrowstarg = 852173
constant integer OID_flamingattack = 852540
constant integer OID_flamingattacktarg = 852539
constant integer OID_flare = 852060
constant integer OID_forceboard = 852044
constant integer OID_forceofnature = 852176
constant integer OID_forkedlightning = 852587
constant integer OID_freezingbreath = 852195
constant integer OID_frenzy = 852561
constant integer OID_frenzyoff = 852563
constant integer OID_frenzyon = 852562
constant integer OID_frostarmor = 852225
constant integer OID_frostarmoroff = 852459
constant integer OID_frostarmoron = 852458
constant integer OID_frostnova = 852226
constant integer OID_getitem = 851981
constant integer OID_gold2lumber = 852233
constant integer OID_grabtree = 852511
constant integer OID_harvest = 852018
constant integer OID_heal = 852063
constant integer OID_healingward = 852109
constant integer OID_healingwave = 852501
constant integer OID_healoff = 852065
constant integer OID_healon = 852064
constant integer OID_hex = 852502
constant integer OID_holdposition = 851993
constant integer OID_holybolt = 852092
constant integer OID_howlofterror = 852588
constant integer OID_humanbuild = 851995
constant integer OID_immolation = 852177
constant integer OID_impale = 852555
constant integer OID_inferno = 852232
constant integer OID_innerfire = 852066
constant integer OID_innerfireoff = 852068
constant integer OID_innerfireon = 852067
constant integer OID_instant = 852200
constant integer OID_invisibility = 852069
constant integer OID_lightningshield = 852110
constant integer OID_load = 852046
constant integer OID_loadarcher = 852142
constant integer OID_loadcorpse = 852050
constant integer OID_loadcorpseinstant = 852053
constant integer OID_locustswarm = 852556
constant integer OID_lumber2gold = 852234
constant integer OID_magicdefense = 852478
constant integer OID_magicleash = 852480
constant integer OID_magicundefense = 852479
constant integer OID_manaburn = 852179
constant integer OID_manaflareoff = 852513
constant integer OID_manaflareon = 852512
constant integer OID_manashieldoff = 852590
constant integer OID_manashieldon = 852589
constant integer OID_massteleport = 852093
constant integer OID_mechanicalcritter = 852564
constant integer OID_metamorphosis = 852180
constant integer OID_militia = 852072
constant integer OID_militiaconvert = 852071
constant integer OID_militiaoff = 852073
constant integer OID_militiaunconvert = 852651
constant integer OID_mindrot = 852565
constant integer OID_mirrorimage = 852123
constant integer OID_monsoon = 852591
constant integer OID_mount = 852469
constant integer OID_mounthippogryph = 852143
constant integer OID_move = 851986
constant integer OID_nagabuild = 852467
constant integer OID_neutraldetectaoe = 852023
constant integer OID_neutralinteract = 852566
constant integer OID_neutralspell = 852630
constant integer OID_nightelfbuild = 851997
constant integer OID_orcbuild = 851996
constant integer OID_parasite = 852601
constant integer OID_parasiteoff = 852603
constant integer OID_parasiteon = 852602
constant integer OID_patrol = 851990
constant integer OID_phaseshift = 852514
constant integer OID_phaseshiftinstant = 852517
constant integer OID_phaseshiftoff = 852516
constant integer OID_phaseshifton = 852515
constant integer OID_phoenixfire = 852481
constant integer OID_phoenixmorph = 852482
constant integer OID_poisonarrows = 852255
constant integer OID_poisonarrowstarg = 852254
constant integer OID_polymorph = 852074
constant integer OID_possession = 852196
constant integer OID_preservation = 852568
constant integer OID_purge = 852111
constant integer OID_rainofchaos = 852237
constant integer OID_rainoffire = 852238
constant integer OID_raisedead = 852197
constant integer OID_raisedeadoff = 852199
constant integer OID_raisedeadon = 852198
constant integer OID_ravenform = 852155
constant integer OID_recharge = 852157
constant integer OID_rechargeoff = 852159
constant integer OID_rechargeon = 852158
constant integer OID_rejuvenation = 852160
constant integer OID_renew = 852161
constant integer OID_renewoff = 852163
constant integer OID_renewon = 852162
constant integer OID_repair = 852024
constant integer OID_repairoff = 852026
constant integer OID_repairon = 852025
constant integer OID_replenish = 852542
constant integer OID_replenishlife = 852545
constant integer OID_replenishlifeoff = 852547
constant integer OID_replenishlifeon = 852546
constant integer OID_replenishmana = 852548
constant integer OID_replenishmanaoff = 852550
constant integer OID_replenishmanaon = 852549
constant integer OID_replenishoff = 852544
constant integer OID_replenishon = 852543
constant integer OID_request_hero = 852239
constant integer OID_requestsacrifice = 852201
constant integer OID_restoration = 852202
constant integer OID_restorationoff = 852204
constant integer OID_restorationon = 852203
constant integer OID_resumebuild = 851999
constant integer OID_resumeharvesting = 852017
constant integer OID_resurrection = 852283 // was 852094
constant integer OID_returnresources = 852020
constant integer OID_revenge = 852241
constant integer OID_revive = 852039
constant integer OID_roar = 852164
constant integer OID_robogoblin = 852656
constant integer OID_root = 852165
constant integer OID_sacrifice = 852205
constant integer OID_sanctuary = 852569
constant integer OID_scout = 852181
// mine custom
constant integer OID_scrollofspeed = 852285
constant integer OID_selfdestruct = 852040
constant integer OID_selfdestructoff = 852042
constant integer OID_selfdestructon = 852041
constant integer OID_sentinel = 852182
constant integer OID_setrally = 851980
constant integer OID_shadowsight = 852570
constant integer OID_shadowstrike = 852527
constant integer OID_shockwave = 852125
constant integer OID_silence = 852592
constant integer OID_sleep = 852227
constant integer OID_slow = 852075
constant integer OID_slowoff = 852077
constant integer OID_slowon = 852076
constant integer OID_soulpreservation = 852242
constant integer OID_spellshield = 852571
constant integer OID_spellshieldaoe = 852572
constant integer OID_spellsteal = 852483
constant integer OID_spellstealoff = 852485
constant integer OID_spellstealon = 852484
constant integer OID_spies = 852235
constant integer OID_spiritlink = 852499
constant integer OID_spiritofvengeance = 852528
constant integer OID_spirittroll = 852573
constant integer OID_spiritwolf = 852126
constant integer OID_stampede = 852593
constant integer OID_standdown = 852113
constant integer OID_starfall = 852183
constant integer OID_stasistrap = 852114
constant integer OID_steal = 852574
constant integer OID_stomp = 852127
constant integer OID_stoneform = 852206
constant integer OID_stop = 851972
constant integer OID_submerge = 852604
constant integer OID_summonfactory = 852658
constant integer OID_summongrizzly = 852594
constant integer OID_summonphoenix = 852489
constant integer OID_summonquillbeast = 852595
constant integer OID_summonwareagle = 852596
constant integer OID_tankdroppilot = 852079
constant integer OID_tankloadpilot = 852080
constant integer OID_tankpilot = 852081
constant integer OID_taunt = 852520
constant integer OID_thunderbolt = 852095
constant integer OID_thunderclap = 852096
constant integer OID_tornado = 852597
constant integer OID_townbelloff = 852083
constant integer OID_townbellon = 852082
constant integer OID_tranquility = 852184
constant integer OID_unavatar = 852087
constant integer OID_unavengerform = 852532
constant integer OID_unbearform = 852139
constant integer OID_unburrow = 852534
constant integer OID_uncoldarrows = 852245
constant integer OID_uncorporealform = 852494
constant integer OID_undeadbuild = 851998
constant integer OID_undefend = 852056
constant integer OID_undivineshield = 852091
constant integer OID_unetherealform = 852497
constant integer OID_unflamingarrows = 852175
constant integer OID_unflamingattack = 852541
constant integer OID_unholyfrenzy = 852209
constant integer OID_unimmolation = 852178
constant integer OID_unload = 852047
constant integer OID_unloadall = 852048
constant integer OID_unloadallcorpses = 852054
constant integer OID_unloadallinstant = 852049
constant integer OID_unpoisonarrows = 852256
constant integer OID_unravenform = 852156
constant integer OID_unrobogoblin = 852657
constant integer OID_unroot = 852166
constant integer OID_unstableconcoction = 852500
constant integer OID_unstoneform = 852207
constant integer OID_unsubmerge = 852605
constant integer OID_unsummon = 852210
constant integer OID_unwindwalk = 852130
constant integer OID_vengeance = 852521
constant integer OID_vengeanceinstant = 852524
constant integer OID_vengeanceoff = 852523
constant integer OID_vengeanceon = 852522
constant integer OID_voodoo = 852503
constant integer OID_ward = 852504
constant integer OID_waterelemental = 852097
constant integer OID_wateryminion = 852598
constant integer OID_web = 852211
constant integer OID_weboff = 852213
constant integer OID_webon = 852212
constant integer OID_whirlwind = 852128
constant integer OID_windwalk = 852129
constant integer OID_wispharvest = 852214
constant integer OID_acidbomb = 852662
constant integer OID_chemicalrage = 852663
constant integer OID_healingspray = 852664
constant integer OID_transmute = 852665
constant integer OID_lavamonster = 852667
constant integer OID_soulburn = 852668
constant integer OID_volcano = 852669
constant integer OID_cancel = 851976
constant integer OID_moveslot1 = 852002
constant integer OID_moveslot2 = 852003
constant integer OID_moveslot3 = 852004
constant integer OID_moveslot4 = 852005
constant integer OID_moveslot5 = 852006
constant integer OID_moveslot6 = 852007
constant integer OID_useslot1 = 852008
constant integer OID_useslot2 = 852009
constant integer OID_useslot3 = 852010
constant integer OID_useslot4 = 852011
constant integer OID_useslot5 = 852012
constant integer OID_useslot6 = 852013
constant integer OID_smart = 851971
constant integer OID_skillmenu = 852000
//constant integer OID_instant? = 851991
//constant integer OID_instant? = 851987
//constant integer OID_instant? = 851973
//constant integer OID_instant? = 851975
//constant integer OID_instant? = 852019
endglobals
//TESH.scrollpos=0
//TESH.alwaysfold=0
//==============================================================================
// WIDs -- WeatherIDs by Magentix -- v1.0
//==============================================================================
//
// PURPOSE:
// * Just a bunch of useful constants
// * No more having to search for a weather ID
//
// HOW TO IMPORT:
// * Just create a trigger named WIDs
// * then convert it to text and replace the whole trigger text with this one
//
//==============================================================================
globals
constant integer WID_AshenvaleRainHeavy = 'RAhr'
constant integer WID_AshenvaleRainLight = 'RAlr'
constant integer WID_DalaranShield = 'MEds'
constant integer WID_DungeonBlueFogHeavy = 'FDbh'
constant integer WID_DungeonBlueFogLight = 'FDbl'
constant integer WID_DungeonGreenFogHeavy = 'FDgh'
constant integer WID_DungeonGreenFogLight = 'FDgl'
constant integer WID_DungeonRedFogHeavy = 'FDrh'
constant integer WID_DungeonRedFogLight = 'FDrl'
constant integer WID_DungeonWhiteFogHeavy = 'FDwh'
constant integer WID_DungeonWhiteFogLight = 'FDwl'
constant integer WID_LordaeronRainHeavy = 'RLhr'
constant integer WID_LordaeronRainLight = 'RLlr'
constant integer WID_NorthrendBlizzard = 'SNbs'
constant integer WID_NorthrendSnowHeavy = 'SNhs'
constant integer WID_NorthrendSnowLight = 'SNls'
constant integer WID_OutlandWindHeavy = 'WOcw'
constant integer WID_OutlandWindLight = 'WOlw'
constant integer WID_RaysOfLight = 'LRaa'
constant integer WID_RaysOfMoonlight = 'LRma'
constant integer WID_WindHeavy = 'WNcw'
endglobals
//TESH.scrollpos=25
//TESH.alwaysfold=0
globals
//============================================
//=============== Bosses (17) ================
//============================================
constant integer ZID_Arachnathid = 'u00D'
constant integer ZID_Artemis = 'n00F'
constant integer ZID_Behemoth = 'u006'
constant integer ZID_BlackKnight = 'u009'
constant integer ZID_Bonnie = 'n00U'
constant integer ZID_Dolly = 'n00V'
constant integer ZID_Darreus = 'u005'
constant integer ZID_Gargantuan = 'u00B'
constant integer ZID_Genesis = 'u003'
constant integer ZID_EggSack = 'n00O'
constant integer ZID_Hephaestus = 'n00P'
constant integer ZID_LocustSwarm = 'n00W'
constant integer ZID_Metasis = 'u008'
constant integer ZID_Minerva = 'n00G'
constant integer ZID_LeBron = 'n018'
constant integer ZID_Pudge = 'u004'
constant integer ZID_Thanatos = 'n012'
constant integer ZID_HiveQueen = 'n00K'
constant integer ZID_Necaroth = 'n01D'
constant integer ZID_Combustor = 'u00E'
//============================================
//=============== Bigguns (13) ===============
//============================================
constant integer ZID_Beast = 'u00A'
constant integer ZID_Fiend = 'n009'
constant integer ZID_DarkFlyer = 'n00S'
constant integer ZID_Gargoyle = 'n00R'
constant integer ZID_Ghoul = 'n011'
constant integer ZID_Glutton = 'u001'
constant integer ZID_Gonarch = 'n00N'
constant integer ZID_Horror = 'u00C'
constant integer ZID_Krill = 'n00B'
constant integer ZID_Leaper = 'u007'
constant integer ZID_Mutant = 'u002'
constant integer ZID_Ravager = 'n00C'
constant integer ZID_ZombieHuge = 'n00T'
constant integer ZID_Spitter = 'n016'
constant integer ZID_Sting = 'n019'
constant integer ZID_AcidBeast = 'n01C'
constant integer ZID_Butcher = 'n01F'
//============================================
//============== Littluns (14) ===============
//============================================
constant integer ZID_Zombie = 'n000'
constant integer ZID_ZombieFast = 'n001'
constant integer ZID_ZombieFaster = 'n015'
constant integer ZID_ZombieFat = 'n002'
constant integer ZID_ZombieDog = 'n00A'
constant integer ZID_Boomer = 'n00E'
constant integer ZID_Terrorizer = 'n00J'
constant integer ZID_Stalker = 'n013'
constant integer ZID_Shredder = 'n00D'
constant integer ZID_MutatedDog = 'n00Z'
constant integer ZID_Minion = 'n00I'
constant integer ZID_Locust = 'n00Q'
constant integer ZID_Licker = 'u000'
constant integer ZID_Crab = 'n00M'
constant integer ZID_Brute = 'n01E'
//============================================
//================== NPCs ====================
//============================================
constant integer NID_Rifleman = 'h009'
constant integer NID_Assaultman = 'h01D'
constant integer NID_CombatEngineer = 'h017'
constant integer NID_DesignatedMarksman = 'h01E'
constant integer NID_Sniper = 'h01Q'
constant integer NID_SniperBlind = 'h01V'
constant integer NID_SpotterBlind = 'h01W'
constant integer NID_IUL = 'h00A'
constant integer NID_Flamethrower = 'h00V'
constant integer NID_Ghost = 'h01A'
constant integer NID_MachineGunner = 'h00E'
constant integer NID_NavyCorpsman = 'h019'
constant integer NID_GlobalHawk = 'h00K'
constant integer NID_SentryGun = 'h004'
constant integer NID_Mk19 = 'h01T'
constant integer NID_Pilot = 'h014'
constant integer NID_PoliceRifle = 'h018'
constant integer NID_PoliceShotgun = 'h005'
constant integer NID_Engineer = 'h01M'
constant integer NID_Abrams = 'h01S'
constant integer NID_Defender = 'h00G'
constant integer NID_Employee = 'n01G'
endglobals
//TESH.scrollpos=-1
//TESH.alwaysfold=0
globals
// Spell functionality
constant integer UA2_CasterDummy = 'h00X'
// Beta mode flag
constant boolean UA2_BetaModeOn = false
// XP constants
constant integer UA2_RankAmount = 19
constant integer UA2_KillsPerXP = 6
// Spell constants
constant real UA2_GroundFlareDur = 240.
constant real UA2_GroundFlareDurRain = 150.
// Polar projection interval
constant real UA2_ProjectionInterval = .03
// Polar projection speeds (distance per interval)
constant real UA2_JumpSpeed = 25.
constant real UA2_LiftSpeed = 7.
constant real UA2_FireLeapSpeed = 14.
constant real UA2_ZombieLeapSpeed = 14.
constant real UA2_MinervaLeapSpeed = 14.
constant real UA2_AirStrikeSpeed = 40.
constant real UA2_WhitePhosphorousSpeed = 40.
constant real UA2_CASSpeed = 30.
// Mode constants
constant integer UA2_ModeRecruit = 0
constant integer UA2_ModeNormal = 1
constant integer UA2_ModeHard = 2
constant integer UA2_ModeInsane = 3
constant integer UA2_ModeSurvival = 4
constant integer UA2_ModeCompetitive = 5
constant integer UA2_ModeUmbrella = 6
// Standard mode
constant integer UA2_StandardMode = 1
constant string UA2_StandardModeName = "normal"
endglobals
//TESH.scrollpos=169
//TESH.alwaysfold=0
//==============================================================================
// ABC -- STRUCT ATTACHMENT SYSTEM BY COHADAR -- v6.1
//==============================================================================
//==============================================================================
// Quick function index:
//==============================================================================
//
// ----------------------------------------------------------------------
// Set Functions - these functions attach struct to a handle
// ----------------------------------------------------------------------
// SetTimerStructA(timer, struct)
// SetTimerStructB(timer, struct)
// SetTimerStructC(timer, struct)
//
// SetTriggerStructA(trigger, struct)
// SetTriggerStructB(trigger, struct)
// SetTriggerStructC(trigger, struct)
//
// SetDialogStructA(dialog, struct)
// SetDialogStructB(dialog, struct)
// SetDialogStructC(dialog, struct)
//
// SetRegionStructA(region, struct)
// SetRegionStructB(region, struct)
// SetRegionStructC(region, struct)
//
// ----------------------------------------------------------------------
// Get Functions - these functions retrieve attached structs
// ----------------------------------------------------------------------
// GetTimerStructA(timer) -> struct
// GetTimerStructB(timer) -> struct
// GetTimerStructC(timer) -> struct
//
// GetTriggerStructA(trigger) -> struct
// GetTriggerStructB(trigger) -> struct
// GetTriggerStructC(trigger) -> struct
//
// GetDialogStructA(dialog) -> struct
// GetDialogStructB(dialog) -> struct
// GetDialogStructC(dialog) -> struct
//
// GetRegionStructA(region) -> struct
// GetRegionStructB(region) -> struct
// GetRegionStructC(region) -> struct
//
// ----------------------------------------------------------------------
// Clear Functions - these functions clear and return attached value
// ----------------------------------------------------------------------
// ClearTimerStructA(timer) -> struct
// ClearTimerStructB(timer) -> struct
// ClearTimerStructC(timer) -> struct
//
// ClearTriggerStructA(trigger) -> struct
// ClearTriggerStructB(trigger) -> struct
// ClearTriggerStructC(trigger) -> struct
//
// ClearDialogStructA(dialog) -> struct
// ClearDialogStructB(dialog) -> struct
// ClearDialogStructC(dialog) -> struct
//
// ClearRegionStructA(region) -> struct
// ClearRegionStructB(region) -> struct
// ClearRegionStructC(region) -> struct
//
//==============================================================================
//==============================================================================
// DOCUMENTATION:
//==============================================================================
//
// PURPOUSE OF ABC:
// * Type safe handle attaching.
//
// * Currently supported handle types are timer, trigger, dialog and region
//
// PROS:
// * ABC is faster than gamecache based systems.
//
// * You can attach up to 3 structs on the same handle
//
// * System reports collision, and clearing of non-existent value.
//
// * This system will work even if your map leaks
// and will NOT slow down because of it.
//
// CONS:
// * you must manually clear the stored value - REMEMBER THIS RULE!!!
// Don't forget to use Clear functions
//
// DETAILS:
// * You can use Get to check if struct is attached to handle
// It will return 0 if it is not.
//
// * ABC will not interfere with other attachment systems
// You can freely use any other system alongside ABC
//
// * For unit attaching I recommend using PUI
//
// SPECIAL THANKS TO:
// * NagelBagel - for finding errors in versions 4.3 and 4.4
// * Here-b-Trollz - for testing ABC and for making cool spells with it.
// * Toadcop - for being pain in the ass and for pushing me to improve ABC.
// * emjlr3 - for pointing out the need for non-generic trigger attachments
// * PandaMine - I found a bug in ABC by examining his HSAS vs ABC test
// * All those people out there who use and support my systems
// Thank you guys.
//
// HOW TO IMPORT:
// * Just create a trigger named ABC
// * convert it to text and replace the whole trigger text with this one
//
//==============================================================================
//==============================================================================
// Macro function cores
//==============================================================================
//------------------------------------------------------------------------------
//! textmacro ABC_Set takes X, NAME, TYPE
local integer i = GetHandleId(key)
set i = i - (i / HASH) * HASH
if $NAME$Key$X$[i] == null then
set $NAME$Key$X$[i] = key
set $NAME$Value$X$[i] = value
else
debug set $NAME$Collision$X$[i] = $NAME$Collision$X$[i] + 1
debug if $NAME$MaxCollision$X$ < $NAME$Collision$X$[i] then
debug set $NAME$MaxCollision$X$ = $NAME$Collision$X$[i]
debug call BJDebugMsg("|cFFFF00FFWarning: Set$NAME$Struct$X$("+I2S(GetHandleId(key))+", "+I2S(value)+") - index: "+I2S(i)+", collision: "+I2S($NAME$MaxCollision$X$))
debug endif
call SaveInteger($NAME$Hash, '$X$', GetHandleId(key), value)
endif
//! endtextmacro
//------------------------------------------------------------------------------
//! textmacro ABC_Get takes X, NAME, TYPE
local integer i = GetHandleId(key)
set i = i - (i / HASH) * HASH
if $NAME$Key$X$[i] == key then
return $NAME$Value$X$[i]
else
return LoadInteger($NAME$Hash, '$X$', GetHandleId(key))
endif
//! endtextmacro
//------------------------------------------------------------------------------
//! textmacro ABC_Clear takes X, NAME, TYPE
local integer ret
local integer i = GetHandleId(key)
set i = i - (i / HASH) * HASH
if $NAME$Key$X$[i] == key then
set ret = $NAME$Value$X$[i]
set $NAME$Key$X$[i] = null
set $NAME$Value$X$[i] = 0
else
if HaveSavedInteger($NAME$Hash, '$X$', GetHandleId(key)) then
debug set $NAME$Collision$X$[i] = $NAME$Collision$X$[i] - 1
set ret = LoadInteger($NAME$Hash, '$X$', GetHandleId(key))
call RemoveSavedInteger($NAME$Hash, '$X$', GetHandleId(key))
else
call BJDebugMsg("|cFFFF0000ERROR: Clear$NAME$Struct$X$("+I2S(GetHandleId(key))+") - clear attempt on bad key")
set ret = 0
endif
endif
return ret
//! endtextmacro
//==============================================================================
library ABC initializer Init
globals
private constant integer HASH = 8191
private timer array TimerKeyA
private timer array TimerKeyB
private timer array TimerKeyC
private trigger array TriggerKeyA
private trigger array TriggerKeyB
private trigger array TriggerKeyC
private dialog array DialogKeyA
private dialog array DialogKeyB
private dialog array DialogKeyC
private region array RegionKeyA
private region array RegionKeyB
private region array RegionKeyC
private unit array UnitKeyA
private unit array UnitKeyB
private unit array UnitKeyC
private integer array TimerValueA
private integer array TimerValueB
private integer array TimerValueC
private integer array TriggerValueA
private integer array TriggerValueB
private integer array TriggerValueC
private integer array DialogValueA
private integer array DialogValueB
private integer array DialogValueC
private integer array RegionValueA
private integer array RegionValueB
private integer array RegionValueC
private integer array UnitValueA
private integer array UnitValueB
private integer array UnitValueC
private integer array TimerCollisionA
private integer array TimerCollisionB
private integer array TimerCollisionC
private integer array TriggerCollisionA
private integer array TriggerCollisionB
private integer array TriggerCollisionC
private integer array DialogCollisionA
private integer array DialogCollisionB
private integer array DialogCollisionC
private integer array RegionCollisionA
private integer array RegionCollisionB
private integer array RegionCollisionC
private integer array UnitCollisionA
private integer array UnitCollisionB
private integer array UnitCollisionC
private integer TimerMaxCollisionA = 0
private integer TimerMaxCollisionB = 0
private integer TimerMaxCollisionC = 0
private integer TriggerMaxCollisionA = 0
private integer TriggerMaxCollisionB = 0
private integer TriggerMaxCollisionC = 0
private integer DialogMaxCollisionA = 0
private integer DialogMaxCollisionB = 0
private integer DialogMaxCollisionC = 0
private integer RegionMaxCollisionA = 0
private integer RegionMaxCollisionB = 0
private integer RegionMaxCollisionC = 0
private integer UnitMaxCollisionA = 0
private integer UnitMaxCollisionB = 0
private integer UnitMaxCollisionC = 0
private hashtable TimerHash
private hashtable TriggerHash
private hashtable DialogHash
private hashtable RegionHash
private hashtable UnitHash
endglobals
//==============================================================================
// Collision check functions
//==============================================================================
//------------------------------------------------------------------------------
function GetTimerCollisionA takes nothing returns integer
return TimerMaxCollisionA
endfunction
//------------------------------------------------------------------------------
function GetTimerCollisionB takes nothing returns integer
return TimerMaxCollisionB
endfunction
//------------------------------------------------------------------------------
function GetTimerCollisionC takes nothing returns integer
return TimerMaxCollisionC
endfunction
//------------------------------------------------------------------------------
function GetTriggerCollisionA takes nothing returns integer
return TriggerMaxCollisionA
endfunction
//------------------------------------------------------------------------------
function GetTriggerCollisionB takes nothing returns integer
return TriggerMaxCollisionB
endfunction
//------------------------------------------------------------------------------
function GetTriggerCollisionC takes nothing returns integer
return TriggerMaxCollisionC
endfunction
//------------------------------------------------------------------------------
function GetDialogCollisionA takes nothing returns integer
return DialogMaxCollisionA
endfunction
//------------------------------------------------------------------------------
function GetDialogCollisionB takes nothing returns integer
return DialogMaxCollisionB
endfunction
//------------------------------------------------------------------------------
function GetDialogCollisionC takes nothing returns integer
return DialogMaxCollisionC
endfunction
//------------------------------------------------------------------------------
function GetRegionCollisionA takes nothing returns integer
return RegionMaxCollisionA
endfunction
//------------------------------------------------------------------------------
function GetRegionCollisionB takes nothing returns integer
return RegionMaxCollisionB
endfunction
//------------------------------------------------------------------------------
function GetRegionCollisionC takes nothing returns integer
return RegionMaxCollisionC
endfunction
//------------------------------------------------------------------------------
function GetUnitCollisionA takes nothing returns integer
return UnitMaxCollisionA
endfunction
//------------------------------------------------------------------------------
function GetUnitCollisionB takes nothing returns integer
return UnitMaxCollisionB
endfunction
//------------------------------------------------------------------------------
function GetUnitCollisionC takes nothing returns integer
return UnitMaxCollisionC
endfunction
//==============================================================================
// Set functions
//==============================================================================
//------------------------------------------------------------------------------
function SetTimerStructA takes timer key, integer value returns nothing
//! runtextmacro ABC_Set("A", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function SetTimerStructB takes timer key, integer value returns nothing
//! runtextmacro ABC_Set("B", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function SetTimerStructC takes timer key, integer value returns nothing
//! runtextmacro ABC_Set("C", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function SetTriggerStructA takes trigger key, integer value returns nothing
//! runtextmacro ABC_Set("A", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function SetTriggerStructB takes trigger key, integer value returns nothing
//! runtextmacro ABC_Set("B", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function SetTriggerStructC takes trigger key, integer value returns nothing
//! runtextmacro ABC_Set("C", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function SetDialogStructA takes dialog key, integer value returns nothing
//! runtextmacro ABC_Set("A", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function SetDialogStructB takes dialog key, integer value returns nothing
//! runtextmacro ABC_Set("B", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function SetDialogStructC takes dialog key, integer value returns nothing
//! runtextmacro ABC_Set("C", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function SetRegionStructA takes region key, integer value returns nothing
//! runtextmacro ABC_Set("A", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function SetRegionStructB takes region key, integer value returns nothing
//! runtextmacro ABC_Set("B", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function SetRegionStructC takes region key, integer value returns nothing
//! runtextmacro ABC_Set("C", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function SetUnitStructA takes unit key, integer value returns nothing
//! runtextmacro ABC_Set("A", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function SetUnitStructB takes unit key, integer value returns nothing
//! runtextmacro ABC_Set("B", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function SetUnitStructC takes unit key, integer value returns nothing
//! runtextmacro ABC_Set("C", "Unit", "unit")
endfunction
//==============================================================================
// Get functions
//==============================================================================
//------------------------------------------------------------------------------
function GetTimerStructA takes timer key returns integer
//! runtextmacro ABC_Get("A", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function GetTimerStructB takes timer key returns integer
//! runtextmacro ABC_Get("B", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function GetTimerStructC takes timer key returns integer
//! runtextmacro ABC_Get("C", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function GetTriggerStructA takes trigger key returns integer
//! runtextmacro ABC_Get("A", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function GetTriggerStructB takes trigger key returns integer
//! runtextmacro ABC_Get("B", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function GetTriggerStructC takes trigger key returns integer
//! runtextmacro ABC_Get("C", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function GetDialogStructA takes dialog key returns integer
//! runtextmacro ABC_Get("A", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function GetDialogStructB takes dialog key returns integer
//! runtextmacro ABC_Get("B", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function GetDialogStructC takes dialog key returns integer
//! runtextmacro ABC_Get("C", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function GetRegionStructA takes region key returns integer
//! runtextmacro ABC_Get("A", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function GetRegionStructB takes region key returns integer
//! runtextmacro ABC_Get("B", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function GetRegionStructC takes region key returns integer
//! runtextmacro ABC_Get("C", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function GetUnitStructA takes unit key returns integer
//! runtextmacro ABC_Get("A", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function GetUnitStructB takes unit key returns integer
//! runtextmacro ABC_Get("B", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function GetUnitStructC takes unit key returns integer
//! runtextmacro ABC_Get("C", "Unit", "unit")
endfunction
//==============================================================================
// Clear functions
//==============================================================================
//------------------------------------------------------------------------------
function ClearTimerStructA takes timer key returns integer
//! runtextmacro ABC_Clear("A", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function ClearTimerStructB takes timer key returns integer
//! runtextmacro ABC_Clear("B", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function ClearTimerStructC takes timer key returns integer
//! runtextmacro ABC_Clear("C", "Timer", "timer")
endfunction
//------------------------------------------------------------------------------
function ClearTriggerStructA takes trigger key returns integer
//! runtextmacro ABC_Clear("A", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function ClearTriggerStructB takes trigger key returns integer
//! runtextmacro ABC_Clear("B", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function ClearTriggerStructC takes trigger key returns integer
//! runtextmacro ABC_Clear("C", "Trigger", "trigger")
endfunction
//------------------------------------------------------------------------------
function ClearDialogStructA takes dialog key returns integer
//! runtextmacro ABC_Clear("A", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function ClearDialogStructB takes dialog key returns integer
//! runtextmacro ABC_Clear("B", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function ClearDialogStructC takes dialog key returns integer
//! runtextmacro ABC_Clear("C", "Dialog", "dialog")
endfunction
//------------------------------------------------------------------------------
function ClearRegionStructA takes region key returns integer
//! runtextmacro ABC_Clear("A", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function ClearRegionStructB takes region key returns integer
//! runtextmacro ABC_Clear("B", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function ClearRegionStructC takes region key returns integer
//! runtextmacro ABC_Clear("C", "Region", "region")
endfunction
//------------------------------------------------------------------------------
function ClearUnitStructA takes unit key returns integer
//! runtextmacro ABC_Clear("A", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function ClearUnitStructB takes unit key returns integer
//! runtextmacro ABC_Clear("B", "Unit", "unit")
endfunction
//------------------------------------------------------------------------------
function ClearUnitStructC takes unit key returns integer
//! runtextmacro ABC_Clear("C", "Unit", "unit")
endfunction
//==============================================================================
// Initialization
//==============================================================================
private function Init takes nothing returns nothing
set TimerKeyA[HASH-1] = null
set TimerKeyB[HASH-1] = null
set TimerKeyC[HASH-1] = null
set TriggerKeyA[HASH-1] = null
set TriggerKeyB[HASH-1] = null
set TriggerKeyC[HASH-1] = null
set DialogKeyA[HASH-1] = null
set DialogKeyB[HASH-1] = null
set DialogKeyC[HASH-1] = null
set RegionKeyA[HASH-1] = null
set RegionKeyB[HASH-1] = null
set RegionKeyC[HASH-1] = null
set UnitKeyA[HASH-1] = null
set UnitKeyB[HASH-1] = null
set UnitKeyC[HASH-1] = null
set TimerValueA[HASH-1] = 0
set TimerValueB[HASH-1] = 0
set TimerValueC[HASH-1] = 0
set TriggerValueA[HASH-1] = 0
set TriggerValueB[HASH-1] = 0
set TriggerValueC[HASH-1] = 0
set DialogValueA[HASH-1] = 0
set DialogValueB[HASH-1] = 0
set DialogValueC[HASH-1] = 0
set RegionValueA[HASH-1] = 0
set RegionValueB[HASH-1] = 0
set RegionValueC[HASH-1] = 0
set UnitValueA[HASH-1] = 0
set UnitValueB[HASH-1] = 0
set UnitValueC[HASH-1] = 0
set TimerCollisionA[HASH-1] = 0
set TimerCollisionB[HASH-1] = 0
set TimerCollisionC[HASH-1] = 0
set TriggerCollisionA[HASH-1] = 0
set TriggerCollisionB[HASH-1] = 0
set TriggerCollisionC[HASH-1] = 0
set DialogCollisionA[HASH-1] = 0
set DialogCollisionB[HASH-1] = 0
set DialogCollisionC[HASH-1] = 0
set RegionCollisionA[HASH-1] = 0
set RegionCollisionB[HASH-1] = 0
set RegionCollisionC[HASH-1] = 0
set UnitCollisionA[HASH-1] = 0
set UnitCollisionB[HASH-1] = 0
set UnitCollisionC[HASH-1] = 0
set TimerHash = InitHashtable()
set TriggerHash = InitHashtable()
set DialogHash = InitHashtable()
set RegionHash = InitHashtable()
set UnitHash = InitHashtable()
endfunction
endlibrary
//==============================================================================
// END OF ABC STRUCT ATTACHMENT SYSTEM
//==============================================================================
//TESH.scrollpos=-1
//TESH.alwaysfold=0
///////////////////////////////////////////
/// HostBot Command Library
/// Last Modified: September 14, 2009
/// Authors: Strilanc,
/// v1.01
///////////////////////////////////////////
/// Reads a command string transparently encoded into player handicaps by hostbots.
/// Allows at most one character from "abcdefghijklmnopqrstuvwxyz0123456789 -=,." per player.
/// Empty slots don't count towards the player count, but computers do.
///////////////////////////////////////////
library HCL initializer init
globals
private string command = ""
endglobals
public function GetCommandString takes nothing returns string
return command
endfunction
private function init takes nothing returns nothing
local integer i
local integer j
local integer h
local integer v
local string chars = "abcdefghijklmnopqrstuvwxyz0123456789 -=,."
local integer array map
local boolean array blocked
//precompute mapping [have to avoid invalid and normal handicaps]
set blocked[0] = true
set blocked[50] = true
set blocked[60] = true
set blocked[70] = true
set blocked[80] = true
set blocked[90] = true
set blocked[100] = true
set i = 0
set j = 0
loop
if blocked[j] then
set j = j + 1
endif
exitwhen j >= 256
set map[j] = i
set i = i + 1
set j = j + 1
endloop
//Extract command string from player handicaps
set i = 0
loop
exitwhen i >= 12
set h = R2I(100*GetPlayerHandicap(Player(i)) + 0.5)
if not blocked[h] then
set h = map[h]
set v = h/6
set h = h-v*6
call SetPlayerHandicap(Player(i), 0.5 + h/10.0)
set command = command + SubString(chars, v, v+1)
endif
set i = i + 1
endloop
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library Codemaker initializer Init
globals
private gamecache ascii = null
private gamecache codemaker = null
public integer array vals
public integer array size
private constant string CONSTANT_Charmap = "+!*gaCBADEFGHJKLMNOPQRSTUVWXYZbcdefhjklmnopqrstuvwxzy9876543210@"
private constant integer CONSTANT_FCSsize = 7
private string TRANSFERSTRING
endglobals
function Ascii_cache takes nothing returns gamecache
if (ascii==null) then
call FlushGameCache(InitGameCache("arcii.vx"))
set ascii=InitGameCache("arcii.vx")
endif
return ascii
endfunction
constant function Ascii_SafePercent takes nothing returns string
if ("%"=="") then
return "%%"
endif
return "%"
endfunction
function AsciiCharToInteger_sub takes string u returns integer
local string charMap = " !\"#$"+Ascii_SafePercent()+"&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
local string c
local integer i = 0
if (u == "\b") then
return 8
elseif u == "\t" then
return 9
elseif u == "\n" then
return 10
elseif u == "\f" then
return 12
elseif u == "\r" then
return 13
endif
loop
set c = SubString(charMap, i, i + 1)
exitwhen c == ""
if c == u then
return i + 32
endif
set i = i + 1
endloop
return 0
endfunction
function AsciiCharToInteger takes string char returns integer
local string k
local string u = SubString(char, 0, 1)
local integer r
if (u == "") or (u == null) then
return 0
endif
if (StringCase(u,true)==u) then
set k=u
else
set k=u+"1"
endif
if HaveStoredInteger(Ascii_cache(),"ascii",k) then
return GetStoredInteger(Ascii_cache(),"ascii",k)
endif
set r=AsciiCharToInteger_sub(u)
call StoreInteger(Ascii_cache(),"ascii",k,r)
return r
endfunction
function GetStringIdentity takes string s, integer range returns integer
local integer len = StringLength(s)
local integer i = 0
local integer Result = 0
loop
exitwhen (i>=len)
set Result = Result+AsciiCharToInteger(SubString(s,i,i+1))
if (Result>=range) then
set Result=Result-range
endif
set i = i + 1
endloop
return Result
endfunction
private function GetCodemakerCache takes nothing returns gamecache
if (codemaker==null) then
call FlushGameCache(InitGameCache("codemaker"))
set codemaker=InitGameCache("codemaker")
endif
return codemaker
endfunction
private function GetVal takes integer i returns integer
return vals[i]
endfunction
private function GetSize takes integer i returns integer
return size[i]
endfunction
private function GetMaxVals takes nothing returns integer
return vals[0]
endfunction
private function UseCharmap takes integer id returns boolean
local string k=I2S(id)
if GetStoredBoolean(GetCodemakerCache(),"charmaps",k) then
call StoreInteger(GetCodemakerCache(),"charmaps","current",id)
return true
endif
return false
endfunction
private function CurrentCharmap takes nothing returns string
return I2S(GetStoredInteger(GetCodemakerCache(),"charmaps","current"))
endfunction
private function BinStr_NOT takes string bin, integer bits returns string
local integer i=0
local string r=""
loop
exitwhen (i>=bits)
if (SubString(bin,i,i+1)=="1") then
set r=r+"0"
else
set r=r+"1"
endif
set i=i+1
endloop
return r
endfunction
private function BinStr_ADD takes string bina, string binb, integer n returns string
local string r=""
local string c1
local string c2
local string c3
local boolean cr=false
loop
exitwhen (n<=0)
set c1=SubString(bina,n-1,n)
set c2=SubString(binb,n-1,n)
if (c2!=c1) then
if cr then
set c3="0"
else
set c3="1"
endif
elseif (c1==c2) and (c1=="1") then
if cr then
set c3="1"
else
set c3="0"
set cr=true
endif
else
if cr then
set c3="1"
set cr=false
else
set c3="0"
endif
endif
set r=c3+r
set n=n-1
endloop
return r
endfunction
private function BinStr_XOR takes string bin1, string bin2, integer bits returns string
local string r=""
local integer i=1
local integer c1=1
local integer c2=1
local integer L1=StringLength(bin1)
local integer L2=StringLength(bin2)
loop
exitwhen (i>bits)
if ( (SubString(bin1,c1-1,c1)=="1") != (SubString(bin2,c2-1,c2)=="1") ) then
set r=r+"1"
else
set r=r+"0"
endif
set i=i+1
set c1=c1+1
set c2=c2+1
if (c1>L1) then
set c1=1
endif
if (c2>L2) then
set c2=1
endif
endloop
return r
endfunction
private function Int2BinStr takes integer i, integer bits returns string
local integer div
local string r=""
local string max=""
if (bits<32) then
if (i<0) then
return Int2BinStr(0,bits)
endif
elseif (i<0) then
set r=Int2BinStr(-i,31)
set r=BinStr_NOT(r,31)
set r=BinStr_ADD(r,Int2BinStr(1,31),31)
return "1"+r+max
endif
loop
exitwhen (bits==0)
set div=i/2
if (div*2==i) then
set r="0"+r
else
set r="1"+r
endif
set max="1"+max
set i=div
set bits=bits-1
endloop
if (i!=0) then
return max
endif
return r
endfunction
private function BinStr2Int takes string bin, integer bits returns integer
local integer div
local string ch
local integer r=0
local integer p=1
loop
exitwhen (bits<=0)
set ch=SubString(bin,bits-1,bits)
if (ch=="1") then
set r=r+p
endif
set p=p*2
set bits=bits-1
endloop
return r
endfunction
private function EncodeBinStr takes string bin returns string
local gamecache g=GetCodemakerCache()
local string k=CurrentCharmap()
local integer sz=GetStoredInteger(g,k+"bitsperchar","now")
local integer l
local integer i=0
local string ch
local string r=""
set k=k+"bin2char"
loop
set ch=SubString(bin,i,i+sz)
exitwhen (ch=="") or (ch==null)
if HaveStoredString(g,k,ch) then
set r=r+GetStoredString(g,k,ch)
else
set r=r+GetStoredString(g,k,"def")
endif
set i=i+sz
endloop
set g=null
return r
endfunction
private function DecodeBinStr takes string cod returns string
local gamecache g=GetCodemakerCache()
local integer i=0
local string k=CurrentCharmap()+"char2bin"
local string r=""
local string ch
loop
set ch=SubString(cod,i,i+1)
exitwhen (ch=="") or (ch==null)
if (StringCase(ch,true)==ch) then
set ch=ch+"1"
endif
if HaveStoredString(g,k,ch) then
set r=r+GetStoredString(g,k,ch)
else
set g=null
return ""
endif
set i=i+1
endloop
set g=null
return r
endfunction
private function FromArrayToBin takes nothing returns string
local integer n=GetMaxVals()
local integer i=1
local string r=""
loop
exitwhen (i>n)
set r=r+Int2BinStr(GetVal(i),GetSize(i))
set i=i+1
endloop
return r
endfunction
function GetCRC takes string bin, integer n returns string
local integer mod=R2I(Pow(2,n))
local integer s=0
local string c
local integer i=0
loop
set c=SubString(bin,i,i+n)
exitwhen (c=="") or (c==null)
set s= ModuloInteger(s+BinStr2Int(c,n),mod)
set i=i+n
endloop
return Int2BinStr(s,n)
endfunction
private function AddCRC takes string bin returns string
local integer n=GetStoredInteger( GetCodemakerCache() , CurrentCharmap() , "FCS")
local string crc=GetCRC(bin,n)
return( crc+ BinStr_XOR(bin,crc,StringLength(bin)) )
endfunction
private function FixBitNumber takes string bin returns string
local integer sz=GetStoredInteger(GetCodemakerCache(),CurrentCharmap()+"bitsperchar","now")
loop
exitwhen (ModuloInteger(StringLength(bin) , sz)==0)
set bin=bin+"0"
endloop
return bin
endfunction
private function EncodeForPlayer takes string bin, player p returns string
local string in=FixBitNumber(bin)
local integer i=0
local integer l=StringLength(in)
local integer tt= IMinBJ(l, 31)
local string id= Int2BinStr( GetStringIdentity(GetPlayerName(p),R2I( Pow(2,tt) )) , tt)
local string r=""
loop
exitwhen i>=l
if (i+tt>=l) then
set tt=l-i
endif
set r=r+BinStr_XOR(SubString(in,i,i+tt),id,tt)
set i=i+tt
endloop
return r
endfunction
private function DecodeForPlayer takes string bin, player p returns string
local integer i=0
local integer l=StringLength(bin)
local integer tt= IMinBJ(l, 31)
local string id= Int2BinStr( GetStringIdentity(GetPlayerName(p),R2I( Pow(2,tt) )) , tt)
local string r=""
loop
exitwhen i>=l
if (i+tt>=l) then
set tt=l-i
endif
set r=r+BinStr_XOR(SubString(bin,i,i+tt),id,tt)
set i=i+tt
endloop
return r
endfunction
private function TotalBits takes nothing returns integer
local integer i=vals[0]
local integer r=0
loop
exitwhen (i<=0)
set r=r+size[i]
set i=i-1
endloop
return r
endfunction
private function TotalCodeLength takes nothing returns integer
local string k=CurrentCharmap()
local integer r=TotalBits()+GetStoredInteger( GetCodemakerCache() , k , "FCS")
local integer l=GetStoredInteger (GetCodemakerCache(),k+"bitsperchar","now")
loop
exitwhen (ModuloInteger(r,l)==0)
set r=r+1
endloop
return (r/l)
endfunction
private function CheckCRC takes string bin returns string
local integer n=GetStoredInteger( GetCodemakerCache() , CurrentCharmap() , "FCS")
local integer T=TotalBits()
local string rbin= SubString(bin,n,n+T)
local string crc= SubString(bin,0,n)
set rbin=BinStr_XOR(rbin,crc,T)
if (GetCRC(rbin,n)!=crc) then
return ""
endif
return rbin
endfunction
private function FromBinToArray takes string bin returns integer
local integer n=GetMaxVals()
local integer i=1
local integer j=0
local integer sz
local string ch
loop
exitwhen (i>n)
set sz=GetSize(i)
set ch=SubString(bin,j,j+sz)
if (StringLength(ch)< sz ) then
return 4 //Missing bits
endif
set vals[i] = BinStr2Int(ch,sz)
set i=i+1
set j=j+sz
endloop
return 0
endfunction
private function GetId takes trigger t returns integer
return GetHandleId(t)
//return 0
endfunction
private function AskString_Child takes nothing returns nothing
local gamecache g=GetCodemakerCache()
local string k= I2S( GetId( GetTriggeringTrigger() ) )
local string cmd=GetStoredString(g,k,"cmd")
local integer l=StringLength(cmd)
local boolean b=false
local string chat=GetEventPlayerChatString()
local string r
if (chat==GetStoredString(g,k,"cnl")) then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,2,chat)
set b=true
set r=""
elseif (SubString(chat,0,l)==cmd) then
set r=SubString(chat,l,StringLength(chat))
set b=((r!=null) and (r!=""))
endif
if not(b) then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,GetStoredReal(g,k,"rem"),GetStoredString(g,k,"prm"))
else
call StoreString(g,k,"result",r)
endif
set g=null
endfunction
private function GenerateCode_thread takes player p returns nothing
local string r
set r=FromArrayToBin()
set r=AddCRC(r)
if (p!=null) then
set r=EncodeForPlayer(r,p)
endif
set TRANSFERSTRING=EncodeBinStr(r)
endfunction
private function ReadCode_thread takes player p, string cod returns nothing
local integer T=TotalCodeLength()
local integer L=StringLength(cod)
set bj_groupEnumTypeId=5
if (L<T) then
set bj_groupEnumTypeId=1
else
if (L>T) then
set cod=SubString(cod,0,T)
endif
set cod=DecodeBinStr(cod)
if (cod=="") then
set bj_groupEnumTypeId=2
else
if (p!=null) then
set cod=DecodeForPlayer(cod,p)
endif
set cod=CheckCRC(cod)
if (cod=="") then
set bj_groupEnumTypeId=3
else
set bj_groupEnumTypeId=FromBinToArray(cod)
endif
endif
endif
endfunction
public function GenerateCode takes player p returns string
call GenerateCode_thread.execute(p)
return TRANSFERSTRING
endfunction
public function ReadCode takes player p, string cod returns integer
call ReadCode_thread.execute(p,cod)
return bj_groupEnumTypeId
endfunction
public function SetCharmap takes integer id, string ch, integer FCSsize returns nothing
local gamecache g=GetCodemakerCache()
local integer i=0
local integer log=0
local integer p=1
local string c
local string k=I2S(id)
local integer EXITTHREAD
local string bin
if (FCSsize>30) then
call BJDebugMsg("|cffff0000Invalid FCS size: Must be <= 30")
call FlushGameCache(g)
set EXITTHREAD=EXITTHREAD
endif
call StoreBoolean(g,"charmaps",k,true)
loop
set c=SubString(ch,i,i+1)
exitwhen (c=="")
if (StringCase(c,true)==c) then
set c=c+"1"
endif
set i=i+1
if (i>p) then
set p=p*2
set log=log+1
endif
endloop
if (i!=p) then
call BJDebugMsg("|cffff0000Invalid charmap: Length must be a power of 2")
call FlushGameCache(g)
set EXITTHREAD=EXITTHREAD
endif
if (ModuloInteger(p,FCSsize)==0) then
call BJDebugMsg("|cffff0000Invalid charmap/FCS size: FCS size can't be a multiple of the number of bits per character")
call FlushGameCache(g)
set EXITTHREAD=EXITTHREAD
endif
set i=0
call StoreInteger(g,k,"FCS",FCSsize)
call StoreInteger(g,k+"bitsperchar","now",log)
loop
exitwhen (i>=p)
set bin=Int2BinStr(i,log)
set c=SubString(ch,i,i+1)
call StoreString(g,k+"bin2char",bin,c)
if (i==0) then
call StoreString(g,k+"bin2char","def",c)
endif
if (StringCase(c,true)==c) then
set c=c+"1"
endif
call StoreString(g,k+"char2bin",c,bin)
if (i==0) then
call StoreString(g,k+"char2bin","def",bin)
endif
set i=i+1
endloop
set g=null
endfunction
public function AskString takes player p, string prompt, string cmd, string canc, real timeout returns string
local gamecache g=GetCodemakerCache()
local trigger t=CreateTrigger()
local triggeraction ac=TriggerAddAction(t,function AskString_Child )
local string k= I2S( GetId(t) )
local string pk=I2S(GetPlayerId(p))
local string r
local timer x
loop
exitwhen not( GetStoredBoolean(g,pk,"notfree") )
call StoreBoolean(g,pk,"haltnow",true)
call TriggerSleepAction(0)
endloop
call StoreBoolean(g,pk,"notfree",true)
call DisplayTimedTextToPlayer(p,0,0,timeout,prompt)
call TriggerRegisterPlayerChatEvent(t,p,cmd,false)
call TriggerRegisterPlayerChatEvent(t,p,canc,true)
call StoreString(g,k,"cmd",cmd)
call StoreString(g,k,"prm",prompt)
call StoreString(g,k,"cnl",canc)
set x=CreateTimer()
call TimerStart(x,timeout,false,null)
loop
exitwhen HaveStoredString(g,k,"result") or (TimerGetRemaining(x)<=0) or GetStoredBoolean(g,pk,"haltnow")
call StoreReal(g,k,"rem",TimerGetRemaining(x))
call TriggerSleepAction(0)
endloop
call StoreBoolean(g,pk,"haltnow",false)
set r=GetStoredString(g,k,"result")
call FlushStoredMission( g,k)
call TriggerRemoveAction(t,ac)
call DestroyTrigger(t)
call DestroyTimer(x)
call StoreBoolean(g,pk,"notfree",false)
set x=null
set ac=null
set g=null
set t=null
return r
endfunction
public function HighlightCode takes string cod, string cColor, string lColor, string sColor returns string
local integer l=StringLength(cod)
local integer i=0
local string r=""
local string c
local string x
local boolean b
loop
exitwhen (i>=l)
set c=SubString(cod,i,i+1)
set x=""
loop
exitwhen (i>=l)
set b= (StringCase(c,true)==c) and (StringCase(c,false)!=c)
exitwhen not( b)
set x=x+c
set i=i+1
set c=SubString(cod,i,i+1)
endloop
if (x!="") then
set r=r+"|c"+cColor+x+"|r"
endif
set x=""
loop
exitwhen (i>=l)
set b= (StringCase(c,true)!=c) and (StringCase(c,false)==c)
exitwhen not ( b)
set x=x+c
set i=i+1
set c=SubString(cod,i,i+1)
endloop
if (x!="") then
set r=r+"|c"+lColor+x+"|r"
endif
set x=""
loop
exitwhen (i>=l)
set b= (StringCase(c,true)==c) and (StringCase(c,false)==c)
exitwhen not ( b)
set x=x+c
set i=i+1
set c=SubString(cod,i,i+1)
endloop
if (x!="") then
set r=r+"|c"+sColor+x+"|r"
endif
endloop
return r
endfunction
public function Code2Serial takes string cod, string token , integer charspergroup, string cColor, string lColor, string sColor returns string
local integer i=charspergroup
local integer j=0
local gamecache g=GetCodemakerCache()
local string k=CurrentCharmap()
local integer b=GetStoredInteger(g,k+"bitsperchar","now")
local integer mx=R2I(Pow(2,b)-1)
local string r=""
local string c
loop
exitwhen (ModuloInteger(StringLength(cod),i)==0)
set cod=cod+GetStoredString(g,k+"bin2char", Int2BinStr(GetRandomInt(0,mx),b) )
endloop
loop
set c=SubString(cod,j,j+i)
exitwhen (c=="") or (c==null)
if (r=="") then
set r=HighlightCode(c,cColor,lColor,sColor)
else
set r=r+token+HighlightCode(c,cColor,lColor,sColor)
endif
set j=j+i
endloop
set g=null
return r
endfunction
public function Serial2Code takes string serial, string token returns string
local string r=""
local string c=""
local integer i=0
loop
set c=SubString(serial,i,i+1)
exitwhen (c=="") or (c==null)
if (c!=token) then
set r=r+c
endif
set i=i+1
endloop
return r
endfunction
public function GetRequiredSize takes integer i returns integer
local integer p=1
local integer r=0
loop
exitwhen (p>i)
set r=r+1
set p=p*2
endloop
return r
endfunction
//======================================================================================
private function Init takes nothing returns nothing
call SetCharmap(0,CONSTANT_Charmap,CONSTANT_FCSsize)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library TimerUtils initializer init
//*********************************************************************
//* TimerUtils (Blue flavor for 1.23b or later)
//* ----------
//*
//* To implement it , create a custom text trigger called TimerUtils
//* and paste the contents of this script there.
//*
//* To copy from a map to another, copy the trigger holding this
//* library to your map.
//*
//* (requires vJass) More scripts: htt://www.wc3campaigns.net
//*
//* For your timer needs:
//* * Attaching
//* * Recycling (with double-free protection)
//*
//* set t=NewTimer() : Get a timer (alternative to CreateTimer)
//* ReleaseTimer(t) : Relese a timer (alt to DestroyTimer)
//* SetTimerData(t,2) : Attach value 2 to timer
//* GetTimerData(t) : Get the timer's value.
//* You can assume a timer's value is 0
//* after NewTimer.
//*
//* Blue Flavor: Slower than the red flavor, it got a 408000 handle id
//* limit, which means that if more than 408000 handle ids
//* are used in your map, TimerUtils might fail, this
//* value is quite big and it is much bigger than the
//* timer limit in Red flavor.
//*
//********************************************************************
//==================================================================================================
globals
private hashtable hasht //I <3 blizz
endglobals
//It is dependent on jasshelper's recent inlining optimization in order to perform correctly.
function SetTimerData takes timer t, integer value returns nothing
call SaveInteger(hasht,0, GetHandleId(t), value)
endfunction
function GetTimerData takes timer t returns integer
return LoadInteger(hasht, 0, GetHandleId(t))
endfunction
//==========================================================================================
globals
private timer array tT
private integer tN = 0
private constant integer HELD=0x28829022
//use a totally random number here, the more improbable someone uses it, the better.
endglobals
//==========================================================================================
function NewTimer takes nothing returns timer
if (tN==0) then
set tT[0]=CreateTimer()
else
set tN=tN-1
endif
call SetTimerData(tT[tN],0)
return tT[tN]
endfunction
//==========================================================================================
function ReleaseTimer takes timer t returns nothing
if(t==null) then
debug call BJDebugMsg("Warning: attempt to release a null timer")
return
endif
if (tN==8191) then
debug call BJDebugMsg("Warning: Timer stack is full, destroying timer!!")
//stack is full, the map already has much more troubles than the chance of bug
call DestroyTimer(t)
else
call PauseTimer(t)
if(GetTimerData(t)==HELD) then
debug call BJDebugMsg("Warning: ReleaseTimer: Double free!")
return
endif
call SetTimerData(t,HELD)
set tT[tN]=t
set tN=tN+1
endif
endfunction
private function init takes nothing returns nothing
set hasht = InitHashtable()
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library System requires Codemaker, ABC, HCL, TimerUtils
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library BetaMode initializer Init requires GlobalFuncs
globals
private integer FIXED_XP = 0
private real DURATION = 0
private boolean BATALLION_AUTH = false
private boolean DISABLE_SAVE = false
private boolean DISABLE_LOAD = false
private boolean ONLY_TESTERS = false
private boolean ONLY_SUPERVISOR = false
private boolean ALLOW_SETXP = false
private boolean ALLOW_SETDIFFCOMP= false
private string array BETA_TESTERS
private integer TESTER_AMT
private trigger CORE
private trigger TIMED_DEFEAT
private trigger SET_XP
private trigger SET_DC
private string WELCOME_MESSAGE
endglobals
private function InitNames takes nothing returns nothing
set BETA_TESTERS[0] = "Magentix" // Northrend
set BETA_TESTERS[1] = "illidan92" // Azeroth
set BETA_TESTERS[2] = "eleteguard" // US East
set BETA_TESTERS[3] = "John_S" // Azeroth
set BETA_TESTERS[4] = "deathsangel5" // US East
set BETA_TESTERS[5] = "justptsd1" // Azeroth
set BETA_TESTERS[6] = "Aloren" // US East
set BETA_TESTERS[7] = "spartan33" // US East
set BETA_TESTERS[8] = "fruity_skittles"// US East
set BETA_TESTERS[9] = "3demons" //Lordaeron
set BETA_TESTERS[10] = "ShinraCorp" // Azeroth
set BETA_TESTERS[11] = "Coolty44" // Azeroth
set BETA_TESTERS[12] = "Dace" // Azeroth
set BETA_TESTERS[13] = "faults" // Azeroth
set BETA_TESTERS[14] = "warhog54" // US east
set BETA_TESTERS[15] = "kimdoeyoung" // US east/west
set BETA_TESTERS[16] = "FrosTedChaos" // US east/west
set BETA_TESTERS[17] = "Wasusa" // US east/west
set BETA_TESTERS[18] = "FSR-blink-fan" // azeroth/lordaeron/northrend
set BETA_TESTERS[19] = "Darkstar707" // us east
set BETA_TESTERS[20] = "Shadowic" // us east
set BETA_TESTERS[21] = "geck789" // us east
set BETA_TESTERS[22] = "Shozen" // us east
set BETA_TESTERS[23] = "helltrooper012" // us east
set BETA_TESTERS[24] = "jampe" // us east
set BETA_TESTERS[25] = "banzaimonkey" // us east
set BETA_TESTERS[26] = "BacionisFunk" // us east
set BETA_TESTERS[27] = "ZARATUL" // us west
set BETA_TESTERS[28] = "MaxImash" // us east
set BETA_TESTERS[29] = "Firebat26233" // us east
set BETA_TESTERS[30] = "Remscar" // us east
set BETA_TESTERS[31] = "nyko1229" // us east
set BETA_TESTERS[32] = "heavansorhells" // us east
set BETA_TESTERS[33] = "ghostninjamaste"// us east
set BETA_TESTERS[34] = "F34RZominus" // us east
set BETA_TESTERS[35] = "Pythonhare" // us east
set BETA_TESTERS[36] = "Slagish" // us east
set BETA_TESTERS[37] = "nightmare123" // us east
set BETA_TESTERS[38] = "SD-Vortex" // us east
set BETA_TESTERS[39] = "Doctorlove" // us east
set BETA_TESTERS[40] = "Pain_for_Pain" // us east
set BETA_TESTERS[41] = "Liara" // us east
set BETA_TESTERS[42] = "Alahir" // us east
set BETA_TESTERS[43] = "Rotfuchs" // us east
set BETA_TESTERS[44] = "X.xG.O.Dx.X" // us east
set BETA_TESTERS[45] = "mydrid" // us east
set BETA_TESTERS[46] = "USMA-Chris" // us east
set BETA_TESTERS[47] = "flageleur" // us east
set BETA_TESTERS[48] = "kenshin555" // us east
set BETA_TESTERS[49] = "bonepinman" // us east
set BETA_TESTERS[50] = "i_sheep_man" // us east
// Clan leaders
set BETA_TESTERS[51] = "DA.Blademaster" // us east
set BETA_TESTERS[52] = "i_sheep_man" // us east
set BETA_TESTERS[53] = "Helios-" // us east
set BETA_TESTERS[54] = "momoman1995" // us east
set BETA_TESTERS[55] = "johann1212" // us east
set BETA_TESTERS[56] = "Flippy" // us east
set BETA_TESTERS[57] = "Pyrath" // us east
set BETA_TESTERS[58] = "tierdal" // us east
set BETA_TESTERS[59] = "X.xG.O.Dx.X" // us east
set BETA_TESTERS[60] = "reciever80" // us east
set TESTER_AMT = 61
endfunction
function KickIntruders takes nothing returns nothing
local integer i = 0
local integer j
local player p
loop
exitwhen i > 10
set p = Player(i)
if (GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(p) == MAP_CONTROL_USER) then
set j = 0
loop
exitwhen j > (TESTER_AMT-1)
if (PLAYER_NAMES[i+1] == BETA_TESTERS[j]) then
exitwhen true
endif
set j = j + 1
endloop
if (j > TESTER_AMT-1) then
call CustomDefeatBJ(p,"Only beta testers!")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,PLAYER_NAMES[i+1]+" has been kicked for not being a beta tester.")
else
//set WELCOME_MESSAGE = WELCOME_MESSAGE + "Beta tester "+PLAYER_NAMES[i+1]+" recognized.\n"
endif
endif
set i = i + 1
endloop
endfunction
function SupervisorCheck takes nothing returns nothing
local integer i = 0
local integer j
local player p
local boolean supervised=false
loop
exitwhen i > 10
set p = Player(i)
if (GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(p) == MAP_CONTROL_USER) then
set j = 0
loop
exitwhen j > (TESTER_AMT-1)
if (PLAYER_NAMES[i+1] == BETA_TESTERS[j]) then
call DisplayTimedTextToForce(GetPlayersAllies(Player(0)),30.,"Supervisor "+GetPlayerName(p)+" recognized.")
set supervised=true
exitwhen true
endif
set j = j + 1
endloop
endif
set i = i + 1
endloop
if supervised==false then
set i=0
loop
set p = Player(i)
exitwhen i>10
call CustomDefeatBJ(p,"Supervisor required!")
set i=i+1
endloop
endif
endfunction
private function Actions takes nothing returns nothing
local integer i = 1
local integer j
if ONLY_TESTERS then
call KickIntruders()
endif
if ONLY_SUPERVISOR then
call SupervisorCheck()
endif
if (DURATION > 0.) then
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n- Test time is set at: " + R2S(R2I(DURATION)/60) + " minutes"
endif
if (FIXED_XP > 0) then
loop
exitwhen i>UA2_RankAmount
if (RANK_MIN_XP[i]<=FIXED_XP) and (RANK_MAX_XP[i]>=FIXED_XP) then
set j = i
endif
set i=i+1
endloop
set i = 1
loop
exitwhen i > 11
set PLAYER_XP[i] = FIXED_XP
set PLAYER_RANK_NAME[i]=RANK_NAME[j]
set PLAYER_RANK[i]=S2I(SubStringBJ(PLAYER_RANK_NAME[i],1,2))
call SetPlayerName(Player(i-1), SubStringBJ(PLAYER_RANK_NAME[i],3,StringLength(PLAYER_RANK_NAME[i]))+" "+PLAYER_NAMES[i])
set i = i + 1
endloop
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n- XP is set at: " + I2S(FIXED_XP)
endif
if BATALLION_AUTH then
set i = 0
loop
exitwhen i > 10
call SetPlayerTechResearched(Player(i),'R00F',1)
set i = i + 1
endloop
endif
if DISABLE_SAVE then
call DisableTrigger(SAVELOAD_saveTrig)
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n- Saving has been disabled"
endif
if DISABLE_LOAD then
call DisableTrigger(SAVELOAD_loadTrig)
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n- Loading has been disabled"
endif
if ONLY_TESTERS then
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n\nInvalid testers will be removed"
endif
if ONLY_SUPERVISOR then
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n\nSupervisor required"
endif
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\n"
call DisplayTimedTextToForce(GetPlayersAllies(Player(0)),30.,WELCOME_MESSAGE)
endfunction
private function DefeatAll takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 10
call CustomDefeatBJ(Player(i),"Beta expired")
set i = i + 1
endloop
endfunction
private function SetXP takes nothing returns nothing
local integer i=GetPlayerId(GetTriggerPlayer())+1
local string s=GetEventPlayerChatString()
call DisplayTextToPlayer(Player(i-1), 0, 0, "XP set to: " + SubStringBJ(s, 5, StringLength(s)))
set PLAYER_XP[i]=S2I(SubStringBJ(s, 5, StringLength(s)))
set PLAYER_RANK[i]=S2I(SubStringBJ(PLAYER_RANK_NAME[i],1,2))
call SetPlayerName(Player(i-1), SubStringBJ(PLAYER_RANK_NAME[i],3,StringLength(PLAYER_RANK_NAME[i]))+" "+PLAYER_NAMES[i])
set s=null
endfunction
private function SetDC takes nothing returns nothing
local integer i=GetPlayerId(GetTriggerPlayer())+1
local string s=GetEventPlayerChatString()
local string s2
call DisplayTextToPlayer(Player(i-1), 0, 0, "Difficulty completed set to: " + SubStringBJ(s, 5, StringLength(s)))
set PLAYER_DIFFCOMP[i]=S2I(SubStringBJ(s, 5, StringLength(s)))
if PLAYER_DIFFCOMP[i]>=5 then
set s2=DIFF_NAMES[PLAYER_DIFFCOMP[i]-5] + "|umb"
else
set s2=DIFF_NAMES[PLAYER_DIFFCOMP[i]]
endif
call DisplayTextToPlayer(Player(i-1), 0, 0, "DC: " + s2)
set s=null
set s2=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local integer i=0
if UA2_BetaModeOn then
call InitNames()
set WELCOME_MESSAGE = "\nWelcome to Undead Assault Beta!\n"
set CORE = CreateTrigger()
call TriggerRegisterTimerEventSingle(CORE,5.)
call TriggerAddAction(CORE,function Actions)
if (DURATION > 0.) then
set TIMED_DEFEAT = CreateTrigger()
call TriggerRegisterTimerEventSingle(TIMED_DEFEAT,DURATION)
call TriggerAddAction(TIMED_DEFEAT,function DefeatAll)
endif
if ALLOW_SETXP and DISABLE_SAVE then
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\nInput \"-xp ##\" to set your XP\n"
set SET_XP=CreateTrigger()
call TriggerAddAction(SET_XP, function SetXP)
loop
exitwhen i>10
call TriggerRegisterPlayerChatEvent(SET_XP, Player(i), "-xp", false)
set i=i+1
endloop
endif
if ALLOW_SETDIFFCOMP then
set WELCOME_MESSAGE = WELCOME_MESSAGE + "\nInput \"-DC ##\" to set your Difficulty Completed\n"
set SET_DC=CreateTrigger()
call TriggerAddAction(SET_DC, function SetDC)
set i=0
loop
exitwhen i>10
call TriggerRegisterPlayerChatEvent(SET_DC, Player(i), "-DC", false)
set i=i+1
endloop
endif
endif
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DEBUG initializer Init
private function CountActions takes nothing returns nothing
local integer i = 0
local unit u
local group g = CreateGroup()
call GroupAddGroup(PLAYER_UNITS,g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
set i = i + 1
endloop
call BJDebugMsg("Units in group: " + I2S(i))
call DestroyGroup(g)
set g = null
set u = null
endfunction
private function NameActions takes nothing returns nothing
local unit u
local group g = CreateGroup()
call GroupAddGroup(PLAYER_UNITS,g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
call BJDebugMsg("Unit name: " + GetUnitName(u))
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
private function AllianceActions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = 11
local string array Names
loop
exitwhen i > 15
if IsPlayerEnemy(p,Player(i)) then
call BJDebugMsg(GetPlayerName(Player(i)) + ": Enemy")
elseif IsPlayerAlly(p,Player(i)) then
call BJDebugMsg(GetPlayerName(Player(i)) + ": Ally")
else
call BJDebugMsg(GetPlayerName(Player(i)) + ": Neutral")
endif
set i = i + 1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-countgroup",true)
call TriggerAddAction(T,function CountActions)
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-namegroup",true)
call TriggerAddAction(T,function NameActions)
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-alliance",true)
call TriggerAddAction(T,function AllianceActions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library UA2CasterSystem initializer Init
private struct DDIC
real x
real y
real r
real d
endstruct
private struct IPP
item i
boolean b
endstruct
globals
private DDIC ddic
private IPP ipp
private unit GlobalCaster
endglobals
function PreloadAbility takes integer abilId returns nothing
local unit u = CreateUnit(Player(15), UA2_CasterDummy, 0 ,0 ,0)
call UnitAddAbility(u,abilId)
call RemoveUnit(u)
set u = null
endfunction
function AddCasterFacing takes real fac returns unit
return CreateUnit( Player(15), UA2_CasterDummy, 0 ,0 ,fac)
endfunction
function AddPlayerCaster takes player p returns unit
return CreateUnit(p, UA2_CasterDummy, 0 ,0 ,0)
endfunction
function CasterCastAbilityLevel takes player owner, integer abilid, integer level, integer order, widget target, real casterlife returns nothing
local real x=GetWidgetX(target)
local real y=GetWidgetY(target)
local unit caster=AddPlayerCaster(owner)
call UnitApplyTimedLife(caster,'BTLF',I2R(IntegerTertiaryOp(casterlife>5.00,R2I(casterlife),5)))
call UnitAddAbility( caster, abilid)
call SetUnitAbilityLevel(caster,abilid,level)
call SetUnitX(caster,x)
call SetUnitY(caster,y)
call IssueTargetOrderById( caster, order, target )
endfunction
function GetPointZ takes real x,real y returns integer
local location l=Location(x,y)
local integer i=R2I(GetLocationZ(l))
call RemoveLocation(l)
set l=null
return i
endfunction
function AngleBetweenCoords takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
endfunction
function IsPointDownHill takes real sourceX, real sourceY, real destX, real destY returns boolean
return ( GetPointZ(sourceX,sourceY) > (GetPointZ(destX,destY) + 95) )
endfunction
function IsPointWater takes real x, real y returns boolean
return IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) and not(IsTerrainPathable(x,y,PATHING_TYPE_AMPHIBIOUSPATHING))
endfunction
function IsPointPathableCheck takes nothing returns nothing
set ipp.b = ipp.b or (GetEnumItem()!=ipp.i)
endfunction
function IsPointPathable takes real x, real y returns boolean
local rect r
local real dx
local real dy
set ipp.i = CreateItem('ciri',0,0)
call SetItemVisible(ipp.i,false)
call SetItemPosition(ipp.i,x,y)
set dx=GetItemX(ipp.i)-x
set dy=GetItemY(ipp.i)-y
if(dx*dx+dy*dy<=100)then
call RemoveItem(ipp.i)
return true
endif
set r=Rect(x-30,y-30,x+30,y+30)
set ipp.b=false
call EnumItemsInRect(r,BE_TRUE,function IsPointPathableCheck)
call RemoveRect(r)
call RemoveItem(ipp.i)
set r=null
return ipp.b
endfunction
function IsDestructableTreeCheck takes destructable d returns boolean
local boolean b
local boolean i=IsDestructableInvulnerable(d)
call SetUnitX(GlobalCaster,GetWidgetX(d))
call SetUnitY(GlobalCaster,GetWidgetY(d))
if i then
call SetDestructableInvulnerable(d,false)
endif
call UnitAddAbility(GlobalCaster,'Aeat')
set b=(IssueTargetOrderById(GlobalCaster,OID_eattree,d))
call UnitRemoveAbility(GlobalCaster,'Aeat')
if i then
call SetDestructableInvulnerable(d,true)
endif
return b
endfunction
function IsDestructableTree takes destructable d returns boolean
local integer id=GetDestructableTypeId(d)
local boolean b
if HaveSavedBoolean(UA2_HASHTABLE,StringHash("trees"),id) then
set b=LoadBoolean(UA2_HASHTABLE,StringHash("trees"),id)
else
set b=IsDestructableTreeCheck(d)
call SaveBoolean(UA2_HASHTABLE,StringHash("trees"),id,b)
endif
return b
endfunction
function IsDestructableInCircle takes destructable d returns boolean
return ( (Pow(GetDestructableX(d)-ddic.x,2)+Pow(GetDestructableY(d)-ddic.y,2)) <= (ddic.r*ddic.r) )
endfunction
function DamageDestructablesInCircleEnum takes nothing returns nothing
local destructable d=GetEnumDestructable()
if (GetWidgetLife(d)>0) and not(IsDestructableInvulnerable(d)) and IsDestructableInCircle(d) then
call SetWidgetLife(d,GetWidgetLife(d)-ddic.d)
endif
set d=null
endfunction
function DamageDestructablesInCircle takes real x, real y, real radius, real dmg returns nothing
local rect r=Rect(x - radius,y - radius,x + radius,y + radius)
set ddic.x = x
set ddic.y = y
set ddic.r = radius
set ddic.d = dmg
call EnumDestructablesInRect(r,BE_TRUE,function DamageDestructablesInCircleEnum)
call RemoveRect(r)
set r=null
endfunction
function DamageTreesInCircleEnum takes nothing returns nothing
local destructable d=GetEnumDestructable()
if (GetWidgetLife(d)>0) and not(IsDestructableInvulnerable(d)) and IsDestructableInCircle(d) and IsDestructableTree(d) then
call KillDestructable(d)
endif
set d=null
endfunction
function DamageTreesInCircle takes real x, real y, real radius returns nothing
local rect r=Rect(x - radius,y - radius,x + radius,y + radius)
set ddic.x = x
set ddic.y = y
set ddic.r = radius
call EnumDestructablesInRect(r,BE_TRUE,function DamageDestructablesInCircleEnum)
call RemoveRect(r)
set r=null
endfunction
private function Init takes nothing returns nothing
set ddic = DDIC.create()
set ipp = IPP.create()
set GlobalCaster = CreateUnit( Player(15), UA2_CasterDummy, 0 ,0 ,0)
call UnitRemoveAbility(GlobalCaster,'Aloc')
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library GeneralUse initializer Init requires System, UA2CasterSystem
globals
boolexpr BE_TRUE
boolean GAME_PAUSED = false
hashtable UA2_HASHTABLE
endglobals
private function TrueBoolexpr takes nothing returns boolean
return true
endfunction
function CountItemsOfType takes unit u, integer typeid returns integer
local integer i=0
local integer count=0
local item sl
loop
exitwhen i>5
set sl=UnitItemInSlot(u,i)
if GetItemTypeId(sl)==typeid then
set count=count+1
endif
set i=i+1
endloop
set sl=null
return count
endfunction
function GetRectRandX takes rect rec returns real
return GetRandomReal(GetRectMinX(rec),GetRectMaxX(rec))
endfunction
function GetRectRandY takes rect rec returns real
return GetRandomReal(GetRectMinY(rec),GetRectMaxY(rec))
endfunction
function CS_Error takes player ForPlayer, string msg returns nothing
local sound error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
if (GetLocalPlayer() == ForPlayer) then
if (msg!="") and (msg!=null) then
call ClearTextMessages()
call DisplayTimedTextToPlayer(ForPlayer, 0.52, -1.00, 2.00, "|cffffcc00"+msg+"|r" )
endif
call StartSound(error)
endif
call KillSoundWhenDone(error)
set error=null
endfunction
function PolledWait2 takes real duration returns nothing
local real timeRemaining
local real st=TimerGetElapsed( bj_gameStartedTimer)
if st <= 0 then
set bj_gameStartedTimer = CreateTimer()
call TimerStart(bj_gameStartedTimer, 1000000, false, null)
endif
if (duration > 0) then
loop
set timeRemaining = duration - TimerGetElapsed( bj_gameStartedTimer) + st
exitwhen timeRemaining <= 0
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction
function RemoveAllUnitsFromGame takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function PolarProjectUnit takes unit whichUnit, real distance, real angle returns nothing
call SetUnitPosition(whichUnit,GetUnitX(whichUnit)+distance*Cos(angle*bj_DEGTORAD),GetUnitY(whichUnit)+distance*Sin(angle*bj_DEGTORAD))
endfunction
function AngleBetweenPointsXY takes real x1, real y1, real x2, real y2 returns real
return Atan2((y2-y1),(x2-x1)) * bj_RADTODEG
endfunction
function DistanceBetweenPointsXY takes real x1, real y1, real x2, real y2 returns real
return SquareRoot((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))
endfunction
private function GetUnitsOfType_core takes group g, integer unitID returns group
call GroupEnumUnitsOfType(g,UnitId2String(unitID),BE_TRUE)
return g
endfunction
function GetUnitsOfType takes integer unitID returns group
return GetUnitsOfType_core(CreateGroup(),unitID)
endfunction
function FilterLivingType takes nothing returns boolean
return IsUnitAliveBJ(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit())==bj_groupEnumTypeId
endfunction
function GetUnitsOfPlayerAndType_core takes group g, player p, boolexpr f returns group
call GroupEnumUnitsOfPlayer(g,p,f)
call DestroyBoolExpr(f)
return g
endfunction
function GetUnitsOfPlayerAndType takes player p, integer id returns group
set bj_groupEnumTypeId = id
return GetUnitsOfPlayerAndType_core(CreateGroup(),p,Condition(function FilterLivingType))
endfunction
function GetUnitsInRange_core takes group g, real r, location l, boolexpr f returns group
call GroupEnumUnitsInRangeOfLoc(g,l,r,f)
call DestroyBoolExpr(f)
return g
endfunction
function GetUnitsInRange takes real r, location l, boolexpr f returns group
return GetUnitsInRange_core(CreateGroup(),r,l,f)
endfunction
private function Init takes nothing returns nothing
set BE_TRUE = Condition(function TrueBoolexpr)
set UA2_HASHTABLE = InitHashtable()
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library UA2General requires GeneralUse
function KillExplosiveChargesInRange_filter takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit())=='o007'
endfunction
function KillExplosiveChargesInRange_enum takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
function KillExplosiveChargesInRange takes real r,real x, real y returns nothing
call GroupEnumUnitsInRange(GLOBAL_ENUM_GROUP,x,y,r,Condition(function KillExplosiveChargesInRange_filter))
call ForGroup(GLOBAL_ENUM_GROUP,function KillExplosiveChargesInRange_enum)
call GroupClear(GLOBAL_ENUM_GROUP)
endfunction
function IsUnitMiniRifle takes unit u returns boolean
local integer i=GetUnitTypeId(u)
return i==NID_IUL or i==NID_Rifleman or i==NID_NavyCorpsman or i==NID_Assaultman
endfunction
function RifleCheck takes unit u, integer pickup returns boolean
local integer i=1
loop
exitwhen i>RifleItemsCnt
if (CountItemsOfType(u,RifleItems[i])>0 and RifleItems[i]!=pickup) or CountItemsOfType(u,RifleItems[i])>1 then
return true
endif
set i=i+1
endloop
return false
endfunction
function MGCheck takes unit u, integer pickup returns boolean
local integer i=1
loop
exitwhen i>MGItemsCnt
if (CountItemsOfType(u,MGItems[i])>0 and MGItems[i]!=pickup) or CountItemsOfType(u,MGItems[i])>1 then
return true
endif
set i=i+1
endloop
return false
endfunction
function SMGCheck takes unit u, integer pickup returns boolean
if CountItemsOfType(u,pickup) > 1 then
return true
endif
return false
endfunction
function AddDiffComp takes integer difficulty returns nothing
local integer i=1
local integer diff=difficulty
local integer compcheck
if diff<=UA2_ModeInsane then
// the regular mode variables are 1 less than the diffcomp variable
set diff=diff+1
endif
loop
exitwhen i>11
if PLAYER_DIFFCOMP[i]>5 then
set compcheck=PLAYER_DIFFCOMP[i]-5
else
set compcheck=PLAYER_DIFFCOMP[i]
endif
if diff==UA2_ModeUmbrella and PLAYER_DIFFCOMP[i]<5 then
set PLAYER_DIFFCOMP[i]=PLAYER_DIFFCOMP[i]+5
elseif diff <=4 and compcheck<diff then
// make sure you don't overwrite umb mode
if PLAYER_DIFFCOMP[i]<5 then
set PLAYER_DIFFCOMP[i]=diff
else
set PLAYER_DIFFCOMP[i]=diff+5
endif
endif
set i=i+1
endloop
endfunction
function AddPlayerXP takes player p, integer xp returns nothing
local integer i=GetPlayerId(p)+1
local integer newxp=PLAYER_XP[i]+xp
local integer rankindex=4
local string s="|cff3CD58CYou cannot advance in rank until you complete "
if PLAYER_DIFFCOMP[i]<5 and PLAYER_DIFFCOMP[i]>0 then
// umb not completed
set rankindex=4
elseif PLAYER_DIFFCOMP[i]<9 and PLAYER_DIFFCOMP[i]>0 then
//completed umb, but not insane
set rankindex=4
elseif PLAYER_DIFFCOMP[i]==9 and PLAYER_DIFFCOMP[i]>0 then
// all ranks unlocked
set rankindex=4
endif
if newxp > RANK_MAX_XP[RANK_LIM[rankindex]] then
set newxp=RANK_MAX_XP[RANK_LIM[rankindex]]
if PLAYER_LIMMESSAGE[i]==false then
set PLAYER_LIMMESSAGE[i]=true
if rankindex==0 then
set s=s+"normal."
elseif rankindex==-1 then
set s=s+"hard."
elseif rankindex==-1 then
set s=s+"insane."
elseif rankindex==-1 then
set s=s+"umbrella."
endif
call DisplayTimedTextToPlayer(p,0,0,15,s)
endif
endif
// Max XP of last rank is 999999, so it's automatically limited
// to that
set PLAYER_XP[i]=newxp
set s=null
endfunction
function AwardObjectiveXP takes real r, string s returns nothing
local integer i=0
call StartSound(SOUND_RADIO_FEEDBACK_C_1)
if r<0 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("|cff808000"+s+", "+(I2S(R2I(-r))+" xp deducted from all players.")))
elseif r>0 and r<=1 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("|cff808000"+s+", 1 xp awarded to all players."))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,("|cff808000"+s+", "+(I2S(R2I(r*XP_MODIFIER))+" xp awarded to all players.")))
endif
loop
exitwhen i>10
if r<0 then
call AddPlayerXP(Player(i),R2I(r))
elseif r>0 and r<1 then
call AddPlayerXP(Player(i),1)
else
call AddPlayerXP(Player(i),R2I(r*XP_MODIFIER))
endif
set i=i+1
endloop
set s=null
endfunction
function ChanceAutomaticFiringBonus takes unit u,integer chance returns nothing
if GetRandomInt(1,chance)==1 then
call UnitAddAbility(u,'A04H')
endif
endfunction
function ChanceFlashLight takes unit u,integer chance returns nothing
if GetRandomInt(1,chance)==1 then
call UnitAddAbility(u,'A02J')
call UnitAddAbility(u,'A04F')
endif
endfunction
function ChanceFragGrenade takes unit u,integer chance returns nothing
if GetRandomInt(1,chance)==1 then
call UnitAddAbility(u,'A06Z')
call GroupAddUnit(NPC_FRAG,u)
endif
endfunction
function InitiateUmbrellaSoldier takes unit u returns nothing
local unit u2 = CreateUnit(GetOwningPlayer(u),'h003',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
if GetRandomInt(1,5)==1 then
//call GroupAddUnit(RifleButters,u)
endif
call UnitAddAbility(u,'STAD')
call UnitAddAbility(u,'JUMD')
call RemoveGuardPosition(u)
call UnitAddAbility(u2,'A06R')
call SetUnitAbilityLevel(u2,'A06R',Umb_DWSLVL)
call IssueTargetOrderById(u2,OID_drunkenhaze,u)
call UnitApplyTimedLifeBJ(1.5,'BTLF',u2)
call TriggerRegisterUnitEvent(SoldierTakesHit_T,u,EVENT_UNIT_DAMAGED)
set u2=null
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library VisualsFuncs requires GeneralUse
globals
real zstart
real zend
real fogcolor
private real rumble_dur
hashtable HASH=InitHashtable()
boolean Rumbling=false
endglobals
function RumbleCam_Reset takes nothing returns nothing
call PolledWait2(rumble_dur)
call CameraSetSourceNoise(0, 0)
call CameraSetTargetNoise(0, 0)
set Rumbling=false
endfunction
function RumbleCam takes real noise,real dur returns nothing
local real richter
if Rumbling==true then
call CameraSetSourceNoise(0, 0)
call CameraSetTargetNoise(0, 0)
endif
set Rumbling=true
if (noise > 5.0) then
set richter = 5.0
elseif (noise < 2.0) then
set richter = 2.0
else
set richter = 0.0
endif
call CameraSetTargetNoiseEx(noise*2.0, noise*Pow(10,richter),true)
call CameraSetSourceNoiseEx(noise*2.0, noise*Pow(10,richter),true)
set rumble_dur=dur
call ExecuteFunc("RumbleCam_Reset")
endfunction
function SmoothTakeOff_Inner takes nothing returns nothing
local timer t=GetExpiredTimer()
local real height=LoadReal(HASH,GetHandleId(t),StringHash("height"))
local real rate=LoadReal(HASH,GetHandleId(t),StringHash("rate"))
local real r=LoadReal(HASH,GetHandleId(t),StringHash("r"))
local unit u=LoadUnitHandle(HASH,GetHandleId(t),StringHash("u"))
call SetUnitFlyHeight(u,height,rate*r)
if r<=1 then
set r=r+.025
call SaveReal(HASH,GetHandleId(t),StringHash("r"),r)
else
call PauseTimer(t)
call FlushChildHashtable(HASH,GetHandleId(t))
call DestroyTimer(t)
endif
set t=null
set u=null
endfunction
function SmoothTakeOff takes unit u, real height, real rate returns nothing
local timer t=CreateTimer()
local real r=.025
call SaveReal(HASH,GetHandleId(t),StringHash("height"),height)
call SaveReal(HASH,GetHandleId(t),StringHash("rate"),rate)
call SaveReal(HASH,GetHandleId(t),StringHash("r"),r)
call SaveUnitHandle(HASH,GetHandleId(t),StringHash("u"),u)
call TimerStart(t,.05,true,function SmoothTakeOff_Inner)
endfunction
function HeliWashOff takes unit u returns nothing
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real dist = 0
local integer i
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",x,y))
call SetSoundPosition(gg_snd_WashOff,x,y,10)
call StartSound(gg_snd_WashOff)
loop
exitwhen dist>320
set i = 0
loop
exitwhen i>320
if GetRandomInt(0,1)==1 then
call DestroyEffect(AddSpecialEffect( "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", x + dist * Cos(i * bj_DEGTORAD), y + dist * Sin(i * bj_DEGTORAD) ))
endif
set i=i+40
endloop
if GetRandomInt(0,1)==1 then
//call TriggerSleepAction(0.)
endif
set dist=dist+40
endloop
endfunction
function HugeExplosion takes real x, real y returns nothing
local string s="Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl"
call DestroyEffect(AddSpecialEffect(s,x+250,y+0))
call DestroyEffect(AddSpecialEffect(s,x+500,y+0))
call DestroyEffect(AddSpecialEffect(s,x+250,y+250))
call DestroyEffect(AddSpecialEffect(s,x+500,y+500))
call DestroyEffect(AddSpecialEffect(s,x-250,y+250))
call DestroyEffect(AddSpecialEffect(s,x-500,y+500))
call DestroyEffect(AddSpecialEffect(s,x-250,y+0))
call DestroyEffect(AddSpecialEffect(s,x-500,y+0))
call DestroyEffect(AddSpecialEffect(s,x+250,y-250))
call DestroyEffect(AddSpecialEffect(s,x+500,y-500))
call DestroyEffect(AddSpecialEffect(s,x+0,y-250))
call DestroyEffect(AddSpecialEffect(s,x+0,y-500))
call DestroyEffect(AddSpecialEffect(s,x-250,y-250))
call DestroyEffect(AddSpecialEffect(s,x-500,y-500))
call DestroyEffect(AddSpecialEffect(s,x+0,y+250))
call DestroyEffect(AddSpecialEffect(s,x+0,y+500))
endfunction
function CinematicFilterGenericForPlayer takes player whichPlayer, real duration, blendmode bmode, string tex, real red0, real green0, real blue0, real trans0, real red1, real green1, real blue1, real trans1 returns nothing
if ( GetLocalPlayer() == whichPlayer ) then
call SetCineFilterTexture(tex)
call SetCineFilterBlendMode(bmode)
call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
call SetCineFilterStartUV(0, 0, 1, 1)
call SetCineFilterEndUV(0, 0, 1, 1)
call SetCineFilterStartColor(PercentTo255(red0), PercentTo255(green0), PercentTo255(blue0), PercentTo255(100-trans0))
call SetCineFilterEndColor(PercentTo255(red1), PercentTo255(green1), PercentTo255(blue1), PercentTo255(100-trans1))
call SetCineFilterDuration(duration)
call DisplayCineFilter(true)
endif
endfunction
function PingMinimapForPlayerEx takes player whichPlayer, real x, real y, real duration, integer style, real red, real green, real blue returns nothing
local integer red255 = PercentTo255(red)
local integer green255 = PercentTo255(green)
local integer blue255 = PercentTo255(blue)
if (GetLocalPlayer()==whichPlayer) then
if (red255 == 255) and (green255 == 0) and (blue255 == 0) then
set red255 = 254
endif
if (style == bj_MINIMAPPINGSTYLE_SIMPLE) then
call PingMinimapEx(x, y, duration, red255, green255, blue255, false)
elseif (style == bj_MINIMAPPINGSTYLE_FLASHY) then
call PingMinimapEx(x, y, duration, red255, green255, blue255, true)
elseif (style == bj_MINIMAPPINGSTYLE_ATTACK) then
call PingMinimapEx(x, y, duration, 255, 0, 0, false)
endif
endif
endfunction
function ShowNightVision takes player p,boolean b returns nothing
if p==GetLocalPlayer()then
if(b)then
call SetTerrainFogEx(0,2300.,4500.,.25,.0,.0,.0)
call CinematicFilterGenericBJ(2.,BLEND_MODE_MODULATE_2X,"ReplaceableTextures\\CameraMasks\\White_mask.blp",20.,25.,20.,75.,11,(120+(fogcolor*100))/2.55,11,25.) //divide by 2.55, because it's a color %!
else
call SetTerrainFogEx(0,zstart,zend,.25,fogcolor,fogcolor,fogcolor)
call CinematicFilterGenericBJ(.5,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\White_mask.blp",50.,100.,50.,.0,50.,100.,50.,100.)
call CinematicFilterGenericBJ(.0,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",20.,20.,20.,.0,fogcolor*100,fogcolor*100,fogcolor*100,70.)
endif
endif
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library FilterFuncs requires GeneralUse
native UnitAlive takes unit id returns boolean
function IsUnitAlive takes nothing returns boolean
return UnitAlive(GetFilterUnit())
endfunction
function IsUnitAliveAndEnemyWithInfected takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(13)) and UnitAlive(GetFilterUnit()) and GetUnitTypeId(GetFilterUnit())!='n00L'
endfunction
function IsUnitAliveAndEnemyWithNPC takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(11)) and UnitAlive(GetFilterUnit())
endfunction
function IsUnitAliveAndFriendlyWithNPC takes nothing returns boolean
return IsPlayerAlly(GetOwningPlayer(GetFilterUnit()),Player(11)) and UnitAlive(GetFilterUnit())
endfunction
function IsUnitAliveAndFromPlayer takes nothing returns boolean
return IsUnitInGroup(GetFilterUnit(),PLAYER_UNITS) and UnitAlive(GetFilterUnit())
endfunction
function IsUnitAliveAndFromUSMC takes nothing returns boolean
return GetOwningPlayer(GetFilterUnit())==Player(11) and IsUnitAliveBJ(GetFilterUnit())
endfunction
function IsUnitDebuffed takes unit u returns boolean
return (GetUnitAbilityLevel(u,'B012')>0) or (GetUnitAbilityLevel(u,'B011')>0) or (GetUnitAbilityLevel(u,'B00C')>0) or (GetUnitAbilityLevel(u,'B005')>0) or (GetUnitAbilityLevel(u,'B00M')>0) or (GetUnitAbilityLevel(u,'B00Z')>0) or (GetUnitAbilityLevel(u,'B00D')>0)
endfunction
function FilterPlayingPlayer takes nothing returns boolean
return (GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER) and (GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
function IsTargetBigEnemyMofo takes nothing returns boolean
local integer i=1
if IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(11)) and UnitAlive(GetFilterUnit()) then
loop
exitwhen i>BIG_ENEMY_MOFO_AMT
if GetUnitTypeId(GetFilterUnit())==BIG_ENEMY_MOFO[i] then
return true
endif
set i=i+1
endloop
endif
return false
endfunction
function IsTargetBigEnemyMofoPUT takes nothing returns boolean
local integer i=1
local boolean b = IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(11))
if b and UnitAlive(GetFilterUnit()) then
loop
exitwhen i>BIG_ENEMY_MOFO_AMT
if GetUnitTypeId(GetFilterUnit())==BIG_ENEMY_MOFO[i]then
return true
endif
set i=i+1
endloop
endif
if IsUnitInGroup(GetFilterUnit(),PLAYER_UNITS) and UnitAlive(GetFilterUnit()) then
return true
endif
if GetUnitTypeId(GetFilterUnit())=='h00G' or GetUnitTypeId(GetFilterUnit())=='h01S' and b then
return true
endif
return false
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SoundFuncs requires GeneralUse
private struct deafenData
real v = 0.
player p
endstruct
private function SetPlayerVolume takes player p,real v returns nothing
if GetLocalPlayer()==p then
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UNITSOUNDS,v*.5)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_SPELLS,v)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_COMBAT,v)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_FIRE,v)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UI,v)
call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_AMBIENTSOUNDS,v)
endif
endfunction
function PlaySoundForPlayer takes player p,sound s returns nothing
if GetLocalPlayer()==p then
call StartSound(s)
endif
endfunction
function PlaySoundAtUnitLoc takes sound s,unit u returns nothing
call SetSoundPosition(s,GetUnitX(u),GetUnitY(u),10)
call StartSound(s)
endfunction
function SoundDistantExplosion takes nothing returns nothing
call StartSound(SOUND_DISTANT_EXPLOSION[GetRandomInt(1,7)])
endfunction
function SoundDistantArtillery takes nothing returns nothing
call StartSound(SOUND_DISTANT_ARTILLERY[GetRandomInt(1,4)])
endfunction
function SoundDistantGrenade takes nothing returns nothing
call StartSound(SOUND_GRENADE3_DIST[GetRandomInt(1,2)])
endfunction
private function DeafenCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local deafenData dat = GetTimerStructA(t)
call SetPlayerVolume(dat.p,dat.v)
if dat.v>=100 then
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
else
set dat.v=dat.v+1
endif
set t = null
endfunction
function DeafenPlayersInDistanceOfPoint takes real x, real y,real d returns nothing
local integer i=0
local timer t
local deafenData dat
loop
exitwhen i>10
if (DistanceBetweenPointsXY(GetUnitX(PLAYER_UNIT[i+1]),GetUnitY(PLAYER_UNIT[i+1]),x,y)<=d) and IsUnitAliveBJ(PLAYER_UNIT[i+1]) then
call PlaySoundForPlayer(GetOwningPlayer(PLAYER_UNIT[i+1]),gg_snd_ring4)
set t = NewTimer()
set dat = deafenData.create()
set dat.v = .0
set dat.p = Player(i)
call SetTimerStructA(t,dat)
call TimerStart(t,.14,true,function DeafenCallback)
set t = null
endif
set i=i+1
endloop
endfunction
function DeafenPlayersInDistanceOfLoc takes location l,real d returns nothing
call DeafenPlayersInDistanceOfPoint(GetLocationX(l),GetLocationY(l),d)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library CommFuncs requires GeneralUse, SoundFuncs, FilterFuncs
globals
private boolean ALREADY_PLAYING = false
private unit TRANSFER_UNIT
endglobals
function Transmission takes real duration, string s returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,duration,s)
call StartSound(SOUND_RADIO_FEEDBACK_C_1)
endfunction
function FieldChat takes unit u, real time, string text returns nothing
local texttag t
local real x
local real y
if GetWidgetLife(u)>0.405 then
set x = GetUnitX(u)
set y = GetUnitY(u)
call PlaySoundOnUnitBJ(SOUND_RADIO_FEEDBACK_C_2, 100, u)
set t = CreateTextTag()
call SetTextTagText(t, text, 0.0184)
call SetTextTagPos(t, x, y, 25.0)
call SetTextTagVisibility(t, true)
call SetTextTagLifespan(t, time)
call SetTextTagPermanent(t, false)
endif
set t = null
endfunction
function DisplayTimedTextWithRadioFeedback takes real duration, string s returns nothing
call Transmission(duration,s)
endfunction
private function MOSChat_internal takes unit u, real d, string s, boolean playSound returns nothing
local texttag t
local real x
local real y
if GetUnitState(u,UNIT_STATE_LIFE)>0 then
set x=GetUnitX(u)
set y=GetUnitY(u)
if playSound then
call PlaySoundAtUnitLoc(SOUND_RADIO_FEEDBACK_C_2,u)
endif
set t=CreateTextTag()
call SetTextTagText(t,s,.0184)
call SetTextTagPos(t,x,y,25.)
call SetTextTagVisibility(t,true)
call SetTextTagLifespan(t,d)
call SetTextTagPermanent(t,false)
endif
set t=null
endfunction
function MOSChat takes unit u, real duration, string message returns nothing
call MOSChat_internal(u,duration,message,true)
endfunction
function MOSChatSilent takes unit u, real duration, string message returns nothing
call MOSChat_internal(u,duration,message,false)
endfunction
private function IsUnitAliveAndAlliedWithTransferUnit takes nothing returns boolean
return IsUnitAlly(TRANSFER_UNIT,GetOwningPlayer(GetFilterUnit()))and UnitAlive(GetFilterUnit())
endfunction
private function NPCGiveOrderChat_thread takes unit commander, integer order, boolean repeatConfirm returns nothing
local real x
local real y
local sound s
local group g
local unit u
loop
exitwhen ALREADY_PLAYING==false
call PolledWait2(.8)
endloop
set ALREADY_PLAYING = true
if commander!=null and UnitAlive(commander) then
set TRANSFER_UNIT = commander
set x = GetUnitX(commander)
set y = GetUnitY(commander)
set g=CreateGroup()
call GroupEnumUnitsInRange(g,x,y,1200,Condition(function IsUnitAliveAndAlliedWithTransferUnit))
set u = GroupPickRandomUnit(g)
set s=SOUND_ON[GetRandomInt(1,2)]
call PlaySoundAtUnitLoc(s,commander)
call PolledWait2(GetSoundDurationBJ(s))
set s=SOUND_MARINE_CHAT[order]
call PlaySoundAtUnitLoc(s,commander)
call PolledWait2(GetSoundDurationBJ(s))
set s=SOUND_OFF[GetRandomInt(1,3)]
call PlaySoundAtUnitLoc(s,commander)
call PolledWait2(GetSoundDurationBJ(s))
if repeatConfirm and commander!=u and u!=null and UnitAlive(u) then
set s=SOUND_ON[GetRandomInt(1,2)]
call PlaySoundAtUnitLoc(s,u)
call PolledWait2(GetSoundDurationBJ(s))
set s=SOUND_MARINE_CHAT[GetRandomInt(1,2)]
call PlaySoundAtUnitLoc(s,u)
call PolledWait2(GetSoundDurationBJ(s))
set s=SOUND_OFF[GetRandomInt(1,3)]
call PlaySoundAtUnitLoc(s,u)
call PolledWait2(GetSoundDurationBJ(s))
endif
endif
set u = null
set s = null
call DestroyGroup(g)
set g=null
set ALREADY_PLAYING = false
endfunction
function NPCGiveOrderChat takes unit commander, integer order, boolean repeatConfirm returns nothing
call NPCGiveOrderChat_thread.execute(commander,order,repeatConfirm)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library AIFuncs requires GeneralUse, FilterFuncs, CommFuncs
function AttackPlayerUnit takes unit attacker returns nothing
local group g//=CreateGroup() functions return a new group
local unit u
local integer i
if AttackTents==false and AttackConvoy==false then
set g=GetUnitsInRectMatching(GetWorldBounds(),Condition(function IsUnitAliveAndFromPlayer))
set u=GroupPickRandomUnit(g)
call IssuePointOrderById(attacker,OID_attack,GetUnitX(u), GetUnitY(u))
elseif AttackTents==true then
set i=GetRandomInt(1, 3)
if IsUnitGroupDeadBJ(Engineers[i]) or IsUnitGroupEmptyBJ(Engineers[i]) then
set g=GetUnitsOfPlayerMatching(P_USMC,Condition(function IsUnitAlive))
set u=GroupPickRandomUnit(g)
call IssuePointOrderById(attacker,OID_attack,GetUnitX(u), GetUnitY(u))
else
call IssuePointOrderById(attacker,OID_attack,GetRandomReal(GetRectMinX(Base[i]), GetRectMaxX(Base[i])), GetRandomReal(GetRectMinY(Base[i]), GetRectMaxY(Base[i])))
endif
elseif AttackConvoy==true then
set g=GetUnitsOfPlayerMatching(P_USMC,Condition(function IsUnitAlive))
//set g=GetUnitsInRectMatching(GetWorldBounds(),Condition(function IsUnitAliveAndFromUSMC))
set u=GroupPickRandomUnit(g)
call IssuePointOrderById(attacker,OID_attack,GetUnitX(u), GetUnitY(u))
endif
call DestroyGroup(g)
set g=null
set u = null
endfunction
function AttackCrashVictim takes unit attacker returns nothing
local unit u=GroupPickRandomUnit(GROUP_CRASH_VICTIMS)
local real x
local real y
if u != null then
set x = GetUnitX(u)
set y = GetUnitY(u)
call IssuePointOrderById(attacker,OID_attack,x,y)
endif
set u = null
endfunction
function USMCRunFromExplosion_filter takes nothing returns boolean
return (GetOwningPlayer(GetFilterUnit())==Player(11)) and IsUnitAliveBJ(GetFilterUnit()) and not IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)
endfunction
function USMCRunFromExplosion takes real boomX, real boomY, real radius returns nothing
local real runnerX
local real runnerY
local real safetyX
local real safetyY
local real angle
local unit u
local group g=CreateGroup()
local boolexpr bexp=Condition(function USMCRunFromExplosion_filter)
call GroupEnumUnitsInRange(g,boomX,boomY,radius,bexp)
set u=FirstOfGroup(g)
call NPCGiveOrderChat(u,GetRandomInt(3,4),true)
loop
set u=FirstOfGroup(g)
exitwhen u==null
set runnerX = GetUnitX(u)
set runnerY = GetUnitY(u)
set angle = AngleBetweenPointsXY(boomX,boomY,runnerX,runnerY)
set safetyX = runnerX+radius*Cos(angle*bj_DEGTORAD)
set safetyY = runnerY+radius*Sin(angle*bj_DEGTORAD)
call IssuePointOrderById(u,OID_move,safetyX,safetyY)
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set u=null
call DestroyBoolExpr(bexp)
set bexp=null
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpawnFuncs initializer Init requires GeneralUse, AIFuncs
globals
timer Spawn_Delay
endglobals
function LessThanXInfected takes integer i returns boolean
call GroupEnumUnitsOfPlayer(GLOBAL_ENUM_GROUP,Player(15),Condition(function IsUnitAlive))
if DEFEATED or CountUnitsInGroup(GLOBAL_ENUM_GROUP)>=i then
call GroupClear(GLOBAL_ENUM_GROUP)
return false
endif
call GroupClear(GLOBAL_ENUM_GROUP)
return true
endfunction
function SpawnItemMap takes integer count, integer itype returns nothing
local location l
local integer i = 1
loop
exitwhen i > count
loop
set l = GetRandomLocInRect(GetPlayableMapRect())
exitwhen not RectContainsLoc(gg_rct_BlackArea1,l) and not RectContainsLoc(gg_rct_BlackArea2,l)
call RemoveLocation(l)
endloop
call CreateItemLoc(itype, l)
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",l))
call RemoveLocation(l)
set i = i + 1
endloop
set l = null
endfunction
function SpawnItemsInRect takes integer itemID, integer count, rect r returns nothing
local integer i=1
local real x
local real y
loop
exitwhen i > count
set x = GetRandomReal(GetRectMinX(r),GetRectMaxX(r))
set y = GetRandomReal(GetRectMinY(r),GetRectMaxY(r))
call CreateItem(itemID,x,y)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",x,y))
set i = i + 1
endloop
endfunction
function SpawnItemsInRectCent takes integer count, rect r, integer itemID returns nothing
local integer i=1
local real x
local real y
loop
exitwhen i > count
set x = GetRectCenterX(r)+GetRandomReal(-150,150)
set y = GetRectCenterY(r)+GetRandomReal(-150,150)
call CreateItem(itemID,x,y)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",x,y))
set i = i + 1
endloop
endfunction
function SpawnInfectedOfType takes integer id, real count, rect spawnrec returns unit
local integer index = 1
loop
exitwhen Game_Paused == false
call PolledWait2(.5)
endloop
loop
exitwhen index > R2I(count)
set bj_lastCreatedUnit=CreateUnit(Player(15),id,GetRandomReal(GetRectMinX(spawnrec), GetRectMaxX(spawnrec)),GetRandomReal(GetRectMinY(spawnrec), GetRectMaxY(spawnrec)),GetRandomInt(1,360))
call AttackPlayerUnit(bj_lastCreatedUnit)
call RemoveGuardPosition(bj_lastCreatedUnit)
// Locust Swarm
if id=='n00W' then
call IssueImmediateOrderById(bj_lastCreatedUnit,OID_locustswarm)
endif
// Mutated Dog
if id=='n00Z' then
call TriggerRegisterUnitEvent(KA,bj_lastCreatedUnit,EVENT_UNIT_DAMAGED)
endif
if id=='n00E' then
call SetUnitExploded(bj_lastCreatedUnit,true)
endif
//Terrorizers
if AVERAGE_XP_NO_HIGH_RANKS>=80000 and id==ZID_Terrorizer and GetRandomInt(1,2)==1 then
call UnitAddAbility(bj_lastCreatedUnit,'A07X')
endif
// Zombie grumble
if id=='n000' or id=='n001' or id=='n002' or id=='n00E' and GetRandomInt(1,10)==1 then
call TriggerRegisterUnitEvent(lA,bj_lastCreatedUnit,EVENT_UNIT_ACQUIRED_TARGET)
endif
set index = index + 1
call PolledWait2(.2)
endloop
return bj_lastCreatedUnit
endfunction
function SpawnInfectedOfType_OLDFUNC takes integer unitID returns nothing
call SpawnInfectedOfType(unitID,1,SPAWN_INFECTED_RECT)
endfunction
private function Init takes nothing returns nothing
set Spawn_Delay = NewTimer()
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library FuncPack requires GeneralUse, UA2General, VisualsFuncs, FilterFuncs, SoundFuncs, CommFuncs, AIFuncs, SpawnFuncs
endlibrary
//TESH.scrollpos=417
//TESH.alwaysfold=0
library MissionUmbrella initializer Init requires GlobalFuncs, UmbrellaCheckPoints
//TRIG: Pb, Func: J3
//NEEDS: A lot of shit
globals
public trigger T
rect array UmbSniper
integer UmbSniperCnt
integer Umb_DWSLVL=7
endglobals
function PlayerVisionGroup takes nothing returns nothing
local unit u=GetEnumUnit()
local integer i=0
loop
exitwhen i>10
call UnitShareVision(u,Player(i),true)
set i=i+1
endloop
set u=null
endfunction
private function InitSquads takes nothing returns nothing
local integer i=1
loop
exitwhen i>10
set UMBRELLA_SQUADS[i]=CreateGroup()
set UMB_SquadActive[i]=false
set i=i+1
endloop
set UMB_IndexCnt=10
endfunction
private function SetPlayerAlliances takes nothing returns nothing
call SetPlayerAllianceStateBJ(GetEnumPlayer(),Player(14),2)
call SetPlayerAllianceStateBJ(Player(14),GetEnumPlayer(),2)
call SetPlayerAllianceStateBJ(GetEnumPlayer(),Player(11),0)
call SetPlayerAllianceStateBJ(Player(11),GetEnumPlayer(),0)
endfunction
private function RemoveNonHelicopter takes nothing returns nothing
local unit u = GetEnumUnit()
if GetOwningPlayer(u)==Player(12) and u!=SELECTION_HELICOPTER then
call RemoveUnit(u)
endif
set u = null
endfunction
private function SpawnSniperTeam takes rect rec returns nothing
local unit u=CreateUnit(Player(11),NID_Sniper,GetRectRandX(rec),GetRectRandY(rec),GetRandomDirectionDeg())
call InitiateUmbrellaSoldier(u)
call IssueImmediateOrder(u,"holdposition")
call IssueImmediateOrder(u,"defend")
set u=CreateUnit(Player(11),NID_Rifleman,GetRectRandX(rec),GetRectRandY(rec),GetRandomDirectionDeg())
call InitiateUmbrellaSoldier(u)
call IssueImmediateOrder(u,"holdposition")
call IssueImmediateOrder(u,"defend")
set u=null
endfunction
private function Actions takes nothing returns nothing
local location l=GetRectCenter(gg_rct_Generator1)
local location l2=GetRectCenter(LZ[GetRandomInt(1,9)])
local location l3=GetRectCenter(di)
local group g=CreateGroup()
local unit array LOCAL_UNIT
local rect array LOCAL_RECT
local integer i=1
local integer i2=1
local unit u
local unit u2
local unit u3
local force f=GetPlayersAllies(Player(0))
set UmbSniper[1]=gg_rct_UmbSniper01
set UmbSniper[2]=gg_rct_UmbSniper02
set UmbSniper[3]=gg_rct_UmbSniper03
set UmbSniper[4]=gg_rct_UmbSniper04
set UmbSniper[5]=gg_rct_UmbSniper05
set UmbSniper[6]=gg_rct_UmbSniper06
set UmbSniper[7]=gg_rct_UmbSniper07
set UmbSniper[8]=gg_rct_UmbSniper08
set UmbSniper[9]=gg_rct_UmbSniper09
set UmbSniper[10]=gg_rct_UmbSniper10
set UmbSniper[11]=gg_rct_UmbSniper11
set UmbSniper[12]=gg_rct_UmbSniper12
set UmbSniper[13]=gg_rct_UmbSniper13
set UmbSniper[14]=gg_rct_UmbSniper14
set UmbSniper[15]=gg_rct_UmbSniper15
set UmbSniper[16]=gg_rct_UmbSniper16
set UmbSniper[17]=gg_rct_UmbSniper17
set UmbSniperCnt=17
call DisableTrigger(Darkness_T)
call DisableTrigger(AssaultTroopers_T)
set LOCAL_RECT[1]=nn
set LOCAL_RECT[2]=an
set UMBRELLA_POWER_GENERATOR=CreateUnit(Player(12),'h01C',GetLocationX(l),GetLocationY(l),.0)
set g=GetUnitsInRectAll(ei)
call ForGroupBJ(g,function RemoveNonHelicopter)
call GroupClear(g)
call DestroyFogModifier(CreateFogModifierRectBJ(true,Player(14),FOG_OF_WAR_MASKED,GetPlayableMapRect()))
call ForForce(f,function SetPlayerAlliances)
call SetPlayerAllianceStateBJ(Player(12),Player(14),3)
call SetPlayerAllianceStateBJ(Player(14),Player(12),3)
call SetPlayerAllianceStateBJ(Player(11),Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),Player(11),0)
call InitSquads()
call EnableTrigger(UmbrellaSquadManagement_T)
call EnableTrigger(UmbrellaMadeContact_T)
call EnableTrigger(UmbDies_T)
// Already enabled...
//call EnableTrigger(wb)
//call EnableTrigger(NPCAssaultman_T)
//call EnableTrigger(NPCDesignatedMarksman_T)
//call EnableTrigger(NPCGhost_T)
call SetPlayerName(Player(11),"|cff808000Umbrella|r")
call SetPlayerName(Player(14),"|cff808000USMC|r")
call TriggerExecute(SpawnItems_T)
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(5.)
endloop
call PolledWait2(GetRandomReal(10.,15.))
call Transmission(10.,"|cff808000SOCOM:|r Patrol the sector for anything unusual and shoot any of the infected on sight. We need this sector secure to use it's roadways in the future.")
call PolledWait2(GetRandomReal(60,90))
call SpawnUmbrellaSquadOfType(1)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(GetRandomReal(5,15))
if PLAYING_PLAYERS>=7 then
call SpawnUmbrellaSquadOfType(1)
endif
call Transmission(10.,"|cff808000Unknown:|r This is Umbrella Corp., we're here to take over your operations in this sector.")
call PolledWait2(12.)
call Transmission(6.,"|cff808000Marine:|r Umbrella Corporation? What the hell are they doing on our channel?")
call PolledWait2(8)
call Transmission(6.,"|cff808000Marine:|r Lima-Six this is two-six. We have a situation involving Umbrella.")
call PolledWait2(6.)
call Transmission(10.,"|cff808000Lima-Six:|r Roger that. We're getting similar reports from other sectors, stand by.")
call PolledWait2(6.)
call Transmission(6.,"|cff808000Marine:|r Roger.")
call PolledWait2(10.)
call Transmission(10.,"|cff808000Umbrella:|r Leave the sector immediately. There is no victory against the might of Umbrella; any resistance is useless.")
call PolledWait2(10.)
call Transmission(10.,"|cff808000Umbrella:|r We will use force if necessary. Don't make us kill you, too.")
call PolledWait2(10.)
call Transmission(6.,"|cff808000Marine:|r Man that guy needs to shut up.")
call PolledWait2(6.)
call Transmission(8.,"|cff808000Marine:|r Roger that.")
call PolledWait2(18.)
call Transmission(10.,"|cff808000Lima-Six:|r I've sent the report up to divison. They're getting contact in many other sectors - be prepared.")
call PolledWait2(10.)
call Transmission(10.,"|cff808000Lima-Six:|r ROE is to shoot when shot at. Hold the sector until reinforcements arrive. In sector C and B we have intense fighting and the nearest relief is 30 clicks to the west - in the same situation. It's gonna be a long night.")
//tips
call PolledWait2(15.)
call Transmission(10.,"|cff808000TIP:|r It is advised you stay away from the towns and patrol the roads. Umbrella can sneak in the flanks of the towns and assault you when unexpected.")
call PolledWait2(14.)
call Transmission(10.,"|cff808000TIP:|r Whenever you engage or are engaged by the enemy, always prone (hotkey |cffffcc00ZE|r) immediately. This makes it a lot harder for them to hit you along with boosting your own attacks.")
call PolledWait2(14.)
call Transmission(7.,"|cff808000TIP:|r Be sure to not stand too close to your squad members, or you could get fragged.")
call PolledWait2(8.)
call Transmission(10.,"|cff808000TIP:|r Flares work both ways. We can see theirs, and they can see ours.")
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(1)
if DEFEATED then
return
endif
call QuestSetDescription(OBJECTIVE_QUEST,"Hold off Umbrella soldiers, patrol the roads, reinforce the sector, and await further orders.")
call PolledWait2(GetRandomReal(30.,70.))
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(1.)
if PLAYING_PLAYERS>=5 then
call SpawnUmbrellaSquadOfType(6)
endif
call PolledWait2(10.)
call Transmission(10.,"|cff808000TIP:|r It's much harder for them to find you if there is no contact. When they spot you all the squads will be alerted of your location.")
call PolledWait2(GetRandomReal(100,180))
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(GetRandomReal(20.,40.))
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(15.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(30.)
if PLAYING_PLAYERS>=10 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(1)
endif
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(GetRandomReal(90.,120.))
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Lima-Six:|r Some sort of bioweapon has been detected around sector C, and will likely spread to the nearby sectors. It has the appearance of a thick, black fog. Be advised.")
call PolledWait2(8.)
call Transmission(10.,"|cff808000SOCOM:|r Normally the biosphere cleanup processes would clear it, but the city power generator has been shut down by Umbrella. The only way to turn it back on is to recharge it fully with batteries.")
call PolledWait2(GetRandomReal(5.,15.))
// AND THERE SHALLT BE DARKNESS
call SetDayNightModels("","")
call PolledWait2(5.)
call Transmission(10.,"|cff808000SOCOM:|r We'll drop batteries off at the southwest LZ. Retrieve them and bring them to the power generator outside of the north town.")
call PolledWait2(20.)
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Umbrella Officer:|r Theres no chance of success, you must surrender now or perish.")
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(12.)
call SpawnUmbrellaSquadOfType(7)
call SpawnUmbrellaSquadOfType(9)
call PolledWait2(12.)
if DEFEATED then
return
endif
call StartSound(SOUND_UNDEAD_3)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(6)
endif
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,8.,2,100,30.,30.)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l2,8.,2,100,30.,30.)
call CreateItemLoc('I00I',l2)
call CreateItemLoc('I00I',l2)
call CreateItemLoc('I00I',l2)
call CreateItemLoc('I00I',l2)
call CreateItemLoc('I00I',l2)
call QuestSetDescription(OBJECTIVE_QUEST,"A bioweapon has leaked into your sector and is draining your vision. Umbrella has shut down the city power generator so it cannot activate the biosphere cleanup processes. Bring batteries from the southwest town to the power generator in the northwest to reactivate it.")
loop
exitwhen GetUnitState(UMBRELLA_POWER_GENERATOR,UNIT_STATE_MANA)>=1000
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,1,0,100,30.,30.)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l2,1,0,100,30.,30.)
call PolledWait2(1)
endloop
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(2.)
if DEFEATED then
return
endif
call SpawnInfectedOfType(ZID_Krill, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
call Transmission(10.,"|cff808000SOCOM:|r It will take a little bit for the systems to restart. Buckle down and wait until you have visibility.")
call PolledWait2(90.)
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(5.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(6)
endif
call PolledWait2(5.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>12000 then
call SpawnUmbrellaSquadOfType(7)
endif
call PolledWait2(20.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(20.)
if DEFEATED then
return
endif
call StopSound(SOUND_UNDEAD_3,true,true)
call StartSound(SOUND_REINCARNATION)
// AND THERE SHALLT BE LIGHT
call SetDayNightModels("Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl","Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl")
call AwardObjectiveXP(225.,"Power generator restored")
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival as well as cleaning Umbrella out of the sector. Fanning the area for equipment is suggested.")
call PolledWait2(30.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(1.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(1)
endif
call PolledWait2(1.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(60)
if DEFEATED then
return
endif
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(2)
endif
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>35000 then
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(8)
endif
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(5.)
call SpawnUmbrellaSquadOfType(9)
call PolledWait2(5.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(5.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>20000 then
call SpawnUmbrellaSquadOfType(7)
endif
call PolledWait2(5.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(5.)
if PLAYING_PLAYERS>=4 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(5)
endif
call PolledWait2(90.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(5.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(140.)
if DEFEATED then
return
endif
//================================
// Umbrella Check Point Mission
//================================
call Transmission(10.,"|cff808000Lima-Six:|r Umbrella is attempting to take over and control your sector and is sending out soldiers at key check points. Sattelite Reconnaissance has picked up these spots and will ping them on your digital map.")
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r Your sector contains necessary roads and supply lines linking our base of operations to other units in nearby sectors and we CANNOT lose the sector to them. Eliminate the guards within |cff80800010|r minutes and await further orders.")
call QuestSetDescription(OBJECTIVE_QUEST,"Eliminate all Umbrella guards within |cff80800010|r minutes and await further orders.")
call StartSound(SOUND_UNDEAD_X1)
call TriggerExecute(UmbrellaCheckPoints_T)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(2)
call SpawnUmbrellaSquadOfType(9)
set i=1
loop
exitwhen IsUnitGroupDeadBJ(UMBRELLA_CHECKPOINT_GROUP) or i>=120
call PolledWait2(5.)
set i2=1
loop
exitwhen UMBRELLA_CHECKPOINT_RECTS[i2]==null
set l=GetRectCenter(UMBRELLA_CHECKPOINT_RECTS[i2])
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,GetLocationX(l),GetLocationY(l),1.,0,100.,.0,.0)
call RemoveLocation(l)
set i2=i2+1
endloop
set i=i+1
endloop
// PERHAPS ADD A REWARD FOR KILLING WITHIN TIMER?
call Reinforcements(GetRectCenterX(gg_rct_RoadExit68), GetRectCenterY(gg_rct_RoadExit68))
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(10.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(90.)
if DEFEATED then
return
endif
//==========================
// Sparky Sparky Boom Man!
//==========================
call StartSound(SOUND_UNDEAD_2)
set u=CreateUnit(Player(15),ZID_Combustor,.0,15.,10.)
call AttackPlayerUnit(u)
call GroupAddUnit(g,u)
set u=CreateUnit(Player(15),'n00U',.0,15.,10.)
//call GroupAddUnit(g,u)
call AttackPlayerUnit(u)
set u=CreateUnit(Player(15),'n00V',.0,15.,10.)
//call GroupAddUnit(g,u)
call AttackPlayerUnit(u)
set u=CreateUnit(Player(15),'u00C',.0,15.,10.)
call AttackPlayerUnit(u)
set u=CreateUnit(Player(15),'u00C',.0,15.,10.)
call AttackPlayerUnit(u)
set u=CreateUnit(Player(15),'u00C',.0,15.,10.)
call AttackPlayerUnit(u)
set u=CreateUnit(Player(15),'u00C',.0,15.,10.)
call AttackPlayerUnit(u)
call SetPlayerAllianceStateBJ(Player(11),Player(15),2)
call SetPlayerAllianceStateBJ(Player(15),Player(11),2)
call Transmission(10.,"|cff808000Lima-Six:|r We just got word that Sector E got hit. 20 are dead and a team of scouts got wiped out. Whatever it was, it's entering your sector.")
call PolledWait2(6.)
call SpawnUmbrellaSquadOfType(2)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(2.)
call Transmission(10.,"|cff808000Lima-Six:|r Their SITREP indicated some kind of armored mutant that somehow blew everything to pieces. It doesn't attack Umbrella and no one can hide from it. Keep your eyes open.")
call PolledWait2(8.)
call Transmission(10.,"|cff808000Marine:|r It's like Bonnie and Dolly all over again.")
if DEFEATED then
return
endif
call QuestSetDescription(OBJECTIVE_QUEST,"Destroy whatever has entered your sector. Kill them to retain order and security in the sector.")
call SpawnUmbrellaSquadOfType(2)
loop
exitwhen IsUnitGroupDeadBJ(g)
call PolledWait2(2.)
endloop
call SetPlayerAllianceStateBJ(Player(11),Player(15),0)
call SetPlayerAllianceStateBJ(Player(15),Player(11),0)
if DEFEATED then
return
endif
call StopSound(SOUND_UNDEAD_2,true,true)
call StartSound(SOUND_FLASHBACK)
call PolledWait2(2.5)
call AwardObjectiveXP(195,"Combustor killed")
call PolledWait2(15.)
call Transmission(10.,"|cff808000SOCOM:|r Nice work, team. Await further orders.")
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival as well as cleaning Umbrella out of the sector. Fanning the area for equipment is suggested.")
call PolledWait2(180.)
//==========================
// Resupply
//==========================
call Transmission(10.,"|cff808000Lima-Six:|r Umbrella is sending in heavy amounts of firepower in Sector E. We can barely even hold the sector so we're going to fallback to yours. Be prepared for them.")
call PolledWait2(10.)
call Transmission(10.,"|cff808000Lima-Six:|r Easy Company is going to resupply you for what is coming. They'll be taking an APC from the South road and dump off equipment in the South town. Soldiers are going to get evac there from the East too, so be prepared.")
call QuestSetDescription(OBJECTIVE_QUEST,"Sector E is being overrun. Casualties will recieve evac in your sector and arrive in the East so be prepared. Easy Company will resupply you from the south.")
call PolledWait2(30.)
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(2.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(8)
endif
call PolledWait2(2.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(10)
endif
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(9)
call PolledWait2(2.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>20000 then
call SpawnUmbrellaSquadOfType(7)
endif
call PolledWait2(15.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(15.)
call SpawnUmbrellaSquadOfType(6)
call PolledWait2(15.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>20000 then
call SpawnUmbrellaSquadOfType(6)
endif
call PolledWait2(35.)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l3,8.,2,100,30.,30.)
call PolledWait2(2.)
set l3=GetRectCenter(gg_rct_RoadExit66)
set u2=CreateUnit(Player(14),'h00B',GetLocationX(l3),GetLocationY(l3),90.)
set LOCAL_UNIT[1]=CreateUnit(Player(14),'h009',GetLocationX(l3),GetLocationY(l3),90.)
set LOCAL_UNIT[2]=CreateUnit(Player(14),'h009',GetLocationX(l3),GetLocationY(l3),90.)
set LOCAL_UNIT[3]=CreateUnit(Player(14),'h009',GetLocationX(l3),GetLocationY(l3),90.)
call RemoveLocation(l3)
loop
exitwhen RectContainsUnit(gg_rct_Town2,u2) or IsUnitDeadBJ(u2)
call PolledWait2(2)
set l3=GetRectCenter(gg_rct_Town2)
call IssuePointOrderByIdLoc(u2,OID_move,l3)
call RemoveLocation(l3)
if GetRandomInt(1,3)==1 then
call IssuePointOrder(LOCAL_UNIT[1],"move",GetUnitX(u2)-250,GetUnitY(u2))
call IssuePointOrder(LOCAL_UNIT[2],"move",GetUnitX(u2)+250,GetUnitY(u2))
call IssuePointOrder(LOCAL_UNIT[3],"move",GetUnitX(u2),GetUnitY(u2)-250)
else
call IssuePointOrder(LOCAL_UNIT[1],"attack",GetUnitX(u2)-250,GetUnitY(u2))
call IssuePointOrder(LOCAL_UNIT[2],"attack",GetUnitX(u2)+250,GetUnitY(u2))
call IssuePointOrder(LOCAL_UNIT[3],"attack",GetUnitX(u2),GetUnitY(u2)-250)
endif
endloop
if DEFEATED then
return
endif
if IsUnitDeadBJ(u2) then
call AwardObjectiveXP(-38,"APC killed")
call KillUnit(LOCAL_UNIT[1])
call KillUnit(LOCAL_UNIT[2])
call KillUnit(LOCAL_UNIT[3])
call QuestSetDescription(OBJECTIVE_QUEST,"Sector E is being overrun. Casualties will recieve evac in your sector and arrive in the East so be prepared.")
else
call IssueImmediateOrderById(u2,OID_holdposition)
set l3=GetUnitLoc(u2)
call AwardObjectiveXP(85,"APC reached destination")
call PolledWait2(.5)
call CreateItemLoc('I004',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I004',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I004',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I006',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I006',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I006',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00O',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00O',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00W',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00W',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00S',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00S',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00S',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00S',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I005',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I005',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I003',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I003',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00N',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00F',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call CreateItemLoc('I00F',OffsetLocation(l3,GetRandomReal(-250,250),GetRandomReal(-250,250)))
call RemoveLocation(l3)
set l3=GetRectCenter(gg_rct_RoadExit68)
call IssuePointOrderByIdLoc(u2,OID_move,l3)
call QuestSetDescription(OBJECTIVE_QUEST,"Sector E is being overrun. Casualties will recieve evac in your sector and arrive in the East so be prepared. Use the equipment from Easy company to its full extent.")
// EXTRACT NPC AND UNITS
loop
exitwhen RectContainsUnit(gg_rct_RoadExit68,u2) or IsUnitDeadBJ(u2)
call PolledWait2(2)
call IssuePointOrderByIdLoc(u2,OID_move,l3)
call IssuePointOrderByIdLoc(LOCAL_UNIT[1],OID_attack,l3)
call IssuePointOrderByIdLoc(LOCAL_UNIT[2],OID_attack,l3)
call IssuePointOrderByIdLoc(LOCAL_UNIT[3],OID_attack,l3)
endloop
if DEFEATED then
return
endif
call RemoveUnit(u2)
call RemoveUnit(LOCAL_UNIT[1])
call RemoveUnit(LOCAL_UNIT[2])
call RemoveUnit(LOCAL_UNIT[3])
endif
//==========================
// Casualties
//==========================
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r Casualties are on their way.")
call PolledWait2(15.)
call SpawnUmbrellaSquadOfType(9)
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Lima-Six:|r Casualties have arrived at the 2 eastern roads. Bring them to the LZ.")
call QuestSetDescription(OBJECTIVE_QUEST,"Casualties are arriving at the 2 eastern roads and you must evacuate them at the designated LZ.")
set LOCAL_RECT[1]=gg_rct_RoadExit64
set LOCAL_RECT[2]=gg_rct_RoadExit65
set i=1
loop
exitwhen i>PLAYING_PLAYERS+1
set l3=GetRandomLocInRect(LOCAL_RECT[GetRandomInt(1,2)])
call CreateItemLoc('I00X',l3)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l3,12.,bj_MINIMAPPINGSTYLE_SIMPLE,30.,100.,30.)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l3,4.,bj_MINIMAPPINGSTYLE_ATTACK,100.,30.,30.)
set i=i+1
call RemoveLocation(l3)
call PolledWait2(.35)
endloop
call PolledWait2(15.)
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Lima-Six:|r Scouts have picked up a surge in Umbrella activity going into your sector. Airborne reconnaissance has also picked up Umbrella sniper teams setting up in your sector.")
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(3.)
//==========================
// Snipers!
//==========================
set i=1
loop
exitwhen i>3
call SpawnSniperTeam(UmbSniper[GetRandomInt(1,UmbSniperCnt)])
set i=i+1
endloop
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>20000 then
call SpawnUmbrellaSquadOfType(8)
endif
call PolledWait2(3.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(10.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(3)
endif
call PolledWait2(5.)
if PLAYING_PLAYERS>=6 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(4)
endif
call PolledWait2(5.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>15000 then
call SpawnUmbrellaSquadOfType(3)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(4)
endif
call PolledWait2(15.)
if PLAYING_PLAYERS>=10 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(8)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(7)
endif
call PolledWait2(15.)
if PLAYING_PLAYERS>=10 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(8)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(7)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(10)
endif
call PolledWait2(10.)
if DEFEATED then
return
endif
// CREATE A TRANSPORT HELICOPTER
set UMBRELLA_EVAC_RECT=LZ[GetRandomInt(1,LZCount)]
set l3=GetRectCenter(UMBRELLA_EVAC_RECT)
set u3=CreateUnit(Player(14),'h015',GetLocationX(l3),GetLocationY(l3),270.)
call SetUnitFlyHeight(u3,50,200)
call PauseUnit(u3,true)
call EnableTrigger(UmbrellaMarineEvac_T)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l3,8.,2,30.,100.,30.)
call Transmission(10.,"|cff808000Lima-Six:|r The evac heli has arrived. Take the corpses to the LZ marked on your map.")
loop
exitwhen UMBRELLA_EVACUATED_MARINES>=PLAYING_PLAYERS+1
call PolledWait2(2.)
endloop
if DEFEATED then
return
endif
call AwardObjectiveXP(275,"Casualties evacuated")
call PolledWait2(5.)
call Transmission(10.,"|cff808000SOCOM:|r Now they can recieve proper funerals. Await further orders.")
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival as well as cleaning Umbrella out of the sector. Fanning the area for equipment is suggested.")
call SetUnitFlyHeight(u3,1500,300)
call PauseUnit(u3,false)
call PolledWait2(.2)
call RemoveLocation(l3)
// Heli flies off to left border
set l3=GetRandomLocInRect(MAP_BORDER_L)
call IssuePointOrderByIdLoc(u3,OID_move,l3)
call RemoveLocation(l3)
call PolledWait2(5.)
call RemoveUnit(u3)
call PolledWait2(90.)
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(1.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(20.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(1)
endif
call PolledWait2(4.)
if PLAYING_PLAYERS>=8 and AVERAGE_XP_NO_HIGH_RANKS>10000 then
call SpawnUmbrellaSquadOfType(2)
endif
call PolledWait2(120.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(1.)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(1.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(20.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(90.)
if DEFEATED then
return
endif
//==========================
// War Zone Final Mission
//==========================
call Transmission(10.,"|cff808000SOCOM:|r Umbrella is flooding out of sector E and Bravo Company is on their way to aid you. Secure the North town and get ready, it's going to turn into a war zone in there.")
call PolledWait2(30.)
set UMBRELLA_WARZONE_STARTED=true
call PolledWait2(30.)
if DEFEATED then
return
endif
call Reinforcements(GetRectCenterX(gg_rct_RoadExit68), GetRectCenterY(gg_rct_RoadExit68))
set l3=GetRectCenter(gg_rct_RoadExit68)
set i=1
loop
exitwhen i>12
set u=CreateUnit(Player(14),'h009',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
call UnitAddAbility(u,'SPRD')
set i=i+1
endloop
set i=1
loop
exitwhen i>4
set u=CreateUnit(Player(14),'h00E',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
call UnitAddAbility(u,'SPRD')
call UnitAddAbility(u,'JUMD')
set i=i+1
endloop
set i=1
loop
exitwhen i>3
set u=CreateUnit(Player(14),'h00V',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
call UnitAddAbility(u,'SPRD')
set u=CreateUnit(Player(14),'h00A',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
call UnitAddAbility(u,'SPRD')
set u=CreateUnit(Player(14),'h019',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
call UnitAddAbility(u,'SPRD')
set i=i+1
endloop
set u=CreateUnit(Player(14),'h00G',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
set u=CreateUnit(Player(14),'h00G',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
set u=CreateUnit(Player(14),'h01B',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
set i=1
loop
exitwhen i>3
set u=CreateUnit(Player(14),'h01E',GetLocationX(l3),GetLocationY(l3),.0)
call GroupAddUnit(UMBRELLA_FLOOD_SQUAD,u)
set i=i+1
endloop
call RemoveLocation(l3)
call GroupClear(g)
call GroupEnumUnitsOfPlayer(g,Player(14),BE_TRUE)
call ForGroup(g,function PlayerVisionGroup)
// used to be rects throughout the southwest town
set Fx[1]=GetRectCenter(gg_rct_TownGuard1)
set Fx[2]=GetRectCenter(gg_rct_TownGuard2)
set Fx[3]=GetRectCenter(gg_rct_TownGuard3)
set Fx[4]=GetRectCenter(gg_rct_TownGuard4)
set Fx[5]=GetRectCenter(gg_rct_TownGuard5)
set Fx[6]=GetRectCenter(gg_rct_TownGuard6)
call EnableTrigger(UmbrellaFlood_T)
call PolledWait2(8.)
call Transmission(10.,"|cff808000SOCOM:|r Reconnaissance has picked up the Umbrella squads from Sector E moving in towards your location. Destroy them and the sector should be secure.")
call QuestSetDescription(OBJECTIVE_QUEST,"Destroy all Umbrella squads.")
call PolledWait2(5.)
call StartSound(SOUND_WAR3X_MAINSCREEN)
call SpawnUmbrellaSquadOfType(1)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(9)
call PolledWait2(20.)
call SpawnUmbrellaSquadOfType(4)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(10)
call PolledWait2(2.)
call DisableTrigger(NPCGhost_T)
set DISABLE_ION_CANNON=true
call Transmission(10.,"|cff808000SOCOM:|r We have finally hacked their Ion Cannon uplinks and deactivated them. Good luck marines.")
call PolledWait2(20.)
call SpawnUmbrellaSquadOfType(4)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(3)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(3)
call PolledWait2(20.)
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(3)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(7)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(9)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(7)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(90.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(8.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(20.)
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(2)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(4)
call PolledWait2(20.)
if DEFEATED then
return
endif
call SpawnUmbrellaSquadOfType(5)
call PolledWait2(2.)
call SpawnUmbrellaSquadOfType(4)
loop
exitwhen UMB_SquadsActive==0
call PolledWait2(2.)
endloop
if DEFEATED then
return
endif
call DisableTrigger(InfestationLevel_T)
call DisableTrigger(SpawnLickerOrLeaper_T)
call DisableTrigger(SpawnInfected90_T)
call DisableTrigger(SpawnInfected180_T)
call DisableTrigger(SpawnInfected120_T)
call DisableTrigger(PlatoonDefeated_T)
call PauseAllUnitsBJ(true)
// AMHS REMOVAL: #### vC
// AMHS TAKEN OUT HERE ###
call FogEnableOff()
call FogMaskEnableOff()
call StartSound(SOUND_HUMAN_DEFEAT)
call AwardObjectiveXP(685,"Umbrella forces eliminated")
call PolledWait2(6.)
call AddDiffComp(GAME_MODE)
call Transmission(30.,"|cff0000FFThank you for playing Undead Assault II! Type '-save' to get your marine ID, which allows you to save and load experience. Visit the Undead Assault community at undeadassault.net!")
call StartSound(SOUND_HUMAN_DEFEAT)
call PolledWait2(46.)
call StartSound(SOUND_UNDEAD_X1)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaCheckPoints initializer Init requires GlobalFuncs
//TRIG: qb, Func: P3
globals
public trigger T
endglobals
private struct Jetpack
unit u
sound s
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Jetpack j = GetTimerStructA(t)
if GetUnitFlyHeight(j.u)<=1. then
call SetUnitPathing(j.u,true)
call SetUnitFlyHeight(j.u,.0,0)
call PauseUnit(j.u,false)
call StopSound(j.s,false,true)
call UnitRemoveAbility(j.u,'A04Q')
call InitiateUmbrellaSoldier(j.u)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call j.destroy()
endif
set t = null
endfunction
public function JetpackDown takes unit u returns nothing
local Jetpack j=Jetpack.create()
local timer t=CreateTimer()
local sound s=SOUND_OH_LARGE_BUILDING_FIRE_DefEAX
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call UnitAddAbility(u,'A04Q')
call SetUnitFlyHeight(u,1200.,0)
call SetUnitFlyHeight(u,.0,300)
call AttachSoundToUnit(s,u)
call SetSoundVolume(s,127)
call StartSound(s)
call PauseUnit(u,true)
set j.u=u
set j.s=s
call SetTimerStructA(t,j)
call TimerStart(t,4,false,function Callback)
endfunction
private function Actions takes nothing returns nothing
local unit u
local integer i=1
local integer i2=1
local location l
set UMBRELLA_CHECKPOINT_RECTS[1]=Road[37]
set UMBRELLA_CHECKPOINT_RECTS[2]=Road[12]
set UMBRELLA_CHECKPOINT_RECTS[3]=Road[48]
set UMBRELLA_CHECKPOINT_RECTS[4]=Road[56]
set UMBRELLA_CHECKPOINT_RECTS[5]=Road[42]
set UMBRELLA_CHECKPOINT_RECTS[6]=Road[60]
set UMBRELLA_CHECKPOINT_RECTS[7]=Road[03]
set UMBRELLA_CHECKPOINT_RECTS[8]=Road[14]
set UMBRELLA_CHECKPOINT_RECTS[9]=Road[46]
loop
exitwhen UMBRELLA_CHECKPOINT_RECTS[i2]==null
set i=1
set l=GetRectCenter(UMBRELLA_CHECKPOINT_RECTS[i2])
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,GetLocationX(l),GetLocationY(l),15.,2,100.,.0,.0)
call RemoveLocation(l)
set l=GetRandomLocInRect(UMBRELLA_CHECKPOINT_RECTS[i2])
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(.0,180.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,3)
call GroupAddUnit(UMBRELLA_CHECKPOINT_GROUP,u)
call JetpackDown(u)
call RemoveLocation(l)
loop
exitwhen i>GetRandomInt(2,5)
set l=GetRandomLocInRect(UMBRELLA_CHECKPOINT_RECTS[i2])
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(.0,180.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,3)
call GroupAddUnit(UMBRELLA_CHECKPOINT_GROUP,u)
call JetpackDown(u)
call RemoveLocation(l)
set i=i+1
endloop
set i2=i2+1
endloop
set u=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaMarineEvac initializer Init requires GlobalFuncs
//TRIG: sb, Func: t3
globals
public trigger T
endglobals
private function Evac takes nothing returns nothing
local unit u=GetEnumUnit()
if UnitHasItemOfTypeBJ(u,'I00X') then
call RemoveItem(GetItemOfTypeFromUnitBJ(u,'I00X'))
call AwardObjectiveXP(25,"Marine evacuated")
set UMBRELLA_EVACUATED_MARINES=UMBRELLA_EVACUATED_MARINES+1
endif
set u=null
endfunction
private function Actions takes nothing returns nothing
local group g=GetUnitsInRectAll(UMBRELLA_EVAC_RECT)
call ForGroup(g,function Evac)
call DestroyGroup(g)
set g=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,3.)
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CombustionMan initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return true
endfunction
private function Actions takes nothing returns nothing
local unit u
local unit d
local group g=GetUnitsOfType(ZID_Combustor)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitAliveBJ(u) then
set d=CreateUnit(GetOwningPlayer(u),'h021',GetUnitX(u),GetUnitY(u),0)
call UnitApplyTimedLife(d, 'BTLF', 1)
// double shot chance
if GetRandomInt(1,5)==1 then
call PolledWait2(GetRandomReal(.7,1.5))
set d=CreateUnit(GetOwningPlayer(u),'h021',GetUnitX(u),GetUnitY(u),0)
call UnitApplyTimedLife(d, 'BTLF', 1)
endif
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set u=null
set d=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T, 6, true)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaFlood initializer Init requires GlobalFuncs
//TRIG: Sb, Func: T3
//NEEDS: globallocationarray:Fx[] UMBRELLA Mission zones
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local group g=CreateGroup()
local unit u
local location l
local location l2
call GroupAddGroup(UMBRELLA_FLOOD_SQUAD,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
set l = GetUnitLoc(u)
if GetUnitTypeId(u)=='h00G' then
set l2 = OffsetLocation(Fx[GetRandomInt(1,4)],GetRandomInt(-800,800),GetRandomInt(-800,800))
else
set l2 = OffsetLocation(Fx[GetRandomInt(5,6)],GetRandomInt(-300,300),GetRandomInt(-300,300))
endif
if DistanceBetweenPoints(l,l2)<=810 then
call IssueImmediateOrder(u,"holdposition")
call RecycleGuardPosition(u)
else
call IssuePointOrderByIdLoc(u,OID_attack,l2)
call IssueImmediateOrder(u,"berserk")
endif
call RemoveLocation(l)
call RemoveLocation(l2)
call GroupRemoveUnit(g,u)
call PolledWait2(.2)
endloop
call DestroyGroup(g)
set g = null
set l = null
set l2= null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,20.)
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaMadeContact initializer Init requires GlobalFuncs
//TRIG: tb, Func: Y3, Condition: U3
globals
public trigger T
private unit ATTACKER
private unit ATTACKED
private boolean ATTACKER_WAS_PLAYER
endglobals
private function Conditions takes nothing returns boolean
local unit a=GetAttacker()
local boolean b=(GetPlayerController(GetOwningPlayer(a))==MAP_CONTROL_USER and GetOwningPlayer(GetTriggerUnit())==Player(11)) or (GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_USER and GetOwningPlayer(a)==Player(11))
set a=null
return b
endfunction
private function DistanceBetweenCombatantsSmallerThan4000 takes nothing returns boolean
local unit u=GetFilterUnit()
local unit u2=ATTACKER
local location l=GetUnitLoc(u)
local location l2=GetUnitLoc(u2)
local real d=DistanceBetweenPoints(l,l2)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
set u2=null
return d<=4000
endfunction
private function AttackPlayerCombatant takes nothing returns nothing
local unit u
local unit u2=GetEnumUnit()
local location l
local location l2
if ATTACKER_WAS_PLAYER then
set u=ATTACKER
else
set u=ATTACKED
endif
set l=GetUnitLoc(u)
if not IsUnitInGroup(u2, MINI_SPRINTERS) then
call IssueImmediateOrder(u2,"berserk")
endif
set l2=OffsetLocation(l,GetRandomInt(-300,300),GetRandomInt(-300,300))
call IssuePointOrderByIdLoc(u2,OID_attack,l2)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
set u2=null
endfunction
private function Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit u2 = GetTriggerUnit()
local group g
local trigger t=GetTriggeringTrigger()
local boolexpr bexp
call DisableTrigger(t)
if TimerGetRemaining(TIMER_SELF_DEFENSE_BUFFER)<55. then
set ATTACKER = u
set ATTACKED = u2
// was grouping player 14, which is USMC. Changed it to 11.
set bexp=Condition(function DistanceBetweenCombatantsSmallerThan4000)
call GroupEnumUnitsOfPlayer(g,Player(11),bexp)
call DestroyBoolExpr(bexp)
if GetOwningPlayer(u)==MAP_CONTROL_USER then
set ATTACKER_WAS_PLAYER=true
else
set ATTACKER_WAS_PLAYER=false
endif
call ForGroup(g,function AttackPlayerCombatant)
call DestroyGroup(g)
// None of combatants was M70 Sentry Gun: Order u to command attack
if GetUnitTypeId(u)!='h006' then
call NPCGiveOrderChat(u,GetRandomInt(7,10),true)
endif
endif
set UMBRELLA_CURRENTLY_ATTACKING=true
call StartTimerBJ(TIMER_SELF_DEFENSE_BUFFER,false,60.)
call PolledWait2(6)
call EnableTrigger(t)
set t=null
set u=null
set u2=null
set g=null
set bexp=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaLostContact initializer Init requires GlobalFuncs
//TRIG: Tb, Func: z3, Timer: Go
private function Actions takes nothing returns nothing
local unit u = GroupPickRandomUnit(UMBRELLA_SQUADS[GetRandomInt(1,UMB_SquadsActive)])
set UMBRELLA_CURRENTLY_ATTACKING=false
// "Sight line is clear"
call NPCGiveOrderChat(u,11,true)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerExpireEvent(T,TIMER_SELF_DEFENSE_BUFFER)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbDies initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local unit u=GetDyingUnit()
loop
exitwhen i>UMB_IndexCnt or IsUnitInGroup(u,UMBRELLA_SQUADS[i])
set i=i+1
endloop
if i<=UMB_IndexCnt then
if IsUnitGroupDeadBJ(UMBRELLA_SQUADS[i]) then
set UMB_SquadsActive=UMB_SquadsActive-1
set UMB_SquadActive[i]=false
call GroupClear(UMBRELLA_SQUADS[i])
endif
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerRegisterPlayerUnitEvent(T,Player(11),EVENT_PLAYER_UNIT_DEATH,null)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UmbrellaSquadManagement initializer Init requires GlobalFuncs
//TRIG: ub, Func: Z3
globals
public trigger T
integer UMB_SquadsActive=0
boolean array UMB_SquadActive
integer UMB_IndexCnt // Initilized at Umbrella Mission trigger
group array UMBRELLA_SQUADS
boolean UMBRELLA_CURRENTLY_ATTACKING=false
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local integer gap=0
call DisableTrigger(T)
if DEFEATED then
return
endif
//call BJDebugMsg("UMB_IndexCnt: " + I2S(UMB_IndexCnt))
//call BJDebugMsg("UMB_SquadsActive: " + I2S(UMB_SquadsActive))
loop
exitwhen i > UMB_IndexCnt
if UMB_SquadActive[i] then
if gap>0 then
call GroupAddGroup(UMBRELLA_SQUADS[i],UMBRELLA_SQUADS[i-gap])
call GroupClear(UMBRELLA_SQUADS[i])
set UMB_SquadActive[i]=false
set UMB_SquadActive[i-gap]=true
set gap=0
endif
else
set gap=gap+1
endif
set i=i+1
endloop
//call BJDebugMsg("SM Check 1")
if UMBRELLA_CURRENTLY_ATTACKING then
set i=1
loop
exitwhen i>UMB_SquadsActive
call SendUmbrellaSquad(UMBRELLA_SQUADS[i])
set i=i+1
if GetRandomInt(1,3)==1 then
call PolledWait2(.4)
endif
endloop
else
set i=1
loop
exitwhen i>UMB_SquadsActive
if GetRandomInt(1,3)==1 then
call SendUmbrellaSquad(UMBRELLA_SQUADS[i])
call PolledWait2(.4)
endif
set i=i+1
endloop
endif
//call BJDebugMsg("SM Check 2")
call EnableTrigger(T)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerRegisterTimerEventPeriodic(T,15)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=95
//TESH.alwaysfold=0
library MissionStartup initializer Init requires GlobalFuncs, UmbrellaCheckPoints
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T2
public trigger TBE
public trigger TPET
public trigger TBD
integer PlacedN = 0
integer PlacedS = 0
real SporeScale = 60
real MissionTime = 0
private boolean MissionSuccess
private boolean CheckSentries=false
rect array Barricade
integer BarricadeCount
boolean array BarricadeRescued
boolean array BarricadeDead
string array FoundPoliceChat
group EscortedPolice=CreateGroup()
group BarricadedPolice=CreateGroup()
endglobals
//====================================-----Mission 1----====================================
private function SpawnPolice takes rect rec returns nothing
local real x=GetRandomReal(GetRectMinX(rec),GetRectMaxX(rec))
local real y=GetRandomReal(GetRectMinY(rec),GetRectMaxY(rec))
local integer id
local unit u
if GetRandomInt(1,2)==1 then
set id=NID_PoliceShotgun
else
set id=NID_PoliceRifle
endif
set u=CreateUnit(Player(12),id,x,y,GetRandomDirectionDeg())
call IssueImmediateOrder(u,"holdposition")
call GroupAddUnit(BarricadedPolice,u)
call TriggerRegisterUnitEvent(TBD,u,EVENT_UNIT_DEATH)
set u=null
endfunction
private function PoliceFilter takes nothing returns boolean
local unit u=GetFilterUnit()
local boolean b=GetUnitTypeId(u)==NID_PoliceShotgun or GetUnitTypeId(u)==NID_PoliceRifle and IsUnitAliveBJ(u)
set u=null
return b
endfunction
private function PoliceDies takes nothing returns nothing
local unit u=GetDyingUnit()
local group g=CreateGroup()
local integer i=1
loop
exitwhen RectContainsUnit(Barricade[i],u)
set i=i+1
endloop
call GroupEnumUnitsInRect(g,Barricade[i],Condition(function PoliceFilter))
if CountUnitsInGroup(g)==0 then
set BarricadeDead[i]=true
endif
call DestroyGroup(g)
set g=null
set u=null
endfunction
private function EnterBarricade_Conditions takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=GetPlayerId(GetOwningPlayer(u))<12 and IsUnitAliveBJ(u) and IsUnitType(u, UNIT_TYPE_HERO)
set u=null
return b
endfunction
private function EnterBarricade takes nothing returns nothing
local integer i=1
local unit u=GetEnteringUnit()
local group g
local unit gu
loop
exitwhen i>BarricadeCount or RectContainsUnit(Barricade[i],u)
set i=i+1
endloop
if i>BarricadeCount or BarricadeRescued[i] then
set u=null
set g=null
set gu=null
return
endif
set BarricadeRescued[i]=true
set g=CreateGroup()
call GroupEnumUnitsInRect(g,Barricade[i],Condition(function PoliceFilter))
call GroupAddGroup(g,EscortedPolice)
call Transmission(5,GetColorPlayerName(GetOwningPlayer(u))+" I've reached a barricade.")
call PolledWait2(1)
call FieldChat(GroupPickRandomUnit(g),3,"|cff808000Officer:|r Thank god! Let's go!")
loop
set gu=FirstOfGroup(g)
exitwhen gu==null
call IssuePointOrder(gu,"move",GetRectCenterX(Barricade[i]),GetRectCenterY(Barricade[i]))
call SetUnitOwner(gu,GetOwningPlayer(u),true)
call SelectUnitAddForPlayer(gu,GetOwningPlayer(u))
call GroupAddUnit(EscortedPolice,gu)
call GroupRemoveUnit(g,gu)
endloop
call DestroyGroup(g)
set g=null
set gu=null
set u=null
endfunction
private function PoliceEnterTown_Conditions takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=IsUnitInGroup(u, EscortedPolice)
set u=null
return b
endfunction
private function PoliceEnterTown takes nothing returns nothing
local unit u=GetEnteringUnit()
local rect r
if RectContainsUnit(gg_rct_Town1,u) then
set r=gg_rct_Town1
else
set r=gg_rct_Town2
endif
call GroupRemoveUnit(EscortedCivs,u)
call SetUnitOwner(u, Player(12), true)
call AwardObjectiveXP(3, "Police officer relieved")
call IssuePointOrder(u, "move", GetRectCenterX(r)+GetRandomReal(-500,500), GetRectCenterY(r)+GetRandomReal(-500,500))
call PolledWait2(15)
call RemoveUnit(u)
set u=null
set r=null
endfunction
private function BarricadeMission takes nothing returns nothing
local integer i=1
local boolean BarricadesRemain=false
local unit u
local group g=CreateGroup()
// init variables
set Barricade[1]=gg_rct_Barricade01
set Barricade[2]=gg_rct_Barricade02
set Barricade[3]=gg_rct_Barricade03
set Barricade[4]=gg_rct_Barricade04
set Barricade[5]=gg_rct_Barricade05
set BarricadeCount=5
set TBE=CreateTrigger()
call TriggerAddCondition(TBE,Condition(function EnterBarricade_Conditions))
call TriggerAddAction(TBE,function EnterBarricade)
set TPET=CreateTrigger()
call TriggerRegisterEnterRectSimple(TPET,gg_rct_Town1)
call TriggerRegisterEnterRectSimple(TPET,gg_rct_Town2)
call TriggerAddCondition(TPET,Condition(function PoliceEnterTown_Conditions))
call TriggerAddAction(TPET,function PoliceEnterTown)
set TBD=CreateTrigger()
call TriggerAddAction(TBD,function PoliceDies)
loop
exitwhen i>BarricadeCount
set BarricadeRescued[i]=false
set BarricadeDead[i]=false
call TriggerRegisterEnterRectSimple(TBE,Rect(GetRectMinX(Barricade[i])+200,GetRectMinY(Barricade[i])+200,GetRectMaxX(Barricade[i])-200,GetRectMaxY(Barricade[i])-200))
set i=i+1
endloop
call SpawnPolice(gg_rct_BarricadeSpawn01)
call SpawnPolice(gg_rct_BarricadeSpawn02)
call SpawnPolice(gg_rct_BarricadeSpawn03)
call SpawnPolice(gg_rct_BarricadeSpawn04)
call SpawnPolice(gg_rct_BarricadeSpawn05)
call SpawnPolice(gg_rct_BarricadeSpawn06)
call SpawnPolice(gg_rct_BarricadeSpawn07)
call SpawnPolice(gg_rct_BarricadeSpawn08)
call SpawnPolice(gg_rct_BarricadeSpawn09)
call SpawnPolice(gg_rct_BarricadeSpawn10)
call SpawnPolice(gg_rct_BarricadeSpawn11)
call SpawnPolice(gg_rct_BarricadeSpawn12)
call SpawnPolice(gg_rct_BarricadeSpawn13)
call SpawnPolice(gg_rct_BarricadeSpawn14)
call SpawnPolice(gg_rct_BarricadeSpawn15)
call Transmission(10.,"|cff808000Lima-Six:|r Second platoon, the local police force has set up barricades in the sector.")
call PolledWait2(4)
call Transmission(10.,"|cff808000Lima-Six:|r Your first objective is to relieve these barricades and lead them to the towns.")
call QuestSetDescription(OBJECTIVE_QUEST,"The police are holding up in barricades within the sector. Your objective is to relieve them and bring them to the towns.")
set i=1
loop
exitwhen i>BarricadeCount
call PingMinimapEx(GetRectCenterX(Barricade[i]),GetRectCenterY(Barricade[i]),1.9,111,37,131,false)
set i=i+1
endloop
set MissionTime=(260-10*PLAYING_PLAYERS)*MissionTimeModifier
loop
exitwhen MissionTime==0 or IsUnitGroupDeadBJ(BarricadedPolice)
set i=1
loop
exitwhen i>BarricadeCount
if not BarricadeRescued[i] and not BarricadeDead[i] then
call PingMinimapEx(GetRectCenterX(Barricade[i]),GetRectCenterY(Barricade[i]),1.9,111,37,131,false)
//call PolledWait2(.25)
endif
set i=i+1
endloop
call PolledWait2(2)
endloop
if DEFEATED then
return
endif
set i=1
loop
exitwhen i>BarricadeCount
if not BarricadeRescued[i] then
set BarricadesRemain=true
call SpawnInfectedOfType(ZID_Zombie, 10, Barricade[i])
call SpawnInfectedOfType(ZID_Boomer, 2, Barricade[i])
call SpawnInfectedOfType(ZID_ZombieFast, 2, Barricade[i])
call SpawnInfectedOfType(ZID_ZombieFat, 2, Barricade[i])
call SpawnInfectedOfType(ZID_ZombieDog, 2, Barricade[i])
endif
set i=i+1
endloop
call GroupAddGroup(EscortedPolice,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call SetUnitOwner(u,Player(PLAYER_NEUTRAL_AGGRESSIVE),true)
call IssuePointOrder(u,"move",GetRectCenterX(gg_rct_Town2),GetRectCenterY(gg_rct_Town2))
call GroupRemoveUnit(g,u)
endloop
call DisableTrigger(TBE)
if BarricadesRemain then
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
call Transmission(10.,"|cff808000Lima-Six:|r The remaining barricades are being overrun.")
else
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call Transmission(10.,"|cff808000Lima-Six:|r Good job relieving those police officers. We're moving on to the next objective.")
endif
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival and security for yourself, your team, and the local populace. Fanning the area for equipment is suggested.")
call PolledWait2(5)
call DestroyGroup(g)
set g=null
set u=null
if DEFEATED then
return
endif
call TriggerExecute(Mission2_T)
endfunction
private function SentryMission takes nothing returns nothing
local integer index=1
local real x
local real y
local real modifier
local item array Sentry
call EnableTrigger(T2)
call Transmission(10.,"|cff808000Lima-Six:|r Second platoon, we've been charged with securing roads for the convoys and providing aid to the local population.")
call PolledWait2(12.)
call Transmission(10.,"|cff808000Lima-Six:|r We'll need to secure the towns so you can focus more on the convoys. 6 sentry guns will be airdropped. Place 3 at the north town and 2 at the south, and one at either.")
call PolledWait2(12.)
set MissionTime = 280*MissionTimeModifier
call Transmission(10.,"|cff808000Lima-Six:|r We don't have much time before those convoys arrive. You've got "+R2S(MissionTime/60)+" minutes to place those sentries. They should drop near your LZ.")
call PolledWait2(2.)
call PingMinimapEx(GetRectCenterX(gg_rct_Town1), GetRectCenterY(gg_rct_Town1), 15, 0, 255, 0, false)
call PingMinimapEx(GetRectCenterX(gg_rct_Town2), GetRectCenterY(gg_rct_Town2), 15, 0, 255, 0, false)
call QuestSetDescription(OBJECTIVE_QUEST, "6 sentry guns will be airdropped. Place 3 at the north town, 2 at the south, and one at either.")
set CheckSentries=true
loop
exitwhen index > 6
set modifier = 1500 / MissionTimeModifier
set x = GetRectCenterX(gg_rct_StartingRect)+GetRandomReal(-modifier,modifier)
set y = GetRectCenterY(gg_rct_StartingRect)+GetRandomReal(-modifier,modifier)
if index == 6 then
set Sentry[index] = CreateItem('I014', x, y)
else
set Sentry[index] = CreateItem('I005', x, y)
endif
call PingMinimapEx(x,y,15.,255,255,0,false)
call SetCameraQuickPosition(x,y)
call PolledWait2(.3)
set index = index+1
endloop
loop
exitwhen PlacedN+PlacedS >= 6 or MissionTime <= 0
set index=1
loop
exitwhen index>6
if IsItemOwned(Sentry[index]) == false and Sentry[index] != null and (GetItemX(Sentry[index])!=0 and GetItemY(Sentry[index])!=0) then
call PingMinimapEx(GetItemX(Sentry[index]),GetItemY(Sentry[index]),1.9,255,255,0,false)
if GetRandomInt(1,2)==1 then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Brilliance\\Brilliance.mdl",GetItemX(Sentry[index]),GetItemY(Sentry[index])))
endif
endif
set index=index+1
endloop
if GetRandomInt(1,4)==1 then
if PlacedN<=3 then
call PingMinimapEx(GetRectCenterX(gg_rct_Town1), GetRectCenterY(gg_rct_Town1), .9, 0, 255, 0, false)
endif
if PlacedS<=3 then
call PingMinimapEx(GetRectCenterX(gg_rct_Town2), GetRectCenterY(gg_rct_Town2), .9, 0, 255, 0, false)
endif
endif
call PolledWait2(1.)
endloop
if MissionTime > 0 then
call AwardObjectiveXP(30, "Sentries set up in time")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
set MissionSuccess=true
else
call AwardObjectiveXP(-20, "Sentries have not been set up in time")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
set MissionSuccess=false
endif
set MissionTime = 0
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival and security for yourself, your team, and the local populace. Fanning the area for equipment is suggested.")
call PolledWait2(5.)
if MissionSuccess then
call Transmission(10.,"|cff808000Lima-Six:|r Good work. You've got a few minutes before the next objective to prepare, use the time wisely.")
call PolledWait2(10.)
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE*.8, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call Transmission(10.,"|cff808000Lima-Six:|r Some ravagers are entering your sector. The sentries will give you support.")
call PolledWait2(60*MissionTimeModifier)
else
call Transmission(10.,"|cff808000Lima-Six:|r We've got other objectives to work on, but if you can still set up those sentries that would help.")
call PolledWait2(10.)
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE*.9, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call Transmission(10.,"|cff808000Lima-Six:|r Some ravagers are entering your sector. The sentries will give you support.")
call PolledWait2(10.*MissionTimeModifier)
endif
if DEFEATED then
return
endif
call TriggerExecute(Mission2_T)
endfunction
function PingSpores takes nothing returns nothing
if IsUnitAliveBJ(GetEnumUnit()) then
call PingMinimapEx(GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()),1.9,254,1,1,false)
call SetUnitScalePercent(GetEnumUnit(), SporeScale+1, SporeScale+1, SporeScale+1)
endif
endfunction
private function SporeMission takes nothing returns nothing
local group Spores = CreateGroup()
local integer index = 1
local real x
local real y
local real modifier
local unit u
local rect rec
call Transmission(10.,"|cff808000Lima-Six:|r Previous SITREPs from Echo company stationed here last week show spore colonies remaining in the sector. If left alone to grow those babies will be pouring out zulus like beehives.")
call PolledWait2(8.)
call Transmission(10.,"|cff808000Lima-Six:|r Destroy them before they reach maturity.")
call QuestSetDescription(OBJECTIVE_QUEST, "Destroy "+I2S(3+2*GAME_MODE)+" spore colonies before they reach maturity.")
set MissionTime = 420
loop
exitwhen index > 3+2*GAME_MODE
set modifier = 4200 / MissionTimeModifier
loop
if AVERAGE_XP_NO_HIGH_RANKS>=80000 and GetRandomInt(1,3)!=1 then
set rec=SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)]
set x = GetRandomReal(GetRectMinX(rec),GetRectMaxX(rec))
set y = GetRandomReal(GetRectMinY(rec),GetRectMaxY(rec))
else
set x = GetRectCenterX(gg_rct_StartingRect)+GetRandomReal(-modifier,modifier)
set y = GetRectCenterY(gg_rct_StartingRect)+GetRandomReal(-modifier,modifier)
endif
exitwhen RectContainsCoords(gg_rct_Town2, x, y)==false
endloop
set u = CreateUnit(Player(15), 'n00H', x, y, 270)
call GroupAddUnit(Spores,u)
call PingMinimapEx(x,y,15.,255,0,0,false)
call SetCameraQuickPosition(x,y)
set index = index + 1
call PolledWait2(.3)
endloop
loop
exitwhen IsUnitGroupDeadBJ(Spores) or MissionTime <= 0
call ForGroup(Spores, function PingSpores)
set SporeScale=SporeScale+.33
call PolledWait2(2.)
endloop
if DEFEATED then
return
endif
call QuestSetDescription(OBJECTIVE_QUEST,"Await further orders. You should focus on survival and security for yourself, your team, and the local populace. Fanning the area for equipment is suggested.")
call PolledWait2(5)
if MissionTime > 0 or IsUnitGroupDeadBJ(Spores) then
call AwardObjectiveXP(60, "Spores killed before maturity")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call PolledWait2(5)
call Transmission(10,"|cff808000Lima-Six:|r Good job with the spores. However, we still have a lot of work to do.")
call PolledWait2(15*MissionTimeModifier)
else
call AwardObjectiveXP(-10, "Spores reached maturity")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
call PolledWait2(5)
call Transmission(10,"|cff808000Lima-Six:|r We're running behind schedule and need to move on to the next objective.")
call PolledWait2(5*MissionTimeModifier)
// Spawn a hive queen at each live spore
loop
set u=FirstOfGroup(Spores)
exitwhen u==null
if IsUnitAliveBJ(u) then
call CreateUnit(Player(15), ZID_HiveQueen, GetUnitX(u), GetUnitY(u), 270)
endif
call GroupRemoveUnit(Spores,u)
call PolledWait2(.3)
endloop
endif
call TriggerExecute(Mission2_T)
call GroupClear(Spores)
call DestroyGroup(Spores)
set Spores=null
set u=null
set rec=null
endfunction
private function ConditionsSentry takes nothing returns boolean
return (GetSpellAbilityId() == 'A07A' or GetSpellAbilityId() == 'A07V') and PlacedN+PlacedS < 6
endfunction
private function ActionsSentry takes nothing returns nothing
local unit u = bj_lastCreatedUnit
if (RectContainsUnit(gg_rct_Town1, u) and PlacedN < 4) or (RectContainsUnit(gg_rct_Town2, u) and PlacedS < 3) then
if RectContainsUnit(gg_rct_Town1,u) then
set PlacedN = PlacedN+1
call AwardObjectiveXP(7,I2S(PlacedN)+" of 3 sentries placed at north town")
endif
if RectContainsUnit(gg_rct_Town2,u) then
set PlacedS = PlacedS+1
call AwardObjectiveXP(7, I2S(PlacedS)+" of 2 sentries placed at south town")
endif
call SetUnitOwner(u, Player(12), true)
elseif (RectContainsUnit(gg_rct_Town1, u) and PlacedN>=4) then
if GetSpellAbilityId() == 'A07A' then
call CreateItem('I005', GetUnitX(u), GetUnitY(u))
else
call CreateItem('I014', GetUnitX(u), GetUnitY(u))
endif
call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"Too many at the north town! You must place the others at the south town.")
call RemoveUnit(u)
elseif (RectContainsUnit(gg_rct_Town2, u) and PlacedS>=3) then
if GetSpellAbilityId() == 'A07A' then
call CreateItem('I005', GetUnitX(u), GetUnitY(u))
else
call CreateItem('I014', GetUnitX(u), GetUnitY(u))
endif
call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"Too many at the south town! You must place the others at the north town.")
call RemoveUnit(u)
elseif CheckSentries then
if GetSpellAbilityId() == 'A07A' then
call CreateItem('I005', GetUnitX(u), GetUnitY(u))
else
call CreateItem('I014', GetUnitX(u), GetUnitY(u))
endif
call DisplayTextToPlayer(GetOwningPlayer(u),0,0,"You must place the sentries at the towns.")
call RemoveUnit(u)
endif
set u = null
endfunction
private function Actions takes nothing returns nothing
local integer i=0
local fogmodifier array fog1
local fogmodifier array fog2
loop
exitwhen i>11
set fog1[i+1] = CreateFogModifierRadius(Player(i),FOG_OF_WAR_VISIBLE,GetRectCenterX(gg_rct_Town1),GetRectCenterY(gg_rct_Town1),800,true,false)
call FogModifierStart(fog1[i+1])
set fog2[i+1] = CreateFogModifierRadius(Player(i),FOG_OF_WAR_VISIBLE,GetRectCenterX(gg_rct_Town2),GetRectCenterY(gg_rct_Town2),500,true,false)
call FogModifierStart(fog2[i+1])
call SetPlayerAllianceStateBJ(Player(i),Player(14),bj_ALLIANCE_UNALLIED)
call SetPlayerAllianceStateBJ(Player(14),Player(i),bj_ALLIANCE_UNALLIED)
set i=i+1
endloop
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
call Transmission(3,"|cff808000Lima-Six:|r Two-six, this is Captain Kearney; radio test, just respond.")
call PolledWait2(6)
call Transmission(3,"|cff808000Two-Six:|r Read you loud and clear Lima-Six.")
call PolledWait2(5)
set i=0
loop
exitwhen i>11
call FogModifierStop(fog1[i+1])
set fog1[i+1]=null
call FogModifierStop(fog2[i+1])
set fog2[i+1]=null
set i=i+1
endloop
//call TriggerExecute(Guardian_T)
//call TriggerExecute(Convoy_T)
//call TriggerExecute(Civilians_T)
//call MissionSearchForCivs()
//call TriggerExecute(Mission2_T)
// Civilians End
//call TimerStart(Spawn_Delay,60.,false,null)
//call PauseTimer(Spawn_Delay)
//set i=1
//loop
// exitwhen i>11
// if IsUnitHidden(PLAYER_UNIT[i])==false then
// call ShowUnit(PLAYER_UNIT[i],false)
// endif
// set i=i+1
//endloop
//call PolledWait2(2.)
//call TriggerExecute(Salvation_T)
//call BarricadeMission()
//call TriggerExecute(PathOfTheDead_T)
//return
// ===Mission1===
set i=0
if AVERAGE_XP_NO_HIGH_RANKS > 10000 or GAME_MODE>1 then
set i=i+1
endif
if AVERAGE_XP_NO_HIGH_RANKS > 40000 then
set i=i+1
endif
if AVERAGE_XP_NO_HIGH_RANKS > 60000 then
set i=i+1
endif
if AVERAGE_XP_NO_HIGH_RANKS > 100000 then
set i=i+1
endif
if GetRandomInt(1,10+i)>4 then
call SentryMission()
elseif GetRandomInt(1,10+i)>4 then
call BarricadeMission()
else
call SporeMission()
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T2, EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(T2, Condition(function ConditionsSentry))
call TriggerAddAction(T2,function ActionsSentry)
call DisableTrigger(T2)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Mission2 initializer Init requires GlobalFuncs, UmbrellaCheckPoints
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger TC1
public trigger TC2
public trigger TEvac
rect array House
integer HouseCount
boolean array HouseSearched
integer HousesRemaining
string array FoundCivsChat
group EscortedCivs=CreateGroup()
endglobals
//=======================
//==== Search House =====
//=======================
private function SearchHouseConditions takes nothing returns boolean
local unit u=GetFilterUnit()
local boolean b=GetPlayerId(GetOwningPlayer(u))<12 and IsUnitAliveBJ(u) and IsUnitType(u, UNIT_TYPE_HERO)
set u=null
return b
endfunction
private function SearchHouse takes nothing returns nothing
local integer i=1
local integer index=1
local unit u=GetEnteringUnit()
local unit c
local player p=GetOwningPlayer(u)
loop
exitwhen DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetRectCenterX(House[i]),GetRectCenterY(House[i])) <= 225 or i>HouseCount
//call BJDebugMsg(I2S(i))
set i=i+1
endloop
//call BJDebugMsg("Search house 1")
if HouseSearched[i] or i>HouseCount then
set u=null
set c=null
return
endif
//call BJDebugMsg("Search house 2")
set HouseSearched[i]=true
set HousesRemaining=HousesRemaining-1
call IssueImmediateOrder(u,"stop")
call ShowUnit(u, false)
call PolledWait2(GetRandomReal(1,3))
if GetRandomInt(1,18)!=1 then
call FieldChat(u, 5, "|cff808000" + GetUnitName(u) + ":|r " + FoundCivsChat[GetRandomInt(1, 8)])
call PolledWait2(1.)
call ShowUnit(u, true)
call SelectUnitAddForPlayer(u,p)
loop
exitwhen index > GetRandomInt(1,3)
set c=CreateUnit(p, CivilianIDs[GetRandomInt(1,5)], GetRectCenterX(House[i]), GetRectCenterY(House[i]), GetRandomReal(0,360))
call GroupAddUnit(EscortedCivs,c)
call SelectUnitAddForPlayer(c,p)
set index=index+1
endloop
else //zombie fun
if GetRandomInt(1,3)!=1 then
call SetSoundPosition(gg_snd_Rifle1,GetUnitX(u),GetUnitY(u),10)
call StartSound(gg_snd_Rifle1)
call PolledWait2(.3)
call SetSoundPosition(gg_snd_Rifle2,GetUnitX(u),GetUnitY(u),10)
call StartSound(gg_snd_Rifle2)
call PolledWait2(.15)
call SetSoundPosition(gg_snd_ZombieDeath,GetUnitX(u),GetUnitY(u),10)
call StartSound(gg_snd_ZombieDeath)
call PolledWait2(1.5)
call FieldChat(u, 5, "|cff808000" + GetUnitName(u) + ":|r They aren't coming out.")
call PolledWait2(1.)
call ShowUnit(u, true)
call SelectUnitAddForPlayer(u,p)
else
call SetSoundPosition(gg_snd_Rifle1,GetUnitX(u),GetUnitY(u),10)
call StartSound(gg_snd_Rifle1)
call PolledWait2(.3)
call SetSoundPosition(gg_snd_Rifle2,GetUnitX(u),GetUnitY(u),10)
call StartSound(gg_snd_Rifle2)
call PolledWait2(.8)
call FieldChat(u, 5, "|cff808000" + GetUnitName(u) + ":|r They don't look human!")
call ShowUnit(u, true)
call SelectUnitAddForPlayer(u,p)
call PolledWait2(1.5)
call SpawnInfectedOfType(ZID_Zombie, 3, House[i])
endif
endif
set u=null
set c=null
endfunction
private function RescueCivConditions takes nothing returns boolean
local unit u=GetFilterUnit()
local boolean b=IsUnitInGroup(u, EscortedCivs)
set u=null
return b
endfunction
private function RescueCiv takes nothing returns nothing
local unit u=GetEnteringUnit()
local rect r
if RectContainsUnit(gg_rct_Town1,u) then
set r=gg_rct_Town1
else
set r=gg_rct_Town2
endif
call GroupRemoveUnit(EscortedCivs,u)
call SetUnitOwner(u, Player(12), true)
call AwardObjectiveXP(3, "Civilian rescued")
call IssuePointOrder(u, "move", GetRectCenterX(r)+GetRandomReal(-500,500), GetRectCenterY(r)+GetRandomReal(-500,500))
set u=null
set r=null
endfunction
private function MissionSearchForCivs takes nothing returns nothing
local region r=CreateRegion()
local region r2=CreateRegion()
local integer i=1
call RegionAddRect(r2,gg_rct_Town1)
call RegionAddRect(r2,gg_rct_Town2)
call TriggerRegisterEnterRegion(TC2,r2,Condition(function RescueCivConditions))
set House[1]=gg_rct_House1
set House[2]=gg_rct_House2
set House[3]=gg_rct_House3
set House[4]=gg_rct_House4
set House[5]=gg_rct_House5
set House[6]=gg_rct_House6
set House[7]=gg_rct_House7
set House[8]=gg_rct_House8
set HouseCount=8
set HousesRemaining=HouseCount
set FoundCivsChat[1]="Come with me."
set FoundCivsChat[2]="I've found some survivors."
set FoundCivsChat[3]="We gotta go, right now."
set FoundCivsChat[4]="We need to leave, now."
set FoundCivsChat[5]="I'm here to save you, let's go!"
set FoundCivsChat[6]="You need to come with me."
set FoundCivsChat[7]="Found more survivors."
set FoundCivsChat[8]="I found some civilians."
loop
exitwhen i>HouseCount
call RegionAddRect(r,House[i])
call PingMinimapEx(GetRectCenterX(House[i]),GetRectCenterY(House[i]),5,107,142,35,false)
set HouseSearched[i]=false
set i=i+1
endloop
call TriggerRegisterEnterRegion(TC1,r,Condition(function SearchHouseConditions))
call Transmission(12.,"|cff808000Lima-Six:|r Intel reports civilians might be stranded in their homes in the outlying woods. Search the houses for survivors and lead them to the cities.")
call PolledWait2(9.)
call Transmission(17.,"|cff808000Lima-Six:|r There are 3 houses in the west woods, one near the southwest waterfall, one in the northwest cliffs, and 2 in the eastern mountain.")
call QuestSetDescription(OBJECTIVE_QUEST, "Search houses for civilians. There are 3 houses in the west woods, one near the southwest waterfall, one in the northwest cliffs, and 2 in the eastern mountain.")
set MissionTime=(490-10*PLAYING_PLAYERS)*MissionTimeModifier
loop
exitwhen HousesRemaining==0 or MissionTime==0
set i=1
loop
exitwhen i>HouseCount
if not HouseSearched[i] then
call PingMinimapEx(GetRectCenterX(House[i]),GetRectCenterY(House[i]),1,107,142,35,false)
endif
set i=i+1
endloop
call PolledWait2(2.)
endloop
if MissionTime==0 then
call AwardObjectiveXP(-20, "Civilians not rescued in time")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
else
call AwardObjectiveXP(80, "Civilians rescued")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
endif
call PolledWait2(8.)
call TriggerExecute(Mission3_T)
endfunction
//=======================
//====== Heli Down ======
//=======================
private function EnterHeli takes nothing returns nothing
local unit u=GetEnteringUnit()
local integer i=GetUnitTypeId(u)
if GetOwningPlayer(u)==Player(11) and (i=='h01M' or i=='h009' or i=='h00E' or i=='h00V' or i=='h014') then
call RemoveUnit(u)
endif
set u=null
endfunction
private function KillGroup takes nothing returns nothing
local unit u=GetEnumUnit()
call KillUnit(u)
set u=null
endfunction
private function MissionHeliDown takes nothing returns nothing
local rect site=LZ[GetRandomInt(1,LZCount)]
local unit heli
local unit helieng
local unit array eng
local group g=CreateGroup()
local unit u
local integer i=1
local boolean engatlz = false
call Transmission(8.,"|cff808000Lima-Six:|r We've got units from 10th Mountain who will be moving near your sector. A Stryker, callsign Gunmetal, will be clearing out pockets of hostiles around your sector so they aren't held up.")
call PolledWait2(25.)
call Transmission(4.,"|cff808000Gunmetal:|r Something hit us!")
call PolledWait2(4.)
call Transmission(6.,"|cff808000Gunmetal:|r HQ, this is Gunmetal, my pilot is unconcious and we've got a hole in our fuel tank. Making an emergency landing in sector Bravo Echo!")
call PolledWait2(4.)
set heli = CreateUnit(Player(11),'h01P',GetRectCenterX(site),GetRectCenterY(site),240)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",GetUnitX(heli),GetUnitY(heli)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call VisionUnit(heli,true)
call PolledWait2(.1)
//call SetSoundPosition(gg_snd_fhp_cobra_down, GetRectCenterX(site), GetRectCenterY(site), 100)
call StartSound(gg_snd_fhp_cobra_down)
call SetUnitLifePercentBJ(heli,50)
call SetUnitTimeScale(heli,.01)
call PauseUnit(heli,true)
set AttackConvoy=true
call PolledWait2(4.)
call QuestSetDescription(OBJECTIVE_QUEST,"Provide security for Gunmetal and the engineers.")
call Transmission(4.,"|cff808000Lima-Six:|r Gunmetal has gone down in your sector. Get to the crash site and protect the helicopter until engineers arrive.")
call PolledWait2(4.)
call Transmission(4.,"|cff808000Marine:|r Hang on we're coming to you.")
set u=CreateUnit(Player(11),'h009',GetRectCenterX(site)-200,GetRectCenterY(site)+200,GetRandomReal(0,360))
call GroupAddUnit(g,u)
call VisionUnit(u,true)
call UmbrellaCheckPoints_JetpackDown(u)
set u=CreateUnit(Player(11),'h00V',GetRectCenterX(site)+200,GetRectCenterY(site)+200,GetRandomReal(0,360))
call GroupAddUnit(g,u)
call VisionUnit(u,true)
call UmbrellaCheckPoints_JetpackDown(u)
set u=CreateUnit(Player(11),'h009',GetRectCenterX(site)-200,GetRectCenterY(site)-200,GetRandomReal(0,360))
call GroupAddUnit(g,u)
call VisionUnit(u,true)
call UmbrellaCheckPoints_JetpackDown(u)
if AVERAGE_XP_NO_HIGH_RANKS<9000 then
set u=CreateUnit(Player(11),'h009',GetRectCenterX(site)+200,GetRectCenterY(site)-200,GetRandomReal(0,360))
call GroupAddUnit(g,u)
call VisionUnit(u,true)
call UmbrellaCheckPoints_JetpackDown(u)
endif
call SpawnInfectedOfType(ZID_Mutant, 1, CAVE_LOCS[GetRandomInt(1,4)])
if GAME_MODE > 1 then
call SpawnInfectedOfType(ZID_Sting, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
set MissionTime=180/MissionTimeModifier
call PolledWait2(6)
call StartSound(gg_snd_Bell1)
call PingMinimapEx(GetRectCenterX(site),GetRectCenterY(site),5.,212,94,25,false)
call PolledWait2(1.5)
call StartSound(gg_snd_Bell2)
loop
exitwhen IsUnitDeadBJ(heli) or GetUnitLifePercent(heli)==100 or MissionTime==0
call PolledWait2(1)
endloop
if IsUnitDeadBJ(heli) then
call SetUnitTimeScale(heli,.5)
call AwardObjectiveXP(-10, "Mission failed")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
set eng[1]=null
set eng[2]=null
set heli=null
set helieng=null
set site=null
set u=null
call ForGroup(g,function KillGroup)
call DestroyGroup(g)
set g=null
set AttackConvoy=false
call TriggerExecute(Mission3_T)
return
endif
if GetUnitLifePercent(heli)==100 then //already repaired
set MissionTime = 0
call Transmission(5.,"|cff808000Marine:|r Lima-six this is two-six, we've pushed to the LZ, and the pilot is concious and ok, break.")
call PolledWait2(3)
call Transmission(4.,"|cff808000Marine:|r We have repaired Gunmetal. Pilot says his radio was damaged in the crash, and he needs to refuel before taking off, over. ")
call PolledWait2(3)
call Transmission(4.,"|cff808000Lima-Six:|r Roger that. Engineers are just arriving, and they will carry fuel to the HLZ, out.")
else
call Transmission(4.,"|cff808000Lima-Six:|r The engineers are arriving at the center HLZ. Guard them on their way to Gunmetal.")
endif
call SetCameraQuickPosition(GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
call PingMinimapEx(GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect),5.,255,0,0,false)
call PolledWait2(6) // Give the players time to get to the LZ
set helieng=LandHeli(GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
call PolledWait2(4.)
set eng[1]=CreateUnit(Player(11),'h01M',GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect),0)
call IssueTargetOrder(eng[1],"smart",heli)
call VisionUnit(eng[1],true)
set eng[2]=CreateUnit(Player(11),'h01M',GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect),0)
call IssueTargetOrder(eng[2],"smart",heli)
call VisionUnit(eng[1],true)
call PolledWait2(3)
loop
exitwhen (IsUnitDeadBJ(eng[1]) and IsUnitDeadBJ(eng[2])) or IsUnitDeadBJ(heli) or (GetUnitLifePercent(heli)==100 and engatlz == true)
if RectContainsUnit(site, eng[1]) then
call IssueTargetOrder(eng[1],"heal",heli)
else
call IssueTargetOrder(eng[1],"smart",heli)
endif
if RectContainsUnit(site, eng[2]) then
call IssueTargetOrder(eng[2],"heal",heli)
else
call IssueTargetOrder(eng[2],"smart",heli)
endif
if RectContainsUnit(site, eng[1]) or RectContainsUnit(site, eng[2]) then
set engatlz=true
endif
call PolledWait2(4.)
endloop
if GetUnitLifePercent(heli)==100 and engatlz==true then
call PauseUnit(heli,false)
call TakeoffHeli(heli)
call AwardObjectiveXP(100, "Helicopter evacuated safely")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
elseif engatlz==false and GetUnitLifePercent(heli)==100 then
call AwardObjectiveXP(-5, "Mission failed")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",GetUnitX(heli),GetUnitY(heli)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call RemoveUnit(heli)
set u=CreateUnit(Player(11),'h014',GetRectCenterX(site)-25,GetRectCenterY(site)-75,330)
call GroupAddUnit(g,u)
call VisionUnit(u,true)
set u=CreateUnit(Player(11),'h014',GetRectCenterX(site)-25,GetRectCenterY(site)-75,330)
call GroupAddUnit(g,u)
call VisionUnit(u,true)
else
call AwardObjectiveXP(-10, "Mission failed")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",GetUnitX(heli),GetUnitY(heli)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(heli)+GetRandomReal(-120,120),GetUnitY(heli)+GetRandomReal(-120,120)))
call RemoveUnit(heli)
endif
call TriggerRegisterEnterRectSimple(TEvac,gg_rct_StartingRect)
loop
exitwhen IsUnitDeadBJ(eng[1]) and IsUnitDeadBJ(eng[2]) and IsUnitGroupDeadBJ(g)
call IssuePointOrder(eng[1],"move",GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
call IssuePointOrder(eng[2],"move",GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
if GetRandomInt(1,3)==1 then
call GroupPointOrder(g,"move",GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
else
call GroupPointOrder(g,"attack",GetRectCenterX(gg_rct_StartingRect),GetRectCenterY(gg_rct_StartingRect))
endif
call PolledWait2(2.8)
endloop
call TakeoffHeli(helieng)
call DisableTrigger(TEvac)
set eng[1]=null
set eng[2]=null
set heli=null
set helieng=null
set site=null
set u=null
call DestroyGroup(g)
set g=null
set AttackConvoy=false
call TriggerExecute(Mission3_T)
endfunction
public function Actions takes nothing returns nothing
if GetRandomInt(1,2)==1 then
call MissionSearchForCivs()
else
call MissionHeliDown()
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T, function Actions)
set TC1 = CreateTrigger()
call TriggerAddAction(TC1, function SearchHouse)
set TC2 = CreateTrigger()
call TriggerAddAction(TC2, function RescueCiv)
set TEvac=CreateTrigger()
call TriggerAddAction(TEvac, function EnterHeli)
endfunction
endlibrary
//TESH.scrollpos=126
//TESH.alwaysfold=0
library Mission3 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T3
integer WhichOutpost
boolean OutpostReached=false
integer array BlockedRoads
integer Destruct_Count
boolean array RoadUnblocked
endglobals
private function BlockBrush takes rect rec returns nothing
local integer i=1
loop
exitwhen i>GetRandomInt(6,9)
call CreateDestructable('B002', GetRectCenterX(rec)+GetRandomReal(-250,250), GetRectCenterY(rec)+GetRandomReal(-250,250), GetRandomDirectionDeg(), 1.5, 0)
set i=i+1
endloop
endfunction
private function BlockRock takes rect rec returns nothing
local integer i=1
loop
exitwhen i>GetRandomInt(4,7)
call CreateDestructable('B003', GetRectCenterX(rec)+GetRandomReal(-250,250), GetRectCenterY(rec)+GetRandomReal(-250,250), GetRandomDirectionDeg(), 1, GetRandomInt(0,5))
if GetRandomInt(1,4)==1 then
call CreateDestructable('B002', GetRectCenterX(rec)+GetRandomReal(-250,250), GetRectCenterY(rec)+GetRandomReal(-250,250), GetRandomDirectionDeg(), 1.5, GetRandomInt(0,5))
endif
set i=i+1
endloop
endfunction
private function GetRandRoadNum takes nothing returns integer
local integer RandRoad
local integer index=1
loop
set RandRoad=GetRandomInt(2,RoadCount)
set index=1
loop
exitwhen index > 8+3*GAME_MODE
if RandRoad==BlockedRoads[index] then
exitwhen true
endif
set index=index+1
endloop
if index > 8+3*GAME_MODE then
return RandRoad
endif
exitwhen false
endloop
return 0
endfunction
function RoadClear takes nothing returns boolean
return IsDestructableAliveBJ(GetFilterDestructable()) and (GetDestructableTypeId(GetFilterDestructable())=='B002' or GetDestructableTypeId(GetFilterDestructable())=='B003')
endfunction
function CountDestructs takes nothing returns nothing
set Destruct_Count=Destruct_Count+1
endfunction
private function CheckRoads takes nothing returns nothing
local integer index=1
local boolean AnyLeft=false
local timer t=GetExpiredTimer()
loop
exitwhen index > 8+3*GAME_MODE
set Destruct_Count=0
call EnumDestructablesInRect(Road[BlockedRoads[index]], Condition(function RoadClear), function CountDestructs)
if Destruct_Count==0 and RoadUnblocked[index]==false then
set RoadUnblocked[index]=true
call AwardObjectiveXP(12, "Road cleared")
elseif RoadUnblocked[index]==false then
call PingMinimapEx(GetRectCenterX(Road[BlockedRoads[index]]),GetRectCenterY(Road[BlockedRoads[index]]),1.5,128,255,128,false)
set AnyLeft=true
endif
set index=index+1
endloop
if OutpostReached==false then
call PingMinimapEx(GetRectCenterX(Outpost[WhichOutpost]),GetRectCenterY(Outpost[WhichOutpost]),90,255,255,0,false)
endif
if AnyLeft==false then
call PauseTimer(t)
call DestroyTimer(t)
endif
set t=null
endfunction
private function ActionsEnterOutpost takes nothing returns nothing
local integer index=1
local unit u=GetEnteringUnit()
loop
exitwhen u==PLAYER_UNIT[index] or index > 11
set index=index+1
endloop
if u!=null then
call DisableTrigger(T3)
set OutpostReached=true
endif
set u=null
endfunction
private function Actions takes nothing returns nothing
local integer index=1
local integer count=0
local timer t=CreateTimer()
call TimerStart(Spawn_Delay,60*MissionTimeModifier,false,null)
call Transmission(10.,"|cff808000Lima-Six:|r Reconnaissance and SITREPs from previous deployments report rock falls and other obstacles on the roadways. You must clear those roadways for the convoys.")
call PolledWait2(8)
call Transmission(10.,"|cff808000Lima-Six:|r If you have a combat engineer with you he can also use C4 and Satchel Charges to blow a path - but use caution! This is highly explosive and dangerous equipment.")
call QuestSetDescription(OBJECTIVE_QUEST, "Previous SITREPS report obstacles blocking the roadways. You must clear these roadways for the convoys or they'll be stopped in a potential kill zone.")
if AVERAGE_XP_NO_HIGH_RANKS>=90000 and GetRandomInt(1,3)!=1 then
call SpawnInfectedOfType(ZID_Sting, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>60000 then
set count=9+3*GAME_MODE
else
set count=8+3*GAME_MODE
endif
loop
exitwhen index > count
set RoadUnblocked[index]=false
set BlockedRoads[index]=GetRandRoadNum()
if GetRandomInt(1,6-GAME_MODE)==1 then
call BlockRock(Road[BlockedRoads[index]])
else
call BlockBrush(Road[BlockedRoads[index]])
endif
call PingMinimapEx(GetRectCenterX(Road[BlockedRoads[index]]),GetRectCenterY(Road[BlockedRoads[index]]),30,128,255,128,false)
set index=index+1
call PolledWait2(.3)
endloop
set WhichOutpost=GetRandomInt(1, OutpostCount)
call TriggerRegisterEnterRectSimple(T3, Outpost[WhichOutpost])
call EnableTrigger(T3)
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r One of the abandoned outposts in your sector contains a cache of explosives. They must have been left over from a previous deployment.")
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r Use the explosives located in |cffFFFF00outpost " + I2S(index)+"|r to blow up the |cff00FF00blocked roads|r.")
call SpawnItem(7, Outpost[WhichOutpost], 'I00V')
call SpawnItem(3, Outpost[WhichOutpost], 'I006')
call PingMinimapEx(GetRectCenterX(Outpost[WhichOutpost]),GetRectCenterY(Outpost[WhichOutpost]),90,255,255,0,false)
call SetCameraQuickPosition(GetRectCenterX(Outpost[WhichOutpost]),GetRectCenterY(Outpost[WhichOutpost]))
call SpawnInfectedOfType(ZID_Gonarch, 1, CAVE_LOCS[GetRandomInt(1,4)])
call TimerStart(t, 5, true, function CheckRoads)
set MissionTime=180*MissionTimeModifier
call PolledWait2(180*MissionTimeModifier)
if DEFEATED then
return
endif
call TriggerExecute(Guardian_T)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T3 = CreateTrigger()
call TriggerAddAction(T3,function ActionsEnterOutpost)
call DisableTrigger(T3)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Guardian initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T2
boolean AttackTents = false
unit array Engineer
unit array Building
private unit array heli
group array Engineers
rect array GuardPost
endglobals
function SpawnEngineer takes rect en, integer index, integer tent returns nothing
set Engineer[index] = CreateUnit(Player(11), 'h01M', GetRectCenterX(en), GetRectCenterY(en), GetRandomDirectionDeg())
call IssueBuildOrderById(Engineer[index], tent, GetRectCenterX(Tent[index]), GetRectCenterY(Tent[index]))
if en==Base[1] then
call GroupAddUnit(Engineers[1],Engineer[index])
elseif en==Base[2] then
call GroupAddUnit(Engineers[2],Engineer[index])
elseif en==Base[3] then
call GroupAddUnit(Engineers[3],Engineer[index])
endif
//set Building[index] = CreateUnit(Player(11), tent, GetRectCenterX(Tent[index]), GetRectCenterY(Tent[index]), GetRandomDirectionDeg())
//call ShowUnit(Building[index], false)
//call IssuePointOrder(Engineer[index], "move", GetRectCenterX(Tent[index])-GetRandomReal(-150,150), GetRectCenterY(Tent[index])-GetRandomReal(-150,150))
endfunction
function SpawnMarine takes rect r, integer ut, integer rd, integer guard returns nothing
local unit u = CreateUnit(Player(11), ut, GetRectCenterX(r), GetRectCenterY(r), GetRandomDirectionDeg())
call PlaySoundOnUnitBJ(gg_snd_boltpull,100,u)
if guard==0 and ((GetRandomInt(1,6)==1 and rd != 0) or rd==0) then
call IssueImmediateOrder(u,"defend")
call UnitAddItemByIdSwapped('I00O',u)
call SetItemCharges(bj_lastCreatedItem,1)
call UnitUseItemPoint(u, bj_lastCreatedItem, GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
call PolledWait2(.3)
call IssuePointOrder(u, "move", GetUnitX(u)-GetRandomReal(-400,400), GetUnitY(u)-GetRandomReal(-400,400))
elseif guard == 0 then
call RemoveGuardPosition(u)
call UnitAddItemByIdSwapped('I00O',u)
call SetItemCharges(bj_lastCreatedItem,1)
call UnitUseItemPoint(u, bj_lastCreatedItem, GetRandomReal(GetRectMinX(Road[rd]), GetRectMaxX(Road[rd])), GetRandomReal(GetRectMinY(Road[rd]), GetRectMaxY(Road[rd])))
else // guard post
call RemoveGuardPosition(u)
call IssuePointOrder(u,"move",GetRectCenterX(GuardPost[guard]),GetRectCenterY(GuardPost[guard]))
endif
set u = null
endfunction
function HeliVision takes nothing returns nothing
call UnitShareVision(heli[1], GetEnumPlayer(), true)
call UnitShareVision(heli[2], GetEnumPlayer(), true)
call UnitShareVision(heli[3], GetEnumPlayer(), true)
endfunction
function OutpostBoss takes nothing returns nothing
call Transmission(6.,"|cff808000Lima-Six:|r Recon has picked up 2 pudges and "+ I2S(2+2*GAME_MODE) +" mutants heading into your sector. Buckle down and keep the area secure.")
call PolledWait2(5.)
call Transmission(6.,"|cff808000Marine:|r Damn, let's hope those sentries will hold out. Keep them supplied with ammo!")
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Mutant, 1+2*GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
endfunction
function OutpostMission takes nothing returns nothing
local integer index=1
local boolean array EngDead
local boolean boss = false
local boolean quote = false
local real MaxTime
call EnableTrigger(SpawnInfected120_T)
call Transmission(10.,"|cff808000Lima-Six:|r Combat engineers are inbound to set up 3 outposts for the convoys.")
call PolledWait2(9.)
call Transmission(10.,"|cff808000Lima-Six:|r 2 sentry guns per outpost will also be dropped. Set them up and keep them supplied with ammo.")
call PolledWait2(9.)
call QuestSetDescription(OBJECTIVE_QUEST, "Helicopters will drop sentry guns, marines, and engineers to build 3 outposts for the convoys. Protect the bases and keep as many engineers alive as possible.")
set MissionTime = 240 + 50*I2R(GAME_MODE)
set MaxTime = MissionTime
loop
exitwhen index > 3
set heli[index] = CreateUnit(Player(11), 'h015', GetRectCenterX(Base[index]) - 1200, GetRectCenterY(Base[index]) - GetRandomReal(-800, 800), 90)
call IssuePointOrder(heli[index], "move", GetRectCenterX(Base[index]), GetRectCenterY(Base[index]))
call PingMinimapEx(GetRectCenterX(Base[index]), GetRectCenterY(Base[index]), 12, 0, 255, 0, false)
set index=index+1
endloop
set index=1
call ForForce(GetPlayersAllies(Player(0)), function HeliVision)
call PolledWait2(5.)
call SetUnitFlyHeight(heli[1], 15, 200)
call SetUnitFlyHeight(heli[2], 15, 200)
call SetUnitFlyHeight(heli[3], 15, 200)
call PolledWait2(3.)
call Reinforcements(GetUnitX(heli[1]),GetUnitY(heli[1]))
call SpawnItemsInRectCent(2, Base[1], 'I005')
call SpawnItemsInRectCent(2, Base[2], 'I005')
call SpawnItemsInRectCent(1, Base[2], 'I014')
call SpawnItemsInRectCent(2, Base[3], 'I005')
call SpawnItemsInRectCent(1, Base[3], 'I014')
call SpawnItemsInRectCent(2, Base[1], 'I000')
call SpawnItemsInRectCent(2, Base[2], 'I000')
call SpawnItemsInRectCent(2, Base[3], 'I000')
set Engineers[1]=CreateGroup()
set Engineers[2]=CreateGroup()
set Engineers[3]=CreateGroup()
call SpawnEngineer(Base[1], 1, 'h01O')
call SpawnEngineer(Base[1], 2, 'h01N')
call SpawnEngineer(Base[1], 3, 'h01O')
call SpawnEngineer(Base[1], 4, 'h01N')
call SpawnMarine(Base[1], 'h009', 0,0)
call SpawnMarine(Base[1], 'h009', 0,4)
call SpawnMarine(Base[1], 'h009', 0,5)
call SpawnMarine(Base[1], 'h009', 0,6)
call SpawnMarine(Base[1], 'h00V', 26,0)
call SpawnMarine(Base[1], 'h00E', 27,0)
call SpawnMarine(Base[1], 'h009', 24,0)
call SpawnMarine(Base[1], 'h01E', 0,0)
call PolledWait2(2.)
call SpawnEngineer(Base[2], 5, 'h01O')
call SpawnEngineer(Base[2], 6, 'h01N')
call SpawnEngineer(Base[2], 7, 'h01O')
call SpawnEngineer(Base[2], 8, 'h01N')
call SpawnMarine(Base[2], 'h009', 21,7)
call SpawnMarine(Base[2], 'h009', 21,0)
call SpawnMarine(Base[2], 'h00V', 19,0)
call SpawnMarine(Base[2], 'h00E', 0,8)
call SpawnMarine(Base[2], 'h009', 21,9)
call SpawnMarine(Base[2], 'h009', 25,0)
call SpawnMarine(Base[2], 'h019', 0,0)
call PolledWait2(2.)
call SpawnEngineer(Base[3], 9, 'h01O')
call SpawnEngineer(Base[3], 10, 'h01N')
call SpawnEngineer(Base[3], 11, 'h01O')
call SpawnEngineer(Base[3], 12, 'h01N')
call SpawnMarine(Base[3], 'h009', 0,1)
call SpawnMarine(Base[3], 'h00V', 20,0)
call SpawnMarine(Base[3], 'h00E', GetRandomInt(22,23),0)
call SpawnMarine(Base[3], 'h009', 0,0)
call SpawnMarine(Base[3], 'h009', 0,2)
call SpawnMarine(Base[3], 'h00E', 0,3)
call SpawnMarine(Base[3], 'h019', 0,0)
loop
exitwhen index > 3
call HeliWashOff(heli[index])
call SmoothTakeOff(heli[index],800,400)
call PolledWait2(.2)
call IssuePointOrder(heli[index], "move", GetUnitX(heli[index]) - 1500, GetUnitY(heli[index]) - GetRandomReal(-800, 800))
call PolledWait2(GetRandomReal(2, 5))
call RemoveUnit(heli[index])
set index=index+1
endloop
set heli[1]=null
set heli[2]=null
set heli[3]=null
if DEFEATED then
return
endif
loop
exitwhen MissionTime <= 0
if (MaxTime-MissionTime) <= 60 and boss==false then
set boss=true
call ExecuteFunc("OutpostBoss")
endif
if MissionTime < 90 and quote==false then
set quote=true
call Transmission(10.,"So they've got us surrounded, good! Now we can fire in any direction, those bastards won't get away this time! |cff808000-Chesty Puller|r")
endif
set index=1
loop
exitwhen index > 12
if IsUnitDeadBJ(Engineer[index]) and EngDead[index]==false then
set EngDead[index]=true
call KillUnit(Building[index])
call AwardObjectiveXP(-5, "Engineer killed")
endif
if IsUnitDeadBJ(Building[index]) and EngDead[index]==false then
set EngDead[index]=true
call KillUnit(Engineer[index])
call AwardObjectiveXP(-5, "Tent destroyed")
endif
if EngDead[index]==false then
call UnitSetConstructionProgress(Building[index], R2I(((MaxTime-MissionTime)/MaxTime)*100))
endif
set index=index+1
endloop
call PolledWait2(1.)
endloop
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Lima-Six:|r Convoys will arrive shortly.")
set index=1
loop
exitwhen index>12
call RemoveUnit(Engineer[index])
set Engineer[index]=null
set index=index+1
endloop
call DestroyGroup(Engineers[1])
call DestroyGroup(Engineers[2])
call DestroyGroup(Engineers[3])
set Engineers[1]=null
set Engineers[2]=null
set Engineers[3]=null
call PolledWait2(GetRandomInt(5, 30))
set AttackTents = false
call TriggerExecute(Convoy_T)
endfunction
private function Actions takes nothing returns nothing
call Chapter("Guardian")
set GuardPost[1]=gg_rct_Guard01
set GuardPost[2]=gg_rct_Guard02
set GuardPost[3]=gg_rct_Guard03
set GuardPost[4]=gg_rct_Guard04
set GuardPost[5]=gg_rct_Guard05
set GuardPost[6]=gg_rct_Guard06
set GuardPost[7]=gg_rct_Guard07
set GuardPost[8]=gg_rct_Guard08
set GuardPost[9]=gg_rct_Guard09
set AttackTents = true
call OutpostMission()
endfunction
private function Actions2 takes nothing returns nothing
local integer index = 1
local unit u = GetConstructingStructure()
loop
exitwhen index > 12
if RectContainsUnit(Tent[index], u) then
set Building[index] = u
call PauseUnit(Engineer[index], true)
call SetUnitAnimation(Engineer[index], "work")
endif
set index=index+1
endloop
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T2, EVENT_PLAYER_UNIT_CONSTRUCT_START)
call TriggerAddAction(T2,function Actions2)
endfunction
endlibrary
//TESH.scrollpos=373
//TESH.alwaysfold=0
library Convoy initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T2
public trigger T3
string array ConvoyPath
integer array CurPath
group array Convoy
boolean array ConvoyEmpty
boolean array ConvoyDead
boolean array ConvoyWaiting
boolean array ConvoyRepairing
boolean array ConvoySupplied
timer array ConvoyPause
integer array SpecialEvent
unit array ConvoyLeader
integer array SafeAPCs
private boolean whopper=false
private unit LastSpawned
boolean array BaseAlive
integer BaseCount = 3
group tempeng
private integer tempindex
private integer temporder
private boolean templeft=true
string array ConvoyPathsA
integer PathsACnt
string array ConvoyPathsB
integer PathsBCnt
integer ConvoysActive = 0
hashtable HT_Convoy=InitHashtable()
endglobals
//====================================-----Convoy----====================================
function CountAPCs takes group g returns integer
local group g2=CreateGroup()
local unit u
local integer count = 0
call GroupAddGroup(g, g2)
loop
set u=FirstOfGroup(g2)
exitwhen u==null
if GetUnitTypeId(u)=='h00B' then
set count=count+1
endif
call GroupRemoveUnit(g2, u)
endloop
call DestroyGroup(g2)
set u=null
return count
endfunction
private function ConvoyLoss takes nothing returns nothing
local integer index = 1
local unit u = GetDyingUnit()
local integer id=GetUnitTypeId(u)
loop
exitwhen index > 12
if IsUnitInGroup(u, Convoy[index]) then
call GroupRemoveUnit(Convoy[index], u)
if id==NID_Rifleman or id==NID_NavyCorpsman or id=='h01D' or id==NID_IUL or id=='h017' or id==NID_IUL then
call FlushChildHashtable(HT_Convoy,GetHandleId(u))
endif
if CountAPCs(Convoy[index])<=0 and ConvoyDead[index]==false then
call AwardObjectiveXP(-15, "Convoy destroyed")
set ConvoyDead[index]=true
endif
if u==ConvoyLeader[index] then
set ConvoyLeader[index]=null
endif
if IsUnitGroupDeadBJ(Convoy[index]) then
set ConvoyEmpty[index]=true
set ConvoysActive=ConvoysActive-1
endif
endif
set index=index+1
endloop
set u=null
endfunction
private function SpawnConvoyUnit takes integer index, integer id, rect rec returns nothing
local unit u = CreateUnit(Player(11), id, GetRandomReal(GetRectMinX(rec), GetRectMaxX(rec)), GetRandomReal(GetRectMinY(rec), GetRectMaxY(rec)), 270)
call RemoveGuardPosition(u)
if id==NID_Rifleman or id==NID_NavyCorpsman or id=='h01D' or id==NID_IUL or id=='h017' then
call SaveInteger(HT_Convoy,GetHandleId(u),StringHash("guardorder"),temporder)
call SaveBoolean(HT_Convoy,GetHandleId(LastSpawned),StringHash("left"),templeft)
call GroupAddUnit(RifleButters, u)
endif
if id=='h00B' then
//call SetUnitPathing(u,false)
call SetUnitLifePercentBJ(u, GetRandomReal(60, 90))
call UnitAddAbility(u,'A080')
endif
if id=='h00G' then
//call SetUnitPathing(u,false)
call SetUnitLifePercentBJ(u, GetRandomReal(80, 95))
call UnitAddAbility(u,'A081')
endif
if id==NID_IUL then
call SaveInteger(HT_Convoy,GetHandleId(u),StringHash("guardorder"),temporder)
call SaveBoolean(HT_Convoy,GetHandleId(LastSpawned),StringHash("left"),templeft)
set ConvoyLeader[index]=u
endif
call GroupAddUnit(Convoy[index], u)
call TriggerRegisterUnitEvent(T2, u, EVENT_UNIT_DEATH)
if templeft==true then
set templeft=false
endif
set LastSpawned=u
set u=null
endfunction
function IsRepairTent takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit())=='h01N'
endfunction
function IsMarineTent takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit())=='h01O'
endfunction
function EngGroupRemove takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function EngGroupKill takes nothing returns nothing
local group temp = CreateGroup()
local integer index = tempindex
call GroupAddGroup(tempeng, temp)
call GroupClear(tempeng)
call PolledWait2(15)
set ConvoyRepairing[index]=false
call ForGroup(temp, function EngGroupRemove)
call DestroyGroup(temp)
endfunction
function ConvoyResupply takes integer index, rect rec returns nothing
local group eng = CreateGroup()
local group rtg = CreateGroup()
local group mtg = CreateGroup()
local unit u
local integer cnt=CountAPCs(Convoy[index])
call GroupEnumUnitsInRect(rtg, rec, Condition(function IsRepairTent))
call GroupEnumUnitsInRect(mtg, rec, Condition(function IsMarineTent))
// Reinforcements
if CountUnitsInGroup(mtg)==1 then
set temporder=GetRandomInt(1,cnt)
set templeft=true
call SpawnConvoyUnit(index, NID_Rifleman, rec)
if GetRandomInt(1,2)==1 then
call SpawnConvoyUnit(index, NID_NavyCorpsman, rec)
endif
elseif CountUnitsInGroup(mtg)==2 then
set temporder=GetRandomInt(1,cnt)
set templeft=true
call SpawnConvoyUnit(index, NID_CombatEngineer, rec)
call SpawnConvoyUnit(index, NID_Flamethrower, rec)
set temporder=GetRandomInt(1,cnt)
call SpawnConvoyUnit(index, NID_NavyCorpsman, rec)
if GetRandomInt(1,3)==1 then
set temporder=GetRandomInt(1,cnt)
set templeft=true
call SpawnConvoyUnit(index, NID_Rifleman, rec)
endif
endif
// Repairs
if CountUnitsInGroup(rtg)==1 then
set u = CreateUnit(Player(11), 'h01M', GetRectCenterX(rec), GetRectCenterY(rec), 0)
call GroupAddUnit(eng,u)
elseif CountUnitsInGroup(rtg)==2 then
set u = CreateUnit(Player(11), 'h01M', GetRectCenterX(rec), GetRectCenterY(rec), 0)
call GroupAddUnit(eng,u)
set u = CreateUnit(Player(11), 'h01M', GetRectCenterX(rec), GetRectCenterY(rec), 0)
call GroupAddUnit(eng,u)
endif
if CountUnitsInGroup(rtg) > 0 then
//set tempeng = eng
//set tempindex = index
//call ExecuteFunc("EngGroupKill")
call PolledWait2(15)
set ConvoyRepairing[index]=false
call ForGroup(eng, function EngGroupRemove)
else
set ConvoyRepairing[index]=false
endif
call DestroyGroup(mtg)
set mtg=null
call DestroyGroup(rtg)
set rtg=null
call DestroyGroup(eng)
set eng=null
set u=null
endfunction
function RoadClearInner takes nothing returns boolean
return IsDestructableAliveBJ(GetFilterDestructable()) and (GetDestructableTypeId(GetFilterDestructable())=='B002' or GetDestructableTypeId(GetFilterDestructable())=='B003')
endfunction
function CountDestructsInner takes nothing returns nothing
set Destruct_Count=Destruct_Count+1
endfunction
function IsRoadClear takes integer roadnum returns boolean
set Destruct_Count=0
call EnumDestructablesInRect(Road[roadnum], Condition(function RoadClearInner), function CountDestructsInner)
return Destruct_Count==0
endfunction
function GetRandomAPC takes group g returns unit
local group g2=CreateGroup()
local unit u
call GroupAddGroup(g, g2)
loop
set u=FirstOfGroup(g2)
exitwhen u==null
if GetUnitTypeId(u)=='h00B' then
call DestroyGroup(g2)
return u
endif
call GroupRemoveUnit(g2, u)
endloop
call DestroyGroup(g2)
set u=null
return u
endfunction
function ExitGuards takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function ConvoyUpdateCallback takes integer index returns nothing
local string curpath = SubStringBJ(ConvoyPath[index], CurPath[index], CurPath[index]+1)
local integer prev = S2I(SubStringBJ(ConvoyPath[index], CurPath[index]-2, CurPath[index]-1))
local integer cur = S2I(curpath)
local integer next = S2I(SubStringBJ(ConvoyPath[index], CurPath[index]+2, CurPath[index]+3))
local rect rec = Road[cur]
local group g = CreateGroup()
local unit APC
local unit lead=null
local unit u
local boolean nextset = false
local real count
local real x1
local real y1
local real x2
local real y2
local real angle
local real anglefirst=1337
local real anglemod
local integer order=1
local integer guardorder
local boolean guardleft
if curpath=="AA" then
set rec = Base[1]
elseif curpath=="BB" then
set rec = Base[2]
elseif curpath=="CC" then
set rec = Base[3]
endif
set count=CountAPCs(Convoy[index])
//call BJDebugMsg("---Convoy number: "+I2S(index))
//call BJDebugMsg("Whole path: "+ConvoyPath[index])
//call BJDebugMsg("CurPath var:" + I2S(CurPath[index]))
//call BJDebugMsg("Cur/next:" + I2S(cur) + "/" + I2S(next))
call GroupAddGroup(Convoy[index], g)
loop
set u = FirstOfGroup(g)
//set order = LoadInteger(HT_Convoy,GetHandleId(u),StringHash("order"))
exitwhen u == null
// APC orders
if GetUnitTypeId(u) == 'h00B' or GetUnitTypeId(u)=='h00G' then
if lead==null then
set lead=u
endif
if RectContainsUnit(rec, u) then
call IssueImmediateOrder(u, "holdposition")
//Resupply
if (curpath=="AA" or curpath=="BB" or curpath=="CC") and ConvoySupplied[index]==false then
set ConvoySupplied[index]=true
set ConvoyRepairing[index]=true
call ConvoyResupply(index, rec)
endif
// Blocked roads and next road
if TimerGetRemaining(ConvoyPause[index])==0 and IsRoadClear(next) and nextset==false and cur < 64 and ConvoyRepairing[index]==false then
set ConvoyWaiting[index]=false
set CurPath[index]=CurPath[index]+2
set nextset=true
elseif IsRoadClear(next)==false and ConvoyWaiting[index]==false and nextset==false and ConvoyRepairing[index]==false and cur < 64 then
set ConvoyWaiting[index]=true
call SpawnInfectedOfType('n00R', INFECTED_GROUP_SIZE, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call Transmission(10.,"|cff808000Marine:|r Our convoy is held up |cff50C43Chere|r until you can clear the |cff0000FFnext road|r.")
call PingMinimapEx(GetRectCenterX(Road[next]),GetRectCenterY(Road[next]),8.,28,28,255,true)
call PingMinimapEx(GetRectCenterX(rec),GetRectCenterY(rec),8.,28,255,28,true)
endif
// regular movement
elseif u==lead and TimerGetRemaining(ConvoyPause[index])==0 then
if GetUnitTypeId(u)!='h00B' and GetRandomInt(1,2)==1 then
call IssuePointOrder(u, "attack", GetRectCenterX(rec), GetRectCenterY(rec))
else
call IssuePointOrder(u, "move", GetRectCenterX(rec), GetRectCenterY(rec))
endif
elseif u!=lead then
set angle=AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(lead),GetUnitY(lead))
set x1=GetUnitX(lead)-(350*order)*Cos(angle*bj_DEGTORAD)
set y1=GetUnitY(lead)-(350*order)*Sin(angle*bj_DEGTORAD)
call IssuePointOrder(u,"move",x1,y1)
set order=order+1
if anglefirst==1337 then
set anglefirst=angle
endif
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(lead),GetUnitY(lead)) > 700*order then
call TimerStart(ConvoyPause[index],3,false,null)
endif
endif
// =============Guard orders===========
else
set guardorder = LoadInteger(HT_Convoy,GetHandleId(u),StringHash("guardorder")) - 1
set guardleft = LoadBoolean(HT_Convoy,GetHandleId(u),StringHash("left"))
if guardleft then
set anglemod=90
else
set anglemod=-90
endif
if guardorder>count then
set guardorder = guardorder - (guardorder-R2I(count))
endif
if count==1 then
set angle=AngleBetweenPointsXY(GetUnitX(lead),GetUnitY(lead),GetRectCenterX(rec),GetRectCenterY(rec))
set x1=GetUnitX(lead)
set y1=GetUnitY(lead)
elseif count==0 then
set x1=GetRectCenterX(rec)
set y1=GetRectCenterY(rec)
else
set x1=GetUnitX(lead)-(350*guardorder)*Cos(angle*bj_DEGTORAD)
set y1=GetUnitY(lead)-(350*guardorder)*Sin(angle*bj_DEGTORAD)
endif
set x2=x1-(190)*Cos((angle+anglemod)*bj_DEGTORAD)
set y2=y1-(190)*Sin((angle+anglemod)*bj_DEGTORAD)
if count>0 then
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),x2,y2) > 700 then
if not IsUnitInGroup(u, MINI_SPRINTERS) then
call IssueImmediateOrder(u,"berserk")
endif
call IssuePointOrder(u, "move", x2, y2)
//call UnitAddAbility(u,'A07Z') MS bonus, outdated; sprints now
call UnitRemoveAbility(u,'B002') //stop rapid fire
elseif GetRandomInt(1,3) == 1 then
if IsUnitInGroup(u, MINI_SPRINTERS) then
call IssueImmediateOrder(u,"berserk")
endif
call IssuePointOrder(u, "move", x2, y2)
//call UnitRemoveAbility(u,'A07Z')
else
if IsUnitInGroup(u, MINI_SPRINTERS) then
call IssueImmediateOrder(u,"berserk")
endif
call IssuePointOrder(u, "attack", x2, y2)
//call UnitRemoveAbility(u,'A07Z')
endif
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),x2,y2) > 1200 and TimerGetRemaining(ConvoyPause[index])==0 then
call TimerStart(ConvoyPause[index],3,false,null)
endif
else // Convoy is dead, guards move on their own
if IsRoadClear(next) and nextset==false and cur < 64 then
set ConvoyWaiting[index]=false
set CurPath[index]=CurPath[index]+2
set nextset=true
endif
call IssuePointOrder(u, "attack", x2, y2)
call UnitRemoveAbility(u,'A07Z')
endif
endif
if RectContainsUnit(rec, u) and cur >= 64 then //exit
if GetUnitTypeId(u)=='h00B' then
set SafeAPCs[index]=SafeAPCs[index]+1
endif
call RemoveUnit(u)
call GroupRemoveUnit(Convoy[index], u)
if CountAPCs(Convoy[index]) <= 0 then //remove the guards
call ForGroup(Convoy[index], function ExitGuards)
call GroupClear(Convoy[index])
endif
if IsUnitGroupDeadBJ(Convoy[index]) then
set ConvoyEmpty[index]=true
set ConvoysActive=ConvoysActive-1
if SafeAPCs[index]>0 then
call AwardObjectiveXP(SafeAPCs[index]*15, "Convoy safely evacuated")
endif
endif
endif
if RectContainsUnit(rec, u) and cur==14 then // set B
if BaseCount==0 then
set ConvoyPath[index] = ConvoyPathsB[GetRandomInt(3, PathsBCnt)]
else
set ConvoyPath[index] = ConvoyPathsB[GetRandomInt(1, PathsBCnt)]
endif
set CurPath[index]=1
endif
// Special Events
if RectContainsUnit(rec, u) and cur==43 and SpecialEvent[index]==0 then // wrong turn
set SpecialEvent[index]=1
call Transmission(10.,"|cff808000Marine:|r Our convoy took a wrong turn |cff50C43Chere|r and needs extra security.")
call PingMinimapEx(GetRectCenterX(rec),GetRectCenterY(rec),8.,28,255,28,true)
elseif RectContainsUnit(rec, u) and cur==44 and SpecialEvent[index]==1 then
call SpawnInfectedOfType('n015', 8+5*GAME_MODE, CAVE_LOCS[3])
endif
call GroupRemoveUnit(g, u)
endloop
set curpath=null
set u=null
set APC=null
set lead=null
call DestroyGroup(g)
set g=null
endfunction
private function TentsFilter takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit())=='h01N' or GetUnitTypeId(GetFilterUnit())=='h01O'
endfunction
private function ConvoyUpdate takes nothing returns nothing
local integer index = 1
local group g=CreateGroup()
loop
exitwhen index > 12
if not ConvoyEmpty[index] then
call ConvoyUpdateCallback(index)
call PolledWait2(2.9/ConvoysActive)
endif
set index=index+1
endloop
// Update the outpost count
set index=1
set BaseCount=0
loop
exitwhen index>3
call GroupClear(g)
call GroupEnumUnitsInRect(g,Base[index],Condition(function TentsFilter))
if CountUnitsInGroup(g)<=0 then
set BaseAlive[index]=false
else
set BaseAlive[index]=true
set BaseCount=BaseCount+1
endif
set index=index+1
endloop
call DestroyGroup(g)
set g=null
endfunction
function ConvoySpawn takes nothing returns nothing
local integer index = 1
local integer i=0
local integer rn
local boolean whopper_loc=whopper
local real xmult=1
local real ymult=1
local group g=CreateGroup()
local unit u
set whopper=false
// Set index
if DEFEATED then
return
endif
loop
exitwhen ConvoyEmpty[index] == true
set index = index + 1
endloop
set ConvoysActive = ConvoysActive+1
set ConvoyEmpty[index] = false
set SafeAPCs[index] = 0
set ConvoyDead[index]=false
set ConvoyWaiting[index]=false
set ConvoySupplied[index]=false
set ConvoyRepairing[index]=false
set SpecialEvent[index]=0
set ConvoyPause[index]=CreateTimer()
set CurPath[index]=3
set Convoy[index]=CreateGroup()
if BaseCount>0 then
set ConvoyPath[index] = ConvoyPathsA[GetRandomInt(1, 4)]
else
set ConvoyPath[index] = ConvoyPathsA[GetRandomInt(5, PathsACnt)]
endif
set rn=S2I(SubStringBJ(ConvoyPath[index],1,2))
// Set multipliers to know what direction, default is 1
if rn==69 or rn==68 then
set xmult=-.15
set ymult=-1
elseif rn==64 or rn==65 then
set xmult=-1
set ymult=0
elseif rn==66 or rn==67 then
set xmult=0
elseif rn==70 then
set ymult=-1
endif
call Transmission(10.,"|cff808000Lima-Six:|r A convoy is entering your sector.")
call PingMinimapEx(GetRectCenterX(Road[rn]),GetRectCenterY(Road[rn]),5,180,180,180,false)
call StartSound(gg_snd_Note)
// APCs, i starts at 0
if whopper then
set i=5
call SpawnConvoyUnit(index, NID_Defender, Road[rn])
//call SetUnitX(LastSpawned,GetUnitX(LastSpawned)+350*(xmult*(i+1)))
//call SetUnitY(LastSpawned,GetUnitY(LastSpawned)+350*(ymult*(i+1)))
else
set i=2
endif
set i=0
loop
exitwhen (whopper and i>5) or (not whopper and i>2)
call SpawnConvoyUnit(index, 'h00B', Road[rn])
//call SetUnitX(LastSpawned,GetUnitX(LastSpawned)+350*(xmult*i))
//call SetUnitY(LastSpawned,GetUnitY(LastSpawned)+350*(ymult*i))
set i=i+1
endloop
// Guards
set temporder=1
set templeft=true
call SpawnConvoyUnit(index, NID_Rifleman, Road[rn])
call SpawnConvoyUnit(index, NID_NavyCorpsman, Road[rn])
set temporder=3
set templeft=true
call SpawnConvoyUnit(index, NID_IUL, Road[rn])
call SpawnConvoyUnit(index, NID_Flamethrower, Road[rn])
if GetRandomInt(1,4)==1 then
set temporder=2
set templeft=true
call SpawnConvoyUnit(index, NID_Rifleman, Road[rn])
endif
if whopper_loc then
call Reinforcements(GetRectCenterX(Road[rn]), GetRectCenterY(Road[rn]))
set temporder=2
set templeft=true
call SpawnConvoyUnit(index, NID_Rifleman, Road[rn])
call SpawnConvoyUnit(index, NID_Rifleman, Road[rn])
set temporder=5
set templeft=true
call SpawnConvoyUnit(index, NID_NavyCorpsman, Road[rn])
set temporder=6
call SpawnConvoyUnit(index, NID_MachineGunner, Road[rn])
endif
call GroupAddGroup(Convoy[index],g)
if whopper then
set i=i+1
endif
loop
set u=FirstOfGroup(g)
exitwhen u==null
if GetUnitTypeId(u) == 'h00B' or GetUnitTypeId(u)==NID_Defender then
call SetUnitX(u,GetRectCenterX(Road[rn])+350*(xmult*i))
call SetUnitY(u,GetRectCenterY(Road[rn])+350*(ymult*i))
set i=i-1
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set u=null
endfunction
function ConvoyMission takes nothing returns nothing
local integer i=1
local boolean b=false
call Transmission(10.,"|cff808000Lima-Six:|r Protect each convoy through it's expedition. Every loss will hurt our efforts in the war, so fight hard and good luck.")
call QuestSetDescription(OBJECTIVE_QUEST, "Protect every convoy as best as you can throughout it's journey.")
call EnableTrigger(T3)
call PolledWait2(5.)
call ExecuteFunc("ConvoySpawn")
call SpawnInfectedOfType(ZID_Artemis, 1, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Butcher, 2+GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
if GAME_MODE > 1 then
call PolledWait2(GetRandomInt(30, 70))
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
call ExecuteFunc("ConvoySpawn")
endif
call PolledWait2(GetRandomReal(180,380))
if DEFEATED then
return
endif
call Transmission(10.,"|cff808000Lima-Six:|r Next convoys are approaching your sector.")
call TimerStart(Spawn_Delay,90,false,null)
call PolledWait2(GetRandomInt(20, 30))
call ExecuteFunc("ConvoySpawn")
call SpawnInfectedOfType(ZID_Pudge, 2+GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Butcher, 3+GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
call PolledWait2(GetRandomInt(60, 120))
call SpawnInfectedOfType(ZID_Mutant, 2+GAME_MODE*2, CAVE_LOCS[GetRandomInt(1,4)])
call ExecuteFunc("ConvoySpawn")
if GAME_MODE > 1 then
call PolledWait2(GetRandomInt(20, 90))
call SpawnInfectedOfType(ZID_Arachnathid, 1, CAVE_LOCS[GetRandomInt(1,4)])
call ExecuteFunc("ConvoySpawn")
call PolledWait2(3)
call Transmission(5,"|cff808000Lima-Six:|r An Arachnathid has followed the convoy into your sector. Use extra caution.")
endif
call PolledWait2(GetRandomReal(180,380))
if DEFEATED then
return
endif
call PolledWait2(2.)
call Transmission(10.,"|cff808000Lima-Six:|r We have a huge convoy leading through the sector. It is imperative that it survives.")
call PolledWait2(GetRandomInt(30, 30))
if AVERAGE_XP_NO_HIGH_RANKS>=100000 then
//call Transmission(8.,"|cff808000Lima-Six:|r A metasis has been spotted in your sector. Be prepared.")
else
call Transmission(8.,"|cff808000Lima-Six:|r A gargantuan has been spotted in your sector. Be prepared.")
endif
call SpawnInfectedOfType(ZID_Artemis, 1+(GAME_MODE/2), CAVE_LOCS[GetRandomInt(1,4)])
if AVERAGE_XP_NO_HIGH_RANKS>=40000 then
call SpawnInfectedOfType(ZID_Necaroth, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
// ====Battallion Auth====
set i = 0
loop
exitwhen i > 10
call SetPlayerTechResearched(Player(i),'R00F',1)
set i = i + 1
endloop
// ====Battallion Auth====
set whopper=true
call ExecuteFunc("ConvoySpawn")
set i=1
loop
exitwhen ConvoysActive <= 0
if i >= 60 and b==false then
set b=true
if GAME_MODE > 1 or AVERAGE_XP_NO_HIGH_RANKS>=10000 then
call Transmission(5.,"|cff808000Lima-Six:|r We just got word that an Arachnathid has entered your sector.")
call SpawnInfectedOfType(ZID_Arachnathid, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call SpawnInfectedOfType(ZID_Pudge, 1+GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Mutant, 2+GAME_MODE*2, CAVE_LOCS[GetRandomInt(1,4)])
if AVERAGE_XP_NO_HIGH_RANKS>=30000 then
call SpawnInfectedOfType(ZID_Sting, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endif
set i=i+1
call PolledWait2(2.)
endloop
set AttackConvoy=false
call DisableTrigger(T3)
call FlushParentHashtable(HT_Convoy)
call PolledWait2(2.)
call TriggerExecute(PathOfTheDead_T)
endfunction
private function Actions takes nothing returns nothing
local integer i=1
loop
exitwhen i>12
set ConvoyEmpty[i]=true
set i=i+1
endloop
// Variable setup; first is spawn rect
// Outposts
set ConvoyPathsA[1]="6901020332313029272624AA24232220191817161514"
set ConvoyPathsA[2]="690102033231302927282324AA24262521191817161514"
set ConvoyPathsA[3]="6901020332313029272625BB2521191817161514"
set ConvoyPathsA[4]="6901020332313029272823CC2220191817161514"
//set ConvoyPathsA[4]="690102030405060708091011123334353637383940414264"
// No outposts
set ConvoyPathsA[5]="690102030405060708091011121314"
set ConvoyPathsA[6]="690102030405060708091011123334353637383940414264"
set ConvoyPathsA[7]="68606162633637383840414264"
set PathsACnt = 7
// Head north
set ConvoyPathsB[1]="13123334353637383940414264"
set ConvoyPathsB[2]="1312333435364344455657584264"
// Head south
set ConvoyPathsB[3]="46455659545565"
set ConvoyPathsB[4]="46455657584264"
set ConvoyPathsB[5]="46474851515266"
set ConvoyPathsB[6]="464748495067"
set PathsBCnt = 6
// Mission
set AttackConvoy=true
call ConvoyMission()
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerAddAction(T2,function ConvoyLoss)
set T3 = CreateTrigger()
call DisableTrigger(T3)
call TriggerRegisterTimerEvent(T3, 3, true)
call TriggerAddAction(T3, function ConvoyUpdate)
endfunction
endlibrary
//TESH.scrollpos=114
//TESH.alwaysfold=0
library PathOfTheDead initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger TDar
public trigger TDarAttacked
boolean POTDOn=false
timer DarreusAttacking=CreateTimer()
private rect array deathpath
private integer pathnumb=1
unit Darreus
boolean DarreusLeft=false
group DarreusConvoy=CreateGroup()
endglobals
private function DarreusUpdate_Cond takes nothing returns boolean
return TimerGetRemaining(DarreusAttacking)==0
endfunction
function BloodSplat takes real x, real y returns nothing
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonSmallDeathExplode\\DemonSmallDeathExplode.mdl",x+GetRandomReal(-80,80),y+GetRandomReal(-80,80)))
endfunction
private function SpawnStuff takes nothing returns nothing
local real x
local real y
set x=GetRandomReal(GetRectMinX(deathpath[pathnumb]),GetRectMaxX(deathpath[pathnumb]))
set y=GetRandomReal(GetRectMinY(deathpath[pathnumb]),GetRectMaxY(deathpath[pathnumb]))
call CreateUnit(Player(15),'n00H',x,y,0)
call BloodSplat(x,y)
call PolledWait2(.5)
set x=GetRandomReal(GetRectMinX(deathpath[pathnumb]),GetRectMaxX(deathpath[pathnumb]))
set y=GetRandomReal(GetRectMinY(deathpath[pathnumb]),GetRectMaxY(deathpath[pathnumb]))
call CreateUnit(Player(15),'n00O',x,y,0)
call BloodSplat(x,y)
call PolledWait2(.5)
set x=GetRandomReal(GetRectMinX(deathpath[pathnumb]),GetRectMaxX(deathpath[pathnumb]))
set y=GetRandomReal(GetRectMinY(deathpath[pathnumb]),GetRectMaxY(deathpath[pathnumb]))
call GroupAddUnit(DarreusConvoy,CreateUnit(Player(15),'n012',x,y,0))
call BloodSplat(x,y)
call PolledWait2(.5)
set x=GetRandomReal(GetRectMinX(deathpath[pathnumb]),GetRectMaxX(deathpath[pathnumb]))
set y=GetRandomReal(GetRectMinY(deathpath[pathnumb]),GetRectMaxY(deathpath[pathnumb]))
call GroupAddUnit(DarreusConvoy,CreateUnit(Player(15),'n012',x,y,0))
call BloodSplat(x,y)
endfunction
private function DarreusUpdate takes nothing returns nothing
local unit u
local group g=CreateGroup()
local real x
local real y
if RectContainsUnit(deathpath[pathnumb],Darreus) then
call DisableTrigger(TDar)
if pathnumb==3 or pathnumb==5 or pathnumb==7 then
call SpawnStuff()
endif
if pathnumb==10 then
set DarreusLeft=true
call RemoveUnit(Darreus)
call GroupRemoveGroup(DarreusConvoy,DarreusConvoy)
endif
set pathnumb=pathnumb+1
call PolledWait2(4)
call EnableTrigger(TDar)
endif
call GroupAddGroup(DarreusConvoy,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call IssuePointOrder(u,"move",GetRectCenterX(deathpath[pathnumb]),GetRectCenterY(deathpath[pathnumb]))
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set u=null
endfunction
private function DarreusAttacked_Cond takes nothing returns boolean
local unit u=GetTriggerUnit()
local boolean b=IsUnitInGroup(u,DarreusConvoy)
set u=null
return b
endfunction
private function DarreusAttacked takes nothing returns nothing
local unit u=GetAttacker()
local unit gu
local group g=CreateGroup()
if TimerGetRemaining(DarreusAttacking)==0 then
call StartSound(gg_snd_DarreusAttacking)
call IssueImmediateOrder(Darreus,"berserk")
//call IssuePointOrder(Darreus,"attack",GetUnitX(u),GetUnitY(u))
//call AttackPlayerUnit(Darreus)
call GroupAddGroup(DarreusConvoy,g)
loop
set gu=FirstOfGroup(g)
exitwhen gu==null
call IssuePointOrder(gu,"attack",GetUnitX(u),GetUnitY(u))
call GroupRemoveUnit(g,gu)
endloop
endif
call TimerStart(DarreusAttacking,10,false,null)
set u=null
set gu=null
call DestroyGroup(g)
set g=null
endfunction
private function Actions takes nothing returns nothing
call TimerStart(Spawn_Delay,0,false,null)
call Transmission(14,"|cff808000Lima-Six:|r Recon has picked up Darreus moving through your sector. He is somehow spreading the disease and infecting everything in his path.")
call QuestSetDescription(OBJECTIVE_QUEST, "Kill darreus.")
call PolledWait2(10)
call Transmission(14,"|cff808000Lima-Six:|r We cannot have that creature infecting other sectors. Your objective is to kill Darreus before he leaves your sector.")
call PolledWait2(4)
set deathpath[1]=gg_rct_Road60
set deathpath[2]=gg_rct_DarreusPath01
set deathpath[3]=gg_rct_DarreusPath02
set deathpath[4]=gg_rct_DarreusPath03
set deathpath[5]=gg_rct_DarreusPath04
set deathpath[6]=gg_rct_DarreusPath05
set deathpath[7]=gg_rct_DarreusPath06
set deathpath[8]=gg_rct_DarreusPath07
set deathpath[9]=gg_rct_Road42
set deathpath[10]=gg_rct_RoadExit64
set POTDOn=true
set Darreus = CreateUnit(Player(15),ZID_Darreus,GetRectCenterX(Road[68]),GetRectCenterY(Road[68]),270)
call GroupAddUnit(DarreusConvoy,Darreus)
call VisionUnit(Darreus,true)
call StartSound(gg_snd_ReviveUndead)
call PingMinimapEx(GetUnitX(Darreus), GetUnitY(Darreus), 4, 255, 0, 0, false)
call GroupAddUnit(DarreusConvoy,SpawnInfectedOfType(ZID_Thanatos, 1, Road[68]))
call GroupAddUnit(DarreusConvoy,SpawnInfectedOfType(ZID_Thanatos, 1, Road[68]))
call GroupAddUnit(DarreusConvoy,SpawnInfectedOfType(ZID_Butcher, 1, Road[68]))
if GAME_MODE > 1 then
call GroupAddUnit(DarreusConvoy,SpawnInfectedOfType(ZID_Thanatos, 1, Road[68]))
endif
call EnableTrigger(TDar)
call SpawnInfectedOfType(ZID_Spitter, 5, Road[68])
call PolledWait2(10)
if GetSoundIsPlayingBJ(gg_snd_DarknessMusic) then
call StopSound(gg_snd_DarknessMusic,false,true)
endif
call StartSound(gg_snd_Undead2)
loop
exitwhen IsUnitDeadBJ(Darreus) or DarreusLeft
call PolledWait2(1)
endloop
call DisableTrigger(TDar)
if not DarreusLeft then
call AwardObjectiveXP(100, "Darreus killed")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call PolledWait2(5.)
call Transmission(10.,"|cff808000Marine:|r Lima-six this is two-six, target destroyed.")
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r Good job. You saved many lives today.")
else
call AwardObjectiveXP(-15, "Darreus left the sector")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
endif
set POTDOn=false
call PolledWait2(2.)
call TriggerExecute(Civilians_T)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set TDar = CreateTrigger()
call TriggerAddCondition(TDar,Condition(function DarreusUpdate_Cond))
call DisableTrigger(TDar)
call TriggerRegisterTimerEvent(TDar,3,true)
call TriggerAddAction(TDar,function DarreusUpdate)
set TDarAttacked = CreateTrigger()
call TriggerAddCondition(TDarAttacked,Condition(function DarreusAttacked_Cond))
call TriggerRegisterAnyUnitEventBJ(TDarAttacked,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(TDarAttacked,function DarreusAttacked)
endfunction
endlibrary
//TESH.scrollpos=262
//TESH.alwaysfold=0
library Civilians initializer Init requires GlobalFuncs
globals
public trigger T
public trigger T2
public trigger TC
public trigger TExtrac
private group Civilians=CreateGroup()
private group Evacuees=CreateGroup()
private boolean AllAboard=false
endglobals
private function AreAllAboard takes nothing returns nothing
local unit u=GetEnumUnit()
if IsUnitAliveBJ(u) and IsUnitHidden(u)==false then
set AllAboard=false
endif
set u=null
endfunction
private function EnterHeli takes nothing returns nothing
local unit u=GetEnteringUnit()
if IsUnitType(u,UNIT_TYPE_HERO) and GetPlayerId(GetOwningPlayer(u))<11 then
call ShowUnit(u,false)
set AllAboard=true
call ForGroup(PLAYER_UNITS,function AreAllAboard)
elseif GetPlayerId(GetOwningPlayer(u))<11 then //mini
call ShowUnit(u,false)
endif
set u=null
endfunction
private function CiviliansUpdate takes nothing returns nothing
local unit u
local integer i
local real x
local real y
local group g=CreateGroup()
call GroupAddGroup(Civilians,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
set i=GetUnitUserData(u)
set x=GetRectCenterX(Base[i])
set y=GetRectCenterY(Base[i])
if GetUnitTypeId(u)=='h005' or GetUnitTypeId(u)=='h018' then
call IssuePointOrder(u, "attack", x, y)
else
call IssuePointOrder(u, "move", x, y)
endif
if RectContainsUnit(Base[i], u) then
call GroupRemoveUnit(Civilians, u)
call RemoveUnit(u)
call AwardObjectiveXP(5, "Civilian extracted")
endif
call GroupRemoveUnit(g,u)
endloop
set u=null
endfunction
private function Actions takes nothing returns nothing
local integer index=1
local integer i=1
local unit array heli
local group g=CreateGroup()
local unit u
local unit Minerva
set CiviliansWander=false
call Transmission(10.,"|cff808000Lima-Six:|r We've got heavy hostile activity surrounding your sector. Civilians are evecuating from the outlying sectors into yours.")
call QuestSetDescription(OBJECTIVE_QUEST, "Kill minerva.")
call PolledWait2(5)
call Transmission(10.,"|cff808000Lima-Six:|r The outposts seem to be the best mass extraction points. Get to the towns and set up defensive positions.")
call PolledWait2(15)
// === Minerva ===
call SpawnInfectedOfType(ZID_Ravager, R2I(INFECTED_GROUP_SIZE*.85), SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
if GetRandomInt(1,50)==1 then
set Minerva = SpawnInfectedOfType('n018', 1, CAVE_LOCS[GetRandomInt(1,4)])
else
set Minerva = SpawnInfectedOfType(ZID_Minerva, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
if GAME_MODE > 1 then
call SpawnInfectedOfType(ZID_Necaroth, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call SpawnInfectedOfType(ZID_Krill, 1.5*INFECTED_GROUP_SIZE, SPAWN_LOC[GetRandomInt(1,4)])
call Transmission(10.,"|cff808000Lima-Six:|r A minerva has been spotted in your sector. Keep the civilians safe.")
if DEFEATED then
return
endif
call DisableTrigger(SpawnInfected90_T)
if (GAME_MODE==UA2_ModeRecruit) then
call EnableTrigger(SpawnInfected120Recruit_T)
else
call EnableTrigger(SpawnInfected180_T)
endif
call PolledWait2(5.)
call QuestSetDescription(OBJECTIVE_QUEST, "Guard the civilians.")
call Transmission(10.,"|cff808000Lima-Six:|r The civilians have arrived, get to the north town.")
// === Evacuees ===
loop
exitwhen index > GetRandomInt(12,15)
set u=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),CivilianIDs[GetRandomInt(1,5)],GetRectCenterX(gg_rct_RoadExit68),GetRectCenterY(gg_rct_RoadExit68),0)
call GroupAddUnit(Evacuees,u)
call VisionUnit(u,true)
set index=index+1
endloop
set index=1
loop
exitwhen index > GetRandomInt(7,9)
set u=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),CivilianIDs[GetRandomInt(6,7)],GetRectCenterX(gg_rct_RoadExit68),GetRectCenterY(gg_rct_RoadExit68),0)
call GroupAddUnit(Evacuees,u)
call VisionUnit(u,true)
set index=index+1
endloop
call Reinforcements(GetRectCenterX(gg_rct_RoadExit68),GetRectCenterY(gg_rct_RoadExit68))
loop
exitwhen IsUnitGroupInRectBJ(Evacuees,gg_rct_Town1)
call GroupAddGroup(Evacuees,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitDeadBJ(u) then
call GroupRemoveUnit(Evacuees,u)
endif
if GetRandomInt(1,2)==1 then
call IssuePointOrder(u,"move",GetRectCenterX(gg_rct_Town1)+GetRandomReal(-500,500),GetRectCenterY(gg_rct_Town1)+GetRandomReal(-1500,1500))
else
call IssuePointOrder(u,"attack",GetRectCenterX(gg_rct_Town1)+GetRandomReal(-500,500),GetRectCenterY(gg_rct_Town1)+GetRandomReal(-1500,1500))
endif
call GroupRemoveUnit(g,u)
endloop
call PolledWait2(4.)
endloop
call GroupClear(g)
call PolledWait2(5.)
call Transmission(10,"|cff808000Lima-Six:|r Protect the civilians until the helicopters arrive.")
set MissionTime=120
call PolledWait2(100)
if DEFEATED then
return
endif
call Transmission(10,"|cff808000Lima-Six:|r Helicopters ETA 20 seconds.")
call PolledWait2(20)
if DEFEATED then
return
endif
call Transmission(10,"|cff808000Lima-Six:|r The helicopters have arrived. Get everyone in the helicopters then we'll send one for your platoon.")
// === Helicopters ===
set index=1
loop
exitwhen index > 3
set heli[index] = LandHeli(GetRectCenterX(Base[index]), GetRectCenterY(Base[index]))
call PingMinimapEx(GetRectCenterX(Base[index]), GetRectCenterY(Base[index]), 12, 0, 255, 0, false)
set index=index+1
endloop
call PolledWait2(5)
set CiviliansWander=false
set g=GetUnitsOfType('n004')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('n005')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('n006')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('n007')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('n008')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('h005')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
set g=GetUnitsOfType('h018')
call GroupAddGroup(g, Civilians)
call GroupClear(g)
call GroupAddGroup(Civilians,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call SetUnitUserData(u, GetRandomInt(1,3))
call VisionUnit(u,true)
if RectContainsCoords(gg_rct_Town1, GetUnitX(u), GetUnitY(u)) then
call IssuePointOrder(u, "move", GetRectCenterX(gg_rct_Town1), GetRectCenterY(gg_rct_Town1))
else
call IssuePointOrder(u, "move", GetRectCenterX(gg_rct_Town2), GetRectCenterY(gg_rct_Town2))
endif
call GroupRemoveUnit(g,u)
endloop
if DEFEATED then
return
endif
call PolledWait2(4)
call EnableTrigger(T2)
loop
exitwhen IsUnitGroupDeadBJ(Civilians) or IsUnitGroupEmptyBJ(Civilians)
call PolledWait2(5)
endloop
call DisableTrigger(T2)
if DEFEATED then
return
endif
set index=1
loop
exitwhen index > 3
call TakeoffHeli(heli[index])
set heli[index]=null
set index=index+1
endloop
// ==== Evacuate players ====
set u=LandHeli(GetRectCenterX(gg_rct_StartingRect), GetRectCenterY(gg_rct_StartingRect))
call PingMinimapEx(GetRectCenterX(gg_rct_StartingRect), GetRectCenterY(gg_rct_StartingRect), 12, 0, 255, 0, false)
call Transmission(10.,"|cff808000Pilot:|r We are low on fuel. You've got 2 minutes to get to the LZ or we'll have to leave without you!")
set MissionTime=120
// Stop Spawns
call TimerStart(Spawn_Delay,5,false,null)
call PauseTimer(Spawn_Delay)
call TriggerRegisterEnterRectSimple(TExtrac,gg_rct_StartingRect)
set index=1
loop
exitwhen index > 120 or AllAboard
if index==105 then
call Transmission(10.,"|cff808000Pilot:|r 15 seconds!")
endif
call PolledWait2(1)
set index=index+1
endloop
if DEFEATED then
return
endif
call DisableTrigger(TExtrac)
call Transmission(10.,"|cff808000Pilot:|r And we're outta here.")
call PolledWait2(1.)
call CinematicFilterGenericBJ(2, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 100, 0, 0, 0, 0)
call PolledWait2(2.5)
call EnableTrigger(TC)
call PolledWait2(.5)
call CinematicFilterGenericBJ(2, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0, 0, 0, 0, 100)
call PolledWait2(2.)
call StartSound(gg_snd_Bell1)
call TakeoffHeli(u)
call PolledWait2(2.25)
call StartSound(gg_snd_Bell2)
call PolledWait2(2.)
call CinematicFilterGenericBJ(2, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 100, 0, 0, 0, 0)
// Reset vision
set i=0
loop
exitwhen i > 10
if PLAYER_HAS_NVG[i+1] then
call ShowNightVision(Player(i),true)
else
call ShowNightVision(Player(i),false)
endif
set i=i+1
endloop
// hide heroes
set index=1
loop
exitwhen index>11
if IsUnitHidden(PLAYER_UNIT[index])==false then
call ShowUnit(PLAYER_UNIT[index],false)
endif
set index=index+1
endloop
// Stop camera
call DisableTrigger(TC)
// Remove all non-heroes
call GroupClear(g)
call GroupEnumUnitsInRect(g,GetPlayableMapRect(),null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if not IsUnitType(u, UNIT_TYPE_HERO) then
call RemoveUnit(u)
endif
call GroupRemoveUnit(g,u)
endloop
call PolledWait2(2.)
call TriggerExecute(Salvation_T)
set Minerva=null
set u=null
call DestroyGroup(g)
set g=null
endfunction
private function Camera_Actions takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_Starting_Cam2,true,0)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set TC = CreateTrigger()
call DisableTrigger(TC)
call TriggerRegisterTimerEventPeriodic(TC,.05)
call TriggerAddAction(TC,function Camera_Actions)
set T2=CreateTrigger()
call DisableTrigger(T2)
call TriggerRegisterTimerEvent(T2, 3, true)
call TriggerAddAction(T2,function CiviliansUpdate)
set TExtrac=CreateTrigger()
call TriggerAddAction(TExtrac,function EnterHeli)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
if IsUnitDeadBJ(Minerva) then
call AwardObjectiveXP(100, "Minerva killed")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call PolledWait2(5.)
call Transmission(10.,"|cff808000Lima-Six:|r The civilians will arrive soon, and make their way to the north town.")
if MissionTime < 60 then
call PolledWait2(MissionTime)
else
call PolledWait2(8.)
endif
else
call AwardObjectiveXP(-15, "Minerva not killed in time")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
endif
set MissionTime = 300 //*MissionTimeModifier
loop
exitwhen IsUnitDeadBJ(Minerva) or MissionTime==0
call PingMinimapEx(GetUnitX(Minerva), GetUnitY(Minerva), 1, 180, 15, 15, false)
//call StartSound(gg_snd_Heartbeat)
call PolledWait2(2.)
endloop
//TESH.scrollpos=512
//TESH.alwaysfold=0
library Salvation initializer Init requires GlobalFuncs
globals
public trigger T
public trigger T2
public trigger T3
public trigger T4
public trigger T5
private group array Snipers
rect array SNIPERSPOT
integer SNIPERSPOT_COUNT
rect array GUARDSPOT
group Salv_USMC
endglobals
private function SpawnGuard takes integer id, rect rec returns nothing
call GroupAddUnit(Salv_USMC,CreateUnit(Player(14),id,GetRectRandX(rec),GetRectRandY(rec),GetRandomDirectionDeg()))
endfunction
private function SpawnConvoyUnit takes integer id, rect rec returns unit
local unit u = CreateUnit(Player(14), id, GetRandomReal(GetRectMinX(rec), GetRectMaxX(rec)), GetRandomReal(GetRectMinY(rec), GetRectMaxY(rec)), 340)
if id=='h009' or id=='h019' or id=='h01D' or id=='h00A' or id=='h017' then
call GroupAddUnit(RifleButters, u)
endif
return u
endfunction
private function GetSniper takes group g returns unit
local group g2=CreateGroup()
local unit u
call GroupAddGroup(g,g2)
loop
set u=FirstOfGroup(g2)
exitwhen GetUnitTypeId(u)==NID_SniperBlind or IsUnitGroupEmptyBJ(g2)
call GroupRemoveUnit(g2,u)
endloop
call DestroyGroup(g2)
set g2=null
return u
endfunction
private function GetSpotter takes group g returns unit
local group g2=CreateGroup()
local unit u
call GroupAddGroup(g,g2)
loop
set u=FirstOfGroup(g2)
exitwhen GetUnitTypeId(u)==NID_SpotterBlind or IsUnitGroupEmptyBJ(g2)
call GroupRemoveUnit(g2,u)
endloop
call DestroyGroup(g2)
set g2=null
return u
endfunction
private function SnipersDead takes integer groups returns boolean
local integer i=1
local boolean b=true
loop
exitwhen i>groups or b==false
if IsUnitGroupDeadBJ(Snipers[i])==false then
set b=false
endif
set i=i+1
endloop
return b
endfunction
private function SpawnSniperTeam takes integer index, rect rec returns unit
local unit u
local item it
set Snipers[index]=CreateGroup()
set u=CreateUnit(Player(11), NID_SniperBlind, GetRandomReal(GetRectMinX(rec), GetRectMaxX(rec)), GetRandomReal(GetRectMinY(rec), GetRectMaxY(rec)), 180)
call GroupAddUnit(Snipers[index],u)
//call InitiateUmbrellaSoldier(u)
call UnitAddAbility(u,'SPRD')
call UnitAddAbility(u,'STAD')
call UnitAddAbility(u,'JUMD')
call IssueImmediateOrder(u,"holdposition")
call IssueImmediateOrder(u,"defend")
//call VisionUnit(u,true)
set u=CreateUnit(Player(11), NID_SpotterBlind, GetRandomReal(GetRectMinX(rec), GetRectMaxX(rec)), GetRandomReal(GetRectMinY(rec), GetRectMaxY(rec)), 180)
call GroupAddUnit(Snipers[index],u)
call InitiateUmbrellaSoldier(u)
call IssueImmediateOrder(u,"holdposition")
call IssueImmediateOrder(u,"defend")
set it= CreateItem('I00W',GetUnitX(u),GetUnitY(u))
call UnitAddItem(u,it)
call GroupAddUnit(RifleButters, u)
//call VisionUnit(u,true)
set it=null
return u
endfunction
private function SpawnUmbrellaFlare_Inner takes real duration, rect rec returns nothing
local unit u
set u=CreateUnit(Player(11),'o008',GetRectCenterX(rec),GetRectCenterY(rec),0)
call UnitApplyTimedLife(u, 'BTLF', duration)
call VisionUnit(u,true)
set u=null
endfunction
private function SpawnUmbrellaFlares takes real duration returns nothing
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare01)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare02)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare03)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare04)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare05)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare06)
call SpawnUmbrellaFlare_Inner(duration,gg_rct_Flare07)
endfunction
private function SetPlayerAlliances takes nothing returns nothing
call SetPlayerAllianceStateBJ(GetEnumPlayer(),Player(14),3)
call SetPlayerAllianceStateBJ(Player(14),GetEnumPlayer(),3)
call SetPlayerAllianceStateBJ(GetEnumPlayer(),Player(11),0)
call SetPlayerAllianceStateBJ(Player(11),GetEnumPlayer(),0)
endfunction
private function SetOwner14 takes nothing returns nothing
call SetUnitOwner(GetEnumUnit(),Player(14),true)
endfunction
private function Actions takes nothing returns nothing
local unit array convoy
local integer i=0
local integer i2
local integer snipercount
local unit u
local unit u2
local group Bosses=CreateGroup()
local group g=CreateGroup()
if DEFEATED then
return
endif
call CreateItem('I00W',GetRectCenterX(gg_rct_FlareGun01),GetRectCenterY(gg_rct_FlareGun01))
call CreateItem('I00O',GetRectCenterX(gg_rct_FlareGun02),GetRectCenterY(gg_rct_FlareGun02))
// Delete this when done
set i=1
loop
exitwhen i>11
if IsUnitHidden(PLAYER_UNIT[i])==false then
call ShowUnit(PLAYER_UNIT[i],false)
endif
set i=i+1
endloop
// Delete this when done
//ally Umbrella and zombies
call SetPlayerAllianceStateBJ(Player(11),Player(15),2)
call SetPlayerAllianceStateBJ(Player(15),Player(11),2)
// swap umb and USMC teams
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function SetPlayerAlliances)
call GroupEnumUnitsOfPlayer(g,P_USMC,BE_TRUE)
call ForGroup(g,function SetOwner14)
call SetPlayerAllianceStateBJ(Player(12),Player(14),3)
call SetPlayerAllianceStateBJ(Player(14),Player(12),3)
call SetPlayerAllianceStateBJ(Player(11),Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),Player(11),0)
call SetPlayerName(Player(11),"|cff808000Umbrella|r")
call SetPlayerName(Player(14),"|cff808000USMC|r")
set P_USMC=Player(14)
call DestroyGroup(g)
set g=null
call EnableTrigger(T2)
call Chapter("Salvation")
call PolledWait2(1.5)
call Transmission(4.,"It's been 3 weeks since the evacuation of this area...")
set i=1
set convoy[1]=SpawnConvoyUnit('h00G',gg_rct_RoadExit70)
call SetUnitMoveSpeed(convoy[1],185)
call IssuePointOrder(convoy[1],"move",GetRectCenterX(gg_rct_Convoy01),GetRectCenterY(gg_rct_Convoy01))
call RemoveGuardPosition(convoy[1])
call PolledWait2(2)
loop
exitwhen i>4
set convoy[i+1]=SpawnConvoyUnit('h00B',gg_rct_RoadExit70)
call RemoveGuardPosition(convoy[i+1])
call IssuePointOrder(convoy[i+1],"move",GetRectCenterX(gg_rct_Convoy01)-350*i,GetRectCenterY(gg_rct_Convoy01)+250*i)
call PolledWait2(2)
set i=i+1
endloop
call PolledWait2(1)
// call ShowInterface(false, 0)
// call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT,0.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call Transmission(5.,"|cff808000Briefing:|r Reports of an Umbrella facility in Sector C may provide scientific data on a cure for the virus.")
call PolledWait2(6.)
call Transmission(5,"|cff808000Briefing:|r You're going in there with a full platoon to strongpoint the position, wait for Alpha company, and then infiltrate the facility. Expect heavy activity.")
// call ShowInterface(true, 3)
// call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN,3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PolledWait2(2.)
set i=0
loop
exitwhen i>4
call IssuePointOrder(convoy[i+1],"move",GetRectCenterX(gg_rct_ConvoyStop01)-450*i,GetRectCenterY(gg_rct_ConvoyStop01)+50*i)
// call PolledWait2(.3)
set i=i+1
endloop
call SpawnUmbrellaFlares(180)
call PolledWait2(4.5)
call Transmission(3.,"|cff808000Marine:|r Seems quiet...")
call DisableTrigger(T2)
call EnableTrigger(T3)
call PolledWait2(5.)
call Transmission(4.,"|cff808000Marine:|r Yeah, especially considering what it was like the last time we were here.")
call PolledWait2(8)
call Transmission(7.,"|cff808000Lima-Six:|r Apparently the PMC Umbrella Corp. has heard about our mission, and may even plan to intervene. We have a communcations team callsign PROPHET that will be tapping in on their comms.")
call PolledWait2(3)
call DisableTrigger(T3)
call EnableTrigger(T4)
set i=0
loop
exitwhen i>15 or RectContainsUnit(gg_rct_ConvoyStop01,convoy[1])
set i=i+1
call PolledWait2(1)
endloop
if RectContainsUnit(gg_rct_ConvoyStop01,convoy[1])==false then
call SetUnitX(convoy[1],GetRectCenterX(gg_rct_ConvoyStop01))
call SetUnitY(convoy[1],GetRectCenterY(gg_rct_ConvoyStop01))
endif
call PolledWait2(1)
set i=1
loop
exitwhen i>5
call IssueImmediateOrder(convoy[i],"holdposition")
call SetUnitInvulnerable(convoy[i],true)
call PauseUnit(convoy[i],true)
set i=i+1
endloop
//============ Mine Attack ===========
//call DestroyEffect(AddSpecialEffect("war3mapImported\\ClaymoreExplode.mdl",GetUnitX(convoy[1]),GetUnitY(convoy[1])))
set u=CreateUnit(Player(14),'h01U',GetUnitX(convoy[1]),GetUnitY(convoy[1]),0) //effect dummy
call SetUnitAnimation(convoy[1],"death")
call SetUnitLifePercentBJ(convoy[1],20)
call PauseUnit(convoy[1],true)
call StartSound(gg_snd_AirstrikeDist)
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call Transmission(3.,"|cff808000Marine:|r Shit!")
else
call Transmission(3.,"|cff808000Marine:|r Agh!")
endif
call PolledWait2(2)
call SetUnitAnimation(convoy[1],"decay")
call SetUnitTimeScalePercent(convoy[1],0)
call Transmission(3.,"|cff808000Marine:|r Lima six this is two-six, we just hit a mine, assessing casualties, break.")
call PolledWait2(1.5)
call RemoveUnit(u)
set u=CreateUnit(Player(14),'h009',GetUnitX(convoy[2])-150,GetUnitY(convoy[2]),360)
call SetUnitLifePercentBJ(u,10)
call UnitShareVision(u,Player(11),true)
call IssuePointOrder(u,"move",GetUnitX(u),GetUnitY(u)-150)
call PolledWait2(.8)
call IssuePointOrder(u,"move",GetUnitX(convoy[1])-80,GetUnitY(convoy[1])-220)
call PolledWait2(2)
// ==Snipers!==
call DisableTrigger(RunWhenAttacked_T)
set snipercount = 2
set i=GetRandomInt(1,SNIPERSPOT_COUNT)
call SpawnSniperTeam(1,SNIPERSPOT[i])
loop
set i2=GetRandomInt(1,SNIPERSPOT_COUNT)
exitwhen i2!=i
endloop
call SpawnSniperTeam(2,SNIPERSPOT[i2])
call PolledWait2(4)
call Transmission(4.,"|cff808000Marine:|r We're taking sniper fire from the cliffs ahead. We'll be sending a squad to flank them. We've got 1 casualty plus the lead convoy.")
call PolledWait2(3)
set u=CreateUnit(Player(14),'h009',GetUnitX(convoy[2])+175,GetUnitY(convoy[2]),360)
call UnitAddItemByIdSwapped('I00N',u)
call UnitUseItemPoint(u,bj_lastCreatedItem,GetRectCenterX(gg_rct_SmokeGrenade),GetRectCenterY(gg_rct_SmokeGrenade))
call PolledWait2(1)
call IssuePointOrder(u,"move",GetUnitX(convoy[2]),GetUnitY(convoy[2]))
call PolledWait2(.5)
call RemoveUnit(u)
//pause snipers so they dont attack the players when they run out
call PauseUnit(GetSniper(Snipers[1]),true)
call PauseUnit(GetSniper(Snipers[2]),true)
call DisableTrigger(T4)
call EnableTrigger(T5)
call PolledWait2(2)
call EnableTrigger(RunWhenAttacked_T)
call DisableTrigger(T5)
call PolledWait2(.5)
call ResetToGameCamera(0)
// Spawn the players, get them moving
set i=1
loop
exitwhen i>11
if PLAYER_UNIT[i]!=null then
call UnitShareVision(PLAYER_UNIT[i],Player(11),false)
call ShowUnit(PLAYER_UNIT[i],true)
if IsUnitDeadBJ(PLAYER_UNIT[i]) then
if (GetUnitTypeId(PLAYER_UNIT[i])=='h00K') then
call CreateUnit(Player(i-1),'h00K',GetRectCenterX(gg_rct_Convoy01),GetRectCenterY(gg_rct_Convoy01),0)
else
call ReviveHero(PLAYER_UNIT[i],GetUnitX(convoy[2]),GetUnitY(convoy[2])+175,false)
endif
else
if (GetUnitTypeId(PLAYER_UNIT[i])=='h00K') then
call SetUnitX(PLAYER_UNIT[i],GetRectCenterX(gg_rct_Convoy01))
call SetUnitY(PLAYER_UNIT[i],GetRectCenterY(gg_rct_Convoy01))
else
call SetUnitX(PLAYER_UNIT[i],GetUnitX(convoy[2]))
call SetUnitY(PLAYER_UNIT[i],GetUnitY(convoy[2])+175)
endif
endif
call SetUnitLifePercentBJ(PLAYER_UNIT[i],100)
call IssuePointOrder(PLAYER_UNIT[i],"move",GetUnitX(convoy[2])+GetRandomReal(-50,50),GetUnitY(convoy[2])+575+(GetRandomReal(-50,50)))
call SelectUnitForPlayerSingle(PLAYER_UNIT[i],Player(i-1))
call PanCameraToTimedForPlayer(Player(i-1),GetUnitX(PLAYER_UNIT[i]),GetUnitY(PLAYER_UNIT[i]),0.)
call SetCameraFieldForPlayer(Player(i-1),CAMERA_FIELD_TARGET_DISTANCE,Player_ViewDist[i]*100.,1)
endif
set i=i+1
endloop
call PolledWait2(3)
call PauseUnit(GetSniper(Snipers[1]),false)
call PauseUnit(GetSniper(Snipers[2]),false)
call Transmission(4.,"|cff808000Marine:|r We've got 5 minutes to take out those snipers. Hoorah!")
call PolledWait2(3)
set MissionTime=300
call QuestSetDescription(OBJECTIVE_QUEST, "Flank the snipers in the cliffs ahead. Both you and them can see eachother's flares. Stay out of sight.")
call Transmission(4.,"|cff808000Marine:|r Stay away from their ground flares. If they spot us we'll get hit.")
call PolledWait2(3)
call Transmission(4.,"|cff808000Marine:|r Remember, flares work both ways. They can see ours, and we can see theirs. Use smokes to obscure vision.")
loop
exitwhen MissionTime<=0 or SnipersDead(snipercount)
if MissionTime==60 then
call GetSpotter(Snipers[GetRandomInt(1,snipercount)])
endif
call PolledWait2(1)
endloop
if DEFEATED then
return
endif
if SnipersDead(snipercount) then
call AwardObjectiveXP(105, "Snipers killed in time")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
else
call AwardObjectiveXP(-5, "Snipers not killed in time")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
endif
// Resume spawns
call ResumeTimer(Spawn_Delay)
call PolledWait2(3)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PolledWait2(2)
// move the convoy in position
// when i is set at 1, also moves the IFV
set i=2
loop
exitwhen i>5
call SetUnitX(convoy[i],(GetRectCenterX(Road[54])+350)-350*(i-2))
call SetUnitY(convoy[i],GetRectCenterY(Road[54])+75*(i-2))
call IssueImmediateOrder(convoy[i],"holdposition")
call SetUnitInvulnerable(convoy[i],false)
call PauseUnit(convoy[i],true)
set i=i+1
endloop
// move the players in position
set i=1
loop
exitwhen i>11
if PLAYER_UNIT[i]!=null and IsUnitAliveBJ(PLAYER_UNIT[i]) then
if i<6 then
call SetUnitX(PLAYER_UNIT[i],GetRectCenterX(Road[54])-100*(i-1))
else
call SetUnitX(PLAYER_UNIT[i],GetRectCenterX(Road[54])+100*i)
endif
call SetUnitY(PLAYER_UNIT[i],GetRectCenterY(Road[54])+500)
endif
set i=i+1
endloop
set Salv_USMC=CreateGroup()
// spawn some AI units
call SpawnGuard(NID_Rifleman,gg_rct_SalvGuard01)
call SpawnGuard(NID_NavyCorpsman,gg_rct_SalvGuard01)
call SpawnGuard(NID_Rifleman,gg_rct_SalvGuard02)
call SpawnGuard(NID_MachineGunner,gg_rct_SalvGuard02)
call SpawnGuard(NID_Flamethrower,gg_rct_SalvGuard02)
call SpawnGuard(NID_Rifleman,gg_rct_SalvGuard03)
call SpawnGuard(NID_Rifleman,gg_rct_SalvGuard04)
call SpawnGuard(NID_MachineGunner,gg_rct_SalvGuard04)
call SpawnGuard(NID_Rifleman,gg_rct_SalvGuard05)
call SpawnGuard(NID_Flamethrower,gg_rct_SalvGuard05)
call SpawnGuard(NID_CombatEngineer,gg_rct_SalvGuard06)
call SpawnGuard(NID_IUL,gg_rct_SalvGuard06)
call SpawnGuard(NID_Abrams,gg_rct_SalvGuardTank)
call SpawnGuard(NID_Defender,gg_rct_SalvGuardTank2)
call GroupEnumUnitsOfPlayer(Salv_USMC,Player(14),BE_TRUE)
call PanCameraTo(GetRectCenterX(Road[54]),GetRectCenterY(Road[54]))
call PolledWait2(2)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PolledWait2(1)
set i=0
loop
exitwhen i > 10
if PLAYER_HAS_NVG[i+1] then
call ShowNightVision(Player(i),true)
else
call ShowNightVision(Player(i),false)
endif
set i=i+1
endloop
call PolledWait2(1)
call Transmission(4.,"|cff808000Lima-Six:|r Recon has picked up a Gargantuan, metasis, and Behemoth in your sector. Wipe them out.")
call QuestSetDescription(OBJECTIVE_QUEST, "Kill the Gargantuan, metasis, and Behemoth.")
call StartSound(gg_snd_UndeadX1)
set u = SpawnInfectedOfType(ZID_Gargantuan, 1, Road[44])
call GroupAddUnit(Bosses,u)
call VisionUnit(u,true)
set u = SpawnInfectedOfType(ZID_Behemoth, 1, Road[46])
call GroupAddUnit(Bosses,u)
call VisionUnit(u,true)
set u = SpawnInfectedOfType(ZID_Metasis, 1, BORDER_ZONES[GetRandomInt(1,4)])
call GroupAddUnit(Bosses,u)
call VisionUnit(u,true)
loop
exitwhen IsUnitGroupDeadBJ(Bosses) or DEFEATED
call PolledWait2(2)
endloop
if DEFEATED then
return
endif
call AwardObjectiveXP(85, "Targets neutralized")
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call PolledWait2(2)
set u=null
set u2=null
call DestroyGroup(Bosses)
set Bosses=null
// Stop Spawns
call TimerStart(Spawn_Delay,2,false,null)
call PauseTimer(Spawn_Delay)
call TriggerExecute(UmbrellaFacility_T)
endfunction
private function Camera_Actions takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_ConvoyCam1,true,0)
endfunction
private function Camera2_Actions takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_ConvoyCam2,true,0)
endfunction
private function Camera3_Actions takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_ConvoyCam3,true,0)
endfunction
private function Camera4_Actions takes nothing returns nothing
call CameraSetupApplyForceDuration(gg_cam_ConvoyCam4,true,0)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call DisableTrigger(T2)
call TriggerRegisterTimerEventSingle(T2,0.)
call TriggerRegisterTimerEventPeriodic(T2,.05)
call TriggerAddAction(T2,function Camera_Actions)
set T3 = CreateTrigger()
call DisableTrigger(T3)
call TriggerRegisterTimerEventPeriodic(T3,.05)
call TriggerAddAction(T3,function Camera2_Actions)
set T4 = CreateTrigger()
call DisableTrigger(T4)
call TriggerRegisterTimerEventPeriodic(T4,.05)
call TriggerAddAction(T4,function Camera3_Actions)
set T5 = CreateTrigger()
call DisableTrigger(T5)
call TriggerRegisterTimerEventPeriodic(T5,.05)
call TriggerAddAction(T5,function Camera4_Actions)
set SNIPERSPOT[1]=gg_rct_Sniper01
set SNIPERSPOT[2]=gg_rct_Sniper02
set SNIPERSPOT[3]=gg_rct_Sniper03
set SNIPERSPOT[4]=gg_rct_Sniper04
set SNIPERSPOT[5]=gg_rct_Sniper05
set SNIPERSPOT_COUNT=5
set GUARDSPOT[1]=gg_rct_SalvGuard01
set GUARDSPOT[2]=gg_rct_SalvGuard02
set GUARDSPOT[3]=gg_rct_SalvGuard03
set GUARDSPOT[4]=gg_rct_SalvGuard04
set GUARDSPOT[5]=gg_rct_SalvGuard05
set GUARDSPOT[6]=gg_rct_SalvGuard06
endfunction
endlibrary
//TESH.scrollpos=440
//TESH.alwaysfold=0
library UmbrellaFacility initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T_EvacEmp
public trigger T_RestEmp
rect array UmbEmpSpawn
rect array UmbGuardSpawn
group UmbEmps
group UmbEscorted
string array MarineArrestChat
string array EmpArrestChat
rect array SiloRec
unit array Silo
boolean array SiloLaunched
boolean array SiloBlown
integer SilosBlown=0
integer SilosLaunched=0
item array Satchel
group Silos
integer array SiloCountdown
integer array SiloCountdownFirst
texttag array SiloText
integer SiloAmnt=5
endglobals
private function BlowSilo takes integer i returns nothing
local unit u
call PolledWait2(8)
call StartSound(gg_snd_AirstrikeDist)
call KillUnit(Silo[i])
set u=CreateUnit(Player(14),'h01U',GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),0)
call UnitDamagePoint(u,0,300,GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),900,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call PolledWait2(4)
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call AwardObjectiveXP(40, "Silo destroyed")
call RemoveUnit(u)
set u=null
endfunction
private function BlowGate takes nothing returns nothing
local unit u
call PolledWait2(8)
call StartSound(gg_snd_AirstrikeDist)
call KillDestructable( gg_dest_YTcx_7041 )
set u=CreateUnit(Player(14),'h01U',GetRectCenterX(gg_rct_UmbrellaGate2),GetRectCenterY(gg_rct_UmbrellaGate2),0)
call UnitDamagePoint(u,0,300,GetRectCenterX(gg_rct_UmbrellaGate2),GetRectCenterY(gg_rct_UmbrellaGate2),900,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call PolledWait2(4)
call RemoveUnit(u)
set u=null
endfunction
private function LaunchNuke takes integer i returns nothing
call StopSound(gg_snd_NuclearLaunch,false,false)
call StartSound(gg_snd_NuclearLaunch)
call PingMinimapEx(GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),5,255,0,0,false)
call DestroyEffect(AddSpecialEffect("war3mapImported\\NuclearLaunch.mdl",GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i])))
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
call PolledWait2(GetRandomReal(2,4))
call Transmission(4.,"|cff808000Marine:|r Lima-six we have a nuclear launch! I repeat, we have a nuclear launch!")
call PolledWait2(GetRandomReal(2,4))
call AwardObjectiveXP(-15, "Nuclear launch not prevented")
endfunction
private function UpdateSilos takes nothing returns nothing
local integer i=1
local integer ratio
loop
exitwhen i>SiloAmnt
if not SiloLaunched[i] and not SiloBlown[i] then
set SiloCountdown[i]=SiloCountdown[i]-1
set ratio=SiloCountdown[i]/SiloCountdownFirst[i]
call SetTextTagText(SiloText[i],I2S(SiloCountdown[i]),TextTagSize2Height(15))
call SetTextTagColorBJ(SiloText[i],100-ratio*100,100*(ratio),5,15)
endif
// If the countdown is at 30, 15 or 5 seconds, play a warning
if SiloCountdown[i]==30 or SiloCountdown[i]==15 or SiloCountdown[i]==5 then
if SiloCountdown[i]==30 then
call StartSound(gg_snd_Warning)
else
call StartSound(gg_snd_UI_KlaxonAlert)
endif
call PingMinimapEx(GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),5,255,9,9,false)
call Transmission(4,"|cffFF8000Warning:|r " + I2S(SiloCountdown[i]) + " seconds remaining at silo " + I2S(i) + ".")
endif
// If the countdown is finished, launch the nuke
if SiloCountdown[i]==0 and SiloLaunched[i]==false and SiloBlown[i]==false then
set SiloLaunched[i]=true
call DestroyTextTag(SiloText[i])
set SilosLaunched=SilosLaunched+1
call LaunchNuke.execute(i)
endif
set i=i+1
endloop
endfunction
private function UpdateSatchels takes nothing returns nothing
local integer i=1
local integer ind
loop
exitwhen i>6
if not IsItemOwned(Satchel[i]) and Satchel[i]!=null then
// check if the satchel is at a silo
set ind=1
loop
exitwhen ind>SiloAmnt
if RectContainsItem(Satchel[i],SiloRec[ind]) and not SiloLaunched[ind] and not SiloBlown[ind] then
exitwhen true
endif
set ind=ind+1
endloop
// If satchel is at a silo, blow that silo up
if ind<=SiloAmnt then
call Transmission(4,"|cff808000Marine:|r Satchel charge has been set. Let's get out of here.")
call PingMinimapEx(GetRectCenterX(SiloRec[ind]),GetRectCenterY(SiloRec[ind]),5,255,28,28,true)
call RemoveItem(Satchel[i])
set Satchel[i]=null
set SiloBlown[ind]=true
call DestroyTextTag(SiloText[ind])
set SilosBlown=SilosBlown+1
call BlowSilo.execute(ind)
else
// if it isn't at a silo, ping the satchel
call PingMinimapEx(GetItemX(Satchel[i]),GetItemY(Satchel[i]),1,255,28,28,false)
endif
// If the satchel is at the north gate, blow it up
if RectContainsItem(Satchel[i],gg_rct_UmbrellaGate2) then
call Transmission(4,"|cff808000Marine:|r Satchel charge has been set at the north gate. Stand back.")
call PingMinimapEx(GetRectCenterX(gg_rct_UmbrellaGate2),GetRectCenterY(gg_rct_UmbrellaGate2),5,255,28,28,true)
call RemoveItem(Satchel[i])
set Satchel[i]=null
call BlowGate.execute()
endif
endif
set i=i+1
endloop
endfunction
private function SiloMission takes nothing returns nothing
local integer i=1
local integer bc=1
local timer t=CreateTimer()
local timer tsi=CreateTimer()
set SiloRec[1]=gg_rct_Outpost1
set SiloRec[2]=gg_rct_Outpost2
set SiloRec[3]=gg_rct_Outpost3
set SiloRec[4]=gg_rct_Silo1
set SiloRec[5]=gg_rct_Silo2
set Silos=CreateGroup()
call Transmission(4,"|cffFF0000Intercom:|r |cffFF8000LAUNCH SEQUENCE INITIATED.|r")
call StartSound(gg_snd_UI_KlaxonAlert)
call PolledWait2(4)
call Transmission(4,"|cff808000Marine:|r Lima-six this is two-six. We have a situation here.")
call PolledWait2(4.5)
call Transmission(7,"|cff808000Lima-Six:|r Roger that, HQ is already aware of it. Exit the facility immediately and wait for further information.")
call PolledWait2(15)
if GetRandomInt(1,2)==1 then
call Transmission(4,"|cff808000Marine:|r Anybody else get the feeling we're about to be completely screwed?")
endif
call PolledWait2(20)
call Transmission(12,"|cff808000Lima-Six:|r Apparently Umbrella has missile silos located in your sector. One of the employees must have initiated a launch sequence for all of them when you entered the facility.")
call PolledWait2(10)
call Transmission(7,"|cff808000Lima-Six:|r Those silos each contain 10 megaton nuclear warheads, and they're about to launch in a matter of minutes.")
call PolledWait2(7)
call Transmission(12,"|cff808000Lima-Six:|r You may be able to stop the launch by simply blowing up the silos from the inside. Take satchel charges from the convoy and place them at each silo before they launch. Good luck.")
call StartSound(gg_snd_War3XMainScreen)
if PLAYING_PLAYERS<= 2 then
set SiloAmnt=SiloAmnt-1
endif
loop
exitwhen i>6
set Satchel[i]=CreateItem('I007',GetRectCenterX(Road[54])-250,GetRectCenterY(Road[54]))
set i=i+1
endloop
call CreateItem('I00R',GetRectCenterX(Road[54])-250,GetRectCenterY(Road[54]))
call PingMinimapEx(GetRectCenterX(Road[54]),GetRectCenterY(Road[54])-200,8.,28,28,255,true)
set i=1
loop
exitwhen i>SiloAmnt
if bc<3 and GetRandomInt(1,2)==1 then
set SiloCountdown[i]=GetRandomInt(220,280)
set bc=bc+1
else
set SiloCountdown[i]=GetRandomInt(140,220)
endif
set SiloCountdownFirst[i]=SiloCountdown[i]
set SiloText[i]=CreateTextTag()
call SetTextTagText(SiloText[i],I2S(SiloCountdown[i]),0)
call SetTextTagPos(SiloText[i],GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),TextTagSize2Height(15))
call SetTextTagColorBJ(SiloText[i],0,100,5,15)
set SiloLaunched[i]=false
set SiloBlown[i]=false
set Silo[i]=CreateUnit(Player(11),'h01Z',GetRectCenterX(SiloRec[i]),GetRectCenterY(SiloRec[i]),300)
call VisionUnit(Silo[i],true)
call GroupAddUnit(Silos,Silo[i])
set i=i+1
endloop
call TimerStart(t,1.8,true,function UpdateSatchels)
call TimerStart(tsi,1,true,function UpdateSilos)
call PolledWait2(8)
call Transmission(4,"|cff808000Marine:|r We'll need an extra satchel to blow open the north gate.")
call PolledWait2(5)
call StartSound(gg_snd_ReviveUndead)
call SpawnInfectedOfType(ZID_Arachnathid, 2, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Metasis, 1, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Necaroth, 1, BORDER_ZONES[GetRandomInt(1,4)])
call PolledWait2(3.7)
call Transmission(4,"|cff808000Marine:|r There's something out there.")
call PolledWait2(4)
call Transmission(4,"|cff808000Marine:|r Just keep moving and stay alert.")
loop
exitwhen IsUnitGroupDeadBJ(Silos) or DEFEATED or SilosBlown+SilosLaunched==SiloAmnt
call PolledWait2(2)
endloop
call PolledWait2(7)
call PauseTimer(t)
call DestroyTimer(t)
set t=null
call PauseTimer(tsi)
call DestroyTimer(tsi)
set tsi=null
if DEFEATED then
return
endif
// Stop Spawns
call TimerStart(Spawn_Delay,10,false,null)
call PauseTimer(Spawn_Delay)
call PauseAllUnitsBJ(true)
if GAME_MODE==UA2_ModeInsane and OBJECTIVES_FAILED==0 and AVERAGE_XP_NO_HIGH_RANKS>=55001 then
call AwardObjectiveXP(800, "Perfect insane mode completed")
endif
call AddDiffComp(GAME_MODE)
call StartSound(gg_snd_HumanVictory)
call BJDebugMsg("Thank you for playing Undead Assault II! Please report all bugs/suggestions/comments to |cff00FF00undeadassault.net|r.")
call BJDebugMsg("You can type -save to save your experience.")
endfunction
private function RestEmp_Cond takes nothing returns boolean
local unit u=GetOrderTargetUnit()
local unit o=GetOrderedUnit()
local boolean b=GetUnitTypeId(u)==NID_Employee and not IsUnitInGroup(u,UmbEscorted) and GetIssuedOrderId()==OrderId("smart") and IsUnitType(o,UNIT_TYPE_HERO)
set u=null
set o=null
return b
endfunction
private function RestEmp takes nothing returns nothing
local unit t=GetOrderTargetUnit()
local unit o=GetOrderedUnit()
local integer r=GetRandomInt(1,6)
if DistanceBetweenPointsXY(GetUnitX(t),GetUnitY(t),GetUnitX(o),GetUnitY(o))<=300 then
call GroupAddUnit(UmbEscorted,t)
call FieldChat(o,3,"|cff808000Marine:|r "+MarineArrestChat[r])
call SetUnitFacingTimed(t,AngleBetweenPointsXY(GetUnitX(t),GetUnitY(t),GetUnitX(o),GetUnitY(o)),.3)
call PolledWait2(1.5)
call FieldChat(t,3,"|cff808000Employee:|r "+EmpArrestChat[r])
call SetUnitOwner(t,GetOwningPlayer(o),true)
call SelectUnitAddForPlayer(t,GetOwningPlayer(o))
call IssuePointOrder(t,"move",GetUnitX(o),GetUnitY(o))
else
call DisplayTimedTextToPlayer(GetOwningPlayer(o),0,0,2,"Must get closer.")
endif
set t=null
set o=null
endfunction
private function EvacEmp_Cond takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=GetUnitTypeId(u)==NID_Employee
set u=null
return b
endfunction
private function EvacEmp takes nothing returns nothing
local unit u=GetEnteringUnit()
call GroupRemoveUnit(UmbEmps,u)
call GroupRemoveUnit(UmbEscorted,u)
call RemoveUnit(u)
call AwardObjectiveXP(10, "Employee evacuated")
set u=null
endfunction
private function Actions takes nothing returns nothing
local unit u
local item satchel
local unit heli
local integer i=1
set MarineArrestChat[1]="Hands up!"
set MarineArrestChat[2]="Hands where I can see them!"
set MarineArrestChat[3]="You're under arrest!"
set MarineArrestChat[4]="Don't move!"
set MarineArrestChat[5]="You're coming with me!"
set MarineArrestChat[6]="You're under arrest!"
set EmpArrestChat[1]="Don't shoot!"
set EmpArrestChat[2]="Okay, okay!"
set EmpArrestChat[3]="What did I do?"
set EmpArrestChat[4]="Who are you?"
set EmpArrestChat[5]="But I've got work to do!"
set EmpArrestChat[6]="Why am I being detained?"
set UmbEmpSpawn[1]=gg_rct_UmbEmp01
set UmbEmpSpawn[2]=gg_rct_UmbEmp02
set UmbEmpSpawn[3]=gg_rct_UmbEmp03
set UmbEmpSpawn[4]=gg_rct_UmbEmp04
set UmbEmpSpawn[5]=gg_rct_UmbEmp05
set UmbEmpSpawn[6]=gg_rct_UmbEmp06
set UmbEmpSpawn[7]=gg_rct_UmbEmp07
set UmbEmpSpawn[8]=gg_rct_UmbEmp08
set UmbEmpSpawn[9]=gg_rct_UmbEmp09
set UmbEmpSpawn[10]=gg_rct_UmbEmp10
set UmbEmpSpawn[11]=gg_rct_UmbEmp11
set UmbEmpSpawn[12]=gg_rct_UmbEmp12
set UmbEmpSpawn[13]=gg_rct_UmbEmp13
set UmbEmps=CreateGroup()
set UmbEscorted=CreateGroup()
set UmbGuardSpawn[1]=gg_rct_UmbGuard01
set UmbGuardSpawn[2]=gg_rct_UmbGuard02
set UmbGuardSpawn[3]=gg_rct_UmbGuard03
set UmbGuardSpawn[4]=gg_rct_UmbGuard04
set UmbGuardSpawn[5]=gg_rct_UmbGuard05
set UmbGuardSpawn[6]=gg_rct_UmbGuard06
set UmbGuardSpawn[7]=gg_rct_UmbGuard07
set UmbGuardSpawn[8]=gg_rct_UmbGuard08
set UmbGuardSpawn[9]=gg_rct_UmbGuard09
// Ally USMC and umbrella, so USMC doesnt help the players inside
call SetPlayerAllianceStateBJ(Player(11),Player(14),2)
call SetPlayerAllianceStateBJ(Player(14),Player(11),2)
// Unally USMC and umbrella
call SetPlayerAllianceStateBJ(Player(11),Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),Player(11),0)
call PolledWait2(3)
call Transmission(8,"|cff808000Lima-Six:|r Our next objective is to enter the Umbrella facility and arrest any employees present. Place the satchel charge at the gate to force entrance.")
call QuestSetDescription(OBJECTIVE_QUEST, "Place the |cff1C1CFFsatchel|r at the entrance.")
set satchel=CreateItem('I007',GetRectCenterX(Road[54]),GetRectCenterY(Road[54])-200)
call PingMinimapEx(GetRectCenterX(Road[54]),GetRectCenterY(Road[54])-200,8.,28,28,255,true)
loop
exitwhen RectContainsItem(satchel,gg_rct_UmbrellaGate1) or DEFEATED
call PolledWait2(1)
endloop
if DEFEATED then
return
endif
call RemoveItem(satchel)
call Transmission(4.,"|cff808000Marine:|r Stand back. Detonation in 8 seconds.")
call QuestSetDescription(OBJECTIVE_QUEST, "Arrest any employees within the Umbrella facility in "+R2S(300*MissionTimeModifier)+" seconds.")
call PolledWait2(8)
call StartSound(gg_snd_AirstrikeDist)
call KillDestructable( gg_dest_YTcx_0298 )
call KillDestructable( gg_dest_YTcx_0299 )
set u= CreateUnit(Player(14),'h01U',GetRectCenterX(gg_rct_UmbrellaGate1),GetRectCenterY(gg_rct_UmbrellaGate1),0)
call UnitDamagePoint(u,0,300,GetRectCenterX(gg_rct_UmbrellaGate1),GetRectCenterY(gg_rct_UmbrellaGate1),900,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call PolledWait2(4)
call RemoveUnit(u)
set heli=LandHeli(GetRectCenterX(gg_rct_LZSalv),GetRectCenterY(gg_rct_LZSalv))
call SetUnitInvulnerable(heli,true)
call SetUnitOwner(heli,Player(14),true)
call VisionUnit(heli,true)
call Transmission(4.,"|cff808000Marine:|r Let's move in. Arrest any employees and bring them to the |cff1C1CFFLZ|r. Exercise caution, expect resistance.")
call PingMinimapEx(GetRectCenterX(gg_rct_LZSalv),GetRectCenterY(gg_rct_LZSalv),8.,28,28,255,true)
call TriggerRegisterEnterRectSimple(T_EvacEmp,gg_rct_LZSalv)
call EnableTrigger(T_RestEmp)
// ==Spawn the umb units==
// sentry guns
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun01),GetRectCenterY(gg_rct_Sentry_Gun01),90)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun02),GetRectCenterY(gg_rct_Sentry_Gun02),90)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun07),GetRectCenterY(gg_rct_Sentry_Gun07),90)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun03),GetRectCenterY(gg_rct_Sentry_Gun03),180)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun04),GetRectCenterY(gg_rct_Sentry_Gun04),180)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun05),GetRectCenterY(gg_rct_Sentry_Gun05),180)
call CreateUnit(Player(11),'h006',GetRectCenterX(gg_rct_Sentry_Gun06),GetRectCenterY(gg_rct_Sentry_Gun06),180)
// employees
loop
exitwhen i>13
set u=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),NID_Employee,GetRectRandX(UmbEmpSpawn[i]),GetRectRandY(UmbEmpSpawn[i]),GetRandomDirectionDeg())
call GroupAddUnit(UmbEmps,u)
set i=i+1
endloop
// Guards
set i=1
loop
exitwhen i>9
set u=CreateUnit(Player(11),NID_Rifleman,GetRectRandX(UmbEmpSpawn[i]),GetRectRandY(UmbEmpSpawn[i]),GetRandomDirectionDeg())
set i=i+1
endloop
call PolledWait2(3)
call Transmission(4.,"|cff808000Note:|r To arrest and escort an employee, right click them.")
set MissionTime=300*MissionTimeModifier
loop
exitwhen MissionTime==0 or DEFEATED or IsUnitGroupDeadBJ(UmbEmps) or IsUnitGroupEmptyBJ(UmbEmps)
if MissionTime==40 then
// Resume spawns
call ResumeTimer(Spawn_Delay)
endif
call PolledWait2(1)
endloop
// Resume spawns
if TimerGetRemaining(Spawn_Delay) > 0 then
call ResumeTimer(Spawn_Delay)
endif
if DEFEATED then
return
endif
call PolledWait2(2)
call Reinforcements(GetUnitX(heli), GetUnitY(heli))
call PolledWait2(2)
call TakeoffHeli(heli)
set u=null
set heli=null
set satchel=null
call PolledWait2(3)
// Silo mission
call SiloMission.execute()
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set T_EvacEmp = CreateTrigger()
call TriggerAddCondition(T_EvacEmp,Condition(function EvacEmp_Cond))
call TriggerAddAction(T_EvacEmp,function EvacEmp)
set T_RestEmp = CreateTrigger()
call DisableTrigger(T_RestEmp)
call TriggerAddCondition(T_RestEmp,Condition(function RestEmp_Cond))
call TriggerRegisterAnyUnitEventBJ(T_RestEmp, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddAction(T_RestEmp,function RestEmp)
endfunction
endlibrary
//TESH.scrollpos=49
//TESH.alwaysfold=0
library AssaultTroopers initializer Init requires GlobalFuncs
globals
public trigger T
public trigger TEvac
integer TroopersEvacuated=0
public group GAT=CreateGroup()
endglobals
function CleanUpGroup takes group g returns nothing
local group g2=CreateGroup()
local unit u
call GroupAddGroup(g, g2)
loop
set u=FirstOfGroup(g2)
exitwhen u==null
if IsUnitDeadBJ(u) then
call GroupRemoveUnit(g, u)
endif
call GroupRemoveUnit(g2, u)
endloop
call DestroyGroup(g2)
set g2=null
set u=null
endfunction
private function EnterHeli takes nothing returns nothing
local unit u=GetEnteringUnit()
local integer i=GetUnitTypeId(u)
if IsUnitInGroup(u,GAT) then
call RemoveUnit(u)
call GroupRemoveUnit(GAT,u)
set TroopersEvacuated=TroopersEvacuated+1
call AwardObjectiveXP(4, "Trooper evacuated")
endif
set u=null
endfunction
private function Actions takes nothing returns nothing
local integer rd=GetRandomInt(1, RoadCount)
local integer index=1
local real x
local real y
local unit u
local boolean exit=false
local integer rdexit=GetRandomInt(64,70)
call Transmission(10.,"|cff808000Lima-Six:|r A stick of assault troopers missed their DZ and are landing in your sector. Rendezvous with them and escort them out of your sector.")
call PolledWait2(10.)
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"Rendezvou with the assault troopers and lead them out of your sector.")
// Spawn
loop
exitwhen index>12
set x=GetRandomReal(-6800, 4800)
set y=GetRandomReal(-11000, 7500)
call DestroyEffect(AddSpecialEffect("Units\\Demon\\Infernal\\InfernalBirth.mdl", x, y))
call PolledWait2(.8)
if GetRandomInt(1,5)==1 then
set u=CreateUnit(P_USMC, 'h019', x, y, 270)
elseif GetRandomInt(1,5)==1 then
set u=CreateUnit(P_USMC, 'h00V', x, y, 270)
elseif GetRandomInt(1,5)==1 then
set u=CreateUnit(P_USMC, 'h00E', x, y, 270)
else
set u=CreateUnit(P_USMC, 'h009', x, y, 270)
endif
call GroupAddUnit(RifleButters, u)
call RemoveGuardPosition(u)
call PingMinimapEx(x,y,5,128,255,128,false)
call GroupAddUnit(GAT, u)
set index=index+1
endloop
loop
if GetRandomInt(1,3)==1 then
call GroupPointOrder(GAT, "attack", GetRectCenterX(Road[rd]), GetRectCenterY(Road[rd]))
else
call GroupPointOrder(GAT, "move", GetRectCenterX(Road[rd]), GetRectCenterY(Road[rd]))
endif
exitwhen IsUnitGroupInRectBJ(GAT,Road[rd]) or IsUnitGroupEmptyBJ(GAT)
call CleanUpGroup(GAT)
call PolledWait2(2.)
endloop
if IsUnitGroupEmptyBJ(GAT)==false then
call Transmission(10,"|cff808000Assault Trooper:|r Rendezvou with us here.")
call PingMinimapEx(GetRectCenterX(Road[rd]),GetRectCenterY(Road[rd]),5,128,128,255,false)
else
call DestroyGroup(GAT)
set u=null
call AwardObjectiveXP(-5, "Troopers killed")
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"No secondary objective.")
return
endif
loop
exitwhen exit
call PingMinimapEx(GetRectCenterX(Road[rd]),GetRectCenterY(Road[rd]),1,128,128,255,false)
call CleanUpGroup(GAT)
set index=1
loop
exitwhen index>11 or exit
if RectContainsUnit(Road[rd], PLAYER_UNIT[index]) or IsUnitGroupEmptyBJ(GAT) then
set exit=true
endif
set index=index+1
endloop
call PolledWait2(2)
endloop
if IsUnitGroupEmptyBJ(GAT)==false then
call Transmission(10.,"|cff808000Assault Trooper:|r Okay let's go.")
set u=GroupPickRandomUnit(GAT)
call PlaySoundOnUnitBJ(gg_snd_letsgo, 100, u)
call PingMinimapEx(GetRectCenterX(Road[rd]),GetRectCenterY(Road[rd]),5,128,128,255,false)
else
call AwardObjectiveXP(-8, "Troopers killed")
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"No secondary objective.")
return
endif
call PingMinimapEx(GetRectCenterX(Road[rdexit]), GetRectCenterY(Road[rdexit]), 12, 0, 255, 0, false)
call PolledWait2(5)
call TriggerRegisterEnterRectSimple(TEvac,Road[rdexit])
loop
if GetRandomInt(1,2)==1 then
call GroupPointOrder(GAT, "attack", GetRectCenterX(Road[rdexit]), GetRectCenterY(Road[rdexit]))
else
call GroupPointOrder(GAT, "move", GetRectCenterX(Road[rdexit]), GetRectCenterY(Road[rdexit]))
endif
call CleanUpGroup(GAT)
exitwhen IsUnitGroupEmptyBJ(GAT)
call PolledWait2(2)
endloop
if TroopersEvacuated==0 then
call AwardObjectiveXP(-8, "Troopers killed")
endif
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"No secondary objective.")
call DestroyGroup(GAT)
set GAT=null
set u=null
endfunction
private function Conditions takes nothing returns boolean
return DEFEATED==false
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T, GetRandomInt(420, 1650), false)
//call TriggerRegisterPlayerChatEvent(T, Player(0), "-assault", true)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
set TEvac=CreateTrigger()
call TriggerAddAction(TEvac,function EnterHeli)
endfunction
endlibrary
//TESH.scrollpos=60
//TESH.alwaysfold=0
library Darkness initializer Init requires GlobalFuncs
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer comp=GetRandomInt(1, ComputerCount)
local integer i=GetRandomInt(1,LZCount)
local integer count=0
local boolean exit=false
local boolean expired=false
local item papers
local real x=GetRandomReal(GetRectMinX(LZ[i]), GetRectMaxX(LZ[i]))
local real y=GetRandomReal(GetRectMinY(LZ[i]), GetRectMaxY(LZ[i]))
call SetDayNightModels("war3mapImported\\DNCTerrain.mdx","war3mapImported\\DNCUnit.mdx")
call StartSound(gg_snd_DarknessFalls)
call PolledWait2(6.)
call Transmission(6.,"|cff808000Marine:|r What the hell, I can't see anything!")
call PolledWait2(6.)
call Transmission(6.,"|cff808000Marine:|r Turn off your NVGs.")
call PolledWait2(6.)
call Transmission(8.,"|cff808000Marine:|r Battallion we have a black fog in our sector. What's your assessment?")
call PolledWait2(8.)
call Transmission(8.,"|cff808000Lima-Six:|r We've had similar SITREPs in other sectors. Standby.")
call PolledWait2(30.)
call StartSound(gg_snd_DarknessMusic)
call Transmission(12.,"|cff808000Lima-Six:|r Apparently it's some sort of dark infestation swarm moving around. The outposts in your sector can clear it, but you have to input a password and a special security card to gain access.")
call PolledWait2(10.)
call Transmission(12.,"|cff808000Lima-Six:|r We'll drop a security pass in an LZ. Get the |cffFFFF00Security Pass|r and bring it to the |cff00FF00outpost computer|r.")
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"Get the |cffFFFF00Security Pass|r and bring it to the |cff00FF00outpost computer|r..")
if GAME_MODE > 1 then
call PolledWait2(7.)
call Transmission(8.,"|cff808000Lima-Six:|r Recon units have spotted an Arachnathid entering your sector. Exercise extreme caution.")
call SpawnInfectedOfType('u00D', 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
set papers=CreateItem('I00B', x, y)
loop
exitwhen exit or expired
call PingMinimapEx(GetRectCenterX(Computer[comp]), GetRectCenterY(Computer[comp]), 1.5, 0, 255, 0, false)
if IsItemOwned(papers)==false then
call PingMinimapEx(GetItemX(papers), GetItemY(papers), 1.5, 255, 255, 0, false)
endif
set i=1
loop
exitwhen i>11
if RectContainsUnit(Computer[comp], PLAYER_UNIT[i]) and UnitHasItem(PLAYER_UNIT[i], papers) and GetUnitTypeId(PLAYER_UNIT[i])!='h00K' then
call RemoveItem(papers)
set exit=true
exitwhen true
endif
set i=i+1
endloop
set count=count+1
if count >= 400 then
call RemoveItem(papers)
set expired=true
endif
call PolledWait2(1.5)
endloop
if exit then //success
call PolledWait2(5.)
call Transmission(8.,"|cff808000Marine:|r Cleanup process initiated. Just a little longer and we can see again.")
call PolledWait2(40*MissionTimeModifier)
call Transmission(8.,"|cff808000Marine:|r It's looking better.")
call PolledWait2(5.)
set OBJECTIVES_SUCCEEDED=OBJECTIVES_SUCCEEDED+1
call AwardObjectiveXP(48, "Environment restored")
else
call Transmission(8.,"|cff808000Lima-Six:|r The swarm looks like it's moving to another area.")
set OBJECTIVES_FAILED=OBJECTIVES_FAILED+1
endif
call SetDayNightModels("Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl","Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl")
//call SetDayNightModels("war3mapImported\\DNCNormalTerrain.mdx","war3mapImported\\DNCNormalUnit.mdx")
call QuestSetDescription(OBJECTIVE_SECONDARY_QUEST,"No secondary objective.")
set papers=null
endfunction
private function Conditions takes nothing returns boolean
return DEFEATED==false
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T, GetRandomInt(420, 1450), false)
//call TriggerRegisterPlayerChatEvent(T, Player(0), "-dark", true)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library PlayerDies initializer Init requires GlobalFuncs
//TRIG: wO, Cond: bl, Func: jl
private function Conditions takes nothing returns boolean
local unit u=GetDyingUnit()
local boolean b=(u==PLAYER_UNIT[GetPlayerId(GetOwningPlayer(u))+1])
set u=null
return b
endfunction
private function SetAlliedPerks takes nothing returns nothing
local unit u=GetDyingUnit()
if (IsPlayerAlly(GetOwningPlayer(u),GetEnumPlayer())) then
if (GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING) then
call SetPlayerAllianceStateBJ(GetEnumPlayer(),GetOwningPlayer(u),3)
elseif(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_LEFT)then
call SetPlayerAllianceStateBJ(GetEnumPlayer(),GetOwningPlayer(u),4)
endif
endif
set u=null
endfunction
private function Actions takes nothing returns nothing
local unit u=GetDyingUnit()
local force f=GetPlayersByMapControl(MAP_CONTROL_USER)
call PlaySoundForPlayer(GetOwningPlayer(u),SOUND_DIEBUZZ_C)
call AttachSoundToUnit(SOUND_DIEBUZZ_C,u)
call StartSound(SOUND_DIEBUZZ_C)
call GroupRemoveUnit(RifleButters,u)
call GroupRemoveUnit(SPRINTING_UNITS,u)
if (GAME_MODE!=UA2_ModeCompetitive) then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,GetPlayerName(GetOwningPlayer(u))+" has been killed in action.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
endif
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0.,0.,15.,"You have died. You can watch your team and wait for reinforcements or until a Corpsman revives you.")
call ForForce(f,function SetAlliedPerks)
//if(Hl())then
// call UnitRemoveAbility(u,'A04H')
// call UnitRemoveAbility(u,'A04I')
// call UnitRemoveAbility(u,'A034')
// call UnitRemoveAbility(u,'A042')
// call ForceRemovePlayer(xe,GetOwningPlayer(GetTriggerUnit()))
// call ForceRemovePlayer(Ix,GetOwningPlayer(GetTriggerUnit()))
// call ForceAddPlayer(Ax,GetOwningPlayer(GetTriggerUnit()))
// call PolledWait2(14.5)
// call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function hl)
//endif
set u=null
set f=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//function Fl takes nothing returns boolean
//return(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_LEFT)
//endfunction
//function gl takes nothing returns boolean
//return(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING)
//endfunction
//function Gl takes nothing returns boolean
//return(IsPlayerAlly(GetOwningPlayer(GetDyingUnit()),GetEnumPlayer()))
//endfunction
//function hl takes nothing returns nothing
//if(Gl())then
//if(gl())then
//call SetPlayerAllianceStateBJ(GetEnumPlayer(),GetOwningPlayer(GetDyingUnit()),2)
//else
//if(Fl())then
//call SetPlayerAllianceStateBJ(GetEnumPlayer(),GetOwningPlayer(GetDyingUnit()),4)
//endif
//endif
//endif
//endfunction
//function Hl takes nothing returns boolean
//return(GAME_MODE==UA2_ModeCompetitive)
//endfunction
//TESH.scrollpos=51
//TESH.alwaysfold=0
library PlayerRezActions initializer Init requires GlobalFuncs
//TRIG: WO, Cond: Jl, Func: Kl
globals
private player dyingPlayer
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetDyingUnit()
local boolean b = (u==PLAYER_UNIT[GetPlayerId(GetOwningPlayer(u))+1]) and (GetUnitTypeId(u)!='h00K') //and (GAME_MODE!=UA2_ModeCompetitive)
set u = null
return b
endfunction
private function SetAlliedPerks takes nothing returns nothing
local player p = dyingPlayer
if IsPlayerAlly((p),GetEnumPlayer()) then
if(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING)then
call SetPlayerAllianceStateBJ(GetEnumPlayer(),p,2)
elseif GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_LEFT then
call SetPlayerAllianceStateBJ(GetEnumPlayer(),p,4)
endif
endif
endfunction
private function Actions takes nothing returns nothing
local unit u=GetDyingUnit()
local unit u2
local unit u3
local player p=GetOwningPlayer(u)
local location l=GetUnitLoc(u)
local effect e
local texttag ll
call PolledWait2(1.16)
set u2=CreateCorpse(p,'h016',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitSuspendDecay(u2,true)
call SetUnitAnimation(u2,"decay corpse")
call SetUnitBlendTime(u2,.0)
call SetUnitTimeScalePercent(u2,.0)
call GroupAddUnit(bj_suspendDecayFleshGroup,u2)
call TimerStart(bj_delayedSuspendDecayTimer,.05,false,null)
set u3=CreateUnit(p,'h00S',GetLocationX(l),GetLocationY(l),.0)
set e=AddSpecialEffectLoc("Abilities\\Spells\\Human\\Brilliance\\Brilliance.mdl",l)
if GetUnitTypeId(u)=='H00C' then
set ll=CreateTextTagLocBJ("+",l,0,10.,100,25.,25.,25.)
call ShowTextTagForceBJ(true,ll,bj_FORCE_ALL_PLAYERS)
endif
loop
exitwhen IsUnitAliveBJ(u2) or IsUnitAliveBJ(u)
call PolledWait2(GetRandomReal(.7,1.))
endloop
call RemoveUnit(u2)
call RemoveUnit(u3)
if GetUnitTypeId(u)=='H00C' then
call SetTextTagVelocity(ll,0,.03)
call SetTextTagFadepoint(ll,2)
call SetTextTagLifespan(ll,3)
call SetTextTagPermanent(ll,false)
endif
call DestroyEffect(e)
if IsUnitDeadBJ(u)then
set Player_Camlocked[GetPlayerId(p)]=false
call ResetToGameCameraForPlayer(p, 0)
call PanCameraToTimedForPlayer(p,GetUnitX(u),GetUnitY(u),2)
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,Player_ViewDist[GetPlayerId(p)]*100.,0)
call ReviveHeroLoc(u,l,false)
set dyingPlayer=p
set u=null
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function SetAlliedPerks)
endif
set u=null
set u2=null
set u3=null
set ll=null
call RemoveLocation(l)
set l=null
set e=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library PlayerLeaves initializer Init requires GlobalFuncs
//TRIG: MO, Cond: wT, Func: kK
globals
public trigger T
endglobals
private function GiveControl takes nothing returns nothing
call SetPlayerAllianceStateBJ(GetTriggerPlayer(),GetEnumPlayer(),4)
call SetPlayerAllianceStateBJ(GetEnumPlayer(),GetTriggerPlayer(),4)
endfunction
private function Actions takes nothing returns nothing
call ForForce(GetPlayersAllies(GetTriggerPlayer()),function GiveControl)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(GetColorPlayerName(GetTriggerPlayer())+" has abandoned the mission."))
set PLAYING_PLAYERS=PLAYING_PLAYERS-1
//if (GAME_MODE==UA2_ModeCompetitive) then
// call ForceRemovePlayer(MODE_COMP_FORCE[1],GetTriggerPlayer())
// call ForceRemovePlayer(MODE_COMP_FORCE[2],GetTriggerPlayer())
// call ConditionalTriggerExecute(ResortTeams_T)
//endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library KillCounter initializer Init requires GlobalFuncs
//TRIG: pO, Cond: KK, Func: mK
private function Conditions takes nothing returns boolean
local unit u=GetKillingUnit()
local boolean b=(GetPlayerController(GetOwningPlayer(u))==MAP_CONTROL_USER)
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetKillingUnit()
local player p = GetOwningPlayer(u)
//if (GAME_MODE!=UA2_ModeCompetitive) and IsPlayerEnemy(GetOwningPlayer(GetDyingUnit()),p) then
if IsPlayerEnemy(GetOwningPlayer(GetDyingUnit()),p) then
set PLAYER_KILLS[1+GetPlayerId(p)]=PLAYER_KILLS[1+GetPlayerId(p)]+1
//elseif (GAME_MODE==UA2_ModeCompetitive) and (IsUnitInGroup(GetDyingUnit(),PLAYER_UNITS)) and (IsUnitInGroup(GetKillingUnit(),PLAYER_UNITS)) then
// set PLAYER_KILLS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]=(PLAYER_KILLS[(1+GetPlayerId(GetOwningPlayer(GetKillingUnit())))]+1)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SoldierTakesHit initializer Init requires GlobalFuncs
//TRIG: xR, Func: HL
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local unit damagedUnit=GetTriggerUnit()
local unit damagingUnit=GetEventDamageSource()
local integer i=1
local player p=GetOwningPlayer(damagedUnit)
local integer playerID_GUI=1+GetPlayerId(p)
local integer n=GetUnitTypeId(damagingUnit)
if(damagedUnit==PLAYER_UNIT[playerID_GUI])then
if GetEventDamage()>10 then
set PLAYER_HITS[playerID_GUI]=PLAYER_HITS[playerID_GUI]+1
endif
endif
// If not Cyborg nor Plasma Shield + damage more than 10 + chance defined by difficulty + enemies
if (GetRandomInt(1,INJURY_CHANCE)==1 and IsUnitEnemy(damagingUnit,Player(playerID_GUI-1)) and GetEventDamage()>10) and (GetUnitTypeId(damagedUnit)!='H00P') and (GetUnitTypeId(damagedUnit)!='H00K') and (GetUnitAbilityLevel(damagedUnit,'B018')<=0) then
loop
exitwhen i>7
if GetRandomInt(1,INJURY_INDIVIDUAL_CHANCE[i])==1 then
call PlaySoundAtUnitLoc(SOUND_SUITE_WOUND,damagedUnit)
set damagingUnit=CreateUnit(Player(13),'h003',GetUnitX(damagedUnit),GetUnitY(damagedUnit),.0)
call UnitAddAbility(damagingUnit,INJURY_INDIVIDUAL_ABILITY[i])
call IssueTargetOrderById(damagingUnit,INJURY_INDIVIDUAL_ORDER[i],damagedUnit)
call UnitApplyTimedLife(damagingUnit,'Bhwd',5.)
call CinematicFilterGenericForPlayer(GetOwningPlayer(damagedUnit),2,BLEND_MODE_BLEND,"war3mapImported\\Hit.blp", 100,100,100,0,100,100,100,100)
call CameraSetEQNoiseForPlayer(GetOwningPlayer(damagedUnit),2)
call PolledWait2(1)
if PLAYER_HAS_NVG[playerID_GUI] then
call ShowNightVision(p,true)
else
call ShowNightVision(p,false)
endif
call CameraClearNoiseForPlayer(GetOwningPlayer(damagedUnit))
exitwhen true
endif
set i=i+1
endloop
endif
set damagingUnit=null
set damagedUnit=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library TeamKilling initializer Init requires GlobalFuncs
//TRIG: yO, Cond: ml, Func: Pl
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit k=GetKillingUnit()
local unit d=GetDyingUnit()
local player pk=GetOwningPlayer(k)
local player pd=GetOwningPlayer(d)
local boolean b=GetPlayerController(pk)==MAP_CONTROL_USER and IsPlayerAlly(pk,pd) and (IsUnitType(d,UNIT_TYPE_HERO) or pd==Player(11) or pd==Player(12))
set k=null
set d=null
set pk=null
set pd=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit k=GetKillingUnit()
local unit d=GetDyingUnit()
local player pk=GetOwningPlayer(k)
local player pd=GetOwningPlayer(d)
if pk==pd and PLAYER_UNIT[1+GetPlayerId(pd)]==d then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,GetColorPlayerName(pd)+" has killed themself.")
else
if GetPlayerController(pd)==MAP_CONTROL_USER and PLAYER_UNIT[1+GetPlayerId(pd)]==pd then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,GetColorPlayerName(pk)+" has killed "+GetColorPlayerName(pd))
elseif GetUnitTypeId(d)!='n01B' and GetUnitTypeId(d)!='o004' then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,GetColorPlayerName(pk)+" has killed "+GetUnitName(d))
endif
endif
set k=null
set d=null
set pk=null
set pd=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SetAverageXP initializer Init requires GlobalFuncs
//TRIG: fO, Func: WJ
private function Actions takes nothing returns nothing
local integer averageXP=0
local integer i=1
local integer averageXP_noHighRanked=0
local integer highRankedPlayers=0
loop
exitwhen i>11
if(GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING)then
set averageXP=averageXP+PLAYER_XP[i]
endif
set i=i+1
endloop
set averageXP = averageXP/PLAYING_PLAYERS
set i=1
loop
exitwhen i>11
if(GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING)then
if PLAYER_XP[i]>R2I(averageXP*1.5)then
set highRankedPlayers=highRankedPlayers+1
else
set averageXP_noHighRanked=averageXP_noHighRanked+PLAYER_XP[i]
endif
endif
set i=i+1
endloop
set averageXP_noHighRanked=averageXP_noHighRanked/(PLAYING_PLAYERS-highRankedPlayers)
set AVERAGE_XP_NO_HIGH_RANKS=averageXP_noHighRanked
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,20.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GrantKillsXP initializer Init requires GlobalFuncs
//TRIG: dO, Cond: SJ, Func: TJ
private function Conditions takes nothing returns boolean
local unit k=GetKillingUnit()
local unit d=GetDyingUnit()
local boolean b=GetPlayerController(GetOwningPlayer(k))==MAP_CONTROL_USER and IsPlayerEnemy(GetOwningPlayer(d),GetOwningPlayer(k))
set k=null
set d=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u = GetKillingUnit()
local integer i = GetPlayerId(GetOwningPlayer(u))+1
if (KILL_XP_COUNTER[i]==UA2_KillsPerXP) then
call AddPlayerXP(GetOwningPlayer(u),1)
set KILL_XP_COUNTER[i]=0
else
set KILL_XP_COUNTER[i]=KILL_XP_COUNTER[i]+1
endif
set u = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SAVELOAD initializer Init requires GlobalFuncs
globals
public trigger saveTrig=null
public trigger loadTrig=null
endglobals
// Checks if XP is either below 100, or between vals[2]*100 and (vals[2]+1)*100
// private function CJ takes nothing returns boolean
// return(Codemaker_vals[1]>=(Codemaker_vals[2]*100))and(Codemaker_vals[1]<=((Codemaker_vals[2]+1)*100))
// endfunction
// private function DJ takes nothing returns boolean
// return(Codemaker_vals[1]<=99)or(CJ())
// endfunction
private function SaveActions takes nothing returns nothing
local integer index=1+GetPlayerId(GetTriggerPlayer())
call SetPlayerName(GetTriggerPlayer(),PLAYER_NAMES[index])
set Codemaker_vals[0]=2
set Codemaker_vals[1]=PLAYER_XP[index]
set Codemaker_size[1]=20
set Codemaker_vals[2]=PLAYER_DIFFCOMP[index]
set Codemaker_size[2]=14
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,120.," ")
call DisplayTimedTextToForce(GetForceOfPlayer(GetTriggerPlayer()),120.,("Your experience is: "+I2S(Codemaker_vals[1])))
set CODE_PLAYER=GetTriggerPlayer()
set Code=Codemaker_GenerateCode(CODE_PLAYER)
set Code=Codemaker_HighlightCode(Code,"FFAAAAAA","FF0055FF","FFFFFF00")
call DisplayTimedTextToForce(GetForceOfPlayer(GetTriggerPlayer()),10000.,("Your soldier ID is: "+Code))
call SetPlayerName(GetTriggerPlayer(),(SubStringBJ(PLAYER_RANK_NAME[index],3,StringLength(PLAYER_RANK_NAME[index]))+(" "+PLAYER_NAMES[index])))
endfunction
private function Conditions takes nothing returns boolean
return (PLAYER_HAS_LOADED[GetPlayerId(GetTriggerPlayer())+1]==false)
endfunction
private function LoadActions takes nothing returns nothing
local integer i = 1
local integer index=1+GetPlayerId(GetTriggerPlayer())
call SetPlayerName(GetTriggerPlayer(),PLAYER_NAMES[index])
set Codemaker_vals[0]=2
set Codemaker_size[1]=20
set Codemaker_size[2]=5
set CODE_PLAYER=GetTriggerPlayer()
set Code=SubStringBJ(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString()))
if(StringLength(Code)!=0)then
set CodeError=Codemaker_ReadCode(CODE_PLAYER,Code)
if(CodeError!=0)then
call DisplayTextToForce(GetForceOfPlayer(GetTriggerPlayer()),"Soldier ID invalid.")
return
endif
call DisplayTimedTextToForce(GetForceOfPlayer(GetTriggerPlayer()),120.," ")
call DisplayTimedTextToForce(GetForceOfPlayer(GetTriggerPlayer()),120.,("Experience is "+I2S(Codemaker_vals[1])))
set PLAYER_XP[index]=Codemaker_vals[1]
set XP_ON_LOAD[index]=Codemaker_vals[1]
//set PLAYER_XP_100[index]=Codemaker_vals[2]
set PLAYER_DIFFCOMP[index]=Codemaker_vals[2]
set PLAYER_HAS_LOADED[index]=true
endif
call SetPlayerName(GetTriggerPlayer(),(SubStringBJ(PLAYER_RANK_NAME[index],3,StringLength(PLAYER_RANK_NAME[index]))+(" "+PLAYER_NAMES[index])))
loop
exitwhen i>UA2_RankAmount
if (RANK_MIN_XP[i]<=PLAYER_XP[index])and(RANK_MAX_XP[i]>=PLAYER_XP[index]) then
set PLAYER_RANK_NAME[index]=RANK_NAME[i]
endif
set i=i+1
endloop
set PLAYER_RANK[index]=S2I(SubStringBJ(PLAYER_RANK_NAME[index],1,2))
endfunction
// Initializer
private function Init takes nothing returns nothing
set saveTrig = CreateTrigger()
call TriggerRegisterPlayerChatEvent(saveTrig,Player(0),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(1),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(2),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(3),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(4),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(5),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(6),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(7),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(8),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(9),"-save",true)
call TriggerRegisterPlayerChatEvent(saveTrig,Player(10),"-save",true)
call TriggerAddAction(saveTrig,function SaveActions)
set loadTrig = CreateTrigger()
call TriggerRegisterPlayerChatEvent(loadTrig,Player(0),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(1),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(2),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(3),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(4),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(5),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(6),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(7),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(8),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(9),"-load",false)
call TriggerRegisterPlayerChatEvent(loadTrig,Player(10),"-load",false)
call TriggerAddCondition(loadTrig,Condition(function Conditions))
call TriggerAddAction(loadTrig,function LoadActions)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library Firemode initializer Init requires GlobalFuncs
//TRIG: pI, Cond: HQ, Func: pQ
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A035')
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
if IsPlayerInForce(p,FIREMODE_SINGLE) then
call DisplayTimedTextToForce(GetForceOfPlayer(p),8.,"Now on burst-fire.")
call PlaySoundOnUnitBJ(NX,100,u)
call UnitRemoveAbility(u,'A04H')
call UnitRemoveAbility(u,'A04I')
call UnitRemoveAbility(u,'A034')
call UnitRemoveAbility(u,'A042')
if GetUnitTypeId(u)=='H008' or GetUnitTypeId(u)=='H01I' then
call UnitAddAbility(u,'A034')
else
call UnitAddAbility(u,'A042')
endif
call ForceRemovePlayer(FIREMODE_SINGLE,p)
call ForceAddPlayer(FIREMODE_BURST,p)
set u=null
return
endif
if IsPlayerInForce(p,FIREMODE_BURST) and (GetPlayerTechCountSimple('R00B',p)<5 or CountItemsOfType(u,'I019')>=1) then
call DisplayTimedTextToForce(GetForceOfPlayer(p),8.,"Now on single-shot.")
call PlaySoundOnUnitBJ(NX,100,u)
call UnitRemoveAbility(u,'A04H')
call UnitRemoveAbility(u,'A04I')
call UnitRemoveAbility(u,'A034')
call UnitRemoveAbility(u,'A042')
call ForceRemovePlayer(FIREMODE_BURST,p)
call ForceAddPlayer(FIREMODE_SINGLE,p)
set u=null
return
endif
if (IsPlayerInForce(p,FIREMODE_BURST)) and (GetPlayerTechCountSimple('R00B',p)>=5) and CountItemsOfType(u,'I019')==0 then
call DisplayTimedTextToForce(GetForceOfPlayer(p),8.,"Now on automatic.")
call PlaySoundOnUnitBJ(NX,100,u)
call UnitRemoveAbility(u,'A04H')
call UnitRemoveAbility(u,'A04I')
call UnitRemoveAbility(u,'A034')
call UnitRemoveAbility(u,'A042')
if (GetUnitTypeId(u)=='H008') then
call UnitAddAbility(u,'A04I')
else
call UnitAddAbility(u,'A04H')
endif
call ForceRemovePlayer(FIREMODE_BURST,p)
call ForceAddPlayer(FIREMODE_AUTO,p)
set u=null
return
endif
if (IsPlayerInForce(p,FIREMODE_AUTO)) then
call DisplayTimedTextToForce(GetForceOfPlayer(p),8.,"Now on single-shot.")
call PlaySoundOnUnitBJ(NX,100,u)
call UnitRemoveAbility(u,'A04H')
call UnitRemoveAbility(u,'A04I')
call UnitRemoveAbility(u,'A034')
call UnitRemoveAbility(u,'A042')
call ForceRemovePlayer(FIREMODE_AUTO,p)
call ForceAddPlayer(FIREMODE_SINGLE,p)
set u=null
return
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=63
//TESH.alwaysfold=0
library MSManagement initializer Init requires GlobalFuncs
//TRIG: KO, Cond: --, Func: fK
globals
real array MS_MOD
endglobals
private function ReduceNonHeroMSBy60 takes nothing returns nothing
if (IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO)==false) then
call SetUnitMoveSpeed(GetEnumUnit(),(GetUnitMoveSpeed(GetEnumUnit())-60.))
endif
endfunction
private function Actions takes nothing returns nothing
local integer i=1
local real movSpeed
local group g=CreateGroup()
local unit u
loop
exitwhen i>11
if (GetUnitTypeId(PLAYER_UNIT[i])=='H00U') then
set movSpeed=(GetUnitDefaultMoveSpeed(PLAYER_UNIT[i])-(I2R(GetPlayerState(Player(i-1),PLAYER_STATE_RESOURCE_LUMBER))*.02))
else
set movSpeed=(GetUnitDefaultMoveSpeed(PLAYER_UNIT[i])-(I2R(GetPlayerState(Player(i-1),PLAYER_STATE_RESOURCE_LUMBER))*1.5))
endif
if (GetPlayerTechCountSimple('R00B',Player(i-1))>=4) or (GetUnitAbilityLevel(PLAYER_UNIT[i],'A01X')>=4) or (GetUnitAbilityLevel(PLAYER_UNIT[i],'A00L')>=4) or (GetUnitAbilityLevel(PLAYER_UNIT[i],'A082')>=4) then
set movSpeed=(movSpeed+10.)
endif
if SNOWING then
set movSpeed=(movSpeed-8.)
endif
if CountItemsOfType(PLAYER_UNIT[i],'I008')>0 then
set movSpeed=movSpeed-5
endif
set movSpeed=(movSpeed+(S2R(SubStringBJ(PLAYER_RANK_NAME[i],1,2))*.5))
set movSpeed=(movSpeed+(I2R(GetPlayerTechCountSimple('R00I',Player(i-1)))*5.)) //SR Skills
if UnitHasBuffBJ(PLAYER_UNIT[i],'B01A') then //leadership
set movSpeed=movSpeed*(1.02+(I2R(GetUnitAbilityLevel(PLAYER_UNIT[i],'B01A'))*.03))
endif
if (IsUnitInGroup(PLAYER_UNIT[i],PUTTING_ON_ARMOR)) then
set movSpeed=(movSpeed-60.)
endif
set movSpeed=movSpeed+MS_MOD[i]
if (IsUnitInGroup(PLAYER_UNIT[i],SPRINTING_UNITS)==false) then
call SetUnitMoveSpeed(PLAYER_UNIT[i],movSpeed)
if (EXHAUSTION[i]<140) then
set EXHAUSTION[i]=(EXHAUSTION[i]+GetRandomInt(10,14))
endif
else
set EXHAUSTION[i]=(EXHAUSTION[i]-GetRandomInt(4,8))
set movSpeed=(movSpeed+I2R(EXHAUSTION[i]))
call SetUnitMoveSpeed(PLAYER_UNIT[i],movSpeed)
if (EXHAUSTION[i]<=22) or GetUnitAbilityLevel(PLAYER_UNIT[i],'B01K')>0 then
call DisplayTimedTextToForce(GetForceOfPlayer(Player(i-1)),5.,"Stopped sprinting...")
call GroupRemoveUnit(SPRINTING_UNITS,PLAYER_UNIT[i])
endif
endif
set i=i+1
endloop
call ForGroupBJ(PUTTING_ON_ARMOR,function ReduceNonHeroMSBy60)
//======
// Minis
//======
call GroupAddGroup(MINI_BREATHERS,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if GetUnitUserData(u)<140 then
call SetUnitUserData(u,GetUnitUserData(u)+GetRandomInt(10,14))
endif
call GroupRemoveUnit(g,u)
endloop
call GroupAddGroup(MINI_SPRINTERS,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call SetUnitUserData(u,GetUnitUserData(u)-GetRandomInt(4,8))
if GetUnitUserData(u)<=22 or GetUnitAbilityLevel(u,'B01K')>0 then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5.,GetUnitName(u)+" stopped sprinting...")
call GroupRemoveUnit(MINI_SPRINTERS,u)
call GroupAddUnit(MINI_BREATHERS,u)
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
else
call SetUnitMoveSpeed(u,(GetUnitDefaultMoveSpeed(u)+I2R(GetUnitUserData(u))))
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,2.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=24
//TESH.alwaysfold=0
library Reload initializer Init requires GlobalFuncs
//TRIG: wI, Cond: ws, Func: oS
//NEEDS: ...
globals
public trigger T
integer BCT='A00D'
integer AITMG='A00L'
integer AITDM='A01X'
integer LDRSHP='B01A'
endglobals
private function Conditions takes nothing returns boolean
local boolean b
local unit u=GetTriggerUnit()
set b= (GetSpellAbilityId()=='A00C' or GetSpellAbilityId()=='A07S') and(IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(u)))]==false)and(PLAYER_UNIT[(1+GetPlayerId(GetOwningPlayer(u)))]==u)
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local effect e
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
local integer pid=1+GetPlayerId(p)
local integer typeid=GetUnitTypeId(u)
local integer ldrshplvl=GetUnitAbilityLevel(u,LDRSHP)
local boolean r=typeid != 'H00R' and typeid != 'H00I'
local boolean b=CURRENT_AMMO[pid]==0 and r
if GetSpellAbilityId()=='A07S' and CURRENT_AMMO[pid] > 0 then
set e=null
set u=null
return
endif
if GetSpellAbilityId()!='A07S' then
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
endif
if GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER) > (0+GetUnitAbilityLevel(u,'A05B')) then
set IS_LINKING_BELTS[pid]=true
set e=AddSpecialEffectTargetUnitBJ("overhead",u,"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set CURRENT_AMMO[pid]=0
call AdjustPlayerStateBJ((-1-GetUnitAbilityLevel(u,'A05B')),p,PLAYER_STATE_RESOURCE_LUMBER)
if r then
call PlaySoundOnUnitBJ(gg_snd_Magout,100,u)
endif
call CreateTextTagUnitBJ("|cff804000"+GetPlayerName(p)+":|r Reloading!",u,0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
if typeid=='H001' or typeid=='H00P' then
call PolledWait2(((6.-(I2R(GetUnitAbilityLevel(u,AITMG))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H00I' then
call PlaySoundOnUnitBJ(gg_snd_PlasmaRifleReload,100,u)
call PolledWait2(3.5)
endif
if typeid=='H00R' then
call UnitRemoveAbility(u,'A07S')
call PlaySoundOnUnitBJ(gg_snd_bfg_reload,100,u)
call PolledWait2(2)
endif
if typeid=='H00H' then
call PolledWait2(((5.-(I2R(GetUnitAbilityLevel(u,AITDM))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H000' or typeid=='H01I' or typeid=='H011' or typeid=='H00C' or typeid=='H00D' or typeid=='H00N' then
call PolledWait2(((4.-(I2R(GetUnitAbilityLevel(u,BCT))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H008' or typeid=='H00J' then
call PolledWait2((2.*(1-(.05*I2R(ldrshplvl)))))
endif
if r then
call PlaySoundOnUnitBJ(gg_snd_Magin,100,u)
endif
call PolledWait2(1.)
if b then
call PlaySoundAtUnitLoc(gg_snd_Boltpull,u)
call PolledWait2(.5)
endif
call ForceRemovePlayer(PLAYER_JAMMED,p)
set CURRENT_AMMO[pid]=MAG_SIZE[pid]
call DestroyEffect(e)
set IS_LINKING_BELTS[pid]=false
if typeid=='H00R' then
call UnitAddAbility(u,'A07S')
endif
else
call DisplayTimedTextToPlayer(p,0,0,5.,"Out of magazines.")
endif
set e=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
library ReloadMini initializer Init requires GlobalFuncs
//TRIG: KI, Cond: EQ, Func: RQ
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A00C' and IsUnitInGroup(GetTriggerUnit(),RELOADING)==false and PLAYER_UNIT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]!=GetTriggerUnit()
endfunction
private function Actions takes nothing returns nothing
local effect e
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
call GroupAddUnit(RELOADING,u)
call AddSpecialEffectTargetUnitBJ("overhead",u,"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set e=bj_lastCreatedEffect
call SetUnitManaPercentBJ(u,.0)
call PlaySoundOnUnitBJ(gg_snd_Magout,100,u)
call CreateTextTagUnitBJ(("|cff804000"+GetUnitName(u))+":|r Reloading!",u,0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
if GetUnitTypeId(u)=='h00E' then
call TriggerSleepAction(6.)
else
call TriggerSleepAction(4.)
endif
call PlaySoundOnUnitBJ(gg_snd_Magin,100,u)
call TriggerSleepAction(1.)
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,u)
call TriggerSleepAction(.3)
call SetUnitManaPercentBJ(u,100)
call DestroyEffect(e)
call GroupRemoveUnit(RELOADING,u)
set u=null
set e=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=22
//TESH.alwaysfold=0
library RifleButtLoop initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
globals
public trigger T
group RifleButters=CreateGroup()
group RifleButting=CreateGroup()
endglobals
function ButtingEnemy takes nothing returns boolean
local unit en=GetEnumUnit()
local unit fil=GetFilterUnit()
local boolean b=IsPlayerEnemy(GetOwningPlayer(en),GetOwningPlayer(fil)) and IsUnitAliveBJ(fil)
set en=null
set fil=null
return b
endfunction
function RifleButtStart takes nothing returns nothing
local unit eu=GetEnumUnit()
local group g=GetUnitsInRangeOfLocMatching(250.,GetUnitLoc(eu),Condition(function ButtingEnemy))
local unit u=GroupPickRandomUnit(g)
local unit b
if u!=null and IsUnitVisible(eu,Player(15)) and IsUnitAliveBJ(eu) then
call GroupAddUnit(RifleButting,eu)
call UnitAddAbility(eu,'A043')
call SetUnitTimeScalePercent(eu,125.)
if GetUnitAbilityLevel(eu,'B01K')==1 then
call SetUnitAnimation(eu,"spell throw defend")
else
call SetUnitAnimation(eu,"spell")
endif
set b = CreateUnit(GetOwningPlayer(eu), 'h00W', GetUnitX(eu), GetUnitY(eu), AngleBetweenPointsXY(GetUnitX(eu), GetUnitY(eu), GetUnitX(u), GetUnitY(u)))
call UnitApplyTimedLifeBJ(1,'BTLF',b)
call IssueTargetOrderById(b,OID_attack,u)
elseif IsUnitDeadBJ(eu) then
call GroupRemoveUnit(RifleButters,eu)
endif
call DestroyGroup(g)
set g=null
set u=null
set b=null
set eu=null
endfunction
function RifleButtEnd takes nothing returns nothing
local unit eu=GetEnumUnit()
call UnitRemoveAbility(eu,'A043')
call SetUnitTimeScalePercent(eu,100.)
call ResetUnitAnimation(eu)
call GroupRemoveUnit(RifleButting,eu)
set eu=null
endfunction
function Actions takes nothing returns nothing
call ForGroup(RifleButters,function RifleButtStart)
call PolledWait2(.08)
call ForGroup(RifleButting,function RifleButtEnd)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T,.8, true)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library RifleButtSpell initializer Init requires GlobalFuncs
//TRIG: mI, Cond: DQ, Func: gQ
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A041')
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
if (IsUnitInGroup(u,RifleButters)) then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(u)),8.,"Not rifle butting.")
call GroupRemoveUnit(RifleButters,u)
elseif (IsUnitInGroup(u,RifleButters)==false) then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(u)),8.,"Now rifle butting.")
call GroupAddUnit(RifleButters,u)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library Safety initializer Init requires GlobalFuncs
//TRIG: cI, Cond: vq, Func: oq
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A03Z')
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
if IsUnitInGroup(u,SAFETY) then
call GroupRemoveUnit(SAFETY,u)
//call UnitRemoveType(u,UNIT_TYPE_PEON)
call DisplayTimedTextToPlayer(p,0,0,10.,"Safety off.")
elseif IsUnitInGroup(u,SAFETY)==false then
call GroupAddUnit(SAFETY,u)
//call UnitAddType(u,UNIT_TYPE_PEON)
call DisplayTimedTextToPlayer(p,0,0,10.,"Safety on.")
endif
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Sprint initializer Init requires GlobalFuncs
//TRIG: lO, Cond: FK, Func: gK
//TRIG: LO, Cond: GK, Func: hK
globals
public trigger T=CreateTrigger()
public trigger T2=CreateTrigger()
group MINI_SPRINTERS=CreateGroup()
group MINI_BREATHERS=CreateGroup()
endglobals
private function Conditions takes nothing returns boolean
return (GetSpellAbilityId()=='A00U') and IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO)
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local integer pid = (1+GetPlayerId(p))
if (IsUnitInGroup(u,SPRINTING_UNITS)==false) and GetUnitAbilityLevel(u,'B01K')==0 then
call DisplayTimedTextToPlayer(p,0.,0.,5.,"Now sprinting...")
call PolledWait2(.01)
call SetUnitMoveSpeed(PLAYER_UNIT[pid],(GetUnitDefaultMoveSpeed(u)+I2R(EXHAUSTION[pid])))
call GroupAddUnit(SPRINTING_UNITS,u)
call PlaySoundOnUnitBJ(SOUND_SUIT_SPRINT,100,u)
elseif IsUnitInGroup(u,SPRINTING_UNITS) then
call DisplayTimedTextToPlayer(p,0.,0.,5.,"Stopped sprinting...")
call PolledWait2(.01)
call GroupRemoveUnit(SPRINTING_UNITS,u)
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
endif
if UICancel[pid] then
call ForceUICancelBJ(p)
endif
set u = null
endfunction
private function Conditions_Mini takes nothing returns boolean
return (GetSpellAbilityId()=='A00U') and IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false
endfunction
private function Actions_Mini takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
if IsUnitInGroup(u,MINI_BREATHERS)==false and IsUnitInGroup(u,MINI_SPRINTERS)==false then
call SetUnitUserData(u,140)
call GroupAddUnit(MINI_BREATHERS,u)
endif
if IsUnitInGroup(u,MINI_BREATHERS) and GetUnitAbilityLevel(u,'B01K')==0 then
call DisplayTimedTextToPlayer(p,0.,0.,5.,"Now sprinting...")
call PolledWait2(.01)
call SetUnitMoveSpeed(u,(GetUnitDefaultMoveSpeed(u)+I2R(GetUnitUserData(u))))
call GroupAddUnit(MINI_SPRINTERS,u)
call GroupRemoveUnit(MINI_BREATHERS,u)
call PlaySoundOnUnitBJ(SOUND_SUIT_SPRINT,100,u)
elseif IsUnitInGroup(u,MINI_SPRINTERS) then
call DisplayTimedTextToPlayer(p,0.,0.,5.,"Stopped sprinting...")
call PolledWait2(.01)
call GroupAddUnit(MINI_BREATHERS,u)
call GroupRemoveUnit(MINI_SPRINTERS,u)
call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))
endif
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
set u = null
endfunction
// Initializer
private function Init takes nothing returns nothing
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call TriggerRegisterAnyUnitEventBJ(T2,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T2,Condition(function Conditions_Mini))
call TriggerAddAction(T2,function Actions_Mini)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library Stance initializer Init requires GlobalFuncs
//TRIG: --, Cond: Gp, Func: qp
//NEEDS: ...
globals
public trigger T
public trigger T2
endglobals
private function Conditions takes nothing returns boolean
return (GetSpellAbilityId()=='A03G')
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer t=GetUnitTypeId(u)
local unit dummy
local player p=GetOwningPlayer(u)
if GetUnitAbilityLevel(u,'B01K')==0 then
call AddUnitAnimationProperties(u,"defend",true)
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5.,"Now prone.")
if GAME_MODE==UA2_ModeUmbrella then
//call UnitAddAbility(u,'A06A')
endif
if t=='H00U' then
call UnitAddAbility(u,'A072')
endif
set dummy=CreateUnit(p,'h003',GetUnitX(u),GetUnitY(u),270.)
call UnitAddAbility(dummy,'A07Q')
call IssueTargetOrder(dummy,"cripple",u)
call UnitApplyTimedLifeBJ(2.,'BTLF',dummy)
elseif GetUnitAbilityLevel(u,'B01K')>0 then
call AddUnitAnimationPropertiesBJ(false,"defend",u)
call DisplayTimedTextToForce(GetForceOfPlayer(p),5.,"Now standing.")
call UnitRemoveAbility(u,'B01K')
call UnitRemoveAbility(u,'A06A')
call UnitRemoveAbility(u,'A072')
endif
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
set u=null
set dummy=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=11
//TESH.alwaysfold=0
library NVGSpell initializer Init requires GlobalFuncs
//TRIG: oI, Cond: np, Func: Vp
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A05E'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=(1+GetPlayerId(GetOwningPlayer(u)))
local player p=GetOwningPlayer(u)
if PLAYER_HAS_NVG[i]==false then
//call ModifyHeroStat(0,PLAYER_UNIT[i],0,1)
call ModifyHeroStat(1,PLAYER_UNIT[i],0,5)
call ShowNightVision(GetOwningPlayer(u),true)
set PLAYER_HAS_NVG[i]=true
call PlaySoundAtUnitLoc(SOUND_NVG_ON,u)
else
//call ModifyHeroStat(0,PLAYER_UNIT[i],1,1)
call ModifyHeroStat(1,PLAYER_UNIT[i],1,5)
call ShowNightVision(GetOwningPlayer(u),false)
set PLAYER_HAS_NVG[i]=false
call PlaySoundAtUnitLoc(SOUND_NVG_OFF,u)
endif
if UICancel[1+GetPlayerId(p)] and GetPlayerId(p)<11 then
call ForceUICancelBJ(p)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=5
//TESH.alwaysfold=0
library AbilityLeveling initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local unit u=GetLearningUnit()
local player p=GetOwningPlayer(u)
if GetLearnedSkill()=='A00Z' then
set SHELLS=SHELLS+5
endif
call SetPlayerTechResearched(p, 'R005',GetUnitAbilityLevel(u, 'A01N'))
if GetUnitAbilityLevel(u, 'A00D')>0 then
call SetPlayerTechResearched(p, 'R00B',GetUnitAbilityLevel(u, 'A00D'))
endif
if GetUnitAbilityLevel(u, 'A00L')>0 then
call SetPlayerTechResearched(p, 'R00B',GetUnitAbilityLevel(u, 'A00L'))
endif
if GetUnitAbilityLevel(u, 'A01X')>0 then
call SetPlayerTechResearched(p, 'R00K',GetUnitAbilityLevel(u, 'A01X'))
endif
if GetUnitAbilityLevel(u, 'A082')>0 then
call SetPlayerTechResearched(p, 'R004',GetUnitAbilityLevel(u, 'A082'))
endif
call SetPlayerTechResearched(p, 'R00G',GetUnitAbilityLevel(u, 'A063'))
call SetPlayerTechResearched(p, 'R00C',GetUnitAbilityLevel(u, 'A039'))
call SetPlayerTechResearched(p, 'R007',GetUnitAbilityLevel(u, 'A02U'))
call SetPlayerTechResearched(p, 'R00L',GetUnitAbilityLevel(u, 'A077'))
call SetUnitAbilityLevel(u, 'A076',GetUnitAbilityLevel(u, 'A077'))
call SetPlayerTechResearched(p, 'R00E',GetUnitAbilityLevel(u, 'A04J'))
call SetUnitAbilityLevel(u, 'A04N',GetUnitAbilityLevel(u, 'A04J'))
call SetPlayerTechResearched(p, 'R00M',GetUnitAbilityLevel(u, 'A02W'))
call SetPlayerTechResearched(p, 'R000',GetUnitAbilityLevel(u, 'A00Y'))
call SetUnitAbilityLevel(u, 'A00X',GetUnitAbilityLevel(u, 'A00Y'))
call SetUnitAbilityLevel(u, 'A07F',GetUnitAbilityLevel(u, 'A00Y'))
call SetPlayerTechResearched(p, 'R001',GetUnitAbilityLevel(u, 'A00Z'))
call SetUnitAbilityLevel(u, 'A011',GetUnitAbilityLevel(u, 'A00Z'))
call SetPlayerTechResearched(p, 'R00I',GetUnitAbilityLevel(u, 'A06L'))
if GetUnitAbilityLevel(u, 'A06L')>=5 then
call EnableTrigger(PingUmbs_T)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_HERO_SKILL)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=10
//TESH.alwaysfold=0
library PingUmbs initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GAME_MODE==UA2_ModeUmbrella
endfunction
private function Actions takes nothing returns nothing
local group g=GetUnitsOfPlayerMatching(Player(11),Condition(function IsUnitAlive))
local unit u
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitVisible(u,Player(0)) then
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS, GetUnitX(u), GetUnitY(u), 2., 0, 100., 20., 20.)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerRegisterTimerEventPeriodic(T,5.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=21
//TESH.alwaysfold=0
library Airstrike initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: CR, Cond: Em, Func: Xm
globals
public trigger T
private unit A_caller
private unit A_fighter
private location A_target
endglobals
function AirstrikeTarget takes nothing returns nothing
local unit caller=A_caller
local unit fighter=A_fighter
local location targ=A_target
local real x=GetLocationX(targ)
local real y=GetLocationY(targ)
local real ux=GetUnitX(fighter)
local real uy=GetUnitY(fighter)
local real angle=AngleBetweenPointsXY(x,y,ux,uy)
local unit dummy
//local effect e
local integer flyby=GetRandomInt(1,3)
set dummy=CreateUnit(P_USMC, 'h00L', ux, uy, angle)
call UnitApplyTimedLifeBJ(5.,'BTLF',dummy)
call UnitAddAbility(dummy,'A00F')
call SetUnitFlyHeight(dummy,700.,0)
call IssuePointOrder(dummy,"clusterrockets",x, y)
call PolledWait2(.8)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cff804000Pilot:|r Impact!")
call StartSound(gg_snd_AirstrikeDist)
set dummy=CreateUnit(P_USMC, 'h01Y', x, y, angle)
//set e=AddSpecialEffect("war3mapImported\\NuclearExplosionHUGE.mdl",x, y)
call UnitDamagePoint(caller,0,1300.,x,y,25000.,true, false, ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DamageDestructables(x,y,1300,25000)
call DeafenPlayersInDistanceOfLoc(targ,4000)
call RumbleCam(18.,1.99)
call PolledWait2(2.)
call RumbleCam(3.,8)
call AttachSoundToUnit(SOUND_FLYBY[flyby], fighter)
call StartSound(SOUND_FLYBY[flyby])
call PolledWait2(28)
call RemoveUnit(dummy)
//call DestroyEffect(e)
//set e=null
set dummy=null
set caller=null
set fighter=null
call RemoveLocation(targ)
set targ=null
endfunction
private struct FighterMove
unit fighter
unit caller
real x
real y
real angle
boolean delivered
boolean close
real count
method Move takes nothing returns nothing
local real ux=GetUnitX(.fighter)
local real uy=GetUnitY(.fighter)
local real nx=ux + 40 * Cos(.angle * bj_DEGTORAD)
local real ny=uy + 40 * Sin(.angle * bj_DEGTORAD)
call SetUnitX(.fighter, nx)
call SetUnitY(.fighter, ny)
endmethod
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local FighterMove f = GetTimerStructA(t)
local real ux=GetUnitX(f.fighter)
local real uy=GetUnitY(f.fighter)
local location targ
call f.Move()
if f.close==false and DistanceBetweenPointsXY(ux, uy, f.x, f.y) <= 3000 then //start sound
set f.close=true
set targ=Location(f.x,f.y)
call PlaySoundAtPointBJ(gg_snd_Airstrike, 100, targ, 15)
call RemoveLocation(targ)
endif
if f.delivered==false and DistanceBetweenPointsXY(ux, uy, f.x, f.y) <= 1200 then //fire
set f.delivered=true
set A_caller=f.caller
set A_fighter=f.fighter
set A_target=Location(f.x,f.y)
call ExecuteFunc("AirstrikeTarget")
set f.count=0
elseif f.delivered==true then //constant damage while there's the heat for 10 seconds
set f.count=f.count+1
if f.count*.03 > .8 and f.count*.03 < 12 then
call UnitDamagePoint(f.caller,0,1300.,f.x,f.y,90*.03,true, false, ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endif
endif
if ux >= 15500 then //remove
call RemoveUnit(f.fighter)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call f.destroy()
endif
set t = null
set targ=null
endfunction
private function Actions takes nothing returns nothing
local FighterMove f = FighterMove.create()
local timer t = CreateTimer()
local location l=GetSpellTargetLoc()
local real x=-15500 //GetLocationX(l)-GetRandomReal(7000,8000)
local real y=GetLocationY(l)-GetRandomReal(-500,500)
local unit u=GetTriggerUnit()
local unit fighter
local unit dummy
set f.x=GetLocationX(l)
set f.y=GetLocationY(l)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(("|cff804000"+GetPlayerName(GetTriggerPlayer()))+": Airstrike inbound!"))
call StartSound(gg_snd_InformAirstrike)
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,f.x,f.y,5.,2,100,30.,30.)
set f.caller=GetTriggerUnit()
set f.delivered=false
set f.close=false
set f.angle=AngleBetweenPointsXY(x,y,f.x,f.y)
set f.fighter=CreateUnit(P_USMC, 'h00O', x, y, f.angle)
call UnitShareVision(f.fighter,GetOwningPlayer(u),true)
set dummy=CreateUnit(GetOwningPlayer(f.caller), 'h00S', f.x, f.y, f.angle) //vision dummy
call UnitApplyTimedLife(dummy,'BTLF',30)
call SetTimerStructA(t,f)
call TimerStart(t,.03,true,function Callback)
set u=null
call RemoveLocation(l)
set l=null
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A033' or GetSpellAbilityId()=='A055'
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CASFM initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: CR, Cond: Em, Func: Xm
globals
public trigger T
private unit C_caller
private unit C_heli
private location C_target
endglobals
function BoomSpot takes unit u, real x, real y returns nothing
call UnitDamagePoint(u,0,300,x,y,500,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",x,y))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x+GetRandomReal(-120,120),y+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x+GetRandomReal(-120,120),y+GetRandomReal(-120,120)))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x+GetRandomReal(-120,120),y+GetRandomReal(-120,120)))
endfunction
function BigExplosion takes unit u, real x, real y returns nothing
local unit boom
call BoomSpot(u,x-700,y-100)
call BoomSpot(u,x-700,y+100)
call BoomSpot(u,x-500,y-300)
call BoomSpot(u,x-500,y+300)
call PolledWait2(.01)
call BoomSpot(u,x-500,y-100)
call BoomSpot(u,x-500,y+100)
call BoomSpot(u,x-300,y-500)
call BoomSpot(u,x-300,y+500)
call PolledWait2(.01)
call BoomSpot(u,x-300,y-100)
call BoomSpot(u,x-300,y+100)
call BoomSpot(u,x-100,y-700)
call BoomSpot(u,x-100,y+700)
call PolledWait2(.01)
//call DestroyEffect(AddSpecialEffect("war3mapImported\\Satchel Explosion.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewMassiveEX.mdx",x,y))
set boom= CreateUnit(GetOwningPlayer(u),'h01U',x,y,0)
call UnitApplyTimedLifeBJ(5.,'BTLF',boom)
call BoomSpot(u,x,y+200)
call BoomSpot(u,x,y-200)
call StartSound(OE)
call UnitDamagePoint(u,0,900.,x,y,8000.,true, false, ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DamageDestructables(x,y,900,8000)
call RumbleCam(10.,1.9)
call PolledWait2(.05)
call BoomSpot(u,x+300,y-100)
call BoomSpot(u,x+300,y+100)
call BoomSpot(u,x+100,y-700)
call BoomSpot(u,x+100,y+700)
call PolledWait2(.01)
call BoomSpot(u,x+500,y-100)
call BoomSpot(u,x+500,y+100)
call BoomSpot(u,x+300,y-500)
call BoomSpot(u,x+300,y+500)
call PolledWait2(.01)
call BoomSpot(u,x+700,y-100)
call BoomSpot(u,x+700,y+100)
call BoomSpot(u,x+500,y-300)
call BoomSpot(u,x+500,y+300)
set boom=null
endfunction
function CASTarget takes nothing returns nothing
local unit caller=C_caller
local unit heli=C_heli
local location targ=C_target
local real x=GetLocationX(targ)
local real y=GetLocationY(targ)
local real ux=GetUnitX(heli)
local real uy=GetUnitY(heli)
local real angle=AngleBetweenPointsXY(x,y,ux,uy)
local unit dummy
local integer flyby=GetRandomInt(1,3)
set dummy=CreateUnit(P_USMC, 'h00L', ux+200, uy, angle)
call UnitApplyTimedLifeBJ(5.,'BTLF',dummy)
call UnitAddAbility(dummy,'A07R')
call SetUnitFlyHeight(dummy,650.,0)
call IssuePointOrder(dummy,"clusterrockets",x, y)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cff804000Pilot:|r Ordnance deployed.")
call PolledWait2(1.3)
call DeafenPlayersInDistanceOfLoc(targ,1600)
call BigExplosion(caller,x,y)
call PolledWait2(2.)
set dummy=null
set caller=null
set heli=null
call RemoveLocation(targ)
set targ=null
endfunction
private struct HeliMove
unit heli
unit caller
real x
real y
real angle
boolean delivered
boolean close
real count
method Move takes nothing returns nothing
local real ux=GetUnitX(.heli)
local real uy=GetUnitY(.heli)
local real nx=ux + 30 * Cos(.angle * bj_DEGTORAD)
local real ny=uy + 30 * Sin(.angle * bj_DEGTORAD)
call SetUnitX(.heli, nx)
call SetUnitY(.heli, ny)
endmethod
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local HeliMove f = GetTimerStructA(t)
local real ux=GetUnitX(f.heli)
local real uy=GetUnitY(f.heli)
call f.Move()
if f.delivered==false and DistanceBetweenPointsXY(ux, uy, f.x, f.y) <= 1500 then //fire
set f.delivered=true
set C_caller=f.caller
set C_heli=f.heli
set C_target=Location(f.x,f.y)
call ExecuteFunc("CASTarget")
endif
if ux >= 15500 then //remove
call RemoveUnit(f.heli)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call f.destroy()
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local HeliMove f = HeliMove.create()
local timer t = CreateTimer()
local location l=GetSpellTargetLoc()
local real x=-15500 //GetLocationX(l)-GetRandomReal(7000,8000)
local real y=GetLocationY(l)-GetRandomReal(-500,500)
local unit u=GetTriggerUnit()
local unit heli
local unit dummy
set f.x=GetLocationX(l)
set f.y=GetLocationY(l)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(("|cff804000"+GetPlayerName(GetTriggerPlayer()))+": CAS inbound!"))
call StartSound(gg_snd_InformAirstrike)
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,f.x,f.y,5.,2,100,30.,30.)
set f.caller=GetTriggerUnit()
set f.delivered=false
set f.close=false
set f.angle=AngleBetweenPointsXY(x,y,f.x,f.y)
set f.heli=CreateUnit(P_USMC, 'h00F', x, y, f.angle)
call UnitShareVision(f.heli,GetOwningPlayer(u),true)
set dummy=CreateUnit(GetOwningPlayer(f.caller), 'h00S', f.x, f.y, f.angle) //vision dummy
call UnitApplyTimedLife(dummy,'BTLF',30)
call SetTimerStructA(t,f)
call TimerStart(t,.03,true,function Callback)
set u=null
call RemoveLocation(l)
set l=null
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A07M'
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=18
//TESH.alwaysfold=0
library ConstrictionNet initializer Init requires GlobalFuncs
private function Conditions takes nothing returns boolean
local integer i = GetSpellAbilityId()
return i=='A07B' or i=='A07C'
endfunction
private function Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local integer index=0
local integer dur
local integer i = GetSpellAbilityId()
local integer dmg
local integer level=GetUnitAbilityLevel(GetTriggerUnit(), 'A07C')
if i=='A07B' then
set dur=5
set dmg=28
set level=3
else
set dur=level+2
set dmg=level*6+10
endif
call UnitAddAbility(u, 'A07D')
call SetUnitAbilityLevel(u, 'A07D', level)
loop
exitwhen index > dur
call SetUnitLifeBJ(u, GetUnitState(u, UNIT_STATE_LIFE)-dmg)
call PolledWait2(1.)
set index = index + 1
endloop
call UnitRemoveAbility(u, 'A07D')
set u = null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ClusterRockets initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: hR, Cond: Gm, Func: hm
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A03A' or GetSpellAbilityId()=='A070'
endfunction
private function Actions takes nothing returns nothing
local integer i=0
local unit u=GetTriggerUnit()
local integer i2=GetUnitAbilityLevelSwapped('A03A',u)
local location l
local location l2=GetSpellTargetLoc()
local location l3
call USMCRunFromExplosion(GetSpellTargetX(),GetSpellTargetY(),800)
call PolledWait2(.4)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call DeafenPlayersInDistanceOfLoc(l2,800)
loop
exitwhen i>=1+i2
call PolledWait2(GetRandomReal(.0,.08))
set l=OffsetLocation(l2,GetRandomInt(-160,160),GetRandomInt(-160,160))
call WG()
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",l))
call UnitDamagePointLoc(u,0,300.+(20.*I2R(i2)),l2,400.+(300.*I2R(i2))/(1.+I2R(i2)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
call Dh(300.+(20.*I2R(i2)),l)
set l3=OffsetLocation(l,GetRandomInt(-'x','x'),GetRandomInt(-'x','x'))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",l3))
call RemoveLocation(l3)
set l3=OffsetLocation(l,GetRandomInt(-'x','x'),GetRandomInt(-'x','x'))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",l3))
call RemoveLocation(l3)
set l3=OffsetLocation(l,GetRandomInt(-'x','x'),GetRandomInt(-'x','x'))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",l3))
call RemoveLocation(l3)
set i=i+1
call RemoveLocation(l)
endloop
set u=null
set l=null
call RemoveLocation(l2)
set l2=null
set l3=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpellEnergyOrb initializer Init requires GlobalFuncs
private struct Data
unit caster
unit dummy
player owner
integer abilId
integer abilLevel
effect fx
real angleRAD
boolean gracePeriod
integer iterations
integer stepsDown = 0
group alreadyDamaged
endstruct
globals
private boolean BounceDetermined = false
private boolean EncounteredDestructables = false
endglobals
private constant function OrbAOE takes real OrbLevel returns real
return 75+OrbLevel*15
endfunction
private constant function OrbTravelStep takes real OrbLevel returns real
return 36.+4*OrbLevel
endfunction
private constant function OrbTravelDistance takes real OrbLevel returns real
return 1200.+400*OrbLevel
endfunction
private constant function OrbDamage takes real OrbLevel returns real
return 100+150*OrbLevel
endfunction
private constant function OrbExplodeDamage takes real OrbLevel returns real
return 350.
endfunction
private constant function OrbSize takes real OrbLevel returns real
return .9+OrbLevel*.1
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A045'
endfunction
private function DestructableInTheWay takes nothing returns nothing
local destructable d = GetEnumDestructable()
if not(d==null) and (GetDestructableLife(d) > 0) then
set EncounteredDestructables = true
if not(BounceDetermined) then
if not(IsDestructableTree(d)) or (GetRandomInt(1,20) > 19) then
set BounceDetermined = true
endif
endif
endif
set d = null
endfunction
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetTimerStructA(t)
local real dummyX = GetUnitX(data.dummy)
local real dummyY = GetUnitY(data.dummy)
local real destX
local real destY
local real downX
local real downY
local real dist = OrbTravelStep(data.abilLevel)
local real aoe = OrbAOE(data.abilLevel)
local real dmg = OrbDamage(data.abilLevel)
local boolean inWater = false
local boolean inHell = false
local boolean downHill = false
local integer bounceTries = 0
local rect r
local unit u
local group targets = CreateGroup()
set data.iterations = data.iterations + 1
if (data.iterations == 12) then
set data.gracePeriod = false
endif
set destX = dummyX + dist * Cos(data.angleRAD)
set destY = dummyY + dist * Sin(data.angleRAD)
if (data.stepsDown > 0) then
set data.stepsDown = data.stepsDown - 1
elseif not(IsPointPathable(destX,destY)) then
set BounceDetermined = false
set EncounteredDestructables = false
set r=Rect(destX-aoe,destY-aoe,destX+aoe,destY+aoe)
call EnumDestructablesInRect(r,BE_TRUE,function DestructableInTheWay)
if BounceDetermined then
call DamageDestructablesInCircle(destX,destY,aoe,dmg)
call DamageTreesInCircle(destX,destY,aoe)
set bounceTries = 0
loop
set data.angleRAD = GetRandomReal(data.angleRAD - (110*bj_DEGTORAD),data.angleRAD + (110*bj_DEGTORAD))
set destX = dummyX + dist * Cos(data.angleRAD)
set destY = dummyY + dist * Sin(data.angleRAD)
exitwhen IsPointPathable(destX,destY)
set bounceTries = bounceTries + 1
exitwhen bounceTries > 5
endloop
call DestroyEffect(AddSpellEffectById('A045',EFFECT_TYPE_AREA_EFFECT,dummyX,dummyY))
call GroupClear(data.alreadyDamaged)
set data.gracePeriod = false
elseif not(EncounteredDestructables) then
if IsPointWater(destX,destY) then
set inWater = true
else
set downX = dummyX + 220 * Cos(data.angleRAD)
set downY = dummyY + 220 * Sin(data.angleRAD)
set downHill = (IsPointPathable(downX,downY) and IsPointDownHill(dummyX,dummyY,downX,downY))
if downHill then
set data.stepsDown = R2I(200/dist)
else
set bounceTries = 0
loop
set data.angleRAD = GetRandomReal(data.angleRAD - (110*bj_DEGTORAD),data.angleRAD + (110*bj_DEGTORAD))
set destX = dummyX + dist * Cos(data.angleRAD)
set destY = dummyY + dist * Sin(data.angleRAD)
exitwhen IsPointPathable(destX,destY)
set bounceTries = bounceTries + 1
exitwhen bounceTries > 5
endloop
call DestroyEffect(AddSpellEffectById('A045',EFFECT_TYPE_AREA_EFFECT,dummyX,dummyY))
call GroupClear(data.alreadyDamaged)
set data.gracePeriod = false
endif
endif
endif
endif
if (bounceTries > 5) then
set inHell = true
else
call SetUnitPosition(data.dummy,destX,destY)
call DamageDestructablesInCircle(destX,destY,aoe,dmg)
call DamageTreesInCircle(destX,destY,aoe)
endif
if ((data.iterations * dist) < OrbTravelDistance(data.abilLevel)) and not(inWater) and not (inHell) then
call GroupEnumUnitsInRange(targets,destX,destY,aoe,BE_TRUE)
loop
set u = FirstOfGroup(targets)
exitwhen(u==null)
if not(u==data.caster and data.gracePeriod) and not(IsUnitInGroup(u,data.alreadyDamaged)) then
call CasterCastAbilityLevel(data.owner,'A044',data.abilLevel,OID_thunderbolt,u,5)
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Undead\\UndeadLargeDeathExplode\\UndeadLargeDeathExplode.mdl",u,"head"))
call GroupAddUnit(data.alreadyDamaged,u)
call UnitDamageTarget(data.caster,u,dmg,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit(targets,u)
endloop
else
set u = CreateUnit(data.owner,'h00S',destX,destY,.0)
call UnitAddAbility(u,'A05Q')
call UnitApplyTimedLife(u,'BTLF',2.)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",destX,destY))
call UnitDamagePoint(u,0,OrbExplodeDamage(data.abilLevel),destX,destY,600.,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(data.fx)
if inWater then
call DestroyEffect(AddSpellEffectById('A045',EFFECT_TYPE_SPECIAL,destX,destY))
call RemoveUnit(data.dummy)
else
call ExplodeUnitBJ(data.dummy)
endif
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
call data.destroy()
endif
call DestroyGroup(targets)
set targets = null
endfunction
private function Actions takes nothing returns nothing
local real casterX
local real casterY
local real abilX
local real abilY
local real dummySize
local location l = GetSpellTargetLoc()
local timer t = NewTimer()
local Data data = Data.create()
set data.caster = GetTriggerUnit()
set data.owner = GetOwningPlayer(data.caster)
set data.dummy = AddPlayerCaster(data.owner)
set data.abilId = GetSpellAbilityId()
set data.abilLevel = GetUnitAbilityLevel(data.caster,data.abilId)
set data.fx = AddSpellEffectTargetById(data.abilId,EFFECT_TYPE_MISSILE,data.dummy,"origin")
set casterX = GetUnitX(data.caster)
set casterY = GetUnitY(data.caster)
set abilX = GetLocationX(l)
set abilY = GetLocationY(l)
set data.angleRAD = Atan2(abilY-casterY,abilX-casterX)
set data.gracePeriod = true
set data.iterations = 0
set data.alreadyDamaged = CreateGroup()
call UnitAddAbility(data.dummy,'A05Q')
call SetUnitPosition(data.dummy,casterX,casterY)
call SetUnitFlyHeight(data.dummy,0,999)
set dummySize=OrbSize(data.abilLevel)
call SetUnitScale(data.dummy,dummySize,dummySize,dummySize)
call SetTimerStructA(t,data)
call TimerStart(t,.04,true,function Callback)
call RemoveLocation(l)
set l = null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call PreloadAbility('A044')
call PreloadAbility('A05Q')
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library FireMission initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A00A' and SHELLS>=FM_SHELLS
endfunction
function DummySpellCast takes integer abil,string order,real dx,real dy,real tx,real ty,real height returns nothing
local unit u=CreateUnit(Player(13),'h003',dx,dy,315)
call SetUnitFlyHeight(u,height,0)
call UnitApplyTimedLifeBJ(3,'BTLF',u)
call UnitAddAbility(u,abil)
call IssuePointOrder(u,order,tx,ty)
set u=null
endfunction
private function ShellSpot takes unit u, real level, real x, real y, real delay returns nothing
local integer rs=GetRandomInt(1,3)
local location l=Location(x,y)
call PolledWait2(delay)
call DummySpellCast('A05D',"clusterrockets",x-900,y+900,x,y,2500)
if GetSoundIsPlaying(SOUND_ARTILLERY_INCOMING[rs]) then
call StopSound(SOUND_ARTILLERY_INCOMING[rs],false,false)
endif
call SetSoundPosition(SOUND_ARTILLERY_INCOMING[rs],x,y,500)
call StartSound(SOUND_ARTILLERY_INCOMING[rs])
call PolledWait2(.85)
call DeafenPlayersInDistanceOfPoint(x,y,1300)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Satchel Explosion.mdx",x,y))
call Dh(350,l)
call UnitDamagePoint((u),0,200.,x,y,(650.+350.*level)*.67,true,false,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamagePoint((u),0,500.,x,y,(650.+350.*level)*.33,true,false,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call DamageDestructables(x,y,400,(650.+350.*level)*.33)
call WG()
call RumbleCam(14.,.3)
call RemoveLocation(l)
set l=null
endfunction
private function Actions takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local unit u2
local integer i1=1
local integer i2=FM_SHELLS
local real i3=I2R(FM_RADIUS)
local real delay
local real level = I2R(GetUnitAbilityLevel(u, 'A00A'))
local real sx
local real sy
local real tx=GetSpellTargetX()
local real ty=GetSpellTargetY()
local effect e1=AddSpecialEffect("Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl", tx,ty)
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,tx,ty,5.,0,100,50,50.)
set SHELLS=(SHELLS-FM_SHELLS)
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Shells Remaining: "+I2S(SHELLS) )
call PolledWait2(16.-1.5*I2R(GetUnitAbilityLevel(u,'A011'))) // rangefinder
call DestroyEffect(e1)
set u2=CreateUnit(GetOwningPlayer(u),'h00S',tx,ty,.0) // vision dummy
call USMCRunFromExplosion(tx,ty,800)
call PolledWait2(.9)
loop
exitwhen i1>i2
set sx=tx+(GetRandomReal(-i3,i3))
set sy=ty+(GetRandomReal(-i3,i3))
if GetRandomInt(1,3)==1 then
set delay=GetRandomReal(.5,2)
else
set delay=GetRandomReal(.05,.6)
endif
// have shells come in waves of 4, for each of the 4 artillery batteries
if i1>=5 and i1<=8 then
set delay=delay+3.5
elseif i1>=9 and i1<=12 then
set delay=delay+7
elseif i1>=13 then
set delay=delay+10.5
endif
call ShellSpot.execute(u, level, sx,sy,delay)
set i1=i1+1
endloop
call PolledWait2(delay+3)
call RemoveUnit(u2)
set e1=null
set u=null
set u2=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=56
//TESH.alwaysfold=0
library Flare initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private struct Shoot
unit flare
real speed
real count
real maxcount
real angle
method Period takes nothing returns nothing
local location ul = GetUnitLoc(.flare)
// When using stuff from a struct instance,
// just use "." to refer to the current instance
call SetUnitPositionLoc(.flare, PolarProjectionBJ(ul, .speed, .angle))
if .speed > .5 then
set .speed = .speed * .99
endif
set .count = .count + 1
if .count <= .maxcount / 1.5 then
call SetUnitFlyHeight(.flare, 1600, .speed*20)
//if .speed > 1. then
//set .speed = .speed * .99
//endif
else
call SetUnitFlyHeight(.flare, 400, .speed*3)
if .speed > 1. then
set .speed = .speed * .99
endif
endif
call RemoveLocation(ul)
set ul = null
endmethod
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Shoot f = GetTimerStructA(t)
call f.Period()
if IsUnitDeadBJ(f.flare) then
//call KillUnit(f.flare)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call f.destroy()
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local Shoot f = Shoot.create()
local timer t = CreateTimer()
local unit c=GetTriggerUnit()
local unit flare=CreateUnit(GetOwningPlayer(c), 'h01L', GetUnitX(c), GetUnitY(c), GetUnitFacing(c))
local location cl=GetUnitLoc(c)
local location targ = GetSpellTargetLoc()
local integer level = GetUnitAbilityLevel(c, 'A012')
local integer index=0
call VisionUnit(flare,true)
call UnitShareVision(flare, Player(14), true)
call UnitShareVision(flare, Player(12), true)
if GetSpellAbilityId()=='A012' then
call UnitApplyTimedLife(flare, 'BTLF', GetRandomInt(13+level*2, 17+level*2))
else
call UnitApplyTimedLife(flare, 'BTLF', GetRandomInt(18, 22))
endif
call PlaySoundOnUnitBJ(gg_snd_FlareLaunch, 100, c)
set f.flare = flare
set f.angle = AngleBetweenPoints(cl, targ)
set f.speed = DistanceBetweenPoints(cl, targ) * .01 + 10 //13
if f.speed < 7 then
set f.speed=7
set f.maxcount = 700 / f.speed
else
set f.maxcount = DistanceBetweenPoints(cl, targ) / f.speed
endif
set f.count = 0
call SetTimerStructA(t,f)
call TimerStart(t,.03,true,function Callback)
set c=null
set flare=null
call RemoveLocation(cl)
set cl=null
endfunction
private function Conditions takes nothing returns boolean
local integer i = GetSpellAbilityId()
return i=='A05R' or i=='A05T' or i=='A06X' or i=='A05U' or i=='A012'
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=21
//TESH.alwaysfold=0
library FragGrenade initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: QR, Cond: XM, Func: OM
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A017' or GetSpellAbilityId()=='A062' or GetSpellAbilityId()=='A06Z' or GetSpellAbilityId()=='A015'
endfunction
private function Actions takes nothing returns nothing
local location l=GetSpellTargetLoc()
local unit u=GetTriggerUnit()
local location l2=GetUnitLoc(u)
call GroupAddUnit(NADING,u)
if DistanceBetweenPoints(l2,l)<=1400. and GetRandomInt(1,8)!=1 then
set l=OffsetLocation(l,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
set l=OffsetLocation(l,GetRandomReal(-175.,175.),GetRandomReal(-175.,175.))
endif
if GetRandomInt(0,50)==0 then
call FieldChat(u,2,"|cff808000"+GetPlayerName(GetOwningPlayer(u))+":|r GTFO NOOB I GONNA KILLZ!")
else
call FieldChat(u,2,"|cff808000"+GetPlayerName(GetOwningPlayer(u))+":|r Frag out!")
endif
call PolledWait2(.4)
call PlaySoundOnUnitBJ(gg_snd_pinpull,100,u)
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(u),'h00Z',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851984,l)
call Ph(l)
call PolledWait2(.8)
call GroupRemoveUnit(NADING,u)
call PolledWait2(.4)
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(u),'h003',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A016')
if GetSpellAbilityId()=='A017' then
call SetUnitAbilityLevelSwapped('A016',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A017',GetTriggerUnit()))
else
call SetUnitAbilityLevelSwapped('A016',bj_lastCreatedUnit,1)
endif
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852488,l)
call PolledWait2(.3)
call yG()
call DeafenPlayersInDistanceOfLoc(l,600)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=34
//TESH.alwaysfold=0
library Jump initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return (GetSpellAbilityId()=='A050' or GetSpellAbilityId()=='JUMD') and GetUnitAbilityLevel(GetTriggerUnit(),'B01K')==0
endfunction
function IsLocInFacility takes location l returns boolean
return RectContainsLoc(gg_rct_Facility1,l) or RectContainsLoc(gg_rct_Facility2,l) or RectContainsLoc(gg_rct_Facility3,l) or RectContainsLoc(gg_rct_Facility4,l) or RectContainsLoc(gg_rct_Facility5,l)
endfunction
private struct Mov
unit u
integer CLD
integer count
integer countmax
real x
real y
real angle
sound s
endstruct
private function Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Mov m=GetTimerStructA(t)
local unit dummy
if m.count>m.countmax then
call SetUnitPathing(m.u,true)
call SetUnitFlyHeight(m.u,0,0)
call StopSound(m.s,false,true)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call m.destroy()
if(m.CLD>=2)then
call SetUnitAnimation(m.u,"Death")
set dummy=CreateUnit(Player(12),'h003',GetUnitX(m.u),GetUnitY(m.u),0)
call UnitApplyTimedLifeBJ(3.,'BTLF',dummy)
call UnitAddAbility(dummy,'A051')
call IssueTargetOrder(dummy,"slow",m.u)
call SetWidgetLife(m.u,GetUnitState(m.u,UNIT_STATE_LIFE)-(40.*m.CLD))
call PlaySoundAtUnitLoc(SOUND_SUITE_WOUND,m.u)
endif
if RectContainsUnit(An,m.u)then
call FieldChat(m.u,5.,GetPlayerName(GetOwningPlayer(m.u))+": Gross...")
endif
else
call SetUnitX(m.u, GetUnitX(m.u)+25.*Cos(m.angle*bj_DEGTORAD) )
call SetUnitY(m.u, GetUnitY(m.u)+25.*Sin(m.angle*bj_DEGTORAD) )
set m.count=m.count+1
if m.count<m.countmax/2 then
call SetUnitFlyHeight(m.u,(m.count*10),0)
else
call SetUnitFlyHeight(m.u,(m.countmax*10)-(m.count*10),0)
endif
endif
set dummy=null
set t=null
endfunction
private function Actions takes nothing returns nothing
local Mov m=Mov.create()
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local location l2=GetUnitLoc(u)
local integer CLU=GetTerrainCliffLevel(GetUnitX(u),GetUnitY(u))
local integer CLT=GetTerrainCliffLevel(GetLocationX(l),GetLocationY(l))
set m.angle=AngleBetweenPoints(l2,l)
if DistanceBetweenPoints(l,l2)>350 or (GetUnitTypeId(u)=='H00P' and DistanceBetweenPoints(l,l2)>475) then
if GetUnitTypeId(u)=='H00P' then
set l=PolarProjectionBJ(l2,475,m.angle)
else
set l=PolarProjectionBJ(l2,350,m.angle)
endif
endif
set m.x=GetLocationX(l)
set m.y=GetLocationY(l)
if DistanceBetweenPoints(l,l2) >= 50 and IsTerrainPathableBJ(l,PATHING_TYPE_WALKABILITY)==false and GetTerrainCliffLevel(GetUnitX(u),GetUnitY(u)) >= GetTerrainCliffLevel(m.x,m.y) and RectContainsLoc(bj_mapInitialPlayableArea,l) and not IsLocInFacility(l) then
//call PolledWait2(.15)
if UICancel[1+GetPlayerId(GetOwningPlayer(u))] and GetPlayerId(GetOwningPlayer(u))<11 then
call ForceUICancelBJ(GetOwningPlayer(u))
endif
set m.CLD=CLU-CLT
set m.count=1
set m.countmax=R2I(DistanceBetweenPoints(l,l2)/25.)
set m.s=IE
set m.u=GetTriggerUnit()
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call AttachSoundToUnit(m.s,u)
call SetSoundVolume(m.s,127)
call StartSound(m.s)
call SetUnitPathing(u,false)
call SetTimerStructA(t,m)
call TimerStart(t,.03,true,function Callback)
else
call IssueImmediateOrder(u,"holdposition")
call CS_Error(GetOwningPlayer(u),"Cannot jump there.")
call ResetUnitAnimation(u)
endif
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library LiftBoots initializer Init requires GlobalFuncs
//TRIG: --, Cond: MM, Func: qM
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A04O' and GetUnitTypeId(GetTriggerUnit())!='h00K' and GetUnitTypeId(GetTriggerUnit())!='h004'
endfunction
private struct Mov
unit u
integer count
integer countmax
real x
real y
real angle
sound s
endstruct
private function Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Mov m=GetTimerStructA(t)
local unit dummy
if m.count>m.countmax then
call UnitRemoveAbility(m.u,'A04P')
call UnitRemoveAbility(m.u,'A04Q')
call SetUnitPathing(m.u,true)
call SetUnitFlyHeight(m.u,.0,0)
call PauseUnit(m.u,false)
call StopSound(m.s,false,true)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call m.destroy()
if RectContainsUnit(An,m.u)then
call FieldChat(m.u,5.,GetPlayerName(GetOwningPlayer(m.u))+": Gross...")
endif
else
call SetUnitX(m.u, GetUnitX(m.u)+7.*Cos(m.angle*bj_DEGTORAD) )
call SetUnitY(m.u, GetUnitY(m.u)+7.*Sin(m.angle*bj_DEGTORAD) )
set m.count=m.count+1
if m.count > m.countmax and GetUnitAbilityLevel(m.u,'Ao4P')==0 then
call UnitRemoveAbility(m.u,'A04Q')
call UnitAddAbility(m.u,'A04P')
endif
if m.count<m.countmax/2 then
call SetUnitFlyHeight(m.u,(m.count*3),0)
else
call SetUnitFlyHeight(m.u,(m.countmax*3)-(m.count*3),0)
endif
endif
set dummy=null
set t=null
endfunction
private function Actions takes nothing returns nothing
local Mov m=Mov.create()
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local location l2=GetUnitLoc(u)
set m.angle=AngleBetweenPoints(l2,l)
set m.x=GetLocationX(l)
set m.y=GetLocationY(l)
if DistanceBetweenPoints(l,l2) >= 175 and IsTerrainPathableBJ(l,PATHING_TYPE_WALKABILITY)==false and GetUnitTypeId(u)!='h00K' and RectContainsLoc(bj_mapInitialPlayableArea,l) and RectContainsLoc(gg_rct_Facility1,l)==false and not IsLocInFacility(l) then
//call PolledWait2(.15)
set m.count=1
set m.countmax=R2I(DistanceBetweenPoints(l,l2)/7.)
set m.s=SOUND_OH_LARGE_BUILDING_FIRE_DefEAX
set m.u=GetTriggerUnit()
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call UnitAddAbility(u,'A04Q')
call AttachSoundToUnit(m.s,u)
call SetSoundVolume(m.s,127)
call StartSound(m.s)
call SetUnitPathing(u,false)
call PauseUnit(u,true)
call SetTimerStructA(t,m)
call TimerStart(t,.03,true,function Callback)
else
call IssueImmediateOrder(u,"holdposition")
if(GetUnitTypeId(u)=='h00K')then
call CS_Error(GetOwningPlayer(u),"Cannot use this item.")
else
call CS_Error(GetOwningPlayer(u),"Cannot use lift boots there.")
endif
call ResetUnitAnimation(u)
endif
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library OrbitalArtillery initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A07F')
endfunction
private function Actions takes nothing returns nothing
local unit u
local unit c = GetTriggerUnit()
local location t = GetSpellTargetLoc()
if SHELLS<5 then
//call IssueImmediateOrderById(GetTriggerUnit(),851972) unecessary, the spell itself is a dummy
call DisplayTimedTextToPlayer(GetOwningPlayer(c),0,0,5.,"Not enough shells.")
else
set SHELLS=(SHELLS-5)
call DisplayTimedTextToPlayer(GetOwningPlayer(c),0,0,5.,("Shells remaining: "+I2S(SHELLS)))
call RumbleCam(10.,4)
set u=CreateUnit(GetOwningPlayer(c), 'h003', GetUnitX(c), GetUnitY(c), 0)
call UnitAddAbility(u, 'A00X')
call SetUnitAbilityLevel(u, 'A00X', GetUnitAbilityLevel(c, GetSpellAbilityId()))
call IssuePointOrderLoc(u, "blizzard", t)
call UnitApplyTimedLife(u,'BTLF',6)
call DeafenPlayersInDistanceOfLoc(t,1000)
call USMCRunFromExplosion(GetLocationX(t),GetLocationY(t),800)
call PlaySoundBJ(gg_snd_ArtilleryDist1)
call PolledWait2(1)
call DeafenPlayersInDistanceOfLoc(t,1000)
call PlaySoundBJ(gg_snd_ArtilleryDist2)
call PolledWait2(1)
call DeafenPlayersInDistanceOfLoc(t,1000)
call PlaySoundBJ(gg_snd_ArtilleryDist3)
call PolledWait2(1)
call DeafenPlayersInDistanceOfLoc(t,1000)
call PlaySoundBJ(gg_snd_ArtilleryDist4)
endif
set u=null
call RemoveLocation(t)
set t=null
set c=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=46
//TESH.alwaysfold=0
library ParalysisTrap initializer Init requires GlobalFuncs
//TRIG: --, Cond: Np, Func: --
private function Conditions takes nothing returns boolean
local unit u=GetDyingUnit()
local boolean b=GetUnitTypeId(u)=='o001'
set u=null
return b
endfunction
private struct Smash
unit u
real angle
integer i
endstruct
private function Knockback_Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Smash s=GetTimerStructA(t)
set s.i=s.i+1
if s.i>50 then
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call s.destroy()
else
call SetUnitX(s.u,GetUnitX(s.u)+(10-(s.i/5))*Cos(s.angle*bj_DEGTORAD) )
call SetUnitY(s.u,GetUnitY(s.u)+(10-(s.i/5))*Sin(s.angle*bj_DEGTORAD) )
endif
set t=null
endfunction
private function Knockback takes nothing returns nothing
local Smash s=Smash.create()
local timer t=CreateTimer()
local unit u=bj_lastCreatedUnit
set s.u=GetEnumUnit()
set s.i=1
set s.angle=AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(s.u),GetUnitY(s.u))
call SetTimerStructA(t,s)
call TimerStart(t,.04,true,function Knockback_Callback)
set u=null
endfunction
private function GroupCond takes nothing returns boolean
return GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>.0 and IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false
endfunction
private function Actions takes nothing returns nothing
local unit u=GetDyingUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local unit dummy=CreateUnit(GetOwningPlayer(u),'h003',x,y,.0)
local group g=CreateGroup()
local boolexpr filter=Condition(function GroupCond)
call SetUnitAnimation(u,"death alternate")
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",x,y))
call UnitAddAbility(dummy,'A02S')
call UnitApplyTimedLifeBJ(5.,'BTLF',dummy)
call IssuePointOrder(dummy,"clusterrockets",x,y)
set bj_lastCreatedUnit=u
call GroupEnumUnitsInRange(g,x,y,450,filter)
call ForGroup(g,function Knockback)
set u=null
set dummy=null
call DestroyBoolExpr(filter)
call DestroyGroup(g)
set g=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library RapidFire initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
private function Conditions takes nothing returns boolean
local integer i=GetSpellAbilityId()
return i=='A00K' or i=='A02W' or i=='A05M'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer i=GetSpellAbilityId()
local real lvl=I2R(GetUnitAbilityLevel(u,i))
if i=='A00K' then
call ForceRemovePlayer(FIREMODE_BURST,GetOwningPlayer(u))
set BURST_ROUNDS[GetPlayerId(GetOwningPlayer(u))+1]=0
endif
call PolledWait2(.2)
call IssueImmediateOrder(u,"holdposition")
if i=='A00K' then
call PolledWait2(5.5+lvl*.5)
call ForceAddPlayer(FIREMODE_BURST,GetOwningPlayer(u))
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=66
//TESH.alwaysfold=0
library Reinforcements initializer Init requires GlobalFuncs
//TRIG: II, Cond: OP, Func: IP
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A01Z'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real x1
local real y1
local unit array r
local integer i=1
local integer i2=1
local integer delay=GetRandomInt(5, 15)
call Transmission(10.,"|cff808000Assault Trooper:|r ETA "+I2S(delay)+" seconds, standby...")
call PolledWait2(delay)
set x=GetUnitX(u)
set y=GetUnitY(u)
loop
exitwhen i>3
set r[i]=CreateUnit(P_USMC,'h009',x+GetRandomReal(-250.,250),y+GetRandomReal(-250.,250),GetRandomReal(0,360))
call UnitAddAbility(r[i],'Amrf')
call UnitRemoveAbility(r[i],'Amrf')
call UnitAddAbility(r[i],'A04P')
call SetUnitFlyHeight(r[i],1200,0)
call PauseUnit(r[i],true)
call ChanceAutomaticFiringBonus(r[i],3)
call ChanceFlashLight(r[i],3)
if GAME_MODE != UA2_ModeUmbrella then
call ChanceFragGrenade(r[i],3)
endif
call GroupAddUnit(RifleButters,r[i])
call PolledWait2(.2)
call SetUnitFlyHeight(r[i],0,300)
set i=i+1
endloop
call PolledWait2(4.)
call UnitRemoveAbility(r[1],'A04P')
call UnitRemoveAbility(r[2],'A04P')
call UnitRemoveAbility(r[3],'A04P')
call PauseUnit(r[1],false)
call PauseUnit(r[2],false)
call PauseUnit(r[3],false)
set i=1
loop
exitwhen i>600
set i2=1
loop
exitwhen i2>3
set x1=GetUnitX(r[i2])
set y1=GetUnitY(r[i2])
set x=GetUnitX(u)
set y=GetUnitY(u)
if DistanceBetweenPointsXY(x1,y1,x,y)>150 and IsUnitAliveBJ(r[i2]) then
if DistanceBetweenPointsXY(x1,y1,x,y)>250 then
call IssuePointOrder(r[i2],"move",x+GetRandomReal(-50,50),y+GetRandomReal(-50,50))
else
call IssuePointOrder(r[i2],"attack",x+GetRandomReal(-50,50),y+GetRandomReal(-50,50))
endif
elseif IsUnitAliveBJ(r[i2]) then
call IssueImmediateOrder(r[i2], "holdposition")
endif
if GetOwningPlayer(r[i2])!=P_USMC then
call SetUnitOwner(r[i2],P_USMC,true)
endif
set i2=i2+1
endloop
set i=i+1
call PolledWait2(.5)
endloop
set i=1
loop
exitwhen i>3
call UnitAddAbility(r[i],'A04P')
call SetUnitFlyHeight(r[i],1200,300)
call PauseUnit(r[i],true)
set i=i+1
endloop
call PolledWait2(4.)
call RemoveUnit(r[1])
call RemoveUnit(r[2])
call RemoveUnit(r[3])
set u=null
set r[1]=null
set r[2]=null
set r[3]=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SurveillanceRadar initializer Init requires GlobalFuncs
//TRIG: BI, Cond: wP, Func: ZP
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A02D')
endfunction
private function PingGroup takes nothing returns nothing
set LOCALIZABLE_LOC=GetUnitLoc(GetEnumUnit())
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,5.,0,100,15.,15.)
call RemoveLocation(LOCALIZABLE_LOC)
endfunction
private function Actions takes nothing returns nothing
local location l=GetUnitLoc(GetTriggerUnit())
local group g=GetUnitsInRangeOfLocMatching(8000.,l,Condition(function IsTargetBigEnemyMofo))
call ForGroupBJ(g,function PingGroup)
call RemoveLocation(l)
set l=null
call DestroyGroup(g)
set g=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=66
//TESH.alwaysfold=0
library WhitePhosphorous initializer Init requires GlobalFuncs, GlobalFuncs2
//TRIG: DI, Cond: Iq, Func: Aq
globals
public trigger T
private unit A_caller
private unit A_fighter
private location A_target
endglobals
function WPTarget takes nothing returns nothing
local unit caller=A_caller
local unit fighter=A_fighter
local location targ=A_target
local real x=GetLocationX(targ)
local real y=GetLocationY(targ)
local real ux=GetUnitX(fighter)
local real uy=GetUnitY(fighter)
local real angle=AngleBetweenPointsXY(x,y,ux,uy)
local unit dummy
local unit WPdummy
local integer flyby=GetRandomInt(1,3)
set dummy=CreateUnit(P_USMC, 'h00L', ux, uy, angle)
call UnitApplyTimedLife(dummy,'BTLF',5)
call UnitAddAbility(dummy,'A00F')
call SetUnitFlyHeight(dummy,700.,0)
call IssuePointOrder(dummy,"clusterrockets",x, y)
call PolledWait2(.8)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cff804000Pilot:|r Impact!")
call StartSound(gg_snd_WPDist)
set WPdummy=CreateUnit(GetOwningPlayer(caller), 'h01F', x, y, 0)
call UnitApplyTimedLife(WPdummy,'BTLF',40)
call DamageDestructables(x,y,900,200)
call UnitDamagePoint(caller,0,900.,x,y,200.,true, false, ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DeafenPlayersInDistanceOfLoc(targ,900)
call RumbleCam(1.5,1)
call PolledWait2(2.)
call AttachSoundToUnit(SOUND_FLYBY[flyby], fighter)
call StartSound(SOUND_FLYBY[flyby])
set WPdummy=null
set dummy=null
set caller=null
set fighter=null
call RemoveLocation(targ)
set targ=null
endfunction
private struct FighterMove
unit fighter
unit caller
real x
real y
real angle
boolean delivered
boolean close
real count
method Move takes nothing returns nothing
local real ux=GetUnitX(.fighter)
local real uy=GetUnitY(.fighter)
local real nx=ux + 40 * Cos(.angle * bj_DEGTORAD)
local real ny=uy + 40 * Sin(.angle * bj_DEGTORAD)
call SetUnitX(.fighter, nx)
call SetUnitY(.fighter, ny)
endmethod
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local FighterMove f = GetTimerStructA(t)
local real ux=GetUnitX(f.fighter)
local real uy=GetUnitY(f.fighter)
local integer flyby=GetRandomInt(1,3)
if ux < 15500 then
call f.Move()
endif
if f.close==false and DistanceBetweenPointsXY(ux, uy, f.x, f.y) <= 4000 then //start sound
set f.close=true
call AttachSoundToUnit(SOUND_FLYBY[flyby], f.fighter)
call StartSound(SOUND_FLYBY[flyby])
endif
if f.delivered==false and DistanceBetweenPointsXY(ux, uy, f.x, f.y) <= 1200 then //fire
set f.delivered=true
set A_caller=f.caller
set A_fighter=f.fighter
set A_target=Location(f.x,f.y)
call ExecuteFunc("WPTarget")
set f.count=0
elseif f.delivered==true then //constant damage while there's WP for 40 seconds
set f.count=f.count+1
if f.count*.03 > .8 and f.count*.03 < 40 then
call UnitDamagePoint(f.caller,0,700.,f.x,f.y,80*.03,true, false, ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endif
endif
if ux >= 15000 then //remove
call RemoveUnit(f.fighter)
endif
if f.count*.03 >= 40 then
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call f.destroy()
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local FighterMove f = FighterMove.create()
local timer t = CreateTimer()
local location l=GetSpellTargetLoc()
local real x=-15500 //GetLocationX(l)-GetRandomReal(7000,8000)
local real y=GetLocationY(l)-GetRandomReal(-500,500)
local unit u=GetTriggerUnit()
local unit fighter
local unit dummy
set SHELLS=SHELLS-6
set f.x=GetLocationX(l)
set f.y=GetLocationY(l)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(("|cff804000"+GetPlayerName(GetTriggerPlayer()))+": WP inbound!"))
call StartSound(gg_snd_InformAirstrike)
call PingMinimapForForceEx(bj_FORCE_ALL_PLAYERS,f.x,f.y,5.,2,100,30.,30.)
set f.caller=GetTriggerUnit()
set f.delivered=false
set f.close=false
set f.angle=AngleBetweenPointsXY(x,y,f.x,f.y)
set f.fighter=CreateUnit(P_USMC, 'h00O', x, y, f.angle)
call UnitShareVision(f.fighter,GetOwningPlayer(u),true)
set dummy=CreateUnit(GetOwningPlayer(f.caller), 'h00S', f.x, f.y, f.angle) //vision dummy
call UnitApplyTimedLife(dummy,'BTLF',30)
call SetTimerStructA(t,f)
call TimerStart(t,.03,true,function Callback)
set u=null
call RemoveLocation(l)
set l=null
endfunction
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A066' and SHELLS>=6
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=18
//TESH.alwaysfold=0
library GroundFlare initializer Init requires GlobalFuncs
//TRIG: tR, Cond: bM, Func: cM
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A04E'
endfunction
private function Actions takes nothing returns nothing
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
local unit u=GetTriggerUnit()
local player p=GetOwningPlayer(u)
local unit fl
local unit dummy
call GroupAddUnit(NADING,u)
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),x,y)<=1400. and GetRandomInt(1,8)!=1 then
set x=x+GetRandomReal(-75,75)
set y=y+GetRandomReal(-75,75)
else
set x=x+GetRandomReal(-125,125)
set y=y+GetRandomReal(-125,125)
endif
call FieldChat(u,6,GetColorPlayerName(p)+": Flare!")
call PolledWait2(.4)
call PlaySoundAtUnitLoc(gg_snd_pinpull,u)
set dummy= CreateUnit(p,'h00Z',GetUnitX(u),GetUnitY(u),GetRandomDirectionDeg())
call UnitApplyTimedLifeBJ(3.,'BTLF',dummy)
call IssuePointOrder(dummy,"attackground",x,y)
// call Ph(l) no longer run from flares
call PolledWait2(1.5)
call GroupRemoveUnit(NADING,u)
call PolledWait2(1)
set fl=CreateUnit(p,'o005',x,y,GetRandomDirectionDeg())
call VisionUnit(fl,true)
if RAINING then
call UnitApplyTimedLifeBJ(UA2_GroundFlareDurRain,'BTLF',fl)
call SetUnitScalePercent(fl,140.,140.,180.)
call SetUnitTimeScalePercent(fl,150.)
else
call UnitApplyTimedLifeBJ(UA2_GroundFlareDur,'BTLF',fl)
endif
call PlaySoundAtUnitLoc(VE,fl)
set u=null
set fl=null
set dummy=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SentryGun initializer Init requires GlobalFuncs
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A07A' or GetSpellAbilityId() == 'A07V'
endfunction
private function Actions takes nothing returns nothing
local location l = GetSpellTargetLoc()
local unit u
if GetSpellAbilityId() == 'A07V' then
set bj_lastCreatedUnit = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h01T', l, GetUnitFacing(GetTriggerUnit()))
else
set bj_lastCreatedUnit = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h004', l, GetUnitFacing(GetTriggerUnit()))
endif
set u = bj_lastCreatedUnit
call PauseUnit(u, true)
call SetUnitAnimation(u, "birth")
call PolledWait2(.66)
call PauseUnit(u, false)
call SetUnitAnimation(u, "stand")
call RemoveLocation(l)
set l = null
set u = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library SentryGunReload initializer Init requires GlobalFuncs
//TRIG: lI, Cond: IQ, Func: bQ
private function Conditions takes nothing returns boolean
return GetUnitTypeId(GetManipulatingUnit())=='h004'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local item i=GetManipulatedItem()
local integer c=GetItemCharges(i)
local real m=GetUnitState(u,UNIT_STATE_MANA)
local real dif=GetUnitState(u,UNIT_STATE_MAX_MANA)-m
if GetItemTypeId(i)=='I000' or GetItemTypeId(i)=='I00S' then
call SetUnitManaBJ(u,m + I2R(c*200) )
if dif/200 > 1.25 and dif/200 < 2 then
call SetItemCharges(i, c-((R2I(dif)/200)+1))
else
call SetItemCharges(i, c-(R2I(dif)/200))
endif
call PlaySoundOnUnitBJ(gg_snd_Bulletchain,100,u)
if GetItemCharges(i) >= 1 then
call UnitRemoveItem(u, i)
call SetItemPosition(i, GetUnitX(u)+50, GetUnitY(u)-50)
else
call RemoveItem(i)
endif
else
call UnitRemoveItem(u, i)
call SetItemPosition(i, GetUnitX(u)+50, GetUnitY(u)-50)
endif
set u=null
set i=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Mk19Reload initializer Init requires GlobalFuncs
//TRIG: lI, Cond: IQ, Func: bQ
private function Conditions takes nothing returns boolean
return GetUnitTypeId(GetManipulatingUnit())=='h01T'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local item i=GetManipulatedItem()
local integer c=GetItemCharges(i)
local real m=GetUnitState(u,UNIT_STATE_MANA)
local real dif=GetUnitState(u,UNIT_STATE_MAX_MANA)-m
if GetItemTypeId(i)=='I000' or GetItemTypeId(i)=='I00S' then
call SetUnitManaBJ(u,m + I2R(c*45) )
if dif/45 > 1.25 and dif/45 < 2 then
call SetItemCharges(i, c-((R2I(dif)/45)+1))
else
call SetItemCharges(i, c-(R2I(dif)/45))
endif
call PlaySoundOnUnitBJ(gg_snd_Bulletchain,100,u)
if GetItemCharges(i) >= 1 then
call UnitRemoveItem(u, i)
call SetItemPosition(i, GetUnitX(u)+50, GetUnitY(u)-50)
else
call RemoveItem(i)
endif
else
call UnitRemoveItem(u, i)
call SetItemPosition(i, GetUnitX(u)+50, GetUnitY(u)-50)
endif
set u=null
set i=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library m42a6 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
integer array RifleItems
integer RifleItemsCnt
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I015'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if RifleCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 rifle.")
call UnitRemoveItem(u,it)
elseif uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H011' or IsUnitMiniRifle(u) then
call UnitAddAbility(u,'A083')
call UnitAddAbility(u,'A084')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]-1
set JAM_MOD[pid]=JAM_MOD[pid]+.2
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a rifle MOS can use the M42a6.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=1
//TESH.alwaysfold=0
library SCAR initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I019'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if RifleCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 rifle.")
call UnitRemoveItem(u,it)
elseif uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H011' or IsUnitMiniRifle(u) then
call UnitAddAbility(u,'A089')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]-2
set JAM_MOD[pid]=JAM_MOD[pid]+.5
endif
if IsPlayerInForce(p,FIREMODE_AUTO) then
call DisplayTimedTextToPlayer(p,0,0,8,"Now on single-shot.")
call PlaySoundOnUnitBJ(NX,100,u)
call UnitRemoveAbility(u,'A04H')
call UnitRemoveAbility(u,'A04I')
call UnitRemoveAbility(u,'A034')
call UnitRemoveAbility(u,'A042')
call ForceRemovePlayer(FIREMODE_AUTO,p)
call ForceAddPlayer(FIREMODE_SINGLE,p)
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a rifle MOS can use the SCAR.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=1
//TESH.alwaysfold=0
library MAR initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I008'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if RifleCheck(u,GetItemTypeId(it)) or CountItemsOfType(u,'I012')>0 then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 rifle or GL/MAR.")
call UnitRemoveItem(u,it)
elseif uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H011' or IsUnitMiniRifle(u) then
call UnitRemoveAbility(u,'A002')
call UnitAddAbility(u,'A04Y')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]-1
set JAM_MOD[pid]=JAM_MOD[pid]+.35
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a rifle MOS can use the MAR.")
call UnitRemoveItem(u,it)
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=15
//TESH.alwaysfold=0
library PTR5 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I00L'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
if RifleCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(p,0,0,5,"Can only carry 1 rifle.")
call UnitRemoveItem(u,it)
elseif uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H011' or IsUnitMiniRifle(u) then
call UnitAddAbility(u,'A03V')
call UnitAddAbility(u,'A03X')
elseif uid=='H00H' then
call UnitAddAbility(u,'A03U')
call UnitAddAbility(u,'A03W')
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only the DM or a rifle MOS can use the PTR-5.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
library mp12a2 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I01A'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if SMGCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 SMG.")
call UnitRemoveItem(u,it)
elseif uid=='H01I' or uid=='H008' then
call UnitAddAbility(u,'A08E')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]-1
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a SMG MOS can use the MP12a2.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library m3a2 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I017'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if CountItemsOfType(u,'I017')>1 then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 flamethrower.")
call UnitRemoveItem(u,it)
endif
if uid=='H00U' or uid==NID_Flamethrower then
call UnitAddAbility(u,'A086')
if IsUnitType(u,UNIT_TYPE_HERO) then
set JAM_MOD[pid]=JAM_MOD[pid]+.15
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a flamethrower MOS can use the M3a2.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=22
//TESH.alwaysfold=0
library m258LMG initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
integer array MGItems
integer MGItemsCnt
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I01B'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if MGCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 machine gun.")
call UnitRemoveItem(u,it)
elseif uid=='H001' or uid=='H00P' or uid=='h00E' then
call UnitAddAbility(u,'A08F')
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]+10
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a machine gun MOS can use the M258 LMG.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library m260MMG initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I01C'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if MGCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 machine gun.")
call UnitRemoveItem(u,it)
elseif uid=='H001' or uid=='H00P' or uid=='h00E' then
call UnitAddAbility(u,'A08G')
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]+5
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a machine gun MOS can use the M260 MMG.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
library g89 initializer Init requires GlobalFuncs
//TRIG: oA, Cond: kS, Func: LS
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I00G'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if MGCheck(u,GetItemTypeId(it)) then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Can only carry 1 machine gun.")
call UnitRemoveItem(u,it)
elseif uid=='H001' or uid=='H00P' or uid=='h00E' then
call UnitRemoveAbility(u,'A00J') // normal MG
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]-10
endif
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only a machine gun MOS can use the G89.")
call UnitRemoveItem(u,it)
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library ExtendedMags initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: OT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I018'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
local integer pid=GetPlayerId(p)+1
if CountItemsOfType(u,'I018')>1 then
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,5,"Extended mags do not stack.")
elseif IsUnitType(u,UNIT_TYPE_HERO) and uid!='H00U' and uid!='h00K' and uid!='H00N' and uid!='H00J' and uid!='H00I' and uid!='H00R' and uid!='h001' and uid!='h00P' then
set MAG_SIZE[pid]=R2I(I2R(MAG_SIZE[pid])*1.2)
else
call DisplayTimedTextToPlayer(p,0,0,5,"Only rifles and SMGs can use extended mags.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=10
//TESH.alwaysfold=0
library DURounds initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local item i=GetManipulatedItem()
local boolean b=GetItemTypeId(i)=='I016'
set i=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local player p=GetOwningPlayer(u)
local integer uid=GetUnitTypeId(u)
local item it=GetManipulatedItem()
if IsUnitMiniRifle(u) or uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H00H' or uid=='H008' or uid=='H01I' or uid=='H00P' or uid=='H001' or uid=='H011' then
else
call UnitRemoveItem(u,it)
call DisplayTimedTextToPlayer(p,0,0,5,"Only a bullet-firing MOS can use DU rounds.")
endif
set it=null
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library DropItem initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local unit u=GetManipulatingUnit()
local item it=GetManipulatedItem()
local integer iid=GetItemTypeId(it)
local integer pid=GetPlayerId(GetOwningPlayer(u))+1
local integer uid=GetUnitTypeId(u)
if iid=='I015' and GetUnitAbilityLevel(u,'A083')>=1 and CountItemsOfType(u,'I015')==1 then
call UnitRemoveAbility(u,'A083')
call UnitRemoveAbility(u,'A084')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]+1
set JAM_MOD[pid]=JAM_MOD[pid]-.2
endif
elseif iid=='I00G' and CountItemsOfType(u,'I00G')==1 then
call UnitAddAbility(u,'A00J') // normal MG
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]+10
endif
elseif iid=='I01C' and GetUnitAbilityLevel(u,'A08G')>=1 and CountItemsOfType(u,'I01C')==1 then
call UnitRemoveAbility(u,'A08G')
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]-5
endif
elseif iid=='I01B' and GetUnitAbilityLevel(u,'A08F')>=1 and CountItemsOfType(u,'I01B')==1 then
call UnitRemoveAbility(u,'A08F')
if IsUnitType(u,UNIT_TYPE_HERO) then
set MS_MOD[pid]=MS_MOD[pid]-10
endif
elseif iid=='I01A' and GetUnitAbilityLevel(u,'A08E')>=1 and CountItemsOfType(u,'I01A')==1 then
call UnitRemoveAbility(u,'A08E')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]+1
endif
elseif iid=='I019' and GetUnitAbilityLevel(u,'A089')>=1 and CountItemsOfType(u,'I019')==1 then
call UnitRemoveAbility(u,'A089')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]+2
set JAM_MOD[pid]=JAM_MOD[pid]-.5
endif
elseif iid=='I00L' and CountItemsOfType(u,'I00L')==1 then
call UnitRemoveAbility(u,'A03V')
call UnitRemoveAbility(u,'A03X')
call UnitRemoveAbility(u,'A03U')
call UnitRemoveAbility(u,'A03W')
elseif iid=='I002' and CountItemsOfType(u,'I002')==1 then
call UnitRemoveAbility(u,'A03L')
call UnitRemoveAbility(u,'A003')
call UnitRemoveAbility(u,'A03M')
elseif iid=='I008' and CountItemsOfType(u,'I008')==1 and (uid=='H000' or uid=='H00C' or uid=='H00D' or uid=='H011') then
call UnitRemoveAbility(u,'A04Y')
call UnitAddAbility(u,'A002')
if IsUnitType(u,UNIT_TYPE_HERO) then
set DWS_MOD[pid]=DWS_MOD[pid]+1
set JAM_MOD[pid]=JAM_MOD[pid]-.35
endif
elseif iid=='I017' and GetUnitAbilityLevel(u,'A086')>=1 and CountItemsOfType(u,'I017')==1 then
call UnitRemoveAbility(u,'A086')
if IsUnitType(u,UNIT_TYPE_HERO) then
set JAM_MOD[pid]=JAM_MOD[pid]-.15
endif
elseif iid=='I016' and CountItemsOfType(u,'I016')==1 then
call UnitRemoveAbility(u,'B01M')
elseif iid=='I018' and CountItemsOfType(u,'I018')==1 and IsUnitType(u,UNIT_TYPE_HERO) and uid!='H00U' and uid!='H00N' and uid!='H00J' and uid!='H00I' and uid!='H00R' and uid!='h001' and uid!='h00P' then
set MAG_SIZE[pid]=MAG_SIZE_STAND[pid]
if MAG_SIZE[pid]<0 then
set MAG_SIZE[pid]=0
endif
endif
set it=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DROP_ITEM)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library AmmoUsage initializer Init requires GlobalFuncs
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer index=1+GetPlayerId(p)
if IsUnitType(u,UNIT_TYPE_HERO) and CURRENT_AMMO[index]>0 and GetPlayerController(p)==MAP_CONTROL_USER and not IsPlayerInForce(p,PLAYER_JAMMED) and not IsPlayerInForce(p,BURST_WAIT) and not IS_LINKING_BELTS[index] and not IsUnitInGroup(u,SAFETY) and not IsUnitInGroup(u,NADING) then
set CURRENT_AMMO[index]=CURRENT_AMMO[index]-1
if IsPlayerInForce(p,FIREMODE_BURST) then
set BURST_ROUNDS[index]=BURST_ROUNDS[index]+1
endif
if CURRENT_AMMO[index] == R2I(I2R(MAG_SIZE[index])*.15) then
call PlaySoundForPlayer(p,gg_snd_lowammo)
endif
endif
if GetUnitTypeId(u)=='H00U' and GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)>0 and GetPlayerController(p)==MAP_CONTROL_USER and GetRandomInt(1,100*R2I(JAM_MOD[index]))<=33 then
call SetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)-1)
endif
set u=null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library AmmoUsageMini initializer Init requires GlobalFuncs
//TRIG: kI, Cond: --, Func: VQ
private function Actions takes nothing returns nothing
local effect e
local integer i
local unit u=GetAttacker()
local integer ID=GetUnitTypeId(u)
if IsUnitInGroup(u,RELOADING)==false and GetUnitStateSwap(UNIT_STATE_MANA,u)==0 and (ID==NID_IUL or ID==NID_Sniper or ID==NID_SniperBlind or ID==NID_SpotterBlind or ID==NID_Rifleman or ID==NID_MachineGunner or ID==NID_Pilot or ID==NID_PoliceRifle or ID==NID_NavyCorpsman or ID==NID_CombatEngineer or ID==NID_Ghost or ID==NID_Assaultman or ID==NID_DesignatedMarksman) then
call GroupAddUnit(RELOADING,u)
set e=AddSpecialEffectTargetUnitBJ("overhead",u,"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
call SetUnitManaPercentBJ(u,.0)
call PlaySoundOnUnitBJ(gg_snd_Magout,100,u)
call CreateTextTagUnitBJ((("|cff804000"+GetUnitName(u))+":|r Reloading!"),u,0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
call TriggerSleepAction(4.)
call PlaySoundOnUnitBJ(gg_snd_Magin,100,u)
call TriggerSleepAction(1.)
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,u)
call TriggerSleepAction(.3)
call DestroyEffect(e)
call GroupRemoveUnit(RELOADING,u)
call SetUnitManaPercentBJ(u,100.)
endif
if IsUnitInGroup(u,RELOADING)==false and GetUnitState(u,UNIT_STATE_MANA)==0 and ID==NID_PoliceShotgun then
call GroupAddUnit(RELOADING,u)
set e=AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl",u,"overhead")
call SetUnitManaPercentBJ(u,.0)
call CreateTextTagUnitBJ((("|cff804000"+GetUnitName(u))+":|r Reloading!"),u,0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
set i=1
loop
exitwhen i>8
if IsUnitAliveBJ(u) then
call PlaySoundOnUnitBJ(SOUND_INSERTSHELL[GetRandomInt(1,3)],100,u)
endif
call SetUnitManaBJ(u,(GetUnitStateSwap(UNIT_STATE_MANA,u)+1))
call PolledWait2(.3)
set i=i+1
endloop
call TriggerSleepAction(.6)
if IsUnitAliveBJ(u) then
call PlaySoundOnUnitBJ(gg_snd_Shotgun_Cock,100,u)
endif
call DestroyEffect(e)
call PolledWait2(.5)
call GroupRemoveUnit(RELOADING,u)
call SetUnitManaBJ(u,8.)
endif
if (GetUnitStateSwap(UNIT_STATE_MANA,u)==0 or IsUnitInGroup(u,RELOADING) or IsUnitInGroup(u,NADING)) and (ID==NID_PoliceShotgun or ID==NID_Sniper or ID==NID_SniperBlind or ID==NID_SpotterBlind or ID==NID_IUL or ID==NID_Rifleman or ID==NID_Flamethrower or ID==NID_MachineGunner or ID==NID_SentryGun or ID==NID_Mk19 or ID==NID_Pilot or ID==NID_PoliceRifle or ID==NID_CombatEngineer or ID==NID_NavyCorpsman or ID==NID_Ghost or ID==NID_Assaultman or ID==NID_DesignatedMarksman or ID==NID_GlobalHawk) then
call IssueImmediateOrder(u,"stop")
call IssueImmediateOrder(u,"holdposition")
endif
if (GetUnitStateSwap(UNIT_STATE_MANA,u)>=1.) and IsUnitInGroup(u,RELOADING)==false and IsUnitInGroup(u,SAFETY)==false and (ID==NID_PoliceShotgun or ID==NID_Sniper or ID==NID_SniperBlind or ID==NID_SpotterBlind or ID==NID_IUL or ID==NID_Rifleman or ID==NID_MachineGunner or ID==NID_SentryGun or ID==NID_Mk19 or ID==NID_Pilot or ID==NID_CombatEngineer or ID==NID_PoliceRifle or ID==NID_NavyCorpsman or ID==NID_Flamethrower or ID==NID_Ghost or ID==NID_Assaultman or ID==NID_DesignatedMarksman or ID==NID_GlobalHawk) then
call SetUnitManaBJ(u,(GetUnitState(u,UNIT_STATE_MANA)-1))
endif
set u=null
set e=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library AutoReload initializer Init requires GlobalFuncs
//TRIG: wI, Cond: ws, Func: oS
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local boolean b
local unit u=GetAttacker()
local integer index=1+GetPlayerId(GetOwningPlayer(u))
set b=CURRENT_AMMO[index]==0 and IsUnitType(u,UNIT_TYPE_HERO) and (IS_LINKING_BELTS[index]==false)and(PLAYER_UNIT[index]==u)and(GetUnitTypeId(u)!='H00U')
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local effect e
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer pid=1+GetPlayerId(p)
local integer typeid=GetUnitTypeId(u)
local integer ldrshplvl=GetUnitAbilityLevel(u,LDRSHP)
local boolean b=typeid != 'H00I'
if IsUnitInGroup(u,RELOADING)==false and GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER) > (0+GetUnitAbilityLevel(u,'A05B')) then
set IS_LINKING_BELTS[pid]=true
call GroupAddUnit(RELOADING,u)
set e=AddSpecialEffectTargetUnitBJ("overhead",u,"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set CURRENT_AMMO[pid]=0
call AdjustPlayerStateBJ((-1-GetUnitAbilityLevel(u,'A05B')),p,PLAYER_STATE_RESOURCE_LUMBER)
if b then
call PlaySoundOnUnitBJ(gg_snd_Magout,100,u)
endif
call CreateTextTagUnitBJ("|cff804000"+GetPlayerName(p)+":|r Reloading!",u,0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
if typeid=='H001' or typeid=='H00P' then
call PolledWait2(((6.-(I2R(GetUnitAbilityLevel(u,AITMG))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H00I' then
call PlaySoundOnUnitBJ(gg_snd_PlasmaRifleReload,100,u)
call PolledWait2(3.5)
endif
if typeid=='H00H' then
call PolledWait2(((5.-(I2R(GetUnitAbilityLevel(u,AITDM))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H000' or typeid=='H01I' or typeid=='H011' or typeid=='H00C' or typeid=='H00D' or typeid=='H00N' then
call PolledWait2(((4.-(I2R(GetUnitAbilityLevel(u,BCT))*.6))*(1-(.05*I2R(ldrshplvl)))))
endif
if typeid=='H008' or typeid=='H00J' then
call PolledWait2((2.*(1-(.05*I2R(ldrshplvl)))))
endif
if b then
call PlaySoundOnUnitBJ(gg_snd_Magin,100,u)
endif
call PolledWait2(1.)
if b then
call PlaySoundAtUnitLoc(gg_snd_Boltpull,u)
call PolledWait2(.5)
endif
call ForceRemovePlayer(PLAYER_JAMMED,p)
call GroupRemoveUnit(RELOADING,u)
set CURRENT_AMMO[pid]=MAG_SIZE[pid]
call DestroyEffect(e)
set IS_LINKING_BELTS[pid]=false
else
if MSG_Empty[pid]==false then
call DisplayTimedTextToPlayer(p,0,0,1.5,"Out of magazines.")
set MSG_Empty[pid]=true
call PolledWait2(4)
set MSG_Empty[pid]=false
endif
endif
set e=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=84
//TESH.alwaysfold=0
library BFG initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger C
public trigger F
private unit TempChecker
endglobals
private struct Force
real angle
real charge=0
real at=0 // audio time
real tt=0 //travel time
unit u //caster
unit blast //the big blasty thing
sound flyloop
integer level
endstruct
private function DestroyLightningDelay takes lightning ltng returns nothing
call PolledWait2(.03)
call DestroyLightning(ltng)
set ltng=null
endfunction
private function BlastFilter takes nothing returns boolean
local unit u=GetFilterUnit()
local boolean b=IsPlayerEnemy(GetOwningPlayer(u),GetOwningPlayer(TempChecker)) and IsUnitAliveBJ(u)
set u=null
return b
endfunction
private function Asplode takes unit u, real charge, integer level returns nothing
call PlaySoundOnUnitBJ(gg_snd_bfg_explode1,100,u)
call UnitDamagePoint(u,0,100,GetUnitX(u),GetUnitY(u),650*charge+30*level,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call UnitDamagePoint(u,0,200,GetUnitX(u),GetUnitY(u),150*charge,true,false,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call KillUnit(u)
call StopSound(gg_snd_bfg_fly_loop,false,false)
endfunction
private function ForceLoop takes nothing returns nothing
local timer t=GetExpiredTimer()
local Force f=GetTimerStructA(t)
local integer pid=GetPlayerId(GetOwningPlayer(f.u))+1
//local location l=GetUnitLoc(f.u)
local real x
local real y
local group g=CreateGroup()
local unit hit
local integer theight=GetTerrainCliffLevel(GetUnitX(f.blast),GetUnitY(f.blast))
set f.tt=f.tt+1
set x = GetUnitX(f.blast) + 18 * Cos(f.angle * bj_DEGTORAD)
set y = GetUnitY(f.blast) + 18 * Sin(f.angle * bj_DEGTORAD)
call SetUnitX(f.blast,x)
call SetUnitY(f.blast,y)
set TempChecker=f.u
call GroupEnumUnitsInRange(g,GetUnitX(f.blast),GetUnitY(f.blast),80,Condition(function BlastFilter))
if CountUnitsInGroup(g)>=1 then //asplode!!!
call Asplode(f.blast,f.charge,f.level)
call PauseTimer(t)
call ClearTimerStructA(t)
call f.destroy()
call DestroyTimer(t)
endif
call GroupClear(g)
call GroupEnumUnitsInRange(g,GetUnitX(f.blast),GetUnitY(f.blast),300,Condition(function BlastFilter))
loop
set hit=FirstOfGroup(g)
exitwhen hit==null
call SetUnitLifeBJ(hit,GetUnitState(hit,UNIT_STATE_LIFE)-14+(f.charge*2)+(f.level))
call PlaySoundOnUnitBJ(gg_snd_BFGShock,100,hit)
call DestroyLightningDelay.execute(AddLightningEx("DRAL",true,x,y,100,GetUnitX(hit),GetUnitY(hit),GetUnitFlyHeight(f.blast) + 50*theight ))
call GroupRemoveUnit(g,hit)
endloop
set f.at=f.at+1
if f.at==50 then
set f.at=0
call StopSound(gg_snd_bfg_fly_loop,false,false)
call PlaySoundOnUnitBJ(gg_snd_bfg_fly_loop,100,f.blast)
endif
if f.tt>(2200+100*f.level)/18 then //max distance
call Asplode(f.blast,f.charge,f.level)
call PauseTimer(t)
call ClearTimerStructA(t)
call f.destroy()
call DestroyTimer(t)
endif
call DestroyGroup(g)
set t=null
set hit=null
endfunction
private function Charge_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A07S'
endfunction
private function Charge_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local real i=0
local real charge=BFG_Charge[GetPlayerId(GetOwningPlayer(u))+1]
local effect chargeeffect=AddSpecialEffectTarget("war3mapImported\\BFG.mdx",u,"weapon")
local sound s=CreateSound("war3mapImported\\bfg_firebegin.mp3",false,true,false,10,10,"SpellsEAX")
local integer index=GetPlayerId(GetOwningPlayer(u))+1
local player p=GetOwningPlayer(u)
local boolean rem=false
local integer level=GetUnitAbilityLevel(u,'A082')
// empty
if CURRENT_AMMO[index]==0 and not IS_LINKING_BELTS[index] then
set charge=CURRENT_AMMO[index]
call PlaySoundOnUnitBJ(gg_snd_bfg_dryfire,100,u)
call DisplayTimedTextToPlayer(p,0,0,3,"Energy cell depleted.")
set s=null
call DestroyEffect(chargeeffect)
set chargeeffect=null
set u=null
return
endif
if CURRENT_AMMO[index]<charge then
set charge=CURRENT_AMMO[index]
set rem=true
call DisplayTimedTextToPlayer(p,0,0,3,"Used remaining charge.")
endif
call SetSoundDuration(s,2455)
call SetSoundVolume(s,127)
call SetSoundPitch(s,1.)
call SetSoundConeAngles(s,.0,.0,127)
call SetSoundConeOrientation(s,.0,.0,.0)
call SetSoundDistances(s,800,10000)
call SetSoundDistanceCutoff(s,3000)
call SetSoundChannel(s,2)
call UnitRemoveAbility(u,'A07S')
call AttachSoundToUnit(s,u)
call StartSound(s)
call PolledWait2(.6*charge - (.1*level))
if charge != BFG_Charge[index] and not rem then
call StopSound(s,false,false)
call UnitAddAbility(u,'A07S')
call DestroyEffect(chargeeffect)
set s=null
set chargeeffect=null
set u=null
return
endif
call StopSound(s,false,false)
call UnitAddAbility(u,'A07T')
call DestroyEffect(chargeeffect)
set BFG_ChargeActual[index]=charge
set s=null
set chargeeffect=null
set u=null
endfunction
private function Fire_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A07T'
endfunction
private function Fire_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer pid=GetPlayerId(GetOwningPlayer(u))+1
local location tar=GetSpellTargetLoc()
local location l=GetUnitLoc(u)
local Force f=Force.create()
local timer t=CreateTimer()
local real x
local real y
local real charge=BFG_ChargeActual[pid]
local integer level=GetUnitAbilityLevel(u,'A082')
// No ammo
if CURRENT_AMMO[pid]==0 then
call PlaySoundOnUnitBJ(gg_snd_bfg_dryfire,100,u)
call DisplayTimedTextToPlayer(GetOwningPlayer(u),0,0,3,"Energy cell depleted.")
call f.destroy()
call RemoveLocation(tar)
set tar=null
call RemoveLocation(l)
set l=null
set u=null
return
endif
set CURRENT_AMMO[pid]=CURRENT_AMMO[pid]-R2I(charge)
if CURRENT_AMMO[pid]<charge or CURRENT_AMMO[pid]<=2 then
call StartSoundForPlayerBJ(GetOwningPlayer(u),gg_snd_lowammo)
endif
call UnitRemoveAbility(u,'A07T')
call UnitAddAbility(u,'A07S')
call PlaySoundOnUnitBJ(gg_snd_bfg_fire,100,u)
call PolledWait2(.1)
set f.level=level
set f.angle=AngleBetweenPoints(l,tar)
set x = GetUnitX(u) + 40 * Cos(f.angle * bj_DEGTORAD)
set y = GetUnitY(u) + 40 * Sin(f.angle * bj_DEGTORAD)
set f.blast=CreateUnit(GetOwningPlayer(u),'h01R',x,y,f.angle)
call PlaySoundOnUnitBJ(gg_snd_bfg_fly_loop,100,f.blast)
set f.charge=charge
set f.u=u
call SetTimerStructA(t,f)
call TimerStart(t,.03,true,function ForceLoop)
call RemoveLocation(tar)
set tar=null
call RemoveLocation(l)
set l=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set C = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(C,Condition(function Charge_Conditions))
call TriggerAddAction(C,function Charge_Actions)
set F = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(F,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(F,Condition(function Fire_Conditions))
call TriggerAddAction(F,function Fire_Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library BurstFiringAdjustment initializer Init requires GlobalFuncs
//TRIG: jI, Cond: wq, Func: yq
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local integer index=GetPlayerId(GetOwningPlayer(u))+1
local boolean b=not IS_LINKING_BELTS[index] and CURRENT_AMMO[index]>0 and IsUnitInGroup(u,NADING)==false and IsPlayerInForce(GetOwningPlayer(u),FIREMODE_BURST) and not IsPlayerInForce(GetOwningPlayer(u),BURST_WAIT) and not IsUnitInGroup(u,SAFETY)
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer index=1+GetPlayerId(p)
local integer dist=GetUnitAbilityLevel(u,'B01F')
if (GetUnitTypeId(u)=='H001' or GetUnitTypeId(u)=='H00P') and CountItemsOfType(u,'I00G')==0 and BURST_ROUNDS[index]>=GetRandomInt(5,9) then
set BURST_ROUNDS[index]=0
call SetUnitAbilityLevelSwapped('A07Y',u,2)
call ForceAddPlayer(BURST_WAIT,p)
if not UnitHasBuffBJ(u,'B00O') then
call PolledWait2(GetRandomReal(.4,.5)+dist*.02)
else
call PolledWait2(GetRandomReal(.15,.25+dist*.02))
endif
call SetUnitAbilityLevelSwapped('A07Y',u,1)
call ForceRemovePlayer(BURST_WAIT,p)
elseif GetUnitTypeId(u)!='H001' and GetUnitTypeId(u)!='H00P' and BURST_ROUNDS[index]>=3 then
set BURST_ROUNDS[index]=0
call SetUnitAbilityLevelSwapped('A042',u,2)
call SetUnitAbilityLevelSwapped('A034',u,2)
call ForceAddPlayer(BURST_WAIT,p)
if not UnitHasBuffBJ(u,'B00O') then
call PolledWait2(GetRandomReal(.15,.4)+dist*.02)
else
call PolledWait2(GetRandomReal(.15,.25)+dist*.02)
endif
call ForceRemovePlayer(BURST_WAIT,p)
call SetUnitAbilityLevelSwapped('A042',u,1)
call SetUnitAbilityLevelSwapped('A034',u,1)
endif
set p=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=30
//TESH.alwaysfold=0
library DynamicWeaponSystem initializer Init requires GlobalFuncs
//TRIG: kO, Cond: nK, Func: VK
//NEED: Group Mr
globals
integer array DWS_MOD
integer array LAST_DWS
endglobals
private function Conditions takes nothing returns boolean
local unit a=GetAttacker()
local boolean b=IsUnitInGroup(a,PLAYER_UNITS) and (IsUnitInGroup(a,NADING)==false) and (GetUnitTypeId(a)!='H00U') and (GetUnitTypeId(a)!='h00K')
set a=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit attacker=GetAttacker()
local unit attacked=GetTriggerUnit()
local real x=GetUnitX(attacker)
local real y=GetUnitY(attacker)
local real dx=x-GetUnitX(attacked)
local real dy=y-GetUnitY(attacked)
local real distSq = dx*dx+dy*dy
local real acqRng = GetUnitAcquireRange(attacker)
local integer relativeDist = R2I((SquareRoot(distSq)/acqRng) * 10)
local unit dummy
local integer pid=GetPlayerId(GetOwningPlayer(attacker))+1
set relativeDist=relativeDist+DWS_MOD[pid]
if LAST_DWS[pid]==relativeDist then
set attacker=null
set attacked=null
set dummy=null
return
endif
set LAST_DWS[pid]=relativeDist
set dummy=CreateUnit(GetOwningPlayer(attacker),'h003',x-15,y,0)
call UnitRemoveAbility(attacker,'B01F')
if GetUnitTypeId(attacker)=='H00H' or GetUnitTypeId(attacker)=='H00R' or GetUnitTypeId(attacker)=='H00N' then
call UnitAddAbility(dummy,'A06Y')
call SetUnitAbilityLevel(dummy,'A06Y',relativeDist)
else
call UnitAddAbility(dummy,'A06R')
call SetUnitAbilityLevel(dummy,'A06R',relativeDist)
endif
call IssueTargetOrderById(dummy,OID_drunkenhaze,attacker)
call UnitApplyTimedLifeBJ(1,'BTLF',dummy)
set attacker=null
set attacked=null
set dummy=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=27
//TESH.alwaysfold=0
library UmbrellaWS initializer Init requires GlobalFuncs
//TRIG: kO, Cond: nK, Func: VK
//NEED: Group Mr
globals
group UWS=CreateGroup()
endglobals
private function Conditions takes nothing returns boolean
local unit a=GetAttacker()
local boolean b=IsUnitInGroup(a,UWS)
set a=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit attacker=GetAttacker()
local unit attacked=GetTriggerUnit()
local unit dummy
local real x=GetUnitX(attacker)
local real y=GetUnitY(attacker)
local integer pid=GetPlayerId(GetOwningPlayer(attacker))+1
local boolean proned=UnitHasBuffBJ(attacked,'B01K') // attacked is proned
local boolean normal=UnitHasBuffBJ(attacker,'B01F') // attacker has normal DWS
if (proned and normal==false) or (proned==false and normal) then
set attacker=null
set attacked=null
set dummy=null
return
endif
set dummy=CreateUnit(GetOwningPlayer(attacker),'h003',x-15,y,0)
call UnitRemoveAbility(attacker,'B01F')
call UnitRemoveAbility(attacker,'B01Q')
if proned then
call UnitAddAbility(dummy,'A08J')
call SetUnitAbilityLevel(dummy,'A08J',Umb_DWSLVL)
else
call UnitAddAbility(dummy,'A06R')
call SetUnitAbilityLevel(dummy,'A06R',Umb_DWSLVL)
endif
call IssueTargetOrder(dummy,"drunkenhaze",attacker)
call UnitApplyTimedLifeBJ(.5,'BTLF',dummy)
set attacker=null
set attacked=null
set dummy=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=18
//TESH.alwaysfold=0
library EmptyAndJams initializer Init requires GlobalFuncs
//TRIG: HI, Cond: --, Func: Uq
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer id=GetUnitTypeId(u)
local integer pid=GetPlayerId(p)+1
if IsUnitType(u,UNIT_TYPE_HERO) and GetPlayerController(p)==MAP_CONTROL_USER and id!='H00U' and IsPlayerInForce(p,PLAYER_JAMMED) or IS_LINKING_BELTS[(pid)] or CURRENT_AMMO[(pid)]==0 or IsUnitInGroup(u,NADING) then
call IssueImmediateOrderById(u,OID_holdposition)
if IsPlayerInForce(p,PLAYER_JAMMED) then
call PlaySoundOnUnitBJ(gg_snd_Jammed,100,u)
if MSG_Jammed[pid]==false then
call DisplayTimedTextToPlayer(p,0,0,5.,"Weapon jammed. Press Z then A to unjam.")
set MSG_Jammed[pid]=true
call PolledWait2(4.)
set MSG_Jammed[pid]=false
endif
endif
if CURRENT_AMMO[pid]==0 and id!='H00U' and id!='h00K' then
call PlaySoundOnUnitBJ(gg_snd_MagEmpty,100,u)
if MSG_Empty[pid]==false then
call DisplayTimedTextToPlayer(p,0,0,1.5,"Magazine is empty.")
set MSG_Empty[pid]=true
call PolledWait2(4.)
set MSG_Empty[pid]=false
endif
endif
endif
if GetPlayerController(p)==MAP_CONTROL_USER and id=='H00U' and GetPlayerState(p,PLAYER_STATE_RESOURCE_LUMBER)==0 then
call IssueImmediateOrderById(u,OID_holdposition)
if MSG_Empty[(pid)]==false then
call DisplayTimedTextToPlayer(p,0,0,1.5,"Out of fuel.")
set MSG_Empty[(pid)]=true
call PolledWait2(4.)
set MSG_Empty[(pid)]=false
endif
endif
if IsUnitInGroup(u,SAFETY) then
call IssueImmediateOrderById(u,OID_holdposition)
endif
set u=null
set p=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=39
//TESH.alwaysfold=0
library FiringSounds initializer Init requires GlobalFuncs
//TRIG: GI, Cond: Lq, Func: mq
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer index=1+GetPlayerId(p)
return(IS_LINKING_BELTS[index]==false)and IsUnitInGroup(u,NADING)==false and(PLAYER_UNIT[index]==u)and(IsPlayerInForce(p,PLAYER_JAMMED)==false)and(IsPlayerInForce(p,BURST_WAIT)==false)and((CURRENT_AMMO[index]>0)or GetUnitTypeId(u)=='H00U') and not IsUnitInGroup(u,SAFETY)
set u=null
set p=null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local unit a=GetTriggerUnit()
local player p=GetOwningPlayer(u)
local real dist
if (GetUnitTypeId(u)=='H00D' or GetUnitTypeId(u)=='H000' or GetUnitTypeId(u)=='H00C' or GetUnitTypeId(u)=='H011') then
set dist=DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(a),GetUnitY(a))
if dist <= 500 or not IsPlayerInForce(p,FIREMODE_SINGLE) then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(wE,u)
else
call PlaySoundAtUnitLoc(WE,u)
endif
endif
call StartSound(MV)
endif
if GetUnitTypeId(u)=='H00J' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(gg_snd_GaussRifle1,u)
else
call PlaySoundAtUnitLoc(gg_snd_GaussRifle2,u)
endif
call StartSound(LV)
endif
if UnitHasItemOfTypeBJ(u,'I00G')==false and GetUnitTypeId(u)=='H001' or GetUnitTypeId(u)=='H00P' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(DE,u)
else
call PlaySoundAtUnitLoc(fE,u)
endif
call StartSound(PV)
endif
if UnitHasItemOfTypeBJ(u,'I00G') and GetUnitTypeId(u)=='H001' or GetUnitTypeId(u)=='H00P' or GetUnitTypeId(u)=='h00E' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(zV,u)
else
call PlaySoundAtUnitLoc(ZV,u)
endif
call StartSound(qV)
endif
if GetUnitTypeId(u)=='H008' or GetUnitTypeId(u)=='H01I' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(VX,u)
else
call PlaySoundAtUnitLoc(EX,u)
endif
call StartSound(pV)
endif
if GetUnitTypeId(u)=='H00H' then
if GetUnitAbilityLevel(u,'A074')!=0 then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(uV,u)
else
call PlaySoundAtUnitLoc(UV,u)
endif
else
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(tV,u)
else
call PlaySoundAtUnitLoc(TV,u)
endif
call PolledWait2(.2)
call StartSound(mV)
endif
endif
if GetUnitTypeId(u)=='H00N' then
if UnitHasItemOfTypeBJ(u,'I00U')then
if GetRandomInt(1,3)==1 then
call PlaySoundAtUnitLoc(VV,u)
else
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(EV,u)
else
call PlaySoundAtUnitLoc(XV,u)
endif
endif
else
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(aX,u)
else
call PlaySoundAtUnitLoc(nX,u)
endif
endif
call StartSound(PV)
endif
set u=null
set a=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=1
//TESH.alwaysfold=0
library MiniFiringSounds initializer Init requires GlobalFuncs
//TRIG: hI, Cond: Mq, Func: pq
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local boolean b=IsUnitInGroup(u,RELOADING)==false and IsUnitType(u,UNIT_TYPE_HERO)==false
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
if GetUnitTypeId(u)=='h009' or GetUnitTypeId(u)=='h00A' or GetUnitTypeId(u)=='h019' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(wE,u)
else
call PlaySoundAtUnitLoc(WE,u)
endif
call StartSound(MV)
endif
if UnitHasItemOfTypeBJ(u,'I00G')==false and GetUnitTypeId(u)=='h00E' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(DE,u)
else
call SetSoundPosition(fE,GetUnitX(u),GetUnitY(u),10)
call PlaySoundAtUnitLoc(fE,u)
endif
call StartSound(PV)
endif
if UnitHasItemOfTypeBJ(u,'I00G')and GetUnitTypeId(u)=='H00E' then
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(zV,u)
else
call PlaySoundAtUnitLoc(ZV,u)
endif
call StartSound(qV)
endif
if GetUnitTypeId(u)=='H01E' then
call StartSound(mV)
endif
if GetUnitTypeId(u)=='h017' or GetUnitTypeId(u)=='h005' then
if UnitHasItemOfTypeBJ(u,'I00U')then
if GetRandomInt(1,3)==1 then
call PlaySoundAtUnitLoc(VV,u)
else
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(EV,u)
else
call PlaySoundAtUnitLoc(XV,u)
endif
endif
else
if GetRandomInt(1,2)==1 then
call PlaySoundAtUnitLoc(aX,u)
else
call PlaySoundAtUnitLoc(nX,u)
endif
endif
call StartSound(PV)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GhostFiringSounds initializer Init requires GlobalFuncs
//TRIG: gI, Cond: Kq, Func: lq
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local integer pid=1+GetPlayerId(GetOwningPlayer(u))
local boolean b=IsUnitInGroup(u,NADING)==false and (PLAYER_UNIT[pid]==u) and (CURRENT_AMMO[pid]>0)and(IsPlayerInForce(GetOwningPlayer(u),PLAYER_JAMMED)==false) and (IsPlayerInForce(GetOwningPlayer(u),BURST_WAIT)==false)
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
if GetUnitTypeId(u)=='H00I' then
if GetRandomInt(1,2)==1 then
call SetSoundPosition(HE,GetUnitX(u),GetUnitY(u),10)
call StartSound(HE)
else
call SetSoundPosition(jE,GetUnitX(u),GetUnitY(u),10)
call StartSound(jE)
endif
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GunFlashes initializer Init requires GlobalFuncs
//TRIG: FI, Cond: dq, Func: kq
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer index=GetPlayerId(p)+1
if IsPlayerInForce(p,PLAYER_JAMMED)==false and IsPlayerInForce(p,BURST_WAIT)==false and IsUnitInGroup(u,NADING)==false and IsUnitInGroup(u,SAFETY)==false and IS_LINKING_BELTS[index]==false and CURRENT_AMMO[index]>0 or IsUnitType(u,UNIT_TYPE_HERO)==false then
set u=null
return true
endif
set u=null
return false
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local integer id=GetUnitTypeId(u)
if id=='H000' or id=='H011' or id=='H00J' or id=='H00I' or id=='H00C' or id=='H00D' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\Gunshot Effect.MDX",u,"weapon"))
endif
if id=='H001' or id=='H00P' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\MachineGunEffect.MDX",u,"weapon"))
endif
if id=='H008' or id=='H01I' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SMG Gunshot.MDX",u,"weapon"))
endif
if id=='H00H' and GetUnitAbilityLevel(u,'A074')==0 then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SniperEffectAttachment.MDX",u,"weapon"))
endif
if id=='H00N' then
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\ShotgunEffect.MDX",u,"weapon"))
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Jam initializer Init requires GlobalFuncs
//TRIG: QI, Cond: --, Func: uQ
//NEEDS: ...
globals
public trigger T
real array JAM_MOD
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer pid=GetPlayerId(p)+1
local boolean b=IsPlayerInForce(p,PLAYER_JAMMED)==false and IsUnitInGroup(u,SAFETY)==false and IsUnitInGroup(u,RELOADING)==false and CURRENT_AMMO[pid]>0 and u==PLAYER_UNIT[pid] and GetUnitTypeId(u)!='H00U' and GetUnitTypeId(u)!='H00I' and GetUnitTypeId(u)!='H00J' and GetUnitTypeId(u)!='H00R'
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer pid=GetPlayerId(p)+1
if GetRandomInt(1,R2I(500*JAM_MOD[pid]))==1 then
call ForceAddPlayer(PLAYER_JAMMED,p)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library OpportunedShot initializer Init requires GlobalFuncs
//TRIG: qI, Cond: sQ, Func: tQ
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local player p=GetOwningPlayer(u)
local integer pid=GetPlayerId(p)+1
local boolean b=(CURRENT_AMMO[pid]>0)and(IsPlayerInForce(p,PLAYER_JAMMED)==false)and(IsPlayerInForce(p,OPPORTUNED_SHOT))and(IsUnitInGroup(u,NADING)==false)
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
if GetUnitAbilityLevelSwapped('A079',u)!=1 then
call SetUnitAbilityLevelSwapped('A079',u,GetRandomInt(1,3))
else
call SetUnitAbilityLevelSwapped('A079',u,GetRandomInt(2,3))
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=18
//TESH.alwaysfold=0
library Sniper initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local boolean b=(GetUnitTypeId(u)==NID_Sniper or GetUnitTypeId(u)==NID_SniperBlind) and GetUnitState(u,UNIT_STATE_MANA)>=1
set u=null
return b
endfunction
private function DelayedReload takes unit u returns nothing
call PolledWait2(1.)
call PlaySoundOnUnitBJ(gg_snd_SniperReload1,100,u)
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local unit a=GetTriggerUnit()
local unit d
local integer i=0
local real dist=DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(a),GetUnitY(a))
call DestroyEffect(AddSpecialEffectTarget("war3mapImported\\SniperEffectAttachment.MDX",u,"weapon"))
call PlaySoundOnUnitBJ(gg_snd_Sniper1,100,u)
call DelayedReload.execute(u)
if dist > 1500 then
call PolledWait2(dist / 3000)
// Vision dummy
set d=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h020',GetUnitX(u),GetUnitY(u),0)
call VisionUnit(d,true)
call PolledWait2(.2)
call PlaySoundOnUnitBJ(gg_snd_SniperEcho1,100,u)
call PolledWait2(.35)
call RemoveUnit(d)
endif
set u=null
set a=null
set d=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=2
//TESH.alwaysfold=0
library VisionDummies initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
private unit tempunit
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=GetUnitTypeId(u)=='o000' or GetUnitTypeId(u)=='h00S' or GetUnitTypeId(u)=='h016'
set u=null
return b
endfunction
private function ShareVisionGroup takes nothing returns nothing
call UnitShareVision(tempunit,GetEnumPlayer(),true)
endfunction
private function Actions takes nothing returns nothing
local unit u=GetEnteringUnit()
local force f=GetPlayersAllies(GetOwningPlayer(u))
set tempunit=u
call ForForce(f,function ShareVisionGroup)
set u=null
call DestroyForce(f)
set f=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterEnterRectSimple(T,GetWorldBounds())
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CrashUAV initializer Init requires GlobalFuncs
//TRIG: --, Cond: g3, Func: h3
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=(GetUnitTypeId(u)=='h00K')
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetEnteringUnit()
call KillUnit(u)
call PlaySoundOnUnitBJ(iE,100,u)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterEnterRectSimple(T,gg_rct_Facility1)
call TriggerRegisterEnterRectSimple(T,gg_rct_Facility2)
call TriggerRegisterEnterRectSimple(T,gg_rct_Facility3)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library TimeOfDay initializer Init requires GlobalFuncs
//TRIG: TX, Cond: --, Func: xH
function FogTransition takes nothing returns nothing
local real r=0
local integer i=1
loop
exitwhen r > 100
if fogcolor<1 then
set fogcolor=fogcolor+.01
endif
set zstart=zstart+6
set zend=zend+12
set i=1
loop
exitwhen i>11
if Player(i-1)==GetLocalPlayer() then
if PLAYER_HAS_NVG[i] then
call SetTerrainFogEx(0,2300.,4500.,.25,.0,.0,.0)
call CinematicFilterGenericBJ(0,BLEND_MODE_MODULATE_2X,"ReplaceableTextures\\CameraMasks\\White_mask.blp",20.,25.,20.,75.,11,(120+(fogcolor*100))/2.55,11,25.)
else
call SetTerrainFogEx(0,zstart,zend,.25,fogcolor,fogcolor,fogcolor)
call CinematicFilterGenericBJ(.5,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\White_mask.blp",50.,100.,50.,.0,50.,100.,50.,100.)
call CinematicFilterGenericBJ(.0,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",20.,20.,20.,.0,fogcolor*100,fogcolor*100,fogcolor*100,70.)
endif
endif
set i=i+1
endloop
call EnableUserUI(true)
set r=r+1
call PolledWait2(1)
endloop
endfunction
private function Actions takes nothing returns nothing
call SetTimeOfDay(18.5)
set zstart=800
set zend=3000
set fogcolor=.1
call SetTimeOfDayScalePercentBJ(8.)
loop
exitwhen GetTimeOfDay()>=20.
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(7.)
loop
exitwhen GetTimeOfDay()>=22.
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(5.)
loop
exitwhen GetTimeOfDay()>=23.
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(3.)
loop
exitwhen GetTimeOfDay()>=1.
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(4.)
loop
exitwhen GetTimeOfDay()>=3.
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(5.)
loop
exitwhen GetTimeOfDay()>=4.8
call PolledWait2(2)
endloop
call SetTimeOfDayScalePercentBJ(6.)
call FogTransition()
loop
exitwhen GetTimeOfDay()>=6.
call PolledWait2(2)
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,.01)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=22
//TESH.alwaysfold=0
library template2 initializer Init requires GlobalFuncs
//TRIG: eO, Cond: --, Func: Xj
globals
private weathereffect Snow
private weathereffect Rain
endglobals
private function DouseFlares takes nothing returns nothing
call UnitApplyTimedLifeBJ(UA2_GroundFlareDurRain,'BTLF',GetEnumUnit())
call SetUnitScalePercent(GetEnumUnit(),140.,140.,180.)
call SetUnitTimeScalePercent(GetEnumUnit(),150.)
endfunction
private function Actions takes nothing returns nothing
if (GetRandomInt(1,2)==1) then
if (GetRandomInt(1,5)==1) then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cff808000Current Temperature:|r "+(I2S(GetRandomInt(25,35))+" degrees fahrenheit.")))
call TriggerSleepAction(3.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"|cff808000Weather:|r Snow expected.")
call TriggerSleepAction(GetRandomReal(15.,30.))
set SNOWING=true
if (GetRandomInt(1,2)==1) then
set Snow = AddWeatherEffectSaveLast(GetWorldBounds(),WID_NorthrendSnowLight)
call EnableWeatherEffect(Snow,true)
call PlaySoundBJ(SOUND_AMBIENT_UD_GLUESCREEN)
call TriggerSleepAction(GetRandomReal(15.,30.))
call RemoveWeatherEffect(Snow)
set Snow = AddWeatherEffectSaveLast(GetWorldBounds(),WID_NorthrendSnowHeavy)
call EnableWeatherEffect(Snow,true)
else
set Snow = AddWeatherEffectSaveLast(GetWorldBounds(),WID_NorthrendSnowLight)
call EnableWeatherEffect(Snow,true)
call PlaySoundBJ(SOUND_AMBIENT_WINDLOOP)
endif
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cff808000Current Temperature:|r "+(I2S(GetRandomInt(55,65))+" degrees fahrenheit.")))
call TriggerSleepAction(3.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"|cff808000Weather:|r Rain expected.")
call TriggerSleepAction(GetRandomReal(15.,30.))
set RAINING=true
if (GetRandomInt(1,2)==1) then
set Rain = AddWeatherEffectSaveLast(GetWorldBounds(),WID_AshenvaleRainLight)
call EnableWeatherEffect(Rain,true)
call PlaySoundBJ(SOUND_AMBIENT_BNET_WINDLOOP)
call TriggerSleepAction(GetRandomReal(15.,30.))
call RemoveWeatherEffect(Rain)
set Rain = AddWeatherEffectSaveLast(GetWorldBounds(),WID_AshenvaleRainHeavy)
call EnableWeatherEffect(Rain,true)
call ForGroupBJ(GetUnitsOfType('o005'),function DouseFlares)
else
set Rain = AddWeatherEffectSaveLast(GetWorldBounds(),WID_AshenvaleRainLight)
call EnableWeatherEffect(Rain,true)
call PlaySoundBJ(SOUND_AMBIENT_RAIN)
endif
call ForGroupBJ(GetUnitsOfType('o005'),function DouseFlares)
endif
call TriggerSleepAction(GetRandomReal(600.,900.))
set RAINING=false
set SNOWING=false
call RemoveWeatherEffect(Rain)
call RemoveWeatherEffect(Snow)
call StopSoundBJ(SOUND_AMBIENT_BNET_WINDLOOP,true)
call StopSoundBJ(SOUND_AMBIENT_RAIN,true)
call StopSoundBJ(SOUND_AMBIENT_UD_GLUESCREEN,true)
call StopSoundBJ(SOUND_AMBIENT_WINDLOOP,true)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,("|cff808000Current Temperature:|r "+(I2S(GetRandomInt(55,65))+" degrees fahrenheit.")))
call TriggerSleepAction(3.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"|cff808000Weather:|r Partly cloudy.")
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,120.)
call TriggerRegisterTimerEventPeriodic(T,1500.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=27
//TESH.alwaysfold=0
library CivilianMovement initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
private group array CivilianMovers
boolean CiviliansWander=true
endglobals
function CivilianMoveUpdate takes nothing returns nothing
local unit u
local group g=CreateGroup()
local timer t=GetExpiredTimer()
if CiviliansWander==false then
set u=null
call DestroyGroup(g)
set g=null
call PauseTimer(t)
//call DestroyTimer(GetExpiredTimer())
set t=null
endif
call GroupAddGroup(CivilianMovers[1],g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call IssuePointOrder(u, "move", GetRandomReal(GetRectMinX(gg_rct_Town1)+1200, GetRectMaxX(gg_rct_Town1)-1800), GetRandomReal(GetRectMinY(gg_rct_Town1)+700, GetRectMaxY(gg_rct_Town1)-600) )
call GroupRemoveUnit(g,u)
endloop
call GroupAddGroup(CivilianMovers[2],g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call IssuePointOrder(u, "move", GetRandomReal(GetRectMinX(gg_rct_Town2)+400, GetRectMaxX(gg_rct_Town2)-600), GetRandomReal(GetRectMinY(gg_rct_Town2)+1200, GetRectMaxY(gg_rct_Town2)-500))
call GroupRemoveUnit(g,u)
endloop
set u=null
call DestroyGroup(g)
set g=null
set t=null
endfunction
private function Actions takes nothing returns nothing
local integer index=1
local unit u
local timer t=CreateTimer()
set CivilianMovers[1]=CreateGroup()
set CivilianMovers[2]=CreateGroup()
loop
exitwhen index>GetRandomInt(5,7)
set u=CreateUnit(Player(12), CivilianIDs[GetRandomInt(1,5)], GetRandomReal(GetRectMinX(gg_rct_Town1), GetRectMaxX(gg_rct_Town1)), GetRandomReal(GetRectMinY(gg_rct_Town1), GetRectMaxY(gg_rct_Town1)), GetRandomReal(0,360))
call GroupAddUnit(CivilianMovers[1], u)
set index=index+1
endloop
set index=1
loop
exitwhen index>GetRandomInt(2,3)
set u=CreateUnit(Player(12), CivilianIDs[GetRandomInt(1,5)], GetRandomReal(GetRectMinX(gg_rct_Town2), GetRectMaxX(gg_rct_Town2)), GetRandomReal(GetRectMinY(gg_rct_Town2), GetRectMaxY(gg_rct_Town2)), GetRandomReal(0,360))
call GroupAddUnit(CivilianMovers[2], u)
set index=index+1
endloop
call TimerStart(t, 15, true, function CivilianMoveUpdate)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T, 15, false)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library InfestationSetup initializer Init requires GlobalFuncs
//TRIG: ZX, Cond: --, Func: PH
globals
public trigger T
endglobals
private function SetCap takes nothing returns nothing
if (GAME_MODE==UA2_ModeRecruit) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_FOOD_CAP_CEILING,50)
elseif (GAME_MODE==UA2_ModeNormal) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_FOOD_CAP_CEILING,40)
elseif (GAME_MODE==UA2_ModeHard) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_FOOD_CAP_CEILING,28)
elseif (GAME_MODE==UA2_ModeInsane) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_FOOD_CAP_CEILING,20)
elseif (GAME_MODE==UA2_ModeSurvival) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_FOOD_CAP_CEILING,35)
endif
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_FOOD_CAP,1000)
endfunction
private function Actions takes nothing returns nothing
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function SetCap)
call EnableTrigger(InfestationLevel_T)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=36
//TESH.alwaysfold=0
library InfestationLevel initializer Init requires GlobalFuncs
//TRIG: vO, Cond: qH, Func: oj
globals
public trigger T
private boolean HEARTBEAT_PLAYING=false
endglobals
private function Conditions takes nothing returns boolean
return (DEFEATED==false)
endfunction
private function PlayerDead takes nothing returns nothing
local unit u=GetEnumUnit()
if IsUnitDeadBJ(u) then
set INFESTATION_LEVEL=(INFESTATION_LEVEL+R2I(1.5))
endif
set u=null
endfunction
private function ShowInfestationlevel takes nothing returns nothing
if (INFESTATION_LEVEL<0) then
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_FOOD_USED,0)
else
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_FOOD_USED,INFESTATION_LEVEL)
endif
endfunction
private function AddEvolvedMetabolism takes nothing returns nothing
local unit u=GetEnumUnit()
call UnitAddAbility(u,'A040')
call IssueImmediateOrderById(u,OID_frenzy)
set u=null
endfunction
// Doesn't affect Cyborg
private function ReduceLife takes nothing returns nothing
local unit u=GetEnumUnit()
if (GetUnitTypeId(u)!='H00P') then
call SetUnitLifePercentBJ(u,(GetUnitLifePercent(u)-GetRandomReal(0,2)))
endif
set u=null
endfunction
private function Actions takes nothing returns nothing
local integer i = 0
local group g=CreateGroup()
local boolexpr bexp=Condition(function IsUnitAlive)
call GroupEnumUnitsOfPlayer(g,Player(15),bexp)
set INFESTATION_LEVEL=(R2I(CountUnitsInGroup(g))/15)
call GroupEnumUnitsOfType(g,UnitId2String('u005'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*8)) // Darreus
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('u003'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*15)) // Genesis
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('u006'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*5)) // Behemoth
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('n00K'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(R2I(CountUnitsInGroup(g)*1.5))) // Hive Queen
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('n00H'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*2)) // Spore Colony
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('n00F'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*3)) // Artemis
call GroupClear(g)
call GroupEnumUnitsOfType(g,UnitId2String('n00G'),BE_TRUE)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(CountUnitsInGroup(g)*3)) // Minerva
call GroupClear(g)
set INFESTATION_LEVEL=(INFESTATION_LEVEL+(OBJECTIVES_FAILED*8))
set INFESTATION_LEVEL=(INFESTATION_LEVEL-(OBJECTIVES_SUCCEEDED*4))
set INFESTATION_LEVEL=(INFESTATION_LEVEL-(R2I(FOUND_PAPERS*.35)))
set INFESTATION_LEVEL=(INFESTATION_LEVEL-(R2I(FOUND_EVIDENCE*.45)))
call GroupEnumUnitsOfPlayer(g,Player(12),bexp)
set INFESTATION_LEVEL=(INFESTATION_LEVEL-(CountUnitsInGroup(g)/6))
call GroupClear(g)
call GroupEnumUnitsOfPlayer(g,Player(11),bexp)
set INFESTATION_LEVEL=(INFESTATION_LEVEL-(CountUnitsInGroup(g)/6))
call TriggerSleepAction(.02)
call ForGroupBJ(PLAYER_UNITS,function PlayerDead)
call TriggerSleepAction(.02)
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function ShowInfestationlevel)
call TriggerSleepAction(.02)
if (INFESTATION_LEVEL>GetPlayerState(Player(0),PLAYER_STATE_FOOD_CAP_CEILING)) and (GetRandomInt(1,3)==1) then
call GroupClear(g)
call GroupClear(bj_lastCreatedGroup)
call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup,Player(15),bexp)
call GroupAddUnit(g,GroupPickRandomUnit(bj_lastCreatedGroup))
call GroupAddUnit(g,GroupPickRandomUnit(bj_lastCreatedGroup))
call GroupAddUnit(g,GroupPickRandomUnit(bj_lastCreatedGroup))
call ForGroupBJ(g,function AddEvolvedMetabolism)
call GroupClear(bj_lastCreatedGroup)
endif
call TriggerSleepAction(.02)
if (INFESTATION_LEVEL>=60)and(GetRandomInt(1,2)==1) then
if (HEARTBEAT_PLAYING==false) then
call PlaySoundBJ(SOUND_HEARTBEAT)
set HEARTBEAT_PLAYING=true
endif
call ForGroup(PLAYER_UNITS,function ReduceLife)
endif
if (INFESTATION_LEVEL<60) then
call StopSoundBJ(SOUND_HEARTBEAT,true)
set HEARTBEAT_PLAYING=false
endif
// Non-Umbrella
if (INFESTATION_LEVEL<=GetPlayerState(Player(0),PLAYER_STATE_FOOD_CAP_CEILING)) and (GetRandomInt(1,8)==1) and (GAME_MODE!=UA2_ModeUmbrella) then
loop
exitwhen i>10
call AddPlayerXP(Player(i),1)
set i=i+1
endloop
endif
// Umbrella
if (INFESTATION_LEVEL<=GetPlayerState(Player(0),PLAYER_STATE_FOOD_CAP_CEILING)) and (GetRandomInt(1,8)==1) and (GAME_MODE==UA2_ModeUmbrella) then
set i=0
loop
exitwhen i>10
call AddPlayerXP(Player(i),2)
set i=i+1
endloop
endif
call DestroyGroup(g)
set g=null
call DestroyBoolExpr(bexp)
set bexp=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(3.,4.))
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ShowTips initializer Init requires GlobalFuncs
//TRIG: mO, Cond: --, Func: HK
private function Actions takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"\n|cffffcc00Pilot:|r You have 90 seconds to pick your MOS.")
call TriggerSleepAction(300.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,6.,"\"The deadliest weapon in the world is a marine and his rifle! -Gen Pershing, US Army\"")
call TriggerSleepAction(90.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"|cffffcc00Hint:|r As you play the game you gain experience from killing undead and completing missions. You can type \"-save\" to save your experience and type \"-load <code>\" to input your Marine ID. All IDs earlier than version 2.0 will not work.")
call TriggerSleepAction(90.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Hint:|r You can type \"-tl\" to ping your team's locations and you can type \"-dead\" to ping where dead soldiers on your team have died. For more commands and information, press Intel (|cffffcc00F9|r).")
call TriggerSleepAction(90.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Hint:|r Every time you shoot your bullets go through the target and will hit anything behind it, even allies. More powerful guns will travel farther.")
call TriggerSleepAction(90.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Hint:|r The more magazines you have (not including in your inventory) the more encumbered your soldier is.")
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,.0)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library PlatoonDefeated initializer Init requires GlobalFuncs
//TRIG: zO, Func: Ul
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i = 1
loop
exitwhen i>11
if IsUnitAliveBJ(PLAYER_UNIT[i]) then
return
endif
set i=i+1
endloop
call DisableTrigger(T)
call DisableTrigger(InfestationLevel_T)
call StopSoundBJ(SOUND_WAR3X_MAINSCREEN,true)
call StopSoundBJ(SOUND_WAR3_MAINSCREEN,true)
call StopSoundBJ(SOUND_DARK_AGENTS,true)
call StopSoundBJ(SOUND_UNDEAD_2,true)
call StopSoundBJ(SOUND_UNDEAD_3,true)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"The platoon has been killed.")
set DEFEATED=true
call PlaySoundBJ(SOUND_UNDEAD_VICTORY)
call TriggerSleepAction(5.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30.,"Visit the Undead Assault community at: |cff408080undeadassault.net")
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,3.)
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DefeatCheaters initializer Init requires GlobalFuncs
//TRIG: yX, Cond: IH, Func: NH
private function Conditions takes nothing returns boolean
return(IsMapFlagSet(MAP_FOG_ALWAYS_VISIBLE)) or (IsMapFlagSet(MAP_FOG_MAP_EXPLORED))
endfunction
private function KickAll takes nothing returns nothing
call CustomDefeatBJ(GetEnumPlayer(),"No Cheating")
endfunction
private function Actions takes nothing returns nothing
call ForForce(bj_FORCE_ALL_PLAYERS,function KickAll)
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,.0)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=77
//TESH.alwaysfold=0
library CheckHost initializer Init requires GlobalFuncs
//TRIG: bO, Cond: --, Func: NJ
globals
private gamecache GC=null
endglobals
private function GameCache takes nothing returns gamecache
if (GC == null) then
call FlushGameCache(InitGameCache("hostchecker.w3v"))
set GC = InitGameCache("hostchecker.w3v")
endif
if GC==null then
call BJDebugMsg("hostchecker.w3v is nulled!")
endif
return GC
endfunction
private function GetHostId takes nothing returns integer
call StoreInteger(GameCache(), "HostChecker", "host", GetPlayerId(GetLocalPlayer()) + 1)
call TriggerSyncStart()
call SyncStoredInteger(GameCache(), "HostChecker", "host")
call TriggerSyncReady()
return GetStoredInteger(GameCache(), "HostChecker", "host") - 1
endfunction
public function GetHost takes nothing returns nothing
local integer array id
local real array latency
local integer max = 0
local integer t = 0
local integer i = 0
local timer T = CreateTimer()
call TimerStart(T,20.,false,null)
set HOST = null
loop
exitwhen i > 11
set id[i] = 0
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
set latency[i]=TimerGetElapsed(T)
set t = GetHostId()
set latency[i] = TimerGetElapsed(T)-latency[i]
set id[t] = id[t] + 1
if id[t] > id[max] then
set max = t
endif
set i = i + 1
call PauseTimer(T)
call PolledWait(1.)
call ResumeTimer(T)
endloop
set HOST = Player(max)
set LATENCY = (latency[1]+latency[2]+latency[3]+latency[4]+latency[5])/5.
call ClearTextMessages()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Host: "+GetPlayerName(HOST))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Latency: "+I2S(R2I(LATENCY*1000)))
call StartSound(SOUND_RADIO_FEEDBACK_C_1)
call TriggerRegisterPlayerChatEvent(CommandKick_T,HOST,"-kick",false)
call FlushStoredMission(GameCache(),"missionKey")
call FlushGameCache(GC)
call PauseTimer(T)
call DestroyTimer(T)
set T = null
endfunction
private function Actions takes nothing returns nothing
local gamecache gc
call FlushGameCache(InitGameCache("cheatchecker.ua2"))
set gc=InitGameCache("cheatchecker.ua2")
call StoreInteger(gc,"test","test",9)
if gc==null then
call BJDebugMsg("gc is nulled!")
endif
if SaveGameCache(gc) then
set SINGLE_PLAYER = true
set HOST = GetLocalPlayer()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"\nThe current game is single player.")
if not UA2_BetaModeOn then
call DisableTrigger(SAVELOAD_saveTrig)
call PolledWait2(2.15)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,7.85,"You cannot save in single player to prevent cheating.")
endif
else
call GetHost()
endif
call FlushGameCache(gc)
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,4.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ModeSelection initializer Init requires GlobalFuncs
//TRIG: ZO, Cond: --, Func: vL --> InitDialog
//TRIG: vR, Cond: --, Func: hL --> Selected
//TRIG: eR, Cond: --, Func: hL --> Competition Selected
globals
private trigger T2
private boolean MODE_SELECTED=false
endglobals
private function SetRifleMode takes nothing returns nothing
call SetPlayerHandicapXPBJ(GetEnumPlayer(),(50.+(I2R(PLAYING_PLAYERS)*1.55)))
call SetPlayerAbilityAvailableBJ(true,'A06B',GetEnumPlayer())
endfunction
private function GrantInitialClasses takes nothing returns nothing
call SetPlayerUnitAvailableBJ('H00C',true,GetEnumPlayer())
call SetPlayerUnitAvailableBJ('H000',true,GetEnumPlayer())
if (MODE_RIFLE_ON==false) then
call SetPlayerUnitAvailableBJ('H011',true,GetEnumPlayer())
endif
endfunction
private function SelectClassPicker takes nothing returns nothing
call SelectUnitForPlayerSingle(SELECTION_TENT_1,GetEnumPlayer())
endfunction
private function DisableDevotion takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(false,'A06B',GetEnumPlayer())
endfunction
private function DisableRevive takes nothing returns nothing
call SetPlayerAbilityAvailableBJ(false,'A054',GetEnumPlayer())
endfunction
private function GiveSentriesToUmb takes nothing returns nothing
if (GetUnitTypeId(GetEnumUnit())=='h006') then
call SetUnitOwner(GetEnumUnit(),Player(11),true)
endif
endfunction
private function SetHandicap58 takes nothing returns nothing
call SetPlayerHandicapXPBJ(GetEnumPlayer(),58.)
endfunction
private function Actions takes nothing returns nothing
call CinematicFadeBJ(1,.0,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
call SetUserControlForceOff(bj_FORCE_ALL_PLAYERS)
call PolledWait2(1.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Detecting host...")
loop
exitwhen (HOST!=null)
call PolledWait2(1.)
endloop
call SetUserControlForceOn(GetForceOfPlayer(HOST))
set MODE_SELECTION_DIALOG = DialogCreate()
call DialogSetMessage(MODE_SELECTION_DIALOG,"Choose Difficulty")
set MODE_RECR_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Recruit",1)
set MODE_NORM_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Normal",2)
set MODE_HARD_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Hard",3)
set MODE_INSA_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Insane",4)
set MODE_UMBR_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Umbrella",5)
//set MODE_SURV_BUTTON=DialogAddButton(MODE_SELECTION_DIALOG,"Survival",6)
call DialogDisplayBJ(true,MODE_SELECTION_DIALOG,HOST)
call TriggerRegisterDialogEvent(T2,MODE_SELECTION_DIALOG)
if (GetPlayerSlotState(HOST)==PLAYER_SLOT_STATE_LEFT) or (GetPlayerSlotState(HOST)==PLAYER_SLOT_STATE_EMPTY) then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is "+UA2_StandardModeName+".")
else
call PolledWait2(30.)
if (MODE_SELECTED==false) then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,GetPlayerName(HOST)+" has taken too long to choose a difficulty, so it is set to "+UA2_StandardModeName+" by default.")
endif
endif
if (MODE_SELECTED==false) then
call DialogDisplayBJ(false,MODE_SELECTION_DIALOG,HOST)
call CinematicFadeBJ(0,3.,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
set GAME_MODE=UA2_StandardMode
set MODE_SELECTED=true
set CAN_SELECT_EXTRA_MODE=false
call ForForce(bj_FORCE_ALL_PLAYERS,function GrantInitialClasses)
call CreateQuestBJ(2,"Difficulty: Normal","Normal mode offers average enemy statistics and average experience rewards.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
call TriggerExecute(MissionStartup_T)
call EnableTrigger(RankManagement_T)
call TriggerExecute(InfestationSetup_T)
call TriggerExecute(SpawnItemsOnce_T)
call ConditionalTriggerExecute(WeaponCacheSetup_T)
call TriggerExecute(InitializeMultiboard_T)
endif
endfunction
private function Selected takes nothing returns nothing
local button clicked = GetClickedButton()
local group g
call DisableTrigger(T2)
call CinematicFadeBJ(0,3.,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,0)
call SetUserControlForceOn(bj_FORCE_ALL_PLAYERS)
call ForForce(bj_FORCE_ALL_PLAYERS,function SelectClassPicker)
set MODE_SELECTED=true
if (clicked==MODE_RECR_BUTTON) then
set GAME_MODE=UA2_ModeRecruit
set XP_MODIFIER=.65
set INJURY_CHANCE=8
set MissionTimeModifier = 1.15
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is recruit.")
call TriggerExecute(MissionStartup_T)
set STANDARD_INFECTED_GROUP_SIZE=R2I(STANDARD_INFECTED_GROUP_SIZE*.8)
set QUEST_TITLE="Recruit"
set MAIN_QUEST = CreateQuestBJ(2,QUEST_TITLE,"Recruit mode is shorter, easier and offers 65% of the normal experience. Only Riflemen and Corpsmen are available.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
endif
if (clicked==MODE_NORM_BUTTON) then
set GAME_MODE=UA2_ModeNormal
set INJURY_CHANCE=6
set MissionTimeModifier = 1
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is normal.")
call ConditionalTriggerExecute(MissionStartup_T)
set QUEST_TITLE="Normal"
set MAIN_QUEST = CreateQuestBJ(2,QUEST_TITLE,"Normal mode offers average enemy statistics and average experience rewards.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
endif
if (clicked==MODE_HARD_BUTTON) then
set GAME_MODE=UA2_ModeHard
set XP_MODIFIER=1.75
set INJURY_CHANCE=4
set MissionTimeModifier = .75
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is hard.")
call TriggerExecute(MissionStartup_T)
set STANDARD_INFECTED_GROUP_SIZE=R2I(STANDARD_INFECTED_GROUP_SIZE*1.05)
call SetPlayerTechResearchedSwap('R008',8,Player(15))
set QUEST_TITLE="Hard"
set MAIN_QUEST = CreateQuestBJ(2,QUEST_TITLE,"Hard mode will give boosted hostile statistics and offers 175% of the normal experience.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
endif
if (clicked==MODE_INSA_BUTTON) then
set GAME_MODE=UA2_ModeInsane
set XP_MODIFIER=2.5
set INJURY_CHANCE=3
set MissionTimeModifier = .6
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is insane.")
call TriggerExecute(MissionStartup_T)
set STANDARD_INFECTED_GROUP_SIZE=R2I(STANDARD_INFECTED_GROUP_SIZE*1.1)
call SetPlayerTechResearchedSwap('R008',18,Player(15))
set QUEST_TITLE="Insane"
set MAIN_QUEST = CreateQuestBJ(2,QUEST_TITLE,"Insane mode offers greatly boosted enemy statistics but grants 250% of the normal experience reward.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
endif
if (clicked==MODE_UMBR_BUTTON) then
set GAME_MODE=UA2_ModeUmbrella
set INJURY_CHANCE=5
set P_USMC=Player(14)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The current difficulty is Umbrella.")
call TriggerExecute(MissionUmbrella_T)
call SetPlayerTechResearchedSwap('R008',4,Player(15))
set QUEST_TITLE="Umbrella"
set MAIN_QUEST = CreateQuestBJ(2,QUEST_TITLE,"Umbrella mode primarily involves combatting Umbrella insurgents. It offers the most experience gain but the most difficult gameplay. The more players in the game the less experience awarded.","ReplaceableTextures\\CommandButtons\\BTNOrb.blp")
set XP_MODIFIER=(1.15-(I2R(PLAYING_PLAYERS)*.05))
set SHELLS=65
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function SetHandicap58)
set g = GetUnitsInRectAll(bj_mapInitialPlayableArea)
call ForGroupBJ(g,function GiveSentriesToUmb)
call DestroyGroup(g)
endif
if (clicked!=MODE_COMP_BUTTON and clicked!=MODE_SURV_BUTTON) then
call ForForce(bj_FORCE_ALL_PLAYERS,function DisableDevotion)
endif
if (GAME_MODE!=UA2_ModeRecruit) then
set CAN_SELECT_EXTRA_MODE=true
call DisplayTimedTextToForce(GetForceOfPlayer(HOST),12.,"|cffffcc00You have 12 seconds to choose any extra modes. To pick an extra mode type \"-\" followed by the mode name. Outbreak not available in Recruit or Umbrella.|r Extra modes: rifle, outbreak")
call PolledWait2(12.)
set CAN_SELECT_EXTRA_MODE=false
call DisplayTimedTextToForce(GetForceOfPlayer(HOST),8.,"|cffffcc00You cannot pick extra modes any more.")
call ForForce(bj_FORCE_ALL_PLAYERS,function GrantInitialClasses)
else
set CAN_SELECT_EXTRA_MODE=false
set MODE_RIFLE_ON=true
call ForForce(bj_FORCE_ALL_PLAYERS,function SetRifleMode)
call ForForce(bj_FORCE_ALL_PLAYERS,function GrantInitialClasses)
endif
call EnableTrigger(RankManagement_T)
call TriggerExecute(InfestationSetup_T)
call TriggerExecute(SpawnItemsOnce_T)
call ConditionalTriggerExecute(WeaponCacheSetup_T)
call TriggerExecute(InitializeMultiboard_T)
set g = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,.0)
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerAddAction(T2,function Selected)
endfunction
endlibrary
//TESH.scrollpos=166
//TESH.alwaysfold=0
library UnitSelectionSystem initializer Init requires GlobalFuncs
//TRIG: hO, Cond: qk, Func: Uk --> Dynamic Helicopter Selection
//TRIG: FO, Cond: YJ, Func: Kk --> After a unit is selected
//TRIG: GO, Cond: --, Func: Pk --> After 90 seconds
//TRIG: gO, Cond: --, Func: -- --> Helicopter flies off
globals
trigger T_Selected = CreateTrigger()
public trigger T
private trigger T2
private trigger T3
endglobals
function MakeUnavailable takes integer uid returns nothing
local integer i = 0
loop
exitwhen i>10
call SetPlayerTechMaxAllowed(Player(i),uid,0)
set i=i+1
endloop
endfunction
private function Selected_Conditions takes nothing returns boolean
local unit u=GetSellingUnit()
local string s=GetEventPlayerChatString()
local boolean b=false
set s=StringCase(s,false)
if s=="-random" and PLAYER_UNIT[1+GetPlayerId(GetTriggerPlayer())]==null and CAN_SELECT_EXTRA_MODE==false then
set b=true
elseif (u==SELECTION_TENT_1) or (u==SELECTION_TENT_2) then
set b=true
endif
set u=null
set s=null
return b
endfunction
private function PlayingPlayerFilter takes nothing returns boolean
return (GetPlayerController(GetFilterPlayer())==MAP_CONTROL_USER) and (GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
private function HideUnit takes unit u returns nothing
call PolledWait2(2.)
call ShowUnit(u,false)
call PlaySoundOnUnitBJ(SOUND_PICKUP,100.,SELECTION_HELICOPTER)
endfunction
private function ResetMask takes nothing returns nothing
call DestroyFogModifier(CreateFogModifierRectBJ(true,GetEnumPlayer(),FOG_OF_WAR_MASKED,GetPlayableMapRect()))
endfunction
// After all have selected
private function HelicopterFliesOff takes nothing returns nothing
local location l2 = GetRectCenter(gg_rct_StartingRect)
local location l = OffsetLocation(l2,-2000,-2000)
local player p
local integer i = 0
call DisableTrigger(T) // 120 sec autopick
call DisableTrigger(T_Selected)
set MISSION_TIME=0
call PolledWait2(2.)
// Make units enter (hide them)
if GetRandomInt(1,2)==1 then
call PlaySoundOnUnitBJ(gg_snd_moveout,100.,SELECTION_HELICOPTER)
else
call PlaySoundOnUnitBJ(gg_snd_letsgo,100.,SELECTION_HELICOPTER)
endif
loop
exitwhen i > 10
if (PLAYER_UNIT[i+1]!=null) and (GetUnitTypeId(PLAYER_UNIT[i+1])!='h00K') then
call IssuePointOrderById(PLAYER_UNIT[i+1],OID_move,GetUnitX(SELECTION_HELICOPTER),GetUnitY(SELECTION_HELICOPTER))
call HideUnit.execute(PLAYER_UNIT[i+1])
call PolledWait(.3)
endif
set i = i + 1
endloop
call PolledWait2(5.)
// Do fly off stuff
//call SetUnitFlyHeight(SELECTION_HELICOPTER,300.,150.)
call SmoothTakeOff(SELECTION_HELICOPTER,300,150)
call PolledWait2(1.5)
call IssuePointOrderByIdLoc(SELECTION_HELICOPTER,OID_move,l)
call PolledWait2(2.)
call ClearTextMessages()
// Fade to black
call ShowInterface(false, 3)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT,3.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PolledWait2(4.)
// Reset Black Mask
call ForForce(bj_FORCE_ALL_PLAYERS,function ResetMask)
// Move helicopter
call SetUnitX(SELECTION_HELICOPTER,GetLocationX(l))
call SetUnitY(SELECTION_HELICOPTER,GetLocationY(l))
call RemoveLocation(l)
call DisableTrigger(T2) // Disable Selection Camera
call EnableTrigger(T3) // Enable Drop Off Camera
// Show UA2 logo
call PolledWait2(2.)
call StartSound(gg_snd_Chapter)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEOUT,1.5,"war3mapImported\\UA2.blp",255,255,255,0)
call PolledWait2(2.)
// Move helicopter in
call IssuePointOrderByIdLoc(SELECTION_HELICOPTER,OID_move,l2)
call RemoveLocation(l2)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN,2.5,"war3mapImported\\UA2.blp",255,255,255,0)
call PolledWait2(2.8)
// Fade back in
call ShowInterface(true, 3)
call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN,3., "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call PolledWait2(6.)
// Drop off units
//call SetUnitFacingTimed(SELECTION_HELICOPTER,0.,1.2)
//call PolledWait2(1.2)
call SetUnitFlyHeight(SELECTION_HELICOPTER,0.,150.)
call PolledWait2(2.)
set l2 = GetUnitLoc(SELECTION_HELICOPTER)
set i = 0
loop
exitwhen i > 10
if (PLAYER_UNIT[i+1]!=null) and (GetUnitTypeId(PLAYER_UNIT[i+1])!='h00K') then
set l = OffsetLocation(l2,0.,-150.)
call SetUnitX(PLAYER_UNIT[i+1],GetLocationX(l))
call SetUnitY(PLAYER_UNIT[i+1],GetLocationY(l))
call ShowUnit(PLAYER_UNIT[i+1],true)
call RemoveLocation(l)
set l = OffsetLocation(l2,GetRandomReal(-250.,250.),GetRandomReal(-450.,-150.))
call IssuePointOrderByIdLoc(PLAYER_UNIT[i+1],OID_move,l)
call RemoveLocation(l)
call PlaySoundBJ(gg_snd_Boltpull)
call PolledWait(.3)
endif
set i = i + 1
endloop
call RemoveLocation(l2)
set l2 = null
call PolledWait2(2.)
// Flies off from StartingRect
call HeliWashOff(SELECTION_HELICOPTER)
//call SetUnitFlyHeight(SELECTION_HELICOPTER,700.,175.)
call SmoothTakeOff(SELECTION_HELICOPTER,700,175)
call TriggerSleepAction(1.5)
call EnableTrigger(PlatoonDefeated_T)
call IssuePointOrder(SELECTION_HELICOPTER,"move",GetRectCenterX(gg_rct_StartingRect)+2000,GetRectCenterY(gg_rct_StartingRect)+2000)
set l = null
call DisableTrigger(T3) // Disable Drop Off Camera
call ResetToGameCamera(2.5)
call PolledWait2(2.5)
set CINEMATIC_ENDED = true
// Give control back
//call EnableUserControl(true)
set i = 0
loop
exitwhen i > 10
set p = Player(i)
if (PLAYER_UNIT[i+1]!=null) then
call SetUnitOwner(PLAYER_UNIT[i+1],p,false)
call PanCameraToTimedForPlayer(p,GetUnitX(PLAYER_UNIT[i+1]),GetUnitY(PLAYER_UNIT[i+1]),0.)
call SetCameraFieldForPlayer(p,CAMERA_FIELD_TARGET_DISTANCE,Player_ViewDist[i]*100.,1)
if (GetUnitTypeId(PLAYER_UNIT[i+1])=='h00K') then
call SetUnitFlyHeight(PLAYER_UNIT[i+1],400.,300.)
call SetUnitInvulnerable(PLAYER_UNIT[i+1],false)
endif
call SelectUnitForPlayerSingle(PLAYER_UNIT[i+1],p)
endif
call UnitShareVisionBJ(false,SELECTION_HELICOPTER,p)
set i = i + 1
endloop
call EnableTrigger(CommandNVG_T)
// Removes remaining class pickers
call ForGroupBJ(GetUnitsOfType('n003'),function RemoveAllUnitsFromGame)
call PolledWait2(5.)
call RemoveUnit(SELECTION_HELICOPTER)
endfunction
//=======================================
// UNIT IS SELECTED FUNCTIONS START HERE
//=======================================
private function Selected_Actions takes nothing returns nothing
local unit u = GetSoldUnit()
local player p = GetOwningPlayer(u)
local integer pid = GetPlayerId(p)
local location l
local integer i = 1
local group g=CreateGroup()
local force f=CreateForce()
local string s=GetEventPlayerChatString()
set s=StringCase(s,false)
if s=="-random" then
set p = GetTriggerPlayer()
set pid = GetPlayerId(p)
if MODE_RIFLE_ON then
set u=CreateUnit(p,MOS_LIST[GetRandomInt(1,2)],GetUnitX(SELECTION_TENT_1),GetUnitY(SELECTION_TENT_1),220)
else
set u=CreateUnit(p,MOS_LIST[GetRandomInt(1,MOS_ALLOWED[PLAYER_RANK[1+pid]])],GetUnitX(SELECTION_TENT_1),GetUnitY(SELECTION_TENT_1),220)
endif
endif
//if (GetLocalPlayer() == p) then
// call EnableUserControl(false)
//endif
if PLAYER_UNIT[(1+pid)]!=null then
call RemoveUnit(u)
set u = null
return
endif
call UnitShareVisionBJ(false,SELECTION_TENT_1,p)
call UnitShareVisionBJ(false,SELECTION_TENT_2,p)
if (GetUnitTypeId(u)=='H00M') then
// hawk
call RemoveUnit(u)
set STANDARD_INFECTED_GROUP_SIZE=(R2I(STANDARD_INFECTED_GROUP_SIZE*1.1))
set PLAYER_UNIT_ID[1+pid]='h00K'
set u = CreateUnit(p, 'h00K', GetRectCenterX(LZ[1]), GetRectCenterY(LZ[1]), 270)
set PLAYER_UNIT[1+pid]=u
call GroupAddUnit(PLAYER_UNITS,u)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(("|cff804000"+GetPlayerName(p))+(" is now operating the "+GetUnitName(u))))
call SetUnitOwner(u,Player(12),false)
call SetUnitFlyHeight(u,0.,500.)
call SetUnitInvulnerable(u,true)
call TriggerRegisterUnitEvent(SoldierTakesHit_T,u,EVENT_UNIT_DAMAGED)
call DisplayTimedTextToPlayer(p,0,0,15,"Waiting for others to arrive at the LZ...")
set XP_MODIFIER=(XP_MODIFIER*.8)
else
set PLAYER_UNIT_ID[1+pid]=GetUnitTypeId(u)
set PLAYER_UNIT[1+pid]=u
call SetUnitAbilityLevel(u, 'A000', ITEM_SLOTS)
call GroupAddUnit(PLAYER_UNITS,u)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(("|cff804000"+GetPlayerName(p))+(" has selected "+GetUnitName(u))))
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,u)
call TriggerRegisterUnitEvent(SoldierTakesHit_T,u,EVENT_UNIT_DAMAGED)
call TriggerRegisterUnitEvent(Maggot_T,u,EVENT_UNIT_DAMAGED)
set l = GetRandomLocInRect(gg_rct_SelectionRect)
call SetUnitOwner(u,Player(12),false)
call UnitShareVisionBJ(true,u,p)
call IssuePointOrderByIdLoc(u,OID_move,l)
call RemoveLocation(l)
set l = null
if (GAME_MODE==UA2_ModeRecruit) then
// Recruit armor bonus
call UnitAddAbility(u,'A05S')
endif
if (MODE_RIFLE_ON) then
call SetHeroLevelBJ(u,2,false)
set bj_lastCreatedItem=UnitAddItemById(u,'I000')
call SetItemCharges(bj_lastCreatedItem,3)
endif
endif
if (GetUnitTypeId(u)=='H00C') then
call UnitAddItemById(u,'I003')
set CURRENT_AMMO[(1+pid)]=65
set MAG_SIZE[(1+pid)]=65
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00W')
endif
if (GetUnitTypeId(u)=='H000') then
set CURRENT_AMMO[(1+pid)]=70
set MAG_SIZE[(1+pid)]=70
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,8)
call UnitAddItemById(u,'I00N')
endif
if (GetUnitTypeId(u)=='H011') then
set CURRENT_AMMO[(1+pid)]=65
set MAG_SIZE[(1+pid)]=65
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00O')
endif
if (GetUnitTypeId(u)=='H00H') then
set CURRENT_AMMO[(1+pid)]=30
set MAG_SIZE[(1+pid)]=30
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00O')
endif
if (GetUnitTypeId(u)=='H00U') then
set MAG_SIZE[(1+pid)]=50
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,425)
endif
if (GetUnitTypeId(u)=='H01I') then
set CURRENT_AMMO[(1+pid)]=80
set MAG_SIZE[(1+pid)]=80
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,9)
call UnitAddItemById(u,'I00O')
call ForceRemovePlayer(FIREMODE_SINGLE,p)
call ForceAddPlayer(FIREMODE_BURST,p)
call UnitAddAbility(u,'A034')
endif
if (GetUnitTypeId(u)=='H001') then
set CURRENT_AMMO[(1+pid)]=100
set MAG_SIZE[(1+pid)]=100
call ForceRemovePlayer(FIREMODE_SINGLE,p)
call ForceAddPlayer(FIREMODE_BURST,p)
call UnitAddAbility(u,'A07Y')
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,12)
call UnitAddItemById(u,'I00W')
endif
if (GetUnitTypeId(u)=='H00P') then
set CURRENT_AMMO[(1+pid)]=200
set MAG_SIZE[(1+pid)]=200
call ForceRemovePlayer(FIREMODE_SINGLE,p)
call ForceAddPlayer(FIREMODE_BURST,p)
call UnitAddAbility(u,'A07Y')
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,10)
call UnitAddItemById(u,'I00C')
endif
if (GetUnitTypeId(u)=='H00N') then
set CURRENT_AMMO[(1+pid)]=24
set MAG_SIZE[(1+pid)]=24
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00C')
call SetPlayerTechResearched(p,'R00B',5)
endif
if (GetUnitTypeId(u)=='H008') then
set CURRENT_AMMO[(1+pid)]=80
set MAG_SIZE[(1+pid)]=80
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,9)
call UnitAddItemById(u,'I00O')
set XP_MODIFIER=(XP_MODIFIER*.95)
call SetPlayerTechResearched(p,'R00B',5)
call ForceRemovePlayer(FIREMODE_SINGLE,p)
call ForceAddPlayer(FIREMODE_BURST,p)
call UnitAddAbility(u,'A034')
endif
if (GetUnitTypeId(u)=='H00J') then
set CURRENT_AMMO[(1+pid)]=40
set MAG_SIZE[(1+pid)]=40
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00O')
call SetPlayerTechResearched(p,'R00B',5)
endif
if (GetUnitTypeId(u)=='H00I') then
set CURRENT_AMMO[(1+pid)]=165
set MAG_SIZE[(1+pid)]=165
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00O')
set XP_MODIFIER=(XP_MODIFIER*.95)
call SetPlayerTechResearched(p,'R00B',5)
endif
if (GetUnitTypeId(u)=='H00R') then
set CURRENT_AMMO[(1+pid)]=8
set MAG_SIZE[(1+pid)]=8
set BFG_Charge[1+pid]=1
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,12)
endif
if (GetUnitTypeId(u)=='H00D') then
set CURRENT_AMMO[(1+pid)]=65
set MAG_SIZE[(1+pid)]=65
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_LUMBER,7)
call UnitAddItemById(u,'I00W')
endif
set MAG_SIZE_STAND[1+pid]=MAG_SIZE[1+pid]
// Remove all selectors for player p
set g=GetUnitsOfPlayerAndTypeId(p,'n003')
call ForGroupBJ(g,function RemoveAllUnitsFromGame)
set PLAYERS_THAT_HAVE_SELECTED=0
loop
exitwhen i>11
if (PLAYER_UNIT[i]!=null) then
set PLAYERS_THAT_HAVE_SELECTED=(PLAYERS_THAT_HAVE_SELECTED+1)
endif
set i=i+1
endloop
set f=GetPlayersMatching(Condition(function PlayingPlayerFilter))
if (PLAYERS_THAT_HAVE_SELECTED==CountPlayersInForceBJ(f)) then
call HelicopterFliesOff()
endif
set u = null
set s=null
call DestroyGroup(g)
set g=null
call DestroyForce(f)
set f=null
endfunction
//========================================
// 120 SECONDS PASSED FUNCTIONS START HERE
//========================================
private function Actions takes nothing returns nothing
local integer i = 1
local location l
local unit pu
local group g=CreateGroup()
loop
exitwhen i>11
if (GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(Player(i-1))==MAP_CONTROL_USER) and (PLAYER_UNIT[i]==null) then
//if (GetLocalPlayer() == Player(i-1)) then
// call EnableUserControl(false)
//endif
set pu = CreateUnit(Player(i-1), 'H000', GetUnitX(SELECTION_TENT_1), GetUnitY(SELECTION_TENT_1), 0)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cff804000"+GetPlayerName(Player(i-1))+" has auto-selected "+GetUnitName(pu))
set PLAYER_UNIT[i]=pu
call GroupAddUnit(PLAYER_UNITS,pu)
call SetUnitAbilityLevel(pu, 'A000', ITEM_SLOTS)
call UnitShareVisionBJ(false,SELECTION_TENT_1,Player(i-1))
call UnitShareVisionBJ(false,SELECTION_TENT_2,Player(i-1))
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,pu)
call TriggerRegisterUnitEvent(SoldierTakesHit_T,pu,EVENT_UNIT_DAMAGED)
set l = GetRandomLocInRect(gg_rct_SelectionRect)
call SetUnitOwner(pu,Player(12),false)
call UnitShareVisionBJ(true,pu,Player(i-1))
call IssuePointOrderByIdLoc(pu,OID_move,l)
call RemoveLocation(l)
set CURRENT_AMMO[i]=65
set MAG_SIZE[i]=65
call SetPlayerStateBJ(Player(i-1),PLAYER_STATE_RESOURCE_LUMBER,15)
call UnitAddItemById(pu,'I00N')
set g=GetUnitsOfPlayerAndTypeId(Player(i-1),'n003')
call ForGroupBJ(g,function RemoveAllUnitsFromGame)
call GroupClear(g)
endif
set i=i+1
endloop
call HelicopterFliesOff()
set pu=null
call DestroyGroup(g)
set g=null
set l = null
endfunction
//=======================================
// INITIALIZER
//=======================================
private function Camera_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 10
call CameraSetupApplyForPlayer(true,gg_cam_Starting_Cam,Player(i),0)
set i = i + 1
endloop
endfunction
private function Camera2_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i > 10
call CameraSetupApplyForPlayer(true,gg_cam_Starting_Cam2,Player(i),0)
set i = i + 1
endloop
endfunction
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,120.)
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerRegisterTimerEventSingle(T2,0.)
call TriggerRegisterTimerEventPeriodic(T2,.05)
call TriggerAddAction(T2,function Camera_Actions)
set T3 = CreateTrigger()
call DisableTrigger(T3)
call TriggerRegisterTimerEventPeriodic(T3,.05)
call TriggerAddAction(T3,function Camera2_Actions)
call TriggerRegisterAnyUnitEventBJ(T_Selected,EVENT_PLAYER_UNIT_SELL)
call TriggerAddCondition(T_Selected,Condition(function Selected_Conditions))
call TriggerAddAction(T_Selected,function Selected_Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library RankManagement initializer Init requires GlobalFuncs
//TRIG: CO, Cond: --, Func: sJ
globals
public trigger T
endglobals
private function ManageRank takes nothing returns nothing
local integer i=1
local integer j=19
local player p = GetEnumPlayer()
local integer pid = GetPlayerId(p)
loop
exitwhen i>j
if RANK_MIN_XP[i]<=PLAYER_XP[1+pid] and RANK_MAX_XP[i]>=PLAYER_XP[1+pid] then
set PLAYER_RANK_NAME[1+pid]=RANK_NAME[i]
endif
set i=i+1
endloop
if (S2I(SubStringBJ(PLAYER_RANK_NAME[1+pid],1,2)) > PLAYER_RANK[1+pid]) and (GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING) then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,(GetPlayerName(p)+(" has been promoted to "+SubStringBJ(PLAYER_RANK_NAME[1+pid],3,StringLength(PLAYER_RANK_NAME[1+pid])))))
endif
set PLAYER_RANK[1+pid]=S2I(SubStringBJ(PLAYER_RANK_NAME[1+pid],1,2))
call SetPlayerTechResearchedSwap('R002',S2I(SubStringBJ(PLAYER_RANK_NAME[1+pid],1,2)),p)
call SetPlayerTechResearchedSwap('R00J',(S2I(SubStringBJ(PLAYER_RANK_NAME[1+pid],1,2))/ 3),p)
if (MODE_RIFLE_ON==false) and (CAN_SELECT_EXTRA_MODE==false) then
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[2]) then
call SetPlayerUnitAvailableBJ('H001',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[3]) then
call SetPlayerUnitAvailableBJ('H01I',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[4]) then
call SetPlayerUnitAvailableBJ('H00U',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[5]) then
call SetPlayerUnitAvailableBJ('H00H',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[7]) then
call SetPlayerUnitAvailableBJ('H00N',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[9]) then
if (GAME_MODE!=UA2_ModeUmbrella) and bj_isSinglePlayer==false then
call SetPlayerUnitAvailableBJ('H00M',true,p)
endif
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[10]) then
call SetPlayerUnitAvailableBJ('H00I',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[11]) then
call SetPlayerUnitAvailableBJ('H00D',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[12]) then
call SetPlayerUnitAvailableBJ('H00P',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[14]) then
call SetPlayerUnitAvailableBJ('H008',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[15]) then
call SetPlayerUnitAvailableBJ('H00R',true,p)
endif
if (PLAYER_XP[1+pid]>=RANK_MAX_XP[16]) then
call SetPlayerUnitAvailableBJ('H00J',true,p)
endif
endif
//call SetPlayerName(p,PLAYER_NAMES[1+pid])
call SetPlayerName(p,(SubStringBJ(PLAYER_RANK_NAME[1+pid],3,StringLength(PLAYER_RANK_NAME[1+pid]))+(" "+PLAYER_NAMES[1+pid])))
endfunction
private function Actions takes nothing returns nothing
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function ManageRank)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,2.)
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SetPlayerProperties initializer Init requires GlobalFuncs
//TRIG: uX, Cond: --, Func: aH
//NEED: Force Ax
globals
public trigger T
endglobals
private function SetProperties takes player p returns nothing
call TriggerRegisterPlayerChatEvent(CommandTL_T,p,"-tl",true)
call TriggerRegisterPlayerChatEvent(CommandMS_T,p,"-ms",true)
call TriggerRegisterPlayerChatEvent(CommandT_T,p,"-t",true)
call TriggerRegisterPlayerChatEvent(CommandDEAD_T,p,"-dead",true)
call TriggerRegisterPlayerChatEvent(CommandST_T,p,"-st",true)
call TriggerRegisterPlayerChatEvent(CommandS_T,p,"-s",false)
call TriggerRegisterPlayerChatEvent(CommandC_T,p,"-c",false)
call TriggerRegisterPlayerChatEvent(CommandR_T,p,"-r",false)
call TriggerRegisterPlayerChatEvent(CommandV_T,p,"-v",false)
call TriggerRegisterPlayerChatEvent(CommandNVG_T,p,"-nvg",true)
call TriggerRegisterPlayerChatEvent(CommandCAMLOCK_T,p,"-camlock",true)
call TriggerRegisterPlayerChatEvent(CommandUIC_T,p,"-uic",true)
call TriggerRegisterPlayerChatEvent(T_Selected,p,"-random",true)
call TriggerRegisterPlayerEventLeave(PlayerLeaves_T,p)
call SetPlayerHandicapXPBJ(p,(30.+(I2R(PLAYING_PLAYERS)*1.2)))
call SetPlayerMaxHeroesAllowed(1,p)
call ForceAddPlayer(FIREMODE_SINGLE,p)
// Disable all MOS at start
call SetPlayerUnitAvailableBJ('H00C',false,p)
call SetPlayerUnitAvailableBJ('H000',false,p)
call SetPlayerUnitAvailableBJ('H011',false,p)
call SetPlayerUnitAvailableBJ('H01I',false,p)
call SetPlayerUnitAvailableBJ('H001',false,p)
call SetPlayerUnitAvailableBJ('H00U',false,p)
call SetPlayerUnitAvailableBJ('H008',false,p)
call SetPlayerUnitAvailableBJ('H00D',false,p)
call SetPlayerUnitAvailableBJ('H00H',false,p)
call SetPlayerUnitAvailableBJ('H00I',false,p)
call SetPlayerUnitAvailableBJ('H00J',false,p)
call SetPlayerUnitAvailableBJ('H00N',false,p)
call SetPlayerUnitAvailableBJ('H00M',false,p)
call SetPlayerUnitAvailableBJ('H00P',false,p)
call SetPlayerUnitAvailableBJ('H00R',false,p)
call UnitShareVisionBJ(true,SELECTION_HELICOPTER,p)
call UnitShareVisionBJ(true,SELECTION_TENT_1,p)
call UnitShareVisionBJ(true,SELECTION_TENT_2,p)
call SelectUnitForPlayerSingle(SELECTION_TENT_1,p)
call SetPlayerStateBJ(p,PLAYER_STATE_RESOURCE_FOOD_CAP,1)
// Umbrella
call SetPlayerAllianceStateBJ(p,Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),p,0)
// Infected
call SetPlayerAllianceStateBJ(p,Player(13),0)
call SetPlayerAllianceStateBJ(Player(13),p,0)
call SetPlayerAllianceStateBJ(p,Player(15),0)
call SetPlayerAllianceStateBJ(Player(15),p,0)
// Populace
call SetPlayerAllianceStateBJ(p,Player(12),2)
call SetPlayerAllianceStateBJ(Player(12),p,2)
// USMC
call SetPlayerAllianceStateBJ(p,Player(11),3)
call SetPlayerAllianceStateBJ(Player(11),p,3)
endfunction
private function Actions takes nothing returns nothing
local integer i=0
call EndThematicMusicBJ()
call SetPlayerName(Player(15),"The Infected")
call SetPlayerName(Player(12),"Populace")
call SetPlayerName(Player(14),"Umbrella")
call SetPlayerName(Player(13),"The Infected")
call EnableOcclusionBJ(true, bj_FORCE_ALL_PLAYERS)
call CreateFogModifierRectBJ( true, Player(bj_PLAYER_NEUTRAL_EXTRA), FOG_OF_WAR_FOGGED, GetPlayableMapRect() )
call SetPlayerAllianceStateBJ(Player(11),Player(13),0)
call SetPlayerAllianceStateBJ(Player(13),Player(11),0)
call SetPlayerAllianceStateBJ(Player(13),Player(12),0)
call SetPlayerAllianceStateBJ(Player(12),Player(13),0)
call SetPlayerAllianceStateBJ(Player(15),Player(13),3)
call SetPlayerAllianceStateBJ(Player(13),Player(15),3)
call SetPlayerAllianceStateBJ(Player(11),Player(15),0)
call SetPlayerAllianceStateBJ(Player(15),Player(11),0)
call SetPlayerAllianceStateBJ(Player(12),Player(11),2)
call SetPlayerAllianceStateBJ(Player(11),Player(12),2)
call SetPlayerAllianceStateBJ(Player(11),Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),Player(11),0)
call SetPlayerAllianceStateBJ(Player(14),Player(12),0)
call SetPlayerAllianceStateBJ(Player(12),Player(14),0)
call SetPlayerAllianceStateBJ(Player(15),Player(14),0)
call SetPlayerAllianceStateBJ(Player(14),Player(15),0)
call SetPlayerAllianceStateBJ(Player(15),Player(12),0)
call SetPlayerAllianceStateBJ(Player(12),Player(15),0)
loop
exitwhen i>10
if (GetPlayerSlotState(Player(i))==PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(Player(i))==MAP_CONTROL_USER) then
set PLAYING_PLAYERS=PLAYING_PLAYERS+1
set PLAYER_NAMES[i+1]=GetPlayerName(Player(i))
call SetProperties(Player(i))
endif
set i=i+1
endloop
call SetCreepCampFilterState(false)
call EnableMinimapFilterButtons(true,false)
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_UNITSOUNDS,50.)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GameSetup initializer Init requires GlobalFuncs
//TRIG: QX, Func: th
globals
public trigger T
endglobals
private function SetGameVars takes nothing returns nothing
set BIG_MOFO_LIST[1]='u005'
set BIG_MOFO_LIST[2]='u003'
set BIG_MOFO_LIST[3]='u002'
set BIG_MOFO_LIST[4]='u006'
set BIG_MOFO_LIST[5]='u004'
set BIG_MOFO_LIST[6]='u008'
set BIG_MOFO_LIST[7]='n00P'
set BIG_MOFO_LIST[8]='n00K'
set BIG_MOFO_LIST[9]='n00F'
set BIG_MOFO_LIST[10]='n00G'
set BIG_MOFO_LIST[11]=ZID_Butcher
set BIG_ENEMY_MOFO_AMT=11
// MOS list does not include the UAV MOS
set MOS_LIST[1]='H000'
set MOS_LIST[2]='H00C'
set MOS_LIST[3]='H011'
set MOS_LIST[4]='H001'
set MOS_LIST[5]='H01I'
set MOS_LIST[6]='H00U'
set MOS_LIST[7]='H00H'
set MOS_LIST[8]='H00N'
set MOS_LIST[9]='H00I'
set MOS_LIST[10]='H00D'
set MOS_LIST[11]='H00P'
set MOS_LIST[12]='H008'
set MOS_LIST[13]='H00R'
set MOS_LIST[14]='H00J'
// shows up to what index of the MOS_LIST each rank allows
set MOS_ALLOWED[1]=13
set MOS_ALLOWED[2]=13
set MOS_ALLOWED[3]=13
set MOS_ALLOWED[4]=13
set MOS_ALLOWED[5]=13
set MOS_ALLOWED[6]=13
set MOS_ALLOWED[7]=13
set MOS_ALLOWED[8]=13
set MOS_ALLOWED[9]=13
set MOS_ALLOWED[10]=13
set MOS_ALLOWED[11]=13
set MOS_ALLOWED[12]=13
set MOS_ALLOWED[13]=13
set MOS_ALLOWED[14]=13
set MOS_ALLOWED[15]=13
set MOS_ALLOWED[16]=13
set MOS_ALLOWED[17]=13
set MOS_ALLOWED[18]=13
set MOS_ALLOWED[19]=13
set INJURY_INDIVIDUAL_CHANCE[1]=4
set INJURY_INDIVIDUAL_CHANCE[2]=7
set INJURY_INDIVIDUAL_CHANCE[3]=8
set INJURY_INDIVIDUAL_CHANCE[4]=7
set INJURY_INDIVIDUAL_CHANCE[5]=10
set INJURY_INDIVIDUAL_CHANCE[6]=10
set INJURY_INDIVIDUAL_CHANCE[7]=10
set INJURY_INDIVIDUAL_ORDER[1]=OID_attack
set INJURY_INDIVIDUAL_ORDER[2]=OID_attack
set INJURY_INDIVIDUAL_ORDER[3]=OID_drunkenhaze
set INJURY_INDIVIDUAL_ORDER[4]=OID_slow
set INJURY_INDIVIDUAL_ORDER[5]=OID_parasite
set INJURY_INDIVIDUAL_ORDER[6]=OID_drunkenhaze
set INJURY_INDIVIDUAL_ORDER[7]=OID_drunkenhaze
set INJURY_INDIVIDUAL_ABILITY[1]='A00R'
set INJURY_INDIVIDUAL_ABILITY[2]='A02M'
set INJURY_INDIVIDUAL_ABILITY[3]='A04T'
set INJURY_INDIVIDUAL_ABILITY[4]='A04S'
set INJURY_INDIVIDUAL_ABILITY[5]='A01U'
set INJURY_INDIVIDUAL_ABILITY[6]='A04U'
set INJURY_INDIVIDUAL_ABILITY[7]='A04V'
endfunction
private function SetRankVars takes nothing returns nothing
set RANK_MIN_XP[1]=0
set RANK_MAX_XP[1]=1
set RANK_NAME[1]="01Pvt"
set RANK_MIN_XP[2]=2
set RANK_MAX_XP[2]=10
set RANK_NAME[2]="02Pfc"
set RANK_MIN_XP[3]=11
set RANK_MAX_XP[3]=20
set RANK_NAME[3]="03LCpl"
set RANK_MIN_XP[4]=21
set RANK_MAX_XP[4]=30
set RANK_NAME[4]="04Cpl"
set RANK_MIN_XP[5]=31
set RANK_MAX_XP[5]=40
set RANK_NAME[5]="05Sgt"
set RANK_MIN_XP[6]=41
set RANK_MAX_XP[6]=50
set RANK_NAME[6]="06SSgt"
set RANK_MIN_XP[7]=51
set RANK_MAX_XP[7]=60
set RANK_NAME[7]="07GySgt"
set RANK_MIN_XP[8]=61
set RANK_MAX_XP[8]=70
set RANK_NAME[8]="081stSgt"
set RANK_MIN_XP[9]=71
set RANK_MAX_XP[9]=80
set RANK_NAME[9]="09MGySgt"
set RANK_MIN_XP[10]=81
set RANK_MAX_XP[10]=90
set RANK_NAME[10]="10SgtMaj"
set RANK_MIN_XP[11]=91
set RANK_MAX_XP[11]=100
set RANK_NAME[11]="112ndLt"
set RANK_MIN_XP[12]=101
set RANK_MAX_XP[12]=110
set RANK_NAME[12]="121stLt"
set RANK_MIN_XP[13]=111
set RANK_MAX_XP[13]=120
set RANK_NAME[13]="13Capt"
set RANK_MIN_XP[14]=121
set RANK_MAX_XP[14]=130
set RANK_NAME[14]="14Maj"
set RANK_MIN_XP[15]=131
set RANK_MAX_XP[15]=140
set RANK_NAME[15]="15LtCol"
set RANK_MIN_XP[16]=141
set RANK_MAX_XP[16]=150
set RANK_NAME[16]="16Col"
set RANK_MIN_XP[17]=151
set RANK_MAX_XP[17]=160
set RANK_NAME[17]="17BGen"
set RANK_MIN_XP[18]=161
set RANK_MAX_XP[18]=4000
set RANK_NAME[18]="18MajGen"
set RANK_MIN_XP[19]=4001
set RANK_MAX_XP[19]=999999
set RANK_NAME[19]="19LtGen"
endfunction
private function HideFactoryGuns takes nothing returns nothing
call SetUnitOwner(GetEnumUnit(),Player(14),true)
call ShowUnit(GetEnumUnit(),false)
call PauseUnit(GetEnumUnit(),true)
endfunction
private function SetPoliceOfficersToHold takes nothing returns nothing
call LockGuardPosition(GetEnumUnit())
call IssueImmediateOrderById(GetEnumUnit(),OID_holdposition)
endfunction
private function Actions takes nothing returns nothing
local integer i = 0
local group g
// Create selectors
loop
exitwhen i>10
set PLAYER_SELECTOR[i+1]=CreateUnit(Player(i),'n003',-15000.,-14000.,270.)
set i=i+1
endloop
// More 'special' stuff & uses wait.
call TriggerExecute(SetPlayerProperties_T)
// Too expansive, would fuck up visual aspect of this func.
call SetGameVars()
call SetRankVars()
// Can be deleted soon
//call InitHandleVars()
//set LOCAL_VARS_CACHE=InitGameCache("jasslocalvars.w3v")
// Set Day/Night Models
call SetDayNightModels("Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl","Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl")
//call SetDayNightModels("war3mapImported\\DNCNormalTerrain.mdx","war3mapImported\\DNCNormalUnit.mdx")
// Set Initial Quests
call CreateQuestBJ(2,"Commands","Your suit can tell you viable information. These commands can request more information:\n\"-camlock\" - Locks the camera to the selected unit.\n\"-uic\" - Toggles on/off auto UI cancel in actions menu.\n\"-v #\" - Sets the camera distance (around 25 recommended).\n\"-tl\" - Pings the location of your squad on your digital map.\n\"-dead\" Pings the location of dead squad members on your digital map.\n\"-s\" Changes the amount of shells per fire mission (Forward Observer).\n\"-r\" Changes the maximum radius per fire mission (Forward Observer).\n\"-ms\" Displays the current movement speed of all squad members.\n\"-t\" Displays information about your team and your experience gained.\n\"-nvg\" Toggles night vision on and off, useful if you're dead.\n\"-st\" Displays the statistics of you and your team.\n\"-kick <player color>\" (Player 1 (red) only) Kicks the player of the color. Colors are: red, blue, teal, yellow, purple, orange, green, pink, gray or grey, light blue, dark green.","ReplaceableTextures\\CommandButtons\\BTNMarine.blp")
call CreateQuestBJ(2,"Infestation Level","The infestation level is seen at the top-right portion of your screen in the replacement of food. You want to keep it in the controlled level, which is below or at the second number (it is read: current infestation level/controlled infestation level). The controlled level varies on difficulty settings. High infestation levels can cause mutations to occur more often and can damage or even kill a squad member. Keeping it in the controlled level will offer bonus experience points over time.","war3mapImported\\BTNInfestation.tga")
call CreateQuestBJ(2,"HUD","The HUD has been updated to provide much information in as compact space as possible. The abbreviations are as follows:\nDT: Deployment time displayed in minutes, this is how long the whole game has been.\nMT: Mission time. This is the remaining time you have to complete the current mission.","ReplaceableTextures\\CommandButtons\\BTNSpy.blp")
call CreateQuestBJ(2,"Credits","-Made by illidan92, banzaimonkey, John_S and Magentix.\nVisit our website at: undeadassault.net\n\nIllidan92: Made the map.\nMagentix: Co-developer\nJohn_S: Made some great icons.\nBanzaimonkey: Lead beta tester and website manager. Special thanks, tons of help.\n\n-Special thanks to illidan(evil)X for his modelling talent!\n-Thanks to Hellish Hybrid for his decapitated corpse model.\n-Thanks to Punisher_X for his house rubble, street lamp, barrel, box and power line doodads. \nThanks to Pyramidhe@d and tee.dubs for their awesome models.\n-Special thanks to everyone at wc3jass.com for JASS help.","ReplaceableTextures\\CommandButtons\\BTNChime.blp")
call CreateQuestBJ(2,"Ranking Info","As you complete missions you gain experience. Every 6 enemy kills gives you 1 bonus experience.\n=-Ranks=-\nExperience Needed - Rank - Rank Number:\n0-250=Private1\n251-500=Private First Class2\n501-2500=Lance Corporal3\n2501-5000=Corporal4\n5001-8000=Seargant5\n8001-12000=Staff Seargant6\n12001-20000=Gunnery Seargant7\n20001-30000=Master Seargant8\n30001-40000=Seargant Major9\n40001-50000=Warrant Officer10\n50001-60000=Chief Warrant Officer11\n60001-70000=2nd Lieutenant12\n70001-80000=1st Lieutenant13\n80001-100000=Captain14\n100001-130000=Major15\n130001-190000=Lieutenant Colonel16\n190001-300000=Colonel17\n300001-500000=Lieutenant General18\n500,000+=General19","ReplaceableTextures\\CommandButtons\\BTNAcorn.blp")
call CreateQuestBJ(2,"Technical Issues","Q: The map crashes.\nA: This may be because you have a map hack turned on or a bug in the map.\nQ: I keep hearing wierd sounds playing or firing sounds in other maps.\nA: The overlapping sounds is caused by them not being reset. Restart Warcraft III.\nQ: I keep hearing sounds play over and over.\nA: Go to options > sounds and uncheck \"3d positional audio\".\nQ: I found a bug, have a question or have a suggestion.\nA: Submit them at our website: undeadassault.net","ReplaceableTextures\\CommandButtons\\BTNBanish.blp")
call CreateQuestBJ(2,"Military Strategies","There are various strategies you can use for effective combat. A few are listed here.\n-Patrolling (\"pat\"): If there are 6 or more marines then split into 2 fireteams (groups). Roam around the map (taking to the roads/paths is advised) in a single-file line or leap frogging and gather equipment you find.\n-Dynamic Camping (Dcamping): If there are 6 or more marines you may want to split into 2 fireteams (groups), though it is optional. Travel in a single-file line or leap frogging, going from hill-to-hill. Upon arrival at a hill secure the area (using flares and smokes as necessary) for 1-3 minutes. Then, send out 1/4 to 1/2 the squad to find equipment and return them to the hill.\n*Leap frogging: Leap frogging (or bounding overwatch) is a combat squad maneuver used when on the move. Squad members take turns moving up 5-8 meters and holding position. Squad members should provide cover to those reloading and those reloading should be on the move.","ReplaceableTextures\\CommandButtonsDisabled\\DISBTNCommander.blp")
set OBJECTIVE_QUEST = CreateQuestBJ(0, "Primary Objective", "Await further orders.", "war3mapImported\\BTNHoldPos.blp")
set OBJECTIVE_SECONDARY_QUEST = CreateQuestBJ(0, "Secondary Objective", "No secondary objective.", "war3mapImported\\BTNNVGs.blp")
// Preload MOS
call RemoveUnit(CreateUnit(Player(12),'H000',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H001',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H008',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00H',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00C',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00D',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00I',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00J',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'h00K',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00N',0,0,0.))
call RemoveUnit(CreateUnit(Player(12),'H00P',0,0,0.))
call Preload("war3mapImported\\FA-22 Raptor.mdx")
set g = GetUnitsOfType('h006')
call ForGroupBJ(g,function HideFactoryGuns)
call DestroyGroup(g)
set g = GetUnitsOfType('h005')
call ForGroupBJ(g,function SetPoliceOfficersToHold)
call DestroyGroup(g)
set g = null
set i = 1
loop
exitwhen i>20
// Enter rect -> Supplies mission
call TriggerRegisterEnterRectSimple(kN,ov[i])
set i=i+1
endloop
set STANDARD_INFECTED_GROUP_SIZE=(R2I(PLAYING_PLAYERS*1.4))+11
//Add 1 to slots
if PLAYING_PLAYERS <= 4 then
set ITEM_SLOTS = 5
elseif PLAYING_PLAYERS <= 8 then
set ITEM_SLOTS = 4
else
set ITEM_SLOTS = 3
endif
call TriggerExecute(SetInfectedGroupSize_T)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library template initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
// some shit
endfunction
private function Actions takes nothing returns nothing
// some shit
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library template2 initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
private function Conditions takes nothing returns boolean
// some shit
endfunction
private function Actions takes nothing returns nothing
// some shit
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=57
//TESH.alwaysfold=0
library AIDisables initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T2
public trigger T3
public trigger T4
public trigger T5
public trigger T6
public trigger T7
public trigger T8
endglobals
private function Actions takes nothing returns nothing
if IsTriggerEnabled(NPCSelfHeal_T) then
call DisableTrigger(NPCSelfHeal_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCSelfHeal_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions2 takes nothing returns nothing
if IsTriggerEnabled(NPCCombatEngineer_T) then
call DisableTrigger(NPCCombatEngineer_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCCombatEngineer_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions3 takes nothing returns nothing
if IsTriggerEnabled(NPCCombatEngineer2_T) then
call DisableTrigger(NPCCombatEngineer2_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCCombatEngineer2_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions4 takes nothing returns nothing
if IsTriggerEnabled(NPCAssaultman_T) then
call DisableTrigger(NPCAssaultman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCAssaultman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions5 takes nothing returns nothing
if IsTriggerEnabled(NPCDesignatedMarksman_T) then
call DisableTrigger(NPCDesignatedMarksman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCDesignatedMarksman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions6 takes nothing returns nothing
if IsTriggerEnabled(NPCGhost_T) then
call DisableTrigger(NPCGhost_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCGhost_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions7 takes nothing returns nothing
if IsTriggerEnabled(NPCFrags_T) then
call DisableTrigger(NPCFrags_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCFrags_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
private function Actions8 takes nothing returns nothing
if IsTriggerEnabled(NPCNavyCorpsman_T) then
call DisableTrigger(NPCNavyCorpsman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(NPCNavyCorpsman_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-sh",true)
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T2,Player(0),"-ce",true)
call TriggerAddAction(T2,function Actions2)
set T3 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T3,Player(0),"-ce2",true)
call TriggerAddAction(T3,function Actions3)
set T4 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T4,Player(0),"-as",true)
call TriggerAddAction(T4,function Actions4)
set T5 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T5,Player(0),"-dm",true)
call TriggerAddAction(T5,function Actions5)
set T6 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T6,Player(0),"-gh",true)
call TriggerAddAction(T6,function Actions6)
set T7 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T7,Player(0),"-fr",true)
call TriggerAddAction(T7,function Actions7)
set T8 = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T8,Player(0),"-nc",true)
call TriggerAddAction(T8,function Actions8)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SMDisable initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
if IsTriggerEnabled(UmbrellaSquadManagement_T) then
call DisableTrigger(UmbrellaSquadManagement_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(UmbrellaSquadManagement_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-smd",true)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library MCD initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
if IsTriggerEnabled(UmbrellaMadeContact_T) then
call DisableTrigger(UmbrellaMadeContact_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"disabled.")
else
call EnableTrigger(UmbrellaMadeContact_T)
call DisplayTimedTextToPlayer(Player(0),0,0,5,"enabled.")
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-mcd",true)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SSC initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
call SpawnUmbrellaSquadOfType(S2I( SubStringBJ(s,5,StringLength(s)) ))
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-ss ",false)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GlobalFuncs2 requires GlobalFuncs
// Se = some huge group?
function rh takes player vc,boolean b returns nothing
if vc==GetLocalPlayer()then
if(b)then
call SetTerrainFogEx(0,2100.,4500.,.25,20.,20.,100.)
call CinematicFilterGenericBJ(5.,BLEND_MODE_MODULATE_2X,"ReplaceableTextures\\CameraMasks\\White_mask.blp",.0,0,100,100,0,0,80.,25.)
else
call SetTerrainFogEx(0,350.,4000.,.55,.3,.3,.3)
call CinematicFilterGenericBJ(.5,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\White_mask.blp",50.,100,50.,.0,50.,100.,50.,100.)
call CinematicFilterGenericBJ(.0,BLEND_MODE_BLEND,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",20.,20.,20.,.0,20.,20.,20.,70.)
endif
endif
endfunction
function ah takes integer abil,string order,location dummyloc,location targ,real height returns nothing
local unit u=CreateUnit(Player(13),'h003',GetLocationX(dummyloc),GetLocationY(dummyloc),AngleBetweenPoints(dummyloc,targ))
call SetUnitFlyHeight(u,height,0)
call UnitApplyTimedLifeBJ(3.,'BTLF',u)
call UnitAddAbility(u,abil)
call IssuePointOrderLoc(u,order,targ)
set u=null
endfunction
function Ch takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit())=='o007'
endfunction
function dh takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
function Dh takes real r,location l returns nothing
local group g=GetUnitsInRangeOfLocMatching(r,l,Condition(function Ch))
call ForGroup(g,function dh)
call DestroyGroup(g)
set g=null
endfunction
function Fh takes unit u,real qF,string gh returns nothing
local texttag t
local real x
local real y
if GetUnitState(u,UNIT_STATE_LIFE)>0 then
set x=GetUnitX(u)
set y=GetUnitY(u)
call PlaySoundAtUnitLoc(SOUND_RADIO_FEEDBACK_C_2,u)
set t=CreateTextTag()
call SetTextTagText(t,gh,.0184)
call SetTextTagPos(t,x,y,25.)
call SetTextTagVisibility(t,true)
call SetTextTagLifespan(t,qF)
call SetTextTagPermanent(t,false)
endif
set t=null
endfunction
function Gh takes unit u,real qF,string gh returns nothing
if GetUnitState(u,UNIT_STATE_LIFE)>0 then
call StartSound(SOUND_RADIO_FEEDBACK_C_1)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,qF,gh)
endif
endfunction
function Mh takes nothing returns boolean
return Player(11)==GetOwningPlayer(GetFilterUnit())and IsUnitAliveBJ(GetFilterUnit())and IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false
endfunction
function ph takes nothing returns nothing
local location l=GetUnitLoc(GetEnumUnit())
local location l2=PolarProjectionBJ(l,800.,AngleBetweenPoints(LOCALIZABLE_LOC,l))
call IssuePointOrderByIdLoc(GetEnumUnit(),851986,l2)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
endfunction
function Ph takes location l returns nothing
local group g=GetUnitsInRangeOfLocMatching(800.,l,Condition(function Mh))
local unit u
set u=GroupPickRandomUnit(g)
call NPCGiveOrderChat(u,GetRandomInt(3,4),true)
set LOCALIZABLE_LOC=OffsetLocation(l,0,0)
call ForGroup(g,function ph)
call RemoveLocation(LOCALIZABLE_LOC)
set u=null
call DestroyGroup(g)
set g=null
endfunction
function Trig_Clusteru_GroupCond takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(11)) and IsUnitAliveBJ(GetFilterUnit())
endfunction
function Trig_Clusteru_GroupCond2 takes nothing returns boolean
return IsPlayerAlly(GetOwningPlayer(GetFilterUnit()),Player(11)) and IsUnitAliveBJ(GetFilterUnit())
endfunction
function jL takes nothing returns boolean
return GetUnitTypeId(GetDyingUnit())=='o007'
endfunction
function JL takes nothing returns nothing
local unit u=GetDyingUnit()
local location l=GetUnitLoc(u)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\ClaymoreExplode.mdx",l))
call RemoveLocation(l)
set l=null
set u=null
endfunction
function kL takes nothing returns boolean
return GetUnitTypeId(GetDyingUnit())=='n00E'
endfunction
function KL takes nothing returns nothing
local unit u=GetDyingUnit()
local location l=GetUnitLoc(u)
if GetRandomInt(1,2)==1 then
call PolledWait2(GetRandomReal(.02,1.5))
else
call PolledWait2(GetRandomReal(.02,5.5))
endif
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Zombie Explosion.mdx",l))
call UnitDamagePointLoc((u),0,GetRandomReal(200,350),l,GetRandomInt(125,225),ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call Dh(350.,l)
call RemoveLocation(l)
set l=null
set u=null
endfunction
function lL takes nothing returns nothing
call SetPlayerTechResearchedSwap('R00H',(GetUnitAbilityLevelSwapped('A01C',GetEnumUnit())+GetUnitAbilityLevelSwapped('A01D',GetEnumUnit())),GetOwningPlayer(GetEnumUnit()))
endfunction
function LL takes nothing returns nothing
set LOCALIZABLE_GROUP=GetUnitsOfType('H00C')
call ForGroupBJ(LOCALIZABLE_GROUP,function lL)
call DestroyGroup(LOCALIZABLE_GROUP)
endfunction
function YL takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='h00K')and(GetItemTypeId(GetManipulatedItem())=='I00K')
endfunction
function zL takes nothing returns nothing
call RemoveItem(GetManipulatedItem())
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Hellfire M2 rockets installed.")
call SetUnitAbilityLevelSwapped('A02B',GetManipulatingUnit(),(GetUnitAbilityLevelSwapped('A02B',GetManipulatingUnit())+1))
endfunction
function ZL takes nothing returns boolean
return(GetSpellAbilityId()=='A00Q')and(GetUnitAbilityLevelSwapped('A00Q',GetSpellAbilityUnit())>=3)
endfunction
function vm takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I004')
endfunction
function em takes nothing returns boolean
return(GetSpellAbilityId()=='A00N')
endfunction
function xm takes nothing returns boolean
return(GetSpellAbilityId()=='A01D')and(GetUnitAbilityLevelSwapped('A01D',GetSpellAbilityUnit())>=2)
endfunction
function om takes nothing returns boolean
return(GetSpellAbilityId()=='A05I')or(xm())
endfunction
function rm takes nothing returns boolean
return(om())
endfunction
function im takes nothing returns boolean
return(GetSpellAbilityId()=='A06J')and(GetUnitAbilityLevelSwapped('A06J',GetSpellAbilityUnit())>=2)
endfunction
function am takes nothing returns boolean
return(GetSpellAbilityId()=='A06J')and(GetUnitAbilityLevelSwapped('A06J',GetSpellAbilityUnit())>=3)
endfunction
function nm takes nothing returns boolean
return(GetSpellAbilityId()=='A01D')and(GetUnitAbilityLevelSwapped('A01D',GetSpellAbilityUnit())>=3)
endfunction
function Vm takes nothing returns nothing
local unit u
if(ZL())then
set u=GetSpellAbilityUnit()
call UnitRemoveAbility(u,'B005')
call UnitRemoveAbility(u,'B00M')
call UnitRemoveAbility(u,'B00D')
call UnitRemoveAbility(u,'Bssd')
call UnitRemoveAbility(u,'B01N')
call UnitRemoveAbility(u,'B01O')
endif
if(vm())then
set u=GetManipulatingUnit()
call UnitRemoveAbility(u,'B005')
call UnitRemoveAbility(u,'Bssd')
call UnitRemoveAbility(u,'B00C')
call UnitRemoveAbility(u,'B011')
call UnitRemoveAbility(u,'B012')
call UnitRemoveAbility(u,'B00M')
call UnitRemoveAbility(u,'B00Z')
call UnitRemoveAbility(u,'B00D')
call UnitRemoveAbility(u,'Bssd')
call UnitRemoveAbility(u,'B01N')
call UnitRemoveAbility(u,'B01O')
endif
if(em())then
set u=GetSpellTargetUnit()
call UnitRemoveAbility(u,'B005')
call UnitRemoveAbility(u,'Bssd')
endif
if(rm())then
set u=GetSpellTargetUnit()
call UnitRemoveAbility(u,'B005')
call UnitRemoveAbility(u,'B00M')
call UnitRemoveAbility(u,'B00Z')
call UnitRemoveAbility(u,'B00D')
call UnitRemoveAbility(u,'Bssd')
call UnitRemoveAbility(u,'B01N')
call UnitRemoveAbility(u,'B01O')
endif
if(im())then
set u=GetSpellTargetUnit()
call UnitRemoveAbility(u,'B005')
endif
if(am())then
set u=GetSpellTargetUnit()
call UnitRemoveAbility(u,'B00M')
call UnitRemoveAbility(u,'B00Z')
call UnitRemoveAbility(u,'B00D')
call UnitRemoveAbility(u,'Bssd')
call UnitRemoveAbility(u,'B01N')
call UnitRemoveAbility(u,'B01O')
endif
if(nm())then
set u=GetSpellTargetUnit()
call UnitRemoveAbility(u,'B00C')
call UnitRemoveAbility(u,'B011')
call UnitRemoveAbility(u,'B012')
call UnitRemoveAbility(u,'Bssd')
endif
set u=null
endfunction
function Om takes nothing returns boolean
return GetSpellAbilityId()=='A047'
endfunction
function Rm takes nothing returns nothing
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local group g=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(u),'o003')
local unit u2=GroupPickRandomUnit(g)
if CountUnitsInGroup(g)<14 then
call CreateUnit(GetOwningPlayer(u),'o004',GetLocationX(l),GetLocationY(l),GetUnitFacing(u))
else
call RemoveUnit(u2)
call CreateUnit(GetOwningPlayer(u),'o004',GetLocationX(l),GetLocationY(l),GetUnitFacing(u))
endif
call RemoveLocation(l)
set l=null
set u=null
set u2=null
call DestroyGroup(g)
endfunction
function Im takes nothing returns boolean
return(GetSpellAbilityId()=='A03H')
endfunction
function Am takes nothing returns boolean
return(CountUnitsInGroup(GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()),'h004'))>=2)
endfunction
function Nm takes nothing returns nothing
local unit u
if(Am())then
call KillUnit(GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()),'h004')))
endif
call CreateNUnitsAtLoc(1,'h004',GetOwningPlayer(GetTriggerUnit()),GetSpellTargetLoc(),bj_UNIT_FACING)
call SetUnitAnimation(bj_lastCreatedUnit,"birth")
set u=bj_lastCreatedUnit
call PolledWait2(.67)
call ResetUnitAnimation(u)
set u=null
endfunction
function bm takes nothing returns boolean
return GetSpellAbilityId()=='A032'
endfunction
function Bm takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local location l=GetSpellTargetLoc()
local group g=GetUnitsOfPlayerAndTypeId(p,'o003')
local unit u2=GroupPickRandomUnit(g)
if CountUnitsInGroup(g)>=5 then
call RemoveUnit(u2)
endif
call CreateUnit(p,'o003',GetLocationX(l),GetLocationY(l),GetRandomReal(0,360))
call DestroyGroup(g)
set u=null
set u2=null
call RemoveLocation(l)
set l=null
endfunction
function cm2 takes nothing returns boolean
return GetSpellAbilityId()=='A05P'
endfunction
function Cm takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local location l=GetSpellTargetLoc()
local group g=GetUnitsOfPlayerAndTypeId(p,'o007')
local integer i=CountUnitsInGroup(g)
local unit u2=GroupPickRandomUnit(g)
if i>=7 then
call RemoveUnit(u2)
endif
call CreateNUnitsAtLoc(1,'o007',p,l,285.)
call DestroyGroup(g)
set u=null
set u2=null
call RemoveLocation(l)
set l=null
endfunction
function Dm takes nothing returns boolean
return GetSpellAbilityId()=='A020' or GetSpellAbilityId()=='A05Z'
endfunction
function fm takes nothing returns nothing
local integer i=0
local unit u
local location l=GetSpellTargetLoc()
local location l2=OffsetLocation(l,GetRandomInt(-2000,-3000),GetRandomInt(-1000,1000))
set u=CreateUnit(P_USMC,'h01G',GetLocationX(l2),GetLocationY(l2),.0)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,5.,2,100,30.,30.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Close air support inbound.")
call RemoveLocation(l2)
loop
exitwhen i>10
call UnitShareVision(u,Player(i),true)
set i=i+1
endloop
set i=0
loop
exitwhen i>22
set l2=OffsetLocation(l,GetRandomInt(-1000,1000),GetRandomInt(-1000,1000))
call IssuePointOrderByIdLoc(u,851986,l2)
call RemoveLocation(l2)
set i=i+1
call PolledWait2(2.5)
call IssueImmediateOrderById(u,OID_holdposition)
call PolledWait2(1.5)
endloop
set l2=GetRandomLocInRect(MAP_BORDER_L)
call IssuePointOrderByIdLoc(u,851986,l2)
call PolledWait2(4.)
call RemoveUnit(u)
set u=null
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
endfunction
function Fm takes nothing returns boolean
return(GetSpellAbilityId()=='A01R')
endfunction
function gm takes nothing returns nothing
local unit u=GetTriggerUnit()
local location l=GetUnitLoc(u)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\ClaymoreExplode.mdx",l))
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Satchel Explosion.mdx",l))
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Explosion.mdl",l))
call Dh(350.,l)
call UnitDamagePointLoc(u,0,350.,l,1800.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call DamageDestructables(GetUnitX(u),GetUnitY(u),350,1800)
call WG()
call DeafenPlayersInDistanceOfLoc(l,1400)
call RemoveUnit(u)
set u=null
call RemoveLocation(l)
set l=null
endfunction
function Hm takes nothing returns boolean
return GetSpellAbilityId()=='A02Z'
endfunction
function jm takes nothing returns nothing
local unit u=GetSpellTargetUnit()
local unit u2=GetSpellAbilityUnit()
local unit u3
local unit boom
local player p=GetOwningPlayer(u2)
local location l=GetUnitLoc(u)
local integer i=10
local real x=GetUnitX(u)
local real y=GetUnitY(u)
if(GetUnitTypeId(u)=='o003')then
call GroupAddUnit(Jv,u)
call DisplayTimedTextToForce(GetForceOfPlayer(p),5.,"C4 primed.")
endif
if(GetUnitTypeId(u)=='o006')then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,5.,"Satchel primed.")
call KillUnit(u)
set u3=CreateUnit(p,'h00S',GetLocationX(l),GetLocationY(l),.0)
call UnitApplyTimedLifeBJ(10.,'BTLF',u3)
call PolledWait2(1.)
loop
exitwhen i<1
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,1.,2,100.,50.,50.)
call PolledWait2(.3)
set i=i-1
endloop
call SetSoundPosition(zE,x,y,10)
call StartSound(zE)
call PolledWait2(2.)
call DestroyEffect(AddSpecialEffect("war3mapImported\\Satchel Explosion.mdx",x,y))
call DestroyEffect(AddSpecialEffect("war3mapImported\\NewMassiveEX.mdx",x,y))
set boom= CreateUnit(GetOwningPlayer(u2),'h01U',x,y,0)
call UnitApplyTimedLifeBJ(5.,'BTLF',boom)
call UnitDamagePointLoc((u2),0,1200,l,18000,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call DamageDestructables(x,y,1200,18000)
call Dh(1200.,l)
call HugeExplosion(x,y)
call StartSound(OE)
call DeafenPlayersInDistanceOfLoc(l,2400)
call RumbleCam(15.,1.)
endif
set u=null
set u2=null
set u3=null
set boom=null
call RemoveLocation(l)
set l=null
endfunction
function Jm takes nothing returns boolean
return GetSpellAbilityId()=='A02X'
endfunction
function Km takes nothing returns nothing
local location l=GetUnitLoc(GetEnumUnit())
local unit u=GetEnumUnit()
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",l))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",l))
call WG()
call Dh(350.,l)
call UnitDamagePointLoc(u,0,350.,l,600.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call DamageDestructables(GetUnitX(u),GetUnitY(u),350,450)
call KillUnit(u)
call RemoveLocation(l)
set l=null
set u=null
endfunction
function lm takes nothing returns nothing
call ForGroupBJ(Jv,function Km)
endfunction
function Lm takes nothing returns boolean
return GetSpellAbilityId()=='A01G'
endfunction
function mm takes nothing returns nothing
local location o=GetSpellTargetLoc()
local unit u=GetSpellAbilityUnit()
local location l2=GetUnitLoc(u)
local real d=DistanceBetweenPoints(o,l2)
local location l=OffsetLocation(o,GetRandomReal(-(d/25),d/25),GetRandomReal(-(d/25),d/25))
call CreateTextTagUnitBJ("|cffFF0000"+GetUnitName(u)+": Fire in the hole!",u,25.,8.,50.,100,50.,10.)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundOnUnitBJ(SOUND_RADIO_FEEDBACK_C_2,100,(u))
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call PolledWait2(2.)
set l2=GetUnitLoc(u)
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A02R')
call SetUnitAbilityLevelSwapped('A02R',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A01G',GetTriggerUnit()))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852652,l)
call PlaySoundAtUnitLoc(YE,u)
call Ph(l)
call PolledWait2((d/ 5000)+.65)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),l,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\BigExplosionBlue.mdl",l))
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Cyclon Explosion.mdx",l))
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\NightElf\\NECancelDeath\\NECancelDeath.mdl",l))
call Dh(125.+(25.*I2R(GetUnitAbilityLevelSwapped('A01G',u))),l)
call UnitDamagePointLoc(u,0,(400.+(50.*I2R(GetUnitAbilityLevelSwapped('A01G',u)))),l,(2000.+(500.*I2R(GetUnitAbilityLevelSwapped('A01G',u)))),ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
call RemoveLocation(o)
set o=null
set u=null
endfunction
function Mm takes nothing returns boolean
return GetSpellAbilityId()=='A01J' or GetSpellAbilityId()=='A05X'
endfunction
function pm takes nothing returns nothing
local location o=GetSpellTargetLoc()
local location l2
local unit u=GetSpellAbilityUnit()
local location l3=GetUnitLoc(u)
local real d=DistanceBetweenPoints(o,l3)
local location l=OffsetLocation(o,GetRandomReal(-(d/25),d/25),GetRandomReal(-(d/25),d/25))
local integer i=0
call GroupAddUnit(NADING,u)
call CreateTextTagUnitBJ((("|cffFF0000"+GetUnitName((u)))+": Fire in the hole!"),(u),25.,8.,50.,100,50.,10.)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundOnUnitBJ(SOUND_RADIO_FEEDBACK_C_2,100,(u))
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l3,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call PolledWait2(2.)
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l3,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A00F')
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852652,l)
call PlaySoundOnUnitBJ(YE,100,u)
call Ph(l)
call PolledWait2((d/ 5000)+.65)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),(l),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
loop
exitwhen i>GetRandomInt(2,3)
set l2=OffsetLocation(l,GetRandomInt(-50,50),GetRandomInt(-50,50))
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",(l2)))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",(l2)))
call UnitDamagePointLoc((u),0,200.,l2,200.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call RemoveLocation(l2)
set i=i+1
endloop
call Dh(125.+(25.*I2R(GetUnitAbilityLevelSwapped('A01J',(u)))),l)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Satchel Explosion.mdx",(l)))
call UnitDamagePointLoc((u),0,175.+(25.*I2R(GetUnitAbilityLevelSwapped('A01J',(u)))),(l),(3700.+(800.*I2R(GetUnitAbilityLevelSwapped('A01J',(u))))),ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call YG()
call DeafenPlayersInDistanceOfLoc(l,800)
call RumbleCam(10.,.55)
call GroupRemoveUnit(NADING,u)
call RemoveLocation(l)
set l=null
set l2=null
call RemoveLocation(l3)
set l3=null
call RemoveLocation(o)
set o=null
set u=null
endfunction
function Pm takes nothing returns boolean
return(GetSpellAbilityId()=='A02B')
endfunction
function qm takes nothing returns nothing
local location l2
local unit u=GetSpellAbilityUnit()
local location l3=GetUnitLoc(u)
local real d=DistanceBetweenPoints(GetSpellTargetLoc(),l3)
local location l=OffsetLocation(GetSpellTargetLoc(),GetRandomReal(-(d/25),d/25),GetRandomReal(-(d/25),d/25))
local integer i=0
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l3,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call PolledWait2(.25)
call CreateNUnitsAtLoc(1,'h00L',GetOwningPlayer(u),l3,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A00F')
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852652,(l))
call SetUnitAnimation((u),"spell")
call PlaySoundOnUnitBJ(YE,100,(u))
call Ph(l)
call PolledWait2((d/ 5000)+.65)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),(l),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
loop
exitwhen i>GetRandomInt(2,3)
set l2=OffsetLocation(l,GetRandomInt(-130,130),GetRandomInt(-130,130))
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",(l2)))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",(l2)))
set i=i+1
endloop
call Dh(350.+(100.*I2R(GetUnitAbilityLevelSwapped('A02B',(u)))),l)
call UnitDamagePointLoc((u),0,350.+(100.*I2R(GetUnitAbilityLevelSwapped('A02B',(u)))),l,(900.+(400.*I2R(GetUnitAbilityLevelSwapped('A02B',(u))))),ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call YG()
call DeafenPlayersInDistanceOfLoc((l),800)
call RumbleCam(10.,.55)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
call RemoveLocation(l3)
set l3=null
set u=null
endfunction
function Wm takes nothing returns boolean
return(GetSpellAbilityId()=='A04G')
endfunction
function ym takes nothing returns nothing
call AdjustPlayerStateBJ(30,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call PlaySoundOnUnitBJ(YV,100,GetTriggerUnit())
endfunction
function Ym takes nothing returns boolean
return(GetSpellAbilityId()=='A03R')and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>=10)
endfunction
function zm takes nothing returns boolean
return(RAINING)
endfunction
function Zm takes nothing returns nothing
if(zm())then
call AdjustPlayerStateBJ(-15,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
else
call AdjustPlayerStateBJ(-10,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
endif
endfunction
function vM takes nothing returns boolean
return(RAINING)and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)<15)
endfunction
function eM takes nothing returns boolean
return(RAINING==false)and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)<10)
endfunction
function xM takes nothing returns boolean
return(vM())or(eM())
endfunction
function oM takes nothing returns boolean
return(GetSpellAbilityId()=='A03R')and(xM())
endfunction
function rM takes nothing returns nothing
call IssueImmediateOrderById(GetTriggerUnit(),OID_holdposition)
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),10.,"Not enough fuel to discharge.")
endfunction
function iM takes nothing returns nothing
call CreateFogModifierRectBJ(true,GetEnumPlayer(),FOG_OF_WAR_FOGGED,bj_mapInitialPlayableArea)
endfunction
function aM takes nothing returns boolean
return(No==false)
endfunction
function nM takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A024',GetEnumUnit())==4)
endfunction
function VM takes nothing returns nothing
call SetPlayerTechResearchedSwap('R006',GetUnitAbilityLevelSwapped('A024',PLAYER_UNIT[(1+GetPlayerId(GetOwningPlayer(GetEnumUnit())))]),GetOwningPlayer(GetEnumUnit()))
call SetUnitAbilityLevelSwapped('A022',GetEnumUnit(),GetUnitAbilityLevelSwapped('A024',GetEnumUnit()))
if(nM())then
if(aM())then
// AMHS REMOVAL: #### vC
call ForForce(GetPlayersAllies(GetOwningPlayer(GetEnumUnit())),function iM)
// AMHS REMOVAL: #### eC
set No=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Reconnaissance online.")
endif
endif
endfunction
function EM takes nothing returns nothing
set LOCALIZABLE_GROUP=GetUnitsOfType('H00I')
call ForGroupBJ(LOCALIZABLE_GROUP,function VM)
call DestroyGroup(LOCALIZABLE_GROUP)
endfunction
function RM takes nothing returns boolean
return GetSpellAbilityId()=='A049' or GetSpellAbilityId()=='A048'
endfunction
function IM takes nothing returns nothing
local location l=GetSpellTargetLoc()
local unit u=GetTriggerUnit()
local location l2=GetUnitLoc(u)
call GroupAddUnit(NADING,u)
if DistanceBetweenPoints(l2,l)<=1400. and GetRandomInt(1,8)!=1 then
set l=OffsetLocation(l,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
set l=OffsetLocation(l,GetRandomReal(-150.,150.),GetRandomReal(-150.,150.))
endif
call Fh(u,8,"|cff808000"+GetPlayerName(GetOwningPlayer(u))+":|r Frag out!")
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundOnUnitBJ(SOUND_RADIO_FEEDBACK_C_2,100,u)
call PolledWait2(.5)
call PlaySoundOnUnitBJ(gg_snd_pinpull,100,u)
call CreateNUnitsAtLoc(1,'h010',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851984,l)
call Ph(l)
call PolledWait2(1.)
call CreateNUnitsAtLoc(1,'h003',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A030')
if GetSpellAbilityId()=='A048' then
call SetUnitAbilityLevelSwapped('A030',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A048',GetTriggerUnit()))
else
call SetUnitAbilityLevelSwapped('A030',bj_lastCreatedUnit,3)
endif
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852488,l)
call GroupRemoveUnit(NADING,u)
call PolledWait2(.3)
call PlaySoundBJ(QV)
call DeafenPlayersInDistanceOfLoc((l),600)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
function AM takes nothing returns boolean
return GetSpellAbilityId()=='A04A' or GetSpellAbilityId()=='A04C' or GetSpellAbilityId()=='A04D' or GetSpellAbilityId()=='A04M'
endfunction
function NM takes nothing returns nothing
local location l=GetSpellTargetLoc()
local unit u=GetTriggerUnit()
local location l2=GetUnitLoc(u)
local destructable destruct
call GroupAddUnit(NADING,u)
if GetSpellAbilityId()=='A04M' then
if DistanceBetweenPoints(l2,l)<=1200. then
set l=OffsetLocation(l,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
if GetRandomInt(1,7)!=1 and DistanceBetweenPoints(l2,l)<=1800. then
if GetRandomInt(1,3)!=1 then
set l=OffsetLocation(l,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
set l=OffsetLocation(l,GetRandomReal(-100.,100.),GetRandomReal(-100.,100.))
endif
else
set l=OffsetLocation(l,GetRandomReal(-200.,200.),GetRandomReal(-200.,200.))
endif
endif
else
if GetRandomInt(1,8)!=1 and DistanceBetweenPoints(l2,l)<=1400. then
set l=OffsetLocation(GetSpellTargetLoc(),GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
set l=OffsetLocation(GetSpellTargetLoc(),GetRandomReal(-200.,200.),GetRandomReal(-200.,200.))
endif
endif
call Fh(u,8,"|cff808000"+GetPlayerName(GetOwningPlayer(u))+":|r Smoke!")
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundAtUnitLoc(SOUND_RADIO_FEEDBACK_C_2,u)
call Ph(l)
if GetSpellAbilityId()=='A04M' then
call PlaySoundAtUnitLoc(nE,u)
call CreateNUnitsAtLoc(1,'h012',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851984,l)
call PolledWait2(1.8)
else
call PolledWait2(.4)
call PlaySoundAtUnitLoc(gg_snd_pinpull,u)
call CreateNUnitsAtLoc(1,'h00Z',GetOwningPlayer(u),l2,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851984,l)
call PolledWait2(1.5)
call GroupRemoveUnit(NADING,u)
call PolledWait2(1)
endif
call CreateNUnitsAtLoc(1,'h00Y',GetOwningPlayer(u),l,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(45.,'BTLF',bj_lastCreatedUnit)
call PlaySoundAtUnitLoc(XX,bj_lastCreatedUnit)
call VisionUnit(bj_lastCreatedUnit,true)
set destruct = CreateDestructableLoc('B005',l,0,1,0)
call PolledWait2(45)
call RemoveDestructable(destruct)
set destruct=null
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
function CM takes nothing returns boolean
return GetSpellAbilityId()=='A059'
endfunction
function dM takes nothing returns nothing
local unit u=GetTriggerUnit()
call rh(GetOwningPlayer(u),true)
call PolledWait2(15.)
call rh(GetOwningPlayer(u),false)
set u=null
endfunction
function DM takes nothing returns boolean
return GetSpellAbilityId()=='A031'
endfunction
function fM takes nothing returns nothing
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Ion cannon successfully directed.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,5.,2,100,30.,30.)
call PolledWait2(2)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\LasercannonfinalRED.mdx",l))
call Ph(l)
call PolledWait2(1.4)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),l,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call Dh(900.,l)
call UnitDamagePointLoc(u,0,900.,l,15000.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call PlaySoundBJ(RE)
call RumbleCam(12.,1.15)
set u=null
endfunction
// ION CANNON CONDITION AND ACTION
function FM takes nothing returns boolean
return GetSpellAbilityId()=='A05V' and DISABLE_ION_CANNON==false
endfunction
function gM takes nothing returns nothing
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local effect e=AddSpecialEffectLoc("Abilities\\Spells\\Orc\\Bloodlust\\BloodlustTarget.mdl",l)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cffffcc00Ion cannon successfully directed.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,5.,2,100,30.,30.)
call PolledWait2(5.)
call DestroyEffect(e)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\LasercannonfinalRED.mdx",l))
call PolledWait2(1.4)
call CreateNUnitsAtLoc(1,'h00S',GetOwningPlayer(u),(l),bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(4.,'BTLF',bj_lastCreatedUnit)
call Dh(900.,l)
call UnitDamagePointLoc((u),0,800.,(l),3000.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call PlaySoundBJ(RE)
call RumbleCam(12.,1.15)
set u=null
endfunction
function GM takes nothing returns boolean
return GetSpellAbilityId()=='A018' and SHELLS>=FM_SHELLS
endfunction
function hM takes nothing returns nothing
local location l1=GetSpellTargetLoc()
local location l2
local unit u=GetSpellAbilityUnit()
local unit u2
local integer i1=1
local integer i2=FM_SHELLS
local integer i3=FM_RADIUS
local integer i4=GetUnitAbilityLevelSwapped('A03A',u)
local effect e1
local effect array e2
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,(l1),5.,0,40,40,80)
set SHELLS=SHELLS-FM_SHELLS
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(u)),5.,("Shells Remaining: "+I2S(SHELLS)))
set e1=AddSpecialEffectLocBJ(l1,"Abilities\\Spells\\Human\\DevotionAura\\DevotionAura.mdl")
call PolledWait2((16.-2*I2R(GetUnitAbilityLevelSwapped('A011',(u)))))
call DestroyEffect(e1)
loop
exitwhen i1>i2
set l2=(PolarProjectionBJ((l1),GetRandomReal(.0,I2R(i3)),GetRandomReal(0,360)))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\Flare\\FlareTarget.mdl",l2))
set e2[i1]=AddSpecialEffectLoc("war3mapImported\\StrongLight.MDX",l2)
call UnitDamagePointLoc(u,0,800.,l2,50.+(50.*I2R(i4)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
set u2=CreateUnit(GetOwningPlayer(u),'h00S',GetLocationX(l2),GetLocationY(l2),bj_UNIT_FACING)
call UnitAddAbility(u2,'A05Q')
call UnitApplyTimedLifeBJ(3.+I2R(i4),'BTLF',u2)
call RemoveLocation(l2)
call PolledWait2(GetRandomReal(1.2,4.85))
set i1=i1+1
endloop
call PolledWait2(3.+I2R(i4))
set i1=1
loop
exitwhen i1>i2
call DestroyEffect(e2[i1])
set i1=i1+1
endloop
call RemoveLocation(l1)
call RemoveLocation(l2)
set l1=null
set l2=null
set u=null
set u2=null
endfunction
function KM takes nothing returns boolean
return GetSpellAbilityId()=='A06O' and(GetUnitAbilityLevel(GetSpellTargetUnit(),'B01D')<=0)
endfunction
function lM takes nothing returns nothing
call UnitShareVision(pe,GetEnumPlayer(),true)
endfunction
function LM takes nothing returns nothing
call UnitShareVision(pe,GetEnumPlayer(),false)
endfunction
function mM takes nothing returns nothing
local unit u=GetSpellTargetUnit()
local unit u2=GetTriggerUnit()
local location l
set pe=u
call ForForce(bj_FORCE_ALL_PLAYERS,function lM)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,12.,GetUnitName(u)+" has been designated.")
loop
set l=GetUnitLoc(u)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,l,1.,0,100.,65.,65.)
call RemoveLocation(l)
call PolledWait2(2.)
exitwhen GetUnitAbilityLevel(u,'B01D')<=0
endloop
set pe=u
call ForForce(bj_FORCE_ALL_PLAYERS,function LM)
set u=null
set u2=null
set l=null
endfunction
function QM takes nothing returns nothing
set MAG_SIZE[(1+GetPlayerId(GetOwningPlayer(GetEnumUnit())))]=(100+(100*GetUnitAbilityLevelSwapped('A05B',GetEnumUnit())))
endfunction
function sM takes nothing returns nothing
set LOCALIZABLE_GROUP=GetUnitsOfType('H001')
call ForGroupBJ(LOCALIZABLE_GROUP,function QM)
call DestroyGroup(LOCALIZABLE_GROUP)
endfunction
function SM takes nothing returns boolean
return GetSpellAbilityId()=='A04J' or GetSpellAbilityId()=='A01T'
endfunction
function tM takes nothing returns nothing
local unit u
local location l2=GetUnitLoc(GetTriggerUnit())
local location Eh=GetSpellTargetLoc()
local location l=OffsetLocation(Eh,GetRandomReal(-100.,100.),GetRandomReal(-100.,100.))
if DistanceBetweenPoints(l2,Eh)<=1200. then
set l=OffsetLocation(Eh,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
if GetRandomInt(1,7)!=1 and DistanceBetweenPoints(l2,Eh)<=1800. then
if GetRandomInt(1,3)!=1 then
set l=OffsetLocation(Eh,GetRandomReal(-85.,85.),GetRandomReal(-85.,85.))
else
set l=OffsetLocation(Eh,GetRandomReal(-125.,125.),GetRandomReal(-125.,125.))
endif
else
set l=OffsetLocation(Eh,GetRandomReal(-165.,165.),GetRandomReal(-165.,165.))
endif
endif
call Fh(GetTriggerUnit(),8,"|cff808000"+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+":|r Frag out!")
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundAtUnitLoc(SOUND_RADIO_FEEDBACK_C_2,GetTriggerUnit())
call PlaySoundAtUnitLoc(nE,GetTriggerUnit())
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h012',GetLocationX(l2),GetLocationY(l2),AngleBetweenPoints(l2,l))
call UnitApplyTimedLifeBJ(3.,'BTLF',u)
call IssuePointOrderByIdLoc(u,851984,l)
call Ph(l)
call PolledWait2(1.25)
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h003',GetLocationX(l2),GetLocationY(l2),AngleBetweenPoints(l2,l))
call UnitApplyTimedLifeBJ(5.,'BTLF',u)
call UnitAddAbility(u,'A04K')
if GetSpellAbilityId()=='A01T' then
call SetUnitAbilityLevelSwapped('A04K',u,3)
else
call SetUnitAbilityLevelSwapped('A04K',u,GetUnitAbilityLevelSwapped('A04J',GetTriggerUnit()))
endif
call IssuePointOrderByIdLoc(u,852488,l)
call PolledWait2(.3)
call yG()
call DeafenPlayersInDistanceOfLoc(l,800)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
call RemoveLocation(Eh)
set Eh=null
set u=null
endfunction
function TM takes nothing returns boolean
return GetSpellAbilityId()=='A04N'
endfunction
function uM takes nothing returns nothing
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Undead\\UndeadLargeDeathExplode\\UndeadLargeDeathExplode.mdl",GetEnumUnit(),"origin"))
call SetUnitExploded(GetEnumUnit(),true)
endfunction
function UM takes nothing returns nothing
call SetUnitExploded(GetEnumUnit(),false)
endfunction
function wM takes nothing returns nothing
call SetDestructableLife(GetEnumDestructable(),(GetDestructableLife(GetEnumDestructable())-(300.+300.*I2R(bj_forLoopAIndex))))
if IsDestructableAliveBJ(GetEnumDestructable()) then
call SetDestructableAnimation(GetEnumDestructable(),"stand hit")
endif
endfunction
function WM takes nothing returns nothing
if IsDestructableAliveBJ(GetEnumDestructable()) then
call SetDestructableAnimation(GetEnumDestructable(),"stand")
endif
endfunction
function yM takes nothing returns nothing
local unit u
local location l2=GetUnitLoc(GetTriggerUnit())
local location Eh=GetSpellTargetLoc()
local location l=OffsetLocation(Eh,GetRandomReal(-100.,100.),GetRandomReal(-100.,100.))
if DistanceBetweenPoints(l2,Eh)<=1200. then
set l=OffsetLocation(Eh,GetRandomReal(-75.,75.),GetRandomReal(-75.,75.))
else
if GetRandomInt(1,7)!=1 and DistanceBetweenPoints(l2,Eh)<=1800. then
if GetRandomInt(1,3)!=1 then
set l=OffsetLocation(Eh,GetRandomReal(-85.,85.),GetRandomReal(-85.,85.))
else
set l=OffsetLocation(Eh,GetRandomReal(-125.,125.),GetRandomReal(-125.,125.))
endif
else
set l=OffsetLocation(Eh,GetRandomReal(-200.,200.),GetRandomReal(-200.,200.))
endif
endif
call Fh(GetTriggerUnit(),8,"|cff808000"+GetPlayerName(GetOwningPlayer(GetTriggerUnit()))+":|r Frag out!")
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call PlaySoundAtUnitLoc(SOUND_RADIO_FEEDBACK_C_2,GetTriggerUnit())
call PlaySoundAtUnitLoc(nE,GetTriggerUnit())
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h012',GetLocationX(l2),GetLocationY(l2),AngleBetweenPoints(l2,l))
call UnitApplyTimedLifeBJ(3.,'BTLF',u)
call IssuePointOrderByIdLoc(u,851984,l)
call Ph(l)
call PolledWait2(1.25)
set LOCALIZABLE_LOC=l
call ForGroupBJ(GetUnitsInRangeOfLocAll(400.,LOCALIZABLE_LOC),function uM)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Satchel Explosion.mdx",l))
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\ground.mdx",l))
call Dh(400.,l)
call UnitDamagePoint(GetTriggerUnit(),0,400.,GetLocationX(l),GetLocationY(l),(350.+(250.*I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A04N')))),true,false,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call ForGroupBJ(GetUnitsInRangeOfLocAll(400.,LOCALIZABLE_LOC),function UM)
set bj_forLoopAIndex=GetUnitAbilityLevel(GetTriggerUnit(),'A04N')
call EnumDestructablesInCircleBJ(400.,LOCALIZABLE_LOC,function wM)
call RemoveLocation(LOCALIZABLE_LOC)
call PolledWait2(.3)
set LOCALIZABLE_LOC=l
call EnumDestructablesInCircleBJ(400.,LOCALIZABLE_LOC,function WM)
call WG()
call DeafenPlayersInDistanceOfLoc(l,800)
call RemoveLocation(LOCALIZABLE_LOC)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
call RemoveLocation(Eh)
set Eh=null
set u=null
endfunction
function ip takes nothing returns boolean
return GetSpellAbilityId()=='A02Q'
endfunction
function ap takes nothing returns nothing
local location l2=GetSpellTargetLoc()
local location l=OffsetLocation(l2,GetRandomReal(-50.,50.),GetRandomReal(-50.,50.))
local unit u=GetSpellAbilityUnit()
local integer i=0
call RemoveLocation(l2)
call PolledWait2(.25)
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(u),'h00L',GetUnitX(u),GetUnitY(u),GetUnitFacing(u))
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A00F')
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852652,(l))
call SetUnitAnimation((u),"spell")
call PlaySoundOnUnitBJ(YE,100,u)
call Ph(l)
call PolledWait2(1.)
loop
exitwhen i>GetRandomInt(2,3)
set l2=OffsetLocation(l,GetRandomInt(-50,50),GetRandomInt(-50,50))
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",(l2)))
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",(l2)))
call UnitDamagePointLoc((u),0,150.,l2,200.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call RemoveLocation(l2)
set i=i+1
endloop
call Dh(400.+(50.*I2R(GetUnitAbilityLevelSwapped('A01J',u))),l)
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Satchel Explosion.mdx",l))
call UnitDamagePointLoc((u),0,400.,l,4500.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
call YG()
call DeafenPlayersInDistanceOfLoc((l),800)
call RumbleCam(10.,.55)
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
function Sp takes nothing returns nothing
if IsUnitAliveBJ(GetEnumUnit()) then
set LOCALIZABLE_LOC=GetUnitLoc(GetEnumUnit())
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,3.,0,100,10.,10.)
call RemoveLocation(LOCALIZABLE_LOC)
endif
endfunction
function Qp takes nothing returns boolean
return(No)
endfunction
function Dp takes nothing returns boolean
return GetSpellAbilityId()=='A01Y'
endfunction
function fp takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call DestroyEffect(AddSpecialEffectTargetUnitBJ("weapon",u,"war3mapImported\\SniperEffectAttachment.MDX"))
call PolledWait2(.5)
call PlaySoundAtUnitLoc(kE,u)
set u=null
endfunction
function Fp takes nothing returns boolean
return GetSpellAbilityId()=='A046' or GetSpellAbilityId()=='A06T'
endfunction
function gp takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call PlaySoundAtUnitLoc(mE,u)
set u=null
endfunction
function PingUnitIfAlive takes nothing returns nothing
local unit u=GetEnumUnit()
if (IsUnitAliveBJ(u)) then
set LOCALIZABLE_LOC=GetUnitLoc(u)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,3.,0,100,10.,10.)
call RemoveLocation(LOCALIZABLE_LOC)
endif
set u=null
endfunction
function aP takes nothing returns nothing
set LOCALIZABLE_GROUP=GetUnitsOfType('u009')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('u005')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('u003')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('u006')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('u004')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('n00K')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('n00F')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('n00G')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
set LOCALIZABLE_GROUP=GetUnitsOfType('n00O')
call ForGroupBJ(LOCALIZABLE_GROUP,function PingUnitIfAlive)
call GroupClear(LOCALIZABLE_GROUP)
call PlaySoundBJ(BV)
endfunction
function QP takes nothing returns boolean
return GetSpellAbilityId()=='A01O'
endfunction
function sP takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local location l=GetSpellTargetLoc()
local group g=GetUnitsOfPlayerAndTypeId(p,'o006')
local integer i=CountUnitsInGroup(g)
local unit u2=GroupPickRandomUnit(g)
if i>=1 then
call RemoveUnit(u2)
endif
call CreateNUnitsAtLoc(1,'o006',p,l,135.)
call DestroyGroup(g)
set u=null
set u2=null
call RemoveLocation(l)
set l=null
endfunction
function SP takes nothing returns boolean
local integer i=(1+GetPlayerId(GetOwningPlayer(GetAttacker())))
return GAME_MODE!=UA2_ModeCompetitive and TimerGetRemaining(wr[i])<=0 and GetUnitTypeId(GetAttacker())=='H00H' and GetUnitAbilityLevel(GetAttacker(),'A02L')!=0 and CURRENT_AMMO[i]>0 and IS_LINKING_BELTS[i]==false
endfunction
function tP takes nothing returns nothing
local unit u=GetAttacker()
local integer i=GetPlayerId(GetOwningPlayer(u))
local real dx=GetUnitX(u)-GetUnitX(GetTriggerUnit())
local real dy=GetUnitY(u)-GetUnitY(GetTriggerUnit())
if(dx*dx+dy*dy>=300.*300.)then
call SetPlayerAllianceStateBJ(Player(15),Player(i),2)
if GAME_MODE==UA2_ModeUmbrella then
call SetPlayerAllianceStateBJ(Player(11),Player(i),2)
endif
call TimerStart(wr[i+1],2.,false,null)
call PolledWait2(1.65)
call SetPlayerAllianceStateBJ(Player(15),Player(i),0)
if GAME_MODE==UA2_ModeUmbrella then
call SetPlayerAllianceStateBJ(Player(11),Player(i),0)
endif
endif
set u=null
endfunction
function TP takes nothing returns boolean
return(GetSpellAbilityId()=='A073')
endfunction
function uP takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A074',GetTriggerUnit())==0)
endfunction
function UP takes nothing returns nothing
if(uP())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),5.,"Supressor on.")
call UnitRemoveAbility(GetTriggerUnit(),'A019')
call UnitAddAbility(GetTriggerUnit(),'A02L')
call UnitAddAbility(GetTriggerUnit(),'A074')
call PlaySoundOnUnitBJ(SOUND_NVG_OFF,100,GetTriggerUnit())
else
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),5.,"Supressor off.")
call UnitRemoveAbility(GetTriggerUnit(),'A074')
call UnitRemoveAbility(GetTriggerUnit(),'A02L')
call UnitAddAbility(GetTriggerUnit(),'A019')
call PlaySoundOnUnitBJ(SOUND_NVG_OFF,100,GetTriggerUnit())
endif
endfunction
function PQ takes nothing returns boolean
return(GetSpellAbilityId()=='A078')
endfunction
function QQ takes nothing returns nothing
if (IsPlayerInForce(GetOwningPlayer(GetTriggerUnit()),OPPORTUNED_SHOT)==false) then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),8.,"Opportuned shot activated.")
call ForceAddPlayer(OPPORTUNED_SHOT,GetOwningPlayer(GetTriggerUnit()))
call UnitAddAbility(GetTriggerUnit(),'A079')
call SetUnitAbilityLevelSwapped('A079',GetTriggerUnit(),2)
else
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),8.,"Opportuned shot deactivated.")
call ForceRemovePlayer(OPPORTUNED_SHOT,GetOwningPlayer(GetTriggerUnit()))
call UnitRemoveAbility(GetTriggerUnit(),'A079')
endif
endfunction
function UQ takes nothing returns boolean
return(GetSpellAbilityId()=='A00B')and(IsPlayerInForce(GetOwningPlayer(GetTriggerUnit()),PLAYER_JAMMED))
endfunction
function wQ takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H001')or(GetUnitTypeId(GetTriggerUnit())=='H00P')
endfunction
function WQ takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00H')
endfunction
function yQ takes nothing returns boolean
return(wQ())
endfunction
function YQ takes nothing returns nothing
local effect e
call AddSpecialEffectTargetUnitBJ("overhead",GetTriggerUnit(),"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set e=bj_lastCreatedEffect
call TriggerSleepAction(.2)
call PlaySoundOnUnitBJ(gg_snd_Magin,100,GetTriggerUnit())
if(yQ())then
call TriggerSleepAction((1.7-(I2R(GetUnitAbilityLevelSwapped('A00L',GetTriggerUnit()))*.15)))
else
if(WQ())then
call TriggerSleepAction((1.7-(I2R(GetUnitAbilityLevelSwapped('A01X',GetTriggerUnit()))*.15)))
else
call TriggerSleepAction((1.7-(I2R(GetUnitAbilityLevelSwapped('A00D',GetTriggerUnit()))*.15)))
endif
endif
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,GetTriggerUnit())
call TriggerSleepAction(.2)
call DestroyEffect(e)
call ForceRemovePlayer(PLAYER_JAMMED,GetOwningPlayer(GetTriggerUnit()))
endfunction
function Bs takes nothing returns boolean
return(GetSpellAbilityId()=='A00V')
endfunction
function cs2 takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I000')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<3)
endfunction
function Cs takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I00S')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<10)
endfunction
function Ds takes nothing returns boolean
return(cs2())or(Cs())
endfunction
function fs takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00U')and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>=75)
endfunction
function Fs takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H000')or(GetUnitTypeId(GetTriggerUnit())=='H011')or(GetUnitTypeId(GetTriggerUnit())=='H00I')or(GetUnitTypeId(GetTriggerUnit())=='H00H')or(GetUnitTypeId(GetTriggerUnit())=='H00C')or(GetUnitTypeId(GetTriggerUnit())=='H00D')or(GetUnitTypeId(GetTriggerUnit())=='H00J')or(GetUnitTypeId(GetTriggerUnit())=='H00N')or(GetUnitTypeId(GetTriggerUnit())=='H001')or(GetUnitTypeId(GetTriggerUnit())=='H00P')
endfunction
function gs takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I000')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<3)
endfunction
function Gs takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I00S')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<10)
endfunction
function hs takes nothing returns boolean
return(gs())or(Gs())
endfunction
function Hs takes nothing returns boolean
return(hs())
endfunction
function js takes nothing returns boolean
return(Fs())and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>=2)
endfunction
function Js takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H008')or(GetUnitTypeId(GetTriggerUnit())=='H01I')or(GetUnitTypeId(GetTriggerUnit())=='H00R')
endfunction
function Ks takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I000')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<3)
endfunction
function ls takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))=='I00S')and(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))<10)
endfunction
function Ls takes nothing returns boolean
return(Ks())or(ls())
endfunction
function ms takes nothing returns boolean
return(Ls())
endfunction
function Ms takes nothing returns boolean
return(Js())and(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>=3)
endfunction
function ps takes nothing returns nothing
if(fs())then
call AdjustPlayerStateBJ(-75,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call PlaySoundOnUnitBJ(YV,100,GetTriggerUnit())
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Ds())then
call SetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex),(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))+1))
return
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call UnitAddItemByIdSwapped('I000',GetTriggerUnit())
endif
if(js())then
call AdjustPlayerStateBJ(-2,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call PlaySoundOnUnitBJ(gg_snd_Magout,100,GetTriggerUnit())
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Hs())then
call SetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex),(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))+1))
return
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call UnitAddItemByIdSwapped('I000',GetTriggerUnit())
endif
if(Ms())then
call AdjustPlayerStateBJ(-3,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call PlaySoundOnUnitBJ(gg_snd_Magout,100,GetTriggerUnit())
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(ms())then
call SetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex),(GetItemCharges(UnitItemInSlotBJ(GetTriggerUnit(),bj_forLoopAIndex))+1))
return
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call UnitAddItemByIdSwapped('I000',GetTriggerUnit())
endif
endfunction
function Ps takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I000')or(GetItemTypeId(GetManipulatedItem())=='I00S')
endfunction
function qs takes nothing returns boolean
return(Ps())
endfunction
function Qs takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='h00K')
endfunction
function ss takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00U')
endfunction
function Ss takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H000')or(GetUnitTypeId(GetManipulatingUnit())=='H011')or(GetUnitTypeId(GetManipulatingUnit())=='H00I')or(GetUnitTypeId(GetManipulatingUnit())=='H00H')or(GetUnitTypeId(GetManipulatingUnit())=='H00C')or(GetUnitTypeId(GetManipulatingUnit())=='H00D')or(GetUnitTypeId(GetManipulatingUnit())=='H00J')or(GetUnitTypeId(GetManipulatingUnit())=='H00N')or(GetUnitTypeId(GetManipulatingUnit())=='H001')or(GetUnitTypeId(GetManipulatingUnit())=='H00P')
endfunction
function ts takes nothing returns boolean
return(Ss())
endfunction
function Ts takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H00R')or(GetUnitTypeId(GetManipulatingUnit())=='H008')or(GetUnitTypeId(GetManipulatingUnit())=='H01I')
endfunction
function us takes nothing returns boolean
return(Ts())
endfunction
function Us takes nothing returns nothing
if(Qs())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"Only soldiers can use magazines.")
call UnitAddItemByIdSwapped('I000',GetManipulatingUnit())
endif
if(ss())then
call UnitAddItemByIdSwapped('I011',GetManipulatingUnit())
endif
if(ts())then
call UnitAddItemByIdSwapped('I00Z',GetManipulatingUnit())
endif
if(us())then
call UnitAddItemByIdSwapped('I010',GetManipulatingUnit())
endif
endfunction
function rS takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00I')or(GetUnitTypeId(GetTriggerUnit())=='H00R')
endfunction
function iS takes nothing returns boolean
return(GetSpellAbilityId()=='A00C')and(IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==false)and(PLAYER_UNIT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==GetTriggerUnit())and(rS())
endfunction
function aS takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00R')
endfunction
function nS takes nothing returns boolean
return(aS())
endfunction
function VS takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='H00I')
endfunction
function ES takes nothing returns boolean
return(VS())
endfunction
function XS takes nothing returns boolean
return(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>0)
endfunction
function OS takes nothing returns nothing
local effect e
if(XS())then
set IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
set e=AddSpecialEffectTargetUnitBJ("overhead",GetTriggerUnit(),"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=0
call AdjustPlayerStateBJ(-1,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call CreateTextTagUnitBJ((("|cff804000"+GetPlayerName(GetOwningPlayer(GetTriggerUnit())))+":|r Reloading!"),GetTriggerUnit(),0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
call TriggerSleepAction(.2)
call PlaySoundOnUnitBJ(JE,100,GetTriggerUnit())
if(nS())then
call TriggerSleepAction((3.*(1-(.05*I2R(GetUnitAbilityLevelSwapped('B01A',GetTriggerUnit()))))))
endif
if(ES())then
call TriggerSleepAction((2.4*(1-(.05*I2R(GetUnitAbilityLevelSwapped('B01A',GetTriggerUnit()))))))
endif
call ForceRemovePlayer(PLAYER_JAMMED,GetOwningPlayer(GetTriggerUnit()))
set CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=MAG_SIZE[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
call DestroyEffect(e)
set IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=false
else
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),5.,"Not enough magazines.")
endif
set e=null
endfunction
function RS takes nothing returns boolean
return(GetSpellAbilityId()=='A05B')and(IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==false)and(PLAYER_UNIT[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]==GetTriggerUnit())
endfunction
function IS takes nothing returns boolean
return(GetPlayerState(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)>0)and(CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]<=(MAG_SIZE[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]-100))
endfunction
function AS takes nothing returns nothing
local effect e
if(IS())then
set IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
call AddSpecialEffectTargetUnitBJ("overhead",GetTriggerUnit(),"Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl")
set e=bj_lastCreatedEffect
call AdjustPlayerStateBJ(-1,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_LUMBER)
call CreateTextTagUnitBJ((("|cff804000"+GetPlayerName(GetOwningPlayer(GetTriggerUnit())))+":|r Reloading!"),GetTriggerUnit(),0,8.,100,100,100,10.)
call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
call SetTextTagLifespanBJ(bj_lastCreatedTextTag,4.)
call TriggerSleepAction((6.-(I2R(GetUnitAbilityLevelSwapped('A05B',GetTriggerUnit()))*1.5)))
call PlaySoundOnUnitBJ(cV,100,GetTriggerUnit())
call TriggerSleepAction(1.)
call PlaySoundOnUnitBJ(gg_snd_Boltpull,100,GetTriggerUnit())
call TriggerSleepAction(.3)
set CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+100)
call DestroyEffect(e)
set IS_LINKING_BELTS[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=false
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),5.,(I2S((CURRENT_AMMO[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]/ 100))+" full belts attached."))
else
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())),5.,"Cannot link belts.")
endif
endfunction
function NS takes nothing returns nothing
local unit u=GetManipulatingUnit()
call PlaySoundAtUnitLoc(SOUND_PICKUP,u)
set u=null
endfunction
function PS takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00U')
endfunction
function qS takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())!='H00N')and(GetUnitTypeId(GetManipulatingUnit())!='h017')and(GetUnitTypeId(GetManipulatingUnit())!='h00K')
endfunction
function QS takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00U')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function sS takes nothing returns nothing
if(qS())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"Only units with shotguns can use this weapon.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(QS())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"You can only use 1 shotgun.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function SS takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00F')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00F')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function tS takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(SS())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"You can only use 1 MRL.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function TS takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I009')or(GetItemTypeId(GetManipulatedItem())=='I00D')
endfunction
function uS takes nothing returns boolean
return(TS())
endfunction
function US takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I009')or(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00D')
endfunction
function wS takes nothing returns boolean
return(US())and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function WS takes nothing returns boolean
return(IsUnitType(GetManipulatingUnit(),UNIT_TYPE_HERO)!=null)
endfunction
function yS takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(wS())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"You can only wear 1 body armor.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
return
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
if(WS())then
call GroupAddUnit(PUTTING_ON_ARMOR,GetManipulatingUnit())
call PlaySoundOnUnitBJ(wV,100,GetManipulatingUnit())
call SetUnitMoveSpeed(GetManipulatingUnit(),(GetUnitMoveSpeed(GetManipulatingUnit())-60.))
call PolledWait2(1.3)
call GroupRemoveUnit(PUTTING_ON_ARMOR,GetManipulatingUnit())
else
call PlaySoundOnUnitBJ(wV,100,GetManipulatingUnit())
call SetUnitMoveSpeed(GetManipulatingUnit(),(GetUnitMoveSpeed(GetManipulatingUnit())-60.))
call PolledWait2(1.3)
call SetUnitMoveSpeed(GetManipulatingUnit(),GetUnitDefaultMoveSpeed(GetManipulatingUnit()))
endif
endfunction
function YS takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I002')or(GetItemTypeId(GetManipulatedItem())=='I00A')
endfunction
function zS takes nothing returns boolean
return(YS())
endfunction
function ZS takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I002')or(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00A')
endfunction
function vt takes nothing returns boolean
return(ZS())and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function et takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H00U')or(GetUnitTypeId(GetManipulatingUnit())=='h00V')or(GetUnitTypeId(GetManipulatingUnit())=='H00I')or(GetUnitTypeId(GetManipulatingUnit())=='H00R')
endfunction
function xt takes nothing returns boolean
return(et())
endfunction
function ot takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(vt())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"You can only use 1 bullet type.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
call UnitRemoveAbility(GetManipulatingUnit(),'A03L')
call UnitRemoveAbility(GetManipulatingUnit(),'A003')
call UnitRemoveAbility(GetManipulatingUnit(),'A03M')
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
if(xt())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"Only units using bullets can use this item.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
endfunction
function rt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I001')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I001')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function at takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(rt())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"You can only use 1 Aim Assistant.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function nt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I007')or(GetManipulatedItem()==Tv[1])or(GetManipulatedItem()==Tv[2])or(GetManipulatedItem()==Tv[3])or(GetItemTypeId(GetManipulatedItem())=='I00B')or(GetItemTypeId(GetManipulatedItem())=='I00H')
endfunction
function Vt takes nothing returns boolean
return(nt())and(GetUnitTypeId(GetManipulatingUnit())=='h00K')
endfunction
function Et takes nothing returns nothing
if(Vt())then
call DisplayTimedTextToForce(GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())),10.,"Only soldiers can carry this item.")
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
endfunction
function Xt takes nothing returns boolean
return((GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex)))<=10)
endfunction
function Ot takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))=='I000')
endfunction
function Rt takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00S')and(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))<10)
endfunction
function It takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Rt())then
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=6
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
if(Ot())then
if(Xt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))))
call RemoveItem(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))
else
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex),(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))-(10-GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))))
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),10)
endif
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function At takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I004')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I004')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=5)
endfunction
function Nt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(At())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function bt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00I')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00I')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=12)
endfunction
function Bt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(bt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function ct takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I008')or(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I012')
endfunction
function Ct takes nothing returns boolean
return((GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex)))<=10)
endfunction
function Dt takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))=='I00J')
endfunction
function ft takes nothing returns boolean
return(ct())and(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))<10)
endfunction
function Ft takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(ft())then
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=6
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
if(Dt())then
if(Ct())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))))
call RemoveItem(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))
else
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex),(GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopBIndex))-(10-GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))))
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),10)
endif
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function gt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00J')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00J')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=15)
endfunction
function Gt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(gt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function ht takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00W')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00W')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=8)
endfunction
function Ht takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(ht())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function jt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I006')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I006')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=8)
endfunction
function Jt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(jt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function kt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00M')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00M')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=8)
endfunction
function Kt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(kt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function lt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00N')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00N')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=6)
endfunction
function Lt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(lt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function mt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00V')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00V')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=8)
endfunction
function Mt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(mt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function pt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00O')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00O')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=8)
endfunction
function Pt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(pt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function qt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I003')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I003')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=6)
endfunction
function Qt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(qt())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function St takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I000')and(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I000')and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))and((GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex)))<=3)
endfunction
function Tt takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(St())then
call SetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex),(GetItemCharges(GetManipulatedItem())+GetItemCharges(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))))
call RemoveItem(GetManipulatedItem())
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function Ut takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I002')
endfunction
function wt takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I002')or(GetItemTypeId(GetManipulatedItem())=='I00A')
endfunction
function Wt takes nothing returns boolean
return(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I002')or(GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))=='I00A')
endfunction
function yt takes nothing returns boolean
return(wt())and(Wt())and(GetManipulatedItem()!=UnitItemInSlotBJ(GetManipulatingUnit(),bj_forLoopAIndex))
endfunction
function Yt takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H00D')or(GetUnitTypeId(GetManipulatingUnit())=='H00P')or(GetUnitTypeId(GetManipulatingUnit())=='H008')or(GetUnitTypeId(GetManipulatingUnit())=='H00C')or(GetUnitTypeId(GetManipulatingUnit())=='H000')or(GetUnitTypeId(GetManipulatingUnit())=='H011')or(GetUnitTypeId(GetManipulatingUnit())=='H001')or(GetUnitTypeId(GetManipulatingUnit())=='h01D')or(GetUnitTypeId(GetManipulatingUnit())=='h00E')or(GetUnitTypeId(GetManipulatingUnit())=='h019')or(GetUnitTypeId(GetManipulatingUnit())=='h009')or(GetUnitTypeId(GetManipulatingUnit())=='h00A')
endfunction
function zt takes nothing returns boolean
return(Yt())
endfunction
function Zt takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H00H')or(GetUnitTypeId(GetManipulatingUnit())=='h01E')or(GetUnitTypeId(GetManipulatingUnit())=='H00J')
endfunction
function vT takes nothing returns boolean
return(Zt())
endfunction
function eT takes nothing returns boolean
return(GetUnitTypeId(GetManipulatingUnit())=='H00N')or(GetUnitTypeId(GetManipulatingUnit())=='h017')
endfunction
function xT takes nothing returns boolean
return(eT())
endfunction
function oT takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(yt())then
return
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
if(zt())then
call UnitAddAbility(GetTriggerUnit(),'A03L')
endif
if(vT())then
call UnitAddAbility(GetTriggerUnit(),'A003')
endif
if(xT())then
call UnitAddAbility(GetTriggerUnit(),'A03M')
endif
endfunction
function AT takes nothing returns boolean
return(GetUnitTypeId(GetAttacker())=='u009')or(GetUnitTypeId(GetAttacker())=='u003')or(GetUnitTypeId(GetAttacker())=='u00C')
endfunction
function NT takes nothing returns boolean
return(AT())
endfunction
function bT takes nothing returns nothing
call PlaySoundOnUnitBJ(sE,100,GetAttacker())
endfunction
function cT takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='u009')or(GetUnitTypeId(GetDyingUnit())=='u003')or(GetUnitTypeId(GetDyingUnit())=='u00C')
endfunction
function CT takes nothing returns boolean
return(cT())
endfunction
function dT takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='u00C')
endfunction
function DT takes nothing returns nothing
local unit u=GetDyingUnit()
local location l=GetUnitLoc(u)
call PlaySoundOnUnitBJ(SE,100,GetDyingUnit())
if(dT())then
call PolledWait2(.3)
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl",l))
call DestroyEffect(AddSpecialEffectLoc("war3mapImported\\Zombie Explosion.mdx",l))
call Dh(250.,l)
call UnitDamagePointLoc((u),0,250.,l,300.,ATTACK_TYPE_SIEGE,DAMAGE_TYPE_NORMAL)
endif
call RemoveLocation(l)
set l=null
endfunction
function fT takes nothing returns nothing
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Undead\\UndeadBlood\\UndeadBloodGhoul.mdl",GetTriggerUnit(),"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",GetTriggerUnit(),"origin"))
endfunction
function FT takes nothing returns boolean
return(GetRandomInt(1,8)==1)
endfunction
function gT takes nothing returns boolean
return(GetRandomInt(1,2)==1)
endfunction
function GT takes nothing returns nothing
if(gT())then
call PlaySoundOnUnitBJ(PX,100,GetTriggerUnit())
else
call PlaySoundOnUnitBJ(qX,100,GetTriggerUnit())
endif
endfunction
function ZW takes nothing returns boolean
return(IsUnitInGroup(GetDyingUnit(),xv))
endfunction
function vy takes nothing returns boolean
return(GetUnitTypeId(GetDyingUnit())=='h00B')
endfunction
function ey takes nothing returns nothing
call GroupRemoveUnit(xv,GetDyingUnit())
if(vy())then
set fv=(fv+1)
endif
endfunction
function xy takes nothing returns boolean
return(IsUnitInGroup(GetEnteringUnit(),xv))and(DEFEATED==false)
endfunction
function oy takes nothing returns boolean
return(GetUnitTypeId(GetEnteringUnit())=='h00B')
endfunction
function ry takes nothing returns nothing
call DisableTrigger(gN)
call GroupRemoveUnit(xv,GetEnteringUnit())
call RemoveUnit(GetEnteringUnit())
call EnableTrigger(gN)
if(oy())then
set iv=(iv+1)
endif
endfunction
// UMBRELLA MISSION
function q3 takes nothing returns boolean
return(GetManipulatingUnit()==UMBRELLA_POWER_GENERATOR)
endfunction
function Q3 takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00I')
endfunction
function s3 takes nothing returns nothing
local location l=GetUnitLoc(GetManipulatingUnit())
if(Q3())then
call SetUnitManaBJ(UMBRELLA_POWER_GENERATOR,(GetUnitStateSwap(UNIT_STATE_MANA,UMBRELLA_POWER_GENERATOR)+(60.*I2R(GetItemCharges(GetManipulatedItem())))))
call RemoveItem(GetManipulatedItem())
call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",l))
else
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
endif
call RemoveLocation(l)
set l=null
endfunction
function e4 takes nothing returns boolean
return GetOwningPlayer(GetDyingUnit())==Player(14)and GetRandomInt(1,2)==1
endfunction
function x4 takes nothing returns boolean
return IsUnitAliveBJ(GetFilterUnit())and GetOwningPlayer(GetFilterUnit())==Player(14)
endfunction
function o4 takes nothing returns nothing
local unit u=GetDyingUnit()
local location l=GetUnitLoc(u)
local group g=GetUnitsInRangeOfLocMatching(1400.,l,Condition(function x4))
local unit u2=FirstOfGroup(g)
call NPCGiveOrderChat(u2,GetRandomInt(6,7),false)
call DestroyGroup(g)
set u=null
set u2=null
call RemoveLocation(l)
set l=null
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library GlobalFuncs initializer Init requires FuncPack
globals
boolean Game_Paused = false
private boolean ALREADY_PLAYING = false
private unit TRANSFER_UNIT
private real DamageDestruct_Damage
endglobals
function WG takes nothing returns nothing
call StartSound(SOUND_DISTANT_EXPLOSION[GetRandomInt(1,7)])
endfunction
function yG takes nothing returns nothing
call StartSound(SOUND_POLY_TARG_AIR[GetRandomInt(1,2)])
endfunction
function YG takes nothing returns nothing
call StartSound(SOUND_GRENADE3_DIST[GetRandomInt(1,2)])
endfunction
function GetPlayerColorFlag takes playercolor color returns string
if color == PLAYER_COLOR_RED then
return "|cffff0303"
elseif color == PLAYER_COLOR_BLUE then
return "|cff0042ff"
elseif color == PLAYER_COLOR_CYAN then
return "|cff1ce6b9"
elseif color == PLAYER_COLOR_PURPLE then
return "|cff540081"
elseif color == PLAYER_COLOR_YELLOW then
return "|cfffffc01"
elseif color == PLAYER_COLOR_ORANGE then
return "|cfffe8a0e"
elseif color == PLAYER_COLOR_GREEN then
return "|cff20c000"
elseif color == PLAYER_COLOR_PINK then
return "|cffe55bb0"
elseif color == PLAYER_COLOR_LIGHT_GRAY then
return "|cff959697"
elseif color == PLAYER_COLOR_LIGHT_BLUE then
return "|cff7ebff1"
elseif color == PLAYER_COLOR_AQUA then
return "|cff106246"
elseif color == PLAYER_COLOR_BROWN then
return "|cff4e2a04"
endif
return "|cffffffff"
endfunction
function GetColorPlayerName takes player p returns string
return GetPlayerColorFlag(GetPlayerColor(p)) + GetPlayerName(p) + "|r"
endfunction
function DamageDestructablesCallback takes nothing returns nothing
local destructable d=GetEnumDestructable()
call SetDestructableLife(d, GetDestructableLife(d)-DamageDestruct_Damage)
if GetDestructableLife(d) > 0 then
call SetDestructableAnimation(d, "stand hit")
endif
set d=null
endfunction
function DamageDestructables takes real x, real y, real radius, real damage returns nothing
local location l=Location(x,y)
set DamageDestruct_Damage=damage
call EnumDestructablesInCircleBJ(radius, l, function DamageDestructablesCallback)
call RemoveLocation(l)
set l=null
endfunction
function LandHeli takes real x, real y returns unit
local unit heli = CreateUnit(Player(11), 'h015', x - 1200, y - GetRandomReal(-800, 800), 90)
call IssuePointOrder(heli, "move", x, y)
call PolledWait2(5)
call SetUnitFlyHeight(heli, 15, 200)
call HeliWashOff(heli)
return heli
endfunction
function TakeoffHeli takes unit heli returns nothing
call SmoothTakeOff(heli,800,300)
call HeliWashOff(heli)
call PolledWait2(.2)
call IssuePointOrder(heli, "move", GetUnitX(heli) + 1500, GetUnitY(heli) - GetRandomReal(-800, 800))
call PolledWait2(GetRandomReal(2, 3))
call RemoveUnit(heli)
endfunction
function VisionUnit takes unit u,boolean share returns nothing
local integer i=0
loop
exitwhen i>11
call UnitShareVision(u,Player(i),share)
set i=i+1
endloop
endfunction
function Chapter takes string s returns nothing
local integer i=0
call PauseAllUnitsBJ(true)
set Game_Paused = true
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 1.0, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call ShowInterface(false,1.0)
call ClearTextMessages()
call PolledWait2(1.5)
call StartSound(gg_snd_Chapter)
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " |cff804000" + s)
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " " )
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " " )
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " " )
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " " )
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 4.0, " " )
call PolledWait2(4.3)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.0, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call ShowInterface(true,1.0)
call ClearTextMessages()
call PolledWait2(1.)
call PauseAllUnitsBJ(false)
set Game_Paused = false
// call PolledWait2(5.)
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUT, 0.01, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 0.01, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0 )
loop
exitwhen i > 10
if PLAYER_HAS_NVG[i+1] then
call ShowNightVision(Player(i),true)
else
call ShowNightVision(Player(i),false)
endif
set i=i+1
endloop
call EnableUserUI(true)
endfunction
function SpawnItem takes integer count, rect rec, integer itype returns nothing
local location l
local integer i = 1
loop
exitwhen i > count
set l = GetRandomLocInRect(rec)
call CreateItemLoc(itype, l)
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",l))
call RemoveLocation(l)
set i = i + 1
endloop
set l = null
endfunction
private function TrueBoolexpr takes nothing returns boolean
return true
endfunction
function RemoveNonSelectorPassives takes nothing returns nothing
local unit u = GetEnumUnit()
if (GetOwningPlayer(u)==Player(12)) and (u!=SELECTION_HELICOPTER) and (u!=SELECTION_TENT_1) and (u!=SELECTION_TENT_2) then
call RemoveUnit(u)
endif
set u = null
endfunction
function RemoveDead takes nothing returns nothing
local unit u=GetEnumUnit()
if IsUnitDeadBJ(u) then
call GroupRemoveUnit(bj_lastCreatedGroup,u)
endif
set u=null
endfunction
function SendUmbrellaSquad takes group squad returns nothing
local location l
local location l2
local group g=CreateGroup()
local group g2=CreateGroup()
local unit u
local unit u2
if DEFEATED then
call DestroyGroup(g)
set g=null
call DestroyGroup(g2)
set g2=null
set u=null
set u2=null
set l = null
set l2 = null
return
endif
call GroupAddGroup(squad,g)
set u=GroupPickRandomUnit(g)
// "ALL UNITS MOVE IN"
call NPCGiveOrderChat(u,5,true)
// Set alive players to g
call GroupAddGroup(PLAYER_UNITS,g2)
call GroupClear(bj_lastCreatedGroup)
call GroupAddGroup(g2,bj_lastCreatedGroup)
call ForGroup(g2,function RemoveDead)
call GroupClear(g2)
call GroupAddGroup(bj_lastCreatedGroup,g2)
set u2=GroupPickRandomUnit(g2)
if UMBRELLA_CURRENTLY_ATTACKING or GetRandomInt(1,5)==1 or (UMBRELLA_WARZONE_STARTED and GetRandomInt(1,2)==1) then
// Send entire group to attack-move to 500 around player unit's location
set l = GetUnitLoc(u2)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call IssueImmediateOrder(u,"berserk")
set l2=OffsetLocation(l,GetRandomInt(-500,500),GetRandomInt(-500,500))
call IssuePointOrderByIdLoc(u,OID_attack,l2)
call RemoveLocation(l2)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation(l)
elseif UMBRELLA_WARZONE_STARTED==false then
loop
set l = GetRandomLocInRect(GetPlayableMapRect())
exitwhen not RectContainsLoc(gg_rct_BlackArea1,l) and not RectContainsLoc(gg_rct_BlackArea2,l)
call RemoveLocation(l)
endloop
// Send entire group to attack-move a random point in 500 radius around l
loop
set u=FirstOfGroup(g)
exitwhen u==null
set l2=OffsetLocation(l,GetRandomInt(-500,500),GetRandomInt(-500,500))
call IssuePointOrderByIdLoc(u,OID_attack,l2)
call RemoveLocation(l2)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation(l)
else
set l=GetRandomLocInRect(gg_rct_Town1)
// Send entire group to attack-move a random point in 1000 radius around l
loop
set u=FirstOfGroup(g)
exitwhen u==null
set l2=OffsetLocation(l,GetRandomInt(-1000,1000),GetRandomInt(-1000,1000))
call IssuePointOrderByIdLoc(u,OID_attack,l2)
call RemoveLocation(l2)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation(l)
endif
call GroupClear(bj_lastCreatedGroup)
call DestroyGroup(g)
set g=null
call DestroyGroup(g2)
set g2=null
set u=null
set u2=null
set l = null
set l2 = null
endfunction
private function SpawnUmbrellaSquad_thread takes integer squadType returns nothing
local unit u
local location l=GetRandomLocInRect(BORDER_ZONES[GetRandomInt(1,4)])
local integer i=1
local integer i2=1
local integer currentSquad
set UMB_SquadsActive=UMB_SquadsActive+1
loop
exitwhen i>UMB_IndexCnt
if UMB_SquadActive[i]==false then
set currentSquad=i
set UMB_SquadActive[i]=true
call GroupClear(UMBRELLA_SQUADS[i])
exitwhen true
endif
set i=i+1
endloop
if i>UMB_IndexCnt then
set UMB_IndexCnt=UMB_IndexCnt+1
//call BJDebugMsg("IndexCnt added to " + I2S(UMB_IndexCnt))
set UMBRELLA_SQUADS[i]=CreateGroup()
set UMB_SquadActive[i]=true
set currentSquad=i
endif
//====================
// End Initialization
//====================
if squadType==10 then
set i=1
loop
exitwhen i>GetRandomInt(1,3)
set u=CreateUnit(Player(11),'h01A',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
endloop
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,4)==1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up an Umbrella ghost squad entering your sector.")
endif
endif
if squadType==9 then
set i=1
loop
exitwhen i>2
set u=CreateUnit(Player(11),'h00E',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
endloop
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,4)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)==1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a small machine gunner squad of Umbrella soldiers entering your sector.")
endif
endif
if squadType==1 then
set i=1
loop
exitwhen i>GetRandomInt(1,3)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,5)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,4)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i2=i2+1
if i2<GetRandomInt(3,4)then
set u=CreateUnit(Player(11),'h00V',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
set i2=i2+1
endif
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)==1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a small squad of Umbrella soldiers entering your sector.")
endif
endif
if squadType==2 then
set i=1
loop
exitwhen i>GetRandomInt(5,8)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,2)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,5)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(0,2)
set u=CreateUnit(Player(11),'h00V',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h017',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h01D',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h01E',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h00A',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,1)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(2,3)
set u=CreateUnit(Player(11),'h00E',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)!=1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a large squad of Umbrella soldiers entering your sector.")
endif
endif
if squadType==3 then
set i=1
loop
exitwhen i>GetRandomInt(3,7)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,2)
call ChanceFragGrenade(u,5)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(0,2)
set u=CreateUnit(Player(11),'h00V',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(2,4)
set u=CreateUnit(Player(11),'h017',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h00A',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,1)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(0,2)
set u=CreateUnit(Player(11),'h00E',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
if GetRandomInt(1,3)==1 then
set u=CreateUnit(Player(11),'h01S',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
else
set u=CreateUnit(Player(11),'h00G',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
endif
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
set i=i+1
set i2=i2+1
endloop
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)!=1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a large squad of Umbrella soldiers entering your sector. We also detected possible tanks with them.")
endif
endif
if squadType==4 then
set i=1
loop
exitwhen i>GetRandomInt(2,5)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,5)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h017',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h01A',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h01B',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,2)
set i=i+1
set i2=i2+1
endloop
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,2)==1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a squad of Umbrella soldiers entering your sector. We also detected possible helicopters with them.")
endif
endif
if squadType==5 then
set i=1
loop
exitwhen i>GetRandomInt(5,8)
set u=CreateUnit(Player(11),'h009',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call ChanceFragGrenade(u,5)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(3,4)
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set i=1
loop
exitwhen i>GetRandomInt(1,2)
set u=CreateUnit(Player(11),'h00A',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,1)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)!=1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a large squad of Umbrella soldiers entering your sector.")
endif
endif
if squadType==6 then
set i=1
loop
exitwhen i>GetRandomInt(2,4)
set u=CreateUnit(Player(11),'h00V',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
set i=i+1
set i2=i2+1
endloop
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,4)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i2=i2+1
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,2)==1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a small squad of Umbrella soldiers entering your sector.")
endif
endif
if squadType==7 then
set i=1
loop
exitwhen i>GetRandomInt(2,4)
set u=CreateUnit(Player(11),'h01E',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,4)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i2=i2+1
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)!=1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a small squad of Umbrella Marksmen entering your sector.")
endif
endif
if squadType==8 then
set i=1
loop
exitwhen i>GetRandomInt(2,4)
set u=CreateUnit(Player(11),'h01D',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call ChanceFlashLight(u,3)
call InitiateUmbrellaSoldier(u)
set i=i+1
set i2=i2+1
endloop
set u=CreateUnit(Player(11),'h019',GetLocationX(l),GetLocationY(l),GetRandomReal(160.,200.))
call ChanceAutomaticFiringBonus(u,4)
call ChanceFlashLight(u,3)
call GroupAddUnit(UMBRELLA_SQUADS[currentSquad],u)
call InitiateUmbrellaSoldier(u)
set i2=i2+1
call SendUmbrellaSquad(UMBRELLA_SQUADS[currentSquad])
if GetRandomInt(1,3)!=1 then
call Transmission(5.,"|cff808000Lima-Six: We have picked up a small squad of Umbrella Assaultmen entering your sector.")
endif
endif
call RemoveLocation(l)
set l=null
set u=null
endfunction
function SpawnUmbrellaSquadOfType takes integer i returns nothing
call SpawnUmbrellaSquad_thread.execute(i)
endfunction
function Reinforcements takes real x, real y returns nothing
local integer i=1
local unit u
local boolean b=false
loop
exitwhen i>11
if IsUnitDeadBJ(PLAYER_UNIT[i]) and PLAYER_UNIT[i]!=null and DEFEATED==false then
set b=true
if GetRandomInt(1,5)==1 then //flamer
set u=CreateUnit(Player(i-1),'h00V',x,y,GetRandomReal(0,360))
elseif GetRandomInt(1,5)==1 then //MG
set u=CreateUnit(Player(i-1),'h00E',x,y,GetRandomReal(0,360))
call InitiateUmbrellaSoldier(u)
elseif GetRandomInt(1,4)==1 then //Corpsman
set u=CreateUnit(Player(i-1),'h019',x,y,GetRandomReal(0,360))
call InitiateUmbrellaSoldier(u)
elseif GetRandomInt(1,5)==1 then //DM
set u=CreateUnit(Player(i-1),'h01E',x,y,GetRandomReal(0,360))
elseif GetRandomInt(1,8)==1 then //CE
set u=CreateUnit(Player(i-1),'h017',x,y,GetRandomReal(0,360))
call InitiateUmbrellaSoldier(u)
elseif GetRandomInt(1,8)==1 then //Assaultman
set u=CreateUnit(Player(i-1),'h01D',x,y,GetRandomReal(0,360))
call InitiateUmbrellaSoldier(u)
else //rifle it up, baby
set u=CreateUnit(Player(i-1),'h009',x,y,GetRandomReal(0,360))
call InitiateUmbrellaSoldier(u)
call ChanceFragGrenade(u,3)
endif
endif
set i=i+1
endloop
if b then
call Transmission(6.,"|cff808000Battallion:|r Reinforcements arrived.")
call PingMinimapEx(x, y, 6, 100, 100, 255, false)
endif
set u=null
endfunction
//=================================================
// INITIALIZER
//=================================================
private function Init takes nothing returns nothing
set BE_TRUE = Condition(function TrueBoolexpr)
endfunction
endlibrary
//TESH.scrollpos=442
//TESH.alwaysfold=0
library CONSTRUCT initializer Init requires GlobalFuncs2
function main2 takes nothing returns nothing
local player p
local unit u
local integer i
set p=Player(12)
set SELECTION_HELICOPTER=CreateUnit(p,'h002',-15000.,-14550.,180.)
set SELECTION_TENT_1=CreateUnit(p,'h01K',-15150.,-14050.,270.)
set SELECTION_TENT_2=CreateUnit(p,'h01J',-14800.,-14050.,270.)
set RifleButters=CreateGroup()
set RifleButting=CreateGroup()
set CivilianIDs[1]='n004'
set CivilianIDs[2]='n005'
set CivilianIDs[3]='n006'
set CivilianIDs[4]='n007'
set CivilianIDs[5]='n008'
set CivilianIDs[6]='h018'
set CivilianIDs[7]='h005'
set RifleItems[1]='I015'
set RifleItems[2]='I00L'
set RifleItems[3]='I008'
set RifleItems[4]='I019'
set RifleItemsCnt=4
set MGItems[1]='I00G'
set MGItems[2]='I01B'
set MGItems[3]='I01C'
set MGItemsCnt=3
set DIFF_NAMES[0]="None"
set DIFF_NAMES[1]="Recr"
set DIFF_NAMES[2]="Norm"
set DIFF_NAMES[3]="Hard"
set DIFF_NAMES[4]="Insa"
set RANK_LIM[0]=4
set RANK_LIM[1]=6
set RANK_LIM[2]=11
set RANK_LIM[3]=17
set RANK_LIM[4]=19
set P_USMC=Player(11)
set no=CreateGroup()
set Vo=CreateGroup()
set XP_MODIFIER=1.
set do=CreateTimer()
set TIMER_SELF_DEFENSE_BUFFER=CreateTimer()
set UMBRELLA_FLOOD_SQUAD=CreateGroup()
set INJURY_CHANCE=5
set jr=CreateTimer()
set PUTTING_ON_ARMOR=CreateGroup()
set OPPORTUNED_SHOT=CreateForce()
set UMBRELLA_CHECKPOINT_GROUP=CreateGroup()
set SPRINTING_UNITS=CreateGroup()
set Q=CreateGroup()
set FM_SHELLS=2
set FM_RADIUS=200
set SHELLS=200
set xv=CreateGroup()
set Gv=CreateGroup()
set Jv=CreateGroup()
set Kv=CreateGroup()
set Wv=CreateGroup()
set ee=CreateForce()
set ae=CreateGroup()
set Re=CreateGroup()
set Ae=CreateGroup()
set Ce=CreateGroup()
set He=CreateGroup()
set SAFETY=CreateGroup()
set qe=CreateGroup()
set se=CreateForce()
set CSS_CASTERS=CreateGroup()
set PLAYER_UNITS=CreateGroup()
set GROUP_CRASH_VICTIMS=CreateGroup()
set kx=CreateGroup()
set Lx=1
set i=0
loop
exitwhen(i>1)
set Ev[i]=0
set Xv[i]=0
set SELECTION_SLOT_STATE[i]=1
set UNIT_TIMES_PICKED[i]=0
set CSS_CASTER_VARS[i]=0
set INJURY_INDIVIDUAL_CHANCE[i]=0
set INJURY_INDIVIDUAL_ORDER[i]=0
set Gr[i]=0
set Qr[i]=false
set sr[i]=false
set ur[i]=false
set wr[i]=CreateTimer()
set i=i+1
endloop
set i=0
loop
exitwhen(i>2)
set zv[i]=0
set ux[i]=0
set MODE_COMP_FORCE[i]=CreateForce()
set qr[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>3)
set ev[i]=false
set WEAPONS_CACHE_FOUND[i]=false
set i=i+1
endloop
set i=0
loop
exitwhen(i>4)
set Mx[i]=false
set Jr[i]=false
set Pr[i]=CreateGroup()
set i=i+1
endloop
set i=0
loop
exitwhen(i>5)
set ce[i]=false
set jx[i]=0
set hr[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>12)
set UICancel[i]=true
set LAST_DWS[i]=0
set PLAYER_UNIT[i]=null
set CURRENT_AMMO[i]=0
set EXHAUSTION[i]='x'
set q[i]=false
set DWS_MOD[i]=0
set JAM_MOD[i]=1
set MS_MOD[i]=0
set PLAYER_XP[i]=0
set PLAYER_LIMMESSAGE[i]=false
set PLAYER_DIFFCOMP[i]=0
set PLAYER_RANK_NAME[i]=""
set KILL_XP_COUNTER[i]=0
set PLAYER_HAS_LOADED[i]=false
set MSG_Jammed[i]=false
set MSG_Empty[i]=false
set MAG_SIZE[i]=0
set MAG_SIZE_STAND[i]=0
set IS_LINKING_BELTS[i]=false
set BURST_ROUNDS[i]=0
set PLAYER_HITS[i]=0
set PLAYER_KILLS[i]=0
set PLAYER_UNIT_ID[i]=0
set PLAYER_NAMES[i]=""
set Ex[i]=0
set PLAYER_RANK[i]=1
set PLAYER_HAS_NVG[i]=false
set XP_ON_LOAD[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>15)
set M[i]=""
set P[i]=""
set Zx[i]=0
set vo[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>19)
set RANK_MIN_XP[i]=0
set RANK_MAX_XP[i]=0
set RANK_NAME[i]=""
set i=i+1
endloop
set oR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(oR,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(oR,Condition(function jL))
call TriggerAddAction(oR,function JL)
set rR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(rR,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(rR,Condition(function kL))
call TriggerAddAction(rR,function KL)
set iR=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(iR,2.1)
call TriggerAddAction(iR,function LL)
set BR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(BR,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(BR,Condition(function YL))
call TriggerAddAction(BR,function zL)
set cR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(cR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerRegisterAnyUnitEventBJ(cR,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(cR,function Vm)
set dR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dR,Condition(function Om))
call TriggerAddAction(dR,function Rm)
set DR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DR,Condition(function Im))
call TriggerAddAction(DR,function Nm)
set fR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(fR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(fR,Condition(function bm))
call TriggerAddAction(fR,function Bm)
set FR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(FR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(FR,Condition(function cm2))
call TriggerAddAction(FR,function Cm)
set gR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gR,Condition(function Dm))
call TriggerAddAction(gR,function fm)
set GR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(GR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(GR,Condition(function Fm))
call TriggerAddAction(GR,function gm)
set HR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(HR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(HR,Condition(function Hm))
call TriggerAddAction(HR,function jm)
set jR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(jR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(jR,Condition(function Jm))
call TriggerAddAction(jR,function lm)
set JR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(JR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(JR,Condition(function Lm))
call TriggerAddAction(JR,function mm)
set kR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(kR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(kR,Condition(function Mm))
call TriggerAddAction(kR,function pm)
set KR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(KR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(KR,Condition(function Pm))
call TriggerAddAction(KR,function qm)
set MR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(MR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(MR,Condition(function Wm))
call TriggerAddAction(MR,function ym)
set pR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(pR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(pR,Condition(function Ym))
call TriggerAddAction(pR,function Zm)
set PR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(PR,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(PR,Condition(function oM))
call TriggerAddAction(PR,function rM)
set qR=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(qR,2.1)
call TriggerAddAction(qR,function EM)
set sR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(sR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(sR,Condition(function RM))
call TriggerAddAction(sR,function IM)
set SR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(SR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(SR,Condition(function AM))
call TriggerAddAction(SR,function NM)
set TR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(TR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(TR,Condition(function CM))
call TriggerAddAction(TR,function dM)
set uR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(uR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(uR,Condition(function DM))
call TriggerAddAction(uR,function fM)
set UR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(UR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(UR,Condition(function FM))
call TriggerAddAction(UR,function gM)
set wR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(wR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(wR,Condition(function GM))
call TriggerAddAction(wR,function hM)
set yR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(yR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(yR,Condition(function KM))
call TriggerAddAction(yR,function mM)
set zR=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(zR,3.2)
call TriggerAddAction(zR,function sM)
set ZR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ZR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ZR,Condition(function SM))
call TriggerAddAction(ZR,function tM)
set vI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(vI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(vI,Condition(function TM))
call TriggerAddAction(vI,function yM)
set xI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(xI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(xI,Condition(function ip))
call TriggerAddAction(xI,function ap)
set VI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(VI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(VI,Condition(function Dp))
call TriggerAddAction(VI,function fp)
set EI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(EI,Condition(function Fp))
call TriggerAddAction(EI,function gp)
set OI=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(OI,30.)
call TriggerAddCondition(OI,Condition(function Qp))
call TriggerAddAction(OI,function aP)
set AI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(AI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(AI,Condition(function QP))
call TriggerAddAction(AI,function sP)
set NI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(NI,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(NI,Condition(function SP))
call TriggerAddAction(NI,function tP)
set bI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(bI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(bI,Condition(function TP))
call TriggerAddAction(bI,function UP)
set PI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(PI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(PI,Condition(function PQ))
call TriggerAddAction(PI,function QQ)
set sI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(sI,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(sI,Condition(function UQ))
call TriggerAddAction(sI,function YQ)
set uI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(uI,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(uI,Condition(function Bs))
call TriggerAddAction(uI,function ps)
set UI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(UI,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(UI,Condition(function qs))
call TriggerAddAction(UI,function Us)
set WI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(WI,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(WI,Condition(function iS))
call TriggerAddAction(WI,function OS)
set yI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(yI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(yI,Condition(function RS))
call TriggerAddAction(yI,function AS)
set YI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(YI,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(YI,function NS)
set iA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(iA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(iA,Condition(function PS))
call TriggerAddAction(iA,function sS)
set aA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(aA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(aA,function tS)
set nA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(nA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(nA,Condition(function uS))
call TriggerAddAction(nA,function yS)
set VA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(VA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(VA,Condition(function zS))
call TriggerAddAction(VA,function ot)
set EA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(EA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(EA,function at)
set XA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(XA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(XA,function Et)
set OA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(OA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(OA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(OA,function It)
set RA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(RA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(RA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(RA,function Nt)
set IA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(IA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(IA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(IA,function Bt)
set AA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(AA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(AA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(AA,function Ft)
set NA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(NA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(NA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(NA,function Gt)
set bA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(bA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(bA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(bA,function Ht)
set BA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(BA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(BA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(BA,function Jt)
set cA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(cA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(cA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(cA,function Kt)
set CA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(CA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(CA,function Lt)
set dA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(dA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(dA,function Mt)
set DA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(DA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(DA,function Pt)
set fA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(fA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(fA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(fA,function Qt)
set FA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(FA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerRegisterAnyUnitEventBJ(FA,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(FA,function Tt)
set gA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gA,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(gA,Condition(function Ut))
call TriggerAddAction(gA,function oT)
set jA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(jA,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(jA,Condition(function NT))
call TriggerAddAction(jA,function bT)
set kA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(kA,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(kA,Condition(function CT))
call TriggerAddAction(kA,function DT)
set KA=CreateTrigger()
call TriggerAddAction(KA,function fT)
set lA=CreateTrigger()
call TriggerAddCondition(lA,Condition(function FT))
call TriggerAddAction(lA,function GT)
set gN=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gN,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(gN,Condition(function ZW))
call TriggerAddAction(gN,function ey)
set GN=CreateTrigger()
call TriggerRegisterEnterRectSimple(GN,di)
call TriggerRegisterEnterRectSimple(GN,nn)
call TriggerAddCondition(GN,Condition(function xy))
call TriggerAddAction(GN,function ry)
set Qb=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Qb,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(Qb,Condition(function q3))
call TriggerAddAction(Qb,function s3)
// UMB?
set wb=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(wb,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(wb,Condition(function e4))
call TriggerAddAction(wb,function o4)
set iB=CreateTrigger()
set aB=CreateTrigger()
call TriggerExecute(GameSetup_T)
endfunction
private function Init takes nothing returns nothing
call ExecuteFunc("main2")
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
globals
group RifleButters=null
group RifleButting=null
boolean AttackConvoy = false
integer array CivilianIDs
player P_USMC
integer ITEM_SLOTS
force E=null
unit array PLAYER_UNIT
unit array PLAYER_SELECTOR
integer array CURRENT_AMMO
boolean CINEMATIC_ENDED=false
integer SPAWN_LOC_AMT=0
quest OBJECTIVE_QUEST=null
integer array EXHAUSTION
group SPRINTING_UNITS=null
string array M
string array P
boolean array q
group Q=null
integer array S
integer array PLAYER_XP
integer FM_SHELLS=0
integer FM_RADIUS=0
integer SHELLS=0
location array vv
boolean array ev
group xv=null
integer rv=0
integer iv=0
location array av
gamecache nv=null
gamecache Vv=null
integer array Ev
integer array Xv
player CODE_PLAYER=null
string Code=""
integer CodeError=0
string array PLAYER_RANK_NAME
integer array KILL_XP_COUNTER
boolean array PLAYER_HAS_LOADED
item array Bv
integer FOUND_EVIDENCE=0
boolean DEFEATED=false
unit dv=null
integer PLAYERS_THAT_HAVE_SELECTED=0
integer fv=0
boolean array MSG_Jammed
boolean array MSG_Empty
group Gv=null
integer array MAG_SIZE
integer FOUND_PAPERS=0
group Jv=null
unit kv=null
group Kv=null
integer lv=0
boolean array Mv
dialog MODE_SELECTION_DIALOG=null
button MODE_NORM_BUTTON=null
button MODE_HARD_BUTTON=null
button MODE_INSA_BUTTON=null
button MODE_SURV_BUTTON=null
button MODE_UMBR_BUTTON=null
boolean Sv=false
boolean tv=false
item array Tv
boolean uv=false
boolean Uv=false
boolean wv=false
group Wv=null
integer yv=0
unit SURV_EXTRACTION_HELI=null
integer array zv
integer DEPLOYMENT_TIME=0
boolean ve=false
force ee=null
force xe=null
force oe=null
integer array re
group ae=null
unit array ne
unit Ve=null
integer Ee=0
unit Xe=null
integer GAME_MODE=0
group Re=null
rect SPAWN_INFECTED_RECT=null
group Ae=null
integer Ne=0
item array be
location array Be
boolean array ce
group Ce=null
integer array PLAYER_HITS
integer array PLAYER_KILLS
unit array WEAPONS_CACHE
boolean array WEAPONS_CACHE_FOUND
integer array PLAYER_UNIT_ID
group He=null
button MODE_RECR_BUTTON=null
group RELOADING=CreateGroup()
integer INFESTATION_LEVEL=0
integer OBJECTIVES_SUCCEEDED=0
integer OBJECTIVES_FAILED=0
integer array SELECTION_SLOT_STATE
integer array UNIT_TIMES_PICKED
unit pe=null
group Pe=null
group qe=null
integer Qe=0
force se=null
group CSS_CASTERS=null
real array CSS_CASTER_VARS
gamecache CSCACHE_CACHE=null
integer CSS_CURRENT_ABILITY=0
unit CSS_CURRENT_CASTER=null
unit CSS_CURRENT_HURTER=null
real CSS_DELAY_HACK=0
location CSS_SOURCE_HACK=null
integer AVERAGE_XP_NO_HIGH_RANKS=0
integer PLAYING_PLAYERS=0
string array PLAYER_NAMES
group PLAYER_UNITS=null
integer array RANK_MIN_XP
integer array RANK_MAX_XP
string array RANK_NAME
integer array Ex
weathereffect Xx=null
boolean RAINING=false
integer array PLAYER_RANK
force Ix=null
force Ax=null
integer STANDARD_INFECTED_GROUP_SIZE=0
integer INFECTED_GROUP_SIZE=0
integer array PLAYER_XP_100
weathereffect Cx=null
boolean SNOWING=false
location array Fx
location LOCALIZABLE_LOC=null
group GROUP_CRASH_VICTIMS=null
integer hx=0
rect array Hx
integer array jx
integer Jx=0
group kx=null
unit Kx=null
boolean lx=false
integer Lx=0
boolean array Mx
unit Px=null
boolean qx=false
integer Qx=0
button MODE_COMP_BUTTON=null
boolean Tx=false
integer array ux
integer array Ux
rect array wx
integer array Wx
integer yx=0
force array MODE_COMP_FORCE
integer array Zx
integer array vo
integer array INJURY_INDIVIDUAL_CHANCE
integer array INJURY_INDIVIDUAL_ORDER
integer array INJURY_INDIVIDUAL_ABILITY
group LOCALIZABLE_GROUP=null
unit io=null
item ao=null
group no=null
group Vo=null
boolean Eo=false
boolean Xo=false
boolean array PLAYER_HAS_NVG
integer array Ao
integer array BIG_ENEMY_MOFO
integer BIG_ENEMY_MOFO_AMT
boolean No=false
real XP_MODIFIER=0
unit co=null
location Co=null
timer do=null
group array UMBRELLA_SQUADS
boolean UMBRELLA_CURRENTLY_ATTACKING=false
integer UMBRELLA_SQUAD_AMOUNT=0
unit UMBRELLA_POWER_GENERATOR=null
rect UMBRELLA_EVAC_RECT=null
timer TIMER_SELF_DEFENSE_BUFFER=null
group UMBRELLA_FLOOD_SQUAD=null
boolean UMBRELLA_WARZONE_STARTED=false
integer UMBRELLA_EVACUATED_MARINES=0
// AMHS
// boolean qo=false
// real Qo=0
// rect so=null
// boolean So=false
// lightning to=null
// real To=0
// real uo=0
// timer Uo=null
// timer wo=null
// boolean Wo=false
// unit yo=null
// unit Yo=null
// integer zo=0
// player array Zo
// integer vr=0
// real er=0
// rect xr=null
// real rr=0
// real ir=0
// integer ar=0
boolean nr=false
integer INJURY_CHANCE=0
boolean SINGLE_PLAYER=false
boolean CAN_SELECT_EXTRA_MODE=false
boolean MODE_RIFLE_ON=false
string QUEST_TITLE=""
quest MAIN_QUEST=null
boolean MODE_OUTBREAK_ON=false
integer br=0
dialog COMP_SELECTION_DIALOG=null
button COMP_CONT_BUTTON=null
button COMP_DEAT_BUTTON=null
button COMP_DEMO_BUTTON=null
unit array fr
item Fr=null
integer array Gr
integer array hr
unit array Hr
timer jr=null
boolean array Jr
boolean kr=false
rect array Kr
boolean Lr=false
group PUTTING_ON_ARMOR=null
group NADING=CreateGroup()
unit pr=null
group array Pr
integer array qr
boolean array Qr
boolean array sr
gamecache LOCAL_VARS_CACHE=null
integer tr=0
integer array XP_ON_LOAD
boolean array ur
force Ur=null
timer array wr
player HOST=null
real LATENCY=0
boolean DISABLE_ION_CANNON=false
group UMBRELLA_CHECKPOINT_GROUP=null
real Zr=0
camerasetup eV=null
camerasetup xV=null
trigger QX=null
trigger sX=null
trigger SX=null
trigger tX=null
trigger TX=null
trigger uX=null
trigger UX=null
trigger wX=null
trigger WX=null
trigger yX=null
trigger YX=null
trigger zX=null
trigger ZX=null
trigger vO=null
trigger eO=null
trigger xO=null
trigger oO=null
trigger rO=null
trigger iO=null
trigger aO=null
trigger nO=null
trigger VO=null
trigger EO=null
trigger XO=null
trigger OO=null
trigger RO=null
trigger IO=null
trigger AO=null
trigger NO=null
trigger bO=null
trigger CO=null
trigger dO=null
trigger DO=null
trigger fO=null
trigger FO=null
trigger gO=null
trigger GO=null
trigger hO=null
trigger jO=null
trigger JO=null
trigger kO=null
trigger KO=null
trigger lO=null
trigger LO=null
trigger mO=null
trigger MO=null
trigger pO=null
trigger PO=null
trigger qO=null
trigger QO=null
trigger sO=null
trigger SO=null
trigger tO=null
trigger TO=null
trigger uO=null
trigger UO=null
trigger wO=null
trigger WO=null
trigger yO=null
trigger YO=null
trigger zO=null
trigger ZO=null
trigger vR=null
trigger eR=null
trigger xR=null
trigger oR=null
trigger rR=null
trigger iR=null
trigger BR=null
trigger cR=null
trigger dR=null
trigger DR=null
trigger fR=null
trigger FR=null
trigger gR=null
trigger GR=null
trigger hR=null
trigger HR=null
trigger jR=null
trigger JR=null
trigger kR=null
trigger KR=null
trigger lR=null
trigger LR=null
trigger mR=null
trigger MR=null
trigger pR=null
trigger PR=null
trigger qR=null
trigger QR=null
trigger sR=null
trigger SR=null
trigger tR=null
trigger TR=null
trigger uR=null
trigger UR=null
trigger wR=null
trigger WR=null
trigger yR=null
trigger YR=null
trigger zR=null
trigger ZR=null
trigger vI=null
trigger eI=null
trigger xI=null
trigger oI=null
trigger rI=null
trigger iI=null
trigger aI=null
trigger nI=null
trigger VI=null
trigger EI=null
trigger XI=null
trigger OI=null
trigger RI=null
trigger II=null
trigger AI=null
trigger NI=null
trigger bI=null
trigger BI=null
trigger cI=null
trigger CI=null
trigger fI=null
trigger FI=null
trigger gI=null
trigger GI=null
trigger hI=null
trigger HI=null
trigger jI=null
trigger JI=null
trigger kI=null
trigger KI=null
trigger lI=null
trigger LI=null
trigger mI=null
trigger MI=null
trigger pI=null
trigger PI=null
trigger qI=null
trigger QI=null
trigger sI=null
trigger SI=null
trigger tI=null
trigger TI=null
trigger uI=null
trigger UI=null
trigger wI=null
trigger WI=null
trigger yI=null
trigger YI=null
trigger zI=null
trigger ZI=null
trigger vA=null
trigger eA=null
trigger xA=null
trigger oA=null
trigger rA=null
trigger iA=null
trigger aA=null
trigger nA=null
trigger VA=null
trigger EA=null
trigger XA=null
trigger OA=null
trigger RA=null
trigger IA=null
trigger AA=null
trigger NA=null
trigger bA=null
trigger BA=null
trigger cA=null
trigger CA=null
trigger dA=null
trigger DA=null
trigger fA=null
trigger FA=null
trigger gA=null
trigger GA=null
trigger hA=null
trigger HA=null
trigger jA=null
trigger JA=null
trigger kA=null
trigger KA=null
trigger lA=null
trigger LA=null
trigger mA=null
trigger MA=null
trigger pA=null
trigger PA=null
trigger qA=null
trigger QA=null
trigger sA=null
trigger SA=null
trigger tA=null
trigger TA=null
trigger uA=null
trigger UA=null
trigger wA=null
trigger WA=null
trigger yA=null
trigger YA=null
trigger zA=null
trigger ZA=null
trigger vN=null
trigger eN=null
trigger xN=null
trigger oN=null
trigger rN=null
trigger iN=null
trigger nN=null
trigger VN=null
trigger EN=null
trigger XN=null
trigger ON=null
trigger RN=null
trigger IN=null
trigger AN=null
trigger NN=null
trigger bN=null
trigger BN=null
trigger cN=null
trigger CN=null
trigger dN=null
trigger DN=null
trigger fN=null
trigger FN=null
trigger gN=null
trigger GN=null
trigger hN=null
trigger HN=null
trigger jN=null
trigger JN=null
trigger kN=null
trigger KN=null
trigger lN=null
trigger LN=null
trigger mN=null
trigger MN=null
trigger pN=null
trigger PN=null
trigger qN=null
trigger QN=null
trigger sN=null
trigger SN=null
trigger tN=null
trigger TN=null
trigger uN=null
trigger UN=null
trigger wN=null
trigger WN=null
trigger yN=null
trigger YN=null
trigger zN=null
trigger ZN=null
trigger vb=null
trigger eb=null
trigger xb=null
trigger ob=null
trigger rb=null
trigger ib=null
trigger ab=null
trigger nb=null
trigger Vb=null
trigger Eb=null
trigger Xb=null
trigger Ob=null
trigger Rb=null
trigger Ib=null
trigger Ab=null
trigger Nb=null
trigger bb=null
trigger Bb=null
trigger cb=null
trigger Cb=null
trigger db=null
trigger Db=null
trigger fb=null
trigger Fb=null
trigger gb=null
trigger Gb=null
trigger hb=null
trigger Hb=null
trigger jb=null
trigger Jb=null
trigger kb=null
trigger Kb=null
trigger lb=null
trigger Lb=null
trigger mb=null
trigger Mb=null
trigger pb=null
trigger Pb=null
trigger qb=null
trigger Qb=null
trigger sb=null
trigger Sb=null
trigger tb=null
trigger Tb=null
trigger ub=null
trigger Ub=null
trigger wb=null
trigger Wb=null
trigger yb=null
trigger Yb=null
trigger zb=null
trigger Zb=null
trigger vB=null
trigger eB=null
trigger xB=null
trigger oB=null
trigger rB=null
trigger iB=null
trigger aB=null
trigger nB=null
unit SELECTION_HELICOPTER=null
unit SELECTION_TENT_1=null
unit SELECTION_TENT_2=null
unit NPC_SENTRY_GUN_1=null
unit NPC_SENTRY_GUN_2=null
unit NPC_SENTRY_GUN_3=null
unit FACTORY_GENERATOR_1=null
unit FACTORY_GENERATOR_2=null
unit FACTORY_GENERATOR_3=null
real kB=.0
real KB=.0
group lB=null
force LB=null
endglobals
//TESH.scrollpos=-1
//TESH.alwaysfold=0
globals
//group RifleButters=null
//group RifleButting=null
boolean AttackConvoy = false
integer array CivilianIDs
real MissionTimeModifier
real array BFG_Charge
real array BFG_ChargeActual
boolean array UICancel
player P_USMC
integer ITEM_SLOTS
group GLOBAL_ENUM_GROUP=CreateGroup()
force PLAYER_JAMMED=CreateForce()
unit array PLAYER_UNIT
unit array PLAYER_SELECTOR
integer array CURRENT_AMMO
boolean CINEMATIC_ENDED=false
integer SPAWN_LOC_AMT=0
quest OBJECTIVE_QUEST=null
quest OBJECTIVE_SECONDARY_QUEST=null
integer array EXHAUSTION
group SPRINTING_UNITS=null
string array M
string array P
boolean array q
group Q=null
integer array PLAYER_XP
integer array RANK_LIM
integer array PLAYER_DIFFCOMP
boolean array PLAYER_LIMMESSAGE
string array DIFF_NAMES
integer array MOS_LIST
integer array MOS_ALLOWED
integer FM_SHELLS=0
integer FM_RADIUS=0
integer SHELLS=0
location array vv
boolean array ev
group xv=null
integer rv=0
integer iv=0
location array av
gamecache nv=null
gamecache Vv=null
integer array Ev
integer array Xv
player CODE_PLAYER=null
string Code=""
integer CodeError=0
string array PLAYER_RANK_NAME
integer array KILL_XP_COUNTER
boolean array PLAYER_HAS_LOADED
item array Bv
integer FOUND_EVIDENCE=0
boolean DEFEATED=false
unit dv=null
integer PLAYERS_THAT_HAVE_SELECTED=0
integer fv=0
boolean array MSG_Jammed
boolean array MSG_Empty
boolean array Fv
integer array MAG_SIZE
integer array MAG_SIZE_STAND
boolean array gv
group Gv=null
integer array CLIP_SIZE
integer FOUND_PAPERS=0
group Jv=null
unit kv=null
group Kv=null
integer lv=0
boolean array IS_LINKING_BELTS
dialog MODE_SELECTION_DIALOG=null
button MODE_NORM_BUTTON=null
button MODE_HARD_BUTTON=null
button MODE_INSA_BUTTON=null
button MODE_SURV_BUTTON=null
boolean Sv=false
boolean tv=false
item array Tv
boolean uv=false
boolean Uv=false
boolean wv=false
group Wv=null
integer yv=0
unit Yv=null
integer array zv
integer DEPLOYMENT_TIME=0
integer MISSION_TIME=120
boolean ve=false
force ee=null
force FIREMODE_BURST=CreateForce()
force BURST_WAIT=CreateForce()
integer array BURST_ROUNDS
group ae=null
unit array ne
unit Ve=null
integer Ee=0
unit Xe=null
integer GAME_MODE=0
group Re=null
rect SPAWN_INFECTED_RECT=null
group Ae=null
integer Ne=0
item array be
location array Be
boolean array ce
group Ce=null
integer array PLAYER_HITS
integer array PLAYER_KILLS
unit array WEAPONS_CACHE
real array WEAPONS_CACHE_X
real array WEAPONS_CACHE_Y
boolean array WEAPONS_CACHE_FOUND
boolean array PLAYER_IS_SPRINTING
integer array PLAYER_UNIT_ID
group He=null
button MODE_RECR_BUTTON=null
group RELOADING=CreateGroup()
integer INFESTATION_LEVEL=0
integer OBJECTIVES_SUCCEEDED=0
integer OBJECTIVES_FAILED=0
integer array SELECTION_SLOT_STATE
integer array UNIT_TIMES_PICKED
unit pe=null
group SAFETY=null
group qe=null
integer Qe=0
force se=null
group te=null
group CSS_CASTERS=null
real array CSS_CASTER_VARS
gamecache CSCACHE_CACHE=null
integer CSS_CURRENT_ABILITY=0
unit CSS_CURRENT_CASTER=null
unit CSS_CURRENT_HURTER=null
real CSS_DELAY_HACK=0
location CSS_SOURCE_HACK=null
integer AVERAGE_XP_NO_HIGH_RANKS=0
integer PLAYING_PLAYERS=0
string array PLAYER_NAMES
group PLAYER_UNITS=null
integer array RANK_MIN_XP
integer array RANK_MAX_XP
string array RANK_NAME
integer array Ex
weathereffect Xx=null
boolean RAINING=false
integer array PLAYER_RANK
force FIREMODE_AUTO=CreateForce()
force FIREMODE_SINGLE=CreateForce()
integer STANDARD_INFECTED_GROUP_SIZE=0
integer INFECTED_GROUP_SIZE=0
integer array PLAYER_XP_100
weathereffect Cx=null
boolean SNOWING=false
location array Fx
location LOCALIZABLE_LOC=null
group GROUP_CRASH_VICTIMS=null
integer hx=0
rect array Hx
integer array jx
integer Jx=0
group kx=null
unit Kx=null
boolean lx=false
integer Lx=0
boolean array Mx
unit Px=null
boolean qx=false
integer Qx=0
button MODE_COMP_BUTTON=null
boolean Tx=false
integer array ux
integer array Ux
rect array wx
integer array Wx
integer yx=0
force array MODE_COMP_FORCE
integer array Zx
integer array vo
integer array INJURY_INDIVIDUAL_CHANCE
integer array INJURY_INDIVIDUAL_ORDER
integer array INJURY_INDIVIDUAL_ABILITY
group LOCALIZABLE_GROUP=null
unit io=null
item ao=null
group no=null
group Vo=null
boolean Eo=false
boolean Xo=false
boolean array PLAYER_HAS_NVG
integer array BIG_MOFO_LIST// was Ao
integer array BIG_ENEMY_MOFO
integer BIG_ENEMY_MOFO_AMT
boolean No=false
real XP_MODIFIER=0
unit co=null
location Co=null
timer do=null
button MODE_UMBR_BUTTON=null
unit UMBRELLA_POWER_GENERATOR=null
rect UMBRELLA_EVAC_RECT
timer TIMER_SELF_DEFENSE_BUFFER=null
group UMBRELLA_FLOOD_SQUAD=null
boolean UMBRELLA_WARZONE_STARTED=false
integer UMBRELLA_EVACUATED_MARINES=0
// AMHS
// boolean qo=false
// real Qo=0
// rect so=null
// boolean So=false
// lightning to=null
// real To=0
// real uo=0
// timer Uo=null
// timer wo=null
// boolean Wo=false
// unit yo=null
// unit Yo=null
// integer zo=0
// player array Zo
// integer vr=0
// real er=0
// rect xr=null
// real rr=0
// real ir=0
// integer ar=0
boolean nr=false
integer INJURY_CHANCE=0
boolean SINGLE_PLAYER=false
boolean CAN_SELECT_EXTRA_MODE=false
boolean MODE_RIFLE_ON=false
string QUEST_TITLE=""
quest MAIN_QUEST=null
boolean MODE_OUTBREAK_ON=false
integer br=0
dialog COMP_SELECTION_DIALOG=null
button COMP_CONT_BUTTON=null
button COMP_DEAT_BUTTON=null
button COMP_DEMO_BUTTON=null
unit array fr
item Fr=null
integer array Gr
integer array hr
unit array Hr
timer jr=null
boolean array Jr
boolean kr=false
rect array Kr
boolean Lr=false
group PUTTING_ON_ARMOR=null
group NADING=CreateGroup()
unit pr=null
group array Pr
integer array qr
boolean array Qr
boolean array sr
//gamecache LOCAL_VARS_CACHE=null
integer tr=0
integer array XP_ON_LOAD
boolean array ur
force OPPORTUNED_SHOT=null
timer array wr
player HOST=null
real LATENCY=0
boolean DISABLE_ION_CANNON=false
group UMBRELLA_CHECKPOINT_GROUP=null
real Zr=0
camerasetup eV=null
camerasetup xV=null
trigger QX=null
trigger sX=null
trigger SX=null
trigger tX=null
trigger TX=null
trigger uX=null
trigger UX=null
trigger wX=null
trigger WX=null
trigger yX=null
trigger YX=null
trigger zX=null
trigger ZX=null
trigger vO=null
trigger eO=null
trigger xO=null
trigger oO=null
trigger rO=null
trigger iO=null
trigger aO=null
trigger nO=null
trigger VO=null
trigger EO=null
trigger XO=null
trigger OO=null
trigger RO=null
trigger IO=null
trigger AO=null
trigger NO=null
trigger bO=null
trigger CO=null
trigger dO=null
trigger DO=null
trigger fO=null
trigger FO=null
trigger gO=null
trigger GO=null
trigger hO=null
trigger jO=null
trigger JO=null
trigger kO=null
trigger KO=null
trigger lO=null
trigger LO=null
trigger mO=null
trigger MO=null
trigger pO=null
trigger PO=null
trigger qO=null
trigger QO=null
trigger sO=null
trigger SO=null
trigger tO=null
trigger TO=null
trigger uO=null
trigger UO=null
trigger wO=null
trigger WO=null
trigger yO=null
trigger YO=null
trigger zO=null
trigger ZO=null
trigger vR=null
trigger eR=null
trigger xR=null
trigger oR=null
trigger rR=null
trigger iR=null
trigger aR=null
trigger nR=null
trigger VR=null
trigger ER=null
trigger XR=null
trigger OR=null
trigger RR=null
trigger IR=null
trigger AR=null
trigger NR=null
trigger bR=null
trigger BR=null
trigger cR=null
trigger CR=null
trigger dR=null
trigger DR=null
trigger fR=null
trigger FR=null
trigger gR=null
trigger GR=null
trigger HR=null
trigger jR=null
trigger JR=null
trigger kR=null
trigger KR=null
trigger lR=null
trigger mR=null
trigger MR=null
trigger pR=null
trigger PR=null
trigger qR=null
trigger sR=null
trigger SR=null
trigger tR=null
trigger TR=null
trigger uR=null
trigger UR=null
trigger wR=null
trigger yR=null
trigger zR=null
trigger ZR=null
trigger vI=null
trigger eI=null
trigger xI=null
trigger oI=null
trigger rI=null
trigger iI=null
trigger aI=null
trigger nI=null
trigger VI=null
trigger EI=null
trigger XI=null
trigger OI=null
trigger RI=null
trigger II=null
trigger AI=null
trigger NI=null
trigger bI=null
trigger BI=null
trigger cI=null
trigger CI=null
trigger dI=null
trigger DI=null
trigger fI=null
trigger FI=null
trigger gI=null
trigger GI=null
trigger hI=null
trigger HI=null
trigger jI=null
trigger JI=null
trigger kI=null
trigger lI=null
trigger LI=null
trigger mI=null
trigger MI=null
trigger pI=null
trigger PI=null
trigger qI=null
trigger QI=null
trigger sI=null
trigger SI=null
trigger tI=null
trigger TI=null
trigger uI=null
trigger UI=null
trigger wI=null
trigger WI=null
trigger yI=null
trigger YI=null
trigger zI=null
trigger ZI=null
trigger vA=null
trigger eA=null
trigger xA=null
trigger oA=null
trigger rA=null
trigger iA=null
trigger aA=null
trigger nA=null
trigger VA=null
trigger EA=null
trigger XA=null
trigger OA=null
trigger RA=null
trigger IA=null
trigger AA=null
trigger NA=null
trigger bA=null
trigger BA=null
trigger cA=null
trigger CA=null
trigger dA=null
trigger DA=null
trigger fA=null
trigger FA=null
trigger gA=null
trigger GA=null
trigger hA=null
trigger HA=null
trigger jA=null
trigger JA=null
trigger kA=null
trigger KA=null
trigger lA=null
trigger LA=null
trigger mA=null
trigger MA=null
trigger pA=null
trigger PA=null
trigger qA=null
trigger QA=null
trigger sA=null
trigger SA=null
trigger tA=null
trigger TA=null
trigger uA=null
trigger UA=null
trigger wA=null
trigger WA=null
trigger yA=null
trigger YA=null
trigger zA=null
trigger ZA=null
trigger vN=null
trigger eN=null
trigger xN=null
trigger oN=null
trigger rN=null
trigger iN=null
trigger aN=null
trigger nN=null
trigger VN=null
trigger EN=null
trigger XN=null
trigger ON=null
trigger RN=null
trigger IN=null
trigger AN=null
trigger NN=null
trigger bN=null
trigger BN=null
trigger cN=null
trigger CN=null
trigger dN=null
trigger DN=null
trigger fN=null
trigger FN=null
trigger gN=null
trigger GN=null
trigger hN=null
trigger HN=null
trigger jN=null
trigger JN=null
trigger kN=null
trigger KN=null
trigger lN=null
trigger LN=null
trigger mN=null
trigger MN=null
trigger pN=null
trigger PN=null
trigger qN=null
trigger QN=null
trigger sN=null
trigger SN=null
trigger tN=null
trigger TN=null
trigger uN=null
trigger UN=null
trigger wN=null
trigger WN=null
trigger yN=null
trigger YN=null
trigger zN=null
trigger ZN=null
trigger vb=null
trigger eb=null
trigger xb=null
trigger ob=null
trigger rb=null
trigger ib=null
trigger ab=null
trigger nb=null
trigger Vb=null
trigger Eb=null
trigger Xb=null
trigger Ob=null
trigger Rb=null
trigger Ib=null
trigger Ab=null
trigger Nb=null
trigger bb=null
trigger Bb=null
trigger cb=null
trigger Cb=null
trigger db=null
trigger Db=null
trigger fb=null
trigger Fb=null
trigger gb=null
trigger Gb=null
trigger hb=null
trigger Hb=null
trigger jb=null
trigger Jb=null
trigger kb=null
trigger Kb=null
trigger lb=null
trigger Lb=null
trigger mb=null
trigger Mb=null
trigger pb=null
trigger Pb=null
trigger qb=null
trigger Qb=null
trigger sb=null
trigger Sb=null
trigger tb=null
trigger Tb=null
trigger ub=null
trigger Ub=null
trigger wb=null
trigger Wb=null
trigger yb=null
trigger Yb=null
trigger zb=null
trigger Zb=null
trigger vB=null
trigger eB=null
trigger xB=null
trigger oB=null
trigger rB=null
trigger iB=null
trigger aB=null
trigger nB=null
unit SELECTION_HELICOPTER=null
unit SELECTION_TENT_1=null
unit SELECTION_TENT_2=null
unit NPC_SENTRY_GUN_1=null
unit NPC_SENTRY_GUN_2=null
unit NPC_SENTRY_GUN_3=null
unit FACTORY_GENERATOR_1=null
unit FACTORY_GENERATOR_2=null
unit FACTORY_GENERATOR_3=null
real kB=.0
real KB=.0
group lB=null
force LB=null
endglobals
//TESH.scrollpos=659
//TESH.alwaysfold=0
library Sounds initializer Init
globals
sound array SOUND_DISTANT_EXPLOSION
sound array SOUND_DISTANT_ARTILLERY
sound array SOUND_ARTILLERY_INCOMING
sound array SOUND_POLY_TARG_AIR
sound array SOUND_GRENADE3_DIST
sound array SOUND_UNDEAD_RAISE_REVIVE
sound array SOUND_ON
sound array SOUND_OFF
sound array SOUND_MARINE_CHAT
sound array SOUND_FLYBY
sound array SOUND_INSERTSHELL
sound array MINERVA_SOUNDS
sound SOUND_SAD_MISTERY
sound SOUND_AMBIENT_WINDLOOP=null
sound SOUND_AMBIENT_BNET_WINDLOOP=null
sound SOUND_AMBIENT_RAIN=null
sound SOUND_AMBIENT_UD_GLUESCREEN=null
sound SOUND_HINT=null
sound VV=null
sound EV=null
sound XV=null
sound SOUND_WAR3X_MAINSCREEN=null
sound SOUND_WAR3_MAINSCREEN=null
sound SOUND_DARK_AGENTS=null
sound AV=null
sound NV=null
sound bV=null
sound BV=null
sound cV=null
sound dV=null
sound SOUND_UNDEAD_2=null
sound SOUND_UNDEAD_3=null
sound SOUND_DIEBUZZ_C=null
sound DISTANT_EXPLOSION_1_1=null
sound DISTANT_EXPLOSION_1_2=null
sound DISTANT_EXPLOSION_1_3=null
sound DISTANT_EXPLOSION_1_4=null
sound DISTANT_EXPLOSION_1_5=null
sound DISTANT_EXPLOSION_1_6=null
sound DISTANT_EXPLOSION_1_7=null
sound POLY_TARG_AIR_1_1=null
sound POLY_TARG_AIR_1_2=null
sound LV=null
sound mV=null
sound MV=null
sound pV=null
sound PV=null
sound qV=null
sound QV=null
sound GRENADE3_DIST_1=null
sound GRENADE3_DIST_2=null
sound tV=null
sound TV=null
sound uV=null
sound UV=null
sound wV=null
sound WV=null
sound yV=null
sound YV=null
sound zV=null
sound ZV=null
sound vE=null
sound eE=null
sound xE=null
sound oE=null
sound rE=null
sound iE=null
sound SOUND_FLASHBACK=null
sound nE=null
sound VE=null
sound SOUND_HEARTBEAT=null
sound XE=null
sound OE=null
sound RE=null
sound IE=null
sound AE=null
sound NE=null
sound bE=null
sound BE=null
sound cE=null
sound SOUND_OH_LARGE_BUILDING_FIRE_DefEAX=null
sound dE=null
sound DE=null
sound fE=null
sound SOUND_NVG_OFF=null
sound SOUND_NVG_ON=null
sound SOUND_PICKUP=null
sound HE=null
sound jE=null
sound JE=null
sound kE=null
sound SOUND_UNDEAD_VICTORY=null
sound lE=null
sound SOUND_REINCARNATION=null
sound mE=null
sound ME=null
sound pE=null
sound PE=null
sound SOUND_RADIO_FEEDBACK_C_1=null
sound SOUND_RADIO_FEEDBACK_C_2=null
sound sE=null
sound SE=null
sound tE=null
sound wE=null
sound WE=null
sound SOUND_RING_6=null
sound YE=null
sound zE=null
sound ZE=null
sound vX=null
sound eX=null
sound xX=null
sound aX=null
sound nX=null
sound VX=null
sound EX=null
sound XX=null
sound SOUND_SUIT_SPRINT=null
sound SOUND_SUITE_WOUND=null
sound IX=null
sound AX=null
sound NX=null
sound SOUND_UNDEAD_X1=null
sound SOUND_CHAT_AFFIRMATIVE=null
sound SOUND_CHAT_ALLUNITSMOVEIN=null
sound CX=null
sound SOUND_CHAT_COPY=null
sound SOUND_CHAT_BAL_YES_3=null
sound SOUND_CHAT_GRENADE=null
sound SOUND_HUMAN_DEFEAT=null
sound OFF_1=null
sound OFF_2=null
sound OFF_3=null
sound SOUND_CHAT_OFFICERDOWN=null
sound SOUND_CHAT_OFFICERUNDERFIRE=null
sound ON_1=null
sound ON_2=null
sound SOUND_CHAT_BAL_YES_2=null
sound SOUND_CHAT_BAL_YES_1=null
sound SOUND_CHAT_BAL_WHAT1=null
sound SOUND_CHAT_BAL_WHAT2=null
sound SOUND_CHAT_WATCHIT=null
sound SOUND_SECRET_FOUND=null
sound PX=null
sound qX=null
endglobals
private function SetArrays takes nothing returns nothing
set SOUND_DISTANT_EXPLOSION[1]=DISTANT_EXPLOSION_1_1
set SOUND_DISTANT_EXPLOSION[2]=DISTANT_EXPLOSION_1_2
set SOUND_DISTANT_EXPLOSION[3]=DISTANT_EXPLOSION_1_3
set SOUND_DISTANT_EXPLOSION[4]=DISTANT_EXPLOSION_1_4
set SOUND_DISTANT_EXPLOSION[5]=DISTANT_EXPLOSION_1_5
set SOUND_DISTANT_EXPLOSION[6]=DISTANT_EXPLOSION_1_6
set SOUND_DISTANT_EXPLOSION[7]=DISTANT_EXPLOSION_1_7
set SOUND_DISTANT_ARTILLERY[1]=gg_snd_ArtilleryDist1
set SOUND_DISTANT_ARTILLERY[2]=gg_snd_ArtilleryDist2
set SOUND_DISTANT_ARTILLERY[3]=gg_snd_ArtilleryDist3
set SOUND_DISTANT_ARTILLERY[4]=gg_snd_ArtilleryDist4
set SOUND_ARTILLERY_INCOMING[1]=gg_snd_ArtilleryIncoming
set SOUND_ARTILLERY_INCOMING[2]=gg_snd_ArtilleryIncoming2
set SOUND_ARTILLERY_INCOMING[3]=gg_snd_ArtilleryIncoming3
set SOUND_POLY_TARG_AIR[1]=POLY_TARG_AIR_1_1
set SOUND_POLY_TARG_AIR[2]=POLY_TARG_AIR_1_2
set SOUND_GRENADE3_DIST[1]=GRENADE3_DIST_1
set SOUND_GRENADE3_DIST[2]=GRENADE3_DIST_2
set SOUND_UNDEAD_RAISE_REVIVE[1]=ZE
set SOUND_UNDEAD_RAISE_REVIVE[2]=vX
set SOUND_UNDEAD_RAISE_REVIVE[3]=eX
set SOUND_UNDEAD_RAISE_REVIVE[4]=xX
set SOUND_ON[1]=gg_snd_on2
set SOUND_ON[2]=gg_snd_on3
set SOUND_OFF[1]=gg_snd_off2
set SOUND_OFF[2]=gg_snd_off3
set SOUND_OFF[3]=gg_snd_off4
set MINERVA_SOUNDS[1]=gg_snd_OwlBearWhat1
set MINERVA_SOUNDS[2]=gg_snd_OwlBearWhat2
set MINERVA_SOUNDS[3]=gg_snd_OwlBearYes1
set MINERVA_SOUNDS[4]=gg_snd_OwlBearYes2
set MINERVA_SOUNDS[5]=gg_snd_OwlBearYesAttack1
set MINERVA_SOUNDS[6]=gg_snd_OwlBearYesAttack2
set SOUND_MARINE_CHAT[1]=gg_snd_BallistaYes3
set SOUND_MARINE_CHAT[2]=gg_snd_BallistaYesAttack3
set SOUND_MARINE_CHAT[3]=gg_snd_GrenadeChat
set SOUND_MARINE_CHAT[4]=gg_snd_watchit
set SOUND_MARINE_CHAT[5]=gg_snd_BallistaYes1
set SOUND_MARINE_CHAT[6]=gg_snd_officerdown
set SOUND_MARINE_CHAT[7]=gg_snd_officerunderfire
set SOUND_MARINE_CHAT[8]=gg_snd_BallistaYes2
set SOUND_MARINE_CHAT[9]=gg_snd_BallistaYes1
set SOUND_MARINE_CHAT[10]=gg_snd_BallistaYes2
set SOUND_MARINE_CHAT[11]=gg_snd_BallistaWhat1
set SOUND_FLYBY[1]=gg_snd_Flyby1
set SOUND_FLYBY[2]=gg_snd_Flyby2
set SOUND_FLYBY[3]=gg_snd_Flyby3
set SOUND_INSERTSHELL[1]=gg_snd_InsertShell1
set SOUND_INSERTSHELL[2]=gg_snd_InsertShell2
set SOUND_INSERTSHELL[3]=gg_snd_InsertShell3
endfunction
//=================================================
// INITIALIZER
//=================================================
private function Init takes nothing returns nothing
set SOUND_SAD_MISTERY=CreateSound("Sound\\Music\\mp3Music\\SadMystery.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_SAD_MISTERY,10000)
call SetSoundChannel(SOUND_SAD_MISTERY,0)
call SetSoundPitch(SOUND_SAD_MISTERY,1.)
call SetSoundVolume(SOUND_SAD_MISTERY,127)
set SOUND_AMBIENT_WINDLOOP=CreateSound("Sound\\Ambient\\WindLoopStereo.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_AMBIENT_WINDLOOP,"AmbientSoundTestWind")
call SetSoundDuration(SOUND_AMBIENT_WINDLOOP,11036)
call SetSoundVolume(SOUND_AMBIENT_WINDLOOP,80)
// was in rects
call SetSoundPosition(SOUND_AMBIENT_WINDLOOP,-1024.,13728.,95.6)
call RegisterStackedSound(SOUND_AMBIENT_WINDLOOP,true,7680.,4096.)
set SOUND_AMBIENT_BNET_WINDLOOP=CreateSound("Sound\\Ambient\\BattleNetWindStereoLoop1.wav",true,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_AMBIENT_BNET_WINDLOOP,"GlueScreenBnetWind")
call SetSoundDuration(SOUND_AMBIENT_BNET_WINDLOOP,19783)
call SetSoundVolume(SOUND_AMBIENT_BNET_WINDLOOP,127)
set SOUND_AMBIENT_RAIN=CreateSound("Sound\\Ambient\\RainAmbience.wav",true,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_AMBIENT_RAIN,"AmbientSoundRain")
call SetSoundDuration(SOUND_AMBIENT_RAIN,4418)
call SetSoundVolume(SOUND_AMBIENT_RAIN,127)
set SOUND_AMBIENT_UD_GLUESCREEN=CreateSound("Sound\\Ambient\\UndeadGlueScreenLoop1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_AMBIENT_UD_GLUESCREEN,"UndeadGlueScreenLoop")
call SetSoundDuration(SOUND_AMBIENT_UD_GLUESCREEN,7291)
call SetSoundVolume(SOUND_AMBIENT_UD_GLUESCREEN,127)
set SOUND_HINT=CreateSound("Sound\\Interface\\Hint.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_HINT,"Hint")
call SetSoundDuration(SOUND_HINT,2006)
call SetSoundVolume(SOUND_HINT,100)
set VV=CreateSound("war3mapImported\\Autoshotgun.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(VV,713)
call SetSoundChannel(VV,0)
call SetSoundVolume(VV,127)
call SetSoundPitch(VV,1.)
call SetSoundDistances(VV,600.,10000.)
call SetSoundDistanceCutoff(VV,3000.)
call SetSoundConeAngles(VV,.0,.0,127)
call SetSoundConeOrientation(VV,.0,.0,.0)
set EV=CreateSound("war3mapImported\\Autoshotgun.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(EV,713)
call SetSoundChannel(EV,2)
call SetSoundVolume(EV,127)
call SetSoundPitch(EV,1.)
call SetSoundDistances(EV,600.,10000.)
call SetSoundDistanceCutoff(EV,3000.)
call SetSoundConeAngles(EV,.0,.0,127)
call SetSoundConeOrientation(EV,.0,.0,.0)
set XV=CreateSound("war3mapImported\\Autoshotgun.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(XV,713)
call SetSoundChannel(XV,2)
call SetSoundVolume(XV,127)
call SetSoundPitch(XV,1.)
call SetSoundDistances(XV,600.,10000.)
call SetSoundDistanceCutoff(XV,3000.)
call SetSoundConeAngles(XV,.0,.0,127)
call SetSoundConeOrientation(XV,.0,.0,.0)
set SOUND_WAR3X_MAINSCREEN=CreateSound("Sound\\Music\\mp3Music\\War3XMainScreen.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_WAR3X_MAINSCREEN,80162)
call SetSoundChannel(SOUND_WAR3X_MAINSCREEN,0)
call SetSoundVolume(SOUND_WAR3X_MAINSCREEN,127)
call SetSoundPitch(SOUND_WAR3X_MAINSCREEN,1.)
set SOUND_WAR3_MAINSCREEN=CreateSound("Sound\\Music\\mp3Music\\Mainscreen.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_WAR3_MAINSCREEN,69177)
call SetSoundChannel(SOUND_WAR3_MAINSCREEN,0)
call SetSoundVolume(SOUND_WAR3_MAINSCREEN,127)
call SetSoundPitch(SOUND_WAR3_MAINSCREEN,1.)
set SOUND_DARK_AGENTS=CreateSound("Sound\\Music\\mp3Music\\DarkAgents.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_DARK_AGENTS,64950)
call SetSoundChannel(SOUND_DARK_AGENTS,0)
call SetSoundVolume(SOUND_DARK_AGENTS,127)
call SetSoundPitch(SOUND_DARK_AGENTS,1.)
set NV=CreateSound("Units\\Undead\\ObsidianStatue\\ObsidianStatueMorph.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(NV,"ObsidianStatueMorph")
call SetSoundDuration(NV,3384)
set bV=CreateSound("Abilities\\Spells\\Orc\\Voodoo\\BigBadVoodooSpellBirth1.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(bV,"VoodooBirth")
call SetSoundDuration(bV,3442)
set BV=CreateSound("Sound\\Interface\\BattleNetTick.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(BV,"ChatroomTimerTick")
call SetSoundDuration(BV,476)
call SetSoundVolume(BV,50)
set cV=CreateSound("war3mapImported\\bulletchain2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(cV,1288)
call SetSoundChannel(cV,2)
call SetSoundVolume(cV,127)
call SetSoundPitch(cV,1.)
call SetSoundDistances(cV,600.,10000.)
call SetSoundDistanceCutoff(cV,3000.)
call SetSoundConeAngles(cV,.0,.0,127)
call SetSoundConeOrientation(cV,.0,.0,.0)
set dV=CreateSound("war3mapImported\\ArtExplodeW.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(dV,1254)
call SetSoundChannel(dV,2)
call SetSoundVolume(dV,100)
call SetSoundPitch(dV,1.)
call SetSoundDistances(dV,1750.,10000.)
call SetSoundDistanceCutoff(dV,4000.)
call SetSoundConeAngles(dV,.0,.0,127)
call SetSoundConeOrientation(dV,.0,.0,.0)
set SOUND_UNDEAD_2=CreateSound("Sound\\Music\\mp3Music\\Undead2.mp3",true,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_UNDEAD_2,309242)
call SetSoundChannel(SOUND_UNDEAD_2,0)
call SetSoundVolume(SOUND_UNDEAD_2,127)
call SetSoundPitch(SOUND_UNDEAD_2,1.)
set SOUND_UNDEAD_3=CreateSound("Sound\\Music\\mp3Music\\Undead3.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_UNDEAD_3,291071)
call SetSoundChannel(SOUND_UNDEAD_3,0)
call SetSoundVolume(SOUND_UNDEAD_3,127)
call SetSoundPitch(SOUND_UNDEAD_3,1.)
set SOUND_DIEBUZZ_C=CreateSound("war3mapImported\\diebuzzC.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_DIEBUZZ_C,2985)
call SetSoundChannel(SOUND_DIEBUZZ_C,2)
call SetSoundVolume(SOUND_DIEBUZZ_C,127)
call SetSoundPitch(SOUND_DIEBUZZ_C,1.)
call SetSoundDistances(SOUND_DIEBUZZ_C,1000.,10000.)
call SetSoundDistanceCutoff(SOUND_DIEBUZZ_C,4000.)
call SetSoundConeAngles(SOUND_DIEBUZZ_C,.0,.0,127)
call SetSoundConeOrientation(SOUND_DIEBUZZ_C,.0,.0,.0)
set DISTANT_EXPLOSION_1_1=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_1,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_1,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_1,'x')
call SetSoundPitch(DISTANT_EXPLOSION_1_1,.9)
set DISTANT_EXPLOSION_1_2=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_2,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_2,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_2,'z')
call SetSoundPitch(DISTANT_EXPLOSION_1_2,1.)
set DISTANT_EXPLOSION_1_3=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_3,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_3,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_3,'v')
call SetSoundPitch(DISTANT_EXPLOSION_1_3,.9)
set DISTANT_EXPLOSION_1_4=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_4,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_4,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_4,'}')
call SetSoundPitch(DISTANT_EXPLOSION_1_4,.9)
set DISTANT_EXPLOSION_1_5=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_5,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_5,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_5,'{')
call SetSoundPitch(DISTANT_EXPLOSION_1_5,1.)
set DISTANT_EXPLOSION_1_6=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_6,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_6,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_6,'w')
call SetSoundPitch(DISTANT_EXPLOSION_1_6,1.)
set DISTANT_EXPLOSION_1_7=CreateSound("war3mapImported\\DistantExplosion1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(DISTANT_EXPLOSION_1_7,974)
call SetSoundChannel(DISTANT_EXPLOSION_1_7,2)
call SetSoundVolume(DISTANT_EXPLOSION_1_7,127)
call SetSoundPitch(DISTANT_EXPLOSION_1_7,1.)
set POLY_TARG_AIR_1_1=CreateSound("Abilities\\Spells\\Human\\Polymorph\\PolymorphTargetAir1.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(POLY_TARG_AIR_1_1,"PolymorphAir")
call SetSoundDuration(POLY_TARG_AIR_1_1,663)
call SetSoundVolume(POLY_TARG_AIR_1_1,55)
call SetSoundPitch(POLY_TARG_AIR_1_1,.8)
set POLY_TARG_AIR_1_2=CreateSound("Abilities\\Spells\\Human\\Polymorph\\PolymorphTargetAir1.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(POLY_TARG_AIR_1_2,"PolymorphAir")
call SetSoundDuration(POLY_TARG_AIR_1_2,663)
call SetSoundVolume(POLY_TARG_AIR_1_2,60)
call SetSoundPitch(POLY_TARG_AIR_1_2,.8)
set LV=CreateSound("Abilities\\Spells\\Human\\Polymorph\\PolymorphDone.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(LV,"PolymorphDone")
call SetSoundDuration(LV,872)
call SetSoundChannel(LV,0)
call SetSoundVolume(LV,30)
call SetSoundPitch(LV,1.2)
set mV=CreateSound("war3mapImported\\DistantHighCal.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(mV,557)
call SetSoundChannel(mV,0)
call SetSoundVolume(mV,80)
call SetSoundPitch(mV,1.)
set MV=CreateSound("war3mapImported\\DistantLowCal.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(MV,165)
call SetSoundChannel(MV,0)
call SetSoundVolume(MV,50)
call SetSoundPitch(MV,1.)
set pV=CreateSound("war3mapImported\\DistantLowCal2.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(pV,165)
call SetSoundChannel(pV,0)
call SetSoundVolume(pV,65)
call SetSoundPitch(pV,1.)
set PV=CreateSound("war3mapImported\\DistantMediumCal.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(PV,139)
call SetSoundChannel(PV,0)
call SetSoundVolume(PV,75)
call SetSoundPitch(PV,1.)
set qV=CreateSound("war3mapImported\\DistantMG.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(qV,348)
call SetSoundChannel(qV,0)
call SetSoundVolume(qV,40)
call SetSoundPitch(qV,1.)
set QV=CreateSound("Sound\\Buildings\\Death\\NightElfBuildingDeathSmall1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(QV,"DeathNightElfBuildingCancel")
call SetSoundDuration(QV,3675)
call SetSoundVolume(QV,80)
call SetSoundPitch(QV,.8)
set GRENADE3_DIST_1=CreateSound("war3mapImported\\Grenade3 Dist.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(GRENADE3_DIST_1,1333)
call SetSoundChannel(GRENADE3_DIST_1,2)
call SetSoundVolume(GRENADE3_DIST_1,127)
call SetSoundPitch(GRENADE3_DIST_1,1.)
set GRENADE3_DIST_2=CreateSound("war3mapImported\\Grenade3 Dist.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(GRENADE3_DIST_2,1333)
call SetSoundChannel(GRENADE3_DIST_2,2)
call SetSoundVolume(GRENADE3_DIST_2,127)
call SetSoundPitch(GRENADE3_DIST_2,1.1)
set tV=CreateSound("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(tV,"Resurrect")
call SetSoundDuration(tV,499)
call SetSoundChannel(tV,2)
call SetSoundDistances(tV,1000.,10000.)
call SetSoundDistanceCutoff(tV,5000.)
set TV=CreateSound("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(TV,"Resurrect")
call SetSoundDuration(TV,499)
call SetSoundChannel(TV,2)
call SetSoundDistances(TV,1000.,10000.)
call SetSoundDistanceCutoff(TV,5000.)
set uV=CreateSound("Abilities\\Spells\\Human\\Slow\\SlowTarget.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(uV,"Slow")
call SetSoundDuration(uV,165)
call SetSoundDistances(uV,500.,10000.)
call SetSoundDistanceCutoff(uV,2000.)
set UV=CreateSound("Abilities\\Spells\\Human\\Slow\\SlowTarget.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(UV,"Slow")
call SetSoundDuration(UV,165)
call SetSoundDistances(UV,500.,10000.)
call SetSoundDistanceCutoff(UV,2000.)
set wV=CreateSound("war3mapImported\\Equip_Armor.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(wV,1314)
call SetSoundChannel(wV,2)
call SetSoundVolume(wV,127)
call SetSoundPitch(wV,1.)
call SetSoundDistances(wV,600.,10000.)
call SetSoundDistanceCutoff(wV,3000.)
call SetSoundConeAngles(wV,.0,.0,127)
call SetSoundConeOrientation(wV,.0,.0,.0)
set WV=CreateSound("Abilities\\Spells\\NightElf\\Uproot\\Uproot.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(WV,"Uproot")
call SetSoundDuration(WV,412)
call SetSoundChannel(WV,2)
call SetSoundVolume(WV,100)
set yV=CreateSound("Sound\\Interface\\GlueScreenMeteorLaunch3.wav",false,false,false,10,10,"MissilesEAX")
call SetSoundParamsFromLabel(yV,"GlueScreenMeteorLaunch")
call SetSoundDuration(yV,3000)
call SetSoundVolume(yV,127)
call SetSoundPitch(yV,.9)
set YV=CreateSound("Abilities\\Weapons\\CannonTowerMissile\\CannonTowerMissileLaunch2.wav",false,true,false,10,10,"CombatSoundsEAX")
call SetSoundParamsFromLabel(YV,"CannonTowerAttack")
call SetSoundDuration(YV,1219)
set zV=CreateSound("Abilities\\Spells\\NightElf\\Root\\Root.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(zV,"Root")
call SetSoundDuration(zV,482)
set ZV=CreateSound("Abilities\\Spells\\NightElf\\Root\\Root.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(ZV,"Root")
call SetSoundDuration(ZV,482)
set xE=CreateSound("Units\\Undead\\ObsidianStatue\\ObsidianAvengerWhat1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(xE,"ObsidianDestroyerWhat")
call SetSoundDuration(xE,2519)
set oE=CreateSound("Units\\Undead\\ObsidianStatue\\ObsidianAvengerWhat2.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(oE,"ObsidianDestroyerWhat")
call SetSoundDuration(oE,2647)
set rE=CreateSound("Units\\Undead\\ObsidianStatue\\ObsidianAvengerWhat3.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(rE,"ObsidianDestroyerWhat")
call SetSoundDuration(rE,2682)
set iE=CreateSound("Sound\\Units\\Combat\\MetalHeavyBashMetal2.wav",false,true,false,10,10,"CombatSoundsEAX")
call SetSoundParamsFromLabel(iE,"MetalHeavyBashMetal")
call SetSoundDuration(iE,1248)
call SetSoundDistances(iE,900.,10000.)
call SetSoundDistanceCutoff(iE,3500.)
set SOUND_FLASHBACK=CreateSound("Sound\\Ambient\\DoodadEffects\\FlashBack1Second.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_FLASHBACK,"FlashBack1Second")
call SetSoundDuration(SOUND_FLASHBACK,2178)
call SetSoundPitch(SOUND_FLASHBACK,.5)
set nE=CreateSound("war3mapImported\\GrenadeLaunch1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(nE,166)
call SetSoundChannel(nE,2)
call SetSoundVolume(nE,127)
call SetSoundPitch(nE,1.)
call SetSoundDistances(nE,800.,10000.)
call SetSoundDistanceCutoff(nE,3500.)
call SetSoundConeAngles(nE,.0,.0,127)
call SetSoundConeOrientation(nE,.0,.0,.0)
set VE=CreateSound("Abilities\\Spells\\Human\\Flare\\FlareTarget1.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(VE,"Flare1")
call SetSoundDuration(VE,3582)
set SOUND_HEARTBEAT=CreateSound("war3mapImported\\Heartbeat.mp3",true,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_HEARTBEAT,687)
call SetSoundChannel(SOUND_HEARTBEAT,0)
call SetSoundVolume(SOUND_HEARTBEAT,127)
call SetSoundPitch(SOUND_HEARTBEAT,1.)
set XE=CreateSound("Abilities\\Spells\\Demon\\RainOfFire\\RainOfFireTarget3.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(XE,"StarfallTarget")
call SetSoundDuration(XE,3000)
set OE=CreateSound("Sound\\Buildings\\Death\\BuildingDeathLargeHuman.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(OE,"DeathHumanLargeBuilding")
call SetSoundDuration(OE,1493)
call SetSoundPitch(OE,.3)
set RE=CreateSound("war3mapImported\\IonCannon.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(RE,1549)
call SetSoundChannel(RE,2)
call SetSoundVolume(RE,127)
call SetSoundPitch(RE,1.)
set IE=CreateSound("Sound\\Units\\Footsteps\\step.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(IE,"TestFootstep")
call SetSoundDuration(IE,540)
call SetSoundVolume(IE,127)
call SetSoundDistances(IE,600.,10000.)
call SetSoundDistanceCutoff(IE,3000.)
set AE=CreateSound("Units\\NightElf\\FaerieDragon\\FaerieDragonWhat1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(AE,"FaerieDragonWhat")
call SetSoundDuration(AE,1382)
set NE=CreateSound("Units\\NightElf\\FaerieDragon\\FaerieDragonYes2.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(NE,"FaerieDragonYesAttack")
call SetSoundDuration(NE,1625)
set bE=CreateSound("Units\\NightElf\\FaerieDragon\\FaerieDragonPissed1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(bE,"FaerieDragonPissed")
call SetSoundDuration(bE,3200)
set BE=CreateSound("Sound\\Buildings\\Fire\\OrcHumanLargeBuildingFire1.wav",true,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(BE,"HumanFireLarge")
call SetSoundDuration(BE,3471)
call SetSoundPitch(BE,1.8)
set cE=CreateSound("Sound\\Interface\\GlueScreenMeteorHit1.wav",false,true,false,10,10,"MissilesEAX")
call SetSoundParamsFromLabel(cE,"GlueScreenMeteorHit")
call SetSoundDuration(cE,1500)
call SetSoundVolume(cE,127)
call SetSoundPitch(cE,.8)
call SetSoundDistances(cE,1000.,10000.)
call SetSoundDistanceCutoff(cE,5000.)
set SOUND_OH_LARGE_BUILDING_FIRE_DefEAX=CreateSound("Sound\\Buildings\\Fire\\OrcHumanLargeBuildingFire1.wav",true,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,"HumanFireLarge")
call SetSoundDuration(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,3471)
call SetSoundChannel(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,0)
call SetSoundPitch(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,1.8)
call SetSoundDistances(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,800.,100000.)
call SetSoundDistanceCutoff(SOUND_OH_LARGE_BUILDING_FIRE_DefEAX,3000.)
set dE=CreateSound("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(dE,"MassTeleport")
call SetSoundDuration(dE,4899)
call SetSoundPitch(dE,.6)
set DE=CreateSound("Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(DE,"Invisibility")
call SetSoundDuration(DE,440)
call SetSoundChannel(DE,2)
set fE=CreateSound("Abilities\\Spells\\Human\\Invisibility\\InvisibilityTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(fE,"Invisibility")
call SetSoundDuration(fE,440)
call SetSoundChannel(fE,2)
call SetSoundPitch(fE,1.)
set SOUND_NVG_OFF=CreateSound("war3mapImported\\nvg_off.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_NVG_OFF,191)
call SetSoundChannel(SOUND_NVG_OFF,2)
call SetSoundVolume(SOUND_NVG_OFF,127)
call SetSoundPitch(SOUND_NVG_OFF,1.)
call SetSoundDistances(SOUND_NVG_OFF,600.,10000.)
call SetSoundDistanceCutoff(SOUND_NVG_OFF,3000.)
call SetSoundConeAngles(SOUND_NVG_OFF,.0,.0,127)
call SetSoundConeOrientation(SOUND_NVG_OFF,.0,.0,.0)
set SOUND_NVG_ON=CreateSound("war3mapImported\\nvg_on.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_NVG_ON,348)
call SetSoundChannel(SOUND_NVG_ON,2)
call SetSoundVolume(SOUND_NVG_ON,127)
call SetSoundPitch(SOUND_NVG_ON,1.)
call SetSoundDistances(SOUND_NVG_ON,600.,10000.)
call SetSoundDistanceCutoff(SOUND_NVG_ON,3000.)
call SetSoundConeAngles(SOUND_NVG_ON,.0,.0,127)
call SetSoundConeOrientation(SOUND_NVG_ON,.0,.0,.0)
set SOUND_PICKUP=CreateSound("war3mapImported\\Pickup2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_PICKUP,530)
call SetSoundChannel(SOUND_PICKUP,2)
call SetSoundVolume(SOUND_PICKUP,100)
call SetSoundPitch(SOUND_PICKUP,1.)
call SetSoundDistances(SOUND_PICKUP,600.,10000.)
call SetSoundDistanceCutoff(SOUND_PICKUP,3000.)
call SetSoundConeAngles(SOUND_PICKUP,.0,.0,127)
call SetSoundConeOrientation(SOUND_PICKUP,.0,.0,.0)
set HE=CreateSound("Abilities\\Weapons\\DruidoftheTalonMissile\\DruidOfTheTalonMissileLaunch1.wav",false,true,false,10,10,"MissilesEAX")
call SetSoundParamsFromLabel(HE,"DruidOfTheTalonMissileLaunch")
call SetSoundDuration(HE,395)
set jE=CreateSound("Abilities\\Weapons\\DruidoftheTalonMissile\\DruidOfTheTalonMissileLaunch2.wav",false,true,false,10,10,"MissilesEAX")
call SetSoundParamsFromLabel(jE,"DruidOfTheTalonMissileLaunch")
call SetSoundDuration(jE,405)
set JE=CreateSound("war3mapImported\\PlasmaRifleReload.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(JE,3456)
call SetSoundChannel(JE,2)
call SetSoundVolume(JE,127)
call SetSoundPitch(JE,1.)
call SetSoundDistances(JE,900.,10000.)
call SetSoundDistanceCutoff(JE,5000.)
call SetSoundConeAngles(JE,.0,.0,127)
call SetSoundConeOrientation(JE,.0,.0,.0)
set kE=CreateSound("Abilities\\Spells\\Undead\\Impale\\ImpaleLand.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(kE,"ImpaleLand")
call SetSoundDuration(kE,879)
call SetSoundPitch(kE,.8)
set SOUND_UNDEAD_VICTORY=CreateSound("Sound\\Music\\mp3Music\\UndeadVictory.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_UNDEAD_VICTORY,39794)
call SetSoundChannel(SOUND_UNDEAD_VICTORY,0)
call SetSoundVolume(SOUND_UNDEAD_VICTORY,127)
call SetSoundPitch(SOUND_UNDEAD_VICTORY,1.)
set lE=CreateSound("war3mapImported\\PointSecure.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(lE,1079)
call SetSoundChannel(lE,2)
call SetSoundVolume(lE,127)
call SetSoundPitch(lE,1.)
call SetSoundDistances(lE,3000.,10000.)
call SetSoundDistanceCutoff(lE,100000.)
call SetSoundConeAngles(lE,.0,.0,127)
call SetSoundConeOrientation(lE,.0,.0,.0)
set SOUND_REINCARNATION=CreateSound("Abilities\\Spells\\Orc\\Reincarnation\\Reincarnation.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(SOUND_REINCARNATION,"Reincarnation")
call SetSoundDuration(SOUND_REINCARNATION,2728)
call SetSoundPitch(SOUND_REINCARNATION,.6)
set mE=CreateSound("war3mapImported\\pshield.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(mE,1184)
call SetSoundChannel(mE,2)
call SetSoundVolume(mE,127)
call SetSoundPitch(mE,1.)
call SetSoundDistances(mE,600.,10000.)
call SetSoundDistanceCutoff(mE,3000.)
call SetSoundConeAngles(mE,.0,.0,127)
call SetSoundConeOrientation(mE,.0,.0,.0)
set ME=CreateSound("Sound\\Interface\\QuestCompleted.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(ME,"QuestCompleted")
call SetSoundDuration(ME,5155)
call SetSoundVolume(ME,127)
set pE=CreateSound("Sound\\Interface\\QuestFailed.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(pE,"QuestFailed")
call SetSoundDuration(pE,4690)
call SetSoundVolume(pE,127)
call SetSoundPitch(pE,.7)
set PE=CreateSound("Sound\\Interface\\QuestNew.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(PE,"QuestNew")
call SetSoundDuration(PE,3750)
call SetSoundVolume(PE,127)
set SOUND_RADIO_FEEDBACK_C_1=CreateSound("war3mapImported\\RadioFeedback_C.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_RADIO_FEEDBACK_C_1,307)
call SetSoundChannel(SOUND_RADIO_FEEDBACK_C_1,2)
call SetSoundVolume(SOUND_RADIO_FEEDBACK_C_1,127)
call SetSoundPitch(SOUND_RADIO_FEEDBACK_C_1,1.)
set SOUND_RADIO_FEEDBACK_C_2=CreateSound("war3mapImported\\RadioFeedback_C.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_RADIO_FEEDBACK_C_2,307)
call SetSoundChannel(SOUND_RADIO_FEEDBACK_C_2,2)
call SetSoundVolume(SOUND_RADIO_FEEDBACK_C_2,127)
call SetSoundPitch(SOUND_RADIO_FEEDBACK_C_2,1.)
call SetSoundDistances(SOUND_RADIO_FEEDBACK_C_2,800.,10000.)
call SetSoundDistanceCutoff(SOUND_RADIO_FEEDBACK_C_2,4000.)
call SetSoundConeAngles(SOUND_RADIO_FEEDBACK_C_2,.0,.0,127)
call SetSoundConeOrientation(SOUND_RADIO_FEEDBACK_C_2,.0,.0,.0)
set sE=CreateSound("war3mapImported\\blacka1.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(sE,739)
call SetSoundChannel(sE,2)
call SetSoundVolume(sE,127)
call SetSoundPitch(sE,1.)
call SetSoundDistances(sE,600.,10000.)
call SetSoundDistanceCutoff(sE,3000.)
call SetSoundConeAngles(sE,.0,.0,127)
call SetSoundConeOrientation(sE,.0,.0,.0)
set SE=CreateSound("war3mapImported\\blackd1.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SE,1758)
call SetSoundChannel(SE,2)
call SetSoundVolume(SE,127)
call SetSoundPitch(SE,1.)
call SetSoundDistances(SE,600.,10000.)
call SetSoundDistanceCutoff(SE,3000.)
call SetSoundConeAngles(SE,.0,.0,127)
call SetSoundConeOrientation(SE,.0,.0,.0)
set tE=CreateSound("war3mapImported\\blackh1.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(tE,504)
call SetSoundChannel(tE,2)
call SetSoundVolume(tE,127)
call SetSoundPitch(tE,1.)
call SetSoundDistances(tE,600.,10000.)
call SetSoundDistanceCutoff(tE,3000.)
call SetSoundConeAngles(tE,.0,.0,127)
call SetSoundConeOrientation(tE,.0,.0,.0)
set wE=CreateSound("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(wE,"DispelMagic")
call SetSoundDuration(wE,451)
call SetSoundChannel(wE,2)
set WE=CreateSound("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(WE,"DispelMagic")
call SetSoundDuration(WE,451)
call SetSoundChannel(WE,2)
call SetSoundPitch(WE,1.)
set SOUND_RING_6=CreateSound("war3mapImported\\ring4.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_RING_6,6000)
call SetSoundChannel(SOUND_RING_6,0)
call SetSoundVolume(SOUND_RING_6,100)
call SetSoundPitch(SOUND_RING_6,1.)
set YE=CreateSound("Abilities\\Weapons\\BoatMissile\\BoatAttack1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(YE,"BoatMissileLaunch")
call SetSoundDuration(YE,235)
call SetSoundChannel(YE,2)
call SetSoundDistances(YE,900.,10000.)
call SetSoundDistanceCutoff(YE,4000.)
set zE=CreateSound("Abilities\\Spells\\Human\\Polymorph\\PolymorphDone.wav",false,true,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(zE,"PolymorphDone")
call SetSoundDuration(zE,872)
call SetSoundPitch(zE,.5)
call SetSoundDistances(zE,1000.,10000.)
call SetSoundDistanceCutoff(zE,5000.)
set ZE=CreateSound("Abilities\\Spells\\Undead\\DarkSummoning\\DarkSummoningTarget1.wav",false,false,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(ZE,"DarkSummoningTarget")
call SetSoundDuration(ZE,3320)
call SetSoundPitch(ZE,.7)
set vX=CreateSound("Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget1.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(vX,"DarkRitual")
call SetSoundDuration(vX,3007)
call SetSoundPitch(vX,.7)
set eX=CreateSound("Abilities\\Spells\\Undead\\ReviveUndead\\ReviveUndead.wav",false,false,false,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(eX,"ReviveUndead")
call SetSoundDuration(eX,3623)
call SetSoundVolume(eX,80)
call SetSoundPitch(eX,.5)
set xX=CreateSound("Abilities\\Spells\\Orc\\ReviveOrc\\ReviveOrc.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(xX,"ReviveOrc")
call SetSoundDuration(xX,3013)
set aX=CreateSound("war3mapImported\\shotgun.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(aX,728)
call SetSoundChannel(aX,2)
call SetSoundVolume(aX,127)
call SetSoundPitch(aX,1.)
call SetSoundDistances(aX,600.,10000.)
call SetSoundDistanceCutoff(aX,3000.)
call SetSoundConeAngles(aX,.0,.0,127)
call SetSoundConeOrientation(aX,.0,.0,.0)
set nX=CreateSound("war3mapImported\\shotgun.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(nX,728)
call SetSoundChannel(nX,2)
call SetSoundVolume(nX,127)
call SetSoundPitch(nX,1.)
call SetSoundDistances(nX,600.,10000.)
call SetSoundDistanceCutoff(nX,3000.)
call SetSoundConeAngles(nX,.0,.0,127)
call SetSoundConeOrientation(nX,.0,.0,.0)
set VX=CreateSound("Units\\Orc\\Catapult\\CatapultAttack1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(VX,"CatapultAttack1")
call SetSoundDuration(VX,239)
call SetSoundChannel(VX,2)
set EX=CreateSound("Units\\Orc\\Catapult\\CatapultAttack1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(EX,"CatapultAttack1")
call SetSoundDuration(EX,239)
call SetSoundChannel(EX,2)
call SetSoundPitch(EX,1.)
set XX=CreateSound("war3mapImported\\ArtExplodeW.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(XX,1254)
call SetSoundChannel(XX,2)
call SetSoundVolume(XX,100)
call SetSoundPitch(XX,1.1)
call SetSoundDistances(XX,600.,10000.)
call SetSoundDistanceCutoff(XX,3000.)
call SetSoundConeAngles(XX,.0,.0,127)
call SetSoundConeOrientation(XX,.0,.0,.0)
set SOUND_SUIT_SPRINT=CreateSound("war3mapImported\\suit_sprint.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_SUIT_SPRINT,510)
call SetSoundChannel(SOUND_SUIT_SPRINT,2)
call SetSoundVolume(SOUND_SUIT_SPRINT,127)
call SetSoundPitch(SOUND_SUIT_SPRINT,1.)
call SetSoundDistances(SOUND_SUIT_SPRINT,600.,10000.)
call SetSoundDistanceCutoff(SOUND_SUIT_SPRINT,3000.)
call SetSoundConeAngles(SOUND_SUIT_SPRINT,.0,.0,127)
call SetSoundConeOrientation(SOUND_SUIT_SPRINT,.0,.0,.0)
set SOUND_SUITE_WOUND=CreateSound("war3mapImported\\SuiteWound2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_SUITE_WOUND,1236)
call SetSoundChannel(SOUND_SUITE_WOUND,2)
call SetSoundVolume(SOUND_SUITE_WOUND,100)
call SetSoundPitch(SOUND_SUITE_WOUND,1.)
call SetSoundDistances(SOUND_SUITE_WOUND,600.,10000.)
call SetSoundDistanceCutoff(SOUND_SUITE_WOUND,3000.)
call SetSoundConeAngles(SOUND_SUITE_WOUND,.0,.0,127)
call SetSoundConeOrientation(SOUND_SUITE_WOUND,.0,.0,.0)
set IX=CreateSound("Sound\\Ambient\\DoodadEffects\\Switch.wav",false,true,true,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(IX,"Switch")
call SetSoundDuration(IX,2606)
set AX=CreateSound("Sound\\Interface\\GlueScreenMeteorLaunch3.wav",false,false,false,10,10,"MissilesEAX")
call SetSoundParamsFromLabel(AX,"GlueScreenMeteorLaunch")
call SetSoundDuration(AX,3000)
call SetSoundVolume(AX,127)
call SetSoundPitch(AX,.3)
set NX=CreateSound("war3mapImported\\ToggleFireMode.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(NX,191)
call SetSoundChannel(NX,2)
call SetSoundVolume(NX,100)
call SetSoundPitch(NX,1.)
call SetSoundDistances(NX,600.,10000.)
call SetSoundDistanceCutoff(NX,3000.)
call SetSoundConeAngles(NX,.0,.0,127)
call SetSoundConeOrientation(NX,.0,.0,.0)
set SOUND_UNDEAD_X1=CreateSound("Sound\\Music\\mp3Music\\UndeadX1.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_UNDEAD_X1,270671)
call SetSoundChannel(SOUND_UNDEAD_X1,0)
call SetSoundVolume(SOUND_UNDEAD_X1,127)
call SetSoundPitch(SOUND_UNDEAD_X1,1.)
set SOUND_CHAT_AFFIRMATIVE=CreateSound("war3mapImported\\affirmative2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_AFFIRMATIVE,478)
call SetSoundChannel(SOUND_CHAT_AFFIRMATIVE,2)
call SetSoundVolume(SOUND_CHAT_AFFIRMATIVE,127)
call SetSoundPitch(SOUND_CHAT_AFFIRMATIVE,1.)
call SetSoundDistances(SOUND_CHAT_AFFIRMATIVE,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_AFFIRMATIVE,3000.)
call SetSoundConeAngles(SOUND_CHAT_AFFIRMATIVE,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_AFFIRMATIVE,.0,.0,.0)
set SOUND_CHAT_ALLUNITSMOVEIN=CreateSound("war3mapImported\\allunitsmovein.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_ALLUNITSMOVEIN,687)
call SetSoundChannel(SOUND_CHAT_ALLUNITSMOVEIN,2)
call SetSoundVolume(SOUND_CHAT_ALLUNITSMOVEIN,127)
call SetSoundPitch(SOUND_CHAT_ALLUNITSMOVEIN,1.)
call SetSoundDistances(SOUND_CHAT_ALLUNITSMOVEIN,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_ALLUNITSMOVEIN,3000.)
call SetSoundConeAngles(SOUND_CHAT_ALLUNITSMOVEIN,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_ALLUNITSMOVEIN,.0,.0,.0)
set CX=CreateSound("Units\\NightElf\\Ballista\\BallistaYes1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(CX,"BallistaYes")
call SetSoundDuration(CX,334)
call SetSoundChannel(CX,2)
call SetSoundVolume(CX,100)
call SetSoundDistances(CX,800.,10000.)
call SetSoundDistanceCutoff(CX,3000.)
set SOUND_CHAT_COPY=CreateSound("war3mapImported\\copy.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_COPY,321)
call SetSoundChannel(SOUND_CHAT_COPY,2)
call SetSoundVolume(SOUND_CHAT_COPY,127)
call SetSoundPitch(SOUND_CHAT_COPY,1.)
call SetSoundDistances(SOUND_CHAT_COPY,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_COPY,3000.)
call SetSoundConeAngles(SOUND_CHAT_COPY,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_COPY,.0,.0,.0)
set SOUND_CHAT_BAL_YES_3=CreateSound("Units\\NightElf\\Ballista\\BallistaYesAttack3.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_CHAT_BAL_YES_3,"BallistaYesAttack")
call SetSoundDuration(SOUND_CHAT_BAL_YES_3,316)
call SetSoundChannel(SOUND_CHAT_BAL_YES_3,2)
call SetSoundVolume(SOUND_CHAT_BAL_YES_3,100)
call SetSoundDistances(SOUND_CHAT_BAL_YES_3,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_BAL_YES_3,3000.)
set SOUND_CHAT_GRENADE=CreateSound("war3mapImported\\grenade.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_GRENADE,452)
call SetSoundChannel(SOUND_CHAT_GRENADE,2)
call SetSoundVolume(SOUND_CHAT_GRENADE,127)
call SetSoundPitch(SOUND_CHAT_GRENADE,1.)
call SetSoundDistances(SOUND_CHAT_GRENADE,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_GRENADE,3000.)
call SetSoundConeAngles(SOUND_CHAT_GRENADE,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_GRENADE,.0,.0,.0)
set SOUND_HUMAN_DEFEAT=CreateSound("Sound\\Music\\mp3Music\\HumanDefeat.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_HUMAN_DEFEAT,46664)
call SetSoundChannel(SOUND_HUMAN_DEFEAT,0)
call SetSoundVolume(SOUND_HUMAN_DEFEAT,127)
call SetSoundPitch(SOUND_HUMAN_DEFEAT,1.)
set OFF_1=CreateSound("war3mapImported\\off2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(OFF_1,557)
call SetSoundChannel(OFF_1,2)
call SetSoundVolume(OFF_1,127)
call SetSoundPitch(OFF_1,1.)
call SetSoundDistances(OFF_1,800.,10000.)
call SetSoundDistanceCutoff(OFF_1,3000.)
call SetSoundConeAngles(OFF_1,.0,.0,127)
call SetSoundConeOrientation(OFF_1,.0,.0,.0)
set OFF_2=CreateSound("war3mapImported\\off3.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(OFF_2,583)
call SetSoundChannel(OFF_2,2)
call SetSoundVolume(OFF_2,127)
call SetSoundPitch(OFF_2,1.)
call SetSoundDistances(OFF_2,800.,10000.)
call SetSoundDistanceCutoff(OFF_2,3000.)
call SetSoundConeAngles(OFF_2,.0,.0,127)
call SetSoundConeOrientation(OFF_2,.0,.0,.0)
set OFF_3=CreateSound("war3mapImported\\off4.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(OFF_3,191)
call SetSoundChannel(OFF_3,2)
call SetSoundVolume(OFF_3,127)
call SetSoundPitch(OFF_3,1.)
call SetSoundDistances(OFF_3,800.,10000.)
call SetSoundDistanceCutoff(OFF_3,3000.)
call SetSoundConeAngles(OFF_3,.0,.0,127)
call SetSoundConeOrientation(OFF_3,.0,.0,.0)
set SOUND_CHAT_OFFICERDOWN=CreateSound("war3mapImported\\officerdown.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_OFFICERDOWN,635)
call SetSoundChannel(SOUND_CHAT_OFFICERDOWN,2)
call SetSoundVolume(SOUND_CHAT_OFFICERDOWN,127)
call SetSoundPitch(SOUND_CHAT_OFFICERDOWN,1.)
call SetSoundDistances(SOUND_CHAT_OFFICERDOWN,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_OFFICERDOWN,3000.)
call SetSoundConeAngles(SOUND_CHAT_OFFICERDOWN,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_OFFICERDOWN,.0,.0,.0)
set SOUND_CHAT_OFFICERUNDERFIRE=CreateSound("war3mapImported\\officerunderfire.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_OFFICERUNDERFIRE,948)
call SetSoundChannel(SOUND_CHAT_OFFICERUNDERFIRE,2)
call SetSoundVolume(SOUND_CHAT_OFFICERUNDERFIRE,127)
call SetSoundPitch(SOUND_CHAT_OFFICERUNDERFIRE,1.)
call SetSoundDistances(SOUND_CHAT_OFFICERUNDERFIRE,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_OFFICERUNDERFIRE,3000.)
call SetSoundConeAngles(SOUND_CHAT_OFFICERUNDERFIRE,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_OFFICERUNDERFIRE,.0,.0,.0)
set ON_1=CreateSound("war3mapImported\\on2.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(ON_1,321)
call SetSoundChannel(ON_1,2)
call SetSoundVolume(ON_1,127)
call SetSoundPitch(ON_1,1.)
call SetSoundDistances(ON_1,800.,10000.)
call SetSoundDistanceCutoff(ON_1,3000.)
call SetSoundConeAngles(ON_1,.0,.0,127)
call SetSoundConeOrientation(ON_1,.0,.0,.0)
set ON_2=CreateSound("war3mapImported\\on3.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(ON_2,635)
call SetSoundChannel(ON_2,2)
call SetSoundVolume(ON_2,127)
call SetSoundPitch(ON_2,1.)
call SetSoundDistances(ON_2,800.,10000.)
call SetSoundDistanceCutoff(ON_2,3000.)
call SetSoundConeAngles(ON_2,.0,.0,127)
call SetSoundConeOrientation(ON_2,.0,.0,.0)
set SOUND_CHAT_BAL_YES_2=CreateSound("Units\\NightElf\\Ballista\\BallistaYesAttack2.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_CHAT_BAL_YES_2,"BallistaYesAttack")
call SetSoundDuration(SOUND_CHAT_BAL_YES_2,393)
call SetSoundChannel(SOUND_CHAT_BAL_YES_2,2)
call SetSoundVolume(SOUND_CHAT_BAL_YES_2,100)
call SetSoundDistances(SOUND_CHAT_BAL_YES_2,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_BAL_YES_2,3000.)
set SOUND_CHAT_BAL_YES_1=CreateSound("Units\\NightElf\\Ballista\\BallistaYesAttack1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_CHAT_BAL_YES_1,"BallistaYesAttack")
call SetSoundDuration(SOUND_CHAT_BAL_YES_1,494)
call SetSoundChannel(SOUND_CHAT_BAL_YES_1,2)
call SetSoundVolume(SOUND_CHAT_BAL_YES_1,100)
call SetSoundDistances(SOUND_CHAT_BAL_YES_1,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_BAL_YES_1,3000.)
set SOUND_CHAT_BAL_WHAT1=CreateSound("Units\\NightElf\\Ballista\\BallistaWhat1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_CHAT_BAL_WHAT1,"BallistaWhat")
call SetSoundDuration(SOUND_CHAT_BAL_WHAT1,748)
call SetSoundChannel(SOUND_CHAT_BAL_WHAT1,2)
call SetSoundVolume(SOUND_CHAT_BAL_WHAT1,100)
call SetSoundDistances(SOUND_CHAT_BAL_WHAT1,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_BAL_WHAT1,3000.)
set SOUND_CHAT_BAL_WHAT2=CreateSound("Units\\NightElf\\Ballista\\BallistaWhat2.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_CHAT_BAL_WHAT2,"BallistaWhat")
call SetSoundDuration(SOUND_CHAT_BAL_WHAT2,748)
call SetSoundChannel(SOUND_CHAT_BAL_WHAT2,2)
call SetSoundVolume(SOUND_CHAT_BAL_WHAT2,100)
call SetSoundDistances(SOUND_CHAT_BAL_WHAT2,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_BAL_WHAT2,3000.)
set SOUND_CHAT_WATCHIT=CreateSound("war3mapImported\\watchit.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(SOUND_CHAT_WATCHIT,504)
call SetSoundChannel(SOUND_CHAT_WATCHIT,2)
call SetSoundVolume(SOUND_CHAT_WATCHIT,127)
call SetSoundPitch(SOUND_CHAT_WATCHIT,1.)
call SetSoundDistances(SOUND_CHAT_WATCHIT,800.,10000.)
call SetSoundDistanceCutoff(SOUND_CHAT_WATCHIT,3000.)
call SetSoundConeAngles(SOUND_CHAT_WATCHIT,.0,.0,127)
call SetSoundConeOrientation(SOUND_CHAT_WATCHIT,.0,.0,.0)
set SOUND_SECRET_FOUND=CreateSound("Sound\\Interface\\SecretFound.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(SOUND_SECRET_FOUND,"SecretFound")
call SetSoundDuration(SOUND_SECRET_FOUND,2525)
call SetSoundVolume(SOUND_SECRET_FOUND,100)
set PX=CreateSound("Units\\Creeps\\Wendigo\\WendigoWhat3.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(PX,"WendigoWhat")
call SetSoundDuration(PX,1567)
call SetSoundDistances(PX,300.,10000.)
call SetSoundDistanceCutoff(PX,800.)
set qX=CreateSound("Units\\Creeps\\Wendigo\\WendigoYesAttack1.wav",false,true,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(qX,"WendigoYesAttack")
call SetSoundDuration(qX,1695)
call SetSoundDistances(qX,300.,10000.)
call SetSoundDistanceCutoff(qX,800.)
call SetArrays()
endfunction
endlibrary
//TESH.scrollpos=311
//TESH.alwaysfold=0
library Rects initializer Init
globals
rect array UMBRELLA_CHECKPOINT_RECTS
rect array SPAWN_LOC
rect array BORDER_ZONES
rect array CAVE_LOCS
rect array LZ
rect array ov
rect array Road
rect array Base
rect array Outpost
rect array Tent
rect array Computer
integer RoadCount
integer OutpostCount
integer ComputerCount
integer LZCount
rect vi=null
rect ei=null
rect xi=null
rect oi=null
rect ri=null
rect ii=null
rect ai=null
rect ni=null
rect Vi=null
rect UMBRELLA_GENERATOR_LOC=null
rect Ai=null
rect Ni=null
rect bi=null
rect Bi=null
rect ci=null
rect Ci=null
rect di=null
rect Di=null
rect fi=null
rect Fi=null
rect gi=null
rect Gi=null
rect hi=null
rect Hi=null
rect ji=null
rect Ji=null
rect Ki=null
rect li=null
rect Li=null
rect mi=null
rect Mi=null
rect pi=null
rect Pi=null
rect qi=null
rect Qi=null
rect si=null
rect Si=null
rect ti=null
rect Ti=null
rect ui=null
rect Ui=null
rect wi=null
rect Wi=null
rect yi=null
rect Yi=null
rect La=null
rect MAP_BORDER_BOT_R=null
rect MAP_BORDER_L=null
rect MAP_BORDER_R=null
rect MAP_BORDER_TOP_L=null
rect Ta=null
rect ua=null
rect Ua=null
rect Wa=null
rect ya=null
rect Ya=null
rect za=null
rect Za=null
rect vn=null
rect en=null
rect xn=null
rect on=null
rect an=null
rect nn=null
rect Vn=null
rect En=null
rect Xn=null
rect On=null
rect Rn=null
rect In=null
rect An=null
rect Nn=null
rect bn=null
rect Bn=null
rect cn=null
rect Cn=null
rect dn=null
rect Dn=null
rect fn=null
rect Fn=null
rect gn=null
rect Gn=null
rect hn=null
rect Hn=null
rect jn=null
rect Jn=null
rect kn=null
rect Kn=null
rect ln=null
rect Ln=null
rect mn=null
rect Mn=null
rect pn=null
rect Pn=null
rect qn=null
rect Qn=null
rect sn=null
rect Sn=null
rect tn=null
rect Tn=null
rect Un=null
rect wn=null
rect Wn=null
rect yn=null
rect Yn=null
rect zn=null
rect CACHE_RECT_BOT=null
rect CACHE_RECT_TOP=null
endglobals
private function SetArrays takes nothing returns nothing
set SPAWN_LOC[1]=gg_rct_Spawn1
set SPAWN_LOC[2]=gg_rct_Spawn2
set SPAWN_LOC[3]=gg_rct_Spawn3
set SPAWN_LOC_AMT=3
set BORDER_ZONES[1]=gg_rct_Border_Bottom
set BORDER_ZONES[2]=gg_rct_Border_Right
set BORDER_ZONES[3]=gg_rct_Border_Top
set BORDER_ZONES[4]=gg_rct_Border_Left
set CAVE_LOCS[1]=gg_rct_Cave1
set CAVE_LOCS[2]=gg_rct_Cave2
set CAVE_LOCS[3]=gg_rct_Cave3
set CAVE_LOCS[4]=gg_rct_Cave4
set LZ[1]=gg_rct_LZ01
set LZ[2]=gg_rct_LZ02
set LZ[3]=gg_rct_LZ03
set LZ[4]=gg_rct_LZ04
set LZ[5]=gg_rct_LZ05
set LZ[6]=gg_rct_LZ06
set LZ[7]=gg_rct_LZ07
set LZ[8]=gg_rct_LZ08
set LZ[9]=gg_rct_LZ09
set LZCount=9
set Road[1]=gg_rct_Road01
set Road[2]=gg_rct_Road02
set Road[3]=gg_rct_Road03
set Road[4]=gg_rct_Road04
set Road[5]=gg_rct_Road05
set Road[6]=gg_rct_Road06
set Road[7]=gg_rct_Road07
set Road[8]=gg_rct_Road08
set Road[9]=gg_rct_Road09
set Road[10]=gg_rct_Road10
set Road[11]=gg_rct_Road11
set Road[12]=gg_rct_Road12
set Road[13]=gg_rct_Road13
set Road[14]=gg_rct_Road14
set Road[15]=gg_rct_Road15
set Road[16]=gg_rct_Road16
set Road[17]=gg_rct_Road17
set Road[18]=gg_rct_Road18
set Road[19]=gg_rct_Road19
set Road[20]=gg_rct_Road20
set Road[21]=gg_rct_Road21
set Road[22]=gg_rct_Road22
set Road[23]=gg_rct_Road23
set Road[24]=gg_rct_Road24
set Road[25]=gg_rct_Road25
set Road[26]=gg_rct_Road26
set Road[27]=gg_rct_Road27
set Road[28]=gg_rct_Road28
set Road[29]=gg_rct_Road29
set Road[30]=gg_rct_Road30
set Road[31]=gg_rct_Road31
set Road[32]=gg_rct_Road32
set Road[33]=gg_rct_Road33
set Road[34]=gg_rct_Road34
set Road[35]=gg_rct_Road35
set Road[36]=gg_rct_Road36
set Road[37]=gg_rct_Road37
set Road[38]=gg_rct_Road38
set Road[39]=gg_rct_Road39
set Road[40]=gg_rct_Road40
set Road[41]=gg_rct_Road41
set Road[42]=gg_rct_Road42
set Road[43]=gg_rct_Road43
set Road[44]=gg_rct_Road44
set Road[45]=gg_rct_Road45
set Road[46]=gg_rct_Road46
set Road[47]=gg_rct_Road47
set Road[48]=gg_rct_Road48
set Road[49]=gg_rct_Road49
set Road[50]=gg_rct_Road50
set Road[51]=gg_rct_Road51
set Road[52]=gg_rct_Road52
set Road[53]=gg_rct_Road53
set Road[54]=gg_rct_Road54
set Road[55]=gg_rct_Road55
set Road[56]=gg_rct_Road56
set Road[57]=gg_rct_Road57
set Road[58]=gg_rct_Road58
set Road[59]=gg_rct_Road59
set Road[60]=gg_rct_Road60
set Road[61]=gg_rct_Road61
set Road[62]=gg_rct_Road62
set Road[63]=gg_rct_Road63
set Road[64]=gg_rct_RoadExit64
set Road[65]=gg_rct_RoadExit65
set Road[66]=gg_rct_RoadExit66
set Road[67]=gg_rct_RoadExit67
set Road[68]=gg_rct_RoadExit68
set Road[69]=gg_rct_RoadExit69
set Road[70]=gg_rct_RoadExit70
set RoadCount=63
set Base[1]=gg_rct_Base1
set Base[2]=gg_rct_Base2
set Base[3]=gg_rct_Base3
set Outpost[1]=gg_rct_Outpost1
set Outpost[2]=gg_rct_Outpost2
set Outpost[3]=gg_rct_Outpost3
set OutpostCount=3
set Computer[1]=gg_rct_Computer1
set Computer[2]=gg_rct_Computer2
set Computer[3]=gg_rct_Computer3
set Computer[4]=gg_rct_Computer4
set Computer[5]=gg_rct_Computer5
set ComputerCount=5
set Tent[1]=gg_rct_Tent01
set Tent[2]=gg_rct_Tent02
set Tent[3]=gg_rct_Tent03
set Tent[4]=gg_rct_Tent04
set Tent[5]=gg_rct_Tent05
set Tent[6]=gg_rct_Tent06
set Tent[7]=gg_rct_Tent07
set Tent[8]=gg_rct_Tent08
set Tent[9]=gg_rct_Tent09
set Tent[10]=gg_rct_Tent10
set Tent[11]=gg_rct_Tent11
set Tent[12]=gg_rct_Tent12
// Supply locs
set ov[1]=fi
set ov[2]=Fi
set ov[3]=gi
set ov[4]=Gi
set ov[5]=hi
set ov[6]=Hi
set ov[7]=ji
set ov[8]=Ji
set ov[9]=Ki
set ov[10]=li
set ov[11]=Li
set ov[12]=mi
set ov[13]=Mi
set ov[14]=pi
set ov[15]=Pi
set ov[16]=qi
set ov[17]=Qi
set ov[18]=si
set ov[19]=Si
set ov[20]=ti
set ov[21]=di
set ov[22]=nn
set rv=1
endfunction
//=================================================
// INITIALIZER
//=================================================
private function Init takes nothing returns nothing
set vi=Rect(15136.,14720.,15200.,14784.)
set ei=Rect(2624.,-32.,5952.,2080.)
set xi=Rect(12704.,-10336.,13856.,-9568.)
set oi=Rect(-9984.,-4640.,-9920.,-4576.)
set ri=Rect(-9824.,-3552.,-9760.,-3488.)
set ii=Rect(-9216.,-2752.,-9152.,-2688.)
set ai=Rect(-9344.,-3904.,-9280.,-3840.)
set ni=Rect(-8672.,-4320.,-8608.,-4256.)
set Vi=Rect(-9792.,-2976.,-9728.,-2912.)
set UMBRELLA_GENERATOR_LOC=Rect(-5376.,12672.,-5088.,12960.)
set Ai=Rect(-13760.,-6976.,-8544.,-1792.)
set Ni=Rect(11520.,-5280.,11776.,-5056.)
set bi=Rect(3328.,6720.,3744.,7104.)
set Bi=Rect(9344.,-6432.,9600.,-6208.)
set ci=Rect(-896.,-15200.,-640.,-14976.)
set Ci=Rect(9792.,-1664.,10176.,-1312.)
set di=Rect(-2400.,-15872.,-1952.,-15680.)
set Di=Rect(-15584.,-2400.,-15296.,-1984.)
set fi=Rect(-13440.,-3392.,-12960.,-2912.)
set Fi=Rect(-9792.,-1248.,-9312.,-768.)
set gi=Rect(-5152.,3136.,-4672.,3616.)
set Gi=Rect(-5952.,5824.,-5472.,6304.)
set hi=Rect(-5312.,8672.,-4832.,9152.)
set Hi=Rect(-3936.,9760.,-3456.,10240.)
set ji=Rect(-1728.,9600.,-1248.,10080.)
set Ji=Rect(-192.,8480.,288.,8960.)
set Ki=Rect(4128.,7840.,4608.,8320.)
set li=Rect(10016.,5984.,10496.,6464.)
set Li=Rect(11296.,4640.,11776.,5120.)
set mi=Rect(12672.,2592.,13152.,3072.)
set Mi=Rect(11488.,-1632.,11968.,-1152.)
set pi=Rect(12768.,-2944.,13248.,-2464.)
set Pi=Rect(11136.,-4256.,11616.,-3776.)
set qi=Rect(8352.,-4320.,8832.,-3840.)
set Qi=Rect(4768.,-6336.,5248.,-5856.)
set si=Rect(3968.,-7904.,4448.,-7424.)
set Si=Rect(-864.,-5280.,-384.,-4800.)
set ti=Rect(-2656.,-5856.,-2176.,-5376.)
set Ti=Rect(11904.,-14560.,12128.,-14400.)
set ui=Rect(704.,-12800.,1664.,-11872.)
set Ui=Rect(-1440.,-12384.,-480.,-11456.)
set wi=Rect(1984.,-13920.,4160.,-12992.)
set Wi=Rect(7776.,-13632.,11136.,-12320.)
set yi=Rect(-15232.,-8096.,5536.,10304.)
set Yi=Rect(6080.,-7648.,15296.,5056.)
set La=Rect(224.,8960.,1088.,9728.)
set Ta=Rect(-4864.,11680.,2816.,15776.)
set ua=Rect(11296.,-14720.,11712.,-14080.)
set Ua=Rect(10784.,-4192.,13344.,-2496.)
set Wa=Rect(12000.,1920.,13504.,3584.)
set ya=Rect(8352.,-13248.,8800.,-12832.)
set Ya=Rect(-1184.,-9888.,-736.,-9472.)
set za=Rect(-1120.,-13632.,-672.,-13216.)
set Za=Rect(13856.,5344.,14624.,6208.)
set vn=Rect(4192.,-1056.,4960.,-192.)
set en=Rect(1152.,11296.,1824.,12000.)
set xn=Rect(11168.,-9568.,15136.,-6368.)
set on=Rect(736.,4448.,4704.,7648.)
set an=Rect(15424.,-4032.,15584.,-3648.)
set nn=Rect(15392.,2272.,15584.,2720.)
set Vn=Rect(14976.,-3968.,15264.,-3680.)
set En=Rect(-12864.,8384.,-12384.,8832.)
set Xn=Rect(-2496.,-5984.,2112.,-3840.)
set On=Rect(12416.,-5408.,15296.,3456.)
set Rn=Rect(-5600.,4192.,128.,10336.)
set In=Rect(-1216.,7072.,-1088.,7200.)
set An=Rect(-7264.,-10976.,-6880.,-9664.)
set Nn=Rect(9024.,-11232.,9760.,-10592.)
set bn=Rect(7264.,-11264.,8000.,-10624.)
set Bn=Rect(3648.,640.,5728.,1536.)
set cn=Rect(-12128.,-13920.,-7968.,-11104.)
set Cn=Rect(-2272.,-4928.,12224.,3200.)
set dn=Rect(-12288.,-5984.,-10784.,-4480.)
set Dn=Rect(-12800.,7744.,-9888.,10560.)
set fn=Rect(-2496.,-7680.,14944.,4192.)
set Fn=Rect(12672.,-11008.,12800.,-10624.)
set gn=Rect(13952.,-11008.,14080.,-10624.)
set Gn=Rect(3648.,-12320.,4160.,-11424.)
set hn=Rect(2144.,-12512.,2720.,-12032.)
set Hn=Rect(-1312.,-10976.,-736.,-10496.)
set jn=Rect(10016.,-12352.,10336.,-12000.)
set Jn=Rect(-1504.,-14112.,4672.,-8768.)
set kn=Rect(7200.,-14720.,11136.,-10496.)
set Kn=Rect(4672.,-13984.,7232.,-12992.)
set ln=Rect(11104.,-14816.,12192.,-14048.)
set Ln=Rect(12096.,-14816.,14784.,-10592.)
set mn=Rect(-10272.,2240.,-9920.,2656.)
set Mn=Rect(-7392.,32.,-6848.,704.)
set pn=Rect(-5248.,2816.,-4352.,3872.)
set Pn=Rect(-6016.,8640.,-5440.,9792.)
set qn=Rect(12416.,2208.,13280.,3456.)
set Qn=Rect(12160.,-4128.,13216.,-2688.)
set sn=Rect(-3808.,-3328.,-3328.,-2752.)
set Sn=Rect(-8480.,-1344.,-8000.,-768.)
set tn=Rect(-1280.,-5184.,-800.,-4608.)
set Tn=Rect(12256.,-14624.,14624.,-10720.)
set Un=Rect(12544.,-14624.,12800.,-14112.)
set wn=Rect(3904.,1312.,4256.,1632.)
set Wn=Rect(1920.,13216.,2272.,13536.)
set yn=Rect(14784.,-4512.,15136.,-4192.)
set Yn=Rect(-256.,-15008.,96.,-14688.)
set zn=Rect(-6592.,3232.,-6240.,3552.)
set CACHE_RECT_BOT=Rect(-3840.,-8128.,13504.,7168.)
set CACHE_RECT_TOP=Rect(-4224.,7264.,6816.,13568.)
call SetArrays()
endfunction
endlibrary
//TESH.scrollpos=69
//TESH.alwaysfold=0
library GeneralLeap initializer Init requires GlobalFuncs
//TRIG: --, Cond: Sm, Func: um
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A03P' or GetSpellAbilityId()=='A04R'
endfunction
private struct Mov
unit u
integer count
integer countmax
integer SpellId
real x
real y
real angle
sound s
endstruct
private function Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Mov m=GetTimerStructA(t)
if m.count>m.countmax then
if IsUnitAliveBJ(m.u)then
call ResetUnitAnimation(m.u)
endif
call SetUnitPathing(m.u,true)
call SetUnitFlyHeight(m.u,.0,0)
call PauseUnit(m.u,false)
call StopSound(m.s,false,true)
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call m.destroy()
else
call SetUnitX(m.u, GetUnitX(m.u)+9.*Cos(m.angle*bj_DEGTORAD) )
call SetUnitY(m.u, GetUnitY(m.u)+9.*Sin(m.angle*bj_DEGTORAD) )
set m.count=m.count+1
if m.count<m.countmax/2 then
call SetUnitFlyHeight(m.u,(m.count*8),0)
else
call SetUnitFlyHeight(m.u,(m.countmax*8)-(m.count*8),0)
endif
if GetSpellAbilityId()=='A03P' then
call SetUnitAnimation(m.u,"stand alternate")
endif
endif
set t=null
endfunction
private function Actions takes nothing returns nothing
local Mov m=Mov.create()
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local location l2=GetUnitLoc(u)
set m.angle=AngleBetweenPoints(l2,l)
set m.x=GetLocationX(l)
set m.y=GetLocationY(l)
set m.SpellId=GetSpellAbilityId()
if DistanceBetweenPoints(l,l2) >= 175 and IsTerrainPathableBJ(l,PATHING_TYPE_WALKABILITY)==false and RectContainsLoc(bj_mapInitialPlayableArea,l) then
//call PolledWait2(.15)
set m.count=1
set m.countmax=R2I(DistanceBetweenPoints(l,l2)/25.)
set m.u=GetTriggerUnit()
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call PauseUnit(u,true)
if m.SpellId=='A03P' then
set m.s=SOUND_OH_LARGE_BUILDING_FIRE_DefEAX
call AttachSoundToUnit(m.s,u)
call SetSoundVolume(m.s,127)
call StartSound(m.s)
call SetUnitAnimation(u,"stand alternate")
endif
if m.SpellId=='A04R' then
call SetUnitAnimation(u,"stand victory")
endif
call SetUnitPathing(u,false)
call SetTimerStructA(t,m)
call TimerStart(t,.03,true,function Callback)
else
call IssueImmediateOrder(u,"holdposition")
call CS_Error(GetOwningPlayer(u),"Cannot leap there.")
call ResetUnitAnimation(u)
endif
call RemoveLocation(l)
set l=null
call RemoveLocation(l2)
set l2=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpellMinervaLeap initializer Init requires GlobalFuncs
globals
private unit CASTING_UNIT
endglobals
private struct GroupData
unit u
integer count
real angle
endstruct
private struct Data
unit u
integer count
integer countmax
real angle
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A071'
endfunction
private function GroupTimerCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local GroupData gdata = GetTimerStructA(t)
set gdata.count=gdata.count+1
if gdata.count>50 then
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
call gdata.destroy()
else
call PolarProjectUnit(gdata.u,(10.-(gdata.count/5)),gdata.angle)
endif
endfunction
private function GroupCallback takes nothing returns nothing
local timer t = NewTimer()
local real x0 = GetUnitX(GetEnumUnit())
local real y0 = GetUnitY(GetEnumUnit())
local real x1 = GetUnitX(CASTING_UNIT)
local real y1 = GetUnitY(CASTING_UNIT)
local GroupData gdata = GroupData.create()
set gdata.count=1
set gdata.u=GetEnumUnit()
set gdata.angle = AngleBetweenPointsXY(x0,y0,x1,y1)
call SetWidgetLife(gdata.u,GetUnitState(gdata.u,UNIT_STATE_LIFE)-40)
call SetTimerStructA(t,gdata)
call TimerStart(t,.04,true,function GroupTimerCallback)
endfunction
private function GroupCondition takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(15)) and (GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetTimerStructA(t)
local group g
if data.count>data.countmax then
call SetUnitPathing(data.u,true)
call SetUnitFlyHeight(data.u,.0,900)
call PauseUnit(data.u,false)
call SetUnitTimeScale(data.u,1)
if (GetUnitState(data.u, UNIT_STATE_LIFE) > 0) then
call SetUnitAnimation(data.u,"stand")
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetUnitX(data.u),GetUnitY(data.u)))
set CASTING_UNIT=data.u
call GroupEnumUnitsInRange(GLOBAL_ENUM_GROUP,GetUnitX(data.u),GetUnitY(data.u),250.,Condition(function GroupCondition))
call ForGroup(GLOBAL_ENUM_GROUP,function GroupCallback)
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
call data.destroy()
else
call PolarProjectUnit(data.u,UA2_MinervaLeapSpeed,data.angle)
set data.count=data.count+1
if data.count<data.countmax/2 then
call SetUnitFlyHeight(data.u,(data.count*8),0)
else
call SetUnitFlyHeight(data.u,(data.countmax*8)-(data.count*8),0)
endif
endif
call DestroyGroup(g)
set g = null
endfunction
private function Actions takes nothing returns nothing
local Data data
local timer t
local unit u = GetSpellAbilityUnit()
local real x0 = GetSpellTargetX()
local real y0 = GetSpellTargetY()
local real x1 = GetUnitX(u)
local real y1 = GetUnitY(u)
local real distance = DistanceBetweenPointsXY(x0,y0,x1,y1)
if(distance>=175)and(RectContainsCoords(bj_mapInitialPlayableArea,x0,y0))then
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call SetUnitTimeScale(u,0.50)
call SetUnitAnimation(u,"attack spell slam")
call PauseUnit(u,true)
call SetUnitPathing(u,false)
set data = Data.create()
set data.u = u
set data.countmax = R2I(distance/UA2_MinervaLeapSpeed)
set data.angle = AngleBetweenPointsXY(x1,y1,x0,y0)
set t = NewTimer()
call SetTimerStructA(t,data)
call TimerStart(t,UA2_ProjectionInterval,true,function Callback)
else
call IssueImmediateOrderById(u,OID_stop)
call SetUnitAnimation(u,"stand")
endif
set u=null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=134
//TESH.alwaysfold=0
library MinervaLeap initializer Init requires GlobalFuncs
//TRIG: --, Cond: YM, Func: --
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A071' or GetSpellAbilityId()=='A07W'
endfunction
private struct Mov
unit u
integer count
integer countmax
real x
real y
real angle
endstruct
private struct Smash
unit u
real angle
integer i
endstruct
function Knockback_Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Smash s=GetTimerStructA(t)
set s.i=s.i+1
if s.i>50 then
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call s.destroy()
else
call SetUnitX(s.u,GetUnitX(s.u)+(10-(s.i/5))*Cos(s.angle*bj_DEGTORAD) )
call SetUnitY(s.u,GetUnitY(s.u)+(10-(s.i/5))*Sin(s.angle*bj_DEGTORAD) )
endif
set t=null
endfunction
function Knockback takes nothing returns nothing
local Smash s=Smash.create()
local timer t=CreateTimer()
local unit u=bj_lastCreatedUnit
call SetWidgetLife(GetEnumUnit(),GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE)-40)
set s.u=GetEnumUnit()
set s.i=1
set s.angle=AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(s.u),GetUnitY(s.u))
call SetTimerStructA(t,s)
call TimerStart(t,.04,true,function Knockback_Callback)
set u=null
endfunction
function GroupCond takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()),Player(15))and IsUnitAliveBJ(GetFilterUnit())and IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false
endfunction
// ======Minerva's Leap=====
private function Callback takes nothing returns nothing
local timer t=GetExpiredTimer()
local Mov m=GetTimerStructA(t)
local group g=CreateGroup()
local boolexpr filter=Condition(function GroupCond)
if m.count>m.countmax then
if IsUnitAliveBJ(m.u)then
call ResetUnitAnimation(m.u)
endif
call PauseUnit(m.u,false)
call SetUnitTimeScalePercent(m.u,100)
call SetUnitPathing(m.u,true)
call SetUnitFlyHeight(m.u,.0,0)
call PauseTimer(t)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",m.x,m.y))
set bj_lastCreatedUnit=m.u
call GroupEnumUnitsInRange(g,m.x,m.y,250,filter)
call ForGroup(g,function Knockback)
call ClearTimerStructA(t)
call DestroyTimer(t)
call m.destroy()
else
if GetUnitTypeId(m.u)==ZID_LeBron then
call SetUnitX(m.u, GetUnitX(m.u)+18.*Cos(m.angle*bj_DEGTORAD) )
call SetUnitY(m.u, GetUnitY(m.u)+18.*Sin(m.angle*bj_DEGTORAD) )
else
call SetUnitX(m.u, GetUnitX(m.u)+13.*Cos(m.angle*bj_DEGTORAD) )
call SetUnitY(m.u, GetUnitY(m.u)+13.*Sin(m.angle*bj_DEGTORAD) )
endif
set m.count=m.count+1
if m.count<m.countmax/2 then
call SetUnitFlyHeight(m.u,(m.count*8),0)
else
call SetUnitFlyHeight(m.u,(m.countmax*8)-(m.count*8),0)
endif
if GetSpellAbilityId()=='A03P' then
call SetUnitAnimation(m.u,"stand alternate")
endif
endif
set t=null
call DestroyBoolExpr(filter)
call DestroyGroup(g)
set g=null
endfunction
private function Actions takes nothing returns nothing
local Mov m=Mov.create()
local timer t=CreateTimer()
local unit u=GetTriggerUnit()
local real dist=DistanceBetweenPointsXY(GetSpellTargetX(),GetSpellTargetY(),GetUnitX(u),GetUnitY(u))
set m.x=GetSpellTargetX()
set m.y=GetSpellTargetY()
set m.angle=AngleBetweenPointsXY(GetUnitX(u),GetUnitY(u),m.x,m.y)
if dist >= 175 and IsTerrainPathable(m.x,m.y,PATHING_TYPE_WALKABILITY)==false and RectContainsCoords(bj_mapInitialPlayableArea,m.x,m.y) then
set m.count=1
if GetUnitTypeId(u)==ZID_LeBron then
set m.countmax=R2I(dist/18.)
else
set m.countmax=R2I(dist/13.)
endif
set m.u=GetTriggerUnit()
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call SetUnitTimeScalePercent(u,30)
call SetUnitAnimation(u,"attack spell slam")
call SetUnitPathing(u,false)
call PauseUnit(u,true)
call PlaySoundOnUnitBJ(MINERVA_SOUNDS[GetRandomInt(1,6)],100,u)
call SetTimerStructA(t,m)
call TimerStart(t,.03,true,function Callback)
else
call IssueImmediateOrder(u,"holdposition")
call CS_Error(GetOwningPlayer(u),"Cannot leap there.")
call ResetUnitAnimation(u)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpellZombieLeap initializer Init requires GlobalFuncs
private struct Data
unit u
integer count=1
integer countmax
real angle
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A04R'
endfunction
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetTimerStructA(t)
if data.count>data.countmax then
call SetUnitPathing(data.u,true)
call SetUnitFlyHeight(data.u,.0,900)
call PauseUnit(data.u,false)
call SetUnitTimeScale(data.u,1)
if (GetUnitState(data.u, UNIT_STATE_LIFE) > 0) then
call SetUnitAnimation(data.u,"stand")
endif
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
call data.destroy()
else
call PolarProjectUnit(data.u,UA2_ZombieLeapSpeed,data.angle)
set data.count=data.count+1
if data.count<data.countmax/2 then
call SetUnitFlyHeight(data.u,(data.count*8),0)
else
call SetUnitFlyHeight(data.u,(data.countmax*8)-(data.count*8),0)
endif
endif
endfunction
private function Actions takes nothing returns nothing
local Data data
local timer t
local unit u = GetSpellAbilityUnit()
local real x0 = GetSpellTargetX()
local real y0 = GetSpellTargetY()
local real x1 = GetUnitX(u)
local real y1 = GetUnitY(u)
local real distance = DistanceBetweenPointsXY(x0,y0,x1,y1)
if(distance>=175)and(RectContainsCoords(bj_mapInitialPlayableArea,x0,y0))then
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call SetUnitTimeScale(u,0.50)
call SetUnitAnimation(u,"stand victory")
call PauseUnit(u,true)
call SetUnitPathing(u,false)
call PlaySoundOnUnitBJ(lickersnd[GetRandomInt(1,LICKER_MAX)], 100, u)
set data = Data.create()
set data.u = u
set data.countmax = R2I(distance/UA2_ZombieLeapSpeed)
set data.angle = AngleBetweenPointsXY(x1,y1,x0,y0)
set t = NewTimer()
call SetTimerStructA(t,data)
call TimerStart(t,UA2_ProjectionInterval,true,function Callback)
else
call IssueImmediateOrderById(u,OID_stop)
call SetUnitAnimation(u,"stand")
endif
set u=null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpellFireLeap initializer Init requires GlobalFuncs
private struct Data
unit u
integer count=1
integer countmax
real angle
endstruct
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A03P'
endfunction
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetTimerStructA(t)
if data.count>data.countmax then
call SetUnitPathing(data.u,true)
call SetUnitFlyHeight(data.u,.0,900)
call PauseUnit(data.u,false)
if (GetUnitState(data.u, UNIT_STATE_LIFE) > 0) then
call SetUnitAnimation(data.u,"stand")
else
call SetUnitAnimation(data.u,"death")
endif
call ClearTimerStructA(t)
call PauseTimer(t)
call ReleaseTimer(t)
call data.destroy()
else
call PolarProjectUnit(data.u,UA2_FireLeapSpeed,data.angle)
set data.count=data.count+1
if data.count<data.countmax/2 then
call SetUnitFlyHeight(data.u,(data.count*8),0)
else
call SetUnitFlyHeight(data.u,(data.countmax*8)-(data.count*8),0)
endif
call SetUnitAnimation(data.u,"stand alternate")
endif
endfunction
private function Actions takes nothing returns nothing
local Data data
local timer t
local unit u = GetSpellAbilityUnit()
local real x0 = GetSpellTargetX()
local real y0 = GetSpellTargetY()
local real x1 = GetUnitX(u)
local real y1 = GetUnitY(u)
local real distance = DistanceBetweenPointsXY(x0,y0,x1,y1)
if(distance>=175)and(RectContainsCoords(bj_mapInitialPlayableArea,x0,y0))and not RAINING then
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call PauseUnit(u,true)
call SetUnitAnimation(u,"stand alternate")
call SetUnitPathing(u,false)
set data = Data.create()
set data.u = u
set data.countmax = R2I(distance/UA2_FireLeapSpeed)
set data.angle = AngleBetweenPointsXY(x1,y1,x0,y0)
set t = NewTimer()
call SetTimerStructA(t,data)
call TimerStart(t,UA2_ProjectionInterval,true,function Callback)
else
call IssueImmediateOrderById(u,OID_stop)
call SetUnitAnimation(u,"stand")
endif
set u=null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=68
//TESH.alwaysfold=0
library Maggot initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit damagingUnit=GetEventDamageSource()
local boolean b=GetUnitTypeId(damagingUnit)=='n01A'
set damagingUnit=null
return b
endfunction
function SpawnMaggots takes real x, real y returns nothing
local integer i=1
local unit u
loop
exitwhen i>GetRandomInt(3,6)
set u=CreateUnit(Player(15),'n01A',x,y,GetRandomReal(0,360))
call AttackPlayerUnit(u)
set i=i+1
endloop
set u=null
endfunction
function Maggot_Loop takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit victim=LoadUnitHandle(HASH,GetHandleId(t),StringHash("victim"))
local unit maggot=LoadUnitHandle(HASH,GetHandleId(t),StringHash("maggot"))
local unit maggotrep
local real angle=GetUnitFacing(victim)
call SetUnitFlyHeight(maggot,GetUnitFlyHeight(victim)+60,0)
if IsUnitAliveBJ(maggot) and IsUnitAliveBJ(victim) and (UnitHasBuffBJ(victim,'B01N') or UnitHasBuffBJ(victim,'B01O')) then
call SetUnitFacingTimed(maggot,angle,0)
call SetUnitX(maggot,GetUnitX(victim)-18*Cos(angle*bj_DEGTORAD))
call SetUnitY(maggot,GetUnitY(victim)-18*Sin(angle*bj_DEGTORAD))
else
call PauseTimer(t)
if GAME_MODE < 2 then
call UnitRemoveAbility(victim,'B01N')
call UnitRemoveAbility(victim,'B01O')
endif
if IsUnitDeadBJ(victim) then
call SpawnMaggots(GetUnitX(victim),GetUnitY(victim))
endif
call SetUnitFlyHeight(maggot,0,0)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonSmallDeathExplode\\DemonSmallDeathExplode.mdl",GetUnitX(maggot),GetUnitY(maggot)))
if IsUnitAliveBJ(maggot) then
//call PolledWait2(1.5)
set maggotrep=CreateUnit(Player(15),'n01A',GetUnitX(maggot),GetUnitY(maggot),GetUnitFacing(maggot))
//call AttackPlayerUnit(maggotrep)
call RemoveUnit(maggot)
endif
call FlushChildHashtable(HASH,GetHandleId(t))
call DestroyTimer(t)
endif
set t=null
set maggot=null
set maggotrep=null
set victim=null
endfunction
private function Actions takes nothing returns nothing
local unit victim=GetTriggerUnit()
local unit maggotfirst=GetEventDamageSource()
local unit maggot
local timer t=CreateTimer()
set maggot=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'n01B',GetUnitX(maggotfirst),GetUnitY(maggotfirst),GetUnitFacing(maggotfirst))
call RemoveUnit(maggotfirst)
call UnitAddAbility(maggot,'Amrf')
call UnitRemoveAbility(maggot,'Amrf')
call SetUnitFlyHeight(maggot,GetUnitFlyHeight(victim)+60,0)
call PauseUnit(maggot,true)
call SaveUnitHandle(HASH,GetHandleId(t),StringHash("victim"),victim)
call SaveUnitHandle(HASH,GetHandleId(t),StringHash("maggot"),maggot)
//call SaveEffectHandle(HASH,GetHandleId(t),StringHash("effect"),e)
call TimerStart(t,.05,true,function Maggot_Loop)
set maggot=null
set maggotfirst=null
set victim=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library MaggotAttacked initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
public trigger T2
endglobals
private function ConditionsOrder takes nothing returns boolean
local unit u=GetOrderTargetUnit()
local boolean b=GetUnitTypeId(u)=='n01B'
set u=null
return b
endfunction
private function ActionsOrder takes nothing returns nothing
local unit u=GetOrderedUnit()
local unit m=GetOrderTargetUnit()
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(m),GetUnitY(m)) < 80 then
call IssueImmediateOrder(u,"holdposition")
endif
set m=null
set u=null
endfunction
private function Conditions takes nothing returns boolean
local unit u=GetTriggerUnit()
local boolean b=GetUnitTypeId(u)=='n01B'
set u=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u=GetAttacker()
local unit m=GetTriggerUnit()
if DistanceBetweenPointsXY(GetUnitX(u),GetUnitY(u),GetUnitX(m),GetUnitY(m)) < 80 then
call IssueImmediateOrder(u,"holdposition")
endif
set m=null
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T2,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(T2,Condition(function ConditionsOrder))
call TriggerAddAction(T2,function ActionsOrder)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library HitKnockback initializer Init requires GlobalFuncs
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetAttacker()
local unit h=GetTriggerUnit()
local boolean b=GetUnitTypeId(u)=='u00D' and IsUnitType(h,UNIT_TYPE_MECHANICAL)==false
set u=null
set h=null
return b
endfunction
private struct Knockback
unit hitter
unit target
real angle
real speed
method Move takes nothing returns nothing
local real ux=GetUnitX(.target)
local real uy=GetUnitY(.target)
local real nx=ux + .speed * Cos(.angle * bj_DEGTORAD)
local real ny=uy + .speed * Sin(.angle * bj_DEGTORAD)
if IsTerrainPathable(nx,ny,PATHING_TYPE_WALKABILITY)==false then
call SetUnitX(.target, nx)
call SetUnitY(.target, ny)
endif
endmethod
endstruct
private function Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local Knockback k = GetTimerStructA(t)
call k.Move()
set k.speed=k.speed*.96
if GetRandomInt(1,5)==1 then
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl",GetUnitX(k.target),GetUnitY(k.target)))
endif
if k.speed <= 2.5 then //remove
call PauseTimer(t)
call ClearTimerStructA(t)
call DestroyTimer(t)
call k.destroy()
endif
set t = null
endfunction
private function Actions takes nothing returns nothing
local Knockback k = Knockback.create()
local timer t = CreateTimer()
set k.hitter=GetAttacker()
set k.target=GetTriggerUnit()
set k.angle=AngleBetweenPointsXY(GetUnitX(k.hitter),GetUnitY(k.hitter),GetUnitX(k.target),GetUnitY(k.target))
set k.speed=12
call PolledWait2(.35)
call SetTimerStructA(t,k)
call TimerStart(t, .03, true, function Callback)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=76
//TESH.alwaysfold=0
library SpikeCharge initializer Init requires GlobalFuncs
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A07G'
endfunction
private struct Charge
unit hitter
group targets=CreateGroup()
real angle
real speed=100
real tx
real ty
real cntr=1
boolean offmap=false
method Move takes nothing returns nothing
local real ux=GetUnitX(.hitter)
local real uy=GetUnitY(.hitter)
local real nx=ux + .speed * Cos(.angle * bj_DEGTORAD)
local real ny=uy + .speed * Sin(.angle * bj_DEGTORAD)
if nx>GetRectMinX(GetPlayableMapRect()) and nx<GetRectMaxX(GetPlayableMapRect()) and ny>GetRectMinY(GetPlayableMapRect()) and ny<GetRectMaxY(GetPlayableMapRect()) then
call SetUnitX(.hitter, nx)
call SetUnitY(.hitter, ny)
else
set .offmap=true
endif
endmethod
endstruct
private function Knockback_Cond takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),Player(15)) and GetUnitTypeId(GetFilterUnit())!='u00D'
endfunction
private function Callback takes nothing returns nothing
local trigger t = GetTriggeringTrigger()
local Charge c = GetTriggerStructA(t)
local real x=GetUnitX(c.hitter)
local real y=GetUnitY(c.hitter)
local real distance=DistanceBetweenPointsXY(x,y,c.tx,c.ty)
local group g=CreateGroup()
local unit u
local real nx
local real ny
local real angle
call GroupEnumUnitsInRange(g,x,y,250,Condition(function Knockback_Cond))
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitInGroup(u,c.targets)==false then
call UnitDamageTarget(c.hitter,u,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_METAL_HEAVY_BASH)
endif
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl",u,"origin"))
set angle=AngleBetweenPointsXY(x,y,GetUnitX(u),GetUnitY(u))
set nx=GetUnitX(u) + 25 * Cos(angle * bj_DEGTORAD)
set ny=GetUnitY(u) + 25 * Sin(angle * bj_DEGTORAD)
call SetUnitX(u,nx)
call SetUnitY(u,ny)
call GroupRemoveUnit(g,u)
endloop
call GroupAddGroup(g,c.targets)
call c.Move()
if distance <= 400 then
set c.speed=c.speed*.5
else
set c.speed=c.speed*.98
endif
if c.cntr==2 then
set c.cntr=1
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",GetUnitX(c.hitter)+GetRandomReal(-100,100),GetUnitY(c.hitter)+GetRandomReal(-100,100)))
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\Impale\\ImpaleHitTarget.mdl",GetUnitX(c.hitter)+GetRandomReal(-100,100),GetUnitY(c.hitter)+GetRandomReal(-100,100)))
else
set c.cntr=c.cntr+1
endif
if c.speed <= 10 or distance <= 100 or c.offmap==true then //remove
call ClearTriggerStructA(t)
call c.destroy()
call DestroyGroup(g)
set u=null
call DestroyTrigger(t)
set t = null
endif
call DestroyGroup(g)
set u=null
endfunction
private function Actions takes nothing returns nothing
local Charge c = Charge.create()
local trigger t = CreateTrigger()
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local location l=GetSpellTargetLoc()
set c.angle=AngleBetweenPointsXY(x,y,GetLocationX(l),GetLocationY(l))
set c.tx=GetUnitX(c.hitter) + 1300 * Cos(c.angle * bj_DEGTORAD)
set c.ty=GetUnitY(c.hitter) + 1300 * Sin(c.angle * bj_DEGTORAD)
set c.hitter=GetTriggerUnit()
call PolledWait2(.1)
call PlaySoundOnUnitBJ(gg_snd_ArachnoidCharge, 100, c.hitter)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Shockwave\\ShockwaveMissile.mdl",c.hitter,"head"))
call SetTriggerStructA(t,c)
call TriggerRegisterTimerEvent(t,.03,true)
call TriggerAddAction(t,function Callback)
call RemoveLocation(l)
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=-1
//TESH.alwaysfold=0
library SpellArachnathidBurrow initializer Init requires GlobalFuncs
private function Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A07I'
endfunction
private function Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local real x=GetSpellTargetX()
local real y=GetSpellTargetY()
call PolledWait2(.5)
call PauseUnit(u,true)
call ShowUnit(u,false)
call PolledWait2(GetRandomReal(0,3))
call ShowUnit(u,true)
call SetUnitPosition(u,x,y)
call SetUnitAnimation(u,"morph ALTERNATE")
call PolledWait2(1)
call PauseUnit(u,false)
call SetUnitAnimation(u,"stand")
set u=null
endfunction
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=36
//TESH.alwaysfold=0
library SpawnInfectedOB initializer Init requires GlobalFuncs
//TRIG: UA, Cond: au, Func: Vu
globals
private trigger T
endglobals
private function Conditions takes nothing returns boolean
local group g
if DEFEATED or MODE_OUTBREAK_ON==false then
set g = null
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=80 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return TimerGetRemaining(Spawn_Delay)==0
endfunction
private function LessThan80Infected takes nothing returns boolean
local group g
if DEFEATED then
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=80 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return true
endfunction
private function Actions takes nothing returns nothing
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*1.2, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call PolledWait2(2.)
if INFESTATION_LEVEL>=20 and(LessThan80Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*1.8, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(.2)
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*.75, CAVE_LOCS[GetRandomInt(1,4)])
call PolledWait2(2.)
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
call PolledWait2(2.)
call SpawnInfectedOfType(ZID_ZombieFat, INFECTED_GROUP_SIZE/3, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call PolledWait2(2.)
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE/2, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call PolledWait2(2.)
if GetRandomInt(1,2)>=1 and(LessThan80Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*.75, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call SpawnInfectedOfType(ZID_ZombieDog, INFECTED_GROUP_SIZE*.75, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(2.)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Boomer, INFECTED_GROUP_SIZE*.75, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(2.)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_ZombieFaster, INFECTED_GROUP_SIZE*.75, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
endif
call PolledWait2(2.)
if GetRandomInt(1,3)>=1 and LessThan80Infected()then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(2.)
if GetRandomInt(1,9)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, SPAWN_LOC[GetRandomInt(1,SPAWN_LOC_AMT)])
call SpawnInfectedOfType(ZID_Locust, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(2.)
if GetRandomInt(1,9)==1 then
call SpawnInfectedOfType(ZID_LocustSwarm, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,30.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=26
//TESH.alwaysfold=0
library SpawnInfected90 initializer Init requires GlobalFuncs
//TRIG: SA, Cond: wT, Func: yT
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local group g
if DEFEATED or MODE_OUTBREAK_ON then
set g = null
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=60 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return TimerGetRemaining(Spawn_Delay)==0
endfunction
private function LessThan50Infected takes nothing returns boolean
local group g
if DEFEATED then
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=50 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return true
endfunction
private function Actions takes nothing returns nothing
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*2, BORDER_ZONES[GetRandomInt(1,4)])
call PolledWait2(1)
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
if INFESTATION_LEVEL>=20 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*.6, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(.2)
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE*.85, CAVE_LOCS[GetRandomInt(1,4)])
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_Terrorizer, INFECTED_GROUP_SIZE*1.2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_ZombieFat, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_ZombieDog, INFECTED_GROUP_SIZE*.85, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Shredder, INFECTED_GROUP_SIZE*.75, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Stalker, INFECTED_GROUP_SIZE*.75, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=41 and(LessThan50Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Boomer, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,4)==1 and GAME_MODE!=UA2_ModeUmbrella then
call SpawnInfectedOfType(ZID_Brute, GAME_MODE, BORDER_ZONES[GetRandomInt(1,4)])
endif
if GetRandomInt(1,4)==1 and GAME_MODE==UA2_ModeUmbrella then
call SpawnInfectedOfType(ZID_Brute, 3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=21 and LessThan50Infected()then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and GAME_MODE>=1 then
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,9)==1 and DEPLOYMENT_TIME > 520 then
call SpawnInfectedOfType(ZID_Pudge, 1, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Locust, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,9)==1 and DEPLOYMENT_TIME > 420 then
call SpawnInfectedOfType(ZID_LocustSwarm, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,90.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=35
//TESH.alwaysfold=0
library SpawnInfected120 initializer Init requires GlobalFuncs
//TRIG: TA, Cond: vu, Func: xu
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local group g
if DEFEATED or MODE_OUTBREAK_ON then
set g = null
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=90 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return TimerGetRemaining(Spawn_Delay)==0
endfunction
private function LessThan100Infected takes nothing returns boolean
local group g
if DEFEATED then
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=90 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return true
endfunction
private function Actions takes nothing returns nothing
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE*2.5, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
set SPAWN_INFECTED_RECT=BORDER_ZONES[GetRandomInt(1,4)]
if GetRandomInt(1,4)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_ZombieFat, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Boomer, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,4)==1 and(LessThan100Infected())then
if AVERAGE_XP_NO_HIGH_RANKS>=40000 then
call SpawnInfectedOfType(ZID_ZombieFaster, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
else
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call SpawnInfectedOfType(ZID_Licker, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE*2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,6)==1 then
call SpawnInfectedOfType(ZID_Shredder, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,6)==1 then
call SpawnInfectedOfType(ZID_Gargoyle, INFECTED_GROUP_SIZE-2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,6)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Shredder, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_DarkFlyer, INFECTED_GROUP_SIZE-2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Spitter, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=30000 then
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=20000 then
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=8000 and GAME_MODE>=1 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Fiend, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=15000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_BlackKnight, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=20000 and GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=40000 and INFESTATION_LEVEL>=25 then
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=20000 and INFESTATION_LEVEL>=25 then
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Thanatos, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=41 and GetRandomReal(0,1)>.7 then
call SpawnInfectedOfType(ZID_Pudge, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Gonarch, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=10000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_MutatedDog, 2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=35 and (GAME_MODE==UA2_ModeHard or GAME_MODE==UA2_ModeInsane) then
call SpawnInfectedOfType(ZID_Mutant, 2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=20 and (GAME_MODE==UA2_ModeHard or GAME_MODE==UA2_ModeInsane) and AVERAGE_XP_NO_HIGH_RANKS>=10000 then
call SpawnInfectedOfType(ZID_Mutant, 7, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Terrorizer, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>GetPlayerState(Player(0),PLAYER_STATE_FOOD_CAP_CEILING)then
call SpawnInfectedOfType(ZID_EggSack, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=15000 and GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_EggSack, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=12000 and GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_AcidBeast, GAME_MODE+2, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=35000 and GetRandomInt(1,8)==1 then
call SpawnInfectedOfType(ZID_Arachnathid, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=80000 and GetRandomInt(1,6)==1 then
call SpawnInfectedOfType(ZID_Arachnathid, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=80000 and GetRandomInt(1,5)==1 then
call SpawnInfectedOfType(ZID_Sting, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=110000 and GetRandomInt(1,4)==1 then
call SpawnInfectedOfType(ZID_Sting, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
set SPAWN_INFECTED_RECT=BORDER_ZONES[GetRandomInt(1,4)]
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Mutant, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(.2)
if AVERAGE_XP_NO_HIGH_RANKS>=50000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Mutant, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(.2)
if AVERAGE_XP_NO_HIGH_RANKS>=50000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Brute, GAME_MODE+2, BORDER_ZONES[GetRandomInt(1,4)])
endif
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Krill, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
call SpawnInfectedOfType(ZID_Horror, INFECTED_GROUP_SIZE/4, BORDER_ZONES[GetRandomInt(1,4)])
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,120.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=30
//TESH.alwaysfold=0
library SpawnInfected120Recruit initializer Init requires GlobalFuncs
//TRIG: uA, Cond: ou, Func: iu
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local group g
if DEFEATED or MODE_OUTBREAK_ON then
set g = null
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=100 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return TimerGetRemaining(Spawn_Delay)==0
endfunction
private function LessThan100Infected takes nothing returns boolean
local group g
if DEFEATED then
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=100 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return true
endfunction
private function Actions takes nothing returns nothing
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
call PolledWait2(1)
if LessThan100Infected()then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
call PolledWait2(1)
if GetRandomInt(1,2)==1 and LessThan100Infected()then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and LessThan100Infected()then
call SpawnInfectedOfType(ZID_ZombieFat, INFECTED_GROUP_SIZE/4, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE/4, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and LessThan100Infected() then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Terrorizer, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if LessThan100Infected()then
call SpawnInfectedOfType(ZID_Boomer, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Brute, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Fiend, INFECTED_GROUP_SIZE/5, CAVE_LOCS[GetRandomInt(1,4)])
endif
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_ZombieDog, INFECTED_GROUP_SIZE/5, CAVE_LOCS[GetRandomInt(1,4)])
endif
endif
call PolledWait2(1)
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,120.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=29
//TESH.alwaysfold=0
library SpawnInfected180 initializer Init requires GlobalFuncs
//TRIG: tA, Cond: YT, Func: ZT
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local group g
if DEFEATED or MODE_OUTBREAK_ON then
set g = null
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=90 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return TimerGetRemaining(Spawn_Delay)==0
endfunction
private function LessThan100Infected takes nothing returns boolean
local group g
if DEFEATED then
return false
endif
set g = GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
if CountUnitsInGroup(g)>=90 then
call DestroyGroup(g)
set g = null
return false
endif
call DestroyGroup(g)
set g = null
return true
endfunction
private function Actions takes nothing returns nothing
loop
exitwhen CINEMATIC_ENDED
call PolledWait2(1)
endloop
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE*2.8, BORDER_ZONES[GetRandomInt(1,4)])
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=50000 then
call SpawnInfectedOfType(ZID_ZombieFaster, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
else
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
set SPAWN_INFECTED_RECT=CAVE_LOCS[GetRandomInt(1,4)]
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Leaper, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,4)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_ZombieFat, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
call SpawnInfectedOfType(ZID_Horror, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Boomer, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,4)==1 and(LessThan100Infected())then
if AVERAGE_XP_NO_HIGH_RANKS>=50000 then
call SpawnInfectedOfType(ZID_ZombieFaster, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
else
call SpawnInfectedOfType(ZID_ZombieFast, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call SpawnInfectedOfType(ZID_Licker, INFECTED_GROUP_SIZE/2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Zombie, INFECTED_GROUP_SIZE*3, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,6)==1 then
call SpawnInfectedOfType(ZID_Shredder, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Gargoyle, INFECTED_GROUP_SIZE/2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Butcher, 1+GAME_MODE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,6)==1 then
call SpawnInfectedOfType(ZID_DarkFlyer, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
call SpawnInfectedOfType(ZID_ZombieDog, INFECTED_GROUP_SIZE, BORDER_ZONES[GetRandomInt(1,4)])
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Stalker, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=20000 and GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Ravager, INFECTED_GROUP_SIZE/3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE/GetRandomInt(1,2), BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=20000 then
call SpawnInfectedOfType(ZID_Glutton, INFECTED_GROUP_SIZE/GetRandomInt(1,2), BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Fiend, INFECTED_GROUP_SIZE/GetRandomInt(1,2), BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
set SPAWN_INFECTED_RECT=BORDER_ZONES[GetRandomInt(1,4)]
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE/GetRandomInt(1,3), BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=25000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Thanatos, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=25000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=50000 and INFESTATION_LEVEL>=25 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=41 then
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Gonarch, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>=35 and (GAME_MODE==2 or GAME_MODE==3) then
call SpawnInfectedOfType(ZID_Mutant, 2, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=50000 and INFESTATION_LEVEL>=30 and (GAME_MODE==2 or GAME_MODE==3) then
call SpawnInfectedOfType(ZID_Mutant, 5, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_Pudge, 1, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if INFESTATION_LEVEL>GetPlayerState(Player(0),PLAYER_STATE_FOOD_CAP_CEILING)then
call SpawnInfectedOfType(ZID_EggSack, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if AVERAGE_XP_NO_HIGH_RANKS>=2500 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_MutatedDog, 2, BORDER_ZONES[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=10000 and GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_MutatedDog, 3, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
set SPAWN_INFECTED_RECT=Cn
if AVERAGE_XP_NO_HIGH_RANKS>=35000 and GetRandomInt(1,3)==1 then
call SpawnInfectedOfType(ZID_EggSack, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
set SPAWN_INFECTED_RECT=BORDER_ZONES[GetRandomInt(1,4)]
if(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE*1.5, BORDER_ZONES[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Ghoul, INFECTED_GROUP_SIZE*2, CAVE_LOCS[GetRandomInt(1,4)])
endif
call PolledWait2(1)
if GetRandomInt(1,2)==1 and(LessThan100Infected())then
call SpawnInfectedOfType(ZID_Gargoyle, INFECTED_GROUP_SIZE, CAVE_LOCS[GetRandomInt(1,4)])
endif
if GetRandomInt(1,2)==1 then
call SpawnInfectedOfType(ZID_Beast, INFECTED_GROUP_SIZE/3, CAVE_LOCS[GetRandomInt(1,4)])
endif
if AVERAGE_XP_NO_HIGH_RANKS>=80000 and GetRandomInt(1,5)==1 then
call SpawnInfectedOfType(ZID_Arachnathid, 1, BORDER_ZONES[GetRandomInt(1,4)])
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,180.)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SetInfected120Ror180 initializer Init requires GlobalFuncs
//TRIG: aN, Cond: NU, Func: BU
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return (DEFEATED==false)
endfunction
private function Actions takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"|cff808000SOCOM:|r Recon has picked up multiple hostiles closing in on your position.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
call TriggerSleepAction(10.)
if (GAME_MODE==UA2_ModeRecruit) then
call EnableTrigger(SpawnInfected120Recruit_T)
else
call EnableTrigger(SpawnInfected180_T)
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,GetRandomReal(420.,520.))
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
call DisableTrigger(T)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SetInfectedGroupSize initializer Init requires GlobalFuncs
//TRIG: mA, Cond: --, Func: kT
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
if (AVERAGE_XP_NO_HIGH_RANKS<10000) then
if (AVERAGE_XP_NO_HIGH_RANKS<5000) then
set INFECTED_GROUP_SIZE=(STANDARD_INFECTED_GROUP_SIZE-2)
else
set INFECTED_GROUP_SIZE=(STANDARD_INFECTED_GROUP_SIZE-1)
endif
else
// Undead stat bonus +2
set INFECTED_GROUP_SIZE=R2I(STANDARD_INFECTED_GROUP_SIZE*1.1)
call SetPlayerTechResearched(Player(15),'R008',3)
endif
// On first run
if (INFECTED_GROUP_SIZE<=0) then
set INFECTED_GROUP_SIZE=STANDARD_INFECTED_GROUP_SIZE
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,60.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=36
//TESH.alwaysfold=0
library EatingZombies initializer Init requires GlobalFuncs
globals
public trigger T
public trigger T2
public trigger T3
sound array lickersnd
integer LICKER_MAX
endglobals
private function LickerAttacked takes nothing returns nothing
local unit u = GetEventDamageSource()
call DisableTrigger(GetTriggeringTrigger())
call PauseUnit(GetTriggerUnit(), false)
call ResetUnitAnimation(u)
call IssuePointOrder(GetTriggerUnit(), "attack", GetUnitX(u), GetUnitY(u))
call PlaySoundOnUnitBJ(lickersnd[GetRandomInt(1,LICKER_MAX)], 100, GetTriggerUnit())
set u = null
endfunction
private function InRangeCondition takes nothing returns boolean
return GetPlayerController(GetOwningPlayer(GetTriggerUnit())) == MAP_CONTROL_USER
endfunction
private function LickerInRange takes nothing returns nothing
local unit u = GetEventDamageSource()
call DisableTrigger(GetTriggeringTrigger())
call PauseUnit(GetTriggerUnit(), false)
call ResetUnitAnimation(u)
call IssuePointOrder(GetTriggerUnit(), "attack", GetUnitX(u), GetUnitY(u))
set u = null
endfunction
private function SpawnEatingLicker takes rect rec, real angle returns nothing
local unit u = CreateUnit(Player(15), 'u000', GetRectCenterX(rec), GetRectCenterY(rec), angle)
call SetUnitAnimation(u, "stand channel")
call PauseUnit(u, true)
call TriggerRegisterUnitEvent(T2, u, EVENT_UNIT_DAMAGED)
//call TriggerRegisterUnitInRange(T3, u, 250., Condition(function InRangeCondition)) how to detect the licker?
set u = null
endfunction
private function Actions takes nothing returns nothing
set lickersnd[1] = gg_snd_GhoulWarcry1
set lickersnd[2] = gg_snd_GhoulYes1
set lickersnd[3] = gg_snd_GhoulYes4
set lickersnd[4] = gg_snd_GhoulYesAttack1
set lickersnd[5] = gg_snd_GhoulYesAttack2
set lickersnd[6] = gg_snd_GhoulYesAttack3
set LICKER_MAX = 6
call SpawnEatingLicker(gg_rct_EatingZombie1 ,238)
call SpawnEatingLicker(gg_rct_EatingZombie2 ,100)
call SpawnEatingLicker(gg_rct_EatingZombie3 ,302)
call SpawnEatingLicker(gg_rct_EatingZombie4 ,103)
call SpawnEatingLicker(gg_rct_EatingZombie5 ,346)
call SpawnEatingLicker(gg_rct_EatingZombie6 ,247)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEvent(T, .1, false)
call TriggerAddAction(T,function Actions)
set T2 = CreateTrigger()
call TriggerAddAction(T2,function LickerAttacked)
set T3 = CreateTrigger()
call TriggerAddAction(T3,function LickerInRange)
endfunction
endlibrary
//TESH.scrollpos=8
//TESH.alwaysfold=0
library GonarchSpawn initializer Init requires GlobalFuncs
//TRIG: MA, Cond: --, Func: lT
//NEEDS: ...
globals
public trigger T
endglobals
function SpawnCrab takes nothing returns nothing
local unit eu=GetEnumUnit()
local unit u=CreateUnit(Player(15),'n00M',GetUnitX(eu),GetUnitY(eu),GetRandomReal(0,360))
call AttackPlayerUnit(u)
call SetUnitAnimation(u,"birth")
set u=null
set eu=null
endfunction
private function Actions takes nothing returns nothing
local integer i=1
loop
exitwhen i>GetRandomInt(1,2)
set LOCALIZABLE_GROUP=GetUnitsOfType('n00N')
call ForGroupBJ(LOCALIZABLE_GROUP,function SpawnCrab)
call DestroyGroup(LOCALIZABLE_GROUP)
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(30,35))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
library SporeSpawn initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: Ow
//NEEDS: ...
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local group g=CreateGroup()
local unit u
local unit m
set g=GetUnitsOfType('n00H')
loop
set u=FirstOfGroup(g)
exitwhen u==null
if IsUnitAliveBJ(u) then
call SetUnitAnimation(u,"slam")
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonSmallDeathExplode\\DemonSmallDeathExplode.mdl",GetUnitX(u),GetUnitY(u)))
set m=CreateUnit(Player(15),'n00I',GetUnitX(u),GetUnitY(u),GetRandomReal(0,360))
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonSmallDeathExplode\\DemonSmallDeathExplode.mdl",GetUnitX(m),GetUnitY(m)))
call AttackPlayerUnit(m)
if PLAYING_PLAYERS > 1 and GAME_MODE > 1 and GetRandomInt(1,3)==1 then
set m=CreateUnit(Player(15),'n01A',GetUnitX(u),GetUnitY(u),GetRandomReal(0,360))
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Demon\\DemonSmallDeathExplode\\DemonSmallDeathExplode.mdl",GetUnitX(m),GetUnitY(m)))
call AttackPlayerUnit(m)
endif
call PolledWait2(1)
call ResetUnitAnimation(u)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g=null
set u=null
set m=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(20,22))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=26
//TESH.alwaysfold=0
library SpawnLickerOrLeaper initializer Init requires GlobalFuncs
//TRIG: pA, Cond: LT, Func: PT
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(DEFEATED==false)
endfunction
private function Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local unit un
local integer i = GetUnitTypeId(u)
local location l
if (GetRandomInt(1,3)==1) and ((i=='n000') or (i=='n001') or (i=='n002') or (i=='u000') or (i=='n009') or (i=='h005') or (i=='h018') or (i=='n004') or (i=='n005') or (i=='n008') or (i=='n007') or (i=='n006')) then
call TriggerSleepAction(GetRandomReal(3.,20.))
loop
exitwhen Game_Paused==false
call PolledWait2(1.)
endloop
set l = GetUnitLoc(u)
if (GetRandomInt(1,12)==1) then
set un = CreateUnitAtLoc(Player(15),'u007',l,GetUnitFacing(u))
elseif GetRandomInt(1,3) != 1 and i=='n000' then
set un = CreateUnitAtLoc(Player(15),'n000',l,GetUnitFacing(u))
call PauseUnit(un, true)
call SetUnitAnimation(un, "birth")
call SetUnitTimeScalePercent(un, 50)
else
set un = CreateUnitAtLoc(Player(15),'u000',l,GetUnitFacing(u))
endif
call RemoveLocation(l)
set l=GetUnitLoc(un)
if GetUnitTypeId(un) == 'n000' then
call PolledWait2(1.165)
if IsUnitAliveBJ(un) then
call PauseUnit(un, false)
call SetUnitAnimation(un, "stand")
call SetUnitTimeScalePercent(un, 100)
endif
else
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl",l))
call DestroyEffect(AddSpecialEffectLoc("Objects\\Spawnmodels\\Undead\\UndeadLargeDeathExplode\\UndeadLargeDeathExplode.mdl",l))
endif
call AttackPlayerUnit(un)
call RemoveLocation(l)
set l = null
endif
set u = null
set un=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library SpawnItemsOnce initializer Init requires GlobalFuncs
//TRIG: zI, Cond: --, Func: BS
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
call SpawnItemMap(GetRandomInt(22,30), 'I000')
call SpawnItemMap(GetRandomInt(3,5), 'I004')
call SpawnItemMap(GetRandomInt(1,4), 'I000')
call SpawnItemMap(GetRandomInt(0,2), 'I015')
call SpawnItemMap(GetRandomInt(0,1), 'I01C')
call SpawnItemMap(GetRandomInt(0,1), 'I01B')
call SpawnItemMap(GetRandomInt(2,4), 'I003')
call SpawnItemMap(2, 'I006')
call SpawnItemMap(GetRandomInt(4,5), 'I00C')
call SpawnItemMap(1, 'I012')
if (GAME_MODE!=5) then
call TriggerSleepAction(GetRandomReal(800.,1200.))
call SpawnItemMap(2, 'I00K')
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=21
//TESH.alwaysfold=0
library SpawnItems initializer Init requires GlobalFuncs
//TRIG: ZI, Func: dS
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
call SpawnItemMap(6, 'I000')
if GetRandomInt(1,2)==1 then
call SpawnItemMap(2, 'I004')
endif
if GetRandomInt(1,2)==1 then
call SpawnItemMap(2, 'I003')
endif
call SpawnItemMap(GetRandomInt(34,40), 'I000')
call SpawnItemMap(8, 'I00S')
call SpawnItemMap(GetRandomInt(0,1), 'I019')
call SpawnItemMap(GetRandomInt(0,1), 'I015')
call SpawnItemMap(GetRandomInt(0,2), 'I018')
call SpawnItemMap(1, 'I017')
if GetRandomInt(1,2)==1 then
call SpawnItemMap(GetRandomInt(0,1), 'I01C')
call SpawnItemMap(GetRandomInt(0,1), 'I01B')
endif
call SpawnItemMap(GetRandomInt(1,2), 'I004')
call SpawnItemMap(GetRandomInt(1,2), 'I003')
call SpawnItemMap(GetRandomInt(3,6), 'I00J')
call SpawnItemMap(GetRandomInt(1,2), 'I00J')
call SpawnItemMap(GetRandomInt(1,2), 'I00I')
call SpawnItemMap(GetRandomInt(2,3), 'I00N')
call SpawnItemMap(GetRandomInt(1,3), 'I00O')
call SpawnItemMap(GetRandomInt(6,9), 'I00S')
call SpawnItemMap(GetRandomInt(3,5), 'I00V')
call SpawnItemMap(GetRandomInt(1,3), 'I00W')
call SpawnItemMap(GetRandomInt(1,2), 'I00F')
call SpawnItemMap(GetRandomInt(1,2), 'I006')
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,5.)
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(600.,800.))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library SpawnItems2 initializer Init requires GlobalFuncs
//TRIG: vA, Func: DS
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
call SpawnItemMap(1, 'I00U')
call SpawnItemMap(1, 'I019')
call SpawnItemMap(1, 'I015')
call SpawnItemMap(1, 'I018')
call SpawnItemMap(1, 'I017')
call SpawnItemMap(1, 'I016')
call SpawnItemMap(GetRandomInt(1,3), 'I008')
call SpawnItemMap(GetRandomInt(1,3), 'I012')
call SpawnItemMap(GetRandomInt(3,4), 'I00R')
call SpawnItemMap(GetRandomInt(1,3), 'I00L')
call SpawnItemMap(GetRandomInt(2,4), 'I009')
call SpawnItemMap(GetRandomInt(2,4), 'I00E')
call SpawnItemMap(GetRandomInt(1,3), 'I00F')
call SpawnItemMap(1, 'I005')
call SpawnItemMap(1, 'I00G')
call SpawnItemMap(GetRandomInt(2,5), 'I002')
call SpawnItemMap(GetRandomInt(1,2), 'I00E')
call SpawnItemMap(GetRandomInt(2,8), 'I006')
call SpawnItemMap(GetRandomInt(1,2), 'I00A')
call SpawnItemMap(GetRandomInt(2,5), 'I00C')
call SpawnItemMap(GetRandomInt(1,3), 'I00D')
call SpawnItemMap(GetRandomInt(2,5), 'I00M')
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventSingle(T,1080.)
call TriggerRegisterTimerEventSingle(T,1800.)
call TriggerRegisterTimerEventSingle(T,3600.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library WeaponCacheSetup initializer Init requires GlobalFuncs
//TRIG: YX, Cond: --, Func: FH
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i
if true then //(GAME_MODE<=UA2_ModeNormal) then
set i=1
loop
exitwhen i>3
if (GetRandomInt(1,3)==1) then
set WEAPONS_CACHE[i]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_TOP),bj_UNIT_FACING)
else
set WEAPONS_CACHE[i]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_BOT),bj_UNIT_FACING)
endif
set i=i+1
endloop
call TriggerSleepAction(5.)
call EnableTrigger(WeaponCacheFound_T)
call TriggerSleepAction(180.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cff808000Battallion:|r Logs show Echo company passed through here about a week ago. They had to ditch a lot of equipment and they stocked them in 3 weapons caches somewhere in the sector. They could greatly aid you if you find them.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
elseif (GAME_MODE==UA2_ModeSurvival) or (GAME_MODE==UA2_ModeUmbrella) then
set i=1
loop
exitwhen i>2
if (GetRandomInt(1,3)==1) then
set WEAPONS_CACHE[i]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_TOP),bj_UNIT_FACING)
else
set WEAPONS_CACHE[i]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_BOT),bj_UNIT_FACING)
endif
set i=i+1
endloop
set WEAPONS_CACHE_FOUND[3]=true
call TriggerSleepAction(5.)
call EnableTrigger(WeaponCacheFound_T)
call TriggerSleepAction(80.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cff808000Battallion:|r Logs show Echo company passed through here about a week ago. They had to ditch a lot of equipment and they stocked them in 2 weapons caches somewhere in the sector. They could greatly aid you if you find them.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
elseif (GAME_MODE==UA2_ModeInsane) then
if (GetRandomInt(1,3)==1) then
set WEAPONS_CACHE[1]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_TOP),bj_UNIT_FACING)
else
set WEAPONS_CACHE[1]=CreateUnitAtLoc(Player(12),'n00L',GetRandomLocInRect(CACHE_RECT_BOT),bj_UNIT_FACING)
endif
set WEAPONS_CACHE_FOUND[2]=true
set WEAPONS_CACHE_FOUND[3]=true
call TriggerSleepAction(5.)
call EnableTrigger(WeaponCacheFound_T)
call TriggerSleepAction(80.)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|cff808000Battallion:|r Logs show Echo company passed through here about a week ago. They had to ditch a lot of equipment and they stocked them in a weapons cache somewhere in the sector. It could greatly aid you if you find it.")
call PlaySoundBJ(SOUND_RADIO_FEEDBACK_C_1)
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=68
//TESH.alwaysfold=0
library WeaponCacheFound initializer Init requires GlobalFuncs
//TRIG: zX, Cond: --, Func: kH
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local integer i_2
local real px
local real py
local real cx
local real cy
loop
exitwhen i>11
set px=GetUnitX(PLAYER_UNIT[i])
set py=GetUnitY(PLAYER_UNIT[i])
set cx=GetUnitX(WEAPONS_CACHE[1])
set cy=GetUnitY(WEAPONS_CACHE[1])
if (DistanceBetweenPointsXY(px,py,cx,cy) <= 200) and (WEAPONS_CACHE_FOUND[1]==false) then
set LOCALIZABLE_LOC=GetUnitLoc(WEAPONS_CACHE[1])
set WEAPONS_CACHE_FOUND[1]=true
set cx=GetUnitX(WEAPONS_CACHE[1])
set cy=GetUnitY(WEAPONS_CACHE[1])
call PlaySoundBJ(SOUND_SECRET_FOUND)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,8.,2,82.,36.,9.)
call SetCameraQuickPositionLoc(LOCALIZABLE_LOC)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Weapons cache found.")
set i_2=1
loop
exitwhen i_2>2+PLAYING_PLAYERS/3
call CreateItemLoc('I00S',LOCALIZABLE_LOC)
call SetItemCharges(bj_lastCreatedItem,5)
set i_2=i_2+1
endloop
call CreateItemLoc('I00M',LOCALIZABLE_LOC)
call CreateItemLoc('I00O',LOCALIZABLE_LOC)
call CreateItemLoc('I00F',LOCALIZABLE_LOC)
call CreateItemLoc('I00U',LOCALIZABLE_LOC)
call CreateItemLoc('I009',LOCALIZABLE_LOC)
call CreateItemLoc('I012',LOCALIZABLE_LOC)
call CreateItemLoc('I006',LOCALIZABLE_LOC)
if GetRandomInt(1,3)==1 then
call CreateItemLoc('I013',LOCALIZABLE_LOC)
endif
call CreateItemLoc('I00I',LOCALIZABLE_LOC)
call SetItemCharges(bj_lastCreatedItem,8)
set i_2=1
loop
exitwhen i_2>2
call CreateItemLoc('I004',LOCALIZABLE_LOC)
call CreateItemLoc('I003',LOCALIZABLE_LOC)
call CreateItemLoc('I00V',LOCALIZABLE_LOC)
call CreateItemLoc('I00W',LOCALIZABLE_LOC)
call CreateItemLoc('I00C',LOCALIZABLE_LOC)
set i_2=i_2+1
endloop
call RemoveUnit(WEAPONS_CACHE[1])
call RemoveLocation(LOCALIZABLE_LOC)
endif
set cx=GetUnitX(WEAPONS_CACHE[2])
set cy=GetUnitY(WEAPONS_CACHE[2])
if (DistanceBetweenPointsXY(px,py,cx,cy) <= 200) and (WEAPONS_CACHE_FOUND[2]==false) then
set LOCALIZABLE_LOC=GetUnitLoc(WEAPONS_CACHE[2])
set WEAPONS_CACHE_FOUND[2]=true
call PlaySoundBJ(SOUND_SECRET_FOUND)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,8.,2,82.,36.,9.)
call SetCameraQuickPositionLoc(LOCALIZABLE_LOC)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Weapons cache found.")
set i_2=1
loop
exitwhen i_2>2+PLAYING_PLAYERS/3
call CreateItemLoc('I00S',LOCALIZABLE_LOC)
call SetItemCharges(bj_lastCreatedItem,5)
set i_2=i_2+1
endloop
call CreateItemLoc('I017',LOCALIZABLE_LOC)
call CreateItemLoc('I001',LOCALIZABLE_LOC)
call CreateItemLoc('I00E',LOCALIZABLE_LOC)
call CreateItemLoc('I005',LOCALIZABLE_LOC)
call CreateItemLoc('I003',LOCALIZABLE_LOC)
call CreateItemLoc('I004',LOCALIZABLE_LOC)
call CreateItemLoc('I00V',LOCALIZABLE_LOC)
call CreateItemLoc('I006',LOCALIZABLE_LOC)
set i_2=1
loop
exitwhen i_2>2
call CreateItemLoc('I00N',LOCALIZABLE_LOC)
call CreateItemLoc('I00O',LOCALIZABLE_LOC)
call CreateItemLoc('I00J',LOCALIZABLE_LOC)
call CreateItemLoc('I00W',LOCALIZABLE_LOC)
call CreateItemLoc('I00C',LOCALIZABLE_LOC)
set i_2=i_2+1
endloop
call RemoveUnit(WEAPONS_CACHE[2])
call RemoveLocation(LOCALIZABLE_LOC)
endif
set cx=GetUnitX(WEAPONS_CACHE[3])
set cy=GetUnitY(WEAPONS_CACHE[3])
if (DistanceBetweenPointsXY(px,py,cx,cy) <= 200) and (WEAPONS_CACHE_FOUND[3]==false) then
set LOCALIZABLE_LOC=GetUnitLoc(WEAPONS_CACHE[3])
set WEAPONS_CACHE_FOUND[3]=true
call PlaySoundBJ(SOUND_SECRET_FOUND)
call PingMinimapLocForForceEx(bj_FORCE_ALL_PLAYERS,LOCALIZABLE_LOC,8.,2,82.,36.,9.)
call SetCameraQuickPositionLoc(LOCALIZABLE_LOC)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Weapons cache found.")
set i_2=1
loop
exitwhen i_2>2+PLAYING_PLAYERS/3
call CreateItemLoc('I00S',LOCALIZABLE_LOC)
call SetItemCharges(bj_lastCreatedItem,5)
set i_2=i_2+1
endloop
call CreateItemLoc('I008',LOCALIZABLE_LOC)
call CreateItemLoc('I00E',LOCALIZABLE_LOC)
call CreateItemLoc('I00D',LOCALIZABLE_LOC)
call CreateItemLoc('I00N',LOCALIZABLE_LOC)
call CreateItemLoc('I00O',LOCALIZABLE_LOC)
call CreateItemLoc('I00V',LOCALIZABLE_LOC)
call CreateItemLoc('I00W',LOCALIZABLE_LOC)
set i_2=1
loop
exitwhen i_2>2
call CreateItemLoc('I006',LOCALIZABLE_LOC)
call CreateItemLoc('I00I',LOCALIZABLE_LOC)
call CreateItemLoc('I004',LOCALIZABLE_LOC)
call CreateItemLoc('I003',LOCALIZABLE_LOC)
set i_2=i_2+1
endloop
call RemoveUnit(WEAPONS_CACHE[3])
call RemoveLocation(LOCALIZABLE_LOC)
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerRegisterTimerEventPeriodic(T,1.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library InitializeMultiboard initializer Init requires GlobalFuncs
//TRIG: RO, Cond: --, Func: lj
globals
public trigger T
multiboard MULTIBOARD
endglobals
private function Actions takes nothing returns nothing
local integer i=3
local integer rows=2+PLAYING_PLAYERS
set MULTIBOARD = CreateMultiboardBJ(2,rows,"Initializing")
call MultiboardSetItemValueBJ(MULTIBOARD,1,2,"|cff804000Soldier ID|r")
call MultiboardSetItemValueBJ(MULTIBOARD,2,2,"|cff804000Status|r")
call MultiboardSetItemWidthBJ(MULTIBOARD,1,0,10)
call MultiboardSetItemWidthBJ(MULTIBOARD,2,0,6.)
call MultiboardSetItemStyleBJ(MULTIBOARD,0,0,true,false)
call MultiboardSetItemStyleBJ(MULTIBOARD,1,0,true,true)
call MultiboardSetItemStyleBJ(MULTIBOARD,1,1,true,false)
call MultiboardSetItemStyleBJ(MULTIBOARD,1,2,true,false)
call MultiboardSetItemStyleBJ(MULTIBOARD,2,0,true,true)
call MultiboardSetItemStyleBJ(MULTIBOARD,2,1,true,false)
call MultiboardSetItemStyleBJ(MULTIBOARD,2,2,true,false)
call MultiboardMinimize(MULTIBOARD,true)
set i=3
loop
exitwhen i>13
if (GetPlayerController(Player(i-3))==MAP_CONTROL_USER) then
if (GetPlayerSlotState(Player(i-3))==PLAYER_SLOT_STATE_PLAYING) then
call MultiboardSetItemValueBJ(MULTIBOARD,1,i,GetPlayerName(Player(i-3)))
else
call MultiboardSetItemStyleBJ(MULTIBOARD,0,i,false,false)
endif
endif
set i=i+1
endloop
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Initializing.")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Initializing..")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Initializing...")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Recieving Data")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Recieving Data.")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Recieving Data..")
call PolledWait2(.5)
call MultiboardSetTitleText(MULTIBOARD,"Recieving Data...")
call PolledWait2(1.5)
call MultiboardSetTitleText(MULTIBOARD,"Connecting To UndeadAssault.net")
call PolledWait2(1.5)
call MultiboardSetTitleText(MULTIBOARD,"Connecting To UndeadAssault.net.")
call PolledWait2(1.5)
call MultiboardSetTitleText(MULTIBOARD,"Connecting To UndeadAssault.net..")
call PolledWait2(1.5)
call MultiboardSetTitleText(MULTIBOARD,"Connecting To UndeadAssault.net...")
call PolledWait2(1.5)
call MultiboardSetTitleText(MULTIBOARD,"HUD")
call MultiboardSetItemIconBJ(MULTIBOARD,2,1,"ReplaceableTextures\\CommandButtons\\BTNSkillz.tga")
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UpdatePlayerStats initializer Init requires GlobalFuncs
//TRIG: IO, Cond: --, Func: RJ
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local integer index=3
local player p
local unit u
local string s
loop
exitwhen index > MultiboardGetRowCount(MULTIBOARD)
set i=index-2
loop
exitwhen i>11
set p = Player(i-1)
set u = PLAYER_UNIT[i]
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNSkillz.tga")
if UnitHasBuffBJ(u,'B00C') or UnitHasBuffBJ(u,'B012') or UnitHasBuffBJ(u,'B011') then
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNSkeletalLongevity.blp")
endif
if UnitHasBuffBJ(u,'B004') or UnitHasBuffBJ(u,'B005') then
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNCannibalize.blp")
endif
if UnitHasBuffBJ(u,'B00M') or UnitHasBuffBJ(u,'B00N') or UnitHasBuffBJ(u,'B00Z') then
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNCorrosiveBreath.blp")
endif
if UnitHasBuffBJ(u,'B00D') then
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNParasite.blp")
endif
if IsUnitDeadBJ(u) or u==null then
call MultiboardSetItemIconBJ(MULTIBOARD,2,index,"ReplaceableTextures\\CommandButtons\\BTNAnkh.blp")
endif
if GetUnitTypeId(u)=='H008' or GetUnitTypeId(u)=='H00C' or GetUnitTypeId(u)=='H000' or GetUnitTypeId(u)=='H01I' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNMarine.blp")
endif
if GetUnitTypeId(u)=='H00H' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNCommander.blp")
endif
if GetUnitTypeId(u)=='H00N' or GetUnitTypeId(u)=='H00P' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTN_Marine.blp")
endif
if GetUnitTypeId(u)=='H00U' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNFirebat.blp")
endif
if GetUnitTypeId(u)=='H001' or GetUnitTypeId(u)=='H00D' or GetUnitTypeId(u)=='H00R' or GetUnitTypeId(u)=='H011' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNSophoComabatSpaceMarine1.blp")
endif
if GetUnitTypeId(u)=='H00J' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNCommander2.blp")
endif
if GetUnitTypeId(u)=='H00I' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"war3mapImported\\BTNGhost.blp")
endif
if GetUnitTypeId(u)=='h00K' then
call MultiboardSetItemIconBJ(MULTIBOARD,1,index,"ReplaceableTextures\\CommandButtons\\BTNFlyingMachine.blp")
endif
call MultiboardSetItemValueBJ(MULTIBOARD,2,index,(I2S(R2I(GetUnitLifePercent(u)))+"%"))
if IsUnitDeadBJ(u) then
call MultiboardSetItemValueBJ(MULTIBOARD,2,index,"K.I.A.")
endif
if u==null then
call MultiboardSetItemValueBJ(MULTIBOARD,2,index,"Picking")
endif
if GetPlayerSlotState(p)==PLAYER_SLOT_STATE_LEFT then
call MultiboardSetItemValueBJ(MULTIBOARD,2,index,"M.I.A.")
endif
if StringLength(GetPlayerName(p)) > 16 then
set s=SubStringBJ(GetPlayerName(p),1,14) + "..."
else
set s=GetPlayerName(p)
endif
if GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING then
call MultiboardSetItemValueBJ(MULTIBOARD,1,index,s)
elseif GetPlayerSlotState(p)==PLAYER_SLOT_STATE_LEFT then
call MultiboardSetItemValueBJ(MULTIBOARD,1,index,"|cff808080"+s)
endif
if GetPlayerSlotState(p)==PLAYER_SLOT_STATE_PLAYING or GetPlayerSlotState(p)==PLAYER_SLOT_STATE_LEFT then
set i=1337
endif
set i=i+1
endloop
set index=index+1
endloop
set u=null
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,3.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library UpdateMissionAndAmmo initializer Init requires GlobalFuncs
//TRIG: AO, Cond: --, Func: IJ
private function Actions takes nothing returns nothing
local multiboarditem mbitem
local integer i=1
local string s
set DEPLOYMENT_TIME=(DEPLOYMENT_TIME+1)
if MissionTime >= 1 then
set MissionTime=(MissionTime-1)
endif
if MissionTime < 1 then
set MissionTime=0
endif
call MultiboardSetItemValueBJ(MULTIBOARD,1,1,"DT: "+I2S(R2I(DEPLOYMENT_TIME/60))+"m")
call MultiboardSetItemValueBJ(MULTIBOARD,2,1,"MT: "+I2S(R2I(MissionTime))+"s")
// ==================== Ammo counter (causes server split) ==================
return
loop
exitwhen i>11
if GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING and GetUnitTypeId(PLAYER_UNIT[i])!='H00U' then
set s="DT: "+I2S(DEPLOYMENT_TIME/60)+" min Ammo: "
set mbitem=MultiboardGetItem(MULTIBOARD,0,0) //this function is based at 0
if CURRENT_AMMO[i] > MAG_SIZE[i]*.84 then
set s=s+"IIIII"
elseif CURRENT_AMMO[i] > MAG_SIZE[i]*.68 then
set s=s+"IIII|cff808080I"
elseif CURRENT_AMMO[i] > MAG_SIZE[i]*.52 then
set s=s+"III|cff808080II"
elseif CURRENT_AMMO[i] > MAG_SIZE[i]*.36 then
set s=s+"II|cff808080III"
elseif CURRENT_AMMO[i] > MAG_SIZE[i]*.2 then
set s=s+"I|cff808080IIII"
elseif CURRENT_AMMO[i] >= 0 then
set s=s+"|cff808080IIIII"
endif
if GetLocalPlayer()==Player(i-1) then
call MultiboardSetItemValue(mbitem, s)
call MultiboardReleaseItem(mbitem)
endif
elseif GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING and GetUnitTypeId(PLAYER_UNIT[i])!='H00U' then
set s="DT: "+I2S(DEPLOYMENT_TIME/60)+" min"
set mbitem=MultiboardGetItem(MULTIBOARD,0,0) //this function is based at 0
if GetLocalPlayer()==Player(i-1) then
call MultiboardSetItemValue(mbitem, s)
call MultiboardReleaseItem(mbitem)
endif
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,1.)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Arachnathid initializer Init requires GlobalFuncs
//TRIG: yA, Func: Nu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('u00D')
local unit u=GroupPickRandomUnit(g)
local group g2=CreateGroup()
local unit u2
local boolexpr filter
if u != null then
set filter=Condition(function IsUnitAliveAndEnemyWithInfected)
call GroupEnumUnitsInRange(g2,GetUnitX(u),GetUnitY(u),1300,filter)
call DestroyBoolExpr(filter)
set u2 = GroupPickRandomUnit(g2)
if u2 != null then
call IssuePointOrder(u,"impale",GetUnitX(u2),GetUnitY(u2))
endif
call DestroyGroup(g2)
set u2=null
set g2=null
endif
call DestroyGroup(g)
set u = null
set g = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,2)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library ArachnathidBurrow initializer Init requires GlobalFuncs
//TRIG: zA, Func: Cu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('u00D')
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local group g3
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(200.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set g3 = GetUnitsInRangeOfLocMatching(1800.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g3)
if CountUnitsInGroup(g2)<=0 and u2 != null then
call IssuePointOrderById(u,OID_blink,GetUnitX(u2),GetUnitY(u2))
endif
call DestroyGroup(g2)
call DestroyGroup(g3)
call RemoveLocation(l)
set u2=null
set g2=null
set g3=null
set l=null
endif
call DestroyGroup(g)
set u = null
set g = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(1.,1.5))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Darreus initializer Init requires GlobalFuncs
//TRIG: WA, Func: Iu
//NEEDS pB(real)
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType(ZID_Darreus)
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(1200.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g2)
if u2 != null and (IsUnitInGroup(u,DarreusConvoy)==false or TimerGetRemaining(DarreusAttacking)==0) then
call IssueImmediateOrderById(u,OID_berserk)
call IssuePointOrderById(u,OID_attack,GetUnitX(u2),GetUnitY(u2))
call AddUnitAnimationProperties(u,"alternate",true)
// Next 2 lines used to be after next endif
call PolledWait2(6.)
call AddUnitAnimationProperties(u,"alternate",false)
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(1.2,1.7))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=7
//TESH.alwaysfold=0
library Sting initializer Init requires GlobalFuncs
//TRIG: WA, Func: Iu
//NEEDS pB(real)
private function Actions takes nothing returns nothing
local group g
local unit u
local location l
local group g2
local unit u2
if GetRandomInt(1,2)==1 then
set g=GetUnitsOfType(ZID_Sting)
else
set g=GetUnitsOfType(ZID_Fiend)
endif
set u=GroupPickRandomUnit(g)
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(500,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g2)
if u2 != null then
call IssueTargetOrder(u,"ensnare",u2)
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,4)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library EggSack initializer Init requires GlobalFuncs
//TRIG: wA, Func: Ou
private function SpawnHeph takes nothing returns nothing
local location l
local unit u = GetEnumUnit()
local integer i
if (GetUnitState(u,UNIT_STATE_MANA) >= 100.) and IsUnitAliveBJ(u) then
set l = GetUnitLoc(u)
call KillUnit(u)
call CreateNUnitsAtLoc(1,'n00P',Player(15),l,GetRandomReal(0,360))
call AttackPlayerUnit(bj_lastCreatedUnit)
set i=1
loop
exitwhen i>GetRandomInt(3,8)
call CreateNUnitsAtLoc(1,'n00J',Player(15),l,GetRandomReal(0,360))
call AttackPlayerUnit(bj_lastCreatedUnit)
set i=i+1
endloop
call PlaySoundBJ(SOUND_HEARTBEAT)
endif
call RemoveLocation(l)
set l = null
set u = null
endfunction
private function Actions takes nothing returns nothing
local group g = GetUnitsOfType('n00O')
call ForGroupBJ(g,function SpawnHeph)
call DestroyGroup(g)
set g = null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,5)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library Hephaestus initializer Init requires GlobalFuncs
//TRIG: yA, Func: Nu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('n00P')
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local group g3
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(300,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set g3 = GetUnitsInRangeOfLocMatching(2200,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g3)
if u2 != null and CountUnitsInGroup(g2)==0 then
call IssuePointOrderById(u,OID_blink,GetUnitX(u2),GetUnitY(u2))
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call DestroyGroup(g3)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set g3=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,1.6)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=5
//TESH.alwaysfold=0
library Leaper initializer Init requires GlobalFuncs
//TRIG: YA, Func: Bu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('u007')
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local group g3
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(400.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set g3 = GetUnitsInRangeOfLocMatching(2200.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g3)
if u2 != null and CountUnitsInGroup(g2)==0 then
call IssuePointOrderById(u,OID_blink,GetUnitX(u2),GetUnitY(u2))
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call DestroyGroup(g3)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set g3=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(1.4,1.8))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Minerva initializer Init requires GlobalFuncs
//TRIG: zA, Func: Cu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('n00G')
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local group g3
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(400.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set g3 = GetUnitsInRangeOfLocMatching(2800.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g3)
if CountUnitsInGroup(g2)<=0 and u2 != null then
call IssuePointOrderById(u,OID_blink,GetUnitX(u2),GetUnitY(u2))
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call DestroyGroup(g3)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set g3=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(1.,1.5))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library LeBronDunk initializer Init requires GlobalFuncs
//TRIG: zA, Func: Cu
private function Actions takes nothing returns nothing
local group g=GetUnitsOfType('n018')
local unit u=GroupPickRandomUnit(g)
local location l
local group g2
local group g3
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRangeOfLocMatching(400.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set g3 = GetUnitsInRangeOfLocMatching(5000.,l,Condition(function IsUnitAliveAndEnemyWithInfected))
set u2 = GroupPickRandomUnit(g3)
if CountUnitsInGroup(g2)<=0 and u2 != null then
call IssuePointOrderById(u,OID_blink,GetUnitX(u2),GetUnitY(u2))
endif
endif
call DestroyGroup(g)
call DestroyGroup(g2)
call DestroyGroup(g3)
call RemoveLocation(l)
set u=null
set u2=null
set g=null
set g2=null
set g3=null
set l=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(1.,1.5))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=4
//TESH.alwaysfold=0
library ZombieAttackUpdate initializer Init requires GlobalFuncs
//TRIG: PA, Cond: qT, Func: QT
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return DEFEATED==false
endfunction
private function Actions takes nothing returns nothing
local integer i=1
local unit u
local group g=GetUnitsOfPlayerMatching(Player(15),Condition(function IsUnitAlive))
loop
exitwhen i>20
set u=GroupPickRandomUnit(g)
if IsUnitInGroup(u,DarreusConvoy)==false then
call AttackPlayerUnit(u)
endif
call GroupRemoveUnit(g,u)
call PolledWait2(.2)
set i=i+1
endloop
set u=null
call DestroyGroup(g)
set g=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,9)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library NPCManageGroups initializer Init requires GlobalFuncs
//TRIG: --, Cond: --, Func: --
//NEEDS: ...
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local unit u=GetEnteringUnit()
local boolean b=GetOwningPlayer(u)==Player(11)
set u=null
return b
endfunction
private function GroupUnit takes group g, unit u, boolean add returns nothing
if add then
call GroupAddUnit(g,u)
else
call GroupRemoveUnit(g,u)
endif
endfunction
private function Actions takes nothing returns nothing
local unit u=GetEnteringUnit()
local integer id=GetUnitTypeId(u)
local boolean add=true
if u==null then
set u=GetDyingUnit()
set add=false
endif
if id=='h00A' then
call GroupUnit(NPC_FRAG,u,add)
call GroupUnit(NPC_SH,u,add)
endif
if id=='h009' or id=='h01A' or id=='h01D' then
call GroupUnit(NPC_SH,u,add)
endif
if id=='h017' then
call GroupUnit(NPC_CE,u,add)
endif
if id=='h01D' then
call GroupUnit(NPC_Assmen,u,add)
endif
if id=='h01E' then
call GroupUnit(NPC_DM,u,add)
endif
if id=='h01A' then
call GroupUnit(NPC_Ghost,u,add)
endif
if id=='h019' then
call GroupUnit(NPC_NC,u,add)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterEnterRectSimple(T,GetWorldBounds())
call TriggerRegisterPlayerUnitEvent(T,Player(11),EVENT_PLAYER_UNIT_DEATH,null)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=7
//TESH.alwaysfold=0
library NPCSelfHeal initializer Init requires GlobalFuncs
//TRIG: iO, Func: Bj
globals
public trigger T
group NPC_SH=CreateGroup()
endglobals
private function GetLostLife takes unit u returns real
return GetUnitState(u,UNIT_STATE_MAX_LIFE) - GetUnitState(u,UNIT_STATE_LIFE)
endfunction
private function Actions takes nothing returns nothing
local group g=CreateGroup()
local unit u
local integer i=1
call GroupAddGroup(NPC_SH,g)
loop
//call PolledWait2(.2)
set u=FirstOfGroup(g)
exitwhen u==null
if GetLostLife(u)>=25 then
call IssueImmediateOrderById(u,OID_chemicalrage)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set g = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,5)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=5
//TESH.alwaysfold=0
library NPCCombatEngineer initializer Init requires GlobalFuncs
//TRIG: oO, Func: Aj
globals
public trigger T
group NPC_CE=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u = GroupPickRandomUnit(NPC_CE)
local location l
local group g
local unit u2
if u != null then
set l = GetUnitLoc(u)
set g = GetUnitsInRange(2200.,l,Condition(function IsTargetBigEnemyMofo))
set u2 = GroupPickRandomUnit(g)
if u2 != null then
call IssueTargetOrderById(u,OID_ensnare,u2)
endif
endif
set u = null
call RemoveLocation(l)
call DestroyGroup(g)
set u2 = null
set g = null
set l = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(3.2,3.7))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=3
//TESH.alwaysfold=0
library NPCCombatEngineer2 initializer Init requires GlobalFuncs
//TRIG: VO, Func: Fj
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local unit u=GroupPickRandomUnit(NPC_CE)
local location l
local group g2
local unit u2
local location l2
local group g3
local group g4
local unit u3
local location l3
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRange(2200.,l,Condition(function IsUnitAliveAndEnemyWithNPC))
set u2 = FirstOfGroup(g2)
if u2 != null then
set l2 = GetUnitLoc(u2)
set g3 = GetUnitsInRange(575.,l2,Condition(function IsUnitAliveAndEnemyWithNPC))
set g4 = GetUnitsInRange(650.,l2,Condition(function IsUnitAliveAndFriendlyWithNPC))
set u3 = GroupPickRandomUnit(PLAYER_UNITS)
if u3 != null then
set l3 = GetUnitLoc(u3)
if CountUnitsInGroup(g4)==0 and (CountUnitsInGroup(g3)>=4 or DistanceBetweenPoints(l2,l3)<=500.) then
call IssuePointOrderByIdLoc(u,OID_clusterrockets,l2)
endif
endif
endif
endif
call RemoveLocation(l)
call DestroyGroup(g2)
set l = null
set g2 = null
set u = null
call RemoveLocation(l2)
call DestroyGroup(g3)
call DestroyGroup(g4)
set l2 = null
set g3 = null
set g4 = null
set u2 = null
call RemoveLocation(l3)
set l3 = null
set u3 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,3.8)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=8
//TESH.alwaysfold=0
library NPCAssaultman initializer Init requires GlobalFuncs
//TRIG: EO, Func: Gj
globals
public trigger T
group NPC_Assmen=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u=GroupPickRandomUnit(NPC_Assmen)
local location l
local group g
local unit u2
local location l2
if u != null then
set l = GetUnitLoc(u)
set g = GetUnitsInRange(3800.,l,Condition(function IsTargetBigEnemyMofoPUT))
set u2 = GroupPickRandomUnit(g)
if u2 != null then
set l2 = GetUnitLoc(u2)
call IssuePointOrderByIdLoc(u,OID_lavamonster,l2)
endif
endif
call DestroyGroup(g)
call RemoveLocation(l)
set u = null
set l = null
set g = null
call RemoveLocation(l2)
set u2 = null
set l2 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,3.5)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=7
//TESH.alwaysfold=0
library NPCDesignatedMarksman initializer Init requires GlobalFuncs
//TRIG: XO, Func: Hj
globals
public trigger T
group NPC_DM=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u=GroupPickRandomUnit(NPC_DM)
local location l
local group g
local unit u2
local location l2
if u != null then
set l = GetUnitLoc(u)
set g = GetUnitsInRange(4000.,l,Condition(function IsTargetBigEnemyMofoPUT))
set u2 = GroupPickRandomUnit(g)
if u2 != null then
set l2 = GetUnitLoc(u2)
call IssuePointOrderByIdLoc(u,OID_farsight,l2)
endif
endif
call DestroyGroup(g)
call RemoveLocation(l)
set u = null
set l = null
set g = null
call RemoveLocation(l2)
set u2 = null
set l2 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,9)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=8
//TESH.alwaysfold=0
library NPCGhost initializer Init requires GlobalFuncs
//TRIG: OO, Func: Jj
globals
public trigger T
group NPC_Ghost=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u=GroupPickRandomUnit(NPC_Ghost)
local location l
local group g
local unit u2
local location l2
if u != null then
set l = GetUnitLoc(u)
set g = GetUnitsInRange(13000.,l,Condition(function IsTargetBigEnemyMofoPUT))
set u2 = GroupPickRandomUnit(g)
if u2 != null then
set l2 = GetUnitLoc(u2)
call IssuePointOrderByIdLoc(u,OID_flamestrike,l2)
endif
endif
call DestroyGroup(g)
call RemoveLocation(l)
set u = null
set l = null
set g = null
call RemoveLocation(l2)
set u2 = null
set l2 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,8)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library NPCFlamer initializer Init requires GlobalFuncs
//TRIG: aO, Cond: cj, Func: Cj
private function Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit())=='h00V'
endfunction
private function Actions takes nothing returns nothing
call IssueImmediateOrderById(GetTriggerUnit(),OID_battleroar)
endfunction
// Initializer
private function Init takes nothing returns nothing
local trigger T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=29
//TESH.alwaysfold=0
library NPCFrags initializer Init requires GlobalFuncs
//TRIG: nO, Func: fj
//NEEDS: group:ox->PLAYER_UNITS
globals
public trigger T
group NPC_FRAG=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u
local location l
local group g2
local unit u2
local location l2
local group g3
local group g4
local unit u3
local location l3
set u=GroupPickRandomUnit(NPC_FRAG)
if u != null then
set l = GetUnitLoc(u)
set g2 = GetUnitsInRange(2000.,l,Condition(function IsUnitAliveAndEnemyWithNPC))
set u2 = FirstOfGroup(g2)
if u2 != null then
set l2 = GetUnitLoc(u2)
set g3 = GetUnitsInRange(575.,l2,Condition(function IsUnitAliveAndEnemyWithNPC))
set g4 = GetUnitsInRange(950.,l2,Condition(function IsUnitAliveAndFriendlyWithNPC))
// if theres a 4+ cluster, frag it
if CountUnitsInGroup(g4)==0 and CountUnitsInGroup(g3)>=4 then
call IssuePointOrderByIdLoc(u,OID_flamestrike,l2)
elseif GetRandomInt(1,2)==1 then
// otherwise, if there is a player nearby, frag em, teehee!
loop
set u3=FirstOfGroup(g2)
set l3=GetUnitLoc(u3)
exitwhen u3==null or IsUnitType(u3,UNIT_TYPE_HERO)
call RemoveLocation(l3)
call GroupRemoveUnit(g2,u3)
endloop
if u3!=null then
call RemoveLocation(l2)
set l2=l3
call RemoveLocation(l3)
set l3=OffsetLocation(l2,GetRandomReal(-75,75),GetRandomReal(-75,75))
call IssuePointOrderByIdLoc(u,OID_flamestrike,l3)
endif
endif
endif
endif
call RemoveLocation(l3)
call RemoveLocation(l2)
call RemoveLocation(l)
call DestroyGroup(g2)
call DestroyGroup(g3)
call DestroyGroup(g4)
set g2 = null
set g3 = null
set g4 = null
set l=null
set l2=null
set l3=null
set u=null
set u2=null
set u3=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,4)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=2
//TESH.alwaysfold=0
library NPCNavyCorpsman initializer Init requires GlobalFuncs
//TRIG: rO, Func: bj
globals
public trigger T
group NPC_NC=CreateGroup()
endglobals
private function Actions takes nothing returns nothing
local unit u=GroupPickRandomUnit(NPC_NC)
local location l
local group g
local unit u2
call DisableTrigger(T)
//call BJDebugMsg("NPC NC Check 1")
if u != null then
set l = GetUnitLoc(u)
set g = GetUnitsInRange(1400.,l,Condition(function IsUnitAliveAndFriendlyWithNPC))
loop
if GetRandomInt(1,3)==1 then
call PolledWait2(.2)
endif
set u2 = FirstOfGroup(g)
exitwhen u2==null
if GetUnitLifePercent(u2)<=25. or IsUnitDebuffed(u2) then
call IssueTargetOrderById(u,OID_holybolt,u2)
set u2 = null
exitwhen true
endif
if GetUnitLifePercent(u2)<=80. then
call IssueTargetOrderById(u,OID_repair,u2)
set u2 = null
exitwhen true
endif
call GroupRemoveUnit(g,u2)
endloop
endif
//call BJDebugMsg("NPC NC Check 2")
call EnableTrigger(T)
call DestroyGroup(g)
call RemoveLocation(l)
set u = null
set l = null
set g = null
set u2 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterTimerEventPeriodic(T,GetRandomReal(3,3.4))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=43
//TESH.alwaysfold=0
library RunWhenAttacked initializer Init requires GlobalFuncs
//TRIG: xO, Cond: Oj, Func: Rj
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local boolean b
local unit u=GetTriggerUnit()
local unit a=GetAttacker()
local integer utype=GetUnitTypeId(u)
set b=IsPlayerEnemy(GetOwningPlayer(u),GetOwningPlayer(a)) and not IsUnitInGroup(u,BarricadedPolice) and (GAME_MODE!=UA2_ModeUmbrella or GetOwningPlayer(u)!=Player(11)) and utype!='h00G' and utype!='h00B' and utype!='h01S' and not UnitHasBuffBJ(u,'B018')
set u=null
set a=null
return b
endfunction
private function Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit u2 = GetAttacker()
local real x1 = GetUnitX(u)
local real y1 = GetUnitY(u)
local real x2 = GetUnitX(u2)
local real y2 = GetUnitY(u2)
local real angle = AngleBetweenPointsXY(x2,y2,x1,y1)
local real x = x1 + 350 * Cos(angle * bj_DEGTORAD)
local real y = y1 + 350 * Sin(angle * bj_DEGTORAD)
local integer ch1 = GetTerrainCliffLevel(x1,y1)
local integer ch2 = GetTerrainCliffLevel(x,y)
// Original: Run away four times the distance between attacker and attacked
// New: Run away 350u, or jump off cliff
//call IssuePointOrderById(u,OID_move,x+(4*(x1-x2)),y+(4*(y1-y2)))
if ch1 > ch2 or GetUnitAbilityLevel(u,'B002')>=1 then
call UnitAddAbility(u,'JUMD')
call IssuePointOrder(u,"banish",x,y)
elseif ch2 > ch1 then
set x = x1 + 50 * Cos(angle+45 * bj_DEGTORAD)
set y = y1 + 50 * Sin(angle+45 * bj_DEGTORAD)
set ch2 = GetTerrainCliffLevel(x,y)
if ch1 == ch2 then
call IssuePointOrderById(u,OID_move,x,y)
else
set x = x1 + 50 * Cos(angle-45 * bj_DEGTORAD)
set y = y1 + 50 * Sin(angle-45 * bj_DEGTORAD)
set ch2 = GetTerrainCliffLevel(x,y)
if ch1 == ch2 then
call IssuePointOrderById(u,OID_move,x,y)
endif
endif
else
call IssuePointOrderById(u,OID_move,x,y)
endif
if not IsUnitInGroup(u, MINI_SPRINTERS) then
call IssueImmediateOrder(u,"berserk")
endif
set u = null
set u2 = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerUnitEvent(T,Player(11),EVENT_PLAYER_UNIT_ATTACKED,null)
call TriggerRegisterPlayerUnitEvent(T,Player(12),EVENT_PLAYER_UNIT_ATTACKED,null)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandTL initializer Init requires GlobalFuncs
//TRIG: PO, Cond: --, Func: pK
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local force f=CreateForce()
call ForceAddPlayer(f, GetTriggerPlayer())
loop
exitwhen i>11
if (PLAYER_UNIT[i]!=null) and (IsUnitAliveBJ(PLAYER_UNIT[i])) and (IsPlayerAlly(Player(i-1),GetTriggerPlayer())) then
call PingMinimapForForceEx(f,GetUnitX(PLAYER_UNIT[i]),GetUnitY(PLAYER_UNIT[i]),5.,0,83.,36.,9.)
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandMS initializer Init requires GlobalFuncs
//TRIG: QO, Cond: --, Func: sK
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local player p=GetTriggerPlayer()
loop
exitwhen i>11
if (GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING) then
call DisplayTimedTextToPlayer(p,0.,0.,15.,GetPlayerName(Player(i-1))+" MS is |cffFF8000"+I2S(R2I(GetUnitMoveSpeed(PLAYER_UNIT[i]))))
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=8
//TESH.alwaysfold=0
library CommandT initializer Init requires GlobalFuncs
//TRIG: SO, Cond: --, Func: rl
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local player p=GetTriggerPlayer()
local string s
call DisplayTimedTextToPlayer(p,0,0,12.,"|cff008000Experience gained: "+I2S(PLAYER_XP[1+GetPlayerId(p)]-XP_ON_LOAD[1+GetPlayerId(p)]) )
call DisplayTimedTextToPlayer(p,0,0,12.,"|cff008000Experience: "+I2S(PLAYER_XP[1+GetPlayerId(p)]) )
loop
exitwhen i>11
if (GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING)and(GetPlayerController(Player(i-1))==MAP_CONTROL_USER) then
if PLAYER_DIFFCOMP[i]>=5 then
set s=DIFF_NAMES[PLAYER_DIFFCOMP[i]-5] + ",umb"
else
set s=DIFF_NAMES[PLAYER_DIFFCOMP[i]]
endif
if (PLAYER_UNIT[i]==null) then
call DisplayTimedTextToPlayer(p,0,0,12.,(GetPlayerName(Player(i-1))+"|cff0000FF - MOS: Picking"))
elseif IsUnitAliveBJ(PLAYER_UNIT[i]) then
call DisplayTimedTextToPlayer(p,0,0,12.,GetPlayerName(Player(i-1))+" |cff0000FF- " + "MOS: "+GetUnitName(PLAYER_UNIT[i])+" |cff008040at level "+I2S(GetUnitLevel(PLAYER_UNIT[i]))+" |cffFF8000- XP: " + I2S(PLAYER_XP[i]) + " DC: " + s )
else
call DisplayTimedTextToPlayer(p,0,0,12.,GetPlayerName(Player(i-1))+" |cffC0C0C0- " + "MOS: "+GetUnitName(PLAYER_UNIT[i])+" |cff008040at level "+I2S(GetUnitLevel(PLAYER_UNIT[i]))+" |cffFF8000- XP: " + I2S(PLAYER_XP[i]) + " DC: " + s )
endif
endif
set i=i+1
endloop
set p=null
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=2
//TESH.alwaysfold=0
library CommandDEAD initializer Init requires GlobalFuncs
//TRIG: qO, Cond: --, Func: qK
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
local location l
loop
exitwhen i>11
if (PLAYER_UNIT[i]!=null) and (IsUnitDeadBJ(PLAYER_UNIT[i])) then
set l=GetUnitLoc(PLAYER_UNIT[i])
call PingMinimapLocForForceEx(GetForceOfPlayer(GetTriggerPlayer()),l,5.,0,100.,50.,50.)
call RemoveLocation(l)
set l = null
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandST initializer Init requires GlobalFuncs
//TRIG: TO, Cond: --, Func: Vl
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=1
loop
exitwhen i>11
if (GetPlayerSlotState(Player(i-1))==PLAYER_SLOT_STATE_PLAYING) and (GetPlayerController(Player(i-1))==MAP_CONTROL_USER) then
call DisplayTimedTextToForce(GetForceOfPlayer(GetTriggerPlayer()),15.,((GetPlayerName(Player(i-1))+" - ")+(("|cffFF0000Kills: "+I2S(PLAYER_KILLS[i]))+(" |r - |cff0000FFHits: "+I2S(PLAYER_HITS[i])))))
endif
set i=i+1
endloop
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
library CommandR initializer Init requires GlobalFuncs
//TRIG: UO, Cond: Il, Func: Nl
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
return(GetUnitTypeId(PLAYER_UNIT[(1+GetPlayerId(GetTriggerPlayer()))])=='H008')
endfunction
private function Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
local player p=GetTriggerPlayer()
if (s=="-r") then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Shells Per Fire Mission: "+I2S(FM_SHELLS)))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Radius Per Fire Mission: "+I2S(FM_RADIUS)))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Shells Remaining: "+I2S(SHELLS)))
endif
if (S2I(SubStringBJ(s,4,StringLength(s)))<=1000) and (S2I(SubStringBJ(s,4,StringLength(s)))>=150) then
set FM_RADIUS=S2I(SubStringBJ(s,4,StringLength(s)))
call DisplayTimedTextToPlayer(p,0,0,5.,("Radius Per Fire Mission Set To: "+I2S(FM_RADIUS)))
else
call DisplayTimedTextToPlayer(p,0,0,5.,"Input \"-r \" then the desired radius (anywhere from 150 to 1000). Example: -r 400")
endif
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=12
//TESH.alwaysfold=0
library CommandS initializer Init requires GlobalFuncs
//TRIG: uO, Cond: El, Func: Vl
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local string s=GetEventPlayerChatString()
local boolean b=(GetUnitTypeId(PLAYER_UNIT[(1+GetPlayerId(GetTriggerPlayer()))])=='H008') and (s!="-save") and (s!="-st")
set s=null
return b
endfunction
private function Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
local integer shellset=S2I(SubStringBJ(s,4,StringLength(s)))
local player p=GetTriggerPlayer()
if (s=="-s") then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Shells Per Fire Mission: "+I2S(FM_SHELLS)))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Radius Per Fire Mission: "+I2S(FM_RADIUS)))
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,("Shells Remaining: "+I2S(SHELLS)))
endif
if (shellset<=15) and (shellset>=1) then
set FM_SHELLS=shellset
call DisplayTimedTextToPlayer(p,0,0,5.,("Shells Per Fire Mission Set To: "+I2S(FM_SHELLS)))
else
call DisplayTimedTextToPlayer(p,0,0,15.,"Input \"-s \" then the desired number of shells (anywhere from 1 to 15). Example: -s 3")
endif
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=10
//TESH.alwaysfold=0
library CommandC initializer Init requires GlobalFuncs
//TRIG: uO, Cond: El, Func: Vl
globals
public trigger T
endglobals
private function Conditions takes nothing returns boolean
local string s=GetEventPlayerChatString()
local boolean b=(GetUnitTypeId(PLAYER_UNIT[(1+GetPlayerId(GetTriggerPlayer()))])=='H00R') and (s!="-camlock")
set s=null
return b
endfunction
private function Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
local integer chargeset=S2I(SubStringBJ(s,4,StringLength(s)))
local player p=GetTriggerPlayer()
local integer index=GetPlayerId(p)+1
local string s2=( "Charge: "+SubStringBJ(R2S(BFG_Charge[index]),1,1) )
if (s=="-c") then
call DisplayTimedTextToPlayer(p,0,0,8,s2)
endif
if chargeset >= 1 and chargeset <= 4 then
set BFG_Charge[index]=chargeset
if chargeset>1 and GetUnitAbilityLevel(PLAYER_UNIT[index],'A07T')>0 then
//call UnitRemoveAbility(PLAYER_UNIT[index],'A07T')
//call UnitAddAbility(PLAYER_UNIT[index],'A07S')
elseif chargeset==1 and GetUnitAbilityLevel(PLAYER_UNIT[index],'A07S')>0 then
//call UnitRemoveAbility(PLAYER_UNIT[index],'A07S')
//call UnitAddAbility(PLAYER_UNIT[index],'A07T')
endif
call DisplayTimedTextToPlayer(p,0,0,3,("Charge set to: "+R2S(BFG_Charge[index])))
else
call DisplayTimedTextToPlayer(p,0,0,8,"Input \"-c \" then the charge (1-4).")
endif
set s=null
set s2=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandV initializer Init requires GlobalFuncs
//TRIG: tO, Cond: il, Func: al
globals
public trigger T
real array Player_ViewDist
endglobals
private function Conditions takes nothing returns boolean
return(SubStringBJ(GetEventPlayerChatString(),1,3)=="-v ")
endfunction
private function Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
set Player_ViewDist[GetPlayerId(GetTriggerPlayer())]=S2R( SubStringBJ( s,4,StringLength(s) ) )
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,(S2R(SubStringBJ(s,4,StringLength(s)))*100.),.5)
set s=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local integer i=0
set T = CreateTrigger()
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
loop
exitwhen i>10
set Player_ViewDist[i]=22
set i=i+1
endloop
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandNVG initializer Init requires GlobalFuncs
//TRIG: rI, Cond: --, Func: Ep
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=(1+GetPlayerId(GetTriggerPlayer()))
local unit u=PLAYER_UNIT[i]
if PLAYER_HAS_NVG[i]==false then
//call ModifyHeroStat(0,u,0,1)
call ModifyHeroStat(1,u,0,5)
call ShowNightVision(GetOwningPlayer(u),true)
set PLAYER_HAS_NVG[i]=true
call PlaySoundAtUnitLoc(SOUND_NVG_ON,u)
else
//call ModifyHeroStat(0,u,1,1)
call ModifyHeroStat(1,u,1,5)
call ShowNightVision(GetOwningPlayer(u),false)
set PLAYER_HAS_NVG[i]=false
call PlaySoundAtUnitLoc(SOUND_NVG_OFF,u)
endif
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call DisableTrigger(T)
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=7
//TESH.alwaysfold=0
library CommandRifle initializer Init requires GlobalFuncs
//TRIG: jO, Cond: vK, Func: xK
globals
private trigger T
endglobals
private function Conditions takes nothing returns boolean
return CAN_SELECT_EXTRA_MODE
endfunction
private function SetRifleMode takes nothing returns nothing
call SetPlayerHandicapXPBJ(GetEnumPlayer(),(50.+(I2R(PLAYING_PLAYERS)*1.55)))
call SetPlayerAbilityAvailableBJ(true,'A06B',GetEnumPlayer())
endfunction
private function Actions takes nothing returns nothing
call DisableTrigger(T)
set MODE_RIFLE_ON=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,("|cffffcc00"+(GetPlayerName(Player(0))+" has chosen rifle mode. You can only pick riflemen and navy corpsmen but get a 15% gain in XP and many other benefits.")))
set QUEST_TITLE = (QUEST_TITLE+" - Rifle")
call QuestSetTitle(MAIN_QUEST,QUEST_TITLE)
set XP_MODIFIER=(XP_MODIFIER+.15)
call ForForce(bj_FORCE_ALL_PLAYERS,function SetRifleMode)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-rifle",true)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
library CommandOutbreak initializer Init requires GlobalFuncs
//TRIG: JO, Cond: oK, Func: aK
globals
private trigger T
endglobals
private function Conditions takes nothing returns boolean
return CAN_SELECT_EXTRA_MODE and (GAME_MODE!=UA2_ModeRecruit) and (GAME_MODE!=UA2_ModeUmbrella)
endfunction
private function SetOutbreakMode takes nothing returns nothing
if (MODE_RIFLE_ON==false) then
call SetPlayerHandicapXPBJ(GetEnumPlayer(),47.)
endif
endfunction
private function Actions takes nothing returns nothing
call DisableTrigger(T)
set MODE_OUTBREAK_ON=true
set QUEST_TITLE = (QUEST_TITLE+" - Outbreak")
call QuestSetTitle(MAIN_QUEST,QUEST_TITLE)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,8.,("|cffffcc00"+(GetPlayerName(Player(0))+" has chosen outbreak mode. 30% loss in XP gain but mostly basic zombies spawn.")))
set XP_MODIFIER=(XP_MODIFIER*.7)
call ForForce(bj_FORCE_ALL_PLAYERS,function SetOutbreakMode)
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerRegisterPlayerChatEvent(T,Player(0),"-outbreak",true)
call TriggerAddCondition(T,Condition(function Conditions))
call TriggerAddAction(T,function Actions)
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandKick initializer Init requires GlobalFuncs
//TRIG: sO, Cond: --, Func: vl
globals
public trigger T
private string array kickColors
endglobals
private function Actions takes nothing returns nothing
local string s = SubString(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString()))
local integer i = 0
loop
exitwhen i>10
if (s==kickColors[i]) then
call KillUnit(PLAYER_UNIT[i+1])
call CustomDefeatBJ(Player(i),"Kicked")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,GetPlayerName(Player(i))+" has been kicked by "+GetPlayerName(HOST))
exitwhen true
endif
set i = i + 1
endloop
set s = null
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
set kickColors[0]= "red"
set kickColors[1]= "blue"
set kickColors[2]= "teal"
set kickColors[3]= "purple"
set kickColors[4]= "yellow"
set kickColors[5]= "orange"
set kickColors[6]= "green"
set kickColors[7]= "pink"
set kickColors[8]= "gray"
set kickColors[9]= "light blue"
set kickColors[10]="dark green"
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandCAMLOCK initializer Init requires GlobalFuncs
//TRIG: qO, Cond: --, Func: qK
globals
public trigger T
boolean array Player_Camlocked
endglobals
private function Actions takes nothing returns nothing
local group g=GetUnitsSelectedAll(GetTriggerPlayer())
local unit u=FirstOfGroup(g)
local integer i=GetPlayerId(GetTriggerPlayer())
if Player_Camlocked[i] then
call ResetToGameCameraForPlayer(GetTriggerPlayer(), 1)
call SetCameraFieldForPlayer(GetTriggerPlayer(),CAMERA_FIELD_TARGET_DISTANCE,Player_ViewDist[i]*100.,1)
set Player_Camlocked[i]=false
elseif IsPlayerAlly(GetTriggerPlayer(), GetOwningPlayer(u)) and (u==PLAYER_UNIT[i+1] or IsUnitDeadBJ(PLAYER_UNIT[i+1])) then
call SetCameraTargetControllerNoZForPlayer(GetTriggerPlayer(), u, 0,0, false)
set Player_Camlocked[i]=true
endif
call DestroyGroup(g)
set u=null
endfunction
// Initializer
private function Init takes nothing returns nothing
local integer i=0
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
loop
exitwhen i>10
set Player_Camlocked[i]=false
set i=i+1
endloop
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library CommandUIC initializer Init requires GlobalFuncs
//TRIG: qO, Cond: --, Func: qK
globals
public trigger T
endglobals
private function Actions takes nothing returns nothing
local integer i=GetPlayerId(GetTriggerPlayer())+1
if UICancel[i] then
set UICancel[i]=false
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,4,"UI cancel off.")
else
set UICancel[i]=true
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,4,"UI cancel on.")
endif
endfunction
// Initializer
private function Init takes nothing returns nothing
set T = CreateTrigger()
call TriggerAddAction(T,function Actions)
endfunction
endlibrary