Name | Type | is_array | initial_value |
AbsorbManaGroup | group | No | |
AntiSlowHero1 | trigger | Yes | |
AntiSlowHero10 | trigger | Yes | |
AntiSlowHero11 | trigger | Yes | |
AntiSlowHero12 | trigger | Yes | |
AntiSlowHero13 | trigger | Yes | |
AntiSlowHero14 | trigger | Yes | |
AntiSlowHero15 | trigger | Yes | |
AntiSlowHero16 | trigger | Yes | |
AntiSlowHero17 | trigger | Yes | |
AntiSlowHero18 | trigger | Yes | |
AntiSlowHero19 | trigger | Yes | |
AntiSlowHero2 | trigger | Yes | |
AntiSlowHero20 | trigger | Yes | |
AntiSlowHero21 | trigger | Yes | |
AntiSlowHero22 | trigger | Yes | |
AntiSlowHero23 | trigger | Yes | |
AntiSlowHero24 | trigger | Yes | |
AntiSlowHero3 | trigger | Yes | |
AntiSlowHero4 | trigger | Yes | |
AntiSlowHero5 | trigger | Yes | |
AntiSlowHero6 | trigger | Yes | |
AntiSlowHero7 | trigger | Yes | |
AntiSlowHero8 | trigger | Yes | |
AntiSlowHero9 | trigger | Yes | |
AttributeHero | unit | Yes | |
AttributeItem | item | Yes | |
AttributeNumber | integer | Yes | |
AuraMasterHero | unit | No | |
BerserkFireGroup | group | No | |
ColdArrowsHero | unit | No | |
CreepBoDem | integer | No | |
CreepButton | button | Yes | |
CreepDialog | dialog | No | |
CreepGameType | integer | No | |
CreepHP | abilcode | Yes | |
CreepIncreaseBountyDuoi | integer | No | |
CreepIncreaseBountyTren | integer | No | |
CreepLevel | integer | No | |
CreepNumberUnitLost | integer | No | |
CreepRegionFirst | rect | Yes | |
CreepRegionLast | rect | Yes | |
CreepTimer | timer | No | |
CriticalStrikeAuraHero | unit | No | |
DarknessAuraUnit | unitcode | Yes | |
DarknessBodem | integer | No | |
DarknessDauKim | unit | No | |
DarknessDoorButton | button | Yes | |
DarknessDoorDialog | dialog | No | |
DarknessDoorFlag | boolean | Yes | |
DarknessDoorHero | unitcode | Yes | |
DarknessFirst | boolean | No | |
DarknessGroup | group | No | |
DarknessGroupEffectMoDan | group | No | |
DarknessGroupMove | group | No | |
DarknessHero | unit | Yes | |
DarknessRange | real | No | |
DarknessStep | real | No | |
DarknessVictim | unit | No | |
DoorOfDimensionGroup | group | No | |
EvasionAuraHero | unit | No | |
FireFlareAbility | abilcode | Yes | |
FireStormAbility | abilcode | Yes | |
FrostRegionGroup | group | No | |
FrozenRainHero | unit | No | |
HeroViewingSkillGroup | group | No | |
IceMountainAbility | abilcode | Yes | |
LifeOfCorpseTome | itemcode | Yes | |
MutiDeathCoilGroup | group | No | |
PowerDrainHero | unit | No | |
PQ1Foot | integer | Yes | |
PQ1Region | rect | Yes | |
PQ2Foot | integer | Yes | |
PQ2Region | rect | Yes | |
PQ3Foot | integer | Yes | |
PQ3Region | rect | Yes | |
PQ4Foot | integer | Yes | |
PQ4Region | rect | Yes | |
PQButton | button | Yes | |
PQDialog | dialog | No | |
PQFootSwitch | destructable | Yes | |
PQFootSwitchRegion | rect | Yes | |
RainOfChaosUnit | unitcode | Yes | |
RainOfElementGroup | group | No | |
RainOfElementUnit | unitcode | Yes | |
SpiritOfTheMoonUnit | unit | Yes | |
SpiritOfTheMoonUnitSpirit | unitcode | Yes | |
SpiritOfWolfUnit | unitcode | Yes | |
SSGodModeUnit | unit | Yes | |
ThunderLizardUnit | unitcode | Yes | |
ThunderStormGroup | group | No | |
ToxicBloodHero | unit | No | |
TwinHawksGroup | group | No |
function Trig_Creep_Drop_Lumber_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_ANCIENT) == false ) ) then
return false
endif
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == false ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Drop_Lumber_Actions takes nothing returns nothing
local integer chance = GetRandomInt(1, 100)
local location point = GetUnitLoc(GetDyingUnit())
if ( chance <= 2 ) then
call CreateItemLoc( 'I01K', point )
endif
set chance = GetRandomInt(1, 100)
if ( chance <= 3 ) then
call CreateItemLoc( 'I01C', point )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Drop_Lumber takes nothing returns nothing
set gg_trg_Creep_Drop_Lumber = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Creep_Drop_Lumber, Player(10), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Creep_Drop_Lumber, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Creep_Drop_Lumber, Condition( function Trig_Creep_Drop_Lumber_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Drop_Lumber, function Trig_Creep_Drop_Lumber_Actions )
endfunction
function Trig_Creep_Actions takes nothing returns nothing
local integer a = 1
local integer heso
loop
exitwhen a > 4
if GetUnitState(udg_AttributeHero[a], UNIT_STATE_LIFE) > 0 then
set heso = 1
if ( UnitHasBuffBJ(udg_AttributeHero[a], 'B014') == true ) then //scroll of exp
set heso = heso + 1
endif
if ( UnitHasItemOfTypeBJ(udg_AttributeHero[a], 'I01Y') == true ) then //ring of odin
set heso = heso + 1
endif
call AddHeroXP(udg_AttributeHero[a], (heso * ( GetUnitLevel(GetDyingUnit()) * 10 )), true)
endif
set a = a + 1
endloop
endfunction
//===========================================================================
function InitTrig_Creep takes nothing returns nothing
set gg_trg_Creep = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Creep, Player(10), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Creep, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Creep, function Trig_Creep_Actions )
endfunction
function Trig_Creep_Level_Write_On_Actions takes nothing returns nothing
local location point
local integer a = 1
loop
exitwhen a > 28
set point = PolarProjectionBJ(GetRectCenter(udg_CreepRegionFirst[a]), 200.00, 90.00)
call CreateTextTagLocBJ( ( "Level : " + I2S(a) ), point, 0, 12.00, 100, 100, 100, 0 )
set a = a + 1
endloop
call RemoveLocation(point)
set point = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Creep_Level_Write_On takes nothing returns nothing
set gg_trg_Creep_Level_Write_On = CreateTrigger( )
call TriggerAddAction( gg_trg_Creep_Level_Write_On, function Trig_Creep_Level_Write_On_Actions )
endfunction
function Trig_Creep_Begin_Actions takes nothing returns nothing
call PlayMusicBJ( gg_snd_MainMusic )
call DisplayTextToForce( GetPlayersAll(), ( "Level : " + "1" ) )
call TimerStart(udg_CreepTimer,10,false,null)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Creep_Begin takes nothing returns nothing
set gg_trg_Creep_Begin = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Creep_Begin, 60.00 )
call TriggerAddAction( gg_trg_Creep_Begin, function Trig_Creep_Begin_Actions )
endfunction
function Trig_Creep_Setup_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
set g = GetUnitsInRectMatching(gg_rct_Region_Stock_Enemy, null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
call SetUnitInvulnerable( f, true )
call SetUnitAcquireRange(f, 0.00)
call SetUnitFacing(f, 270.00)
call UnitRemoveAbility(f, 'Aatk')
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
set f = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Creep_Setup takes nothing returns nothing
set gg_trg_Creep_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Creep_Setup, function Trig_Creep_Setup_Actions )
endfunction
function Trig_Creep_Summon_Actions takes nothing returns nothing
local location point1 = GetRectCenter(gg_rct_Creep_Trai_Begin)
local location point2 = GetRectCenter(gg_rct_Creep_Trai_So_2)
local location point3 = GetRectCenter(gg_rct_Creep_Phai_Begin)
local location point4 = GetRectCenter(gg_rct_Creep_Phai_So_2)
local group g = CreateGroup()
local unit f
local integer a
local unit p
if ( udg_CreepBoDem == 4 ) then
call PlayMusicBJ( gg_snd_MainMusic )
call DisplayTextToForce( GetPlayersAll(), ( "Level : " + I2S(udg_CreepLevel) ) )
endif
if ( udg_CreepBoDem > 3 ) then
set g = GetUnitsInRectMatching(udg_CreepRegionLast[udg_CreepLevel], null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitAlly(f, Player(10)) == true ) then
set a = 1
loop
exitwhen a > udg_CreepIncreaseBountyDuoi
set p = CreateUnitAtLoc(Player(10), GetUnitTypeId(f), point1, AngleBetweenPoints(point1, point2))
if ( udg_CreepLevel == 21 ) then
else
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
endif
call SetUnitMoveSpeed( p, ( GetUnitDefaultMoveSpeed(p) - 75.00 ) )
call IssuePointOrderLoc( p, "attack", point2 )
//-------------------
set p = CreateUnitAtLoc(Player(11), GetUnitTypeId(f), point3, AngleBetweenPoints(point3, point4))
if ( udg_CreepLevel == 21 ) then
else
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
endif
call SetUnitMoveSpeed( p, ( GetUnitDefaultMoveSpeed(p) - 75.00 ) )
call IssuePointOrderLoc( p, "attack", point4 )
set a = a + 1
endloop
endif
call GroupRemoveUnit(g, f)
endloop
call GroupClear(g)
set g = GetUnitsInRectMatching(udg_CreepRegionFirst[udg_CreepLevel], null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitAlly(f, Player(10)) == true ) then
set a = 1
loop
exitwhen a > udg_CreepIncreaseBountyTren
set p = CreateUnitAtLoc(Player(10), GetUnitTypeId(f), point1, AngleBetweenPoints(point1, point2))
if ( udg_CreepLevel == 21 ) then
else
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
endif
call SetUnitMoveSpeed( p, ( GetUnitDefaultMoveSpeed(p) - 75.00 ) )
call IssuePointOrderLoc( p, "attack", point2 )
//-------------------
set p = CreateUnitAtLoc(Player(11), GetUnitTypeId(f), point3, AngleBetweenPoints(point3, point4))
if ( udg_CreepLevel == 21 ) then
else
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
endif
call SetUnitMoveSpeed( p, ( GetUnitDefaultMoveSpeed(p) - 75.00 ) )
call IssuePointOrderLoc( p, "attack", point4 )
set a = a + 1
endloop
endif
call GroupRemoveUnit(g, f)
endloop
if ( udg_CreepBoDem >= 13 ) then
set udg_CreepBoDem = 0
set udg_CreepLevel = ( udg_CreepLevel + 1 )
// -----------Hero Attack Creep-------------------
if (udg_CreepLevel==3) or (udg_CreepLevel==6) or (udg_CreepLevel==9) or (udg_CreepLevel==12) or (udg_CreepLevel==15) or (udg_CreepLevel==18) or (udg_CreepLevel==21) or (udg_CreepLevel==24)or(udg_CreepLevel==27) then
call TriggerExecute( gg_trg_HA_Creep_Begin )
endif
// -----------Increase Hard-------------------
if ( udg_CreepLevel == 15 ) then
set udg_CreepGameType = udg_CreepGameType + 1
endif
// -----------VICTORY-------------------
if ( udg_CreepLevel >= 29 ) then
call TriggerExecute( gg_trg_Cinematic_Victory )
call DisableTrigger( GetTriggeringTrigger() )
endif
set g = GetUnitsInRectMatching(udg_CreepRegionLast[( udg_CreepLevel - 1 )], null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
call RemoveUnit( f )
call GroupRemoveUnit(g, f)
endloop
set g = GetUnitsInRectMatching(udg_CreepRegionFirst[( udg_CreepLevel - 1 )], null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
call RemoveUnit( f )
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
endif
endif
set udg_CreepBoDem = ( udg_CreepBoDem + 1 )
call TimerStart(udg_CreepTimer, 10, false, null)
call RemoveLocation(point1)
set point1 = null
call RemoveLocation(point2)
set point2 = null
call RemoveLocation(point3)
set point3 = null
call RemoveLocation(point4)
set point4 = null
call DestroyGroup(g)
set g = null
set f = null
set p = null
endfunction
//===========================================================================
function InitTrig_Creep_Summon takes nothing returns nothing
set gg_trg_Creep_Summon = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_Creep_Summon, udg_CreepTimer )
call TriggerAddAction( gg_trg_Creep_Summon, function Trig_Creep_Summon_Actions )
endfunction
function Trig_Creep_Var_Setup_Actions takes nothing returns nothing
set udg_CreepLevel = 1
set udg_CreepBoDem = 3
set udg_CreepIncreaseBountyTren = 4
set udg_CreepIncreaseBountyDuoi = 2
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Creep_Var_Setup takes nothing returns nothing
set gg_trg_Creep_Var_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Creep_Var_Setup, function Trig_Creep_Var_Setup_Actions )
endfunction
function Trig_Creep_Way_Fix_Bug_1_Func002C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return true
endif
return false
endfunction
function Trig_Creep_Way_Fix_Bug_1_Conditions takes nothing returns boolean
if ( not Trig_Creep_Way_Fix_Bug_1_Func002C() ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Fix_Bug_1_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_Phu)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Fix_Bug_1 takes nothing returns nothing
set gg_trg_Creep_Way_Fix_Bug_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Fix_Bug_1, gg_rct_Region_091 )
call TriggerAddCondition( gg_trg_Creep_Way_Fix_Bug_1, Condition( function Trig_Creep_Way_Fix_Bug_1_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Fix_Bug_1, function Trig_Creep_Way_Fix_Bug_1_Actions )
endfunction
function Trig_Creep_Way_Trai_1_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_1_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_Phu)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_1 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_1, gg_rct_Creep_Trai_So_2 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_1, Condition( function Trig_Creep_Way_Trai_1_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_1, function Trig_Creep_Way_Trai_1_Actions )
endfunction
function Trig_Creep_Way_Phai_1_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_1_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_Phu)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_1 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_1, gg_rct_Creep_Phai_So_2 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_1, Condition( function Trig_Creep_Way_Phai_1_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_1, function Trig_Creep_Way_Phai_1_Actions )
endfunction
function Trig_Creep_Way_Phu_Trai_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phu_Trai_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_1)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phu_Trai takes nothing returns nothing
set gg_trg_Creep_Way_Phu_Trai = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phu_Trai, gg_rct_Creep_Center_Phu )
call TriggerAddCondition( gg_trg_Creep_Way_Phu_Trai, Condition( function Trig_Creep_Way_Phu_Trai_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phu_Trai, function Trig_Creep_Way_Phu_Trai_Actions )
endfunction
function Trig_Creep_Way_Phu_Phai_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phu_Phai_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_1)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phu_Phai takes nothing returns nothing
set gg_trg_Creep_Way_Phu_Phai = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phu_Phai, gg_rct_Creep_Center_Phu )
call TriggerAddCondition( gg_trg_Creep_Way_Phu_Phai, Condition( function Trig_Creep_Way_Phu_Phai_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phu_Phai, function Trig_Creep_Way_Phu_Phai_Actions )
endfunction
function Trig_Creep_Way_Trai_2_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_2_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Left_3)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_2 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_2, gg_rct_Creep_Center_1 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_2, Condition( function Trig_Creep_Way_Trai_2_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_2, function Trig_Creep_Way_Trai_2_Actions )
endfunction
function Trig_Creep_Way_Phai_2_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_2_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Right_3)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_2 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_2, gg_rct_Creep_Center_1 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_2, Condition( function Trig_Creep_Way_Phai_2_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_2, function Trig_Creep_Way_Phai_2_Actions )
endfunction
function Trig_Creep_Way_Trai_3_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_3_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Left_4)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_3 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_3, gg_rct_Creep_Left_3 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_3, Condition( function Trig_Creep_Way_Trai_3_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_3, function Trig_Creep_Way_Trai_3_Actions )
endfunction
function Trig_Creep_Way_Phai_3_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_3_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Right_4)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_3 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_3, gg_rct_Creep_Right_3 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_3, Condition( function Trig_Creep_Way_Phai_3_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_3, function Trig_Creep_Way_Phai_3_Actions )
endfunction
function Trig_Creep_Way_Trai_4_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_4_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Left_5)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_4 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_4, gg_rct_Creep_Left_4 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_4, Condition( function Trig_Creep_Way_Trai_4_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_4, function Trig_Creep_Way_Trai_4_Actions )
endfunction
function Trig_Creep_Way_Phai_4_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_4_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Right_5)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_4 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_4, gg_rct_Creep_Right_4 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_4, Condition( function Trig_Creep_Way_Phai_4_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_4, function Trig_Creep_Way_Phai_4_Actions )
endfunction
function Trig_Creep_Way_Trai_5_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_5_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_2)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_5 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_5, gg_rct_Creep_Left_5 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_5, Condition( function Trig_Creep_Way_Trai_5_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_5, function Trig_Creep_Way_Trai_5_Actions )
endfunction
function Trig_Creep_Way_Phai_5_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_5_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Creep_Center_2)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_5 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_5, gg_rct_Creep_Right_5 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_5, Condition( function Trig_Creep_Way_Phai_5_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_5, function Trig_Creep_Way_Phai_5_Actions )
endfunction
function Trig_Creep_Way_Trai_6_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Trai_6_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Hero_Start)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Trai_6 takes nothing returns nothing
set gg_trg_Creep_Way_Trai_6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Trai_6, gg_rct_Creep_Center_2 )
call TriggerAddCondition( gg_trg_Creep_Way_Trai_6, Condition( function Trig_Creep_Way_Trai_6_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Trai_6, function Trig_Creep_Way_Trai_6_Actions )
endfunction
function Trig_Creep_Way_Phai_6_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_Phai_6_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Hero_Start)
call IssuePointOrderLoc( GetEnteringUnit(), "attack", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_Phai_6 takes nothing returns nothing
set gg_trg_Creep_Way_Phai_6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_Phai_6, gg_rct_Creep_Center_2 )
call TriggerAddCondition( gg_trg_Creep_Way_Phai_6, Condition( function Trig_Creep_Way_Phai_6_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_Phai_6, function Trig_Creep_Way_Phai_6_Actions )
endfunction
function Trig_Creep_Way_End_Func001C takes nothing returns boolean
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(10) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetEnteringUnit()) == Player(11) ) ) then
return true
endif
return false
endfunction
function Trig_Creep_Way_End_Conditions takes nothing returns boolean
if ( not Trig_Creep_Way_End_Func001C() ) then
return false
endif
return true
endfunction
function Trig_Creep_Way_End_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetEnteringUnit())
call RemoveUnit( GetEnteringUnit() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set udg_CreepNumberUnitLost = ( udg_CreepNumberUnitLost + 1 )
if ( udg_CreepNumberUnitLost >= 150 ) then
call PlayMusicBJ( gg_snd_Defeat )
call CustomDefeatBJ( Player(0), ( "Defeat" + " !" ) )
call CustomDefeatBJ( Player(1), ( "Defeat" + " !" ) )
call CustomDefeatBJ( Player(2), ( "Defeat" + " !" ) )
call CustomDefeatBJ( Player(3), ( "Defeat" + " !" ) )
call DestroyTrigger( GetTriggeringTrigger() )
endif
// -------------------------------------------
call LeaderboardSetPlayerItemValueBJ( Player(11), GetLastCreatedLeaderboard(), udg_CreepNumberUnitLost )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Creep_Way_End takes nothing returns nothing
set gg_trg_Creep_Way_End = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Creep_Way_End, gg_rct_Hero_Start )
call TriggerAddCondition( gg_trg_Creep_Way_End, Condition( function Trig_Creep_Way_End_Conditions ) )
call TriggerAddAction( gg_trg_Creep_Way_End, function Trig_Creep_Way_End_Actions )
endfunction
function Trig_PQ_Setup_Actions takes nothing returns nothing
local integer a
local location point
set udg_PQ1Region[1] = gg_rct_PQ1_1
set udg_PQ1Region[2] = gg_rct_PQ1_2
set udg_PQ1Region[3] = gg_rct_PQ1_3
set udg_PQ1Region[4] = gg_rct_PQ1_4
set a = 1
loop
exitwhen a > 4
set point = GetRectCenter(udg_PQ1Region[a])
call CreateTextTagLocBJ( I2S(a), point, 0, 20.00, 100, 100, 100, 0 )
set a = a + 1
endloop
// --------------------------------------------------------
set udg_PQ2Region[1] = gg_rct_PQ2_1
set udg_PQ2Region[2] = gg_rct_PQ2_2
set udg_PQ2Region[3] = gg_rct_PQ2_3
set udg_PQ2Region[4] = gg_rct_PQ2_4
set udg_PQ2Region[5] = gg_rct_PQ2_5
set a = 1
loop
exitwhen a > 5
set point = GetRectCenter(udg_PQ2Region[a])
call CreateTextTagLocBJ( I2S(a), point, 0, 20.00, 100, 100, 100, 0 )
set a = a + 1
endloop
// --------------------------------------------------------
set udg_PQ3Region[1] = gg_rct_PQ3_1
set udg_PQ3Region[2] = gg_rct_PQ3_2
set udg_PQ3Region[3] = gg_rct_PQ3_3
set udg_PQ3Region[4] = gg_rct_PQ3_4
set udg_PQ3Region[5] = gg_rct_PQ3_5
set udg_PQ3Region[6] = gg_rct_PQ3_6
set a = 1
loop
exitwhen a > 6
set point = GetRectCenter(udg_PQ3Region[a])
call CreateTextTagLocBJ( I2S(a), point, 0, 20.00, 100, 100, 100, 0 )
set a = a + 1
endloop
// --------------------------------------------------------
set udg_PQ4Region[1] = gg_rct_PQ4_1
set udg_PQ4Region[2] = gg_rct_PQ4_2
set udg_PQ4Region[3] = gg_rct_PQ4_3
set udg_PQ4Region[4] = gg_rct_PQ4_4
set udg_PQ4Region[5] = gg_rct_PQ4_5
set udg_PQ4Region[6] = gg_rct_PQ4_6
set udg_PQ4Region[7] = gg_rct_PQ4_7
set a = 1
loop
exitwhen a > 7
set point = GetRectCenter(udg_PQ4Region[a])
call CreateTextTagLocBJ( I2S(a), point, 0, 20.00, 100, 100, 100, 0 )
set a = a + 1
endloop
// --------------------------------------------------------
set udg_PQFootSwitchRegion[1] = gg_rct_PQ1_1
set udg_PQFootSwitchRegion[2] = gg_rct_PQ1_2
set udg_PQFootSwitchRegion[3] = gg_rct_PQ1_3
set udg_PQFootSwitchRegion[4] = gg_rct_PQ1_4
// ---------------------------
set udg_PQFootSwitchRegion[5] = gg_rct_PQ2_1
set udg_PQFootSwitchRegion[6] = gg_rct_PQ2_2
set udg_PQFootSwitchRegion[7] = gg_rct_PQ2_3
set udg_PQFootSwitchRegion[8] = gg_rct_PQ2_4
set udg_PQFootSwitchRegion[9] = gg_rct_PQ2_5
// ---------------------------
set udg_PQFootSwitchRegion[10] = gg_rct_PQ3_1
set udg_PQFootSwitchRegion[11] = gg_rct_PQ3_2
set udg_PQFootSwitchRegion[12] = gg_rct_PQ3_3
set udg_PQFootSwitchRegion[13] = gg_rct_PQ3_4
set udg_PQFootSwitchRegion[14] = gg_rct_PQ3_5
set udg_PQFootSwitchRegion[15] = gg_rct_PQ3_6
// ---------------------------
set udg_PQFootSwitchRegion[16] = gg_rct_PQ4_1
set udg_PQFootSwitchRegion[17] = gg_rct_PQ4_2
set udg_PQFootSwitchRegion[18] = gg_rct_PQ4_3
set udg_PQFootSwitchRegion[19] = gg_rct_PQ4_4
set udg_PQFootSwitchRegion[20] = gg_rct_PQ4_5
set udg_PQFootSwitchRegion[21] = gg_rct_PQ4_6
set udg_PQFootSwitchRegion[22] = gg_rct_PQ4_7
// -----------Fake Event----------
call RemoveLocation(point)
set point = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_PQ_Setup takes nothing returns nothing
set gg_trg_PQ_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_PQ_Setup, function Trig_PQ_Setup_Actions )
endfunction
function Trig_PQ_Register_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(0) ) ) then
return false
endif
return true
endfunction
function Trig_PQ_Register_Actions takes nothing returns nothing
call DialogClear(udg_PQDialog)
call DialogSetMessage(udg_PQDialog, ( "Are you sure you want to do Party Quest " + "?" ))
set udg_PQButton[1] = DialogAddButton(udg_PQDialog, ( "Yes" + " ..." ),0)
set udg_PQButton[2] = DialogAddButton(udg_PQDialog, ( "No" + " ..." ),0)
call DialogDisplay(Player(0), udg_PQDialog, true)
endfunction
//===========================================================================
function InitTrig_PQ_Register takes nothing returns nothing
set gg_trg_PQ_Register = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_PQ_Register, gg_rct_PQ_Active )
call TriggerAddCondition( gg_trg_PQ_Register, Condition( function Trig_PQ_Register_Conditions ) )
call TriggerAddAction( gg_trg_PQ_Register, function Trig_PQ_Register_Actions )
endfunction
function Trig_PQ_Button_Click_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Region_Pick_Hero)
local group g = CreateGroup()
local unit f
local integer a
local unit p
if ( GetClickedButtonBJ() == udg_PQButton[2] ) then
call DialogClear(udg_PQDialog)
endif
if ( GetClickedButtonBJ() == udg_PQButton[1] ) then
call PauseTimer(udg_CreepTimer)
call PlayMusicBJ( gg_snd_PartyQuest )
// Party Quest 1
set a = 1
loop
exitwhen a > 4
set p = CreateUnitAtLoc(Player(0), 'e004', point, bj_UNIT_FACING)
call SetUnitUserData( p, a )
call GroupAddUnit(g, p)
set a = a + 1
endloop
set f = GroupPickRandomUnit(g)
set udg_PQ1Foot[1] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ1Foot[2] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ1Foot[3] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
// Party Quest 2
set a = 1
loop
exitwhen a > 5
set p = CreateUnitAtLoc(Player(0), 'e004', point, bj_UNIT_FACING)
call SetUnitUserData( p, a )
call GroupAddUnit(g, p)
set a = a + 1
endloop
set f = GroupPickRandomUnit(g)
set udg_PQ2Foot[1] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ2Foot[2] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ2Foot[3] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
// Party Quest 3
set a = 1
loop
exitwhen a > 6
set p = CreateUnitAtLoc(Player(0), 'e004', point, bj_UNIT_FACING)
call SetUnitUserData( p, a )
call GroupAddUnit(g, p)
set a = a + 1
endloop
set f = GroupPickRandomUnit(g)
set udg_PQ3Foot[1] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ3Foot[2] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ3Foot[3] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
// Party Quest 4
set a = 1
loop
exitwhen a > 7
set p = CreateUnitAtLoc(Player(0), 'e004', point, bj_UNIT_FACING)
call SetUnitUserData( p, a )
call GroupAddUnit(g, p)
set a = a + 1
endloop
set f = GroupPickRandomUnit(g)
set udg_PQ4Foot[1] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ4Foot[2] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
set udg_PQ4Foot[3] = GetUnitUserData(f)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-----------------------
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
set f = GroupPickRandomUnit(g)
call GroupRemoveUnit(g, f)
call RemoveUnit( f )
//-0-0-0-0-0-0-0-0-0-0-
call SetUnitUserData( gg_unit_Ecen_0135, 0 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0135, 100, 100, 100, 0 )
call SetUnitUserData( gg_unit_Ecen_0136, 0 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0136, 100, 100, 100, 0 )
call SetUnitUserData( gg_unit_Ecen_0137, 0 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0137, 100, 100, 100, 0 )
call SetUnitUserData( gg_unit_Ecen_0138, 0 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0138, 100, 100, 100, 0 )
endif
call DestroyGroup(g)
set g = null
set f = null
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_PQ_Button_Click takes nothing returns nothing
set gg_trg_PQ_Button_Click = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_PQ_Button_Click, udg_PQDialog )
call TriggerAddAction( gg_trg_PQ_Button_Click, function Trig_PQ_Button_Click_Actions )
endfunction
function Trig_PQ_Enter_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_PQ_Enter_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local location point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set point = GetRectCenter(gg_rct_PQ1)
call SetUnitPositionLocFacingBJ( u, point, 0.00 )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_PQ_Enter takes nothing returns nothing
set gg_trg_PQ_Enter = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_PQ_Enter, gg_rct_Begin_PQ )
call TriggerAddCondition( gg_trg_PQ_Enter, Condition( function Trig_PQ_Enter_Conditions ) )
call TriggerAddAction( gg_trg_PQ_Enter, function Trig_PQ_Enter_Actions )
endfunction
function Trig_PQ_PQ1_Action_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Ecen_0135 ) ) then
return false
endif
if ( not ( GetUnitUserData(gg_unit_Ecen_0135) == 0 ) ) then
return false
endif
if ( not ( udg_PQ1Foot[1] != 0 ) ) then
return false
endif
return true
endfunction
function Trig_PQ_PQ1_Action_Actions takes nothing returns nothing
local integer a = 1
local integer bodem = 0
local integer bodem1 = 0
set a = 1
loop
exitwhen a > 3
if ( RectContainsUnit(udg_PQ1Region[udg_PQ1Foot[a]], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ1Region[udg_PQ1Foot[a]], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ1Region[udg_PQ1Foot[a]], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ1Region[udg_PQ1Foot[a]], udg_AttributeHero[4]) == true ) then
set bodem = ( bodem + 1 )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 4
if ( RectContainsUnit(udg_PQ1Region[a], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ1Region[a], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ1Region[a], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ1Region[a], udg_AttributeHero[4]) == true ) then
set bodem1 = ( bodem1 + 1 )
endif
set a = a + 1
endloop
if ( bodem >= 3 ) and (bodem1 == 3) then
call SetUnitUserData( gg_unit_Ecen_0135, 1 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0135, 100, 0.00, 0.00, 0 )
call DisplayTextToForce( GetPlayersAll(), ( "Level Complete " + "!" ) )
call AddHeroXP(udg_AttributeHero[1], GetHeroLevel(udg_AttributeHero[1]) * 100, true)
call AddHeroXP(udg_AttributeHero[2], GetHeroLevel(udg_AttributeHero[2]) * 100, true)
call AddHeroXP(udg_AttributeHero[3], GetHeroLevel(udg_AttributeHero[3]) * 100, true)
call AddHeroXP(udg_AttributeHero[4], GetHeroLevel(udg_AttributeHero[4]) * 100, true)
else
call CinematicFilterGenericBJ( 1.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
call TriggerSleepAction( 1.00 )
call DisplayCineFilter(false)
endif
endfunction
//===========================================================================
function InitTrig_PQ_PQ1_Action takes nothing returns nothing
set gg_trg_PQ_PQ1_Action = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_PQ_PQ1_Action, Player(0), true )
call TriggerAddCondition( gg_trg_PQ_PQ1_Action, Condition( function Trig_PQ_PQ1_Action_Conditions ) )
call TriggerAddAction( gg_trg_PQ_PQ1_Action, function Trig_PQ_PQ1_Action_Actions )
endfunction
function Trig_PQ_PQ2_Action_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Ecen_0136 ) ) then
return false
endif
if ( not ( GetUnitUserData(gg_unit_Ecen_0136) == 0 ) ) then
return false
endif
if ( not ( udg_PQ2Foot[1] != 0 ) ) then
return false
endif
return true
endfunction
function Trig_PQ_PQ2_Action_Actions takes nothing returns nothing
local integer a = 1
local integer bodem = 0
local integer bodem1 = 0
set a = 1
loop
exitwhen a > 3
if ( RectContainsUnit(udg_PQ2Region[udg_PQ2Foot[a]], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ2Region[udg_PQ2Foot[a]], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ2Region[udg_PQ2Foot[a]], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ2Region[udg_PQ2Foot[a]], udg_AttributeHero[4]) == true ) then
set bodem = ( bodem + 1 )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 5
if ( RectContainsUnit(udg_PQ2Region[a], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ2Region[a], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ2Region[a], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ2Region[a], udg_AttributeHero[4]) == true ) then
set bodem1 = ( bodem1 + 1 )
endif
set a = a + 1
endloop
if ( bodem >= 3 ) and (bodem1 == 3) then
call SetUnitUserData( gg_unit_Ecen_0136, 1 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0136, 100, 0.00, 0.00, 0 )
call DisplayTextToForce( GetPlayersAll(), ( "Level Complete " + "!" ) )
call AddHeroXP(udg_AttributeHero[1], GetHeroLevel(udg_AttributeHero[1]) * 200, true)
call AddHeroXP(udg_AttributeHero[2], GetHeroLevel(udg_AttributeHero[2]) * 200, true)
call AddHeroXP(udg_AttributeHero[3], GetHeroLevel(udg_AttributeHero[3]) * 200, true)
call AddHeroXP(udg_AttributeHero[4], GetHeroLevel(udg_AttributeHero[4]) * 200, true)
else
call CinematicFilterGenericBJ( 1.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
call TriggerSleepAction( 1.00 )
call DisplayCineFilter(false)
endif
endfunction
//===========================================================================
function InitTrig_PQ_PQ2_Action takes nothing returns nothing
set gg_trg_PQ_PQ2_Action = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_PQ_PQ2_Action, Player(0), true )
call TriggerAddCondition( gg_trg_PQ_PQ2_Action, Condition( function Trig_PQ_PQ2_Action_Conditions ) )
call TriggerAddAction( gg_trg_PQ_PQ2_Action, function Trig_PQ_PQ2_Action_Actions )
endfunction
function Trig_PQ_PQ3_Action_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Ecen_0137 ) ) then
return false
endif
if ( not ( GetUnitUserData(gg_unit_Ecen_0137) == 0 ) ) then
return false
endif
if ( not ( udg_PQ3Foot[1] != 0 ) ) then
return false
endif
return true
endfunction
function Trig_PQ_PQ3_Action_Actions takes nothing returns nothing
local integer a = 1
local integer bodem = 0
local integer bodem1 = 0
set a = 1
loop
exitwhen a > 3
if ( RectContainsUnit(udg_PQ3Region[udg_PQ3Foot[a]], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ3Region[udg_PQ3Foot[a]], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ3Region[udg_PQ3Foot[a]], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ3Region[udg_PQ3Foot[a]], udg_AttributeHero[4]) == true ) then
set bodem = ( bodem + 1 )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 6
if ( RectContainsUnit(udg_PQ3Region[a], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ3Region[a], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ3Region[a], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ3Region[a], udg_AttributeHero[4]) == true ) then
set bodem1 = ( bodem1 + 1 )
endif
set a = a + 1
endloop
if ( bodem >= 3 ) and (bodem1 == 3) then
call SetUnitUserData( gg_unit_Ecen_0137, 1 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0137, 100, 0.00, 0.00, 0 )
call DisplayTextToForce( GetPlayersAll(), ( "Level Complete " + "!" ) )
call AddHeroXP(udg_AttributeHero[1], GetHeroLevel(udg_AttributeHero[1]) * 300, true)
call AddHeroXP(udg_AttributeHero[2], GetHeroLevel(udg_AttributeHero[2]) * 300, true)
call AddHeroXP(udg_AttributeHero[3], GetHeroLevel(udg_AttributeHero[3]) * 300, true)
call AddHeroXP(udg_AttributeHero[4], GetHeroLevel(udg_AttributeHero[4]) * 300, true)
else
call CinematicFilterGenericBJ( 1.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
call TriggerSleepAction( 1.00 )
call DisplayCineFilter(false)
endif
endfunction
//===========================================================================
function InitTrig_PQ_PQ3_Action takes nothing returns nothing
set gg_trg_PQ_PQ3_Action = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_PQ_PQ3_Action, Player(0), true )
call TriggerAddCondition( gg_trg_PQ_PQ3_Action, Condition( function Trig_PQ_PQ3_Action_Conditions ) )
call TriggerAddAction( gg_trg_PQ_PQ3_Action, function Trig_PQ_PQ3_Action_Actions )
endfunction
function Trig_PQ_PQ4_Action_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_Ecen_0138 ) ) then
return false
endif
if ( not ( GetUnitUserData(gg_unit_Ecen_0138) == 0 ) ) then
return false
endif
if ( not ( udg_PQ4Foot[1] != 0 ) ) then
return false
endif
return true
endfunction
function Trig_PQ_PQ4_Action_Actions takes nothing returns nothing
local integer a = 1
local integer bodem = 0
local integer bodem1 = 0
set a = 1
loop
exitwhen a > 3
if ( RectContainsUnit(udg_PQ4Region[udg_PQ4Foot[a]], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ4Region[udg_PQ4Foot[a]], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ4Region[udg_PQ4Foot[a]], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ4Region[udg_PQ4Foot[a]], udg_AttributeHero[4]) == true ) then
set bodem = ( bodem + 1 )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 7
if ( RectContainsUnit(udg_PQ4Region[a], udg_AttributeHero[1]) == true ) or ( RectContainsUnit(udg_PQ4Region[a], udg_AttributeHero[2]) == true ) or ( RectContainsUnit(udg_PQ4Region[a], udg_AttributeHero[3]) == true ) or ( RectContainsUnit(udg_PQ4Region[a], udg_AttributeHero[4]) == true ) then
set bodem1 = ( bodem1 + 1 )
endif
set a = a + 1
endloop
if ( bodem >= 3 ) and (bodem1 == 3) then
call SetUnitUserData( gg_unit_Ecen_0138, 1 )
call SetUnitVertexColorBJ( gg_unit_Ecen_0138, 100, 0.00, 0.00, 0 )
call DisplayTextToForce( GetPlayersAll(), ( "Level Complete " + "!" ) )
call AddHeroXP(udg_AttributeHero[1], GetHeroLevel(udg_AttributeHero[1]) * 400, true)
call AddHeroXP(udg_AttributeHero[2], GetHeroLevel(udg_AttributeHero[2]) * 400, true)
call AddHeroXP(udg_AttributeHero[3], GetHeroLevel(udg_AttributeHero[3]) * 400, true)
call AddHeroXP(udg_AttributeHero[4], GetHeroLevel(udg_AttributeHero[4]) * 400, true)
else
call CinematicFilterGenericBJ( 1.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
call TriggerSleepAction( 1.00 )
call DisplayCineFilter(false)
endif
endfunction
//===========================================================================
function InitTrig_PQ_PQ4_Action takes nothing returns nothing
set gg_trg_PQ_PQ4_Action = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_PQ_PQ4_Action, Player(0), true )
call TriggerAddCondition( gg_trg_PQ_PQ4_Action, Condition( function Trig_PQ_PQ4_Action_Conditions ) )
call TriggerAddAction( gg_trg_PQ_PQ4_Action, function Trig_PQ_PQ4_Action_Actions )
endfunction
function Trig_PQ_End_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetLeavingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_PQ_Region, udg_AttributeHero[1]) == false ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_PQ_Region, udg_AttributeHero[2]) == false ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_PQ_Region, udg_AttributeHero[3]) == false ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_PQ_Region, udg_AttributeHero[4]) == false ) ) then
return false
endif
return true
endfunction
function Trig_PQ_End_Actions takes nothing returns nothing
call ResumeTimer(udg_CreepTimer)
endfunction
//===========================================================================
function InitTrig_PQ_End takes nothing returns nothing
set gg_trg_PQ_End = CreateTrigger( )
call TriggerRegisterLeaveRectSimple( gg_trg_PQ_End, gg_rct_PQ_Region )
call TriggerAddCondition( gg_trg_PQ_End, Condition( function Trig_PQ_End_Conditions ) )
call TriggerAddAction( gg_trg_PQ_End, function Trig_PQ_End_Actions )
endfunction
function Trig_DD_Setup_Actions takes nothing returns nothing
call SetDestructableInvulnerable(gg_dest_ATg3_0160, true)
set udg_DarknessDoorHero[1] = 'n00T'
set udg_DarknessDoorHero[2] = 'n00S'
set udg_DarknessDoorHero[3] = 'z000'
set udg_DarknessDoorHero[4] = 'n00U'
set udg_DarknessDoorHero[5] = 'n00V'
// ----
set udg_DarknessDoorFlag[1] = false
set udg_DarknessDoorFlag[2] = false
set udg_DarknessDoorFlag[3] = false
set udg_DarknessDoorFlag[4] = false
set udg_DarknessDoorFlag[5] = false
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_DD_Setup takes nothing returns nothing
set gg_trg_DD_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_DD_Setup, function Trig_DD_Setup_Actions )
endfunction
function Trig_DD_Enter_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetEnteringUnit()) == Player(0) ) ) then
return false
endif
return true
endfunction
function Trig_DD_Enter_Actions takes nothing returns nothing
call DialogClear(udg_DarknessDoorDialog)
call DialogSetMessage(udg_DarknessDoorDialog, ( "Which Monster You Wish To Face " + "?" ))
if ( udg_DarknessDoorFlag[1] == false ) then
set udg_DarknessDoorButton[1] = DialogAddButton(udg_DarknessDoorDialog, ( "1st - " + "Nether Dragon" ),0)
endif
if ( udg_DarknessDoorFlag[2] == false ) then
set udg_DarknessDoorButton[2] = DialogAddButton(udg_DarknessDoorDialog, ( "2nd - " + "Elder Voidwalker" ),0)
endif
if ( udg_DarknessDoorFlag[3] == false ) then
set udg_DarknessDoorButton[3] = DialogAddButton(udg_DarknessDoorDialog, ( "3rd - " + "Hydralisk" ),0)
endif
if ( udg_DarknessDoorFlag[4] == false ) then
set udg_DarknessDoorButton[4] = DialogAddButton(udg_DarknessDoorDialog, ( "4th - " + "Deeplord Revenant" ),0)
endif
if ( udg_DarknessDoorFlag[5] == false ) then
set udg_DarknessDoorButton[5] = DialogAddButton(udg_DarknessDoorDialog, ( "5th - " + "Fel Ravager" ),0)
endif
set udg_DarknessDoorButton[0] = DialogAddButton(udg_DarknessDoorDialog, ( "Cancel" + " !!!" ),0)
call DialogDisplay(Player(0), udg_DarknessDoorDialog, true)
endfunction
//===========================================================================
function InitTrig_DD_Enter takes nothing returns nothing
set gg_trg_DD_Enter = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_DD_Enter, gg_rct_DarknessDoorGate )
call TriggerAddCondition( gg_trg_DD_Enter, Condition( function Trig_DD_Enter_Conditions ) )
call TriggerAddAction( gg_trg_DD_Enter, function Trig_DD_Enter_Actions )
endfunction
function Trig_DD_Summon_Actions takes nothing returns nothing
local integer a
local location point
local group g = CreateGroup()
local unit f
local unit p
set g = GetUnitsInRectMatching(gg_rct_DarknessRegion, null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetUnitPointValue(f) == 1 ) then
call DialogClear(udg_DarknessDoorDialog)
call DisplayTextToForce( GetPlayersAll(), ( "Sorry ! Not at this time" + " ...." ) )
call DestroyGroup(g)
call RemoveLocation(point)
set g = null
set f = null
set point = null
return
endif
call GroupRemoveUnit(g, f)
endloop
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[0] ) then
call DialogClear(udg_DarknessDoorDialog)
call DestroyGroup(g)
call RemoveLocation(point)
set g = null
set f = null
set point = null
return
endif
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_ATg3_0160 )
call TriggerSleepAction( 20.00 )
call ModifyGateBJ( bj_GATEOPERATION_CLOSE, gg_dest_ATg3_0160 )
call PauseTimer(udg_CreepTimer)
call CameraSetupApplyForPlayer( true, gg_cam_Camera_004, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_004, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_004, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_004, Player(3), 0 )
set a = 1
loop
exitwhen a > 3
set point = PolarProjectionBJ(GetRectCenter(gg_rct_DarknessRegion), 1000.00, I2R(a*120) )
set p = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'e017', point, bj_UNIT_FACING)
call UnitAddAbility(p, 'A07T')
call UnitApplyTimedLife(p, 'BTLF', 1)
set a = a + 1
endloop
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[1] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Prepare for Summoning Nether Dragon" + " ...." ) )
set udg_DarknessDoorFlag[1] = true
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[2] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Prepare for Summoning Elder Voidwalker" + " ...." ) )
set udg_DarknessDoorFlag[2] = true
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[3] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Prepare for Summoning Hydralisk" + " ...." ) )
set udg_DarknessDoorFlag[3] = true
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[4] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Prepare for Summoning Deeplord Revenant" + " ...." ) )
set udg_DarknessDoorFlag[4] = true
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[5] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Prepare for Summoning Fel Ravager" + " ...." ) )
set udg_DarknessDoorFlag[5] = true
endif
//-----------------------
call TriggerSleepAction( 20.00 )
call DisplayTextToForce( GetPlayersAll(), ( "You have 10 minutes to kill this monster !" ) )
set point = GetRectCenter(gg_rct_DarknessRegion)
set p = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'e01A', point, bj_UNIT_FACING)
call UnitApplyTimedLife(p, 'BTLF', 1)
//-----------------------
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[1] ) then
set p = CreateUnitAtLoc(Player(11), udg_DarknessDoorHero[1], point, bj_UNIT_FACING)
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[2] ) then
set p = CreateUnitAtLoc(Player(11), udg_DarknessDoorHero[2], point, bj_UNIT_FACING)
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[3] ) then
set p = CreateUnitAtLoc(Player(11), udg_DarknessDoorHero[3], point, bj_UNIT_FACING)
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[4] ) then
set p = CreateUnitAtLoc(Player(11), udg_DarknessDoorHero[4], point, bj_UNIT_FACING)
endif
if ( GetClickedButtonBJ() == udg_DarknessDoorButton[5] ) then
set p = CreateUnitAtLoc(Player(11), udg_DarknessDoorHero[5], point, bj_UNIT_FACING)
endif
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], udg_CreepLevel)
call SetUnitAnimation( p, "birth" )
call UnitApplyTimedLife(p, 'BTLF', 600)
call TriggerSleepAction( 1.00 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_005, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_005, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_005, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_005, Player(3), 0 )
call TriggerExecute( gg_trg_DD_Check_End )
call DestroyGroup(g)
set g = null
set f = null
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_DD_Summon takes nothing returns nothing
set gg_trg_DD_Summon = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_DD_Summon, udg_DarknessDoorDialog )
call TriggerAddAction( gg_trg_DD_Summon, function Trig_DD_Summon_Actions )
endfunction
function Trig_DD_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetDyingUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_DD_Die_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
if ( GetUnitTypeId(GetDyingUnit()) == udg_DarknessDoorHero[1] ) and ( IsUnitAlly(GetKillingUnitBJ(), Player(0)) == true ) then
call CreateItemLoc( 'I01H', point )
call ResumeTimer(udg_CreepTimer)
endif
if ( GetUnitTypeId(GetDyingUnit()) == udg_DarknessDoorHero[2] ) and ( IsUnitAlly(GetKillingUnitBJ(), Player(0)) == true ) then
call CreateItemLoc( 'I01G', point )
call ResumeTimer(udg_CreepTimer)
endif
if ( GetUnitTypeId(GetDyingUnit()) == udg_DarknessDoorHero[3] ) and ( IsUnitAlly(GetKillingUnitBJ(), Player(0)) == true ) then
call CreateItemLoc( 'I01J', point )
call ResumeTimer(udg_CreepTimer)
endif
if ( GetUnitTypeId(GetDyingUnit()) == udg_DarknessDoorHero[4] ) and ( IsUnitAlly(GetKillingUnitBJ(), Player(0)) == true ) then
call CreateItemLoc( 'I01I', point )
call ResumeTimer(udg_CreepTimer)
endif
if ( GetUnitTypeId(GetDyingUnit()) == udg_DarknessDoorHero[5] ) and ( IsUnitAlly(GetKillingUnitBJ(), Player(0)) == true ) then
call CreateItemLoc( 'I01M', point )
call ResumeTimer(udg_CreepTimer)
endif
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_ATg3_0160 )
call TriggerSleepAction( 20.00 )
call ModifyGateBJ( bj_GATEOPERATION_CLOSE, gg_dest_ATg3_0160 )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_DD_Die takes nothing returns nothing
set gg_trg_DD_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DD_Die, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_DD_Die, Condition( function Trig_DD_Die_Conditions ) )
call TriggerAddAction( gg_trg_DD_Die, function Trig_DD_Die_Actions )
endfunction
function Revive_Hero_Con takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_AttributeHero[1], GetUnitsInRectAll(gg_rct_DarknessRegion)) == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(udg_AttributeHero[2], GetUnitsInRectAll(gg_rct_DarknessRegion)) == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(udg_AttributeHero[3], GetUnitsInRectAll(gg_rct_DarknessRegion)) == false ) ) then
return false
endif
if ( not ( IsUnitInGroup(udg_AttributeHero[4], GetUnitsInRectAll(gg_rct_DarknessRegion)) == false ) ) then
return false
endif
return true
endfunction
function Trig_DD_Check_End_Actions takes nothing returns nothing
call TriggerSleepAction( 2.00 )
if ( Revive_Hero_Con() ) then
call ResumeTimer(udg_CreepTimer)
endif
endfunction
//===========================================================================
function InitTrig_DD_Check_End takes nothing returns nothing
set gg_trg_DD_Check_End = CreateTrigger( )
call TriggerAddAction( gg_trg_DD_Check_End, function Trig_DD_Check_End_Actions )
endfunction
function Trig_COT_Create_Cloud_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A07T', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_COT_Create_Cloud_Actions takes nothing returns nothing
local unit u
local unit array t
local unit array y
local location point = GetUnitLoc(GetDyingUnit())
local integer a
set u = CreateUnitAtLoc(Player(PLAYER_NEUTRAL_AGGRESSIVE), 'n00W', point, bj_UNIT_FACING)
call UnitApplyTimedLife(u, 'BTLF', 20)
call IssuePointOrderLoc( u, "move", point )
//--------------------------
set point = GetRectCenter(gg_rct_DarknessRegion)
set a = 1
loop
exitwhen a > 3
set y[a] = CreateUnitAtLoc(GetOwningPlayer(u), 'e004', point, bj_UNIT_FACING)
call SetUnitFlyHeight(y[a], 790, 9999)
call UnitAddAbility(y[a],'A042')
//--------------------------
set t[a] = CreateUnitAtLoc(GetOwningPlayer(u), 'e00G', point, bj_UNIT_FACING)
call SetUnitFlyHeight(t[a], -200, 9999)
set a = a + 1
endloop
loop
exitwhen ( IsUnitAliveBJ(u) == false )
set a = 1
loop
exitwhen a > 3
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 150.00), GetRandomDirectionDeg())
call SetUnitPositionLoc( y[a], point )
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 300.00), GetRandomDirectionDeg())
call SetUnitPositionLoc( t[a], point )
call IssueTargetOrder( y[a], "chainlightning", t[a] )
set a = a + 1
endloop
call TriggerSleepAction( 1.00 )
endloop
call RemoveUnit( t[1] )
call RemoveUnit( t[2] )
call RemoveUnit( t[3] )
call RemoveUnit( y[1] )
call RemoveUnit( y[2] )
call RemoveUnit( y[3] )
call RemoveLocation(point)
set point = null
set u = null
set t[1] = null
set t[2] = null
set t[3] = null
set y[1] = null
set y[2] = null
set y[3] = null
endfunction
//===========================================================================
function InitTrig_COT_Create_Cloud takes nothing returns nothing
set gg_trg_COT_Create_Cloud = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_COT_Create_Cloud, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_COT_Create_Cloud, Condition( function Trig_COT_Create_Cloud_Conditions ) )
call TriggerAddAction( gg_trg_COT_Create_Cloud, function Trig_COT_Create_Cloud_Actions )
endfunction
function Trig_HA_Creep_Setup_Actions takes nothing returns nothing
local integer a = 0
set udg_DarknessHero[0] = gg_unit_N00O_0043
set udg_DarknessHero[1] = gg_unit_H000_0087
set udg_DarknessHero[2] = gg_unit_U000_0116
set udg_DarknessHero[3] = gg_unit_N00P_0117
set udg_DarknessHero[4] = gg_unit_N00N_0118
set udg_DarknessHero[5] = gg_unit_E019_0119
set udg_DarknessHero[6] = gg_unit_N00R_0120
set udg_DarknessHero[7] = gg_unit_N00Q_0059
set udg_DarknessHero[8] = gg_unit_N00M_0001
call SetUnitInvulnerable( udg_DarknessHero[8], true )
set udg_DarknessFirst = false
loop
exitwhen a > 7
call GroupAddUnit(udg_DarknessGroup, udg_DarknessHero[a])
call SetUnitInvulnerable( udg_DarknessHero[a], true )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_HA_Creep_Setup takes nothing returns nothing
set gg_trg_HA_Creep_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_HA_Creep_Setup, function Trig_HA_Creep_Setup_Actions )
endfunction
function Trig_HA_Creep_Begin_Actions takes nothing returns nothing
local location point
local integer a
local unit p
call PauseTimer(udg_CreepTimer)
call PauseAllUnitsBJ( true )
call EnableTrigger( gg_trg_HA_Make_Effect_Mo_Dan )
// Cinematic
call CinematicModeBJ( true, GetPlayersAll() )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 2, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 0, 0, 50.00 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(3), 0 )
// String
if ( udg_DarknessFirst == false ) then
call PlayMusicBJ( gg_snd_HeroAttackFirst )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "Now, my heroes !!! Who want to destroy CAT's team " + "?" ), bj_TIMETYPE_ADD, 0, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "No One " + "?" ), bj_TIMETYPE_ADD, 0, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "Ok then, I will randomly call one of your name " + "!" ), bj_TIMETYPE_ADD, 0, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "I call " + "......." ), bj_TIMETYPE_ADD, 0, true )
else
call PlayMusicBJ( gg_snd_HeroAttackContinue )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "Ok, next hero is " + "...." ), bj_TIMETYPE_ADD, 0, true )
endif
// String
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 0.50, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 0.00, 0, 0, 0.00 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(3), 0 )
// Effect
call GroupClear( udg_DarknessGroupMove )
set a = 0
loop
exitwhen a > 10
set point = GetUnitLoc(udg_DarknessHero[8])
set p = CreateUnitAtLoc(Player(0), 'e018', point, bj_UNIT_FACING)
call UnitApplyTimedLife(p, 'BTLF', 45)
call GroupAddUnit(udg_DarknessGroupMove, p)
set point = PolarProjectionBJ(GetUnitLoc(udg_DarknessHero[8]), ( ( 1100.00 / 10.00 ) * I2R(a) ), 90.00)
call IssuePointOrderLoc( p, "move", point )
set a = a + 1
endloop
set udg_DarknessDauKim = p
// Effect
call TriggerSleepAction( 2 )
set a = 0
loop
exitwhen a > 36
set point = PolarProjectionBJ(GetUnitLoc(udg_DarknessHero[8]), 1100.00, ( ( 360.00 / 36.00 ) * I2R(a) ))
set p = CreateUnitAtLoc(Player(0), 'e013', point, bj_UNIT_FACING)
call UnitApplyTimedLife(p, 'BTLF', 45)
call SetUnitFlyHeight( p, 100.00, ( 2400.00 * 0.70 ) )
set a = a + 1
endloop
call TriggerSleepAction( 2 )
set udg_DarknessBodem = 0
set udg_DarknessStep = 10.00
set udg_DarknessRange = 100.00
set udg_DarknessFirst = true
call EnableTrigger( gg_trg_HA_Creep_Move_Clock )
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_HA_Creep_Begin takes nothing returns nothing
set gg_trg_HA_Creep_Begin = CreateTrigger( )
call TriggerAddAction( gg_trg_HA_Creep_Begin, function Trig_HA_Creep_Begin_Actions )
endfunction
function Trig_HA_Creep_Last_Hero_Actions takes nothing returns nothing
local location point
local unit p
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_002, Player(3), 0 )
// -----------
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "Oh, this time I have to go " + "...." ), bj_TIMETYPE_ADD, 0, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( "CAT's team, your journey will be over " + "!!!" ), bj_TIMETYPE_ADD, 0, true )
// -----------
set point = GetRectCenter(gg_rct_Creep_Trai_Begin)
set p = CreateUnitAtLoc(Player(10), GetUnitTypeId(udg_DarknessHero[8]), point, bj_UNIT_FACING)
call SetHeroLevel(p, udg_CreepLevel, false)
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
set point = GetRectCenter(gg_rct_Creep_Trai_So_2)
call IssuePointOrderLoc( p, "attack", point )
// -----------------------------
set point = GetRectCenter(gg_rct_Creep_Phai_Begin)
set p = CreateUnitAtLoc(Player(11), GetUnitTypeId(udg_DarknessHero[8]), point, bj_UNIT_FACING)
call SetHeroLevel(p, udg_CreepLevel, false)
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
set point = GetRectCenter(gg_rct_Creep_Phai_So_2)
call IssuePointOrderLoc( p, "attack", point )
// -----------
call CinematicModeBJ( false, GetPlayersAll() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(3), 0 )
call SelectUnitForPlayerSingle( udg_AttributeHero[1], Player(0) )
call SelectUnitForPlayerSingle( udg_AttributeHero[2], Player(1) )
call SelectUnitForPlayerSingle( udg_AttributeHero[3], Player(2) )
call SelectUnitForPlayerSingle( udg_AttributeHero[4], Player(3) )
// -----------------------------
call ResumeTimer(udg_CreepTimer)
call PauseAllUnitsBJ( false )
call DisableTrigger( gg_trg_HA_Make_Effect_Mo_Dan )
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_HA_Creep_Last_Hero takes nothing returns nothing
set gg_trg_HA_Creep_Last_Hero = CreateTrigger( )
call TriggerAddAction( gg_trg_HA_Creep_Last_Hero, function Trig_HA_Creep_Last_Hero_Actions )
endfunction
function Trig_HA_Creep_Move_Clock_Conditions takes nothing returns boolean
if ( not ( IsUnitGroupEmptyBJ(udg_DarknessGroupMove) == false ) ) then
return false
endif
return true
endfunction
function Trig_HA_Creep_Move_Clock_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
local location point
local location point1 = GetUnitLoc(udg_DarknessHero[8])
local integer a
local unit p
call GroupAddGroup( udg_DarknessGroupMove, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
set point = GetUnitLoc(f)
call SetUnitPositionLocFacingBJ( f, PolarProjectionBJ(point1, DistanceBetweenPoints(point1, point), ( AngleBetweenPoints(point1, point) + udg_DarknessStep )), bj_UNIT_FACING )
set p = CreateUnitAtLoc(Player(0), 'e018', point, bj_UNIT_FACING)
call SetUnitUserData( p, 30 )
call GroupAddUnit(udg_DarknessGroupEffectMoDan, p)
call GroupRemoveUnit(g, f)
endloop
set udg_DarknessBodem = ( udg_DarknessBodem + 1 )
if ( udg_DarknessBodem == 120 ) then
set udg_DarknessStep = ( udg_DarknessStep / 1.50 )
endif
if ( udg_DarknessBodem == 180 ) then
set udg_DarknessStep = ( udg_DarknessStep / 2.00 )
set udg_DarknessVictim = GroupPickRandomUnit(udg_DarknessGroup)
call GroupRemoveUnit( udg_DarknessGroup, udg_DarknessVictim )
endif
if ( udg_DarknessBodem > 180 ) then
set point = GetUnitLoc(udg_DarknessDauKim)
if ( IsUnitInGroup(udg_DarknessVictim, GetUnitsInRangeOfLocAll(udg_DarknessRange, point)) == true ) then
call DisableTrigger( GetTriggeringTrigger() )
call CinematicFadeBJ( bj_CINEFADETYPE_FADEOUTIN, 1, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 50.00 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_003, Player(3), 0 )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessHero[8], GetHeroProperName(udg_DarknessHero[8]), null, ( ( "Ok " + GetUnitName(udg_DarknessVictim) ) + " you go ?" ), bj_TIMETYPE_ADD, 0, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_DarknessVictim, GetHeroProperName(udg_DarknessVictim), null, ( "As you wish, my lord" + "!!!" ), bj_TIMETYPE_ADD, 0, true )
call TriggerSleepAction( 2 )
call CinematicModeBJ( false, GetPlayersAll() )
// -----------------------------
set point = GetRectCenter(gg_rct_Creep_Trai_Begin)
set p = CreateUnitAtLoc(Player(10), GetUnitTypeId(udg_DarknessVictim), point, bj_UNIT_FACING)
call SetHeroLevel(p, udg_CreepLevel, false)
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
set point = GetRectCenter(gg_rct_Creep_Trai_So_2)
call IssuePointOrderLoc( p, "attack", point )
// -----------------------------
set point = GetRectCenter(gg_rct_Creep_Phai_Begin)
set p = CreateUnitAtLoc(Player(11), GetUnitTypeId(udg_DarknessVictim), point, bj_UNIT_FACING)
call SetHeroLevel(p, udg_CreepLevel, false)
call UnitAddAbility( p, udg_CreepHP[udg_CreepGameType] )
call SetUnitAbilityLevel(p, udg_CreepHP[udg_CreepGameType], GetUnitLevel(p))
set point = GetRectCenter(gg_rct_Creep_Phai_So_2)
call IssuePointOrderLoc( p, "attack", point )
set a = 0
loop
exitwhen a > 7
if ( GetUnitTypeId(udg_DarknessVictim) == GetUnitTypeId(udg_DarknessHero[a]) ) then
call RemoveUnit( udg_DarknessHero[a] )
endif
set a = a + 1
endloop
// -----------------------------
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(0), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(1), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(2), 0 )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(3), 0 )
call SelectUnitForPlayerSingle( udg_AttributeHero[1], Player(0) )
call SelectUnitForPlayerSingle( udg_AttributeHero[2], Player(1) )
call SelectUnitForPlayerSingle( udg_AttributeHero[3], Player(2) )
call SelectUnitForPlayerSingle( udg_AttributeHero[4], Player(3) )
// -----------------------------
call ResumeTimer(udg_CreepTimer)
call PauseAllUnitsBJ( false )
call DisableTrigger( gg_trg_HA_Make_Effect_Mo_Dan )
endif
endif
if ( udg_DarknessBodem > 320 ) then
set udg_DarknessRange = 150.00
endif
if ( udg_DarknessBodem > 400 ) then
call DisableTrigger( GetTriggeringTrigger() )
call TriggerExecute( gg_trg_HA_Creep_Last_Hero )
endif
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set f = null
call DestroyGroup(g)
set g = null
set p = null
endfunction
//===========================================================================
function InitTrig_HA_Creep_Move_Clock takes nothing returns nothing
set gg_trg_HA_Creep_Move_Clock = CreateTrigger( )
call DisableTrigger( gg_trg_HA_Creep_Move_Clock )
call TriggerRegisterTimerEventPeriodic( gg_trg_HA_Creep_Move_Clock, 0.07 )
call TriggerAddCondition( gg_trg_HA_Creep_Move_Clock, Condition( function Trig_HA_Creep_Move_Clock_Conditions ) )
call TriggerAddAction( gg_trg_HA_Creep_Move_Clock, function Trig_HA_Creep_Move_Clock_Actions )
endfunction
function Trig_HA_Make_Effect_Mo_Dan_Conditions takes nothing returns boolean
if ( not ( IsUnitGroupEmptyBJ(udg_DarknessGroupEffectMoDan) == false ) ) then
return false
endif
return true
endfunction
function Trig_HA_Make_Effect_Mo_Dan_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_DarknessGroupEffectMoDan, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
call SetUnitUserData( f, ( GetUnitUserData(f) + 10 ) )
call SetUnitVertexColorBJ( f, 100, 0.00, 0.00, I2R(GetUnitUserData(f)) )
call GroupRemoveUnit(g, f)
if ( GetUnitUserData(f) >= 100 ) then
call GroupRemoveUnit(udg_DarknessGroupEffectMoDan, f)
call RemoveUnit( f )
endif
endloop
set f = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_HA_Make_Effect_Mo_Dan takes nothing returns nothing
set gg_trg_HA_Make_Effect_Mo_Dan = CreateTrigger( )
call DisableTrigger( gg_trg_HA_Make_Effect_Mo_Dan )
call TriggerRegisterTimerEventPeriodic( gg_trg_HA_Make_Effect_Mo_Dan, 0.10 )
call TriggerAddCondition( gg_trg_HA_Make_Effect_Mo_Dan, Condition( function Trig_HA_Make_Effect_Mo_Dan_Conditions ) )
call TriggerAddAction( gg_trg_HA_Make_Effect_Mo_Dan, function Trig_HA_Make_Effect_Mo_Dan_Actions )
endfunction
function Trig_Create_Board_Actions takes nothing returns nothing
call PlayMusicBJ( gg_snd_ChosingHero )
call DialogClear(udg_CreepDialog)
call DialogSetMessage(udg_CreepDialog, ( "Game " + "Mode !" ))
set udg_CreepButton[1] = DialogAddButton(udg_CreepDialog, ( "Easy " + "Mode" ),0)
set udg_CreepButton[2] = DialogAddButton(udg_CreepDialog, ( "Normal " + "Mode" ),0)
set udg_CreepButton[3] = DialogAddButton(udg_CreepDialog, ( "Hard " + "Mode" ),0)
call DialogDisplay(Player(0), udg_CreepDialog, true)
endfunction
//===========================================================================
function InitTrig_Create_Board takes nothing returns nothing
set gg_trg_Create_Board = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Create_Board, 2.00 )
call TriggerAddAction( gg_trg_Create_Board, function Trig_Create_Board_Actions )
endfunction
function Trig_GT_Event_Actions takes nothing returns nothing
if ( GetClickedButtonBJ() == udg_CreepButton[1] ) then
set udg_CreepGameType = 1
call DisplayTextToForce( GetPlayersAll(), ( "Game Mod Set To : " + "Easy" ) )
call LeaderboardSetLabelBJ( GetLastCreatedLeaderboard(), ( "CAT's Team " + "- Easy Mode" ) )
call DialogClear( udg_CreepDialog )
endif
if ( GetClickedButtonBJ() == udg_CreepButton[2] ) then
set udg_CreepGameType = 2
call DisplayTextToForce( GetPlayersAll(), ( "Game Mod Set To : " + "Normal" ) )
call LeaderboardSetLabelBJ( GetLastCreatedLeaderboard(), ( "CAT's Team " + "- Normal Mode" ) )
call DialogClear( udg_CreepDialog )
endif
if ( GetClickedButtonBJ() == udg_CreepButton[3] ) then
set udg_CreepGameType = 3
call DisplayTextToForce( GetPlayersAll(), ( "Game Mod Set To : " + "Hard" ) )
call LeaderboardSetLabelBJ( GetLastCreatedLeaderboard(), ( "CAT's Team " + "- Hard Mode" ) )
call DialogClear( udg_CreepDialog )
endif
endfunction
//===========================================================================
function InitTrig_GT_Event takes nothing returns nothing
set gg_trg_GT_Event = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_GT_Event, udg_CreepDialog )
call TriggerAddAction( gg_trg_GT_Event, function Trig_GT_Event_Actions )
endfunction
function Trig_Destroy_Text_Actions takes nothing returns nothing
local texttag t = GetLastCreatedTextTag()
call TriggerSleepAction( 2.5 )
call DestroyTextTag( t )
set t=null
endfunction
//===========================================================================
function InitTrig_Destroy_Text takes nothing returns nothing
set gg_trg_Destroy_Text = CreateTrigger( )
call TriggerAddAction( gg_trg_Destroy_Text, function Trig_Destroy_Text_Actions )
endfunction
function Trig_Teleport_Regin_Left_Conditions takes nothing returns boolean
if ( not ( IsUnitAlly(GetEnteringUnit(), Player(0)) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Teleport_Regin_Left_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local location point = GetUnitLoc(u)
if ( GetUnitAbilityLevel(u, 'A04X') > 0 ) then
call UnitRemoveAbility( u, 'A04X' )
return
endif
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbility(u, 'A04W' )
call SetUnitPositionLocFacingBJ( u, GetRectCenter(gg_rct_Out_tele), 90.00 )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Teleport_Regin_Left takes nothing returns nothing
set gg_trg_Teleport_Regin_Left = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleport_Regin_Left, gg_rct_Left_Tele )
call TriggerAddCondition( gg_trg_Teleport_Regin_Left, Condition( function Trig_Teleport_Regin_Left_Conditions ) )
call TriggerAddAction( gg_trg_Teleport_Regin_Left, function Trig_Teleport_Regin_Left_Actions )
endfunction
function Trig_Teleport_Regin_Right_Conditions takes nothing returns boolean
if ( not ( IsUnitAlly(GetEnteringUnit(), Player(0)) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Teleport_Regin_Right_Actions takes nothing returns nothing
local unit u = GetEnteringUnit()
local location point = GetUnitLoc(u)
if ( GetUnitAbilityLevel(u, 'A04X') > 0 ) then
call UnitRemoveAbility(u, 'A04X')
return
endif
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbility(u, 'A04W')
call SetUnitPositionLocFacingBJ( u, GetRectCenter(gg_rct_Out_tele), 90.00 )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Teleport_Regin_Right takes nothing returns nothing
set gg_trg_Teleport_Regin_Right = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleport_Regin_Right, gg_rct_Right_Tele )
call TriggerAddCondition( gg_trg_Teleport_Regin_Right, Condition( function Trig_Teleport_Regin_Right_Conditions ) )
call TriggerAddAction( gg_trg_Teleport_Regin_Right, function Trig_Teleport_Regin_Right_Actions )
endfunction
function Trig_Teleport_Region_Center_Conditions takes nothing returns boolean
if ( not ( IsUnitAlly(GetEnteringUnit(), Player(0)) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetEnteringUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Teleport_Region_Center_Actions takes nothing returns nothing
local integer chance = GetRandomInt(1, 2)
local unit u = GetEnteringUnit()
local location point = GetUnitLoc(u)
if ( GetUnitAbilityLevel(u, 'A04W') > 0 ) then
call UnitRemoveAbility(u, 'A04W')
return
endif
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbility(u, 'A04X')
if (chance == 1) then
set point = GetRectCenter(gg_rct_Left_Tele)
call SetUnitPositionLocFacingBJ( u, point, 90.00 )
else
set point = GetRectCenter(gg_rct_Right_Tele)
call SetUnitPositionLocFacingBJ( u, point, 90.00 )
endif
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Teleport_Region_Center takes nothing returns nothing
set gg_trg_Teleport_Region_Center = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Teleport_Region_Center, gg_rct_Out_tele )
call TriggerAddCondition( gg_trg_Teleport_Region_Center, Condition( function Trig_Teleport_Region_Center_Conditions ) )
call TriggerAddAction( gg_trg_Teleport_Region_Center, function Trig_Teleport_Region_Center_Actions )
endfunction
function Trig_Anti_Slow_Actions takes nothing returns nothing
call SetPlayerHandicapXP(Player(10), 0)
call SetPlayerHandicapXP(Player(11), 0)
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Anti_Slow takes nothing returns nothing
set gg_trg_Anti_Slow = CreateTrigger( )
call TriggerAddAction( gg_trg_Anti_Slow, function Trig_Anti_Slow_Actions )
endfunction
function Trig_Sign_Special_Stone_Actions takes nothing returns nothing
local integer a
local location point
call DisplayTimedTextToForce( GetPlayersAll(), 30, ( "Each Player Can Control 1 Special Stone " + "!!!" ) )
set a = 1
loop
exitwhen a > 5
set point = GetUnitLoc(gg_unit_nbse_0012)
call PingMinimapLocForForceEx( GetPlayersAll(), point, 1, bj_MINIMAPPINGSTYLE_FLASHY, 100, 0.00, 0.00 )
set point = GetUnitLoc(gg_unit_nbse_0128)
call PingMinimapLocForForceEx( GetPlayersAll(), point, 1, bj_MINIMAPPINGSTYLE_FLASHY, 0.00, 0.00, 100.00 )
set point = GetUnitLoc(gg_unit_nbse_0127)
call PingMinimapLocForForceEx( GetPlayersAll(), point, 1, bj_MINIMAPPINGSTYLE_FLASHY, 0.00, 100.00, 100.00 )
set point = GetUnitLoc(gg_unit_nbse_0182)
call PingMinimapLocForForceEx( GetPlayersAll(), point, 1, bj_MINIMAPPINGSTYLE_FLASHY, 100.00, 0.00, 100.00 )
call TriggerSleepAction( 2 )
set a = a + 1
endloop
call RemoveLocation(point)
set point = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Sign_Special_Stone takes nothing returns nothing
set gg_trg_Sign_Special_Stone = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Sign_Special_Stone, 50.00 )
call TriggerAddAction( gg_trg_Sign_Special_Stone, function Trig_Sign_Special_Stone_Actions )
endfunction
function Trig_Player_Left_The_Game_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
call DisplayTextToForce( GetPlayersAll(), ( ( "Player " + GetPlayerName(GetTriggerPlayer()) ) + " has left the game." ) )
call DisplayTextToForce( GetPlayersAll(), ( ( "All unit belong to " + GetPlayerName(GetTriggerPlayer()) ) + " are removed from the game." ) )
call RemoveUnit( udg_AttributeHero[GetConvertedPlayerId(GetTriggerPlayer())] )
call LeaderboardSetPlayerItemLabelBJ( GetTriggerPlayer(), GetLastCreatedLeaderboard(), ( "--> Left The Game" + "!!!" ) )
set g = GetUnitsInRectMatching(GetPlayableMapRect(), null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetTriggerPlayer() ) then
call RemoveUnit( f )
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_Player_Left_The_Game takes nothing returns nothing
set gg_trg_Player_Left_The_Game = CreateTrigger( )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Left_The_Game, Player(0) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Left_The_Game, Player(1) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Left_The_Game, Player(2) )
call TriggerRegisterPlayerEventLeave( gg_trg_Player_Left_The_Game, Player(3) )
call TriggerAddAction( gg_trg_Player_Left_The_Game, function Trig_Player_Left_The_Game_Actions )
endfunction
function Trig_Revive_Hero_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'U001' ) ) then
return false
endif
if ( not ( IsUnitType(GetDyingUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Revive_Hero_Action takes nothing returns nothing
local unit u = GetDyingUnit()
local location temppoint = GetRectCenter(gg_rct_Hero_Start)
local timerdialog timerdial
local timer tx = CreateTimer()
local integer a
local group g = CreateGroup()
local unit f
call TriggerSleepAction( 2.00 )
call DisplayTextToForce( GetPlayersAll(), ( GetHeroProperName(u) + " Will Revive In 15 Seconds !!!!" ) )
call TimerStart(tx,15,false,null)
call CreateTimerDialogBJ( tx, GetPlayerName(GetOwningPlayer(u)) )
set timerdial = GetLastCreatedTimerDialogBJ()
call TriggerSleepAction( 15.00 )
call DestroyTimerDialog(timerdial)
call DestroyTimer(tx)
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(u), 0 )
call ReviveHeroLoc( u, temppoint, true )
//Quezacotl Armor
set a = 1
loop
exitwhen a > 6
if ( GetItemTypeId(UnitItemInSlotBJ(u, a)) == 'I01B' ) then
call UnitRemoveItemFromSlotSwapped( a, u )
call UnitAddItemSwapped( GetLastRemovedItem(), u )
endif
set a = a + 1
endloop
//Quezacotl Armor
call TriggerExecute( gg_trg_DD_Check_End )
call DestroyGroup(g)
set g = null
set f = null
call RemoveLocation(temppoint)
set tx = null
set timerdial = null
set u = null
set temppoint = null
endfunction
//===========================================================================
function InitTrig_Revive_Hero takes nothing returns nothing
set gg_trg_Revive_Hero = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Hero, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Hero, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Hero, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Hero, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive_Hero, Condition( function Trig_Revive_Hero_Conditions ) )
call TriggerAddAction( gg_trg_Revive_Hero, function Trig_Revive_Hero_Action )
endfunction
function Trig_Create_Wisp_Actions takes nothing returns nothing
local location point = GetRectCenter(gg_rct_Region_Pick_Hero)
local unit p
set p = CreateUnitAtLoc(Player(0), 'ewsp', point, bj_UNIT_FACING)
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_GOLD, 2300 )
call SetPlayerHandicapXP( Player(0), 0 )
// -----------------------------------
set p = CreateUnitAtLoc(Player(1), 'ewsp', point, bj_UNIT_FACING)
call SetPlayerStateBJ( Player(1), PLAYER_STATE_RESOURCE_GOLD, 2300 )
call SetPlayerHandicapXP( Player(1), 0 )
// -----------------------------------
set p = CreateUnitAtLoc(Player(2), 'ewsp', point, bj_UNIT_FACING)
call SetPlayerStateBJ( Player(2), PLAYER_STATE_RESOURCE_GOLD, 2300 )
call SetPlayerHandicapXP( Player(2), 0 )
// -----------------------------------
set p = CreateUnitAtLoc(Player(3), 'ewsp', point, bj_UNIT_FACING)
call SetPlayerStateBJ( Player(3), PLAYER_STATE_RESOURCE_GOLD, 2300 )
call SetPlayerHandicapXP( Player(3), 0 )
// -----------------------------------
call RemoveLocation(point)
set point = null
set p = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Create_Wisp takes nothing returns nothing
set gg_trg_Create_Wisp = CreateTrigger( )
call TriggerAddAction( gg_trg_Create_Wisp, function Trig_Create_Wisp_Actions )
endfunction
function Trig_Hero_Setup_Actions takes nothing returns nothing
local unit u=GetLastCreatedUnit()
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_HeroViewingSkillGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(u) ) then
call SetUnitOwner( f, Player(PLAYER_NEUTRAL_PASSIVE), true )
endif
call GroupRemoveUnit(g, f)
endloop
call SetPlayerName( GetOwningPlayer(u), ( GetPlayerName(GetOwningPlayer(u)) + ( ( " (" + GetUnitName(u) ) + ")" ) ) )
call ShowUnitHide( u )
call UnitAddItemById(u, 'phea' )
call UnitAddItemById(u, 'pman' )
call TriggerSleepAction( 1.00 )
call ShowUnitShow( u )
//-------------Check and Remove Hero Viewing System
call DestroyGroup(g)
set g = null
set f = null
set u = null
endfunction
//===========================================================================
function InitTrig_Hero_Setup takes nothing returns nothing
set gg_trg_Hero_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_Hero_Setup, function Trig_Hero_Setup_Actions )
endfunction
function Trig_Hero_1_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_1_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Harf', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 3
call EnableTrigger( udg_AntiSlowHero3[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_1 takes nothing returns nothing
set gg_trg_Hero_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_1, gg_rct_Human__Arthas )
call TriggerAddCondition( gg_trg_Hero_1, Condition( function Trig_Hero_1_Conditions ) )
call TriggerAddAction( gg_trg_Hero_1, function Trig_Hero_1_Actions )
endfunction
function Trig_Hero_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_2_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hjai', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
call RemoveLocation(point)
set point = null
//
set a = 1
loop
exitwhen a > 7
call EnableTrigger( udg_AntiSlowHero1[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_2 takes nothing returns nothing
set gg_trg_Hero_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_2, gg_rct_Human_Jaina )
call TriggerAddCondition( gg_trg_Hero_2, Condition( function Trig_Hero_2_Conditions ) )
call TriggerAddAction( gg_trg_Hero_2, function Trig_Hero_2_Actions )
endfunction
function Trig_Hero_3_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_3_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hkal', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 5
call EnableTrigger( udg_AntiSlowHero4[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_3 takes nothing returns nothing
set gg_trg_Hero_3 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_3, gg_rct_Human_Kael )
call TriggerAddCondition( gg_trg_Hero_3, Condition( function Trig_Hero_3_Conditions ) )
call TriggerAddAction( gg_trg_Hero_3, function Trig_Hero_3_Actions )
endfunction
function Trig_Hero_13_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_13_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hmbr', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 4
call EnableTrigger( udg_AntiSlowHero2[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_13 takes nothing returns nothing
set gg_trg_Hero_13 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_13, gg_rct_Human_Muradin )
call TriggerAddCondition( gg_trg_Hero_13, Condition( function Trig_Hero_13_Conditions ) )
call TriggerAddAction( gg_trg_Hero_13, function Trig_Hero_13_Actions )
endfunction
function Trig_Hero_14_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_14_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hgam', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\ReviveHuman\\ReviveHuman.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 9
call EnableTrigger( udg_AntiSlowHero17[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_14 takes nothing returns nothing
set gg_trg_Hero_14 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_14, gg_rct_Human_Medivh )
call TriggerAddCondition( gg_trg_Hero_14, Condition( function Trig_Hero_14_Conditions ) )
call TriggerAddAction( gg_trg_Hero_14, function Trig_Hero_14_Actions )
endfunction
function Trig_Hero_21_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_21_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hapm', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 9
call EnableTrigger( udg_AntiSlowHero21[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_21 takes nothing returns nothing
set gg_trg_Hero_21 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_21, gg_rct_Human_Proudmoore )
call TriggerAddCondition( gg_trg_Hero_21, Condition( function Trig_Hero_21_Conditions ) )
call TriggerAddAction( gg_trg_Hero_21, function Trig_Hero_21_Actions )
endfunction
function Trig_Hero_4_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_4_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Emns', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 12
call EnableTrigger( udg_AntiSlowHero16[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_4 takes nothing returns nothing
set gg_trg_Hero_4 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_4, gg_rct_NE_Malfurion )
call TriggerAddCondition( gg_trg_Hero_4, Condition( function Trig_Hero_4_Conditions ) )
call TriggerAddAction( gg_trg_Hero_4, function Trig_Hero_4_Actions )
endfunction
function Trig_Hero_5_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_5_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Etyr', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
call RemoveLocation(point)
set point = null
//
set a = 1
loop
exitwhen a > 10
call EnableTrigger( udg_AntiSlowHero15[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_5 takes nothing returns nothing
set gg_trg_Hero_5 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_5, gg_rct_NE_Tyrande )
call TriggerAddCondition( gg_trg_Hero_5, Condition( function Trig_Hero_5_Conditions ) )
call TriggerAddAction( gg_trg_Hero_5, function Trig_Hero_5_Actions )
endfunction
function Trig_Hero_6_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_6_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Eevi', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
call RemoveLocation(point)
set point = null
//
set a = 1
loop
exitwhen a > 8
call EnableTrigger( udg_AntiSlowHero13[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_6 takes nothing returns nothing
set gg_trg_Hero_6 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_6, gg_rct_Ne_Illidan )
call TriggerAddCondition( gg_trg_Hero_6, Condition( function Trig_Hero_6_Conditions ) )
call TriggerAddAction( gg_trg_Hero_6, function Trig_Hero_6_Actions )
endfunction
function Trig_Hero_16_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_16_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Ewrd', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\TargetArtLumber\\TargetArtLumber.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
call RemoveLocation(point)
set point = null
//
set a = 1
loop
exitwhen a > 4
call EnableTrigger( udg_AntiSlowHero14[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_16 takes nothing returns nothing
set gg_trg_Hero_16 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_16, gg_rct_NE_Maiev )
call TriggerAddCondition( gg_trg_Hero_16, Condition( function Trig_Hero_16_Conditions ) )
call TriggerAddAction( gg_trg_Hero_16, function Trig_Hero_16_Actions )
endfunction
function Trig_Hero_15_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_15_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Hvsh', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 9
call EnableTrigger( udg_AntiSlowHero20[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_15 takes nothing returns nothing
set gg_trg_Hero_15 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_15, gg_rct_NE_Naga )
call TriggerAddCondition( gg_trg_Hero_15, Condition( function Trig_Hero_15_Conditions ) )
call TriggerAddAction( gg_trg_Hero_15, function Trig_Hero_15_Actions )
endfunction
function Trig_Hero_22_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_22_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Orex', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 9
call EnableTrigger( udg_AntiSlowHero22[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_22 takes nothing returns nothing
set gg_trg_Hero_22 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_22, gg_rct_NE_Rexxar )
call TriggerAddCondition( gg_trg_Hero_22, Condition( function Trig_Hero_22_Conditions ) )
call TriggerAddAction( gg_trg_Hero_22, function Trig_Hero_22_Actions )
endfunction
function Trig_Hero_7_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_7_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Ogrh', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call SetPlayerAbilityAvailable(Player(0), 'A045', false)
call SetPlayerAbilityAvailable(Player(1), 'A045', false)
call SetPlayerAbilityAvailable(Player(2), 'A045', false)
call SetPlayerAbilityAvailable(Player(3), 'A045', false)
call UnitAddAbility(u, 'A045')
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Starfall\\StarfallTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\SpiritLink\\SpiritLinkTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 3
call EnableTrigger( udg_AntiSlowHero8[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_7 takes nothing returns nothing
set gg_trg_Hero_7 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_7, gg_rct_Orc_GromHellScream )
call TriggerAddCondition( gg_trg_Hero_7, Condition( function Trig_Hero_7_Conditions ) )
call TriggerAddAction( gg_trg_Hero_7, function Trig_Hero_7_Actions )
endfunction
function Trig_Hero_8_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_8_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Ogld', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Items\\VampiricPotion\\VampPotionCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 5
call EnableTrigger( udg_AntiSlowHero5[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_8 takes nothing returns nothing
set gg_trg_Hero_8 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_8, gg_rct_Orc_Guldan )
call TriggerAddCondition( gg_trg_Hero_8, Condition( function Trig_Hero_8_Conditions ) )
call TriggerAddAction( gg_trg_Hero_8, function Trig_Hero_8_Actions )
endfunction
function Trig_Hero_9_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_9_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Othr', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\ManaFlare\\ManaFlareBoltImpact.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 3
call EnableTrigger( udg_AntiSlowHero7[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_9 takes nothing returns nothing
set gg_trg_Hero_9 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_9, gg_rct_Orc_Thrall )
call TriggerAddCondition( gg_trg_Hero_9, Condition( function Trig_Hero_9_Conditions ) )
call TriggerAddAction( gg_trg_Hero_9, function Trig_Hero_9_Actions )
endfunction
function Trig_Hero_17_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_17_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Ocb2', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 3
call EnableTrigger( udg_AntiSlowHero6[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_17 takes nothing returns nothing
set gg_trg_Hero_17 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_17, gg_rct_Orc_Cairne )
call TriggerAddCondition( gg_trg_Hero_17, Condition( function Trig_Hero_17_Conditions ) )
call TriggerAddAction( gg_trg_Hero_17, function Trig_Hero_17_Actions )
endfunction
function Trig_Hero_18_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_18_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Orkn', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\Voodoo\\VoodooAura.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 2
call EnableTrigger( udg_AntiSlowHero18[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_18 takes nothing returns nothing
set gg_trg_Hero_18 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_18, gg_rct_Orc_Rokhan )
call TriggerAddCondition( gg_trg_Hero_18, Condition( function Trig_Hero_18_Conditions ) )
call TriggerAddAction( gg_trg_Hero_18, function Trig_Hero_18_Actions )
endfunction
function Trig_Hero_23_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_23_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Naka', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 2
call EnableTrigger( udg_AntiSlowHero23[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_23 takes nothing returns nothing
set gg_trg_Hero_23 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_23, gg_rct_Orc_Akama )
call TriggerAddCondition( gg_trg_Hero_23, Condition( function Trig_Hero_23_Conditions ) )
call TriggerAddAction( gg_trg_Hero_23, function Trig_Hero_23_Actions )
endfunction
function Trig_Hero_10_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_10_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Uktl', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 11
call EnableTrigger( udg_AntiSlowHero12[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_10 takes nothing returns nothing
set gg_trg_Hero_10 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_10, gg_rct_UD_Lich )
call TriggerAddCondition( gg_trg_Hero_10, Condition( function Trig_Hero_10_Conditions ) )
call TriggerAddAction( gg_trg_Hero_10, function Trig_Hero_10_Actions )
endfunction
function Trig_Hero_11_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_11_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Usyl', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 6
call EnableTrigger( udg_AntiSlowHero9[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_11 takes nothing returns nothing
set gg_trg_Hero_11 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_11, gg_rct_UD_Sylvanas )
call TriggerAddCondition( gg_trg_Hero_11, Condition( function Trig_Hero_11_Conditions ) )
call TriggerAddAction( gg_trg_Hero_11, function Trig_Hero_11_Actions )
endfunction
function Trig_Hero_12_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_12_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Utic', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 9
call EnableTrigger( udg_AntiSlowHero10[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_12 takes nothing returns nothing
set gg_trg_Hero_12 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_12, gg_rct_UD_Tichondrius )
call TriggerAddCondition( gg_trg_Hero_12, Condition( function Trig_Hero_12_Conditions ) )
call TriggerAddAction( gg_trg_Hero_12, function Trig_Hero_12_Actions )
endfunction
function Trig_Hero_19_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_19_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Nman', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Other\\HowlOfTerror\\HowlTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 2
call EnableTrigger( udg_AntiSlowHero11[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_19 takes nothing returns nothing
set gg_trg_Hero_19 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_19, gg_rct_UD_Mannoroth )
call TriggerAddCondition( gg_trg_Hero_19, Condition( function Trig_Hero_19_Conditions ) )
call TriggerAddAction( gg_trg_Hero_19, function Trig_Hero_19_Actions )
endfunction
function Trig_Hero_20_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_20_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Nklj', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 7
call EnableTrigger( udg_AntiSlowHero19[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_20 takes nothing returns nothing
set gg_trg_Hero_20 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_20, gg_rct_UD_Hydralisk )
call TriggerAddCondition( gg_trg_Hero_20, Condition( function Trig_Hero_20_Conditions ) )
call TriggerAddAction( gg_trg_Hero_20, function Trig_Hero_20_Actions )
endfunction
function Trig_Hero_24_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'ewsp' ) ) then
return false
endif
return true
endfunction
function Trig_Hero_24_Actions takes nothing returns nothing
local unit u
local location point
local integer a
set point = GetRectCenter(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 20.00, 20.00))
call DisableTrigger( GetTriggeringTrigger() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( GetEnteringUnit() )
call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, GetOwningPlayer(GetEnteringUnit()), 0 )
set point = GetRectCenter(gg_rct_Hero_Start)
call CreateNUnitsAtLoc( 1, 'Uanb', GetOwningPlayer(GetEnteringUnit()), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
set udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(GetEnteringUnit()))] = u
call TriggerExecute( gg_trg_Hero_Setup )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\shadowstrike\\shadowstrike.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set u = null
set point = null
//
set a = 1
loop
exitwhen a > 7
call EnableTrigger( udg_AntiSlowHero19[a] )
set a = a + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Hero_24 takes nothing returns nothing
set gg_trg_Hero_24 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Hero_24, gg_rct_UD_Anubarak )
call TriggerAddCondition( gg_trg_Hero_24, Condition( function Trig_Hero_24_Conditions ) )
call TriggerAddAction( gg_trg_Hero_24, function Trig_Hero_24_Actions )
endfunction
function Trig_FO_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then
return false
endif
return true
endfunction
function FO_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A064', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function FO_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A010', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
endfunction
function Trig_FO_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function FO_Conditions))
local triggeraction taction = TriggerAddAction(t, function FO_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit u
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
call SetUnitScalePercent( u, 150.00, 150.00, 150.00 )
set g = GetUnitsInRangeOfLocAll(1000, point1)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A064', u )
call SetUnitAbilityLevelSwapped( 'A064', u, GetUnitAbilityLevelSwapped('A00Z', hero) )
call IssuePointOrderLocBJ( u, "carrionswarm", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_FO_Begin takes nothing returns nothing
set gg_trg_FO_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FO_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FO_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FO_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FO_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FO_Begin, Condition( function Trig_FO_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FO_Begin, function Trig_FO_Begin_Actions )
endfunction
function Trig_FR_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01T' ) ) then
return false
endif
return true
endfunction
function Trig_FR_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_FrostRegionGroup )
call UnitAddAbilityBJ( 'A01V', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01V', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01T', hero) )
call UnitApplyTimedLifeBJ( 0.1, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 120 )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_FR_Begin takes nothing returns nothing
set gg_trg_FR_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FR_Begin, Condition( function Trig_FR_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FR_Begin, function Trig_FR_Begin_Actions )
endfunction
function Trig_FR_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A01V', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_FR_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call GroupRemoveUnitSimple( u, udg_FrostRegionGroup )
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_FrostRegionGroup )
call UnitAddAbilityBJ( 'A01V', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01V', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01V', u) )
call UnitApplyTimedLifeBJ( 0.15, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0.00, 1000.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01U', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01U', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01V', u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveUnit( u )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_FR_Fake_Action takes nothing returns nothing
set gg_trg_FR_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FR_Fake_Action, Condition( function Trig_FR_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_FR_Fake_Action, function Trig_FR_Fake_Action_Actions )
endfunction
function Trig_FR_Fix_Bug_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01T' ) ) then
return false
endif
return true
endfunction
function Trig_FR_Fix_Bug_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local group g = CreateGroup()
local unit f
local location point = GetUnitLoc(hero)
call GroupAddGroup( udg_FrostRegionGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(hero) ) then
call RemoveUnit( f )
call GroupRemoveUnitSimple( f, udg_FrostRegionGroup )
endif
call GroupRemoveUnit(g, f)
endloop
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01V', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "bloodlust", hero )
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_FR_Fix_Bug takes nothing returns nothing
set gg_trg_FR_Fix_Bug = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fix_Bug, Player(0), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fix_Bug, Player(1), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fix_Bug, Player(2), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fix_Bug, Player(3), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_FR_Fix_Bug, Condition( function Trig_FR_Fix_Bug_Conditions ) )
call TriggerAddAction( gg_trg_FR_Fix_Bug, function Trig_FR_Fix_Bug_Actions )
endfunction
function Trig_FR_Begi_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A031' ) ) then
return false
endif
return true
endfunction
function Trig_FR_Begi_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
set udg_FrozenRainHero = hero
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), 100 )
call UnitAddAbilityBJ( 'A07Q', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_FR_Begi takes nothing returns nothing
set gg_trg_FR_Begi = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begi, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begi, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begi, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Begi, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FR_Begi, Condition( function Trig_FR_Begi_Conditions ) )
call TriggerAddAction( gg_trg_FR_Begi, function Trig_FR_Begi_Actions )
endfunction
function Trig_FR_Fake_Action1_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A07Q', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(udg_FrozenRainHero) == true ) ) then
return false
endif
return true
endfunction
function Trig_FR_Fake_Action1_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local integer a = 1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07Q', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
loop
exitwhen a > 3
set point = PolarProjectionBJ(GetUnitLoc(udg_FrozenRainHero), GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e00Y', GetOwningPlayer(u), point, bj_UNIT_FACING )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
call SetUnitAbilityLevelSwapped( 'A01Y', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A031', udg_FrozenRainHero) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
call RemoveUnit( u )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_FR_Fake_Action1 takes nothing returns nothing
set gg_trg_FR_Fake_Action1 = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action1, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action1, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action1, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Fake_Action1, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FR_Fake_Action1, Condition( function Trig_FR_Fake_Action1_Conditions ) )
call TriggerAddAction( gg_trg_FR_Fake_Action1, function Trig_FR_Fake_Action1_Actions )
endfunction
function Trig_FR_Di_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e00Y' ) ) then
return false
endif
return true
endfunction
function Trig_FR_Di_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call TriggerExecute( gg_trg_Effect_Off )
call CreateNUnitsAtLoc( 1, 'e009', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A07Q', GetLastCreatedUnit() )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
set u = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_FR_Di takes nothing returns nothing
set gg_trg_FR_Di = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Di, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Di, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Di, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FR_Di, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FR_Di, Condition( function Trig_FR_Di_Conditions ) )
call TriggerAddAction( gg_trg_FR_Di, function Trig_FR_Di_Actions )
endfunction
function Trig_Muti_Storm_Bolt_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A044' ) ) then
return false
endif
return true
endfunction
function Trig_Muti_Storm_Bolt_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
local integer bodem = 0
call TriggerSleepAction( 0.30 )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(u)) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04C', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A044', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", u )
call GroupRemoveUnit(g, u)
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = FirstOfGroup(g)
exitwhen ((f == null) or ( bodem >= (GetUnitAbilityLevelSwapped('A044', hero) + 1) ))
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04C', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A044', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
set hero = null
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_Muti_Storm_Bolt takes nothing returns nothing
set gg_trg_Muti_Storm_Bolt = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Storm_Bolt, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Storm_Bolt, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Storm_Bolt, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Storm_Bolt, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Muti_Storm_Bolt, Condition( function Trig_Muti_Storm_Bolt_Conditions ) )
call TriggerAddAction( gg_trg_Muti_Storm_Bolt, function Trig_Muti_Storm_Bolt_Actions )
endfunction
function Trig_FF_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05P' ) ) then
return false
endif
return true
endfunction
function Trig_FF_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location point
call TriggerSleepAction( ( DistanceBetweenPoints(GetUnitLoc(hero), GetUnitLoc(target)) / 1000.00 ) )
set point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e015', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call RemoveLocation(point)
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05P', hero) )
call UnitApplyTimedLifeBJ( 0.80, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 930.00, 1100.00 )
set point = null
set hero = null
set target = null
endfunction
//===========================================================================
function InitTrig_FF_Begin takes nothing returns nothing
set gg_trg_FF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_FF_Begin, Condition( function Trig_FF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FF_Begin, function Trig_FF_Begin_Actions )
endfunction
function Trig_FF_Action_Effect_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e015' ) ) then
return false
endif
return true
endfunction
function Trig_FF_Action_Effect_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local integer a
local location point
set point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'n00L', Player(0), point, bj_UNIT_FACING )
call KillUnit( GetLastCreatedUnit() )
set a = 1
loop
exitwhen a > 6
set point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'o00A', GetOwningPlayer(u), GetUnitLoc(u), AngleBetweenPoints(point, PolarProjectionBJ(point, 450.00, ( I2R(a) * 60.00 ))) )
call UnitAddAbilityBJ( udg_FireFlareAbility[GetUnitUserData(u)], GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
set point = PolarProjectionBJ(GetUnitLoc(u), 450.00, ( I2R(a) * 60.00 ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", point )
set a = a + 1
endloop
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_FF_Action_Effect takes nothing returns nothing
set gg_trg_FF_Action_Effect = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Action_Effect, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Action_Effect, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Action_Effect, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FF_Action_Effect, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FF_Action_Effect, Condition( function Trig_FF_Action_Effect_Conditions ) )
call TriggerAddAction( gg_trg_FF_Action_Effect, function Trig_FF_Action_Effect_Actions )
endfunction
function Trig_FBW_Begin_Cast_Spell_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01J' ) ) then
return false
endif
return true
endfunction
function Trig_FBW_Begin_Cast_Spell_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location targetpoint = GetSpellTargetLoc()
local location point
local real angle = AngleBetweenPoints(GetUnitLoc(hero), targetpoint)
local real range
local real timedeath
call TriggerSleepAction( 0.30 )
set point = PolarProjectionBJ(GetUnitLoc(hero), 110.00, angle)
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, angle )
set range = DistanceBetweenPoints(GetUnitLoc(GetLastCreatedUnit()), targetpoint)
set timedeath = ( range / GetUnitMoveSpeed(GetLastCreatedUnit()) )
call UnitApplyTimedLifeBJ( timedeath, 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01J', hero) )
set point = PolarProjectionBJ(GetUnitLoc(GetLastCreatedUnit()), range, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
// dong1 con 1
set point = PolarProjectionBJ(GetUnitLoc(hero), 55.00, ( angle + 70.00 ))
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, angle )
call UnitApplyTimedLifeBJ( ( timedeath + 0.10 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01J', hero) )
set point = PolarProjectionBJ(GetUnitLoc(GetLastCreatedUnit()), range, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
// dong1 con 2
set point = PolarProjectionBJ(GetUnitLoc(hero), 55.00, ( angle - 70.00 ))
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, angle )
call UnitApplyTimedLifeBJ( ( timedeath + 0.10 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01J', hero) )
set point = PolarProjectionBJ(GetUnitLoc(GetLastCreatedUnit()), range, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
// dong2 con 1
set point = PolarProjectionBJ(GetUnitLoc(hero), 80.00, ( angle + 90.00 ))
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, angle )
call UnitApplyTimedLifeBJ( ( timedeath + 0.20 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01J', hero) )
set point = PolarProjectionBJ(GetUnitLoc(GetLastCreatedUnit()), range, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
// dong2 con 2
set point = PolarProjectionBJ(GetUnitLoc(hero), 80.00, ( angle - 90.00 ))
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, angle )
call UnitApplyTimedLifeBJ( ( timedeath + 0.20 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01J', hero) )
set point = PolarProjectionBJ(GetUnitLoc(GetLastCreatedUnit()), range, GetUnitFacing(GetLastCreatedUnit()))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
call RemoveLocation(point)
call RemoveLocation(targetpoint)
set hero = null
set targetpoint = null
set point = null
endfunction
//===========================================================================
function InitTrig_FBW_Begin_Cast_Spell takes nothing returns nothing
set gg_trg_FBW_Begin_Cast_Spell = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Begin_Cast_Spell, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Begin_Cast_Spell, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Begin_Cast_Spell, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Begin_Cast_Spell, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FBW_Begin_Cast_Spell, Condition( function Trig_FBW_Begin_Cast_Spell_Conditions ) )
call TriggerAddAction( gg_trg_FBW_Begin_Cast_Spell, function Trig_FBW_Begin_Cast_Spell_Actions )
endfunction
function Trig_FBW_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e00I' ) ) then
return false
endif
return true
endfunction
function Trig_FBW_Die_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_FBW_Die takes nothing returns nothing
set gg_trg_FBW_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FBW_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FBW_Die, Condition( function Trig_FBW_Die_Conditions ) )
call TriggerAddAction( gg_trg_FBW_Die, function Trig_FBW_Die_Actions )
endfunction
function Trig_HS_Action_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(GetAttacker(), Player(0)) == true ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B010') == true ) ) then
return false
endif
return true
endfunction
function Trig_HS_Action_Actions takes nothing returns nothing
local unit hero = GetAttackedUnitBJ()
local unit target = GetAttacker()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitDamageTargetBJ( GetLastCreatedUnit(), target, ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, target) * ( ( 1 + ( I2R(GetUnitAbilityLevelSwapped('A08D', hero)) * 0.40 ) ) / 100.00 ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call AddSpecialEffectTargetUnitBJ( "chest", GetAttacker(), "Abilities\\Weapons\\FaerieDragonMissile\\FaerieDragonMissile.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set hero = null
set target = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_HS_Action takes nothing returns nothing
set gg_trg_HS_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HS_Action, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HS_Action, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HS_Action, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HS_Action, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_HS_Action, Condition( function Trig_HS_Action_Conditions ) )
call TriggerAddAction( gg_trg_HS_Action, function Trig_HS_Action_Actions )
endfunction
function Trig_SM_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A025' ) ) then
return false
endif
return true
endfunction
function Trig_SM_Begin_Actions takes nothing returns nothing
local integer a
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
local real manapoint = GetUnitStateSwap(UNIT_STATE_MANA, hero)
local integer ManaSo
local integer ManaSoTemp
local integer ManaSoTrieu
local integer ManaSoTramNghin
local integer ManaSoChucNghin
local integer ManaSoNghin
local integer ManaSoTram
local integer ManaSoChuc
local integer ManaSoDonVi
call AddSpecialEffectTargetUnitBJ( "overhead", hero, "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A02K', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "innerfire", hero )
// --------------------------
set manapoint = ( manapoint * ( ( I2R(GetUnitAbilityLevelSwapped('A025', hero) * 5 ) + 50.00 ) / 100.00 ) )
set ManaSo = R2I(manapoint)
set ManaSoTemp = ManaSo
// --------------------------
set ManaSoTrieu = ( ManaSoTemp / 1000000 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoTrieu * 1000000 ) )
set ManaSoTramNghin = ( ManaSoTemp / 100000 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoTramNghin * 100000 ) )
set ManaSoChucNghin = ( ManaSoTemp / 10000 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoChucNghin * 10000 ) )
set ManaSoNghin = ( ManaSoTemp / 1000 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoNghin * 1000 ) )
set ManaSoTram = ( ManaSoTemp / 100 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoTram * 100 ) )
set ManaSoChuc = ( ManaSoTemp / 10 )
set ManaSoTemp = ( ManaSoTemp - ( ManaSoChuc * 10 ) )
set ManaSoDonVi = ( ManaSoTemp / 1 )
// -------- + Damage ----------
set a = 1
loop
exitwhen a > ManaSoTrieu
call UnitAddItemByIdSwapped( 'I00G', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoTramNghin
call UnitAddItemByIdSwapped( 'I00B', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoChucNghin
call UnitAddItemByIdSwapped( 'I00C', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoNghin
call UnitAddItemByIdSwapped( 'I00D', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoTram
call UnitAddItemByIdSwapped( 'I00E', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoChuc
call UnitAddItemByIdSwapped( 'I00F', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoDonVi
call UnitAddItemByIdSwapped( 'I00A', hero )
set a = a + 1
endloop
call SetUnitManaBJ( hero, ( GetUnitStateSwap(UNIT_STATE_MANA, hero) - I2R(ManaSo) ) )
// ---------- Damage ----------
call TriggerSleepAction( 2.00 )
loop
exitwhen ( UnitHasBuffBJ(hero, 'B00F') == false )
call TriggerSleepAction( 2.00 )
endloop
loop
exitwhen ( IsUnitAliveBJ(hero) == true )
call TriggerSleepAction( 2.00 )
endloop
set a = 1
loop
exitwhen a > ManaSoTrieu
call UnitAddItemByIdSwapped( 'I00H', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoTramNghin
call UnitAddItemByIdSwapped( 'I00N', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoChucNghin
call UnitAddItemByIdSwapped( 'I00I', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoNghin
call UnitAddItemByIdSwapped( 'I00J', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoTram
call UnitAddItemByIdSwapped( 'I00K', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoChuc
call UnitAddItemByIdSwapped( 'I00L', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > ManaSoDonVi
call UnitAddItemByIdSwapped( 'I00M', hero )
set a = a + 1
endloop
set hero = null
endfunction
//===========================================================================
function InitTrig_SM_Begin takes nothing returns nothing
set gg_trg_SM_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SM_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SM_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SM_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SM_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_SM_Begin, Condition( function Trig_SM_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SM_Begin, function Trig_SM_Begin_Actions )
endfunction
function Trig_SM_Anti_Slow_Actions takes nothing returns nothing
local unit u = gg_unit_Harf_0060
call UnitAddItemByIdSwapped( 'I00A', u )
call UnitAddItemByIdSwapped( 'I00F', u )
call UnitAddItemByIdSwapped( 'I00E', u )
call UnitAddItemByIdSwapped( 'I00D', u )
call UnitAddItemByIdSwapped( 'I00C', u )
call UnitAddItemByIdSwapped( 'I00B', u )
call UnitAddItemByIdSwapped( 'I00G', u )
// ------------------------------------
call UnitAddItemByIdSwapped( 'I00M', u )
call UnitAddItemByIdSwapped( 'I00L', u )
call UnitAddItemByIdSwapped( 'I00K', u )
call UnitAddItemByIdSwapped( 'I00J', u )
call UnitAddItemByIdSwapped( 'I00I', u )
call UnitAddItemByIdSwapped( 'I00N', u )
call UnitAddItemByIdSwapped( 'I00H', u )
call RemoveUnit( u )
set u = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_SM_Anti_Slow takes nothing returns nothing
set gg_trg_SM_Anti_Slow = CreateTrigger( )
call TriggerAddAction( gg_trg_SM_Anti_Slow, function Trig_SM_Anti_Slow_Actions )
endfunction
function Trig_FD_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A091' ) ) then
return false
endif
return true
endfunction
function Trig_FD_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local unit p
set p = CreateUnitAtLoc( GetOwningPlayer(hero), 'e017', point, bj_UNIT_FACING )
call UnitAddAbility(p, 'A092')
call SetUnitAbilityLevel(p, 'A092', GetUnitAbilityLevel(hero,'A091') )
call UnitApplyTimedLife( p, 'BTLF', 0.20 )
call SetUnitUserData( p, 30 )
set hero = null
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_FD_Begin takes nothing returns nothing
set gg_trg_FD_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FD_Begin, Condition( function Trig_FD_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FD_Begin, function Trig_FD_Begin_Actions )
endfunction
function Trig_FD_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A092', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_FD_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A092', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A092', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A092', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 800.00), GetRandomDirectionDeg())
call TerrainDeformationCraterBJ( 1.00, false, point, 200.00, -400.00 )
call TriggerSleepAction( 0.50 )
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set point1 = PolarProjectionBJ(point, 400, GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A093', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A092', u) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'o00O', GetOwningPlayer(u), point, AngleBetweenPoints(point, point1) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", point1 )
call RemoveUnit( u )
call RemoveLocation(point1)
set point1 = null
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_FD_Fake_Action takes nothing returns nothing
set gg_trg_FD_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FD_Fake_Action, Condition( function Trig_FD_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_FD_Fake_Action, function Trig_FD_Fake_Action_Actions )
endfunction
function Trig_FD_Damage_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A093', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_FD_Damage_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call CreateNUnitsAtLoc( 1, 'e009', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A092', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A092', GetLastCreatedUnit(), GetUnitUserData(u) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_FD_Damage takes nothing returns nothing
set gg_trg_FD_Damage = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Damage, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Damage, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Damage, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FD_Damage, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_FD_Damage, Condition( function Trig_FD_Damage_Conditions ) )
call TriggerAddAction( gg_trg_FD_Damage, function Trig_FD_Damage_Actions )
endfunction
function Trig_FW_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00V' ) ) then
return false
endif
return true
endfunction
function Trig_FW_Begin_Actions takes nothing returns nothing
local integer a
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local location temppoint
local real var1 = AtanBJ(( 400.00 / DistanceBetweenPoints(GetUnitLoc(hero), point) ))
local real var2 = Pow(( Pow(400.00, 2.00) + Pow(DistanceBetweenPoints(GetUnitLoc(hero), point), 2.00) ), ( 1.00 / 2.00 ))
// ----------------------------
call CreateNUnitsAtLoc( 1, 'e007', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', GetLastCreatedUnit() )
set a = 1
loop
exitwhen a > 11
set temppoint = PolarProjectionBJ(point, ( I2R(a) * 30.00 ), AngleBetweenPoints(point, PolarProjectionBJ(GetUnitLoc(hero), var2, ( AngleBetweenPoints(GetUnitLoc(hero), point) + var1 ))))
call CreateNUnitsAtLoc( 1, 'e007', GetOwningPlayer(hero), temppoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A03P', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03P', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00V', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "immolation" )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', GetLastCreatedUnit() )
set temppoint = PolarProjectionBJ(point, ( I2R(a) * 30.00 ), AngleBetweenPoints(point, PolarProjectionBJ(GetUnitLoc(hero), var2, ( AngleBetweenPoints(GetUnitLoc(hero), point) - var1 ))))
call CreateNUnitsAtLoc( 1, 'e007', GetOwningPlayer(hero), temppoint, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A03P', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A03P', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00V', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "immolation" )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
call RemoveLocation(point)
set point = null
call RemoveLocation(temppoint)
set temppoint = null
set hero = null
endfunction
//===========================================================================
function InitTrig_FW_Begin takes nothing returns nothing
set gg_trg_FW_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FW_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FW_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FW_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FW_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_FW_Begin, Condition( function Trig_FW_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FW_Begin, function Trig_FW_Begin_Actions )
endfunction
function Trig_PS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetSpellTargetUnit(), 'B007') == false ) ) then
return false
endif
return true
endfunction
function Trig_PS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(u)
local unit p
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set p = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A01C', p )
call SetUnitAbilityLevelSwapped( 'A01C', p, GetUnitAbilityLevelSwapped('A00Y', hero) )
loop
set point = GetUnitLoc(hero)
call SetUnitPositionLoc( p, point )
call TriggerSleepAction( 0.50 )
exitwhen ( IsUnitAliveBJ(hero) == false ) or ( UnitHasBuffBJ(hero, 'B007') == false )
endloop
call RemoveLocation(point)
set point = null
set hero = null
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_PS_Begin takes nothing returns nothing
set gg_trg_PS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_PS_Begin, Condition( function Trig_PS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_PS_Begin, function Trig_PS_Begin_Actions )
endfunction
function Trig_CFI_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07Z' ) ) then
return false
endif
return true
endfunction
function Trig_CFI_Fake_Action_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(u)) )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(hero), 9999.00 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A08C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08C', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A07Z', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", u )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_CFI_Fake_Action takes nothing returns nothing
set gg_trg_CFI_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Fake_Action, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Fake_Action, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Fake_Action, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Fake_Action, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CFI_Fake_Action, Condition( function Trig_CFI_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_CFI_Fake_Action, function Trig_CFI_Fake_Action_Actions )
endfunction
function Trig_CFI_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08C' ) ) then
return false
endif
return true
endfunction
function CFI_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A080', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function CFI_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
local group g = CreateGroup()
local integer chance = GetRandomInt(1, 100)
local integer bodem = 0
local unit f
if ( chance <= 20 ) then
set point = GetUnitLoc(target)
set g = GetUnitsInRangeOfLocAll(800, point)
call GroupRemoveUnit(g, target)
loop
set f = GroupPickRandomUnit(g)
exitwhen (f == null) or ( bodem >= 3 )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(attacker)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A011', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A011', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A080', attacker) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
endif
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
set f = null
endfunction
function Trig_CFI_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function CFI_Conditions))
local triggeraction taction = TriggerAddAction(t, function CFI_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local unit u
local location point = GetUnitLoc(target)
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call SetUnitFlyHeightBJ( u, GetUnitFlyHeight(hero), 9999.00 )
call UnitApplyTimedLifeBJ( 6.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(1500, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A080', u )
call SetUnitAbilityLevelSwapped( 'A080', u, GetUnitAbilityLevelSwapped('A07Z', hero) )
call IssueTargetOrderBJ( u, "chainlightning", target )
call TimerStart(tx,6,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_CFI_Begin takes nothing returns nothing
set gg_trg_CFI_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFI_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CFI_Begin, Condition( function Trig_CFI_Begin_Conditions ) )
call TriggerAddAction( gg_trg_CFI_Begin, function Trig_CFI_Begin_Actions )
endfunction
function Trig_M_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A081' ) ) then
return false
endif
return true
endfunction
function Trig_M_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A083', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A083', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A081', hero) )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 10 )
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_M_Begin takes nothing returns nothing
set gg_trg_M_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_M_Begin, Condition( function Trig_M_Begin_Conditions ) )
call TriggerAddAction( gg_trg_M_Begin, function Trig_M_Begin_Actions )
endfunction
function Trig_M_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A083', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_M_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A083', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A083', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A083', u) )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
//-------------------------------
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 350.00), GetRandomDirectionDeg())
set point1 = PolarProjectionBJ(point, 400.00, 45.00)
call CreateNUnitsAtLoc( 1, 'e01B', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A082', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A083', u) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 900.00 )
// --------------------
call CreateNUnitsAtLoc( 1, 'e01C', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 900.00 )
call RemoveUnit( u )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_M_Fake_Action takes nothing returns nothing
set gg_trg_M_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_M_Fake_Action, Condition( function Trig_M_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_M_Fake_Action, function Trig_M_Fake_Action_Actions )
endfunction
function Trig_M_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e01B' ) ) then
return false
endif
return true
endfunction
function Trig_M_Action_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
local effect e
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call TerrainDeformationRippleBJ( 2.00, false, point, 300.00, 300.00, 50.00, 0.50, 150.00 )
set e = GetLastCreatedEffectBJ()
call TriggerSleepAction( 5.00 )
call DestroyEffectBJ(e)
set e = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_M_Action takes nothing returns nothing
set gg_trg_M_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_M_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_M_Action, Condition( function Trig_M_Action_Conditions ) )
call TriggerAddAction( gg_trg_M_Action, function Trig_M_Action_Actions )
endfunction
function Trig_MB_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A086' ) ) then
return false
endif
return true
endfunction
function Trig_MB_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08B', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A086', hero) )
call UnitApplyTimedLifeBJ( 0.01, 'BTLF', GetLastCreatedUnit() )
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_MB_Begin takes nothing returns nothing
set gg_trg_MB_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MB_Begin, Condition( function Trig_MB_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MB_Begin, function Trig_MB_Begin_Actions )
endfunction
function Trig_MB_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A08B', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_MB_Fake_Action_Actions takes nothing returns nothing
local integer a = 1
local unit hero = GetDyingUnit()
local location point = GetUnitLoc(hero)
local location point1
loop
exitwhen a > 10
set point1 = PolarProjectionBJ(point, GetRandomReal(200.00, 400.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'o00C', GetOwningPlayer(hero), point, AngleBetweenPoints(point, point1) )
call UnitAddAbilityBJ( udg_FireFlareAbility[GetUnitUserData(hero)], GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", point1 )
set a = a + 1
endloop
call CreateNUnitsAtLoc( 1, 'e01D', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call TerrainDeformationCraterBJ( 0.5, false, point, 300.00, 400.00 )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
//--------------------
call CreateNUnitsAtLoc( 1, 'e009', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A087', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A087', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A086', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set hero = null
endfunction
//===========================================================================
function InitTrig_MB_Fake_Action takes nothing returns nothing
set gg_trg_MB_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MB_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MB_Fake_Action, Condition( function Trig_MB_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_MB_Fake_Action, function Trig_MB_Fake_Action_Actions )
endfunction
function Trig_OOE_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A088' ) ) then
return false
endif
return true
endfunction
function OOEAction takes unit hero returns nothing
local unit array u
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local integer a
//Fire
call CreateNUnitsAtLoc( 1, 'e01F', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[1] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 60, 'BTLF', u[1] )
call SetUnitUserData( u[1], GetUnitAbilityLevelSwapped('A088', hero) )
//Ice
call CreateNUnitsAtLoc( 1, 'e01G', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[2] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 60, 'BTLF', u[2] )
call SetUnitUserData( u[2], GetUnitAbilityLevelSwapped('A088', hero) )
//Lightning
call CreateNUnitsAtLoc( 1, 'e01E', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[3] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 60, 'BTLF', u[3] )
call SetUnitUserData( u[3], GetUnitAbilityLevelSwapped('A088', hero) )
loop
exitwhen ( IsUnitDeadBJ(hero) == true ) or ( IsUnitDeadBJ(u[1]) == true )
set a = 1
loop
exitwhen a > 3
set point = GetUnitLoc(u[a])
set g = GetUnitsInRangeOfLocAll(600, point)
if ( IsUnitInGroup(hero, g) == true ) then
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(0, 300.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u[a], "attack", point )
else
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(0, 300.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u[a], "move", point )
endif
set a = a + 1
endloop
call TriggerSleepAction( 0.50 )
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
call RemoveUnit( u[1] )
call RemoveUnit( u[2] )
call RemoveUnit( u[3] )
set u[1] = null
set u[2] = null
set u[3] = null
endfunction
function Trig_OOE_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local integer a = 0
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call OOEAction( hero )
set hero = null
endfunction
//===========================================================================
function InitTrig_OOE_Begin takes nothing returns nothing
set gg_trg_OOE_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_OOE_Begin, Condition( function Trig_OOE_Begin_Conditions ) )
call TriggerAddAction( gg_trg_OOE_Begin, function Trig_OOE_Begin_Actions )
endfunction
function Trig_OOE_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A089', GetAttacker()) > 0 ) ) then
return false
endif
return true
endfunction
function OOE_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A089', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function OOE_Damage takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(u)
if ( GetUnitTypeId(hero) == 'e01F' ) then
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A083', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A083', GetLastCreatedUnit(), GetUnitUserData(hero) )
call SetUnitUserData( GetLastCreatedUnit(), 1 )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
endif
if ( GetUnitTypeId(hero) == 'e01G' ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(u)) )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), GetUnitFlyHeight(hero), 9999.00 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A08C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08C', GetLastCreatedUnit(), GetUnitUserData(hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", u )
endif
if ( GetUnitTypeId(hero) == 'e01E' ) then
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08B', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(hero) )
call UnitApplyTimedLifeBJ( 0.01, 'BTLF', GetLastCreatedUnit() )
endif
call RemoveLocation(point)
set point = null
endfunction
function Trig_OOE_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function OOE_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function OOE_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 10 ) then
call TimerStart(tx,5,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
endif
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_OOE_Action takes nothing returns nothing
set gg_trg_OOE_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_OOE_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_OOE_Action, Condition( function Trig_OOE_Action_Conditions ) )
call TriggerAddAction( gg_trg_OOE_Action, function Trig_OOE_Action_Actions )
endfunction
function Trig_SOE_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00K' ) ) then
return false
endif
return true
endfunction
function SOE_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A02W', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function SOE_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00L', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "drunkenhaze", target )
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
endfunction
function Trig_SOE_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function SOE_Conditions))
local triggeraction taction = TriggerAddAction(t, function SOE_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit u
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(1000, point1)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A02W', u )
call SetUnitAbilityLevelSwapped( 'A02W', u, GetUnitAbilityLevelSwapped('A00K', hero) )
call IssuePointOrderLocBJ( u, "shockwave", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_SOE_Begin takes nothing returns nothing
set gg_trg_SOE_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOE_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOE_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOE_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOE_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_SOE_Begin, Condition( function Trig_SOE_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SOE_Begin, function Trig_SOE_Begin_Actions )
endfunction
function Trig_ROE_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05X' ) ) then
return false
endif
return true
endfunction
function Trig_ROE_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_RainOfElementGroup )
call UnitAddAbilityBJ( 'A05Z', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 25.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "monsoon", point )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_ROE_Begin takes nothing returns nothing
set gg_trg_ROE_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_ROE_Begin, Condition( function Trig_ROE_Begin_Conditions ) )
call TriggerAddAction( gg_trg_ROE_Begin, function Trig_ROE_Begin_Actions )
endfunction
function Trig_ROE_Effect_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05Z' ) ) then
return false
endif
return true
endfunction
function Trig_ROE_Effect_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local location point1
local integer a = 1
local integer b
loop
exitwhen (a > (250/4)-6) or ( IsUnitDeadBJ(u) == true )
set b = GetRandomInt(1, 20)
if ( b < 4 ) then
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call AddSpecialEffectLocBJ( point1, "Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget.mdl" )
call TriggerExecute( gg_trg_ROE_Effect_Off )
endif
if (b < 12) then
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call AddSpecialEffectLocBJ( point1, "Abilities\\Spells\\NightElf\\Starfall\\StarfallTarget.mdl" )
call TriggerExecute( gg_trg_ROE_Effect_Off )
endif
if ( b > 4 ) and (b<15) then
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call AddSpecialEffectLocBJ( point1, "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" )
call TriggerExecute( gg_trg_ROE_Effect_Off )
endif
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call AddSpecialEffectLocBJ( point1, "Abilities\\Spells\\Demon\\RainOfFire\\RainOfFireTarget.mdl" )
call TriggerExecute( gg_trg_ROE_Effect_Off )
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call AddSpecialEffectLocBJ( point1, "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
call TriggerExecute( gg_trg_ROE_Effect_Off )
call TriggerSleepAction( 0.40 )
set a = a + 1
endloop
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
endfunction
//===========================================================================
function InitTrig_ROE_Effect takes nothing returns nothing
set gg_trg_ROE_Effect = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Effect, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Effect, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Effect, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Effect, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ROE_Effect, Condition( function Trig_ROE_Effect_Conditions ) )
call TriggerAddAction( gg_trg_ROE_Effect, function Trig_ROE_Effect_Actions )
endfunction
function Trig_ROE_Fix_Bug_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05X' ) ) then
return false
endif
return true
endfunction
function Trig_ROE_Fix_Bug_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_RainOfElementGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(hero) ) then
call KillUnit( f )
call GroupRemoveUnitSimple( f, udg_RainOfElementGroup )
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
set f = null
set hero = null
endfunction
//===========================================================================
function InitTrig_ROE_Fix_Bug takes nothing returns nothing
set gg_trg_ROE_Fix_Bug = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Fix_Bug, Player(0), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Fix_Bug, Player(1), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Fix_Bug, Player(2), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROE_Fix_Bug, Player(3), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_ROE_Fix_Bug, Condition( function Trig_ROE_Fix_Bug_Conditions ) )
call TriggerAddAction( gg_trg_ROE_Fix_Bug, function Trig_ROE_Fix_Bug_Actions )
endfunction
function Trig_Muti_Shockwave_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04F' ) ) then
return false
endif
return true
endfunction
function Trig_Muti_Shockwave_Actions takes nothing returns nothing
local integer a
local unit u = GetSpellAbilityUnit()
local location point = GetUnitLoc(u)
local location point1
call TriggerSleepAction( 0.40 )
set a = 1
loop
exitwhen a > 8
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, AngleBetweenPoints(point, PolarProjectionBJ(point, 10.00, ( 45.00 * I2R(a) ))) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A05E', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05E', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04F', u) )
set point1 = PolarProjectionBJ(point, 10.00, ( 45.00 * I2R(a) ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "carrionswarm", point1 )
set a = a + 1
endloop
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_Muti_Shockwave takes nothing returns nothing
set gg_trg_Muti_Shockwave = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Shockwave, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Shockwave, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Shockwave, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Muti_Shockwave, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Muti_Shockwave, Condition( function Trig_Muti_Shockwave_Conditions ) )
call TriggerAddAction( gg_trg_Muti_Shockwave, function Trig_Muti_Shockwave_Actions )
endfunction
function Trig_AM_Learn_Skills_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A04G' ) ) then
return false
endif
return true
endfunction
function Trig_AM_Learn_Skills_Actions takes nothing returns nothing
local unit hero = GetLearningUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
if ( udg_AuraMasterHero == null ) then
set udg_AuraMasterHero = hero
call SetPlayerAbilityAvailableBJ( false, 'A06J', Player(0) )
call SetPlayerAbilityAvailableBJ( false, 'A06J', Player(1) )
call SetPlayerAbilityAvailableBJ( false, 'A06J', Player(2) )
call SetPlayerAbilityAvailableBJ( false, 'A06J', Player(3) )
call UnitAddAbilityBJ( 'A06J', hero )
call TriggerRegisterUnitInRangeSimple( gg_trg_AM_Action_1, 900.00, udg_AuraMasterHero )
endif
set g = GetUnitsInRangeOfLocAll(900, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == true ) then
call SetUnitAbilityLevelSwapped( 'A06J', f, GetUnitAbilityLevelSwapped('A04G', udg_AuraMasterHero) )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set hero = null
endfunction
//===========================================================================
function InitTrig_AM_Learn_Skills takes nothing returns nothing
set gg_trg_AM_Learn_Skills = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Learn_Skills, Player(0), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Learn_Skills, Player(1), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Learn_Skills, Player(2), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Learn_Skills, Player(3), EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_AM_Learn_Skills, Condition( function Trig_AM_Learn_Skills_Conditions ) )
call TriggerAddAction( gg_trg_AM_Learn_Skills, function Trig_AM_Learn_Skills_Actions )
endfunction
function Trig_AMM_Action_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(udg_AuraMasterHero)) == true ) ) then
return false
endif
return true
endfunction
function Trig_AM_Action_1 takes nothing returns nothing
local unit u = GetEnteringUnit()
call UnitRemoveAbilityBJ( 'A06J', u )
call UnitAddAbilityBJ( 'A06J', u )
call SetUnitAbilityLevelSwapped( 'A06J', u, GetUnitAbilityLevelSwapped('A04G', udg_AuraMasterHero) )
call TriggerSleepAction(2.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_AuraMasterHero))) == false ) or ( IsUnitAliveBJ(udg_AuraMasterHero) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(0.1)
endloop
call UnitRemoveAbilityBJ( 'A06J', u )
set u = null
endfunction
//===========================================================================
function InitTrig_AM_Action_1 takes nothing returns nothing
set gg_trg_AM_Action_1 = CreateTrigger( )
call TriggerAddCondition( gg_trg_AM_Action_1, Condition( function Trig_AMM_Action_Conditions ) )
call TriggerAddAction( gg_trg_AM_Action_1, function Trig_AM_Action_1 )
endfunction
function Trig_COL_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01M' ) ) then
return false
endif
return true
endfunction
function CL_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00P', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function CL_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01O', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "purge", target )
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
endfunction
function Trig_COL_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function CL_Conditions))
local triggeraction taction = TriggerAddAction(t, function CL_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local unit u
local location point = GetUnitLoc(target)
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 6.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(1500, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A00P', u )
call SetUnitAbilityLevelSwapped( 'A00P', u, GetUnitAbilityLevelSwapped('A01M', hero) )
call IssueTargetOrderBJ( u, "chainlightning", target )
call TimerStart(tx,6,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_COL_Begin takes nothing returns nothing
set gg_trg_COL_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_COL_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_COL_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_COL_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_COL_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_COL_Begin, Condition( function Trig_COL_Begin_Conditions ) )
call TriggerAddAction( gg_trg_COL_Begin, function Trig_COL_Begin_Actions )
endfunction
function Trig_SOW_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A022', GetAttacker()) > 0 ) ) then
return false
endif
return true
endfunction
function SOWW_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A05W', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function SOWW_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(hero)
call UnitRemoveAbilityBJ( 'A05W', hero )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, GetUnitFacing(hero) )
call ReplaceUnitBJ( GetLastCreatedUnit(), udg_SpiritOfWolfUnit[GetUnitAbilityLevelSwapped('A022', hero)], bj_UNIT_STATE_METHOD_MAXIMUM )
set point = GetUnitLoc(GetLastReplacedUnitBJ())
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitApplyTimedLifeBJ( 30.00, 'B00Q', GetLastReplacedUnitBJ() )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
function Trig_SOW_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function SOWW_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function SOWW_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= (GetUnitAbilityLevelSwapped('A022', attacker)) ) then
call UnitAddAbilityBJ( 'A05W', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A05W', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_SOW_Action takes nothing returns nothing
set gg_trg_SOW_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOW_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOW_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_SOW_Action, Condition( function Trig_SOW_Action_Conditions ) )
call TriggerAddAction( gg_trg_SOW_Action, function Trig_SOW_Action_Actions )
endfunction
function Trig_LS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08R' ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetSpellTargetUnit(), 'B00W') == false ) ) then
return false
endif
return true
endfunction
function Trig_LS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location point = GetUnitLoc(target)
local unit u
local boolean flag
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A08S', u )
call SetUnitAbilityLevelSwapped( 'A08S', u, GetUnitAbilityLevelSwapped('A08R', hero) )
loop
set flag = false
set point = GetUnitLoc(target)
call GroupClear(g)
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = GroupPickRandomUnit(g)
exitwhen (flag == true) or (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(target)) == false ) then
call SetUnitPositionLoc( u, point )
call SetUnitFlyHeightBJ( u, GetUnitFlyHeight(target), 9999.00 )
call IssueTargetOrderBJ( u, "chainlightning", f )
call UnitResetCooldown( u )
set flag = true
endif
call GroupRemoveUnit(g, f)
endloop
call TriggerSleepAction( 2.00 )
exitwhen ( IsUnitAliveBJ(target) == false ) or ( UnitHasBuffBJ(target, 'B00W') == false )
endloop
call KillUnit( u )
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set hero = null
set u = null
set f = null
set target = null
endfunction
//===========================================================================
function InitTrig_LS_Begin takes nothing returns nothing
set gg_trg_LS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_LS_Begin, Condition( function Trig_LS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_LS_Begin, function Trig_LS_Begin_Actions )
endfunction
function Trig_HF_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01E' ) ) then
return false
endif
return true
endfunction
function Trig_HF_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit dump
local location point = GetSpellTargetLoc()
local player pl = GetOwningPlayer(hero)
local location temppoint
call TriggerSleepAction( 1.00 )
call IssueImmediateOrderBJ( hero, "stop" )
call PauseUnitBJ( true, hero )
call ShowUnitHide( hero )
set temppoint = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e00H', pl, temppoint, GetUnitFacing(hero) )
set dump = GetLastCreatedUnit()
call SetUnitAnimation( dump, "Attack Walk Stand Spin" )
call SetUnitFlyHeightBJ( dump, 800.00, 800.00 )
call TriggerSleepAction( 1.00 )
set temppoint = point
call SetUnitPositionLocFacingBJ( dump, temppoint, AngleBetweenPoints(GetUnitLoc(hero), temppoint) )
call SetUnitAnimation( dump, "Attack Slam" )
call SetUnitFlyHeightBJ( dump, 0.00, 1100.00 )
call TriggerSleepAction( ( 800.00 / 1100.00 ) )
call RemoveUnit( dump )
set temppoint = PolarProjectionBJ(point, 100.00, AngleBetweenPoints(GetUnitLoc(hero), point))
call AddSpecialEffectLocBJ( temppoint, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
set temppoint = PolarProjectionBJ(point, 100.00, AngleBetweenPoints(GetUnitLoc(hero), point))
call CreateNUnitsAtLoc( 1, 'e009', pl, temppoint, AngleBetweenPoints(GetUnitLoc(hero), point) )
call SetUnitPositionLoc( hero, point )
call PauseUnitBJ( false, hero )
call ShowUnitShow( hero )
// ---------------------------
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01E', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
// ---------------------------
call SelectUnitForPlayerSingle( hero, pl )
call RemoveLocation(temppoint)
call RemoveLocation(point)
set point = null
set temppoint = null
set hero = null
set dump = null
set pl = null
endfunction
//===========================================================================
function InitTrig_HF_Begin takes nothing returns nothing
set gg_trg_HF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HF_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HF_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HF_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_HF_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_HF_Begin, Condition( function Trig_HF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_HF_Begin, function Trig_HF_Begin_Actions )
endfunction
function Trig_CSA_Prepare_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A008' ) ) then
return false
endif
return true
endfunction
function Trig_CSA_Prepare_Actions takes nothing returns nothing
local unit hero = GetLearningUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
if ( udg_CriticalStrikeAuraHero == null ) then
set udg_CriticalStrikeAuraHero = hero
call SetPlayerAbilityAvailableBJ( false, 'A01D', Player(0) )
call SetPlayerAbilityAvailableBJ( false, 'A01D', Player(1) )
call SetPlayerAbilityAvailableBJ( false, 'A01D', Player(2) )
call SetPlayerAbilityAvailableBJ( false, 'A01D', Player(3) )
call UnitAddAbilityBJ( 'A01D', hero )
call TriggerRegisterUnitInRangeSimple( gg_trg_CSA_Action, 900.00, hero )
endif
set udg_CriticalStrikeAuraHero = hero
set g = GetUnitsInRangeOfLocAll(900, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == true ) then
call SetUnitAbilityLevelSwapped( 'A01D', f, GetUnitAbilityLevelSwapped('A008', udg_CriticalStrikeAuraHero) )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set hero = null
endfunction
//===========================================================================
function InitTrig_CSA_Prepare takes nothing returns nothing
set gg_trg_CSA_Prepare = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CSA_Prepare, Player(0), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CSA_Prepare, Player(1), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CSA_Prepare, Player(2), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CSA_Prepare, Player(3), EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_CSA_Prepare, Condition( function Trig_CSA_Prepare_Conditions ) )
call TriggerAddAction( gg_trg_CSA_Prepare, function Trig_CSA_Prepare_Actions )
endfunction
function Trig_CSA_Action_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(udg_CriticalStrikeAuraHero)) == true ) ) then
return false
endif
return true
endfunction
function Trig_CSA_Action_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitRemoveAbilityBJ( 'A01D', u )
call UnitAddAbilityBJ( 'A01D', u )
call SetUnitAbilityLevelSwapped( 'A01D', u, GetUnitAbilityLevelSwapped('A008', udg_CriticalStrikeAuraHero) )
call TriggerSleepAction(2.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_CriticalStrikeAuraHero))) == false ) or ( IsUnitAliveBJ(udg_CriticalStrikeAuraHero) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(0.1)
endloop
call UnitRemoveAbilityBJ( 'A01D', u )
set u = null
endfunction
//===========================================================================
function InitTrig_CSA_Action takes nothing returns nothing
set gg_trg_CSA_Action = CreateTrigger( )
call TriggerAddCondition( gg_trg_CSA_Action, Condition( function Trig_CSA_Action_Conditions ) )
call TriggerAddAction( gg_trg_CSA_Action, function Trig_CSA_Action_Actions )
endfunction
function Trig_SI_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A08H', GetAttacker()) > 0 ) ) then
return false
endif
if ( not ( IsUnitIllusionBJ(GetAttacker()) == false ) ) then
return false
endif
return true
endfunction
function SI_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A08I', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function SI_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(hero)
call UnitRemoveAbilityBJ( 'A08I', hero )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, GetUnitFacing(hero) )
call UnitAddAbilityBJ( 'A08G', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08G', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08H', hero) )
call IssueTargetOrderById(GetLastCreatedUnit(), 852274, hero )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
function Trig_SI_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function SI_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function SI_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 20 ) then
call UnitAddAbilityBJ( 'A08I', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_SI_Action takes nothing returns nothing
set gg_trg_SI_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SI_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SI_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_SI_Action, Condition( function Trig_SI_Action_Conditions ) )
call TriggerAddAction( gg_trg_SI_Action, function Trig_SI_Action_Actions )
endfunction
function Trig_DA_Action_Actions takes nothing returns nothing
local integer chance = GetRandomInt(1, 100)
local group g = CreateGroup()
local unit f
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
if ( chance <= 30) then //reduce slow :D
set g = GetUnitsInRangeOfLocAll(900, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( UnitHasBuffBJ(f, 'B00Y') == true ) and ( IsUnitIllusionBJ(f) == false ) then
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(f), point, GetUnitFacing(f) )
call ReplaceUnitBJ( GetLastCreatedUnit(), udg_DarknessAuraUnit[GetUnitAbilityLevelSwapped('A08V', f)], bj_UNIT_STATE_METHOD_MAXIMUM )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastReplacedUnitBJ() )
endif
call GroupRemoveUnit(g, f)
endloop
endif
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
set u = null
endfunction
//===========================================================================
function InitTrig_DA_Action takes nothing returns nothing
set gg_trg_DA_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DA_Action, Player(10), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DA_Action, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_DA_Action, function Trig_DA_Action_Actions )
endfunction
function Trig_FS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09O' ) ) then
return false
endif
return true
endfunction
function Trig_FS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local location point1 = PolarProjectionBJ(GetUnitLoc(hero), 10.00, AngleBetweenPoints(GetUnitLoc(hero), point))
local integer a = 1
local boolean flag = false
call CreateNUnitsAtLoc( 1, 'e01O', GetOwningPlayer(hero), point1, AngleBetweenPoints(GetUnitLoc(hero), point) )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09O', hero) )
call UnitAddAbilityBJ( udg_FireStormAbility[GetUnitAbilityLevelSwapped('A09O', hero)], GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
call TriggerExecute( gg_trg_FS_Run )
call TriggerExecute( gg_trg_FS_Damage )
loop
exitwhen a > ( GetUnitAbilityLevelSwapped('A09O', hero) + 1 )
if flag == false then
set point1 = PolarProjectionBJ(GetUnitLoc(hero), 10.00, ( AngleBetweenPoints(GetUnitLoc(hero), point) - (a * 20) ) )
call CreateNUnitsAtLoc( 1, 'e01O', GetOwningPlayer(hero), point1, ( AngleBetweenPoints(GetUnitLoc(hero), point) - (a * 20) ) )
set flag = true
else
set point1 = PolarProjectionBJ(GetUnitLoc(hero), 10.00, ( AngleBetweenPoints(GetUnitLoc(hero), point) + (a * 20) ) )
call CreateNUnitsAtLoc( 1, 'e01O', GetOwningPlayer(hero), point1, ( AngleBetweenPoints(GetUnitLoc(hero), point) + (a * 20) ) )
set flag = false
endif
call SetUnitAbilityLevelSwapped( 'A09N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09O', hero) )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
call TriggerExecute( gg_trg_FS_Run )
call TriggerExecute( gg_trg_FS_Damage )
set a = a + 1
endloop
set hero = null
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
endfunction
//===========================================================================
function InitTrig_FS_Begin takes nothing returns nothing
set gg_trg_FS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_FS_Begin, Condition( function Trig_FS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_FS_Begin, function Trig_FS_Begin_Actions )
endfunction
function Trig_FS_Run_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local boolean flag = false
local real a = GetUnitFacing(u)
local real temp
local location point
loop
exitwhen IsUnitDeadBJ(u) == true
set temp = GetRandomReal(10, 30)
if flag == false then
call SetUnitAnimation( u, "birth" )
set point = PolarProjectionBJ(GetUnitLoc(u), 256, ( a - temp ))
call IssuePointOrderLocBJ( u, "move", point )
call TriggerSleepAction( 0.5 )
call SetUnitAnimation( u, "birth" )
set point = PolarProjectionBJ(GetUnitLoc(u), 256, ( a + temp ))
call IssuePointOrderLocBJ( u, "move", point )
set flag = true
else
call SetUnitAnimation( u, "birth" )
set point = PolarProjectionBJ(GetUnitLoc(u), 256, ( a + temp ))
call IssuePointOrderLocBJ( u, "move", point )
call TriggerSleepAction( 0.5 )
call SetUnitAnimation( u, "birth" )
set point = PolarProjectionBJ(GetUnitLoc(u), 256, ( a - temp ))
call IssuePointOrderLocBJ( u, "move", point )
set flag = false
endif
call TriggerSleepAction( 0.5 )
endloop
set u = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_FS_Run takes nothing returns nothing
set gg_trg_FS_Run = CreateTrigger( )
call TriggerAddAction( gg_trg_FS_Run, function Trig_FS_Run_Actions )
endfunction
function Trig_FS_Damage_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local location point
loop
exitwhen IsUnitDeadBJ(u) == true
set point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e01N', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( udg_FireStormAbility[GetUnitUserData(u)], GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\LiquidFire\\Liquidfire.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call TriggerSleepAction( 0.0 )
endloop
set u = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_FS_Damage takes nothing returns nothing
set gg_trg_FS_Damage = CreateTrigger( )
call TriggerAddAction( gg_trg_FS_Damage, function Trig_FS_Damage_Actions )
endfunction
function Trig_GS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09Q' ) ) then
return false
endif
return true
endfunction
function Trig_GS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e01R', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'e01Q', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'e01P', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
//-----------------------------------
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A09R', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A09R', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09Q', hero) )
call UnitApplyTimedLifeBJ( 0.1, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 200 )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_GS_Begin takes nothing returns nothing
set gg_trg_GS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_GS_Begin, Condition( function Trig_GS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_GS_Begin, function Trig_GS_Begin_Actions )
endfunction
function Trig_GS_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A09R', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_GS_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
local group g = CreateGroup()
local unit f
local real damage = ( I2R(GetUnitAbilityLevelSwapped('A09R', u)) * 10.00 )
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A09R', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A09R', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09R', u) )
call UnitApplyTimedLifeBJ( 0.1, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set g = GetUnitsInRangeOfLocAll( 800.00, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == false ) then
if ( ( GetUnitStateSwap(UNIT_STATE_LIFE, f) - damage ) >= 1.00 ) then
set point1 = GetUnitLoc(f)
call SetUnitLifeBJ( f, ( GetUnitStateSwap(UNIT_STATE_LIFE, f) - damage ) )
call SetUnitPositionLoc( f, PolarProjectionBJ(point, ( DistanceBetweenPoints(point, point1) - 2.00 ), AngleBetweenPoints(point, point1)) )
else
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), f, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
endif
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveUnit( u )
call RemoveLocation(point1)
set point1 = null
call RemoveLocation(point)
set point = null
set u = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_GS_Fake_Action takes nothing returns nothing
set gg_trg_GS_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_GS_Fake_Action, Condition( function Trig_GS_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_GS_Fake_Action, function Trig_GS_Fake_Action_Actions )
endfunction
function Trig_GS_Effect_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e01R' ) ) then
return false
endif
return true
endfunction
function Trig_GS_Effect_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local unit f
set g = GetUnitsInRangeOfLocAll( 800.00, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == false ) then
call UnitRemoveAbilityBJ( 'Aatk', f )
call SetUnitMoveSpeed( f, ( GetUnitDefaultMoveSpeed(f) / 2.00 ) )
call AddSpecialEffectTargetUnitBJ( "origin", f, "Abilities\\Spells\\Human\\ManaFlare\\ManaFlareBoltImpact.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
set point = null
set u = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_GS_Effect_Action takes nothing returns nothing
set gg_trg_GS_Effect_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Effect_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Effect_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Effect_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GS_Effect_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_GS_Effect_Action, Condition( function Trig_GS_Effect_Action_Conditions ) )
call TriggerAddAction( gg_trg_GS_Effect_Action, function Trig_GS_Effect_Action_Actions )
endfunction
function Trig_LOC_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A009', GetLearningUnit()) == 1 ) ) then
return false
endif
if ( not ( GetLearnedSkillBJ() == 'A009' ) ) then
return false
endif
return true
endfunction
function Trig_LOC_Begin_Actions takes nothing returns nothing
local unit hero = GetLearningUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
loop
if ( IsUnitAliveBJ(hero) == true ) then
set point = GetUnitLoc(hero)
call GroupClear(g)
set g = GetUnitsInRangeOfLocAll(900, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_ANCIENT) == false ) and ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitDeadBJ(f) == true ) and ( IsUnitType(f, UNIT_TYPE_HERO) == false ) then
set point = GetUnitLoc(f)
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit( f )
call UnitAddItemByIdSwapped( udg_LifeOfCorpseTome[GetUnitAbilityLevelSwapped('A009', hero)], hero )
endif
call GroupRemoveUnit(g, f)
endloop
endif
call TriggerSleepAction( 4.00 )
endloop
set hero = null
endfunction
//===========================================================================
function InitTrig_LOC_Begin takes nothing returns nothing
set gg_trg_LOC_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LOC_Begin, Player(0), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LOC_Begin, Player(1), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LOC_Begin, Player(2), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_LOC_Begin, Player(3), EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_LOC_Begin, Condition( function Trig_LOC_Begin_Conditions ) )
call TriggerAddAction( gg_trg_LOC_Begin, function Trig_LOC_Begin_Actions )
endfunction
function Trig_PD_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01A' ) ) then
return false
endif
return true
endfunction
function Trig_PD_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
local integer bodem = 0
set udg_PowerDrainHero = hero
set g = GetUnitsInRangeOfLocAll(1000, point)
call GroupRemoveUnit(g, u)
loop
set f = FirstOfGroup(g)
exitwhen (f == null) or ( bodem > 3 )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e00G', Player(PLAYER_NEUTRAL_AGGRESSIVE), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
// call CreateNUnitsAtLoc( 1, 'e00G', Player(0), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', GetLastCreatedUnit() )
call TriggerExecute( gg_trg_PD_Action )
call UnitAddAbilityBJ( 'A01B', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01B', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01A', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "drain", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
set hero = null
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_PD_Begin takes nothing returns nothing
set gg_trg_PD_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_PD_Begin, Condition( function Trig_PD_Begin_Conditions ) )
call TriggerAddAction( gg_trg_PD_Begin, function Trig_PD_Begin_Actions )
endfunction
function Trig_PD_Action_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
loop
call SetUnitLifeBJ( udg_PowerDrainHero, ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_PowerDrainHero) + ( 20.00 + ( I2R(GetUnitAbilityLevelSwapped('A01A', udg_PowerDrainHero)) * 20.00 ) ) ) )
call TriggerSleepAction( 1.00 )
exitwhen ( IsUnitAliveBJ(udg_PowerDrainHero) == false ) or ( GetUnitCurrentOrder(udg_PowerDrainHero) != String2OrderIdBJ("drain") )
endloop
call KillUnit( u )
set u = null
endfunction
//===========================================================================
function InitTrig_PD_Action takes nothing returns nothing
set gg_trg_PD_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_PD_Action, function Trig_PD_Action_Actions )
endfunction
function Trig_PD_Finish_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01A' ) ) then
return false
endif
if ( not ( IsUnitType(GetSpellAbilityUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_PD_Finish_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
call ModifyHeroStat( bj_HEROSTAT_STR, u, bj_MODIFYMETHOD_ADD, 1 )
call ModifyHeroStat( bj_HEROSTAT_AGI, u, bj_MODIFYMETHOD_ADD, 1 )
call ModifyHeroStat( bj_HEROSTAT_INT, u, bj_MODIFYMETHOD_ADD, 1 )
call AddSpecialEffectTargetUnitBJ( "chest", u, "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set u = null
endfunction
//===========================================================================
function InitTrig_PD_Finish takes nothing returns nothing
set gg_trg_PD_Finish = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Finish, Player(0), EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Finish, Player(1), EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Finish, Player(2), EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PD_Finish, Player(3), EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_PD_Finish, Condition( function Trig_PD_Finish_Conditions ) )
call TriggerAddAction( gg_trg_PD_Finish, function Trig_PD_Finish_Actions )
endfunction
function Trig_CA_Take_E_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A01L', GetAttacker()) > 0 ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetAttackedUnitBJ(), GetOwningPlayer(GetAttacker())) == true ) ) then
return false
endif
return true
endfunction
function Trig_ColdArrow_E_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A01L', GetEventDamageSource()) > 0 ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B009') == true ) ) then
return false
endif
return true
endfunction
function ColdArrow_Damage takes nothing returns nothing
local location point
call UnitRemoveBuffBJ( 'B009', GetTriggerUnit() )
set point = GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc( 1, 'e00X', GetOwningPlayer(GetEventDamageSource()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetEventDamageSource()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01K', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01K', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01L', GetEventDamageSource()) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
endfunction
function Trig_CA_Take_E_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function ColdArrow_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function Trig_ColdArrow_E_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_CA_Take_E takes nothing returns nothing
set gg_trg_CA_Take_E = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CA_Take_E, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_CA_Take_E, Condition( function Trig_CA_Take_E_Conditions ) )
call TriggerAddAction( gg_trg_CA_Take_E, function Trig_CA_Take_E_Actions )
endfunction
function Trig_CA_Cast_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A01L', GetOrderedUnit()) > 0 ) ) then
return false
endif
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("coldarrowstarg") ) ) then
return false
endif
return true
endfunction
function Trig_CA_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A01L', GetEventDamageSource()) > 0 ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B009') == true ) ) then
return false
endif
return true
endfunction
function CA_Cast_Damage takes nothing returns nothing
local location point = GetUnitLoc(GetTriggerUnit())
call UnitRemoveBuffBJ( 'B009', GetTriggerUnit() )
call CreateNUnitsAtLoc( 1, 'e00X', GetOwningPlayer(GetEventDamageSource()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetEventDamageSource()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01K', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01K', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01L', GetEventDamageSource()) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
endfunction
function Trig_CA_Cast_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetOrderedUnit()
local triggeraction taction = TriggerAddAction(t, function CA_Cast_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function Trig_CA_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,4,false,null)
call TriggerRegisterUnitEvent(t,GetOrderTargetUnit(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
endfunction
//===========================================================================
function InitTrig_CA_Cast takes nothing returns nothing
set gg_trg_CA_Cast = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Cast, Player(0), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Cast, Player(1), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Cast, Player(2), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Cast, Player(3), EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( gg_trg_CA_Cast, Condition( function Trig_CA_Cast_Conditions ) )
call TriggerAddAction( gg_trg_CA_Cast, function Trig_CA_Cast_Actions )
endfunction
function Trig_MTDC_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00M' ) ) then
return false
endif
return true
endfunction
function Trig_MTDC_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
local integer bodem = 0
call TriggerSleepAction( 0.30 )
call GroupAddUnitSimple( hero, udg_MutiDeathCoilGroup )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(u)) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00N', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00M', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "deathcoil", u )
call GroupRemoveUnit(g, u)
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = FirstOfGroup(g)
exitwhen ((f == null) or ( bodem >= 2 ))
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00N', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00M', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "deathcoil", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
set hero = null
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_MTDC_Begin takes nothing returns nothing
set gg_trg_MTDC_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_MTDC_Begin, Condition( function Trig_MTDC_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MTDC_Begin, function Trig_MTDC_Begin_Actions )
endfunction
function Trig_MTDC_Return_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00N' ) ) then
return false
endif
return true
endfunction
function Trig_MTDC_Return_Copy_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location point
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_MutiDeathCoilGroup, g )
call TriggerSleepAction( ( DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target)) / 1100.00 ) )
set point = GetUnitLoc(target)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(caster) ) then
call CreateNUnitsAtLoc( 1, 'e005', GetOwningPlayer(caster), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00N', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00N', caster) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", f )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set point = null
set target=null
set caster=null
endfunction
//===========================================================================
function InitTrig_MTDC_Return takes nothing returns nothing
set gg_trg_MTDC_Return = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Return, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Return, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Return, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Return, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MTDC_Return, Condition( function Trig_MTDC_Return_Copy_Conditions ) )
call TriggerAddAction( gg_trg_MTDC_Return, function Trig_MTDC_Return_Copy_Actions )
endfunction
function Trig_MTDC_Regen_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'e005' ) ) then
return false
endif
return true
endfunction
function MTDC_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00N', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function MTDC_Damage takes nothing returns nothing
local unit hero = GetTriggerUnit()
local unit u = GetEventDamageSource()
local location point = GetUnitLoc(u)
local integer hppoint = (GetUnitAbilityLevelSwapped('A00N', u) * 100)
call UnitRemoveAbilityBJ( 'A00N', u )
call SetUnitLifeBJ( hero, ( GetUnitStateSwap(UNIT_STATE_LIFE, hero) + I2R(hppoint) ) )
call RemoveUnit( u )
set u = null
set hero = null
call RemoveLocation(point)
set point = null
endfunction
function Trig_MTDC_Regen_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function MTDC_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function MTDC_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,5,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_MTDC_Regen takes nothing returns nothing
set gg_trg_MTDC_Regen = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Regen, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Regen, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Regen, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MTDC_Regen, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_MTDC_Regen, Condition( function Trig_MTDC_Regen_Conditions ) )
call TriggerAddAction( gg_trg_MTDC_Regen, function Trig_MTDC_Regen_Actions )
endfunction
function Trig_Copy_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'U001' ) ) then
return false
endif
return true
endfunction
function Trig_Copy_Death_Actions takes nothing returns nothing
local unit hero = GetSummoningUnit()
local unit u = GetSummonedUnit()
call ModifyHeroStat( bj_HEROSTAT_STR, u, bj_MODIFYMETHOD_SET, ( GetHeroStatBJ(bj_HEROSTAT_STR, hero, false) / 2 ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, u, bj_MODIFYMETHOD_SET, ( GetHeroStatBJ(bj_HEROSTAT_AGI, hero, false) / 2 ) )
call ModifyHeroStat( bj_HEROSTAT_INT, u, bj_MODIFYMETHOD_SET, ( GetHeroStatBJ(bj_HEROSTAT_INT, hero, false) / 2 ) )
call UnitApplyTimedLifeBJ( ( 10.00 + ( 10.00 * I2R(GetUnitAbilityLevelSwapped('A018', hero)) ) ), 'BTLF', u )
call SuspendHeroXPBJ( false, u )
set u = null
set hero = null
endfunction
//===========================================================================
function InitTrig_Copy_Death takes nothing returns nothing
set gg_trg_Copy_Death = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Copy_Death, Player(0), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Copy_Death, Player(1), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Copy_Death, Player(2), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Copy_Death, Player(3), EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Copy_Death, Condition( function Trig_Copy_Death_Conditions ) )
call TriggerAddAction( gg_trg_Copy_Death, function Trig_Copy_Death_Actions )
endfunction
function Trig_BF_Begin_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("immolation") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'Utic' ) ) then
return false
endif
return true
endfunction
function Trig_BF_Begin_Actions takes nothing returns nothing
local unit hero = GetOrderedUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_BerserkFireGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(hero) ) then
call RemoveUnit( f )
call GroupRemoveUnitSimple( f, udg_BerserkFireGroup )
endif
call GroupRemoveUnit(g, f)
endloop
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call TriggerExecute( gg_trg_BF_Action )
call SetUnitScalePercent( GetLastCreatedUnit(), 50.00, 50.00, 50.00 )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_BerserkFireGroup )
call UnitAddAbilityBJ( 'A01P', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set hero = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_BF_Begin takes nothing returns nothing
set gg_trg_BF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_BF_Begin, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_BF_Begin, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_BF_Begin, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_BF_Begin, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_BF_Begin, Condition( function Trig_BF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_BF_Begin, function Trig_BF_Begin_Actions )
endfunction
function Trig_BF_Action_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local unit hero = GetOrderedUnit()
local location point
local group g = CreateGroup()
local unit f
local boolean flag
loop
set flag = false
set point = GetUnitLoc(hero)
call GroupClear(g)
set g = GetUnitsInRangeOfLocAll(800, point)
loop
set f = GroupPickRandomUnit(g)
exitwhen (flag == true) or (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call SetUnitPositionLoc( u, point )
call IssueTargetOrderBJ( u, "acidbomb", f )
call UnitResetCooldown( u )
set flag = true
endif
call GroupRemoveUnit(g, f)
endloop
call TriggerSleepAction( 0.50 )
exitwhen ( GetUnitStateSwap(UNIT_STATE_MANA, hero) < 10.00 ) or ( IsUnitAliveBJ(hero) == false ) or ( UnitHasBuffBJ(hero, 'B00O') == false )
endloop
call KillUnit( u )
call IssueImmediateOrderBJ( hero, "manashieldoff" )
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set hero = null
set u = null
set f = null
endfunction
//===========================================================================
function InitTrig_BF_Action takes nothing returns nothing
set gg_trg_BF_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_BF_Action, function Trig_BF_Action_Actions )
endfunction
function Trig_ROC_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05B' ) ) then
return false
endif
return true
endfunction
function Trig_ROC_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05V', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05V', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05B', hero) )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 0.10, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 10 )
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_ROC_Begin takes nothing returns nothing
set gg_trg_ROC_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_ROC_Begin, Condition( function Trig_ROC_Begin_Conditions ) )
call TriggerAddAction( gg_trg_ROC_Begin, function Trig_ROC_Begin_Actions )
endfunction
function Trig_ROC_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05V', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_ROC_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05V', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05V', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05V', u) )
call UnitApplyTimedLifeBJ( 0.10, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
//----------------------------
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 800.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e00Z', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05V', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05V', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05V', u) )
call UnitApplyTimedLifeBJ( 0.80, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_ROC_Fake_Action takes nothing returns nothing
set gg_trg_ROC_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROC_Fake_Action, Condition( function Trig_ROC_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_ROC_Fake_Action, function Trig_ROC_Fake_Action_Actions )
endfunction
function Trig_ROC_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e00Z' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05V', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_ROC_Die_Actions takes nothing returns nothing
local unit hero = GetDyingUnit()
local location point = GetUnitLoc(hero)
local integer a = GetUnitAbilityLevelSwapped('A05V', hero)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A030', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A030', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05V', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
// call TriggerSleepAction( 0.10 )
// ------------------------------------------
call CreateNUnitsAtLoc( 1, udg_RainOfChaosUnit[a], GetOwningPlayer(hero), point, bj_UNIT_FACING )
call SetUnitAnimation( GetLastCreatedUnit(), "birth" )
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_ROC_Die takes nothing returns nothing
set gg_trg_ROC_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROC_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROC_Die, Condition( function Trig_ROC_Die_Conditions ) )
call TriggerAddAction( gg_trg_ROC_Die, function Trig_ROC_Die_Actions )
endfunction
function Trig_ROF_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_ROF_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A001', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A001', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A000', hero) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 25 )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_ROF_Begin takes nothing returns nothing
set gg_trg_ROF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_ROF_Begin, Condition( function Trig_ROF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_ROF_Begin, function Trig_ROF_Begin_Actions )
endfunction
function Trig_ROF_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05U', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_ROF_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A001', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A001', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A001', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 350.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e002', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A001', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A001', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A001', u) )
call UnitApplyTimedLifeBJ( 0.80, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_ROF_Fake_Action takes nothing returns nothing
set gg_trg_ROF_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROF_Fake_Action, Condition( function Trig_ROF_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_ROF_Fake_Action, function Trig_ROF_Fake_Action_Actions )
endfunction
function Trig_ROF_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e002' ) ) then
return false
endif
return true
endfunction
function Trig_ROF_Die_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A001', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A001', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A001', u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveUnit( GetDyingUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_ROF_Die takes nothing returns nothing
set gg_trg_ROF_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROF_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROF_Die, Condition( function Trig_ROF_Die_Conditions ) )
call TriggerAddAction( gg_trg_ROF_Die, function Trig_ROF_Die_Actions )
endfunction
function Trig_CA_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Q' ) ) then
return false
endif
return true
endfunction
function Trig_CA_Begin_Actions takes nothing returns nothing
call UnitAddAbilityBJ( 'A048', GetSpellTargetUnit() )
call SetUnitAbilityLevelSwapped( 'A048', GetSpellTargetUnit(), GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) )
endfunction
//===========================================================================
function InitTrig_CA_Begin takes nothing returns nothing
set gg_trg_CA_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CA_Begin, Condition( function Trig_CA_Begin_Conditions ) )
call TriggerAddAction( gg_trg_CA_Begin, function Trig_CA_Begin_Actions )
endfunction
function Trig_CA_Gen_Event_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetAttackedUnitBJ(), 'B002') == true ) ) then
return false
endif
return true
endfunction
function CA_Con takes nothing returns boolean
if ( not ( IsUnitType(GetEventDamageSource(), UNIT_TYPE_RANGED_ATTACKER) == true ) ) then
return false
endif
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B002') == true ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetEventDamageSource(), GetOwningPlayer(GetTriggerUnit())) == true ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A048', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function CA_Dmg takes nothing returns nothing
local unit hero = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(hero)
local real damage = ( I2R(GetUnitAbilityLevelSwapped('A048', hero)) * 100.00 )
call CreateNUnitsAtLoc( 1, 'e005', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(attacker)) )
call SetUnitUserData(GetLastCreatedUnit(), R2I(damage))
call UnitApplyTimedLifeBJ( 0.07, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00R', GetLastCreatedUnit() )
call SetUnitMoveSpeed( GetLastCreatedUnit(), 0 )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "coldarrowstarg", attacker )
call RemoveLocation(point)
set point = null
set hero = null
set attacker = null
endfunction
function Trig_CA_Gen_Event_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function CA_Dmg)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function CA_Con))
local timer tx = CreateTimer()
call UnitAddAbilityBJ( 'A048', attacker )
call TimerStart(tx,4,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A048', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_CA_Gen_Event takes nothing returns nothing
set gg_trg_CA_Gen_Event = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Gen_Event, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Gen_Event, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Gen_Event, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Gen_Event, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_CA_Gen_Event, Condition( function Trig_CA_Gen_Event_Conditions ) )
call TriggerAddAction( gg_trg_CA_Gen_Event, function Trig_CA_Gen_Event_Actions )
endfunction
function Trig_CA_Deals_Damage_Condi takes nothing returns boolean
if ( GetSpellAbilityId() == 'A00R' ) then
return true
endif
if ( GetSpellAbilityId() == 'A05R' ) then
return true
endif
return false
endfunction
function Trig_CA_Deals_Damage_Conditions takes nothing returns boolean
if ( not Trig_CA_Deals_Damage_Condi() ) then
return false
endif
return true
endfunction
function Trig_CA_Deals_Damage_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local unit e = GetSpellTargetUnit()
local location point = GetUnitLoc(u)
call TriggerSleepAction( ( DistanceBetweenPoints(GetUnitLoc(u), GetUnitLoc(e)) / 1500.00 ) - 0.1 )
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), e, GetUnitUserData(u), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call KillUnit( u )
set point = null
call RemoveLocation(point)
set u = null
set e = null
endfunction
//===========================================================================
function InitTrig_CA_Deals_Damage takes nothing returns nothing
set gg_trg_CA_Deals_Damage = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Deals_Damage, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Deals_Damage, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Deals_Damage, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CA_Deals_Damage, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CA_Deals_Damage, Condition( function Trig_CA_Deals_Damage_Conditions ) )
call TriggerAddAction( gg_trg_CA_Deals_Damage, function Trig_CA_Deals_Damage_Actions )
endfunction
function Trig_CIB_Take_E_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A012', GetAttacker()) > 0 ) ) then
return false
endif
if ( not ( IsUnitEnemy(GetAttackedUnitBJ(), GetOwningPlayer(GetAttacker())) == true ) ) then
return false
endif
return true
endfunction
function CIB_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A013', GetTriggerUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function CIB_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local real damage = GetEventDamage()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(GetTriggerUnit())
local unit f
local group g = CreateGroup()
local group damagegroup = CreateGroup()
local integer bodem = 0
call UnitRemoveAbilityBJ( 'A013', target )
if (not (GetEventDamage() == 0)) then
set g = GetUnitsInRangeOfLocAll(800, point)
call GroupRemoveUnit(g, target)
call GroupAddUnit(damagegroup, target)
loop
set f = FirstOfGroup(g)
exitwhen ((f == null) or ( bodem >= 1 ) )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(attacker)) == false ) and ( IsUnitInGroup(f, damagegroup) == false ) then
call GroupAddUnit(damagegroup, f)
call CreateNUnitsAtLoc( 1, 'e005', GetOwningPlayer(attacker), point, AngleBetweenPoints(point, GetUnitLoc(f) ) )
call SetUnitUserData(GetLastCreatedUnit(), R2I(damage))
call UnitApplyTimedLifeBJ( 0.1, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04C', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A012', attacker) )
call UnitAddAbilityBJ( 'A05R', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "blackarrow", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
endif
call RemoveLocation(point)
call DestroyGroup(damagegroup)
call DestroyGroup(g)
set damagegroup = null
set g = null
set f = null
set point = null
set target = null
set attacker = null
endfunction
function Trig_CIB_Take_E_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function CIB_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function CIB_Conditions))
local timer tx = CreateTimer()
local integer chance = GetRandomInt(1, 100)
if ( chance <= ( ( GetUnitAbilityLevelSwapped('A012', attacker) * 5 ) + 15 ) ) then
call UnitAddAbilityBJ( 'A013', GetAttackedUnitBJ() )
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
call TimerStart(tx,3,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1.00)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_CIB_Take_E takes nothing returns nothing
set gg_trg_CIB_Take_E = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_Take_E,Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_Take_E,Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_CIB_Take_E, Condition( function Trig_CIB_Take_E_Conditions ) )
call TriggerAddAction( gg_trg_CIB_Take_E, function Trig_CIB_Take_E_Actions )
endfunction
function Trig_CIB_More_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05R' ) ) then
return false
endif
if ( not ( GetUnitUserData(GetSpellAbilityUnit()) > 1 ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A04C', GetSpellAbilityUnit()) > 1 ) ) then
return false
endif
return true
endfunction
function Trig_CIB_More_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point = GetUnitLoc(u)
local unit f
local group g = CreateGroup()
local group damagegroup = CreateGroup()
local integer bodem = 0
call TriggerSleepAction( ( DistanceBetweenPoints(GetUnitLoc(hero), GetUnitLoc(u)) / 1500.00 ) )
set g = GetUnitsInRangeOfLocAll(800, point)
call GroupRemoveUnit(g, u)
call GroupAddUnit(damagegroup, u)
loop
set f = GroupPickRandomUnit(g)
exitwhen ((f == null) or ( bodem >= 1 ) )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) and ( IsUnitInGroup(f, damagegroup) == false ) then
call GroupAddUnit(damagegroup, f)
call CreateNUnitsAtLoc( 1, 'e005', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f) ) )
call RemoveLocation(point)
call SetUnitUserData(GetLastCreatedUnit(), GetUnitUserData(hero))
call UnitAddAbilityBJ( 'A04C', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04C', GetLastCreatedUnit(), (GetUnitAbilityLevelSwapped('A04C', hero) - 1) )
call UnitAddAbilityBJ( 'A05R', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "blackarrow", f )
call UnitApplyTimedLifeBJ( 0.1, 'BTLF', GetLastCreatedUnit() )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call DestroyGroup(damagegroup)
call DestroyGroup(g)
set damagegroup = null
set g = null
set f = null
set point = null
set u = null
set hero = null
endfunction
//===========================================================================
function InitTrig_CIB_More takes nothing returns nothing
set gg_trg_CIB_More = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_More, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_More, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_More, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_More, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CIB_More, Condition( function Trig_CIB_More_Conditions ) )
call TriggerAddAction( gg_trg_CIB_More, function Trig_CIB_More_Actions )
endfunction
function Trig_CIB_Fix_Bug_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'e005' ) ) then
return false
endif
return true
endfunction
function Trig_CIB_Fix_Bug_Actions takes nothing returns nothing
local unit u = GetAttacker()
call IssueImmediateOrderBJ( u, "stop" )
set u = null
endfunction
//===========================================================================
function InitTrig_CIB_Fix_Bug takes nothing returns nothing
set gg_trg_CIB_Fix_Bug = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_Fix_Bug, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CIB_Fix_Bug, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_CIB_Fix_Bug, Condition( function Trig_CIB_Fix_Bug_Conditions ) )
call TriggerAddAction( gg_trg_CIB_Fix_Bug, function Trig_CIB_Fix_Bug_Actions )
endfunction
function Trig_IP_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A017' ) ) then
return false
endif
return true
endfunction
function Trig_IP_Begin_Actions takes nothing returns nothing
local integer a
local location point
local unit hero = GetSpellAbilityUnit()
local unit orb
local unit f
local location targetpoint = GetSpellTargetLoc()
local integer damage = 0
local group g = CreateGroup()
local real x
local real y
set a = 1
loop
exitwhen a > 36
set point = PolarProjectionBJ(targetpoint, 50.00, ( I2R(a) * 10.00 ))
call CreateNUnitsAtLoc( 1, 'e00C', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(targetpoint, 50.00, ( I2R(a) * 10.00 )), targetpoint) )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
set damage = damage + ( GetUnitAbilityLevelSwapped('A017', hero) * 200 )
call TriggerSleepAction( 0.50 )
call CreateNUnitsAtLoc( 1, 'e00B', GetOwningPlayer(hero), targetpoint, bj_UNIT_FACING )
set orb = GetLastCreatedUnit()
call TriggerExecute( gg_trg_IP_Animation )
loop
exitwhen ( IsUnitDeadBJ(hero) == true ) or ( GetUnitCurrentOrder(hero) != String2OrderIdBJ("deathanddecay") )
set damage = damage + ( GetUnitAbilityLevelSwapped('A017', hero) * 200 )
set a = 0
loop
exitwhen a > 36
set point = PolarProjectionBJ(targetpoint, 50.00, ( I2R(a) * 10.00 ))
call CreateNUnitsAtLoc( 1, 'e00C', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(targetpoint, 50.00, ( I2R(a) * 10.00 )), targetpoint) )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
call TriggerSleepAction( 1.7 )
endloop
call DisplayTextToForce( GetPlayersAll(), ( "Ice Power will deals max damage : " + I2S(R2I(damage)) ) )
call UnitAddAbilityBJ( 'A016', orb )
call TriggerSleepAction( 5 )
set point = GetUnitLoc(orb)
call CreateNUnitsAtLoc( 1, 'e00C', GetOwningPlayer(orb), point, bj_UNIT_FACING )
call SetUnitScalePercent( GetLastCreatedUnit(), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ) )
call TriggerSleepAction( 1.00 )
call ShowUnitHide( orb )
call UnitApplyTimedLifeBJ( 6.00, 'BTLF', orb )
call SetUnitVertexColorBJ( orb, 100, 100, 100, 100.00 )
call CreateNUnitsAtLoc( 1, 'e00D', GetOwningPlayer(orb), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 50.00 )
call SetUnitScalePercent( GetLastCreatedUnit(), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ) )
call CreateNUnitsAtLoc( 1, 'e00E', GetOwningPlayer(orb), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 10.00 )
call SetUnitScalePercent( GetLastCreatedUnit(), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ), ( 150.00 + ( I2R(damage) * 1.00 ) ) )
set g = GetUnitsInRangeOfLocAll(1000, targetpoint)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(orb)) == false ) then
set point = GetUnitLoc(f)
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(orb), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), f, I2R(damage), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
endif
call GroupRemoveUnit(g, f)
endloop
call TriggerSleepAction( 0.50 )
set a = 1
loop
exitwhen a > 36
set point = GetUnitLoc(orb)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(orb), point, AngleBetweenPoints(point, PolarProjectionBJ(point, 100.00, ( I2R(a) * 10.00 ))) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A016', GetLastCreatedUnit() )
set point = PolarProjectionBJ(GetUnitLoc(orb), 1, ( I2R(a) * 10.00 ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "impale", point )
set a = a + 1
endloop
set f = null
call DestroyGroup(g)
set g = null
call KillUnit( orb )
call RemoveLocation(targetpoint)
call RemoveLocation(point)
set orb = null
set hero = null
set targetpoint = null
set point = null
endfunction
//===========================================================================
function InitTrig_IP_Begin takes nothing returns nothing
set gg_trg_IP_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IP_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IP_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IP_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IP_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_IP_Begin, Condition( function Trig_IP_Begin_Conditions ) )
call TriggerAddAction( gg_trg_IP_Begin, function Trig_IP_Begin_Actions )
endfunction
function Trig_IP_Animation_Actions takes nothing returns nothing
local unit u= GetLastCreatedUnit()
local integer size=100
loop
exitwhen ( size > 700 ) or ( GetUnitAbilityLevelSwapped('A016', u) > 0 )
call SetUnitScalePercent( u, size, size, size )
set size=size+6
call TriggerSleepAction( 0.0 )
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_IP_Animation takes nothing returns nothing
set gg_trg_IP_Animation = CreateTrigger( )
call TriggerAddAction( gg_trg_IP_Animation, function Trig_IP_Animation_Actions )
endfunction
function Trig_PR_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08J' ) ) then
return false
endif
return true
endfunction
function Trig_PR_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08J', hero) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 30 )
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_PR_Begin takes nothing returns nothing
set gg_trg_PR_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_PR_Begin, Condition( function Trig_PR_Begin_Conditions ) )
call TriggerAddAction( gg_trg_PR_Begin, function Trig_PR_Begin_Actions )
endfunction
function Trig_PR_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A08F', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_PR_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
local integer a = 1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08F', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
// --------------------
loop
exitwhen a > 3
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 500.00), GetRandomDirectionDeg())
set point1 = PolarProjectionBJ(point, 360.00, 135.00)
call CreateNUnitsAtLoc( 1, 'e01H', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A08F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08F', u) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1000.00 )
set a = a + 1
endloop
// --------------------
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_PR_Fake_Action takes nothing returns nothing
set gg_trg_PR_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_PR_Fake_Action, Condition( function Trig_PR_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_PR_Fake_Action, function Trig_PR_Fake_Action_Actions )
endfunction
function Trig_PR_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e01H' ) ) then
return false
endif
return true
endfunction
function Trig_PR_Die_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
local group g = CreateGroup()
local unit f
call AddSpecialEffectLocBJ( point, "Abilities\\Weapons\\PoisonSting\\PoisonStingTarget.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
set g = GetUnitsInRangeOfLocAll(150, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == false ) then
set point1 = GetUnitLoc(f)
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(u), point1, AngleBetweenPoints(point, point1) )
call UnitAddAbilityBJ( 'A08F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08F', u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", f )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', GetLastCreatedUnit() )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
set point = null
set u = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_PR_Die takes nothing returns nothing
set gg_trg_PR_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_PR_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_PR_Die, Condition( function Trig_PR_Die_Conditions ) )
call TriggerAddAction( gg_trg_PR_Die, function Trig_PR_Die_Actions )
endfunction
function Trig_DW_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08L' ) ) then
return false
endif
return true
endfunction
function DW_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A08M', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function DW2_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A04A', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function DW2_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08N', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08M', attacker) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", target )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', GetLastCreatedUnit() )
set target = null
set attacker = null
call RemoveLocation(point)
set point = null
endfunction
function DW_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
local integer chance = GetRandomInt(1, 100)
local location point1
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function DW2_Conditions))
local triggeraction taction = TriggerAddAction(t, function DW2_Damage)
local timer tx = CreateTimer()
local unit u
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08N', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08N', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08M', attacker) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", target )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', GetLastCreatedUnit() )
if ( chance <= 50 ) then
set point1 = PolarProjectionBJ(point, 10.00, ( AngleBetweenPoints(GetUnitLoc(attacker), point) - GetRandomReal(0.00, 180.00) ))
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point, AngleBetweenPoints(point, point1) )
set u = GetLastCreatedUnit()
call SetUnitScalePercent( u, 150.00, 150.00, 150.00 )
call SetUnitFlyHeightBJ( u, 150.00, 9999.00 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(attacker)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A04A', u )
call SetUnitAbilityLevelSwapped( 'A04A', u, GetUnitAbilityLevelSwapped('A08M', attacker) )
call IssuePointOrderLocBJ( u, "carrionswarm", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
endif
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
set taction = null
set tcondition = null
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set target = null
set attacker = null
set u = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
function Trig_DW_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function DW_Conditions))
local triggeraction taction = TriggerAddAction(t, function DW_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit u
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call SetUnitScalePercent( u, 300.00, 300.00, 300.00 )
call SetUnitFlyHeightBJ( u, 200.00, 9999.00 )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(1000, point1)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A08M', u )
call SetUnitAbilityLevelSwapped( 'A08M', u, GetUnitAbilityLevelSwapped('A08L', hero) )
call IssuePointOrderLocBJ( u, "carrionswarm", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_DW_Begin takes nothing returns nothing
set gg_trg_DW_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DW_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DW_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DW_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DW_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_DW_Begin, Condition( function Trig_DW_Begin_Conditions ) )
call TriggerAddAction( gg_trg_DW_Begin, function Trig_DW_Begin_Actions )
endfunction
function Trig_TB_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05C' ) ) then
return false
endif
return true
endfunction
function TB_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A08P', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function TB_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
local integer a = ( GetUnitUserData(attacker) + ( GetUnitUserData(attacker) * ( ( GetUnitAbilityLevelSwapped('A08P', attacker) * 10 ) / 100 ) ) )
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitDamageTargetBJ( GetLastCreatedUnit(), target, I2R(a), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call UnitApplyTimedLifeBJ( 0.3, 'BTLF', GetLastCreatedUnit() )
//-----------------
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08Q', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08Q', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A08P', attacker) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", target )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', GetLastCreatedUnit() )
set target = null
set attacker = null
call RemoveLocation(point)
set point = null
endfunction
function Trig_TB_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TB_Conditions))
local triggeraction taction = TriggerAddAction(t, function TB_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
local location point1
local group g = CreateGroup()
local integer a = 1
local unit f
local unit array u
set udg_ToxicBloodHero = GetSpellAbilityUnit()
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
loop
exitwhen a > 8
set point1 = PolarProjectionBJ(point, 10.00, ( 45.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, point1) )
set u[a] = GetLastCreatedUnit()
call SetUnitUserData( u[a], R2I(( GetUnitStateSwap(UNIT_STATE_LIFE, hero) * ( 10.00 / 100.00 ) )) )
call DisplayTextToForce( GetPlayersAll(), ( "hp = " + I2S(GetUnitUserData(u[a])) ) )
call SetUnitScalePercent( u[a], 300.00, 300.00, 300.00 )
call SetUnitFlyHeightBJ( u[a], 200.00, 9999.00 )
call UnitAddAbilityBJ( 'A08P', u[a] )
call SetUnitAbilityLevelSwapped( 'A08P', u[a], GetUnitAbilityLevelSwapped('A05C', hero) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u[a] )
call IssuePointOrderLocBJ( u[a], "carrionswarm", point1 )
set a = a + 1
endloop
call SetUnitLifeBJ( hero, ( GetUnitStateSwap(UNIT_STATE_LIFE, hero) - ( 8.00 * I2R(GetUnitUserData(u[1])) ) ) )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u[1] = null
set u[2] = null
set u[3] = null
set u[4] = null
set u[5] = null
set u[6] = null
set u[7] = null
set u[8] = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_TB_Begin takes nothing returns nothing
set gg_trg_TB_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_TB_Begin, Condition( function Trig_TB_Begin_Conditions ) )
call TriggerAddAction( gg_trg_TB_Begin, function Trig_TB_Begin_Actions )
endfunction
function Trig_TB_Return_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08P' ) ) then
return false
endif
return true
endfunction
function Trig_TB_Return_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local location point2 = PolarProjectionBJ(point1, 700.00, AngleBetweenPoints(point1, point))
local integer hppoint = GetUnitUserData(hero)
call TriggerSleepAction( 1.00 )
call CreateNUnitsAtLoc( 1, 'o00D', GetOwningPlayer(hero), point2, AngleBetweenPoints(point2, GetUnitLoc(udg_ToxicBloodHero)) )
call SetUnitUserData( GetLastCreatedUnit(), hppoint )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", udg_ToxicBloodHero )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
call RemoveLocation(point2)
set point2 = null
set hero = null
endfunction
//===========================================================================
function InitTrig_TB_Return takes nothing returns nothing
set gg_trg_TB_Return = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Return, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Return, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Return, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Return, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_TB_Return, Condition( function Trig_TB_Return_Conditions ) )
call TriggerAddAction( gg_trg_TB_Return, function Trig_TB_Return_Actions )
endfunction
function Trig_TB_Regen_HP_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'o00D' ) ) then
return false
endif
return true
endfunction
function TBRegen_Conditions takes nothing returns boolean
if ( not ( GetUnitUserData(GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function TBRegen_Damage takes nothing returns nothing
local unit hero = GetTriggerUnit()
local unit u = GetEventDamageSource()
local integer hppoint = GetUnitUserData(u)
local location point = GetUnitLoc(u)
call SetUnitUserData( u, 0 )
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitLifeBJ( hero, ( GetUnitStateSwap(UNIT_STATE_LIFE, hero) + I2R(hppoint) ) )
call RemoveLocation(point)
set point = null
set hero = null
set u = null
endfunction
function Trig_TB_Regen_HP_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function TBRegen_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TBRegen_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,6,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_TB_Regen_HP takes nothing returns nothing
set gg_trg_TB_Regen_HP = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Regen_HP, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Regen_HP, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Regen_HP, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TB_Regen_HP, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_TB_Regen_HP, Condition( function Trig_TB_Regen_HP_Conditions ) )
call TriggerAddAction( gg_trg_TB_Regen_HP, function Trig_TB_Regen_HP_Actions )
endfunction
function Trig_VL_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetKillingUnitBJ(), 'B016') == true ) ) then
return false
endif
return true
endfunction
function Trig_VL_Action_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Naga\\NagaBlood\\NagaBloodWindserpent.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetKillingUnitBJ()), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A098', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A098', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04S', GetKillingUnitBJ()) )
call UnitApplyTimedLifeBJ( 0.10, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_VL_Action takes nothing returns nothing
set gg_trg_VL_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_VL_Action, Player(10), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_VL_Action, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_VL_Action, Condition( function Trig_VL_Action_Conditions ) )
call TriggerAddAction( gg_trg_VL_Action, function Trig_VL_Action_Actions )
endfunction
function Trig_BH_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetKillingUnitBJ(), 'B017') == true ) ) then
return false
endif
return true
endfunction
function Trig_BH_Action_Actions takes nothing returns nothing
local integer a = 1
local unit hero = GetKillingUnitBJ()
loop
exitwhen a > GetUnitAbilityLevelSwapped('A04Q', GetKillingUnitBJ())
call UnitAddItemByIdSwapped( 'I00A', hero )
set a = a + 1
endloop
set hero = null
endfunction
//===========================================================================
function InitTrig_BH_Action takes nothing returns nothing
set gg_trg_BH_Action = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_BH_Action, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_BH_Action, Condition( function Trig_BH_Action_Conditions ) )
call TriggerAddAction( gg_trg_BH_Action, function Trig_BH_Action_Actions )
endfunction
function Trig_GC_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04N' ) ) then
return false
endif
return true
endfunction
function Trig_GC_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit u = GetSpellTargetUnit()
local location point
local location point1
local integer a
call TriggerSleepAction( 0.1 )
set point = GetUnitLoc(u)
call SetUnitPositionLocFacingBJ( hero, point, GetUnitFacing(hero) )
set point = GetUnitLoc(hero)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call SetUnitAnimationByIndex( hero, 8 )
call TriggerSleepAction( 0.1 )
//-------------
set point = GetUnitLoc(hero)
set a = 1
loop
exitwhen a > 12
set point1 = PolarProjectionBJ(point, 10.00, ( 30.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, point1) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A09B', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A09B', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04N', hero) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "impale", point1 )
set a = a + 1
endloop
set hero = null
set u = null
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
endfunction
//===========================================================================
function InitTrig_GC_Begin takes nothing returns nothing
set gg_trg_GC_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GC_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GC_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GC_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GC_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_GC_Begin, Condition( function Trig_GC_Begin_Conditions ) )
call TriggerAddAction( gg_trg_GC_Begin, function Trig_GC_Begin_Actions )
endfunction
function Trig_CE_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'ucs1' ) ) then
return false
endif
return true
endfunction
function Trig_CE_Begin_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_CE_Begin takes nothing returns nothing
set gg_trg_CE_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CE_Begin, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CE_Begin, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CE_Begin, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CE_Begin, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_CE_Begin, Condition( function Trig_CE_Begin_Conditions ) )
call TriggerAddAction( gg_trg_CE_Begin, function Trig_CE_Begin_Actions )
endfunction
function Trig_DOD_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09H' ) ) then
return false
endif
return true
endfunction
function DOD_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function DOD_Damage takes nothing returns nothing
local unit hero = GetTriggerUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
local unit p
local integer a = 0
if ( GetUnitAbilityLevel(hero, 'A09I') > 0 ) then
call UnitRemoveAbility( hero, 'A09I' )
set hero = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
set p = null
return
endif
set g = GetUnitsInRangeOfLocAll(150.00, point)
loop
set f = FirstOfGroup(g)
exitwhen ( GetUnitTypeId(f) == 'e00H' )
call GroupRemoveUnit(g, f)
endloop
set a = GetUnitUserData(f)
set p = f
call GroupClear( g )
call GroupAddGroup( udg_DoorOfDimensionGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen ( ( GetUnitUserData(f) == a ) and ( f != p ) )
call GroupRemoveUnit(g, f)
endloop
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbility(hero, 'A09I' )
set point = GetUnitLoc(f)
call SetUnitPositionLocFacingBJ( hero, point, GetUnitFacing(hero) )
set point = GetUnitLoc(hero)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set hero = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
set p = null
endfunction
function Trig_DOD_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggeraction taction = TriggerAddAction(t, function DOD_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function DOD_Conditions))
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
local unit f1
local integer a = -1
if ( DistanceBetweenPoints(point1, point) < 300.00 ) then
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set hero = null
call DestroyGroup(g)
set g = null
set f = null
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set t=null
set tx = null
return
endif
call GroupAddGroup( udg_DoorOfDimensionGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetUnitUserData(f) > a ) then
set a = GetUnitUserData(f)
endif
call GroupRemoveUnit(g, f)
endloop
set a = a + 1
call CreateNUnitsAtLoc( 1, 'e00H', GetOwningPlayer(hero), point1, ( 180.00 + AngleBetweenPoints(point1, point) ) )
set f1 = GetLastCreatedUnit()
call SetUnitAnimation( f1, "birth" )
call SetUnitUserData( f1, a )
call GroupAddUnit( udg_DoorOfDimensionGroup, f1 )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', f1 )
call TriggerRegisterUnitInRangeSimple( t, 100.00, f1 )
call CreateNUnitsAtLoc( 1, 'e00H', GetOwningPlayer(hero), point, AngleBetweenPoints(point1, point) )
set f = GetLastCreatedUnit()
call SetUnitAnimation( f, "birth" )
call SetUnitUserData( f, a )
call GroupAddUnit( udg_DoorOfDimensionGroup, f )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', f )
call TriggerRegisterUnitInRangeSimple( t, 100.00, f )
call TimerStart(tx,20,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( IsUnitAliveBJ(f) == false )
call TriggerSleepAction(5.0)
endloop
call GroupRemoveUnit(udg_DoorOfDimensionGroup, f1)
call GroupRemoveUnit(udg_DoorOfDimensionGroup, f)
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set hero = null
call DestroyGroup(g)
set g = null
set f = null
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_DOD_Begin takes nothing returns nothing
set gg_trg_DOD_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DOD_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DOD_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DOD_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_DOD_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_DOD_Begin, Condition( function Trig_DOD_Begin_Conditions ) )
call TriggerAddAction( gg_trg_DOD_Begin, function Trig_DOD_Begin_Actions )
endfunction
function Trig_TCOD_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09L' ) ) then
return false
endif
return true
endfunction
function Trig_TCOD_Begin_Actions takes nothing returns nothing
local integer a = 1
local unit hero = GetSpellAbilityUnit()
local location point
local location point1 = GetSpellTargetLoc()
loop
exitwhen a > 16
set point = PolarProjectionBJ(point1, ( ( I2R(GetUnitAbilityLevelSwapped('A09L', hero)) * 100.00 ) + 200.00 ), ( I2R(a) * 22.50 ))
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Undead\\Graveyard\\GraveMarker.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set a = a + 1
endloop
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A09M', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A09M', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09L', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "locustswarm" )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set hero = null
endfunction
//===========================================================================
function InitTrig_TCOD_Begin takes nothing returns nothing
set gg_trg_TCOD_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_TCOD_Begin, Condition( function Trig_TCOD_Begin_Conditions ) )
call TriggerAddAction( gg_trg_TCOD_Begin, function Trig_TCOD_Begin_Actions )
endfunction
function Trig_TCOD_Damage_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A09M', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_TCOD_Damage_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local unit f
set g = GetUnitsInRangeOfLocAll( (( I2R(GetUnitAbilityLevelSwapped('A09M', u)) * 100.00 ) + 200.00 ), point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) then
call SetUnitLifePercentBJ( f, 1.00 )
call AddSpecialEffectTargetUnitBJ( "overhead", f, "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
endif
call GroupRemoveUnit(g, f)
endloop
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_TCOD_Damage takes nothing returns nothing
set gg_trg_TCOD_Damage = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Damage, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Damage, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Damage, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TCOD_Damage, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_TCOD_Damage, Condition( function Trig_TCOD_Damage_Conditions ) )
call TriggerAddAction( gg_trg_TCOD_Damage, function Trig_TCOD_Damage_Actions )
endfunction
function Trig_EA_Prepare_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A015' ) ) then
return false
endif
return true
endfunction
function Trig_EA_Prepare_Actions takes nothing returns nothing
local unit hero = GetLearningUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
if ( udg_EvasionAuraHero == null ) then
set udg_EvasionAuraHero = hero
call SetPlayerAbilityAvailableBJ( false, 'A03R', Player(0) )
call SetPlayerAbilityAvailableBJ( false, 'A03R', Player(1) )
call SetPlayerAbilityAvailableBJ( false, 'A03R', Player(2) )
call SetPlayerAbilityAvailableBJ( false, 'A03R', Player(3) )
call UnitAddAbilityBJ( 'A03R', hero )
call TriggerRegisterUnitInRangeSimple( gg_trg_EA_Action, 900.00, hero )
endif
set udg_EvasionAuraHero = hero
set g = GetUnitsInRangeOfLocAll(900.00, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == true ) then
call SetUnitAbilityLevelSwapped( 'A03R', f, GetUnitAbilityLevelSwapped('A015', udg_EvasionAuraHero) )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set hero = null
endfunction
//===========================================================================
function InitTrig_EA_Prepare takes nothing returns nothing
set gg_trg_EA_Prepare = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_EA_Prepare, Player(0), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_EA_Prepare, Player(1), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_EA_Prepare, Player(2), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_EA_Prepare, Player(3), EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_EA_Prepare, Condition( function Trig_EA_Prepare_Conditions ) )
call TriggerAddAction( gg_trg_EA_Prepare, function Trig_EA_Prepare_Actions )
endfunction
function Trig_EA_Action_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(udg_EvasionAuraHero)) == true ) ) then
return false
endif
return true
endfunction
function Trig_EA_Action_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitRemoveAbilityBJ( 'A03R', u )
call UnitAddAbilityBJ( 'A03R', u )
call SetUnitAbilityLevelSwapped( 'A03R', u, GetUnitAbilityLevelSwapped('A015', udg_EvasionAuraHero) )
call TriggerSleepAction(2.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_EvasionAuraHero))) == false ) or ( IsUnitAliveBJ(udg_EvasionAuraHero) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(0.1)
endloop
call UnitRemoveAbilityBJ( 'A03R', u )
set u = null
endfunction
//===========================================================================
function InitTrig_EA_Action takes nothing returns nothing
set gg_trg_EA_Action = CreateTrigger( )
call TriggerAddCondition( gg_trg_EA_Action, Condition( function Trig_EA_Action_Conditions ) )
call TriggerAddAction( gg_trg_EA_Action, function Trig_EA_Action_Actions )
endfunction
function Trig_TS_Begin_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("manashieldon") ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'Eevi' ) ) then
return false
endif
return true
endfunction
function Trig_TS_Begin_Actions takes nothing returns nothing
local unit hero = GetOrderedUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_ThunderStormGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(hero) ) then
call RemoveUnit( f )
call GroupRemoveUnitSimple( f, udg_ThunderStormGroup )
endif
call GroupRemoveUnit(g, f)
endloop
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call TriggerExecute( gg_trg_TS_Action )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_ThunderStormGroup )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 1200.00, 9999.00 )
call UnitAddAbilityBJ( 'A01S', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A01S', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01R', hero) )
call RemoveLocation(point)
set point = null
set hero = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_TS_Begin takes nothing returns nothing
set gg_trg_TS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TS_Begin, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TS_Begin, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TS_Begin, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TS_Begin, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_TS_Begin, Condition( function Trig_TS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_TS_Begin, function Trig_TS_Begin_Actions )
endfunction
function Trig_TS_Action_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local unit hero = GetOrderedUnit()
local location point
local group g = CreateGroup()
local unit f
local boolean flag
// call TriggerSleepAction( 2.00 )
loop
set flag = false
set point = GetUnitLoc(hero)
call GroupClear(g)
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = GroupPickRandomUnit(g)
exitwhen (flag == true) or (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
set point = GetUnitLoc(f)
call SetUnitPositionLoc( u, point )
call IssueTargetOrderBJ( u, "chainlightning", f )
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(0, 1000.00), GetRandomDirectionDeg())
call SetUnitPositionLoc( u, point )
call UnitResetCooldown( u )
set flag = true
endif
call GroupRemoveUnit(g, f)
endloop
call SetUnitManaBJ( hero, ( GetUnitStateSwap(UNIT_STATE_MANA, hero) - 10 ) )
call TriggerSleepAction( 1.00 )
exitwhen ( GetUnitStateSwap(UNIT_STATE_MANA, hero) < 10.00 ) or ( IsUnitAliveBJ(hero) == false ) or ( UnitHasBuffBJ(hero, 'B00B') == false )
endloop
call KillUnit( u )
call IssueImmediateOrderBJ( hero, "manashieldoff" )
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set hero = null
set u = null
set f = null
endfunction
//===========================================================================
function InitTrig_TS_Action takes nothing returns nothing
set gg_trg_TS_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_TS_Action, function Trig_TS_Action_Actions )
endfunction
function Trig_SOL_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07O' ) ) then
return false
endif
return true
endfunction
function Trig_SOL_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
call TriggerSleepAction( 0.03 )
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A07N', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( ( ( 600.00 / 150.00 ) + 0.50 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A07O', hero) )
call CreateNUnitsAtLoc( 1, 'e011', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 8.00, 'BTLF', GetLastCreatedUnit() )
call TriggerExecute( gg_trg_SOL_Change_Size )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 50.00 )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 700.00, 150.00 )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_SOL_Begin takes nothing returns nothing
set gg_trg_SOL_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_SOL_Begin, Condition( function Trig_SOL_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SOL_Begin, function Trig_SOL_Begin_Actions )
endfunction
function Trig_SOL_Change_Size_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local integer size=100
loop
exitwhen size > 230
call SetUnitScalePercent( u, size, size, size )
set size = size + 5
call TriggerSleepAction( 0.02 )
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_SOL_Change_Size takes nothing returns nothing
set gg_trg_SOL_Change_Size = CreateTrigger( )
call TriggerAddAction( gg_trg_SOL_Change_Size, function Trig_SOL_Change_Size_Actions )
endfunction
function Trig_SOL_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A07N', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_SOL_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local unit f
set g = GetUnitsInRangeOfLocAll(800, point)
loop
set f = GroupPickRandomUnit(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 700.00, 9999.00 )
call UnitAddAbilityBJ( 'A07P', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", f )
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set u = null
set f = null
endfunction
//===========================================================================
function InitTrig_SOL_Fake_Action takes nothing returns nothing
set gg_trg_SOL_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_SOL_Fake_Action, Condition( function Trig_SOL_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_SOL_Fake_Action, function Trig_SOL_Fake_Action_Actions )
endfunction
function Trig_SOL_Damage_Action_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07P' ) ) then
return false
endif
return true
endfunction
function Trig_SOL_Damage_Action_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
local location point = GetUnitLoc(target)
call TriggerSleepAction( ( DistanceBetweenPoints(GetUnitLoc(caster), GetUnitLoc(target)) / 1500.00 ) )
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(caster), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), target, GetRandomReal(( ( I2R(GetUnitUserData(caster)) ) * 100.00 ), ( I2R(GetUnitUserData(caster)) * 200.00 )), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call RemoveLocation(point)
set point = null
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_SOL_Damage_Action takes nothing returns nothing
set gg_trg_SOL_Damage_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Damage_Action, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Damage_Action, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Damage_Action, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOL_Damage_Action, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_SOL_Damage_Action, Condition( function Trig_SOL_Damage_Action_Conditions ) )
call TriggerAddAction( gg_trg_SOL_Damage_Action, function Trig_SOL_Damage_Action_Actions )
endfunction
function Trig_FOKS_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A04J', GetAttacker()) > 0 ) ) then
return false
endif
return true
endfunction
function FOKS_Damage takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04H', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04H', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04I', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "fanofknives" )
call RemoveLocation(point)
set point = null
set u = null
set hero = null
endfunction
function Trig_FOKS_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function FOKS_Damage)
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= ( 3 + ( GetUnitAbilityLevelSwapped('A04J', attacker) * 2 ) ) ) then
call TimerStart(tx,4,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1.0)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_FOKS_Action takes nothing returns nothing
set gg_trg_FOKS_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FOKS_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_FOKS_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_FOKS_Action, Condition( function Trig_FOKS_Action_Conditions ) )
call TriggerAddAction( gg_trg_FOKS_Action, function Trig_FOKS_Action_Actions )
endfunction
function Trig_Fan_of_knives_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04I' ) ) then
return false
endif
return true
endfunction
function Trig_Fan_of_knives_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04H', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04H', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04I', u) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "fanofknives" )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Fan_of_knives takes nothing returns nothing
set gg_trg_Fan_of_knives = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fan_of_knives, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fan_of_knives, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fan_of_knives, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Fan_of_knives, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Fan_of_knives, Condition( function Trig_Fan_of_knives_Conditions ) )
call TriggerAddAction( gg_trg_Fan_of_knives, function Trig_Fan_of_knives_Actions )
endfunction
function Trig_Melee_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'Ewrd' ) ) then
return false
endif
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("bearform") ) ) then
return false
endif
return true
endfunction
function Trig_Melee_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
local location point = GetUnitLoc(u)
loop
call TriggerSleepAction( 3.00 )
exitwhen ( IsUnitType(u, UNIT_TYPE_RANGED_ATTACKER) == true )
endloop
call TriggerSleepAction( 0.10 )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A04L', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A04L', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A04K', u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "bloodlust", u )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Melee takes nothing returns nothing
set gg_trg_Melee = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Melee, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Melee, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Melee, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Melee, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Melee, Condition( function Trig_Melee_Conditions ) )
call TriggerAddAction( gg_trg_Melee, function Trig_Melee_Actions )
endfunction
function Trig_Range_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetOrderedUnit()) == 'E00J' ) ) then
return false
endif
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("unbearform") ) ) then
return false
endif
return true
endfunction
function Trig_Range_Actions takes nothing returns nothing
local unit u = GetOrderedUnit()
call TriggerSleepAction( 2.00 )
call UnitRemoveBuffBJ( 'B00L', u )
set u = null
endfunction
//===========================================================================
function InitTrig_Range takes nothing returns nothing
set gg_trg_Range = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Range, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Range, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Range, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Range, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Range, Condition( function Trig_Range_Conditions ) )
call TriggerAddAction( gg_trg_Range, function Trig_Range_Actions )
endfunction
function Trig_AM_Take_E_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00O', GetAttacker()) > 0 ) ) then
return false
endif
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_FLYING) == false ) ) then
return false
endif
return true
endfunction
function ArrowM_Conditions takes nothing returns boolean
if ( not ( GetUnitUserData(GetEventDamageSource()) == 1 ) ) then
return false
endif
return true
endfunction
function AM1_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A065', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function AM1_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), target, I2R(GetUnitUserData(attacker)), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A066', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
endfunction
function ArrowM_Damage takes nothing returns nothing
local integer a
local unit hero = GetEventDamageSource()
local unit target = GetTriggerUnit()
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function AM1_Conditions))
local triggeraction taction = TriggerAddAction(t, function AM1_Damage)
local location point = GetUnitLoc(target)
local location point1 = GetUnitLoc(hero)
local location point2
local timer tx = CreateTimer()
local group g = CreateGroup()
local unit f
local unit u
call SetUnitUserData(hero,0)
if (not (GetEventDamage() == 0)) then
set point2 = PolarProjectionBJ(point, 150.00, AngleBetweenPoints(point, point1))
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point2, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u )
call SetUnitUserData( u, R2I(GetEventDamage()) )
call SetUnitScalePercent( u, 50.00, 50.00, 50.00 )
set g = GetUnitsInRangeOfLocAll(1000, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
set point = PolarProjectionBJ(point, 600.00, AngleBetweenPoints(point1, point))
call UnitAddAbilityBJ( 'A065', u )
call IssuePointOrderLocBJ( u, "carrionswarm", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
endif
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
call RemoveLocation(point2)
set point = null
set point1 = null
set point2 = null
set target = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
set u = null
endfunction
function Trig_AM_Take_E_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function ArrowM_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function ArrowM_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= ( 5 + ( GetUnitAbilityLevelSwapped('A00O', GetAttacker()) * 5 ) ) ) then
call SetUnitUserData(attacker,1)
call TimerStart(tx,10,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1.0)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_AM_Take_E takes nothing returns nothing
set gg_trg_AM_Take_E = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Take_E,Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Take_E,Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_AM_Take_E, Condition( function Trig_AM_Take_E_Conditions ) )
call TriggerAddAction( gg_trg_AM_Take_E, function Trig_AM_Take_E_Actions )
endfunction
function Trig_MST_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01Z' ) ) then
return false
endif
return true
endfunction
function Trig_MST_Begin_Actions takes nothing returns nothing
local integer a
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call TriggerSleepAction( 1.20 )
// ------------------------------------------
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
// ------------------------------------------
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A021', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A021', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01Z', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call TriggerSleepAction( 0.10 )
// ------------------------------------------
set a = 1
loop
exitwhen a > 4
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, PolarProjectionBJ(point, 10.00, ( 90.00 * I2R(a) ))) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A05E', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05E', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01Z', hero) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "carrionswarm", PolarProjectionBJ(point, 10.00, ( 90.00 * I2R(a) )) )
set a = a + 1
endloop
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_MST_Begin takes nothing returns nothing
set gg_trg_MST_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MST_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MST_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MST_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MST_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_MST_Begin, Condition( function Trig_MST_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MST_Begin, function Trig_MST_Begin_Actions )
endfunction
function Trig_SOTM_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02O' ) ) then
return false
endif
return true
endfunction
function Trig_SOTM_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location heropoint
local location point
local integer a
set heropoint = GetUnitLoc(hero)
set a = 1
loop
exitwhen a > 6
call RemoveUnit( udg_SpiritOfTheMoonUnit[a] )
set a = a + 1
endloop
call TriggerSleepAction( 0.50 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e00M', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call RemoveLocation(point)
call TriggerExecute( gg_trg_SOTM_Effect )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
call AddLightningLoc( "HWPB", heropoint, PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )) )
call TriggerExecute( gg_trg_SOTM_Lightning_Effect )
set a = a + 1
endloop
call TriggerSleepAction( 0.10 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e00M', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call TriggerExecute( gg_trg_SOTM_Effect )
call RemoveLocation(point)
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
set a = a + 1
endloop
call TriggerSleepAction( 0.10 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e00M', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call RemoveLocation(point)
call TriggerExecute( gg_trg_SOTM_Effect )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
set a = a + 1
endloop
call TriggerSleepAction( 0.10 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e00M', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call RemoveLocation(point)
call TriggerExecute( gg_trg_SOTM_Effect )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
set a = a + 1
endloop
call TriggerSleepAction( 0.10 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, 'e00M', GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call RemoveLocation(point)
call TriggerExecute( gg_trg_SOTM_Effect )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 0.00, 1200.00 )
set a = a + 1
endloop
call TriggerSleepAction( 1.15 )
set a = 1
loop
exitwhen a > 6
set point = PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) ))
call CreateNUnitsAtLoc( 1, udg_SpiritOfTheMoonUnitSpirit[GetUnitAbilityLevelSwapped('A02O', hero)], GetOwningPlayer(hero), point, AngleBetweenPoints(PolarProjectionBJ(heropoint, 300.00, ( 60.00 * I2R(a) )), heropoint) )
call RemoveLocation(point)
set udg_SpiritOfTheMoonUnit[a] = GetLastCreatedUnit()
set a = a + 1
endloop
call RemoveLocation(heropoint)
set heropoint = null
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_SOTM_Begin takes nothing returns nothing
set gg_trg_SOTM_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOTM_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOTM_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOTM_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOTM_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_SOTM_Begin, Condition( function Trig_SOTM_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SOTM_Begin, function Trig_SOTM_Begin_Actions )
endfunction
function Trig_ROMS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02Y' ) ) then
return false
endif
return true
endfunction
function Trig_ROMS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A02Y', hero) )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 30 )
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_ROMS_Begin takes nothing returns nothing
set gg_trg_ROMS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_ROMS_Begin, Condition( function Trig_ROMS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_ROMS_Begin, function Trig_ROMS_Begin_Actions )
endfunction
function Trig_ROMS_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05T', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_ROMS_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05F', u) )
call UnitApplyTimedLifeBJ( 0.50, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
//----------------------------
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 800.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e00Z', GetOwningPlayer(u), point1, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05F', u) )
call UnitApplyTimedLifeBJ( 0.80, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_ROMS_Fake_Action takes nothing returns nothing
set gg_trg_ROMS_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROMS_Fake_Action, Condition( function Trig_ROMS_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_ROMS_Fake_Action, function Trig_ROMS_Fake_Action_Actions )
endfunction
function Trig_ROMS_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e00Z' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05F', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_ROMS_Die_Actions takes nothing returns nothing
local integer a
local unit hero = GetDyingUnit()
local location point = GetUnitLoc(hero)
local location point1
// ------------------------------------------
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
call TriggerExecute( gg_trg_MST_Effect_Off )
// ------------------------------------------
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A030', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A030', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05F', hero) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call TriggerSleepAction( 0.10 )
// ------------------------------------------
set a = 1
loop
exitwhen a > 4
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, PolarProjectionBJ(point, 10.00, ( 90.00 * I2R(a) ))) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A05F', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05F', hero) )
set point1 = PolarProjectionBJ(GetUnitLoc(hero), 1.00, ( 90.00 * I2R(a) ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "carrionswarm", point1 )
call RemoveLocation(point1)
set a = a + 1
endloop
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_ROMS_Die takes nothing returns nothing
set gg_trg_ROMS_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ROMS_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ROMS_Die, Condition( function Trig_ROMS_Die_Conditions ) )
call TriggerAddAction( gg_trg_ROMS_Die, function Trig_ROMS_Die_Actions )
endfunction
function Trig_AM_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A019' ) ) then
return false
endif
return true
endfunction
function Trig_AM_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_AbsorbManaGroup )
call UnitAddAbilityBJ( 'A05S', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05S', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A019', hero) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(),( (GetUnitAbilityLevelSwapped('A019', hero) * 5) + 5 ) )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_AM_Begin takes nothing returns nothing
set gg_trg_AM_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_AM_Begin, Condition( function Trig_AM_Begin_Conditions ) )
call TriggerAddAction( gg_trg_AM_Begin, function Trig_AM_Begin_Actions )
endfunction
function Trig_AM_Gen_E_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05S', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_AM_Gen_E_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
local group g = CreateGroup()
local group damagegroup = CreateGroup()
local unit f
local group g1 = CreateGroup()
local group damagegroup1 = CreateGroup()
local unit f1
call GroupRemoveUnitSimple( u, udg_AbsorbManaGroup )
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_AbsorbManaGroup )
call UnitAddAbilityBJ( 'A05S', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A05S', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A05S', u) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(),( GetUnitUserData(u) - 1 ) )
//-------------------------------------------------------------
set g = GetUnitsInRangeOfLocAll(800, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetUnitStateSwap(UNIT_STATE_MANA, f) < GetUnitStateSwap(UNIT_STATE_MAX_MANA, f) ) and ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == true ) and ( IsUnitInGroup(f, damagegroup) == false ) then
call GroupAddUnit(damagegroup, f)
call GroupClear(g1)
call GroupClear(damagegroup1)
set g1 = GetUnitsInRangeOfLocAll(800, point)
loop
set f1 = FirstOfGroup(g1)
exitwhen (f1 == null)
if ( GetUnitStateSwap(UNIT_STATE_MANA, f1) >= 1.00 ) and ( IsUnitType(f1, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f1) == true ) and ( IsUnitAlly(f1, GetOwningPlayer(u)) == false ) and ( IsUnitInGroup(f1, damagegroup1) == false ) then
call GroupAddUnit(damagegroup1, f1)
set point1 = GetUnitLoc(f1)
call SetUnitManaBJ( f1, ( GetUnitStateSwap(UNIT_STATE_MANA, f1) - ( (GetUnitAbilityLevelSwapped('A05S', u)) * 3 ) ) )
call CreateNUnitsAtLoc( 1, 'e00F', GetOwningPlayer(u), point1, AngleBetweenPoints(point1, GetUnitLoc(f)) )
call SetUnitUserData( GetLastCreatedUnit(),( (GetUnitAbilityLevelSwapped('A05S', u)) * 3 ) )
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", f )
endif
call GroupRemoveUnit(g1, f1)
endloop
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
call RemoveLocation(point1)
call DestroyGroup(damagegroup)
call DestroyGroup(g)
set damagegroup = null
set g = null
set f = null
call DestroyGroup(damagegroup1)
call DestroyGroup(g1)
set damagegroup1 = null
set g1 = null
set f1 = null
call KillUnit(u)
set point = null
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_AM_Gen_E takes nothing returns nothing
set gg_trg_AM_Gen_E = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Gen_E, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Gen_E, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Gen_E, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Gen_E, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_AM_Gen_E, Condition( function Trig_AM_Gen_E_Conditions ) )
call TriggerAddAction( gg_trg_AM_Gen_E, function Trig_AM_Gen_E_Actions )
endfunction
function Trig_AM_Regen_Mana_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'e00F' ) ) then
return false
endif
return true
endfunction
function AM_Conditions takes nothing returns boolean
if ( not ( GetUnitUserData(GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function AM_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer manapoint = GetUnitUserData(hero)
local location point = GetUnitLoc(u)
call SetUnitUserData( hero, 0 )
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MANA, u) + manapoint ) )
call RemoveLocation(point)
set point = null
set hero = null
set u = null
endfunction
function Trig_AM_Regen_Mana_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function AM_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function AM_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,5,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_AM_Regen_Mana takes nothing returns nothing
set gg_trg_AM_Regen_Mana = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Regen_Mana, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Regen_Mana, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Regen_Mana, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Regen_Mana, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_AM_Regen_Mana, Condition( function Trig_AM_Regen_Mana_Conditions ) )
call TriggerAddAction( gg_trg_AM_Regen_Mana, function Trig_AM_Regen_Mana_Actions )
endfunction
function Trig_AM_Fix_Bug_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A019' ) ) then
return false
endif
return true
endfunction
function Trig_AM_Fix_Bug_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_AbsorbManaGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetOwningPlayer(hero) ) then
call RemoveUnit( f )
call GroupRemoveUnitSimple( f, udg_AbsorbManaGroup )
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
set f = null
set hero = null
endfunction
//===========================================================================
function InitTrig_AM_Fix_Bug takes nothing returns nothing
set gg_trg_AM_Fix_Bug = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Fix_Bug, Player(0), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Fix_Bug, Player(1), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Fix_Bug, Player(2), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_AM_Fix_Bug, Player(3), EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_AM_Fix_Bug, Condition( function Trig_AM_Fix_Bug_Conditions ) )
call TriggerAddAction( gg_trg_AM_Fix_Bug, function Trig_AM_Fix_Bug_Actions )
endfunction
function Trig_CFB_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01G' ) ) then
return false
endif
return true
endfunction
function Trig_CFB_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local integer bodem = 0
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(target)) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A011', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A011', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01G', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
set point = GetUnitLoc(target)
set g = GetUnitsInRangeOfLocAll(800, point)
call GroupRemoveUnit(g, target)
call TriggerSleepAction( ( ( DistanceBetweenPoints(GetUnitLoc(hero), GetUnitLoc(target)) / 700.00 ) - 0.00 ) )
loop
set f = GroupPickRandomUnit(g)
exitwhen (f == null) or ( bodem >= 4 )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A011', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A011', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A01G', hero) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set target = null
set hero = null
set f = null
endfunction
//===========================================================================
function InitTrig_CFB_Begin takes nothing returns nothing
set gg_trg_CFB_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CFB_Begin, Condition( function Trig_CFB_Begin_Conditions ) )
call TriggerAddAction( gg_trg_CFB_Begin, function Trig_CFB_Begin_Actions )
endfunction
function Trig_CFB_Add_Frost_Effect_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A011' ) ) then
return false
endif
return true
endfunction
function Trig_CFB_Add_Frost_Effect_Actions takes nothing returns nothing
local unit casteru = GetSpellAbilityUnit()
local unit targetu = GetSpellTargetUnit()
local location point = GetUnitLoc(targetu)
call TriggerSleepAction( ( ( DistanceBetweenPoints(GetUnitLoc(casteru), point) / 700.00 ) - 0.00 ) )
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(casteru), point, bj_UNIT_FACING )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A01H', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
set point = null
set casteru = null
set targetu = null
endfunction
//===========================================================================
function InitTrig_CFB_Add_Frost_Effect takes nothing returns nothing
set gg_trg_CFB_Add_Frost_Effect = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Add_Frost_Effect, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Add_Frost_Effect, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Add_Frost_Effect, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_CFB_Add_Frost_Effect, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_CFB_Add_Frost_Effect, Condition( function Trig_CFB_Add_Frost_Effect_Conditions ) )
call TriggerAddAction( gg_trg_CFB_Add_Frost_Effect, function Trig_CFB_Add_Frost_Effect_Actions )
endfunction
function Trig_NS_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A02M', GetAttacker()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_NS_Begin_Actions takes nothing returns nothing
local unit hero = GetAttacker()
local unit target = GetAttackedUnitBJ()
local integer chance = GetRandomInt(1, 100)
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
if ( chance <= ( ( GetUnitAbilityLevelSwapped('A02M', hero) * 5 ) + 5 ) ) then
set g = GetUnitsInRangeOfLocAll(1000, point)
call GroupRemoveUnit(g, target)
call GroupRemoveUnit(g, hero)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e00L', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call SetUnitUserData( GetLastCreatedUnit(), ( GetHeroStatBJ(bj_HEROSTAT_INT, hero, true) * 3 ) )
call UnitApplyTimedLifeBJ( 5.00, 'BTLF', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attackonce", f )
endif
call GroupRemoveUnit(g, f)
endloop
endif
call RemoveLocation(point)
call DestroyGroup(g)
set g = null
set f = null
set point = null
set hero = null
set target = null
endfunction
//===========================================================================
function InitTrig_NS_Begin takes nothing returns nothing
set gg_trg_NS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_NS_Begin, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_NS_Begin, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_NS_Begin, Condition( function Trig_NS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_NS_Begin, function Trig_NS_Begin_Actions )
endfunction
function Trig_NS_Gen_E_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'e00L' ) ) then
return false
endif
return true
endfunction
function NS_Conditions takes nothing returns boolean
if ( not ( GetUnitUserData(GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function NS_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
local unit u = GetTriggerUnit()
local integer damagepoint = GetUnitUserData(hero)
local location point = GetUnitLoc(u)
call SetUnitUserData( hero, 0 )
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), u, I2R(damagepoint), ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL )
//call RemoveUnit( hero )
set point = null
set hero = null
set u = null
endfunction
function Trig_NS_Gen_E_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function NS_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function NS_Conditions))
local timer tx = CreateTimer()
call TimerStart(tx,5,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_NS_Gen_E takes nothing returns nothing
set gg_trg_NS_Gen_E = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_NS_Gen_E,Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_NS_Gen_E,Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_NS_Gen_E, Condition( function Trig_NS_Gen_E_Conditions ) )
call TriggerAddAction( gg_trg_NS_Gen_E, function Trig_NS_Gen_E_Actions )
endfunction
function Trig_MFF_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02R' ) ) then
return false
endif
return true
endfunction
function Trig_MFF_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A032', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A032', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A02R', hero) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 50 )
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_MFF_Begin takes nothing returns nothing
set gg_trg_MFF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MFF_Begin, Condition( function Trig_MFF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MFF_Begin, function Trig_MFF_Begin_Actions )
endfunction
function Trig_MFF_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A032', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_MFF_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 600.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e015', GetOwningPlayer(u), point, bj_UNIT_FACING )
call RemoveLocation(point)
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A032', u) )
call UnitApplyTimedLifeBJ( 0.80, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 930.00, 1100.00 )
set point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A032', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A032', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A032', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
//call RemoveUnit(u)
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_MFF_Fake_Action takes nothing returns nothing
set gg_trg_MFF_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MFF_Fake_Action, Condition( function Trig_MFF_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_MFF_Fake_Action, function Trig_MFF_Fake_Action_Actions )
endfunction
function Trig_MFF_Auto_Cast_Level_up_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A02R', GetLevelingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_MFF_Auto_Cast_Level_up_Actions takes nothing returns nothing
local unit hero = GetLevelingUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A032', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A032', GetLastCreatedUnit(), 10 )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 50 )
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_MFF_Auto_Cast_Level_up takes nothing returns nothing
set gg_trg_MFF_Auto_Cast_Level_up = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Level_up, Player(0), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Level_up, Player(1), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Level_up, Player(2), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Level_up, Player(3), EVENT_PLAYER_HERO_LEVEL )
call TriggerAddCondition( gg_trg_MFF_Auto_Cast_Level_up, Condition( function Trig_MFF_Auto_Cast_Level_up_Conditions ) )
call TriggerAddAction( gg_trg_MFF_Auto_Cast_Level_up, function Trig_MFF_Auto_Cast_Level_up_Actions )
endfunction
function Trig_MFF_Auto_Cast_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A02R', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_MFF_Auto_Cast_Die_Actions takes nothing returns nothing
local unit hero = GetDyingUnit()
local location point = GetUnitLoc(hero)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A032', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A032', GetLastCreatedUnit(), 10 )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 50 )
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_MFF_Auto_Cast_Die takes nothing returns nothing
set gg_trg_MFF_Auto_Cast_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MFF_Auto_Cast_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MFF_Auto_Cast_Die, Condition( function Trig_MFF_Auto_Cast_Die_Conditions ) )
call TriggerAddAction( gg_trg_MFF_Auto_Cast_Die, function Trig_MFF_Auto_Cast_Die_Actions )
endfunction
function Trig_MLS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07W' ) ) then
return false
endif
return true
endfunction
function MLS_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A07X', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function MLS_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point1 = GetUnitLoc(target)
local location point2 = PolarProjectionBJ(point1, 900.00, AngleBetweenPoints(GetUnitLoc(attacker), point1))
local group g1 = CreateGroup()
local group g2 = CreateGroup()
local unit f
local unit u
local integer bodem = 0
set g1 = GetUnitsInRangeOfLocAll(900, point1)
set g2 = GetUnitsInRangeOfLocAll(900, point2)
loop
set f = GroupPickRandomUnit(g1)
exitwhen (f == null) or ( bodem >= 1 )
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(attacker)) == false ) and ( IsUnitInGroup(f, g2) == true ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point1, AngleBetweenPoints(GetUnitLoc(attacker), point1) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', u )
call UnitAddAbilityBJ( 'A07Y', u )
call SetUnitAbilityLevelSwapped( 'A07Y', u, GetUnitAbilityLevelSwapped('A07X', attacker) )
call IssueTargetOrderBJ( u, "chainlightning", f )
set bodem = bodem + 1
endif
call GroupRemoveUnit(g1, f)
endloop
call RemoveLocation(point1)
set point1 = null
call RemoveLocation(point2)
set point2 = null
call DestroyGroup(g1)
set g1 = null
call DestroyGroup(g2)
set g2 = null
set f = null
set target = null
set attacker = null
set u = null
endfunction
function Trig_MLS_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function MLS_Conditions))
local triggeraction taction = TriggerAddAction(t, function MLS_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit target = GetSpellTargetUnit()
local unit u
local location point = GetUnitLoc(target)
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point1, AngleBetweenPoints(point1, point) )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 6.00, 'BTLF', u )
set g = GetUnitsInRangeOfLocAll(2000, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbilityBJ( 'A07X', u )
call SetUnitAbilityLevelSwapped( 'A07X', u, GetUnitAbilityLevelSwapped('A07W', hero) )
call IssueTargetOrderBJ( u, "forkedlightning", target )
call TimerStart(tx,6,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_MLS_Begin takes nothing returns nothing
set gg_trg_MLS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MLS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MLS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MLS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MLS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MLS_Begin, Condition( function Trig_MLS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MLS_Begin, function Trig_MLS_Begin_Actions )
endfunction
function Trig_WS_Learn_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A05D' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05D', GetLearningUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_WS_Learn_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_WS_Action, GetLearningUnit(), EVENT_UNIT_DAMAGED )
endfunction
//===========================================================================
function InitTrig_WS_Learn takes nothing returns nothing
set gg_trg_WS_Learn = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Learn, Player(0), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Learn, Player(1), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Learn, Player(2), EVENT_PLAYER_HERO_SKILL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Learn, Player(3), EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_WS_Learn, Condition( function Trig_WS_Learn_Conditions ) )
call TriggerAddAction( gg_trg_WS_Learn, function Trig_WS_Learn_Actions )
endfunction
function Trig_WS_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B015') == true ) ) then
return false
endif
return true
endfunction
function Trig_WS_Action_Actions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(attacker)
local real damage = ( GetEventDamage() * ( ( I2R(GetUnitAbilityLevelSwapped('A05D', hero)) * 50.00 ) / 100.00 ) )
call AddSpecialEffectLocBJ( point, "Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
if ( ( GetUnitStateSwap(UNIT_STATE_LIFE, attacker) - damage ) > 1.00 ) then
call SetUnitLifeBJ( attacker, ( GetUnitStateSwap(UNIT_STATE_LIFE, attacker) - damage ) )
else
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 0.5, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), attacker, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
endif
call RemoveLocation(point)
set point = null
set hero = null
set attacker = null
endfunction
//===========================================================================
function InitTrig_WS_Action takes nothing returns nothing
set gg_trg_WS_Action = CreateTrigger( )
call TriggerAddCondition( gg_trg_WS_Action, Condition( function Trig_WS_Action_Conditions ) )
call TriggerAddAction( gg_trg_WS_Action, function Trig_WS_Action_Actions )
endfunction
function Trig_WS_Order_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("manashieldon") ) ) then
return false
endif
return true
endfunction
function Trig_WS_Order_Actions takes nothing returns nothing
local unit hero = GetOrderedUnit()
loop
call SetUnitManaBJ( hero, ( GetUnitStateSwap(UNIT_STATE_MANA, hero) - 10.00 ) )
call TriggerSleepAction( 1.00 )
exitwhen ( GetUnitStateSwap(UNIT_STATE_MANA, hero) < 10.00 ) or ( IsUnitAliveBJ(hero) == false ) or ( UnitHasBuffBJ(hero, 'B015') == false )
endloop
call IssueImmediateOrderBJ( hero, "manashieldoff" )
set hero = null
endfunction
//===========================================================================
function InitTrig_WS_Order takes nothing returns nothing
set gg_trg_WS_Order = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Order, Player(0), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Order, Player(1), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Order, Player(2), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_WS_Order, Player(3), EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_WS_Order, Condition( function Trig_WS_Order_Conditions ) )
call TriggerAddAction( gg_trg_WS_Order, function Trig_WS_Order_Actions )
endfunction
function Trig_SS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02S' ) ) then
return false
endif
return true
endfunction
function Trig_SS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local group g = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A02T', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A02T', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A02S', hero) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 10 )
set g = GetUnitsInRangeOfLocAll(200, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A02T', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "sleep", f )
endif
call GroupRemoveUnit(g, f)
endloop
set hero = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_SS_Begin takes nothing returns nothing
set gg_trg_SS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_SS_Begin, Condition( function Trig_SS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SS_Begin, function Trig_SS_Begin_Actions )
endfunction
function Trig_SS_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A02T', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_SS_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local group damagegroup = CreateGroup()
local unit f
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A02T', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A02T', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A02T', u) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set g = GetUnitsInRangeOfLocAll(200, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( UnitHasBuffBJ(f, 'BUsl') == true ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == false ) and ( IsUnitInGroup(f, damagegroup) == false ) then
call SetUnitLifeBJ( f, ( GetUnitStateSwap(UNIT_STATE_LIFE, f) - ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, f) * ( I2R(GetUnitAbilityLevelSwapped('A02T', u)) / 100.00 ) ) ) )
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
set point = null
set u = null
call DestroyGroup(damagegroup)
call DestroyGroup(g)
set damagegroup = null
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_SS_Fake_Action takes nothing returns nothing
set gg_trg_SS_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SS_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_SS_Fake_Action, Condition( function Trig_SS_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_SS_Fake_Action, function Trig_SS_Fake_Action_Actions )
endfunction
function Trig_IM_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A084' ) ) then
return false
endif
return true
endfunction
function Trig_IM_Begin_Actions takes nothing returns nothing
local location point = GetSpellTargetLoc()
local effect e
call TerrainDeformationCraterBJ( 0.00, true, point, 40.00, 200.00 )
call TerrainDeformationCraterBJ( 2.00, true, point, 300.00, -300.00 )
call SetTerrainTypeBJ( point, 'Iice', -1, 5, 0 )
// --------------------
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
set e = GetLastCreatedEffectBJ()
call TriggerSleepAction( 12.00 )
call DestroyEffectBJ( e )
call TerrainDeformationCraterBJ( 2.00, true, point, 300.00, 300.00 )
call TerrainDeformationCraterBJ( 2.00, true, point, 40.00, -200.00 )
call TriggerSleepAction( 2 )
call SetTerrainTypeBJ( point, 'Ldrt', -1, 5, 0 )
call DestroyEffectBJ(e)
set e = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_IM_Begin takes nothing returns nothing
set gg_trg_IM_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_IM_Begin, Condition( function Trig_IM_Begin_Conditions ) )
call TriggerAddAction( gg_trg_IM_Begin, function Trig_IM_Begin_Actions )
endfunction
function Trig_IM_Action_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A084' ) ) then
return false
endif
return true
endfunction
function Trig_IM_Action_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A085', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A085', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A084', hero) )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 2.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 33 )
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_IM_Action takes nothing returns nothing
set gg_trg_IM_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Action, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Action, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Action, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Action, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_IM_Action, Condition( function Trig_IM_Action_Conditions ) )
call TriggerAddAction( gg_trg_IM_Action, function Trig_IM_Action_Actions )
endfunction
function Trig_IM_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A085', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_IM_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A085', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A085', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A085', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
//----------------------------
set point1 = PolarProjectionBJ(point, GetRandomReal(0, 500.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'o00B', GetOwningPlayer(u), point, AngleBetweenPoints(point, point1) )
call UnitAddAbilityBJ( udg_IceMountainAbility[GetUnitAbilityLevelSwapped('A085', u)], GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", point1 )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
endfunction
//===========================================================================
function InitTrig_IM_Fake_Action takes nothing returns nothing
set gg_trg_IM_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_IM_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_IM_Fake_Action, Condition( function Trig_IM_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_IM_Fake_Action, function Trig_IM_Fake_Action_Actions )
endfunction
function Trig_STL_Lizard_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) != 'n016' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A09F', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitLevel(GetDyingUnit()) != 10 ) ) then
return false
endif
return true
endfunction
function Trig_STL_Lizard_Death_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'n016', GetOwningPlayer(u), point, bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(u) )
call SetUnitAbilityLevelSwapped( 'A09F', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09F', u) )
call UnitApplyTimedLife(GetLastCreatedUnit(), 'BHwe', 5.00)
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_STL_Lizard_Death takes nothing returns nothing
set gg_trg_STL_Lizard_Death = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Lizard_Death, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Lizard_Death, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Lizard_Death, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Lizard_Death, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_STL_Lizard_Death, Condition( function Trig_STL_Lizard_Death_Conditions ) )
call TriggerAddAction( gg_trg_STL_Lizard_Death, function Trig_STL_Lizard_Death_Actions )
endfunction
function Trig_STL_Egg_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'n016' ) ) then
return false
endif
return true
endfunction
function Trig_STL_Egg_Death_Actions takes nothing returns nothing
local integer chance = GetRandomInt(1, 100)
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
if ( chance < ( ( GetUnitUserData(u) * 5 ) + 20 ) ) then
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call CreateNUnitsAtLoc( 1, udg_ThunderLizardUnit[( GetUnitAbilityLevelSwapped('A09F', u) + 1 )], GetOwningPlayer(u), point, bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A09F', GetLastCreatedUnit(), ( GetUnitAbilityLevelSwapped('A09F', u) + 1 ) )
call UnitApplyTimedLife( GetLastCreatedUnit(), 'BHwe', 60.00 )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(u) )
endif
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_STL_Egg_Death takes nothing returns nothing
set gg_trg_STL_Egg_Death = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Egg_Death, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Egg_Death, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Egg_Death, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_STL_Egg_Death, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_STL_Egg_Death, Condition( function Trig_STL_Egg_Death_Conditions ) )
call TriggerAddAction( gg_trg_STL_Egg_Death, function Trig_STL_Egg_Death_Actions )
endfunction
function Trig_TH_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetSummonedUnit()) == 28 ) ) then
return false
endif
return true
endfunction
function Trig_TH_Begin_Actions takes nothing returns nothing
local unit u = GetSummonedUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local unit f
local integer a = -1
call GroupAddGroup( udg_TwinHawksGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetUnitUserData(f) > a ) then
set a = GetUnitUserData(f)
endif
call GroupRemoveUnit(g, f)
endloop
set a = a + 1
call CreateNUnitsAtLoc( 1, GetUnitTypeId(u), GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 70.00, 'B019', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), a )
call SetUnitUserData( u, a )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_TwinHawksGroup )
call GroupAddUnitSimple( u, udg_TwinHawksGroup )
set u = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_TH_Begin takes nothing returns nothing
set gg_trg_TH_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Begin, Player(0), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Begin, Player(1), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Begin, Player(2), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Begin, Player(3), EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_TH_Begin, Condition( function Trig_TH_Begin_Conditions ) )
call TriggerAddAction( gg_trg_TH_Begin, function Trig_TH_Begin_Actions )
endfunction
function Trig_TH_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetDyingUnit()) == 28 ) ) then
return false
endif
return true
endfunction
function Trig_TH_Death_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_TwinHawksGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetUnitUserData(f) == GetUnitUserData(u) ) then
call GroupRemoveUnitSimple( f, udg_TwinHawksGroup )
call KillUnit( f )
endif
call GroupRemoveUnit(g, f)
endloop
set u = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_TH_Death takes nothing returns nothing
set gg_trg_TH_Death = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Death, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Death, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Death, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_TH_Death, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_TH_Death, Condition( function Trig_TH_Death_Conditions ) )
call TriggerAddAction( gg_trg_TH_Death, function Trig_TH_Death_Actions )
endfunction
function Trig_S_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09P' ) ) then
return false
endif
return true
endfunction
function Trig_S_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
local location point1 = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, AngleBetweenPoints(point, point1) )
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A09G', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A09G', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A09P', hero) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "stampede", point1 )
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set hero = null
endfunction
//===========================================================================
function InitTrig_S_Begin takes nothing returns nothing
set gg_trg_S_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_S_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_S_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_S_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_S_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_S_Begin, Condition( function Trig_S_Begin_Conditions ) )
call TriggerAddAction( gg_trg_S_Begin, function Trig_S_Begin_Actions )
endfunction
function Trig_SOH_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A023' ) ) then
return false
endif
return true
endfunction
function Trig_SOH_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetUnitLoc(hero)
call TriggerSleepAction( 0.03 )
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A05Q', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( ( ( 600.00 / 150.00 ) + 0.50 ), 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A023', hero) )
call CreateNUnitsAtLoc( 1, 'e00K', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 8.00, 'BTLF', GetLastCreatedUnit() )
call TriggerExecute( gg_trg_SOH_Change_Size )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 50.00 )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 700.00, 150.00 )
call RemoveLocation(point)
set hero = null
set point = null
endfunction
//===========================================================================
function InitTrig_SOH_Begin takes nothing returns nothing
set gg_trg_SOH_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_SOH_Begin, Condition( function Trig_SOH_Begin_Conditions ) )
call TriggerAddAction( gg_trg_SOH_Begin, function Trig_SOH_Begin_Actions )
endfunction
function Trig_SOH_Change_Size_Actions takes nothing returns nothing
local unit u = GetLastCreatedUnit()
local integer size=100
loop
exitwhen size > 230
call SetUnitScalePercent( u, size, size, size )
set size = size + 5
call TriggerSleepAction( 0.02 )
endloop
set u = null
endfunction
//===========================================================================
function InitTrig_SOH_Change_Size takes nothing returns nothing
set gg_trg_SOH_Change_Size = CreateTrigger( )
call TriggerAddAction( gg_trg_SOH_Change_Size, function Trig_SOH_Change_Size_Actions )
endfunction
function Trig_SOH_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A05Q', GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_SOH_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local group g = CreateGroup()
local unit f
set g = GetUnitsInRangeOfLocAll(800, point)
loop
set f = GroupPickRandomUnit(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(u)) == true ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), 700.00, 9999.00 )
call UnitAddAbilityBJ( 'A024', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), GetUnitUserData(u) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "healingwave", f )
endif
call GroupRemoveUnit(g, f)
endloop
//call RemoveUnit( u )
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set u = null
set f = null
endfunction
//===========================================================================
function InitTrig_SOH_Fake_Action takes nothing returns nothing
set gg_trg_SOH_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_SOH_Fake_Action, Condition( function Trig_SOH_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_SOH_Fake_Action, function Trig_SOH_Fake_Action_Actions )
endfunction
function Trig_SOH_Healing_Action_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A024' ) ) then
return false
endif
return true
endfunction
function Trig_SOH_Healing_Action_Actions takes nothing returns nothing
local unit target = GetSpellTargetUnit()
local unit caster = GetSpellAbilityUnit()
call SetUnitLifeBJ( target, ( GetUnitStateSwap(UNIT_STATE_LIFE, target) + ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, target) * ( ( ( I2R(GetUnitUserData(caster)) * 5.00 ) + 15.00 ) / 100.00 ) ) ) )
set caster = null
set target = null
endfunction
//===========================================================================
function InitTrig_SOH_Healing_Action takes nothing returns nothing
set gg_trg_SOH_Healing_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Healing_Action, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Healing_Action, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Healing_Action, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_SOH_Healing_Action, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_SOH_Healing_Action, Condition( function Trig_SOH_Healing_Action_Conditions ) )
call TriggerAddAction( gg_trg_SOH_Healing_Action, function Trig_SOH_Healing_Action_Actions )
endfunction
function Trig_MS_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00T' ) ) then
return false
endif
return true
endfunction
function Trig_MS_Begin_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00X', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00T', hero) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 20 )
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_MS_Begin takes nothing returns nothing
set gg_trg_MS_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_MS_Begin, Condition( function Trig_MS_Begin_Conditions ) )
call TriggerAddAction( gg_trg_MS_Begin, function Trig_MS_Begin_Actions )
endfunction
function Trig_MS_Fake_Action_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A00X', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_MS_Fake_Action_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00X', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00X', u) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
set point = PolarProjectionBJ(GetUnitLoc(u), GetRandomReal(0, 350.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e008', GetOwningPlayer(u), point, bj_UNIT_FACING )
call SetUnitFlyHeightBJ( GetLastCreatedUnit(), -50.00, 1200.00 )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00X', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00X', u) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_MS_Fake_Action takes nothing returns nothing
set gg_trg_MS_Fake_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Fake_Action, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Fake_Action, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Fake_Action, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Fake_Action, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MS_Fake_Action, Condition( function Trig_MS_Fake_Action_Conditions ) )
call TriggerAddAction( gg_trg_MS_Fake_Action, function Trig_MS_Fake_Action_Actions )
endfunction
function Trig_MS_Die_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e008' ) ) then
return false
endif
return true
endfunction
function Trig_MS_Die_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(GetDyingUnit())
call CreateNUnitsAtLoc( 1, 'e009', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A00X', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A00X', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A00X', u) )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "thunderclap" )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_MS_Die takes nothing returns nothing
set gg_trg_MS_Die = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Die, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Die, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Die, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_MS_Die, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MS_Die, Condition( function Trig_MS_Die_Conditions ) )
call TriggerAddAction( gg_trg_MS_Die, function Trig_MS_Die_Actions )
endfunction
function Trig_Time_Stop_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummonedUnit()) == 'e006' ) ) then
return false
endif
return true
endfunction
function TSI_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I020') == false ) ) then
return false
endif
return true
endfunction
function TSI_Damage takes nothing returns nothing
call PauseUnit(GetTriggerUnit(), true)
endfunction
function Trig_Time_Stop_Begin_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit u = GetSummonedUnit()
local triggeraction taction = TriggerAddAction(t, function TSI_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TSI_Conditions))
local timer tx = CreateTimer()
local group g = CreateGroup()
local unit f
local location point = GetUnitLoc(GetSummonedUnit())
call TriggerSleepAction( 0.50 )
call SetUnitTimeScalePercent( u, 0.00 )
call TimerStart(tx,20,false,null)
call TriggerRegisterUnitInRangeSimple( t, 600.00, u )
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(5)
endloop
set g = GetUnitsInRangeOfLocAll(700, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitPaused(f) == true ) then
call PauseUnit(f, false)
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
call DestroyGroup(g)
set g = null
set f = null
set taction = null
set tcondition = null
set t=null
set tx = null
set u = null
endfunction
//===========================================================================
function InitTrig_Time_Stop_Begin takes nothing returns nothing
set gg_trg_Time_Stop_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop_Begin, Player(0), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop_Begin, Player(1), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop_Begin, Player(2), EVENT_PLAYER_UNIT_SUMMON )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Time_Stop_Begin, Player(3), EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Time_Stop_Begin, Condition( function Trig_Time_Stop_Begin_Conditions ) )
call TriggerAddAction( gg_trg_Time_Stop_Begin, function Trig_Time_Stop_Begin_Actions )
endfunction
function Trig_Sheep_Staff_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AIse' ) ) then
return false
endif
return true
endfunction
function Trig_Sheep_Staff_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
local group g = CreateGroup()
local unit f
local unit p
set g = GetUnitsInRangeOfLocAll(300, point)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
set p = CreateUnitAtLoc( GetOwningPlayer(hero), 'e004', point, AngleBetweenPoints(point, GetUnitLoc(f)) )
call UnitApplyTimedLife( p, 'BTLF', 2 )
call UnitAddAbility(p, 'Aply')
call IssueTargetOrder( p, "polymorph", f )
endif
call GroupRemoveUnit(g, f)
endloop
set hero = null
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
set p = null
endfunction
//===========================================================================
function InitTrig_Sheep_Staff takes nothing returns nothing
set gg_trg_Sheep_Staff = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Sheep_Staff, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Sheep_Staff, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Sheep_Staff, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Sheep_Staff, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Sheep_Staff, Condition( function Trig_Sheep_Staff_Conditions ) )
call TriggerAddAction( gg_trg_Sheep_Staff, function Trig_Sheep_Staff_Actions )
endfunction
function Trig_Ice_Mine_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nglm' ) ) then
return false
endif
return true
endfunction
function Trig_Ice_Mine_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
local unit p
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\NightElf\\NEDeathMedium\\NEDeath.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set p = CreateUnitAtLoc( GetOwningPlayer(GetDyingUnit()), 'e000', point, bj_UNIT_FACING )
call UnitApplyTimedLife( p, 'BTLF', 1 )
call UnitAddAbility(p, 'A01U')
call SetUnitAbilityLevel(p, 'A01U', 5 )
call IssueTargetOrder( p, "frostnova", p )
call RemoveLocation(point)
set point = null
set p = null
endfunction
//===========================================================================
function InitTrig_Ice_Mine takes nothing returns nothing
set gg_trg_Ice_Mine = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ice_Mine, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ice_Mine, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ice_Mine, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ice_Mine, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Ice_Mine, Condition( function Trig_Ice_Mine_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Mine, function Trig_Ice_Mine_Actions )
endfunction
function Trig_Phoenix_Wing_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AIbk' ) ) then
return false
endif
return true
endfunction
function PWI_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A047', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function PWI_Damage takes nothing returns nothing
local unit target = GetTriggerUnit()
local unit attacker = GetEventDamageSource()
local location point = GetUnitLoc(target)
local integer damage = GetUnitUserData(attacker)
local unit p
set p = CreateUnitAtLoc( GetOwningPlayer(attacker), 'e001', point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', p )
call UnitDamageTargetBJ( p, target, I2R(damage), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call RemoveLocation(point)
set point = null
set target = null
set attacker = null
set p = null
endfunction
function Trig_Phoenix_Wing_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function PWI_Conditions))
local triggeraction taction = TriggerAddAction(t, function PWI_Damage)
local timer tx = CreateTimer()
local unit hero = GetSpellAbilityUnit()
local unit u
local location point = GetSpellTargetLoc()
local location point1 = GetUnitLoc(hero)
local group g = CreateGroup()
local unit f
set u = CreateUnitAtLoc( GetOwningPlayer(hero), 'e004', point1, AngleBetweenPoints(point1, point) )
call UnitApplyTimedLife( u, 'BTLF', 3 )
set g = GetUnitsInRangeOfLocAll(1000, point1)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_STRUCTURE) == false ) and ( IsUnitAliveBJ(f) == true ) and ( IsUnitAlly(f, GetOwningPlayer(hero)) == false ) then
call TriggerRegisterUnitEvent(t,f, EVENT_UNIT_DAMAGED)
endif
call GroupRemoveUnit(g, f)
endloop
call UnitAddAbility(u, 'A047' )
call SetUnitUserData( u, ( 2 * GetHeroStatBJ(bj_HEROSTAT_AGI, hero, true) ) )
call IssuePointOrderLoc( u, "shockwave", point )
call TimerStart(tx,2,false,null)
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(1.00)
endloop
call DestroyTrigger(t)
set t=null
call DestroyTimer(tx)
set tx = null
call RemoveLocation(point)
call RemoveLocation(point1)
set point = null
set point1 = null
set u = null
set hero = null
set taction = null
set tcondition = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_Phoenix_Wing takes nothing returns nothing
set gg_trg_Phoenix_Wing = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Phoenix_Wing, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Phoenix_Wing, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Phoenix_Wing, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Phoenix_Wing, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Phoenix_Wing, Condition( function Trig_Phoenix_Wing_Conditions ) )
call TriggerAddAction( gg_trg_Phoenix_Wing, function Trig_Phoenix_Wing_Actions )
endfunction
function Trig_Stone_of_Refresh_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01V' ) ) then
return false
endif
return true
endfunction
function Trig_Stone_of_Refresh_Actions takes nothing returns nothing
local integer a = 1
local unit hero = GetManipulatingUnit()
local item array i
loop
exitwhen a > 6
if ( UnitItemInSlotBJ(hero, a) == null ) then
call UnitAddItemByIdSwapped( 'sehr', hero )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 6
if ( GetItemTypeId(UnitItemInSlotBJ(hero, a)) == 'I01V' ) then
set i[a] = UnitItemInSlotBJ(hero, a)
call UnitRemoveItemSwapped( i[a], hero )
endif
set a = a + 1
endloop
call UnitResetCooldown( hero )
set a = 1
loop
exitwhen a > 6
if ( i[a] != null ) then
call UnitAddItemSwapped( i[a], hero )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 6
if ( GetItemTypeId(UnitItemInSlotBJ(hero, a)) == 'sehr' ) then
call UnitRemoveItemFromSlotSwapped( a, hero )
call RemoveItem( GetLastRemovedItem() )
endif
set a = a + 1
endloop
set hero = null
set i[1] = null
set i[2] = null
set i[3] = null
set i[4] = null
set i[5] = null
set i[6] = null
endfunction
//===========================================================================
function InitTrig_Stone_of_Refresh takes nothing returns nothing
set gg_trg_Stone_of_Refresh = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stone_of_Refresh, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stone_of_Refresh, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stone_of_Refresh, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Stone_of_Refresh, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Stone_of_Refresh, Condition( function Trig_Stone_of_Refresh_Conditions ) )
call TriggerAddAction( gg_trg_Stone_of_Refresh, function Trig_Stone_of_Refresh_Actions )
endfunction
function Trig_Ring_of_Destruction_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01T') == true ) ) then
return false
endif
return true
endfunction
function Trig_Ring_of_Destruction_Actions takes nothing returns nothing
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local integer chance = GetRandomInt(1, 100)
local location point = GetUnitLoc(target)
local real hp
local unit u
if ( chance <= 10 ) then
set hp = GetUnitStateSwap(UNIT_STATE_LIFE, target)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(attacker), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 1.0, 'BTLF', u )
call AddSpecialEffectTargetUnitBJ( "overhead", target, "Abilities\\Spells\\Undead\\ReplenishHealth\\ReplenishHealthCaster.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitDamageTargetBJ( u, target, hp, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call UnitDamageTargetBJ( u, attacker, hp, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
endif
set attacker = null
set target = null
endfunction
//===========================================================================
function InitTrig_Ring_of_Destruction takes nothing returns nothing
set gg_trg_Ring_of_Destruction = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ring_of_Destruction, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ring_of_Destruction, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Ring_of_Destruction, Condition( function Trig_Ring_of_Destruction_Conditions ) )
call TriggerAddAction( gg_trg_Ring_of_Destruction, function Trig_Ring_of_Destruction_Actions )
endfunction
function Trig_Illusion_Blade_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01R') == true ) ) then
return false
endif
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_HERO) == false ) ) then
return false
endif
return true
endfunction
function ILB_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A090', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function ILB_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
local unit u = GetTriggerUnit()
local location point = GetUnitLoc(u)
call UnitRemoveAbilityBJ( 'A090', hero )
if ( IsUnitAliveBJ(u) == true ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08Z', GetLastCreatedUnit() )
call IssueTargetOrderById(GetLastCreatedUnit(), 852274, u )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
endif
call RemoveLocation(point)
set point = null
set hero = null
set u = null
endfunction
function Trig_Illusion_Blade_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function ILB_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function ILB_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 5 ) then
call UnitAddAbilityBJ( 'A090', attacker )
call TimerStart(tx,4,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A090', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_Illusion_Blade_Action takes nothing returns nothing
set gg_trg_Illusion_Blade_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Illusion_Blade_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Illusion_Blade_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Illusion_Blade_Action, Condition( function Trig_Illusion_Blade_Action_Conditions ) )
call TriggerAddAction( gg_trg_Illusion_Blade_Action, function Trig_Illusion_Blade_Action_Actions )
endfunction
function Trig_GH_Action_Func001C takes nothing returns boolean
if ( ( GetOwningPlayer(GetKillingUnitBJ()) == Player(0) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetKillingUnitBJ()) == Player(1) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetKillingUnitBJ()) == Player(2) ) ) then
return true
endif
if ( ( GetOwningPlayer(GetKillingUnitBJ()) == Player(3) ) ) then
return true
endif
return false
endfunction
function Trig_GH_Action_Conditions takes nothing returns boolean
if ( not Trig_GH_Action_Func001C() ) then
return false
endif
return true
endfunction
function Trig_GH_Action_Actions takes nothing returns nothing
local unit u = GetKillingUnitBJ()
call AdjustPlayerStateBJ( ( 5 * GetUnitAbilityLevelSwapped('A03B', udg_AttributeHero[GetConvertedPlayerId(GetOwningPlayer(u))]) ), ConvertedPlayer(GetConvertedPlayerId(GetOwningPlayer(u))), PLAYER_STATE_RESOURCE_GOLD )
set u = null
endfunction
//===========================================================================
function InitTrig_GH_Action takes nothing returns nothing
set gg_trg_GH_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GH_Action, Player(10), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GH_Action, Player(11), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_GH_Action, Condition( function Trig_GH_Action_Conditions ) )
call TriggerAddAction( gg_trg_GH_Action, function Trig_GH_Action_Actions )
endfunction
function Trig_Potion_of_Restore_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'pnvl' ) ) then
return false
endif
return true
endfunction
function Trig_Potion_of_Restore_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
call SetUnitLifeBJ( u, GetUnitStateSwap(UNIT_STATE_MAX_LIFE, u) )
call SetUnitManaBJ( u, GetUnitStateSwap(UNIT_STATE_MAX_MANA, u) )
set u = null
endfunction
//===========================================================================
function InitTrig_Potion_of_Restore takes nothing returns nothing
set gg_trg_Potion_of_Restore = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Potion_of_Restore, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Potion_of_Restore, Condition( function Trig_Potion_of_Restore_Conditions ) )
call TriggerAddAction( gg_trg_Potion_of_Restore, function Trig_Potion_of_Restore_Actions )
endfunction
function Trig_Potion_of_Rejunation_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'pnvu' ) ) then
return false
endif
return true
endfunction
function Trig_Potion_of_Rejunation_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
call SetUnitLifeBJ( u, ( GetUnitStateSwap(UNIT_STATE_LIFE, u) + ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, u) * 0.50 ) ) )
call SetUnitManaBJ( u, ( GetUnitStateSwap(UNIT_STATE_MANA, u) + ( GetUnitStateSwap(UNIT_STATE_MAX_MANA, u) * 0.50 ) ) )
set u = null
endfunction
//===========================================================================
function InitTrig_Potion_of_Rejunation takes nothing returns nothing
set gg_trg_Potion_of_Rejunation = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Potion_of_Rejunation, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Potion_of_Rejunation, Condition( function Trig_Potion_of_Rejunation_Conditions ) )
call TriggerAddAction( gg_trg_Potion_of_Rejunation, function Trig_Potion_of_Rejunation_Actions )
endfunction
function Trig_Cursed_Potion_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'pomn' ) ) then
return false
endif
return true
endfunction
function Trig_Cursed_Potion_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
local integer chance = GetRandomInt(1, 100)
if ( chance <= 70 ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetManipulatingUnit()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A08T', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "rejuvination", GetManipulatingUnit() )
else
set chance = GetRandomInt(1, 100)
if ( chance <= 50 ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call RemoveItem( GetLastRemovedItem() )
call AddSpecialEffectTargetUnitBJ( "origin", GetManipulatingUnit(), "Abilities\\Spells\\Human\\Polymorph\\PolyMorphDoneGround.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
endif
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Cursed_Potion takes nothing returns nothing
set gg_trg_Cursed_Potion = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Cursed_Potion, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Cursed_Potion, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Cursed_Potion, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Cursed_Potion, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Cursed_Potion, Condition( function Trig_Cursed_Potion_Conditions ) )
call TriggerAddAction( gg_trg_Cursed_Potion, function Trig_Cursed_Potion_Actions )
endfunction
function Trig_Holy_Potion_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'pres' ) ) then
return false
endif
return true
endfunction
function Trig_Holy_Potion_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
local integer chance = GetRandomInt(1, 100)
if ( chance <= 50 ) then
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetManipulatingUnit()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A08T', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A08T', GetLastCreatedUnit(), 2 )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "rejuvination", GetManipulatingUnit() )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Holy_Potion takes nothing returns nothing
set gg_trg_Holy_Potion = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Holy_Potion, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Holy_Potion, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Holy_Potion, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Holy_Potion, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Holy_Potion, Condition( function Trig_Holy_Potion_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Potion, function Trig_Holy_Potion_Actions )
endfunction
function Trig_Gamble_Tome_of_Str_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01P' ) ) then
return false
endif
return true
endfunction
function Trig_Gamble_Tome_of_Str_Actions takes nothing returns nothing
local integer chance = GetRandomInt(4, 14)
call DisplayTextToForce( GetPlayersAll(), ( "+" + I2S(( chance + 2 )) ) )
call ModifyHeroStat( bj_HEROSTAT_STR, GetManipulatingUnit(), bj_MODIFYMETHOD_ADD, chance )
endfunction
//===========================================================================
function InitTrig_Gamble_Tome_of_Str takes nothing returns nothing
set gg_trg_Gamble_Tome_of_Str = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Str, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Str, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Str, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Str, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Gamble_Tome_of_Str, Condition( function Trig_Gamble_Tome_of_Str_Conditions ) )
call TriggerAddAction( gg_trg_Gamble_Tome_of_Str, function Trig_Gamble_Tome_of_Str_Actions )
endfunction
function Trig_Gamble_Tome_of_Agi_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01P' ) ) then
return false
endif
return true
endfunction
function Trig_Gamble_Tome_of_Agi_Actions takes nothing returns nothing
local integer chance = GetRandomInt(4, 14)
call DisplayTextToForce( GetPlayersAll(), ( "+" + I2S(( chance + 2 )) ) )
call ModifyHeroStat( bj_HEROSTAT_AGI, GetManipulatingUnit(), bj_MODIFYMETHOD_ADD, chance )
endfunction
//===========================================================================
function InitTrig_Gamble_Tome_of_Agi takes nothing returns nothing
set gg_trg_Gamble_Tome_of_Agi = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Agi, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Agi, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Agi, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Agi, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Gamble_Tome_of_Agi, Condition( function Trig_Gamble_Tome_of_Agi_Conditions ) )
call TriggerAddAction( gg_trg_Gamble_Tome_of_Agi, function Trig_Gamble_Tome_of_Agi_Actions )
endfunction
function Trig_Gamble_Tome_of_Int_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01P' ) ) then
return false
endif
return true
endfunction
function Trig_Gamble_Tome_of_Int_Actions takes nothing returns nothing
local integer chance = GetRandomInt(4, 14)
call DisplayTextToForce( GetPlayersAll(), ( "+" + I2S(( chance + 2 )) ) )
call ModifyHeroStat( bj_HEROSTAT_INT, GetManipulatingUnit(), bj_MODIFYMETHOD_ADD, chance )
endfunction
//===========================================================================
function InitTrig_Gamble_Tome_of_Int takes nothing returns nothing
set gg_trg_Gamble_Tome_of_Int = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Int, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Int, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Int, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Gamble_Tome_of_Int, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Gamble_Tome_of_Int, Condition( function Trig_Gamble_Tome_of_Int_Conditions ) )
call TriggerAddAction( gg_trg_Gamble_Tome_of_Int, function Trig_Gamble_Tome_of_Int_Actions )
endfunction
function Trig_Claw_of_Thunder_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I013') == true ) ) then
return false
endif
return true
endfunction
function Trig_Claw_of_Thunder_Action_Actions takes nothing returns nothing
local location point
local integer chance = GetRandomInt(1, 100)
if ( chance <= 10 ) then
set point = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetAttacker()), point, AngleBetweenPoints(GetUnitLoc(GetAttacker()), GetUnitLoc(GetAttackedUnitBJ())) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03J', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", GetAttackedUnitBJ() )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Claw_of_Thunder_Action takes nothing returns nothing
set gg_trg_Claw_of_Thunder_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Claw_of_Thunder_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Claw_of_Thunder_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Claw_of_Thunder_Action, Condition( function Trig_Claw_of_Thunder_Action_Conditions ) )
call TriggerAddAction( gg_trg_Claw_of_Thunder_Action, function Trig_Claw_of_Thunder_Action_Actions )
endfunction
function Trig_Hand_of_God_Action_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_HERO) == false ) ) then
return false
endif
if ( not ( GetUnitPointValue(GetAttackedUnitBJ()) != 1 ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I014') == true ) ) then
return false
endif
return true
endfunction
function Trig_Hand_of_God_Action_Actions takes nothing returns nothing
local integer chance
set chance = GetRandomInt(1, 100)
if ( chance <= 2 ) then
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
call SetUnitOwner( GetAttackedUnitBJ(), GetOwningPlayer(GetAttacker()), true )
call AddSpecialEffectTargetUnitBJ( "origin", GetAttackedUnitBJ(), "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endif
endfunction
//===========================================================================
function InitTrig_Hand_of_God_Action takes nothing returns nothing
set gg_trg_Hand_of_God_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Hand_of_God_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Hand_of_God_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Hand_of_God_Action, Condition( function Trig_Hand_of_God_Action_Conditions ) )
call TriggerAddAction( gg_trg_Hand_of_God_Action, function Trig_Hand_of_God_Action_Actions )
endfunction
function Trig_Frozen_Stone_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttackedUnitBJ(), 'I01D') == true ) ) then
return false
endif
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_MELEE_ATTACKER) == true ) ) then
return false
endif
return true
endfunction
function Trig_Frozen_Stone_Actions takes nothing returns nothing
local integer chance
set chance = GetRandomInt(1, 100)
if ( chance <= 10 ) then
call TriggerExecute( gg_trg_Frozen_Stone_Action )
endif
endfunction
//===========================================================================
function InitTrig_Frozen_Stone takes nothing returns nothing
set gg_trg_Frozen_Stone = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Frozen_Stone, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Frozen_Stone, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Frozen_Stone, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Frozen_Stone, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Frozen_Stone, Condition( function Trig_Frozen_Stone_Conditions ) )
call TriggerAddAction( gg_trg_Frozen_Stone, function Trig_Frozen_Stone_Actions )
endfunction
function Trig_ThunderLizard_Diamond_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01F') == true ) ) then
return false
endif
return true
endfunction
function Trig_ThunderLizard_Diamond_Action_Actions takes nothing returns nothing
local location point
local integer chance = GetRandomInt(1, 100)
if ( chance <= 10 ) then
set point = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetAttacker()), point, AngleBetweenPoints(point, GetUnitLoc(GetAttackedUnitBJ())) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A052', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "forkedlightning", GetAttackedUnitBJ() )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_ThunderLizard_Diamond_Action takes nothing returns nothing
set gg_trg_ThunderLizard_Diamond_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ThunderLizard_Diamond_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_ThunderLizard_Diamond_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_ThunderLizard_Diamond_Action, Condition( function Trig_ThunderLizard_Diamond_Action_Conditions ) )
call TriggerAddAction( gg_trg_ThunderLizard_Diamond_Action, function Trig_ThunderLizard_Diamond_Action_Actions )
endfunction
function Trig_Chest_Of_Gold_Type_1_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'rdis' ) ) then
return false
endif
return true
endfunction
function Trig_Chest_Of_Gold_Type_1_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( 200, GetOwningPlayer(GetManipulatingUnit()), PLAYER_STATE_RESOURCE_GOLD )
endfunction
//===========================================================================
function InitTrig_Chest_Of_Gold_Type_1 takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Trig_Chest_Of_Gold_Type_1_Conditions ) )
call TriggerAddAction( t, function Trig_Chest_Of_Gold_Type_1_Actions )
set t = null
endfunction
function Trig_Chest_Of_Gold_Type_2_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'gfor' ) ) then
return false
endif
return true
endfunction
function Trig_Chest_Of_Gold_Type_2_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( 2000, GetOwningPlayer(GetManipulatingUnit()), PLAYER_STATE_RESOURCE_GOLD )
endfunction
//===========================================================================
function InitTrig_Chest_Of_Gold_Type_2 takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Trig_Chest_Of_Gold_Type_2_Conditions ) )
call TriggerAddAction( t, function Trig_Chest_Of_Gold_Type_2_Actions )
set t = null
endfunction
function Trig_Chest_Of_Gold_Type_3_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'gomn' ) ) then
return false
endif
return true
endfunction
function Trig_Chest_Of_Gold_Type_3_Actions takes nothing returns nothing
call AdjustPlayerStateBJ( 4000, GetOwningPlayer(GetManipulatingUnit()), PLAYER_STATE_RESOURCE_GOLD )
endfunction
//===========================================================================
function InitTrig_Chest_Of_Gold_Type_3 takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( t, Condition( function Trig_Chest_Of_Gold_Type_3_Conditions ) )
call TriggerAddAction( t, function Trig_Chest_Of_Gold_Type_3_Actions )
set t = null
endfunction
function Trig_Jumbo_Cactur_Armor_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttackedUnitBJ(), 'I01L') == true ) ) then
return false
endif
return true
endfunction
function Trig_Jumbo_Cactur_Armor_Actions takes nothing returns nothing
local location point
local integer chance = GetRandomInt(1, 100)
if ( chance <= 20 ) then
set point = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetAttackedUnitBJ()), point, AngleBetweenPoints(GetUnitLoc(GetAttacker()), GetUnitLoc(GetAttackedUnitBJ())) )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A046', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "entanglingroots", GetAttacker() )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Jumbo_Cactur_Armor takes nothing returns nothing
set gg_trg_Jumbo_Cactur_Armor = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Jumbo_Cactur_Armor, Player(0), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Jumbo_Cactur_Armor, Player(1), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Jumbo_Cactur_Armor, Player(2), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Jumbo_Cactur_Armor, Player(3), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Jumbo_Cactur_Armor, Condition( function Trig_Jumbo_Cactur_Armor_Conditions ) )
call TriggerAddAction( gg_trg_Jumbo_Cactur_Armor, function Trig_Jumbo_Cactur_Armor_Actions )
endfunction
function Trig_Odins_Sword_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I015') == true ) ) then
return false
endif
return true
endfunction
function Trig_Odins_Sword_Action_Actions takes nothing returns nothing
local integer chance = GetRandomInt(1, 100)
local location point
if ( chance <= 10 ) then
set point = GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(GetAttacker()), point, AngleBetweenPoints(point, GetUnitLoc(GetAttackedUnitBJ())) )
call UnitApplyTimedLifeBJ( 0.03, 'BTLF', GetLastCreatedUnit() )
call UnitDamageTargetBJ( GetLastCreatedUnit(), GetAttackedUnitBJ(), 99999.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call CreateTextTagUnitBJ( ( "Zantesuken" + "!" ), GetAttacker(), 10.00, 11.00, 100.00, 0.00, 0.00, 30.00 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 80.00, 90 )
call TriggerExecute( gg_trg_Destroy_Text )
endif
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Odins_Sword_Action takes nothing returns nothing
set gg_trg_Odins_Sword_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Odins_Sword_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Odins_Sword_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Odins_Sword_Action, Condition( function Trig_Odins_Sword_Action_Conditions ) )
call TriggerAddAction( gg_trg_Odins_Sword_Action, function Trig_Odins_Sword_Action_Actions )
endfunction
function Trig_Eye_of_Levithan_Begin_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e01M' ) ) then
return false
endif
return true
endfunction
function Trig_Eye_of_Levithan_Begin_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local integer a = 1
local unit u1
local unit u2
local unit u3
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08X', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 0.20, 'BTLF', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), 50 ) //10s
//--------------------------------------
call CreateNUnitsAtLoc( 1, 'e01I', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u1 = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 20.00, 'BTLF', u1 )
call CreateNUnitsAtLoc( 1, 'e01J', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u2 = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'e01K', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u3 = GetLastCreatedUnit()
loop
exitwhen ( IsUnitAliveBJ(u1) == false )
call TriggerSleepAction( 5.00 )
endloop
call SetUnitFlyHeightBJ( u2, 300.00, 3000.00 )
call SetUnitFlyHeightBJ( u3, 300.00, 3000.00 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', u2 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', u3 )
set u1 = null
set u2 = null
set u3 = null
set u = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Eye_of_Levithan_Begin takes nothing returns nothing
set gg_trg_Eye_of_Levithan_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Begin, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Begin, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Begin, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Begin, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Eye_of_Levithan_Begin, Condition( function Trig_Eye_of_Levithan_Begin_Conditions ) )
call TriggerAddAction( gg_trg_Eye_of_Levithan_Begin, function Trig_Eye_of_Levithan_Begin_Actions )
endfunction
function Trig_Eye_of_Levithan_Action_Effect_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e017' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A08X', GetDyingUnit()) > 0 ) ) then
return false
endif
if ( not ( GetUnitUserData(GetDyingUnit()) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Eye_of_Levithan_Action_Effect_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local location point1
local integer a = 1
local unit u1
local unit u2
call CreateNUnitsAtLoc( 1, 'e017', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A08X', GetLastCreatedUnit() )
call SetUnitUserData( GetLastCreatedUnit(), ( GetUnitUserData(u) - 1 ) )
call UnitApplyTimedLifeBJ( 0.30, 'BTLF', GetLastCreatedUnit() )
// --------------------
loop
exitwhen a > 2
set point1 = PolarProjectionBJ(point, GetRandomReal(100, 800.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point1, AngleBetweenPoints(point1, point ))
set u1 = GetLastCreatedUnit()
call SetUnitScalePercent( u1, 10, 10, 10 )
call SetUnitFlyHeightBJ( u1, GetRandomReal(200.00, 800.00), 9999.00 )
call UnitAddAbilityBJ( 'A08X', u1 )
call UnitApplyTimedLifeBJ( 2.0, 'BTLF', u1 )
call CreateNUnitsAtLoc( 1, 'e01L', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u2 = GetLastCreatedUnit()
call SetUnitFlyHeightBJ( u2, 300.00, 9999.00 )
call IssueTargetOrderBJ( u1, "acidbomb", u2 )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point1, AngleBetweenPoints(point1, point ))
set u1 = GetLastCreatedUnit()
call SetUnitFlyHeightBJ( u1, GetRandomReal(600.00, 1000.00), 9999.00 )
call UnitAddAbilityBJ( 'A08Y', u1 )
call UnitApplyTimedLifeBJ( 2.0, 'BTLF', u1 )
call CreateNUnitsAtLoc( 1, 'e01L', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u2 = GetLastCreatedUnit()
call SetUnitFlyHeightBJ( u2, 300.00, 9999.00 )
call IssueTargetOrderBJ( u1, "acidbomb", u2 )
set a = a + 1
endloop
// --------------------
call RemoveLocation(point)
set point = null
call RemoveLocation(point1)
set point1 = null
set u = null
set u1 = null
set u2 = null
endfunction
//===========================================================================
function InitTrig_Eye_of_Levithan_Action_Effect takes nothing returns nothing
set gg_trg_Eye_of_Levithan_Action_Effect = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Action_Effect, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Action_Effect, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Action_Effect, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Action_Effect, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Eye_of_Levithan_Action_Effect, Condition( function Trig_Eye_of_Levithan_Action_Effect_Conditions ) )
call TriggerAddAction( gg_trg_Eye_of_Levithan_Action_Effect, function Trig_Eye_of_Levithan_Action_Effect_Actions )
endfunction
function Trig_Eye_of_Levithan_Damage_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e01J' ) ) then
return false
endif
return true
endfunction
function Trig_Eye_of_Levithan_Damage_Actions takes nothing returns nothing
local integer a = 1
local unit u = GetDyingUnit()
local location point = GetUnitLoc(u)
local unit u2
call TerrainDeformationRippleBJ( 3.00, false, point, 0.00, 2000.00, 60.00, 1, 512 )
call CreateNUnitsAtLoc( 1, 'e001', GetOwningPlayer(u), point, bj_UNIT_FACING )
set u2 = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', u2 )
call UnitDamagePointLoc( u2, 0, 2000.00, point, 999999.00, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
set u2 = null
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Eye_of_Levithan_Damage takes nothing returns nothing
set gg_trg_Eye_of_Levithan_Damage = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Damage, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Damage, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Damage, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Eye_of_Levithan_Damage, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Eye_of_Levithan_Damage, Condition( function Trig_Eye_of_Levithan_Damage_Conditions ) )
call TriggerAddAction( gg_trg_Eye_of_Levithan_Damage, function Trig_Eye_of_Levithan_Damage_Actions )
endfunction
function Trig_Chapion_Ice_Sword_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01G') == true ) ) then
return false
endif
return true
endfunction
function CISA_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A054', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function CISA_Damage takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A054', GetEventDamageSource() )
call TriggerExecute( gg_trg_CIS_Action )
endfunction
function Trig_Chapion_Ice_Sword_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function CISA_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function CISA_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 30 ) then
call UnitAddAbilityBJ( 'A054', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(2.0)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_Chapion_Ice_Sword_Gen_E takes nothing returns nothing
set gg_trg_Chapion_Ice_Sword_Gen_E = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Chapion_Ice_Sword_Gen_E, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Chapion_Ice_Sword_Gen_E, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Chapion_Ice_Sword_Gen_E, Condition( function Trig_Chapion_Ice_Sword_Action_Conditions ) )
call TriggerAddAction( gg_trg_Chapion_Ice_Sword_Gen_E, function Trig_Chapion_Ice_Sword_Action_Actions )
endfunction
function Trig_CIS_Action_Actions takes nothing returns nothing
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(GetTriggerUnit())
local location heropoint = GetUnitLoc(hero)
local location temppoint
local integer a
local integer b = GetRandomInt(3, 7)
local real angle
set angle = AngleBetweenPoints(heropoint, point)
set a = 0
loop
exitwhen a > b
set temppoint = PolarProjectionBJ(point, ( I2R(a) * 100.00 ), angle)
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(hero), temppoint, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A053', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostnova", GetLastCreatedUnit() )
call TriggerSleepAction(0.00)
set a = a + 1
endloop
call RemoveLocation(point)
call RemoveLocation(heropoint)
call RemoveLocation(temppoint)
set hero = null
set temppoint = null
set point = null
set heropoint = null
endfunction
//===========================================================================
function InitTrig_CIS_Action takes nothing returns nothing
set gg_trg_CIS_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_CIS_Action, function Trig_CIS_Action_Actions )
endfunction
function Trig_Ifrits_Sword_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01H') == true ) ) then
return false
endif
return true
endfunction
function TFSOI_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A057', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function TFSOI_Damage takes nothing returns nothing
local integer a
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(GetTriggerUnit())
local location temppoint
call UnitRemoveAbilityBJ( 'A057', hero )
set a = 1
loop
exitwhen a > 36
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A056', GetLastCreatedUnit() )
set temppoint = PolarProjectionBJ(point, 1.00, ( I2R(a) * 10.00 ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "breathoffire", temppoint )
set a = a + 1
endloop
call RemoveLocation(point)
call RemoveLocation(temppoint)
set hero = null
set point = null
set temppoint = null
endfunction
function Trig_Ifrits_Sword_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function TFSOI_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TFSOI_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 15 ) then
call UnitAddAbilityBJ( 'A057', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A057', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_Ifrits_Sword takes nothing returns nothing
set gg_trg_Ifrits_Sword = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ifrits_Sword, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Ifrits_Sword, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Ifrits_Sword, Condition( function Trig_Ifrits_Sword_Conditions ) )
call TriggerAddAction( gg_trg_Ifrits_Sword, function Trig_Ifrits_Sword_Actions )
endfunction
function Trig_The_Scythe_of_Death_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01J') == true ) ) then
return false
endif
return true
endfunction
function TCOD_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A05A', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function TCOD_Damage takes nothing returns nothing
local integer a
local integer b = GetRandomInt(20, 36)
local unit hero = GetEventDamageSource()
local location point = GetUnitLoc(GetTriggerUnit())
local location temppoint
call UnitRemoveAbilityBJ( 'A05A', hero )
set a = 1
loop
exitwhen a > b
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, ( I2R(a) * I2R(360/b) ) )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A058', GetLastCreatedUnit() )
set temppoint = PolarProjectionBJ(point, 1.00, ( I2R(a) * I2R(360/b) ))
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "breathoffrost", temppoint )
set a = a + 1
endloop
call RemoveLocation(point)
call RemoveLocation(temppoint)
set hero = null
set point = null
set temppoint = null
endfunction
function Trig_The_Scythe_of_Death_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function TCOD_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TCOD_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 15 ) then
call UnitAddAbilityBJ( 'A05A', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A05A', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_The_Scythe_of_Death takes nothing returns nothing
set gg_trg_The_Scythe_of_Death = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_The_Scythe_of_Death, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_The_Scythe_of_Death, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_The_Scythe_of_Death, Condition( function Trig_The_Scythe_of_Death_Conditions ) )
call TriggerAddAction( gg_trg_The_Scythe_of_Death, function Trig_The_Scythe_of_Death_Actions )
endfunction
function Trig_The_Staff_of_Ramuh_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01I') == true ) ) then
return false
endif
return true
endfunction
function TSOR_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A068', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function TSOR_Damage takes nothing returns nothing
local unit hero = GetEventDamageSource()
call UnitRemoveAbilityBJ( 'A057', hero )
call TriggerExecute( gg_trg_TSOR_Action )
set hero = null
endfunction
function Trig_The_Staff_of_Ramuh_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local triggeraction taction = TriggerAddAction(t, function TSOR_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function TSOR_Conditions))
local timer tx = CreateTimer()
local integer chance = GetRandomInt(1, 100)
if ( chance <= 5 ) then
call UnitAddAbilityBJ( 'A068', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,GetAttackedUnitBJ(), EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(0.1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_The_Staff_of_Ramuh takes nothing returns nothing
set gg_trg_The_Staff_of_Ramuh = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_The_Staff_of_Ramuh, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_The_Staff_of_Ramuh, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_The_Staff_of_Ramuh, Condition( function Trig_The_Staff_of_Ramuh_Conditions ) )
call TriggerAddAction( gg_trg_The_Staff_of_Ramuh, function Trig_The_Staff_of_Ramuh_Actions )
endfunction
function Trig_TSOR_Action_Actions takes nothing returns nothing
local unit hero = GetEventDamageSource()
local unit u
local location point
local group g = CreateGroup()
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(50, 300.00), GetRandomDirectionDeg())
call CreateNUnitsAtLoc( 1, 'e003', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', u )
loop
exitwhen ( ( IsUnitDeadBJ(hero) ) == true ) or ( GetUnitAbilityLevelSwapped('A068', hero) == 0 )
set point = GetUnitLoc(u)
set g = GetUnitsInRangeOfLocAll(500, point)
if ( IsUnitInGroup(hero, g) == true ) then
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(50, 200.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u, "attack", point )
else
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(50, 200.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u, "move", point )
endif
call TriggerSleepAction( 1.00 )
endloop
call KillUnit(u)
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
set hero = null
call TriggerSleepAction( 1.00 )
call RemoveUnit( u )
set u = null
endfunction
//===========================================================================
function InitTrig_TSOR_Action takes nothing returns nothing
set gg_trg_TSOR_Action = CreateTrigger( )
call TriggerAddAction( gg_trg_TSOR_Action, function Trig_TSOR_Action_Actions )
endfunction
function Trig_QA_Take_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01B' ) ) then
return false
endif
return true
endfunction
function QAAction takes unit hero returns nothing
local unit array u
local location point = GetUnitLoc(hero)
local group g = CreateGroup()
local integer a
call CreateNUnitsAtLoc( 1, 'e00A', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[1] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'e00A', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[2] = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'e00A', GetOwningPlayer(hero), point, bj_UNIT_FACING )
set u[3] = GetLastCreatedUnit()
loop
exitwhen ( ( IsUnitDeadBJ(hero) ) == true ) or ( ( UnitHasItemOfTypeBJ(hero, 'I01B') == false ) )
set a = 1
loop
exitwhen a > 3
set point = GetUnitLoc(u[a])
set g = GetUnitsInRangeOfLocAll(500, point)
if ( IsUnitInGroup(hero, g) == true ) then
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(0, 300.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u[a], "attack", point )
else
set point = PolarProjectionBJ(GetUnitLoc(hero), GetRandomReal(0, 300.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( u[a], "move", point )
endif
set a = a + 1
endloop
call TriggerSleepAction( 0.50 )
endloop
call TriggerSleepAction( 1.00 )
call DestroyGroup(g)
set g = null
call RemoveLocation(point)
set point = null
call KillUnit( u[1] )
call KillUnit( u[2] )
call KillUnit( u[3] )
set u[1] = null
set u[2] = null
set u[3] = null
endfunction
function Trig_QA_Take_Actions takes nothing returns nothing
local unit hero = GetManipulatingUnit()
local integer a = 0
call AddSpecialEffectTargetUnitBJ( "origin", hero, "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call QAAction( hero )
set hero = null
endfunction
//===========================================================================
function InitTrig_QA_Take takes nothing returns nothing
set gg_trg_QA_Take = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_QA_Take, Player(0), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_QA_Take, Player(1), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_QA_Take, Player(2), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_QA_Take, Player(3), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_QA_Take, Condition( function Trig_QA_Take_Conditions ) )
call TriggerAddAction( gg_trg_QA_Take, function Trig_QA_Take_Actions )
endfunction
function Trig_Bloody_Sword_of_Hade_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01N' ) ) then
return false
endif
return true
endfunction
function Trig_Bloody_Sword_of_Hade_Actions takes nothing returns nothing
local integer a
local unit hero = GetManipulatingUnit()
local location point = GetUnitLoc(hero)
local real HPpoint
local integer HPSo
local integer HPSoTemp
local integer HPSoTrieu
local integer HPSoTramNghin
local integer HPSoChucNghin
local integer HPSoNghin
local integer HPSoTram
local integer HPSoChuc
local integer HPSoDonVi
call AddSpecialEffectTargetUnitBJ( "overhead", hero, "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A07V', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "cripple", hero )
// --------------------------
set HPpoint = ( ( GetUnitStateSwap(UNIT_STATE_LIFE, hero) * 90.00 ) / 100.00 )
call SetUnitLifeBJ( hero, ( GetUnitStateSwap(UNIT_STATE_LIFE, hero) - HPpoint) )
set HPpoint = ( HPpoint * 10.00 ) / 100.00
set HPSo = R2I(HPpoint)
set HPSoTemp = HPSo
// --------------------------
set HPSoTrieu = ( HPSoTemp / 1000000 )
set HPSoTemp = ( HPSoTemp - ( HPSoTrieu * 1000000 ) )
set HPSoTramNghin = ( HPSoTemp / 100000 )
set HPSoTemp = ( HPSoTemp - ( HPSoTramNghin * 100000 ) )
set HPSoChucNghin = ( HPSoTemp / 10000 )
set HPSoTemp = ( HPSoTemp - ( HPSoChucNghin * 10000 ) )
set HPSoNghin = ( HPSoTemp / 1000 )
set HPSoTemp = ( HPSoTemp - ( HPSoNghin * 1000 ) )
set HPSoTram = ( HPSoTemp / 100 )
set HPSoTemp = ( HPSoTemp - ( HPSoTram * 100 ) )
set HPSoChuc = ( HPSoTemp / 10 )
set HPSoTemp = ( HPSoTemp - ( HPSoChuc * 10 ) )
set HPSoDonVi = ( HPSoTemp / 1 )
// -------- + Damage ----------
set a = 1
loop
exitwhen a > HPSoTrieu
call UnitAddItemByIdSwapped( 'I00G', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoTramNghin
call UnitAddItemByIdSwapped( 'I00B', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoChucNghin
call UnitAddItemByIdSwapped( 'I00C', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoNghin
call UnitAddItemByIdSwapped( 'I00D', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoTram
call UnitAddItemByIdSwapped( 'I00E', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoChuc
call UnitAddItemByIdSwapped( 'I00F', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoDonVi
call UnitAddItemByIdSwapped( 'I00A', hero )
set a = a + 1
endloop
// -------- - Damage ----------
call TriggerSleepAction( 2.00 )
loop
exitwhen ( UnitHasBuffBJ(hero, 'B00R') == false )
call TriggerSleepAction( 2.00 )
endloop
loop
exitwhen ( IsUnitAliveBJ(hero) == true )
call TriggerSleepAction( 2.00 )
endloop
set a = 1
loop
exitwhen a > HPSoTrieu
call UnitAddItemByIdSwapped( 'I00H', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoTramNghin
call UnitAddItemByIdSwapped( 'I00N', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoChucNghin
call UnitAddItemByIdSwapped( 'I00I', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoNghin
call UnitAddItemByIdSwapped( 'I00J', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoTram
call UnitAddItemByIdSwapped( 'I00K', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoChuc
call UnitAddItemByIdSwapped( 'I00L', hero )
set a = a + 1
endloop
set a = 1
loop
exitwhen a > HPSoDonVi
call UnitAddItemByIdSwapped( 'I00M', hero )
set a = a + 1
endloop
set hero = null
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Bloody_Sword_of_Hade takes nothing returns nothing
set gg_trg_Bloody_Sword_of_Hade = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Bloody_Sword_of_Hade, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Bloody_Sword_of_Hade, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Bloody_Sword_of_Hade, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Bloody_Sword_of_Hade, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Bloody_Sword_of_Hade, Condition( function Trig_Bloody_Sword_of_Hade_Conditions ) )
call TriggerAddAction( gg_trg_Bloody_Sword_of_Hade, function Trig_Bloody_Sword_of_Hade_Actions )
endfunction
function Trig_GOS_Action_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01M') == true ) ) then
return false
endif
return true
endfunction
function GOS_Conditions takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A07S', GetEventDamageSource()) > 0 ) ) then
return false
endif
return true
endfunction
function GOS_Damage takes nothing returns nothing
local integer a
local unit hero = GetEventDamageSource()
local unit target = GetTriggerUnit()
local location point
local integer a
local real range
local real timedeath
call UnitRemoveAbilityBJ( 'A07S', hero )
set range = GetRandomReal(200.00, 600.00)
set a = 1
loop
exitwhen a > 10
set point = PolarProjectionBJ(GetUnitLoc(target), 50.00, ( 36.00 * I2R(a) ) )
call CreateNUnitsAtLoc( 1, 'e00I', GetOwningPlayer(hero), point, ( GetUnitFacing(hero) + ( 36.00 * I2R(a) ) ) )
call SetUnitAbilityLevelSwapped( 'A01I', GetLastCreatedUnit(), 2 )
set timedeath = ( range / GetUnitMoveSpeed(GetLastCreatedUnit()) )
set point = PolarProjectionBJ(GetUnitLoc(target), range, ( 36.00 * I2R(a) ) )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", point )
call UnitApplyTimedLifeBJ( timedeath, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
call RemoveLocation(point)
set hero = null
set target = null
set point = null
endfunction
function Trig_GOS_Action_Actions takes nothing returns nothing
local trigger t = CreateTrigger()
local unit attacker = GetAttacker()
local unit target = GetAttackedUnitBJ()
local triggeraction taction = TriggerAddAction(t, function GOS_Damage)
local triggercondition tcondition = TriggerAddCondition(t, Condition(function GOS_Conditions))
local integer chance = GetRandomInt(1, 100)
local timer tx = CreateTimer()
if ( chance <= 10 ) then
call UnitAddAbilityBJ( 'A07S', attacker )
call TimerStart(tx,3,false,null)
call TriggerRegisterUnitEvent(t,target, EVENT_UNIT_DAMAGED)
loop
exitwhen (TimerGetRemaining(tx)<=0) or ( GetUnitAbilityLevelSwapped('A07S', attacker) <= 0 ) or (GetTriggerEvalCount(t) == 1)
call TriggerSleepAction(1)
endloop
endif
call DestroyTrigger(t)
call DestroyTimer(tx)
set taction = null
set tcondition = null
set attacker = null
set target = null
set t=null
set tx = null
endfunction
//===========================================================================
function InitTrig_GOS_Action takes nothing returns nothing
set gg_trg_GOS_Action = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GOS_Action, Player(10), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GOS_Action, Player(11), EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_GOS_Action, Condition( function Trig_GOS_Action_Conditions ) )
call TriggerAddAction( gg_trg_GOS_Action, function Trig_GOS_Action_Actions )
endfunction
function Trig_Armor_of_Fire_Buy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00W' ) ) then
return false
endif
return true
endfunction
function Trig_Armor_of_Fire_Buy_Actions takes nothing returns nothing
call UnitAddAbilityBJ( 'A014', GetManipulatingUnit() )
endfunction
//===========================================================================
function InitTrig_Armor_of_Fire_Buy takes nothing returns nothing
set gg_trg_Armor_of_Fire_Buy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armor_of_Fire_Buy, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Armor_of_Fire_Buy, Condition( function Trig_Armor_of_Fire_Buy_Conditions ) )
call TriggerAddAction( gg_trg_Armor_of_Fire_Buy, function Trig_Armor_of_Fire_Buy_Actions )
endfunction
function Trig_Armor_of_Fire_Drop_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00W' ) ) then
return false
endif
return true
endfunction
function Trig_Armor_of_Fire_Drop_Actions takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A014', GetManipulatingUnit() )
endfunction
//===========================================================================
function InitTrig_Armor_of_Fire_Drop takes nothing returns nothing
set gg_trg_Armor_of_Fire_Drop = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armor_of_Fire_Drop, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( gg_trg_Armor_of_Fire_Drop, Condition( function Trig_Armor_of_Fire_Drop_Conditions ) )
call TriggerAddAction( gg_trg_Armor_of_Fire_Drop, function Trig_Armor_of_Fire_Drop_Actions )
endfunction
function Trig_Armor_of_Ice_Buy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00X' ) ) then
return false
endif
return true
endfunction
function Trig_Armor_of_Ice_Buy_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
local location point = GetUnitLoc(u)
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(u), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03I', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostarmor", u )
call RemoveLocation(point)
set point = null
set u = null
endfunction
//===========================================================================
function InitTrig_Armor_of_Ice_Buy takes nothing returns nothing
set gg_trg_Armor_of_Ice_Buy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armor_of_Ice_Buy, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Armor_of_Ice_Buy, Condition( function Trig_Armor_of_Ice_Buy_Conditions ) )
call TriggerAddAction( gg_trg_Armor_of_Ice_Buy, function Trig_Armor_of_Ice_Buy_Actions )
endfunction
function Trig_Armor_of_Ice_Drop_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00X' ) ) then
return false
endif
return true
endfunction
function Trig_Armor_of_Ice_Drop_Actions takes nothing returns nothing
call UnitRemoveBuffBJ( 'BUfa', GetManipulatingUnit() )
endfunction
//===========================================================================
function InitTrig_Armor_of_Ice_Drop takes nothing returns nothing
set gg_trg_Armor_of_Ice_Drop = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armor_of_Ice_Drop, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( gg_trg_Armor_of_Ice_Drop, Condition( function Trig_Armor_of_Ice_Drop_Conditions ) )
call TriggerAddAction( gg_trg_Armor_of_Ice_Drop, function Trig_Armor_of_Ice_Drop_Actions )
endfunction
function Trig_AOI_Fix_1_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummoningUnit()) == 'Ogld' ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetSummonedUnit(), 'I00X') == true ) ) then
return false
endif
return true
endfunction
function Trig_AOI_Fix_1_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetManipulatingUnit()), point, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03I', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostarmor", GetSummonedUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_AOI_Fix_1 takes nothing returns nothing
set gg_trg_AOI_Fix_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AOI_Fix_1, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_AOI_Fix_1, Condition( function Trig_AOI_Fix_1_Conditions ) )
call TriggerAddAction( gg_trg_AOI_Fix_1, function Trig_AOI_Fix_1_Actions )
endfunction
function Trig_AOI_Fix_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSummoningUnit()) == 'Ogrh' ) ) then
return false
endif
if ( not ( UnitHasItemOfTypeBJ(GetSummoningUnit(), 'I00X') == true ) ) then
return false
endif
return true
endfunction
function Trig_AOI_Fix_2_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
call CreateNUnitsAtLoc( 1, 'e004', GetOwningPlayer(GetManipulatingUnit()), point, bj_UNIT_FACING )
call RemoveLocation(point)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A03I', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "frostarmor", GetSummonedUnit() )
set point = null
endfunction
//===========================================================================
function InitTrig_AOI_Fix_2 takes nothing returns nothing
set gg_trg_AOI_Fix_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AOI_Fix_2, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_AOI_Fix_2, Condition( function Trig_AOI_Fix_2_Conditions ) )
call TriggerAddAction( gg_trg_AOI_Fix_2, function Trig_AOI_Fix_2_Actions )
endfunction
function Trig_Shivas_Armor_Buy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00Y' ) ) then
return false
endif
return true
endfunction
function Trig_Shivas_Armor_Buy_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
call AddSpecialEffectLocBJ( point, "Objects\\Spawnmodels\\NightElf\\NEDeathMedium\\NEDeath.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbilityBJ( 'A03H', GetManipulatingUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Shivas_Armor_Buy takes nothing returns nothing
set gg_trg_Shivas_Armor_Buy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shivas_Armor_Buy, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Shivas_Armor_Buy, Condition( function Trig_Shivas_Armor_Buy_Conditions ) )
call TriggerAddAction( gg_trg_Shivas_Armor_Buy, function Trig_Shivas_Armor_Buy_Actions )
endfunction
function Trig_Ifrits_Armor_Buy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I011' ) ) then
return false
endif
return true
endfunction
function Trig_Ifrits_Armor_Buy_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetManipulatingUnit())
call AddSpecialEffectLocBJ( point, "Environment\\LargeBuildingFire\\LargeBuildingFire1.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call UnitAddAbilityBJ( 'A03G', GetManipulatingUnit() )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_Ifrits_Armor_Buy takes nothing returns nothing
set gg_trg_Ifrits_Armor_Buy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ifrits_Armor_Buy, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Ifrits_Armor_Buy, Condition( function Trig_Ifrits_Armor_Buy_Conditions ) )
call TriggerAddAction( gg_trg_Ifrits_Armor_Buy, function Trig_Ifrits_Armor_Buy_Actions )
endfunction
function Trig_God_Mode_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03F' ) ) then
return false
endif
return true
endfunction
function GodMode_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not ( IsUnitAliveBJ(GetTriggerUnit()) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), Player(0)) == true ) ) then
return false
endif
return true
endfunction
function GM_Action1 takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbilityBJ( 'A067', u )
call TriggerSleepAction(1.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_SSGodModeUnit[1]))) == false ) or ( IsUnitAliveBJ(udg_SSGodModeUnit[1]) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(1.0)
endloop
call UnitRemoveAbilityBJ( 'A067', u )
set u = null
endfunction
function GM_Action2 takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbilityBJ( 'A067', u )
call TriggerSleepAction(1.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_SSGodModeUnit[2]))) == false ) or ( IsUnitAliveBJ(udg_SSGodModeUnit[2]) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(1.0)
endloop
call UnitRemoveAbilityBJ( 'A067', u )
set u = null
endfunction
function GM_Action3 takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbilityBJ( 'A067', u )
call TriggerSleepAction(1.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_SSGodModeUnit[3]))) == false ) or ( IsUnitAliveBJ(udg_SSGodModeUnit[3]) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(1.0)
endloop
call UnitRemoveAbilityBJ( 'A067', u )
set u = null
endfunction
function GM_Action4 takes nothing returns nothing
local unit u = GetTriggerUnit()
call UnitAddAbilityBJ( 'A067', u )
call TriggerSleepAction(1.0)
loop
exitwhen ( IsUnitInGroup(u, GetUnitsInRangeOfLocAll(900.00, GetUnitLoc(udg_SSGodModeUnit[4]))) == false ) or ( IsUnitAliveBJ(udg_SSGodModeUnit[4]) == false ) or ( IsUnitAliveBJ(u) == false )
call TriggerSleepAction(1.0)
endloop
call UnitRemoveAbilityBJ( 'A067', u )
set u = null
endfunction
function Trig_God_Mode_Begin_Actions takes nothing returns nothing
local unit u
local location point = GetSpellTargetLoc()
local trigger t = CreateTrigger()
local triggercondition tcondition = TriggerAddCondition(t, Condition(function GodMode_Conditions))
local triggeraction taction
local timer tx = CreateTimer()
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
call CreateNUnitsAtLoc( 1, 'e014', GetOwningPlayer(GetSpellAbilityUnit()), point, bj_UNIT_FACING )
set udg_SSGodModeUnit[numberp] = GetLastCreatedUnit()
set u = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 30.00, 'BTLF', u )
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" )
call TriggerExecute( gg_trg_GM_Effect_Off )
call TriggerSleepAction( 3.10 )
call SetUnitTimeScalePercent( u, 0.00 )
set point = GetUnitLoc(u)
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl" )
call TriggerExecute( gg_trg_GM_Effect_Off )
//////////////////////////////////////////////////
call TimerStart(tx,35,false,null)
if (numberp == 1) then
set taction = TriggerAddAction(t, function GM_Action1)
call TriggerRegisterUnitInRangeSimple( t, 900.00, udg_SSGodModeUnit[1] )
endif
if (numberp == 2) then
set taction = TriggerAddAction(t, function GM_Action2)
call TriggerRegisterUnitInRangeSimple( t, 900.00, udg_SSGodModeUnit[2] )
endif
if (numberp == 3) then
set taction = TriggerAddAction(t, function GM_Action3)
call TriggerRegisterUnitInRangeSimple( t, 900.00, udg_SSGodModeUnit[3] )
endif
if (numberp == 4) then
set taction = TriggerAddAction(t, function GM_Action4)
call TriggerRegisterUnitInRangeSimple( t, 900.00, udg_SSGodModeUnit[4] )
endif
loop
exitwhen (TimerGetRemaining(tx)<=0)
call TriggerSleepAction(8.0)
endloop
call DestroyTrigger(t)
call DestroyTimer(tx)
set tcondition = null
set taction = null
set t=null
set tx = null
call RemoveLocation(point)
set u = null
set point = null
endfunction
//===========================================================================
function InitTrig_God_Mode_Begin takes nothing returns nothing
set gg_trg_God_Mode_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_God_Mode_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_God_Mode_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_God_Mode_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_God_Mode_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_God_Mode_Begin, Condition( function Trig_God_Mode_Begin_Conditions ) )
call TriggerAddAction( gg_trg_God_Mode_Begin, function Trig_God_Mode_Begin_Actions )
endfunction
function Trig_GM_Dead_Effect_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'e014' ) ) then
return false
endif
return true
endfunction
function Trig_GM_Dead_Effect_Actions takes nothing returns nothing
local location point = GetUnitLoc(GetDyingUnit())
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl" )
call ConditionalTriggerExecute( gg_trg_Effect_Off )
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
call ConditionalTriggerExecute( gg_trg_Effect_Off )
call RemoveLocation(point)
set point = null
endfunction
//===========================================================================
function InitTrig_GM_Dead_Effect takes nothing returns nothing
set gg_trg_GM_Dead_Effect = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GM_Dead_Effect, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GM_Dead_Effect, Player(1), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GM_Dead_Effect, Player(2), EVENT_PLAYER_UNIT_DEATH )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_GM_Dead_Effect, Player(3), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_GM_Dead_Effect, Condition( function Trig_GM_Dead_Effect_Conditions ) )
call TriggerAddAction( gg_trg_GM_Dead_Effect, function Trig_GM_Dead_Effect_Actions )
endfunction
function Trig_Summon_GF_Begin_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03M' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_GF_Begin_Actions takes nothing returns nothing
local location point = GetSpellTargetLoc()
local group g = CreateGroup()
local unit f
local integer a = 1
call AddSpecialEffectLocBJ( point, "Abilities\\Spells\\NightElf\\Tranquility\\Tranquility.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
set g = GetUnitsInRectMatching(udg_CreepRegionFirst[( udg_CreepLevel + 2 )], null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == Player(10) ) then
loop
exitwhen a > 6
call CreateNUnitsAtLoc( 1, GetUnitTypeId(f), GetOwningPlayer(GetSpellAbilityUnit()), point, GetRandomDirectionDeg() )
call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() )
set a = a + 1
endloop
endif
call GroupRemoveUnit(g, f)
endloop
call RemoveLocation(point)
set point = null
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_Summon_GF_Begin takes nothing returns nothing
set gg_trg_Summon_GF_Begin = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_Begin, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_Begin, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_Begin, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_Begin, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Summon_GF_Begin, Condition( function Trig_Summon_GF_Begin_Conditions ) )
call TriggerAddAction( gg_trg_Summon_GF_Begin, function Trig_Summon_GF_Begin_Actions )
endfunction
function Trig_Summon_GF_IAS_MS_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04Z' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_GF_IAS_MS_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call AddSpecialEffectLocBJ( point, "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call TriggerSleepAction(0.8)
call CreateNUnitsAtLoc( 1, 'nwrg', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call SetUnitVertexColorBJ( GetLastCreatedUnit(), 0.00, 100, 0.00, 0 )
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A050', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_Summon_GF_IAS_MS takes nothing returns nothing
set gg_trg_Summon_GF_IAS_MS = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_IAS_MS, Player(0), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_IAS_MS, Player(1), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_IAS_MS, Player(2), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_IAS_MS, Player(3), EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Summon_GF_IAS_MS, Condition( function Trig_Summon_GF_IAS_MS_Conditions ) )
call TriggerAddAction( gg_trg_Summon_GF_IAS_MS, function Trig_Summon_GF_IAS_MS_Actions )
endfunction
function Trig_Summon_GF_CA_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09A' ) ) then
return false
endif
return true
endfunction
function Trig_Summon_GF_CA_Actions takes nothing returns nothing
local unit hero = GetSpellAbilityUnit()
local location point = GetSpellTargetLoc()
call AddSpecialEffectLocBJ( point, "Units\\Demon\\Infernal\\InfernalBirth.mdl" )
call TriggerExecute( gg_trg_Effect_Off )
call TriggerSleepAction(0.8)
call CreateNUnitsAtLoc( 1, 'nwrg', GetOwningPlayer(hero), point, bj_UNIT_FACING )
call SetUnitVertexColorBJ( GetLastCreatedUnit(), 100, 100, 0.00, 0 )
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitApplyTimedLifeBJ( 60, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A099', GetLastCreatedUnit() )
call RemoveLocation(point)
set point = null
set hero = null
endfunction
//===========================================================================
function InitTrig_Summon_GF_CA takes nothing returns nothing
set gg_trg_Summon_GF_CA = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_CA, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_CA, Player(1), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_CA, Player(2), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Summon_GF_CA, Player(3), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Summon_GF_CA, Condition( function Trig_Summon_GF_CA_Conditions ) )
call TriggerAddAction( gg_trg_Summon_GF_CA, function Trig_Summon_GF_CA_Actions )
endfunction
function Attribute_Action takes player u returns nothing
local integer numberp = GetConvertedPlayerId(u)
local integer a
local integer b
local integer c
if ( udg_AttributeHero[numberp] == null ) or ( IsUnitAliveBJ(udg_AttributeHero[numberp]) == false ) then
return
endif
call SelectUnitForPlayerSingle( udg_AttributeHero[numberp], ConvertedPlayer(numberp) )
if ( GetItemTypeId(UnitItemInSlotBJ(udg_AttributeHero[numberp], 1)) != 'I018' ) then
call DisplayTextToForce( bj_FORCE_PLAYER[numberp], ( " Hit ESC again to back to your Hero's Inventory" + " !" ) )
// ////////////////////////////////
set a = ( 6 * numberp )
set b = a + 5
set c = 1
loop
exitwhen a > b
set udg_AttributeItem[a] = null
set udg_AttributeItem[a] = UnitItemInSlotBJ(udg_AttributeHero[numberp], c)
call UnitRemoveItemFromSlotSwapped( c, udg_AttributeHero[numberp] )
call SetItemVisibleBJ( false, GetLastRemovedItem() )
set a = a + 1
set c = c + 1
endloop
call UnitAddItemByIdSwapped( 'I018', udg_AttributeHero[numberp] )
call SetItemCharges( GetLastCreatedItem(), udg_AttributeNumber[numberp] )
call UnitAddItemByIdSwapped( 'I018', udg_AttributeHero[numberp] )
call UnitAddItemByIdSwapped( 'I017', udg_AttributeHero[numberp] )
call SetItemCharges( GetLastCreatedItem(), udg_AttributeNumber[numberp] )
call UnitAddItemByIdSwapped( 'I017', udg_AttributeHero[numberp] )
call UnitAddItemByIdSwapped( 'I016', udg_AttributeHero[numberp] )
call SetItemCharges( GetLastCreatedItem(), udg_AttributeNumber[numberp] )
// ////////////////////////////////
call UnitRemoveItemFromSlotSwapped( 2, udg_AttributeHero[numberp] )
call RemoveItem( GetLastRemovedItem() )
call UnitRemoveItemFromSlotSwapped( 4, udg_AttributeHero[numberp] )
call RemoveItem( GetLastRemovedItem() )
// ////////////////////////////////
else
call TriggerSleepAction( 1.00 )
set a = 1
loop
exitwhen a > 6
call UnitRemoveItemFromSlotSwapped( a, udg_AttributeHero[numberp] )
call RemoveItem( GetLastRemovedItem() )
set a = a + 1
endloop
set a = ( 6 * numberp )
set b = a + 5
loop
exitwhen a > b
if ( udg_AttributeItem[a] == null ) then
call UnitAddItemByIdSwapped( 'azhr', udg_AttributeHero[numberp] )
else
call SetItemVisibleBJ( true, udg_AttributeItem[a] )
call UnitAddItemSwapped( udg_AttributeItem[a], udg_AttributeHero[numberp] )
endif
set a = a + 1
endloop
set a = 1
loop
exitwhen a > 6
if ( GetItemTypeId(UnitItemInSlotBJ(udg_AttributeHero[numberp], a)) == 'azhr' ) then
call UnitRemoveItemFromSlotSwapped( a, udg_AttributeHero[numberp] )
call RemoveItem( GetLastRemovedItem() )
endif
set a = a + 1
endloop
endif
endfunction
function Trig_Attribute_Player_Get_Event_Actions takes nothing returns nothing
call Attribute_Action( GetTriggerPlayer() )
endfunction
//===========================================================================
function InitTrig_Attribute_Player_Get_Event takes nothing returns nothing
set gg_trg_Attribute_Player_Get_Event = CreateTrigger( )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Attribute_Player_Get_Event, Player(0) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Attribute_Player_Get_Event, Player(1) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Attribute_Player_Get_Event, Player(2) )
call TriggerRegisterPlayerEventEndCinematic( gg_trg_Attribute_Player_Get_Event, Player(3) )
call TriggerAddAction( gg_trg_Attribute_Player_Get_Event, function Trig_Attribute_Player_Get_Event_Actions )
endfunction
function Trig_Attribute_Hero_Level_Up_Actions takes nothing returns nothing
local unit u = GetLevelingUnit()
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(u))
set udg_AttributeNumber[numberp] = ( udg_AttributeNumber[numberp] + 4 )
if ( GetItemTypeId(UnitItemInSlotBJ(u, 1)) == 'I018' ) then
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], 1), udg_AttributeNumber[numberp] )
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], 3), udg_AttributeNumber[numberp] )
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], 5), udg_AttributeNumber[numberp] )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Attribute_Hero_Level_Up takes nothing returns nothing
set gg_trg_Attribute_Hero_Level_Up = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Hero_Level_Up, Player(0), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Hero_Level_Up, Player(1), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Hero_Level_Up, Player(2), EVENT_PLAYER_HERO_LEVEL )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Hero_Level_Up, Player(3), EVENT_PLAYER_HERO_LEVEL )
call TriggerAddAction( gg_trg_Attribute_Hero_Level_Up, function Trig_Attribute_Hero_Level_Up_Actions )
endfunction
function Trig_Attribute_Acquire_More_Item_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), 1)) == 'I018' ) ) then
return false
endif
if ( not ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), 3)) == 'I017' ) ) then
return false
endif
if ( not ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), 5)) == 'I016' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) != 'I018' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) != 'I017' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) != 'I016' ) ) then
return false
endif
return true
endfunction
function Trig_Attribute_Acquire_More_Item_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
local item it = GetManipulatedItem()
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(u))
local location point = GetItemLoc(it)
call UnitRemoveItemSwapped( it, udg_AttributeHero[numberp] )
call SetItemPositionLoc(it,point)
call RemoveLocation(point)
set point = null
set u = null
set it = null
endfunction
//===========================================================================
function InitTrig_Attribute_Acquire_More_Item takes nothing returns nothing
set gg_trg_Attribute_Acquire_More_Item = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Acquire_More_Item, Player(0), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Acquire_More_Item, Player(1), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Acquire_More_Item, Player(2), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Acquire_More_Item, Player(3), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Attribute_Acquire_More_Item, Condition( function Trig_Attribute_Acquire_More_Item_Conditions ) )
call TriggerAddAction( gg_trg_Attribute_Acquire_More_Item, function Trig_Attribute_Acquire_More_Item_Actions )
endfunction
function Trig_Attribute_Str_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I018' ) ) then
return false
endif
return true
endfunction
function Trig_Attribute_Str_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
local integer a
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(u))
if ( udg_AttributeNumber[numberp] > 0 ) then
set udg_AttributeNumber[numberp] = ( udg_AttributeNumber[numberp] - 1 )
call ModifyHeroStat( bj_HEROSTAT_STR, udg_AttributeHero[numberp], bj_MODIFYMETHOD_ADD, 1 )
set a = 1
loop
exitwhen a > 5
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], a), udg_AttributeNumber[numberp] )
set a = a + 1
endloop
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Attribute_Str takes nothing returns nothing
set gg_trg_Attribute_Str = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Str, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Str, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Str, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Str, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Attribute_Str, Condition( function Trig_Attribute_Str_Conditions ) )
call TriggerAddAction( gg_trg_Attribute_Str, function Trig_Attribute_Str_Actions )
endfunction
function Trig_Attribute_Agi_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I017' ) ) then
return false
endif
return true
endfunction
function Trig_Attribute_Agi_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
local integer a
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(u))
if ( udg_AttributeNumber[numberp] > 0 ) then
set udg_AttributeNumber[numberp] = ( udg_AttributeNumber[numberp] - 1 )
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_AttributeHero[numberp], bj_MODIFYMETHOD_ADD, 1 )
set a = 1
loop
exitwhen a > 5
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], a), udg_AttributeNumber[numberp] )
set a = a + 1
endloop
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Attribute_Agi takes nothing returns nothing
set gg_trg_Attribute_Agi = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Agi, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Agi, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Agi, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Agi, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Attribute_Agi, Condition( function Trig_Attribute_Agi_Conditions ) )
call TriggerAddAction( gg_trg_Attribute_Agi, function Trig_Attribute_Agi_Actions )
endfunction
function Trig_Attribute_Int_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I016' ) ) then
return false
endif
return true
endfunction
function Trig_Attribute_Int_Actions takes nothing returns nothing
local unit u = GetManipulatingUnit()
local integer a
local integer numberp = GetConvertedPlayerId(GetOwningPlayer(u))
if ( udg_AttributeNumber[numberp] > 0 ) then
set udg_AttributeNumber[numberp] = ( udg_AttributeNumber[numberp] - 1 )
call ModifyHeroStat( bj_HEROSTAT_INT, udg_AttributeHero[numberp], bj_MODIFYMETHOD_ADD, 1 )
set a = 1
loop
exitwhen a > 5
call SetItemCharges( UnitItemInSlotBJ(udg_AttributeHero[numberp], a), udg_AttributeNumber[numberp] )
set a = a + 1
endloop
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Attribute_Int takes nothing returns nothing
set gg_trg_Attribute_Int = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Int, Player(0), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Int, Player(1), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Int, Player(2), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Attribute_Int, Player(3), EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Attribute_Int, Condition( function Trig_Attribute_Int_Conditions ) )
call TriggerAddAction( gg_trg_Attribute_Int, function Trig_Attribute_Int_Actions )
endfunction
function Trig_HVS_Setup_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
set g = GetUnitsInRectMatching(gg_rct_Region_Pick_Hero, null)
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( IsUnitType(f, UNIT_TYPE_HERO) == true ) then
call UnitRemoveAbilityBJ( 'Aatk', f )
call UnitRemoveAbilityBJ( 'Amov', f )
call SetUnitInvulnerable( f, true )
call ModifyHeroSkillPoints( f, bj_MODIFYMETHOD_SET, 0 )
call GroupAddUnitSimple( f, udg_HeroViewingSkillGroup )
call TriggerRegisterUnitEvent( gg_trg_HVS_Anti_Order, f, EVENT_UNIT_ISSUED_ORDER )
call TriggerRegisterUnitEvent( gg_trg_HVS_Anti_Order, f, EVENT_UNIT_SPELL_CAST )
endif
call GroupRemoveUnit(g, f)
endloop
call DestroyGroup(g)
set g = null
set f = null
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_HVS_Setup takes nothing returns nothing
set gg_trg_HVS_Setup = CreateTrigger( )
call TriggerAddAction( gg_trg_HVS_Setup, function Trig_HVS_Setup_Actions )
endfunction
function Trig_HVS_Select_Conditions takes nothing returns boolean
if ( not ( IsUnitInGroup(GetTriggerUnit(), udg_HeroViewingSkillGroup) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(PLAYER_NEUTRAL_PASSIVE) ) ) then
return false
endif
if ( not ( udg_AttributeHero[GetConvertedPlayerId(GetTriggerPlayer())] == null ) ) then
return false
endif
return true
endfunction
function Trig_HVS_Select_Actions takes nothing returns nothing
local group g = CreateGroup()
local unit f
call GroupAddGroup( udg_HeroViewingSkillGroup, g )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
if ( GetOwningPlayer(f) == GetTriggerPlayer() ) then
call SetUnitOwner( f, Player(PLAYER_NEUTRAL_PASSIVE), true )
endif
call GroupRemoveUnit(g, f)
endloop
call SetUnitOwner( GetTriggerUnit(), GetTriggerPlayer(), true )
call DestroyGroup(g)
set g = null
set f = null
endfunction
//===========================================================================
function InitTrig_HVS_Select takes nothing returns nothing
set gg_trg_HVS_Select = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(0), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(1), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(2), true )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_HVS_Select, Player(3), true )
call TriggerAddCondition( gg_trg_HVS_Select, Condition( function Trig_HVS_Select_Conditions ) )
call TriggerAddAction( gg_trg_HVS_Select, function Trig_HVS_Select_Actions )
endfunction
function Trig_HVS_Anti_Order_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() != String2OrderIdBJ("stop") ) ) then
return false
endif
return true
endfunction
function Trig_HVS_Anti_Order_Actions takes nothing returns nothing
call PauseUnit( GetTriggerUnit(), true)
call IssueImmediateOrder( GetTriggerUnit(), "stop" )
call PauseUnit(GetTriggerUnit(), false)
endfunction
//===========================================================================
function InitTrig_HVS_Anti_Order takes nothing returns nothing
set gg_trg_HVS_Anti_Order = CreateTrigger( )
call TriggerAddCondition( gg_trg_HVS_Anti_Order, Condition( function Trig_HVS_Anti_Order_Conditions ) )
call TriggerAddAction( gg_trg_HVS_Anti_Order, function Trig_HVS_Anti_Order_Actions )
endfunction