Name | Type | is_array | initial_value |
CapitalShips | unit | Yes | |
CouncilPlayers | force | No | |
CouncilPoints | integer | No | 10 |
Dummy | unit | No | |
DummyGroup | group | No | |
DummyPoint | location | No | |
DummyTargetPoint | location | No | |
Forfeit | integer | Yes | |
HammerSlow | unit | Yes | |
HeroKills | integer | Yes | |
Leaderboard | leaderboard | No | |
Location | location | No | |
Multiboard | multiboard | No | |
OldOnesPlayers | force | No | |
OldOnesPoints | integer | No | 10 |
PlayerColor | string | Yes | |
PlayerStrings | string | Yes | |
PointDifference | real | No | |
rBoats | rect | Yes | |
RealCouncil | real | No | 10.00 |
RealOldOnes | real | No | 10.00 |
ShareDisabled | integer | Yes | |
SinglePlayerQuest | quest | No | |
SpawnReal | real | No | 5.00 |
SpawnSize | integer | No | |
SpawnTime | real | No | 120.00 |
SpawnTimer | timer | No | |
TempGroup | group | No | |
TempLoc | rect | No | |
TempPoint | location | No | |
TempString | string | No | |
Teston | integer | No | |
TimeElapsedMinutes | integer | No | |
TimeElapsedSeconds | integer | No | |
UnitKills | integer | Yes | |
uRollingThunder | unit | No |
globals
hashtable BoatTable = InitHashtable()
boolean TowerPermaDeath = false
integer PlayerCount = 14
force MsgPlayers = CreateForce()
integer ComparedPlayer = 0
string EventHeroName = ""
string EventHeroTitle = ""
string array ColorNames
string array FactionNames
string array ColorCodes
string array PlayerNames
integer array HealerType
group array HealerGroup
unit array ArmyCommand[13]
integer BlackfyreLvl = 3
unit array DepotOwner[3]
//Sovereign Eclipse
integer sov = 0
//Evil Ruler
unit EvilRulerTarget = null
effect EvilRulerEffect = null
//QuelDorash
boolean QuelDorashOn = false
//Erebos God of Mists Tracker
integer iBlueHeroes = 4
//Dummies
unit Dummy
unit array PDummy[24]
constant real DummyX = 23848
constant real DummyY = 28700
//Vulcanus
timer VulcanusTimer
timerdialog VulcanusTimerDialog
//Moonstride
group Moonstriders = CreateGroup()
hashtable MoonstrideTable = InitHashtable()
//Leaping Strike
group LeapingStrikers = CreateGroup()
hashtable LeapingStrikeTable = InitHashtable()
//Executioners Verdict
group Executioner = CreateGroup()
hashtable ExecutionerTable = InitHashtable()
//Sinister Strike
group SinisterStrikers = CreateGroup()
hashtable SinisterStrikeTable = InitHashtable()
real SinisterX
real SinisterY
//Stargazer's Shield
unit ShieldedUnit
//Celestial Convergence
integer CelestialInt
integer CelestialConvergeInt
//Arcane Fracture
unit ward
endglobals
library StunSystem
function UnitAddStun takes unit whichUnit, real stunTimer returns nothing
local unit u = whichUnit
call SetUnitX(Dummy, GetUnitX(u))
call SetUnitY(Dummy, GetUnitY(u))
call BlzSetAbilityRealLevelField( BlzGetUnitAbility(Dummy, 'A0JJ'), ABILITY_RLF_DURATION_NORMAL, 0, stunTimer )
call BlzSetAbilityRealLevelField( BlzGetUnitAbility(Dummy, 'A0JJ'), ABILITY_RLF_DURATION_HERO, 0, stunTimer )
call IssueTargetOrder( Dummy, "thunderbolt", u )
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
endfunction
function SlamTrigger takes unit slamCaster, integer spellID, integer spellLvl, real damage, real radius, real x, real y, integer dmgCap returns nothing
local group g = CreateGroup()
local unit slamTarget
local unit caster = slamCaster
local real actualDamage = damage
local integer ctr = 0
local integer lim
//local unit Dummy = gg_unit_e000_0520
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
//argument (unit whichUnit, player whichPlayer, boolean changeColor)
call SetUnitOwner(Dummy, GetOwningPlayer(caster), false)
call UnitAddAbility(Dummy, spellID)
call SetUnitAbilityLevel(Dummy, spellID, spellLvl)
call IssuePointOrder(Dummy, "silence", x, y)
call UnitRemoveAbility(Dummy, spellID)
call SetUnitOwner(Dummy, Player(PLAYER_NEUTRAL_PASSIVE), false)
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
//add units within radius of map coordinates x,y who match filter to whichGroup. A null as filter means that every nearby unit is added to group.
//native GroupEnumUnitsInRange takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
call GroupEnumUnitsInRange(g, x, y, radius, null)
//native BlzGroupGetSize takes group whichGroup returns integer
//returns the size (length) of whichGroup. The size refers to game's internal representation of group data (array), whichGroup's last index =size - 1
set lim = BlzGroupGetSize(g)
if (lim > dmgCap) then
set actualDamage = damage * dmgCap / lim
endif
loop
exitwhen ctr == lim
//native BlzGroupUnitAt takes group whichGroup, integer index returns unit
//returns unit at the index in whichGroup. Groups start at index 0. If the unit was removed form the game or index is out of bounds, returns null.
set slamTarget = BlzGroupUnitAt(g, ctr)
if IsUnitEnemy(slamTarget, GetOwningPlayer(caster) ) then
if (IsUnitType(slamTarget, UNIT_TYPE_STRUCTURE) == false) then
//native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
call UnitDamageTarget(caster, slamTarget, actualDamage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
endif
endif
set ctr = ctr +1
endloop
call DestroyGroup(g)
set g = null
set slamTarget = null
set caster = null
endfunction
//"integer lvl" deprecated. remove it when time.
function StompTrigger takes unit caster, integer lvl, real heroDuration, real unitDuration, real damage, real radius, real x, real y, integer dmgCap returns nothing
local group g = CreateGroup()
local unit stompTarget
local real actualDamage = damage
local integer ctr = 0
local integer lim
call GroupEnumUnitsInRange(g, x, y, radius, null)
set lim = BlzGroupGetSize(g)
if (lim > dmgCap) then
set actualDamage = damage * dmgCap / lim
endif
loop
exitwhen ctr == lim
set stompTarget = BlzGroupUnitAt(g, ctr)
if IsUnitEnemy(stompTarget, GetOwningPlayer(caster) ) then
if (IsUnitType(stompTarget, UNIT_TYPE_STRUCTURE) == false and IsUnitType(stompTarget, UNIT_TYPE_MAGIC_IMMUNE) == false) then
call UnitDamageTarget(caster, stompTarget, actualDamage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
if ( IsUnitType(stompTarget, UNIT_TYPE_HERO) or IsUnitType(stompTarget, UNIT_TYPE_RESISTANT) ) then
call UnitAddStun(stompTarget , heroDuration)
else
call UnitAddStun(stompTarget , unitDuration)
endif
endif
endif
set ctr = ctr + 1
endloop
call DestroyGroup(g)
set g = null
set stompTarget = null
endfunction
endlibrary
library FoodLimit
// Why is this needed? FOOD_CAP goes above the (game constant) food cap if the amount of food provided by buildings
// exceed said game constant, leading to too many units
// FOOD_MAX on the other hand only looks at the game constant, so you spawn too much if you have few bases left etc.
// So goal is to make it strictly follow the food cap as shown in-game
globals
constant integer FoodLim = 80
endglobals
function FoodLimitCheck takes integer i returns boolean
local integer pFood = GetPlayerState(Player(i - 1), PLAYER_STATE_RESOURCE_FOOD_USED)
local integer pCap = GetPlayerState(Player(i - 1), PLAYER_STATE_RESOURCE_FOOD_CAP)
return ( pFood < FoodLim and pFood < pCap )
endfunction
endlibrary
library stuff
function GroupAddUnits takes player whichPlayer, integer unitId, integer unitAmount, group whichGroup, real x, real y returns nothing
local integer ctr = 0
loop
exitwhen ctr == unitAmount
if (whichGroup != null) then
call GroupAddUnit(whichGroup, CreateUnit(whichPlayer, unitId, x, y, bj_UNIT_FACING) )
else
call CreateUnit(whichPlayer, unitId, x, y, bj_UNIT_FACING)
endif
set ctr = ctr + 1
endloop
endfunction
function MakeItemsDroppableEnum takes nothing returns nothing
//Can use this IFENDIF to make items not droppable in future, example is carstein ring in warhammer
//if ( GetItemTypeId(GetEnumItem()) != 'I00H' ) then
call SetItemDroppable(GetEnumItem(), true)
//endif
endfunction
function MakeItemsDroppable takes unit whichUnit returns nothing
local unit u = whichUnit
local rect r = Rect(GetUnitX(u) - 64, GetUnitY(u) - 64, GetUnitX(u) + 64, GetUnitY(u) + 64)
call EnumItemsInRect(r, null, function MakeItemsDroppableEnum)
call RemoveRect(r)
set u = null
set r = null
endfunction
function BoardTrain takes unit caster, unit destination, integer playerId, integer spellId returns nothing
local real x = GetUnitX(caster)
local real x2 = GetUnitX(destination)
local real y = GetUnitY(caster)
local real y2 = GetUnitY(destination)
call SetUnitX(PDummy[playerId], x2)
call SetUnitY(PDummy[playerId], y2)
call UnitAddAbility(PDummy[playerId], spellId)
call IssuePointOrder(PDummy[playerId], "darksummoning", x, y)
call SetUnitX(PDummy[playerId], DummyX)
call SetUnitY(PDummy[playerId], DummyY)
call UnitRemoveAbility(PDummy[playerId], spellId)
endfunction
function PDummyPointOrder takes integer pNum, integer spellId, integer spellLvl, string order, integer orderId, real x, real y returns nothing
//Leave "order" as null to call by orderId
call SetUnitX(PDummy[pNum], x)
call SetUnitY(PDummy[pNum], y)
call UnitAddAbility(PDummy[pNum], spellId)
call SetUnitAbilityLevel(PDummy[pNum], spellId, spellLvl)
if ( not (order == null) ) then
call IssuePointOrder(PDummy[pNum], order, x, y)
else
call IssuePointOrderById(PDummy[pNum], orderId, x, y)
endif
call UnitRemoveAbility(PDummy[pNum], spellId)
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
endfunction
function PDummyPointOrderEx takes integer pNum, integer spellId, integer spellLvl, string order, integer orderId, real fromX, real fromY, real toX, real toY returns nothing
//Leave "order" as null to call by orderId
call SetUnitX(PDummy[pNum], fromX)
call SetUnitY(PDummy[pNum], fromY)
call UnitAddAbility(PDummy[pNum], spellId)
call SetUnitAbilityLevel(PDummy[pNum], spellId, spellLvl)
if ( not (order == null) ) then
call IssuePointOrder(PDummy[pNum], order, toX, toY)
else
call IssuePointOrderById(PDummy[pNum], orderId, toX, toY)
endif
call UnitRemoveAbility(PDummy[pNum], spellId)
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
endfunction
function PDummyImmediateOrder takes integer pNum, integer spellId, integer spellLvl, string order, integer orderId, real x, real y returns nothing
//Leave "order" as null to call by orderId
call SetUnitX(PDummy[pNum], x)
call SetUnitY(PDummy[pNum], y)
call UnitAddAbility(PDummy[pNum], spellId)
call SetUnitAbilityLevel(PDummy[pNum], spellId, spellLvl)
if ( order != null ) then
call IssueImmediateOrder(PDummy[pNum], order)
else
call IssueImmediateOrderById(PDummy[pNum], orderId)
endif
call UnitRemoveAbility(PDummy[pNum], spellId)
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
endfunction
function PDummyTargetOrder takes integer pNum, integer spellId, integer spellLvl, string order, integer orderId, unit target, real x, real y returns nothing
//Leave "order" as null to call by orderId
call SetUnitX(PDummy[pNum], x)
call SetUnitY(PDummy[pNum], y)
call UnitAddAbility(PDummy[pNum], spellId)
call SetUnitAbilityLevel(PDummy[pNum], spellId, spellLvl)
if ( not (order == null) ) then
call IssueTargetOrder(PDummy[pNum], order, target)
else
call IssueTargetOrderById(PDummy[pNum], orderId, target)
endif
call UnitRemoveAbility(PDummy[pNum], spellId)
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
endfunction
function ActivateEventBase takes unit base, player baseRecipient, location loc, boolean changeColor returns nothing
local integer pNum = GetPlayerId(baseRecipient)
call SetUnitOwner(base, baseRecipient, changeColor)
if ( loc != null ) then
call SetUnitPositionLoc(base, loc)
endif
if (IsPlayerInForce(baseRecipient, udg_CouncilPlayers)) then
set CouncilSpawnCount = CouncilSpawnCount + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 17, 2))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 17, 2), I2S(R2I(CouncilSpawnCount)) )
else
set OldOnesSpawnCount = OldOnesSpawnCount + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 16, 2))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 16, 2), I2S(R2I(OldOnesSpawnCount)) )
endif
call SetUnitInvulnerable(base, false)
call GroupAddUnit(Spawns[pNum], base)
endfunction
function ActivateEventHero takes unit hero, player heroRecipient, real x, real y, integer lvl, boolean changeColor returns nothing
local location l = Location(x, y)
local group g
local unit u
set u = hero
set EventHeroName = GetHeroProperName(u)
set EventHeroTitle = GetUnitName(u)
call SetHeroLevel(u, lvl, false)
call SetUnitOwner(u, heroRecipient, true)
call SetUnitPositionLoc(u, l)
call UnitUseItem(u, UnitAddItemById(u, 'pdi2'))
call UnitRemoveAbility(u, 'A000')
call UnitAddItemToSlotById(u, 'stwp', 1)
//Attempt to fix the neutral colored hero glow
call UnitAddAbility(u, 'A000')
call RemoveLocation(l)
set l = null
set u = null
set g = null
endfunction
function GetPlayerHeroCount takes player p returns integer
local unit u
local group g = CreateGroup()
local integer index = 0
local integer lim
local integer result = 0
call GroupEnumUnitsOfPlayer(g, p, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen index == lim
set u = BlzGroupUnitAt(g, index)
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
//Needs to count dead heroes, otherwise this fails to reincarnate effects.
set result = result + 1
endif
set index = index + 1
endloop
call DestroyGroup(g)
set g = null
set u = null
return result
endfunction
endlibrary
library voting
function Join_Expires takes nothing returns nothing
call PauseTimer( JoinTimer )
if ( Votes >= VotesNeeded) then
call TriggerExecute(gg_trg_Join_Successful)
else
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 20.00, GetPlayerName(JoiningPlayer) + " did not receive enough votes to join." )
endif
call EnableTrigger( gg_trg_Initiate_Join )
call EnableTrigger( gg_trg_Initiate_Vote_Kick )
call BlzFrameSetVisible(VoteBackdrop, false)
endfunction
function Votekick_Expires takes nothing returns nothing
call PauseTimer( KickTimer )
if ( Votes >= VotesNeeded) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, GetPlayerName(PlayerBeingKicked) + " has been kicked!" )
call ShareEverythingWithTeam( PlayerBeingKicked )
call CustomDefeatBJ( PlayerBeingKicked, "You have been votekicked" )
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, GetPlayerName(PlayerBeingKicked) + " did not receive enough votes to be kicked." )
endif
call EnableTrigger( gg_trg_Initiate_Join )
call EnableTrigger( gg_trg_Initiate_Vote_Kick )
call BlzFrameSetVisible(VoteBackdrop, false)
endfunction
function VoteButtonPressed takes nothing returns nothing
local framehandle f = BlzGetTriggerFrame()
local integer i = GetPlayerId(GetTriggerPlayer())
call BlzFrameSetEnable(f, false)
call BlzFrameSetEnable(f, true)
if ( f == YesButton ) then
//0 = Observer Join
//1 = Votekick
if ( TypeOfVote == 0 ) then
set Votes = Votes + 1
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 10.00, PlayerNames[GetPlayerId(GetTriggerPlayer())] + " has voted to let " + GetPlayerName(JoiningPlayer) + " join. " + I2S(Votes) + "/" + I2S(VotesNeeded) + "." )
if ( Votes == VotesNeeded ) then
call Join_Expires()
endif
elseif ( TypeOfVote == 1 ) then
set Votes = Votes + 1
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, PlayerNames[GetPlayerId(GetTriggerPlayer())] + " has voted to kick " + GetPlayerName(PlayerBeingKicked) + ". " + I2S(Votes) + "/" + I2S(VotesNeeded) )
if ( Votes == VotesNeeded ) then
call Votekick_Expires()
endif
endif
endif
if ( GetLocalPlayer() == GetTriggerPlayer() ) then
call BlzFrameSetVisible(VoteBackdrop, false)
endif
set f = null
endfunction
endlibrary
function BoatAbilitySetup takes unit boat, unit destinationBoat, string deathMessage returns nothing
local timer t = CreateTimer()
call TriggerRegisterUnitEvent(gg_trg_Boat_Transfers, boat, EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(gg_trg_Boat_Trigger, boat, EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(gg_trg_Boat_Death, boat, EVENT_UNIT_DEATH)
if ( destinationBoat != null ) then
call SaveUnitHandle(BoatTable, GetHandleId(boat), 0, destinationBoat)
endif
call SaveTimerHandle(BoatTable, GetHandleId(boat), 1, t)
if ( deathMessage != null ) then
call SaveStr(BoatTable, GetHandleId(boat), 2, deathMessage)
endif
call SaveUnitHandle(BoatTable, GetHandleId(t), 0, boat)
set t = null
endfunction
function Trig_Boat_Setup_Actions takes nothing returns nothing
call SaveInteger(BoatTable, 'h0GY', 0, 'A0HD')
//Valskar
//Barak Varr to Karak Azgal
call BoatAbilitySetup(gg_unit_h0GY_0038, gg_unit_h0GY_0025, null)
call BoatAbilitySetup(gg_unit_h0GY_0025, gg_unit_h0GY_0038, null)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Boat_Setup takes nothing returns nothing
set gg_trg_Boat_Setup = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Boat_Setup, 0.50, false )
call TriggerAddAction( gg_trg_Boat_Setup, function Trig_Boat_Setup_Actions )
endfunction
function Trig_Boat_Trigger_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A0HD' )
endfunction
function Trig_Boat_Trigger_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit destination
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local real x2
local real y2
local unit dummy
if GetTriggerUnit() == gg_unit_h0GY_0025 then
set destination = gg_unit_h0GY_0038
if GetWidgetLife(destination) > 0.405 then
call DestroyEffect(AddSpecialEffect("MassTeleportCaster.mdl", x, y))
set x2 = GetUnitX(destination)
set y2 = GetUnitY(destination)
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x2, y2, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 6.00)
call UnitAddAbility(dummy, 'A126')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetUnitLoc(caster) )
endif
endif
if GetTriggerUnit() == gg_unit_h0GY_0038 then
set destination = gg_unit_h0GY_0025
if GetWidgetLife(destination) > 0.405 then
call DestroyEffect(AddSpecialEffect("MassTeleportCaster.mdl", x, y))
set x2 = GetUnitX(destination)
set y2 = GetUnitY(destination)
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x2, y2, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 6.00)
call UnitAddAbility(dummy, 'A126')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetUnitLoc(caster) )
endif
endif
set caster = null
set destination = null
endfunction
//===========================================================================
function InitTrig_Boat_Trigger takes nothing returns nothing
set gg_trg_Boat_Trigger = CreateTrigger( )
call TriggerAddCondition( gg_trg_Boat_Trigger, Condition( function Trig_Boat_Trigger_Conditions ) )
call TriggerAddAction( gg_trg_Boat_Trigger, function Trig_Boat_Trigger_Actions )
endfunction
function Trig_Boat_Transfers_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A06C'
endfunction
function Trig_Boat_Transfers_Actions takes nothing returns nothing
call SetUnitOwner( GetTriggerUnit(), GetOwningPlayer(GetSpellTargetUnit()), true )
endfunction
//===========================================================================
function InitTrig_Boat_Transfers takes nothing returns nothing
set gg_trg_Boat_Transfers = CreateTrigger( )
call TriggerAddCondition( gg_trg_Boat_Transfers, Condition( function Trig_Boat_Transfers_Conditions ) )
call TriggerAddAction( gg_trg_Boat_Transfers, function Trig_Boat_Transfers_Actions )
endfunction
function Trig_Boat_Death_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit otherBoat = LoadUnitHandle(BoatTable, GetHandleId(u), 0)
local timer t = LoadTimerHandle(BoatTable, GetHandleId(u), 1)
local string s = null
//Cleanup for other boat will resolve in its own death trigger
if ( HaveSavedString(BoatTable, GetHandleId(u), 2) ) then
set s = LoadStr(BoatTable, GetHandleId(u), 2)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, s)
endif
call KillUnit(otherBoat)
call FlushChildHashtable( BoatTable, GetHandleId(u) )
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(BoatTable, GetHandleId(t))
set u = null
set otherBoat = null
set s = null
endfunction
//===========================================================================
function InitTrig_Boat_Death takes nothing returns nothing
set gg_trg_Boat_Death = CreateTrigger( )
call TriggerAddAction( gg_trg_Boat_Death, function Trig_Boat_Death_Actions )
endfunction
function Trig_Handle_Checker_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_HandleCounter )
endfunction
//===========================================================================
function InitTrig_Handle_Checker takes nothing returns nothing
set gg_trg_Handle_Checker = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(0), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(1), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(2), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(3), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(4), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(5), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(6), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(7), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(8), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(9), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(10), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(11), "-handlecheck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Handle_Checker, Player(12), "-handlecheck", true )
call TriggerAddAction( gg_trg_Handle_Checker, function Trig_Handle_Checker_Actions )
endfunction
function Trig_HandleCounter_Actions takes nothing returns nothing
local location L = Location(0,0)
call BJDebugMsg(I2S(GetHandleId(L)-0x100000))
call RemoveLocation(L)
set L = null
endfunction
//===========================================================================
function InitTrig_HandleCounter takes nothing returns nothing
set gg_trg_HandleCounter = CreateTrigger( )
call DisableTrigger( gg_trg_HandleCounter )
call TriggerRegisterTimerEventPeriodic( gg_trg_HandleCounter, 0.09 )
call TriggerAddAction( gg_trg_HandleCounter, function Trig_HandleCounter_Actions )
endfunction
function Trig_Debug_Actions takes nothing returns nothing
call BJDebugMsg("|cffffcc00"+GetUnitName(GetTriggerUnit())+"|r - |cffffcc00order id:|r "+I2S(GetIssuedOrderId())+" - |cffffcc00order string:|r "+OrderId2String(GetIssuedOrderId())+" - |cffffcc00order string:|r "+OrderId2String(GetSpellAbilityId()))
endfunction
//===========================================================================
function InitTrig_Debug takes nothing returns nothing
set gg_trg_Debug = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Debug, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Debug, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Debug, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddAction( gg_trg_Debug, function Trig_Debug_Actions )
endfunction
function Trig_Escape_Key_Spawn_Select_Actions takes nothing returns nothing
call TriggerExecute( gg_trg_Select_Spawns )
endfunction
//===========================================================================
function InitTrig_Escape_Key_Spawn_Select takes nothing returns nothing
set gg_trg_Escape_Key_Spawn_Select = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(0) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(1) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(2) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(3) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(4) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(5) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(6) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(7) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(8) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(9) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(10) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(11) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(12) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(13) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(20) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Escape_Key_Spawn_Select, Player(21) )
call TriggerAddAction( gg_trg_Escape_Key_Spawn_Select, function Trig_Escape_Key_Spawn_Select_Actions )
endfunction
globals
integer array EscHotkeyEnabled
endglobals
function Trig_Escape_Hotkey_Conditions takes nothing returns boolean
return SubString(GetEventPlayerChatString(), 0, 4) == "-esc"
endfunction
function Trig_Escape_Hotkey_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetTriggerPlayer())
set EscHotkeyEnabled[pNum] = EscHotkeyEnabled[pNum] + 1
if ( EscHotkeyEnabled[pNum] == 1 ) then
call BlzTriggerRegisterPlayerKeyEvent(ArmySelectTrigger, Player(pNum), OSKEY_ESCAPE, 0, false)
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "Hotkey registered")
endif
endfunction
//===========================================================================
function InitTrig_Escape_Hotkey takes nothing returns nothing
local integer i = 0
loop
exitwhen i == 24
set EscHotkeyEnabled[i] = 0
set i = i + 1
if ( i == 14 ) then
set i = 20
endif
endloop
set gg_trg_Escape_Hotkey = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(0), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(1), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(2), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(3), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(4), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(5), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(6), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(7), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(8), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(9), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(10), "-esc", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, Player(11), "-esc", true )
call TriggerAddCondition( gg_trg_Escape_Hotkey, Condition( function Trig_Escape_Hotkey_Conditions ) )
call TriggerAddAction( gg_trg_Escape_Hotkey, function Trig_Escape_Hotkey_Actions )
endfunction
function SelectSpawns takes integer spawnId, player selectingPlayer, boolean doPings returns nothing
local integer pNum = spawnId
local unit u
local real x
local real y
local integer i = 0
local integer j
if (GetLocalPlayer() == selectingPlayer) then
call ClearSelection()
call SelectUnit(ArmyCommand[pNum], true)
endif
set j = BlzGroupGetSize(Spawns[pNum])
loop
exitwhen i == j
set u = BlzGroupUnitAt(Spawns[pNum], i)
set x = GetUnitX(u)
set y = GetUnitY(u)
if ( GetLocalPlayer() == selectingPlayer) then
call SelectUnit(u, true)
if ( doPings ) then
call PingMinimap(x, y, 7.50)
endif
endif
set i = i + 1
endloop
set u = null
endfunction
globals
framehandle ArmySelectBackdrop
framehandle ArmySelectButton
trigger ArmySelectTrigger
endglobals
function IdleWorkerReplacementCallback takes nothing returns nothing
local integer pNum = GetPlayerId(GetTriggerPlayer())
local player p = GetTriggerPlayer()
call BlzFrameSetEnable(BlzGetTriggerFrame(), false)
call BlzFrameSetEnable(BlzGetTriggerFrame(), true)
//Obs
if ( pNum >= 20) then
set pNum = ObsHasJoined[pNum - 20] - 1
endif
call SelectSpawns(pNum, p, false)
set p = null
endfunction
function IdleWorkerReplacementInit takes nothing returns nothing
local integer ctr = 0
local framehandle buttonBackdrop = BlzCreateFrame("BNetPopupMenuBackdropTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 1, 0)
local framehandle selectButton = BlzCreateFrame("ScoreScreenBottomButtonTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local framehandle hBar = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BAR, 0)
local framehandle idleWorker = BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_SIMPLE_UI_PARENT, 0), 7)
local framehandle tooltip = BlzCreateFrame("BoxedText", buttonBackdrop, 0, 2)
set ArmySelectTrigger = CreateTrigger()
call BlzFrameSetAllPoints(buttonBackdrop, idleWorker)
call BlzFrameSetAllPoints(selectButton, idleWorker)
call BlzFrameSetSize(buttonBackdrop, 0.2, 0.2)
call BlzFrameSetSize(selectButton, 0.2, 0.2)
call BlzFrameSetTexture(buttonBackdrop, "ReplaceableTextures\\CommandButtons\\BTNHumanWatchTower.blp", 0, true)
call BlzFrameSetTooltip(selectButton, tooltip)
call BlzFrameSetPoint(tooltip, FRAMEPOINT_LEFT, selectButton, FRAMEPOINT_RIGHT, 0.01, 0.01)
call BlzFrameSetSize(tooltip, 0.09, 0.04)
call BlzFrameSetText(BlzGetFrameByName("BoxedTextValue", 2), "Hotkey:|cffffff33 (ESC)|r|n|cffC0C0C0Selects your Army Command|r")
loop
exitwhen ctr == 14
call BlzTriggerRegisterPlayerKeyEvent(ArmySelectTrigger, Player(ctr), OSKEY_OEM_5, 0, false)
//call BlzTriggerRegisterPlayerKeyEvent(CreateFaceClickTrigger(buttonFrame), Player(ctr), OSKEY_F8, 0, false)
set ctr = ctr + 1
endloop
call BlzTriggerRegisterFrameEvent(ArmySelectTrigger, selectButton, FRAMEEVENT_CONTROL_CLICK)
call TriggerAddAction(ArmySelectTrigger, function IdleWorkerReplacementCallback)
set ArmySelectBackdrop = buttonBackdrop
set ArmySelectButton = selectButton
if ( GetPlayerId(GetLocalPlayer()) > 13 ) then
call BlzFrameSetVisible(ArmySelectBackdrop, false)
call BlzFrameSetVisible(ArmySelectButton, false)
endif
set buttonBackdrop = null
set selectButton = null
set hBar = null
set idleWorker = null
set tooltip = null
endfunction
globals
framehandle ObsResourceTransferBackdrop
framehandle ObsResourceTransferButton
endglobals
function ObsLeaverResourceTransfer takes nothing returns nothing
local integer i = GetPlayerId(GetTriggerPlayer()) - 20
local integer gold = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD)
local integer lumber = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER)
local integer leaverGold = GetPlayerState(Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_GOLD)
local integer leaverLumber = GetPlayerState(Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_LUMBER)
call BlzFrameSetEnable(BlzGetTriggerFrame(), false)
call BlzFrameSetEnable(BlzGetTriggerFrame(), true)
if ( GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD ) == 0 ) then
call SetPlayerState( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, gold + leaverGold )
call SetPlayerState( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, lumber + leaverLumber )
call SetPlayerState( Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_GOLD, 0 )
call SetPlayerState( Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_LUMBER, 0 )
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, 5.00, "Taking resources")
else
call SetPlayerState( Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_GOLD, gold + leaverGold )
call SetPlayerState( Player(ObsHasJoined[i] - 1), PLAYER_STATE_RESOURCE_LUMBER, lumber + leaverLumber )
call SetPlayerState( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, 0 )
call SetPlayerState( GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER, 0 )
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, 5.00, "Giving resources")
endif
endfunction
function ObsLeaverResourceTransferInit takes nothing returns nothing
local trigger t = CreateTrigger()
local framehandle transferBackdrop = BlzCreateFrame("BNetPopupMenuBackdropTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 1, 0)
local framehandle transferButton = BlzCreateFrame("ScoreScreenBottomButtonTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local framehandle transferTooltip = BlzCreateFrame("BoxedText", transferBackdrop, 0, 3)
call BlzFrameSetSize(transferBackdrop, 0.0385, 0.0385)
call BlzFrameSetSize(transferButton, 0.0385, 0.0385)
call BlzFrameSetPoint(transferBackdrop, FRAMEPOINT_CENTER, ArmySelectButton, FRAMEPOINT_CENTER, 0.05, 0)
call BlzFrameSetPoint(transferButton, FRAMEPOINT_CENTER, ArmySelectButton, FRAMEPOINT_CENTER, 0.05, 0)
call BlzFrameSetTooltip(transferButton, transferTooltip)
call BlzFrameSetPoint(transferTooltip, FRAMEPOINT_LEFT, transferButton, FRAMEPOINT_RIGHT, 0.01, 0.01)
call BlzFrameSetSize(transferTooltip, 0.13, 0.04)
call BlzFrameSetText(BlzGetFrameByName("BoxedTextValue", 3), "|cffC0C0C0Transfers gold back and forth between you and the leaver you are controlling|r")
call BlzFrameSetTexture(transferBackdrop, "ReplaceableTextures\\CommandButtons\\BTNPickUpItem.blp", 0, true)
set ObsResourceTransferBackdrop = transferBackdrop
set ObsResourceTransferButton = transferButton
call BlzTriggerRegisterFrameEvent(t, ObsResourceTransferButton, FRAMEEVENT_CONTROL_CLICK)
call TriggerAddAction(t, function ObsLeaverResourceTransfer)
call BlzFrameSetVisible(ObsResourceTransferBackdrop, false)
call BlzFrameSetVisible(ObsResourceTransferButton, false)
set t = null
set transferBackdrop = null
set transferButton = null
set transferTooltip = null
endfunction
globals
integer TypeOfVote = -1
integer Votes = 0
integer VotesNeeded = 0
framehandle VoteBackdrop
framehandle VoteBackdropText
framehandle YesButton
framehandle NoButton
framehandle OptionsBackdrop
endglobals
function InitVoteUI takes nothing returns nothing
local trigger t = CreateTrigger()
local framehandle backdrop = BlzCreateFrame("EscMenuBackdrop", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 0, 0)
local framehandle yesButton = BlzCreateFrame("ScriptDialogButton", backdrop, 0, 0)
local framehandle yesText = BlzGetFrameByName("ScriptDialogButtonText", 0)
local framehandle noButton = BlzCreateFrame("ScriptDialogButton", backdrop, 0, 0)
local framehandle noText = BlzGetFrameByName("ScriptDialogButtonText", 0)
local framehandle backdropText = BlzCreateFrameByType("TEXT", "backdropText", backdrop, "", 0)
call BlzFrameSetSize(backdrop, 0.2, 0.11)
call BlzFrameSetPoint(backdrop, FRAMEPOINT_TOP, BlzGetFrameByName("UpperButtonBarMenuButton", 0), FRAMEPOINT_BOTTOM, 0.40, -0.025)
call BlzFrameSetPoint(backdropText, FRAMEPOINT_TOP, backdrop, FRAMEPOINT_TOP, 0, -0.0325)
call BlzFrameSetText(backdropText, "")
call BlzFrameSetSize(yesButton, 0.04, 0.030)
call BlzFrameSetPoint(yesButton, FRAMEPOINT_TOP, backdrop, FRAMEPOINT_TOP, -0.025, -0.045)
call BlzFrameSetText(yesText, "Yes")
call BlzFrameSetSize(noButton, 0.04, 0.030)
call BlzFrameSetPoint(noButton, FRAMEPOINT_TOP, backdrop, FRAMEPOINT_TOP, 0.025, -0.045)
call BlzFrameSetText(noText, "No")
call BlzTriggerRegisterFrameEvent(t, yesButton, FRAMEEVENT_CONTROL_CLICK)
call BlzTriggerRegisterFrameEvent(t, noButton, FRAMEEVENT_CONTROL_CLICK)
call TriggerAddAction(t, function VoteButtonPressed)
call BlzFrameSetVisible(backdrop, false)
call EnableTrigger(gg_trg_Initiate_Join)
call EnableTrigger(gg_trg_Initiate_Vote_Kick)
set VoteBackdrop = backdrop
set VoteBackdropText = backdropText
set YesButton = yesButton
set NoButton = noButton
set t = null
set backdrop = null
set yesButton = null
set yesText = null
set noButton = null
set noText = null
set backdropText = null
endfunction
function Trig_Debug_MB_Actions takes nothing returns nothing
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
endfunction
//===========================================================================
function InitTrig_Debug_MB takes nothing returns nothing
set gg_trg_Debug_MB = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(0), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(1), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(2), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(3), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(4), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(5), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(6), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(7), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(8), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(9), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(10), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(11), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(12), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(13), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(20), "-debug", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug_MB, Player(21), "-debug", true )
call TriggerAddAction( gg_trg_Debug_MB, function Trig_Debug_MB_Actions )
endfunction
function Trig_Clear_Commands_Actions takes nothing returns nothing
local integer number = GetPlayerId(GetTriggerPlayer())
call ClearTextMessagesBJ( bj_FORCE_PLAYER[number] )
endfunction
//===========================================================================
function InitTrig_Clear_Commands takes nothing returns nothing
set gg_trg_Clear_Commands = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(0), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(1), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(2), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(3), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(4), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(5), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(6), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(7), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(8), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(9), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(10), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(11), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(12), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(13), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(20), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear_Commands, Player(21), "-clear", true )
call TriggerAddAction( gg_trg_Clear_Commands, function Trig_Clear_Commands_Actions )
endfunction
globals
integer array ArmyLevel
boolean PauseUnitFlag
hashtable GameInitHashtable = null
endglobals
function GameStartPauseUnitsEnum takes nothing returns nothing
local unit u = GetEnumUnit()
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
if ( PauseUnitFlag ) then
call SaveReal(GameInitHashtable, GetHandleId(u), 0, GetUnitPropWindow(u))
call SetUnitPropWindow(u, 0)
else
call SetUnitPropWindow(u, LoadReal(GameInitHashtable, GetHandleId(u), 0))
call FlushChildHashtable(GameInitHashtable, GetHandleId(u))
endif
else
call BlzPauseUnitEx(u, PauseUnitFlag)
endif
set u = null
endfunction
function GameStartPauseUnits takes boolean pause returns nothing
local integer index = 0
local group g = CreateGroup()
set PauseUnitFlag = pause
if ( GameInitHashtable == null ) then
set GameInitHashtable = InitHashtable()
endif
loop
exitwhen index == 14
call GroupEnumUnitsOfPlayer(g, Player(index), null)
call ForGroup(g, function GameStartPauseUnitsEnum)
call GroupClear(g)
set index = index + 1
endloop
call DestroyGroup(g)
set g = null
endfunction
function Trig_Game_Start_Actions takes nothing returns nothing
local integer ctr = 0
call SetGameSpeed( MAP_SPEED_NORMAL )
call SetMapFlag(MAP_LOCK_SPEED, true)
call SetMapFlag( MAP_LOCK_RESOURCE_TRADING, true )
call SetMapFlag( MAP_LOCK_ALLIANCE_CHANGES, true )
call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, 3000.00, 2.00 )
set ArmyLevel[1] = 'R00D'
set ArmyLevel[2] = 'R00G'
set ArmyLevel[3] = 'R00F'
set ArmyLevel[4] = 'R00E'
set ArmyLevel[5] = 'R00C'
set ArmyLevel[6] = 'R00H'
if (bj_isSinglePlayer == false) then
call GameStartPauseUnits(true)
endif
loop
exitwhen ctr == 14
call SetPlayerHandicap( Player(ctr), 1.00 )
set ctr = ctr + 1
endloop
call SetDoodadAnimation(9847, 16690, 3000, 'D04B', false, "Stand Alternate", false)
call SetDoodadAnimation(-24862, -2147, 3000, 'D01X', false, "Stand Alternate", false)
call SetDoodadAnimation(-19950, -14000, 3000, 'D0EA', false, "Death Alternate", false)
call FogMaskEnableOff( )
call FogEnable(false)
call FogEnable(true)
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Game_Start takes nothing returns nothing
set gg_trg_Game_Start = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Game_Start_2, 0.50, false )
call TriggerAddAction( gg_trg_Game_Start, function Trig_Game_Start_Actions )
endfunction
function GameStartNeutralInvul takes nothing returns nothing
if ( GetOwningPlayer(GetFilterUnit()) == Player(PLAYER_NEUTRAL_PASSIVE) ) then
call SetUnitInvulnerable(GetFilterUnit(), true)
endif
endfunction
function GameStartDestructableEnum takes nothing returns nothing
local destructable d = GetEnumDestructable()
local real x
local real y
call SetDestructableInvulnerable(d, true )
set d = null
endfunction
function SetupPlayerColorNames takes nothing returns nothing
local integer index = 0
set ColorNames[0] = "Red"
set ColorNames[1] = "Blue"
set ColorNames[2] = "Teal"
set ColorNames[3] = "Purple"
set ColorNames[4] = "Yellow"
set ColorNames[5] = "Orange"
set ColorNames[6] = "Green"
set ColorNames[7] = "Pink"
set ColorNames[8] = "Gray"
set ColorNames[9] = "Light Blue"
set ColorNames[10] = "Dark Green"
set ColorNames[11] = "Brown"
set ColorNames[12] = "Maroon"
set ColorNames[13] = "Navy Blue"
set ColorNames[20] = "Black"
set ColorNames[21] = "White"
set ColorCodes[0] = "|cFFFF0303"
set ColorCodes[1] = "|cFF0042FF"
set ColorCodes[2] = "|cFF1CE6B9"
set ColorCodes[3] = "|cFF540081"
set ColorCodes[4] = "|cFFFFFC00"
set ColorCodes[5] = "|cFFFE8A0E"
set ColorCodes[6] = "|cFF20C000"
set ColorCodes[7] = "|cFFE55BB0"
set ColorCodes[8] = "|cFF959697"
set ColorCodes[9] = "|cFF7FBFF1"
set ColorCodes[10] = "|cFF106246"
set ColorCodes[11] = "|cFF492A04"
set ColorCodes[12] = "|cff800000"
set ColorCodes[13] = "|cff000080"
set FactionNames[0] = ColorCodes[0] + "Drakoria|r"
set FactionNames[1] = ColorCodes[1] + "Erebos|r"
set FactionNames[2] = ColorCodes[2] + "Silverleaf|r"
set FactionNames[3] = ColorCodes[3] + "Kethara|r"
set FactionNames[4] = ColorCodes[4] + "Urgraz|r"
set FactionNames[5] = ColorCodes[5] + "Valskar|r"
set FactionNames[6] = ColorCodes[6] + "Ilium|r"
set FactionNames[7] = ColorCodes[7] + "Kingdom of Mu|r"
set FactionNames[8] = ColorCodes[8] + "Auroriya|r"
set FactionNames[9] = ColorCodes[9] + "Avandor|r"
set FactionNames[10] = ColorCodes[10] + "Gromokol|r"
set FactionNames[11] = ColorCodes[11] + "Dwarf City States|r"
set FactionNames[12] = ColorCodes[12] + "Xanthea|r"
set FactionNames[13] = ColorCodes[13] + "Skaldrin|r"
set ArmyCommand[0] = gg_unit_h00G_1280
set ArmyCommand[1] = gg_unit_h00G_0007
set ArmyCommand[2] = gg_unit_h00G_0971
set ArmyCommand[3] = gg_unit_h00G_1281
set ArmyCommand[4] = gg_unit_h00G_0294
set ArmyCommand[5] = gg_unit_h00G_2164
set ArmyCommand[6] = gg_unit_h00G_0719
set ArmyCommand[7] = gg_unit_h00G_1643
set ArmyCommand[8] = gg_unit_h00G_0969
set ArmyCommand[9] = gg_unit_h00G_0970
set ArmyCommand[10] = gg_unit_h00G_0019
set ArmyCommand[11] = gg_unit_h00G_0083
set ArmyCommand[12] = gg_unit_h00G_1644
set ArmyCommand[13] = gg_unit_h00G_2165
//Setup the timing for teal's ultimate hero Lysandor who emerges at the celestial convergence
set CelestialConvergeInt = GetRandomInt(1, 15)
set CelestialInt = 1
//Dwarf Tank Event
call PauseUnit(gg_unit_h04B_0468, true)
//Gromokol and Ilium Great Road Marketplaces
call SetUnitInvulnerable(gg_unit_h0CR_2115, true)
call SetUnitInvulnerable(gg_unit_h0CQ_0062, true)
//Hide Balzathor Void Projection
call SetPlayerAbilityAvailableBJ( false, 'A0S3', Player(12) )
loop
exitwhen index == 13
set PlayerNames[index] = ColorCodes[index] + GetPlayerName(Player(index)) + "|r"
set index = index + 1
endloop
endfunction
function SetupHealers takes nothing returns nothing
//Healers
set HealerType[0] = 'h07I'
set HealerType[1] = 'h03P'
set HealerType[2] = 'h05S'
set HealerType[3] = 'h08F'
set HealerType[4] = 'o00C'
set HealerType[5] = 'h0GQ'
set HealerType[6] = 'h01C'
set HealerType[7] = 'h09M'
set HealerType[8] = 'h066'
set HealerType[9] = 'h06V'
set HealerType[10] = 'h00K'
set HealerType[11] = 'h046'
set HealerType[12] = 'h0A2'
set HealerType[13] = 'h0FP'
set HealerGroup[0] = CreateGroup()
set HealerGroup[1] = CreateGroup()
set HealerGroup[2] = CreateGroup()
set HealerGroup[3] = CreateGroup()
set HealerGroup[4] = CreateGroup()
set HealerGroup[5] = CreateGroup()
set HealerGroup[6] = CreateGroup()
set HealerGroup[7] = CreateGroup()
set HealerGroup[8] = CreateGroup()
set HealerGroup[9] = CreateGroup()
set HealerGroup[10] = CreateGroup()
set HealerGroup[11] = CreateGroup()
set HealerGroup[12] = CreateGroup()
set HealerGroup[13] = CreateGroup()
call GroupAddUnit( HealerGroup[0], gg_unit_h07I_1208 )
call GroupAddUnit( HealerGroup[1], gg_unit_h03P_0212 )
call GroupAddUnit( HealerGroup[2], gg_unit_h05S_0786 )
call GroupAddUnit( HealerGroup[3], gg_unit_h08F_1342 )
call GroupAddUnit( HealerGroup[4], gg_unit_o00C_0172 )
call GroupAddUnit( HealerGroup[5], gg_unit_h0GQ_2167 )
call GroupAddUnit( HealerGroup[6], gg_unit_h01C_0048 )
call GroupAddUnit( HealerGroup[7], gg_unit_h09M_1640 )
call GroupAddUnit( HealerGroup[8], gg_unit_h066_0859 )
call GroupAddUnit( HealerGroup[9], gg_unit_h06V_0961 )
call GroupAddUnit( HealerGroup[10], gg_unit_h00K_0005 )
call GroupAddUnit( HealerGroup[11], gg_unit_h046_1932 )
call GroupAddUnit( HealerGroup[12], gg_unit_h0A2_1639 )
call GroupAddUnit( HealerGroup[13], gg_unit_h0FP_1843 )
endfunction
function Trig_Game_Start_2_Actions takes nothing returns nothing
local integer ctr = 0
local group g = CreateGroup()
local unit u
local framehandle f = BlzGetOriginFrame(ORIGIN_FRAME_UNIT_MSG, 0)
local framehandle hBar = BlzGetOriginFrame(ORIGIN_FRAME_HERO_BAR, 0)
call BlzLoadTOCFile("war3mapImported\\BoxedText.toc")
call BlzFrameClearAllPoints(f)
call BlzFrameSetPoint(f, FRAMEPOINT_BOTTOMLEFT, hBar, FRAMEPOINT_BOTTOMRIGHT, 0.02, 0.0425 )
call BlzFrameSetPoint(f, FRAMEPOINT_TOPRIGHT, hBar, FRAMEPOINT_TOPLEFT, 0.475, -0.09 )
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "Welcome to Veilfall - a universe of custom lore! The game will begin momentarily. This map is centered around the breaching of the Veil - where the Old Ones reality breaches into the past and a long drawn out war with the Council ensues over the use of technology. Units spawn roughly every two minutes and armys upgrade every 5 spawns. Heroes are extremely important-do not lose them. |cff8080ffHint: Press the ESC key to select the Army Command Tower and read for tips to play.|r Have fun!" )
//---------COLOR MULTI NAMES-----------------//
call SetupPlayerColorNames()
//-------------LOOP-----------------//
loop
exitwhen ctr == 14
call SetPlayerAllianceStateBJ( Player(ctr), Player(20), bj_ALLIANCE_ALLIED_VISION )
call SetPlayerAllianceStateBJ( Player(ctr), Player(21), bj_ALLIANCE_ALLIED_VISION )
//set XP[ctr] = 1
set IsPlayedByObs[ctr] = 0
set udg_Forfeit[ctr + 1] = 0
call ForceAddPlayer(MsgPlayers, Player(ctr))
if ( IsPlayerAlly(Player(ctr), Player(0)) ) then
call ForceAddPlayer( udg_OldOnesPlayers, Player(ctr) )
elseif ( IsPlayerAlly(Player(ctr), Player(1)) ) then
call ForceAddPlayer( udg_CouncilPlayers, Player(ctr) )
endif
set ctr = ctr + 1
endloop
set ctr = 20
loop
exitwhen ctr == 24
if (GetPlayerSlotState(Player(ctr)) == PLAYER_SLOT_STATE_PLAYING) then
call ForceAddPlayer(ObserverPlayers, Player(ctr) )
call ForceAddPlayer(MsgPlayers, Player(ctr))
set udg_Forfeit[ctr + 1] = 0
endif
set ctr = ctr + 1
endloop
//Set Lore Abilities per Army Command
//Drakoria
//Veil Spells
call UnitAddAbility(ArmyCommand[0], 'A1RP')
call UnitAddAbility(ArmyCommand[0], 'A1RO')
call UnitAddAbility(ArmyCommand[0], 'A1RN')
//Erebos
call UnitAddAbility(ArmyCommand[1], 'A1KE')
call UnitAddAbility(ArmyCommand[1], 'A1KN')
call UnitAddAbility(ArmyCommand[1], 'A1L2')
call UnitAddAbility(ArmyCommand[1], 'A1L3')
call UnitAddAbility(ArmyCommand[1], 'A1L4')
//Silverfall
//Veil Spells
call UnitAddAbility(ArmyCommand[2], 'A1RS')
call UnitAddAbility(ArmyCommand[2], 'A1RV')
call UnitAddAbility(ArmyCommand[2], 'A1RW')
//Kethara
call UnitAddAbility(ArmyCommand[3], 'A1NV')
call UnitAddAbility(ArmyCommand[3], 'A1NW')
call UnitAddAbility(ArmyCommand[3], 'A1NX')
call UnitAddAbility(ArmyCommand[3], 'A1NY')
call UnitAddAbility(ArmyCommand[3], 'A1NZ')
//Urgraz
call UnitAddAbility(ArmyCommand[4], 'A1NH')
call UnitAddAbility(ArmyCommand[4], 'A1NI')
call UnitAddAbility(ArmyCommand[4], 'A1NJ')
call UnitAddAbility(ArmyCommand[4], 'A1NK')
call UnitAddAbility(ArmyCommand[4], 'A1NL')
//Ilium
call UnitAddAbility(ArmyCommand[6], 'A1LT')
call UnitAddAbility(ArmyCommand[6], 'A1LM')
call UnitAddAbility(ArmyCommand[6], 'A1LU')
call UnitAddAbility(ArmyCommand[6], 'A1LW')
call UnitAddAbility(ArmyCommand[6], 'A1LV')
//Kingdom of Mu
call UnitAddAbility(ArmyCommand[7], 'A1O8')
call UnitAddAbility(ArmyCommand[7], 'A1OA')
call UnitAddAbility(ArmyCommand[7], 'A1OB')
call UnitAddAbility(ArmyCommand[7], 'A1OC')
call UnitAddAbility(ArmyCommand[7], 'A1OD')
//Auroriya
call UnitAddAbility(ArmyCommand[8], 'A1GQ')
call UnitAddAbility(ArmyCommand[8], 'A1GO')
call UnitAddAbility(ArmyCommand[8], 'A1H2')
call UnitAddAbility(ArmyCommand[8], 'A1I0')
call UnitAddAbility(ArmyCommand[8], 'A1I1')
//Avandor
call UnitAddAbility(ArmyCommand[9], 'A1HP')
call UnitAddAbility(ArmyCommand[9], 'A1IF')
call UnitAddAbility(ArmyCommand[9], 'A1IB')
call UnitAddAbility(ArmyCommand[9], 'A1IC')
call UnitAddAbility(ArmyCommand[9], 'A1IM')
//Gromokol
call UnitAddAbility(ArmyCommand[10], 'A1M8')
call UnitAddAbility(ArmyCommand[10], 'A1M6')
call UnitAddAbility(ArmyCommand[10], 'A1M7')
call UnitAddAbility(ArmyCommand[10], 'A1M9')
call UnitAddAbility(ArmyCommand[10], 'A1MA')
//Dwarf City States
call UnitAddAbility(ArmyCommand[11], 'A1MW')
call UnitAddAbility(ArmyCommand[11], 'A1MY')
call UnitAddAbility(ArmyCommand[11], 'A1N0')
call UnitAddAbility(ArmyCommand[11], 'A1N1')
call UnitAddAbility(ArmyCommand[11], 'A1MZ')
//Xanthea
call UnitAddAbility(ArmyCommand[12], 'A1LE')
call UnitAddAbility(ArmyCommand[12], 'A1L5')
call UnitAddAbility(ArmyCommand[12], 'A1LG')
call UnitAddAbility(ArmyCommand[12], 'A1LH')
call UnitAddAbility(ArmyCommand[12], 'A1LI')
//Skaldrin
call UnitAddAbility(ArmyCommand[13], 'A1GL')
call IdleWorkerReplacementInit()
call ObsLeaverResourceTransferInit()
call SetupHealers()
call InitVoteUI()
call SetPlayerState( Player(PLAYER_NEUTRAL_AGGRESSIVE), PLAYER_STATE_GIVES_BOUNTY, 0 )
//Destructable Invul
call EnumDestructablesInRect( bj_mapInitialPlayableArea, null, function GameStartDestructableEnum )
set ObsHasJoined[0] = -1
set ObsHasJoined[1] = -1
set ObsHasJoined[2] = -1
set ObsHasJoined[3] = -1
call DestroyGroup(g)
set g = null
set u = null
set f = null
set hBar = null
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Game_Start_2 takes nothing returns nothing
set gg_trg_Game_Start_2 = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Game_Start_2, 0.75, false )
call TriggerAddAction( gg_trg_Game_Start_2, function Trig_Game_Start_2_Actions )
endfunction
function Trig_Game_Start_Unpause_Actions takes nothing returns nothing
local integer i = 5
call CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 1.50, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0)
if ( bj_isSinglePlayer == false) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "Game starting in:")
call PolledWait(0.50)
loop
exitwhen i < 1
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, I2S(i))
set i = i - 1
call TriggerSleepAction(1.00)
endloop
call GameStartPauseUnits(false)
endif
call PolledWait (10.00)
endfunction
//===========================================================================
function InitTrig_Game_Start_Unpause takes nothing returns nothing
set gg_trg_Game_Start_Unpause = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Game_Start_Unpause, 22.50, false )
call TriggerAddAction( gg_trg_Game_Start_Unpause, function Trig_Game_Start_Unpause_Actions )
endfunction
function Trig_Base_Vision_Enum takes nothing returns boolean
if ( ( GetUnitAbilityLevel(GetFilterUnit(), 'A00N') == 1 ) ) then
return true
endif
//---------------ADD SUPPLEMENTARY BASE HERE---------------------
return false
endfunction
function Trig_Base_Vision_Actions takes nothing returns nothing
local integer ctr = 0
local integer i = 0
local group g = CreateGroup()
local real x
local real y
local fogmodifier array vis
local unit u
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Filter(function Trig_Base_Vision_Enum))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
set x = GetUnitX(u)
set y = GetUnitY(u)
if ( IsUnitAlly(u, Player(0)) ) then
set vis[i] = CreateFogModifierRadius(Player(1), FOG_OF_WAR_VISIBLE, x, y, 900.00, true, false)
else
set vis[i] = CreateFogModifierRadius(Player(0), FOG_OF_WAR_VISIBLE, x, y, 900.00, true, false)
endif
call FogModifierStart(vis[i])
set i = i + 1
endloop
call TriggerSleepAction( 2.50 )
loop
exitwhen ctr > i
call DestroyFogModifier(vis[ctr])
set vis[ctr] = null
set ctr = ctr + 1
endloop
call DisableTrigger( GetTriggeringTrigger() )
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Base_Vision takes nothing returns nothing
set gg_trg_Base_Vision = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Base_Vision, 5, false )
call TriggerAddAction( gg_trg_Base_Vision, function Trig_Base_Vision_Actions )
endfunction
function Trig_AntiTK_Conditions takes nothing returns boolean
if (IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetAttacker()))) then
//Spawn Ability
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03B') == 1) then
return true
endif
//Sleeping hero
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO ) ) then
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'BUsl') < 1 ) then
return true
endif
endif
endif
if (GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_PASSIVE)) then
return true
endif
return false
endfunction
function Trig_AntiTK_Actions takes nothing returns nothing
call IssueImmediateOrder( GetAttacker(), "stop" )
endfunction
//===========================================================================
function InitTrig_AntiTK takes nothing returns nothing
set gg_trg_AntiTK = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AntiTK, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_AntiTK, Condition( function Trig_AntiTK_Conditions ) )
call TriggerAddAction( gg_trg_AntiTK, function Trig_AntiTK_Actions )
endfunction
function Trig_Hero_Dies_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(u))
local integer s = 3
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
call MakeItemsDroppable(u)
set s = GetRandomInt(0, 3)
if ( IsUnitInForce(u, udg_OldOnesPlayers) ) then
if ( ( s == 0 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r|cFF8080FF" + GetHeroProperName(u) + " has been fed to the grave...|r")
endif
if ( ( s == 1 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r|cFF8080FF" + GetHeroProperName(u) + " gave his last breath for a false hope...|r")
endif
if ( ( s == 2 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r |cFF8080FF" + GetHeroProperName(u) + " has been sacrificed to the Veil...|r")
endif
if ( ( s == 3 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r|cFF8080FF" + GetHeroProperName(u) + " has been torn apart...|r")
endif
else
if ( ( s == 0 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r |cFF8080FF" + GetHeroProperName(u) + " has been cleansed!|r")
endif
if ( ( s == 1 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r |cFF8080FF" + GetHeroProperName(u) + " will no longer make innocents suffer!|r")
endif
if ( ( s == 2 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r|cFF8080FF" + GetHeroProperName(u) + " soul has been sent beyond the Veil!|r")
endif
if ( ( s == 3 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Hero Slain: |r |cFF8080FF" + GetHeroProperName(u) + " has been reduced from bones to dust!|r")
endif
if GetOwningPlayer(GetTriggerUnit()) == Player(1) then
set iBlueHeroes = iBlueHeroes - 1
if ( udg_TimeElapsedMinutes < 30 ) then
if iBlueHeroes == 0 then
call PolledWait(5.0)
call TriggerExecute( gg_trg_eAetherius )
endif
endif
endif
endif
call PolledWait( 4.00 )
call SetUnitOwner( u, Player(PLAYER_NEUTRAL_PASSIVE), false )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Hero_Dies takes nothing returns nothing
set gg_trg_Hero_Dies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Dies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Hero_Dies, function Trig_Hero_Dies_Actions )
endfunction
function Trig_Destroyed_Bases_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer s = 3
if ( GetUnitAbilityLevel(u, 'A03B') == 1 ) then
set s = GetRandomInt(0, 3)
if ( IsUnitInForce(u, udg_CouncilPlayers) ) then
if ( ( s == 0 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " will now forever lay in darkness...|r")
endif
if ( ( s == 1 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " ceases to exist of any living being...|r")
endif
if ( ( s == 2 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has been destroyed...|r")
endif
if ( ( s == 3 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has failed to continue it's existance...|r")
endif
else
if ( ( s == 0 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has been burned to the ground!|r")
endif
if ( ( s == 1 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has been cleansed!|r")
endif
if ( ( s == 2 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has been liberated of any inhuman beasts!|r")
endif
if ( ( s == 3 ) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cFF8080FF" + GetUnitName(u) + " has been burned by the rightful timeline!|r")
endif
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Destroyed_Bases takes nothing returns nothing
set gg_trg_Destroyed_Bases = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Destroyed_Bases, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Destroyed_Bases, function Trig_Destroyed_Bases_Actions )
endfunction
function Trig_Team_Elimination_Conditions takes nothing returns boolean
return ( CouncilSpawnCount <= 0 or OldOnesSpawnCount <= 0 )
endfunction
function Trig_Team_Elimination_Actions takes nothing returns nothing
local force f
local string s
local string s2
local integer i = 0
//The event to detect when either value becomes 0 is buggy as fuck for some reason, so just checking every 15 seconds instead.
call DisableTrigger(GetTriggeringTrigger())
if ( CouncilSpawnCount == 0 ) then
set f = udg_CouncilPlayers
set s = "Council of Six"
set s2 = "n Old Ones"
else
set f = udg_OldOnesPlayers
set s = "Old Ones"
set s2 ="Council of Six"
endif
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The Forces of " + s + " have been eliminated! The game will now end in a " + s2 + " victory in 20 seconds!")
call PolledWait(20.00)
loop
exitwhen i == 24
if (IsPlayerInForce(Player(i), f)) then
call CustomDefeatBJ(Player(i), "Defeat! Your team has been eliminated")
endif
set i = i + 1
endloop
set f = null
endfunction
//===========================================================================
function InitTrig_Team_Elimination takes nothing returns nothing
set gg_trg_Team_Elimination = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Team_Elimination, 15.00, true )
call TriggerAddAction( gg_trg_Team_Elimination, function Trig_Team_Elimination_Actions )
call TriggerAddCondition( gg_trg_Team_Elimination, Condition(function Trig_Team_Elimination_Conditions))
endfunction
function Trig_Seize_Control_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 4) == "-sc " ) ) then
return false
endif
if ( not ( udg_ShareDisabled[GetPlayerId(GetTriggerPlayer()) + 1] == 0 ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 4, StringLength(GetEventPlayerChatString()))) < 15 ) ) then
return false
endif
return true
endfunction
function Trig_Seize_Control_Actions takes nothing returns nothing
local integer pNum = S2I(SubString(GetEventPlayerChatString(), 4, StringLength(GetEventPlayerChatString()))) - 1
if ( IsPlayerAlly(GetTriggerPlayer(), Player(pNum)) and (pNum != GetPlayerId(GetTriggerPlayer()) + 1) ) then
if (udg_ShareDisabled[pNum + 1] == 0) then
call SetPlayerAlliance(Player(pNum), GetTriggerPlayer(), ALLIANCE_SHARED_CONTROL, true)
call SetPlayerAlliance(GetTriggerPlayer(), Player(pNum), ALLIANCE_SHARED_CONTROL, true)
endif
endif
endfunction
//===========================================================================
function InitTrig_Seize_Control takes nothing returns nothing
set gg_trg_Seize_Control = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(0), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(1), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(2), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(3), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(4), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(5), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(6), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(7), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(8), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(9), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(10), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(11), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(12), "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, Player(13), "-sc", false )
call TriggerAddCondition( gg_trg_Seize_Control, Condition( function Trig_Seize_Control_Conditions ) )
call TriggerAddAction( gg_trg_Seize_Control, function Trig_Seize_Control_Actions )
endfunction
function Trig_Hero_and_misc_Dies_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(u))
local integer i
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
call MakeItemsDroppable(u)
call PolledWait( 4.00 )
call SetUnitOwner( u, Player(PLAYER_NEUTRAL_PASSIVE), false )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Hero_and_misc_Dies takes nothing returns nothing
local integer index = 0
set gg_trg_Hero_and_misc_Dies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_and_misc_Dies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Hero_and_misc_Dies, function Trig_Hero_and_misc_Dies_Actions )
endfunction
function Trig_Point_Difference_Actions takes nothing returns nothing
set udg_PointDifference = udg_RealCouncil - udg_RealOldOnes
endfunction
//===========================================================================
function InitTrig_Point_Difference takes nothing returns nothing
set gg_trg_Point_Difference = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Point_Difference, 5.00, true )
call TriggerAddAction( gg_trg_Point_Difference, function Trig_Point_Difference_Actions )
endfunction
function Trig_Team_Point_Increment_Conditions takes nothing returns boolean
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true and GetUnitAbilityLevel(GetTriggerUnit(), 'A0X3') == 0 ) then
return true
elseif ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03B') == 1 ) then
return true
endif
return false
endfunction
function BlightArea takes real x, real y, real radius returns nothing
//Elf ruins in death event for their main
call SetBlight(Player(12), x, y, radius, true)
endfunction
function Trig_Team_Point_Increment_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
if ( IsPlayerInForce(GetOwningPlayer(u), udg_CouncilPlayers) ) then
set udg_OldOnesPoints = udg_OldOnesPoints + 1
set udg_RealOldOnes = udg_RealOldOnes + 1
//Win Condition
if udg_OldOnesPoints >= 90 then
call TriggerExecute(gg_trg_Victory)
endif
call LeaderboardSetItemValue( udg_Leaderboard, 0, udg_OldOnesPoints )
//Blighting dead Council bases
if ( IsUnitType(u, UNIT_TYPE_HERO) == false ) then
if ( GetUnitAbilityLevel(u, 'A03B') == 1 ) then
set CouncilSpawnCount = CouncilSpawnCount - 1
call GroupRemoveUnit(Spawns[GetPlayerId(GetTriggerPlayer())], u)
endif
//lighting Silverfall Bases on Fire and Erebosi Towns Blighted
if ( GetOwningPlayer(GetTriggerUnit()) == Player(2) or GetOwningPlayer(GetTriggerUnit()) == Player(1) ) then
call SetDoodadAnimation(x, y, 1536, 'VSvb', false, "death", false)
call BlightArea(x, y, 512)
call AddSpecialEffectLocBJ( GetRandomLocInRect(Rect((x-200), (y-200), (x+200), (y+200))), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
call AddSpecialEffectLocBJ( GetRandomLocInRect(Rect((x-200), (y-200), (x+200), (y+200))), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
call AddSpecialEffectLocBJ( GetRandomLocInRect(Rect((x-600), (y-600), (x+600), (y+600))), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
call AddSpecialEffectLocBJ( GetRandomLocInRect(Rect((x-750), (y-750), (x+750), (y+750))), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
call AddSpecialEffectLocBJ( GetRandomLocInRect(Rect((x-900), (y-900), (x+900), (y+900))), "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
call PolledWait(1.00)
call BlightArea(x + 1024 + GetRandomInt(0, 3) * 128, y + GetRandomInt(-1, 1) * 128, 384 + GetRandomInt(0, 2) * 128)
call BlightArea(x - 1024 - GetRandomInt(0, 3) * 128, y - GetRandomInt(-1, 1) * 128, 384 + GetRandomInt(0, 2) * 128)
call PolledWait(1.00)
call BlightArea(x + GetRandomInt(-1, 1) * 128, y + 1024 + GetRandomInt(0, 3) * 128, 384 + GetRandomInt(0, 2) * 128)
call BlightArea(x - GetRandomInt(-1, 1) * 128, y - 1024 - GetRandomInt(0, 3) * 128, 384 + GetRandomInt(0, 2) * 128)
endif
endif
elseif ( IsPlayerInForce(GetOwningPlayer(u), udg_OldOnesPlayers) ) then
set udg_CouncilPoints = udg_CouncilPoints + 1
set udg_RealCouncil = udg_RealCouncil + 1
if udg_CouncilPoints >= 90 then
call TriggerExecute(gg_trg_Victory)
endif
call LeaderboardSetItemValue( udg_Leaderboard, 1, udg_CouncilPoints )
if ( GetUnitAbilityLevel(u, 'A03B') == 1 ) then
set OldOnesSpawnCount = OldOnesSpawnCount - 1
call GroupRemoveUnit(Spawns[GetPlayerId(GetTriggerPlayer())], GetTriggerUnit())
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Team_Point_Increment takes nothing returns nothing
set gg_trg_Team_Point_Increment = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Team_Point_Increment, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Team_Point_Increment, Condition( function Trig_Team_Point_Increment_Conditions ) )
call TriggerAddAction( gg_trg_Team_Point_Increment, function Trig_Team_Point_Increment_Actions )
endfunction
globals
integer OldOnesTotal = 0
integer CouncilTotal = 0
endglobals
function Trig_Multiboard_Update_Conditions takes nothing returns boolean
return ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_SUMMONED) ) )
endfunction
function Trig_Multiboard_Update_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetOwningPlayer(GetKillingUnit())) + 1
local unit u = GetTriggerUnit()
if ( IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
if (IsUnitEnemy(u, Player(pNum - 1))) then
set udg_UnitKills[pNum] = udg_UnitKills[pNum] + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, pNum, 2))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, pNum, 2), I2S(udg_UnitKills[pNum]) )
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
if ( GetUnitAbilityLevel(u, 'A0X3') == 0 ) then
set udg_HeroKills[pNum] = udg_HeroKills[pNum] + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, pNum, 1))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, pNum, 1), I2S(udg_HeroKills[pNum]) )
if (IsPlayerInForce(Player(pNum - 1), udg_OldOnesPlayers)) then
set OldOnesTotal = OldOnesTotal + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 16, 1))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 16, 1), I2S(OldOnesTotal))
elseif (IsPlayerInForce(Player(pNum - 1), udg_CouncilPlayers)) then
set CouncilTotal = CouncilTotal + 1
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 17, 1))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 17, 1), I2S(CouncilTotal))
endif
endif
endif
endif
//A base
elseif ( GetUnitAbilityLevel(u, 'A03B') == 1 ) then
if (IsPlayerInForce(Player(GetPlayerId(GetOwningPlayer(GetTriggerUnit()))), udg_OldOnesPlayers)) then
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 16, 2))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 16, 2), I2S(OldOnesSpawnCount) )
elseif (IsPlayerInForce(Player(GetPlayerId(GetOwningPlayer(GetTriggerUnit()))), udg_CouncilPlayers)) then
call MultiboardReleaseItem(MultiboardGetItem(udg_Multiboard, 17, 2))
call MultiboardSetItemValue(MultiboardGetItem(udg_Multiboard, 17, 2), I2S(CouncilSpawnCount) )
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Multiboard_Update takes nothing returns nothing
set gg_trg_Multiboard_Update = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Multiboard_Update, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Multiboard_Update, Condition( function Trig_Multiboard_Update_Conditions ) )
call TriggerAddAction( gg_trg_Multiboard_Update, function Trig_Multiboard_Update_Actions )
endfunction
function Trig_Leaderboard_Actions takes nothing returns nothing
set udg_Leaderboard = CreateLeaderboardBJ(bj_FORCE_ALL_PLAYERS, "|cff808000Team Points|r" )
call LeaderboardAddItem(udg_Leaderboard, "The Old Ones", 10, Player(0) )
call LeaderboardAddItem( udg_Leaderboard, "Council of Six", 10, Player(1))
call LeaderboardSetSizeByItemCount(udg_Leaderboard, LeaderboardGetItemCount(udg_Leaderboard))
endfunction
//===========================================================================
function InitTrig_Leaderboard takes nothing returns nothing
set gg_trg_Leaderboard = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Leaderboard, 1.50, false )
call TriggerAddAction( gg_trg_Leaderboard, function Trig_Leaderboard_Actions )
endfunction
function Trig_Game_Timer_Update_Actions takes nothing returns nothing
set udg_TimeElapsedSeconds = udg_TimeElapsedSeconds + 1
if ( udg_TimeElapsedSeconds == 60 ) then
set udg_TimeElapsedSeconds = 0
set udg_TimeElapsedMinutes = udg_TimeElapsedMinutes + 1
endif
if ( udg_TimeElapsedMinutes >= 10 ) then
if ( udg_TimeElapsedSeconds >= 10 ) then
call MultiboardSetTitleText( udg_Multiboard, ( "|CFFFEC70AVeilfall: Aetherite Wars|r (" + ( I2S(udg_TimeElapsedMinutes) + ( ":" + ( I2S(udg_TimeElapsedSeconds) + ")" ) ) ) ) )
else
call MultiboardSetTitleText( udg_Multiboard, ( "|CFFFEC70AVeilfall: Aetherite Wars|r (" + ( I2S(udg_TimeElapsedMinutes) + ( ":0" + ( I2S(udg_TimeElapsedSeconds) + ")" ) ) ) ) )
endif
else
if ( udg_TimeElapsedSeconds >= 10 ) then
call MultiboardSetTitleText( udg_Multiboard, ( "|CFFFEC70AVeilfall: Aetherite Wars|r (0" + ( I2S(udg_TimeElapsedMinutes) + ( ":" + ( I2S(udg_TimeElapsedSeconds) + ")" ) ) ) ) )
else
call MultiboardSetTitleText( udg_Multiboard, ( "|CFFFEC70AVeilfall: Aetherite Wars|r (0" + ( I2S(udg_TimeElapsedMinutes) + ( ":0" + ( I2S(udg_TimeElapsedSeconds) + ")" ) ) ) ) )
endif
endif
endfunction
//===========================================================================
function InitTrig_Game_Timer_Update takes nothing returns nothing
set gg_trg_Game_Timer_Update = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Game_Timer_Update, 1.00, true )
call TriggerAddAction( gg_trg_Game_Timer_Update, function Trig_Game_Timer_Update_Actions )
endfunction
globals
unit array ArmyCommand
endglobals
function Trig_Army_Command_Init_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
call GroupEnumUnitsInRect(g, gg_rct_Army_Commands, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call TriggerRegisterUnitEvent(gg_trg_Move_Army, u, EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(gg_trg_Stop_Army, u, EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(gg_trg_Rally_Spawns, u, EVENT_UNIT_SPELL_EFFECT)
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Army_Command_Init takes nothing returns nothing
set gg_trg_Army_Command_Init = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Army_Command_Init, 1.50, false )
call TriggerAddAction( gg_trg_Army_Command_Init, function Trig_Army_Command_Init_Actions )
endfunction
function Trig_Move_Army_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0HN' ) ) then
return false
endif
return true
endfunction
function Trig_Move_Army_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local group g = CreateGroup()
local unit u
call GroupEnumUnitsOfPlayer(g, GetTriggerPlayer(), null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (IsUnitType(u, UNIT_TYPE_HERO) == false and GetUnitAbilityLevel(u, 'A0J0') != 1) then
call IssuePointOrder(u, "move", x, y)
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Move_Army takes nothing returns nothing
set gg_trg_Move_Army = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Move_Army, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Move_Army, Condition( function Trig_Move_Army_Conditions ) )
call TriggerAddAction( gg_trg_Move_Army, function Trig_Move_Army_Actions )
endfunction
function Trig_Stop_Army_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Stop_Army_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
call GroupEnumUnitsOfPlayer(g, GetTriggerPlayer(), null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (IsUnitType(u, UNIT_TYPE_HERO) == false and GetUnitAbilityLevel(u, 'A0J0') != 1) then
call IssueImmediateOrder(u, "stop")
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Stop_Army takes nothing returns nothing
set gg_trg_Stop_Army = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Stop_Army, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stop_Army, Condition( function Trig_Stop_Army_Conditions ) )
call TriggerAddAction( gg_trg_Stop_Army, function Trig_Stop_Army_Actions )
endfunction
function Trig_Rally_Spawns_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0KE'
endfunction
function Trig_Rally_Spawns_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
local integer i = 0
local integer j = BlzGroupGetSize(Spawns[pNum])
local unit u
loop
exitwhen i == j
set u = BlzGroupUnitAt(Spawns[pNum], i)
call IssuePointOrder(u, "setrally", x, y)
set i = i + 1
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_Rally_Spawns takes nothing returns nothing
set gg_trg_Rally_Spawns = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rally_Spawns, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rally_Spawns, Condition( function Trig_Rally_Spawns_Conditions ) )
call TriggerAddAction( gg_trg_Rally_Spawns, function Trig_Rally_Spawns_Actions )
endfunction
function Trig_Player_Chat_Vote_Actions takes nothing returns nothing
if (GetLocalPlayer() == GetTriggerPlayer()) then
if ( BlzFrameIsVisible(VoteBackdrop) ) then
call BlzFrameClick(YesButton)
endif
endif
endfunction
//===========================================================================
function InitTrig_Player_Chat_Vote takes nothing returns nothing
set gg_trg_Player_Chat_Vote = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(0), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(1), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(2), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(3), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(4), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(5), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(6), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(7), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(8), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(9), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(10), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(11), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(12), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(13), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(20), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(21), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(22), "-yes", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Player_Chat_Vote, Player(23), "-yes", true )
call TriggerAddAction( gg_trg_Player_Chat_Vote, function Trig_Player_Chat_Vote_Actions )
endfunction
globals
timer JoinTimer = CreateTimer()
integer array ObsHasJoined
integer array IsPlayedByObs
integer JoinSlot
player JoiningPlayer
force ObserverPlayers = CreateForce()
endglobals
function Trig_Initiate_Join_Conditions takes nothing returns boolean
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, 7)) > 0 ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, 8)) <= 14 ) ) then
return false
endif
return true
endfunction
function Trig_Initiate_Join_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 6, 8))
if ((GetPlayerSlotState(Player(i - 1)) == PLAYER_SLOT_STATE_LEFT) and ObsHasJoined[GetPlayerId(GetTriggerPlayer()) - 20] == -1 and IsPlayedByObs[i - 1] == 0 ) then
set Votes = 0
set JoinSlot = i - 1
set TypeOfVote = 0
set VotesNeeded = (PlayerCount / 2) + 1
if ( bj_isSinglePlayer ) then
set VotesNeeded = 0
call Join_Expires()
endif
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 12, GetPlayerName(GetTriggerPlayer()) + " wants to join in place of " + PlayerNames[i - 1] + ". " + I2S(VotesNeeded) + " votes required." )
set JoiningPlayer = GetTriggerPlayer()
call TimerStart(JoinTimer, 30.00, false, function Join_Expires)
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger( gg_trg_Initiate_Vote_Kick )
call BlzFrameSetText(VoteBackdropText, "|cffff6666Let " + GetPlayerName(JoiningPlayer) + " join slot " + I2S(JoinSlot + 1) + "?|r")
if ( GetPlayerId(GetLocalPlayer()) < 14 ) then
call BlzFrameSetVisible(VoteBackdrop, true)
elseif (GetPlayerId(GetLocalPlayer()) >= 20 ) then
if ( ObsHasJoined[GetPlayerId(GetLocalPlayer()) - 20] > -1 ) then
call BlzFrameSetVisible(VoteBackdrop, true)
endif
endif
if ( BlzFrameIsVisible(OptionsBackdrop) ) then
call BlzFrameSetPoint(VoteBackdrop, FRAMEPOINT_TOP, BlzGetFrameByName("UpperButtonBarMenuButton", 0), FRAMEPOINT_BOTTOM, 0.20, -0.025)
else
call BlzFrameSetPoint(VoteBackdrop, FRAMEPOINT_TOP, BlzGetFrameByName("UpperButtonBarMenuButton", 0), FRAMEPOINT_BOTTOM, 0.40, -0.025)
endif
endif
endfunction
//===========================================================================
function InitTrig_Initiate_Join takes nothing returns nothing
set gg_trg_Initiate_Join = CreateTrigger( )
call DisableTrigger(gg_trg_Initiate_Join)
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Join, Player(0), "-join", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Join, Player(20), "-join", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Join, Player(21), "-join", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Join, Player(22), "-join", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Join, Player(23), "-join", false )
call TriggerAddCondition( gg_trg_Initiate_Join, Condition( function Trig_Initiate_Join_Conditions ) )
call TriggerAddAction( gg_trg_Initiate_Join, function Trig_Initiate_Join_Actions )
endfunction
function Trig_Join_Successful_Actions takes nothing returns nothing
local integer i = 0
call DisplayTimedTextToPlayer( GetLocalPlayer(), 0, 0, 20, "|cff8080ff" + GetPlayerName(JoiningPlayer) + " has entered the game!|r" )
set PlayerCount = PlayerCount + 1
set ObsHasJoined[GetPlayerId(JoiningPlayer) - 20] = JoinSlot + 1
set IsPlayedByObs[JoinSlot] = 1
set PlayerNames[JoinSlot] = ColorCodes[JoinSlot] + GetPlayerName(JoiningPlayer) + "|r"
set PlayerNames[GetPlayerId(JoiningPlayer)] = ColorCodes[JoinSlot] + GetPlayerName(JoiningPlayer) + "|r"
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, JoiningPlayer, "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Seize_Control, JoiningPlayer, "-sc", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, JoiningPlayer, "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, JoiningPlayer, "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Escape_Hotkey, JoiningPlayer, "-esc", true )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, JoiningPlayer, EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Obs_Leave_Share, JoiningPlayer, EVENT_PLAYER_LEAVE )
call BlzTriggerRegisterPlayerKeyEvent(ArmySelectTrigger, JoiningPlayer, OSKEY_OEM_5, 0, false)
call BlzTriggerRegisterPlayerKeyEvent(ArmySelectTrigger, JoiningPlayer, OSKEY_F8, 0, false)
call SetPlayerColor( JoiningPlayer, GetPlayerColor(Player(JoinSlot)) )
call ForceRemovePlayer(ObserverPlayers, JoiningPlayer)
if ( GetLocalPlayer() == JoiningPlayer ) then
call BlzFrameSetVisible(ArmySelectBackdrop, true)
call BlzFrameSetVisible(ArmySelectButton, true)
call BlzFrameSetVisible(ObsResourceTransferBackdrop, true)
call BlzFrameSetVisible(ObsResourceTransferButton, true)
endif
loop
exitwhen i == 24
if ( IsPlayerAlly(Player(JoinSlot), Player(i)) and (Player(i) != JoiningPlayer) ) then
if (GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_LEFT) then
call SetPlayerAllianceStateBJ(JoiningPlayer, Player(i), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(i), JoiningPlayer, bj_ALLIANCE_ALLIED_ADVUNITS )
else
call SetPlayerAllianceStateBJ( Player(i), JoiningPlayer, bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAllianceStateBJ( JoiningPlayer, Player(i), bj_ALLIANCE_ALLIED_VISION)
call SetPlayerAlliance(Player(i), Player(JoinSlot), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
call SetPlayerAlliance(Player(JoinSlot), Player(i), ALLIANCE_SHARED_ADVANCED_CONTROL, false)
endif
else
call SetPlayerAllianceStateBJ( Player(i), JoiningPlayer, bj_ALLIANCE_UNALLIED )
endif
if ( i == 13) then
set i = 20
else
set i = i + 1
endif
endloop
if ( IsPlayerInForce( Player(JoinSlot), udg_OldOnesPlayers ) ) then
call ForceAddPlayer(udg_OldOnesPlayers, JoiningPlayer)
else
call ForceAddPlayer(udg_CouncilPlayers, JoiningPlayer)
endif
set i = 20
loop
exitwhen i == 24
if (Player(i) != JoiningPlayer ) then
if ( IsPlayerInForce(Player(i), ObserverPlayers) ) then
call SetPlayerAllianceStateBJ( JoiningPlayer, Player(i), bj_ALLIANCE_ALLIED)
call SetPlayerAllianceStateBJ( Player(i), JoiningPlayer, bj_ALLIANCE_UNALLIED)
endif
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Join_Successful takes nothing returns nothing
set gg_trg_Join_Successful = CreateTrigger( )
call TriggerAddAction( gg_trg_Join_Successful, function Trig_Join_Successful_Actions )
endfunction
function Trig_Obs_Leave_Share_Actions takes nothing returns nothing
local integer i = ObsHasJoined[GetPlayerId(GetTriggerPlayer()) - 20] - 1
local integer obsGold = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD)
local integer obsLumber = GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_LUMBER)
local integer leaverGold = GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD)
local integer leaverLumber = GetPlayerState(Player(i), PLAYER_STATE_RESOURCE_LUMBER)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, ColorNames[i] + " (Obs) has left the game")
call ShareEverythingWithTeam( Player(i) )
call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_GOLD, obsGold + leaverGold )
call SetPlayerState(Player(i), PLAYER_STATE_RESOURCE_LUMBER, obsLumber + leaverLumber )
set IsPlayedByObs[i] = 0
set ObsHasJoined[GetPlayerId(GetTriggerPlayer()) - 20] = 0
set PlayerCount = PlayerCount - 1
endfunction
//===========================================================================
function InitTrig_Obs_Leave_Share takes nothing returns nothing
set gg_trg_Obs_Leave_Share = CreateTrigger( )
call TriggerAddAction( gg_trg_Obs_Leave_Share, function Trig_Obs_Leave_Share_Actions )
endfunction
globals
timer KickTimer = CreateTimer()
player PlayerBeingKicked
endglobals
function Trig_Initiate_Vote_Kick_Conditions takes nothing returns boolean
if ( not ( S2I(SubString(GetEventPlayerChatString(), 10, 12)) > 0 ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 10, 12)) <= 24 ) ) then
return false
endif
return true
endfunction
function Trig_Initiate_Vote_Kick_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 10, 12))
if ( GetPlayerSlotState(Player(i - 1)) == PLAYER_SLOT_STATE_PLAYING and IsPlayerObserver(Player(i - 1)) == false and GetPlayerId(GetTriggerPlayer()) != i - 1 ) then
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger( gg_trg_Initiate_Join )
set TypeOfVote = 1
set VotesNeeded = (PlayerCount / 2) + 4
if ( i < 15 ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, PlayerNames[GetPlayerId(GetTriggerPlayer())] + " has initiated a vote to kick " + PlayerNames[i - 1] + ". 1/" + I2S(VotesNeeded) )
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, PlayerNames[GetPlayerId(GetTriggerPlayer())] + " has initiated a vote to kick " + GetPlayerName(Player(i - 1)) + ". 1/" + I2S(VotesNeeded) )
endif
set PlayerBeingKicked = Player(i - 1)
set Votes = 1
call BlzFrameSetText(VoteBackdropText, "|cffff6666Kick " + GetPlayerName(PlayerBeingKicked) + "?|r")
call TimerStart(KickTimer, 30.00, false, function Votekick_Expires)
if ( GetPlayerId(GetLocalPlayer()) < 14 and GetLocalPlayer() != GetTriggerPlayer() ) then
call BlzFrameSetVisible(VoteBackdrop, true)
elseif (GetPlayerId(GetLocalPlayer()) >= 20 ) then
if ( ObsHasJoined[GetPlayerId(GetLocalPlayer()) - 20] > -1 ) then
call BlzFrameSetVisible(VoteBackdrop, true)
endif
endif
if ( BlzFrameIsVisible(OptionsBackdrop) ) then
call BlzFrameSetPoint(VoteBackdrop, FRAMEPOINT_TOP, BlzGetFrameByName("UpperButtonBarMenuButton", 0), FRAMEPOINT_BOTTOM, 0.20, -0.025)
else
call BlzFrameSetPoint(VoteBackdrop, FRAMEPOINT_TOP, BlzGetFrameByName("UpperButtonBarMenuButton", 0), FRAMEPOINT_BOTTOM, 0.40, -0.025)
endif
endif
endfunction
//===========================================================================
function InitTrig_Initiate_Vote_Kick takes nothing returns nothing
set gg_trg_Initiate_Vote_Kick = CreateTrigger( )
call DisableTrigger(gg_trg_Initiate_Vote_Kick)
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(0), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(1), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(2), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(3), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(4), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(5), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(6), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(7), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(8), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(9), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(10), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(11), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(12), "-votekick ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Initiate_Vote_Kick, Player(13), "-votekick ", false )
call TriggerAddCondition( gg_trg_Initiate_Vote_Kick, Condition( function Trig_Initiate_Vote_Kick_Conditions ) )
call TriggerAddAction( gg_trg_Initiate_Vote_Kick, function Trig_Initiate_Vote_Kick_Actions )
endfunction
function Trig_Build_Point_or_Tower_Dies_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), 'A0MB' ) == 1
endfunction
function Trig_Build_Point_or_Tower_Dies_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call CreateUnit( GetOwningPlayer(GetKillingUnit()), 'h03Q', x, y, bj_UNIT_FACING )
set u = null
endfunction
//===========================================================================
function InitTrig_Build_Point_or_Tower_Dies takes nothing returns nothing
set gg_trg_Build_Point_or_Tower_Dies = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Build_Point_or_Tower_Dies, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Build_Point_or_Tower_Dies, Condition(function Trig_Build_Point_or_Tower_Dies_Conditions) )
call TriggerAddAction( gg_trg_Build_Point_or_Tower_Dies, function Trig_Build_Point_or_Tower_Dies_Actions )
endfunction
function Trig_Enable_or_Disable_Sharing_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 7) == "-share " ) ) then
return false
endif
if ( not ( SubString(GetEventPlayerChatString(), 7, StringLength(GetEventPlayerChatString())) == "off" ) ) then
if ( not ( SubString(GetEventPlayerChatString(), 7, StringLength(GetEventPlayerChatString())) == "on" ) ) then
return false
endif
endif
return true
endfunction
function Trig_Enable_or_Disable_Sharing_Actions takes nothing returns nothing
local string s = SubString(GetEventPlayerChatString(), 7, StringLength(GetEventPlayerChatString()))
local integer ctr = 0
if ( s == "off" ) then
set udg_ShareDisabled[GetPlayerId(GetTriggerPlayer()) + 1] = 1
loop
exitwhen ctr == 24
if ( IsPlayerAlly(Player(ctr), GetTriggerPlayer()) ) then
if ( GetPlayerSlotState(Player(ctr)) == PLAYER_SLOT_STATE_PLAYING ) then
call SetPlayerAlliance(Player(ctr), GetTriggerPlayer(), ALLIANCE_SHARED_CONTROL, false)
call SetPlayerAlliance(GetTriggerPlayer(), Player(ctr), ALLIANCE_SHARED_CONTROL, false)
endif
endif
set ctr = ctr + 1
endloop
else
set udg_ShareDisabled[GetPlayerId(GetTriggerPlayer()) + 1] = 0
endif
set s = null
endfunction
//===========================================================================
function InitTrig_Enable_or_Disable_Sharing takes nothing returns nothing
set gg_trg_Enable_or_Disable_Sharing = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(0), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(1), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(2), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(3), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(4), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(5), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(6), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(7), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(8), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(9), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(10), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(11), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(12), "-share", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Sharing, Player(12), "-share", false )
call TriggerAddCondition( gg_trg_Enable_or_Disable_Sharing, Condition( function Trig_Enable_or_Disable_Sharing_Conditions ) )
call TriggerAddAction( gg_trg_Enable_or_Disable_Sharing, function Trig_Enable_or_Disable_Sharing_Actions )
endfunction
function Trig_Camera_Commands_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 5) == "-cam " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 5, 10)) > 500 ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 5, 10)) < 4001 ) ) then
return false
endif
return true
endfunction
function Trig_Camera_Commands_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local real value = S2R(SubString(GetEventPlayerChatString(), 5, 10))
if (GetLocalPlayer() == p) then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, value, 2.00)
endif
set p = null
endfunction
//===========================================================================
function InitTrig_Camera_Commands takes nothing returns nothing
set gg_trg_Camera_Commands = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(0), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(1), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(2), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(3), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(4), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(5), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(6), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(7), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(8), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(9), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(10), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(11), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(12), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(13), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(20), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(21), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(22), "-cam", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Commands, Player(23), "-cam", false )
call TriggerAddCondition( gg_trg_Camera_Commands, Condition( function Trig_Camera_Commands_Conditions ) )
call TriggerAddAction( gg_trg_Camera_Commands, function Trig_Camera_Commands_Actions )
endfunction
function Trig_Forfeit_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local force forfeitingForce
local string forceName
local integer ctr = 1
local integer ffAmount = 0
local integer playersInForce = 0
local integer pId = GetPlayerId(GetTriggerPlayer()) + 1
set udg_Forfeit[pId] = udg_Forfeit[pId] + 1
if ( IsPlayerInForce(p, udg_CouncilPlayers) ) then
set forfeitingForce = udg_CouncilPlayers
set forceName = "Council of Six"
elseif ( IsPlayerInForce(p, udg_OldOnesPlayers) ) then
set forfeitingForce = udg_OldOnesPlayers
set forceName = "The Old Ones"
endif
loop
exitwhen ctr == 25
if ( IsPlayerInForce(Player(ctr - 1), forfeitingForce) ) then
set playersInForce = playersInForce + 1
if ( udg_Forfeit[ctr] >= 1 ) then
set ffAmount = ffAmount + 1
endif
endif
set ctr = ctr + 1
endloop
if ( udg_Forfeit[pId] == 1 ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, PlayerNames[pId - 1] + " has voted to forfeit the game! " + I2S(ffAmount) + "/" + I2S(playersInForce) + " votes from the " + forceName + " have been cast!")
endif
if ( ffAmount >= playersInForce ) then
call PolledWait( 5.00 )
set ctr = 0
loop
exitwhen ctr == 25
if ( IsPlayerInForce(Player(ctr), forfeitingForce) ) then
call CustomDefeatBJ( Player(ctr), "Defeat" )
endif
set ctr = ctr + 1
endloop
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "The " + forceName + " have conceded! you have won and may now revel in your triumph" )
endif
set forfeitingForce = null
set forceName = null
set p = null
endfunction
//===========================================================================
function InitTrig_Forfeit takes nothing returns nothing
set gg_trg_Forfeit = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(0), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(1), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(2), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(3), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(4), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(5), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(6), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(7), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(8), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(9), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(10), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(11), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(12), "-ff", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Forfeit, Player(13), "-ff", true )
call TriggerAddAction( gg_trg_Forfeit, function Trig_Forfeit_Actions )
endfunction
function Trig_Fort_Swaps_Init_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if ( GetUnitAbilityLevel( u, 'A0DN') == 1 ) then
call TriggerRegisterUnitEvent( gg_trg_Fort_Swaps, u, EVENT_UNIT_DAMAGED )
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Fort_Swaps_Init takes nothing returns nothing
set gg_trg_Fort_Swaps_Init = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Fort_Swaps_Init, 1.50, false )
call TriggerAddAction( gg_trg_Fort_Swaps_Init, function Trig_Fort_Swaps_Init_Actions )
endfunction
function Trig_Fort_Swaps_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetWidgetLife(u) - GetEventDamage() <= 0.405 ) then
call BlzSetEventDamage(0)
call SetUnitOwner( u, GetOwningPlayer(GetEventDamageSource()), true )
call SetWidgetLife(u, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Fort_Swaps takes nothing returns nothing
set gg_trg_Fort_Swaps = CreateTrigger( )
call TriggerAddAction( gg_trg_Fort_Swaps, function Trig_Fort_Swaps_Actions )
endfunction
function Trig_Enable_or_Disable_Testing_Features_Conditions takes nothing returns boolean
if ( not ( GetPlayerName(GetTriggerPlayer()) == "Xaidin#1639" ) ) then
return false
endif
if ( not ( SubString(GetEventPlayerChatString(), 0, 6) == "-test " ) ) then
return false
endif
return true
endfunction
function Trig_Enable_or_Disable_Testing_Features_Actions takes nothing returns nothing
if ( SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString())) == "on" ) then
set udg_Teston = 1
else
if ( SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString())) == "off" ) then
set udg_Teston = 0
endif
endif
endfunction
//===========================================================================
function InitTrig_Enable_or_Disable_Testing_Features takes nothing returns nothing
set gg_trg_Enable_or_Disable_Testing_Features = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(0), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(1), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(2), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(3), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(4), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(5), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(6), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(7), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(8), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(9), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(10), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(11), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(12), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(13), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(20), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(21), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(22), "-test", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Testing_Features, Player(23), "-test", false )
call TriggerAddCondition( gg_trg_Enable_or_Disable_Testing_Features, Condition( function Trig_Enable_or_Disable_Testing_Features_Conditions ) )
call TriggerAddAction( gg_trg_Enable_or_Disable_Testing_Features, function Trig_Enable_or_Disable_Testing_Features_Actions )
endfunction
function Trig_Get_Damage_Data_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local string s = GetUnitName(u) + " damaged by " + R2S(GetEventDamage()) + "; Attack Type: "
if ( BlzGetEventAttackType() == ATTACK_TYPE_CHAOS ) then
set s = s + " Chaos "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_HERO ) then
set s = s + " Hero "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_MAGIC ) then
set s = s + " Magic "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_MELEE ) then
set s = s + " Melee "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_NORMAL ) then
set s = s + " Normal "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_PIERCE ) then
set s = s + " Pierce "
endif
if ( BlzGetEventAttackType() == ATTACK_TYPE_SIEGE ) then
set s = s + " Siege "
endif
set s = s + "Damage Type: "
if ( BlzGetEventDamageType() == DAMAGE_TYPE_UNIVERSAL ) then
set s = s + "universal"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_NORMAL ) then
set s = s + "normal"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_MAGIC ) then
set s = s + "magic"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_POISON ) then
set s = s + "poison"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_FORCE ) then
set s = s + "force"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_ACID ) then
set s = s + "acid"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_SLOW_POISON ) then
set s = s + "slow poison"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_ENHANCED ) then
set s = s + "enhanced"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_COLD ) then
set s = s + "cold"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_DEATH) then
set s = s + "death"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_DEFENSIVE) then
set s = s + "defensive"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_DEMOLITION) then
set s = s + "demolition"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_DIVINE) then
set s = s + "divine"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_FIRE) then
set s = s + "fire"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_LIGHTNING) then
set s = s + "lightning"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_MIND) then
set s = s + "mind"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_PLANT) then
set s = s + "plant"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_SHADOW_STRIKE) then
set s = s + "shadow strike"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_SONIC) then
set s = s + "sonic"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_SPIRIT_LINK) then
set s = s + "spirit link"
elseif ( BlzGetEventDamageType() == DAMAGE_TYPE_UNKNOWN ) then
set s = s + "unknown"
else
set s = s + "other"
endif
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, s)
set u = null
endfunction
//===========================================================================
function InitTrig_Get_Damage_Data takes nothing returns nothing
set gg_trg_Get_Damage_Data = CreateTrigger( )
call TriggerAddAction( gg_trg_Get_Damage_Data, function Trig_Get_Damage_Data_Actions )
endfunction
function Trig_Track_Unit_Damage_Data_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
local player p = GetTriggerPlayer()
if ( bj_isSinglePlayer or udg_Teston == 1) then
call GroupEnumUnitsSelected(g, p, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call TriggerRegisterUnitEvent(gg_trg_Get_Damage_Data, u, EVENT_UNIT_DAMAGED)
endloop
endif
call DestroyGroup(g)
set g = null
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_Track_Unit_Damage_Data takes nothing returns nothing
set gg_trg_Track_Unit_Damage_Data = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(0), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(1), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(2), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(3), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(4), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(5), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(6), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(7), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(8), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(9), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(10), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(11), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(12), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(13), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(20), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(21), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(22), "-track", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Track_Unit_Damage_Data, Player(23), "-track", true )
call TriggerAddAction( gg_trg_Track_Unit_Damage_Data, function Trig_Track_Unit_Damage_Data_Actions )
endfunction
function Trig_Set_Minute_Actions takes nothing returns nothing
if bj_isSinglePlayer or udg_Teston == 1 then
set udg_TimeElapsedMinutes = S2I(SubString(GetEventPlayerChatString(), 8, StringLength(GetEventPlayerChatString())))
endif
endfunction
//===========================================================================
function InitTrig_Set_Minute takes nothing returns nothing
set gg_trg_Set_Minute = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(0), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(1), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(2), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(3), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(4), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(5), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(6), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(7), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(8), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(9), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(10), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(11), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(12), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(13), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(20), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(21), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(22), "-minute ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Minute, Player(23), "-minute ", false )
call TriggerAddAction( gg_trg_Set_Minute, function Trig_Set_Minute_Actions )
endfunction
function Trig_Control_Herobox_Heroes_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
if ( bj_isSinglePlayer or udg_Teston == 1) then
call GroupEnumUnitsOfPlayer(g, Player(PLAYER_NEUTRAL_PASSIVE), null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (IsUnitType(u, UNIT_TYPE_HERO)) then
if (GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if ( IsUnitHidden(u) == false ) then
call SetUnitOwner(u, GetTriggerPlayer(), false)
endif
endif
endif
endloop
endif
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Control_Herobox_Heroes takes nothing returns nothing
set gg_trg_Control_Herobox_Heroes = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(0), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(1), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(2), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(3), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(4), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(5), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(6), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(7), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(8), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(9), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(10), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(11), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(12), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(13), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(20), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(21), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(22), "-givebox", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Control_Herobox_Heroes, Player(23), "-givebox", false )
call TriggerAddAction( gg_trg_Control_Herobox_Heroes, function Trig_Control_Herobox_Heroes_Actions )
endfunction
function Trig_Create_Tester_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 8) == "-tester " ) ) then
return false
endif
return true
endfunction
function Trig_Create_Tester_Actions takes nothing returns nothing
local integer uType = 'h03Y'
local unit u
if bj_isSinglePlayer or udg_Teston == 1 then
if ( S2I(SubString(GetEventPlayerChatString(), 8, 9)) == 2 ) then
set uType = 'h03Y'
endif
set u = CreateUnit(GetTriggerPlayer(), uType, DummyX, DummyY, bj_UNIT_FACING)
call TriggerRegisterUnitEvent( gg_trg_Calculate_Range, u, EVENT_UNIT_SPELL_EFFECT )
endif
endfunction
//===========================================================================
function InitTrig_Create_Tester takes nothing returns nothing
set gg_trg_Create_Tester = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(0), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(1), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(2), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(3), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(4), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(5), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(6), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(7), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(8), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(9), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(10), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(11), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(12), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(13), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(20), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(21), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(22), "-tester", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Create_Tester, Player(23), "-tester", false )
call TriggerAddCondition( gg_trg_Create_Tester, Condition( function Trig_Create_Tester_Conditions ) )
call TriggerAddAction( gg_trg_Create_Tester, function Trig_Create_Tester_Actions )
endfunction
function Trig_Frame_Player_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 6) == "-text " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, 8)) <= 24 ) ) then
return false
endif
if ( not ( GetPlayerName(GetTriggerPlayer()) == "Krazlo#2845" ) ) then
return false
endif
return true
endfunction
function Trig_Frame_Player_Actions takes nothing returns nothing
local integer pId = S2I(SubString(GetEventPlayerChatString(), 6, 8)) - 1
local string s
if (S2I(SubString(GetEventPlayerChatString(), 6, 8)) < 10) then
set s = SubString(GetEventPlayerChatString(), 8, StringLength(GetEventPlayerChatString()))
else
set s = SubString(GetEventPlayerChatString(), 9, StringLength(GetEventPlayerChatString()))
endif
call BlzDisplayChatMessage(Player(pId), 0, s)
set s = null
endfunction
//===========================================================================
function InitTrig_Frame_Player takes nothing returns nothing
set gg_trg_Frame_Player = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(0), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(1), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(2), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(3), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(4), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(5), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(6), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(7), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(8), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(9), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(10), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(11), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(12), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(13), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(20), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(21), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(22), "-text", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Frame_Player, Player(23), "-text", false )
call TriggerAddCondition( gg_trg_Frame_Player, Condition( function Trig_Frame_Player_Conditions ) )
call TriggerAddAction( gg_trg_Frame_Player, function Trig_Frame_Player_Actions )
endfunction
function Trig_Ally_All_Actions takes nothing returns nothing
local integer ctr = 0
if bj_isSinglePlayer or udg_Teston == 1 then
loop
exitwhen ctr == 21
call SetPlayerAllianceStateBJ( Player(ctr), GetTriggerPlayer(), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), Player(ctr), bj_ALLIANCE_ALLIED_ADVUNITS )
set ctr = ctr + 1
endloop
endif
endfunction
//===========================================================================
function InitTrig_Ally_All takes nothing returns nothing
set gg_trg_Ally_All = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(0), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(1), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(2), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(3), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(4), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(5), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(6), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(7), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(8), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(9), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(10), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(11), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(12), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(13), "-allyall", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(20), "-allyall", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(21), "-allyall", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(22), "-allyall", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally_All, Player(23), "-allyall", false )
call TriggerAddAction( gg_trg_Ally_All, function Trig_Ally_All_Actions )
endfunction
function Trig_Ally_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 6) == "-ally " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))) < 15 ) ) then
return false
endif
return true
endfunction
function Trig_Ally_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))) - 1
if bj_isSinglePlayer or udg_Teston == 1 then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), Player(i), bj_ALLIANCE_ALLIED_ADVUNITS )
call SetPlayerAllianceStateBJ( Player(i), GetTriggerPlayer(), bj_ALLIANCE_ALLIED_ADVUNITS )
endif
endfunction
//===========================================================================
function InitTrig_Ally takes nothing returns nothing
set gg_trg_Ally = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(0), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(1), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(2), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(3), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(4), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(5), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(6), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(7), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(8), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(9), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(10), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(11), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(12), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(13), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(20), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(21), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(22), "-ally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Ally, Player(23), "-ally", false )
call TriggerAddCondition( gg_trg_Ally, Condition( function Trig_Ally_Conditions ) )
call TriggerAddAction( gg_trg_Ally, function Trig_Ally_Actions )
endfunction
function Trig_Unally_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 8) == "-unally " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 8, StringLength(GetEventPlayerChatString()))) < 15 ) ) then
return false
endif
return true
endfunction
function Trig_Unally_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 8, StringLength(GetEventPlayerChatString()))) - 1
if bj_isSinglePlayer or udg_Teston == 1 then
call SetPlayerAllianceStateBJ( GetTriggerPlayer(), Player(i), bj_ALLIANCE_UNALLIED )
call SetPlayerAllianceStateBJ( Player(i), GetTriggerPlayer(), bj_ALLIANCE_UNALLIED )
endif
endfunction
//===========================================================================
function InitTrig_Unally takes nothing returns nothing
set gg_trg_Unally = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(0), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(1), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(2), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(3), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(4), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(5), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(6), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(7), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(8), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(9), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(10), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(11), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(12), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(13), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(20), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(21), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(22), "-unally", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Unally, Player(23), "-unally", false )
call TriggerAddCondition( gg_trg_Unally, Condition( function Trig_Unally_Conditions ) )
call TriggerAddAction( gg_trg_Unally, function Trig_Unally_Actions )
endfunction
function Trig_Set_Spawn_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 10) == "-setspawn " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 10, StringLength(GetEventPlayerChatString()))) < 7 ) ) then
return false
endif
return true
endfunction
function Trig_Set_Spawn_Actions takes nothing returns nothing
if bj_isSinglePlayer or udg_Teston == 1 then
set udg_SpawnSize = S2I(SubString(GetEventPlayerChatString(), 10, StringLength(GetEventPlayerChatString())))
endif
endfunction
//===========================================================================
function InitTrig_Set_Spawn takes nothing returns nothing
set gg_trg_Set_Spawn = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(0), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(1), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(2), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(3), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(4), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(5), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(6), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(7), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(8), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(9), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(10), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(11), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(12), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(13), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(20), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(21), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(22), "-setspawn", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Spawn, Player(23), "-setspawn", false )
call TriggerAddCondition( gg_trg_Set_Spawn, Condition( function Trig_Set_Spawn_Conditions ) )
call TriggerAddAction( gg_trg_Set_Spawn, function Trig_Set_Spawn_Actions )
endfunction
function Trig_Give_Resources_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 9) == "-resource" ) ) then
return false
endif
return true
endfunction
function Trig_Give_Resources_Actions takes nothing returns nothing
local integer ctr = 0
if (bj_isSinglePlayer or udg_Teston == 1) then
loop
exitwhen ctr == 14
call SetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_GOLD) + 100000)
call SetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_LUMBER) + 100000)
set ctr = ctr + 1
endloop
endif
endfunction
//===========================================================================
function InitTrig_Give_Resources takes nothing returns nothing
set gg_trg_Give_Resources = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(0), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(1), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(2), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(3), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(4), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(5), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(6), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(7), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(8), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(9), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(10), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(11), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(12), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(13), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(20), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(21), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(22), "-resource", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Give_Resources, Player(23), "-resource", false )
call TriggerAddCondition( gg_trg_Give_Resources, Condition( function Trig_Give_Resources_Conditions ) )
call TriggerAddAction( gg_trg_Give_Resources, function Trig_Give_Resources_Actions )
endfunction
function Trig_Set_Hero_Level_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 5) == "-lvl " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 5, 7)) < 16 ) ) then
return false
endif
return true
endfunction
function Trig_Set_Hero_Level_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = S2I(SubString(GetEventPlayerChatString(), 5, 7))
local group g = CreateGroup()
local unit u
if bj_isSinglePlayer or udg_Teston == 1 then
call GroupEnumUnitsSelected(g, p, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if ( IsUnitType(u, UNIT_TYPE_HERO) ) then
if (GetHeroLevel(u) < i) then
call SetHeroLevel(u, i, true)
elseif (GetHeroLevel(u) > i) then
call UnitStripHeroLevel(u, GetHeroLevel(u) - i)
endif
endif
endloop
endif
call DestroyGroup(g)
set g = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Set_Hero_Level takes nothing returns nothing
set gg_trg_Set_Hero_Level = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(0), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(1), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(2), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(3), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(4), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(5), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(6), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(7), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(8), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(9), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(10), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(11), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(12), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(13), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(20), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(21), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(22), "-lvl", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Hero_Level, Player(23), "-lvl", false )
call TriggerAddCondition( gg_trg_Set_Hero_Level, Condition( function Trig_Set_Hero_Level_Conditions ) )
call TriggerAddAction( gg_trg_Set_Hero_Level, function Trig_Set_Hero_Level_Actions )
endfunction
function Trig_Remove_Unit_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 2) == "-r" ) ) then
return false
endif
return true
endfunction
function Trig_Remove_Unit_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local group g = CreateGroup()
local unit u
if bj_isSinglePlayer or udg_Teston == 1 then
call GroupEnumUnitsSelected(g, p, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call RemoveUnit(u)
endloop
endif
call DestroyGroup(g)
set g = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Remove_Unit takes nothing returns nothing
set gg_trg_Remove_Unit = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(0), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(1), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(2), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(3), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(4), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(5), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(6), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(7), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(8), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(9), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(10), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(11), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(12), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(13), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(20), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(21), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(22), "-r", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Remove_Unit, Player(23), "-r", true )
call TriggerAddCondition( gg_trg_Remove_Unit, Condition( function Trig_Remove_Unit_Conditions ) )
call TriggerAddAction( gg_trg_Remove_Unit, function Trig_Remove_Unit_Actions )
endfunction
function Trig_Set_Army_Level_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 5) == "-upg " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 5, 7)) <= 6 ) ) then
return false
endif
return true
endfunction
function Trig_Set_Army_Level_Actions takes nothing returns nothing
local integer ctr = 0
local integer i
local integer lvl = S2I(SubString(GetEventPlayerChatString(), 5, 7))
if (bj_isSinglePlayer or udg_Teston == 1) then
call SetPlayerTechResearched( Player(ctr), ArmyLevel[ctr], 1 )
loop
exitwhen ctr == 14
call SetPlayerTechResearched( Player(ctr), 'R000', lvl )
call SetPlayerTechResearched( Player(ctr), 'R001', lvl )
call SetPlayerTechResearched( Player(ctr), 'R003', lvl )
if ( lvl > udg_SpawnSize ) then
set i = udg_SpawnSize + 1
loop
call SetPlayerTechResearched( Player(ctr), ArmyLevel[i], 1 )
exitwhen i == lvl
set i = i + 1
endloop
elseif ( lvl < udg_SpawnSize ) then
set i = udg_SpawnSize
loop
exitwhen i == lvl or i == 0
call SetPlayerTechResearched( Player(ctr), ArmyLevel[i], 0 )
set i = i - 1
endloop
endif
set ctr = ctr + 1
endloop
set udg_SpawnSize = lvl
endif
endfunction
//===========================================================================
function InitTrig_Set_Army_Level takes nothing returns nothing
set gg_trg_Set_Army_Level = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(0), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(1), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(2), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(3), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(4), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(5), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(6), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(7), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(8), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(9), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(10), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(11), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(12), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(13), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(20), "-upg", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Army_Level, Player(21), "-upg", false )
call TriggerAddCondition( gg_trg_Set_Army_Level, Condition( function Trig_Set_Army_Level_Conditions ) )
call TriggerAddAction( gg_trg_Set_Army_Level, function Trig_Set_Army_Level_Actions )
endfunction
function Trig_Set_Unit_Owner_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 5) == "-own " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 5, 7)) < 25 ) ) then
return false
endif
return true
endfunction
function Trig_Set_Unit_Owner_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = S2I(SubString(GetEventPlayerChatString(), 5, 7)) - 1
local group g = CreateGroup()
local unit u
if bj_isSinglePlayer or udg_Teston == 1 then
call GroupEnumUnitsSelected(g, p, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call SetUnitOwner(u, Player(i), true)
endloop
endif
call DestroyGroup(g)
set g = null
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_Set_Unit_Owner takes nothing returns nothing
set gg_trg_Set_Unit_Owner = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(0), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(1), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(2), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(3), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(4), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(5), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(6), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(7), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(8), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(9), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(10), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(11), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(12), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(13), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(20), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(21), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(22), "-own", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Unit_Owner, Player(23), "-own", false )
call TriggerAddCondition( gg_trg_Set_Unit_Owner, Condition( function Trig_Set_Unit_Owner_Conditions ) )
call TriggerAddAction( gg_trg_Set_Unit_Owner, function Trig_Set_Unit_Owner_Actions )
endfunction
function Trig_Kill_All_Units_Actions takes nothing returns nothing
local unit u
local group g = CreateGroup()
if bj_isSinglePlayer or udg_Teston == 1 then
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if ( IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
if ( IsUnitType(u, UNIT_TYPE_HERO) == false ) then
if ( GetUnitAbilityLevel(u, 'A0J0') < 1 ) then
if ( IsUnitHidden(u) == false ) then
call KillUnit(u)
endif
endif
endif
endif
endloop
endif
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Kill_All_Units takes nothing returns nothing
set gg_trg_Kill_All_Units = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(0), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(1), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(2), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(3), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(4), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(5), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(6), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(7), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(8), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(9), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(10), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(11), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(12), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(13), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(20), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(21), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(22), "-Wrath of God", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_All_Units, Player(23), "-Wrath of God", true )
call TriggerAddAction( gg_trg_Kill_All_Units, function Trig_Kill_All_Units_Actions )
endfunction
function Trig_Kill_Selected_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer i = S2I(SubString(GetEventPlayerChatString(), 5, 7))
local group g = CreateGroup()
local unit u
if bj_isSinglePlayer or udg_Teston == 1 then
call GroupEnumUnitsSelected(g, p, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call KillUnit(u)
endloop
endif
call DestroyGroup(g)
set g = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Kill_Selected takes nothing returns nothing
set gg_trg_Kill_Selected = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(0), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(1), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(2), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(3), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(4), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(5), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(6), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(7), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(8), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(9), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(10), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(11), "-murder", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Kill_Selected, Player(12), "-murder", true )
call TriggerAddAction( gg_trg_Kill_Selected, function Trig_Kill_Selected_Actions )
endfunction
function Trig_sadf_Actions takes nothing returns nothing
call KillUnit( GetFilterUnit() )
endfunction
//===========================================================================
function InitTrig_sadf takes nothing returns nothing
set gg_trg_sadf = CreateTrigger( )
call TriggerAddAction( gg_trg_sadf, function Trig_sadf_Actions )
endfunction
function Trig_Force_Spawns_Actions takes nothing returns nothing
if bj_isSinglePlayer or udg_Teston == 1 then
call TriggerExecute( gg_trg_Spawns_and_Income )
endif
endfunction
//===========================================================================
function InitTrig_Force_Spawns takes nothing returns nothing
set gg_trg_Force_Spawns = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(0), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(1), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(2), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(3), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(4), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(5), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(6), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(7), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(8), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(9), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(10), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(11), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(12), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(13), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(20), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(21), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(22), "-s", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Force_Spawns, Player(23), "-s", true )
call TriggerAddAction( gg_trg_Force_Spawns, function Trig_Force_Spawns_Actions )
endfunction
function Trig_Kick_Conditions takes nothing returns boolean
if ( not ( GetPlayerName(GetTriggerPlayer()) == "Xaidin#1639" ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))) < 25 ) ) then
return false
endif
return true
endfunction
function Trig_Kick_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))) - 1
call CustomDefeatBJ( Player(i), "You've been kicked" )
call ShareEverythingWithTeam( Player(i) )
endfunction
//===========================================================================
function InitTrig_Kick takes nothing returns nothing
set gg_trg_Kick = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(0), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(1), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(2), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(3), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(4), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(5), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(6), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(7), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(8), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(9), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(10), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(11), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(12), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(13), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(20), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(21), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(22), "-kick", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Kick, Player(23), "-kick", false )
call TriggerAddCondition( gg_trg_Kick, Condition( function Trig_Kick_Conditions ) )
call TriggerAddAction( gg_trg_Kick, function Trig_Kick_Actions )
endfunction
function Trig_Trap_Player_Conditions takes nothing returns boolean
if ( not ( GetPlayerName(GetTriggerPlayer()) == "Xaidin#1639" ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString()))) < 25 ) ) then
return false
endif
return true
endfunction
function Trig_Trap_Player_Actions takes nothing returns nothing
local integer i = S2I(SubString(GetEventPlayerChatString(), 6, StringLength(GetEventPlayerChatString())))
local framehandle f1 = BlzGetFrameByName("ConfirmQuitQuitButton", 0)
local framehandle f2 = BlzGetFrameByName("EndGameButton", 0)
if ( GetLocalPlayer() == Player(i) ) then
call BlzFrameSetVisible(f1, false)
call BlzFrameSetVisible(f2, false)
endif
set f1 = null
set f2 = null
endfunction
//===========================================================================
function InitTrig_Trap_Player takes nothing returns nothing
set gg_trg_Trap_Player = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(0), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(1), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(2), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(3), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(4), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(5), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(6), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(7), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(8), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(9), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(10), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(11), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(12), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(13), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(20), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(21), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(22), "-trap", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Trap_Player, Player(23), "-trap", false )
call TriggerAddCondition( gg_trg_Trap_Player, Condition( function Trig_Trap_Player_Conditions ) )
call TriggerAddAction( gg_trg_Trap_Player, function Trig_Trap_Player_Actions )
endfunction
function Trig_Change_a_Name_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 6) == "-name " ) ) then
return false
endif
if ( not ( S2I(SubString(GetEventPlayerChatString(), 6, 8)) < 25 ) ) then
return false
endif
if ( not ( GetPlayerName(GetTriggerPlayer()) == "Xaidin#1639" ) ) then
return false
endif
return true
endfunction
function Trig_Change_a_Name_Actions takes nothing returns nothing
// Players 1-9 or 10+
if ( S2I(SubString(GetEventPlayerChatString(), 6, 8)) < 10 ) then
call SetPlayerName( Player(S2I(SubString(GetEventPlayerChatString(), 6, 7)) - 1), SubString(GetEventPlayerChatString(), 8, StringLength(GetEventPlayerChatString())) )
else
call SetPlayerName( Player(S2I(SubString(GetEventPlayerChatString(), 6, 8)) - 1), SubString(GetEventPlayerChatString(), 9, StringLength(GetEventPlayerChatString())) )
endif
endfunction
//===========================================================================
function InitTrig_Change_a_Name takes nothing returns nothing
set gg_trg_Change_a_Name = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(0), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(1), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(2), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(3), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(4), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(5), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(6), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(7), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(8), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(9), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(10), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(11), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(12), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(13), "-name ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(20), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(21), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(22), "-name", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Change_a_Name, Player(23), "-name", false )
call TriggerAddCondition( gg_trg_Change_a_Name, Condition( function Trig_Change_a_Name_Conditions ) )
call TriggerAddAction( gg_trg_Change_a_Name, function Trig_Change_a_Name_Actions )
endfunction
function Trig_Cooldowns_Toggle_Actions takes nothing returns nothing
if bj_isSinglePlayer or udg_Teston == 1 then
if ( IsTriggerEnabled(gg_trg_No_Cooldowns) ) then
call DisableTrigger( gg_trg_No_Cooldowns )
else
call EnableTrigger( gg_trg_No_Cooldowns )
endif
endif
endfunction
//===========================================================================
function InitTrig_Cooldowns_Toggle takes nothing returns nothing
set gg_trg_Cooldowns_Toggle = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(0), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(1), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(2), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(3), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(4), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(5), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(6), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(7), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(8), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(9), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(10), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(11), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(12), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(13), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(20), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(21), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(22), "-wtf", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Cooldowns_Toggle, Player(23), "-wtf", true )
call TriggerAddAction( gg_trg_Cooldowns_Toggle, function Trig_Cooldowns_Toggle_Actions )
endfunction
function Trig_No_Cooldowns_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetSpellAbilityId()
call TriggerSleepAction(0.1)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MAX_MANA))
call BlzEndUnitAbilityCooldown(u, i)
endfunction
//===========================================================================
function InitTrig_No_Cooldowns takes nothing returns nothing
set gg_trg_No_Cooldowns = CreateTrigger( )
call DisableTrigger( gg_trg_No_Cooldowns )
call TriggerRegisterAnyUnitEventBJ( gg_trg_No_Cooldowns, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_No_Cooldowns, function Trig_No_Cooldowns_Actions )
endfunction
function Trig_Player_Leaves_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
set udg_Forfeit[GetPlayerId(p) + 1] = 1
if ( GetPlayerId(p) <= 13 ) then
set PlayerCount = PlayerCount - 1
call ShareEverythingWithTeam( p )
call TriggerExecute( gg_trg_Debug_MB )
call SetPlayerAbilityAvailable( p, 'A0D4', true )
endif
if ( p == Player(13) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The Skaldrin have crawled back into their marsh!" )
elseif ( p == Player(12) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The |cff800000The Empire of Xanthea|r has been sent back beyond the veil!" )
elseif ( p == Player(11) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The |cff663300Dwarf City-States|r have crumbeled and fled to their holes!" )
elseif ( p == Player(10) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cff008000Gromokol|r has failed in its quest of to solidify its hold on the Veil!" )
elseif ( p == Player(9) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The forests of|cff8080ffAvandor|r lie in ash and Quel'Dorash has disappeared!" )
elseif ( p == Player(8) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cff808080Auroriya's|r gospel are no longer spread!" )
elseif ( p == Player(7) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The|cffff80c0Kingdom of Mu|r has faded into the mist!" )
elseif ( p == Player(6) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The industrious people of |cff00ff00Ilium|r have fled the continent!" )
elseif ( p == Player(5) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The|cffff8000Valskar|r have returned to their dunes!" )
elseif ( p == Player(4) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The clans of|cffffff00Urgraz|r have fallen to infighting!" )
elseif ( p == Player(3) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The Imperial Legion of |cff6f2583Kethara|r has returned to the capital!" )
elseif ( p == Player(2) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cff00ffffSilverfall|r has faded into the night!" )
elseif ( p == Player(1) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The mistwalkers of |cff004080Erebos|r have returned to their homes!" )
elseif ( p == Player(0) ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "The forces of |cffff0000Drakoria|r have abandoned their conquest!" )
endif
call PolledWait(2.00)
call MultiboardDisplay( udg_Multiboard, true )
set p = null
endfunction
//===========================================================================
function InitTrig_Player_Leaves takes nothing returns nothing
set gg_trg_Player_Leaves = CreateTrigger( )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(0), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(1), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(2), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(3), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(4), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(5), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(6), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(7), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(8), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(9), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(10), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(11), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(12), EVENT_PLAYER_LEAVE )
call TriggerRegisterPlayerEvent( gg_trg_Player_Leaves, Player(13), EVENT_PLAYER_LEAVE )
call TriggerAddAction( gg_trg_Player_Leaves, function Trig_Player_Leaves_Actions )
endfunction
function Trig_Observer_Cam_Reset_Actions takes nothing returns nothing
local integer ctr = 14
loop
exitwhen ctr == 20
if ( IsPlayerObserver(Player(ctr)) ) then
if (GetLocalPlayer() == Player(ctr) ) then
call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, 2750.00, 2.00)
endif
endif
set ctr = ctr + 1
endloop
endfunction
//===========================================================================
function InitTrig_Observer_Cam_Reset takes nothing returns nothing
set gg_trg_Observer_Cam_Reset = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Observer_Cam_Reset, 20.00, true )
call TriggerAddAction( gg_trg_Observer_Cam_Reset, function Trig_Observer_Cam_Reset_Actions )
endfunction
function Trig_Victory_Actions takes nothing returns nothing
local integer ctr = 0
if udg_OldOnesPoints >= 90 then
//If Old Ones Win
call DisplayTextToForce( udg_OldOnesPlayers, "|cffffcc00VICTORY: |r|cFF8080FFThe forces of the Old Ones have defeated the current timeline and prevented the experiment beneath Cogfall!|r" )
call DisplayTextToForce( udg_CouncilPlayers, "|cffffcc00DEFEAT: |r|cFF8080FFThe forces of the Council have been defeated and the great experiment beneath Cogfall has been halted...|r" )
call TriggerSleepAction( 5.00 )
loop
exitwhen ctr == 24
if ( IsPlayerAlly(Player(ctr), Player(0)) ) then
call CustomVictoryBJ( Player(ctr), true, true )
elseif ( IsPlayerAlly(Player(ctr), Player(1)) ) then
call CustomDefeatBJ( Player(ctr), "You have been defeated." )
endif
set ctr = ctr + 1
endloop
elseif udg_CouncilPoints >= 90 then
//If Council Wins
call DisplayTextToForce( udg_OldOnesPlayers, "|cffffcc00DEFEAT: |r|cFF8080FFThe forces of the Council have utterly devestated the Old One's forces and sent you back to your timeline...|r" )
call DisplayTextToForce( udg_CouncilPlayers, "|cffffcc00VICTORY: |r|cFF8080FFThe forces of the Council have defeated the timeline intruders and can carry on with their experiment beneath Cogfall!|r" )
call TriggerSleepAction( 5.00 )
loop
exitwhen ctr == 24
if ( IsPlayerAlly(Player(ctr), Player(0)) ) then
call CustomDefeatBJ( Player(ctr), "You have been defeated." )
elseif ( IsPlayerAlly(Player(ctr), Player(1)) ) then
call CustomVictoryBJ( Player(ctr), true, true )
endif
set ctr = ctr + 1
endloop
endif
call DestroyTrigger(gg_trg_Victory)
endfunction
//===========================================================================
function InitTrig_Victory takes nothing returns nothing
set gg_trg_Victory = CreateTrigger( )
call TriggerAddAction( gg_trg_Victory, function Trig_Victory_Actions )
endfunction
function Trig_Dummies_Actions takes nothing returns nothing
local integer ctr = 1
set Dummy = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e000', DummyX, DummyY, bj_UNIT_FACING)
set PDummy[0] = Dummy
call TriggerRegisterUnitEvent(gg_trg_Dummy_Respawn_Debug, PDummy[0], EVENT_UNIT_DEATH)
loop
exitwhen ctr == 14
set PDummy[ctr] = (CreateUnit(Player(ctr - 1), 'e000', DummyX, DummyY, bj_UNIT_FACING))
call TriggerRegisterUnitEvent(gg_trg_Dummy_Respawn_Debug, PDummy[ctr], EVENT_UNIT_DEATH)
set ctr = ctr + 1
endloop
set PDummy[14] = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'e000', DummyX, DummyY, bj_UNIT_FACING)
call TriggerRegisterUnitEvent(gg_trg_Dummy_Respawn_Debug, PDummy[15], EVENT_UNIT_DEATH)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Dummies takes nothing returns nothing
set gg_trg_Dummies = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Dummies, 1.00, false )
call TriggerAddAction( gg_trg_Dummies, function Trig_Dummies_Actions )
endfunction
function Trig_Dummy_Respawn_Debug_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
set PDummy[pNum] = (CreateUnit(Player(pNum - 1), 'e000', DummyX, DummyY, bj_UNIT_FACING))
call TriggerRegisterUnitEvent(gg_trg_Dummy_Respawn_Debug, PDummy[pNum], EVENT_UNIT_DEATH)
endfunction
//===========================================================================
function InitTrig_Dummy_Respawn_Debug takes nothing returns nothing
set gg_trg_Dummy_Respawn_Debug = CreateTrigger( )
call TriggerAddAction( gg_trg_Dummy_Respawn_Debug, function Trig_Dummy_Respawn_Debug_Actions )
endfunction
function Trig_Train_Ride_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1S0' ) ) then
return false
endif
return true
endfunction
function Trig_Train_Ride_Actions takes nothing returns nothing
local unit dummy
local real x
local real y
local unit caster = GetTriggerUnit()
//Whispering Rails Depot to Frostpeak Terminal
if GetTriggerUnit() == gg_unit_h0HU_0566 then
set x = GetRectCenterX(gg_rct_Frostpeak_Terminal)
set y = GetRectCenterY(gg_rct_Frostpeak_Terminal)
set dummy = (CreateUnit(GetOwningPlayer(caster),'h02L', x, y, bj_UNIT_FACING))
call UnitApplyTimedLife( dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy,'A1RZ')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetRectCenter(gg_rct_Whispering_Rails_Depot) )
endif
//Frostpeak Terminal to Ironclad Junction
if GetTriggerUnit() == gg_unit_h0HT_0080 then
set x = GetRectCenterX(gg_rct_Ironclad_Junction)
set y = GetRectCenterY(gg_rct_Ironclad_Junction)
set dummy = (CreateUnit(GetOwningPlayer(caster),'h02L', x, y, bj_UNIT_FACING))
call UnitApplyTimedLife( dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy,'A1RZ')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetRectCenter(gg_rct_Frostpeak_Terminal) )
endif
//Ironclad Junction to Ember Gate Depot
if GetTriggerUnit() == gg_unit_h0HR_0487 then
set x = GetRectCenterX(gg_rct_Ember_Gate_Depot)
set y = GetRectCenterY(gg_rct_Ember_Gate_Depot)
set dummy = (CreateUnit(GetOwningPlayer(caster),'h02L', x, y, bj_UNIT_FACING))
call UnitApplyTimedLife( dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy,'A1RZ')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetRectCenter(gg_rct_Ironclad_Junction) )
endif
//Embergate Depot to Whispering Rails Depot
if GetTriggerUnit() == gg_unit_h0GY_0453 then
set x = GetRectCenterX(gg_rct_Whispering_Rails_Depot)
set y = GetRectCenterY(gg_rct_Whispering_Rails_Depot)
set dummy = (CreateUnit(GetOwningPlayer(caster),'h02L', x, y, bj_UNIT_FACING))
call UnitApplyTimedLife( dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy,'A1RZ')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetRectCenter(gg_rct_Ember_Gate_Depot) )
endif
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Train_Ride takes nothing returns nothing
set gg_trg_Train_Ride = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Train_Ride, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Train_Ride, Condition( function Trig_Train_Ride_Conditions ) )
call TriggerAddAction( gg_trg_Train_Ride, function Trig_Train_Ride_Actions )
endfunction
function Trig_Depot_Swap_Init_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if ( GetUnitAbilityLevel( u, 'A1S0') == 1 ) then
call TriggerRegisterUnitEvent( gg_trg_Depot_Swaps, u, EVENT_UNIT_DAMAGED )
endif
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Depot_Swap_Init takes nothing returns nothing
set gg_trg_Depot_Swap_Init = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Depot_Swap_Init, 1.50, false )
call TriggerAddAction( gg_trg_Depot_Swap_Init, function Trig_Depot_Swap_Init_Actions )
endfunction
function Trig_Depot_Swaps_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
local player p2 = GetOwningPlayer(GetEventDamageSource())
local integer int = GetPlayerId(p2)
if ( GetWidgetLife(u) - GetEventDamage() <= 0.405 ) then
call BlzSetEventDamage(0)
call SetUnitOwner( u, p2, true )
call SetWidgetLife(u, GetUnitState(u, UNIT_STATE_MAX_LIFE))
if ( IsPlayerInForce(p, udg_CouncilPlayers) ) then
set udg_OldOnesPoints = udg_OldOnesPoints + 5
set udg_RealOldOnes = udg_RealOldOnes + 5
set udg_CouncilPoints = udg_CouncilPoints - 5
set udg_RealCouncil = udg_RealCouncil - 5
call LeaderboardSetItemValue( udg_Leaderboard, 0, udg_OldOnesPoints )
call LeaderboardSetItemValue( udg_Leaderboard, 1, udg_CouncilPoints )
endif
if ( IsPlayerInForce(p, udg_OldOnesPlayers) ) then
set udg_CouncilPoints = udg_CouncilPoints + 5
set udg_RealCouncil = udg_RealCouncil + 5
set udg_OldOnesPoints = udg_OldOnesPoints - 5
set udg_RealOldOnes = udg_RealOldOnes - 5
call LeaderboardSetItemValue( udg_Leaderboard, 0, udg_OldOnesPoints )
call LeaderboardSetItemValue( udg_Leaderboard, 1, udg_CouncilPoints )
endif
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0" + FactionNames[int] + " has control over the " + GetUnitName(u) + "!" )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Depot_Swaps takes nothing returns nothing
set gg_trg_Depot_Swaps = CreateTrigger( )
call TriggerAddAction( gg_trg_Depot_Swaps, function Trig_Depot_Swaps_Actions )
endfunction
function Trig_Event_Command_Conditions takes nothing returns boolean
return SubString(GetEventPlayerChatString(), 0, 7) == "-events"
endfunction
function Trig_Event_Command_Actions takes nothing returns nothing
local string s = GetEventPlayerChatString()
local integer number = GetPlayerId(GetTriggerPlayer()) + 1
local sound snd
local integer i
if ( StringLength(s) >= 9 ) then
if ( S2I(SubString(s, 8, StringLength(s))) > 0 and S2I(SubString(s, 8, StringLength(s))) <= 14 ) then
set number = S2I(SubString(s, 8, StringLength(s)))
endif
elseif ( number > 14) then
if ( ObsHasJoined[GetPlayerId(GetTriggerPlayer()) - 20] != 0 ) then
set number = ObsHasJoined[GetPlayerId(GetTriggerPlayer()) - 20] - 1
endif
endif
set i = DisplayEventText(GetTriggerPlayer(), number)
if ( i > 0 ) then
set snd = CreateSoundFromLabel("SecretFound", false, false, false, 10, 10)
if ( GetLocalPlayer() == GetTriggerPlayer() ) then
call StartSound(snd)
endif
call KillSoundWhenDone(snd)
else
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "No events available for " + ColorCodes[number - 1] + ColorNames[number - 1] + "|r")
endif
set snd = null
set s = null
endfunction
//===========================================================================
function InitTrig_Event_Command takes nothing returns nothing
set gg_trg_Event_Command = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(0), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(1), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(2), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(3), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(4), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(5), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(6), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(7), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(8), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(9), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(10), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(11), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(12), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(13), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(20), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(21), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(22), "-events", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Event_Command, Player(23), "-events", false )
call TriggerAddCondition( gg_trg_Event_Command, Condition( function Trig_Event_Command_Conditions ) )
call TriggerAddAction( gg_trg_Event_Command, function Trig_Event_Command_Actions )
endfunction
function DisplayEventRed takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 20 ) then
//Scythemaw Vortrex
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Scythemaw Vortrex arrives at Draconis Citadel at 20 minutes.")
set noOfEvents = noOfEvents + 1
endif
if ( GetWidgetLife(gg_unit_h05A_0722) > 0.405 ) then
//Azureguard Syltharion
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Destroy Moonwhisper Glade " + PingColorTeal + "(!)|r. and receive Azureguard Syltharion.")
set x = GetUnitX(gg_unit_h05A_0722)
set y = GetUnitY(gg_unit_h05A_0722)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
if GetOwningPlayer(gg_unit_H0BK_0405) != Player(0) then
//Sovereign Drakonix
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Destroy all of Silverfall's bases " + PingColorRed + "(!)|r to receive your ultimate hero, Sovereign Drakonix.")
//indvidual spawns because i lack critical thinking
//Eldarion's Reach
if ( GetWidgetLife(gg_unit_h01U_0720) > 0.405 ) then
set x = GetUnitX(gg_unit_h01U_0720)
set y = GetUnitY(gg_unit_h01U_0720)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Sylvan Bastion
if ( GetWidgetLife(gg_unit_h0AY_1239) > 0.405 ) then
set x = GetUnitX(gg_unit_h0AY_1239)
set y = GetUnitY(gg_unit_h0AY_1239)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Verdant Hollow
if ( GetWidgetLife(gg_unit_h05E_0726) > 0.405 ) then
set x = GetUnitX(gg_unit_h05E_0726)
set y = GetUnitY(gg_unit_h05E_0726)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Silversky Citadel
if ( GetWidgetLife(gg_unit_h05D_0725) > 0.405 ) then
set x = GetUnitX(gg_unit_h05D_0725)
set y = GetUnitY(gg_unit_h05D_0725)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Starfall Grove
if ( GetWidgetLife(gg_unit_h05C_0724) > 0.405 ) then
set x = GetUnitX(gg_unit_h05C_0724)
set y = GetUnitY(gg_unit_h05C_0724)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Crystalvale
if ( GetWidgetLife(gg_unit_h01V_0721) > 0.405 ) then
set x = GetUnitX(gg_unit_h01V_0721)
set y = GetUnitY(gg_unit_h01V_0721)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Sunsong Village
if ( GetWidgetLife(gg_unit_h05B_0723) > 0.405 ) then
set x = GetUnitX(gg_unit_h05B_0723)
set y = GetUnitY(gg_unit_h05B_0723)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
//Elvenwatch Ridge
if ( GetWidgetLife(gg_unit_h0AX_1800) > 0.405 ) then
set x = GetUnitX(gg_unit_h0AX_1800)
set y = GetUnitY(gg_unit_h0AX_1800)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
endif
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventBlue takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
local integer remainingHolds = 0
if ( udg_TimeElapsedMinutes < 12 ) then
//Eamon the Cloudstrider
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Eamon the Cloudstrider arrives at Skyport" + PingColorTeal + "(!)|r. at 12 minutes.")
set x = GetUnitX(gg_unit_h030_0206)
set y = GetUnitY(gg_unit_h030_0206)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
if (GetOwningPlayer(gg_unit_H02J_0133) != Player(1) and GetWidgetLife(gg_unit_h032_0205) > 0.405 ) then
//Lyra the Stormcaller
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Bring Victor the Sky Captain to Cloudwatch " + PingColorGreen + "(!)|r at level 4+ to enlist the aid of Lyra the Stormcaller.")
set x = GetUnitX(gg_unit_h032_0205)
set y = GetUnitY(gg_unit_h032_0205)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
set noOfEvents = noOfEvents + 1
endif
if (GetOwningPlayer(gg_unit_h0AB_1525) == Player(PLAYER_NEUTRAL_AGGRESSIVE) and GetWidgetLife(gg_unit_h0AB_1525) > 0.405 ) then
//Survivor of Veloria
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If you conquer Veloria " + PingColorRed + "(!)|r before Xanthea does, you will gain the Survivor of Veloria.")
set x = GetUnitX(gg_unit_h0AB_1525)
set y = GetUnitY(gg_unit_h0AB_1525)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
set noOfEvents = noOfEvents + 1
endif
if GetWidgetLife(gg_unit_H02K_0135) > 0.405 then
//The Mistsmasher
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-At level 6+, bring Victor the Sky Captain to Quel'Dorash " + PingColorOrange + "(!)|r to receive an upgraded airship, the Mistsmasher.")
set x = GetUnitX(gg_unit_h08P_0081)
set y = GetUnitY(gg_unit_h08P_0081)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
set noOfEvents = noOfEvents + 1
endif
if (GetOwningPlayer(gg_unit_H02J_0133) != Player(1) and iBlueHeroes > 0 ) then
//Aetherius, God of Mists
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If you lose all of your heroes AFTER 30 minutes of game time you will gain Aetherius.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventTeal takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 15 and GetWidgetLife(gg_unit_h05C_0724) > 0.405 ) then
//Sylvianara
set x = GetUnitX(gg_unit_h05C_0724)
set y = GetUnitY(gg_unit_h05C_0724)
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If Starfall Grove remains, Sylvianara will emerge at 15 minutes " + PingColorTeal + " (1)|r .")
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
if ( GetWidgetLife(gg_unit_h0AX_1800) > 0.405 ) then
//Thaliondir
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If Elvenwatch Ridge falls" + PingColorRed + "(!)|r , Thaliondir will emerge from Silversky Citadel! " + PingColorBlue + "(!)|r.")
set x = GetUnitX(gg_unit_h0AX_1800)
set y = GetUnitY(gg_unit_h0AX_1800)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
set x = GetUnitX(gg_unit_h05D_0725)
set y = GetUnitY(gg_unit_h05D_0725)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 128, 255, 255, false)
endif
set noOfEvents = noOfEvents + 1
endif
if ( GetOwningPlayer(gg_unit_H0BV_0767) != Player(2) and GetWidgetLife(gg_unit_h01U_0720) > 0.405 )then
//Lysandor
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Every minute after 15 minutes (up to 30 minutes) is a chance for the Celestial Convergence to emerge, granting you Lysandor at Eldarion's Reach.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventPurple takes player toPlayer returns integer
local real x
local real y
local real x2
local real y2
local real x3
local real y3
local real x4
local real y4
local real x5
local real y5
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 13 ) then
//Elara Seabinder
set x = GetUnitX(gg_unit_h08K_1376)
set y = GetUnitY(gg_unit_h08K_1376)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 111, 37, 131, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Elara Seabinder will arrive at Seaspray Harbor " + PingColorPurple + "(!)|r. at 13 minutes.")
set noOfEvents = noOfEvents + 1
endif
//Lyria Goldenblade
if ( GetOwningPlayer(gg_unit_H0DO_2150) != Player(3) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Lyria Goldenblade will arrive at Dawnview" + PingColorTeal + "(!)|r if Kael Wavebreaker dies.")
set x = GetUnitX(gg_unit_h0EA_1573)
set y = GetUnitY(gg_unit_h0EA_1573)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
//Thoran Avatar of the Thunder God
if ( GetWidgetLife(gg_unit_h08K_1376) > 0.405 or GetWidgetLife(gg_unit_h084_1282) > 0.405 or GetWidgetLife(gg_unit_h08N_1379) > 0.405) then
set x = GetUnitX(gg_unit_h08K_1376)
set y = GetUnitY(gg_unit_h08K_1376)
set x2 = GetUnitX(gg_unit_h084_1282)
set y2 = GetUnitY(gg_unit_h084_1282)
set x3 = GetUnitX(gg_unit_h08N_1379)
set y3 = GetUnitY(gg_unit_h08N_1379)
set x4 = GetUnitX(gg_unit_h08M_1378)
set y4 = GetUnitY(gg_unit_h08M_1378)
set x5 = GetUnitX(gg_unit_h01X_0108)
set y5 = GetUnitY(gg_unit_h01X_0108)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
call PingMinimapEx(x2, y2, 25, 212, 94, 25, false)
call PingMinimapEx(x3, y3, 25, 212, 94, 25, false)
call PingMinimapEx(x4, y4, 25, 255, 0, 0, false)
call PingMinimapEx(x5, y5, 25, 255, 0, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If Seaspray Harbor, High Tide, and Galepoint fall " + PingColorOrange + "(!)|r Thoran the Avatar of the Thunder God will arrive in Dawnview. If Dawnview is destroyed, he will arrive at Cogfall " + PingColorRed + "(!)|r .")
set noOfEvents = noOfEvents + 1
endif
//Blackwater and Captain Blackfyre
if ( GetOwningPlayer(gg_unit_h0EA_1573) != Player(3) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Capture Blackwater to control its spawn and Captain Blackfyre" + PingColorPink + "(!)|r.")
set x = GetUnitX(gg_unit_h0EA_1573)
set y = GetUnitY(gg_unit_h0EA_1573)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventYellow takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( GetOwningPlayer(gg_unit_O00S_0599) != Player(4) ) then
//Thunderfist Bastion and Grommash
set x = GetRectCenterX(gg_rct_eOgre_Trigger)
set y = GetRectCenterY(gg_rct_eOgre_Trigger)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Bring a lvl 4+ hero to the entrance of Thunderfist Bastion " + PingColorTeal + "(!)|r to receive Grommash Thunderfist and Thunderfist Bastion as a new base.")
set noOfEvents = noOfEvents + 1
endif
if ( GetOwningPlayer(gg_unit_O00R_0598) != Player(4) ) then
//Altar of Machinoboza and Tinkmaster Zizzik
set x = GetRectCenterX(gg_rct_Altar_of_Mach)
set y = GetRectCenterY(gg_rct_Altar_of_Mach)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 111, 37, 131, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Bring a lvl 6+ hero to the entrance of Altar of Machinoboza " + PingColorPurple + "(!)|r to receive Tinkmaster Zizzik and Altar of Machinoboza as a new base.")
set noOfEvents = noOfEvents + 1
endif
if ( GetOwningPlayer(gg_unit_O00N_0597) != Player(4) ) then
//Zikka MegaDoomTank Upgrade
set x = GetRectCenterX(gg_rct_eZikka_DoomTank)
set y = GetRectCenterY(gg_rct_eZikka_DoomTank)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 128, 128, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Bring lvl 6+ Zikka Shadowstalker to Quel'dorash " + PingColorBlue + "(!)|r to receive the MegaDoomTank upgrade.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventOrange takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( GetOwningPlayer(gg_unit_H0HO_2017) != Player(5) ) then
//Jarek
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Jarek Vorn will join the fight roughly 10 minutes into the battle.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventGreen takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 10 ) then
//The Shadowblade
set x = GetUnitX(gg_unit_H0CY_2128)
set y = GetUnitY(gg_unit_H0CY_2128)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-At 10 minutes, a 1v1 fight between the Shadowblade and Viktor Kharzim will occur at the Arena " + PingColorOrange + "(!)|r. The winner will get gain the combatant as a hero at their capital.")
set noOfEvents = noOfEvents + 1
endif
//The Great Road
if ( GetOwningPlayer(gg_unit_H0D0_2134) != Player(6) ) then
set x = GetUnitX(gg_unit_h0CS_2116)
set y = GetUnitY(gg_unit_h0CS_2116)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Control the Great Road " + PingColorGreen + "(!)|r for a total of 10 minutes and use the neighboring marketplace's ability to gain the Hero of Havenford.")
set noOfEvents = noOfEvents + 1
endif
if ( udg_TimeElapsedMinutes < 18 ) then
if ( GetWidgetLife(gg_unit_h03S_0092) > 0.405 ) then
//Chieftain Thunderhoof
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Chieftain Thunderhoof arrives at Seawall at 18 minutes.")
set noOfEvents = noOfEvents + 1
endif
endif
return noOfEvents
endfunction
function DisplayEventPink takes player toPlayer returns integer
local real x
local real y
local real x2
local real y2
local integer noOfEvents = 0
//Sylas the Darkweaver
if ( udg_TimeElapsedMinutes < 13 ) then
set x = GetUnitX(gg_unit_h0E7_1939)
set y = GetUnitY(gg_unit_h0E7_1939)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 111, 37, 131, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Sylas the Darkweaver will arrive at Yanarheim " + PingColorPurple + "(!)|r. at 13 minutes 20 seconds.")
set noOfEvents = noOfEvents + 1
endif
//Zhen the Tempest Blade
if ( GetOwningPlayer(gg_unit_H09O_2101) == Player(7) ) then
set x2 = GetUnitX(gg_unit_h09R_1518)
set y2 = GetUnitY(gg_unit_h09R_1518)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x2, y2, 25, 128, 128, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If Kenta dies, Zhen will appear at Zenkai " + PingColorBlue + "(!)|r to avenge him.")
set noOfEvents = noOfEvents + 1
endif
//Kazuo the Crimson Phantom
if ( GetOwningPlayer(gg_unit_H09I_2104) != Player(7) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Kazuo the Crimson Phantom will arrive at Jalakendra if Toshiro dies" + PingColorTeal + "(!)|r.")
set x = GetUnitX(gg_unit_h09T_1516)
set y = GetUnitY(gg_unit_h09T_1516)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
//Blackwater and Captain Blackfyre
if ( GetOwningPlayer(gg_unit_h0EA_1573) != Player(7) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Capture Blackwater to control its spawn and Captain Blackfyre" + PingColorPink + "(!)|r.")
set x = GetUnitX(gg_unit_h0EA_1573)
set y = GetUnitY(gg_unit_h0EA_1573)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
endif
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventGray takes player toPlayer returns integer
local real x
local real y
local real x2
local real y2
local integer noOfEvents = 0
//Luminar
if ( udg_TimeElapsedMinutes < 11 and GetWidgetLife(gg_unit_h06G_0870) > 0.405) then
set x = GetUnitX(gg_unit_h06G_0870)
set y = GetUnitY(gg_unit_h06G_0870)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-At 11 minutes, Luminar will appear at Radiant Point " + PingColorOrange + "(!)|r.")
set noOfEvents = noOfEvents + 1
endif
//Furnace Colossus
if ( GetWidgetLife(gg_unit_h0B3_0926) > 0.405 and GetWidgetLife(gg_unit_h06E_0868) > 0.405) then
set x = GetUnitX(gg_unit_h0B3_0926)
set y = GetUnitY(gg_unit_h0B3_0926)
set x2 = GetRectCenterX(gg_rct_Auroria)
set y2 = GetRectCenterY(gg_rct_Auroria)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
call PingMinimapEx(x2, y2, 25, 128, 128, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If the Celestial Cathedral falls " + PingColorGreen + "(!)|r, then the Furnace Colossus will emerge from Auroria " + PingColorBlue + "(!)|r.")
set noOfEvents = noOfEvents + 1
endif
//Celestial Dawnblade
if ( GetWidgetLife(gg_unit_h0B8_1916) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Silvergrove_Stronghold)
set y = GetRectCenterY(gg_rct_Silvergrove_Stronghold)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Once Thalion is level 6+ and acquires the Dawn Ore from Silvergrove Stronghold " + PingColorRed + "(!)|r, Thalion will gain the Celestial Dawnblade and the ability to summon Vulcanus.")
set noOfEvents = noOfEvents + 1
endif
//Vulcanus
if ( GetOwningPlayer(gg_unit_H01N_0042) != Player(8) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Vulcanus can be summoned by Thalion after he aquires the Celestial Dawnblade.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventLightBlue takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 11 ) then
//Kaelia
set x = GetRectCenterX(gg_rct_QuelDorash)
set y = GetRectCenterY(gg_rct_QuelDorash)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 128, 128, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-After 11 minutes, Kaelia will arive in Quel'Dorash " + PingColorBlue + "(!)|r.")
set noOfEvents = noOfEvents + 1
endif
//Champion of Avandor
if ( GetOwningPlayer(gg_unit_H06O_2083) != Player(9) ) then
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Should Vulcanus be summoned, Valyra the Stormblade will emerge at Quel'Dorash.")
set noOfEvents = noOfEvents + 1
endif
//Lyrielle
if ( GetOwningPlayer(gg_unit_H06I_0950) != Player(9) ) then
set x = GetRectCenterX(gg_rct_eLyrielle)
set y = GetRectCenterY(gg_rct_eLyrielle)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-You will gain Lyrielle if you bring a level 4+ hero to the Straight of Seawall " + PingColorGreen + "(!)|r.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventDarkGreen takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( udg_TimeElapsedMinutes < 10 ) then
//The Veil Hunter
set x = GetUnitX(gg_unit_H0CY_2128)
set y = GetUnitY(gg_unit_H0CY_2128)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-At 10 minutes, a 1v1 fight between the Shadowblade and Viktor Kharzim will occur at the Arena " + PingColorOrange + "(!)|r. The winner will get gain the combatant as a hero at their capital.")
set noOfEvents = noOfEvents + 1
endif
//The Great Road
if ( GetOwningPlayer(gg_unit_H040_0438) != Player(10) ) then
set x = GetUnitX(gg_unit_h0CS_2116)
set y = GetUnitY(gg_unit_h0CS_2116)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Control the Great Road " + PingColorGreen + "(!)|r for a total of 10 minutes and use the neighboring marketplace's ability to gain Baroness Vanya Ironwill.")
set noOfEvents = noOfEvents + 1
endif
if ( udg_TimeElapsedMinutes < 19 ) then
if ( GetWidgetLife(gg_unit_h00C_0014) > 0.405 ) then
//Archibald Flux
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Archibald Flux arrives at Castle Orlov at 19 minutes.")
set noOfEvents = noOfEvents + 1
endif
endif
return noOfEvents
endfunction
function DisplayEventBrown takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
//Titan Breaker
if ( udg_TimeElapsedMinutes < 10 ) then
set x = GetRectCenterX(gg_rct_Titanbreaker)
set y = GetRectCenterY(gg_rct_Titanbreaker)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-If you successfully defend the Titanbreaker for the first 10 minutes " + PingColorGreen + "(!)|r, the Titanbreaker will be fully gassed up and mobile ready!")
set noOfEvents = noOfEvents + 1
endif
//Hammer of Hammerhold
if ( GetOwningPlayer(gg_unit_H04J_0594) == Player(11)) then
set x = GetRectCenterX(gg_rct_Hammer_of_Hammerhold)
set y = GetRectCenterY(gg_rct_Hammer_of_Hammerhold)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 128, 128, 255, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Should you bring Thorin Thunderhammer to the lair of the great Rumblehide " + PingColorBlue + "(!)|r, you will be able to fight for your hammer back!")
set noOfEvents = noOfEvents + 1
endif
//Deepforge Crossing
if ( GetWidgetLife(gg_unit_h0CJ_2033) > 0.405 and (GetOwningPlayer(gg_unit_h0CJ_2033) != Player(11)) ) then
set x = GetUnitX(gg_unit_h0CJ_2033)
set y = GetUnitY(gg_unit_h0CJ_2033)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-You may capture Deepforge Crossing " + PingColorOrange + "(!)|r for a new base.")
set noOfEvents = noOfEvents + 1
endif
//Deepvein Hollow and Halden Drakeshot
if ( GetWidgetLife(gg_unit_h093_1463) > 0.405 and (GetOwningPlayer(gg_unit_h093_1463) == Player(PLAYER_NEUTRAL_AGGRESSIVE) or GetOwningPlayer(gg_unit_h093_1463) == Player(4)) ) then
set x = GetUnitX(gg_unit_h093_1463)
set y = GetUnitY(gg_unit_h093_1463)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 212, 94, 25, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-You may capture Deepvein Hollow " + PingColorOrange + "(!)|r for a new base and a new hero, Halden Drakeshot.")
set noOfEvents = noOfEvents + 1
endif
//Urzukar Depths and Daz Crystalbeard
if ( GetWidgetLife(gg_unit_h094_1464) > 0.405 and GetOwningPlayer(gg_unit_h094_1464) == Player(4) ) then
set x = GetUnitX(gg_unit_h094_1464)
set y = GetUnitY(gg_unit_h094_1464)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-You may capture Urzukar Depths " + PingColorRed + "(!)|r for a new base and a new hero, Daz Crystalbeard.")
set noOfEvents = noOfEvents + 1
endif
//Thorin Thunderhammer
if ( udg_TimeElapsedMinutes < 25 ) then
set x = GetRectCenterX(gg_rct_eThorin_Thunderhammer)
set y = GetRectCenterY(gg_rct_eThorin_Thunderhammer)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-25 minutes into the game, Thorin Thunderhmamer will arrive at " + PingColorPink + "(!)|r.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventMaroon takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
local integer index
local boolean hasItem = false
//Morriganth arrival
if ( udg_TimeElapsedMinutes < 30 and GetWidgetLife(gg_unit_h0AD_1774) > 0.405 ) then
set x = GetUnitX(gg_unit_h0AD_1774)
set y = GetUnitY(gg_unit_h0AD_1774)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 0, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-After 30 minutes, Morriganth arrives in Nexumbra " + PingColorRed + "(!)|r and further tears the veil.")
set noOfEvents = noOfEvents + 1
endif
//Veloria and Nunomortis
if ( GetWidgetLife(gg_unit_h0AB_1525) > 0.405 and (GetOwningPlayer(gg_unit_h0AB_1525) != Player(12)) ) then
set x = GetUnitX(gg_unit_h0AB_1525)
set y = GetUnitY(gg_unit_h0AB_1525)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 0, 255, 0, false)
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Capture Veloria " + PingColorGreen + "(!)|r for a new base and hero, Nunomortis, before Erebos captures it.")
set noOfEvents = noOfEvents + 1
endif
//Balzathor
if (GetOwningPlayer(gg_unit_U006_1981) != Player(12)) then
set x = GetUnitX(gg_unit_h0CP_1946)
set y = GetUnitY(gg_unit_h0CP_1946)
if ( GetLocalPlayer() == toPlayer ) then
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
if ( GetWidgetLife(gg_unit_h0AP_1111) > 0.405 ) then
set x = GetUnitX(gg_unit_h0AP_1111)
set y = GetUnitY(gg_unit_h0AP_1111)
call PingMinimapEx(x, y, 25, 255, 128, 128, false)
endif
endif
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Bring a level 4+ hero to The Infernal Spire " + PingColorPink + "(!)|r to receive a new base and unleash Balzathor upon the world. Shadowgate Fortress " + PingColorPink + "(!)|r must be destroyed prior.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
function DisplayEventNavyBlue takes player toPlayer returns integer
local real x
local real y
local integer noOfEvents = 0
if ( GetOwningPlayer(gg_unit_H0FY_1854) != Player(13) ) then
//Golemnar
call DisplayTimedTextToPlayer(toPlayer, 0, 0, 25.00, "-Golemnar will join the fight roughly 10 minutes into the battle.")
set noOfEvents = noOfEvents + 1
endif
return noOfEvents
endfunction
globals
string PingColorRed = "|cffff0000"
string PingColorBlue = "|cff8080ff"
string PingColorTeal = "|cff00ffff"
string PingColorPurple = "|cff6f2583"
string PingColorGreen = "|cff00ff00"
string PingColorOrange = "|cffd45e19"
string PingColorPink = "|cffff8080"
endglobals
function DisplayEventText takes player toPlayer, integer eventPlayerId returns integer
local integer noOfEvents = 0
if ( eventPlayerId == 1 ) then
set noOfEvents = DisplayEventRed(toPlayer)
elseif ( eventPlayerId == 2 ) then
set noOfEvents = DisplayEventBlue(toPlayer)
elseif ( eventPlayerId == 3 ) then
set noOfEvents = DisplayEventTeal(toPlayer)
elseif ( eventPlayerId == 4 ) then
set noOfEvents = DisplayEventPurple(toPlayer)
elseif ( eventPlayerId == 5 ) then
set noOfEvents = DisplayEventYellow(toPlayer)
elseif ( eventPlayerId == 6 ) then
set noOfEvents = DisplayEventOrange(toPlayer)
elseif ( eventPlayerId == 7 ) then
set noOfEvents = DisplayEventGreen(toPlayer)
elseif ( eventPlayerId == 8 ) then
set noOfEvents = DisplayEventPink(toPlayer)
elseif ( eventPlayerId == 9 ) then
set noOfEvents = DisplayEventGray(toPlayer)
elseif ( eventPlayerId == 10 ) then
set noOfEvents = DisplayEventLightBlue(toPlayer)
elseif ( eventPlayerId == 11 ) then
set noOfEvents = DisplayEventDarkGreen(toPlayer)
elseif ( eventPlayerId == 12 ) then
set noOfEvents = DisplayEventBrown(toPlayer)
elseif ( eventPlayerId == 13 ) then
set noOfEvents = DisplayEventMaroon(toPlayer)
elseif ( eventPlayerId == 14 ) then
set noOfEvents = DisplayEventNavyBlue(toPlayer)
endif
return noOfEvents
endfunction
globals
real array XP[14]
endglobals
function DisplayTextEx takes player triggerUnitOwner, string input returns nothing
//MsgPlayers set in globals and initialization
//leave triggerUnitOwner as null if it should be seen by both teams
if ( IsPlayerInForce(GetLocalPlayer(), MsgPlayers) ) then
if ( triggerUnitOwner == null or IsPlayerEnemy(GetLocalPlayer(), triggerUnitOwner ) ) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 10.00, input)
endif
endif
endfunction
function Trig_Enable_or_Disable_Event_Messages_Conditions takes nothing returns boolean
if ( not ( SubString(GetEventPlayerChatString(), 0, 5) == "-msg " ) ) then
return false
endif
if ( not ( SubString(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString())) == "off" ) ) then
if ( not ( SubString(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString())) == "on" ) ) then
return false
endif
endif
return true
endfunction
function Trig_Enable_or_Disable_Event_Messages_Actions takes nothing returns nothing
local string s = SubString(GetEventPlayerChatString(), 5, StringLength(GetEventPlayerChatString()))
if ( s == "off" ) then
call ForceRemovePlayer(MsgPlayers, GetTriggerPlayer())
else
call ForceAddPlayer(MsgPlayers, GetTriggerPlayer())
endif
call DisplayTextToPlayer(GetTriggerPlayer(), 0, 0, "Messages for base and hero deaths turned |cffffcc00" + s + "|r")
endfunction
//===========================================================================
function InitTrig_Enable_or_Disable_Event_Messages takes nothing returns nothing
set gg_trg_Enable_or_Disable_Event_Messages = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(0), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(1), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(2), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(3), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(4), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(5), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(6), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(7), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(8), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(9), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(10), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(11), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(12), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(13), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(20), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(21), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(22), "-msg ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Enable_or_Disable_Event_Messages, Player(23), "-msg ", false )
call TriggerAddCondition( gg_trg_Enable_or_Disable_Event_Messages, Condition( function Trig_Enable_or_Disable_Event_Messages_Conditions ) )
call TriggerAddAction( gg_trg_Enable_or_Disable_Event_Messages, function Trig_Enable_or_Disable_Event_Messages_Actions )
endfunction
function Trig_Coalharbor_Watch_Owner_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_Coalharbor_Watch_Owner_Actions takes nothing returns nothing
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
if ( IsUnitAlly(GetAttacker(), Player(6)) ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Coalharbor Watch has been taken back by Ilium!" )
call ActivateEventBase(GetTriggerUnit(), Player(6), null, true)
call DestroyTrigger(GetTriggeringTrigger())
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Coalharbor Watch has burned down Coalharbor Watch!" )
call KillUnit(gg_unit_h0CK_2034)
endif
endfunction
//===========================================================================
function InitTrig_Coalharbor_Watch_Owner takes nothing returns nothing
set gg_trg_Coalharbor_Watch_Owner = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Coalharbor_Watch_Owner, gg_unit_h0CK_2034, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Coalharbor_Watch_Owner, Condition( function Trig_Coalharbor_Watch_Owner_Conditions ) )
call TriggerAddAction( gg_trg_Coalharbor_Watch_Owner, function Trig_Coalharbor_Watch_Owner_Actions )
endfunction
function Trig_Deepforge_Crossing_Owner_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_Deepforge_Crossing_Owner_Actions takes nothing returns nothing
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
if ( IsUnitAlly(GetAttacker(), Player(11)) ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Deepforge Crossing has been taken back by the Dwarves!" )
call ActivateEventBase(GetTriggerUnit(), Player(11), null, true)
call DestroyTrigger(GetTriggeringTrigger())
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Deepforge Crossing has been burnt down by the Old Ones!" )
call KillUnit(gg_unit_h0CJ_2033)
endif
endfunction
//===========================================================================
function InitTrig_Deepforge_Crossing_Owner takes nothing returns nothing
set gg_trg_Deepforge_Crossing_Owner = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Deepforge_Crossing_Owner, gg_unit_h0CJ_2033, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Deepforge_Crossing_Owner, Condition( function Trig_Deepforge_Crossing_Owner_Conditions ) )
call TriggerAddAction( gg_trg_Deepforge_Crossing_Owner, function Trig_Deepforge_Crossing_Owner_Actions )
endfunction
function Trig_Great_Road_Taken_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_Great_Road_Taken_Actions takes nothing returns nothing
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
if ( IsUnitAlly(GetAttacker(), Player(6)) ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Great Road is under the control of Ilium! Commerce is flowing to the Old Ones." )
call ActivateEventBase(GetTriggerUnit(), Player(6), null, true)
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Great Road is under the control of Gromokol! Commerce is flowing to the Council." )
call ActivateEventBase(GetTriggerUnit(), Player(10), null, true)
endif
endfunction
//===========================================================================
function InitTrig_Great_Road_Taken takes nothing returns nothing
set gg_trg_Great_Road_Taken = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Great_Road_Taken, gg_unit_h0CS_2116, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Great_Road_Taken, Condition( function Trig_Great_Road_Taken_Conditions ) )
call TriggerAddAction( gg_trg_Great_Road_Taken, function Trig_Great_Road_Taken_Actions )
endfunction
function Trig_eThe_Arena_Actions takes nothing returns nothing
local unit u = gg_unit_H05G_0759
local unit u2 = gg_unit_H0CY_2128
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Gladiator fight has begun in the Great Arena!" )
call SetUnitOwner(u, Player(10), true)
call SetUnitInvulnerable(u, false)
call SetUnitOwner(u2, Player(6), true)
call SetUnitInvulnerable(u2, false)
call PingMinimapLocForForce( bj_FORCE_PLAYER[6], GetUnitLoc(u), 5.00 )
call PingMinimapLocForForce( bj_FORCE_PLAYER[10], GetUnitLoc(u), 5.00 )
set u = null
set u2 = null
endfunction
//===========================================================================
function InitTrig_eThe_Arena takes nothing returns nothing
set gg_trg_eThe_Arena = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eThe_Arena, 600.00 )
call TriggerAddAction( gg_trg_eThe_Arena, function Trig_eThe_Arena_Actions )
endfunction
function Trig_eThe_Arena_Winner_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 150.00
endfunction
function Trig_eThe_Arena_Winner_Actions takes nothing returns nothing
local real x
local real x2
local real y
local real y2
//put Kharzim in Cogfall
set x = GetUnitX(ArmyCommand[10])
set y = GetUnitY(ArmyCommand[10])
//put Alaric in Ilium
set x2 = GetUnitX(ArmyCommand[6])
set y2 = GetUnitY(ArmyCommand[6])
//if Kharzim wins, give level 4 and item
if ( GetWidgetLife(gg_unit_H05G_0759) > 150.00 ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Viktor Kharzim has hunted down yet another Veil beast, Alaric the Shadowblade, by defeating him in the notorious Arena in Cogfall!" )
call ActivateEventHero(gg_unit_H05G_0759, Player(10), x, y, 4, true)
call ActivateEventHero(gg_unit_H0CY_2128, Player(6), x2, y2, 3, true)
call UnitAddItemByIdSwapped('I009', gg_unit_H05G_0759)
call RemoveItem( UnitItemInSlot(gg_unit_H0CY_2128, 0) )
call SetUnitLifePercentBJ(gg_unit_H05G_0759, 100)
call SetUnitLifePercentBJ(gg_unit_H0CY_2128, 100)
call DestroyTrigger( GetTriggeringTrigger() )
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Alaric Blackthorn, the Shadowblade, has killed Viktor Kharzim - he will no longer hunt beasts from the Veil!" )
call ActivateEventHero(gg_unit_H0CY_2128, Player(6), x2, y2, 4, true)
call ActivateEventHero(gg_unit_H05G_0759, Player(10), x, y, 3, true)
call UnitAddItemByIdSwapped('I00A', gg_unit_H0CY_2128)
call RemoveItem( UnitItemInSlot(gg_unit_H05G_0759, 0) )
call SetUnitLifePercentBJ(gg_unit_H05G_0759, 100)
call SetUnitLifePercentBJ(gg_unit_H0CY_2128, 100)
call DestroyTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_eThe_Arena_Winner takes nothing returns nothing
set gg_trg_eThe_Arena_Winner = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eThe_Arena_Winner, gg_unit_H05G_0759, EVENT_UNIT_ATTACKED)
call TriggerRegisterUnitEvent( gg_trg_eThe_Arena_Winner, gg_unit_H0CY_2128, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_eThe_Arena_Winner, Condition( function Trig_eThe_Arena_Winner_Conditions ) )
call TriggerAddAction( gg_trg_eThe_Arena_Winner, function Trig_eThe_Arena_Winner_Actions )
endfunction
function Trig_Blackwater_Owner_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_Blackwater_Owner_Actions takes nothing returns nothing
local real x = GetUnitX(gg_unit_h0EA_1573)
local real y = GetUnitY(gg_unit_h0EA_1573)
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
//If kethara or ally takes blackwater
if ( IsUnitAlly(GetAttacker(), Player(3)) ) then
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Blackwater has been taken by Kethara! Captain Blackfyre has joined Kethara in their fight." )
call ActivateEventBase(GetTriggerUnit(), Player(3), null, true)
call ActivateEventHero(gg_unit_O01G_2138, Player(3), x, y, BlackfyreLvl, true)
call UnitRemoveItemFromSlot(gg_unit_O01G_2138, 1)
call SetUnitInvulnerable(gg_unit_O01G_2138, false)
//If Mu or ally takes blackwater
else
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Blackwater has been taken by the Kingdom of Mu! Captain Blackfyre has joined Mu in their fight. " )
call ActivateEventBase(GetTriggerUnit(), Player(7), null, true)
call ActivateEventHero(gg_unit_O01G_2138, Player(7), x, y, BlackfyreLvl, true)
call UnitRemoveItemFromSlot(gg_unit_O01G_2138, 1)
call SetUnitInvulnerable(gg_unit_O01G_2138, false)
endif
endfunction
//===========================================================================
function InitTrig_Blackwater_Owner takes nothing returns nothing
set gg_trg_Blackwater_Owner = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Blackwater_Owner, gg_unit_h0EA_1573, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Blackwater_Owner, Condition( function Trig_Blackwater_Owner_Conditions ) )
call TriggerAddAction( gg_trg_Blackwater_Owner, function Trig_Blackwater_Owner_Actions )
endfunction
function Trig_Blackfyre_Owner_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 300.00
endfunction
function Trig_Blackfyre_Owner_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_Dummy_Box)
local real y = GetRectCenterY(gg_rct_Dummy_Box)
local unit u = GetTriggerUnit()
local location l = Location(x, y)
local integer index = 0
//Drop items before moving
loop
exitwhen index == 6
call UnitRemoveItemFromSlotSwapped( index, u )
set index = index + 1
endloop
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Captain Blackfyre has been injured and dragged back to Blackwater!" )
call SetWidgetLife(u, GetUnitState(u, UNIT_STATE_MAX_LIFE))
call SetUnitPositionLoc(u, l)
call SetUnitOwner(u, Player(PLAYER_NEUTRAL_PASSIVE), false)
call SetUnitInvulnerable(u, true)
set BlackfyreLvl = GetHeroLevel(u)
set l = null
set u = null
endfunction
//===========================================================================
function InitTrig_Blackfyre_Owner takes nothing returns nothing
set gg_trg_Blackfyre_Owner = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Blackfyre_Owner, gg_unit_O01G_2138, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Blackfyre_Owner, Condition( function Trig_Blackfyre_Owner_Conditions ) )
call TriggerAddAction( gg_trg_Blackfyre_Owner, function Trig_Blackfyre_Owner_Actions )
endfunction
function Trig_Blackwater_Researches_Actions takes nothing returns nothing
if ( GetResearched() == 'R04U' ) then
call SetPlayerTechResearched( Player(3), 'R04U', 1 )
call SetPlayerTechResearched( Player(7), 'R04U', 1 )
endif
if ( GetResearched() == 'R04V' ) then
call SetPlayerTechResearched( Player(3), 'R04V', 1 )
call SetPlayerTechResearched( Player(7), 'R04V', 1 )
endif
if ( GetResearched() == 'R04W' ) then
call SetPlayerTechResearched( Player(3), 'R04W', 1 )
call SetPlayerTechResearched( Player(7), 'R04W', 1 )
endif
endfunction
//===========================================================================
function InitTrig_Blackwater_Researches takes nothing returns nothing
set gg_trg_Blackwater_Researches = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Blackwater_Researches, gg_unit_h0EA_1573, EVENT_UNIT_RESEARCH_FINISH )
call TriggerAddAction( gg_trg_Blackwater_Researches, function Trig_Blackwater_Researches_Actions )
endfunction
function Trig_Veloria_Conquered_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_Veloria_Conquered_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_Veloria)
local real y = GetRectCenterY(gg_rct_Veloria)
//Ally of Xanthea
if ( IsUnitAlly(GetAttacker(), Player(0)) ) then
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
call ActivateEventHero(gg_unit_U004_0002, Player(12), x, y, 3, true)
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Veloria has been swayed to serve Morriganth under the promise of redemption! " + EventHeroName + " has arisen to serve the Dark Dominion!" )
call ActivateEventBase(GetTriggerUnit(), Player(12), null, true)
call UnitRemoveItemFromSlot(gg_unit_U004_0002, 1)
call EnableTrigger (gg_trg_Deaths_Grasp )
else
//Enemy of Xanthea
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Veloria has been burned and Nunomortis has died again! The last survivor of Veloria has emerged to join Erebos!" )
call ActivateEventHero(gg_unit_H0GF_1024, Player(1), x, y, 3, true)
call UnitRemoveItemFromSlot(gg_unit_H0GF_1024, 1)
call EnableTrigger(gg_trg_Howl_of_the_Wolf)
endif
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Veloria_Conquered takes nothing returns nothing
set gg_trg_Veloria_Conquered = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Veloria_Conquered, gg_unit_h0AB_1525, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_Veloria_Conquered, Condition( function Trig_Veloria_Conquered_Conditions ) )
call TriggerAddAction( gg_trg_Veloria_Conquered, function Trig_Veloria_Conquered_Actions )
endfunction
function Trig_eScythemaw_Votrex_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[0])
local real y = GetUnitY(ArmyCommand[0])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0From the depths of Drakoria's ancient battlefields, the ground trembles with the approach of Scythemaw Vortrex. His scythe gleams ominously, harvesting the fear of his foes. Rise to the challenge, for the Crimson Harvester walks among us, ready to reap once more!" )
call ActivateEventHero(gg_unit_H080_1173, Player(0), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eScythemaw_Votrex takes nothing returns nothing
set gg_trg_eScythemaw_Votrex = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eScythemaw_Votrex, 1200.00 )
call TriggerAddAction( gg_trg_eScythemaw_Votrex, function Trig_eScythemaw_Votrex_Actions )
endfunction
function Trig_eAzureguard_Syltharion_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[0])
local real y = GetUnitY(ArmyCommand[0])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0As the last remnants of Moonwhisper Glade fall to ruin, a shadow passes overhead. With a mighty roar that rends the sky, Azureguard Syltharion descends, his wings unfurled in defiance. The Guardian of the Skies has come to push the vile elves further into their forest and drink the waters of the Glade!" )
call ActivateEventHero(gg_unit_H0BD_0404, Player(0), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Zephyrs_Vigor )
call EnableTrigger( gg_trg_Tempests_Dominion )
endfunction
//===========================================================================
function InitTrig_eAzureguard_Syltharion takes nothing returns nothing
set gg_trg_eAzureguard_Syltharion = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eAzureguard_Syltharion, 1200.00 )
call TriggerAddAction( gg_trg_eAzureguard_Syltharion, function Trig_eAzureguard_Syltharion_Actions )
endfunction
globals
group spawns
endglobals
function eSovereign_Drakonix_Conditions takes nothing returns boolean
if ( ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03B') == 1) ) then
return true
endif
return false
endfunction
function SpawnCounter takes nothing returns nothing
if (GetUnitAbilityLevel(GetEnumUnit(), 'A03B') == 0 ) then
call GroupRemoveUnit(spawns, GetEnumUnit())
endif
endfunction
function Trig_eSovereign_Drakonix_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[0])
local real y = GetUnitY(ArmyCommand[0])
local group g = CreateGroup()
set spawns = CreateGroup()
call GroupEnumUnitsOfPlayer(spawns, Player(2), null)
call ForGroup(spawns, function SpawnCounter)
if CountUnitsInGroup(spawns) == 1 then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Major Event: |r|cff0080c0The widespread destruction of the forests of Silverfall have paved the way for the Sovereign Drakonix to emerge from the volcanic spires of Drakoria!." )
call ActivateEventHero(gg_unit_H0BK_0405, Player(0), x, y, 5, true)
call DestroyGroup(spawns)
call DestroyTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_eSovereign_Drakonix takes nothing returns nothing
set gg_trg_eSovereign_Drakonix = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_eSovereign_Drakonix, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_eSovereign_Drakonix, Condition( function eSovereign_Drakonix_Conditions) )
call TriggerAddAction( gg_trg_eSovereign_Drakonix, function Trig_eSovereign_Drakonix_Actions )
endfunction
function Trig_eEamon_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[1])
local real y = GetUnitY(ArmyCommand[1])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Eamon the Cloustrider, Erebos' best aerial combatant, has emerged from Skyport to face the hordes of Xanthea!" )
call ActivateEventHero(gg_unit_H02F_0129, Player(1), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
set iBlueHeroes = iBlueHeroes + 1
endfunction
//===========================================================================
function InitTrig_eEamon takes nothing returns nothing
set gg_trg_eEamon = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eEamon, 720.00 )
call TriggerAddAction( gg_trg_eEamon, function Trig_eEamon_Actions )
endfunction
function Trig_eLyra_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_H02K_0135 ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 4
endfunction
function Trig_eLyra_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[1])
local real y = GetUnitY(ArmyCommand[1])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Victor has successfully pleaded to Lyra to abandon her post at Cloudwatch to assist Erebos on the front lines." )
//Activate Lyra the Stormcaller hero
call ActivateEventHero(gg_unit_H02J_0133, Player(1), x, y, 4, true)
set iBlueHeroes = iBlueHeroes + 1
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eLyra takes nothing returns nothing
set gg_trg_eLyra = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eLyra, gg_rct_Cloudwatch )
call TriggerAddCondition( gg_trg_eLyra, Condition( function Trig_eLyra_Conditions ) )
call TriggerAddAction( gg_trg_eLyra, function Trig_eLyra_Actions )
endfunction
function Trig_eAetherius_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[1])
local real y = GetUnitY(ArmyCommand[1])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0With the falling of the last heroic defender of Erebos - Aetherius, the Erebosi God of Mists, has emerged to defend the realm of his devout followers." )
//Activate Aetherius, God of Mists
call ActivateEventHero(gg_unit_H02I_0132, Player(1), x, y, 5, true)
set iBlueHeroes = iBlueHeroes + 1
call EnableTrigger(gg_trg_Mistral_Blade)
call EnableTrigger(gg_trg_Zephyrs_Embrace)
call EnableTrigger(gg_trg_Veil_of_Obscurity)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eAetherius takes nothing returns nothing
set gg_trg_eAetherius = CreateTrigger( )
call TriggerAddAction( gg_trg_eAetherius, function Trig_eAetherius_Actions )
endfunction
function Trig_eMistsmasher_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_H02K_0135 ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 6
endfunction
function Trig_eMistsmasher_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The highly-skilled engineers of Quel'dorash have made vast improvements upon Viktor's airship, now named The Mistsmasher!" )
call UnitRemoveAbility(u, 'A10P')
call UnitAddAbility(u, 'A1KX')
call DestroyTrigger( GetTriggeringTrigger() )
set u = null
endfunction
//===========================================================================
function InitTrig_eMistsmasher takes nothing returns nothing
set gg_trg_eMistsmasher = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eMistsmasher, gg_rct_eMistsmasher )
call TriggerAddCondition( gg_trg_eMistsmasher, Condition( function Trig_eMistsmasher_Conditions ) )
call TriggerAddAction( gg_trg_eMistsmasher, function Trig_eMistsmasher_Actions )
endfunction
function Trig_eSylvianara_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[2])
local real y = GetUnitY(ArmyCommand[2])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0With the threat ever looming to her Sacred Grove of Whispers, Sylvianara - the Lady of the Forest - has emerged!" )
call ActivateEventHero(gg_unit_H0BX_1160, Player(2), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eSylvianara takes nothing returns nothing
set gg_trg_eSylvianara = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eSylvianara, 900.00 )
call TriggerAddAction( gg_trg_eSylvianara, function Trig_eSylvianara_Actions )
endfunction
function Trig_eThaliondir_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[2])
local real y = GetUnitY(ArmyCommand[2])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cff0080c0The Elvenwatch Ridge has been razed! With the further encroachment upon the forests of Silverfall, Thaliondir, the Shadowed Sentinel, has emerged from Silversky Citadel to strike fear in the enemies of the forest." )
call ActivateEventHero(gg_unit_H0BW_0818, Player(2), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Whispering_Strike )
call EnableTrigger( gg_trg_Oathkeepers_Assault )
endfunction
//===========================================================================
function InitTrig_eThaliondir takes nothing returns nothing
set gg_trg_eThaliondir = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eThaliondir, gg_unit_h0AX_1800, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eThaliondir, function Trig_eThaliondir_Actions )
endfunction
function Trig_eInitiateCelestialConvergence_Actions takes nothing returns nothing
call EnableTrigger(gg_trg_eCelestialConvergencePeriodic)
endfunction
//===========================================================================
function InitTrig_eInitiateCelestialConvergence takes nothing returns nothing
set gg_trg_eInitiateCelestialConvergence = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eInitiateCelestialConvergence, 900.00 )
call TriggerAddAction( gg_trg_eInitiateCelestialConvergence, function Trig_eInitiateCelestialConvergence_Actions )
endfunction
function Trig_eCelestialConvergencePeriodic_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[2])
local real y = GetUnitY(ArmyCommand[2])
if CelestialInt == CelestialConvergeInt then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Major Event: |r|cff0080c0The Celestial Convergence is upon the world, spewing forth lunar magic to be twisted to the will of the Moon Mages of Silverfall. From the Convergence arises Lysandor, the mightiest of all Moon Mages!." )
call ActivateEventHero(gg_unit_H0BV_0767, Player(2), x, y, 5, true)
call DestroyTrigger( gg_trg_eCelestialConvergencePeriodic )
call EnableTrigger( gg_trg_Stargazers_Shield )
call EnableTrigger( gg_trg_Astral_Cataclysm )
call UnitAddItemByIdSwapped( 'I008', gg_unit_H0BV_0767 )
call UnitUseItem( gg_unit_H0BV_0767, GetLastCreatedItem() )
else
set CelestialInt = (CelestialInt + 1)
endif
endfunction
//===========================================================================
function InitTrig_eCelestialConvergencePeriodic takes nothing returns nothing
set gg_trg_eCelestialConvergencePeriodic = CreateTrigger( )
call DisableTrigger( gg_trg_eCelestialConvergencePeriodic )
call TriggerRegisterTimerEventPeriodic( gg_trg_eCelestialConvergencePeriodic, 60.00 )
call TriggerAddAction( gg_trg_eCelestialConvergencePeriodic, function Trig_eCelestialConvergencePeriodic_Actions )
endfunction
function Trig_eLyria_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[3])
local real y = GetUnitY(ArmyCommand[3])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Lyria Goldenblade has arrived at Dawnview to avenge Kael. The resolute Commander of the Golden Order, clad in her radiant armor, stands as a beacon of hope and valor, her sword ready to uphold justice." )
call ActivateEventHero(gg_unit_H0DO_2150, Player(3), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eLyria takes nothing returns nothing
set gg_trg_eLyria = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eLyria, gg_unit_H089_1336, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eLyria, function Trig_eLyria_Actions )
endfunction
function Trig_eElara_Seabinder_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[3])
local real y = GetUnitY(ArmyCommand[3])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Elara Seabinder has returned from her voyage to mainland Kethara. With the power of the sea at her command, she brings forth a wave of change, ready to turn the tides in battle." )
call ActivateEventHero(gg_unit_H0DN_2151, Player(3), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eElara_Seabinder takes nothing returns nothing
set gg_trg_eElara_Seabinder = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eElara_Seabinder, 780.00 )
call TriggerAddAction( gg_trg_eElara_Seabinder, function Trig_eElara_Seabinder_Actions )
endfunction
function Trig_eThoran_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[3])
local real y = GetUnitY(ArmyCommand[3])
if ( GetWidgetLife(gg_unit_h08N_1379) < 0.405 and GetWidgetLife(gg_unit_h08K_1376) < 0.405 and GetWidgetLife(gg_unit_h084_1282) < 0.405 ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The skies rumble and lightning arcs across the heavens as Thoran, Avatar of the Thunder God, descends upon the battlefield. His arrival heralds a storm of divine power, a manifestation of celestial fury and might. The citizens of Dawnview feel safe in his presence." )
call ActivateEventHero(gg_unit_H0DP_0544, Player(3), x, y, 5, true)
call DestroyTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Celestial_Aegis )
call EnableTrigger( gg_trg_Stormgods_Vengeance )
endif
endfunction
//===========================================================================
function InitTrig_eThoran takes nothing returns nothing
set gg_trg_eThoran = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eThoran, gg_unit_h08N_1379, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( gg_trg_eThoran, gg_unit_h08K_1376, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( gg_trg_eThoran, gg_unit_h084_1282, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eThoran, function Trig_eThoran_Actions )
endfunction
function Trig_eThunderfist_Bastion_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(4) ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 4
endfunction
function Trig_eThunderfist_Bastion_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_Thunderfist_Bastion)
local real y = GetRectCenterY(gg_rct_Thunderfist_Bastion)
local group g = CreateGroup()
local unit u
//Activate the Thunderfist Bastion base
call ActivateEventBase(gg_unit_h0CL_1469, Player(4), null, true)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Ogres of Thunderfist Bastion have joined Urgraz after being promised to be rid of the incessant dwarves!" )
call GroupEnumUnitsInRect(g, gg_rct_rOgre_Trigger, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (GetOwningPlayer(u) == Player(PLAYER_NEUTRAL_PASSIVE) ) then
if (GetUnitTypeId(u) == 'h0CI') then
call RemoveUnit(u)
endif
call SetUnitInvulnerable( u, false )
call SetUnitOwner( u, Player(4), true )
endif
endloop
//Activate Grommash Thunderfist and Units
call GroupAddUnits(Player(4), 'n00C', 2, null, x, y)
call GroupAddUnits(Player(4), 'n00D', 2, null, x, y)
call GroupAddUnits(Player(4), 'n00B', 2, null, x, y)
set x = GetUnitX(ArmyCommand[4])
set y = GetUnitY(ArmyCommand[4])
call ActivateEventHero(gg_unit_O00S_0599, Player(4), x, y, 4, true)
call RemoveRect ( gg_rct_eOgre_Trigger )
call RemoveRect ( gg_rct_rOgre_Trigger )
call EnableTrigger( gg_trg_Ironhide_Roar )
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eThunderfist_Bastion takes nothing returns nothing
set gg_trg_eThunderfist_Bastion = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eThunderfist_Bastion, gg_rct_eOgre_Trigger )
call TriggerAddCondition( gg_trg_eThunderfist_Bastion, Condition( function Trig_eThunderfist_Bastion_Conditions ) )
call TriggerAddAction( gg_trg_eThunderfist_Bastion, function Trig_eThunderfist_Bastion_Actions )
endfunction
function Trig_eAltar_of_Machinoboza_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(4) ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 6
endfunction
function Trig_eAltar_of_Machinoboza_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_Altar_of_Mach)
local real y = GetRectCenterY(gg_rct_Altar_of_Mach)
local group g = CreateGroup()
local unit u
//Activate the Thunderfist Bastion base
call ActivateEventBase(gg_unit_h001_0009, Player(4), null, true)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Tinkmaster Zizzik has ousted the human Machinoboza worshippers! His renowed tinkershop runs the show now!" )
call GroupEnumUnitsInRect(g, gg_rct_Altar_of_Mach, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (GetOwningPlayer(u) == Player(PLAYER_NEUTRAL_PASSIVE) ) then
if (GetUnitTypeId(u) == 'h0CI') then
call RemoveUnit(u)
endif
call SetUnitInvulnerable( u, false )
call SetUnitOwner( u, Player(4), true )
endif
endloop
//Activate Tinkmaster and Units
call GroupAddUnits(Player(4), 'o00O', 2, null, x, y)
call GroupAddUnits(Player(4), 'o01B', 2, null, x, y)
call ActivateEventHero(gg_unit_O00R_0598, Player(4), x, y, 5, true)
set x = GetUnitX(ArmyCommand[4])
set y = GetUnitY(ArmyCommand[4])
call EnableTrigger(gg_trg_Acidic_Web_Spray)
call RemoveRect ( gg_rct_Altar_of_Mach )
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eAltar_of_Machinoboza takes nothing returns nothing
set gg_trg_eAltar_of_Machinoboza = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eAltar_of_Machinoboza, gg_rct_Altar_of_Mach )
call TriggerAddCondition( gg_trg_eAltar_of_Machinoboza, Condition( function Trig_eAltar_of_Machinoboza_Conditions ) )
call TriggerAddAction( gg_trg_eAltar_of_Machinoboza, function Trig_eAltar_of_Machinoboza_Actions )
endfunction
function Trig_eZikka_DoomTank_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_O00Q_0533 ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 6
endfunction
function Trig_eZikka_DoomTank_Actions takes nothing returns nothing
local unit zikka = gg_unit_O00Q_0533
local real x = GetUnitX(zikka)
local real y = GetUnitY(zikka)
local integer index = 0
local integer ZikkaLvl = GetHeroLevel(zikka)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Zikka has gotten his hands on the best tech that Quel'dorash has to offer and created the MegaDoomTank!" )
//Give Doomtank items from Zikka
loop
exitwhen index == 6
call UnitRemoveItemFromSlotSwapped( index, zikka )
call UnitAddItemSwapped( GetLastRemovedItem(), gg_unit_O00N_0597 )
set index = index + 1
endloop
//Activate MegaDoomTank
set x = GetUnitX(ArmyCommand[4])
set y = GetUnitY(ArmyCommand[4])
call ActivateEventHero(gg_unit_O00N_0597, Player(4), x, y, ZikkaLvl, true)
call RemoveUnit(zikka)
call RemoveRect ( gg_rct_eZikka_DoomTank )
set zikka = null
call EnableTrigger (gg_trg_Earthshaker_Stomp)
call EnableTrigger (gg_trg_Gatling_Gun_Barrage)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eZikka_DoomTank takes nothing returns nothing
set gg_trg_eZikka_DoomTank = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eZikka_DoomTank, gg_rct_eZikka_DoomTank )
call TriggerAddCondition( gg_trg_eZikka_DoomTank, Condition( function Trig_eZikka_DoomTank_Conditions ) )
call TriggerAddAction( gg_trg_eZikka_DoomTank, function Trig_eZikka_DoomTank_Actions )
endfunction
function Trig_eJarekVorn_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[5])
local real y = GetUnitY(ArmyCommand[5])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Jarek Vorn, the Sandstorm Commando, has arrived!" )
call ActivateEventHero(gg_unit_H0HO_2017, Player(5), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eJarekVorn takes nothing returns nothing
set gg_trg_eJarekVorn = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eJarekVorn, 625.00 )
call TriggerAddAction( gg_trg_eJarekVorn, function Trig_eJarekVorn_Actions )
endfunction
function Trig_eHero_of_Havenford_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1C3'
endfunction
function Trig_eHero_of_Havenford_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[6])
local real y = GetUnitY(ArmyCommand[6])
call UnitRemoveAbility(gg_unit_h0CQ_0062, 'A1C3')
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Hero of Havenford has returned from his journey on The Great Road!" )
call ActivateEventHero(gg_unit_H0D0_2134, Player(6), x, y, 4, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eHero_of_Havenford takes nothing returns nothing
set gg_trg_eHero_of_Havenford = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_eHero_of_Havenford, Player(8), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_eHero_of_Havenford, gg_unit_h0CQ_0062, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_eHero_of_Havenford, Condition( function Trig_eHero_of_Havenford_Conditions ) )
call TriggerAddAction( gg_trg_eHero_of_Havenford, function Trig_eHero_of_Havenford_Actions )
endfunction
function Trig_eChieftain_Thunderhoof_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[6])
local real y = GetUnitY(ArmyCommand[6])
if ( GetWidgetLife(gg_unit_h03S_0092) > 0.405 ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The ancient war drums of the Mammoth Men of the north echo through the valleys of Ilium. Chieftain Thunderhoof has returned from his journey on the Great Road." )
call ActivateEventHero(gg_unit_H0D3_0527, Player(6), x, y, 4, true)
call DestroyTrigger( GetTriggeringTrigger() )
else
call DestroyTrigger( gg_trg_eChieftain_Thunderhoof )
endif
endfunction
//===========================================================================
function InitTrig_eChieftain_Thunderhoof takes nothing returns nothing
set gg_trg_eChieftain_Thunderhoof = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eChieftain_Thunderhoof, 1080.00 )
call TriggerAddAction( gg_trg_eChieftain_Thunderhoof, function Trig_eChieftain_Thunderhoof_Actions )
endfunction
function Trig_eKuzao_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[7])
local real y = GetUnitY(ArmyCommand[7])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0A silent whisper of steel announces the arrival of Kazuo the Crimson Phantom. Shrouded in his reddish-black samurai armor, he moves like a shadow, his katana a deadly extension of his will. He seeks revenger for his brother in arms, Toshiro." )
call ActivateEventHero(gg_unit_H09I_2104, Player(7), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eKuzao takes nothing returns nothing
set gg_trg_eKuzao = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eKuzao, gg_unit_H09G_1526, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eKuzao, function Trig_eKuzao_Actions )
endfunction
function Trig_eZhen_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[7])
local real y = GetUnitY(ArmyCommand[7])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The air crackles with raw energy as Zhen the Tempest Blade steps onto the battlefield, his dual warglaives gleaming with a storm's fury after to avenge Kenta." )
call ActivateEventHero(gg_unit_H09O_2101, Player(7), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eZhen takes nothing returns nothing
set gg_trg_eZhen = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eZhen, gg_unit_H09J_1529, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eZhen, function Trig_eZhen_Actions )
endfunction
function Trig_eSylas_Darkweaver_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[7])
local real y = GetUnitY(ArmyCommand[7])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0A shadow falls over the land as Sylas the Dark Weaver, Master of Forbidden Arts, steps forth from the realm of darkness. With a flick of his sickle and a whisper of dark incantations, Sylas is prepared to bend the fabric of reality to his will." )
call ActivateEventHero(gg_unit_H0DH_2139, Player(7), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eSylas_Darkweaver takes nothing returns nothing
set gg_trg_eSylas_Darkweaver = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eSylas_Darkweaver, 800.00 )
call TriggerAddAction( gg_trg_eSylas_Darkweaver, function Trig_eSylas_Darkweaver_Actions )
endfunction
function Trig_eFurnace_Colossus_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[8])
local real y = GetUnitY(ArmyCommand[8])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Base Destroyed: |r|cff0080c0The Celestial Cathedral has been razed! The mighty protector of Aurora's secrets, the Furnace Colossus, has been released from Aurora to punish the blasphemors!." )
call ActivateEventHero(gg_unit_H00W_0060, Player(8), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Molten_Armor )
endfunction
//===========================================================================
function InitTrig_eFurnace_Colossus takes nothing returns nothing
set gg_trg_eFurnace_Colossus = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eFurnace_Colossus, gg_unit_h0B3_0926, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_eFurnace_Colossus, function Trig_eFurnace_Colossus_Actions )
endfunction
function Trig_eLuminar_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[8])
local real y = GetUnitY(ArmyCommand[8])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Luminar has returned from his pilgrimage to spread the teachings of Aurora!" )
call ActivateEventHero(gg_unit_H01O_0065, Player(8), x, y, 3, true)
call EnableTrigger( gg_trg_Blessing_of_Aurora)
call EnableTrigger( gg_trg_Auroras_Judgment)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eLuminar takes nothing returns nothing
set gg_trg_eLuminar = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eLuminar, 660.00 )
call TriggerAddAction( gg_trg_eLuminar, function Trig_eLuminar_Actions )
endfunction
function Trig_eThalion_Conditions takes nothing returns boolean
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I011') == false ) then
return false
endif
if (GetHeroLevel(GetTriggerUnit()) >= 6 ) then
return true
endif
return true
endfunction
function Trig_eThalion_Actions takes nothing returns nothing
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffff0000Major Event: |r|cff0080c0Thalion has obtained Dawn Ore and combined it with his blade to create the Celestial Dawnblade!" )
call UnitAddAbility( GetTriggerUnit(), 'A08R' )
call SetItemPositionLoc( GetItemOfTypeFromUnitBJ(gg_unit_H05X_0850, 'I011'), GetRectCenter(gg_rct_Dummy_Box) )
call SetItemPositionLoc( GetItemOfTypeFromUnitBJ(gg_unit_H05X_0850, 'I015'), GetRectCenter(gg_rct_Dummy_Box) )
call UnitAddItemToSlotById(GetTriggerUnit(), 'I019', 0)
call BlzUnitHideAbility( gg_unit_H05X_0850, 'A0GA', true )
call DestroyTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Vulcanus_Summoning_Started )
endfunction
//===========================================================================
function InitTrig_eThalion takes nothing returns nothing
set gg_trg_eThalion = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eThalion, gg_unit_H05X_0850, EVENT_UNIT_HERO_LEVEL )
call TriggerRegisterUnitEvent( gg_trg_eThalion, gg_unit_H05X_0850, EVENT_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_eThalion, Condition( function Trig_eThalion_Conditions ) )
call TriggerAddAction( gg_trg_eThalion, function Trig_eThalion_Actions )
endfunction
globals
boolean VulcanusSummoned = false
endglobals
function Trig_Vulcanus_Summoning_Started_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A08R'
endfunction
function Trig_Vulcanus_Summoning_Finished takes nothing returns nothing
local timer t = CreateTimer()
local real x = GetUnitX(gg_unit_H05X_0850)
local real y = GetUnitY(gg_unit_H05X_0850)
set VulcanusSummoned = true
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffff0000Major Event: |r|cff0080c0Vulcanus has emerged from beyond the Veil - a twisted avatar of Aurora. With Vulcanus' emergence comes Valyra the Stormblade, the greatest champion of Avandor, to hunt the twisted avatar!" )
call UnitRemoveAbility(gg_unit_H05X_0850, 'A08R')
call ActivateEventHero(gg_unit_H01N_0042, Player(8), x, y, 5, false)
call TimerDialogDisplay(VulcanusTimerDialog, false)
call DestroyTimerDialog(VulcanusTimerDialog)
//call EnableTrigger( gg_trg_Nagash_Blight )
call DestroyTrigger( gg_trg_Vulcanus_Summoning_Started )
call DestroyTrigger( gg_trg_Vulcanus_Summoning_Canceled )
call EnableTrigger( gg_trg_Pyreclast_Smash)
call EnableTrigger( gg_trg_Explosive_Rune)
//call for Light Blue's hero, Valyra
set x = GetUnitX(ArmyCommand[9])
set y = GetUnitY(ArmyCommand[9])
call ActivateEventHero(gg_unit_H06O_2083, Player(9), x, y, 5, false)
call EnableTrigger( gg_trg_Leaping_Strike)
call EnableTrigger( gg_trg_Tough_as_Nails)
call DestroyTrigger( GetTriggeringTrigger() )
set t = null
endfunction
function Trig_Vulcanus_Summoning_Started_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
set VulcanusTimer = CreateTimer()
set VulcanusTimerDialog = CreateTimerDialog(VulcanusTimer)
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffff0000Major Event: |r|cff0080c0Thalion has begun summoning Vulcanus from beyond the Veil!" )
call PingMinimapForForceEx( bj_FORCE_ALL_PLAYERS, x, y, 15.00, bj_MINIMAPPINGSTYLE_ATTACK, 100, 100, 100 )
call TimerStart( VulcanusTimer, 120.00, false, function Trig_Vulcanus_Summoning_Finished )
call TimerDialogSetTitle(VulcanusTimerDialog, "Vulcanus")
call TimerDialogDisplay(VulcanusTimerDialog, true)
call EnableTrigger( gg_trg_Vulcanus_Summoning_Canceled )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Vulcanus_Summoning_Started takes nothing returns nothing
set gg_trg_Vulcanus_Summoning_Started = CreateTrigger( )
call DisableTrigger( gg_trg_Vulcanus_Summoning_Started )
call TriggerRegisterUnitEvent( gg_trg_Vulcanus_Summoning_Started, gg_unit_H05X_0850, EVENT_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Vulcanus_Summoning_Started, Condition( function Trig_Vulcanus_Summoning_Started_Conditions ) )
call TriggerAddAction( gg_trg_Vulcanus_Summoning_Started, function Trig_Vulcanus_Summoning_Started_Actions )
endfunction
function Trig_Vulcanus_Summoning_Canceled_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A08R'
endfunction
function Trig_Vulcanus_Summoning_Canceled_Actions takes nothing returns nothing
call PauseTimer( VulcanusTimer )
call DestroyTimerDialog( VulcanusTimerDialog )
call EnableTrigger( gg_trg_Vulcanus_Summoning_Started )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Vulcanus_Summoning_Canceled takes nothing returns nothing
set gg_trg_Vulcanus_Summoning_Canceled = CreateTrigger( )
call DisableTrigger( gg_trg_Vulcanus_Summoning_Canceled )
call TriggerRegisterUnitEvent( gg_trg_Vulcanus_Summoning_Canceled, gg_unit_H05X_0850, EVENT_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Vulcanus_Summoning_Canceled, Condition( function Trig_Vulcanus_Summoning_Canceled_Conditions ) )
call TriggerAddAction( gg_trg_Vulcanus_Summoning_Canceled, function Trig_Vulcanus_Summoning_Canceled_Actions )
endfunction
function Trig_eLyrielle_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(9) ) ) then
return false
endif
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == false ) then
return false
endif
if ( GetHeroLevel(GetTriggerUnit()) >= 4 == false ) then
return false
endif
return true
//return GetHeroLevel(GetTriggerUnit()) >= 4
endfunction
function Trig_eLyrielle_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_eLyrielle)
local real y = GetRectCenterY(gg_rct_eLyrielle)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Lyrielle and her company has returned from her journey on the Great Road to assist Avandor!" )
//Activate Lyrielle, the Arcane Tempest hero
call GroupAddUnits(Player(9), 'h06R', 4, null, x, y)
call GroupAddUnits(Player(9), 'h06P', 10, null, x, y)
call GroupAddUnits(Player(9), 'h06S', 4, null, x, y)
set x = GetUnitX(ArmyCommand[9])
set y = GetUnitY(ArmyCommand[9])
call ActivateEventHero(gg_unit_H06I_0950, Player(9), x, y, 3, true)
call EnableTrigger( gg_trg_Dominance )
call EnableTrigger( gg_trg_Ley_Line_Seal )
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eLyrielle takes nothing returns nothing
set gg_trg_eLyrielle = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eLyrielle, gg_rct_eLyrielle )
call TriggerAddCondition( gg_trg_eLyrielle, Condition( function Trig_eLyrielle_Conditions ) )
call TriggerAddAction( gg_trg_eLyrielle, function Trig_eLyrielle_Actions )
endfunction
function Trig_eKaelia_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[9])
local real y = GetUnitY(ArmyCommand[9])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Kaelia has returned to Quel'Dorash to hunt down the zealots!" )
call ActivateEventHero(gg_unit_H06K_0921, Player(9), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eKaelia takes nothing returns nothing
set gg_trg_eKaelia = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eKaelia, 660.00 )
call TriggerAddAction( gg_trg_eKaelia, function Trig_eKaelia_Actions )
endfunction
function Trig_eHero_of_Port_Duragol_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1C4'
endfunction
function Trig_eHero_of_Port_Duragol_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[10])
local real y = GetUnitY(ArmyCommand[10])
call UnitRemoveAbility(gg_unit_h0CR_2115, 'A1C4')
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The Hero of Port Duragol has returned from her journey on The Great Road!" )
call ActivateEventHero(gg_unit_H040_0438, Player(10), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eHero_of_Port_Duragol takes nothing returns nothing
set gg_trg_eHero_of_Port_Duragol = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_eHero_of_Port_Duragol, Player(10), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_eHero_of_Port_Duragol, gg_unit_h0CR_2115, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_eHero_of_Port_Duragol, Condition( function Trig_eHero_of_Port_Duragol_Conditions ) )
call TriggerAddAction( gg_trg_eHero_of_Port_Duragol, function Trig_eHero_of_Port_Duragol_Actions )
endfunction
function Trig_eArchibald_Flux_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[10])
local real y = GetUnitY(ArmyCommand[10])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Gromokol's most brilliant and quirky arcanist, Archibald Flux, has emerged from the great library of Cogfal to study the Mammoth Men." )
call ActivateEventHero(gg_unit_H00J_0021, Player(10), x, y, 4, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eArchibald_Flux takes nothing returns nothing
set gg_trg_eArchibald_Flux = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eArchibald_Flux, 1140.00 )
call TriggerAddAction( gg_trg_eArchibald_Flux, function Trig_eArchibald_Flux_Actions )
endfunction
function Trig_eDeepvein_Hollow_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_eDeepvein_Hollow_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[11])
local real y = GetUnitY(ArmyCommand[11])
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
if ( IsUnitAlly(GetAttacker(), Player(11)) ) then
call ActivateEventHero(gg_unit_H04F_0592, Player(11), x, y, 3, true)
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The shadows of Deepvein Hollow stir as a legendary figure steps into the light. Halden Drakeshot, the Dragon's Sting, joins the dwarf cause, his deadly crossbow aimed at their enemies. Remembered for the night he single-handedly fended off a goblin horde, his lethal precision is now theirs to command. Brace yourselves, for with Halden at their side, nothing can standin their way!" )
call ActivateEventBase(GetTriggerUnit(), Player(11), null, true)
endif
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eDeepvein_Hollow takes nothing returns nothing
set gg_trg_eDeepvein_Hollow = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eDeepvein_Hollow, gg_unit_h093_1463, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_eDeepvein_Hollow, Condition( function Trig_eDeepvein_Hollow_Conditions ) )
call TriggerAddAction( gg_trg_eDeepvein_Hollow, function Trig_eDeepvein_Hollow_Actions )
endfunction
function Trig_eDaz_Crystalbeard_Conditions takes nothing returns boolean
return GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) <= 500.00
endfunction
function Trig_eDaz_Crystalbeard_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_Urzukar_Depths)
local real y = GetRectCenterY(gg_rct_Urzukar_Depths)
//Ally of Dwarves
if ( IsUnitAlly(GetAttacker(), Player(1)) ) then
call SetWidgetLife(GetTriggerUnit(), GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE))
call ActivateEventBase(GetTriggerUnit(), Player(11), null, true)
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Against all odds, the dwarfs have triumphed over the menacing orcs of Urzukar Depths. As the dust settles and the echoes of battle fade, a new hero emerges from the shadows. Daz Crystalbeard, the Crystal Mage of the Down-Under. Wielding the raw power of the mystical crystals, he is a beacon of hope and a testament to the dwarven tenacity. Under his leadership, a new era dawns for the Dwarves in the Down-Under!" )
call GroupAddUnits(Player(11), 'h08W', 6, null, x, y)
//send Daz to army command
set x = GetUnitX(ArmyCommand[11])
set y = GetUnitY(ArmyCommand[11])
call ActivateEventHero(gg_unit_H04I_0595, Player(11), x, y, 3, true)
endif
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eDaz_Crystalbeard takes nothing returns nothing
set gg_trg_eDaz_Crystalbeard = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eDaz_Crystalbeard, gg_unit_h094_1464, EVENT_UNIT_ATTACKED)
call TriggerAddCondition( gg_trg_eDaz_Crystalbeard, Condition( function Trig_eDaz_Crystalbeard_Conditions ) )
call TriggerAddAction( gg_trg_eDaz_Crystalbeard, function Trig_eDaz_Crystalbeard_Actions )
endfunction
function Trig_eThorin_Thunderhammer_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_eThorin_Thunderhammer)
local real y = GetRectCenterY(gg_rct_eThorin_Thunderhammer)
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The ground quakes and the air shivers with electric tension as Thorin Thunderhammer, the stalwart defender of the Dwarven City States, arrives on the battlefield. His legendary hammer, crackling with untamed lightning, promises swift and unyielding justice to any who dare threaten his kinsfolk. Let the enemies of the Dwarves despair, for their doom is upon them!" )
call GroupAddUnits(Player(11), 'h08V', 6, null, x, y)
set x = GetUnitX(ArmyCommand[11])
set y = GetUnitY(ArmyCommand[11])
call DestroyEffect(AddSpecialEffect("Stormfall.mdx", x, y))
call ActivateEventHero(gg_unit_H04J_0594, Player(11), x, y, 5, true)
endfunction
//===========================================================================
function InitTrig_eThorin_Thunderhammer takes nothing returns nothing
set gg_trg_eThorin_Thunderhammer = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eThorin_Thunderhammer, 1500.00 )
call TriggerAddAction( gg_trg_eThorin_Thunderhammer, function Trig_eThorin_Thunderhammer_Actions )
endfunction
function Trig_eTitanbreaker_Actions takes nothing returns nothing
local unit u = gg_unit_h04B_0468
if ( GetWidgetLife(u) > 0.405 ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0The dwarves have successfully defended the Titanbreaker long enough to prepare it for war!" )
call PauseUnit(u, false)
call DestroyTrigger( GetTriggeringTrigger() )
else
call DestroyTrigger( gg_trg_eTitanbreaker )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_eTitanbreaker takes nothing returns nothing
set gg_trg_eTitanbreaker = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eTitanbreaker, 600.00 )
call TriggerAddAction( gg_trg_eTitanbreaker, function Trig_eTitanbreaker_Actions )
endfunction
function Trig_eMorriganth_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[12])
local real y = GetUnitY(ArmyCommand[12])
if ( GetWidgetLife(gg_unit_h0AD_1774) > 0.405 ) then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Morriganth has emerged from the realm-beyond, further tearing the veil, and bringing his destructive might into this world." )
call ActivateEventHero(gg_unit_U005_1649, Player(12), x, y, 5, true)
call EnableTrigger(gg_trg_Aura_of_Desolation)
call EnableTrigger(gg_trg_Sovereigns_Eclipse)
call EnableTrigger(gg_trg_Evil_Ruler)
call DestroyTrigger( GetTriggeringTrigger() )
else
call DestroyTrigger( gg_trg_eMorriganth )
endif
endfunction
//===========================================================================
function InitTrig_eMorriganth takes nothing returns nothing
set gg_trg_eMorriganth = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eMorriganth, 1800.00 )
call TriggerAddAction( gg_trg_eMorriganth, function Trig_eMorriganth_Actions )
endfunction
function Trig_eBalzathor_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(12) ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetWidgetLife(gg_unit_h0AP_1111) < 0.405 ) ) then
return false
endif
return GetHeroLevel(GetTriggerUnit()) >= 4
endfunction
function Trig_eBalzathor_Actions takes nothing returns nothing
local real x = GetRectCenterX(gg_rct_eBalzathor)
local real y = GetRectCenterY(gg_rct_eBalzathor)
local group g = CreateGroup()
local unit u
//Activate the Infernal Spire base
call ActivateEventBase(gg_unit_h0CP_1946, Player(12), null, true)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Morriganth's dark acolytes have completed their ritual at the Infernal Spire - their dark incantations tearing a rift between this world and the realm-beyond, allowing the great Spawn - Balthazor - to emerge and cast a shadow upon this realm!" )
call GroupEnumUnitsInRect(g, gg_rct_eBalzathor, null)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (GetOwningPlayer(u) == Player(PLAYER_NEUTRAL_PASSIVE) ) then
if (GetUnitTypeId(u) == 'h0CI') then
call RemoveUnit(u)
endif
call SetUnitInvulnerable( u, false )
call SetUnitOwner( u, Player(12), true )
endif
endloop
//Activate Balzathor and Units
call GroupAddUnits(Player(12), 'h0A5', 2, null, x, y)
call GroupAddUnits(Player(12), 'h0A8', 2, null, x, y)
call GroupAddUnits(Player(12), 'h0A3', 2, null, x, y)
set x = GetUnitX(ArmyCommand[12])
set y = GetUnitY(ArmyCommand[12])
call ActivateEventHero(gg_unit_U006_1981, Player(12), x, y, 4, true)
call EnableTrigger(gg_trg_Void_Smash)
call EnableTrigger(gg_trg_The_Beyond)
call EnableTrigger(gg_trg_Abyssal_Wrath)
call EnableTrigger(gg_trg_Void_Projection)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eBalzathor takes nothing returns nothing
set gg_trg_eBalzathor = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_eBalzathor, gg_rct_eBalzathor )
call TriggerAddCondition( gg_trg_eBalzathor, Condition( function Trig_eBalzathor_Conditions ) )
call TriggerAddAction( gg_trg_eBalzathor, function Trig_eBalzathor_Actions )
endfunction
function Trig_eBalzathor_Supreme_Conditions takes nothing returns boolean
if ( not ( GetHeroLevel(gg_unit_U006_1981) == 12 ) ) then
return false
endif
return true
endfunction
function Trig_eBalzathor_Supreme_Actions takes nothing returns nothing
local unit balz = gg_unit_U006_1981
local real x = GetUnitX(balz)
local real y = GetUnitY(balz)
local integer index = 0
local integer lvl = GetHeroLevel(balz)
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Balzathor has become powerful enough to maintain his true form beyond the Veil!" )
//Give Balz Supreme items from Balz
loop
exitwhen index == 6
call UnitRemoveItemFromSlotSwapped( index, gg_unit_U006_1981 )
call UnitAddItemSwapped( GetLastRemovedItem(), gg_unit_U006_2208 )
set index = index + 1
endloop
//Activate new Balz hero and remove old
call ActivateEventHero(gg_unit_U006_2208, Player(12), x, y, lvl, true)
call RemoveUnit(balz)
call DestroyTrigger(GetTriggeringTrigger())
set balz = null
endfunction
//===========================================================================
function InitTrig_eBalzathor_Supreme takes nothing returns nothing
set gg_trg_eBalzathor_Supreme = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eBalzathor_Supreme, gg_unit_U006_1981, EVENT_UNIT_HERO_LEVEL )
call TriggerAddCondition( gg_trg_eBalzathor_Supreme, Condition( function Trig_eBalzathor_Supreme_Conditions ) )
call TriggerAddAction( gg_trg_eBalzathor_Supreme, function Trig_eBalzathor_Supreme_Actions )
endfunction
function Trig_eAwakening_of_Nexumbra_Conditions takes nothing returns boolean
return GetHeroLevel(GetTriggerUnit()) >= 8
endfunction
function Trig_eAwakening_of_Nexumbra_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_eAwakening_of_Nexumbra takes nothing returns nothing
set gg_trg_eAwakening_of_Nexumbra = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_eAwakening_of_Nexumbra, gg_unit_U005_1649, EVENT_UNIT_HERO_LEVEL )
call TriggerAddCondition( gg_trg_eBalzathor, Condition( function Trig_eAwakening_of_Nexumbra_Conditions ) )
call TriggerAddAction( gg_trg_eAwakening_of_Nexumbra, function Trig_eAwakening_of_Nexumbra_Actions )
endfunction
function Trig_eGolemnar_Actions takes nothing returns nothing
local real x = GetUnitX(ArmyCommand[13])
local real y = GetUnitY(ArmyCommand[13])
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00Event: |r|cff0080c0Golemnar, the Ritual Colossus, has been summoned from Zephyrskar!" )
call ActivateEventHero(gg_unit_H0FY_1854, Player(13), x, y, 3, true)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_eGolemnar takes nothing returns nothing
set gg_trg_eGolemnar = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_eGolemnar, 625.00 )
call TriggerAddAction( gg_trg_eGolemnar, function Trig_eGolemnar_Actions )
endfunction
globals
hashtable array AbilityTable
endglobals
function Trig_Player_Ability_Hashtables_Actions takes nothing returns nothing
local integer i = 0
//Everything could just be in a single hashtable, i suppose, but not sure abo
loop
exitwhen i == 14
set AbilityTable[i] = InitHashtable()
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Player_Ability_Hashtables takes nothing returns nothing
set gg_trg_Player_Ability_Hashtables = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Player_Ability_Hashtables, 1.25, false )
call TriggerAddAction( gg_trg_Player_Ability_Hashtables, function Trig_Player_Ability_Hashtables_Actions )
endfunction
function Trig_Calculate_Range_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0RK'
endfunction
function Trig_Calculate_Range_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local real x2 = GetSpellTargetX()
local real y2 = GetSpellTargetY()
local real dist
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", x2, y2 ) )
set dist = SquareRoot( (x2 - x) * (x2 - x) + (y2 -y) * (y2 - y) )
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Distance to target: " + R2S(dist))
endfunction
//===========================================================================
function InitTrig_Calculate_Range takes nothing returns nothing
set gg_trg_Calculate_Range = CreateTrigger( )
call TriggerAddCondition( gg_trg_Calculate_Range, Condition( function Trig_Calculate_Range_Conditions ) )
call TriggerAddAction( gg_trg_Calculate_Range, function Trig_Calculate_Range_Actions )
endfunction
function Trig_Airship_Unlock_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(GetKillingUnit())
if ( GetUnitAbilityLevel(u, 'A1RI') == 1 ) then
call DisplayTimedTextToPlayer(p, 0, 0, 15.00, "With the destruction of your nemesis, you may now use Airship travel if armies have upgraded past level 2!")
//Red defeated
if ( GetTriggerUnit() == gg_unit_h07Y_1144 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(2) )
endif
//Blue defeated
if ( GetTriggerUnit() == gg_unit_h03N_0210 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(12) )
endif
//Teal defeated
if ( GetTriggerUnit() == gg_unit_h01U_0720 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(0) )
endif
//Purple defeated
if ( GetTriggerUnit() == gg_unit_h08K_1376 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(7) )
endif
//Yellow defeated
if ( GetTriggerUnit() == gg_unit_h058_0667 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(11) )
endif
//Orange defeated
if ( GetTriggerUnit() == gg_unit_h0GP_2155 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(13) )
endif
//Green defeated
if ( GetTriggerUnit() == gg_unit_h03V_0293 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(10) )
endif
//Pink defeated
if ( GetTriggerUnit() == gg_unit_h097_1514 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(3) )
endif
//Gray defeated
if ( GetTriggerUnit() == gg_unit_h06E_0868 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(9) )
endif
//Light Blue defeated
if ( GetTriggerUnit() == gg_unit_h08P_0081 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(8) )
endif
//Dark Green defeated
if ( GetTriggerUnit() == gg_unit_h01X_0108 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(6) )
endif
//Brown defeated
if ( GetTriggerUnit() == gg_unit_h07T_1138 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(4) )
endif
//Maroon defeated
if ( GetTriggerUnit() == gg_unit_h0AD_1774 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(1) )
endif
//Navy defeated
if ( GetTriggerUnit() == gg_unit_h0G5_1974 ) then
call SetPlayerTechResearchedSwap( 'R05I', 1, Player(5) )
endif
endif
endfunction
//===========================================================================
function InitTrig_Airship_Unlock takes nothing returns nothing
set gg_trg_Airship_Unlock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Airship_Unlock, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Airship_Unlock, function Trig_Airship_Unlock_Actions )
endfunction
function Delivery_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'o01L' ) ) then
return false
endif
return true
endfunction
function Trig_Delivery_Actions takes nothing returns nothing
local unit dummy
local unit caster = GetTriggerUnit()
local integer ctr = 0
local unit ward = GetSummonedUnit()
local real x = GetUnitX(ward)
local real y = GetUnitY(ward)
call PolledWait(15.00)
if ( GetWidgetLife(ward) > 0.405 ) then
loop
exitwhen ctr == 5
set dummy = (CreateUnit(GetOwningPlayer(caster),'h02L', x, y, bj_UNIT_FACING))
call UnitApplyTimedLife( dummy, 'BTLF', 16.00)
call UnitAddAbility(dummy,'A1RF')
call IssuePointOrderLocBJ( dummy, "darksummoning", GetRectCenter(GetPlayableMapRect()) )
call PolledWait(0.05)
set ctr = ctr + 1
endloop
endif
set dummy = null
set caster = null
set ward = null
endfunction
//===========================================================================
function InitTrig_Delivery takes nothing returns nothing
set gg_trg_Delivery = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Delivery, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Delivery, Condition( function Delivery_Conditions) )
call TriggerAddAction( gg_trg_Delivery, function Trig_Delivery_Actions )
endfunction
function Mortar_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1RJ'
endfunction
function Mortar_Strike_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit dummy
local group g = CreateGroup()
local unit u
local integer lim = 0
local integer p = GetPlayerId(GetTriggerPlayer())
set dummy = (CreateUnit(GetOwningPlayer(GetTriggerUnit()),'h02L', x, y, bj_UNIT_FACING))
call GroupEnumUnitsInRange(g, x, y, 375, null)
set lim = BlzGroupGetSize(g)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if (GetOwningPlayer(u) == Player(PLAYER_NEUTRAL_PASSIVE)) then
if (GetUnitTypeId(u) == 'h0CI') then
call PingMinimapForForceEx( bj_FORCE_ALL_PLAYERS, x, y, 10.00, bj_MINIMAPPINGSTYLE_ATTACK, 100, 100, 100 )
set x = GetUnitX(u)
set y = GetUnitY(u)
call DestroyEffect(AddSpecialEffect("ExplosionBIG.mdx", x, y))
call BlzStartUnitAbilityCooldown(ArmyCommand[p], 'A1RJ' , 180.00)
call RemoveUnit(u)
endif
endif
endloop
call DestroyGroup(g)
set u = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Mortar_Strike takes nothing returns nothing
set gg_trg_Mortar_Strike = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Mortar_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_Mortar_Strike, Condition(function Mortar_Strike_Conditions))
call TriggerAddAction(gg_trg_Mortar_Strike, function Mortar_Strike_Actions)
endfunction
function Trig_Dragons_Roost_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RP' ) ) then
return false
endif
return true
endfunction
function Trig_Dragons_Roost_Actions takes nothing returns nothing
local unit roost
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit dummy
local player p = Player(0)
local unit u = GetTriggerUnit()
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vDrakoria, dummy) == true ) then
set dummy = (CreateUnit( p, 'h0HP', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 15.00)
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + 45))
call BlzEndUnitAbilityCooldown( GetTriggerUnit(), 'A1RP' )
endif
set dummy = null
endfunction
//===========================================================================
function InitTrig_Dragons_Roost takes nothing returns nothing
set gg_trg_Dragons_Roost = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Dragons_Roost, gg_unit_h00G_1280, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dragons_Roost, Condition( function Trig_Dragons_Roost_Conditions ) )
call TriggerAddAction( gg_trg_Dragons_Roost, function Trig_Dragons_Roost_Actions )
endfunction
function Trig_Draconic_Firestorm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RO' ) ) then
return false
endif
return true
endfunction
function Trig_Draconic_Firestorm_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit u = GetTriggerUnit()
local unit dummy
local player p = Player(0)
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vSilverfall, dummy) == true ) then
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbilityBJ( 'A1RM', dummy )
call IssuePointOrderLocBJ( dummy, "flamestrike", GetSpellTargetLoc() )
call AddSpecialEffectLocBJ( GetSpellTargetLoc(), "units\\creeps\\RedDragon\\RedDragon.mdl" )
call BlzSetSpecialEffectScale( GetLastCreatedEffectBJ(), 2.00 )
call BlzSetSpecialEffectHeight( GetLastCreatedEffectBJ(), 380.00 )
call BlzPlaySpecialEffect( GetLastCreatedEffectBJ(), ANIM_TYPE_ATTACK )
call TriggerSleepAction( 1.50 )
call BlzPlaySpecialEffect( GetLastCreatedEffectBJ(), ANIM_TYPE_ATTACK )
call TriggerSleepAction( 1.50 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + 60))
call BlzEndUnitAbilityCooldown( GetTriggerUnit(), 'A1RO' )
endif
set dummy = null
endfunction
//===========================================================================
function InitTrig_Draconic_Firestorm takes nothing returns nothing
set gg_trg_Draconic_Firestorm = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Draconic_Firestorm, gg_unit_h00G_1280, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Draconic_Firestorm, Condition( function Trig_Draconic_Firestorm_Conditions ) )
call TriggerAddAction( gg_trg_Draconic_Firestorm, function Trig_Draconic_Firestorm_Actions )
endfunction
function Trig_Draconic_Vortex_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RN' ) ) then
return false
endif
return true
endfunction
// Tornado Spell Cast Function
function CastDraconicVortex takes unit caster, real targetX, real targetY returns nothing
local integer i = 0
local integer count = GetRandomInt(1, 3)
local unit tornado
local real angle
local real distance
local real newX
local real newY
local unit dummy
local player p = Player(0)
local unit u = GetTriggerUnit()
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', targetX, targetY, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vSilverfall, dummy) == true or RectContainsUnit(gg_rct_vDrakoria, dummy) == true) then
// Spawn tornadoes
loop
exitwhen i >= count
// Calculate random spawn position within the range
set angle = GetRandomReal(0, 2 * bj_PI)
set distance = GetRandomReal(0, 500)
set newX = targetX + distance * Cos(angle)
set newY = targetY + distance * Sin(angle)
// Create the tornado unit
set tornado = CreateUnit(GetOwningPlayer(caster), 'ntor', newX, newY, GetRandomReal(0, 360))
// Set the tornado expiration timer
call UnitApplyTimedLife(tornado, 'BTLF', 15)
// Start the tornado movement
call IssuePointOrder(tornado, "move", GetUnitX(tornado) + GetRandomReal(-100, 100), GetUnitY(tornado) + GetRandomReal(-100, 100))
set i = i + 1
endloop
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + 90))
call BlzEndUnitAbilityCooldown( GetTriggerUnit(), 'A1RN' )
endif
set tornado = null
set caster = null
set dummy = null
endfunction
// Tornado Spell Cast Trigger
function Trig_Draconic_Vortex_Actions takes nothing returns boolean
local unit caster = GetTriggerUnit()
local real targetX = GetSpellTargetX()
local real targetY = GetSpellTargetY()
// Call the tornado spell cast function
call CastDraconicVortex(caster, targetX, targetY)
return false
endfunction
//===========================================================================
function InitTrig_Draconic_Vortex takes nothing returns nothing
set gg_trg_Draconic_Vortex = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Draconic_Vortex, gg_unit_h00G_1280, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Draconic_Vortex, Condition( function Trig_Draconic_Vortex_Conditions ) )
call TriggerAddAction( gg_trg_Draconic_Vortex, function Trig_Draconic_Vortex_Actions )
endfunction
globals
real xAstral
real yAstral
endglobals
function Trig_Astral_Manipulation_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RS' ) ) then
return false
endif
return true
endfunction
// Tornado Spell Cast Function
function Trig_Astral_Manipulation_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit dummy
local player p = Player(2)
local unit u = GetTriggerUnit()
set xAstral = GetSpellTargetX()
set yAstral = GetSpellTargetY()
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vSilverfall, dummy) == true ) then
call EnableTrigger( gg_trg_Astral_Manipulation_Loop )
call AddSpecialEffectLocBJ( GetSpellTargetLoc(), "Doodads\\Cinematic\\EnergyField\\EnergyField.mdl" )
call BlzSetSpecialEffectScale( GetLastCreatedEffectBJ(), 1.50 )
// Wait for the duration of the energy field
call TriggerSleepAction(10.00)
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call DisableTrigger( gg_trg_Astral_Manipulation_Loop)
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + 60))
call BlzEndUnitAbilityCooldown( GetTriggerUnit(), 'A1RS' )
endif
set dummy = null
endfunction
//===========================================================================
function InitTrig_Astral_Manipulation takes nothing returns nothing
set gg_trg_Astral_Manipulation = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Astral_Manipulation, gg_unit_h00G_0971, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Astral_Manipulation, Condition( function Trig_Astral_Manipulation_Conditions ) )
call TriggerAddAction( gg_trg_Astral_Manipulation, function Trig_Astral_Manipulation_Actions )
endfunction
function Astral_Manipulation_Loop_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit currentunit
local unit dummy
local real width = 700.00
local real height = 700.00
local rect energyField = Rect(xAstral - width / 2, yAstral - height / 2, xAstral + width / 2, yAstral + height / 2)
local player p = Player(2)
// Apply the slow effect to units entering the energy field
set dummy = (CreateUnit( p, 'h02L', xAstral, yAstral, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 10.05)
call UnitAddAbility(dummy, 'A1RT')
call GroupEnumUnitsInRect(g, energyField, null)
loop
set currentunit = FirstOfGroup(g)
exitwhen currentunit == null
call IssueTargetOrderBJ( dummy, "slow", currentunit )
call GroupRemoveUnit(g, currentunit)
endloop
set dummy = null
set currentunit = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Astral_Manipulation_Loop takes nothing returns nothing
set gg_trg_Astral_Manipulation_Loop = CreateTrigger( )
call DisableTrigger( gg_trg_Astral_Manipulation_Loop )
call TriggerAddAction( gg_trg_Astral_Manipulation_Loop, function Astral_Manipulation_Loop_Actions )
call TriggerRegisterTimerEvent( gg_trg_Astral_Manipulation_Loop, 0.5, true )
endfunction
function Trig_Cosmic_Downpour_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RV' ) ) then
return false
endif
return true
endfunction
function Trig_Cosmic_Downpour_Actions takes nothing returns nothing
local unit roost
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit dummy
local player p = Player(2)
local unit u = GetTriggerUnit()
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vDrakoria, dummy) == true ) then
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 5.00)
call UnitAddAbilityBJ( 'A1RU', dummy )
call IssuePointOrderLocBJ( dummy, "blizzard", GetSpellTargetLoc() )
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u, UNIT_STATE_MANA) + 60))
call BlzEndUnitAbilityCooldown( GetTriggerUnit(), 'A1RV' )
endif
set dummy = null
endfunction
//===========================================================================
function InitTrig_Cosmic_Downpour takes nothing returns nothing
set gg_trg_Cosmic_Downpour = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Cosmic_Downpour, gg_unit_h00G_0971, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cosmic_Downpour, Condition( function Trig_Cosmic_Downpour_Conditions ) )
call TriggerAddAction( gg_trg_Cosmic_Downpour, function Trig_Cosmic_Downpour_Actions )
endfunction
function Trig_Lunar_Aegis_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1RW' ) ) then
return false
endif
return true
endfunction
function Trig_Lunar_Aegis_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit caster = GetTriggerUnit()
local unit u
local unit dummy
local integer ctr = 0
local integer lim
local player p = Player(2)
local group g = CreateGroup()
//create dummy at spell target location then check if the dummy is in the geo region
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 0.05)
if ( RectContainsUnit(gg_rct_vSilverfall, dummy) == true or RectContainsUnit(gg_rct_vDrakoria, dummy) == true) then
set dummy = (CreateUnit( p, 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 5.00)
call UnitAddAbilityBJ( 'A1RX', dummy )
call UnitAddAbilityBJ( 'A1RY', dummy )
call GroupEnumUnitsInRange(g, x, y, 400, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set u = BlzGroupUnitAt(g, ctr)
if ( not (IsUnitEnemy(u, p))) then
call IssueTargetOrder(dummy, "antimagicshell", u)
endif
if ( IsUnitEnemy(u, p)) then
call IssueTargetOrder(dummy, "slow", u)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MANA) - 50 )
endif
set ctr = ctr + 1
endloop
else
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "|cffffcc00You can't cast that in this area!")
//refund the mana cost and reset cooldown
call PolledWait(0.5)
call SetUnitState(caster, UNIT_STATE_MANA, (GetUnitState(caster, UNIT_STATE_MANA) + 90))
call BlzEndUnitAbilityCooldown( caster, 'A1RW' )
endif
set dummy = null
set caster = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Lunar_Aegis takes nothing returns nothing
set gg_trg_Lunar_Aegis = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Lunar_Aegis, gg_unit_h00G_0971, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lunar_Aegis, Condition( function Trig_Lunar_Aegis_Conditions ) )
call TriggerAddAction( gg_trg_Lunar_Aegis, function Trig_Lunar_Aegis_Actions )
endfunction
function Trig_Learn_Draconic_Arcanum_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A16S'
endfunction
function Trig_Learn_Draconic_Arcanum_Actions takes nothing returns nothing
call EnableTrigger( gg_trg_Draconic_Arcanum )
call DestroyTrigger( gg_trg_Learn_Draconic_Arcanum)
endfunction
//===========================================================================
function InitTrig_Learn_Draconic_Arcanum takes nothing returns nothing
set gg_trg_Learn_Draconic_Arcanum = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Learn_Draconic_Arcanum, Player(0), EVENT_PLAYER_HERO_SKILL, null )
call TriggerRegisterUnitEvent( gg_trg_Learn_Draconic_Arcanum, gg_unit_H07M_0659, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Learn_Draconic_Arcanum, Condition( function Trig_Learn_Draconic_Arcanum_Conditions ) )
call TriggerAddAction( gg_trg_Learn_Draconic_Arcanum, function Trig_Learn_Draconic_Arcanum_Actions )
endfunction
function Trig_Draconic_Arcanum_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local unit dummy
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real x2 = GetSpellTargetX()
local real y2 = GetSpellTargetY()
local integer int = 0
//if Draconic Arcanum is level 1 gives 10% chance to double cast the ability used
if ( GetUnitAbilityLevel(caster, 'A16S') == 1 ) then
set int = GetRandomInt(1, 10)
elseif ( GetUnitAbilityLevel(caster, 'A16S') == 2 ) then
set int = GetRandomInt(1, 5)
elseif ( GetUnitAbilityLevel(caster, 'A16S') == 3 ) then
set int = GetRandomInt(1, 2)
endif
if (int == 1) then
//Dragonfire Cascade
if GetSpellAbilityId() == 'A16P' then
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A16T')
call IssuePointOrder(dummy,"breathoffrost", x2, y2)
call CreateTextTagUnitBJ( "Double Cast!", GetTriggerUnit(), 6.50, 10.00, 100.00, 100.00, 0.00, 10.00 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 75.00, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.50 )
endif
//Wyrm's Shield
if GetSpellAbilityId() == 'A16Q' then
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A16U')
call IssueTargetOrder(dummy,"innerfire", caster)
call CreateTextTagUnitBJ( "Double Cast!", GetTriggerUnit(), 6.50, 10.00, 100.00, 100.00, 0.00, 10.00 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 75.00, 90 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.50 )
endif
endif
set caster = null
set dummy = null
set target = null
set int = 0
endfunction
//===========================================================================
function InitTrig_Draconic_Arcanum takes nothing returns nothing
set gg_trg_Draconic_Arcanum = CreateTrigger( )
call DisableTrigger( gg_trg_Draconic_Arcanum )
call TriggerRegisterUnitEvent( gg_trg_Draconic_Arcanum, gg_unit_H07M_0659, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Draconic_Arcanum, function Trig_Draconic_Arcanum_Actions )
endfunction
function Arcane_Fracture_Summoned_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'o011' ) ) then
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'o012' ) ) then
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'o013' ) ) then
return false
endif
endif
endif
return true
endfunction
function Trig_Arcane_Fracture_Summoned_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit dummy
local real x = GetUnitX(ward)
local real y = GetUnitY(ward)
set ward = GetSummonedUnit()
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 10.00)
call UnitAddAbility(dummy, 'A170')
call IssueImmediateOrder(dummy, "manaflareon")
//call EnableTrigger(gg_trg_Arcane_Fracture_Loop)
set caster = null
set dummy = null
endfunction
//==================================================================
function InitTrig_Arcane_Fracture_Summoned takes nothing returns nothing
set gg_trg_Arcane_Fracture_Summoned = CreateTrigger ( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arcane_Fracture_Summoned, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Arcane_Fracture_Summoned, Condition(function Arcane_Fracture_Summoned_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Fracture_Summoned, function Trig_Arcane_Fracture_Summoned_Actions )
endfunction
function Arcane_Shields_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0D1'
endfunction
function Arcane_Shields_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local group g = CreateGroup()
local unit target
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
call UnitAddAbility( Dummy, 'A0D0' )
call SetUnitOwner( Dummy, Player(0), true )
call GroupEnumUnitsInRange(g, x, y, 450, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
if ( IsUnitAlly(target, GetOwningPlayer(caster)) ) then
if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) == false ) then
call IssueTargetOrder( Dummy, "antimagicshell", target )
endif
endif
endloop
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
call UnitRemoveAbility( Dummy, 'A0D0' )
call SetUnitOwner( udg_Dummy, Player(PLAYER_NEUTRAL_PASSIVE), true )
set target = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Arcane_Aegis takes nothing returns nothing
set gg_trg_Arcane_Aegis = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Arcane_Aegis, gg_unit_H07L_1075, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arcane_Aegis, Condition(function Arcane_Shields_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Aegis, function Arcane_Shields_Actions )
endfunction
function Guardians_Aegis_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0A8'
endfunction
function Guardians_Aegis_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A0A8') == 1 ) then
call UnitAddAbility(u, 'A175' )
call BlzUnitHideAbility(u, 'A175', true)
call PolledWait(15.00)
call UnitRemoveAbility( u, 'A175' )
else
if ( GetUnitAbilityLevel(u, 'A0A8') == 2 ) then
call UnitAddAbility(u, 'A176' )
call BlzUnitHideAbility(u, 'A175', true)
call PolledWait(15.00)
call UnitRemoveAbility( u, 'A176' )
else
call UnitAddAbility(u, 'A177' )
call BlzUnitHideAbility(u, 'A175', true)
call PolledWait(15.00)
call UnitRemoveAbility( u, 'A177' )
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Guardians_Aegis takes nothing returns nothing
set gg_trg_Guardians_Aegis = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Guardians_Aegis, gg_unit_H07N_1076, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Guardians_Aegis, Condition(function Guardians_Aegis_Conditions ) )
call TriggerAddAction( gg_trg_Guardians_Aegis, function Guardians_Aegis_Actions )
endfunction
function Winged_Bulwark_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A178'
endfunction
function Winged_Bulwark_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A178') == 1 ) then
call UnitAddAbility(u, 'A179' )
call BlzUnitHideAbility(u, 'A179', true)
else
if ( GetUnitAbilityLevel(u, 'A178') == 2 ) then
call UnitAddAbility(u, 'A17A' )
call BlzUnitHideAbility(u, 'A17A', true)
else
call UnitAddAbility(u, 'A17B' )
call BlzUnitHideAbility(u, 'A17B', true)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Winged_Bulwark takes nothing returns nothing
set gg_trg_Winged_Bulwark = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Winged_Bulwark, gg_unit_H07N_1076, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Winged_Bulwark, Condition(function Winged_Bulwark_Conditions ) )
call TriggerAddAction( gg_trg_Winged_Bulwark, function Winged_Bulwark_Actions )
endfunction
function Wyrmguards_Stand_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A17C'
endfunction
function Wyrmguards_Stand_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call SetUnitMoveSpeed(u, 0)
call UnitAddAbility(u, 'A17D')
call UnitAddAbility(u, 'A17E')
call BlzUnitHideAbility(u, 'A17E', true)
call PolledWait(5.00)
call UnitRemoveAbility(u, 'A17D')
call UnitRemoveAbility(u, 'A17E')
call SetUnitMoveSpeed(u, 270)
set u = null
endfunction
//===========================================================================
function InitTrig_Wyrmguards_Stand takes nothing returns nothing
set gg_trg_Wyrmguards_Stand = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Wyrmguards_Stand, gg_unit_H07N_1076, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Wyrmguards_Stand, Condition(function Wyrmguards_Stand_Conditions ) )
call TriggerAddAction( gg_trg_Wyrmguards_Stand, function Wyrmguards_Stand_Actions )
endfunction
function Inferno_Dash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A17F'
endfunction
function Inferno_Dash_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local string sfx = "BlinkCaster_Portrait.mdx"
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real angle = GetUnitFacing(u) + 180
local real x2
local real y2
set x2 = x + (50 * Cos(angle * bj_DEGTORAD))
set y2 = y + (50 * Sin(angle * bj_DEGTORAD))
call PolledWait(0.05)
call SetUnitPosition(caster, x2, y2 )
call SetUnitFacing(caster, GetUnitFacing(u))
call UnitAddAbility(caster, 'A17G')
call IssueImmediateOrder(caster, "windwalk")
call UnitRemoveAbility(caster, 'A17G')
call IssueTargetOrder(caster, "attack", u)
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
set caster = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Inferno_Dash takes nothing returns nothing
set gg_trg_Inferno_Dash = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Inferno_Dash, gg_unit_H07E_1148, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Inferno_Dash, Condition( function Inferno_Dash_Conditions ) )
call TriggerAddAction( gg_trg_Inferno_Dash, function Inferno_Dash_Actions )
endfunction
function Trig_Zephyrs_Vigor_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A17P'
endfunction
function Trig_Zephyrs_Vigor_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A022') == 1 ) then
call UnitAddAbility(u, 'A0JC' )
else
if ( GetUnitAbilityLevel(u, 'A022') == 2 ) then
call UnitRemoveAbility( u, 'A0JC' )
call UnitAddAbility( u, 'A0LC' )
else
call UnitRemoveAbility( u, 'A0LC' )
call UnitAddAbility( u, 'A0LD' )
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Zephyrs_Vigor takes nothing returns nothing
set gg_trg_Zephyrs_Vigor = CreateTrigger( )
call DisableTrigger( gg_trg_Zephyrs_Vigor )
call TriggerRegisterUnitEvent( gg_trg_Zephyrs_Vigor, gg_unit_H0BD_0404, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Zephyrs_Vigor, Condition( function Trig_Zephyrs_Vigor_Conditions ) )
call TriggerAddAction( gg_trg_Zephyrs_Vigor, function Trig_Zephyrs_Vigor_Actions )
endfunction
globals
unit TempestDummy
unit TempestTarget
endglobals
function Trig_Tempests_Dominion_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A17Q'
endfunction
function TempestFilter takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetWidgetLife(u) > 0.405 ) then
if ( IsUnitEnemy(u, GetOwningPlayer(gg_unit_H0BD_0404)) ) then
if not ( IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(u, UNIT_TYPE_STRUCTURE) ) then
set u = null
return true
endif
endif
endif
set u = null
return false
endfunction
function TempestPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local real x = GetUnitX(TempestTarget)
local real y = GetUnitY(TempestTarget)
local group g
local unit u
local integer ctr = 0
local integer lim
local integer i
if ( GetUnitAbilityLevel(TempestTarget, 'B02L') > 0 ) then
call SetUnitPosition(TempestDummy, x, y)
set g = CreateGroup()
call GroupEnumUnitsInRange(g, x, y, 500, function TempestFilter)
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim or ctr == 6
set i = GetRandomInt(0, lim)
set u = BlzGroupUnitAt(g, i)
call GroupRemoveUnit(g, u)
call IssueTargetOrder(TempestDummy, "forkedlightning", u)
set ctr = ctr + 1
endloop
else
call KillUnit(TempestDummy)
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
endfunction
function Trig_Tempests_Dominion_Actions takes nothing returns nothing
local timer t = CreateTimer()
local real x = GetUnitX(GetSpellTargetUnit())
local real y = GetUnitY(GetSpellTargetUnit())
set TempestTarget = GetSpellTargetUnit()
set TempestDummy = CreateUnit(GetOwningPlayer(gg_unit_H0BD_0404), 'h07H', x, y, bj_UNIT_FACING)
call TimerStart(t, 0.167, true, function TempestPeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Tempests_Dominion takes nothing returns nothing
set gg_trg_Tempests_Dominion = CreateTrigger( )
call DisableTrigger( gg_trg_Tempests_Dominion )
call TriggerRegisterUnitEvent( gg_trg_Tempests_Dominion, gg_unit_H0BD_0404, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Tempests_Dominion, Condition( function Trig_Tempests_Dominion_Conditions ) )
call TriggerAddAction( gg_trg_Tempests_Dominion, function Trig_Tempests_Dominion_Actions )
endfunction
function MistbreakerDeath takes nothing returns nothing
if ( GetUnitState(gg_unit_H02K_0135, UNIT_STATE_LIFE) > 0.405 ) then
if ( BlzGetUnitAbilityCooldownRemaining(gg_unit_H02K_0135, 'A10P') < 30.00 ) then
call BlzStartUnitAbilityCooldown(gg_unit_H02K_0135, 'A10P' , 30.00)
endif
endif
endfunction
function MistsmasherDeath takes nothing returns nothing
if ( GetUnitState(gg_unit_H02K_0135, UNIT_STATE_LIFE) > 0.405 ) then
if ( BlzGetUnitAbilityCooldownRemaining(gg_unit_H02K_0135, 'A1KX') < 30.00 ) then
call BlzStartUnitAbilityCooldown(gg_unit_H02K_0135, 'A1KX' , 30.00)
endif
endif
endfunction
function Trig_Mistbreaker_CD_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'h02M' or GetUnitTypeId(GetSummonedUnit()) == 'h0GI' ) )then
return false
endif
return true
endfunction
function Trig_Mistbreaker_CD_Actions takes nothing returns nothing
local trigger t = null
if GetUnitTypeId(GetSummonedUnit()) == 'h02M' then
if ( t == null ) then
set t = CreateTrigger()
endif
call TriggerRegisterUnitEvent( t, GetSummonedUnit(), EVENT_UNIT_DEATH )
call TriggerAddAction(t, function MistbreakerDeath)
elseif GetUnitTypeId(GetSummonedUnit()) == 'h0GI' then
if ( t == null ) then
set t = CreateTrigger()
endif
call TriggerRegisterUnitEvent( t, GetSummonedUnit(), EVENT_UNIT_DEATH )
call TriggerAddAction(t, function MistsmasherDeath)
endif
set t = null
endfunction
//===========================================================================
function InitTrig_Mistbreaker_CD takes nothing returns nothing
set gg_trg_Mistbreaker_CD = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Mistbreaker_CD, Player(1), EVENT_PLAYER_UNIT_SUMMON, null )
call TriggerAddCondition( gg_trg_Mistbreaker_CD, Condition( function Trig_Mistbreaker_CD_Conditions ) )
call TriggerAddAction( gg_trg_Mistbreaker_CD, function Trig_Mistbreaker_CD_Actions )
endfunction
function Trig_Mistral_Tempest_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04O'
endfunction
function MistralTempestPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[1], GetHandleId(t), 0)
local unit summon = LoadUnitHandle(AbilityTable[1], GetHandleId(t), 1)
//call DisplayTextToForce( GetPlayersAll(), "Mistral Tempest" )
if ( GetWidgetLife(summon) >= 0.405 and GetWidgetLife(u) >= 0.405 ) then
call IssueTargetOrder(summon, "move", u)
else
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(AbilityTable[1], GetHandleId(t))
if ( GetWidgetLife(summon) >= 0.405 ) then
call UnitAddAbility(summon, 'Atwa')
endif
endif
set t = null
set u = null
set summon = null
endfunction
function Trig_Mistral_Tempest_Actions takes nothing returns nothing
local unit u
local unit summon
local unit caster = GetTriggerUnit()
local timer t
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real x2 = x + 200 * Cos(GetUnitFacing(caster) * bj_DEGTORAD)
local real y2 = y + 200 * Sin(GetUnitFacing(caster) * bj_DEGTORAD)
set summon = CreateUnit(GetOwningPlayer(caster), 'h03I', x2, y2, bj_UNIT_FACING)
call UnitApplyTimedLife( summon, 'BFig', 6.00 )
if ( GetSpellTargetUnit() != null ) then
set t = CreateTimer()
set u = GetSpellTargetUnit()
call TimerStart(t, 0.2, true, function MistralTempestPeriodic)
call SaveUnitHandle(AbilityTable[1], GetHandleId(t), 0, u)
call SaveUnitHandle(AbilityTable[1], GetHandleId(t), 1, summon)
else
call UnitAddAbility(summon, 'Atwa')
endif
set u = null
set summon = null
set caster = null
set t = null
endfunction
//===========================================================================
function InitTrig_Mistral_Tempest takes nothing returns nothing
set gg_trg_Mistral_Tempest = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Mistral_Tempest, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Mistral_Tempest, gg_unit_H02H_0131, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Mistral_Tempest, Condition( function Trig_Mistral_Tempest_Conditions ) )
call TriggerAddAction( gg_trg_Mistral_Tempest, function Trig_Mistral_Tempest_Actions )
endfunction
function Mistral_Blade_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1KO'
endfunction
function Mistral_Blade_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
local real x = GetUnitX(target)
local real y = GetUnitY(target)
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) - 50 - (50 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
call DestroyEffect(AddSpecialEffect( "Piercing Thrust Blue.mdx" , x, y ) )
set target = null
endfunction
//===========================================================================
function InitTrig_Mistral_Blade takes nothing returns nothing
set gg_trg_Mistral_Blade = CreateTrigger( )
call DisableTrigger( gg_trg_Mistral_Blade )
call TriggerRegisterUnitEvent( gg_trg_Mistral_Blade, gg_unit_H02I_0132, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mistral_Blade, Condition(function Mistral_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Mistral_Blade, function Mistral_Blade_Actions )
endfunction
function Trig_Zephyrs_Embrace_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1KQ'
endfunction
function ZephyrsEmbraceRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[1], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[1], GetHandleId(t), 1)
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
set udg_TempPoint = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e000', Player(1), udg_TempPoint, bj_UNIT_FACING )
set udg_Dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A1KP', udg_Dummy )
call SetUnitAbilityLevel( udg_Dummy, 'A1KP', GetUnitAbilityLevel(gg_unit_H02I_0132, GetSpellAbilityId()))
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', udg_Dummy )
call IssueTargetOrderBJ( udg_Dummy, "bloodlust", u )
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
set udg_Dummy = null
set udg_TempPoint = null
endfunction
function Trig_Zephyrs_Embrace_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A1KQ')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[1], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[1], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function ZephyrsEmbraceRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Zephyrs_Embrace takes nothing returns nothing
set gg_trg_Zephyrs_Embrace = CreateTrigger( )
call DisableTrigger( gg_trg_Zephyrs_Embrace )
call TriggerRegisterPlayerUnitEvent( gg_trg_Zephyrs_Embrace, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Zephyrs_Embrace, gg_unit_H02I_0132, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Zephyrs_Embrace, Condition( function Trig_Zephyrs_Embrace_Conditions ) )
call TriggerAddAction( gg_trg_Zephyrs_Embrace, function Trig_Zephyrs_Embrace_Actions )
endfunction
function Veil_of_Obscurity_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1KR'
endfunction
function Veil_of_Obscurity_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1KR') == 1 ) then
call UnitAddAbility(u, 'A1KS' )
call BlzUnitHideAbility(u, 'A1KS', true)
else
if ( GetUnitAbilityLevel(u, 'A1KR') == 2 ) then
call SetUnitAbilityLevel(u, 'A1KS', GetUnitAbilityLevel(u, 'A1KR'))
else
call SetUnitAbilityLevel(u, 'A1KS', GetUnitAbilityLevel(u, 'A1KR'))
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Veil_of_Obscurity takes nothing returns nothing
set gg_trg_Veil_of_Obscurity = CreateTrigger( )
call DisableTrigger( gg_trg_Veil_of_Obscurity )
call TriggerRegisterUnitEvent( gg_trg_Veil_of_Obscurity, gg_unit_H02I_0132, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Veil_of_Obscurity, Condition(function Veil_of_Obscurity_Conditions ) )
call TriggerAddAction( gg_trg_Veil_of_Obscurity, function Veil_of_Obscurity_Actions )
endfunction
function Trig_Howl_of_the_Wolf_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1L0' ) ) then
return false
endif
return true
endfunction
function Trig_Howl_of_the_Wolf_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit dummy
set dummy = (CreateUnit( GetOwningPlayer(u), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A1L1')
call IssueTargetOrder(dummy,"bloodlust", u)
set dummy = null
set u = null
endfunction
//===========================================================================
function InitTrig_Howl_of_the_Wolf takes nothing returns nothing
set gg_trg_Howl_of_the_Wolf = CreateTrigger( )
call DisableTrigger( gg_trg_Howl_of_the_Wolf )
call TriggerRegisterUnitEvent( gg_trg_Howl_of_the_Wolf, gg_unit_H0GF_1024, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Howl_of_the_Wolf, Condition( function Trig_Howl_of_the_Wolf_Conditions ) )
call TriggerAddAction( gg_trg_Howl_of_the_Wolf, function Trig_Howl_of_the_Wolf_Actions )
endfunction
function Moonstride_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04K'
endfunction
function Moonstride_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real x = GetUnitX(target) - GetUnitX(caster)
local real y = GetUnitY(target) - GetUnitY(caster)
local real distSquared = x * x + y * y
//call DisplayTextToForce( GetPlayersAll(), "Moonstride" )
//call PlaySoundOnUnitBJ( gg_snd_Avatar, 100, caster )
call SetUnitPathing( caster, false )
call GroupAddUnit(Moonstriders, caster)
call UnitAddAbility( caster, 'A08D')
call UnitAddAbility( caster, 'Arav')
call UnitRemoveAbility( caster, 'Arav' )
call BlzPauseUnitEx(caster, true)
call SaveUnitHandle( MoonstrideTable, GetHandleId(caster), 0, target )
call SaveReal( MoonstrideTable, GetHandleId(caster), 1, distSquared)
call EnableTrigger( gg_trg_Moonstride_Loop )
call BlzPauseUnitEx(caster, false)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Moonstride takes nothing returns nothing
set gg_trg_Moonstride = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Moonstride, gg_unit_H05N_0768, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEvent( gg_trg_Moonstride, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerAddCondition( gg_trg_Moonstride, Condition( function Moonstride_Conditions) )
call TriggerAddAction( gg_trg_Moonstride, function Moonstride_Actions )
endfunction
function Moonstride_ForGroup takes nothing returns nothing
local unit u = GetEnumUnit()
local unit target = LoadUnitHandle(MoonstrideTable, GetHandleId(u), 0)
local real x = GetUnitX(target) - GetUnitX(u)
local real y = GetUnitY(target) - GetUnitY(u)
local real dist = x * x + y * y
local real descentDist = (LoadReal(MoonstrideTable, GetHandleId(u), 1))
local real angle
local real radius
local real damage
//call DisplayTextToForce( GetPlayersAll(), "Moonstride Loop" )
//75^2
if (dist > 5625) then
set angle = Atan2( y, x ) * bj_RADTODEG
call SetUnitFacing(u, angle)
set x = GetUnitX(u) + 25 * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(u) + 25 * Sin(angle * bj_DEGTORAD)
call SetUnitX(u, x)
call SetUnitY(u, y)
if (dist >= descentDist * 0.35) then
if ( GetUnitFlyHeight(u) <= 400 ) then
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) + 25, 1000000000.00 )
endif
else
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) - 25, 1000000000.00 )
endif
else
call GroupRemoveUnit(Moonstriders, u)
call SetUnitFlyHeight( u, 0, 1000000000.00 )
call UnitRemoveAbility( u, 'A08D')
call BlzPauseUnitEx(u, false)
call SetUnitPathing( u, true )
call IssueTargetOrder( u, "attack", target )
call FlushChildHashtable( MoonstrideTable, GetHandleId(u) )
set radius = 350
set damage = 150
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" , GetUnitX(u), GetUnitY(u) ) )
call SlamTrigger(u, 'A0JL', GetUnitAbilityLevel(u, 'A04K'), damage, radius, GetUnitX(u), GetUnitY(u), 20)
endif
set u = null
set target = null
endfunction
function Moonstride_Loop_Actions takes nothing returns nothing
call ForGroup(Moonstriders, function Moonstride_ForGroup)
if (BlzGroupGetSize(Moonstriders) == 0) then
call DisableTrigger(GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Moonstride_Loop takes nothing returns nothing
set gg_trg_Moonstride_Loop = CreateTrigger( )
call DisableTrigger( gg_trg_Moonstride_Loop )
call TriggerAddAction( gg_trg_Moonstride_Loop, function Moonstride_Loop_Actions )
call TriggerRegisterTimerEvent( gg_trg_Moonstride_Loop, 0.05, true )
endfunction
function Trig_Heal_Reduction_Attack_Elandor_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1AG'
endfunction
function Trig_Heal_Reduction_Attack_Elandor_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel( u, 'A1AG' ) == 1 ) then
call UnitAddAbility( u, 'A1AH' )
else
call SetUnitAbilityLevel( u, 'A1AH', GetUnitAbilityLevel(u, 'A1AG') )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Heal_Reduction_Attack_Elandor takes nothing returns nothing
set gg_trg_Heal_Reduction_Attack_Elandor = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Heal_Reduction_Attack_Elandor, gg_unit_H05N_0768, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Heal_Reduction_Attack_Elandor, Condition( function Trig_Heal_Reduction_Attack_Elandor_Conditions ) )
call TriggerAddAction( gg_trg_Heal_Reduction_Attack_Elandor, function Trig_Heal_Reduction_Attack_Elandor_Actions )
endfunction
function Whispering_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1AL'
endfunction
function Whispering_Strike_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local unit dummy
local real x = GetUnitX(target)
local real y = GetUnitY(target)
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A1AP')
call IssuePointOrder(dummy,"silence", x, y)
set target = null
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Whispering_Strike takes nothing returns nothing
set gg_trg_Whispering_Strike = CreateTrigger( )
call DisableTrigger( gg_trg_Whispering_Strike )
call TriggerRegisterUnitEvent( gg_trg_Whispering_Strike, gg_unit_H0BW_0818, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Whispering_Strike, Condition(function Whispering_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Whispering_Strike, function Whispering_Strike_Actions )
endfunction
function Oathkeepers_Assault_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1AQ'
endfunction
function FilterHero takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
endfunction
function FilterUnit takes nothing returns boolean
return not IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
endfunction
function Oathkeepers_Assault_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit dummy
local unit u
local group g = CreateGroup()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real x2
local real y2
local integer i = 15
call GroupEnumUnitsInRange(g, x, y, 500, Filter(function FilterHero))
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy, 'A1AS')
loop
set u = FirstOfGroup(g)
exitwhen u == null
if ( IsUnitEnemy(u, GetTriggerPlayer())) then
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
call SetUnitX(caster, x2)
call SetUnitY(caster, y2)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", caster, "origin") )
call UnitDamageTarget(caster, u, 75, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call IssueTargetOrder(dummy, "faeriefire", u)
call PolledWait(0.10)
endif
call GroupRemoveUnit(g,u)
endloop
call GroupEnumUnitsInRange(g, x, y, 500, Filter(function FilterUnit))
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 2.00)
call UnitAddAbility(dummy, 'A1AS')
loop
set u = FirstOfGroup(g)
exitwhen i == null or u == null
if ( IsUnitEnemy(u, GetTriggerPlayer())) then
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
call SetUnitX(caster, x2)
call SetUnitY(caster, y2)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", caster, "origin") )
call UnitDamageTarget(caster, u, 75, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call IssueTargetOrder(dummy, "faeriefire", u)
call PolledWait(0.10)
endif
call GroupRemoveUnit(g,u)
set i = i - 1
endloop
call DestroyGroup(g)
call SetUnitX(caster, x)
call SetUnitY(caster, y)
set dummy = null
set caster = null
set u = null
endfunction
//===========================================================================
function InitTrig_Oathkeepers_Assault takes nothing returns nothing
set gg_trg_Oathkeepers_Assault = CreateTrigger( )
call DisableTrigger( gg_trg_Oathkeepers_Assault )
call TriggerRegisterUnitEvent( gg_trg_Oathkeepers_Assault, gg_unit_H0BW_0818, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Oathkeepers_Assault, Condition(function Oathkeepers_Assault_Conditions ) )
call TriggerAddAction( gg_trg_Oathkeepers_Assault, function Oathkeepers_Assault_Actions )
endfunction
function Trig_Stargazers_Shield_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1AU'
endfunction
function StargazersShieldRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[2], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[2], GetHandleId(t), 1)
local unit caster = GetTriggerUnit()
local real x = GetUnitX(ShieldedUnit)
local real y = GetUnitY(ShieldedUnit)
local group g = CreateGroup()
local unit target
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", ShieldedUnit, "origin") )
set x = GetUnitX(ShieldedUnit)
set y = GetUnitY(ShieldedUnit)
call GroupEnumUnitsInRange(g, x, y, 350, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
if ( IsUnitEnemy(target, GetOwningPlayer(caster))) then
call UnitDamageTarget(caster, target, 100, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endif
call GroupRemoveUnit(g,target)
endloop
set target = null
set ShieldedUnit = null
set u = null
set sfx = null
set t = null
endfunction
function Trig_Stargazers_Shield_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A1AU')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
set ShieldedUnit = GetSpellTargetUnit()
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[2], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[2], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function StargazersShieldRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Stargazers_Shield takes nothing returns nothing
set gg_trg_Stargazers_Shield = CreateTrigger( )
call DisableTrigger( gg_trg_Stargazers_Shield )
call TriggerRegisterPlayerUnitEvent( gg_trg_Stargazers_Shield, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Stargazers_Shield, gg_unit_H0BV_0767, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stargazers_Shield, Condition( function Trig_Stargazers_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Stargazers_Shield, function Trig_Stargazers_Shield_Actions )
endfunction
globals
integer AstralInt = 30
endglobals
function Trig_Astral_Cataclysm_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1AX'
endfunction
function Astral_Cataclysm_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer pNum = GetPlayerId(GetOwningPlayer(gg_unit_H0BV_0767)) + 1
local real x = GetUnitX(gg_unit_H0BV_0767) + GetRandomInt(-600, 600)
local real y = GetUnitY(gg_unit_H0BV_0767) + GetRandomInt(-600, 600)
set AstralInt = AstralInt - 1
call PDummyPointOrder(pNum, 'A0O7', 1, "dreadlordinferno", 0, x, y)
if ( AstralInt <= 0 ) then
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
endfunction
function Trig_Astral_Cataclysm_Actions takes nothing returns nothing
local timer t = CreateTimer()
set AstralInt = 30
call TimerStart(t, 0.33, true, function Astral_Cataclysm_Periodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Astral_Cataclysm takes nothing returns nothing
set gg_trg_Astral_Cataclysm = CreateTrigger( )
call DisableTrigger( gg_trg_Astral_Cataclysm )
call TriggerRegisterUnitEvent( gg_trg_Astral_Cataclysm, gg_unit_H0BV_0767, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Astral_Cataclysm, Condition( function Trig_Astral_Cataclysm_Conditions ) )
call TriggerAddAction( gg_trg_Astral_Cataclysm, function Trig_Astral_Cataclysm_Actions )
endfunction
function Dawns_Resilience_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1DW'
endfunction
function Dawns_Resilience_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local group g = CreateGroup()
local unit u
local integer i = 0
local integer lim
local integer spellId
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1DW' ) == 1 ) then
set spellId = 'A0M6'
elseif ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1DW' ) == 2 ) then
set spellId = 'A0QN'
else
set spellId = 'A0QO'
endif
call GroupEnumUnitsInRange(g, x, y, 600.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen i == lim
set u = BlzGroupUnitAt(g, i)
if (IsUnitAlly(u, Player(pNum)) ) then
if (GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if (IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
call UnitAddAbility(u, spellId)
endif
endif
endif
set i = i + 1
endloop
call TriggerSleepAction(15.00)
set i = 0
loop
exitwhen i == lim
if (BlzGroupUnitAt(g, i) != null ) then
call UnitRemoveAbility(BlzGroupUnitAt(g, i), spellId)
endif
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Dawns_Resilience takes nothing returns nothing
set gg_trg_Dawns_Resilience = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Dawns_Resilience, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Dawns_Resilience, gg_unit_H086_1333, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Dawns_Resilience, Condition(function Dawns_Resilience_Conditions) )
call TriggerAddAction( gg_trg_Dawns_Resilience, function Dawns_Resilience_Actions )
endfunction
function Sunshields_Stand_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1DY'
endfunction
function Sunshields_Stand_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call SetUnitMoveSpeed(u, 0)
call UnitAddAbility(u, 'A17D')
call UnitAddAbility(u, 'A17E')
call BlzUnitHideAbility(u, 'A17E', true)
call PolledWait(5.00)
call UnitRemoveAbility(u, 'A17D')
call UnitRemoveAbility(u, 'A17E')
call SetUnitMoveSpeed(u, 270)
set u = null
endfunction
//===========================================================================
function InitTrig_Sunshields_Stand takes nothing returns nothing
set gg_trg_Sunshields_Stand = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Sunshields_Stand, gg_unit_H086_1333, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Sunshields_Stand, Condition(function Sunshields_Stand_Conditions ) )
call TriggerAddAction( gg_trg_Sunshields_Stand, function Sunshields_Stand_Actions )
endfunction
globals
effect array MaceOfMightSfx
trigger MaceOfMightTrig = null
integer MaceOfMightIndex = 0
endglobals
function Trig_Mace_of_Might_Cast_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A059'
endfunction
function MaceOfMight takes nothing returns nothing
local unit u
local unit attacker = GetEventDamageSource()
local real x
local real y
if ( GetUnitAbilityLevel(attacker, 'A0VS') > 0 ) then
if ( BlzGetEventIsAttack() ) then
set u = GetTriggerUnit()
if ( IsUnitEnemy(u, GetOwningPlayer(attacker)) ) then
set x = GetUnitX(u)
set y = GetUnitY(u)
call StompTrigger(attacker, 1, 0.1, 0.1, 50, 250, x, y, 9999)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
endif
endif
endif
set u = null
set attacker = null
endfunction
function Trig_Mace_of_Might_Cast_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(u))
if ( MaceOfMightTrig == null ) then
set MaceOfMightTrig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(MaceOfMightTrig, EVENT_PLAYER_UNIT_DAMAGED)
call TriggerAddAction(MaceOfMightTrig, function MaceOfMight)
elseif MaceOfMightIndex == 0 then
call EnableTrigger(MaceOfMightTrig)
endif
set MaceOfMightSfx[pNum] = AddSpecialEffectTarget("war3mapImported\\SacredShield.mdx", u, "weapon")
call UnitAddAbility(u, 'A0VS')
set MaceOfMightIndex = MaceOfMightIndex + 1
call PolledWait(20.00)
call DestroyEffect(MaceOfMightSfx[pNum])
set MaceOfMightIndex = MaceOfMightIndex - 1
call UnitRemoveAbility(u, 'A0VS')
if ( MaceOfMightIndex == 0 ) then
call DisableTrigger(MaceOfMightTrig)
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Mace_of_Might_Cast takes nothing returns nothing
set gg_trg_Mace_of_Might_Cast = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Mace_of_Might_Cast, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Mace_of_Might_Cast, gg_unit_H087_1334, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Mace_of_Might_Cast, Condition( function Trig_Mace_of_Might_Cast_Conditions) )
call TriggerAddAction( gg_trg_Mace_of_Might_Cast, function Trig_Mace_of_Might_Cast_Actions )
endfunction
function Maelstrom_Call_Admiral_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1E2'
endfunction
function Maelstrom_Call_Admiral_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit caster = GetTriggerUnit()
local unit dummy
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BA', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A0DR' )
call SetUnitAbilityLevel( dummy, 'A0DR', 3 )
call IssueImmediateOrder( dummy, "whirlwind" )
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BB', x, y, bj_UNIT_FACING ) )
call SetUnitVertexColor( dummy, 100, 100, 100, 13 )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A0DT' )
call IssueImmediateOrder( dummy, "whirlwind" )
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Maelstrom_Call_Admiral takes nothing returns nothing
set gg_trg_Maelstrom_Call_Admiral = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Maelstrom_Call_Admiral, gg_unit_H089_1336, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Maelstrom_Call_Admiral, Condition(function Maelstrom_Call_Admiral_Conditions ) )
call TriggerAddAction( gg_trg_Maelstrom_Call_Admiral, function Maelstrom_Call_Admiral_Actions )
endfunction
function StormbladeRegular_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A13T' ) ) then
return false
endif
return true
endfunction
function StormbladeRegular_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real radius
local real damage
local integer dmgCap = 20
local integer abilityLvl = GetUnitAbilityLevel( caster, GetSpellAbilityId())
local real heroDuration = 0.5 + 0.5 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId()))
local real unitDuration = 1 + 0.5 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId()))
if (GetSpellAbilityId() != 'A03M' ) then
set radius = 350
set damage = 225
set heroDuration = 2
set unitDuration = 2
call StompTrigger(caster, abilityLvl, heroDuration, unitDuration, damage, radius, x, y, 20)
call DestroyEffect(AddSpecialEffect("Stormfall.mdx", x, y))
endif
set caster = null
endfunction
function InitTrig_Stormblade takes nothing returns nothing
set gg_trg_Stormblade = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Stormblade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_Stormblade, Condition(function StormbladeRegular_Conditions))
call TriggerAddAction(gg_trg_Stormblade, function StormbladeRegular_Actions)
endfunction
function Valors_Embrace_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1FY'
endfunction
function Valors_Embrace_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local group g = CreateGroup()
local unit u
local integer i = 0
local integer lim
local integer spellId
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1FY' ) == 1 ) then
set spellId = 'A0M6'
elseif ( GetUnitAbilityLevel(GetTriggerUnit(), 'A1FY' ) == 2 ) then
set spellId = 'A0QN'
else
set spellId = 'A0QO'
endif
call GroupEnumUnitsInRange(g, x, y, 600.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen i == lim
set u = BlzGroupUnitAt(g, i)
if (IsUnitAlly(u, Player(pNum)) ) then
if (GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if (IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
call UnitAddAbility(u, spellId)
endif
endif
endif
set i = i + 1
endloop
call TriggerSleepAction(15.00)
set i = 0
loop
exitwhen i == lim
if (BlzGroupUnitAt(g, i) != null ) then
call UnitRemoveAbility(BlzGroupUnitAt(g, i), spellId)
endif
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Valors_Embrace takes nothing returns nothing
set gg_trg_Valors_Embrace = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Valors_Embrace, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Valors_Embrace, gg_unit_H0DO_2150, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Valors_Embrace, Condition(function Valors_Embrace_Conditions) )
call TriggerAddAction( gg_trg_Valors_Embrace, function Valors_Embrace_Actions )
endfunction
globals
effect array LightOfTheOrderSfx
trigger LightOfTheOrderTrig = null
integer LightOfTheOrderIndex = 0
endglobals
function Trig_Light_of_the_Order_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A059'
endfunction
function LightOfTheOrder takes nothing returns nothing
local unit u
local unit attacker = GetEventDamageSource()
local real x
local real y
if ( GetUnitAbilityLevel(attacker, 'A0VS') > 0 ) then
if ( BlzGetEventIsAttack() ) then
set u = GetTriggerUnit()
if ( IsUnitEnemy(u, GetOwningPlayer(attacker)) ) then
set x = GetUnitX(u)
set y = GetUnitY(u)
call StompTrigger(attacker, 1, 0.1, 0.1, 50, 250, x, y, 9999)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
endif
endif
endif
set u = null
set attacker = null
endfunction
function Trig_Light_of_the_Order_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(u))
if ( LightOfTheOrderTrig == null ) then
set LightOfTheOrderTrig = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(LightOfTheOrderTrig, EVENT_PLAYER_UNIT_DAMAGED)
call TriggerAddAction(LightOfTheOrderTrig, function LightOfTheOrder)
elseif LightOfTheOrderIndex == 0 then
call EnableTrigger(LightOfTheOrderTrig)
endif
set LightOfTheOrderSfx[pNum] = AddSpecialEffectTarget("war3mapImported\\SacredShield.mdx", u, "weapon")
call UnitAddAbility(u, 'A0VS')
set LightOfTheOrderIndex = LightOfTheOrderIndex + 1
call PolledWait(20.00)
call DestroyEffect(LightOfTheOrderSfx[pNum])
set LightOfTheOrderIndex = LightOfTheOrderIndex - 1
call UnitRemoveAbility(u, 'A0VS')
if ( LightOfTheOrderIndex == 0 ) then
call DisableTrigger(LightOfTheOrderTrig)
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Light_of_the_Order takes nothing returns nothing
set gg_trg_Light_of_the_Order = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Light_of_the_Order, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Light_of_the_Order, gg_unit_H0DO_2150, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Light_of_the_Order, Condition( function Trig_Light_of_the_Order_Conditions) )
call TriggerAddAction( gg_trg_Light_of_the_Order, function Trig_Light_of_the_Order_Actions )
endfunction
function Trig_Celestial_Aegis_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1G2'
endfunction
function CelestialAegisRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[3], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[3], GetHandleId(t), 1)
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
endfunction
function Trig_Celestial_Aegis_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A1G2')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[3], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[3], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function CelestialAegisRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Celestial_Aegis takes nothing returns nothing
set gg_trg_Celestial_Aegis = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Celestial_Aegis, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Celestial_Aegis, gg_unit_H0DP_0544, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Celestial_Aegis, Condition( function Trig_Celestial_Aegis_Conditions ) )
call TriggerAddAction( gg_trg_Celestial_Aegis, function Trig_Celestial_Aegis_Actions )
endfunction
globals
unit StormgodsVengeanceDummy
unit StormgodsVengeanceTarget
endglobals
function Trig_Stormgods_Vengeance_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0VM'
endfunction
function StormgodsVengeanceFilter takes nothing returns boolean
local unit u = GetFilterUnit()
if ( GetWidgetLife(u) > 0.405 ) then
if ( IsUnitEnemy(u, GetOwningPlayer(gg_unit_H0DP_0544)) ) then
if not ( IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(u, UNIT_TYPE_STRUCTURE) ) then
set u = null
return true
endif
endif
endif
set u = null
return false
endfunction
function StormgodsVengeancePeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local real x = GetUnitX(StormgodsVengeanceTarget)
local real y = GetUnitY(StormgodsVengeanceTarget)
local group g
local unit u
local integer ctr = 0
local integer lim
local integer i
if ( GetUnitAbilityLevel(StormgodsVengeanceTarget, 'B031') > 0 ) then
call SetUnitPosition(StormgodsVengeanceDummy, x, y)
set g = CreateGroup()
call GroupEnumUnitsInRange(g, x, y, 500, function StormgodsVengeanceFilter)
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim or ctr == 6
set i = GetRandomInt(0, lim)
set u = BlzGroupUnitAt(g, i)
call GroupRemoveUnit(g, u)
call IssueTargetOrder(StormgodsVengeanceDummy, "forkedlightning", u)
set ctr = ctr + 1
endloop
else
call KillUnit(StormgodsVengeanceDummy)
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
endfunction
function Trig_Stormgods_Vengeance_Actions takes nothing returns nothing
local timer t = CreateTimer()
local real x = GetUnitX(GetSpellTargetUnit())
local real y = GetUnitY(GetSpellTargetUnit())
set StormgodsVengeanceTarget = GetSpellTargetUnit()
set StormgodsVengeanceDummy = CreateUnit(GetOwningPlayer(gg_unit_H0DP_0544), 'h07H', x, y, bj_UNIT_FACING)
call TimerStart(t, 0.167, true, function StormgodsVengeancePeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Stormgods_Vengeance takes nothing returns nothing
set gg_trg_Stormgods_Vengeance = CreateTrigger( )
call DisableTrigger( gg_trg_Stormgods_Vengeance )
call TriggerRegisterUnitEvent( gg_trg_Stormgods_Vengeance, gg_unit_H0DP_0544, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stormgods_Vengeance, Condition( function Trig_Stormgods_Vengeance_Conditions ) )
call TriggerAddAction( gg_trg_Stormgods_Vengeance, function Trig_Stormgods_Vengeance_Actions )
endfunction
function Trig_Orcish_Ingenuity_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1BA'
endfunction
function Trig_Orcish_Ingenuity_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1BA') == 1 ) then
call UnitAddAbility(u, 'A1BB' )
call BlzUnitHideAbility(u, 'A1BB', true)
else
if ( GetUnitAbilityLevel(u, 'A1BA') == 2 ) then
call SetUnitAbilityLevel(u, 'A1BB', 2)
else
call SetUnitAbilityLevel(u, 'A1BB', 2)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Orcish_Ingenuity takes nothing returns nothing
set gg_trg_Orcish_Ingenuity = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Orcish_Ingenuity, gg_unit_O00P_0532, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Orcish_Ingenuity, Condition( function Trig_Orcish_Ingenuity_Conditions ) )
call TriggerAddAction( gg_trg_Orcish_Ingenuity, function Trig_Orcish_Ingenuity_Actions )
endfunction
function Trig_Trisky_Bugger_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A056'
endfunction
function Trig_Trisky_Bugger_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer pNum = GetPlayerId(GetOwningPlayer(gg_unit_O00Q_0533)) + 1
local integer spellLvl = GetUnitAbilityLevel(gg_unit_O00Q_0533, 'A056')
//call DisplayTextToForce( GetPlayersAll(), "Trisky Bugger" )
call PDummyImmediateOrder(pNum, 'A0FK', spellLvl, "roar", 0, x, y)
endfunction
//===========================================================================
function InitTrig_Trisky_Bugger takes nothing returns nothing
set gg_trg_Trisky_Bugger = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Trisky_Bugger, gg_unit_O00Q_0533, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Trisky_Bugger, Condition( function Trig_Trisky_Bugger_Conditions ) )
call TriggerAddAction( gg_trg_Trisky_Bugger, function Trig_Trisky_Bugger_Actions )
endfunction
function Trig_Troll_Regeneration_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A11D'
endfunction
function Trig_Troll_Regeneration_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A11D') == 1 ) then
call UnitAddAbility(u, 'A0BV' )
else
if ( GetUnitAbilityLevel(u, 'A11D') == 2 ) then
call UnitRemoveAbility( u, 'A0BV' )
call UnitAddAbility( u, 'A11E' )
else
call UnitRemoveAbility( u, 'A11E' )
call UnitAddAbility( u, 'A11F' )
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Troll_Regeneration takes nothing returns nothing
set gg_trg_Troll_Regeneration = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Troll_Regeneration, Player(4), EVENT_PLAYER_HERO_SKILL, null )
call TriggerRegisterUnitEvent( gg_trg_Troll_Regeneration, gg_unit_O00T_0536, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Troll_Regeneration, Condition( function Trig_Troll_Regeneration_Conditions ) )
call TriggerAddAction( gg_trg_Troll_Regeneration, function Trig_Troll_Regeneration_Actions )
endfunction
globals
hashtable GrukashTable = InitHashtable()
endglobals
function Earth_Splinter_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0R6'
endfunction
function EarthsplinterEffect takes unit caster, unit target returns nothing
local group g = CreateGroup()
local real x = GetUnitX(target)
local real y = GetUnitY(target)
local real x2
local real y2
local real stunAngle = Atan2(GetUnitY(caster) - y, GetUnitX(caster) - x) * bj_RADTODEG
local real unitAngle
local real angleDifference
local unit u
local integer pNum = GetPlayerId(GetOwningPlayer(caster)) + 1
//call DisplayTextToForce( GetPlayersAll(), "Earth Splinter" )
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
call UnitAddAbility(Dummy, 'A0R7')
call SetUnitAbilityLevel(Dummy, 'A0R7', GetUnitAbilityLevel(caster, 'A0R6'))
call SetUnitOwner(Dummy, Player(4), false)
call GroupEnumUnitsInRange(g, x, y, 325.00, null)
call GroupRemoveUnit(g, target)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set unitAngle = Atan2( y - y2, x - x2) * bj_RADTODEG
set angleDifference = ModuloReal(stunAngle - unitAngle + 540, 360) - 180
if ( angleDifference <= 65 and angleDifference >= -65 ) then
call IssueTargetOrder(Dummy, "creepthunderbolt", u)
endif
endloop
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
call UnitRemoveAbility(Dummy, 'A0R7')
call SetUnitOwner(Dummy, Player(PLAYER_NEUTRAL_PASSIVE), false)
call DestroyGroup(g)
set g = null
set u = null
endfunction
function Earth_Splinter_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(GrukashTable, GetHandleId(t), 0)
local unit caster = LoadUnitHandle(GrukashTable, GetHandleId(t), 1)
local integer failsafeCounter = LoadInteger(GrukashTable, GetHandleId(t), 2)
set failsafeCounter = failsafeCounter - 1
call RemoveSavedInteger(GrukashTable, GetHandleId(t), 2)
call SaveInteger(GrukashTable, GetHandleId(t), 2, failsafeCounter)
if ( GetUnitAbilityLevel(u, 'B02V' ) > 0 or failsafeCounter == 0 ) then
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(GrukashTable, GetHandleId(t))
if ( GetUnitAbilityLevel(u, 'B02V' ) > 0 ) then
call UnitDamageTarget(caster, u, 75 * GetUnitAbilityLevel(caster, 'A0R6'), true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
call EarthsplinterEffect(caster, u)
endif
endif
set u = null
set t = null
set caster = null
endfunction
function Earth_Splinter_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetTriggerUnit()
call SaveUnitHandle(GrukashTable, GetHandleId(t), 0, GetSpellTargetUnit())
call SaveUnitHandle(GrukashTable, GetHandleId(t), 1, caster)
//if, for example Grimgor with spell shield up was targeted, the timer would
//keep running in the background forever or until he was hit by another cast
//so giving the ability 8 seconds to hit.
call SaveInteger(GrukashTable, GetHandleId(t), 2, 80)
call TimerStart(t, 0.10, true, function Earth_Splinter_Periodic)
set t = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Earth_Splinter takes nothing returns nothing
set gg_trg_Earth_Splinter = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Earth_Splinter, Player(4), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Earth_Splinter, gg_unit_O00U_0518, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Earth_Splinter, Condition(function Earth_Splinter_Conditions) )
call TriggerAddAction( gg_trg_Earth_Splinter, function Earth_Splinter_Actions )
endfunction
function Ironhide_Roar_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1BL'
endfunction
function Ironhide_Roar_Actions takes nothing returns nothing
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local group g = CreateGroup()
local unit u
local integer i = 0
local integer lim
local integer spellId
if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A0A8' ) == 1 ) then
set spellId = 'A0M6'
elseif ( GetUnitAbilityLevel(GetTriggerUnit(), 'A0A8' ) == 2 ) then
set spellId = 'A0QN'
else
set spellId = 'A0QO'
endif
call GroupEnumUnitsInRange(g, x, y, 600.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen i == lim
set u = BlzGroupUnitAt(g, i)
if (IsUnitAlly(u, Player(pNum)) ) then
if (GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if (IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
call UnitAddAbility(u, spellId)
endif
endif
endif
set i = i + 1
endloop
call TriggerSleepAction(15.00)
set i = 0
loop
exitwhen i == lim
if (BlzGroupUnitAt(g, i) != null ) then
call UnitRemoveAbility(BlzGroupUnitAt(g, i), spellId)
endif
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Ironhide_Roar takes nothing returns nothing
set gg_trg_Ironhide_Roar = CreateTrigger( )
call DisableTrigger( gg_trg_Ironhide_Roar )
call TriggerRegisterPlayerUnitEvent(gg_trg_Ironhide_Roar, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Ironhide_Roar, gg_unit_O00S_0599, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Ironhide_Roar, Condition(function Ironhide_Roar_Conditions) )
call TriggerAddAction( gg_trg_Ironhide_Roar, function Ironhide_Roar_Actions )
endfunction
function Trig_Acidic_Web_Spray_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1N7'
endfunction
function Trig_Acidic_Web_Spray_Actions takes nothing returns nothing
call EnableTrigger(gg_trg_Acidic_Web_Spray_Slow)
call PolledWait(1.00)
call DisableTrigger(gg_trg_Acidic_Web_Spray_Slow)
endfunction
//===========================================================================
function InitTrig_Acidic_Web_Spray takes nothing returns nothing
set gg_trg_Acidic_Web_Spray = CreateTrigger( )
call DisableTrigger( gg_trg_Acidic_Web_Spray )
call TriggerRegisterUnitEvent( gg_trg_Acidic_Web_Spray, gg_unit_O00R_0598, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Acidic_Web_Spray, Condition( function Trig_Acidic_Web_Spray_Conditions ) )
call TriggerAddAction( gg_trg_Acidic_Web_Spray, function Trig_Acidic_Web_Spray_Actions )
endfunction
function Trig_Acidic_Web_Spray_Slow_Conditions takes nothing returns boolean
return ( GetEventDamageSource() == gg_unit_O00R_0598 and BlzGetEventDamageType() == DAMAGE_TYPE_SONIC )
endfunction
function Trig_Acidic_Web_Spray_Slow_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer pNum = GetPlayerId(GetOwningPlayer(GetEventDamageSource())) + 1
local integer lvl = GetUnitAbilityLevel(GetEventDamageSource(), 'A1N7')
call PDummyTargetOrder(pNum, 'A1FN', lvl, "slow", 0, u, x, y)
set u = null
endfunction
//===========================================================================
function InitTrig_Acidic_Web_Spray_Slow takes nothing returns nothing
set gg_trg_Acidic_Web_Spray_Slow = CreateTrigger( )
call DisableTrigger( gg_trg_Acidic_Web_Spray_Slow )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Acidic_Web_Spray_Slow, EVENT_PLAYER_UNIT_DAMAGED )
call TriggerAddCondition( gg_trg_Acidic_Web_Spray_Slow, Condition( function Trig_Acidic_Web_Spray_Slow_Conditions ) )
call TriggerAddAction( gg_trg_Acidic_Web_Spray_Slow, function Trig_Acidic_Web_Spray_Slow_Actions )
endfunction
globals
integer EarthshakerInt
endglobals
function Trig_Earthshaker_Stomp_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1N2'
endfunction
function EarthshakerPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_O00N_0597, 'A1N2')
local real radius = 250 + 100 * lvl
local real damage = 5 + 5 * lvl
local real x = GetUnitX(gg_unit_O00N_0597)
local real y = GetUnitY(gg_unit_O00N_0597)
if ( EarthshakerInt > 0 and GetWidgetLife(gg_unit_O00N_0597) > 0.405 ) then
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
call StompTrigger(gg_unit_O00N_0597, lvl, 0.2, 0.2, damage, radius, x, y, 24)
set EarthshakerInt = EarthshakerInt - 1
else
call PauseTimer(t)
call DestroyTimer(t)
call SetUnitTimeScale(gg_unit_O00N_0597, 1)
endif
set t = null
endfunction
function Trig_Earthshaker_Stomp_Actions takes nothing returns nothing
local timer t = CreateTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_O00N_0597, 'A1N2')
local real radius = 250 + 100 * lvl
local real damage = 5 + 5 * lvl
local real x = GetUnitX(gg_unit_O00N_0597)
local real y = GetUnitY(gg_unit_O00N_0597)
set EarthshakerInt = 3 + 1 * lvl
call SetUnitTimeScale(gg_unit_O00N_0597, 1.75)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
call StompTrigger(gg_unit_O00N_0597, lvl, 0.2, 0.2, damage, radius, x, y, 24)
call TimerStart(t, 0.4, true, function EarthshakerPeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Earthshaker_Stomp takes nothing returns nothing
set gg_trg_Earthshaker_Stomp = CreateTrigger( )
call DisableTrigger( gg_trg_Earthshaker_Stomp )
call TriggerRegisterUnitEvent( gg_trg_Earthshaker_Stomp, gg_unit_O00N_0597, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Earthshaker_Stomp, Condition( function Trig_Earthshaker_Stomp_Conditions ) )
call TriggerAddAction( gg_trg_Earthshaker_Stomp, function Trig_Earthshaker_Stomp_Actions )
endfunction
globals
integer GatlingInt
real GatlingX
real GatlingY
unit GatlingDummy
endglobals
function Trig_Gatling_Gun_Barrage_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1N4'
endfunction
function GatlingPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = gg_unit_O00N_0597
local integer lvl = GetUnitAbilityLevel(caster, 'A1N4')
local real x = GetUnitX(gg_unit_O00N_0597)
local real y = GetUnitY(gg_unit_O00N_0597)
if ( GatlingInt > 0 and GetWidgetLife(caster) > 0.405 ) then
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
call IssuePointOrder(GatlingDummy,"carrionswarm", GatlingX, GatlingY)
set GatlingInt = GatlingInt - 1
else
call PauseTimer(t)
call DestroyTimer(t)
call PauseUnit(caster, false)
call SetUnitTimeScale(caster, 1)
endif
set t = null
endfunction
function Trig_Gatling_Gun_Barrage_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(caster, 'A1N4')
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
set GatlingX = GetSpellTargetX()
set GatlingY = GetSpellTargetY()
set GatlingInt = 8 + 3 * lvl
call SetUnitTimeScale(caster, 1.75)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
set GatlingDummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call SetUnitScale(GatlingDummy, 1.0, 1.0, 1.0)
call UnitApplyTimedLife(GatlingDummy, 'BTLF', 4.00)
call UnitAddAbility(GatlingDummy, 'A1N5')
call SetUnitAbilityLevel(GatlingDummy, 'A1N5', GetUnitAbilityLevel(caster, 'A1N4'))
call IssuePointOrder(GatlingDummy,"carrionswarm", GatlingX, GatlingY)
call PauseUnit(caster, true)
call TimerStart(t, 0.2, true, function GatlingPeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Gatling_Gun_Barrage takes nothing returns nothing
set gg_trg_Gatling_Gun_Barrage = CreateTrigger( )
call DisableTrigger( gg_trg_Gatling_Gun_Barrage )
call TriggerRegisterUnitEvent( gg_trg_Gatling_Gun_Barrage, gg_unit_O00N_0597, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Gatling_Gun_Barrage, Condition( function Trig_Gatling_Gun_Barrage_Conditions ) )
call TriggerAddAction( gg_trg_Gatling_Gun_Barrage, function Trig_Gatling_Gun_Barrage_Actions )
endfunction
function Desert_Fury_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit dummy
if ( GetSpellAbilityId() == 'A1Q0' ) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + (200 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A1Q0'))) )
set dummy = (CreateUnit( GetOwningPlayer(u), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A1Q1')
call SetUnitAbilityLevel(dummy, 'A1Q1', GetUnitAbilityLevel(GetTriggerUnit(), 'A1Q0'))
call IssueTargetOrder(dummy,"antimagicshell", u)
endif
set u = null
set dummy = null
endfunction
function InitTrig_Desert_Fury takes nothing returns nothing
set gg_trg_Desert_Fury = CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_Desert_Fury, gg_unit_H0EV_1763, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_Desert_Fury, function Desert_Fury_Actions)
endfunction
function Deserts_Fortitude_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real radius = 275
local real x
local real y
local group g = CreateGroup()
local unit target = null
local integer ctr = 0
local integer lim
if ( GetSpellAbilityId() == 'A1Q3' ) then
call PolledWait(5.0)
set x = GetUnitX(caster)
set y = GetUnitY(caster)
call DestroyEffect(AddSpecialEffect("ExplosionBIG.mdx", x, y))
call GroupEnumUnitsInRange(g, x, y, 275.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set target = BlzGroupUnitAt(g, ctr)
if ( IsUnitEnemy(target, GetOwningPlayer(caster)) ) then
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) - 250 )
endif
set ctr = ctr + 1
endloop
endif
call DestroyGroup(g)
set caster = null
set target = null
endfunction
function InitTrig_Deserts_Fortitude takes nothing returns nothing
set gg_trg_Deserts_Fortitude = CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_Deserts_Fortitude, gg_unit_H0F4_1765, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(gg_trg_Deserts_Fortitude, function Deserts_Fortitude_Actions)
endfunction
function Trig_Twin_Mirage_Slash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1Q4'
endfunction
function Trig_Twin_Mirage_Slash_Actions takes nothing returns nothing
call EnableTrigger(gg_trg_Twin_Mirage_Slash_Slow)
call PolledWait(1.00)
call DisableTrigger(gg_trg_Twin_Mirage_Slash_Slow)
endfunction
//===========================================================================
function InitTrig_Twin_Mirage_Slash takes nothing returns nothing
set gg_trg_Twin_Mirage_Slash = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Twin_Mirage_Slash, gg_unit_H0GR_2225, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Twin_Mirage_Slash, Condition( function Trig_Twin_Mirage_Slash_Conditions ) )
call TriggerAddAction( gg_trg_Twin_Mirage_Slash, function Trig_Twin_Mirage_Slash_Actions )
endfunction
function Trig_Twin_Mirage_Slash_Slow_Conditions takes nothing returns boolean
return ( GetEventDamageSource() == gg_unit_H0GR_2225 and BlzGetEventDamageType() == DAMAGE_TYPE_SONIC )
endfunction
function Trig_Twin_Mirage_Slash_Slow_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer pNum = GetPlayerId(GetOwningPlayer(GetEventDamageSource())) + 1
local integer lvl = GetUnitAbilityLevel(GetEventDamageSource(), 'A1Q4')
call PDummyTargetOrder(pNum, 'A1FN', lvl, "slow", 0, u, x, y)
set u = null
endfunction
//===========================================================================
function InitTrig_Twin_Mirage_Slash_Slow takes nothing returns nothing
set gg_trg_Twin_Mirage_Slash_Slow = CreateTrigger( )
call DisableTrigger( gg_trg_Twin_Mirage_Slash_Slow )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Twin_Mirage_Slash_Slow, EVENT_PLAYER_UNIT_DAMAGED )
call TriggerAddCondition( gg_trg_Twin_Mirage_Slash_Slow, Condition( function Trig_Twin_Mirage_Slash_Slow_Conditions ) )
call TriggerAddAction( gg_trg_Twin_Mirage_Slash_Slow, function Trig_Twin_Mirage_Slash_Slow_Actions )
endfunction
function Desert_Nuke_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0FC'
endfunction
function DesertNukeDamage takes nothing returns nothing
local timer t = GetExpiredTimer()
local real x = LoadReal(AbilityTable[5], GetHandleId(t), 0)
local real y = LoadReal(AbilityTable[5], GetHandleId(t), 1)
local unit u
local group g = CreateGroup()
local integer ctr = 0
local integer lim
call GroupEnumUnitsInRange(g, x, y, 400, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set u = BlzGroupUnitAt(g, ctr)
call UnitDamageTarget(gg_unit_H0HO_2017, u, 500, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
set ctr = ctr + 1
endloop
call DestroyGroup(g)
call FlushChildHashtable(AbilityTable[5], GetHandleId(t))
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set g = null
set u = null
endfunction
function Desert_Nuke_Actions takes nothing returns nothing
local timer t = CreateTimer()
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit dummy
set dummy = (CreateUnit(GetOwningPlayer(gg_unit_H0HO_2017),'h02L', x, y, bj_UNIT_FACING))
call SaveReal(AbilityTable[5], GetHandleId(t), 0, x)
call SaveReal(AbilityTable[5], GetHandleId(t), 1, y)
call UnitApplyTimedLife( dummy, 'BTLF', 6.00)
call UnitAddAbility(dummy,'A1R2')
call IssuePointOrder(dummy, "flamestrike", x, y)
call TimerStart(t, 1.9, false, function DesertNukeDamage)
set dummy = null
set t = null
endfunction
//===========================================================================
function InitTrig_Desert_Nuke takes nothing returns nothing
set gg_trg_Desert_Nuke = CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_Desert_Nuke, gg_unit_H0HO_2017, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Desert_Nuke, Condition(function Desert_Nuke_Conditions))
call TriggerAddAction(gg_trg_Desert_Nuke, function Desert_Nuke_Actions)
endfunction
globals
trigger DesertNukeEndCast
endglobals
function DesertNukeEndCastActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local effect sfx = LoadEffectHandle(AbilityTable[5], GetHandleId(u), 0)
call DestroyEffect(sfx)
call FlushChildHashtable(AbilityTable[5], GetHandleId(u))
set u = null
set sfx = null
endfunction
function Trig_Desert_Nuke_Anim_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local effect sfx = AddSpecialEffect("war3mapImported\\Spell Marker TC.mdx", x, y)
call BlzSetSpecialEffectColorByPlayer(sfx, GetOwningPlayer(u))
call BlzSetSpecialEffectHeight(sfx, BlzGetLocalSpecialEffectZ(sfx) + 15 )
call SaveEffectHandle(AbilityTable[5], GetHandleId(u), 0, sfx)
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Desert_Nuke_Anim takes nothing returns nothing
set gg_trg_Desert_Nuke_Anim = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Desert_Nuke_Anim, gg_unit_H0HO_2017, EVENT_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Desert_Nuke_Anim, Condition( function Desert_Nuke_Conditions ) )
call TriggerAddAction( gg_trg_Desert_Nuke_Anim, function Trig_Desert_Nuke_Anim_Actions )
set DesertNukeEndCast = CreateTrigger( )
call TriggerRegisterUnitEvent( DesertNukeEndCast, gg_unit_H0HO_2017, EVENT_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( DesertNukeEndCast, Condition( function Desert_Nuke_Conditions ) )
call TriggerAddAction( DesertNukeEndCast, function DesertNukeEndCastActions )
endfunction
function Trig_Chilling_Blow_Conditions takes nothing returns boolean
return GetAttacker() == gg_unit_H01Q_0067
endfunction
constant function GetMissingHealth takes unit target returns real
return GetUnitState(target, UNIT_STATE_MAX_LIFE) - GetUnitState(target, UNIT_STATE_LIFE)
endfunction
function ChillingBlowEffect takes unit caster, unit target returns nothing
local real dmg = 10.0 // base damage
local real bonus_factor = 0.05 // bonus damage factor based on missing health
local unit u = GetTriggerUnit()
//call DisplayTextToForce( GetPlayersAll(), "Chilling Blow" )
if ( GetUnitAbilityLevel(u, 'A0CX') == 1 ) then
call UnitDamageTarget(caster, target, dmg + bonus_factor * GetMissingHealth(target), true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, null)
else
if ( GetUnitAbilityLevel(u, 'A0CX') == 2 ) then
call UnitDamageTarget(caster, target, dmg + (bonus_factor + 0.05) * GetMissingHealth(target), true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, null)
else
if ( GetUnitAbilityLevel(u, 'A0CX') == 3 ) then
call UnitDamageTarget(caster, target, dmg + (bonus_factor + 0.1) * GetMissingHealth(target), true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, null)
endif
endif
endif
set u = null
endfunction
function Trig_Chilling_Blow_Actions takes nothing returns nothing
call ChillingBlowEffect(GetAttacker(), GetTriggerUnit())
endfunction
//===========================================================================
function InitTrig_Chilling_Blow takes nothing returns nothing
set gg_trg_Chilling_Blow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Chilling_Blow, EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Chilling_Blow, Condition(function Trig_Chilling_Blow_Conditions))
call TriggerAddAction( gg_trg_Chilling_Blow, function Trig_Chilling_Blow_Actions )
endfunction
function Trig_Polar_Pop_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02X'
endfunction
function Trig_Polar_Pop_Actions takes nothing returns nothing
local real x = GetUnitX(gg_unit_H01T_0070)
local real y = GetUnitY(gg_unit_H01T_0070)
local group g = CreateGroup()
local integer lim
local integer i = 0
local unit u
//call DisplayTextToForce( GetPlayersAll(), "Polar Pop" )
call GroupEnumUnitsInRange(g, x, y, 500.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen i == lim
set u = BlzGroupUnitAt(g, i)
if (IsUnitAlly(u, GetOwningPlayer(gg_unit_H01T_0070)) ) then
if (GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if (IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
call UnitAddAbility(u, 'A0QL')
call SetUnitAbilityLevel(u, 'A0QL', GetUnitAbilityLevel(gg_unit_H01T_0070, 'A02X'))
endif
endif
endif
set i = i + 1
endloop
//Auras linger for 3 seconds, so removing the buff 3 seconds before roar expires
call TriggerSleepAction(7.00)
set i = 0
loop
exitwhen i == lim
if (BlzGroupUnitAt(g, i) != null ) then
call UnitRemoveAbility(BlzGroupUnitAt(g, i), 'A0QL')
endif
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Polar_Pop takes nothing returns nothing
set gg_trg_Polar_Pop = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Polar_Pop, gg_unit_H01T_0070, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Polar_Pop, Condition( function Trig_Polar_Pop_Conditions ) )
call TriggerAddAction( gg_trg_Polar_Pop, function Trig_Polar_Pop_Actions )
endfunction
function Trig_Silencing_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1CG'
endfunction
function Trig_Silencing_Strike_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit u
set u = GetSpellTargetUnit()
call PolledWait(0.05)
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
call UnitAddAbility(Dummy, 'A101')
call SetUnitAbilityLevel(Dummy, 'A101', GetUnitAbilityLevel(gg_unit_H00M_0024, 'A1CG'))
call IssueTargetOrder(Dummy, "soulburn", u)
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
call UnitRemoveAbility(Dummy, 'A101')
set u = null
endfunction
//===========================================================================
function InitTrig_Silencing_Strike takes nothing returns nothing
set gg_trg_Silencing_Strike = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Silencing_Strike, gg_unit_H0CY_2128, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Silencing_Strike, Condition( function Trig_Silencing_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Silencing_Strike, function Trig_Silencing_Strike_Actions )
endfunction
function Trig_Dagger_Dance_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1CI'
endfunction
function Trig_Dagger_Dance_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A103') == 1 ) then
call UnitAddAbility(u, 'A105' )
else
if ( GetUnitAbilityLevel(u, 'A103') == 2 ) then
call SetUnitAbilityLevel(u, 'A105', 2)
else
call SetUnitAbilityLevel(u, 'A105', 3)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Dagger_Dance takes nothing returns nothing
set gg_trg_Dagger_Dance = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Dagger_Dance, gg_unit_H0CY_2128, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Dagger_Dance, Condition( function Trig_Dagger_Dance_Conditions ) )
call TriggerAddAction( gg_trg_Dagger_Dance, function Trig_Dagger_Dance_Actions )
endfunction
function Shadow_Assassination_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1CJ'
endfunction
function Shadow_Assassination_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local string sfx = "BlinkCaster_Portrait.mdx"
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real angle = GetUnitFacing(u) + 180
local real x2
local real y2
set x2 = x + (50 * Cos(angle * bj_DEGTORAD))
set y2 = y + (50 * Sin(angle * bj_DEGTORAD))
call PolledWait(0.05)
call SetUnitPosition(caster, x2, y2 )
call SetUnitFacing(caster, GetUnitFacing(u))
call UnitAddAbility(caster, 'A17G')
call IssueImmediateOrder(caster, "windwalk")
call UnitRemoveAbility(caster, 'A17G')
call IssueTargetOrder(caster, "attack", u)
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
set caster = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Shadow_Assassination takes nothing returns nothing
set gg_trg_Shadow_Assassination = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Shadow_Assassination, gg_unit_H0CY_2128, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Assassination, Condition( function Shadow_Assassination_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Assassination, function Shadow_Assassination_Actions )
endfunction
function Maelstrom_Call_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1CX'
endfunction
function Maelstrom_Call_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit caster = GetTriggerUnit()
local unit dummy
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BA', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A0DR' )
call SetUnitAbilityLevel( dummy, 'A0DR', 3 )
call IssueImmediateOrder( dummy, "whirlwind" )
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BB', x, y, bj_UNIT_FACING ) )
call SetUnitVertexColor( dummy, 100, 100, 100, 13 )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A0DT' )
call IssueImmediateOrder( dummy, "whirlwind" )
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Maelstrom_Call takes nothing returns nothing
set gg_trg_Maelstrom_Call = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Maelstrom_Call, gg_unit_H0D0_2134, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Maelstrom_Call, Condition(function Maelstrom_Call_Conditions ) )
call TriggerAddAction( gg_trg_Maelstrom_Call, function Maelstrom_Call_Actions )
endfunction
function Trig_Big_Boy_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1D0'
endfunction
function Trig_Big_Boy_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1D0') == 1 ) then
call UnitAddAbility(u, 'A1BB' )
call BlzUnitHideAbility(u, 'A1BB', true)
else
if ( GetUnitAbilityLevel(u, 'A1D0') == 2 ) then
call SetUnitAbilityLevel(u, 'A1BB', 2)
else
call SetUnitAbilityLevel(u, 'A1BB', 2)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Big_Boy takes nothing returns nothing
set gg_trg_Big_Boy = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Big_Boy, gg_unit_H0D3_0527, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Big_Boy, Condition( function Trig_Big_Boy_Conditions ) )
call TriggerAddAction( gg_trg_Big_Boy, function Trig_Big_Boy_Actions )
endfunction
function Dehydrate_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A15H'
endfunction
function Dehydrate_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit caster = GetTriggerUnit()
local unit dummy
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BA', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A1FD' )
call IssueImmediateOrder( dummy, "whirlwind" )
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h0BB', x, y, bj_UNIT_FACING ) )
call SetUnitVertexColor( dummy, 100, 100, 100, 13 )
call UnitApplyTimedLife(dummy, 'BTLF', 8.00 )
call UnitAddAbility( dummy, 'A0DT' )
call IssueImmediateOrder( dummy, "whirlwind" )
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Dehydrate takes nothing returns nothing
set gg_trg_Dehydrate = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Dehydrate, gg_unit_H09L_1531, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dehydrate, Condition(function Dehydrate_Conditions ) )
call TriggerAddAction( gg_trg_Dehydrate, function Dehydrate_Actions )
endfunction
function Trig_Dual_Slash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0UW'
endfunction
function Trig_Dual_Slash_Actions takes nothing returns nothing
call EnableTrigger(gg_trg_Dual_Slash_Slow)
call PolledWait(1.00)
call DisableTrigger(gg_trg_Dual_Slash_Slow)
endfunction
//===========================================================================
function InitTrig_Dual_Slash takes nothing returns nothing
set gg_trg_Dual_Slash = CreateTrigger( )
call DisableTrigger( gg_trg_Dual_Slash )
call TriggerRegisterUnitEvent( gg_trg_Dual_Slash, gg_unit_H09O_2101, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dual_Slash, Condition( function Trig_Dual_Slash_Conditions ) )
call TriggerAddAction( gg_trg_Dual_Slash, function Trig_Dual_Slash_Actions )
endfunction
function Trig_Dual_Slash_Slow_Conditions takes nothing returns boolean
return ( GetEventDamageSource() == gg_unit_H09O_2101 and BlzGetEventDamageType() == DAMAGE_TYPE_SONIC )
endfunction
function Trig_Dual_Slash_Slow_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer pNum = GetPlayerId(GetOwningPlayer(GetEventDamageSource())) + 1
local integer lvl = GetUnitAbilityLevel(GetEventDamageSource(), 'A0UW')
call PDummyTargetOrder(pNum, 'A1FN', lvl, "slow", 0, u, x, y)
set u = null
endfunction
//===========================================================================
function InitTrig_Dual_Slash_Slow takes nothing returns nothing
set gg_trg_Dual_Slash_Slow = CreateTrigger( )
call DisableTrigger( gg_trg_Dual_Slash_Slow )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dual_Slash_Slow, EVENT_PLAYER_UNIT_DAMAGED )
call TriggerAddCondition( gg_trg_Dual_Slash_Slow, Condition( function Trig_Dual_Slash_Slow_Conditions ) )
call TriggerAddAction( gg_trg_Dual_Slash_Slow, function Trig_Dual_Slash_Slow_Actions )
endfunction
function Red_Moons_Grace_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A0KQ' )
endfunction
function Red_Moons_Grace_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
local real lvl = GetUnitAbilityLevel(u, GetSpellAbilityId())
local real selfDmg = (20 + 55 * lvl) + (GetUnitState(u, UNIT_STATE_MAX_LIFE) * 0.1)
call PDummyImmediateOrder(pNum, 'A0KP', GetUnitAbilityLevel(u, 'A0KQ'), null, 852282, x, y)
call SetWidgetLife(u, RMaxBJ(GetWidgetLife(u) - selfDmg, 1.00))
set u = null
endfunction
//===========================================================================
function InitTrig_Red_Moons_Grace takes nothing returns nothing
set gg_trg_Red_Moons_Grace = CreateTrigger( )
call DisableTrigger( gg_trg_Red_Moons_Grace )
call TriggerRegisterUnitEvent(gg_trg_Red_Moons_Grace, gg_unit_H09I_2104, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Red_Moons_Grace, Condition(function Red_Moons_Grace_Conditions) )
call TriggerAddAction( gg_trg_Red_Moons_Grace, function Red_Moons_Grace_Actions )
endfunction
globals
unit DuelTarget
real DuelDuration
endglobals
function Trig_Duel_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0FR'
endfunction
function DuelPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local real x
local real y
set DuelDuration = DuelDuration - 0.05
if ( DuelDuration > 0 ) then
call IssueTargetOrder( gg_unit_H09I_2104, "attack", DuelTarget )
call IssueTargetOrder( DuelTarget, "attack", gg_unit_H09I_2104 )
else
call PauseTimer(t)
call DestroyTimer(t)
endif
if ( GetUnitState(gg_unit_H09I_2104, UNIT_STATE_LIFE) <= 0.405 ) then
//f for Kazuo
call UnitRemoveAbility( DuelTarget, 'B02Y' )
call UnitRemoveAbility( DuelTarget, 'B02Z' )
call PauseTimer(t)
call DestroyTimer(t)
elseif ( GetUnitState(DuelTarget, UNIT_STATE_LIFE) <= 0.405 ) then
//Kazuo won
call UnitRemoveAbility( gg_unit_H09I_2104, 'B02Y' )
call UnitRemoveAbility( gg_unit_H09I_2104, 'B02Z' )
set x = GetUnitX(gg_unit_H09I_2104)
set y = GetUnitY(gg_unit_H09I_2104)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Items\\AIsm\\AIsmTarget.mdl", x, y) )
if ( GetUnitAbilityLevel(gg_unit_H09I_2104, 'A0FU') < 1 ) then
call UnitAddAbility( gg_unit_H09I_2104, 'A0FU' )
else
call IncUnitAbilityLevel( gg_unit_H09I_2104, 'A0FU')
endif
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
endfunction
function Trig_Duel_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(gg_unit_H09I_2104)) + 1
local integer pNumTarget = GetPlayerId(GetOwningPlayer(u)) + 1
local real x1 = GetUnitX(gg_unit_H09I_2104)
local real y1 = GetUnitY(gg_unit_H09I_2104)
local real x2 = GetUnitX(u)
local real y2 = GetUnitY(u)
local timer t
//if ( UnitHasSpellShield(u) == false ) then
set t = CreateTimer()
set DuelTarget = u
set DuelDuration = 4.00
call TimerStart(t, 0.05, true, function DuelPeriodic)
call PDummyTargetOrder(pNumTarget, 'A0FS', 1, "bloodlust", 0, DuelTarget, x2, y2)
call PDummyTargetOrder(pNum, 'A0FS', 1, "bloodlust", 0, gg_unit_H09I_2104, x1, y1)
//Delay, otherwise the spell (by Kazuo) gets cancelled by doom.
call TriggerSleepAction( 0.05 )
call PDummyTargetOrder(pNum, 'A0FQ', 1, "doom", 0, gg_unit_H09I_2104, x1, y1)
//endif
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_Duel takes nothing returns nothing
set gg_trg_Duel = CreateTrigger( )
call DisableTrigger( gg_trg_Duel )
call TriggerRegisterUnitEvent( gg_trg_Duel, gg_unit_H09I_2104, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Duel, Condition( function Trig_Duel_Conditions ) )
call TriggerAddAction( gg_trg_Duel, function Trig_Duel_Actions )
endfunction
function Blink_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00U'
endfunction
function Trig_Zealous_Charge_Filter_Func takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetTriggerPlayer()) == true )
endfunction
function Trig_Zealous_Charge_Bloodlust_Func takes nothing returns nothing
call IssueTargetOrderBJ( udg_Dummy, "bloodlust", GetEnumUnit() )
endfunction
function Blink_Strike_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local string sfx = "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl"
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real angle = GetUnitFacing(u) + 180
local real x2
local real y2
//call DisplayTextToForce( GetPlayersAll(), "Zealous Charge" )
set x2 = x + (50 * Cos(angle * bj_DEGTORAD))
set y2 = y + (50 * Sin(angle * bj_DEGTORAD))
call PolledWait(0.05)
//Buffing
set udg_TempPoint = GetUnitLoc(GetTriggerUnit())
set udg_TempGroup = GetUnitsInRangeOfLocMatching(300.00, udg_TempPoint, Condition(function Trig_Zealous_Charge_Filter_Func))
call CreateNUnitsAtLoc( 1, 'e000', Player(8), udg_TempPoint, bj_UNIT_FACING )
set udg_Dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A0LG', udg_Dummy )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', udg_Dummy )
call ForGroupBJ( udg_TempGroup, function Trig_Zealous_Charge_Bloodlust_Func )
call RemoveLocation(udg_TempPoint)
call DestroyGroup(udg_TempGroup)
//damage dealing
call SetUnitPosition(caster, x2, y2 )
call SetUnitFacing(caster, GetUnitFacing(u))
call UnitAddAbility(caster, 'A0I4')
call IssueImmediateOrder(caster, "windwalk")
call UnitRemoveAbility(caster, 'A0I4')
call IssueTargetOrder(caster, "attack", u)
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
set caster = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_HOLDZealous_Charge takes nothing returns nothing
set gg_trg_HOLDZealous_Charge = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_HOLDZealous_Charge, gg_unit_H05W_0849, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_HOLDZealous_Charge, Condition( function Blink_Strike_Conditions ) )
call TriggerAddAction( gg_trg_HOLDZealous_Charge, function Blink_Strike_Actions )
endfunction
function Purge_the_Unbelievers_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0LX'
endfunction
function Purge_the_Unbelievers_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local group g = CreateGroup()
local unit target
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
set udg_TempPoint = GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'e000', Player(8), udg_TempPoint, bj_UNIT_FACING )
set udg_Dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A0MY', udg_Dummy )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', udg_Dummy )
call GroupEnumUnitsInRange(g, x, y, 450, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
if ( IsUnitAlly(target, GetOwningPlayer(caster)) ) then
if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) == false ) then
call IssueTargetOrder( udg_Dummy, "purge", target )
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) + 100)
endif
endif
endloop
set caster = null
set target = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Purge_the_Unbelievers takes nothing returns nothing
set gg_trg_Purge_the_Unbelievers = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Purge_the_Unbelievers, gg_unit_H05W_0849, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Purge_the_Unbelievers, Condition( function Purge_the_Unbelievers_Conditions ) )
call TriggerAddAction( gg_trg_Purge_the_Unbelievers, function Purge_the_Unbelievers_Actions )
endfunction
function Trig_Healing_Radiance_Conditions takes nothing returns boolean
if (not ( GetSpellAbilityId() == 'A0NA') ) then
return false
endif
return true
endfunction
function Trig_Healing_Radiance_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 200 + (100 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A0NA'))) )
set u = null
endfunction
//===========================================================================
function InitTrig_Healing_Radiance takes nothing returns nothing
set gg_trg_Healing_Radiance = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Healing_Radiance, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Healing_Radiance, Condition( function Trig_Healing_Radiance_Conditions ) )
call TriggerAddAction( gg_trg_Healing_Radiance, function Trig_Healing_Radiance_Actions )
endfunction
function Trig_Holy_Barrier_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0N8'
endfunction
function HolyBarrierRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[9], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[9], GetHandleId(t), 1)
//call DisplayTextToForce( GetPlayersAll(), "Holy Barrier" )
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
endfunction
function Trig_Holy_Barrier_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0N8')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[9], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[9], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function HolyBarrierRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Holy_Barrier takes nothing returns nothing
set gg_trg_Holy_Barrier = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Holy_Barrier, Player(8), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Holy_Barrier, gg_unit_H05X_0850, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Barrier, Condition( function Trig_Holy_Barrier_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Barrier, function Trig_Holy_Barrier_Actions )
endfunction
function Trig_Divine_Arrows_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A03U'
endfunction
function Trig_Divine_Arrows_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel( u, 'A03U' ) == 1 ) then
call UnitAddAbility( u, 'A0MU' )
else
call SetUnitAbilityLevel( u, 'A0MU', GetUnitAbilityLevel(u, 'A03U') )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Divine_Arrows takes nothing returns nothing
set gg_trg_Divine_Arrows = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Divine_Arrows, gg_unit_H05Z_0852, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Divine_Arrows, Condition( function Trig_Divine_Arrows_Conditions ) )
call TriggerAddAction( gg_trg_Divine_Arrows, function Trig_Divine_Arrows_Actions )
endfunction
function Trig_Aura_of_the_Devout_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A0OL'
endfunction
function Trig_Aura_of_the_Devout_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel( u, 'A0OL' ) == 1 ) then
call UnitAddAbility( u, 'A0OF' )
call BlzUnitHideAbility( u, 'A0OF', true )
else
call SetUnitAbilityLevel( u, 'A0OF', GetUnitAbilityLevel(u, 'A0OL') )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Aura_of_the_Devout takes nothing returns nothing
set gg_trg_Aura_of_the_Devout = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Aura_of_the_Devout, gg_unit_H05Y_0851, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Aura_of_the_Devout, Condition( function Trig_Aura_of_the_Devout_Conditions ) )
call TriggerAddAction( gg_trg_Aura_of_the_Devout, function Trig_Aura_of_the_Devout_Actions )
endfunction
function Trig_Molten_Armor_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1H8'
endfunction
function MA_Remove takes nothing returns nothing
local unit u = GetEnumUnit()
call UnitRemoveAbility( u, 'A0JS' )
call UnitRemoveAbility( u, 'A0JT' )
set u = null
endfunction
function Trig_Molten_Armor_Actions takes nothing returns nothing
local integer ctr = 0
local group g = CreateGroup()
local group g2 = CreateGroup()
local unit u
local real x = GetUnitX(gg_unit_H00W_0060)
local real y = GetUnitY(gg_unit_H00W_0060)
call GroupEnumUnitsInRange(g, x, y, 450.00, null)
loop
set u = FirstOfGroup(g)
//himself + 20
exitwhen ( ctr == 21 or u == null )
call GroupRemoveUnit(g, u)
if ( IsUnitAlly(u, GetOwningPlayer(gg_unit_H00W_0060) ) and GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
if ( not ( IsUnitType(u, UNIT_TYPE_STRUCTURE) ) ) then
if ( GetUnitAbilityLevel(u, 'A0J0') == 0 ) then
call GroupAddUnit(g2, u)
set ctr = ctr + 1
call UnitAddAbility( u, 'A0JS' )
call UnitAddAbility( u, 'A0JT' )
call SetUnitAbilityLevel( u, 'A0JT', GetUnitAbilityLevel(GetTriggerUnit(), 'A1H8'))
endif
endif
endif
endloop
call DestroyGroup(g)
call PolledWait( 12.00 )
//Can't use a FirstOfGroup() loop due to null entry shenanigans.
call ForGroup(g2, function MA_Remove)
call DestroyGroup(g2)
set g = null
set g2 = null
set u = null
endfunction
//===========================================================================
function InitTrig_Molten_Armor takes nothing returns nothing
set gg_trg_Molten_Armor = CreateTrigger( )
call DisableTrigger( gg_trg_Molten_Armor )
call TriggerRegisterUnitEvent( gg_trg_Molten_Armor, gg_unit_H00W_0060, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Molten_Armor, Condition( function Trig_Molten_Armor_Conditions ) )
call TriggerAddAction( gg_trg_Molten_Armor, function Trig_Molten_Armor_Actions )
endfunction
function Trig_Blessing_of_Aurora_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local string sfx = "HolyForce.mdx"
//If Blessing of Aurora is cast on self, normal heal. If cast on ally, heals caster for half as well.
if (GetSpellAbilityId() == 'A1HC' ) then
if (GetSpellTargetUnit() == caster) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 150 + (150 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId())) ))
else
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 150 + (150 * I2R(GetUnitAbilityLevel(caster, 'A1HC'))) )
call SetUnitState(caster, UNIT_STATE_LIFE, GetUnitState(caster, UNIT_STATE_LIFE) + 75 + (75 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId())) ))
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
endif
endif
set u = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Blessing_of_Aurora takes nothing returns nothing
set gg_trg_Blessing_of_Aurora = CreateTrigger( )
call DisableTrigger( gg_trg_Blessing_of_Aurora )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Blessing_of_Aurora, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Blessing_of_Aurora, function Trig_Blessing_of_Aurora_Actions )
endfunction
function Auroras_Judgment_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HE'
endfunction
function Auroras_Judgment_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x
local real y
local group g = CreateGroup()
local unit target
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
set udg_TempPoint = GetSpellTargetLoc()
set x = GetLocationX(udg_TempPoint)
set y = GetLocationY(udg_TempPoint)
call GroupEnumUnitsInRange(g, x, y, 250, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
if ( IsUnitAlly(target, GetOwningPlayer(caster)) ) then
if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) == false ) then
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) + 100)
endif
endif
endloop
set caster = null
set target = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Auroras_Judgment takes nothing returns nothing
set gg_trg_Auroras_Judgment = CreateTrigger( )
call DisableTrigger( gg_trg_Auroras_Judgment )
call TriggerRegisterUnitEvent( gg_trg_Auroras_Judgment, gg_unit_H01O_0065, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Auroras_Judgment, Condition( function Auroras_Judgment_Conditions ) )
call TriggerAddAction( gg_trg_Auroras_Judgment, function Auroras_Judgment_Actions )
endfunction
function Pyreclast_Smash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HI'
endfunction
function Pyreclast_Smash_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
local unit dummy
local integer spellLvl = GetUnitAbilityLevel(gg_unit_H01N_0042, 'A1HI')
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 3.00 )
call UnitAddAbility( dummy, 'A1HJ' )
call SetUnitAbilityLevel(dummy, 'A1HJ', spellLvl)
call IssueImmediateOrder( dummy, "roar" )
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Pyreclast_Smash takes nothing returns nothing
set gg_trg_Pyreclast_Smash = CreateTrigger( )
call DisableTrigger( gg_trg_Pyreclast_Smash )
call TriggerRegisterUnitEvent( gg_trg_Pyreclast_Smash, gg_unit_H01N_0042, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Pyreclast_Smash, Condition( function Pyreclast_Smash_Conditions ) )
call TriggerAddAction( gg_trg_Pyreclast_Smash, function Pyreclast_Smash_Actions )
endfunction
function Explosive_Rune_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HK'
endfunction
function Explosive_Rune_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit rune
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
local group g = CreateGroup()
local unit dummy
local unit target
local string sfx = "NewMassiveEX.mdx"
local integer spellLvl = GetUnitAbilityLevel(caster, 'A1HK')
set rune = (CreateUnit( GetOwningPlayer(caster), 'o01H', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', rune )
call SetUnitAbilityLevel(rune, 'A1HL', spellLvl)
call PolledWait(9.00)
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
call GroupEnumUnitsInRange(g, x, y, 250, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
if ( IsUnitEnemy(target, GetOwningPlayer(caster)) ) then
if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) == false ) then
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) - 100)
endif
endif
endloop
set caster = null
set dummy = null
set rune = null
endfunction
//===========================================================================
function InitTrig_Explosive_Rune takes nothing returns nothing
set gg_trg_Explosive_Rune = CreateTrigger( )
call DisableTrigger( gg_trg_Explosive_Rune )
call TriggerRegisterUnitEvent( gg_trg_Explosive_Rune, gg_unit_H01N_0042, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Explosive_Rune, Condition( function Explosive_Rune_Conditions ) )
call TriggerAddAction( gg_trg_Explosive_Rune, function Explosive_Rune_Actions )
endfunction
function Trig_Arcane_Rift_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HT'
endfunction
function Trig_Arcane_Rift_Actions takes nothing returns nothing
call EnableTrigger(gg_trg_Arcane_Rift_Slow)
call PolledWait(1.00)
call DisableTrigger(gg_trg_Arcane_Rift_Slow)
endfunction
//===========================================================================
function InitTrig_Arcane_Rift takes nothing returns nothing
set gg_trg_Arcane_Rift = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Arcane_Rift, gg_unit_H06M_0952, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arcane_Rift, Condition( function Trig_Arcane_Rift_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Rift, function Trig_Arcane_Rift_Actions )
endfunction
function Trig_Arcane_Rift_Slow_Conditions takes nothing returns boolean
return ( GetEventDamageSource() == gg_unit_H06M_0952 and BlzGetEventDamageType() == DAMAGE_TYPE_SONIC )
endfunction
function Trig_Arcane_Rift_Slow_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer pNum = GetPlayerId(GetOwningPlayer(GetEventDamageSource())) + 1
local integer lvl = GetUnitAbilityLevel(GetEventDamageSource(), 'A1HT')
call PDummyTargetOrder(pNum, 'A1FN', lvl, "slow", 0, u, x, y)
set u = null
endfunction
//===========================================================================
function InitTrig_Arcane_Rift_Slow takes nothing returns nothing
set gg_trg_Arcane_Rift_Slow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arcane_Rift_Slow, EVENT_PLAYER_UNIT_DAMAGED )
call TriggerAddCondition( gg_trg_Arcane_Rift_Slow, Condition( function Trig_Arcane_Rift_Slow_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Rift_Slow, function Trig_Arcane_Rift_Slow_Actions )
endfunction
function Polybomb_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HU'
endfunction
function Polybomb_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local group g = CreateGroup()
local unit spelltarget = GetSpellTargetUnit()
local real x
local real y
local unit target
local real groupsize
local integer pNum = GetPlayerId(GetOwningPlayer(GetTriggerUnit())) + 1
call PolledWait (0.50 + (1.5 * I2R(GetUnitAbilityLevel(caster, 'A1HU')) ))
//After expiration of time based on ability level, create dummy at point and cast polymorph on 4, 7, or 10 units based on level
set udg_TempPoint = GetUnitLoc(spelltarget)
call CreateNUnitsAtLoc( 1, 'e000', Player(9), udg_TempPoint, bj_UNIT_FACING )
set x = GetUnitX(spelltarget)
set y = GetUnitY(spelltarget)
set udg_Dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A1HV', udg_Dummy )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', udg_Dummy )
call GroupEnumUnitsInRange(g, x, y, 350, null)
set groupsize = 0
loop
set target = FirstOfGroup(g)
exitwhen groupsize == (1 + (3 * I2R(GetUnitAbilityLevel(caster, 'A1HU')) ))
call GroupRemoveUnit(g, target)
if ( IsUnitEnemy(target, GetOwningPlayer(caster)) ) then
if ( IsUnitType(target, UNIT_TYPE_HERO) == false ) then
call IssueTargetOrder( udg_Dummy, "polymorph", target )
set groupsize = groupsize + 1
endif
endif
endloop
set spelltarget = null
set caster = null
set target = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Polybomb takes nothing returns nothing
set gg_trg_Polybomb = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Polybomb, gg_unit_H06M_0952, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Polybomb, Condition( function Polybomb_Conditions ) )
call TriggerAddAction( gg_trg_Polybomb, function Polybomb_Actions )
endfunction
function Flash_Infusion_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1HW'
endfunction
function Trig_Flash_Infusion_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit dummy
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 150 + (150 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
set u = null
set dummy = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Flash_Infusion takes nothing returns nothing
set gg_trg_Flash_Infusion = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Flash_Infusion, gg_unit_H06M_0952, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flash_Infusion, Condition( function Flash_Infusion_Conditions ) )
call TriggerAddAction( gg_trg_Flash_Infusion, function Trig_Flash_Infusion_Actions )
endfunction
function Dominance_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1I5'
endfunction
function Trig_Dominance_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
call SetUnitState(caster, UNIT_STATE_LIFE, GetUnitState(caster, UNIT_STATE_LIFE) + 25 + (75 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
call DestroyEffect(AddSpecialEffect("Holy Light Royal.mdx", x, y))
set caster = null
endfunction
//===========================================================================
function InitTrig_Dominance takes nothing returns nothing
set gg_trg_Dominance = CreateTrigger( )
call DisableTrigger(gg_trg_Dominance)
call TriggerRegisterUnitEvent( gg_trg_Dominance, gg_unit_H06I_0950, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dominance, Condition( function Dominance_Conditions ) )
call TriggerAddAction( gg_trg_Dominance, function Trig_Dominance_Actions )
endfunction
function Ley_Line_Seal_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1I2'
endfunction
function Ley_Line_Seal_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit dummy
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local real angle = GetUnitFacing(caster) + 90
local real x2
local real y2
local integer pNum = GetPlayerId(GetOwningPlayer(caster))
local integer index = 0
local integer segmentCount = 8
local real length = 1000
local real offset = (length * 0.5)
local real distance = length / I2R(segmentCount)
local real duration = 20
loop
exitwhen index == segmentCount
set x2 = x + offset * Cos(angle * bj_DEGTORAD)
set y2 = y + offset * Sin(angle * bj_DEGTORAD)
call DestroyEffect(AddSpecialEffect("Accelerator Gate Blue.mdx", x2, y2))
set dummy = CreateUnit(Player(pNum), 'h0G6', x2, y2, angle - 90)
call UnitApplyTimedLife(dummy, 'BTLF', duration)
set offset = offset - distance
set index = index + 1
endloop
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Ley_Line_Seal takes nothing returns nothing
set gg_trg_Ley_Line_Seal = CreateTrigger( )
call DisableTrigger(gg_trg_Ley_Line_Seal)
call TriggerRegisterPlayerUnitEvent(gg_trg_Ley_Line_Seal, Player(9), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Ley_Line_Seal, gg_unit_H06I_0950, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Ley_Line_Seal, Condition(function Ley_Line_Seal_Conditions) )
call TriggerAddAction( gg_trg_Ley_Line_Seal, function Ley_Line_Seal_Actions )
endfunction
function Leaping_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1J4'
endfunction
function Leaping_Strike_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real x = GetUnitX(target) - GetUnitX(caster)
local real y = GetUnitY(target) - GetUnitY(caster)
local real distSquared = x * x + y * y
call SetUnitPathing( caster, false )
call GroupAddUnit(LeapingStrikers, caster)
call UnitAddAbility( caster, 'A1J5')
call UnitAddAbility( caster, 'Arav')
call UnitRemoveAbility( caster, 'Arav' )
call BlzPauseUnitEx(caster, true)
call SaveUnitHandle( LeapingStrikeTable, GetHandleId(caster), 0, target )
call SaveReal( LeapingStrikeTable, GetHandleId(caster), 1, distSquared)
call EnableTrigger( gg_trg_Leaping_Strike_Loop )
call BlzPauseUnitEx(caster, false)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Leaping_Strike takes nothing returns nothing
set gg_trg_Leaping_Strike = CreateTrigger( )
call DisableTrigger(gg_trg_Leaping_Strike)
call TriggerRegisterUnitEvent( gg_trg_Leaping_Strike, gg_unit_H06O_2083, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEvent( gg_trg_Leaping_Strike, Player(9), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerAddCondition( gg_trg_Leaping_Strike, Condition( function Leaping_Strike_Conditions) )
call TriggerAddAction( gg_trg_Leaping_Strike, function Leaping_Strike_Actions )
endfunction
function Leaping_Strike_ForGroup takes nothing returns nothing
local unit u = GetEnumUnit()
local unit target = LoadUnitHandle(LeapingStrikeTable, GetHandleId(u), 0)
local real x = GetUnitX(target) - GetUnitX(u)
local real y = GetUnitY(target) - GetUnitY(u)
local real dist = x * x + y * y
local real descentDist = (LoadReal(LeapingStrikeTable, GetHandleId(u), 1))
local real angle
local real radius
local real damage
//75^2
if (dist > 5625) then
set angle = Atan2( y, x ) * bj_RADTODEG
call SetUnitFacing(u, angle)
set x = GetUnitX(u) + 25 * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(u) + 25 * Sin(angle * bj_DEGTORAD)
call SetUnitX(u, x)
call SetUnitY(u, y)
if (dist >= descentDist * 0.35) then
if ( GetUnitFlyHeight(u) <= 400 ) then
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) + 25, 1000000000.00 )
endif
else
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) - 25, 1000000000.00 )
endif
else
call GroupRemoveUnit(LeapingStrikers, u)
call SetUnitFlyHeight( u, 0, 1000000000.00 )
call UnitRemoveAbility( u, 'A1J5')
call BlzPauseUnitEx(u, false)
call SetUnitPathing( u, true )
call IssueTargetOrder( u, "attack", target )
call FlushChildHashtable( LeapingStrikeTable, GetHandleId(u) )
set radius = 350
set damage = 150
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" , GetUnitX(u), GetUnitY(u) ) )
call SlamTrigger(u, 'A0JL', GetUnitAbilityLevel(u, 'A1J4'), damage, radius, GetUnitX(u), GetUnitY(u), 20)
endif
set u = null
set target = null
endfunction
function Leaping_Strike_Loop_Actions takes nothing returns nothing
call ForGroup(LeapingStrikers, function Leaping_Strike_ForGroup)
if (BlzGroupGetSize(LeapingStrikers) == 0) then
call DisableTrigger(GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Leaping_Strike_Loop takes nothing returns nothing
set gg_trg_Leaping_Strike_Loop = CreateTrigger( )
call DisableTrigger( gg_trg_Leaping_Strike_Loop )
call TriggerAddAction( gg_trg_Leaping_Strike_Loop, function Leaping_Strike_Loop_Actions )
call TriggerRegisterTimerEvent( gg_trg_Leaping_Strike_Loop, 0.05, true )
endfunction
function Tough_as_Nails_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1J6'
endfunction
function Tough_as_Nails_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1J6') == 1 ) then
call UnitAddAbility(u, 'A1J7' )
call BlzUnitHideAbility(u, 'A1J7', true)
else
if ( GetUnitAbilityLevel(u, 'A1J6') == 2 ) then
call SetUnitAbilityLevel(u, 'A1J7', GetUnitAbilityLevel(u, 'A1J6'))
call BlzUnitHideAbility(u, 'A1J7', true)
else
call SetUnitAbilityLevel(u, 'A1J7', GetUnitAbilityLevel(u, 'A1J6'))
call BlzUnitHideAbility(u, 'A1J7', true)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Tough_as_Nails takes nothing returns nothing
set gg_trg_Tough_as_Nails = CreateTrigger( )
call DisableTrigger(gg_trg_Tough_as_Nails)
call TriggerRegisterUnitEvent( gg_trg_Tough_as_Nails, gg_unit_H06O_2083, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Tough_as_Nails, Condition(function Tough_as_Nails_Conditions ) )
call TriggerAddAction( gg_trg_Tough_as_Nails, function Tough_as_Nails_Actions )
endfunction
function Eviscerate_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1J9'
endfunction
function Trig_Eviscerate_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
call SetUnitState(target, UNIT_STATE_LIFE, GetUnitState(target, UNIT_STATE_LIFE) - (100 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
set target = null
endfunction
//===========================================================================
function InitTrig_Eviscerate takes nothing returns nothing
set gg_trg_Eviscerate = CreateTrigger( )
call DisableTrigger(gg_trg_Eviscerate)
call TriggerRegisterUnitEvent( gg_trg_Eviscerate, gg_unit_H06K_0921, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Eviscerate, Condition( function Eviscerate_Conditions ) )
call TriggerAddAction( gg_trg_Eviscerate, function Trig_Eviscerate_Actions )
endfunction
function Trig_Aetherite_Barrier_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0ZX'
endfunction
function AetheriteProtectionRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[11], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[11], GetHandleId(t), 1)
//call DisplayTextToForce( GetPlayersAll(), "Aetherite Barrier" )
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
endfunction
function Trig_Aetherite_Barrier_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0ZX')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[11], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[11], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function AetheriteProtectionRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Aetherite_Barrier takes nothing returns nothing
set gg_trg_Aetherite_Barrier = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Aetherite_Barrier, Player(10), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Aetherite_Barrier, gg_unit_H00R_0029, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Aetherite_Barrier, Condition( function Trig_Aetherite_Barrier_Conditions ) )
call TriggerAddAction( gg_trg_Aetherite_Barrier, function Trig_Aetherite_Barrier_Actions )
endfunction
function Trig_Lightning_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A100'
endfunction
function Trig_Lightning_Strike_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit u
set u = GetSpellTargetUnit()
//call DisplayTextToForce( GetPlayersAll(), "Lightning Strike" )
call PolledWait(0.05)
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
call UnitAddAbility(Dummy, 'A101')
call SetUnitAbilityLevel(Dummy, 'A101', GetUnitAbilityLevel(gg_unit_H00M_0024, 'A100'))
call IssueTargetOrder(Dummy, "soulburn", u)
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
call UnitRemoveAbility(Dummy, 'A101')
set u = null
endfunction
//===========================================================================
function InitTrig_Lightning_Strike takes nothing returns nothing
set gg_trg_Lightning_Strike = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Lightning_Strike, gg_unit_H00M_0024, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lightning_Strike, Condition( function Trig_Lightning_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Strike, function Trig_Lightning_Strike_Actions )
endfunction
globals
integer ThunderingChargeInt
endglobals
function Trig_Thundering_Charge_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A102'
endfunction
function ThunderingChargePeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_H00M_0024, 'A102')
local real radius = 200 + 25 * lvl
local real damage = 5 + 5 * lvl
local real x = GetUnitX(gg_unit_H00M_0024)
local real y = GetUnitY(gg_unit_H00M_0024)
//call DisplayTextToForce( GetPlayersAll(), "Thundering Charge" )
if ( ThunderingChargeInt > 0 and GetWidgetLife(gg_unit_H00M_0024) > 0.405 ) then
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
call StompTrigger(gg_unit_H00M_0024, lvl, 0.2, 0.2, damage, radius, x, y, 24)
set ThunderingChargeInt = ThunderingChargeInt - 1
else
call PauseTimer(t)
call DestroyTimer(t)
call SetUnitTimeScale(gg_unit_H00M_0024, 1)
endif
set t = null
endfunction
function Trig_Thundering_Charge_Actions takes nothing returns nothing
local timer t = CreateTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_H00M_0024, 'A102')
local real radius = 200 + 25 * lvl
local real damage = 5 + 5 * lvl
local real x = GetUnitX(gg_unit_H00M_0024)
local real y = GetUnitY(gg_unit_H00M_0024)
set ThunderingChargeInt = 3 + 1 * lvl
call SetUnitTimeScale(gg_unit_H00M_0024, 1.75)
call DestroyEffect( AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", x, y) )
call StompTrigger(gg_unit_H00M_0024, lvl, 0.2, 0.2, damage, radius, x, y, 24)
call TimerStart(t, 0.4, true, function ThunderingChargePeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Thundering_Charge takes nothing returns nothing
set gg_trg_Thundering_Charge = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Thundering_Charge, gg_unit_H00M_0024, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Thundering_Charge, Condition( function Trig_Thundering_Charge_Conditions ) )
call TriggerAddAction( gg_trg_Thundering_Charge, function Trig_Thundering_Charge_Actions )
endfunction
function Trig_Lightning_Reflexes_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A103'
endfunction
function Trig_Lightning_Reflexes_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A103') == 1 ) then
call UnitAddAbility(u, 'A105' )
else
if ( GetUnitAbilityLevel(u, 'A103') == 2 ) then
call SetUnitAbilityLevel(u, 'A105', 2)
else
call SetUnitAbilityLevel(u, 'A105', 3)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Lightning_Reflexes takes nothing returns nothing
set gg_trg_Lightning_Reflexes = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Lightning_Reflexes, Player(10), EVENT_PLAYER_HERO_SKILL, null )
call TriggerRegisterUnitEvent( gg_trg_Lightning_Reflexes, gg_unit_H00M_0024, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Lightning_Reflexes, Condition( function Trig_Lightning_Reflexes_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Reflexes, function Trig_Lightning_Reflexes_Actions )
endfunction
function Trig_Storms_Wrath_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A104'
endfunction
function Trig_Storms_Wrath_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real radius = 350
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local group g = CreateGroup()
local unit target = null
local integer pNum = GetPlayerId(GetOwningPlayer(caster)) + 1
local integer ctr = 0
local integer lim
//call DisplayTextToForce( GetPlayersAll(), "Storms Wrath" )
call SetUnitAnimationByIndex(caster, 5)
call SetUnitX(PDummy[pNum], x)
call SetUnitY(PDummy[pNum], y)
call UnitAddAbility( PDummy[pNum], 'A00P' )
call UnitAddAbility( PDummy[pNum], 'A0GB' )
call GroupEnumUnitsInRange(g, x, y, radius, null)
call DestroyEffect(AddSpecialEffect("Stormfall.mdx", x, y))
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set target = BlzGroupUnitAt(g, ctr)
if ( IsUnitEnemy(target, GetOwningPlayer(caster)) ) then
if ( GetWidgetLife(target) > 0.405 ) then
if ( IsUnitType(target, UNIT_TYPE_STRUCTURE) == false ) then
if ( IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) == false ) then
call IssueTargetOrder( PDummy[pNum], "entanglingroots", target )
call IssuePointOrder( PDummy[pNum], "silence", x, y )
call UnitRemoveBuffs(target, true, false)
if ( IsUnitType(target, UNIT_TYPE_SUMMONED) == false ) then
call UnitDamageTarget( caster, target, 90, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_LIGHTNING, WEAPON_TYPE_WHOKNOWS )
else
call UnitDamageTarget( caster, target, 500, false, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
endif
endif
endif
endif
endif
set ctr = ctr + 1
endloop
call UnitRemoveAbility( PDummy[pNum], 'A00P' )
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
set target = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Storms_Wrath takes nothing returns nothing
set gg_trg_Storms_Wrath = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Storms_Wrath, gg_unit_H00M_0024, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Storms_Wrath, Condition( function Trig_Storms_Wrath_Conditions ) )
call TriggerAddAction( gg_trg_Storms_Wrath, function Trig_Storms_Wrath_Actions )
endfunction
function Trig_Scattershot_Spell_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1CO'
endfunction
function Scattershot_Spell_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer spellLvl = GetUnitAbilityLevel( GetTriggerUnit(), GetSpellAbilityId())
local real radius = 0
local real damage = 0
//takes unit caster, integer spellID, integer spellLvl, real damage, real radius, real x, real y, integer dmgCap
set radius = 200 + ( I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) * 50 )
set damage = 20 + (40 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())))
call SlamTrigger(GetTriggerUnit(), 'A0JL', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
endfunction
function InitTrig_Scattershot_Spell takes nothing returns nothing
set gg_trg_Scattershot_Spell = CreateTrigger()
call TriggerRegisterUnitEvent( gg_trg_Scattershot_Spell, gg_unit_H05G_0759, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Scattershot_Spell, Condition( function Trig_Scattershot_Spell_Conditions ) )
call TriggerAddAction(gg_trg_Scattershot_Spell, function Scattershot_Spell_Actions)
endfunction
function Trig_Scattershot_On_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1CO'
endfunction
function Trig_Scattershot_On_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1CO') == 1 ) then
call TriggerRegisterUnitEvent(gg_trg_Scattershot, u, EVENT_UNIT_DAMAGED)
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Scattershot_On takes nothing returns nothing
set gg_trg_Scattershot_On = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Scattershot_On, gg_unit_H05G_0759, EVENT_UNIT_HERO_SKILL )
call TriggerRegisterPlayerUnitEvent( gg_trg_Scattershot_On, Player(10), EVENT_PLAYER_HERO_SKILL, null )
call TriggerAddCondition( gg_trg_Scattershot_On, Condition( function Trig_Scattershot_On_Conditions ) )
call TriggerAddAction( gg_trg_Scattershot_On, function Trig_Scattershot_On_Actions )
endfunction
function Trig_Scattershot_Conditions takes nothing returns boolean
return BlzGetUnitAbilityCooldownRemaining(GetTriggerUnit(), 'A1CO') == 0.00
endfunction
function Trig_Scattershot_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local integer lvl = GetUnitAbilityLevel(u, 'A1CO')
local integer pNum = GetPlayerId(GetOwningPlayer(u)) + 1
local integer i
local real radius = 0
local real damage = 0
local string sfx = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
if ( BlzGetEventIsAttack() ) then
set i = GetRandomInt(1, 100)
if ( i <= (lvl * 10) ) then
if not ( IsUnitType(GetEventDamageSource(), UNIT_TYPE_MAGIC_IMMUNE) or IsUnitType(GetEventDamageSource(), UNIT_TYPE_MECHANICAL) ) then
//takes unit caster, integer spellID, integer spellLvl, real damage, real radius, real x, real y, integer dmgCap
set radius = 200
set damage = 50
call SlamTrigger(GetTriggerUnit(), 'A0JL', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
call DestroyEffect( AddSpecialEffect( sfx, x, y ) )
endif
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Scattershot takes nothing returns nothing
set gg_trg_Scattershot = CreateTrigger( )
call TriggerAddCondition( gg_trg_Scattershot, Condition( function Trig_Scattershot_Conditions ) )
call TriggerAddAction( gg_trg_Scattershot, function Trig_Scattershot_Actions )
endfunction
function Fluxs_Frenzy_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1DC'
endfunction
function Fluxs_Frenzy_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit caster = GetTriggerUnit()
local integer i = 7
loop
exitwhen i < 1
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call TriggerSleepAction(0.25)
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" )
call TriggerSleepAction(0.25)
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireMissile.mdl" )
call TriggerSleepAction(0.25)
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl" )
call AddSpecialEffectLocBJ( OffsetLocation(GetSpellTargetLoc(), GetRandomReal(0, 350.00), GetRandomReal(0, 350.00)), "Abilities\\Spells\\Other\\BreathOfFrost\\BreathOfFrostMissile.mdl" )
call TriggerSleepAction(0.25)
set i = i - 1
endloop
set caster = null
endfunction
//===========================================================================
function InitTrig_Fluxs_Frenzy takes nothing returns nothing
set gg_trg_Fluxs_Frenzy = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Fluxs_Frenzy, gg_unit_H00J_0021, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fluxs_Frenzy, Condition(function Fluxs_Frenzy_Conditions ) )
call TriggerAddAction( gg_trg_Fluxs_Frenzy, function Fluxs_Frenzy_Actions )
endfunction
function Trig_Stonemasons_Repair_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A12L') ) then
return false
endif
return true
endfunction
function Trig_Stonemasons_Repair_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 200 + (100 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A12L'))) )
set u = null
endfunction
//===========================================================================
function InitTrig_Stonemasons_Repair takes nothing returns nothing
set gg_trg_Stonemasons_Repair = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Stonemasons_Repair, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stonemasons_Repair, Condition( function Trig_Stonemasons_Repair_Conditions ) )
call TriggerAddAction( gg_trg_Stonemasons_Repair, function Trig_Stonemasons_Repair_Actions )
endfunction
function Trig_Runeblade_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A07F'
endfunction
function Trig_Runeblade_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel( u, 'A07F' ) == 1 ) then
call UnitAddAbility( u, 'A0LM' )
else
call SetUnitAbilityLevel( u, 'A0LM', GetUnitAbilityLevel(u, 'A07F') )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Runeblade takes nothing returns nothing
set gg_trg_Runeblade = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Runeblade, gg_unit_H04E_0591, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Runeblade, Condition( function Trig_Runeblade_Conditions ) )
call TriggerAddAction( gg_trg_Runeblade, function Trig_Runeblade_Actions )
endfunction
function Trig_Shattering_Blast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A14K') ) then
return false
endif
return true
endfunction
function Trig_Shattering_Blast_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call DestroyEffect(AddSpecialEffect("FreezingRing.mdx", x, y))
set u = null
endfunction
//===========================================================================
function InitTrig_Shattering_Blast takes nothing returns nothing
set gg_trg_Shattering_Blast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Shattering_Blast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shattering_Blast, Condition( function Trig_Shattering_Blast_Conditions ) )
call TriggerAddAction( gg_trg_Shattering_Blast, function Trig_Shattering_Blast_Actions )
endfunction
globals
hashtable ThorinTable = InitHashtable()
unit array Hammers[2]
endglobals
function Rolling_Thunder_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A14P'
endfunction
function HammerDamage takes unit caster, group damagedGroup, real x, real y returns nothing
local group g = CreateGroup()
local group g2 = damagedGroup
local unit u
local unit damager = caster
local integer i = 0
local integer lim
call GroupEnumUnitsInRange(g, x, y, 150.00, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen i == lim
set u = BlzGroupUnitAt(g, i)
if ( IsUnitEnemy(u, GetOwningPlayer(damager)) ) then
if ( not ( IsUnitInGroup(u, g2) ) ) then
if ( GetUnitState(u, UNIT_STATE_LIFE) > 0.405 ) then
call UnitDamageTarget(damager, u, 35, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl", u, "origin"))
call GroupAddUnit(g2, u)
endif
endif
endif
set i = i + 1
endloop
call DestroyGroup(g)
set g = null
set g2 = null
set damager = null
endfunction
function Hammer_Periodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer i = GetHandleId(t)
local boolean destReached = LoadBoolean(ThorinTable, i, 4)
local unit hammer = LoadUnitHandle(ThorinTable, i, 0)
local group g = LoadGroupHandle(ThorinTable, i , 5)
local real x = GetUnitX(hammer)
local real y = GetUnitY(hammer)
local real x2
local real y2
local real angle
local real dist
if ( destReached == false) then
set x2 = LoadReal(ThorinTable, i, 2)
set y2 = LoadReal(ThorinTable, i, 3)
else
set x2 = GetUnitX(LoadUnitHandle(ThorinTable, i, 1))
set y2 = GetUnitY(LoadUnitHandle(ThorinTable, i, 1))
endif
set angle = Atan2(y2 - y, x2 - x) * bj_RADTODEG
call SetUnitFacing(hammer, GetUnitFacing(hammer) + 144)
set dist = SquareRoot( (x2 - x) * (x2 - x) + (y2 - y) * (y2 - y) )
if ( dist > 35 ) then
call SetUnitX(hammer, x + 33 * Cos(angle * bj_DEGTORAD))
call SetUnitY(hammer, y + 33 * Sin(angle * bj_DEGTORAD))
call HammerDamage(LoadUnitHandle(ThorinTable, i, 1), g, GetUnitX(hammer), GetUnitY(hammer))
else
if ( destReached == false ) then
call RemoveSavedBoolean(ThorinTable, i, 4)
call SaveBoolean(ThorinTable, i, 4, true)
call SetUnitX(hammer, x2)
call SetUnitY(hammer, y2)
call HammerDamage(LoadUnitHandle(ThorinTable, i, 1), g, x2, y2)
call GroupClear(g)
else
call FlushChildHashtable(ThorinTable, i)
call KillUnit(hammer)
set Hammers[GetPlayerId(GetOwningPlayer(hammer))] = null
call PauseTimer(t)
call DestroyTimer(t)
call DestroyGroup(g)
//call SetPlayerAbilityAvailable(GetOwningPlayer(hammer), 'A0R3' , false)
//call SetPlayerAbilityAvailable(GetOwningPlayer(hammer), 'A0R1' , true)
endif
endif
set t = null
set hammer = null
set g = null
endfunction
function Rolling_Thunder_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real x2 = GetSpellTargetX()
local real y2 = GetSpellTargetY()
local real angle = Atan2(y2 - y, x2 - x) * bj_RADTODEG
local unit u
local real x3 = x + 900 * Cos(angle * bj_DEGTORAD)
local real y3 = y + 900 * Sin(angle * bj_DEGTORAD)
local real x4 = x + 75 * Cos(angle * bj_DEGTORAD)
local real y4 = y + 75 * Sin(angle * bj_DEGTORAD)
local group g = CreateGroup()
local timer t = CreateTimer()
//call PlaySoundOnUnitBJ(gg_snd_StormBoltLaunch, 100, caster)
call TimerStart(t, 0.05, true, function Hammer_Periodic)
//create the hammer model to be thrown
set u = (CreateUnit( GetOwningPlayer(caster), 'h096', x4, y4, angle ) )
set Hammers[GetPlayerId(GetOwningPlayer(caster))] = u
call SaveUnitHandle(ThorinTable, GetHandleId(t), 0, u)
call SaveUnitHandle(ThorinTable, GetHandleId(t), 1, caster)
call SaveReal(ThorinTable, GetHandleId(t), 2, x3)
call SaveReal(ThorinTable, GetHandleId(t), 3, y3)
call SaveBoolean(ThorinTable, GetHandleId(t), 4, false)
call SaveGroupHandle(ThorinTable, GetHandleId(t), 5, g)
call HammerDamage(caster, g, x4, y4)
// hold these, no polled wait is better, and not detonating for this ability
//call PolledWait(0.05)
//call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A0R3' , true)
//call SetPlayerAbilityAvailable(GetOwningPlayer(caster), 'A0R1' , false)
set u = null
set caster = null
set t = null
endfunction
//===========================================================================
function InitTrig_Rolling_Thunder takes nothing returns nothing
set gg_trg_Rolling_Thunder = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent(gg_trg_Rolling_Thunder, Player(11), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Rolling_Thunder, gg_unit_H04J_0594, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Rolling_Thunder, Condition(function Rolling_Thunder_Conditions) )
call TriggerAddAction( gg_trg_Rolling_Thunder, function Rolling_Thunder_Actions )
endfunction
function Trig_Astral_Shield_TEMP_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0UN'
endfunction
function AstralShieldRemoveShieldTemp takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[13], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[13], GetHandleId(t), 1)
//call DisplayTextToForce( GetPlayersAll(), "Astral Shield" )
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
endfunction
function Trig_Astral_Shield_TEMP_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0UN')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[13], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[13], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function AstralShieldRemoveShieldTemp)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Astral_Shield_TEMP takes nothing returns nothing
set gg_trg_Astral_Shield_TEMP = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Astral_Shield_TEMP, Player(12), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Astral_Shield_TEMP, gg_unit_U002_1520, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Astral_Shield_TEMP, Condition( function Trig_Astral_Shield_TEMP_Conditions ) )
call TriggerAddAction( gg_trg_Astral_Shield_TEMP, function Trig_Astral_Shield_TEMP_Actions )
endfunction
globals
effect EclipseOfDesolationEffect
trigger TrigEclipseOfDesolationCancel
group EclipseOfDesolationGroup = null
boolean EclipseOfDesolationActive
real EclipseOfDesolationX
real EclipseOfDesolationY
endglobals
function Trig_Eclipse_of_Desolation_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A165'
endfunction
function EclipseOfDesolationFilter takes nothing returns boolean
local unit u = GetFilterUnit()
if ( IsUnitEnemy(u, GetOwningPlayer(gg_unit_U002_1520)) ) then
if ( GetWidgetLife(u) > 0.405) then
if ( IsUnitType(u, UNIT_TYPE_STRUCTURE) == false ) then
if ( IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) == false ) then
if ( BlzIsUnitInvulnerable(u) == false ) then
if ( IsUnitType(u, UNIT_TYPE_HERO) == false ) then
return true
endif
endif
endif
endif
endif
endif
set u = null
return false
endfunction
function EclipseOfDesolationCancel takes nothing returns nothing
call DestroyEffect(EclipseOfDesolationEffect)
set EclipseOfDesolationActive = false
endfunction
function EclipseOfDesolationPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local group g = CreateGroup()
local unit u
local integer ctr = 0
local integer lim
local integer lvl
if ( EclipseOfDesolationActive ) then
call GroupEnumUnitsInRange(g, EclipseOfDesolationX, EclipseOfDesolationY, 450, Filter(function EclipseOfDesolationFilter))
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set u = BlzGroupUnitAt(g, ctr)
set lvl = GetUnitAbilityLevel(u, 'A0VI') + 1
if ( lvl <= 10 ) then
if ( lvl == 1 ) then
call UnitAddAbility(u, 'A0VI')
else
call IncUnitAbilityLevel(u, 'A0VI')
endif
call SetUnitMoveSpeed(u, GetUnitDefaultMoveSpeed(u) * (0.95 - 0.1 * lvl))
endif
if ( IsUnitInGroup(u, EclipseOfDesolationGroup) == false ) then
call GroupAddUnit(EclipseOfDesolationGroup, u)
endif
set ctr = ctr + 1
endloop
endif
if ( BlzGroupGetSize(EclipseOfDesolationGroup) > 0 ) then
set ctr = 0
set lim = BlzGroupGetSize(EclipseOfDesolationGroup)
loop
exitwhen ctr == lim
set u = BlzGroupUnitAt(EclipseOfDesolationGroup, ctr)
if ( IsUnitInGroup(u, g) == false ) then
set lvl = GetUnitAbilityLevel(u, 'A0VI') - 1
if ( lvl > 1 ) then
call DecUnitAbilityLevel(u, 'A0VI')
call SetUnitMoveSpeed(u, GetUnitDefaultMoveSpeed(u) * (0.95 - 0.1 * lvl))
else
call UnitRemoveAbility(u, 'A0VI')
call SetUnitMoveSpeed(u, GetUnitDefaultMoveSpeed(u))
call GroupRemoveUnit(EclipseOfDesolationGroup, u)
call FlushChildHashtable(AbilityTable[13], GetHandleId(u))
endif
endif
set ctr = ctr + 1
endloop
else
if ( EclipseOfDesolationActive == false ) then
call PauseTimer(t)
call DestroyTimer(t)
call GroupClear(EclipseOfDesolationGroup)
endif
endif
set t = null
call DestroyGroup(g)
set g = null
set u = null
endfunction
function Trig_Eclipse_of_Desolation_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit u
local integer ctr = 0
local integer lim
local timer t = CreateTimer()
set EclipseOfDesolationActive = true
set EclipseOfDesolationX = GetSpellTargetX()
set EclipseOfDesolationY = GetSpellTargetY()
if ( EclipseOfDesolationGroup == null ) then
set EclipseOfDesolationGroup = CreateGroup()
endif
//Triggering movement speed slow because auras only update every ~2seconds, making it very visibly not properly gradual for move speed
//However attack speed is more subtle, and it's also only possible to change base attack speed for units, making their swings still look fast
//Just with longer time inbetween, but either way still looking too fast.
call GroupEnumUnitsInRange(g, EclipseOfDesolationX, EclipseOfDesolationY, 450, Filter(function EclipseOfDesolationFilter))
set lim = BlzGroupGetSize(g)
loop
exitwhen ctr == lim
set u = BlzGroupUnitAt(g, ctr)
call UnitAddAbility(u, 'A0VI')
call SetUnitMoveSpeed(u, GetUnitDefaultMoveSpeed(u) * 0.85)
call GroupAddUnit(EclipseOfDesolationGroup, u)
set ctr = ctr + 1
endloop
call TimerStart(t, 1.25, true, function EclipseOfDesolationPeriodic)
set EclipseOfDesolationEffect = AddSpecialEffect("war3mapImported\\FieldTEAmColoured.mdx", EclipseOfDesolationX, EclipseOfDesolationY)
call BlzSetSpecialEffectScale(EclipseOfDesolationEffect, 0.85)
call BlzSetSpecialEffectColorByPlayer(EclipseOfDesolationEffect, Player(12))
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Eclipse_of_Desolation takes nothing returns nothing
set gg_trg_Eclipse_of_Desolation = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Eclipse_of_Desolation, gg_unit_U002_1520, EVENT_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Eclipse_of_Desolation, Condition( function Trig_Eclipse_of_Desolation_Conditions ) )
call TriggerAddAction( gg_trg_Eclipse_of_Desolation, function Trig_Eclipse_of_Desolation_Actions )
set TrigEclipseOfDesolationCancel = CreateTrigger()
call TriggerAddAction(TrigEclipseOfDesolationCancel, function EclipseOfDesolationCancel)
call TriggerAddCondition( TrigEclipseOfDesolationCancel, Condition( function Trig_Eclipse_of_Desolation_Conditions ) )
call TriggerRegisterUnitEvent(TrigEclipseOfDesolationCancel, gg_unit_U002_1520, EVENT_UNIT_SPELL_ENDCAST)
endfunction
globals
unit DeathsGraspTarget = null
trigger TrigDeathsGraspDrainFinish
endglobals
function Trig_Deaths_Grasp_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0X5'
endfunction
function DeathsGraspPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_U004_0002, 'A0X5')
local real dmg = 5 //50 per second
local integer pNum = GetPlayerId(GetOwningPlayer(gg_unit_U004_0002)) + 1
if ( DeathsGraspTarget != null ) then
call UnitDamageTarget(gg_unit_U004_0002, DeathsGraspTarget, dmg, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEATH, WEAPON_TYPE_WHOKNOWS)
call PDummyTargetOrder(pNum, 'S00B', lvl, "cripple", 0, DeathsGraspTarget, GetUnitX(DeathsGraspTarget), GetUnitY(DeathsGraspTarget))
else
call PauseTimer(t)
call DestroyTimer(t)
endif
set t = null
endfunction
function DeathsGraspDrainFinish takes nothing returns nothing
local effect sfx
if ( GetWidgetLife(DeathsGraspTarget) <= 0.405 ) then
set sfx = AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl", DeathsGraspTarget, "origin")
call BlzSetSpecialEffectScale(sfx, 1.8)
call BlzSetSpecialEffectTimeScale(sfx, 1.25)
call DestroyEffect(sfx)
endif
call DisableTrigger(GetTriggeringTrigger())
set DeathsGraspTarget = null
set sfx = null
endfunction
function Trig_Deaths_Grasp_Actions takes nothing returns nothing
local timer t = CreateTimer()
set DeathsGraspTarget = GetSpellTargetUnit()
call EnableTrigger(TrigDeathsGraspDrainFinish)
call TimerStart(t, 0.1, true, function DeathsGraspPeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Deaths_Grasp takes nothing returns nothing
set gg_trg_Deaths_Grasp = CreateTrigger( )
call DisableTrigger(gg_trg_Deaths_Grasp)
call TriggerRegisterUnitEvent( gg_trg_Deaths_Grasp, gg_unit_U004_0002, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Deaths_Grasp, Condition( function Trig_Deaths_Grasp_Conditions ) )
call TriggerAddAction( gg_trg_Deaths_Grasp, function Trig_Deaths_Grasp_Actions )
set TrigDeathsGraspDrainFinish = CreateTrigger( )
call DisableTrigger(TrigDeathsGraspDrainFinish)
call TriggerRegisterUnitEvent( TrigDeathsGraspDrainFinish, gg_unit_U004_0002, EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddAction(TrigDeathsGraspDrainFinish, function DeathsGraspDrainFinish)
endfunction
globals
integer VoidSmashInt
endglobals
function Trig_Void_Smash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1GA'
endfunction
function VoidSmashPeriodic takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_U006_1981, 'A1GA')
local real radius = 225 + 25 * lvl
local real damage = 25 + 25 * lvl
local real x = GetUnitX(gg_unit_U006_1981)
local real y = GetUnitY(gg_unit_U006_1981)
if ( VoidSmashInt > 0 and GetWidgetLife(gg_unit_U006_1981) > 0.405 ) then
call DestroyEffect( AddSpecialEffect("GravityStormClassic.mdx", x, y) )
call StompTrigger(gg_unit_U006_1981, lvl, 0.2, 0.2, damage, radius, x, y, 24)
set VoidSmashInt = VoidSmashInt - 1
else
call PauseTimer(t)
call DestroyTimer(t)
call SetUnitTimeScale(gg_unit_U006_1981, 1)
endif
set t = null
endfunction
function Trig_Void_Smash_Actions takes nothing returns nothing
local timer t = CreateTimer()
local integer lvl = GetUnitAbilityLevel(gg_unit_U006_1981, 'A1GA')
local real radius = 225 + 25 * lvl
local real damage = 25 + 25 * lvl
local real x = GetUnitX(gg_unit_U006_1981)
local real y = GetUnitY(gg_unit_U006_1981)
set VoidSmashInt = 1
call SetUnitTimeScale(gg_unit_U006_1981, 1.75)
call DestroyEffect( AddSpecialEffect("GravityStormClassic.mdx", x, y) )
call StompTrigger(gg_unit_U006_1981, lvl, 0.2, 0.2, damage, radius, x, y, 24)
call TimerStart(t, 2, true, function VoidSmashPeriodic)
set t = null
endfunction
//===========================================================================
function InitTrig_Void_Smash takes nothing returns nothing
set gg_trg_Void_Smash = CreateTrigger( )
call DisableTrigger(gg_trg_Void_Smash)
call TriggerRegisterUnitEvent( gg_trg_Void_Smash, gg_unit_U006_1981, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Void_Smash, Condition( function Trig_Void_Smash_Conditions ) )
call TriggerAddAction( gg_trg_Void_Smash, function Trig_Void_Smash_Actions )
endfunction
function Trig_The_Beyond_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1GB'
endfunction
function Trig_The_Beyond_Actions takes nothing returns nothing
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local unit u
set u = GetSpellTargetUnit()
call SetUnitX(Dummy, x)
call SetUnitY(Dummy, y)
call SetUnitOwner(Dummy, GetTriggerPlayer(), false)
call UnitAddAbility(Dummy, 'A1GD')
call IssueImmediateOrderBJ(Dummy, "howlofterror")
call SetUnitX(Dummy, DummyX)
call SetUnitY(Dummy, DummyY)
call SetUnitOwner(Dummy, Player(PLAYER_NEUTRAL_PASSIVE), false)
call UnitRemoveAbility(Dummy, 'A1GD')
set u = null
endfunction
//===========================================================================
function InitTrig_The_Beyond takes nothing returns nothing
set gg_trg_The_Beyond = CreateTrigger( )
call DisableTrigger(gg_trg_The_Beyond)
call TriggerRegisterUnitEvent( gg_trg_The_Beyond, gg_unit_U006_1981, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_The_Beyond, Condition( function Trig_The_Beyond_Conditions ) )
call TriggerAddAction( gg_trg_The_Beyond, function Trig_The_Beyond_Actions )
endfunction
globals
boolean AbyssalWrathActive = false
endglobals
function Abyssal_Wrath_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0CO'
endfunction
function Abyssal_Wrath_Actions takes nothing returns nothing
local integer ctr = 0
local integer lvl
set AbyssalWrathActive = true
call SetPlayerAbilityAvailable(GetOwningPlayer(gg_unit_U006_1981), 'A0S3', true)
call SetPlayerAbilityAvailable(GetOwningPlayer(gg_unit_U006_1981), 'A1GA', false)
set lvl = GetUnitAbilityLevel(gg_unit_U006_1981, 'A1GA') - GetUnitAbilityLevel(gg_unit_U006_1981, 'A0S3')
if ( lvl > 0 ) then
call UnitModifySkillPoints(gg_unit_U006_1981, lvl)
loop
exitwhen ctr == lvl
call SelectHeroSkill(gg_unit_U006_1981, 'A0S3')
set ctr = ctr + 1
endloop
endif
call PolledWait(46.10)
set AbyssalWrathActive = false
call SetPlayerAbilityAvailable(GetOwningPlayer(gg_unit_U006_1981), 'A1GA', true)
call SetPlayerAbilityAvailable(GetOwningPlayer(gg_unit_U006_1981), 'A0S3', false)
set lvl = GetUnitAbilityLevel(gg_unit_U006_1981, 'A0S3') - GetUnitAbilityLevel(gg_unit_U006_1981, 'A1GA')
if ( lvl > 0 ) then
set ctr = 0
call UnitModifySkillPoints(gg_unit_U006_1981, lvl)
loop
exitwhen ctr == lvl
call SelectHeroSkill(gg_unit_U006_1981, 'A1GA')
set ctr = ctr + 1
endloop
endif
endfunction
//===========================================================================
function InitTrig_Abyssal_Wrath takes nothing returns nothing
set gg_trg_Abyssal_Wrath = CreateTrigger( )
call DisableTrigger( gg_trg_Abyssal_Wrath )
call TriggerRegisterUnitEvent( gg_trg_Abyssal_Wrath, gg_unit_U006_1981, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Abyssal_Wrath, Condition( function Abyssal_Wrath_Conditions ) )
call TriggerAddAction( gg_trg_Abyssal_Wrath, function Abyssal_Wrath_Actions )
endfunction
function Trig_Void_Projection_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0S3'
endfunction
function Trig_Void_Projection_Actions takes nothing returns nothing
local integer lvl = GetUnitAbilityLevel(gg_unit_U006_1981, 'A0S3')
local real radius = 225 + 25 * lvl
local real damage = 25 + 25 * lvl
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
call PolledWait(3.0)
call DestroyEffect( AddSpecialEffect("GravityStormClassic.mdx", x, y) )
call StompTrigger(gg_unit_U006_1981, lvl, 0.2, 0.2, damage, radius, x, y, 24)
endfunction
//===========================================================================
function InitTrig_Void_Projection takes nothing returns nothing
set gg_trg_Void_Projection = CreateTrigger( )
call DisableTrigger(gg_trg_Void_Projection)
call TriggerRegisterUnitEvent( gg_trg_Void_Projection, gg_unit_U006_1981, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Void_Projection, Condition( function Trig_Void_Projection_Conditions ) )
call TriggerAddAction( gg_trg_Void_Projection, function Trig_Void_Projection_Actions )
endfunction
function Trig_Aura_of_Desolation_Conditions takes nothing returns boolean
return GetLearnedSkill() == 'A1ME'
endfunction
function Trig_Aura_of_Desolation_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if ( GetUnitAbilityLevel(u, 'A1ME') == 1 ) then
call UnitAddAbility(u, 'A1MF' )
call BlzUnitHideAbility(u, 'A1MF', true)
else
if ( GetUnitAbilityLevel(u, 'A1ME') == 2 ) then
call SetUnitAbilityLevel(u, 'A1MF', 2)
else
call SetUnitAbilityLevel(u, 'A1MF', 3)
endif
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Aura_of_Desolation takes nothing returns nothing
set gg_trg_Aura_of_Desolation = CreateTrigger( )
call DisableTrigger(gg_trg_Aura_of_Desolation)
call TriggerRegisterPlayerUnitEvent( gg_trg_Aura_of_Desolation, Player(12), EVENT_PLAYER_HERO_SKILL, null )
call TriggerRegisterUnitEvent( gg_trg_Aura_of_Desolation, gg_unit_U005_1649, EVENT_UNIT_HERO_SKILL )
call TriggerAddCondition( gg_trg_Aura_of_Desolation, Condition( function Trig_Aura_of_Desolation_Conditions ) )
call TriggerAddAction( gg_trg_Aura_of_Desolation, function Trig_Aura_of_Desolation_Actions )
endfunction
function Trig_Sovereigns_Eclipse_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1MG'
endfunction
function Trig_Sovereigns_Eclipse_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbility(u, 'A1MH' )
call BlzUnitHideAbility(u, 'A1MH', true)
call UnitAddAbility(u, 'A1MI' )
call BlzUnitHideAbility(u, 'A1MI', true)
call CinematicFilterGenericBJ( 2, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\HazeFilter_mask.blp", 100, 100.00, 100.00, 75.00, 100.00, 0, 0, 0 )
call EnableTrigger( gg_trg_Sovereigns_Eclipse_Loop )
endfunction
//===========================================================================
function InitTrig_Sovereigns_Eclipse takes nothing returns nothing
set gg_trg_Sovereigns_Eclipse = CreateTrigger( )
call DisableTrigger( gg_trg_Sovereigns_Eclipse )
call TriggerRegisterUnitEvent( gg_trg_Sovereigns_Eclipse, gg_unit_U005_1649, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Sovereigns_Eclipse, Condition( function Trig_Sovereigns_Eclipse_Conditions ) )
call TriggerAddAction( gg_trg_Sovereigns_Eclipse, function Trig_Sovereigns_Eclipse_Actions )
endfunction
function Sovereigns_Eclipse_Loop_Actions takes nothing returns nothing
set sov = sov + 1
if ((GetWidgetLife(gg_unit_U005_1649) < 0.405) or (sov == 45)) then
call DisplayCineFilterBJ( false )
call UnitRemoveAbility(gg_unit_U005_1649, 'A1MH' )
call UnitRemoveAbility(gg_unit_U005_1649, 'A1MI' )
set sov = 0
call DisableTrigger(gg_trg_Sovereigns_Eclipse_Loop)
endif
endfunction
//===========================================================================
function InitTrig_Sovereigns_Eclipse_Loop takes nothing returns nothing
set gg_trg_Sovereigns_Eclipse_Loop = CreateTrigger( )
call DisableTrigger( gg_trg_Sovereigns_Eclipse_Loop )
call TriggerAddAction( gg_trg_Sovereigns_Eclipse_Loop, function Sovereigns_Eclipse_Loop_Actions )
call TriggerRegisterTimerEvent( gg_trg_Sovereigns_Eclipse_Loop, 1.00, true )
endfunction
function Trig_Evil_Ruler_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A070'
endfunction
function EvilRuler_Explosion takes nothing returns nothing
local timer t = GetExpiredTimer()
local real damage = 300
local real x = GetUnitX(EvilRulerTarget)
local real y = GetUnitY(EvilRulerTarget)
if (GetUnitState(EvilRulerTarget, UNIT_STATE_LIFE) > 0.405) then
call UnitDamagePoint(EvilRulerTarget, 0.00, 115 + 10, x, y, damage * 0.35, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
call UnitDamagePoint(EvilRulerTarget, 0.00, 187.5 + 17.5, x, y, damage * 0.40, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
call UnitDamagePoint(EvilRulerTarget, 0.00, 275 + 25, x, y, damage * 0.25, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("war3mapImported\\NeutralBuildingExplosionGreen.mdx", x, y))
endif
call DestroyEffect(EvilRulerEffect)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set EvilRulerTarget = null
endfunction
function Trig_Evil_Ruler_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local location cLoc = GetUnitLoc(caster)
local location tLoc
local timer t = CreateTimer()
local integer pNum = GetPlayerId(GetOwningPlayer(caster)) + 1
local real x
local real y
set EvilRulerTarget = GetSpellTargetUnit()
set tLoc = GetUnitLoc(EvilRulerTarget)
set x = GetUnitX(EvilRulerTarget)
set y = GetUnitY(EvilRulerTarget)
//Swap Morriganth with Unit
call PolledWait(0.05)
call SetUnitPathing( caster, false )
call SetUnitPathing( EvilRulerTarget, false )
call SetUnitPositionLoc(caster, tLoc)
call SetUnitPositionLoc(EvilRulerTarget, cLoc)
call SetUnitPathing( caster, true )
call SetUnitPathing( EvilRulerTarget, true )
//Enlarge the target unit to display his inevitable DOOM
call PDummyTargetOrder(pNum, 'A0P3', 1, "bloodlust", 0, EvilRulerTarget, x, y)
call TimerStart(t, 5.00, false, function EvilRuler_Explosion)
call UnitApplyTimedLife(EvilRulerTarget, 'BTLF', 5.05)
set EvilRulerEffect = AddSpecialEffectTarget("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl", EvilRulerTarget, "chest")
call BlzSetSpecialEffectColor(EvilRulerEffect, 51, 255, 51)
call RemoveLocation(cLoc)
call RemoveLocation(tLoc)
set caster = null
set t = null
endfunction
//===========================================================================
function InitTrig_Evil_Ruler takes nothing returns nothing
set gg_trg_Evil_Ruler = CreateTrigger( )
call DisableTrigger( gg_trg_Evil_Ruler )
call TriggerRegisterUnitEvent( gg_trg_Evil_Ruler, gg_unit_U005_1649, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Evil_Ruler, Condition( function Trig_Evil_Ruler_Conditions ) )
call TriggerAddAction( gg_trg_Evil_Ruler, function Trig_Evil_Ruler_Actions )
endfunction
function Executioners_Verdict_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A1OZ'
endfunction
function Executioners_Verdict_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local real x = GetUnitX(target) - GetUnitX(caster)
local real y = GetUnitY(target) - GetUnitY(caster)
local real distSquared = x * x + y * y
//call DisplayTextToForce( GetPlayersAll(), "Moonstride" )
//call PlaySoundOnUnitBJ( gg_snd_Avatar, 100, caster )
call SetUnitPathing( caster, false )
call GroupAddUnit(Executioner, caster)
call UnitAddAbility( caster, 'A08D')
call UnitAddAbility( caster, 'Arav')
call UnitRemoveAbility( caster, 'Arav' )
call BlzPauseUnitEx(caster, true)
call SaveUnitHandle( ExecutionerTable, GetHandleId(caster), 0, target )
call SaveReal( ExecutionerTable, GetHandleId(caster), 1, distSquared)
call EnableTrigger( gg_trg_Executioners_Verdict_Loop )
call BlzPauseUnitEx(caster, false)
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_Executioners_Verdict takes nothing returns nothing
set gg_trg_Executioners_Verdict = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Executioners_Verdict, gg_unit_H0FW_1851, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEvent( gg_trg_Executioners_Verdict, Player(13), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerAddCondition( gg_trg_Executioners_Verdict, Condition( function Executioners_Verdict_Conditions) )
call TriggerAddAction( gg_trg_Executioners_Verdict, function Executioners_Verdict_Actions )
endfunction
function Executioner_ForGroup takes nothing returns nothing
local unit u = GetEnumUnit()
local unit target = LoadUnitHandle(ExecutionerTable, GetHandleId(u), 0)
local real x = GetUnitX(target) - GetUnitX(u)
local real y = GetUnitY(target) - GetUnitY(u)
local real dist = x * x + y * y
local real descentDist = (LoadReal(ExecutionerTable, GetHandleId(u), 1))
local real angle
local real radius
local real damage
local real dmg = 40 + (.15 * GetMissingHealth(u))
//call DisplayTextToForce( GetPlayersAll(), "Moonstride Loop" )
//75^2
if (dist > 5625) then
set angle = Atan2( y, x ) * bj_RADTODEG
call SetUnitFacing(u, angle)
set x = GetUnitX(u) + 25 * Cos(angle * bj_DEGTORAD)
set y = GetUnitY(u) + 25 * Sin(angle * bj_DEGTORAD)
call SetUnitX(u, x)
call SetUnitY(u, y)
if (dist >= descentDist * 0.35) then
if ( GetUnitFlyHeight(u) <= 400 ) then
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) + 25, 1000000000.00 )
endif
else
call SetUnitFlyHeight( u, GetUnitFlyHeight(u) - 25, 1000000000.00 )
endif
else
call GroupRemoveUnit(Executioner, u)
call SetUnitFlyHeight( u, 0, 1000000000.00 )
call UnitRemoveAbility( u, 'A08D')
call BlzPauseUnitEx(u, false)
call SetUnitPathing( u, true )
call IssueTargetOrder( u, "attack", target )
call FlushChildHashtable( ExecutionerTable, GetHandleId(u) )
set radius = 350
set damage = 40 + (.15 * GetMissingHealth(u))
call UnitDamageTarget(gg_unit_H0FW_1851, u, dmg , true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, null)
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" , GetUnitX(u), GetUnitY(u) ) )
endif
set u = null
set target = null
endfunction
function Executioners_Verdict_Loop_Actions takes nothing returns nothing
//local real dmg = 10.0 // base damage
call ForGroup(Executioner, function Executioner_ForGroup)
if (BlzGroupGetSize(Executioner) == 0) then
call DisableTrigger(GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Executioners_Verdict_Loop takes nothing returns nothing
set gg_trg_Executioners_Verdict_Loop = CreateTrigger( )
call DisableTrigger( gg_trg_Executioners_Verdict_Loop )
call TriggerAddAction( gg_trg_Executioners_Verdict_Loop, function Executioners_Verdict_Loop_Actions )
call TriggerRegisterTimerEvent( gg_trg_Executioners_Verdict_Loop, 0.05, true )
endfunction
function Trig_Feast_Conditions takes nothing returns boolean
return GetTransportUnit() == gg_unit_H0FX_1853
endfunction
function Trig_Feast_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call TriggerRegisterUnitEvent( gg_trg_Feast_Dead, u, EVENT_UNIT_DEATH )
call BlzStartUnitAbilityCooldown( GetTransportUnit(), 'A0LI', 90.00 )
set u = null
endfunction
//===========================================================================
function InitTrig_Feast takes nothing returns nothing
set gg_trg_Feast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Feast, EVENT_PLAYER_UNIT_LOADED )
call TriggerAddCondition( gg_trg_Feast, Condition( function Trig_Feast_Conditions ) )
call TriggerAddAction( gg_trg_Feast, function Trig_Feast_Actions )
endfunction
function Trig_Feast_Dead_Actions takes nothing returns nothing
local unit u = gg_unit_H0FX_1853
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call SetHeroStr(u, GetHeroStr(u, false) + 2, true)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 300)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MANA) + 20)
call DestroyEffect( AddSpecialEffect( "Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl", x, y ) )
set u = null
endfunction
//===========================================================================
function InitTrig_Feast_Dead takes nothing returns nothing
set gg_trg_Feast_Dead = CreateTrigger( )
call TriggerAddAction( gg_trg_Feast_Dead, function Trig_Feast_Dead_Actions )
endfunction
function Trig_Heal_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit dummy
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
//This is regular heal that heals for 300, 450, and 600
if (GetSpellAbilityId() == 'A11I' or GetSpellAbilityId() == 'A1AI' or GetSpellAbilityId() == 'A0B2' or GetSpellAbilityId() == 'A1FQ') then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 150 + (150 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
endif
//This is Arcane Infusion which heals for 300, 450, and 600, but also dispels positive and negative buffs on target
if (GetSpellAbilityId() == 'A172' ) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 150 + (150 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A172'))) )
set dummy = (CreateUnit( GetOwningPlayer(caster), 'h02L', x, y, bj_UNIT_FACING ) )
call UnitApplyTimedLife(dummy, 'BTLF', 1.00)
call UnitAddAbility(dummy, 'A171')
call IssueTargetOrder(dummy,"autodispel", u)
endif
//This is Soul Discharge, Arcane Concoction, Stormcaller's Touch and other heals that are stronger and do 300 600 900 health
if (GetSpellAbilityId() == 'A1GC' or GetSpellAbilityId() == 'A1IA' or GetSpellAbilityId() == 'A1KB' or GetSpellAbilityId() == 'A1N3') then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + (300 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) ))
endif
set u = null
set dummy = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Heal takes nothing returns nothing
set gg_trg_Heal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Heal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Heal, function Trig_Heal_Actions )
endfunction
function Trig_Battle_Injection_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00O') ) then
return false
endif
return true
endfunction
function Trig_Battle_Injection_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + 200 + (100 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A00O'))) )
set u = null
endfunction
//===========================================================================
function InitTrig_Battle_Injection takes nothing returns nothing
set gg_trg_Battle_Injection = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(gg_trg_Battle_Injection, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Battle_Injection, Condition( function Trig_Battle_Injection_Conditions ) )
call TriggerAddAction( gg_trg_Battle_Injection, function Trig_Battle_Injection_Actions )
endfunction
function Trig_Base_Repair_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A03V' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A0J5' ) ) then
return true
endif
return false
endfunction
function Trig_Base_Repair_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
//call DisplayTextToForce( GetPlayersAll(), "Base Repair" )
if (GetUnitState(u, UNIT_STATE_LIFE) < GetUnitState(u, UNIT_STATE_MAX_LIFE) * 0.6) then
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE) + GetUnitState(u, UNIT_STATE_MAX_LIFE) * 0.4)
else
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_MAX_LIFE))
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Base_Repair takes nothing returns nothing
set gg_trg_Base_Repair = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Base_Repair, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Base_Repair, Condition( function Trig_Base_Repair_Conditions ) )
call TriggerAddAction( gg_trg_Base_Repair, function Trig_Base_Repair_Actions )
endfunction
function Trig_Root_Stomp_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0XJ'
endfunction
function Trig_Root_Stomp_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local integer lvl = GetUnitAbilityLevel(caster, 'A0XJ')
local real radius = 275 + ( I2R(lvl) * 55 )
local real damage = 20 + (30 * lvl)
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local group g = CreateGroup()
local unit u = null
local integer pNum = GetPlayerId(GetOwningPlayer(caster)) + 1
local integer index = 0
local integer lim
call UnitAddAbility(PDummy[pNum], 'A0XM')
call SetUnitAbilityLevel(PDummy[pNum], 'A0XM', lvl)
call SetUnitX(PDummy[pNum], x)
call SetUnitY(PDummy[pNum], y)
call GroupEnumUnitsInRange(g, x, y, radius, null)
set lim = BlzGroupGetSize(g)
loop
exitwhen index == lim
set u = BlzGroupUnitAt(g, index)
if ( IsUnitEnemy(u, GetOwningPlayer(caster)) ) then
if ( GetWidgetLife(u) > 0.405 ) then
if not ( IsUnitType(u, UNIT_TYPE_STRUCTURE) or IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) ) then
call UnitDamageTarget(caster, u, damage, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_PLANT, WEAPON_TYPE_WHOKNOWS)
call IssueTargetOrder( PDummy[pNum], "entanglingroots", u )
endif
endif
endif
set index = index + 1
endloop
call UnitRemoveAbility( PDummy[pNum], 'A0XM' )
call SetUnitX(PDummy[pNum], DummyX)
call SetUnitY(PDummy[pNum], DummyY)
set u = null
call DestroyGroup(g)
set g = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Root_Stomp takes nothing returns nothing
set gg_trg_Root_Stomp = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Root_Stomp, gg_unit_H0D0_2339, EVENT_UNIT_SPELL_EFFECT )
call TriggerRegisterUnitEvent( gg_trg_Root_Stomp, gg_unit_H0CZ_2340, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Root_Stomp, Condition( function Trig_Root_Stomp_Conditions ) )
call TriggerAddAction( gg_trg_Root_Stomp, function Trig_Root_Stomp_Actions )
endfunction
function GroundSlam_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer spellLvl = GetUnitAbilityLevel( GetTriggerUnit(), GetSpellAbilityId())
local real radius = 0
local real damage = 0
//takes unit caster, integer spellID, integer spellLvl, real damage, real radius, real x, real y, integer dmgCap
if (GetSpellAbilityId() == 'A06U' or GetSpellAbilityId() == 'A04R' or GetSpellAbilityId() == 'A14K' or GetSpellAbilityId() == 'A15A' or GetSpellAbilityId() == 'A1G5' or GetSpellAbilityId() == 'A1H3' or GetSpellAbilityId() == 'A1HY' or GetSpellAbilityId() == 'A0WF') then
set radius = 200 + ( I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) * 50 )
set damage = 20 + (40 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())))
call SlamTrigger(GetTriggerUnit(), 'A0JL', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
elseif (GetSpellAbilityId() == 'A0O4' or GetSpellAbilityId() == 'A1FX') then
set radius = 250 + ( I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) * 50 )
set damage = 20 + (25 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())))
call SlamTrigger(GetTriggerUnit(), 'A0O5', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
elseif (GetSpellAbilityId() == 'A1G0' ) then
set radius = 275 + ( I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())) * 50 )
set damage = 30 + (50 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId())))
call SlamTrigger(GetTriggerUnit(), 'A0O5', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
endif
endfunction
function InitTrig_Ground_Slams takes nothing returns nothing
set gg_trg_Ground_Slams = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Ground_Slams, EVENT_PLAYER_UNIT_SPELL_EFFECT )
//call TriggerAddCondition( gg_trg_Ground_Slams, Condition( function Trig_Ground_Slams_Conditions ) )
call TriggerAddAction(gg_trg_Ground_Slams, function GroundSlam_Actions)
endfunction
function Slam_Actions takes nothing returns nothing
local real x = GetUnitX(GetTriggerUnit())
local real y = GetUnitY(GetTriggerUnit())
local integer spellLvl = GetUnitAbilityLevel( GetTriggerUnit(), GetSpellAbilityId())
local real radius = 0
local real damage = 0
if (GetSpellAbilityId() == 'A02U' or GetSpellAbilityId() == 'A035') then
//takes unit caster, integer spellID, integer spellLvl, real damage, real radius, real x, real y, integer dmgCap
set radius = 225
set damage = 30
call SlamTrigger(GetTriggerUnit(), 'A0JL', GetUnitAbilityLevel(GetTriggerUnit(), GetSpellAbilityId()), damage, radius, x, y, 20)
endif
endfunction
function InitTrig_Slam takes nothing returns nothing
set gg_trg_Slam = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Slam, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction(gg_trg_Slam, function Slam_Actions)
endfunction
function WarStompRegular_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
if ( not ( GetSpellAbilityId() == 'A04J') ) then
if ( not ( GetSpellAbilityId() == 'A0S2') ) then
if ( not ( GetSpellAbilityId() == 'A03M' ) ) then
if ( not ( GetSpellAbilityId() == 'A138' ) ) then
if ( not ( GetSpellAbilityId() == 'A14C' ) ) then
if ( not ( GetSpellAbilityId() == 'A1FI' ) ) then
if ( not ( GetSpellAbilityId() == 'A1FJ' ) ) then
if ( not ( GetSpellAbilityId() == 'A1H7' ) ) then
if ( not ( GetSpellAbilityId() == 'A1K8' ) ) then
if ( not ( GetSpellAbilityId() == 'A1OR' ) ) then
if ( not ( GetSpellAbilityId() == 'A1QW' ) ) then
return false
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
return true
endfunction
function WarStompRegular_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local real x = GetUnitX(caster)
local real y = GetUnitY(caster)
local real radius
local real damage
local integer dmgCap = 20
local integer abilityLvl = GetUnitAbilityLevel( caster, GetSpellAbilityId())
local real heroDuration = 0.5 + 0.5 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId()))
local real unitDuration = 1 + 0.5 * I2R(GetUnitAbilityLevel(caster, GetSpellAbilityId()))
local group g = CreateGroup()
//call DisplayTextToForce( GetPlayersAll(), "War Stomps" )
if (abilityLvl >= 3 ) then
set heroDuration = heroDuration - 0.25
set unitDuration = unitDuration - 0.25
endif
//Infernal Slam, Furance Burst, Galeforce Smash, Skull Bash
if (GetSpellAbilityId() == 'A03M' or GetSpellAbilityId() == 'A1H7' or GetSpellAbilityId() == 'A1K8' or GetSpellAbilityId() == 'A1OR' ) then
set radius = 250 + ( I2R(abilityLvl) * 50 )
set damage = 50 * I2R(abilityLvl)
set heroDuration = 0.75 + 0.5 * I2R(abilityLvl)
set unitDuration = 1.25 + 0.5 * I2R(abilityLvl)
call StompTrigger(caster, abilityLvl, heroDuration, unitDuration, damage, radius, x, y, 24)
//Crimson Harvest ability Harvest of Sorrow
else
if (GetSpellAbilityId() == 'A1FI' or GetSpellAbilityId() == 'A1FJ' ) then
set radius = 325
set damage = 200
set heroDuration = 1.75
set unitDuration = 1.75
call StompTrigger(caster, abilityLvl, heroDuration, unitDuration, damage, radius, x, y, 20)
//Golemnar Colossus Wrath
else
if (GetSpellAbilityId() == 'A1QW' ) then
set radius = 350
set damage = 175
set heroDuration = 1.5
set unitDuration = 1.5
call StompTrigger(caster, abilityLvl, heroDuration, unitDuration, damage, radius, x, y, 20)
call CreateNUnitsAtLocFacingLocBJ( 1, 'h0HN', Player(PLAYER_NEUTRAL_PASSIVE), OffsetLocation(GetUnitLoc(GetTriggerUnit()), -350.00, 0.00), GetUnitLoc(GetTriggerUnit()) )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLocFacingLocBJ( 1, 'h0HN', Player(PLAYER_NEUTRAL_PASSIVE), OffsetLocation(GetUnitLoc(GetTriggerUnit()), 0.00, -350.00), GetUnitLoc(GetTriggerUnit()) )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLocFacingLocBJ( 1, 'h0HN', Player(PLAYER_NEUTRAL_PASSIVE), OffsetLocation(GetUnitLoc(GetTriggerUnit()), 0.00, 350.00), GetUnitLoc(GetTriggerUnit()) )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLocFacingLocBJ( 1, 'h0HN', Player(PLAYER_NEUTRAL_PASSIVE), OffsetLocation(GetUnitLoc(GetTriggerUnit()), 350.00, 0.00), GetUnitLoc(GetTriggerUnit()) )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
//Generic Stomps
else
set radius = 200 + ( I2R(abilityLvl) * 50 )
set damage = 30 * I2R(abilityLvl)
set heroDuration = 0.5 + 0.5 * I2R(abilityLvl)
set unitDuration = 1 + 0.5 * I2R(abilityLvl)
call StompTrigger(caster, abilityLvl, heroDuration, unitDuration, damage, radius, x, y, 20)
endif
endif
endif
set caster = null
call DestroyGroup(g)
endfunction
function InitTrig_War_Stomps takes nothing returns nothing
set gg_trg_War_Stomps = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_War_Stomps, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_War_Stomps, Condition(function WarStompRegular_Conditions))
call TriggerAddAction(gg_trg_War_Stomps, function WarStompRegular_Actions)
endfunction
function Nullify_Mana_Drain_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
function Nullify_Mana_Drain_Actions takes nothing returns nothing
local string sfx = "Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl"
local unit caster = GetTriggerUnit()
local real radius = 150 + 150.00 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A001'))
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local group g = CreateGroup()
local unit target = null
call GroupEnumUnitsInRange(g, x, y, radius, null)
loop
set target = FirstOfGroup(g)
exitwhen target == null
call GroupRemoveUnit(g, target)
if ( IsUnitEnemy(target, GetOwningPlayer(caster)) and BlzGetUnitMaxMana(target) > 0 ) then
if ( not ( IsUnitType(target, UNIT_TYPE_STRUCTURE) ) ) then
call SetUnitState( target, UNIT_STATE_MANA, GetUnitState(target, UNIT_STATE_MANA) - 50)
call DestroyEffect( AddSpecialEffect(sfx, x, y) )
endif
endif
endloop
set target = null
call DestroyGroup(g)
set g = null
set caster = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Nullify_Mana_Drain takes nothing returns nothing
set gg_trg_Nullify_Mana_Drain = CreateTrigger( )
//call TriggerRegisterPlayerUnitEvent(gg_trg_Nullify_Mana_Drain, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
call TriggerRegisterUnitEvent(gg_trg_Nullify_Mana_Drain, gg_unit_H05U_0788, EVENT_UNIT_SPELL_EFFECT)
//call TriggerRegisterUnitEvent(gg_trg_Nullify_Mana_Drain, gg_unit_Hkal_0844, EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition( gg_trg_Nullify_Mana_Drain, Condition( function Nullify_Mana_Drain_Conditions ) )
call TriggerAddAction( gg_trg_Nullify_Mana_Drain, function Nullify_Mana_Drain_Actions )
endfunction
function Trig_Astral_Shield_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0UN'
endfunction
function AstralShieldRemoveShield takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = LoadUnitHandle(AbilityTable[10], GetHandleId(t), 0)
local effect sfx = LoadEffectHandle(AbilityTable[10], GetHandleId(t), 1)
//call DisplayTextToForce( GetPlayersAll(), "Astral Shield" )
call SetUnitInvulnerable(u, false)
call DestroyEffect(sfx)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set sfx = null
endfunction
function Trig_Astral_Shield_Actions takes nothing returns nothing
local integer duration = -1 + 3 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0UN')
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
local effect sfx = AddSpecialEffectTarget("Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl", u, "origin")
if ( GetTriggerUnit() == u ) then
call PolledWait(0.05)
endif
call SetUnitInvulnerable(u, true)
call SaveUnitHandle(AbilityTable[10], GetHandleId(t), 0, u)
call SaveEffectHandle(AbilityTable[10], GetHandleId(t), 1, sfx)
call TimerStart(t, duration, false, function AstralShieldRemoveShield)
set t = null
set u = null
set sfx = null
endfunction
//===========================================================================
function InitTrig_Astral_Shield takes nothing returns nothing
set gg_trg_Astral_Shield = CreateTrigger( )
call TriggerRegisterPlayerUnitEvent( gg_trg_Astral_Shield, Player(9), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
call TriggerRegisterUnitEvent( gg_trg_Astral_Shield, gg_unit_H06M_0952, EVENT_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Astral_Shield, Condition( function Trig_Astral_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Astral_Shield, function Trig_Astral_Shield_Actions )
endfunction
function CreateHealer takes group rallyGroup, player p, integer unitId, real x, real y, real face returns nothing
local unit u
set u = CreateUnit(p, unitId, x, y, face)
call TriggerRegisterUnitEvent(gg_trg_Healer_Cleanse, u, EVENT_UNIT_SPELL_EFFECT)
call GroupAddUnit(HealerGroup[GetPlayerId(p)], u)
if ( rallyGroup != null ) then
call GroupAddUnit(rallyGroup, u)
endif
set u = null
endfunction
function Trig_Healer_Cleanse_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A0Z5' )
endfunction
function Trig_Healer_Cleanse_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local integer pNum = GetPlayerId(GetOwningPlayer(u))
local real cd = BlzGetAbilityRealLevelField( BlzGetUnitAbility(u, 'A0Z5'), ABILITY_RLF_COOLDOWN, 0)
local integer index = 0
local integer lim = BlzGroupGetSize(HealerGroup[pNum])
if ( IsUnitAlly(target, GetOwningPlayer(u)) ) then
call UnitRemoveBuffs(target, false, true)
endif
loop
exitwhen index == lim
call BlzStartUnitAbilityCooldown(BlzGroupUnitAt(HealerGroup[pNum], index), 'A0Z5', cd)
set index = index + 1
endloop
set u = null
set target = null
endfunction
//===========================================================================
function InitTrig_Healer_Cleanse takes nothing returns nothing
set gg_trg_Healer_Cleanse = CreateTrigger( )
call TriggerAddCondition( gg_trg_Healer_Cleanse, Condition( function Trig_Healer_Cleanse_Conditions ) )
call TriggerAddAction( gg_trg_Healer_Cleanse, function Trig_Healer_Cleanse_Actions )
endfunction
function GetActualHealerCount takes integer playerNumber returns integer
local integer index = 0
local integer lim
local unit u
local integer count = 0
//Gets group unit count without ghosts
set lim = BlzGroupGetSize(HealerGroup[playerNumber])
loop
exitwhen index == lim
set u = BlzGroupUnitAt(HealerGroup[playerNumber], index)
if ( u != null ) then
set count = count + 1
endif
set index = index + 1
endloop
set u = null
return count
endfunction
function Trig_Select_Spawns_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local integer pNum = GetPlayerId(GetTriggerPlayer())
call SelectSpawns(pNum, p, true)
set p = null
endfunction
//===========================================================================
function InitTrig_Select_Spawns takes nothing returns nothing
set gg_trg_Select_Spawns = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(0), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(1), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(2), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(3), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(4), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(5), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(6), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(7), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(8), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(9), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(10), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(11), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(12), "-spawns", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Select_Spawns, Player(13), "-spawns", true )
call TriggerAddAction( gg_trg_Select_Spawns, function Trig_Select_Spawns_Actions )
endfunction
globals
group array Spawns
trigger array SpawnTrigger
integer CouncilSpawnCount = 0
integer OldOnesSpawnCount = 0
endglobals
function SpawnInitCallback takes nothing returns nothing
local integer i = GetPlayerId(GetOwningPlayer(GetEnumUnit()))
if (GetUnitAbilityLevel(GetEnumUnit(), 'A03B') == 0 ) then
call GroupRemoveUnit(Spawns[i], GetEnumUnit())
endif
endfunction
function Trig_Spawns_Init_Actions takes nothing returns nothing
local integer i = 0
local unit u
local integer pNum
set SpawnTrigger[0] = gg_trg_Drakoria_Spawn
set SpawnTrigger[1] = gg_trg_Erebos_Spawn
set SpawnTrigger[2] = gg_trg_Silverfall_Spawn
set SpawnTrigger[3] = gg_trg_Kethara_Spawn
set SpawnTrigger[4] = gg_trg_Urgraz_Spawn
set SpawnTrigger[5] = gg_trg_Sandlands_Spawn
set SpawnTrigger[6] = gg_trg_Ilium_Spawn
set SpawnTrigger[7] = gg_trg_Kingdom_of_Mu_Spawn
set SpawnTrigger[8] = gg_trg_Auroriya_Spawn
set SpawnTrigger[9] = gg_trg_Avandor_Spawn
set SpawnTrigger[10] = gg_trg_Gromokol_Spawn
set SpawnTrigger[11] = gg_trg_Dwarf_Spawn
set SpawnTrigger[12] = gg_trg_Xanthea_Spawn
set SpawnTrigger[13] = gg_trg_Skaldrin_Spawn
loop
exitwhen i == 14
set Spawns[i] = CreateGroup()
call GroupEnumUnitsOfPlayer(Spawns[i], Player(i), null)
call ForGroup(Spawns[i], function SpawnInitCallback)
if (IsPlayerInForce(Player(i), udg_CouncilPlayers)) then
set CouncilSpawnCount = CouncilSpawnCount + BlzGroupGetSize(Spawns[i])
else
set OldOnesSpawnCount = OldOnesSpawnCount + BlzGroupGetSize(Spawns[i])
endif
set i = i + 1
call PolledWait(0.05)
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_Spawns_Init takes nothing returns nothing
set gg_trg_Spawns_Init = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Spawns_Init, 2.00, false )
call TriggerAddAction( gg_trg_Spawns_Init, function Trig_Spawns_Init_Actions )
endfunction
function Trig_Spawn_Timer_Init_Actions takes nothing returns nothing
local timerdialog td = CreateTimerDialog(udg_SpawnTimer)
call TimerStart( udg_SpawnTimer,udg_SpawnTime, true, null )
call TimerDialogSetTitle(td, "Reinforcements")
call TimerDialogDisplay(td, true)
set td = null
endfunction
//===========================================================================
function InitTrig_Spawn_Timer_Init takes nothing returns nothing
set gg_trg_Spawn_Timer_Init = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_Spawn_Timer_Init, 0.10, false )
call TriggerAddAction( gg_trg_Spawn_Timer_Init, function Trig_Spawn_Timer_Init_Actions )
endfunction
function Trig_Spawn_Improvement_Actions takes nothing returns nothing
local integer ctr = 0
//call DisplayTextToForce( GetPlayersAll(), "Spawn Improvement" )
if (udg_SpawnSize < 6 ) then
call PolledWait( 20.00 )
set udg_SpawnSize = udg_SpawnSize + 1
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cff8080ffAs the great Aetherite War unfurls, both armies have grown stronger and better equipped. Unit Level for each player's respective armies has increased to " + ( I2S(udg_SpawnSize) + "/6 and income has increased by 10!|r" ) )
loop
exitwhen ctr == 14
call SetPlayerTechResearched( Player(ctr), ArmyLevel[udg_SpawnSize], 1 )
call SetPlayerTechResearched( Player(ctr), 'R000', udg_SpawnSize )
call SetPlayerTechResearched( Player(ctr), 'R001', udg_SpawnSize )
call SetPlayerTechResearched( Player(ctr), 'R003', udg_SpawnSize )
set ctr = ctr + 1
endloop
else
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_Spawn_Improvement takes nothing returns nothing
set gg_trg_Spawn_Improvement = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_Spawn_Improvement, "udg_SpawnReal", EQUAL, 0 )
call TriggerAddAction( gg_trg_Spawn_Improvement, function Trig_Spawn_Improvement_Actions )
endfunction
function Trig_Spawn_Time_Increase_Actions takes nothing returns nothing
//call DisplayTextToForce( GetPlayersAll(), "Spawn Time Increase" )
set udg_SpawnTime = udg_SpawnTime + 10.00
call DisplayTextToPlayer( GetLocalPlayer(), 0, 0, "|cff8080ffWar Exhaustion has increased! Each spawn cycle will last 10 additional seconds." )
call PauseTimer( udg_SpawnTimer )
call TimerStart( udg_SpawnTimer, udg_SpawnTime, true, null)
call TriggerSleepAction( 5.00 )
set udg_SpawnReal = 5.00
endfunction
//===========================================================================
function InitTrig_Spawn_Time_Increase takes nothing returns nothing
set gg_trg_Spawn_Time_Increase = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_Spawn_Time_Increase, "udg_SpawnReal", EQUAL, 0 )
call TriggerAddAction( gg_trg_Spawn_Time_Increase, function Trig_Spawn_Time_Increase_Actions )
endfunction
function Trig_Spawns_and_Income_Actions takes nothing returns nothing
local integer ctr = 0
//call DisplayTextToForce( GetPlayersAll(), "Spawns and Income" )
set udg_SpawnReal = ( udg_SpawnReal - 1 )
loop
exitwhen ctr == 14
call SetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_GOLD) + 100 + (10 * udg_SpawnSize))
call SetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(Player(ctr), PLAYER_STATE_RESOURCE_LUMBER) + 100 + (10 * udg_SpawnSize))
call TriggerExecute(SpawnTrigger[ctr])
set ctr = ctr + 1
call TriggerSleepAction( 0.10 )
endloop
endfunction
//===========================================================================
function InitTrig_Spawns_and_Income takes nothing returns nothing
set gg_trg_Spawns_and_Income = CreateTrigger( )
call TriggerRegisterTimerExpireEvent( gg_trg_Spawns_and_Income, udg_SpawnTimer )
call TriggerAddAction( gg_trg_Spawns_and_Income, function Trig_Spawns_and_Income_Actions )
endfunction
function Trig_Drakoria_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local player p = Player(0)
local unit u
// Draconis Citadel
if ( GetUnitState(gg_unit_h07Y_1144, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Draconis_Citadel)
set y = GetRectCenterY(gg_rct_Draconis_Citadel)
set l = GetUnitRallyPoint(gg_unit_h07Y_1144)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(1) ) then
//2 starshard channeler, 1 flamesword guardian, 1 azureflame occultist, 2 wyrmfang marksman
call GroupAddUnits(p, 'h07J', 2, g, x, y)
call GroupAddUnit(g, CreateUnit( p, 'o003', x, y, bj_UNIT_FACING ))
call GroupAddUnit(g, CreateUnit( p, 'h07D', x, y, bj_UNIT_FACING ))
call GroupAddUnits(p, 'h0BG', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R01W', true) == 1 ) then
//2 Reaperscale Harbingers
call GroupAddUnits(p, 'h0BH', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01X', true) == 1 ) then
//1 Thornheart Vanguard
call GroupAddUnit(g, CreateUnit( p, 'h0BI', x, y, bj_UNIT_FACING ))
endif
//You can only issue the first 12 units in a group a command with "GroupPointOrderLoc()", so.
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Dragomir Peak
if ( GetUnitState(gg_unit_h07U_1143, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Dragomir_Peak)
set y = GetRectCenterY(gg_rct_Dragomir_Peak)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h07U_1143)
//3 crystalforge defender, 2 glaivescale spearthrower
call GroupAddUnits(p, 'h07K', 3, g, x, y)
call GroupAddUnits(p, 'h07C', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R01T', true) == 1 ) then
//1 Sapphire Spellwing
call GroupAddUnit(g, CreateUnit( p, 'h07G', x, y, bj_UNIT_FACING ))
endif
if ( GetPlayerTechCount(p, 'R01U', true) == 1 ) then
//1 Infernowing Adept
call GroupAddUnit(g, CreateUnit( p, 'h082', x, y, bj_UNIT_FACING ))
endif
if ( GetPlayerTechCount(p, 'R01V', true) == 1 ) then
//1 Pyroclast Sorceror
call GroupAddUnit(g, CreateUnit( p, 'h081', x, y, bj_UNIT_FACING ))
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Wyrmheart Crag
if ( GetUnitState(gg_unit_h07V_1145, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Wyrmheart_Crag)
set y = GetRectCenterY(gg_rct_Wyrmheart_Crag)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h07V_1145)
//2 crystalscale skirmisher, 1 glaivescale spearthrower
call GroupAddUnits(p, 'h07B', 3, g, x, y)
call GroupAddUnit(g, CreateUnit( p, 'h07C', x, y, bj_UNIT_FACING ))
if ( GetPlayerTechCount(p, 'R01S', true) == 1 ) then
//2 Umbraclaw Enforcer
call GroupAddUnits(p, 'h0BE', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01Y', true) == 1 ) then
//2 Emberback Wyrms
call GroupAddUnits(p, 'h070', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Galecliff Roost
if ( GetUnitState(gg_unit_h07X_1146, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Galecliff_Roost)
set y = GetRectCenterY(gg_rct_Galecliff_Roost)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h07X_1146)
//2 crystalscale skirmisher, 1 Emerald Bladewyrm
call GroupAddUnits(p, 'h07B', 3, g, x, y)
call GroupAddUnit(g, CreateUnit( p, 'h0BF', x, y, bj_UNIT_FACING ))
if ( GetPlayerTechCount(p, 'R01Z', true) == 1 ) then
//2 Viridblade Warriors
call GroupAddUnits(p, 'h0BJ', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Frostfang Vale
if ( GetUnitState(gg_unit_h07W_1147, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Frostfang_Vale)
set y = GetRectCenterY(gg_rct_Frostfang_Vale)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h07W_1147)
//1 crystalscale skirmisher, 1 spiked claw crusher, 1 Azure Lanceguard
call GroupAddUnit(g, CreateUnit( p, 'h07B', x, y, bj_UNIT_FACING ))
call GroupAddUnit(g, CreateUnit( p, 'h07F', x, y, bj_UNIT_FACING ))
call GroupAddUnit(g, CreateUnit( p, 'h083', x, y, bj_UNIT_FACING ))
if ( GetPlayerTechCount(p, 'R01P', true) == 1 ) then
//2 Azure Lanceguard
call GroupAddUnits(p, 'h083', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Emberhold Bastion
if ( GetUnitState(gg_unit_h0AZ_1194, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Emberhold_Bastion)
set y = GetRectCenterY(gg_rct_Emberhold_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AZ_1194)
//3 Crystalforge Defender
call GroupAddUnits(p, 'h07K', 3, g, x, y)
if ( GetPlayerTechCount(p, 'R01R', true) == 1 ) then
//2 Crystalforge Defender
call GroupAddUnits(p, 'h07K', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Dragon's Perch
if ( GetUnitState(gg_unit_h0AT_0612, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Dragons_Perch)
set y = GetRectCenterY(gg_rct_Dragons_Perch)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AT_0612)
//2 crystalscale skirmisher
call GroupAddUnits(p, 'h07B', 3, g, x, y)
if ( GetPlayerTechCount(p, 'R01O', true) == 1 ) then
//2 Wyrmfang Marksman
call GroupAddUnits(p, 'h0BG', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Wyrmwood Outpost
if ( GetUnitState(gg_unit_h0AU_1789, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(1) ) then
set x = GetRectCenterX(gg_rct_Wyrmwood_Outpost)
set y = GetRectCenterY(gg_rct_Wyrmwood_Outpost)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AU_1789)
//2 crystalscale skirmisher, 1 spiked claw crusher
call GroupAddUnits(p, 'h07B', 2, g, x, y)
call GroupAddUnit(g, CreateUnit( p, 'h0BG', x, y, bj_UNIT_FACING ))
if ( GetPlayerTechCount(p, 'R01Q', true) == 1 ) then
//2 Emerald Bladewyrm
call GroupAddUnits(p, 'h0BF', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Drakoria_Spawn takes nothing returns nothing
set gg_trg_Drakoria_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Drakoria_Spawn, function Trig_Drakoria_Spawn_Actions )
endfunction
function Trig_Erebos_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(1)
// KHALDERIA - CAPITAL
if ( GetUnitState(gg_unit_h03N_0210, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Khalderia)
set y = GetRectCenterY(gg_rct_Khalderia)
set l = GetUnitRallyPoint(gg_unit_h03N_0210)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(2) ) then
//2 Mist wardens, 2 Shadow Guardians, 1 Heavy Hammerer, 1 Mistshard Archer, 1 Stormcaller Javelin
call GroupAddUnits(p, 'h029', 2, g, x, y)
call GroupAddUnits(p, 'h027', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h02B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02A', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R02S', true) == 1 ) then
//2 Nexus Arcanists
call GroupAddUnits(p, 'h04Z', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02T', true) == 1 ) then
//2 Mistborn Dragoon
call GroupAddUnits(p, 'h0CC', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02U', true) == 1 ) then
//1 Whitecrest Reaver
call GroupAddUnit(g, CreateUnit(p, 'h0CE', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// SKYPORT
if ( GetUnitState(gg_unit_h030_0206, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Skyport)
set y = GetRectCenterY(gg_rct_Skyport)
set l = GetUnitRallyPoint(gg_unit_h030_0206)
set g = CreateGroup()
//1 Mist Warden, 1 Shadow Guardian, 1 Heavy Hammerer, 1 Mistshard Archer
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h027', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R011', true) == 1 ) then
//2 Aetheric Sharpshooters
call GroupAddUnits(p, 'h054', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02Q', true) == 1 ) then
//2 Skyblade Aeronaut
call GroupAddUnits(p, 'h00E', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02R', true) == 1 ) then
//1 Aetherzep Bombadier
call GroupAddUnit(g, CreateUnit(p, 'h00F', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Shadowgate Fortress
if ( GetUnitState(gg_unit_h0AP_1111, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Shadowgate_Fortress)
set y = GetRectCenterY(gg_rct_Shadowgate_Fortress)
set l = GetUnitRallyPoint(gg_unit_h0AP_1111)
set g = CreateGroup()
//1 Mist Warden, 1 Shadow Guardian, 1 Heavy Hammerer, 1 Mistshard Archer
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h027', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// SILVERMIST
if ( GetUnitState(gg_unit_h03K_0208, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Silvermist)
set y = GetRectCenterY(gg_rct_Silvermist)
set l = GetUnitRallyPoint(gg_unit_h03K_0208)
set g = CreateGroup()
//1 Mistweaver Enchanter
call GroupAddUnit(g, CreateUnit(p, 'h051', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R02O', true) == 1 ) then
//2 Mistweaver Enchanters
call GroupAddUnits(p, 'h051', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02P', true) == 1 ) then
//2 Tidecleaver Vanguards
call GroupAddUnits(p, 'h0CD', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// MISTGROVE
if ( GetUnitState(gg_unit_h01Z_0104, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Mistgrove)
set y = GetRectCenterY(gg_rct_Mistgrove)
set l = GetUnitRallyPoint(gg_unit_h01Z_0104)
set g = CreateGroup()
//1 Mist Warden, 1 Shadow Guardian, 1 Mistshard Archer, 1 Stormcaller Javelin
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h027', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02A', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00U', true) == 1 ) then
//2 Elixirweavers
call GroupAddUnits(p, 'h04X', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00T', true) == 1 ) then
//3 Mistgrove Volunteers
call GroupAddUnits(p, 'h050', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// COPPERFORT
if ( GetUnitState(gg_unit_h03L_0176, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Copperfort)
set y = GetRectCenterY(gg_rct_Copperfort)
set l = GetUnitRallyPoint(gg_unit_h03L_0176)
set g = CreateGroup()
//1 Mist Warden, 1 Mistshard Archer
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00V', true) == 1 ) then
//1 Deathwatcher
call GroupAddUnit(g, CreateUnit(p, 'h053', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// MISTHAVEN
if ( GetUnitState(gg_unit_h03J_0207, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Misthaven)
set y = GetRectCenterY(gg_rct_Misthaven)
set l = GetUnitRallyPoint(gg_unit_h03J_0207)
set g = CreateGroup()
//1 Mist Warden, 1 Shadow Guardian, 1 Mistshard Archer
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h027', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02D', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00W', true) == 1 ) then
//2 Mistwatcher
call GroupAddUnits(p, 'h052', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00X', true) == 1 ) then
//1 Mistborne Flailrider
call GroupAddUnit(g, CreateUnit(p, 'h00B', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// FOGWATCH
if ( GetUnitState(gg_unit_h03M_0209, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Fogwatch)
set y = GetRectCenterY(gg_rct_Fogwatch)
set l = GetUnitRallyPoint(gg_unit_h03M_0209)
set g = CreateGroup()
//1 Mist Warden, 1 Shadowstrider, 1 Storm Lancer
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02C', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h028', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00Y', true) == 1 ) then
//2 Silentstalker
call GroupAddUnits(p, 'h04Y', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00Z', true) == 1 ) then
//2 Vanguard
call GroupAddUnits(p, 'h025', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// CLOUDWATCH
if ( GetUnitState(gg_unit_h032_0205, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Cloudwatch)
set y = GetRectCenterY(gg_rct_Cloudwatch)
set l = GetUnitRallyPoint(gg_unit_h032_0205)
set g = CreateGroup()
//1 Mist Warden, 1 Shadowstrider, 1 Knight of the Mist
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02C', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h026', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R010', true) == 1 ) then
//2 Knights of the Mist
call GroupAddUnits(p, 'h026', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R011', true) == 1 ) then
//2 Mistfire Arcabucer
call GroupAddUnits(p, 'h054', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// STORMWATCH
if ( GetUnitState(gg_unit_h03O_0177, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(2) ) then
set x = GetRectCenterX(gg_rct_Stormwatch)
set y = GetRectCenterY(gg_rct_Stormwatch)
set l = GetUnitRallyPoint(gg_unit_h03O_0177)
set g = CreateGroup()
//1 Mist Warden, 1 Shadowstrider
call GroupAddUnit(g, CreateUnit(p, 'h029', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02C', x, y, bj_UNIT_FACING) )
//2 Stormguard Phalanx
if ( GetPlayerTechCount(p, 'R02N', true) == 1 ) then
call GroupAddUnits(p, 'h009', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Erebos_Spawn takes nothing returns nothing
set gg_trg_Erebos_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Erebos_Spawn, function Trig_Erebos_Spawn_Actions )
endfunction
function Trig_Silverfall_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(2)
// Eldarion's Reach
if ( GetUnitState(gg_unit_h01U_0720, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Eldarions_Reach)
set y = GetRectCenterY(gg_rct_Eldarions_Reach)
set l = GetUnitRallyPoint(gg_unit_h01U_0720)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(3) ) then
// 2 Verdant Protector, 1 Starshield Guardian, 1 Starshard Javelin, 2 Moonstrider Stalkers, 1 Astral Dreamweaver
call GroupAddUnits(p, 'h05Q', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h05R', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05L', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'h05J', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h05K', x, y, bj_UNIT_FACING) )
//2 Duskshield Guardians
if ( GetPlayerTechCount(p, 'R022', true) == 1 ) then
call GroupAddUnits(p, 'h0BN', 2, g, x, y)
endif
//2 Eclipse Striders
if ( GetPlayerTechCount(p, 'R023', true) == 1 ) then
call GroupAddUnits(p, 'h0BO', 2, g, x, y)
endif
//1 Moonshroud Warlock
if ( GetPlayerTechCount(p, 'R024', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0BP', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Silversky Citadel
if ( GetUnitState(gg_unit_h05D_0725, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Silversky_Citadel)
set y = GetRectCenterY(gg_rct_Silversky_Citadel)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h05D_0725)
//1 Moonblade Duelist, 1 Starshard Javelin, 2 Verdant Protector, 1 Astral Dreamweaver
call GroupAddUnit(g, CreateUnit(p, 'h05I', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05L', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'h05Q', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h05K', x, y, bj_UNIT_FACING) )
//2 Lynxbane Archers
if ( GetPlayerTechCount(p, 'R025', true) == 1 ) then
call GroupAddUnits(p, 'h0BQ', 2, g, x, y)
endif
//2 Celestrial Champions
if ( GetPlayerTechCount(p, 'R026', true) == 1 ) then
call GroupAddUnits(p, 'h0BS', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Elvenwatch Ridge
if ( GetUnitState(gg_unit_h0AX_1800, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Elvenwatch_Ridge)
set y = GetRectCenterY(gg_rct_Elvenwatch_Ridge)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AX_1800)
//1 Moonblade Duelist, 2 Starlance Wardens
call GroupAddUnit(g, CreateUnit(p, 'h05I', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'h05H', 2, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sylvan Bastion
if ( GetUnitState(gg_unit_h0AY_1239, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Sylvan_Bastion)
set y = GetRectCenterY(gg_rct_Sylvan_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AY_1239)
//1 Twilight Archer, 1 Verdant Protector
call GroupAddUnit(g, CreateUnit(p, 'h05O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05Q', x, y, bj_UNIT_FACING) )
//2 Twilight Vanguard
if ( GetPlayerTechCount(p, 'R028', true) == 1 ) then
call GroupAddUnits(p, 'h05M', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Crystalvale
if ( GetUnitState(gg_unit_h01V_0721, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Crystalvale)
set y = GetRectCenterY(gg_rct_Crystalvale)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h01V_0721)
//2 Verdant Protector
call GroupAddUnits(p, 'h05Q', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R021', true) == 1 ) then
//Stellarwood Collosus
call GroupAddUnit(g, CreateUnit(p, 'h0BM', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Moonwhisper Glade
if ( GetUnitState(gg_unit_h05A_0722, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Moonwhisper_Glade)
set y = GetRectCenterY(gg_rct_Moonwhisper_Glade)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h05A_0722)
//2 Verdant Protector, 1 Moonstrider Stalker
call GroupAddUnits(p, 'h05Q', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h05J', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R020', true) == 1 ) then
//Moonbark Sentinel
call GroupAddUnit(g, CreateUnit(p, 'h0BL', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sunsong Village
if ( GetUnitState(gg_unit_h05B_0723, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Sunsong_Village)
set y = GetRectCenterY(gg_rct_Sunsong_Village)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h05B_0723)
//1 Verdant Protector, 1 Twilight Archer, 1 Starshield Guardian
call GroupAddUnit(g, CreateUnit(p, 'h05Q', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05R', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Starfall Grove
if ( GetUnitState(gg_unit_h05C_0724, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Starfall_Grove)
set y = GetRectCenterY(gg_rct_Starfall_Grove)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h05C_0724)
//1 Verdant Protector, 1 Twilight Archer, 1 Lunarwing Rider
call GroupAddUnit(g, CreateUnit(p, 'h05Q', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h05P', x, y, bj_UNIT_FACING) )
//2 Grovefall Warden
if ( GetPlayerTechCount(p, 'R027', true) == 1 ) then
call GroupAddUnits(p, 'h0BR', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Verdant Hollow
if ( GetUnitState(gg_unit_h05E_0726, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(3) ) then
set x = GetRectCenterX(gg_rct_Verdant_Hollow)
set y = GetRectCenterY(gg_rct_Verdant_Hollow)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h05E_0726)
//2 Verdant Protector
call GroupAddUnits(p, 'h05Q', 2, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Silverfall_Spawn takes nothing returns nothing
set gg_trg_Silverfall_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Silverfall_Spawn, function Trig_Silverfall_Spawn_Actions )
endfunction
function Trig_Kethara_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(3)
// Seaspray Harbor
if ( GetUnitState(gg_unit_h08K_1376, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Seaspray_Harbor)
set y = GetRectCenterY(gg_rct_Seaspray_Harbor)
set l = GetUnitRallyPoint(gg_unit_h08K_1376)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(4) ) then
//2 Stormguard Cadet, 2 Ketharan Chargers, 2 Gale Knights
call GroupAddUnits(p, 'h08J', 2, g, x, y)
call GroupAddUnits(p, 'h0DJ', 2, g, x, y)
call GroupAddUnits(p, 'h08G', 2, g, x, y)
if ( udg_SpawnReal == 2.00 or udg_SpawnReal == 5.00 ) then
//1 Great Cannon every 3rd
call GroupAddUnit(g, CreateUnit(p, 'h0CM', x, y, bj_UNIT_FACING) )
endif
//2 Dawnforged Paladin
if ( GetPlayerTechCount(p, 'R03H', true) == 1 ) then
call GroupAddUnits(p, 'h0DW', 2, g, x, y)
endif
//2 Eaglehelm Battlemaster
if ( GetPlayerTechCount(p, 'R03O', true) == 1 ) then
call GroupAddUnits(p, 'h0DT', 2, g, x, y)
endif
//1 Sunforged Colossus
if ( GetPlayerTechCount(p, 'R03Q', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0E2', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// High Tide
if ( GetUnitState(gg_unit_h084_1282, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_High_Tide)
set y = GetRectCenterY(gg_rct_High_Tide)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h084_1282)
//2 Stormguard Cadet, 2 Wavechaser Marksman, 1 Stormplate Sentry
call GroupAddUnits(p, 'h08J', 2, g, x, y)
call GroupAddUnits(p, 'h08C', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h08E', x, y, bj_UNIT_FACING) )
//2 Ketharan Charger
if ( GetPlayerTechCount(p, 'R03J', true) == 1 ) then
call GroupAddUnits(p, 'h0DJ', 2, g, x, y)
endif
//2 Axeguard Sentinel
if ( GetPlayerTechCount(p, 'R03M', true) == 1 ) then
call GroupAddUnits(p, 'h0DI', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Seaguard Hold
if ( GetUnitState(gg_unit_h08L_1377, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Seaguard_Hold)
set y = GetRectCenterY(gg_rct_Seaguard_Hold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h08L_1377)
//2 Seafoam Skirmisher, 2 Wavechaser Marksman, 1 Tempest Striker
call GroupAddUnits(p, 'h08I', 2, g, x, y)
call GroupAddUnits(p, 'h08C', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h08D', x, y, bj_UNIT_FACING) )
//2 Ketharan Arbalest
if ( GetPlayerTechCount(p, 'R03G', true) == 1 ) then
call GroupAddUnits(p, 'h0DQ', 2, g, x, y)
endif
//2 Feathercrest Elite
if ( GetPlayerTechCount(p, 'R03N', true) == 1 ) then
call GroupAddUnits(p, 'h0DU', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Dawnview
if ( GetUnitState(gg_unit_h08M_1378, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Dawnview)
set y = GetRectCenterY(gg_rct_Dawnview)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h08M_1378)
//2 Ketharan Town Guard, 2 Axeguard Sentinel, 1 Sun Monk
call GroupAddUnits(p, 'h0DS', 2, g, x, y)
call GroupAddUnits(p, 'h0DI', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0D4', x, y, bj_UNIT_FACING) )
//2 Sunforged Spellblades
if ( GetPlayerTechCount(p, 'R03F', true) == 1 ) then
call GroupAddUnits(p, 'h0DM', 2, g, x, y)
endif
//2 Sunwing Lancers
if ( GetPlayerTechCount(p, 'R03I', true) == 1 ) then
call GroupAddUnits(p, 'h0DR', 2, g, x, y)
endif
//2 Sun Monks
if ( GetPlayerTechCount(p, 'R03P', true) == 1 ) then
call GroupAddUnits(p, 'h0D4', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Galepoint
if ( GetUnitState(gg_unit_h08N_1379, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Galepoint)
set y = GetRectCenterY(gg_rct_Galepoint)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h08N_1379)
//2 Ketharan Town Guard
call GroupAddUnits(p, 'h0DS', 2, g, x, y)
if ( udg_SpawnReal == 0.00 or udg_SpawnReal == 3.00 ) then
//Dawnbringer Paladin
call GroupAddUnit(g, CreateUnit(p, 'h08A', x, y, bj_UNIT_FACING) )
endif
if ( udg_SpawnReal == 1.00 or udg_SpawnReal == 4.00 ) then
//Dawnbringer Templar
call GroupAddUnit(g, CreateUnit(p, 'h08B', x, y, bj_UNIT_FACING) )
endif
//2 Ketharan Defender
if ( GetPlayerTechCount(p, 'R03L', true) == 1 ) then
call GroupAddUnits(p, 'h0DV', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Oceans End
if ( GetUnitState(gg_unit_h08O_1380, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Oceans_End)
set y = GetRectCenterY(gg_rct_Oceans_End)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h08O_1380)
//2 Ketharan Town Guard
call GroupAddUnits(p, 'h0DS', 2, g, x, y)
//2 Golden Order Guardians
if ( GetPlayerTechCount(p, 'R03E', true) == 1 ) then
call GroupAddUnits(p, 'h0DK', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Dawn's Bastion
if ( GetUnitState(gg_unit_h0E1_1413, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Dawns_Bastion)
set y = GetRectCenterY(gg_rct_Dawns_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0E1_1413)
//2 Stormguard Cadet, 2 Seafoam Skirmisher
call GroupAddUnits(p, 'h08J', 2, g, x, y)
call GroupAddUnits(p, 'h08I', 2, g, x, y)
//3 Ketharan Shieldwarden
if ( GetPlayerTechCount(p, 'R03D', true) == 1 ) then
call GroupAddUnits(p, 'h0DL', 3, g, x, y)
endif
//3 Ketharan Town Guard
if ( GetPlayerTechCount(p, 'R03K', true) == 1 ) then
call GroupAddUnits(p, 'h0DS', 3, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Blackwater
if ( GetUnitState(gg_unit_h0EA_1573, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0EA_1573 ) == p ) then
if ( FoodLimitCheck(4) ) then
set x = GetRectCenterX(gg_rct_Blackwater)
set y = GetRectCenterY(gg_rct_Blackwater)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0EA_1573)
//2 Blackfyre Muskateer, 2 Corsair Duelist
call GroupAddUnits(p, 'h0GT', 2, g, x, y)
call GroupAddUnits(p, 'h0GV', 2, g, x, y)
//3 Blackfyre Muskateer
if ( GetPlayerTechCount(p, 'R04U', true) == 1 ) then
call GroupAddUnits(p, 'h0GT', 3, g, x, y)
endif
//2 Corsair Duelist
if ( GetPlayerTechCount(p, 'R04W', true) == 1 ) then
call GroupAddUnits(p, 'h0GV', 2, g, x, y)
endif
//2 Sea Behemoth
if ( GetPlayerTechCount(p, 'R04V', true) == 1 ) then
call GroupAddUnits(p, 'h0GU', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Kethara_Spawn takes nothing returns nothing
set gg_trg_Kethara_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Kethara_Spawn, function Trig_Kethara_Spawn_Actions )
endfunction
function Trig_Urgraz_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(4)
// Bloodgulch
if ( GetUnitState(gg_unit_h058_0667, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Bloodgulch)
set y = GetRectCenterY(gg_rct_Bloodgulch)
set l = GetUnitRallyPoint(gg_unit_h058_0667)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(5) ) then
//2 bloodgulch boar rider, 2 ironhide warlord, 1 direfang sharpshooter, 2 bloodgulch brawler
call GroupAddUnits(p, 'o00F', 2, g, x, y)
call GroupAddUnits(p, 'o00E', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'o00D', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'o00B', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R032', true) == 1 ) then
//3 Ironhide Enforcers
call GroupAddUnits(p, 'o019', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R033', true) == 1 ) then
//2 Totemcrushers
call GroupAddUnits(p, 'o01C', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Bonecrusher Hold
if ( GetUnitState(gg_unit_h057_0666, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Bonecrusher_Hold)
set y = GetRectCenterY(gg_rct_Bonecrusher_Hold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h057_0666)
//2 bonecrusher brute, 1 bonecrusher witch doctor, 1 bloodgulch brawler
call GroupAddUnits(p, 'o006', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'o00K', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'o00B', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R030', true) == 1 ) then
//2 Machete Mutilators
call GroupAddUnits(p, 'o00I', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R031', true) == 1 ) then
//2 Wolfmask Warlords
call GroupAddUnits(p, 'o00J', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sparkshatter Cove
if ( GetUnitState(gg_unit_h04S_0663, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Sparkshatter_Cove)
set y = GetRectCenterY(gg_rct_Sparkshatter_Cove)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h04S_0663)
//1 bloodgulch brawler, 1 ironhide warlord, 1 bloodmoon javelin
call GroupAddUnit(g, CreateUnit(p, 'o00B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'o00E', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'o00H', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R02X', true) == 1 ) then
//3 Sprocketstabber Sentries
call GroupAddUnits(p, 'o00M', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R02Z', true) == 1 ) then
//1 Rocketride Rumbler
call GroupAddUnit(g, CreateUnit(p, 'o01B', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R02Y', true) == 1 ) then
//1 DOOMtank TM
call GroupAddUnit(g, CreateUnit(p, 'o00O', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Bloodmoon Hill
if ( GetUnitState(gg_unit_h056_0665, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Bloodmoon_Hill)
set y = GetRectCenterY(gg_rct_Bloodmoon_Hill)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h056_0665)
//2 bloodmoon javelin, 1 orakhar wolf rider, 2 bloodgulch brawler
call GroupAddUnits(p, 'o00H', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'o00G', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'o00B', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R034', true) == 1 ) then
//2 Wolf-Rider Brutes
call GroupAddUnits(p, 'o01D', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R035', true) == 1 ) then
//2 Warplate Maurader
call GroupAddUnits(p, 'o018', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Orakhars Stand
if ( GetUnitState(gg_unit_h04R_0199, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Orakhars_Stand)
set y = GetRectCenterY(gg_rct_Orakhars_Stand)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h04R_0199)
//2 Bloodgulch Brawler, 2 Direfang Sharpshooter, 2 Orakhar Wolf Rider, 2 Bonecrusher Witch Doctor
call GroupAddUnits(p, 'o00B', 2, g, x, y)
call GroupAddUnits(p, 'o00D', 2, g, x, y)
call GroupAddUnits(p, 'o00G', 2, g, x, y)
call GroupAddUnits(p, 'o00K', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R02W', true) == 1 ) then
//2 Ironspike Vanguard
call GroupAddUnits(p, 'o01A', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Valley of Honor
if ( GetUnitState(gg_unit_h0AM_0494, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Valley_of_Honor)
set y = GetRectCenterY(gg_rct_Valley_of_Honor)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AM_0494)
//1 Bloodgulch Brawler, 1 Direfang Sharpshooter, 1 Orakhar Wolf Rider
call GroupAddUnit(g, CreateUnit(p, 'o00B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'o00D', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'o00G', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R02V', true) == 1 ) then
//3 Spinebreakers
call GroupAddUnits(p, 'o01E', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Urzukar Depths
if ( GetUnitState(gg_unit_h094_1464, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h094_1464 ) == p ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Urzukar_Depths)
set y = GetRectCenterY(gg_rct_Urzukar_Depths)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h094_1464)
//2 bloodmoon javelin, 2 bloodgulch brawler
call GroupAddUnits(p, 'o00H', 2, g, x, y)
call GroupAddUnits(p, 'o00B', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R036', true) == 1 ) then
//3 Quilboar Axethrashers
call GroupAddUnits(p, 'h0CA', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R037', true) == 1 ) then
//2 Tauren Runebearers
call GroupAddUnits(p, 'h0CB', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Thunderfist Bastion
if ( GetUnitState(gg_unit_h0CL_1469, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0CL_1469 ) == p ) then
if ( FoodLimitCheck(5) ) then
set x = GetRectCenterX(gg_rct_Thunderfist_Bastion)
set y = GetRectCenterY(gg_rct_Thunderfist_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CL_1469)
//2 Thunderfist Brutes, 2 Thunderfist Shaman, 1 Thunderfist Warlord
call GroupAddUnits(p, 'n00C', 2, g, x, y)
call GroupAddUnits(p, 'n00D', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'n00B', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Urgraz_Spawn takes nothing returns nothing
set gg_trg_Urgraz_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Urgraz_Spawn, function Trig_Urgraz_Spawn_Actions )
endfunction
function Trig_Sandlands_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(5)
// Sundara
if ( GetUnitState(gg_unit_h0GP_2155, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Sundara)
set y = GetRectCenterY(gg_rct_Sundara)
set l = GetUnitRallyPoint(gg_unit_h0GP_2155)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(6) ) then
//3 Sandstalker Lancer, 2 Sandstalker Archer, 1 Desert Reaver, 1 Dunesworn Champion
call GroupAddUnits(p, 'h0EI', 3, g, x, y)
call GroupAddUnits(p, 'h0EH', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0EX', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0F2', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05C', true) == 1 ) then
//2 Skyguard Enforcers
call GroupAddUnits(p, 'h0H2', 2, g, x, y)
endif
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call GroupClear(g)
call RemoveLocation(l)
endif
// Zephyrs Rest
if ( GetUnitState(gg_unit_h0GN_2153, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(6) ) then
set x = GetRectCenterX(gg_rct_Zephyrs_Rest)
set y = GetRectCenterY(gg_rct_Zephyrs_Rest)
set l = GetUnitRallyPoint(gg_unit_h0GN_2153)
//2 Sandstalker Lancer, 1 Scorchblade Guardian, 1 Ironsand Vanguard
call GroupAddUnits(p, 'h0EI', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0EY', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0ER', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05D', true) == 1 ) then
//2 Dunesight Archers
call GroupAddUnits(p, 'h0F1', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Sandhold
if ( GetUnitState(gg_unit_h0GM_2141, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(6) ) then
set x = GetRectCenterX(gg_rct_Sandhold)
set y = GetRectCenterY(gg_rct_Sandhold)
set l = GetUnitRallyPoint(gg_unit_h0GM_2141)
//2 Sunforged Halberdier, 1 Dunesworn Champion, 1 Scorchblade Guardian
call GroupAddUnits(p, 'h0F0', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0F2', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0EY', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05F', true) == 1 ) then
//2 Desertstalker
call GroupAddUnits(p, 'h0H8', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Forgefire
if ( GetUnitState(gg_unit_h0GL_2129, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(6) ) then
set x = GetRectCenterX(gg_rct_Forgefire)
set y = GetRectCenterY(gg_rct_Forgefire)
set l = GetUnitRallyPoint(gg_unit_h0GL_2129)
//2 Sandstalker Lancer, 2 Desert Marauder, 1 Sandstorm Behemoth
call GroupAddUnits(p, 'h0EI', 2, g, x, y)
call GroupAddUnits(p, 'h0EQ', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0EU', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05G', true) == 1 ) then
//2 Mechaspiders
call GroupAddUnits(p, 'h0H7', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Duneswatch
if ( GetUnitState(gg_unit_h0GO_2154, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(6) ) then
set x = GetRectCenterX(gg_rct_Duneswatch)
set y = GetRectCenterY(gg_rct_Duneswatch)
set l = GetUnitRallyPoint(gg_unit_h0GO_2154)
//1 Sandstalker Lancer, 1 Sandstalker Archer
call GroupAddUnit(g, CreateUnit(p, 'h0EI', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0EH', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05E', true) == 1 ) then
//3 Dunepick Marauders
call GroupAddUnits(p, 'h0EM', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Bonesaw Pass
if ( GetUnitState(gg_unit_h0GW_2291, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(6) ) then
set x = GetRectCenterX(gg_rct_Bonesaw_Pass)
set y = GetRectCenterY(gg_rct_Bonesaw_Pass)
set l = GetUnitRallyPoint(gg_unit_h0GW_2291)
//1 Sandstalker Lancer, 1 Sandstalker Archer
call GroupAddUnit(g, CreateUnit(p, 'h0EI', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0EH', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R05H', true) == 1 ) then
//3 Sandspike Warrior
call GroupAddUnits(p, 'h0EN', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
call DestroyGroup(g)
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Sandlands_Spawn takes nothing returns nothing
set gg_trg_Sandlands_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Sandlands_Spawn, function Trig_Sandlands_Spawn_Actions )
endfunction
function Trig_Ilium_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(6)
// Ilium
if ( GetUnitState(gg_unit_h03V_0293, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Ilium)
set y = GetRectCenterY(gg_rct_Ilium)
set l = GetUnitRallyPoint(gg_unit_h03V_0293)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(7) ) then
if ( GetPlayerTechCount(p, 'R015', true) == 1 ) then
//2 Cinderforge Cannoneer
call GroupAddUnits(p, 'h018', 2, g, x, y)
endif
//2 Blackpike Sentinel, 2 Coalbreaker Footmen, 1 Frostpike Archer, 1 Harbormaster Guardian, 1 Emberheart Alchemist
call GroupAddUnits(p, 'h019', 2, g, x, y)
call GroupAddUnits(p, 'h019', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h01B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'n003', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h014', x, y, bj_UNIT_FACING) )
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Frosthold Bastion
if ( GetUnitState(gg_unit_h0AG_0372, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Frosthold_Bastion)
set y = GetRectCenterY(gg_rct_Frosthold_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AG_0372)
//2 coalbreaker footmen, 1 frostpike archer
call GroupAddUnits(p, 'h01A', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h01B', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Seawall
if ( GetUnitState(gg_unit_h03S_0092, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Seawall)
set y = GetRectCenterY(gg_rct_Seawall)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03S_0092)
if ( GetPlayerTechCount(p, 'R014', true) == 1 ) then
//1 Cinderforge Paladin
call GroupAddUnit(g, CreateUnit(p, 'h017', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R018', true) == 1 ) then
//1 Shadowmaul Templar
call GroupAddUnit(g, CreateUnit(p, 'h01D', x, y, bj_UNIT_FACING) )
endif
//1 Frostpike Archer, 1 Glacial Charger
call GroupAddUnit(g, CreateUnit(p, 'h01B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h01F', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Eastport
if ( GetUnitState(gg_unit_h03T_0090, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Eastport)
set y = GetRectCenterY(gg_rct_Eastport)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03T_0090)
//2 coalbreaker footmen, 1 blackguard enforcer, 1 glacial charger, 1 emberheart alchemist
call GroupAddUnits(p, 'h01A', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h01F', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h014', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Winterhold
if ( GetUnitState(gg_unit_h03R_0094, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Winterhold)
set y = GetRectCenterY(gg_rct_Winterhold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03R_0094)
//2 coalbreaker footmen, 1 Blackpike Sentinel
call GroupAddUnits(p, 'h01A', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h019', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03A', true) == 1 ) then
//1 Spirit Elder
call GroupAddUnit(g, CreateUnit(p, 'h0CX', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Steelharbor
if ( GetUnitState(gg_unit_h03U_0099, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Steelharbor)
set y = GetRectCenterY(gg_rct_Steelharbor)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03U_0099)
if ( GetPlayerTechCount(p, 'R017', true) == 1 ) then
//1 Emberwraith
call GroupAddUnit(g, CreateUnit(p, 'h01E', x, y, bj_UNIT_FACING) )
endif
//1 glacial charger, 1 blackpike sentinel, 1 frostpike archer
call GroupAddUnit(g, CreateUnit(p, 'h01F', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h019', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h01B', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Frostwall
if ( GetUnitState(gg_unit_h03W_0093, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Frostwall)
set y = GetRectCenterY(gg_rct_Frostwall)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03W_0093)
if ( GetPlayerTechCount(p, 'R019', true) == 1 ) then
//2 Frostguard
call GroupAddUnits(p, 'h015', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01A', true) == 1 ) then
//2 Frostguard Magus
call GroupAddUnits(p, 'h01G', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R016', true) == 1 ) then
//1 Frostguard Sentinel
call GroupAddUnit(g, CreateUnit(p, 'n002', x, y, bj_UNIT_FACING) )
endif
//2 blackguard enforcer
call GroupAddUnits(p, 'h016', 2, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sunhaven
if ( GetUnitState(gg_unit_h03X_0100, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Sunhaven)
set y = GetRectCenterY(gg_rct_Sunhaven)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h03X_0100)
//2 coalbreaker footmen
call GroupAddUnits(p, 'h01A', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R038', true) == 1 ) then
//2 Venomtail Wyvern
call GroupAddUnits(p, 'h0CZ', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R039', true) == 1 ) then
//2 Gazekeeper Basilisk
call GroupAddUnits(p, 'h0CU', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Coalharbor Watch
if ( GetUnitState(gg_unit_h0CK_2034, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0CK_2034 ) == p ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Coalharbor_Watch)
set y = GetRectCenterY(gg_rct_Coalharbor_Watch)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CK_2034)
//2 coalbreaker footmen
call GroupAddUnits(p, 'h01A', 2, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Havenford
if ( GetUnitState(gg_unit_h0CN_1474, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(7) ) then
set x = GetRectCenterX(gg_rct_Havenford)
set y = GetRectCenterY(gg_rct_Havenford)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CN_1474)
//3 coalbreaker footmen
call GroupAddUnits(p, 'h01A', 3, g, x, y)
if ( GetPlayerTechCount(p, 'R03B', true) == 1 ) then
//1 Siegebringer Behemoth
call GroupAddUnit(g, CreateUnit(p, 'h0CN', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R03C', true) == 1 ) then
//2 Warcrusher Titans
call GroupAddUnits(p, 'h0CV', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Ilium_Spawn takes nothing returns nothing
set gg_trg_Ilium_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Ilium_Spawn, function Trig_Ilium_Spawn_Actions )
endfunction
function Trig_Kingdom_of_Mu_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(7)
// Mandala
if ( GetUnitState(gg_unit_h097_1514, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Mandala)
set y = GetRectCenterY(gg_rct_Mandala)
set l = GetUnitRallyPoint(gg_unit_h097_1514)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(8) ) then
//1 Kurotaka Naginata, 1 Kurotaka Tanegashima, 1 Kurotaka Yumi
call GroupAddUnit(g, CreateUnit(p, 'h09A', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h09D', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h09C', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R049', true) == 1 ) then
//2 Harmony Monks
call GroupAddUnits(p, 'h0D5', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04A', true) == 1 ) then
//2 Sky Serpent
call GroupAddUnits(p, 'h0D9', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Yanarheim
if ( GetUnitState(gg_unit_h0E7_1939, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Yanarheim)
set y = GetRectCenterY(gg_rct_Yanarheim)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0E7_1939)
//2 Mystic Seer, 1 Akatori Naginata
call GroupAddUnits(p, 'h0DF', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03Y', true) == 1 ) then
//2 Mystic Seer
call GroupAddUnits(p, 'h0DF', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R03X', true) == 1 ) then
//1 Thunder Reaver
call GroupAddUnit(g, CreateUnit(p, 'h0DC', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Zenkai
if ( GetUnitState(gg_unit_h09R_1518, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Zenkai)
set y = GetRectCenterY(gg_rct_Zenkai)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h09R_1518)
//1 Akatori Naginata, 2 Ashen Blade
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'h0D7', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R042', true) == 1 ) then
//2 Crimson Shadows
call GroupAddUnits(p, 'h09E', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R043', true) == 1 ) then
//2 Ashen Blade
call GroupAddUnits(p, 'h0D7', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R044', true) == 1 ) then
//2 Obsidian Phantoms
call GroupAddUnits(p, 'h09K', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Jalakendra
if ( GetUnitState(gg_unit_h09T_1516, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Jalakendra)
set y = GetRectCenterY(gg_rct_Jalakendra)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h09T_1516)
//1 Akatori Naginata, 1 Zephyr Wisp
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0DZ', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03U', true) == 1 ) then
//1 Zephyr Wisp
call GroupAddUnit(g, CreateUnit(p, 'h0DZ', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R045', true) == 1 ) then
//2 Sakura Blade Dancer
call GroupAddUnits(p, 'h0D6', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Agnivara
if ( GetUnitState(gg_unit_h09S_1546, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Agnivara)
set y = GetRectCenterY(gg_rct_Agnivara)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h09S_1546)
//1 Akatori Naginata, 1 Pyre Reaver
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0E4', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03T', true) == 1 ) then
//2 Pyre Reavers
call GroupAddUnits(p, 'h0E4', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Himura
if ( GetUnitState(gg_unit_h09Q_1512, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Himura)
set y = GetRectCenterY(gg_rct_Himura)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h09Q_1512)
//1 Akatori Naginata, 1 Terra Guardian
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0E0', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03R', true) == 1 ) then
//2 Terra Guardians
call GroupAddUnits(p, 'h0E0', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Shirogane
if ( GetUnitState(gg_unit_h09U_1515, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Shirogane)
set y = GetRectCenterY(gg_rct_Shirogane)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h09U_1515)
//2 Akatori Naginata, 1 Azure Elemental
call GroupAddUnits(p, 'h099', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0E3', x, y, bj_UNIT_FACING) )
//2 Akatori Tanegashima, 1 Akatori Naginata
call GroupAddUnits(p, 'h098', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h099', x, y, bj_UNIT_FACING) )
//2 Bajutsu every 3rd spawn
if ( udg_SpawnReal == 3.00 or udg_SpawnReal == 6.00 ) then
//2 Bajutsu
call GroupAddUnits(p, 'h09F', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R046', true) == 1 ) then
//3 Jade Pike Guard
call GroupAddUnits(p, 'h0D8', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R048', true) == 1 ) then
//1 Dragon's Breath
call GroupAddUnit(g, CreateUnit(p, 'h09N', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R047', true) == 1 ) then
//1 Hwacha
call GroupAddUnit(g, CreateUnit(p, 'h09W', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R03S', true) == 1 ) then
//2 Azure Sentinels
call GroupAddUnits(p, 'h0E3', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Ironclaw Bastion
if ( GetUnitState(gg_unit_h0E8_2140, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Ironclaw_Bastion)
set y = GetRectCenterY(gg_rct_Ironclaw_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0E8_2140)
//2 Steel Fang, 2 Akatori Naginata
call GroupAddUnits(p, 'h0DB', 2, g, x, y)
call GroupAddUnits(p, 'h099', 2, g, x, y)
//2 Desert's Edge Reavers
call GroupAddUnits(p, 'h0DG', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R041', true) == 1 ) then
//3 Desert's Edge Reaver
call GroupAddUnits(p, 'h0DG', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R03W', true) == 1 ) then
//2 Steel Fang
call GroupAddUnits(p, 'h0DB', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R03V', true) == 1 ) then
//2 Emberwalkers
call GroupAddUnits(p, 'h0DE', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Talonpeak Stronghold
if ( GetUnitState(gg_unit_h0E6_1614, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Talonpeak_Stronghold)
set y = GetRectCenterY(gg_rct_Talonpeak_Stronghold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0E6_1614)
//1 Desert's Edge Reaver, 1 Skywatch Archer
call GroupAddUnit(g, CreateUnit(p, 'h0DG', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0DD', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R03Z', true) == 1 ) then
//3 Skywatch Archers
call GroupAddUnits(p, 'h0DD', 3, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R040', true) == 1 ) then
//2 Ironsight Vanguard
call GroupAddUnits(p, 'h0DA', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Blackwater
if ( GetUnitState(gg_unit_h0EA_1573, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0EA_1573 ) == p ) then
if ( FoodLimitCheck(8) ) then
set x = GetRectCenterX(gg_rct_Blackwater)
set y = GetRectCenterY(gg_rct_Blackwater)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0EA_1573)
//2 Blackfyre Muskateer, 2 Corsair Duelist
call GroupAddUnits(p, 'h0GT', 2, g, x, y)
call GroupAddUnits(p, 'h0GV', 2, g, x, y)
//3 Blackfyre Muskateer
if ( GetPlayerTechCount(p, 'R04U', true) == 1 ) then
call GroupAddUnits(p, 'h0GT', 3, g, x, y)
endif
//2 Corsair Duelist
if ( GetPlayerTechCount(p, 'R04W', true) == 1 ) then
call GroupAddUnits(p, 'h0GV', 2, g, x, y)
endif
//2 Sea Behemoth
if ( GetPlayerTechCount(p, 'R04V', true) == 1 ) then
call GroupAddUnits(p, 'h0GU', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Kingdom_of_Mu_Spawn takes nothing returns nothing
set gg_trg_Kingdom_of_Mu_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Kingdom_of_Mu_Spawn, function Trig_Kingdom_of_Mu_Spawn_Actions )
endfunction
function Trig_Auroriya_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(8)
// Auroria
if ( GetUnitState(gg_unit_h06E_0868, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Auroria)
set y = GetRectCenterY(gg_rct_Auroria)
set l = GetUnitRallyPoint(gg_unit_h06E_0868)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(9) ) then
//3 Dawn Warden, 2 Dust Bolter, 3 Twilight Sentinel
call GroupAddUnits(p, 'h065', 2, g, x, y)
call GroupAddUnits(p, 'h062', 2, g, x, y)
call GroupAddUnits(p, 'h064', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R04I', true) == 1 ) then
//2 Infernal Blaze Golems
call GroupAddUnits(p, 'h01M', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04J', true) == 1 ) then
//1 Obsidian Behemoth
call GroupAddUnit(g, CreateUnit(p, 'h0DX', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Celestial Cathedral
if ( GetUnitState(gg_unit_h0B3_0926, UNIT_STATE_LIFE) > 0.405) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Celestial_Gate)
set y = GetRectCenterY(gg_rct_Celestial_Gate)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B3_0926)
//1 Dawn Warden, 1 Luminous Archer, 1 Dawnlight Cavalier
call GroupAddUnit(g, CreateUnit(p, 'h065', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h067', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R04H', true) == 1 ) then
//2 Obsidian Guardians
call GroupAddUnits(p, 'h01J', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Lumina
if ( GetUnitState(gg_unit_h06F_0869, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Lumina)
set y = GetRectCenterY(gg_rct_Lumina)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h06F_0869)
//2 Dawn Warden
call GroupAddUnits(p, 'h065', 2, g, x, y)
if ( udg_SpawnReal == 0.00 or udg_SpawnReal == 3.00 ) then
//1 Luminance Channeler, 1 Lightshadow Seer
call GroupAddUnit(g, CreateUnit(p, 'h069', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h068', x, y, bj_UNIT_FACING) )
endif
if ( udg_SpawnReal == 1.00 or udg_SpawnReal == 4.00 ) then
//1 Radiant Enchantress, 1 Lightshadow Seer
call GroupAddUnit(g, CreateUnit(p, 'h06A', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h068', x, y, bj_UNIT_FACING) )
endif
if ( udg_SpawnReal == 2.00 or udg_SpawnReal == 5.00 ) then
//1 Heretic Banisher, 1 Luminance Channeler
call GroupAddUnit(g, CreateUnit(p, 'h06B', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h069', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R04E', true) == 1 ) then
//2 Lightswine Mechanics
call GroupAddUnits(p, 'h00Z', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sunreach
if ( GetUnitState(gg_unit_h06D_0867, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Sunreach)
set y = GetRectCenterY(gg_rct_Sunreach)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h06D_0867)
//2 Dawn Warden, 1 Luminous Archer, 1 Dawnlight Cavalier
call GroupAddUnits(p, 'h065', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h061', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h067', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Dawn's End
if ( GetUnitState(gg_unit_h06C_0866, UNIT_STATE_LIFE) > 0.405) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Dawns_End)
set y = GetRectCenterY(gg_rct_Dawns_End)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h06C_0866)
//2 Dawn Warden, 1 Dusk Bolter, 1 Twilight Sentinel
call GroupAddUnits(p, 'h065', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h062', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h064', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R04G', true) == 1 ) then
//1 Nightshade Catapult
call GroupAddUnit(g, CreateUnit(p, 'o00X', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Radiant Point
if ( GetUnitState(gg_unit_h06G_0870, UNIT_STATE_LIFE) > 0.405) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Radiant_Point)
set y = GetRectCenterY(gg_rct_Radiant_Point)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h06G_0870)
//1 Dawn Warden, 1 Luminous Archer, 1 Twilight Sentinel, 1 Mightnight Vanguard
call GroupAddUnit(g, CreateUnit(p, 'h065', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h061', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h064', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h063', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R04C', true) == 1 ) then
//2 Obsidian Knights
call GroupAddUnits(p, 'h01I', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04F', true) == 1 ) then
//2 Eclipse Gyrocopters
call GroupAddUnits(p, 'h01H', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Luminarch Enclave
if ( GetUnitState(gg_unit_h0B1_1844, UNIT_STATE_LIFE) > 0.405) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Luminarch_Enclave)
set y = GetRectCenterY(gg_rct_Luminarch_Enclave)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B1_1844)
//1 Dawn Warden, 1 Luminous Archer, 1 Dawnfire Sharpshooter
call GroupAddUnit(g, CreateUnit(p, 'h065', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h061', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h060', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R04B', true) == 1 ) then
//2 Golden Valkyries
call GroupAddUnits(p, 'h01L', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Sunspire Hold
if ( GetUnitState(gg_unit_h0B2_1852, UNIT_STATE_LIFE) > 0.405) then
if ( FoodLimitCheck(9) ) then
set x = GetRectCenterX(gg_rct_Sunspire_Hold)
set y = GetRectCenterY(gg_rct_Sunspire_Hold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B2_1852)
//1 Dawn Warden, 1 Dawn Hammer
call GroupAddUnit(g, CreateUnit(p, 'h065', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h02O', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R04D', true) == 1 ) then
//2 Horned Guardians
call GroupAddUnits(p, 'h04W', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Auroriya_Spawn takes nothing returns nothing
set gg_trg_Auroriya_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Auroriya_Spawn, function Trig_Auroriya_Spawn_Actions )
endfunction
function Trig_Avandor_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(9)
// Quel'Dorash
if ( GetUnitState(gg_unit_h08P_0081, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h08P_0081 ) == p ) then
set x = GetRectCenterX(gg_rct_QuelDorash)
set y = GetRectCenterY(gg_rct_QuelDorash)
set l = GetUnitRallyPoint(gg_unit_h08P_0081)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(10) ) then
//3 Ethereal Bladekeeper, 1 Celestial Naginata Bearer, 2 Twinblade Myrmidon
call GroupAddUnits(p, 'h06P', 3, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06Q', x, y, bj_UNIT_FACING ) )
call GroupAddUnits(p, 'h06R', 2, g, x, y)
if ( GetPlayerTechCount(p, 'R04R', true) == 1 ) then
//2 Aegis Battlemage
call GroupAddUnits(p, 'h0GB', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Solarian Crown
if ( GetUnitState(gg_unit_h074_0974, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Solarion_Crown)
set y = GetRectCenterY(gg_rct_Solarion_Crown)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h074_0974)
//2 Ethereal Bladekeeper, 1 Celestial Naginata Bearer, 1 Astralon Swiftbow, 1 Crimson Vanguard, 1 Stellar Illuminator
call GroupAddUnits(p, 'h06P', 5, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06Q', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06S', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06T', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06W', x, y, bj_UNIT_FACING ) )
if ( GetPlayerTechCount(p, 'R04O', true) == 1 ) then
//2 Skytalon Lancers
call GroupAddUnits(p, 'h0GD', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04S', true) == 1 ) then
//1 Celestial Sorceress
call GroupAddUnit( g, CreateUnit( p, 'h0GA', x, y, bj_UNIT_FACING ) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Silvergrove Stronghold
if ( GetUnitState(gg_unit_h0B8_1916, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Silvergrove_Stronghold)
set y = GetRectCenterY(gg_rct_Silvergrove_Stronghold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B8_1916)
//2 Astralon Swiftbow, 1 Crimson Vanguard, 1 Solarian Sentinel
call GroupAddUnits(p, 'h06S', 2, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06T', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06X', x, y, bj_UNIT_FACING ) )
if ( GetPlayerTechCount(p, 'R04K', true) == 1 ) then
//2 Starlance Chevaliers
call GroupAddUnits(p, 'h0GC', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Mystleaf Bastion
if ( GetUnitState(gg_unit_h0B6_1895, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Mystleaf_Bastion)
set y = GetRectCenterY(gg_rct_Mystleaf_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B6_1895)
//3 Ethereal Bladekeeper
call GroupAddUnits(p, 'h06P', 3, g, x, y)
if ( GetPlayerTechCount(p, 'R04L', true) == 1 ) then
//2 Halberdier Sentinels
call GroupAddUnits(p, 'h0G9', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04P', true) == 1 ) then
//2 Moonshadow Marksman
call GroupAddUnits(p, 'h0GE', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Feynaur Woodrest
if ( GetUnitState(gg_unit_h072_0973, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Feynaur_Woodrest)
set y = GetRectCenterY(gg_rct_Feynaur_Woodrest)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h072_0973)
//2 Astralon Swiftbow, 1 Eclipsar Mystic, 1 Celestial Naginata, 1 Stellar Illuminator
call GroupAddUnits(p, 'h06S', 2, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06T', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06Q', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06Y', x, y, bj_UNIT_FACING ) )
call GroupAddUnit( g, CreateUnit( p, 'h06W', x, y, bj_UNIT_FACING ) )
if ( GetPlayerTechCount(p, 'R04N', true) == 1 ) then
//2 Axeblade Guardians
call GroupAddUnits(p, 'h0G7', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04Q', true) == 1 ) then
//2 Moonshadow Marksman
call GroupAddUnits(p, 'h0GE', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R04T', true) == 1 ) then
//3 Ironclad Warbringers
call GroupAddUnits(p, 'h06Z', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Nymphshade Retreat
if ( GetUnitState(gg_unit_h0B5_1873, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Nymphshade_Retreat)
set y = GetRectCenterY(gg_rct_Nymphshade_Retreat)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B5_1873)
//2 Ethereal Bladekeeper
call GroupAddUnits(p, 'h06P', 2, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06Y', x, y, bj_UNIT_FACING ) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Elandrials Haven
if ( GetUnitState(gg_unit_h0B7_1896, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(10) ) then
set x = GetRectCenterX(gg_rct_Elandrials_Haven)
set y = GetRectCenterY(gg_rct_Elandrials_Haven)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0B7_1896)
//2 Celestial Naginata Bearer, 1 Eclipsar Mystic
call GroupAddUnits(p, 'h06Q', 2, g, x, y)
call GroupAddUnit( g, CreateUnit( p, 'h06Y', x, y, bj_UNIT_FACING ) )
if ( GetPlayerTechCount(p, 'R04M', true) == 1 ) then
//2 Halberdier Sentinels
call GroupAddUnits(p, 'h0G9', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
////////////////////////////////////////////////BACKUP
// TINKERSPIRE
//if (GetUnitState(gg_unit_h02U_0162, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h02U_0162) == p ) then
//if ( FoodLimitCheck(2) ) then
//set x = GetRectCenterX(gg_rct_Tinkerspire)
//set y = GetRectCenterY(gg_rct_Tinkerspire)
//set g = CreateGroup()
//set l = GetUnitRallyPoint(gg_unit_h02U_0162)
//1 Aetherite Juggernaut, 1 Clockwork Golem, 1 Tinkertech Engineer
//call GroupAddUnit(g, CreateUnit(p, 'h03B', x, y, bj_UNIT_FACING) )
//call GroupAddUnit(g, CreateUnit(p, 'n005', x, y, bj_UNIT_FACING) )
//call GroupAddUnit(g, CreateUnit(p, 'h03A', x, y, bj_UNIT_FACING) )
//if ( GetPlayerTechCount(p, 'R009', true) == 1 ) then
//1 Aetherite Grenadier
//call GroupAddUnit(g, CreateUnit(p, 'h05I', x, y, bj_UNIT_FACING) )
//endif
//if ( GetPlayerTechCount(p, 'R008', true) == 1 ) then
//2 Tinkerspire Duelists
//call GroupAddUnits(p, 'h02W', 2, g, x, y)
//endif
//call GroupPointOrderLoc(g, "attack", l)
//call DestroyGroup(g)
//call RemoveLocation(l)
//endif
//endif
// STEAMWICK
//if (GetUnitState(gg_unit_h02X_0163, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h02X_0163) == p ) then
//if ( FoodLimitCheck(2) ) then
//set x = GetRectCenterX(gg_rct_Steamwick)
//set y = GetRectCenterY(gg_rct_Steamwick)
//set g = CreateGroup()
//set l = GetUnitRallyPoint(gg_unit_h02X_0163)
//2 Gnomish Artificer, 2 Ironhold Infantry, 1 Aetherite Alchemist
//call GroupAddUnits(p, 'h03C', 2, g, x, y)
//call GroupAddUnits(p, 'h034', 2, g, x, y)
//call GroupAddUnit(g, CreateUnit(p, 'h039', x, y, bj_UNIT_FACING) )
//if ( GetPlayerTechCount(p, 'R00A', true) == 1 ) then
//1 Steamwick Saboteur
//call GroupAddUnit(g, CreateUnit(p, 'h02Y', x, y, bj_UNIT_FACING) )
//endif
//call GroupPointOrderLoc(g, "attack", l)
//call DestroyGroup(g)
//call RemoveLocation(l)
//endif
//endif
// GADGETTON
//if (GetUnitState(gg_unit_h02Z_0164, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h02Z_0164) == p ) then
//if ( FoodLimitCheck(2) ) then
//set x = GetRectCenterX(gg_rct_Gadgetton)
//set y = GetRectCenterY(gg_rct_Gadgetton)
//set g = CreateGroup()
//set l = GetUnitRallyPoint(gg_unit_h02Z_0164)
//2 Steamgunner, 2 Ironhold Infantry, 1 Aetherite Juggernaut
//call GroupAddUnits(p, 'h037', 2, g, x, y)
//call GroupAddUnits(p, 'h034', 2, g, x, y)
//call GroupAddUnit(g, CreateUnit(p, 'h03B', x, y, bj_UNIT_FACING) )
//call GroupPointOrderLoc(g, "attack", l)
//call DestroyGroup(g)
//call RemoveLocation(l)
//endif
//endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Avandor_Spawn takes nothing returns nothing
set gg_trg_Avandor_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Avandor_Spawn, function Trig_Avandor_Spawn_Actions )
endfunction
function Trig_Gromokol_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(10)
// Cogfall
if ( GetUnitState(gg_unit_h01X_0108, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Cogfall)
set y = GetRectCenterY(gg_rct_Cogfall)
set l = GetUnitRallyPoint(gg_unit_h01X_0108)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(11) ) then
//3 Forgeguard Defender, 2 Ironbound Warrior, 1 Hammerguard, 1 Thunderbolt Rifleman, 1 Tech Priest
call GroupAddUnits(p, 'h00I', 3, g, x, y)
call GroupAddUnits(p, 'h01Y', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h00Q', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00P', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00P', true) == 1 ) then
if ( udg_SpawnReal == 0.00 or udg_SpawnReal == 3.00 ) then
//Thunderstrike Behemoth every 3rd
call GroupAddUnit(g, CreateUnit(p, 'h000', x, y, bj_UNIT_FACING) )
endif
endif
if ( GetPlayerTechCount(p, 'R00Q', true) == 1 ) then
//1 Aetherskimmer Zephyr
call GroupAddUnit(g, CreateUnit(p, 'n000', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Clockwork City
if ( GetUnitState(gg_unit_h003_0011, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Clockwork_City)
set y = GetRectCenterY(gg_rct_Clockwork_City)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h003_0011)
//1 Forgeguard Defender, 2 Thunderbolt Rifleman, 1 Steam Spider,
call GroupAddUnit(g, CreateUnit(p, 'h00I', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00Y', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R005', true) == 1 ) then
//2 Ironwing Flyers
call GroupAddUnits(p, 'h00U', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00O', true) == 1 ) then
//1 Steamstinger Sentinel
call GroupAddUnit(g, CreateUnit(p, 'h04V', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R00M', true) == 1 ) then
//1 Steamwraith Guardian
call GroupAddUnit(g, CreateUnit(p, 'h04C', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Castle of Orlov
if ( GetUnitState(gg_unit_h00C_0014, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Castle_Orlov)
set y = GetRectCenterY(gg_rct_Castle_Orlov)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h00C_0014)
//1 Ironbound Warrior, 1 Forgeguard, 1 Minion Archivist, 1 Thunderbolt Rifleman
call GroupAddUnit(g, CreateUnit(p, 'h01Y', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00I', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00X', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00O', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Steelport
if ( GetUnitState(gg_unit_h00A_0015, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Steelport)
set y = GetRectCenterY(gg_rct_Steelport)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h00A_0015)
//2 Forgeguard Defender, 1 Thunderbolt Rifleman
call GroupAddUnits(p, 'h00I', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h00O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00N', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Brassfield
if ( GetUnitState(gg_unit_h004_0016, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Brassfield)
set y = GetRectCenterY(gg_rct_Brassfield)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h004_0016)
//2 Ironbound Warrior, 1 Tech Priest
call GroupAddUnits(p, 'h01Y', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h01Y', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00P', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Ironhaven
if ( GetUnitState(gg_unit_h002_0004, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Ironhaven)
set y = GetRectCenterY(gg_rct_Ironhaven)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h002_0004)
//1 Forgeguard Defender, 1 Thunderbolt Rifleman, 1 Ironbound Warrior
call GroupAddUnit(g, CreateUnit(p, 'h00I', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h00O', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h01Y', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00I', true) == 1 ) then
//1 Ironclad Hailstormer
call GroupAddUnit(g, CreateUnit(p, 'h010', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R00J', true) == 1 ) then
//1 Ironclad Sharpshooter
call GroupAddUnit(g, CreateUnit(p, 'h012', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Thundercrag
if ( GetUnitState(gg_unit_h006_0001, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Thundercrag)
set y = GetRectCenterY(gg_rct_Thundercrag)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h006_0001)
//3 Steam Spider, 1 Minion Archivist
call GroupAddUnits(p, 'h00Y', 3, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h00X', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R00N', true) == 1 ) then
//2 Steamfang Automaton
call GroupAddUnits(p, 'h04U', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00K', true) == 1 ) then
//2 Thunderhorse Rifleman
call GroupAddUnits(p, 'h011', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Port Duragol
if ( GetUnitState(gg_unit_h0CO_1508, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(11) ) then
set x = GetRectCenterX(gg_rct_Port_Duragol)
set y = GetRectCenterY(gg_rct_Port_Duragol)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h002_0004)
//3 Forgeguard Defenders
call GroupAddUnits(p, 'h00I', 3, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Gromokol_Spawn takes nothing returns nothing
set gg_trg_Gromokol_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Gromokol_Spawn, function Trig_Gromokol_Spawn_Actions )
endfunction
function Trig_Dwarf_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local group ironbreaker = CreateGroup()
local location l
local unit u
local player p = Player(11)
// Kazad Thrum
if ( GetUnitState(gg_unit_h07T_1138, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Kazad_Thrum)
set y = GetRectCenterY(gg_rct_Kazad_Thrum)
set l = GetUnitRallyPoint(gg_unit_h07T_1138)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(12) ) then
//2 Royal Ironfoot, 2 Zul Axemaster, 2 Deepbear Rider
call GroupAddUnits(p, 'h04A', 2, g, x, y)
call GroupAddUnits(p, 'h043', 2, g, x, y)
call GroupAddUnits(p, 'h045', 2, g, x, y)
if ( udg_SpawnReal == 2.00 or udg_SpawnReal == 5.00 ) then
//1 Ironbreaker every 3rd
call GroupAddUnit(g, CreateUnit(p, 'n006', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R01H', true) == 1 ) then
//1 Ironshot Tinkerer
call GroupAddUnit(g, CreateUnit(p, 'h08Q', x, y, bj_UNIT_FACING) )
endif
if ( GetPlayerTechCount(p, 'R01I', true) == 1 ) then
//2 Obsidian Forgemaster
call GroupAddUnits(p, 'h08S', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01J', true) == 1 ) then
//1 Ghost-Steel Reaver
call GroupAddUnit(g, CreateUnit(p, 'h08V', x, y, bj_UNIT_FACING) )
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Kazad Urkahr
if ( GetUnitState(gg_unit_h091_1299, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Kazad_Urkahr)
set y = GetRectCenterY(gg_rct_Kazad_Urkahr)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h091_1299)
//2 Ironfoot Soldier, 2 Deepstone Marksman, 2 Dwarf Cavalier, 1 Earthshaper
call GroupAddUnits(p, 'h047', 2, g, x, y)
call GroupAddUnits(p, 'h048', 2, g, x, y)
call GroupAddUnits(p, 'h041', 2, g, x, y)
set ironbreaker = GetUnitsOfPlayerAndTypeId(Player(11), 'n006')
//1 Ironbreaker every 3rd up to 4 total
if ( udg_SpawnReal == 2.00 or udg_SpawnReal == 5.00 ) then
//1 Ironbreaker every 3rd
if ( BlzGroupGetSize(ironbreaker) < 4 ) then
call GroupAddUnit(g, CreateUnit(p, 'n006', x, y, bj_UNIT_FACING) )
endif
endif
if ( GetPlayerTechCount(p, 'R00R', true) == 1 ) then
//2 Granite Guardians
call GroupAddUnits(p, 'h007', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R00S', true) == 1 ) then
//2 Ironbound Reavers
call GroupAddUnits(p, 'h008', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Stonehaven
if ( GetUnitState(gg_unit_h090_0673, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Stonehaven)
set y = GetRectCenterY(gg_rct_Stonehaven)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h090_0673)
//3 Ironfoot Soldier, 2 Deepstone Marksman, 2 Deepbear Rider, 1 Gilded Crossbowman
call GroupAddUnits(p, 'h047', 3, g, x, y)
call GroupAddUnits(p, 'h048', 2, g, x, y)
call GroupAddUnits(p, 'h045', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h044', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R01D', true) == 1 ) then
//2 Mountainheart Guardian
call GroupAddUnits(p, 'h08T', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01E', true) == 1 ) then
//2 Crowbond Mystic
call GroupAddUnits(p, 'h08W', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Hearthforge City
if ( GetUnitState(gg_unit_h0CG_1121, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Hearthforge_City)
set y = GetRectCenterY(gg_rct_Hearthforge_City)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CG_1121)
//2 Ironfoot Soldier, 1 Deepstone Marksman
call GroupAddUnits(p, 'h047', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h048', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Hammerhold
if ( GetUnitState(gg_unit_h092_1432, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Hammerhold)
set y = GetRectCenterY(gg_rct_Hammerhold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h092_1432)
//2 Ironfoot Soldier, 1 Deepstone Marksman, 1 Dwarf Cavalier, 1 Earthshaper, 1 Ironbreaker
call GroupAddUnits(p, 'h047', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h048', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h041', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h042', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'n006', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R01F', true) == 1 ) then
//2 Ironfoot Pikes
call GroupAddUnits(p, 'h041', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01G', true) == 1 ) then
//1 Ram Fury Berserker
call GroupAddUnit(g, CreateUnit(p, 'h08X', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Stone's Fist
if ( GetUnitState(gg_unit_h0AH_0529, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Stones_Fist)
set y = GetRectCenterY(gg_rct_Stones_Fist)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AH_0529)
//1 Ironfoot Soldier, 1 Dwarf Cavalier, 1 Earthshaper
call GroupAddUnit(g, CreateUnit(p, 'h047', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h041', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h042', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Deepvein Hollow
if ( GetUnitState(gg_unit_h093_1463, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h093_1463 ) == p ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Deepvein_Hollow)
set y = GetRectCenterY(gg_rct_Deepvein_Hollow)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h093_1463)
//2 Ironfoot Soldier, 1 Earthshaper, 1 Ironbreaker
call GroupAddUnits(p, 'h047', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h042', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'n006', x, y, bj_UNIT_FACING) )
if ( GetPlayerTechCount(p, 'R01K', true) == 1 ) then
//2 Veiled Enforcer
call GroupAddUnits(p, 'h08Y', 2, g, x, y)
endif
if ( GetPlayerTechCount(p, 'R01L', true) == 1 ) then
//2 Bearborne Ravagers
call GroupAddUnits(p, 'h08Z', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Urzukar Depths
if ( GetUnitState(gg_unit_h094_1464, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h094_1464 ) == p ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Urzukar_Depths)
set y = GetRectCenterY(gg_rct_Urzukar_Depths)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h094_1464)
//2 Ironbreaker, 1 Stormrider, 1 Gilded Crossbow
call GroupAddUnits(p, 'n006', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h049', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h044', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Deepforge Crossing
if ( GetUnitState(gg_unit_h0CJ_2033, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0CF_0876 ) == p ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Deepforge_Crossing)
set y = GetRectCenterY(gg_rct_Deepforge_Crossing)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CJ_2033)
//2 Ironbreaker, 1 Stormrider, 1 Gilded Crossbow
call GroupAddUnits(p, 'n006', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h049', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h044', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Shieldbrow Bastion
if ( GetUnitState(gg_unit_h0CF_0876, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0CF_0876 ) == p ) then
if ( FoodLimitCheck(12) ) then
set x = GetRectCenterX(gg_rct_Shieldbrow_Bastion)
set y = GetRectCenterY(gg_rct_Shieldbrow_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CF_0876)
//6 Ironfoot Soldier, 6 Deepstone Marksman
call GroupAddUnits(p, 'h047', 6, g, x, y)
call GroupAddUnits(p, 'h048', 6, g, x, y)
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(ironbreaker)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set ironbreaker = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Dwarf_Spawn takes nothing returns nothing
set gg_trg_Dwarf_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Dwarf_Spawn, function Trig_Dwarf_Spawn_Actions )
endfunction
function Trig_Xanthea_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(12)
// Nexumbra
if ( GetUnitState(gg_unit_h0AD_1774, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Nexumbra)
set y = GetRectCenterY(gg_rct_Nexumbra)
set l = GetUnitRallyPoint(gg_unit_h0AD_1774)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(13) ) then
//3 Shadowmancers, 1 Nether Archer, 1 Veil Stalker, 1 Dread Guardian
call GroupAddUnits(p, 'h09Z', 3, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A1', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0A3', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h09X', x, y, bj_UNIT_FACING) )
if ( udg_SpawnReal == 0.00 or udg_SpawnReal == 3.00 ) then
//Abyssal Sentinel every 3rd
call GroupAddUnit(g, CreateUnit(p, 'h0A4', x, y, bj_UNIT_FACING) )
endif
//1 Deathknight Harrower
if ( GetPlayerTechCount(p, 'R02A', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0C8', x, y, bj_UNIT_FACING) )
endif
//2 Netherbane Huntress
if ( GetPlayerTechCount(p, 'R02G', true) == 1 ) then
call GroupAddUnits(p, 'h0C1', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Veil's Breach
if ( GetUnitState(gg_unit_h0AO_1092, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_Veils_Breach)
set y = GetRectCenterY(gg_rct_Veils_Breach)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AO_1092)
//2 Shadowmancers, 1 Nether Hammer
call GroupAddUnits(p, 'h09Z', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A0', x, y, bj_UNIT_FACING) )
//1 Marrowrend Shivan
if ( GetPlayerTechCount(p, 'R02J', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0C2', x, y, bj_UNIT_FACING) )
endif
//2 Veilscar Berserkers
if ( GetPlayerTechCount(p, 'R02K', true) == 1 ) then
call GroupAddUnits(p, 'h0BY', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Desolation's Edge
if ( GetUnitState(gg_unit_h0AR_0262, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_Desolations_Edge)
set y = GetRectCenterY(gg_rct_Desolations_Edge)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AR_0262)
//2 Shadowmancers, 1 Blackguard
call GroupAddUnits(p, 'h09Z', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h09Y', x, y, bj_UNIT_FACING) )
//2 Ossify Knights
if ( GetPlayerTechCount(p, 'R02B', true) == 1 ) then
call GroupAddUnits(p, 'h09Y', 2, g, x, y)
endif
//2 Palestalkers
if ( GetPlayerTechCount(p, 'R02C', true) == 1 ) then
call GroupAddUnits(p, 'h0C3', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// The Obsidian Sanctuary
if ( GetUnitState(gg_unit_h0AQ_0261, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_The_Obsidian_Sanctuary)
set y = GetRectCenterY(gg_rct_The_Obsidian_Sanctuary)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AQ_0261)
//2 Shadowmancers, 1 Veil Stalker
call GroupAddUnits(p, 'h09Z', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A3', x, y, bj_UNIT_FACING) )
//1 Hexcrown Sorceresss
if ( GetPlayerTechCount(p, 'R02L', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0C7', x, y, bj_UNIT_FACING) )
endif
//1 Cryptcast Warlock
if ( GetPlayerTechCount(p, 'R02M', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0C5', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// The Obsidian Bastion
if ( GetUnitState(gg_unit_h0AC_1767, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_The_Obsidian_Bastion)
set y = GetRectCenterY(gg_rct_The_Obsidian_Bastion)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AC_1767)
//3 Nether Hammers, 1 Dreadbolt Arbalester
call GroupAddUnits(p, 'h0A0', 3, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0BU', x, y, bj_UNIT_FACING) )
//3 Wrathbane Berserkers
if ( GetPlayerTechCount(p, 'R02D', true) == 1 ) then
call GroupAddUnits(p, 'h0BZ', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// The Magma Maw
if ( GetUnitState(gg_unit_h0AA_1523, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_The_Magma_Maw)
set y = GetRectCenterY(gg_rct_The_Magma_Maw)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AA_1523)
//2 Shadowmark Bolter, 1 Flames of Aeternus
call GroupAddUnits(p, 'h0BT', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A8', x, y, bj_UNIT_FACING) )
//1 Infernal Titan
if ( GetPlayerTechCount(p, 'R02E', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0A5', x, y, bj_UNIT_FACING) )
endif
//2 Balefire Revenants
if ( GetPlayerTechCount(p, 'R02F', true) == 1 ) then
call GroupAddUnits(p, 'h0C4', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Lament's Crossing
if ( GetUnitState(gg_unit_h023_1522, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_Laments_Crossing)
set y = GetRectCenterY(gg_rct_Laments_Crossing)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h023_1522)
//1 Abyssal Sentinel, 1 Blackguard, 2 Shadowmancers
call GroupAddUnit(g, CreateUnit(p, 'h0A4', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h09Y', x, y, bj_UNIT_FACING) )
call GroupAddUnits(p, 'h09Z', 2, g, x, y)
//2 Gravebone Reavers
if ( GetPlayerTechCount(p, 'R029', true) == 1 ) then
call GroupAddUnits(p, 'h0C9', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Shadowfen Hold
if ( GetUnitState(gg_unit_h0AE_1776, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_Shadowfen_Hold)
set y = GetRectCenterY(gg_rct_Shadowfen_Hold)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AE_1776)
//2 Dread Guardian, 2 Nether Archer, 1 Nether Hammers
call GroupAddUnits(p, 'h09X', 2, g, x, y)
call GroupAddUnits(p, 'h0A1', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A0', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Veloria
if ( GetUnitState(gg_unit_h0AB_1525, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0AB_1525) == p ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_Veloria)
set y = GetRectCenterY(gg_rct_Veloria)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0AB_1525)
//3 Soldier of Veloria, 2 Void Whisperers
call GroupAddUnits(p, 'h0A7', 3, g, x, y)
call GroupAddUnits(p, 'h0A6', 2, g, x, y)
//2 Monarch Wraithblade
if ( GetPlayerTechCount(p, 'R02H', true) == 1 ) then
call GroupAddUnits(p, 'h0C6', 2, g, x, y)
endif
//3 Grimharvest Sentinels
if ( GetPlayerTechCount(p, 'R02I', true) == 1 ) then
call GroupAddUnits(p, 'h0C0', 3, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
// Infernal Spire
if ( GetUnitState(gg_unit_h0CP_1946, UNIT_STATE_LIFE) > 0.405 and GetOwningPlayer(gg_unit_h0CP_1946) == p ) then
if ( FoodLimitCheck(13) ) then
set x = GetRectCenterX(gg_rct_The_Infernal_Spire)
set y = GetRectCenterY(gg_rct_The_Infernal_Spire)
set g = CreateGroup()
set l = GetUnitRallyPoint(gg_unit_h0CP_1946)
//3 Veil Stalkers, 2 Flames of Aeternus, 1 Infernal Titan
call GroupAddUnits(p, 'h0A3', 3, g, x, y)
call GroupAddUnits(p, 'h0A8', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0A5', x, y, bj_UNIT_FACING) )
call GroupPointOrderLoc(g, "attack", l)
call DestroyGroup(g)
call RemoveLocation(l)
endif
endif
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Xanthea_Spawn takes nothing returns nothing
set gg_trg_Xanthea_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Xanthea_Spawn, function Trig_Xanthea_Spawn_Actions )
endfunction
function Trig_Skaldrin_Spawn_Actions takes nothing returns nothing
local real x
local real y
local group g = CreateGroup()
local location l
local unit u
local player p = Player(13)
// Zephyrskar
if ( GetUnitState(gg_unit_h0G5_1974, UNIT_STATE_LIFE) > 0.405 ) then
set x = GetRectCenterX(gg_rct_Zephyrskar)
set y = GetRectCenterY(gg_rct_Zephyrskar)
set l = GetUnitRallyPoint(gg_unit_h0G5_1974)
if ( GetActualHealerCount(GetPlayerId(p)) < 4 ) then
call CreateHealer(g, p, HealerType[GetPlayerId(p)], x, y, bj_UNIT_FACING)
endif
if ( FoodLimitCheck(14) ) then
//3 Thornscale Guard, 2 Razorquill Archer, 1 Spearfang Duelist, 1 Serpent Halberdier
call GroupAddUnits(p, 'h0FJ', 3, g, x, y)
call GroupAddUnits(p, 'h0F8', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0F9', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0FN', x, y, bj_UNIT_FACING) )
//2 Saurikin Horned Guardian
if ( GetPlayerTechCount(p, 'R04Y', true) == 1 ) then
call GroupAddUnits(p, 'h0FO', 2, g, x, y)
endif
//2 Saurikin Venomancer
if ( GetPlayerTechCount(p, 'R050', true) == 1 ) then
call GroupAddUnits(p, 'h0FC', 2, g, x, y)
endif
//2 Golden Mace Guard
if ( GetPlayerTechCount(p, 'R055', true) == 1 ) then
call GroupAddUnits(p, 'h0HI', 2, g, x, y)
endif
//2 Chainglaive Guard
if ( GetPlayerTechCount(p, 'R056', true) == 1 ) then
call GroupAddUnits(p, 'h0HK', 2, g, x, y)
endif
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call GroupClear(g)
call RemoveLocation(l)
endif
// Mistveil
if ( GetUnitState(gg_unit_h0G2_1959, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(14) ) then
set x = GetRectCenterX(gg_rct_Mistveil)
set y = GetRectCenterY(gg_rct_Mistveil)
set l = GetUnitRallyPoint(gg_unit_h0G2_1959)
//2 Thornscale Guard, 1 Vexclaw Guard, 1 Rattar Rifle
call GroupAddUnits(p, 'h0FJ', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0FQ', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0FT', x, y, bj_UNIT_FACING) )
//2 Skyglide Basilisk
if ( GetPlayerTechCount(p, 'R059', true) == 1 ) then
call GroupAddUnits(p, 'h0HE', 2, g, x, y)
endif
//2 Aquafang Serpents
if ( GetPlayerTechCount(p, 'R05A', true) == 1 ) then
call GroupAddUnits(p, 'h0HD', 2, g, x, y)
endif
//2 Aquafang Serpents
if ( GetPlayerTechCount(p, 'R05B', true) == 1 ) then
call GroupAddUnits(p, 'h0HG', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Fangspire
if ( GetUnitState(gg_unit_h0G4_1971, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(14) ) then
set x = GetRectCenterX(gg_rct_Fangspire)
set y = GetRectCenterY(gg_rct_Fangspire)
set l = GetUnitRallyPoint(gg_unit_h0G4_1971)
//2 Flamecaster, 1 Bone Hexer, 1 Voodoo Caster
call GroupAddUnits(p, 'h0F7', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0FL', x, y, bj_UNIT_FACING) )
call GroupAddUnit(g, CreateUnit(p, 'h0FK', x, y, bj_UNIT_FACING) )
//3 Boglash Ambusher
if ( GetPlayerTechCount(p, 'R04Z', true) == 1 ) then
call GroupAddUnits(p, 'h0FO', 3, g, x, y)
endif
//2 Venomous Glaivemaster
if ( GetPlayerTechCount(p, 'R057', true) == 1 ) then
call GroupAddUnits(p, 'h0HJ', 2, g, x, y)
endif
//2 Thornspike Bloomterror
if ( GetPlayerTechCount(p, 'R058', true) == 1 ) then
call GroupAddUnits(p, 'h0HC', 2, g, x, y)
endif
if (BlzGroupGetSize(g) < 13) then
call GroupPointOrderLoc(g, "attack", l)
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
call IssuePointOrderLoc(u, "attack", l)
endloop
endif
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Thornhold
if ( GetUnitState(gg_unit_h0G0_1861, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(14) ) then
set x = GetRectCenterX(gg_rct_Thornhold)
set y = GetRectCenterY(gg_rct_Thornhold)
set l = GetUnitRallyPoint(gg_unit_h0G0_1861)
//2 Thornscale Guard, 2 Macefly Rider, 1 Serpent Rider
call GroupAddUnits(p, 'h0FJ', 2, g, x, y)
call GroupAddUnits(p, 'h0FM', 2, g, x, y)
call GroupAddUnit(g, CreateUnit(p, 'h0FA', x, y, bj_UNIT_FACING) )
//2 Emerald Horn
if ( GetPlayerTechCount(p, 'R052', true) == 1 ) then
call GroupAddUnits(p, 'h0FH', 2, g, x, y)
endif
//2 Crimson Scaled Vanguard
if ( GetPlayerTechCount(p, 'R053', true) == 1 ) then
call GroupAddUnits(p, 'h0FF', 2, g, x, y)
endif
//1 Verdant Behemoth
if ( GetPlayerTechCount(p, 'R054', true) == 1 ) then
call GroupAddUnit(g, CreateUnit(p, 'h0FE', x, y, bj_UNIT_FACING) )
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
// Scaleport
if ( GetUnitState(gg_unit_h0G3_1968, UNIT_STATE_LIFE) > 0.405 ) then
if ( FoodLimitCheck(14) ) then
set x = GetRectCenterX(gg_rct_Scaleport)
set y = GetRectCenterY(gg_rct_Scaleport)
set l = GetUnitRallyPoint(gg_unit_h0G3_1968)
//2 Thornscale Guard, 2 Razorquill Archer
call GroupAddUnits(p, 'h0FJ', 2, g, x, y)
call GroupAddUnits(p, 'h0F8', 2, g, x, y)
//2 Rattar Halberdier
if ( GetPlayerTechCount(p, 'R04X', true) == 1 ) then
call GroupAddUnits(p, 'h0FR', 2, g, x, y)
endif
//2 Rattra Gunners
if ( GetPlayerTechCount(p, 'R051', true) == 1 ) then
call GroupAddUnits(p, 'h0FS', 2, g, x, y)
endif
call GroupPointOrderLoc(g, "attack", l)
call GroupClear(g)
call RemoveLocation(l)
endif
endif
call DestroyGroup(g)
set g = null
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Skaldrin_Spawn takes nothing returns nothing
set gg_trg_Skaldrin_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_Skaldrin_Spawn, function Trig_Skaldrin_Spawn_Actions )
endfunction