function TrueReplace takes unit oldUnit, integer newUnitId, player OwnerOfKillingUnit returns unit
local real Ratio
//Control Points and Capturable Buildings
if (oldUnit == null) then
set bj_lastReplacedUnit = null
return null
endif
set bj_lastReplacedUnit = CreateUnit(OwnerOfKillingUnit, newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
if (GetUnitState(oldUnit, UNIT_STATE_LIFE) > 0) then
set Ratio = GetUnitState(oldUnit, UNIT_STATE_LIFE) / GetUnitState(oldUnit, UNIT_STATE_MAX_LIFE)
call SetUnitState(bj_lastReplacedUnit, UNIT_STATE_LIFE, Ratio * GetUnitState(bj_lastReplacedUnit, UNIT_STATE_MAX_LIFE))
endif
if (GetUnitState(oldUnit, UNIT_STATE_MAX_MANA) > 0) and (GetUnitState(bj_lastReplacedUnit, UNIT_STATE_MAX_MANA) > 0) then
set Ratio = GetUnitState(oldUnit, UNIT_STATE_MANA) / GetUnitState(oldUnit, UNIT_STATE_MAX_MANA)
call SetUnitState(bj_lastReplacedUnit, UNIT_STATE_MANA, Ratio * GetUnitState(bj_lastReplacedUnit, UNIT_STATE_MAX_MANA))
else
set Ratio = 0.00
call SetUnitState(bj_lastReplacedUnit, UNIT_STATE_MANA, Ratio)
endif
call RemoveUnit(oldUnit)
return bj_lastReplacedUnit
endfunction
function UnitCreationAtCoor takes integer count, integer unitId, player whichPlayer, real x, real y, real face returns group
call GroupClear(bj_lastCreatedGroup)
loop
set count = count - 1
exitwhen count < 0
set bj_lastCreatedUnit = CreateUnit(whichPlayer, unitId, x, y, face)
call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
endloop
return bj_lastCreatedGroup
endfunction
function Max takes integer a, integer b returns integer
if a > b then
return a
else
return b
endif
endfunction
function Min takes integer a, integer b returns integer
if a < b then
return a
else
return b
endif
endfunction
Name | Type | is_array | initial_value |
A_Game_Over | boolean | No | |
Acherus | unit | No | |
Acherus_Portals | unit | Yes | |
Angle | real | Yes | |
AoE | integer | Yes | |
BurningLegionSummon | timer | No | |
Caster | unit | Yes | |
CleanedItem | item | Yes | ItemNull |
Coor_X | real | No | |
Coor_Y | real | No | |
Creep_Face_Ang | real | Yes | |
Creep_Loc | location | Yes | |
Cur_D | real | Yes | |
Dalaran | unit | No | |
Dalaran_Portals | unit | Yes | |
DialogArray | dialog | Yes | |
DialogButtonArray | button | Yes | |
DimensionalGate | unit | No | |
Dummy | unit | Yes | |
Dummy2 | unit | Yes | |
Group | group | No | |
HERO_Abbandis | unit | No | |
HERO_Akama | unit | No | |
HERO_Anasterian | unit | No | |
HERO_Arthas | unit | No | |
HERO_Balnazzar | unit | No | UnitNull |
HERO_CThun | unit | No | |
HERO_Daellis | unit | No | |
HERO_Deathwing | unit | No | |
HERO_Detheroc | unit | No | UnitNull |
HERO_Elder_Drake | unit | No | |
HERO_EyeOfCThun | unit | No | |
HERO_Falric | unit | No | |
HERO_Furion | unit | No | |
HERO_Galford | unit | No | |
HERO_Grommash | unit | No | |
HERO_Illidan | unit | No | |
HERO_KaynSunfury | unit | No | |
HERO_KelThuzad | unit | No | |
HERO_Liadrin | unit | No | |
HERO_Mal_Ganis | unit | No | |
HERO_Malygos | unit | No | |
HERO_Marwyn | unit | No | |
HERO_Noth | unit | No | |
HERO_Paltheon | unit | No | |
HERO_Remulos | unit | No | |
HERO_Renault | unit | No | |
HERO_Rhonin | unit | No | |
HERO_Rivendare | unit | No | |
HERO_Rommath | unit | No | |
HERO_Saidan | unit | No | |
HERO_Sally | unit | No | |
HERO_Sinestra | unit | No | |
HERO_Stellagosa | unit | No | |
HERO_Terenas | unit | No | |
HERO_Thalorian | unit | No | |
HERO_Tichondrius | unit | No | |
HERO_Ukorz | unit | No | |
HERO_Varimathras | unit | No | UnitNull |
HERO_Voljin | unit | No | |
HERO_Zuljin | unit | No | |
HERO_Zuluhed | unit | No | |
IdolOfMadness_R1 | real | No | |
IdolOfMadness_R2 | real | No | |
IdolOfMadness_T | timer | No | |
IdolOfMadness_U | unit | No | |
Income_ControlPoints | integer | Yes | |
Income_Lumber | integer | Yes | |
Income_Max | integer | No | 0 |
Integer | integer | No | |
INTEGER_Ability_Chance | integer | No | |
INTEGER_CommandAllCD | integer | Yes | |
INTEGER_KoQ_QTR_EliteLimit | integer | No | 6 |
INTEGER_RandomTipRoll | integer | No | |
INTEGER_SecondCount | integer | No | |
INTEGER_TrueTipRoll | integer | No | |
INTEGER_TurnCount | integer | No | |
ITEM_Combination | itemcode | Yes | |
ITEM_Fac_Clear | boolean | Yes | |
ITEM_Temp | item | No | |
ItemsToClean | integer | No | |
JOTD_Trigg_Spawn_Pos | location | No | |
Legion_Heroes | unit | Yes | |
Legion_Portal_Exit | location | No | |
Level | integer | Yes | |
List | integer | No | |
Loc | location | No | |
Loc1 | location | No | |
Loc2 | location | No | |
Loc3 | location | No | |
Loc4 | location | No | |
Max_D | real | Yes | |
Max_H | real | Yes | |
Max_Index | integer | No | |
MUI_1 | integer | No | |
MUI_2 | integer | Yes | |
MUI_3 | integer | No | |
MULTIBOARD_Leaderboard | multiboard | No | |
Naxxramas | unit | No | |
Naxxramas_Portals | unit | Yes | |
PERM_POS_Center_Of_DummyRegion | location | No | |
PLAYER_Abbandis | player | No | |
PLAYER_Akama | player | No | |
PLAYER_Arthas | player | No | PlayerNA |
PLAYER_GROUP_Tips | force | No | |
PLAYER_Saidan | player | No | |
PLAYER_Ukorz | player | No | |
PLAYER_Voljin | player | No | |
PLAYER_Zuljin | player | No | |
PlayersActive | force | No | |
Real | real | Yes | |
REAL_Count | real | No | |
Speed | real | Yes | |
StartingPosCenRegion | location | Yes | |
SunWell | unit | No | |
SunwellRemnant | group | No | |
TargetLoc | location | No | |
Tech_Level | integer | No | |
Temp | integer | No | |
Temp_Agility | integer | No | |
Temp_Group | group | No | |
Temp_HitPoints | real | No | |
Temp_Integer | integer | No | |
Temp_Integer2 | integer | No | |
Temp_Intelligence | integer | No | |
Temp_Mana | real | No | |
Temp_Player | player | No | |
Temp_Player_Group | force | No | |
Temp_Point | location | No | |
Temp_Real | real | No | |
Temp_Strength | integer | No | |
Temp_String | string | No | |
Temp_Trigger | trigger | No | |
Temp_Unit | unit | No | |
Temp_Unit_2 | unit | No | |
Temp_Unit_Pos | location | No | |
Temp_Unit_Pos_2 | location | No | |
TempLoc1 | location | No | |
TempLoc2 | location | No | |
Timer_GameState | timer | No | |
Timer_Income | timer | No | |
TIMERWINDOW_SummonLegion | timerdialog | No | |
TIMERWINDOW_TurnTimer | timerdialog | No | |
Tree_Destructible | destructable | No | |
TS | integervar | No | |
TS_Angle | real | Yes | |
TS_Boolean | boolean | Yes | |
TS_Caster | unit | Yes | |
TS_Damage | real | Yes | |
TS_Degrees | real | Yes | |
TS_Duration | real | Yes | |
TS_Group | group | No | |
TS_Index | integer | Yes | |
TS_NumE | integer | Yes | |
TS_Point | location | Yes | |
TS_Range | real | Yes | |
TS_Special1 | effect | Yes | |
TS_Special2 | effect | Yes | |
TS_Special3 | effect | Yes | |
TS_Victom | unit | Yes | |
UNIT_GROUP_ArthasExpedition | group | No | |
UNIT_GROUP_COTG_Unit_Group | group | No | |
UNIT_GROUP_EVENTS | group | No | |
UNIT_GROUP_GreaterSummoning | group | No | |
UNIT_GROUP_Hostile | group | No | |
UNIT_GROUP_Houndmasters_Pack | group | No | |
UNIT_GROUP_LightningElementals | group | No | |
UNIT_GROUP_NewCustomCooldown | group | No | |
UNIT_GROUP_SludgeBelcher | group | No | |
UNIT_GROUP_Spirit_Guard | group | No | |
UNIT_GROUP_WatcherBase | group | No |
function Trig_Multiboard_Func001002001 takes nothing returns boolean
return ( GetPlayerController(GetFilterPlayer()) == MAP_CONTROL_USER)
endfunction
function Trig_Multiboard_Remake_Actions takes nothing returns nothing
local multiboarditem mbitem = null
set udg_Temp_Player_Group = GetPlayersMatching(Condition(function Trig_Multiboard_Func001002001))
set udg_Temp_Integer = ( CountPlayersInForceBJ(udg_Temp_Player_Group) + 1 )
call ForceClear( udg_Temp_Player_Group )
set udg_MULTIBOARD_Leaderboard = CreateMultiboard()
call MultiboardSetRowCount(udg_MULTIBOARD_Leaderboard, udg_Temp_Integer)
call MultiboardSetColumnCount(udg_MULTIBOARD_Leaderboard, 3)
call MultiboardSetTitleText(udg_MULTIBOARD_Leaderboard, "Game Info | Win Condition: 150 Control Points")
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, 0, 0)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem, "Player Name")
call MultiboardSetItemWidth(mbitem, 14.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, 0, 1)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem, "Faction")
call MultiboardSetItemWidth(mbitem, 12.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, 0, 2)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem, "CPs")
call MultiboardSetItemWidth(mbitem, 5.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_Temp_Integer
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, bj_forLoopAIndex, 0)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem,"|cff00ff00"+I2S(bj_forLoopAIndex)+ ". "+GetPlayerName(Player(bj_forLoopAIndex - 1))+"|r")
call MultiboardSetItemWidth(mbitem, 14.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, bj_forLoopAIndex, 1)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem, "None")
call MultiboardSetItemWidth(mbitem, 12.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set mbitem = MultiboardGetItem(udg_MULTIBOARD_Leaderboard, bj_forLoopAIndex, 2)
call MultiboardSetItemStyle(mbitem, true, false)
call MultiboardSetItemValue(mbitem, "--")
call MultiboardSetItemWidth(mbitem, 5.00/100)
call MultiboardReleaseItem(mbitem)
set mbitem = null
set udg_Income_ControlPoints[(bj_forLoopAIndex - 1)] = 0
set udg_Income_Lumber[(bj_forLoopAIndex - 1)] = 0
call SetPlayerState(Player(bj_forLoopAIndex - 1), PLAYER_STATE_RESOURCE_GOLD, 1750)
call SetPlayerState(Player(bj_forLoopAIndex - 1), PLAYER_STATE_RESOURCE_LUMBER, 1250)
call ForceAddPlayer(udg_PLAYER_GROUP_Tips, Player(bj_forLoopAIndex - 1))
if ( GetPlayerController(Player(bj_forLoopAIndex - 1)) == MAP_CONTROL_USER ) then
call ForceAddPlayer(udg_PlayersActive, Player(bj_forLoopAIndex - 1))
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetForceAllianceStateBJ( udg_PlayersActive, udg_PlayersActive, bj_ALLIANCE_ALLIED )
call MultiboardDisplay( udg_MULTIBOARD_Leaderboard, true )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Multiboard_Remake takes nothing returns nothing
set gg_trg_Multiboard_Remake = CreateTrigger( )
call TriggerAddAction( gg_trg_Multiboard_Remake, function Trig_Multiboard_Remake_Actions )
endfunction
function Trig_Main_Path_Trigger_Actions takes nothing returns nothing
//All of the triggers used in here are in the events folder
if ( GetPlayerTechCountSimple('R003', GetTriggerPlayer()) == 1 ) then
// Humans
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Humans )
elseif ( GetPlayerTechCountSimple('R00A', GetTriggerPlayer()) == 1 ) then
// Orcs
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Orcs )
elseif ( GetPlayerTechCountSimple('R00B', GetTriggerPlayer()) == 1 ) then
// Undead
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Undead )
elseif ( GetPlayerTechCountSimple('R00C', GetTriggerPlayer()) == 1 ) then
// Night Elves - Sentinels
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Sentinels )
elseif ( GetPlayerTechCountSimple('R00D', GetTriggerPlayer()) == 1 ) then
// Night Elves - Druids
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Druids )
elseif ( GetPlayerTechCountSimple('R01G', GetTriggerPlayer()) == 1 ) then
// High Elves
call ConditionalTriggerExecute( gg_trg_Path_Trigger_High_Elves )
elseif ( GetPlayerTechCountSimple('R01V', GetTriggerPlayer()) == 1 ) then
// Naga
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Naga )
elseif ( GetPlayerTechCountSimple('R02D', GetTriggerPlayer()) == 1 ) then
// Demons
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Demons )
elseif ( GetPlayerTechCountSimple('R03S', GetTriggerPlayer()) == 1 ) then
// Nerubians
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Nerubians )
elseif ( GetPlayerTechCountSimple('R093', GetTriggerPlayer()) == 1 ) then
// Dragons
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Dragons )
elseif ( GetPlayerTechCountSimple('R09W', GetTriggerPlayer()) == 1 ) then
// Trolls
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Trolls )
elseif ( GetPlayerTechCountSimple('R08M', GetTriggerPlayer()) == 1 ) then
// Old Gods
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Old_God_Servants )
elseif ( GetPlayerTechCountSimple('R0BV', GetTriggerPlayer()) == 1 ) then
// Broken Ones
call ConditionalTriggerExecute( gg_trg_Path_Trigger_Broken_Ones )
endif
endfunction
//===========================================================================
function InitTrig_Main_Path_Trigger takes nothing returns nothing
set gg_trg_Main_Path_Trigger = CreateTrigger( )
call TriggerAddAction( gg_trg_Main_Path_Trigger, function Trig_Main_Path_Trigger_Actions )
endfunction
function Trig_Orc_Demolisher_Spawn_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetConstructedStructure()) == 'ogre' ) ) then
return false
endif
return true
endfunction
function Trig_Orc_Demolisher_Spawn_Actions takes nothing returns nothing
call CreateUnit(GetOwningPlayer(GetConstructedStructure()), 'h088', GetUnitX(GetConstructedStructure()), GetUnitY(GetConstructedStructure()), GetUnitFacing(GetConstructedStructure()))
endfunction
//===========================================================================
function InitTrig_Orc_Demolisher_Spawn takes nothing returns nothing
set gg_trg_Orc_Demolisher_Spawn = CreateTrigger( )
call TriggerAddCondition( gg_trg_Orc_Demolisher_Spawn, Condition( function Trig_Orc_Demolisher_Spawn_Conditions ) )
call TriggerAddAction( gg_trg_Orc_Demolisher_Spawn, function Trig_Orc_Demolisher_Spawn_Actions )
endfunction
function Trig_Nerub_Raise_Dead_Fix_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'uske' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetSummoningUnit()) == 'U014' ) ) then
return false
endif
return true
endfunction
function Trig_Nerub_Raise_Dead_Fix_Actions takes nothing returns nothing
call UnitRemoveAbility(GetSummonedUnit(), 'A16A')
endfunction
//===========================================================================
function InitTrig_Nerub_Raise_Dead_Fix takes nothing returns nothing
set gg_trg_Nerub_Raise_Dead_Fix = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerub_Raise_Dead_Fix, Condition( function Trig_Nerub_Raise_Dead_Fix_Conditions ) )
call TriggerAddAction( gg_trg_Nerub_Raise_Dead_Fix, function Trig_Nerub_Raise_Dead_Fix_Actions )
endfunction
function Trig_Burrow_Func004C takes nothing returns boolean
if (GetSpellAbilityId() == 'A01R') then
return true
endif
if (GetSpellAbilityId() == 'A046') then
return true
endif
if (GetSpellAbilityId() == 'A04V') then
return true
endif
if (GetSpellAbilityId() == 'A01Q') then
return true
endif
if (GetSpellAbilityId() == 'A04Y') then
return true
endif
if (GetSpellAbilityId() == 'A07K') then
return true
endif
return false
endfunction
function Trig_Burrow_Conditions takes nothing returns boolean
set bj_wantDestroyGroup = true
if (CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(GetSpellAbilityUnit())) == 0) then
return false
endif
if ( not Trig_Burrow_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Burrow_Actions takes nothing returns nothing
call UnitAddType(GetSpellAbilityUnit(), UNIT_TYPE_UNDEAD )
if(GetSpellAbilityId() == 'A04Y') then
call UnitAddAbility(GetSpellAbilityUnit(), 'Aap1' )
endif
endfunction
//===========================================================================
function InitTrig_Burrow takes nothing returns nothing
set gg_trg_Burrow = CreateTrigger( )
call TriggerAddCondition( gg_trg_Burrow, Condition( function Trig_Burrow_Conditions ) )
call TriggerAddAction( gg_trg_Burrow, function Trig_Burrow_Actions )
endfunction
function Trig_Nerubian_Warrior_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n014' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Warrior_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01L', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Warrior takes nothing returns nothing
set gg_trg_Nerubian_Warrior = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Warrior, Condition( function Trig_Nerubian_Warrior_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Warrior, function Trig_Nerubian_Warrior_Actions )
endfunction
function Trig_Nerubian_Hunter_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01V' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Hunter_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01M', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Hunter takes nothing returns nothing
set gg_trg_Nerubian_Hunter = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Hunter, Condition( function Trig_Nerubian_Hunter_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Hunter, function Trig_Nerubian_Hunter_Actions )
endfunction
function Trig_Nerubian_Crypt_Fiend_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n09N' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Crypt_Fiend_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'u02M', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Crypt_Fiend takes nothing returns nothing
set gg_trg_Nerubian_Crypt_Fiend = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Crypt_Fiend, Condition( function Trig_Nerubian_Crypt_Fiend_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Crypt_Fiend, function Trig_Nerubian_Crypt_Fiend_Actions )
endfunction
function Trig_Nerubian_Spiderlord_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01W' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Spiderlord_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('u012', GetOwningPlayer(GetTriggerUnit())) > 24 ) then
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD) + 240)
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER) + 70)
call TrueReplace( GetTriggerUnit(), 'n05Q', GetOwningPlayer(GetTriggerUnit()) )
set bj_lastReplacedUnit = null
else
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'u012', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Nerubian_Spiderlord takes nothing returns nothing
set gg_trg_Nerubian_Spiderlord = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Spiderlord, Condition( function Trig_Nerubian_Spiderlord_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Spiderlord, function Trig_Nerubian_Spiderlord_Actions )
endfunction
function Trig_Nerubian_Watcher_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01X' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Watcher_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01R', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Watcher takes nothing returns nothing
set gg_trg_Nerubian_Watcher = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Watcher, Condition( function Trig_Nerubian_Watcher_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Watcher, function Trig_Nerubian_Watcher_Actions )
endfunction
function Trig_Nerubian_Seer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01Y' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Seer_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01N', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Seer takes nothing returns nothing
set gg_trg_Nerubian_Seer = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Seer, Condition( function Trig_Nerubian_Seer_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Seer, function Trig_Nerubian_Seer_Actions )
endfunction
function Trig_Nerubian_Flyer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01Z' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Flyer_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_wantDestroyGroup = true
if (CountLivingPlayerUnitsOfTypeId('u00Z', GetOwningPlayer(GetTriggerUnit())) > 8) then
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD) + 185)
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER) + 30)
call TrueReplace( GetTriggerUnit(), 'n05V', GetOwningPlayer(GetTriggerUnit()) )
set bj_lastReplacedUnit = null
else
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'u00Z', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Nerubian_Flyer takes nothing returns nothing
set gg_trg_Nerubian_Flyer = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Flyer, Condition( function Trig_Nerubian_Flyer_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Flyer, function Trig_Nerubian_Flyer_Actions )
endfunction
function Trig_Nerubian_Burrower_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n022' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Burrower_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'u03F', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
call UnitAddAbility(bj_lastCreatedUnit, 'Aap1' )
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
call UnitRemoveAbility( bj_lastCreatedUnit, 'ARal' )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Burrower takes nothing returns nothing
set gg_trg_Nerubian_Burrower = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Burrower, Condition( function Trig_Nerubian_Burrower_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Burrower, function Trig_Nerubian_Burrower_Actions )
endfunction
function Trig_Nerubian_Webspinner_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01U' ) ) then
return false
endif
return true
endfunction
function Trig_Nerubian_Webspinner_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01P', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Nerubian_Webspinner takes nothing returns nothing
set gg_trg_Nerubian_Webspinner = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nerubian_Webspinner, Condition( function Trig_Nerubian_Webspinner_Conditions ) )
call TriggerAddAction( gg_trg_Nerubian_Webspinner, function Trig_Nerubian_Webspinner_Actions )
endfunction
function Trig_Fallen_Nerubian_Swarmlord_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n02P' ) ) then
return false
endif
return true
endfunction
function Trig_Fallen_Nerubian_Swarmlord_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_wantDestroyGroup = true
if (CountLivingPlayerUnitsOfTypeId('n020', GetOwningPlayer(GetTriggerUnit())) > 6) then
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_GOLD) + 350)
call SetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER, GetPlayerState(GetOwningPlayer(GetTriggerUnit()), PLAYER_STATE_RESOURCE_LUMBER) + 125)
call TrueReplace( GetTriggerUnit(), 'n05V', GetOwningPlayer(GetTriggerUnit()) )
set bj_lastReplacedUnit = null
else
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n020', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Fallen_Nerubian_Swarmlord takes nothing returns nothing
set gg_trg_Fallen_Nerubian_Swarmlord = CreateTrigger( )
call TriggerAddCondition( gg_trg_Fallen_Nerubian_Swarmlord, Condition( function Trig_Fallen_Nerubian_Swarmlord_Conditions ) )
call TriggerAddAction( gg_trg_Fallen_Nerubian_Swarmlord, function Trig_Fallen_Nerubian_Swarmlord_Actions )
endfunction
function Trig_Fallen_Nerubian_Necromancer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'n01T' ) ) then
return false
endif
return true
endfunction
function Trig_Fallen_Nerubian_Necromancer_Actions takes nothing returns nothing
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetTriggerUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetTriggerUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetTriggerUnit())
endif
set bj_lastCreatedEffect = AddSpecialEffect( "Objects\\Spawnmodels\\Demon\\DemonLargeDeathExplode\\DemonLargeDeathExplode.mdl", GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'n01J', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), GetUnitFacing(GetTriggerUnit()))
set bj_wantDestroyGroup = true
if (( CountLivingPlayerUnitsOfTypeId('h0DM', GetOwningPlayer(bj_lastCreatedUnit)) == 1 ) and (IsUnitType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD) != true)) then
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_UNDEAD)
endif
call RemoveUnit( GetTriggerUnit() )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X, udg_Coor_Y )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Fallen_Nerubian_Necromancer takes nothing returns nothing
set gg_trg_Fallen_Nerubian_Necromancer = CreateTrigger( )
call TriggerAddCondition( gg_trg_Fallen_Nerubian_Necromancer, Condition( function Trig_Fallen_Nerubian_Necromancer_Conditions ) )
call TriggerAddAction( gg_trg_Fallen_Nerubian_Necromancer, function Trig_Fallen_Nerubian_Necromancer_Actions )
endfunction
function Trig_Dragon_Whelp_Spawn_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0EG' ) ) then
return false
endif
return true
endfunction
function Trig_Dragon_Whelp_Spawn_Actions takes nothing returns nothing
call KillUnit( GetSpellAbilityUnit() )
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'nadw', GetUnitX(GetSpellAbilityUnit()), GetUnitY(GetSpellAbilityUnit()), GetUnitFacing(GetSpellAbilityUnit()))
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 45.00 )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Dragon_Whelp_Spawn takes nothing returns nothing
set gg_trg_Dragon_Whelp_Spawn = CreateTrigger( )
call TriggerAddCondition( gg_trg_Dragon_Whelp_Spawn, Condition( function Trig_Dragon_Whelp_Spawn_Conditions ) )
call TriggerAddAction( gg_trg_Dragon_Whelp_Spawn, function Trig_Dragon_Whelp_Spawn_Actions )
endfunction
function Trig_Valeera_to_KathraNatir_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'E00W' ) ) then
return false
endif
return true
endfunction
function Trig_Valeera_to_KathraNatir_Copy_Func001Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'E00Z' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0MY') == 0 ) then
call SelectHeroSkill( GetEnumUnit(), 'A0MY' )
endif
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0MY', 120.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_Valeera_to_KathraNatir_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0MY' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Valeera_to_KathraNatir_Copy_Func001Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_Valeera_to_KathraNatir takes nothing returns nothing
set gg_trg_Valeera_to_KathraNatir = CreateTrigger( )
call TriggerAddCondition( gg_trg_Valeera_to_KathraNatir, Condition( function Trig_Valeera_to_KathraNatir_Conditions ) )
call TriggerAddAction( gg_trg_Valeera_to_KathraNatir, function Trig_Valeera_to_KathraNatir_Actions )
endfunction
function Trig_KathraNatir_to_Valeera_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'E00Z' ) ) then
return false
endif
return true
endfunction
function Trig_KathraNatir_to_Valeera_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'E00W' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0MY') == 0 ) then
call SelectHeroSkill( GetEnumUnit(), 'A0MY' )
endif
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0MY', 120.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_KathraNatir_to_Valeera_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0MY' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_KathraNatir_to_Valeera_Func002Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_KathraNatir_to_Valeera takes nothing returns nothing
set gg_trg_KathraNatir_to_Valeera = CreateTrigger( )
call TriggerAddCondition( gg_trg_KathraNatir_to_Valeera, Condition( function Trig_KathraNatir_to_Valeera_Conditions ) )
call TriggerAddAction( gg_trg_KathraNatir_to_Valeera, function Trig_KathraNatir_to_Valeera_Actions )
endfunction
function Trig_Barean_to_MalGanis_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'H06S' ) ) then
return false
endif
return true
endfunction
function Trig_Barean_to_MalGanis_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'U02X' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0MY') == 0 ) then
call SelectHeroSkill( GetEnumUnit(), 'A0MY' )
endif
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0QZ', 120.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_Barean_to_MalGanis_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0QZ' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Barean_to_MalGanis_Func002Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_Barean_to_MalGanis takes nothing returns nothing
set gg_trg_Barean_to_MalGanis = CreateTrigger( )
call TriggerAddCondition( gg_trg_Barean_to_MalGanis, Condition( function Trig_Barean_to_MalGanis_Conditions ) )
call TriggerAddAction( gg_trg_Barean_to_MalGanis, function Trig_Barean_to_MalGanis_Actions )
endfunction
function Trig_MalGanis_to_Barean_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'U02X' ) ) then
return false
endif
return true
endfunction
function Trig_MalGanis_to_Barean_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'H06S' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0MY') == 0 ) then
call SelectHeroSkill( GetEnumUnit(), 'A0MY' )
else
endif
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0QZ', 120.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_MalGanis_to_Barean_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0QZ' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_MalGanis_to_Barean_Func002Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_MalGanis_to_Barean takes nothing returns nothing
set gg_trg_MalGanis_to_Barean = CreateTrigger( )
call TriggerAddCondition( gg_trg_MalGanis_to_Barean, Condition( function Trig_MalGanis_to_Barean_Conditions ) )
call TriggerAddAction( gg_trg_MalGanis_to_Barean, function Trig_MalGanis_to_Barean_Actions )
endfunction
function Trig_Broll_to_Bear_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'N05T' ) ) then
return false
endif
return true
endfunction
function Trig_Broll_to_Bear_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'N06Y' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0UW', 30.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Darksummoning\\DarkSummonTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_Broll_to_Bear_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0UW' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Broll_to_Bear_Func002Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_Broll_to_Bear takes nothing returns nothing
set gg_trg_Broll_to_Bear = CreateTrigger( )
call TriggerAddCondition( gg_trg_Broll_to_Bear, Condition( function Trig_Broll_to_Bear_Conditions ) )
call TriggerAddAction( gg_trg_Broll_to_Bear, function Trig_Broll_to_Bear_Actions )
endfunction
function Trig_Bear_to_Broll_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'N06Y' ) ) then
return false
endif
return true
endfunction
function Trig_Bear_to_Broll_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'N05T' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A0UW', 30.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * RMaxBJ(0,GetUnitLifePercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * RMaxBJ(0,GetUnitManaPercent(GetSpellAbilityUnit())) * 0.01)
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_Bear_to_Broll_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0UW' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Bear_to_Broll_Func002Func004A )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
//===========================================================================
function InitTrig_Bear_to_Broll takes nothing returns nothing
set gg_trg_Bear_to_Broll = CreateTrigger( )
call TriggerAddCondition( gg_trg_Bear_to_Broll, Condition( function Trig_Bear_to_Broll_Conditions ) )
call TriggerAddAction( gg_trg_Bear_to_Broll, function Trig_Bear_to_Broll_Actions )
endfunction
function Trig_Defiler_to_Destroyer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'Uwar' ) ) then
return false
endif
return true
endfunction
function Trig_Defiler_to_Destroyer_Func002Func004A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'U04H' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevel( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A14Z', 60.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitState( GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_LIFE) * GetUnitLifePercent(GetSpellAbilityUnit()))
call SetUnitState( GetEnumUnit(), UNIT_STATE_MANA, GetUnitState(GetEnumUnit(), UNIT_STATE_MAX_MANA) * GetUnitManaPercent(GetSpellAbilityUnit()))
call SetUnitPosition(GetEnumUnit(), GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 0))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 1))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 2))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 3))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 4))
call UnitAddItem(GetEnumUnit(), UnitItemInSlot(GetSpellAbilityUnit(), 5))
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
endif
endfunction
function Trig_Defiler_to_Destroyer_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A150' ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Defiler_to_Destroyer_Func002Func004A )
endif
endfunction
//===========================================================================
function InitTrig_Defiler_to_Destroyer takes nothing returns nothing
set gg_trg_Defiler_to_Destroyer = CreateTrigger( )
call TriggerAddCondition( gg_trg_Defiler_to_Destroyer, Condition( function Trig_Defiler_to_Destroyer_Conditions ) )
call TriggerAddAction( gg_trg_Defiler_to_Destroyer, function Trig_Defiler_to_Destroyer_Actions )
endfunction
function Trig_Destroyer_to_Defiler_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'U04H' ) ) then
return false
endif
return true
endfunction
function Trig_Destroyer_to_Defiler_Func001Func003A takes nothing returns nothing
if ( GetUnitTypeId(GetEnumUnit()) == 'Uwar' ) then
set udg_Temp_Integer = GetHeroLevel(GetSpellAbilityUnit())
call SetHeroLevelBJ( GetEnumUnit(), udg_Temp_Integer, false )
set udg_Temp_Integer = GetHeroXP(GetSpellAbilityUnit())
call SetHeroXP( GetEnumUnit(), udg_Temp_Integer, false )
call BlzStartUnitAbilityCooldown( GetEnumUnit(), 'A150', 60.00 )
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetSpellAbilityUnit()), true )
call SetUnitLifePercentBJ( GetEnumUnit(), GetUnitLifePercent(GetSpellAbilityUnit()) )
call SetUnitManaPercentBJ( GetEnumUnit(), GetUnitManaPercent(GetSpellAbilityUnit()) )
call SetUnitPositionLoc( GetEnumUnit(), udg_Temp_Unit_Pos )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 1), GetEnumUnit() )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 2), GetEnumUnit() )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 3), GetEnumUnit() )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 4), GetEnumUnit() )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 5), GetEnumUnit() )
call UnitAddItemSwapped( UnitItemInSlotBJ(GetSpellAbilityUnit(), 6), GetEnumUnit() )
call AddSpecialEffectLocBJ( udg_Temp_Unit_Pos, "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitOwner( GetSpellAbilityUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true )
call SetUnitPositionLoc( GetSpellAbilityUnit(), udg_PERM_POS_Center_Of_DummyRegion )
call RemoveLocation(udg_Temp_Unit_Pos)
endif
endfunction
function Trig_Destroyer_to_Defiler_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A14Z' ) then
set udg_Temp_Unit_Pos = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_Dummy_Region), function Trig_Destroyer_to_Defiler_Func001Func003A )
endif
endfunction
//===========================================================================
function InitTrig_Destroyer_to_Defiler takes nothing returns nothing
set gg_trg_Destroyer_to_Defiler = CreateTrigger( )
call TriggerAddCondition( gg_trg_Destroyer_to_Defiler, Condition( function Trig_Destroyer_to_Defiler_Conditions ) )
call TriggerAddAction( gg_trg_Destroyer_to_Defiler, function Trig_Destroyer_to_Defiler_Actions )
endfunction
function Trig_Druid_of_the_Claw_Bear_Limit_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'Abrf' ) then
return true
endif
return false
endfunction
function Trig_Druid_of_the_Claw_Bear_Limit_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('edcm', GetOwningPlayer(GetSpellAbilityUnit())) >= 13 ) then
call TrueReplace( GetTriggerUnit(), 'edoc', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Druid_of_the_Claw_Bear_Limit takes nothing returns nothing
set gg_trg_Druid_of_the_Claw_Bear_Limit = CreateTrigger( )
call TriggerAddCondition( gg_trg_Druid_of_the_Claw_Bear_Limit, Condition( function Trig_Druid_of_the_Claw_Bear_Limit_Conditions ) )
call TriggerAddAction( gg_trg_Druid_of_the_Claw_Bear_Limit, function Trig_Druid_of_the_Claw_Bear_Limit_Actions )
endfunction
function Trig_GuardianDruidLimitNew_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0VJ' ) then
return true
endif
return false
endfunction
function Trig_GuardianDruidLimitNew_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('e01O', GetOwningPlayer(GetSpellAbilityUnit())) >= 13 ) then
call TrueReplace( GetSpellAbilityUnit(), 'e01L', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_GuardianDruidLimitNew takes nothing returns nothing
set gg_trg_GuardianDruidLimitNew = CreateTrigger( )
call TriggerAddCondition( gg_trg_GuardianDruidLimitNew, Condition( function Trig_GuardianDruidLimitNew_Conditions ) )
call TriggerAddAction( gg_trg_GuardianDruidLimitNew, function Trig_GuardianDruidLimitNew_Actions )
endfunction
function Trig_Feral_Druid_Limit_New_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0VJ' ) then
return true
endif
return false
endfunction
function Trig_Feral_Druid_Limit_New_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('e01Q', GetOwningPlayer(GetSpellAbilityUnit())) >= 13 ) then
call TrueReplace( GetSpellAbilityUnit(), 'e01P', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Feral_Druid_Limit_New takes nothing returns nothing
set gg_trg_Feral_Druid_Limit_New = CreateTrigger( )
call TriggerAddCondition( gg_trg_Feral_Druid_Limit_New, Condition( function Trig_Feral_Druid_Limit_New_Conditions ) )
call TriggerAddAction( gg_trg_Feral_Druid_Limit_New, function Trig_Feral_Druid_Limit_New_Actions )
endfunction
function Trig_Balance_Druid_Limit_New_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0VJ' ) then
return true
endif
return false
endfunction
function Trig_Balance_Druid_Limit_New_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('e01N', GetOwningPlayer(GetSpellAbilityUnit())) >= 7 ) then
call TrueReplace( GetSpellAbilityUnit(), 'e01M', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Balance_Druid_Limit_New takes nothing returns nothing
set gg_trg_Balance_Druid_Limit_New = CreateTrigger( )
call TriggerAddCondition( gg_trg_Balance_Druid_Limit_New, Condition( function Trig_Balance_Druid_Limit_New_Conditions ) )
call TriggerAddAction( gg_trg_Balance_Druid_Limit_New, function Trig_Balance_Druid_Limit_New_Actions )
endfunction
function Trig_Druid_of_the_Talon_Talon_Limit_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'Arav' ) then
return true
endif
return false
endfunction
function Trig_Druid_of_the_Talon_Talon_Limit_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('edtm', GetOwningPlayer(GetSpellAbilityUnit())) >= 7 ) then
call TrueReplace( GetSpellAbilityUnit(), 'edot', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Druid_of_the_Talon_Talon_Limit takes nothing returns nothing
set gg_trg_Druid_of_the_Talon_Talon_Limit = CreateTrigger( )
call TriggerAddCondition( gg_trg_Druid_of_the_Talon_Talon_Limit, Condition( function Trig_Druid_of_the_Talon_Talon_Limit_Conditions ) )
call TriggerAddAction( gg_trg_Druid_of_the_Talon_Talon_Limit, function Trig_Druid_of_the_Talon_Talon_Limit_Actions )
endfunction
function Trig_Arcanist_Siege_Limit_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( GetSpellAbilityId() == 'A0FR' ) then
if ( CountLivingPlayerUnitsOfTypeId('h05H', GetOwningPlayer(GetSpellAbilityUnit())) >= 13 ) then
call TrueReplace( GetSpellAbilityUnit(), 'h03P', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endif
endfunction
//===========================================================================
function InitTrig_Arcanist_Siege_Limit takes nothing returns nothing
set gg_trg_Arcanist_Siege_Limit = CreateTrigger( )
call TriggerAddAction( gg_trg_Arcanist_Siege_Limit, function Trig_Arcanist_Siege_Limit_Actions )
endfunction
function Trig_Arcanist_Normal_Mode_Actions takes nothing returns nothing
if (GetUnitTypeId(GetSpellAbilityUnit()) == 'h05H') then
set bj_wantDestroyGroup = true
if ( (CountLivingPlayerUnitsOfTypeId('h03P', GetOwningPlayer(GetSpellAbilityUnit())) >= 13)) then
call TrueReplace( GetSpellAbilityUnit(), 'h05H', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endif
endfunction
//===========================================================================
function InitTrig_Arcanist_Normal_Mode takes nothing returns nothing
set gg_trg_Arcanist_Normal_Mode = CreateTrigger( )
call TriggerAddAction( gg_trg_Arcanist_Normal_Mode, function Trig_Arcanist_Normal_Mode_Actions )
endfunction
function Trig_Hyppo_Limit_Copy_Func001C takes nothing returns boolean
set bj_wantDestroyGroup = true
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ehpr' ) ) then
return false
endif
if ( not ( CountLivingPlayerUnitsOfTypeId('ehpr', GetOwningPlayer(GetEnteringUnit())) >= 9 ) ) then
return false
endif
return true
endfunction
function Trig_Hyppo_Limit_Copy_Func002C takes nothing returns boolean
set bj_wantDestroyGroup = true
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'e024' ) ) then
return false
endif
if ( not ( CountLivingPlayerUnitsOfTypeId('e024', GetOwningPlayer(GetEnteringUnit())) >= 9 ) ) then
return false
endif
return true
endfunction
function Trig_Hyppo_Limit_Copy_Func003C takes nothing returns boolean
set bj_wantDestroyGroup = true
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'e023' ) ) then
return false
endif
if ( not ( CountLivingPlayerUnitsOfTypeId('e023', GetOwningPlayer(GetEnteringUnit())) >= 9 ) ) then
return false
endif
return true
endfunction
function Trig_Hyppo_Limit_Copy_Func004C takes nothing returns boolean
set bj_wantDestroyGroup = true
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'e022' ) ) then
return false
endif
if ( not ( CountLivingPlayerUnitsOfTypeId('e022', GetOwningPlayer(GetEnteringUnit())) >= 9 ) ) then
return false
endif
return true
endfunction
function Trig_Hyppo_Limit_Actions takes nothing returns nothing
if ( IsUnitIllusion(GetEnteringUnit()) == false ) then
if ( Trig_Hyppo_Limit_Copy_Func001C() ) then
call RemoveUnit( GetEnteringUnit() )
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'earc', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'ehip', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
elseif ( Trig_Hyppo_Limit_Copy_Func002C() ) then
call RemoveUnit( GetEnteringUnit() )
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e01W', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e020', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
elseif ( Trig_Hyppo_Limit_Copy_Func003C() ) then
call RemoveUnit( GetEnteringUnit() )
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e01X', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e01Z', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
elseif ( Trig_Hyppo_Limit_Copy_Func004C() ) then
call RemoveUnit( GetEnteringUnit() )
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e021', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
call CreateUnit(GetOwningPlayer(GetEnteringUnit()), 'e01V', GetUnitX(GetEnteringUnit()), GetUnitY(GetEnteringUnit()), GetUnitFacing(GetEnteringUnit()))
endif
endif
endfunction
//===========================================================================
function InitTrig_Hyppo_Limit takes nothing returns nothing
set gg_trg_Hyppo_Limit = CreateTrigger( )
call TriggerAddAction( gg_trg_Hyppo_Limit, function Trig_Hyppo_Limit_Actions )
endfunction
function Trig_Ability_Instance_Correction_Condition takes nothing returns boolean
if ( GetSpellAbilityId() == 'A09T' ) then
return true
endif
if ( GetSpellAbilityId() == 'A0XF' ) then
return true
endif
if ( GetSpellAbilityId() == 'A08E' ) then
return true
endif
if ( GetSpellAbilityId() == 'A0DG' ) then
return true
endif
if ( GetSpellAbilityId() == 'A10S' ) then
return true
endif
return false
endfunction
function Trig_Ability_Instance_Correction_Func002C takes real x, real y returns boolean
if (((GetRectMinX(gg_rct_Starting_Region) <= x) and (x <= GetRectMaxX(gg_rct_Starting_Region)) and (GetRectMinY(gg_rct_Starting_Region) <= y) and (y <= GetRectMaxY(gg_rct_Starting_Region))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Naxxramas) <= x) and (x <= GetRectMaxX(gg_rct_Naxxramas)) and (GetRectMinY(gg_rct_Naxxramas) <= y) and (y <= GetRectMaxY(gg_rct_Naxxramas))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Acherus_Interior) <= x) and (x <= GetRectMaxX(gg_rct_Acherus_Interior)) and (GetRectMinY(gg_rct_Acherus_Interior) <= y) and (y <= GetRectMaxY(gg_rct_Acherus_Interior))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_New_Dalaran) <= x) and (x <= GetRectMaxX(gg_rct_New_Dalaran)) and (GetRectMinY(gg_rct_New_Dalaran) <= y) and (y <= GetRectMaxY(gg_rct_New_Dalaran))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Argus) <= x) and (x <= GetRectMaxX(gg_rct_Argus)) and (GetRectMinY(gg_rct_Argus) <= y) and (y <= GetRectMaxY(gg_rct_Argus))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Dummy_Region) <= x) and (x <= GetRectMaxX(gg_rct_Dummy_Region)) and (GetRectMinY(gg_rct_Dummy_Region) <= y) and (y <= GetRectMaxY(gg_rct_Dummy_Region))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Nylotha) <= x) and (x <= GetRectMaxX(gg_rct_Nylotha)) and (GetRectMinY(gg_rct_Nylotha) <= y) and (y <= GetRectMaxY(gg_rct_Nylotha))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_Emerald_Dream) <= x) and (x <= GetRectMaxX(gg_rct_Emerald_Dream)) and (GetRectMinY(gg_rct_Emerald_Dream) <= y) and (y <= GetRectMaxY(gg_rct_Emerald_Dream))) == true ) then
return true
endif
if (((GetRectMinX(gg_rct_CThun_Stomach) <= x) and (x <= GetRectMaxX(gg_rct_CThun_Stomach)) and (GetRectMinY(gg_rct_CThun_Stomach) <= y) and (y <= GetRectMaxY(gg_rct_CThun_Stomach))) == true ) then
return true
endif
return false
endfunction
function Trig_Ability_Instance_Correction_Actions takes nothing returns nothing
if ( Trig_Ability_Instance_Correction_Func002C(GetSpellTargetX(),GetSpellTargetY()) ) then
call PauseUnit(GetSpellAbilityUnit(), true )
call IssueImmediateOrder( GetSpellAbilityUnit(), "stop" )
call ForceAddPlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
call DisplayTextToForce( udg_Temp_Player_Group, "TRIGSTR_5335" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
call PauseUnit(GetSpellAbilityUnit(), false )
call BlzEndUnitAbilityCooldown( GetSpellAbilityUnit(), GetSpellAbilityId() )
endif
endfunction
//===========================================================================
function InitTrig_Ability_Instance_Correction takes nothing returns nothing
set gg_trg_Ability_Instance_Correction = CreateTrigger( )
call TriggerAddCondition( gg_trg_Ability_Instance_Correction, Condition( function Trig_Ability_Instance_Correction_Condition ) )
call TriggerAddAction( gg_trg_Ability_Instance_Correction, function Trig_Ability_Instance_Correction_Actions )
endfunction
function Trig_Mass_TP_Instance_Prevention_Condition takes nothing returns boolean
if ( GetSpellAbilityId() == 'A07S' ) then
return true
endif
if ( GetSpellAbilityId() == 'AHmt' ) then
return true
endif
if ( GetSpellAbilityId() == 'Almt' ) then
return true
endif
if ( GetSpellAbilityId() == 'A04W' ) then
return true
endif
if ( GetSpellAbilityId() == 'A0k2' ) then
return true
endif
if ( GetSpellAbilityId() == 'A0PV' ) then
return true
endif
if ( GetSpellAbilityId() == 'Altp' ) then
return true
endif
return false
endfunction
function Trig_Mass_TP_Instance_Prevention_Func002C takes real x, real y returns boolean
if (((GetRectMinX(gg_rct_CThun_Stomach) <= x) and (x <= GetRectMaxX(gg_rct_CThun_Stomach)) and (GetRectMinY(gg_rct_CThun_Stomach) <= y) and (y <= GetRectMaxY(gg_rct_CThun_Stomach))) == true ) then
return true
endif
return false
endfunction
function Trig_Mass_TP_Instance_Prevention_Actions takes nothing returns nothing
if ( Trig_Mass_TP_Instance_Prevention_Func002C(GetSpellTargetX(),GetSpellTargetY()) ) then
call PauseUnit(GetSpellAbilityUnit(), true )
call IssueImmediateOrder( GetSpellAbilityUnit(), "stop" )
call ForceAddPlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
call DisplayTextToForce( udg_Temp_Player_Group, "TRIGSTR_5335" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
call PauseUnit(GetSpellAbilityUnit(), false )
call BlzEndUnitAbilityCooldown( GetSpellAbilityUnit(), GetSpellAbilityId() )
endif
endfunction
//===========================================================================
function InitTrig_Mass_TP_Instance_Prevention takes nothing returns nothing
set gg_trg_Mass_TP_Instance_Prevention = CreateTrigger( )
call TriggerAddCondition( gg_trg_Mass_TP_Instance_Prevention, Condition( function Trig_Mass_TP_Instance_Prevention_Condition ) )
call TriggerAddAction( gg_trg_Mass_TP_Instance_Prevention, function Trig_Mass_TP_Instance_Prevention_Actions )
endfunction
function Trig_Flying_Fortress_Fix_Copy_Func001Func004C takes nothing returns boolean
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e00A' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e009' ) ) then
return true
endif
return false
endfunction
function Trig_Flying_Fortress_Fix_Copy_Func002Func004C takes nothing returns boolean
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e00F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e00G' ) ) then
return true
endif
return false
endfunction
function Trig_Flying_Fortress_Fix_Copy_Func003Func004C takes nothing returns boolean
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e00U' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetEnteringUnit()) == 'e00V' ) ) then
return true
endif
return false
endfunction
function Trig_Flying_Fortress_Fix_Actions takes nothing returns nothing
if ( Trig_Flying_Fortress_Fix_Copy_Func001Func004C() ) then
call ForceAddPlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call DisplayTextToForce( udg_Temp_Player_Group, "Flying Fortress Unit cannot enter into Flying Fortress Instance")
call ForceRemovePlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call SetUnitPosition( GetEnteringUnit(), GetRectCenterX(gg_rct_Dalaran_Out),GetRectCenterY(gg_rct_Dalaran_Out) )
elseif ( Trig_Flying_Fortress_Fix_Copy_Func002Func004C() ) then
call ForceAddPlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call DisplayTextToForce( udg_Temp_Player_Group, "Flying Fortress Unit cannot enter into Flying Fortress Instance")
call ForceRemovePlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call SetUnitPosition( GetEnteringUnit(), GetRectCenterX(gg_rct_Acherus_Out),GetRectCenterY(gg_rct_Acherus_Out) )
elseif ( Trig_Flying_Fortress_Fix_Copy_Func003Func004C() ) then
call ForceAddPlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call DisplayTextToForce( udg_Temp_Player_Group, "Flying Fortress Unit cannot enter into Flying Fortress Instance")
call ForceRemovePlayerSimple( GetOwningPlayer(GetEnteringUnit()), udg_Temp_Player_Group )
call SetUnitPosition( GetEnteringUnit(), GetRectCenterX(gg_rct_Naxxramas_Out),GetRectCenterY(gg_rct_Naxxramas_Out) )
endif
endfunction
//===========================================================================
function InitTrig_Flying_Fortress_Fix takes nothing returns nothing
set gg_trg_Flying_Fortress_Fix = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Flying_Fortress_Fix, gg_rct_New_Dalaran )
call TriggerRegisterEnterRectSimple( gg_trg_Flying_Fortress_Fix, gg_rct_Naxxramas )
call TriggerRegisterEnterRectSimple( gg_trg_Flying_Fortress_Fix, gg_rct_Acherus_Interior )
call TriggerAddAction( gg_trg_Flying_Fortress_Fix, function Trig_Flying_Fortress_Fix_Actions )
endfunction
function Trig_Unit_Death_Restoration_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) == 'cb00' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb01' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb02' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb03' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb04' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb05' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb06' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb07' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb08' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb09' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb10' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb11' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb12' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb13' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb14' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb15' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb16' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb17' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb18' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb19' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb20' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb21' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb22' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb23' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb24' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb25' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb26' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb27' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb28' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb29' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb30' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb31' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb32' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb33' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb34' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb35' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb36' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb37' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb38' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb39' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb40' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb41' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb42' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb43' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb44' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb45' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb46' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb47' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb48' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb49' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb50' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb51' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb52' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb53' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb54' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb55' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb56' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb57' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb58' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb59' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb60' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb61' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb62' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb63' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'cb64' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'nmoo' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'nbsm' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'h097' ) then
return true
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'h03T' ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03X' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h062' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h040' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o05C' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h043' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03U' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h0BV' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o036' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03Y' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03S' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o05E' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h05Y' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03W' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03V' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h011' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h0DA' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o05F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h001' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h03Z' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h005' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o04T' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h060' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h04I' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h042' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h061' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h041' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h05P' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h002' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o012' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o01B' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o00Z' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o011' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o013' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o02C' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o016' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o01J' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o018' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o019' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o002' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o003' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o01A' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o010' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o00Y' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o01I' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o000' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o001' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u001' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u01G' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'n02O' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'n02V' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'nfoh' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'nfrm' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'nzlc' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h055' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h0BQ' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h00R' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'h0B9' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'o079' ) ) then
return true
endif
return false
endfunction
function Trig_Unit_Death_Restoration_Actions takes nothing returns nothing
set udg_Temp_Unit = TrueReplace( GetDyingUnit(), GetUnitTypeId(GetDyingUnit()), GetOwningPlayer(GetKillingUnit()) )
if (( GetUnitTypeId(GetDyingUnit()) == 'h00R' ) and (udg_Temp_Unit == null)) then
call CreateUnit(GetOwningPlayer(GetKillingUnit()), 'h00R', GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()), GetUnitFacing(GetDyingUnit()))
endif
call ConditionalTriggerExecute( gg_trg_Unit_Death_Fix )
set bj_lastReplacedUnit = null
endfunction
//===========================================================================
function InitTrig_Unit_Death_Restoration takes nothing returns nothing
set gg_trg_Unit_Death_Restoration = CreateTrigger( )
call TriggerAddCondition( gg_trg_Unit_Death_Restoration, Condition( function Trig_Unit_Death_Restoration_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Death_Restoration, function Trig_Unit_Death_Restoration_Actions )
endfunction
function SunWellFix takes nothing returns boolean
if ( GetUnitTypeId(udg_Temp_Unit) == 'cb00' ) then
return true
endif
if ( GetUnitTypeId(udg_Temp_Unit) == 'cb01' ) then
return true
endif
return false
endfunction
function Trig_Unit_Death_Fix_Actions takes nothing returns nothing
if ( SunWellFix() ) then
set udg_SunWell = udg_Temp_Unit
endif
if ( GetUnitTypeId(udg_Temp_Unit) == 'o04T' ) then
call GroupAddUnitSimple( udg_Temp_Unit, udg_UNIT_GROUP_NewCustomCooldown )
endif
if ( GetUnitTypeId(udg_Temp_Unit) == 'o01J' ) then
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A13Y', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A13Y') )
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A13Z', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A13Z') )
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A13U', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A13U') )
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A036', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A036') )
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A141', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A141') )
call BlzStartUnitAbilityCooldown( udg_Temp_Unit, 'A140', BlzGetUnitAbilityCooldownRemaining(GetDyingUnit(), 'A140') )
endif
set udg_Temp_Unit = null
endfunction
//===========================================================================
function InitTrig_Unit_Death_Fix takes nothing returns nothing
set gg_trg_Unit_Death_Fix = CreateTrigger( )
call TriggerAddAction( gg_trg_Unit_Death_Fix, function Trig_Unit_Death_Fix_Actions )
endfunction
function Trig_Book_of_Medivh_Drop_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06X' ) ) then
return false
endif
return true
endfunction
function Trig_Book_of_Medivh_Drop_Actions takes nothing returns nothing
call CreateItem('I005',GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
call KillUnit( GetSpellAbilityUnit() )
call DisableTrigger( GetTriggeringTrigger() )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Book_of_Medivh_Drop takes nothing returns nothing
set gg_trg_Book_of_Medivh_Drop = CreateTrigger( )
call TriggerAddCondition( gg_trg_Book_of_Medivh_Drop, Condition( function Trig_Book_of_Medivh_Drop_Conditions ) )
call TriggerAddAction( gg_trg_Book_of_Medivh_Drop, function Trig_Book_of_Medivh_Drop_Actions )
endfunction
function Trig_Acolyte_Sacrifice_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A16B' ) then
return true
endif
return false
endfunction
function Trig_Acolyte_Sacrifice_Actions takes nothing returns nothing
call TrueReplace( GetSpellAbilityUnit(), 'ushd', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endfunction
//===========================================================================
function InitTrig_Acolyte_Sacrifice takes nothing returns nothing
set gg_trg_Acolyte_Sacrifice = CreateTrigger( )
call TriggerAddCondition( gg_trg_Acolyte_Sacrifice, Condition( function Trig_Acolyte_Sacrifice_Conditions ) )
call TriggerAddAction( gg_trg_Acolyte_Sacrifice, function Trig_Acolyte_Sacrifice_Actions )
endfunction
function Trig_Avatar_of_Light_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A18E' ) then
return true
endif
return false
endfunction
function Trig_Avatar_of_Light_Actions takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'h08V', GetUnitX(GetSpellAbilityUnit()), GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING)
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 7.50 )
call UnitAddAbility( bj_lastCreatedUnit,'A18F' )
call IssueTargetOrder( bj_lastCreatedUnit, "bloodlust", GetSpellAbilityUnit() )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Avatar_of_Light takes nothing returns nothing
set gg_trg_Avatar_of_Light = CreateTrigger( )
call TriggerAddCondition( gg_trg_Avatar_of_Light, Condition( function Trig_Avatar_of_Light_Conditions ) )
call TriggerAddAction( gg_trg_Avatar_of_Light, function Trig_Avatar_of_Light_Actions )
endfunction
function Trig_Arcane_Blast_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0GX' ) then
return true
endif
return false
endfunction
function Trig_Arcane_Blast_Actions takes nothing returns nothing
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0GX') == 1 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00N', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING)
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0GX') == 2 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00O', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING)
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0GX') == 3 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00D', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING)
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
endif
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Arcane_Blast takes nothing returns nothing
set gg_trg_Arcane_Blast = CreateTrigger( )
call TriggerAddCondition( gg_trg_Arcane_Blast, Condition( function Trig_Arcane_Blast_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Blast, function Trig_Arcane_Blast_Actions )
endfunction
function Trig_Arcane_Frost_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A197' ) then
return true
endif
return false
endfunction
function Trig_Arcane_Frost_Actions takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'h08V', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit, 'A16S')
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Arcane_Frost takes nothing returns nothing
set gg_trg_Arcane_Frost = CreateTrigger( )
call TriggerAddCondition( gg_trg_Arcane_Frost, Condition( function Trig_Arcane_Frost_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_Frost, function Trig_Arcane_Frost_Actions )
endfunction
function Trig_Aura_of_Madness_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetAttacker(), 'B05J') == true ) ) then
return false
endif
if ( not ( GetRandomReal(0, 1) >= 0.995 ) ) and ( not ( GetHeroLevel(GetAttacker()) >= 1 ) ) then
return false
endif
return true
endfunction
function Trig_Aura_of_Madness_Actions takes nothing returns nothing
call SetUnitOwner( GetAttacker(), Player(PLAYER_NEUTRAL_AGGRESSIVE), true )
endfunction
//===========================================================================
function InitTrig_Aura_of_Madness takes nothing returns nothing
set gg_trg_Aura_of_Madness = CreateTrigger( )
call TriggerAddCondition( gg_trg_Aura_of_Madness, Condition( function Trig_Aura_of_Madness_Conditions ) )
call TriggerAddAction( gg_trg_Aura_of_Madness, function Trig_Aura_of_Madness_Actions )
endfunction
function Trig_Blessed_Death_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A13C') then
return true
endif
return false
endfunction
function Trig_Blessed_Death_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( CountLivingPlayerUnitsOfTypeId('h06X', GetOwningPlayer(GetSpellAbilityUnit())) <= 24 ) then
call TrueReplace( GetSpellAbilityUnit(), 'h06X', GetOwningPlayer(GetSpellAbilityUnit()) )
endif
set bj_lastReplacedUnit = null
endfunction
//===========================================================================
function InitTrig_Blessed_Death takes nothing returns nothing
set gg_trg_Blessed_Death = CreateTrigger( )
call TriggerAddCondition( gg_trg_Blessed_Death, Condition( function Trig_Blessed_Death_Conditions ) )
call TriggerAddAction( gg_trg_Blessed_Death, function Trig_Blessed_Death_Actions )
endfunction
function Trig_Blood_Burn_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0O8' ) ) then
return false
endif
return true
endfunction
function Trig_Blood_Burn_Func_BuffCheck takes nothing returns boolean
return ((GetUnitAbilityLevel(GetFilterUnit(), 'B02I') > 0) == true )
endfunction
function Trig_Blood_Burn_Func002Func002A takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'B02I' )
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00N', GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.25 )
call IssueTargetOrder( bj_lastCreatedUnit, "soulburn", GetEnumUnit() )
set bj_lastCreatedUnit = null
endfunction
function Trig_Blood_Burn_Func003Func002B takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'B02I' )
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00O', GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.25 )
call IssueTargetOrder( bj_lastCreatedUnit, "soulburn", GetEnumUnit() )
set bj_lastCreatedUnit = null
endfunction
function Trig_Blood_Burn_Func004Func002C takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'B02I' )
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00D', GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.25 )
call IssueTargetOrder( bj_lastCreatedUnit, "soulburn", GetEnumUnit() )
set bj_lastCreatedUnit = null
endfunction
function Trig_Blood_Burn_Actions takes nothing returns nothing
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0O8') == 1 ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Blood_Burn_Func_BuffCheck)), function Trig_Blood_Burn_Func002Func002A )
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0O8') == 2) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Blood_Burn_Func_BuffCheck)), function Trig_Blood_Burn_Func003Func002B )
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0O8') == 3 ) then
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Blood_Burn_Func_BuffCheck)), function Trig_Blood_Burn_Func004Func002C )
endif
endfunction
//===========================================================================
function InitTrig_Blood_Burn takes nothing returns nothing
set gg_trg_Blood_Burn = CreateTrigger( )
call TriggerAddCondition( gg_trg_Blood_Burn, Condition( function Trig_Blood_Burn_Conditions ) )
call TriggerAddAction( gg_trg_Blood_Burn, function Trig_Blood_Burn_Actions )
endfunction
function Trig_Burrow_Rush_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A12V' ) then
return true
endif
return false
endfunction
function Trig_Burrow_Rush_Actions takes nothing returns nothing
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'n00N', GetUnitX(GetSpellAbilityUnit()), GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 7.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_Burrow_Rush takes nothing returns nothing
set gg_trg_Burrow_Rush = CreateTrigger( )
call TriggerAddCondition( gg_trg_Burrow_Rush, Condition( function Trig_Burrow_Rush_Conditions ) )
call TriggerAddAction( gg_trg_Burrow_Rush, function Trig_Burrow_Rush_Actions )
endfunction
function Chamber_Of_Corruption_Conditions takes nothing returns boolean
if (GetUnitTypeId(GetKillingUnit()) == 'u02S') then
return true
endif
return false
endfunction
function Chamber_Of_Corruption_Actions takes nothing returns nothing
local integer temp = 1
local integer tempf
local integer foodcap = Min(GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_FOOD_CAP), 300) - GetPlayerState(GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_FOOD_USED)
set udg_Coor_X = GetLocationX(GetUnitRallyPoint(GetKillingUnit()))
call ForceClear( udg_Temp_Player_Group )
call ForceAddPlayer(udg_Temp_Player_Group, GetOwningPlayer(GetKillingUnit()))
if (udg_Coor_X == 0) then
set udg_Coor_X = GetUnitX(GetKillingUnit())
endif
set udg_Coor_Y = GetLocationY(GetUnitRallyPoint(GetKillingUnit()))
if (udg_Coor_Y == 0) then
set udg_Coor_Y = GetUnitY(GetKillingUnit())
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'u02V' ) then
if( foodcap >= 2) then
set temp = GetRandomInt(0,1)
if ( temp == 0 ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o06D', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y )
set bj_lastCreatedUnit = null
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
else
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o06C', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
endif
endif
endif
if (foodcap >= 4) then
set tempf = 2
elseif (foodcap >= 2) then
set tempf = 1
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'n06N' ) then
set temp = GetRandomInt(0,1)
if (temp == 0) then
loop
set tempf = tempf - 1
exitwhen tempf < 0
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o06A', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
endloop
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
else
loop
set tempf = tempf - 1
exitwhen tempf < 0
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o06B', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
endloop
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()), 1.00 )
return
endif
endif
if (foodcap >= 6 and (GetPlayerTechCount( GetOwningPlayer(GetDyingUnit()),'R0CT', true) == 1) ) then
set tempf = 3
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'h0AQ' ) then
set temp = GetRandomInt(0,1)
if (temp == 0) then
loop
set tempf = tempf - 1
exitwhen tempf < 0
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o069', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y )
set bj_lastCreatedUnit = null
endloop
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()), 1.00 )
return
else
loop
set tempf = tempf - 1
exitwhen tempf < 0
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o068', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y )
set bj_lastCreatedUnit = null
endloop
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Corruption Complete!|r" )
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()), 1.00 )
return
endif
endif
//Drone - h025
//Lord - o02N
//Wasp - n065
//Crawler - o037
//Prophet - o07A
if ( GetUnitTypeId(GetDyingUnit()) == 'h025' ) then
set temp = GetRandomInt(0,4)
if (temp == 1) and (foodcap >= 5) and ( (CountLivingPlayerUnitsOfTypeId('o02N', GetOwningPlayer(GetKillingUnit()))) < 12) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o02N', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
elseif (temp == 2) and (foodcap >= 5) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o07A', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
elseif (temp == 3) and (foodcap >= 3) and ( (CountLivingPlayerUnitsOfTypeId('n065', GetOwningPlayer(GetKillingUnit()))) < 24) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'n065', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
elseif (foodcap >= 3) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'o037', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
else
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'h025', GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), bj_UNIT_FACING )
call IssuePointOrder( bj_lastCreatedUnit, "attack", udg_Coor_X,udg_Coor_Y)
set bj_lastCreatedUnit = null
call DisplayTextToForce( udg_Temp_Player_Group, "|cffffcc00Supply is full!|r")
call PingMinimapForPlayer(GetOwningPlayer(GetKillingUnit()), GetUnitX(GetKillingUnit()),GetUnitY(GetKillingUnit()), 1.00 )
return
endif
endif
if (CountLivingPlayerUnitsOfTypeId('h024', GetOwningPlayer(GetDyingUnit())) == 1) then
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Chamber of Corruption can only corrupt Vek'nis Drones!|r" )
else
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Chamber of Corruption can only corrupt Brother, Initiate and Beckoner units!|r" )
endif
call ForceClear( udg_Temp_Player_Group )
call ForceRemovePlayer(udg_Temp_Player_Group,GetOwningPlayer(GetKillingUnit()))
endfunction
//===========================================================================
function InitTrig_Chamber_Of_Corruption takes nothing returns nothing
set gg_trg_Chamber_Of_Corruption = CreateTrigger()
call TriggerAddCondition( gg_trg_Chamber_Of_Corruption, Condition( function Chamber_Of_Corruption_Conditions ) )
call TriggerAddAction( gg_trg_Chamber_Of_Corruption, function Chamber_Of_Corruption_Actions )
endfunction
function Trig_Chains_of_Domination_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A16A' ) then
return true
endif
return false
endfunction
function Trig_Chains_of_Domination_Actions takes nothing returns nothing
local integer foodcap = Min(GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_CAP),300) - GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_USED)
if ( (GetUnitTypeId(GetSpellAbilityUnit()) == 'uske') and (foodcap > 0) ) then
call TrueReplace( GetSpellAbilityUnit(), 'u04K', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
elseif ( (GetUnitTypeId(GetSpellAbilityUnit()) == 'nska') and (foodcap > 1) ) then
call TrueReplace( GetSpellAbilityUnit(), 'n08J', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
elseif ( (GetUnitTypeId(GetSpellAbilityUnit()) == 'uskm' ) and (foodcap > 1) ) then
call TrueReplace( GetSpellAbilityUnit(), 'u04L', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
elseif ( (GetUnitTypeId(GetSpellAbilityUnit()) == 'nsko' ) and (foodcap > 2) ) then
call TrueReplace( GetSpellAbilityUnit(), 'n08I', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
else
call SetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD, GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD) + 100)
call ForceAddPlayer(udg_Temp_Player_Group, GetOwningPlayer(GetSpellAbilityUnit()))
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Warning:|rYou do not have enough food to upgrade this unit!" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
set bj_lastPlayedSound = CreateSound("gg_snd_Error", false, false, true, 12700, 12700, "")
call StartSound(bj_lastPlayedSound)
call KillSoundWhenDone( bj_lastPlayedSound )
set bj_lastPlayedSound = null
endif
endfunction
//===========================================================================
function InitTrig_Chains_of_Domination takes nothing returns nothing
set gg_trg_Chains_of_Domination = CreateTrigger( )
call TriggerAddCondition( gg_trg_Chains_of_Domination, Condition( function Trig_Chains_of_Domination_Conditions ) )
call TriggerAddAction( gg_trg_Chains_of_Domination, function Trig_Chains_of_Domination_Actions )
endfunction
function Trig_Children_of_the_Grave_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A09C' ) then
return true
endif
return false
endfunction
function Trig_Children_of_the_Grave_Func005001003 takes nothing returns boolean
return ((GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) <= 0) == true )
endfunction
function Trig_Children_of_the_Grave_Func005A takes nothing returns nothing
if ( udg_Temp_Integer <= 50) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'uske', GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'Brai', 45.00 )
call UnitAddType( bj_lastCreatedUnit, UNIT_TYPE_SUMMONED )
set bj_lastCreatedEffect = AddSpecialEffect( "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastCreatedUnit = null
endif
set udg_Temp_Integer = ( udg_Temp_Integer + 1 )
endfunction
function Trig_Children_of_the_Grave_Actions takes nothing returns nothing
set udg_Temp_Unit_Pos = GetUnitLoc(GetSpellAbilityUnit())
set udg_Temp_Integer = 0
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocMatching(800.00, udg_Temp_Unit_Pos, Condition(function Trig_Children_of_the_Grave_Func005001003)), function Trig_Children_of_the_Grave_Func005A )
call RemoveLocation(udg_Temp_Unit_Pos)
endfunction
//===========================================================================
function InitTrig_Children_of_the_Grave takes nothing returns nothing
set gg_trg_Children_of_the_Grave = CreateTrigger( )
call TriggerAddCondition( gg_trg_Children_of_the_Grave, Condition( function Trig_Children_of_the_Grave_Conditions ) )
call TriggerAddAction( gg_trg_Children_of_the_Grave, function Trig_Children_of_the_Grave_Actions )
endfunction
function Trig_Corpse_Summoning_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0ME' ) then
return true
endif
return false
endfunction
function Trig_Corpse_Summoning_Actions takes nothing returns nothing
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetSpellTargetX() + GetRandomReal(-5,5),GetSpellTargetY()+ GetRandomReal(-5,5),GetRandomReal(0,360))
endfunction
//===========================================================================
function InitTrig_Corpse_Summoning takes nothing returns nothing
set gg_trg_Corpse_Summoning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Corpse_Summoning, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Corpse_Summoning, Condition( function Trig_Corpse_Summoning_Conditions ) )
call TriggerAddAction( gg_trg_Corpse_Summoning, function Trig_Corpse_Summoning_Actions )
endfunction
function Trig_Corpse_Summon_Wraith_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A0OU' ) then
return true
endif
return false
endfunction
function Trig_Corpse_Summon_Wraith_Actions takes nothing returns nothing
set udg_Temp_Integer = ( R2I(GetUnitState(GetSpellAbilityUnit(), UNIT_STATE_MANA)) / 50 )
loop
set udg_Temp_Integer = udg_Temp_Integer - 1
exitwhen udg_Temp_Integer < 1
call CreateCorpse(GetOwningPlayer(GetSpellAbilityUnit()), 'hfoo', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()),bj_UNIT_FACING)
endloop
call KillUnit(GetSpellAbilityUnit())
endfunction
//===========================================================================
function InitTrig_Corpse_Summon_Wraith takes nothing returns nothing
set gg_trg_Corpse_Summon_Wraith = CreateTrigger( )
call TriggerAddCondition( gg_trg_Corpse_Summon_Wraith, Condition( function Trig_Corpse_Summon_Wraith_Conditions ) )
call TriggerAddAction( gg_trg_Corpse_Summon_Wraith, function Trig_Corpse_Summon_Wraith_Actions )
endfunction
function Trig_Destroyer_Form_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'Aave' ) then
return true
endif
return false
endfunction
function Trig_Destroyer_Form_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( (CountLivingPlayerUnitsOfTypeId('ubsp', GetOwningPlayer(GetSpellAbilityUnit()))) > 6) then
call ReplaceUnitBJ( GetSpellAbilityUnit(), 'u013', bj_UNIT_STATE_METHOD_RELATIVE )
call ForceAddPlayer(udg_Temp_Player_Group ,GetOwningPlayer(GetSpellAbilityUnit()))
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Maximum number of Destroyers reached!|r" )
call ForceRemovePlayer( udg_Temp_Player_Group, GetOwningPlayer(GetSpellAbilityUnit()) )
endif
endfunction
//===========================================================================
function InitTrig_Destroyer_Form takes nothing returns nothing
set gg_trg_Destroyer_Form = CreateTrigger( )
call TriggerAddCondition( gg_trg_Destroyer_Form, Condition( function Trig_Destroyer_Form_Conditions ) )
call TriggerAddAction( gg_trg_Destroyer_Form, function Trig_Destroyer_Form_Actions )
endfunction
function Trig_Fel_Reaver_Reconstruction_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A13M' ) then
return true
endif
return false
endfunction
function Trig_Fel_Reaver_Reconstruction_Actions takes nothing returns nothing
call ReviveHero( udg_Legion_Heroes[1], GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), true )
call RemoveUnit( GetSpellAbilityUnit())
endfunction
//===========================================================================
function InitTrig_Fel_Reaver_Reconstruction takes nothing returns nothing
set gg_trg_Fel_Reaver_Reconstruction = CreateTrigger( )
call TriggerAddCondition( gg_trg_Fel_Reaver_Reconstruction, Condition( function Trig_Fel_Reaver_Reconstruction_Conditions ) )
call TriggerAddAction( gg_trg_Fel_Reaver_Reconstruction, function Trig_Fel_Reaver_Reconstruction_Actions )
endfunction
function Trig_For_the_Fel_Horde_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0PH' ) then
return true
endif
return false
endfunction
function Trig_For_the_Fel_Horde_Func003Func003A takes nothing returns nothing
if ( GetOwningPlayer(GetEnumUnit()) == GetOwningPlayer(GetSpellAbilityUnit()) ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00N', GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 7.50 )
call IssueTargetOrder( bj_lastCreatedUnit, "bloodlust", GetEnumUnit() )
set bj_lastCreatedUnit = null
endif
endfunction
function Trig_For_the_Fel_Horde_Func004Func003A takes nothing returns nothing
if ( GetOwningPlayer(GetEnumUnit()) == GetOwningPlayer(GetSpellAbilityUnit()) ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00O', GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 7.50 )
call IssueTargetOrder( bj_lastCreatedUnit, "bloodlust", GetEnumUnit() )
set bj_lastCreatedUnit = null
endif
endfunction
function Trig_For_the_Fel_Horde_Func005Func003A takes nothing returns nothing
if ( GetOwningPlayer(GetEnumUnit()) == GetOwningPlayer(GetSpellAbilityUnit()) ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00D', GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 7.50 )
call IssueTargetOrder( bj_lastCreatedUnit, "bloodlust", GetEnumUnit() )
set bj_lastCreatedUnit = null
endif
endfunction
function Trig_For_the_Fel_Horde_Actions takes nothing returns nothing
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0PH') == 1 ) then
set udg_Temp_Unit_Pos = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(600.00, udg_Temp_Unit_Pos), function Trig_For_the_Fel_Horde_Func003Func003A )
call RemoveLocation(udg_Temp_Unit_Pos)
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0PH') == 2 ) then
set udg_Temp_Unit_Pos = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(600.00, udg_Temp_Unit_Pos), function Trig_For_the_Fel_Horde_Func004Func003A )
call RemoveLocation(udg_Temp_Unit_Pos)
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0PH') == 3 ) then
set udg_Temp_Unit_Pos = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(600.00, udg_Temp_Unit_Pos), function Trig_For_the_Fel_Horde_Func005Func003A )
call RemoveLocation(udg_Temp_Unit_Pos)
endif
endfunction
//===========================================================================
function InitTrig_For_the_Fel_Horde takes nothing returns nothing
set gg_trg_For_the_Fel_Horde = CreateTrigger( )
call TriggerAddCondition( gg_trg_For_the_Fel_Horde, Condition( function Trig_For_the_Fel_Horde_Conditions ) )
call TriggerAddAction( gg_trg_For_the_Fel_Horde, function Trig_For_the_Fel_Horde_Actions )
endfunction
function Trig_Frozen_Heart_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A16C' ) then
return true
endif
return false
endfunction
function Trig_Frozen_Heart_Func002C takes nothing returns boolean
local integer foodcap = Min(GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_CAP),300) - GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_USED)
set bj_wantDestroyGroup = true
if ( not ( CountLivingPlayerUnitsOfTypeId('ufro', GetOwningPlayer(GetSpellAbilityUnit())) <= 4 ) ) then
return false
endif
if ( not ( foodcap > 6) ) then
return false
endif
return true
endfunction
function Trig_Frozen_Heart_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( Trig_Frozen_Heart_Func002C() ) then
call TrueReplace( GetSpellAbilityUnit(), 'ufro', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
else
call ForceAddPlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()),udg_Temp_Player_Group)
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Warning:|rYou do not have enough food to upgrade this unit!" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
set bj_lastPlayedSound = CreateSound("gg_snd_Error", false, false, true, 12700, 12700, "")
call StartSound(bj_lastPlayedSound)
call KillSoundWhenDone( bj_lastPlayedSound )
set bj_lastPlayedSound = null
endif
endfunction
//===========================================================================
function InitTrig_Frozen_Heart takes nothing returns nothing
set gg_trg_Frozen_Heart = CreateTrigger( )
call TriggerAddCondition( gg_trg_Frozen_Heart, Condition( function Trig_Frozen_Heart_Conditions ) )
call TriggerAddAction( gg_trg_Frozen_Heart, function Trig_Frozen_Heart_Actions )
endfunction
function Trig_Fel_Evolution_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A148' ) then
return true
endif
return false
endfunction
function Trig_Fel_Evolution_Func020A takes nothing returns nothing
call GroupRemoveUnit(udg_UNIT_GROUP_Houndmasters_Pack, GetEnumUnit() )
call TrueReplace(GetEnumUnit(), 'n080', GetOwningPlayer(GetSpellAbilityUnit()))
call UnitAddType(bj_lastReplacedUnit, UNIT_TYPE_SUMMONED )
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl", GetUnitX(bj_lastReplacedUnit) ,GetUnitY(bj_lastReplacedUnit) )
call DestroyEffect( bj_lastCreatedEffect)
call UnitApplyTimedLife( bj_lastReplacedUnit, 'BTLF', 10.00 )
set bj_lastCreatedEffect = null
set bj_lastReplacedUnit = null
endfunction
function Trig_Fel_Evolution_Actions takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n07Z', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
call GroupAddUnit(udg_UNIT_GROUP_Houndmasters_Pack, bj_lastCreatedUnit )
set bj_lastCreatedUnit = null
call ForGroupBJ( udg_UNIT_GROUP_Houndmasters_Pack, function Trig_Fel_Evolution_Func020A )
endfunction
//===========================================================================
function InitTrig_Fel_Evolution takes nothing returns nothing
set gg_trg_Fel_Evolution = CreateTrigger( )
call TriggerAddCondition( gg_trg_Fel_Evolution, Condition( function Trig_Fel_Evolution_Conditions ) )
call TriggerAddAction( gg_trg_Fel_Evolution, function Trig_Fel_Evolution_Actions )
endfunction
function Trig_HerociS_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0WT' ) then
return true
endif
return false
endfunction
function Trig_HerociS_Actions takes nothing returns nothing
call KillUnit( GetTriggerUnit() )
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'h0CM', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call IssueImmediateOrder( bj_lastCreatedUnit, "resurrection" )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BHwe', 2.00 )
set bj_lastCreatedUnit = null
endfunction
//===========================================================================
function InitTrig_HerociS takes nothing returns nothing
set gg_trg_HerociS = CreateTrigger( )
call TriggerAddCondition( gg_trg_HerociS, Condition( function Trig_HerociS_Conditions ) )
call TriggerAddAction( gg_trg_HerociS, function Trig_HerociS_Actions )
endfunction
function Trig_Idol_of_Madness_Start_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A1DC' ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_Start_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'n09Q', GetOwningPlayer(GetSpellAbilityUnit()), GetSpellTargetLoc(), bj_UNIT_FACING )
set udg_IdolOfMadness_U = GetLastCreatedUnit()
call UnitAddTypeBJ( UNIT_TYPE_SUMMONED, GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( ( 5.00 + ( 5.00 * udg_Real[GetUnitAbilityLevelSwapped('A1DC', GetSpellAbilityUnit())] ) ), 'BTLF', GetLastCreatedUnit() )
call EnableTrigger( gg_trg_Idol_of_Madness_Real )
call EnableTrigger( gg_trg_Idol_of_Madness_Spawn )
call EnableTrigger( gg_trg_Idol_of_Madness_Time )
call EnableTrigger( gg_trg_Idol_of_Madness_End )
call StartTimerBJ( udg_IdolOfMadness_T, false, 5.00 )
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_Start takes nothing returns nothing
set gg_trg_Idol_of_Madness_Start = CreateTrigger( )
call TriggerAddCondition( gg_trg_Idol_of_Madness_Start, Condition( function Trig_Idol_of_Madness_Start_Conditions ) )
call TriggerAddAction( gg_trg_Idol_of_Madness_Start, function Trig_Idol_of_Madness_Start_Actions )
endfunction
function Trig_Idol_of_Madness_Time_Actions takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A1DF', udg_IdolOfMadness_U )
call UnitAddAbilityBJ( 'A1DE', udg_IdolOfMadness_U )
call DisableTrigger( gg_trg_Idol_of_Madness_Real )
call EnableTrigger( gg_trg_Idol_of_Madness_DoT_and_HoT )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_Time takes nothing returns nothing
set gg_trg_Idol_of_Madness_Time = CreateTrigger( )
call DisableTrigger( gg_trg_Idol_of_Madness_Time )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Idol_of_Madness_Time, udg_IdolOfMadness_T )
call TriggerAddAction( gg_trg_Idol_of_Madness_Time, function Trig_Idol_of_Madness_Time_Actions )
endfunction
function Trig_Idol_of_Madness_Real_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(BlzGetEventDamageTarget(), 'B05M') == true ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_Real_Func002C takes nothing returns boolean
if ( not ( GetPlayerTechCountSimple('R07G', GetOwningPlayer(udg_IdolOfMadness_U)) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_Real_Actions takes nothing returns nothing
set udg_IdolOfMadness_R1 = ( udg_IdolOfMadness_R1 + GetEventDamage() )
if ( Trig_Idol_of_Madness_Real_Func002C() ) then
set udg_IdolOfMadness_R2 = ( udg_IdolOfMadness_R2 + GetEventDamage() )
else
endif
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_Real takes nothing returns nothing
set gg_trg_Idol_of_Madness_Real = CreateTrigger( )
call DisableTrigger( gg_trg_Idol_of_Madness_Real )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Idol_of_Madness_Real, EVENT_PLAYER_UNIT_DAMAGED )
call TriggerAddCondition( gg_trg_Idol_of_Madness_Real, Condition( function Trig_Idol_of_Madness_Real_Conditions ) )
call TriggerAddAction( gg_trg_Idol_of_Madness_Real, function Trig_Idol_of_Madness_Real_Actions )
endfunction
function Trig_Idol_of_Madness_Spawn_Actions takes nothing returns nothing
set udg_IdolOfMadness_R2 = 0.00
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(udg_IdolOfMadness_U),'n059',GetUnitX(udg_IdolOfMadness_U), GetUnitY(udg_IdolOfMadness_U), bj_UNIT_FACING )
call UnitRemoveAbility(bj_lastCreatedUnit, 'A1AB')
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 60.00)
call IssueImmediateOrder(bj_lastCreatedUnit, "locustswarm")
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_Spawn takes nothing returns nothing
set gg_trg_Idol_of_Madness_Spawn = CreateTrigger( )
call DisableTrigger( gg_trg_Idol_of_Madness_Spawn )
call TriggerRegisterVariableEvent( gg_trg_Idol_of_Madness_Spawn, "udg_IdolOfMadness_R2", GREATER_THAN_OR_EQUAL, 400.00 )
call TriggerAddAction( gg_trg_Idol_of_Madness_Spawn, function Trig_Idol_of_Madness_Spawn_Actions )
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001001003001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001001003002 takes nothing returns boolean
return ( UnitHasBuffBJ(GetFilterUnit(), 'B05L') == true )
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Idol_of_Madness_DoT_and_HoT_Func001001003001(), Trig_Idol_of_Madness_DoT_and_HoT_Func001001003002() )
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001Func001Func001C takes nothing returns boolean
if ( not ( IsUnitAlly(GetEnumUnit(), GetOwningPlayer(udg_HERO_CThun)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(udg_HERO_CThun)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Func001A takes nothing returns nothing
if ( Trig_Idol_of_Madness_DoT_and_HoT_Func001Func001C() ) then
call UnitDamageTargetBJ( udg_IdolOfMadness_U, GetEnumUnit(), ( ( 0.10 + ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A1DC', udg_HERO_CThun)) ) ) * udg_IdolOfMadness_R1 ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
else
if ( Trig_Idol_of_Madness_DoT_and_HoT_Func001Func001Func001C() ) then
call SetUnitLifeBJ( GetEnumUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetEnumUnit()) + ( ( 0.17 + ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A1DC', udg_HERO_CThun)) ) ) * udg_IdolOfMadness_R1 ) ) )
else
call DoNothing( )
endif
endif
endfunction
function Trig_Idol_of_Madness_DoT_and_HoT_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(udg_IdolOfMadness_U), Condition(function Trig_Idol_of_Madness_DoT_and_HoT_Func001001003)), function Trig_Idol_of_Madness_DoT_and_HoT_Func001A )
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_DoT_and_HoT takes nothing returns nothing
set gg_trg_Idol_of_Madness_DoT_and_HoT = CreateTrigger( )
call DisableTrigger( gg_trg_Idol_of_Madness_DoT_and_HoT )
call TriggerRegisterTimerEventPeriodic( gg_trg_Idol_of_Madness_DoT_and_HoT, 1.00 )
call TriggerAddAction( gg_trg_Idol_of_Madness_DoT_and_HoT, function Trig_Idol_of_Madness_DoT_and_HoT_Actions )
endfunction
function Trig_Idol_of_Madness_End_Conditions takes nothing returns boolean
if ( not ( GetDyingUnit() == udg_IdolOfMadness_U ) ) then
return false
endif
return true
endfunction
function Trig_Idol_of_Madness_End_Actions takes nothing returns nothing
call DisableTrigger( gg_trg_Idol_of_Madness_DoT_and_HoT )
call DisableTrigger( gg_trg_Idol_of_Madness_Real )
call DisableTrigger( gg_trg_Idol_of_Madness_Spawn )
call DisableTrigger( gg_trg_Idol_of_Madness_Time )
set udg_IdolOfMadness_U = null
set udg_IdolOfMadness_R1 = 0.00
set udg_IdolOfMadness_R2 = 0.00
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Idol_of_Madness_End takes nothing returns nothing
set gg_trg_Idol_of_Madness_End = CreateTrigger( )
call DisableTrigger( gg_trg_Idol_of_Madness_End )
call TriggerAddCondition( gg_trg_Idol_of_Madness_End, Condition( function Trig_Idol_of_Madness_End_Conditions ) )
call TriggerAddAction( gg_trg_Idol_of_Madness_End, function Trig_Idol_of_Madness_End_Actions )
endfunction
function Trig_Mass_Hex_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0XJ' ) then
return true
endif
return false
endfunction
function Trig_Mass_Hex_Func003A takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit( GetTriggerPlayer(), 'h0CQ', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 2.00 )
call IssueTargetOrder( bj_lastCreatedUnit, "hex", GetEnumUnit())
set bj_lastCreatedUnit = null
endfunction
function Trig_Mass_Hex_Actions takes nothing returns nothing
set udg_TargetLoc = GetSpellTargetLoc()
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(600.00, udg_TargetLoc), function Trig_Mass_Hex_Func003A )
call RemoveLocation(udg_TargetLoc)
endfunction
//===========================================================================
function InitTrig_Mass_Hex takes nothing returns nothing
set gg_trg_Mass_Hex = CreateTrigger( )
call TriggerAddCondition( gg_trg_Mass_Hex, Condition( function Trig_Mass_Hex_Conditions ) )
call TriggerAddAction( gg_trg_Mass_Hex, function Trig_Mass_Hex_Actions )
endfunction
function Trig_Meteor_Step_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0N1' ) then
return true
endif
return false
endfunction
function Trig_Meteor_Step_Actions takes nothing returns nothing
if ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0N1') == 1 ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00N', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
set bj_lastCreatedUnit = null
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0N1') == 2 ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00O', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
set bj_lastCreatedUnit = null
elseif ( GetUnitAbilityLevel(GetSpellAbilityUnit(), 'A0N1') == 3 ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'n00D', GetSpellTargetX(), GetSpellTargetY(), bj_UNIT_FACING )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 3.50 )
call IssueImmediateOrder( bj_lastCreatedUnit, "stomp" )
call SetUnitPosition( GetSpellAbilityUnit(), GetSpellTargetX(), GetSpellTargetY())
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Meteor_Step takes nothing returns nothing
set gg_trg_Meteor_Step = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Meteor_Step, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Meteor_Step, Condition( function Trig_Meteor_Step_Conditions ) )
call TriggerAddAction( gg_trg_Meteor_Step, function Trig_Meteor_Step_Actions )
endfunction
function Trig_Naishas_Moon_Glaive_Conditions takes nothing returns boolean
if ( GetLearnedSkill() == 'A0ER' ) then
return true
endif
return false
endfunction
function Trig_Naishas_Moon_Glaive_Actions takes nothing returns nothing
call SetPlayerTechResearched( GetOwningPlayer(GetTriggerUnit()),'R074', GetUnitAbilityLevel(GetTriggerUnit(),'A0ER') )
endfunction
//===========================================================================
function InitTrig_Naishas_Moon_Glaive takes nothing returns nothing
set gg_trg_Naishas_Moon_Glaive = CreateTrigger( )
call TriggerAddCondition( gg_trg_Naishas_Moon_Glaive, Condition( function Trig_Naishas_Moon_Glaive_Conditions ) )
call TriggerAddAction( gg_trg_Naishas_Moon_Glaive, function Trig_Naishas_Moon_Glaive_Actions )
endfunction
function Trig_Nightmare_Form_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A051' ) then
return true
endif
return false
endfunction
function Trig_Nightmare_Form_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
if ( (CountLivingPlayerUnitsOfTypeId('e02C', GetOwningPlayer(GetSpellAbilityUnit()))) > 15) then
call ReplaceUnitBJ( GetSpellAbilityUnit(), 'o06D', bj_UNIT_STATE_METHOD_RELATIVE )
call ForceAddPlayer(udg_Temp_Player_Group ,GetOwningPlayer(GetSpellAbilityUnit()))
call DisplayTextToForce( udg_Temp_Player_Group, "|cffff0000Maximum number of Winged Nightmares reached!|r" )
call ForceRemovePlayer( udg_Temp_Player_Group, GetOwningPlayer(GetSpellAbilityUnit()) )
endif
endfunction
//===========================================================================
function InitTrig_Nightmare_Form takes nothing returns nothing
set gg_trg_Nightmare_Form = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nightmare_Form, Condition( function Trig_Nightmare_Form_Conditions ) )
call TriggerAddAction( gg_trg_Nightmare_Form, function Trig_Nightmare_Form_Actions )
endfunction
function Trig_Promote_Actions takes nothing returns nothing
//Base Promotion
if (GetSpellAbilityId() == 'A0XP' ) then
if ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) then
call TrueReplace( GetSpellAbilityUnit(), 'h0CF', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
elseif ( GetUnitTypeId(GetTriggerUnit()) == 'n001' ) then
call TrueReplace( GetSpellAbilityUnit(), 'n075', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
//Advanced Promotion
elseif (GetSpellAbilityId() == 'A0XR' ) then
if ( GetUnitTypeId(GetTriggerUnit()) == 'h0CF' ) then
call TrueReplace( GetSpellAbilityUnit(), 'h0CR', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
elseif ( GetUnitTypeId(GetTriggerUnit()) == 'n075' ) then
call TrueReplace( GetSpellAbilityUnit(), 'n078', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
// Holy Training
elseif (GetSpellAbilityId() == 'A0XS') then
if ( GetUnitTypeId(GetTriggerUnit()) == 'h0CF' ) then
call TrueReplace( GetSpellAbilityUnit(), 'h0CS', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
// Arablaster Training
elseif (GetSpellAbilityId() == 'A0XV') then
if ( GetUnitTypeId(GetTriggerUnit()) == 'n076' ) then
call TrueReplace( GetSpellAbilityUnit(), 'n077', GetOwningPlayer(GetSpellAbilityUnit()) )
set bj_lastReplacedUnit = null
endif
endif
endfunction
//===========================================================================
function InitTrig_Promote takes nothing returns nothing
set gg_trg_Promote = CreateTrigger( )
call TriggerAddAction( gg_trg_Promote, function Trig_Promote_Actions )
endfunction
function Trig_Raise_Meat_Golem_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A193' ) then
return true
endif
return false
endfunction
function Trig_Raise_Meat_Golem_Actions takes nothing returns nothing
call TrueReplace( GetSpellAbilityUnit(), 'u01A', GetOwningPlayer(GetSpellAbilityUnit()) )
call UnitApplyTimedLife(bj_lastReplacedUnit, 'BTLF', 120.00 )
set bj_lastReplacedUnit = null
endfunction
//===========================================================================
function InitTrig_Raise_Meat_Golem takes nothing returns nothing
set gg_trg_Raise_Meat_Golem = CreateTrigger( )
call TriggerAddCondition( gg_trg_Raise_Meat_Golem, Condition( function Trig_Raise_Meat_Golem_Conditions ) )
call TriggerAddAction( gg_trg_Raise_Meat_Golem, function Trig_Raise_Meat_Golem_Actions )
endfunction
function Trig_Relentless_Storm_Func003C takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'AOcl' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A0RD' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A00L' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A15U' ) ) then
return true
endif
if ( ( GetSpellAbilityId() == 'A0RC' ) ) then
return true
endif
return false
endfunction
function Trig_Relentless_Storm_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A0H4', GetSpellAbilityUnit()) == 1 ) ) then
return false
endif
if ( not Trig_Relentless_Storm_Func003C() ) then
return false
endif
return true
endfunction
function Trig_Relentless_Storm_Func001C takes nothing returns boolean
if ( not ( GetRandomInt(1, 2) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Relentless_Storm_Actions takes nothing returns nothing
if ( Trig_Relentless_Storm_Func001C() ) then
call UnitResetCooldown( GetSpellAbilityUnit() )
else
endif
endfunction
//===========================================================================
function InitTrig_Relentless_Storm takes nothing returns nothing
set gg_trg_Relentless_Storm = CreateTrigger( )
call TriggerAddCondition( gg_trg_Relentless_Storm, Condition( function Trig_Relentless_Storm_Conditions ) )
call TriggerAddAction( gg_trg_Relentless_Storm, function Trig_Relentless_Storm_Actions )
endfunction
function Trig_Reanimate_Ability_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0LK' ) then
return true
elseif ( GetSpellAbilityId() == 'A0LP' ) then
return true
elseif ( GetSpellAbilityId() == 'A0YO' ) then
return true
endif
return false
endfunction
function Trig_Reanimate_Ability_Actions takes nothing returns nothing
if ( IsUnitType(GetSpellTargetUnit(), UNIT_TYPE_PEON) == true ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'nzom',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
else
if ( GetUnitPointValue(GetSpellTargetUnit()) == 0 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'uske',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 1 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'nska',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 2 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'nsko',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 3 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'uskm',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 4 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'uban',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 5 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'ugho',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 6 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'ucry',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
elseif ( GetUnitPointValue(GetSpellTargetUnit()) == 7 ) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'uabo',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()), bj_UNIT_FACING )
call RemoveUnit( GetSpellTargetUnit() )
endif
endif
call UnitAddType(bj_lastCreatedUnit, UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 45.00 * I2R(GetUnitAbilityLevel(GetSpellAbilityUnit(),GetSpellAbilityId())))
call SetUnitAnimation( bj_lastCreatedUnit, "birth" )
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl", GetUnitX(bj_lastCreatedUnit), GetUnitY(bj_lastCreatedUnit) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedUnit = null
set bj_lastCreatedEffect = null
endfunction
//===========================================================================
function InitTrig_Reanimate_Ability takes nothing returns nothing
set gg_trg_Reanimate_Ability = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reanimate_Ability, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Reanimate_Ability, Condition( function Trig_Reanimate_Ability_Conditions ) )
call TriggerAddAction( gg_trg_Reanimate_Ability, function Trig_Reanimate_Ability_Actions )
endfunction
function Trig_Revive_Renault_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A17U' ) then
return true
endif
return false
endfunction
function Trig_Revive_Renault_Actions takes nothing returns nothing
if ( (GetUnitState(udg_HERO_Renault, UNIT_STATE_LIFE) <= 0) == true ) then
call ReviveHero( udg_HERO_Renault, GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), true )
call ForceAddPlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()),udg_Temp_Player_Group)
call DisplayTextToForce( udg_Temp_Player_Group, "TRIGSTR_13952" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
else
call ForceAddPlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()),udg_Temp_Player_Group)
call DisplayTextToForce( udg_Temp_Player_Group, "TRIGSTR_14141" )
call ForceRemovePlayerSimple( GetOwningPlayer(GetSpellAbilityUnit()), udg_Temp_Player_Group )
call BlzEndUnitAbilityCooldown( GetSpellAbilityUnit(), GetSpellAbilityId() )
endif
endfunction
//===========================================================================
function InitTrig_Revive_Renault takes nothing returns nothing
set gg_trg_Revive_Renault = CreateTrigger( )
call TriggerAddCondition( gg_trg_Revive_Renault, Condition( function Trig_Revive_Renault_Conditions ) )
call TriggerAddAction( gg_trg_Revive_Renault, function Trig_Revive_Renault_Actions )
endfunction
function Trig_Renaults_Holy_Nova_Conditions takes nothing returns boolean
if ( GetLearnedSkill() == 'A184' ) then
return true
endif
return false
endfunction
function Trig_Renaults_Holy_Nova_Actions takes nothing returns nothing
call SetPlayerTechResearched(GetOwningPlayer(GetTriggerUnit()) ,'R0C9', GetUnitAbilityLevel(GetTriggerUnit(),'A184'))
endfunction
//===========================================================================
function InitTrig_Renaults_Holy_Nova takes nothing returns nothing
set gg_trg_Renaults_Holy_Nova = CreateTrigger( )
call TriggerAddCondition( gg_trg_Renaults_Holy_Nova, Condition( function Trig_Renaults_Holy_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Renaults_Holy_Nova, function Trig_Renaults_Holy_Nova_Actions )
endfunction
function Trig_Spirit_Guard_Wolf_Spirit_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) == 'Naka' ) then
return true
endif
return false
endfunction
function Trig_Spirit_Guard_Wolf_Spirit_Actions takes nothing returns nothing
if ( IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetAttacker())) == true ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetAttacker()), 'o05K', GetUnitX(GetAttacker()),GetUnitY(GetAttacker()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Spirit_Guard_Wolf_Spirit takes nothing returns nothing
set gg_trg_Spirit_Guard_Wolf_Spirit = CreateTrigger( )
call TriggerAddCondition( gg_trg_Spirit_Guard_Wolf_Spirit, Condition( function Trig_Spirit_Guard_Wolf_Spirit_Conditions ) )
call TriggerAddAction( gg_trg_Spirit_Guard_Wolf_Spirit, function Trig_Spirit_Guard_Wolf_Spirit_Actions )
endfunction
function Trig_Spirit_Guard_Ability_Summon_Conditions takes nothing returns boolean
if (GetUnitTypeId(GetSpellAbilityUnit()) == 'Naka') then
return true
endif
return false
endfunction
function Trig_Spirit_Guard_Ability_Summon_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0MZ' ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
elseif ( GetSpellAbilityId() == 'A0U5' ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
elseif ( GetSpellAbilityId() == 'A13H' ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
endif
endfunction
//===========================================================================
function InitTrig_Spirit_Guard_Ability_Summon takes nothing returns nothing
set gg_trg_Spirit_Guard_Ability_Summon = CreateTrigger( )
call TriggerAddCondition( gg_trg_Spirit_Guard_Ability_Summon, Condition( function Trig_Spirit_Guard_Ability_Summon_Conditions ) )
call TriggerAddAction( gg_trg_Spirit_Guard_Ability_Summon, function Trig_Spirit_Guard_Ability_Summon_Actions )
endfunction
function Trig_Spirit_Guard_Dire_Awakening_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) == 'o05K' ) then
return true
endif
return false
endfunction
function Trig_Spirit_Guard_Dire_Awakening_Actions takes nothing returns nothing
set udg_Temp_Integer = GetRandomInt(1, 10)
if ( udg_Temp_Integer == 1 ) then
call GroupRemoveUnit(udg_UNIT_GROUP_Spirit_Guard, GetAttacker() )
call TrueReplace( GetAttacker(), 'o05L', GetOwningPlayer(GetAttacker()))
call SetUnitVertexColor( bj_lastReplacedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife(bj_lastReplacedUnit,'BTLF', 10.00)
call UnitAddType( bj_lastReplacedUnit,UNIT_TYPE_SUMMONED )
set bj_lastCreatedEffect = AddSpecialEffect( "Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",GetUnitX(GetAttacker()),GetUnitY(GetAttacker()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastReplacedUnit = null
else
endif
endfunction
//===========================================================================
function InitTrig_Spirit_Guard_Dire_Awakening takes nothing returns nothing
set gg_trg_Spirit_Guard_Dire_Awakening = CreateTrigger( )
call TriggerAddCondition( gg_trg_Spirit_Guard_Dire_Awakening, Condition( function Trig_Spirit_Guard_Dire_Awakening_Conditions ) )
call TriggerAddAction( gg_trg_Spirit_Guard_Dire_Awakening, function Trig_Spirit_Guard_Dire_Awakening_Actions )
endfunction
function Trig_AncestorsCall_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A13J' ) then
return true
endif
return false
endfunction
function Trig_AncestorsCall_Func020A takes nothing returns nothing
call GroupRemoveUnit(udg_UNIT_GROUP_Spirit_Guard, GetEnumUnit() )
call TrueReplace( GetEnumUnit(), 'o05L', GetOwningPlayer(GetEnumUnit()))
call SetUnitVertexColor( bj_lastReplacedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife(bj_lastReplacedUnit,'BTLF', 10.00)
call UnitAddType( bj_lastReplacedUnit,UNIT_TYPE_SUMMONED )
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
set bj_lastReplacedUnit = null
endfunction
function Trig_AncestorsCall_Actions takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50)
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50)
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'o05K', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call GroupAddUnit( udg_UNIT_GROUP_Spirit_Guard, bj_lastCreatedUnit )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call SetUnitVertexColor( bj_lastCreatedUnit, 100, 100, 100, 50 )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 10.00 )
set bj_lastCreatedUnit = null
call ForGroupBJ( udg_UNIT_GROUP_Spirit_Guard, function Trig_AncestorsCall_Func020A )
endfunction
//===========================================================================
function InitTrig_AncestorsCall takes nothing returns nothing
set gg_trg_AncestorsCall = CreateTrigger( )
call TriggerAddCondition( gg_trg_AncestorsCall, Condition( function Trig_AncestorsCall_Conditions ) )
call TriggerAddAction( gg_trg_AncestorsCall, function Trig_AncestorsCall_Actions )
endfunction
function Trig_Sacrifice_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A00D' ) then
return true
endif
if ( GetSpellAbilityId() == 'A06K' ) then
return true
endif
return false
endfunction
function Trig_Sacrifice_Actions takes nothing returns nothing
call KillUnit( GetSpellAbilityUnit() )
call CreateDestructable( 'ATtr', GetUnitX(GetSpellAbilityUnit()), GetUnitY(GetSpellAbilityUnit()), GetRandomReal(0, 360), GetRandomReal(0.80, 1.00), GetRandomInt(1, 10) )
call SetTerrainType(GetUnitX(GetSpellAbilityUnit()), GetUnitY(GetSpellAbilityUnit()), 'Lgrs', -1, 1, 0 )
endfunction
//===========================================================================
function InitTrig_Sacrifice takes nothing returns nothing
set gg_trg_Sacrifice = CreateTrigger( )
call TriggerAddCondition( gg_trg_Sacrifice, Condition( function Trig_Sacrifice_Conditions ) )
call TriggerAddAction( gg_trg_Sacrifice, function Trig_Sacrifice_Actions )
endfunction
function Trig_Selling_Binding_Totems_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A0MX' ) then
return true
endif
return false
endfunction
function Trig_Selling_Binding_Totems_Actions takes nothing returns nothing
if (GetUnitTypeId(GetSpellAbilityUnit()) == 'h00M') then
call AdjustPlayerStateBJ( 400, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 200, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
elseif (GetUnitTypeId(GetSpellAbilityUnit()) == 'h00H') then
call AdjustPlayerStateBJ( 750, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 400, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
elseif (GetUnitTypeId(GetSpellAbilityUnit()) == 'h00K') then
call AdjustPlayerStateBJ( 1000, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 750, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
elseif (GetUnitTypeId(GetSpellAbilityUnit()) == 'h00O') then
call AdjustPlayerStateBJ( 1000, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 550, GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_LUMBER )
endif
call RemoveUnit( GetSpellAbilityUnit() )
endfunction
//===========================================================================
function InitTrig_Selling_Binding_Totems takes nothing returns nothing
set gg_trg_Selling_Binding_Totems = CreateTrigger( )
call TriggerAddCondition( gg_trg_Selling_Binding_Totems, Condition( function Trig_Selling_Binding_Totems_Conditions ) )
call TriggerAddAction( gg_trg_Selling_Binding_Totems, function Trig_Selling_Binding_Totems_Actions )
endfunction
function Trig_Sunwell_Ping_Func003A takes nothing returns nothing
call ForceClear( udg_Temp_Player_Group )
call ForceAddPlayer(udg_Temp_Player_Group, GetOwningPlayer(GetSpellAbilityUnit()))
if ( IsUnitLoaded(GetEnumUnit()) == true ) then
call PingMinimapForForce( udg_Temp_Player_Group, GetUnitX(GetTransportUnit()), GetUnitY(GetTransportUnit()), 3.00 )
else
call PingMinimapForForce( udg_Temp_Player_Group, GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), 3.00 )
endif
call ForceClear( udg_Temp_Player_Group )
call GroupClear( udg_SunwellRemnant )
endfunction
function Trig_Sunwell_Ping_Actions takes nothing returns nothing
if ( GetSpellAbilityId() == 'A0HT' ) then
set udg_SunwellRemnant = GetUnitsOfTypeIdAll('h00R')
if (IsUnitGroupEmptyBJ(udg_SunwellRemnant) == true) then
call GroupClear( udg_SunwellRemnant )
set udg_Temp_Integer = GetRandomInt(1, 9)
if ( udg_Temp_Integer == 1 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Exodar_Spawn)
elseif ( udg_Temp_Integer == 2 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_NylothaToHalls)
elseif ( udg_Temp_Integer == 3 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Dalaran_Ruins_Spawn)
elseif ( udg_Temp_Integer == 4 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Dire_Maul_Spawn)
elseif ( udg_Temp_Integer == 5 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Teldrassil_Spawn)
elseif ( udg_Temp_Integer == 6 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Onslaught_Harbor_Spawn_Region)
elseif ( udg_Temp_Integer == 7 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Remenant_Outland_Spawn)
elseif ( udg_Temp_Integer == 8 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Suramar_Spawn)
elseif ( udg_Temp_Integer == 9 ) then
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Blasted_Lands_Spawn)
endif
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),'h00R',GetLocationX(udg_Temp_Unit_Pos),GetLocationY(udg_Temp_Unit_Pos), bj_UNIT_FACING )
set udg_SunwellRemnant = GetUnitsOfTypeIdAll('h00R')
call RemoveLocation(udg_Temp_Unit_Pos)
call ForGroupBJ( udg_SunwellRemnant, function Trig_Sunwell_Ping_Func003A )
else
call ForGroupBJ( udg_SunwellRemnant, function Trig_Sunwell_Ping_Func003A )
endif
endif
endfunction
//===========================================================================
function InitTrig_Sunwell_Ping takes nothing returns nothing
set gg_trg_Sunwell_Ping = CreateTrigger( )
call TriggerAddAction( gg_trg_Sunwell_Ping, function Trig_Sunwell_Ping_Actions )
endfunction
function Trig_Strike_of_the_Necropolis_Skeletons_Conditions takes nothing returns boolean
if (IsUnitType(GetDyingUnit(), UNIT_TYPE_STRUCTURE) == true) then
return false
endif
if (GetUnitTypeId(GetKillingUnit()) != 'n04X') then
return false
endif
return true
endfunction
function Trig_Strike_of_the_Necropolis_Skeletons_Func001Func009C takes nothing returns boolean
if ( GetUnitTypeId(GetDyingUnit()) != 'uske' ) then
return true
elseif ( GetUnitTypeId(GetDyingUnit()) != 'uskm' ) then
return true
elseif ( GetUnitTypeId(GetDyingUnit()) != 'nsko' ) then
return true
elseif ( GetUnitTypeId(GetDyingUnit()) != 'nska' ) then
return true
elseif ( GetUnitTypeId(GetDyingUnit()) != 'n005' ) then
return true
endif
return false
endfunction
function Trig_Strike_of_the_Necropolis_Skeletons_Actions takes nothing returns nothing
if ( Trig_Strike_of_the_Necropolis_Skeletons_Func001Func009C() ) then
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetKillingUnit()), 'uske', GetUnitX(GetDyingUnit()),GetUnitY(GetDyingUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit, UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 60.00 )
set bj_lastCreatedUnit = null
set bj_lastCreatedEffect = AddSpecialEffect( "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl",GetUnitX(GetDyingUnit()),GetUnitY(GetDyingUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
//===========================================================================
function InitTrig_Strike_of_the_Necropolis_Skeletons takes nothing returns nothing
set gg_trg_Strike_of_the_Necropolis_Skeletons = CreateTrigger( )
call TriggerAddCondition( gg_trg_Strike_of_the_Necropolis_Skeletons, Condition( function Trig_Strike_of_the_Necropolis_Skeletons_Conditions ) )
call TriggerAddAction( gg_trg_Strike_of_the_Necropolis_Skeletons, function Trig_Strike_of_the_Necropolis_Skeletons_Actions )
endfunction
function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0OE' ) then
return true
endif
return false
endfunction
function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Func002A takes nothing returns nothing
if ( (GetUnitTypeId(GetEnumUnit()) == 'H0BC') or (GetUnitTypeId(GetEnumUnit()) == 'H0BA') ) then
call SetUnitAnimation( GetEnumUnit(), "channel" )
call PauseUnit( GetEnumUnit(),true )
endif
endfunction
function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Func002A )
endfunction
//===========================================================================
function InitTrig_Strike_of_the_Necropolis_Blood_Prince_Heroes takes nothing returns nothing
set gg_trg_Strike_of_the_Necropolis_Blood_Prince_Heroes = CreateTrigger( )
call TriggerAddCondition( gg_trg_Strike_of_the_Necropolis_Blood_Prince_Heroes, Condition( function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Conditions ) )
call TriggerAddAction( gg_trg_Strike_of_the_Necropolis_Blood_Prince_Heroes, function Trig_Strike_of_the_Necropolis_Blood_Prince_Heroes_Actions )
endfunction
function Trig_Twilight_Dream_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0GP' ) then
return true
endif
return false
endfunction
function Trig_Twilight_Dream_Damage takes nothing returns nothing
if ( (GetUnitAbilityLevel(GetEnumUnit(), 'B01K') > 0) == true ) then
call UnitDamageTarget( GetSpellAbilityUnit(), GetEnumUnit(), 50.00 * I2R(GetUnitAbilityLevel( GetSpellAbilityUnit(),'A0GP')),true,false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endif
endfunction
function Trig_Twilight_Dream_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Twilight_Dream_Damage )
endfunction
//===========================================================================
function InitTrig_Twilight_Dream takes nothing returns nothing
set gg_trg_Twilight_Dream = CreateTrigger( )
call TriggerAddCondition( gg_trg_Twilight_Dream, Condition( function Trig_Twilight_Dream_Conditions ) )
call TriggerAddAction( gg_trg_Twilight_Dream, function Trig_Twilight_Dream_Actions )
endfunction
function Trig_Walker_Awakening_Conditions takes nothing returns boolean
if ( GetSpellAbilityId() == 'A0TA' ) then
return true
endif
return false
endfunction
function Trig_Walker_Awakening_Actions takes nothing returns nothing
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'e000', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 30.00 )
call UnitAddAbility( bj_lastCreatedUnit,'Aeat' )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit( GetOwningPlayer(GetSpellAbilityUnit()), 'e000', GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()), bj_UNIT_FACING )
call UnitAddType( bj_lastCreatedUnit,UNIT_TYPE_SUMMONED )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 30.00 )
call UnitAddAbility( bj_lastCreatedUnit,'Aeat' )
set bj_lastCreatedUnit = null
set bj_lastCreatedEffect = AddSpecialEffect( "Abilities\\Spells\\Items\\RitualDagger\\RitualDaggerTarget.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endfunction
//===========================================================================
function InitTrig_Walker_Awakening takes nothing returns nothing
set gg_trg_Walker_Awakening = CreateTrigger( )
call TriggerAddCondition( gg_trg_Walker_Awakening, Condition( function Trig_Walker_Awakening_Conditions ) )
call TriggerAddAction( gg_trg_Walker_Awakening, function Trig_Walker_Awakening_Actions )
endfunction
function Weaken_Seal_Conditions takes nothing returns boolean
if (GetSpellAbilityId() == 'A0JV' ) then
return true
endif
return false
endfunction
function Weaken_Seal_Actions takes nothing returns nothing
local integer AvailableFood
local integer numBehemoths
local integer numHeralds
local integer tmp3
local integer tmp4
local integer spawnBehemoths
local integer spawnHeralds
local integer extraUnits
local integer UnitNumber
//get num available units
set udg_TempLoc1 = GetSpellTargetLoc()
set numBehemoths = 12 - CountLivingPlayerUnitsOfTypeId('n09B',GetOwningPlayer(GetSpellAbilityUnit()))
set numHeralds = 12 - CountLivingPlayerUnitsOfTypeId('n059',GetOwningPlayer(GetSpellAbilityUnit()))
//figure out how many units we're able to make
set AvailableFood = Min(GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_CAP), 300) - GetPlayerState(GetOwningPlayer(GetSpellAbilityUnit()), PLAYER_STATE_RESOURCE_FOOD_USED)
set tmp3 = ( GetUnitAbilityLevelSwapped('A0JV', GetSpellAbilityUnit()) * 10 )
set UnitNumber = Min(AvailableFood,tmp3)/5
//if we don't have a perfect multiple of 5 for available food that under our spell level add in filler units
set extraUnits = Min(AvailableFood,tmp3) - (UnitNumber * 5)
set tmp4 = GetRandomInt(0,UnitNumber)
set spawnBehemoths = Min(tmp4,numBehemoths)
//check if we are making as many Behemoths as we should, if not add in extra filler units.
if (numBehemoths < tmp4) then
set extraUnits = extraUnits + (tmp4 - numBehemoths)*5
endif
//we spawn as many heralds as our total units - the number of behemoths
set spawnHeralds = Min((UnitNumber - tmp4), numHeralds)
//once more, excess to filler units
if (numHeralds < (UnitNumber - tmp4)) then
set extraUnits = extraUnits + ((UnitNumber - tmp4) - numHeralds)*5
endif
if (spawnBehemoths > 0) then
call CreateNUnitsAtLoc(spawnBehemoths, 'n09B', GetOwningPlayer(GetSpellAbilityUnit()), udg_TempLoc1, bj_UNIT_FACING)
endif
if (spawnHeralds > 0) then
call CreateNUnitsAtLoc(spawnHeralds, 'n059', GetOwningPlayer(GetSpellAbilityUnit()), udg_TempLoc1, bj_UNIT_FACING)
endif
if (extraUnits > 0) then
call CreateNUnitsAtLoc(extraUnits, 'n09E', GetOwningPlayer(GetSpellAbilityUnit()), udg_TempLoc1, bj_UNIT_FACING)
endif
call RemoveLocation(udg_TempLoc1)
endfunction
//===========================================================================
function InitTrig_Weaken_Seal takes nothing returns nothing
set gg_trg_Weaken_Seal = CreateTrigger( )
call TriggerAddCondition( gg_trg_Weaken_Seal, Condition( function Weaken_Seal_Conditions ) )
call TriggerAddAction( gg_trg_Weaken_Seal, function Weaken_Seal_Actions )
endfunction
function StatementIfEG takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'cgc0') then
return true
elseif (GetUnitTypeId(GetDyingUnit()) == 'cgd0') then
return true
elseif (GetUnitTypeId(GetDyingUnit()) == 'cgo0')then
return true
endif
return false
endfunction
function Trig_Elven_Gate_Ownership_Actions takes nothing returns nothing
if ( StatementIfEG() ) then
call ReplaceUnitBJ( GetDyingUnit(), 'cgd0', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( bj_lastReplacedUnit, GetOwningPlayer(udg_Temp_Unit_2), true )
call SetUnitAnimation( bj_lastReplacedUnit, "death" )
else
endif
endfunction
//===========================================================================
function InitTrig_Elven_Gate_Ownership takes nothing returns nothing
set gg_trg_Elven_Gate_Ownership = CreateTrigger( )
call TriggerAddAction( gg_trg_Elven_Gate_Ownership, function Trig_Elven_Gate_Ownership_Actions )
endfunction
function StatementIfGHG takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'cgc1') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgd1') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgo1') then
return true
endif
return false
endfunction
function Trig_Greater_Human_Gate_Ownership_Actions takes nothing returns nothing
if ( StatementIfGHG() ) then
call ReplaceUnitBJ( GetDyingUnit(), 'cgd1', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( bj_lastReplacedUnit, GetOwningPlayer(udg_Temp_Unit_2), true )
call SetUnitAnimation( bj_lastReplacedUnit, "death" )
else
endif
endfunction
//===========================================================================
function InitTrig_Greater_Human_Gate_Ownership takes nothing returns nothing
set gg_trg_Greater_Human_Gate_Ownership = CreateTrigger( )
call TriggerAddAction( gg_trg_Greater_Human_Gate_Ownership, function Trig_Greater_Human_Gate_Ownership_Actions )
endfunction
function StatementIfMHG takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'cgc2') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgd2') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgo2') then
return true
endif
return false
endfunction
function Trig_Minor_Human_Gate_Ownership_Actions takes nothing returns nothing
if ( StatementIfMHG() ) then
call ReplaceUnitBJ( GetDyingUnit(), 'cgd2', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( bj_lastReplacedUnit, GetOwningPlayer(udg_Temp_Unit_2), true )
call SetUnitAnimation( bj_lastReplacedUnit, "death" )
else
endif
endfunction
//===========================================================================
function InitTrig_Minor_Human_Gate_Ownership takes nothing returns nothing
set gg_trg_Minor_Human_Gate_Ownership = CreateTrigger( )
call TriggerAddAction( gg_trg_Minor_Human_Gate_Ownership, function Trig_Minor_Human_Gate_Ownership_Actions )
endfunction
function StatementIfGG takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'cgc3') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgd3') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgo3') then
return true
endif
return false
endfunction
function Trig_Gilneas_Gate_Ownership_Actions takes nothing returns nothing
if ( StatementIfGG() ) then
call ReplaceUnitBJ( GetDyingUnit(), 'cgd3', bj_UNIT_STATE_METHOD_MAXIMUM )
call SetUnitOwner( bj_lastReplacedUnit, GetOwningPlayer(udg_Temp_Unit_2), true )
call SetUnitAnimation( bj_lastReplacedUnit, "death" )
else
endif
endfunction
//===========================================================================
function InitTrig_Gilneas_Gate_Ownership takes nothing returns nothing
set gg_trg_Gilneas_Gate_Ownership = CreateTrigger( )
call TriggerAddAction( gg_trg_Gilneas_Gate_Ownership, function Trig_Gilneas_Gate_Ownership_Actions )
endfunction
function StatementIfAQG takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'cgc4') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgd4') then
return true
endif
if (GetUnitTypeId(GetDyingUnit()) == 'cgo4') then
return true
endif
return false
endfunction
function Trig_Ahn_Qiraj_Gate_Ownership_Actions takes nothing returns nothing
if ( StatementIfAQG() ) then
call ReplaceUnitBJ( GetDyingUnit(), 'cgd4', bj_UNIT_STATE_METHOD_DEFAULTS )
call SetUnitOwner( bj_lastReplacedUnit, GetOwningPlayer(udg_Temp_Unit_2), true )
call SetUnitAnimation( bj_lastReplacedUnit, "death" )
else
endif
endfunction
//===========================================================================
function InitTrig_Ahn_Qiraj_Gate_Ownership takes nothing returns nothing
set gg_trg_Ahn_Qiraj_Gate_Ownership = CreateTrigger( )
call TriggerAddAction( gg_trg_Ahn_Qiraj_Gate_Ownership, function Trig_Ahn_Qiraj_Gate_Ownership_Actions )
endfunction
function Trig_Rune_Trap_Death_Conditions takes nothing returns boolean
if (GetUnitTypeId(GetDyingUnit()) == 'n01H' ) then
return true
endif
return false
endfunction
function Trig_Rune_Trap_Death_Actions takes nothing returns nothing
call AddSpecialEffect("Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl", GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
endfunction
//===========================================================================
function InitTrig_Rune_Trap_Death takes nothing returns nothing
set gg_trg_Rune_Trap_Death = CreateTrigger( )
call TriggerAddCondition( gg_trg_Rune_Trap_Death, Condition( function Trig_Rune_Trap_Death_Conditions ) )
call TriggerAddAction( gg_trg_Rune_Trap_Death, function Trig_Rune_Trap_Death_Actions )
endfunction
function Trig_Flying_Mechanical_Death_Conditions takes nothing returns boolean
if ( (IsUnitType(GetDyingUnit(), UNIT_TYPE_MECHANICAL) == true) and ( IsUnitType(udg_Temp_Unit, UNIT_TYPE_FLYING) == true )) then
return true
endif
return false
endfunction
function Trig_Flying_Mechanical_Death_Actions takes nothing returns nothing
set bj_lastCreatedEffect = AddSpecialEffectTarget("war3mapImported\\NewAirEX.mdx", GetDyingUnit(), "chest")
call DestroyEffect( bj_lastCreatedEffect )
set bj_lastCreatedEffect = null
endfunction
//===========================================================================
function InitTrig_Flying_Mechanical_Death takes nothing returns nothing
set gg_trg_Flying_Mechanical_Death = CreateTrigger( )
call TriggerAddCondition( gg_trg_Flying_Mechanical_Death, Condition( function Trig_Flying_Mechanical_Death_Conditions ) )
call TriggerAddAction( gg_trg_Flying_Mechanical_Death, function Trig_Flying_Mechanical_Death_Actions )
endfunction
function Trig_Ground_Mechanical_Death_Conditions takes nothing returns boolean
if ( (IsUnitType(GetDyingUnit(), UNIT_TYPE_MECHANICAL) == true) and ( IsUnitType(udg_Temp_Unit, UNIT_TYPE_GROUND) == true )) then
return true
endif
return false
endfunction
function Trig_Ground_Mechanical_Death_Actions takes nothing returns nothing
call AddSpecialEffect("war3mapImported\\NewGroundEX.mdx", GetUnitX(GetDyingUnit()), GetUnitY(GetDyingUnit()) )
call DestroyEffect( bj_lastCreatedEffect )
endfunction
//===========================================================================
function InitTrig_Ground_Mechanical_Death takes nothing returns nothing
set gg_trg_Ground_Mechanical_Death = CreateTrigger( )
call TriggerAddCondition( gg_trg_Ground_Mechanical_Death, Condition( function Trig_Ground_Mechanical_Death_Conditions ) )
call TriggerAddAction( gg_trg_Ground_Mechanical_Death, function Trig_Ground_Mechanical_Death_Actions )
endfunction
function Trig_LimitEvent_Base_Units_Copy_Func001A takes nothing returns nothing
call SetPlayerTechMaxAllowedSwap( 'h0EA', 0, GetEnumPlayer() )
endfunction
function Trig_Dalaran_Dungeons_Portal_Conditions takes nothing returns boolean
if (GetUnitTypeId(GetTrainedUnit()) == 'h0EA' ) then
return true
endif
return false
endfunction
function Trig_Dalaran_Dungeons_Portal_Actions takes nothing returns nothing
call RemoveUnit( GetTrainedUnit() )
if ( GetOwningPlayer(gg_unit_h031_0429) != Player(PLAYER_NEUTRAL_AGGRESSIVE)) then
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'wg01', GetRectCenterX(gg_rct_NewDalaranToDungeons), GetRectCenterY(gg_rct_NewDalaranToDungeons), bj_UNIT_FACING)
call WaygateSetDestination(bj_lastCreatedUnit, GetRectCenterX(gg_rct_DungeonsToNewDalaran), GetRectCenterY(gg_rct_DungeonsToNewDalaran))
call WaygateActivate( bj_lastCreatedUnit, true)
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'wg01', GetRectCenterX(gg_rct_DungeonsToNewDalaran), GetRectCenterY(gg_rct_DungeonsToNewDalaran), bj_UNIT_FACING)
call WaygateSetDestination(bj_lastCreatedUnit, GetRectCenterX(gg_rct_NewDalaranToDungeons), GetRectCenterY(gg_rct_NewDalaranToDungeons))
call WaygateActivate( bj_lastCreatedUnit, true)
set bj_lastCreatedUnit = null
call DisplayTextToForce( GetPlayersAll(), "|c00fEBA0EEvent:|r A portal from New Dalaran to Dalaran Dungeons has been opened." )
call ForForce( GetPlayersAll(), function Trig_LimitEvent_Base_Units_Copy_Func001A )
call DestroyTrigger(GetTriggeringTrigger())
else
call ForceClear( udg_Temp_Player_Group )
call ForceAddPlayer(udg_Temp_Player_Group, GetOwningPlayer(GetTrainedUnit()))
call DisplayTextToForce( udg_Temp_Player_Group, "Cannot open the portal since New Dalaran hasn't been risen!" )
call ForceClear( udg_Temp_Player_Group )
endif
endfunction
//===========================================================================
function InitTrig_Dalaran_Dungeons_Portal takes nothing returns nothing
set gg_trg_Dalaran_Dungeons_Portal = CreateTrigger( )
call TriggerAddCondition( gg_trg_Dalaran_Dungeons_Portal, Condition( function Trig_Dalaran_Dungeons_Portal_Conditions ) )
call TriggerAddAction( gg_trg_Dalaran_Dungeons_Portal, function Trig_Dalaran_Dungeons_Portal_Actions )
endfunction
function Trig_OpenDreamWay_Conditions takes nothing returns boolean
if (GetResearched() == 'R0CB' ) then
return true
endif
return false
endfunction
function Trig_OpenDreamWay_Func003A takes nothing returns nothing
call SetUnitOwner( GetEnumUnit(), GetOwningPlayer(GetResearchingUnit()), true )
endfunction
function Trig_OpenDreamWay_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_14208" )
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'h07R', GetRectCenterX(gg_rct_Emerald_Dream_Out), GetRectCenterY(gg_rct_Emerald_Dream_Out), bj_UNIT_FACING)
call WaygateSetDestination(bj_lastCreatedUnit, GetRectCenterX(gg_rct_Emerald_Dream_In), GetRectCenterY(gg_rct_Emerald_Dream_In))
call WaygateActivate( bj_lastCreatedUnit,true )
set bj_lastCreatedUnit = null
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'h07R', GetRectCenterX(gg_rct_Emerald_Dream_In), GetRectCenterY(gg_rct_Emerald_Dream_In), 315.00)
call UnitAddAbility(bj_lastCreatedUnit, 'A0RF')
call UnitAddAbility(bj_lastCreatedUnit, 'A0RE')
call UnitAddAbility(bj_lastCreatedUnit, 'A16M')
call WaygateSetDestination(bj_lastCreatedUnit, GetRectCenterX(gg_rct_Emerald_Dream_Out), GetRectCenterY(gg_rct_Emerald_Dream_Out))
call WaygateActivate( bj_lastCreatedUnit, true)
set bj_lastCreatedUnit = null
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRectAll(gg_rct_EmeraldDreamBase), function Trig_OpenDreamWay_Func003A )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_OpenDreamWay takes nothing returns nothing
set gg_trg_OpenDreamWay = CreateTrigger( )
call TriggerAddCondition( gg_trg_OpenDreamWay, Condition( function Trig_OpenDreamWay_Conditions ) )
call TriggerAddAction( gg_trg_OpenDreamWay, function Trig_OpenDreamWay_Actions )
endfunction
function Trig_Obtain_Raj_Nazjan_Conditions takes nothing returns boolean
set bj_wantDestroyGroup = true
if ( not ( CountLivingPlayerUnitsOfTypeId('h05V', GetOwningPlayer(GetTrainedUnit())) == 1 ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'h0C2' ) ) then
return false
endif
return true
endfunction
function Trig_Obtain_Raj_Nazjan_DummyFilter takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'h05V' )
endfunction
function Trig_Obtain_Raj_Nazjan_DummyRemove takes nothing returns nothing
call RemoveUnit( GetEnumUnit() )
endfunction
function Trig_Obtain_Raj_Nazjan_Limit takes nothing returns nothing
call SetPlayerTechMaxAllowedSwap( 'h0C2', 0, GetEnumPlayer() )
endfunction
function Trig_Obtain_Raj_Nazjan_ReplaceCond takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'O00J' )
endfunction
function Trig_Obtain_Raj_Nazjan_ReplaceAction takes nothing returns nothing
if ( IsUnitIllusionBJ(GetEnumUnit()) == false ) then
set udg_Temp_Unit = GetEnumUnit()
call ConditionalTriggerExecute( gg_trg_Stats_Correction_Trigger )
call ReplaceUnitBJ( GetEnumUnit(), 'O03X', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_Temp_Unit = GetLastReplacedUnitBJ()
call ConditionalTriggerExecute( gg_trg_TempStatsSet )
endif
endfunction
function Trig_Obtain_Raj_Nazjan_Actions takes nothing returns nothing
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetTrainedUnit()), Condition(function Trig_Obtain_Raj_Nazjan_DummyFilter)), function Trig_Obtain_Raj_Nazjan_DummyRemove )
call SetUnitPositionLoc( GetTrainedUnit(), udg_PERM_POS_Center_Of_DummyRegion )
call DisplayTextToForce( GetPlayersAll(), "|cffffcc00EVENT:|r Raj Nazjan has risen from the depths to pave the way for his queen and her empire to rise." )
call SetPlayerTechMaxAllowedSwap( 'O00J', 0, GetOwningPlayer(GetTrainedUnit()) )
call ForForce( GetPlayersAll(), function Trig_Obtain_Raj_Nazjan_Limit )
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetTrainedUnit()), Condition(function Trig_Obtain_Raj_Nazjan_ReplaceCond)), function Trig_Obtain_Raj_Nazjan_ReplaceAction )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Obtain_Raj_Nazjan takes nothing returns nothing
set gg_trg_Obtain_Raj_Nazjan = CreateTrigger( )
call TriggerAddCondition( gg_trg_Obtain_Raj_Nazjan, Condition( function Trig_Obtain_Raj_Nazjan_Conditions ) )
call TriggerAddAction( gg_trg_Obtain_Raj_Nazjan, function Trig_Obtain_Raj_Nazjan_Actions )
endfunction
function Trig_Nazjatar_Empire_Conditions takes nothing returns boolean
if (GetResearched() == 'R09J' ) then
return true
endif
return false
endfunction
function Trig_Nazjatar_Empire_DisablingNazjatar takes nothing returns nothing
call SetPlayerTechMaxAllowedSwap( 'h0C2', 0, GetEnumPlayer() )
endfunction
function Trig_Nazjatar_Empire_TrueAction takes nothing returns nothing
if ((GetUnitTypeId(GetEnumUnit()) == 'H02S') and (IsUnitIllusion(GetEnumUnit()) == false)) then
set udg_Temp_Unit = GetEnumUnit()
call ConditionalTriggerExecute( gg_trg_Stats_Correction_Trigger )
call ReplaceUnitBJ( GetEnumUnit(), 'H0BL', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_Temp_Unit = GetLastReplacedUnitBJ()
call ConditionalTriggerExecute( gg_trg_TempStatsSet )
call SetUnitPositionLoc( GetLastReplacedUnitBJ(), udg_Temp_Unit_Pos )
call UnitAddItemByIdSwapped('I020', GetLastReplacedUnitBJ())
elseif ( GetUnitTypeId(GetEnumUnit()) == 'nmpe' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'n06R', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'nntt' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'nntt', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'h02K' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'h02K', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'h02L' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'h02L', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'nnsg' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'n06G', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'nnsa' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'n06J', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'h02M' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'h0BF', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'n00K' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'n06Q', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ( GetUnitTypeId(GetEnumUnit()) == 'nwgs' ) then
call ReplaceUnitBJ( GetEnumUnit(), 'n06P', bj_UNIT_STATE_METHOD_RELATIVE )
elseif ((GetUnitTypeId(GetEnumUnit()) == 'nsnp') or (GetUnitTypeId(GetEnumUnit()) == 'nsbs')) then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function Trig_Nazjatar_Empire_Actions takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_MULTIBOARD_Leaderboard, 2, ( GetConvertedPlayerId(GetOwningPlayer(GetResearchingUnit())) + 1 ), "TRIGSTR_3179" )
call SetPlayerColorBJ( GetOwningPlayer(GetResearchingUnit()), PLAYER_COLOR_LIGHT_BLUE, true )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_15408" )
call SetPlayerTechMaxAllowedSwap( 'nmpe', 0, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerTechMaxAllowedSwap( 'nnrg', 6, GetOwningPlayer(GetResearchingUnit()) )
call SetPlayerTechMaxAllowedSwap( 'n06R', 20, GetOwningPlayer(GetResearchingUnit()) )
set udg_Temp_Unit_Pos = GetRectCenter(gg_rct_Center_of_Nazjatar)
call ForForce( GetPlayersAll(), function Trig_Nazjatar_Empire_DisablingNazjatar )
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsOfPlayerAll(GetOwningPlayer(GetResearchingUnit())), function Trig_Nazjatar_Empire_TrueAction )
call RemoveLocation(udg_Temp_Unit_Pos)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Nazjatar_Empire takes nothing returns nothing
set gg_trg_Nazjatar_Empire = CreateTrigger( )
call TriggerAddCondition( gg_trg_Nazjatar_Empire, Condition( function Trig_Nazjatar_Empire_Conditions ) )
call TriggerAddAction( gg_trg_Nazjatar_Empire, function Trig_Nazjatar_Empire_Actions )
endfunction
function Trig_Drone_Summoning_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSoldUnit()) == 'h025' ) ) then
return false
endif
return true
endfunction
function Trig_Drone_Summoning_Actions takes nothing returns nothing
call UnitApplyTimedLifeBJ( 210.00, 'BTLF', GetSoldUnit() )
call IssuePointOrderLocBJ( GetSoldUnit(), "smart", GetUnitLoc(GetUnitRallyUnit(GetSellingUnit())) )
call IssueTargetOrderBJ( GetUnitRallyUnit(GetSellingUnit()), "load", GetSoldUnit() )
endfunction
//===========================================================================
function InitTrig_Drone_Summoning takes nothing returns nothing
set gg_trg_Drone_Summoning = CreateTrigger( )
call TriggerAddCondition( gg_trg_Drone_Summoning, Condition( function Trig_Drone_Summoning_Conditions ) )
call TriggerAddAction( gg_trg_Drone_Summoning, function Trig_Drone_Summoning_Actions )
endfunction