// ===========================Damage Enemies System
function FilterIsEnemy takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer)
endfunction
function DamageEnemiesArea takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns nothing
local group g = CreateGroup()
local boolexpr b = Condition(function FilterIsEnemy)
local unit t
set bj_groupEnumOwningPlayer = GetOwningPlayer(whichUnit)
call GroupEnumUnitsInRange(g, x, y, radius, b)
call DestroyBoolExpr(b)
loop
set t = FirstOfGroup(g)
exitwhen t == null
call GroupRemoveUnit(g,t)
call UnitDamageTarget(whichUnit,t,amount,attack, ranged,attackType,damageType,weaponType)
endloop
call DestroyGroup(g)
set g = null
set b = null
endfunction
// ===========================
// ===========================Local Handle Vars By: Kattana
function H2I takes handle h returns integer
return h
return 0
endfunction
// ===========================
function LocalVars takes nothing returns gamecache
if udg_Cache == null then
call FlushGameCache(InitGameCache("somename"))
set udg_Cache = InitGameCache("somename")
endif
return udg_Cache
endfunction
function SetHandleHandle takes handle subject, string name, handle value returns nothing
if value==null then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
endif
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
else
call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
if value==false then
call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
else
call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleReal takes handle subject, string name, real value returns nothing
if value==0 then
call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
else
call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function SetHandleString takes handle subject, string name, string value returns nothing
if value==null then
call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
else
call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
endif
endfunction
function GetHandleHandle takes handle subject, string name returns handle
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleLocation takes handle subject, string name returns location
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
return null
endfunction
function FlushHandleLocals takes handle subject returns nothing
call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
Name | Type | is_array | initial_value |
acdsa | group | No | |
AlchemyFailRandomInt | integer | Yes | |
angle | real | No | |
Backstabbed | unit | Yes | |
Backstabber | unit | Yes | |
Backstabtrig | trigger | Yes | |
Ber_Caster | unit | No | |
Ber_Group | group | No | |
Black_Hole | unit | No | |
Black_Hole_Group | group | No | |
Cache | gamecache | No | |
caster | unit | No | |
Caster | unit | No | |
CF_Snd | integer | No | |
Chain_Missile | unit | No | |
ChainFrost_Group | group | No | |
ChainFrost_Jumps | integer | No | |
Charge_Caster | unit | No | |
Charge_Color | real | No | |
Charge_Dummy | unit | No | |
Charge_Skill | abilcode | No | |
Charge_Target | unit | No | |
Combine_Charged_Items | boolean | No | |
Combine_Charges_Max | integer | No | |
Creep_1 | location | No | |
Creep_2 | location | No | |
Creep_3 | location | No | |
Creep_4 | location | No | |
Creep_Positions | location | Yes | |
Creep_Types | unitcode | Yes | |
Damage | unit | No | |
DarkDragon | string | Yes | |
DeathMatch | integer | Yes | |
Dis_Con | real | No | |
Distance | real | No | |
Dummy | unit | Yes | |
ED10 | integer | No | |
ED11 | integer | No | |
ED12 | integer | No | |
ED2 | integer | No | |
ED3 | integer | No | |
ED4 | integer | No | |
ED5 | integer | No | |
ED6 | integer | No | |
ED8 | integer | No | |
ED9 | integer | No | |
End_Game_If_All_Gone | boolean | No | |
FrozenThrone | integer | No | |
Game_Minutes | integer | No | |
Game_Seconds | integer | No | |
Game_Time | timer | No | |
GameMode | integer | No | |
Hero_Array | unitcode | Yes | |
Hero_Revive_Time_Factor | real | No | |
Heroes | unit | Yes | |
Heroes_All | unitcode | Yes | |
Heroes_Scourge | unitcode | Yes | |
Heroes_Sentinel | unitcode | Yes | |
Hostile_Revive_Time | real | No | |
i | integer | No | |
ImgEffect | unit | Yes | |
ItemDrop | integer | Yes | |
ItemDropCount | integer | No | |
Kills | integer | Yes | |
l | location | No | |
LastHeroStanding | force | No | |
LastTarget | unit | No | |
LeaderboardScourge | leaderboard | No | |
LeaderboardSentinel | leaderboard | No | |
LevelUp | integer | No | |
Lich | unit | No | |
Lich_Point | location | No | |
LoopCreep | integer | No | |
LoopRandom | integer | No | |
LoopSuper | integer | No | |
Max_Jumps | integer | No | |
maxTimerStored | integer | No | |
MH_Angle | real | No | |
MH_Level | integer | No | |
MH_Link | unit | Yes | |
MH_Links | integer | No | |
MH_links | unit | Yes | |
MH_Unit | unit | Yes | |
Missile | unit | Yes | |
Missile_Point | location | No | |
MODE_AllRandom_AllPick | integer | No | 1 |
MODE_Normal | integer | No | 0 |
MODE_Reverse | integer | No | 2 |
Multiboard_Clock | integer | No | |
Multiboard_ShowDeaths | boolean | No | true |
Multiboard_Spots | integer | Yes | |
NHP10 | group | No | |
NHP11 | group | No | |
NHP12 | group | No | |
NHP2 | group | No | |
NHP3 | group | No | |
NHP4 | group | No | |
NHP5 | group | No | |
NHP6 | group | No | |
NHP8 | group | No | |
NHP9 | group | No | |
Nova_Damage | abilcode | No | |
Nova_Point | location | No | |
Nova_Target | unit | No | |
Odd_Man_Out | force | No | |
Offset_Point | location | No | |
Picked_Unit_Point | location | No | |
Player | player | No | |
Player_Already_Picked | integer | Yes | |
Player_Colors | string | Yes | |
Player_Starting_Gold | integer | No | |
PlayerNames | string | Yes | |
Players | force | No | |
PlayersCount | integer | No | |
PlayersScourge | force | No | |
PlayersScourgeCount | integer | No | |
PlayersScourgePlaying | force | No | |
PlayersScourgeReverse | force | No | |
PlayersSentinel | force | No | |
PlayersSentinelCount | integer | No | |
PlayersSentinelPlaying | force | No | |
PlayersSentinelReverse | force | No | |
point | location | No | |
Point | location | No | |
point2 | location | No | |
Random_Count | integer | No | |
Random_Hero | integer | No | |
Random_Start_Pos | location | No | |
RandomData_All | integer | Yes | |
RandomData_Scourge | integer | Yes | |
RandomData_Sentinel | integer | Yes | |
RandomRune | integer | Yes | |
RandomTotal_All | integer | No | |
RandomTotal_Scourge | integer | No | |
RandomTotal_Sentinel | integer | No | |
Reaper | unit | No | |
Repick_Cost_Ammount | integer | No | |
RevivableHeroes | group | No | |
RevivableTimersWindows | timerdialog | Yes | |
Revive | location | No | |
ReviveTimers | timer | Yes | |
RiverItems | itemcode | Yes | |
RiverItemsCount | integer | No | |
RiverItemsRegions | location | Yes | |
RiverItemsRegionsCount | integer | No | |
RiverItemsTaken | boolean | Yes | |
Run_Time | integer | No | |
Rupture_Caster | unit | No | |
Rupture_Length | integer | No | |
Rupture_Level | integer | No | |
Rupture_Target | unit | No | |
Rupture_Temp_Point | location | No | |
Score_Deaths | integer | Yes | |
Score_Kills | integer | Yes | |
Seconds | integer | No | |
ShortMode_On | boolean | No | |
SkillPoints | integer | Yes | |
Sort_Board_By_Kills | boolean | No | |
StoredTimer | timer | Yes | |
StoredTimerData | integer | Yes | |
Super_Chances | integer | Yes | |
Super_Creeps | unitcode | Yes | |
Super_Creeps_On | boolean | No | |
Super_Names | string | Yes | |
Super_Regions | rect | Yes | |
Target | unit | Yes | |
Team1 | force | No | |
Team1Kills | integer | No | |
Team2 | force | No | |
Team2Kills | integer | No | |
Temp_Group | group | No | |
TEMP_point | location | Yes | |
Temp_Point | location | No | |
TempInteger | integer | No | |
TempReal | real | No | |
TheLeaderBoard | leaderboard | No | |
TheLeaderBoard1 | leaderboard | No | |
TimeofDay | integer | No | |
Total_Heroes | integer | No | |
UberMode_On | boolean | No | |
UltraShortMode_On | boolean | No | |
UnitGroup | group | No | |
Victim | unit | No | |
WorldTree | integer | No | |
XXXX | real | No |
function Trig_DestroyFX_Actions takes nothing returns nothing
local effect f=bj_lastCreatedEffect
call TriggerSleepAction( 1.00 )
call DestroyEffect(f)
set f=null
endfunction
//===========================================================================
function InitTrig_DestroyFX takes nothing returns nothing
set gg_trg_DestroyFX = CreateTrigger( )
call TriggerAddAction( gg_trg_DestroyFX, function Trig_DestroyFX_Actions )
endfunction
function Trig_Damage_Actions takes nothing returns nothing
local location dmg = GetUnitLoc(GetTriggerUnit())
if GetEventDamage() >= 1.00 then
call CreateTextTagLocBJ( I2S(R2I(GetEventDamage())), dmg, 0, 9.00, 100, 0.00, 0.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 80.00, 90.00 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 3.00 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.00 )
else
endif
call RemoveLocation(dmg)
set dmg = null
endfunction
//===========================================================================
function InitTrig_Damage takes nothing returns nothing
set gg_trg_Damage = CreateTrigger( )
call TriggerAddAction( gg_trg_Damage, function Trig_Damage_Actions )
endfunction
function Trig_Combine_Items_Conditions takes nothing returns boolean
if ( not ( GetItemCharges(GetManipulatedItem()) > 0 ) ) then
return false
endif
if ( not ( udg_Combine_Charged_Items == true ) ) then
return false
endif
return true
endfunction
function Trig_Combine_Items_Actions takes nothing returns nothing
local integer ITEMCOUNT
local integer ITEMLOOP
local integer CHARGES
local integer MAXIMUM
local item NEWITEM
local unit OURUNIT
set MAXIMUM = udg_Combine_Charges_Max
set ITEMCOUNT = 0
set ITEMLOOP = 0
set CHARGES = 0
set NEWITEM = GetManipulatedItem()
set OURUNIT = GetManipulatingUnit()
loop
exitwhen ITEMLOOP > 6
if ((GetItemTypeId(NEWITEM)) == (GetItemTypeId(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)))) then
if ((GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) + GetItemCharges(NEWITEM)) <= MAXIMUM) then
if not ( (UnitItemInSlotBJ(OURUNIT, ITEMLOOP)) == (NEWITEM)) then
set CHARGES = (GetItemCharges(UnitItemInSlotBJ(OURUNIT, ITEMLOOP))) + GetItemCharges(NEWITEM)
call SetItemCharges( UnitItemInSlotBJ(OURUNIT, ITEMLOOP), CHARGES )
call RemoveItem( NEWITEM )
set ITEMLOOP=7
endif
endif
endif
if ( ITEMLOOP < 7 ) then
set ITEMLOOP = ITEMLOOP + 1
endif
endloop
endfunction
//===========================================================================
function InitTrig_Combine_Charged_Items takes nothing returns nothing
set gg_trg_Combine_Charged_Items = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Combine_Charged_Items, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Combine_Charged_Items, Condition( function Trig_Combine_Items_Conditions ) )
call TriggerAddAction( gg_trg_Combine_Charged_Items, function Trig_Combine_Items_Actions )
endfunction
function Trig_Berserkers_Call_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04Z'
endfunction
function Berserkers_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true, IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Berserkers_Call_Actions takes nothing returns nothing
local unit v
local location l = GetUnitLoc(GetTriggerUnit())
set udg_Ber_Caster = GetTriggerUnit()
call TriggerSleepAction( 0.20 )
set v = CreateUnit( GetOwningPlayer(udg_Ber_Caster), 'n013', GetUnitX(udg_Ber_Caster), GetUnitY(udg_Ber_Caster), bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A04W', v, GetUnitAbilityLevelSwapped('A04Z', udg_Ber_Caster) )
call IssueTargetOrder( v, "innerfire", udg_Ber_Caster )
call UnitApplyTimedLife( v, 'BTLF', 1.00 )
call TriggerSleepAction( ( 1.00 + ( 0.50 * I2R(GetUnitAbilityLevelSwapped('A04Z', udg_Ber_Caster)) ) ) )
call RemoveLocation(l)
set udg_Ber_Caster = null
set l = null
set v = null
endfunction
//===========================================================================
function InitTrig_Berserkers_Call takes nothing returns nothing
set gg_trg_Berserkers_Call = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Berserkers_Call, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Berserkers_Call, Condition( function Trig_Berserkers_Call_Conditions ) )
call TriggerAddAction( gg_trg_Berserkers_Call, function Trig_Berserkers_Call_Actions )
endfunction
function Trig_Greater_Bash_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetAttacker())) == true ) ) then
return false
endif
if( not ( GetUnitAbilityLevel(GetAttacker(), 'A049' ) > 0 ) ) then
return false
endif
return GetRandomInt(1, 100) <= 25
endfunction
function GB_Destroy_Trees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Knockback takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cast = GetHandleUnit(t, "cast")
local unit targ = GetHandleUnit(t, "targ")
local real dist = GetHandleReal(t,"dist")
local real angle = GetHandleReal(t,"angle")
local location m = Location(GetUnitX(targ)+dist*CosBJ(angle),GetUnitY(targ)+dist*SinBJ(angle))
call SetUnitPositionLoc( targ, m )
call DestroyEffect(AddSpellEffectByIdLoc('A049',EFFECT_TYPE_SPECIAL,m))
call SetHandleReal(t,"dist",dist*.98)
call EnumDestructablesInCircleBJ(150.,m,function GB_Destroy_Trees)
call UnitDamageTargetBJ( cast, targ, .33, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
set t = null
set cast = null
set targ = null
call RemoveLocation(m)
set m = null
endfunction
function Trig_Greater_Bash_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit cast = GetAttacker()
local unit targ = GetTriggerUnit()
local real angle = AngleBetweenPoints(GetUnitLoc(cast), GetUnitLoc(targ))
local effect fx=AddSpecialEffectTargetUnitBJ("weapon",cast,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl")
call DestroyEffect(fx)
call UnitDamageTargetBJ( cast, targ, 25 * GetUnitAbilityLevel(cast, 'A049' ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetHandleHandle(t, "cast", cast)
call SetHandleHandle(t, "targ", targ)
call SetHandleReal(t,"dist",4.00)
call SetHandleReal(t,"angle",angle)
call DisableTrigger(GetTriggeringTrigger())
call TimerStart(t, 0.01, true, function Knockback)
call TriggerSleepAction( 0.4+( .2* I2R(GetUnitAbilityLevel(cast, 'A049'))))
call EnableTrigger(GetTriggeringTrigger())
call FlushHandleLocals(t)
set fx = null
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set cast = null
set targ = null
call RemoveLocation(GetUnitLoc(cast))
call RemoveLocation(GetUnitLoc(targ))
endfunction
//===========================================================================
function InitTrig_Greater_Bash takes nothing returns nothing
set gg_trg_Greater_Bash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Greater_Bash, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Greater_Bash, Condition( function Trig_Greater_Bash_Conditions ) )
call TriggerAddAction( gg_trg_Greater_Bash, function Trig_Greater_Bash_Actions )
endfunction
function Trig_Nether_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04A'
endfunction
function NS_Destroy_Trees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Fade_Out takes nothing returns nothing
local timer t1 = GetExpiredTimer()
local unit u = GetHandleUnit(t1,"u")
local integer i = GetHandleInt(t1,"i")
call SetUnitVertexColorBJ(u,100,100,100,i)
set i=i+1
call SetHandleInt(t1,"i",i)
set u = null
set t1 = null
endfunction
function Fade_In_Knockback takes nothing returns nothing
local timer t2 = GetExpiredTimer()
local unit u = GetHandleUnit(t2,"u")
local integer i = GetHandleInt(t2,"i")
local real dist = GetHandleReal(t2,"dist")
local real angle = GetHandleReal(t2,"angle")
local unit v = GetHandleUnit(t2, "v")
local location m = Location(GetUnitX(v)+dist*CosBJ(angle),GetUnitY(v)+dist*SinBJ(angle))
local effect fx=AddSpecialEffectTargetUnitBJ("weapon",u,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl")
call DestroyEffect(fx)
call SetUnitPositionLoc( v, m )
call DestroyEffect(AddSpellEffectByIdLoc('A049',EFFECT_TYPE_SPECIAL,m))
call SetHandleReal(t2,"dist",dist*.98)
call EnumDestructablesInCircleBJ(150.,m,function NS_Destroy_Trees)
call UnitDamageTargetBJ( u, v, .33, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitVertexColorBJ(u,100,100,100,i)
set i=i-1
call SetHandleInt(t2,"i",i)
set u = null
set t2 = null
call RemoveLocation(m)
set m = null
set fx = null
endfunction
function Fade_In takes nothing returns nothing
local timer t2 = GetExpiredTimer()
local unit u = GetHandleUnit(t2,"u")
local integer i = GetHandleInt(t2,"i")
call SetUnitVertexColorBJ(u,100,100,100,i)
set i=i-1
call SetHandleInt(t2,"i",i)
set u = null
set t2 = null
endfunction
function Trig_Nether_Strike_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit v=GetSpellTargetUnit()
local timer t1=CreateTimer()
local timer t2=CreateTimer()
local location l
local location m
local integer i = 0
call SetHandleHandle(t1,"u",u)
call SetHandleHandle(t2,"u",u)
call SetHandleHandle(t2,"v",v)
call SetHandleInt(t1,"i",i)
call UnitShareVision(v,GetOwningPlayer(u),true)
call IssueImmediateOrder(u,"halt")
call TimerStart(t1,.01,true,function Fade_Out)
call TriggerSleepAction(1)
call PauseTimer(t1)
set i = GetHandleInt(t1,"i")
call SetHandleInt(t2,"i",i)
set l=GetUnitLoc(u)
set m=GetUnitLoc(v)
call SetUnitPositionLocFacingLocBJ(u,PolarProjectionBJ(m,80.,AngleBetweenPoints(l,m)),m)
call SetUnitAnimation(u,"attack")
call IssueTargetOrderById(u,851983,v)
call UnitDamageTargetBJ(u,GetTriggerUnit(),100*I2R(GetUnitAbilityLevel(v, 'A04A' )),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
if GetUnitAbilityLevel(u, 'A049' ) > 0 then
call SetHandleReal(t2,"dist",4.00)
call SetHandleReal(t2,"angle",AngleBetweenPoints(l, m))
call UnitDamageTargetBJ( u, v, 25 * GetUnitAbilityLevel(u, 'A049' ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call TimerStart(t2,.01,true,function Fade_In_Knockback)
call TriggerSleepAction( 0.4+( .2* I2R(GetUnitAbilityLevel(u, 'A049'))))
else
call TimerStart(t2,.01,true,function Fade_In)
call TriggerSleepAction(1)
endif
call PauseTimer(t2)
call SetUnitVertexColorBJ(u,100,100,100,0)
call UnitShareVision(v,GetOwningPlayer(u),false)
call FlushHandleLocals(t1)
call FlushHandleLocals(t2)
call DestroyTimer(t1)
call DestroyTimer(t2)
call RemoveLocation(l)
call RemoveLocation(m)
set l = null
set m = null
set u = null
set v = null
set t1 = null
set t2 = null
endfunction
//===========================================================================
function InitTrig_Nether_Strike takes nothing returns nothing
set gg_trg_Nether_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nether_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nether_Strike, Condition( function Trig_Nether_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Nether_Strike, function Trig_Nether_Strike_Actions )
endfunction
function Trig_Empowering_Haste_Conditions takes nothing returns boolean
if( not( GetUnitAbilityLevelSwapped('A048', GetAttacker()) > 0 )) then
return false
endif
return IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetAttacker())) == false
endfunction
function Trig_Empowering_Haste_Actions takes nothing returns nothing
local real r=GetUnitMoveSpeed(GetAttacker())*.04*GetUnitAbilityLevelSwapped('A048',GetAttacker())
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetBJ(GetAttacker(),GetTriggerUnit(),r,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL)
call TriggerSleepAction(.2)
call EnableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Empowering_Haste takes nothing returns nothing
set gg_trg_Empowering_Haste = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Empowering_Haste, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Empowering_Haste, Condition( function Trig_Empowering_Haste_Conditions ) )
call TriggerAddAction( gg_trg_Empowering_Haste, function Trig_Empowering_Haste_Actions )
endfunction
function Trig_Charge_of_Darkness_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A047'
endfunction
function Trig_Charge_of_Darkness_Actions takes nothing returns nothing
local integer i=GetUnitAbilityLevel(GetTriggerUnit(), 'A047' )
call TriggerSleepAction(0.1)
set udg_Charge_Caster=GetTriggerUnit()
set udg_Charge_Target=GetSpellTargetUnit()
set udg_Charge_Color = 0
call CreateNUnitsAtLoc(1,'n002',GetOwningPlayer(udg_Charge_Caster),GetUnitLoc(udg_Charge_Caster),bj_UNIT_FACING)
set udg_Charge_Dummy=GetLastCreatedUnit()
if (i==1) then
call UnitAddAbility(udg_Charge_Dummy,'A05U')
set udg_Charge_Skill='A05U'
elseif (i==2) then
call UnitAddAbility(udg_Charge_Dummy,'A04D')
set udg_Charge_Skill='A04D'
elseif (i==3) then
call UnitAddAbility(udg_Charge_Dummy,'A05X')
set udg_Charge_Skill='A05X'
elseif (i==4) then
call UnitAddAbility(udg_Charge_Dummy,'A04F')
set udg_Charge_Skill='A04F'
endif
call IssueTargetOrderById(GetTriggerUnit(),851983,GetSpellTargetUnit())
call TriggerSleepAction(0.01)
call SetUnitPathing(GetTriggerUnit(),false)
call EnableTrigger(gg_trg_Charge_Attack)
call EnableTrigger(gg_trg_Charge_Color)
call EnableTrigger(gg_trg_Charge_Order)
call EnableTrigger(gg_trg_Charge_Death)
call DisableTrigger(gg_trg_Greater_Bash)
call RemoveLocation(GetUnitLoc(udg_Charge_Caster))
endfunction
//===========================================================================
function InitTrig_Charge_of_Darkness takes nothing returns nothing
set gg_trg_Charge_of_Darkness = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_of_Darkness, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Charge_of_Darkness, Condition( function Trig_Charge_of_Darkness_Conditions ) )
call TriggerAddAction( gg_trg_Charge_of_Darkness, function Trig_Charge_of_Darkness_Actions )
endfunction
function Trig_Charge_Attack_Conditions takes nothing returns boolean
return GetUnitTypeId(GetAttacker()) == 'O009'
endfunction
function Trig_Charge_Attack_Actions takes nothing returns nothing
local location l=GetUnitLoc(GetAttacker())
local unit u=GetAttacker()
call DisableTrigger(GetTriggeringTrigger())
call DisableTrigger(gg_trg_Charge_Color)
call EnableTrigger(gg_trg_Greater_Bash)
call SetUnitVertexColorBJ(u,100,100,100,0)
call AddSpecialEffectTargetUnitBJ("origin",GetTriggerUnit(),"Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl")
call CreateNUnitsAtLoc(1,'n00Y',GetOwningPlayer(u),l,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A04B')
call SetUnitAbilityLevelSwapped('A04B',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A047',u))
call UnitApplyTimedLifeBJ(2.00,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetTriggerUnit())
call TriggerSleepAction(0.5+0.5*GetUnitAbilityLevelSwapped('A047',u))
call DestroyEffect(bj_lastCreatedEffect)
call UnitRemoveAbility(GetTriggerUnit(),'B00J')
call SetUnitPathing(u,true)
call RemoveLocation(l)
set l = null
set u = null
endfunction
//===========================================================================
function InitTrig_Charge_Attack takes nothing returns nothing
set gg_trg_Charge_Attack = CreateTrigger( )
call DisableTrigger( gg_trg_Charge_Attack )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_Attack, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Charge_Attack, Condition( function Trig_Charge_Attack_Conditions ) )
call TriggerAddAction( gg_trg_Charge_Attack, function Trig_Charge_Attack_Actions )
endfunction
function Trig_Charge_Color_Actions takes nothing returns nothing
call SetUnitVertexColorBJ(udg_Charge_Caster,100,100,100,udg_Charge_Color)
set udg_Charge_Color = (udg_Charge_Color + 25)
call SetUnitPositionLoc(udg_Charge_Dummy,GetUnitLoc(udg_Charge_Caster))
endfunction
//===========================================================================
function InitTrig_Charge_Color takes nothing returns nothing
set gg_trg_Charge_Color = CreateTrigger( )
call DisableTrigger( gg_trg_Charge_Color )
call TriggerRegisterTimerEventPeriodic( gg_trg_Charge_Color, 3.00 )
call TriggerAddAction( gg_trg_Charge_Color, function Trig_Charge_Color_Actions )
endfunction
function Trig_Charge_Order_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == 'O009'
endfunction
function Trig_Charge_Order_Actions takes nothing returns nothing
call SetUnitVertexColorBJ(GetTriggerUnit(),100,100,100,0)
call DisableTrigger(GetTriggeringTrigger())
call DisableTrigger(gg_trg_Charge_Attack)
call DisableTrigger(gg_trg_Charge_Color)
call DisableTrigger(gg_trg_Charge_Death)
call RemoveUnit(udg_Charge_Dummy)
call UnitRemoveAbility(udg_Charge_Target,'B00J')
call SetUnitPathing(GetTriggerUnit(),true)
call EnableTrigger(gg_trg_Greater_Bash)
set udg_Charge_Caster = null
set udg_Charge_Target = null
set udg_Charge_Dummy = null
endfunction
//===========================================================================
function InitTrig_Charge_Order takes nothing returns nothing
set gg_trg_Charge_Order = CreateTrigger( )
call DisableTrigger( gg_trg_Charge_Order )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_Order, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_Order, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_Order, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Charge_Order, Condition( function Trig_Charge_Order_Conditions ) )
call TriggerAddAction( gg_trg_Charge_Order, function Trig_Charge_Order_Actions )
endfunction
function Trig_Charge_Death_Func001C takes nothing returns boolean
if ( ( GetTriggerUnit() == udg_Charge_Caster ) ) then
return true
endif
return GetTriggerUnit() == udg_Charge_Target
endfunction
function Trig_Charge_Death_Conditions takes nothing returns boolean
return Trig_Charge_Death_Func001C()
endfunction
function Trig_Charge_Death_Actions takes nothing returns nothing
call SetUnitVertexColorBJ(udg_Charge_Caster,100,100,100,0)
call DisableTrigger(GetTriggeringTrigger())
call DisableTrigger(gg_trg_Charge_Attack)
call DisableTrigger(gg_trg_Charge_Color)
call DisableTrigger(gg_trg_Charge_Order)
call RemoveUnit(udg_Charge_Dummy)
call UnitRemoveAbility(udg_Charge_Target,'B00J')
call SetUnitPathing(udg_Charge_Caster,true)
call EnableTrigger(gg_trg_Greater_Bash)
set udg_Charge_Caster = null
set udg_Charge_Target = null
set udg_Charge_Dummy = null
endfunction
//===========================================================================
function InitTrig_Charge_Death takes nothing returns nothing
set gg_trg_Charge_Death = CreateTrigger( )
call DisableTrigger( gg_trg_Charge_Death )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Charge_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Charge_Death, Condition( function Trig_Charge_Death_Conditions ) )
call TriggerAddAction( gg_trg_Charge_Death, function Trig_Charge_Death_Actions )
endfunction
function Trig_Sprout_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04P'
endfunction
function Trig_Sprout_Actions takes nothing returns nothing
local destructable array D
local integer i = 1
local location l = GetUnitLoc(GetTriggerUnit())
call CreateFogModifierRadiusLoc( GetOwningPlayer(GetTriggerUnit()), FOG_OF_WAR_VISIBLE, l, 1000.00,true, true )
call RemoveLocation(l)
set l = GetUnitLoc(GetSpellTargetUnit())
loop
exitwhen i > 8
call CreateDestructableLoc( 'LTlt', PolarProjectionBJ(l, 130.00, ( i * 45.00 )), GetRandomDirectionDeg(), 1, 0 )
set D[i] = GetLastCreatedDestructable()
set i = i + 1
endloop
call TriggerSleepAction( ( 2.00 + I2R(GetUnitAbilityLevelSwapped('A009', GetTriggerUnit())) ) )
set i = 1
loop
exitwhen i > bj_forLoopAIndexEnd
call KillDestructable( D[i] )
set i = i + 1
endloop
call DestroyFogModifier( GetLastCreatedFogModifier() )
call TriggerSleepAction( 3.00 )
set i = 1
loop
exitwhen i > 8
call RemoveDestructable( D[i] )
set D[i] =null
set i = i + 1
endloop
call RemoveLocation(l)
set l = null
endfunction
//===========================================================================
function InitTrig_Sprout takes nothing returns nothing
set gg_trg_Sprout = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sprout, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Sprout, Condition( function Trig_Sprout_Conditions ) )
call TriggerAddAction( gg_trg_Sprout, function Trig_Sprout_Actions )
endfunction
function Trig_Toss_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04N'
endfunction
function Toss_Unit_Group takes nothing returns boolean
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_ANCIENT) == true ) then
return false
endif
if IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) then
return false
elseif IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) then
return false
elseif GetFilterUnit() == GetSpellAbilityUnit() then
return false
elseif IsUnitDeadBJ(GetFilterUnit()) then
return false
endif
return true
endfunction
function Toss_Destroy_Trees takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function TossFX takes nothing returns nothing
local effect f= bj_lastCreatedEffect
call TriggerSleepAction(0.4)
call DestroyEffect(f)
set f=null
endfunction
function Toss_Movement takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t,"t")
local real b=GetHandleReal(t,"r")
local real n=GetHandleReal(t,"n")
local real d=GetHandleReal(t,"d")
local location l=GetHandleLocation(t,"l")
local real x=-d+(d*(b/50))
local location m=PolarProjectionBJ(l,x,n)
local real y=((b-25)*(b-25))
call SetUnitPositionLoc(u,m)
call SetUnitFlyHeight( u, ( 775-y ) , 10000.00 )
if GetRandomInt(1,4)==2 then
call AddSpecialEffectTargetUnitBJ( "origin", u, "Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl" )
call TriggerExecute(gg_trg_DestroyFX)
endif
set b=b+1
call SetHandleReal(t,"r",b)
set t=null
set u=null
set b=0
set n=0
set d=0
set l=null
set x=0
call RemoveLocation(m)
set m=null
set y=0
endfunction
function Trig_Toss_Actions takes nothing returns nothing
local group g=CreateGroup()
local unit c=GetTriggerUnit()
local unit a=null
local location l=GetSpellTargetLoc()
local timer t=null
local real b=1
local real d=0
local real n=0
call GroupEnumUnitsInRange(g,GetUnitX(c),GetUnitY(c),275,Condition(function Toss_Unit_Group))
set a=GroupPickRandomUnit(g)
call GroupClear(g)
if a!=null then
call SetUnitAnimationByIndex(c,4)
call PauseUnitBJ( true, a )
call SetUnitPathing( a, false )
call SetUnitFacingToFaceLocTimed( a, l, 0 )
call UnitAddAbilityBJ( 'A04H', a )
call UnitRemoveAbilityBJ( 'A04H', a )
set t=CreateTimer()
call SetHandleHandle(t,"t",a)
call SetHandleReal(t,"r",b)
set d = DistanceBetweenPoints(GetUnitLoc(c), l)
set n= AngleBetweenPoints(GetUnitLoc(c), l)
call SetHandleReal(t,"d",d)
call SetHandleReal(t,"n",n)
call SetHandleHandle(t,"l",l)
call TimerStart(t,0.02,true,function Toss_Movement)
call TriggerSleepAction(1.0)
call RemoveLocation(l)
set l=GetHandleLocation(t,"l")
call RemoveLocation(l)
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
call SetUnitFlyHeightBJ( a, GetUnitDefaultFlyHeight(a), 10000.00 )
call PauseUnitBJ( false, a )
call SetUnitPathing( a, true )
set l=GetUnitLoc(a)
call DestroyEffect(AddSpellEffectByIdLoc('A0BZ', EFFECT_TYPE_TARGET, l))
call TerrainDeformationRippleBJ( 0.2, true, l, 1.00, 300.00, 96.00, 1, 64.00 )
call UnitDamageTargetBJ( c, a, 38.00 * I2R(GetUnitAbilityLevelSwapped('A04N', c)) , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )
set g = GetUnitsInRangeOfLocAll(300.00, l)
loop
set a = FirstOfGroup(g)
exitwhen a == null
call GroupRemoveUnit(g,a)
call UnitDamageTargetBJ( c, a, 75.00 * I2R(GetUnitAbilityLevelSwapped('A04N', c)) , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DEMOLITION )
endloop
call EnumDestructablesInCircleBJ( 300,l , function Toss_Destroy_Trees )
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetLocationX(l),GetLocationY(l)))
endif
call DestroyGroup(g)
set g=null
set c=null
set a=null
call RemoveLocation(l)
set l=null
set t=null
set b=0
set n=0
set d=0
endfunction
//===========================================================================
function InitTrig_Toss takes nothing returns nothing
set gg_trg_Toss = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Toss, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Toss, Condition( function Trig_Toss_Conditions ) )
call TriggerAddAction( gg_trg_Toss, function Trig_Toss_Actions )
endfunction
function Trig_Omnislash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04O'
endfunction
function Unit_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitAliveBJ(GetFilterUnit()) == true, IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Omnislash_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local integer i = 0
local group UnitGroup
local unit TargetRandom
local unit Target = GetSpellTargetUnit()
local effect Phoenix
local location R
local real Damage = 100
local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A04O', Caster) * 2 )
call TriggerSleepAction( 0.20 )
call SelectUnitRemove( Caster )
call SetUnitVertexColor( Caster, 150, 150, 150, 150 )
call SetUnitInvulnerable( Caster, true )
set Phoenix = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",Caster,"weapon" )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(GetUnitLoc(Target), 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(Target)) )
call UnitDamageTarget( Caster, Target, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
loop
set i = i + 1
exitwhen i > Amount
set UnitGroup = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(Caster), Condition(function Unit_Group))
if ( IsUnitGroupEmptyBJ(UnitGroup) == false ) then
set TargetRandom = GroupPickRandomUnit(UnitGroup)
set R = GetUnitLoc(TargetRandom)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(R, 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(TargetRandom)) )
call UnitDamageTarget( Caster, TargetRandom, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call RemoveLocation ( R )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
else
endif
call DestroyGroup(UnitGroup)
endloop
call SelectUnitForPlayerSingle( Caster, GetTriggerPlayer() )
call SetUnitInvulnerable( Caster, false )
call SetUnitVertexColor( Caster, 255, 255, 255, 255 )
call DestroyEffect( Phoenix )
set Phoenix = null
set Caster = null
set UnitGroup = null
set TargetRandom = null
set Target = null
set Amount = 0
set R = null
set Damage = 0
endfunction
//===========================================================================
function InitTrig_Omnislash takes nothing returns nothing
set gg_trg_Omnislash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Omnislash, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Omnislash, Condition( function Trig_Omnislash_Conditions ) )
call TriggerAddAction( gg_trg_Omnislash, function Trig_Omnislash_Actions )
endfunction
function Trig_Freezing_Field_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04K'
endfunction
function Freezing_Field_Effects takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = GetHandleUnit(t, "caster")
local unit u
local location l = PolarProjectionBJ(GetUnitLoc(caster), GetRandomReal(50.00, 600.00), GetRandomReal(0, 360.00))
if GetUnitCurrentOrder(caster) == String2OrderIdBJ("channel") then
set u = CreateUnit(GetOwningPlayer(caster),'u00Y',GetLocationX(l),GetLocationY(l),bj_UNIT_FACING )
call SetUnitPathing( u, false )
call SetUnitAbilityLevelSwapped( 'A04J', u, GetUnitAbilityLevelSwapped('A04K', caster) )
call IssueTargetOrderBJ( u, "frostnova", u )
call UnitApplyTimedLife( u, 'BTLF', 1.00 )
endif
call RemoveLocation(l)
set t = null
set caster = null
set l = null
set u = null
endfunction
function Trig_Freezing_Field_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetTriggerUnit()
call SetHandleHandle(t, "caster", caster)
call TimerStart(t, 0.100, true, function Freezing_Field_Effects)
call TriggerSleepAction(3.00)
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Freezing_Field takes nothing returns nothing
set gg_trg_Freezing_Field = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Freezing_Field, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Freezing_Field, Condition( function Trig_Freezing_Field_Conditions ) )
call TriggerAddAction( gg_trg_Freezing_Field, function Trig_Freezing_Field_Actions )
endfunction
function Trig_Rupture_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04G'
endfunction
function Rupture_Effects takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = GetHandleUnit(t, "u")
local unit v = GetHandleUnit(t, "v")
local location l = GetHandleLocation(t,"l")
local integer i = GetHandleInt(t, "i")
call UnitDamageTargetBJ( u, v, ( ( 0.20 * i ) * DistanceBetweenPoints(GetUnitLoc(v), l) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
if UnitHasBuffBJ(v, 'B00M') == true then
if GetBooleanOr(GetLocationX(GetUnitLoc(v)) != GetLocationX(l),GetLocationY(GetUnitLoc(v)) != GetLocationY(l)) then
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",v,"chest"))
endif
endif
set l = GetUnitLoc(v)
call SetHandleHandle(t, "l", l)
set t = null
set u = null
set v = null
endfunction
function Trig_Rupture_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
local unit v = GetSpellTargetUnit()
local integer i = GetUnitAbilityLevelSwapped('A04G', u)
local location l = GetUnitLoc(v)
call SetHandleHandle(t, "u", u)
call SetHandleHandle(t, "v", v)
call SetHandleInt(t, "i", i)
call SetHandleHandle(t, "l", l)
call TimerStart(t, 0.04, true, function Rupture_Effects)
call UnitDamageTarget( u, v, ( 150.00 + ( 100.00 * ( I2R(i) - 1 ) ) ),false, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL,WEAPON_TYPE_AXE_MEDIUM_CHOP )
call TriggerSleepAction( ( 3.00 + ( 2.00 * I2R(i) ) ) )
call FlushHandleLocals(t)
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
set v = null
call RemoveLocation(l)
set l = null
endfunction
//===========================================================================
function InitTrig_Rupture takes nothing returns nothing
set gg_trg_Rupture = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rupture, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rupture, Condition( function Trig_Rupture_Conditions ) )
call TriggerAddAction( gg_trg_Rupture, function Trig_Rupture_Actions )
endfunction
function Trig_Ravage_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04L'
endfunction
function Trig_Ravage_Actions takes nothing returns nothing
local location l = GetUnitLoc(GetTriggerUnit())
local integer i = 1
local unit u
local player p = GetOwningPlayer(GetTriggerUnit())
loop
exitwhen i > 16
set u = CreateUnit( p, 'n014', GetLocationX(l), GetLocationY(l), bj_UNIT_FACING )
call SetUnitAbilityLevelSwapped( 'A04I', u, GetUnitAbilityLevelSwapped('A04L', GetTriggerUnit()) )
call IssuePointOrderLoc( u, "impale", PolarProjectionBJ(l, 100.00, ( 22.50 * i )) )
call UnitApplyTimedLife( u, 'BTLF', 1.00 )
set i = i + 1
endloop
call RemoveLocation(l)
set l = null
set p = null
set u = null
endfunction
//===========================================================================
function InitTrig_Ravage takes nothing returns nothing
set gg_trg_Ravage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ravage, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ravage, Condition( function Trig_Ravage_Conditions ) )
call TriggerAddAction( gg_trg_Ravage, function Trig_Ravage_Actions )
endfunction
function Trig_Echo_Slam_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A052'
endfunction
function Echo_Group takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Echo_Slam_Actions takes nothing returns nothing
local location l = GetUnitLoc(GetTriggerUnit())
local group g
local unit u
local unit v
call TriggerSleepAction(.25)
set g = GetUnitsInRangeOfLocMatching(500, l, Condition(function Echo_Group))
loop
set u = FirstOfGroup(g)
exitwhen u ==null
call GroupRemoveUnit(g,u)
set v = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'n013',GetUnitX(u), GetUnitY(u), bj_UNIT_FACING)
call SetUnitAbilityLevelSwapped( 'A055', v, GetUnitAbilityLevelSwapped('A052', GetTriggerUnit()) )
call IssueImmediateOrder(v,"fanofknives")
call UnitApplyTimedLife(v,'BTLF',1.00)
endloop
call RemoveLocation(l)
set l = null
call DestroyGroup(g)
set g = null
set v = null
endfunction
//===========================================================================
function InitTrig_Echo_Slam takes nothing returns nothing
set gg_trg_Echo_Slam = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Echo_Slam, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Echo_Slam, Condition( function Trig_Echo_Slam_Conditions ) )
call TriggerAddAction( gg_trg_Echo_Slam, function Trig_Echo_Slam_Actions )
endfunction
function Trig_Requim_of_Souls_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04R'
endfunction
function Req_Group takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Req_Group2 takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true,UnitHasBuffBJ(GetFilterUnit(), 'B00Q') == false )
endfunction
function Trig_Requim_of_Souls_Actions takes nothing returns nothing
local unit u
local unit v
local integer i = 1
local location m = GetUnitLoc(GetTriggerUnit())
local location l
local group g
loop
exitwhen i > 15
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'n013',GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()), bj_UNIT_FACING)
set l = PolarProjectionBJ(m,50.00,(I2R(i)*24))
call SetUnitAbilityLevelSwapped('A04T',u,GetUnitAbilityLevelSwapped('A04R',GetTriggerUnit()))
call UnitApplyTimedLife(u,'BTLF',1.00)
call IssuePointOrder(u,"carrionswarm",GetLocationX(l), GetLocationY(l))
call RemoveLocation(l)
set i = i + 1
endloop
set g = GetUnitsInRangeOfLocMatching(300, m, Condition(function Req_Group))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
set v = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'n013',GetUnitX(u),GetUnitY(u), bj_UNIT_FACING)
call UnitAddAbility(v,'A04U')
call SetUnitAbilityLevelSwapped( 'A04U', v, GetUnitAbilityLevelSwapped('A04R', GetTriggerUnit()) )
call UnitApplyTimedLife(v,'BTLF',1.00)
call IssueTargetOrder( v, "cripple", u )
endloop
call DestroyGroup(g)
call TriggerSleepAction (.1)
set g = GetUnitsInRangeOfLocMatching(500, m, Condition(function Req_Group2))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
set v = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'n013',GetUnitX(u),GetUnitY(u), bj_UNIT_FACING)
call UnitAddAbility(v,'A04X')
call SetUnitAbilityLevelSwapped( 'A04X', v, GetUnitAbilityLevelSwapped('A04R', GetTriggerUnit()) )
call UnitApplyTimedLife(v,'BTLF',1.00)
call IssueTargetOrder( v, "cripple", u )
endloop
call DestroyGroup(g)
call TriggerSleepAction (.1)
set g = GetUnitsInRangeOfLocMatching(700, m, Condition(function Req_Group2))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
set v = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'n013',GetUnitX(u),GetUnitY(u), bj_UNIT_FACING)
call UnitAddAbility(v,'A04V')
call SetUnitAbilityLevelSwapped( 'A04V', v, GetUnitAbilityLevelSwapped('A04R', GetTriggerUnit()) )
call UnitApplyTimedLife(v,'BTLF',1.00)
call IssueTargetOrder( v, "cripple", u )
endloop
call DestroyGroup(g)
set g = null
set u = null
set l = null
call RemoveLocation(m)
set m = null
set v = null
endfunction
//===========================================================================
function InitTrig_Requiem_of_Souls takes nothing returns nothing
set gg_trg_Requiem_of_Souls = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Requiem_of_Souls, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Requiem_of_Souls, Condition( function Trig_Requim_of_Souls_Conditions ) )
call TriggerAddAction( gg_trg_Requiem_of_Souls, function Trig_Requim_of_Souls_Actions )
endfunction
function Trig_Chronosphere_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04Q'
endfunction
function Chronosphere_Group takes nothing returns boolean
return ( GetFilterUnit() != GetTriggerUnit() )
endfunction
function Trig_Chronosphere_Actions takes nothing returns nothing
local integer i=GetUnitAbilityLevel(GetTriggerUnit(),'A04Q')
local unit u
local unit v
local real r=1.5+(i*1.5)
local timer t=CreateTimer()
local location l=GetSpellTargetLoc()
local group g
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u00V',GetLocationX(l),GetLocationY(l),bj_UNIT_FACING)
call TriggerSleepAction (0.3)
call UnitApplyTimedLife(u,'BTLF',r)
call SetUnitTimeScalePercent(u,0.00)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
call StartTimerBJ(t,false,r)
loop
exitwhen TimerGetRemaining(t)<=0.0
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,true)
call SetUnitTimeScalePercent(v,0.00)
endloop
if (TimerGetRemaining(t)<0.8) then
call TriggerSleepAction(0.1)
else
call TriggerSleepAction(0.3)
endif
call DestroyGroup(g)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
endloop
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,false)
call SetUnitTimeScalePercent(v,100.00)
endloop
call DestroyTimer(t)
set u = null
call RemoveLocation(l)
set l = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Chronosphere takes nothing returns nothing
set gg_trg_Chronosphere = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chronosphere, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chronosphere, Condition( function Trig_Chronosphere_Conditions ) )
call TriggerAddAction( gg_trg_Chronosphere, function Trig_Chronosphere_Actions )
endfunction
function Black_Hole_Conditions takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit()) == 'u00X'
endfunction
function Black_Hole_Effects takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = GetHandleUnit(t, "u")
local unit v = GetHandleUnit(t, "v")
local unit w
local location l = GetUnitLoc(v)
local location m
local group g = GetUnitsInRangeOfLocAll(400.00, l)
loop
set w = FirstOfGroup(g)
exitwhen w == null
call GroupRemoveUnit(g,w)
if IsUnitEnemy(w, GetOwningPlayer(v)) == true then
set m = GetUnitLoc(w)
call SetUnitPositionLoc( w, PolarProjectionBJ(l, ( DistanceBetweenPoints(l, m) - 3.00 ), AngleBetweenPoints(l, m)) )
call RemoveLocation(m)
endif
endloop
set u = null
set v = null
set m = null
call RemoveLocation(l)
set l = null
call DestroyGroup(g)
set g = null
endfunction
function Black_Hole_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
local unit v = GetSummonedUnit()
call SetHandleHandle(t, "u", u)
call SetHandleHandle(t, "v", v)
call TimerStart(t, 0.05, true, function Black_Hole_Effects)
call TriggerSleepAction(4)
call FlushHandleLocals(t)
call DestroyTimer(t)
set u = null
set v = null
endfunction
//===========================================================================
function InitTrig_Black_Hole takes nothing returns nothing
set gg_trg_Black_Hole = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Black_Hole, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Black_Hole, Condition( function Black_Hole_Conditions ) )
call TriggerAddAction( gg_trg_Black_Hole, function Black_Hole_Actions )
endfunction
function Trig_Scatter_Shot_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A054'
endfunction
function Trig_Scatter_Shot_Actions takes nothing returns nothing
local location Target = GetSpellTargetLoc()
local unit Caster = GetTriggerUnit()
local player CasterOwner = GetOwningPlayer(Caster)
local integer i = 1
local location Random
local unit Dummy
local integer ScatterAmount = 4 + ( 4 * GetUnitAbilityLevelSwapped('A054', Caster) )
call TriggerSleepAction( 0.25 )
loop
exitwhen i > ScatterAmount
set Dummy = CreateUnit (CasterOwner,'e00H',GetUnitX(Caster),GetUnitY(Caster),bj_UNIT_FACING)
set Random = PolarProjectionBJ(Target,GetRandomDirectionDeg(),GetRandomDirectionDeg())
call IssuePointOrder(Dummy, "attackground", GetLocationX(Random),GetLocationY(Random) )
call RemoveLocation ( Random )
call UnitApplyTimedLife( Dummy, 'BTLF', 0.50 )
set i = i + 1
endloop
call RemoveLocation( Target )
set Target = null
set Random = null
set Caster = null
set Dummy = null
set CasterOwner = null
endfunction
//===========================================================================
function InitTrig_Scatter_Shot takes nothing returns nothing
set gg_trg_Scatter_Shot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Scatter_Shot, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Scatter_Shot, Condition( function Trig_Scatter_Shot_Conditions ) )
call TriggerAddAction( gg_trg_Scatter_Shot, function Trig_Scatter_Shot_Actions )
endfunction
function Trig_March_of_The_Machines_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A05F'
endfunction
function Trig_March_of_The_Machines_Actions takes nothing returns nothing
local location l = GetUnitLoc(GetTriggerUnit())
local location m = GetSpellTargetLoc()
local unit u
set u = CreateUnit( GetOwningPlayer(GetTriggerUnit()), 'n015', GetLocationX(l), GetLocationY(l), bj_UNIT_FACING)
call SetUnitAbilityLevelSwapped( 'A05C', u, GetUnitAbilityLevelSwapped('A05F', GetTriggerUnit()) )
call IssuePointOrder( u, "stampede", GetLocationX(m), GetLocationY(m) )
call RemoveLocation(l)
set l = null
call RemoveLocation(m)
set m = null
set u = null
endfunction
//===========================================================================
function InitTrig_March_of_The_Machines takes nothing returns nothing
set gg_trg_March_of_The_Machines = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_March_of_The_Machines, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_March_of_The_Machines, Condition( function Trig_March_of_The_Machines_Conditions ) )
call TriggerAddAction( gg_trg_March_of_The_Machines, function Trig_March_of_The_Machines_Actions )
endfunction
function Trig_Burrowstrike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A05D'
endfunction
function Trig_Burrowstrike_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitAbilityLevelSwapped('A05D', u)
local location l = GetUnitLoc(u)
local location m = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'n015', GetOwningPlayer(u), PolarProjectionBJ(l, -100.00, AngleBetweenPoints(l, m)), GetUnitFacing(u) )
if i==1 then
call UnitAddAbility( GetLastCreatedUnit(), 'A058' )
call SetUnitAbilityLevelSwapped( 'A058', GetLastCreatedUnit(), ( R2I(DistanceBetweenPoints(l, m)) / 100 ) )
else
if i==2 then
call UnitAddAbility( GetLastCreatedUnit(), 'A059' )
call SetUnitAbilityLevelSwapped( 'A059', GetLastCreatedUnit(), ( R2I(DistanceBetweenPoints(l, m)) / 100 ) )
else
if i==3 then
call UnitAddAbility( GetLastCreatedUnit(), 'A05B' )
call SetUnitAbilityLevelSwapped( 'A05B', GetLastCreatedUnit(), ( R2I(DistanceBetweenPoints(l, m)) / 100 ) )
else
call UnitAddAbility( GetLastCreatedUnit(), 'A05A' )
call SetUnitAbilityLevelSwapped( 'A05A', GetLastCreatedUnit(), ( R2I(DistanceBetweenPoints(l, m)) / 100 ) )
endif
endif
endif
call IssuePointOrder( GetLastCreatedUnit(), "impale", GetLocationX(m),GetLocationY(m) )
call TriggerSleepAction( ( DistanceBetweenPoints(l, m) / 4000.00 ) )
call SetUnitPositionLoc( u, m )
call SetUnitAnimation( u, "morph ALTERNATE" )
set u = null
call RemoveLocation(l)
call RemoveLocation(m)
set l = null
set m = null
endfunction
//===========================================================================
function InitTrig_Burrowstrike takes nothing returns nothing
set gg_trg_Burrowstrike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Burrowstrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Burrowstrike, Condition( function Trig_Burrowstrike_Conditions ) )
call TriggerAddAction( gg_trg_Burrowstrike, function Trig_Burrowstrike_Actions )
endfunction
function Trig_Diabolic_Edict_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A05E'
endfunction
function Diabolic_Edict_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true, IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Diabolic_Edict_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer i = GetUnitAbilityLevelSwapped('A05E', u)
local location l
local timer t = CreateTimer()
local unit v
call StartTimerBJ(t,false, 8)
loop
exitwhen TimerGetRemaining(t) <= 0.00
set l = GetUnitLoc(u)
set v = GroupPickRandomUnit(GetUnitsInRangeOfLocMatching(500.00, l, Condition(function Diabolic_Edict_Group)))
call DestroyEffect( AddSpecialEffectTarget( "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl", v, "chest" ))
call UnitDamageTarget( u, v, 12.5*i, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call RemoveLocation(l)
call TriggerSleepAction(.2)
endloop
call DestroyTimer(t)
set t = null
set u = null
set l = null
set v = null
endfunction
//===========================================================================
function InitTrig_Diabolic_Edict takes nothing returns nothing
set gg_trg_Diabolic_Edict = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Diabolic_Edict, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Diabolic_Edict, Condition( function Trig_Diabolic_Edict_Conditions ) )
call TriggerAddAction( gg_trg_Diabolic_Edict, function Trig_Diabolic_Edict_Actions )
endfunction
function Trig_Time_Walk_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A057'
endfunction
function Time_Walk_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true, IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Time_Walk_Move takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=GetHandleUnit(t,"u")
local location m=GetUnitLoc(u)
local location l=GetHandleLocation(t,"l")
local real r=GetHandleReal(t,"r")
local real s=AngleBetweenPoints(m,l)
local location n=PolarProjectionBJ(m,r/40,s)
local unit v
local group g
if(DistanceBetweenPoints(n,l)>5.) then
call SetUnitPositionLoc(u,n)
else
set v=CreateUnit(GetOwningPlayer(u),'n015',GetLocationX(n),GetLocationY(n),bj_UNIT_FACING)
call SetUnitAbilityLevelSwapped('A056',v,GetUnitAbilityLevel(u,'A057'))
call UnitApplyTimedLife(v,'BTLF',2)
set g= GetUnitsInRangeOfLocMatching(300.00,l,Condition(function Time_Walk_Group))
call SetUnitPathing(v,false)
call SetUnitInvulnerable(v,true)
call IssueImmediateOrderById(v,852096)
loop
set v=FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl",v,"origin"))
endloop
call SetUnitPathing(u,true)
call ResetUnitAnimation(u)
call SetUnitInvulnerable(u,false)
call SetUnitVertexColorBJ(u,0,255,150,.0)
call ClearSelectionForPlayer(GetOwningPlayer(u))
call SelectUnitAddForPlayer(u,GetOwningPlayer(u))
call PauseTimer(t)
call TriggerSleepAction(.01)
call DestroyTimer(t)
endif
call DestroyGroup(g)
set g = null
set v = null
call RemoveLocation(m)
set m = null
call RemoveLocation(n)
set n = null
set u = null
set t = null
endfunction
function Trig_Time_Walk_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local location l=GetSpellTargetLoc()
local location m=GetUnitLoc(u)
local real r = DistanceBetweenPoints(l,m)
local timer t=CreateTimer()
call SetHandleHandle(t,"u",u)
call SetHandleHandle(t,"l",l)
call SetHandleReal(t,"r",r)
call SetUnitAnimation(u,"Walk")
call SetUnitPathing(u,false)
call SetUnitInvulnerable(u,true)
call SetUnitVertexColorBJ(u,0,0,0,25.)
call TimerStart(t,.01,true,function Time_Walk_Move)
call TriggerSleepAction(2)
call SetUnitPathing(u,true)
call ResetUnitAnimation(u)
call SetUnitInvulnerable(u,false)
call SetUnitVertexColorBJ(u,0,255,150,.0)
call ClearSelectionForPlayer(GetOwningPlayer(u))
call SelectUnitAddForPlayer(u,GetOwningPlayer(u))
call RemoveLocation(l)
call RemoveLocation(m)
set l = null
set m = null
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_Time_Walk takes nothing returns nothing
set gg_trg_Time_Walk = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Walk, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Time_Walk, Condition( function Trig_Time_Walk_Conditions ) )
call TriggerAddAction( gg_trg_Time_Walk, function Trig_Time_Walk_Actions )
endfunction
//-------------------------------------------------------------------------------
//Conditions:
//-------------------------------------------------------------------------------
constant function Backstab_Dmg takes nothing returns real
return 35.00 // Damage the backstab will do (35.00 * level of spell + 25)
endfunction
//-------------------------------------------------------------------------------
function backstabability takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A04C', GetAttacker()) >= 1 ) ) then // change 'A04C' to the spell id of your ability
return false
endif
return true
endfunction
//-------------------------------------------------------------------------------
//Actions:
//-------------------------------------------------------------------------------
function PushData takes nothing returns integer
local integer i = 0
loop
exitwhen i > 8192
if(udg_Backstabtrig[i]== null) then
return i
endif
set i= i + 1
endloop
return -1
endfunction
function getIndex takes trigger t returns integer
local integer i = 0
loop
exitwhen i > 8192
if (t == udg_Backstabtrig[i]) then
return i
endif
set i= i + 1
endloop
return -1
endfunction
function backstabber takes nothing returns nothing
local texttag dmgtext
local location x
local real face1
local real face2
local real damage
local unit attacker
local integer idx = getIndex(GetTriggeringTrigger())
if(idx != -1) then
call DestroyTrigger(udg_Backstabtrig[idx])
set udg_Backstabtrig[idx] = null
set attacker = udg_Backstabber[idx]
set face1 = GetUnitFacing(GetEventDamageSource())
set face2 = GetUnitFacing(GetTriggerUnit())
if (face1 <= ( face2 + 60.00 ) ) then
if (face1 >= ( face2 - 60.00 ) ) then
set x = GetUnitLoc(GetTriggerUnit())
if ( GetEventDamageSource() == attacker ) then
call UnitDamageTargetBJ( attacker, GetTriggerUnit(), ( Backstab_Dmg()*GetUnitAbilityLevelSwapped('A04C', attacker)+25 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
// Change the damage types to suit your unit, this is currently set to hero damage.
set damage = (Backstab_Dmg()*GetUnitAbilityLevelSwapped('A04C', attacker)+25 )
call CreateTextTagUnitBJ((I2S(R2I(damage)) + "!" ), GetTriggerUnit(), 10.00, 10, 100, 0.00, 0.00, 0 )
set dmgtext = GetLastCreatedTextTag()
call SetTextTagVelocityBJ( dmgtext, 64, 90 )
call PolledWait(1.5)
call DestroyTextTag(dmgtext)
else
return
endif
endif
endif
endif
call RemoveLocation(x)
endfunction
function unitattack takes nothing returns nothing
local integer i = PushData()
if(i!= -1)then
set udg_Backstabtrig[i] = CreateTrigger()
set udg_Backstabber[i] = GetAttacker()
set udg_Backstabbed[i] = GetAttackedUnitBJ()
call TriggerRegisterUnitEvent(udg_Backstabtrig[i], udg_Backstabbed[i], EVENT_UNIT_DAMAGED)
call TriggerAddAction(udg_Backstabtrig[i], function backstabber)
endif
endfunction
//===========================================================================
function InitTrig_backstab takes nothing returns nothing
set gg_trg_backstab = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_backstab, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_backstab, Condition( function backstabability ) )
call TriggerAddAction( gg_trg_backstab, function unitattack )
endfunction
//Used Globals - that need to be in every map
//globals
// trigger gg_trg_Chain_Frost_jass = null
// unit udg_LastTarget = null
// timer array udg_StoredTimer
// integer array udg_StoredTimerData
// integer udg_maxTimerStored = -1
//endglobals
//========================
//User own stile settings:
//========================
//Boolean type function which returns shuld chain frost use custom sounds
constant function UseSounds takes nothing returns boolean
//Set TRUE to use custom sounds or FALSE to disable custom sounds
//Note: You can use this even if you have slow computer
//Default: TRUE
return TRUE
endfunction
//Boolean type function which returns shuld chain frost use custom graphics
constant function UsingGraphics takes nothing returns boolean
//Set TRUE to use custom graphics or FALSE to disable custom graphics
//Note: You can use this even if you have slow computer
//Default: TRUE
return TRUE
endfunction
//====---==== End user setup ====---====\\
//==== ** ==== ** === ** ===
//Note: You need to edit this raw codes to match your map
//If you dont knowe your raw code in map, follow this steps:
//1. Go to object editor. Hotkey(F6)
//2. Find the spell or unit you copyed.
//3. Press Ctrl + D
//4. Now you will see raw data.
//For any needed object here find raw code in object editor
//One more thing on custom unit you will see 2x raw code
//The raw code of custom unit and the raw code of unit he whos created
//Use always first raw code
//==== ** ==== ** === ** ===
//--- Raw Codes ---
//--- Chain Frost Raw Code --- Needed raw code ---
constant function CF_RawCode takes nothing returns integer
return 'A05O'
endfunction
//--- Chain Frost Upg Raw Code --- Needed raw code ---
constant function CFU_RawCode takes nothing returns integer
return 'A05P'
endfunction
//--- Dummy Raw Code --- Needed raw code ---
constant function Dum_RawCode takes nothing returns integer
return 'u010'
endfunction
//--- Missile Raw Code --- Needed raw code ---
constant function Mis_RawCode takes nothing returns integer
return 'u00Z'
endfunction
//--- Missile Graphics Raw Code --- Needed raw code ---
constant function Grp_RawCode takes nothing returns integer
return 'u011'
endfunction
//--- Damage lvl 1 Raw Code --- Needed raw code ---
constant function DL1_RawCode takes nothing returns integer
return 'A002'
endfunction
//--- Damage lvl 2 Raw Code --- Needed raw code ---
constant function DL2_RawCode takes nothing returns integer
return 'A05K'
endfunction
//--- Damage lvl 3 Raw Code --- Needed raw code ---
constant function DL3_RawCode takes nothing returns integer
return 'A05L'
endfunction
//--- Damage lvl 4 Raw Code --- Needed raw code ---
constant function DL4_RawCode takes nothing returns integer
return 'A05M'
endfunction
//--- Locus Raw Code --- This is constant raw code ---
constant function Loc_RawCode takes nothing returns integer
return 'Aloc'
endfunction
//--- Generic Timer Raw Code --- This is constant raw code ---
constant function GT_RawCode takes nothing returns integer
return 'BTLF'
endfunction
//============================================
//--- Conversion Functions --- Integer Main
//============================================
//*** Unit to Integer
function U2I takes unit u returns integer
return u
return 0
endfunction
//*** Integer to Unit
function I2U takes integer i returns unit
return i
return null
endfunction
//*** Group to Integer
function G2I takes group g returns integer
return g
return 0
endfunction
//*** Integer to Group
function I2G takes integer i returns group
return i
return null
endfunction
//===================================================================================
//Functions
//--- Returns angle bettwen coordinates ( points )
function AngleBetweenCoord takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG * Atan2( y2 - y1, x2 - x1 )
endfunction
//Polar Projection X
function PolarProjectionX takes real x, real dist, real angle returns real
return x + dist * Cos( angle * bj_DEGTORAD )
endfunction
//Polar Projection Y
function PolarProjectionY takes real y, real dist, real angle returns real
return y + dist * Sin( angle * bj_DEGTORAD )
endfunction
//Returns Disatance between coordiantes ( points )
function DistanceBetweenCoord takes real x1, real y1, real x2, real y2 returns real
local real x = x2-x1
local real y = y2-y1
return SquareRoot( x*x + y*y )
endfunction
//--- Checks is unit invulnerable
function GetDamageFactorEx takes unit whichUnit returns real
local unit dummy
local real life = GetUnitState(whichUnit, UNIT_STATE_LIFE)
local real x = GetCameraBoundMinX() + 100
local real y = GetCameraBoundMinY() + 100
set dummy = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), Dum_RawCode(), x, y, 0 )
call UnitAddAbility( dummy, Loc_RawCode() )
call UnitApplyTimedLife( dummy, GT_RawCode(), 0.25 )
call UnitDamageTarget( dummy, whichUnit, 0.01, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
set dummy = null
set x = 0.00
set y = 0.00
return life - GetUnitState(whichUnit, UNIT_STATE_LIFE)
endfunction
//Used for storing timer data
function SetUserTimerData takes timer whichTimer, integer data returns nothing
local integer i = 0
loop
exitwhen i > udg_maxTimerStored
if ( whichTimer == udg_StoredTimer[i] ) then
set udg_StoredTimerData[i] = data
return
endif
set i = i + 1
endloop
set udg_maxTimerStored = udg_maxTimerStored + 1
if ( udg_maxTimerStored > JASS_MAX_ARRAY_SIZE ) then
set udg_maxTimerStored = udg_maxTimerStored - 1
return
endif
set udg_StoredTimer[udg_maxTimerStored] = whichTimer
set udg_StoredTimerData[udg_maxTimerStored] = data
endfunction
//Returns timer data
function GetUserTimerData takes timer whichTimer returns integer
local integer i = 0
loop
exitwhen i > udg_maxTimerStored
if ( udg_StoredTimer[i] == whichTimer ) then
return udg_StoredTimerData[i]
endif
set i = i + 1
endloop
return 0
endfunction
//Clears timer data
function ClearUserTimerData takes timer whichTimer, boolean destroyTimer returns nothing
local integer i = 0
local boolean changeData = false
loop
exitwhen i > udg_maxTimerStored
if ( udg_StoredTimer[i] == whichTimer and changeData == false ) then
set changeData = true
if ( destroyTimer ) then
call DestroyTimer(whichTimer)
endif
set udg_StoredTimer[i] = null
set udg_StoredTimerData[i] = 0
endif
if ( changeData and udg_StoredTimer[i+1] != null ) then
set udg_StoredTimer[i] = udg_StoredTimer[i+1]
set udg_StoredTimerData[i] = udg_StoredTimerData[i+1]
elseif ( changeData and udg_StoredTimer[i+1] == null ) then
set udg_StoredTimer[i] = null
set udg_StoredTimerData[i] = 0
set udg_maxTimerStored = i - 1
endif
set i = i + 1
endloop
endfunction
//PlaySoundEx plays sound using coordintes ( 3D sounds must get positioned )
function PlaySoundEx takes sound soundHandle, real x, real y, real z, boolean kill returns nothing
call StopSound( soundHandle, false, false )
call SetSoundPosition( soundHandle, x, y, z )
call StartSound( soundHandle )
if ( kill ) then
call KillSoundWhenDone( soundHandle )
endif
endfunction
// ===== End Functions ======
//Main Condition
function IsChainFrostCasted takes nothing returns boolean
//Check if ability is cast "chain frost" or "chain frost upgraded(scepter)"
return GetSpellAbilityId() == CF_RawCode() or GetSpellAbilityId() == CFU_RawCode()
endfunction
//--- Chain Frost Group ---
function Chain_Frost_group takes nothing returns boolean
return ((IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false) and (IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false) and (IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false) and (IsUnitVisible(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true) and (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true) and (GetUnitState( GetFilterUnit(), UNIT_STATE_LIFE ) > 0) and (GetDamageFactorEx( GetFilterUnit() ) != 0) and (udg_LastTarget != GetFilterUnit()) )
endfunction
//Returns random unit
function GroupGiveRandomUnit takes nothing returns nothing
local unit u = GetEnumUnit()
set bj_groupRandomConsidered = bj_groupRandomConsidered + 1
if ( GetRandomInt( 1, bj_groupRandomConsidered ) == 1 ) then
set bj_groupRandomCurrentPick = u
endif
set u = null
endfunction
//**** ****
//Graphics Main Function
//**** ****
function GraphicsMove takes nothing returns nothing
local unit u = GetEnumUnit()
local real angle = GetUnitFacing(u)
//Moves picked graphics using speed of 200
call SetUnitPosition( u, PolarProjectionX( GetUnitX(u), 2., angle ), PolarProjectionY( GetUnitY(u), 2., angle ) )
endfunction
function GraphicsKill takes nothing returns nothing
//Kill units insted of remove because of effects
call KillUnit( GetEnumUnit() )
endfunction
function GraphicsMain takes nothing returns nothing
local timer t = GetExpiredTimer()
local group g = I2G(GetUserTimerData(t))
local unit u = FirstOfGroup(g)
local integer exec = GetUnitUserData(u)+1
call SetUnitUserData( u, exec )
if exec == 100 then
call ForGroup( g, function GraphicsKill )
call ClearUserTimerData( t, true )
call DestroyGroup(g)
return
endif
call ForGroup( g, function GraphicsMove )
endfunction
//Missile Move Timer
function SetMissileXY takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit dummy = I2U(GetUserTimerData(t))
local unit missile = I2U(GetUnitUserData(dummy))
local unit target = I2U(GetUnitUserData(missile))
local real missileSpeed = 800
local real timerSpeed = 0.01
local real speed = missileSpeed * timerSpeed //Speed * timer speed (8) Default
local real x = GetUnitX(missile)
local real y = GetUnitY(missile)
local real x2 = GetUnitX(target)
local real y2 = GetUnitY(target)
local real angle = AngleBetweenCoord( x, y, x2, y2 )
local real distance = 0.
set x = PolarProjectionX( x, speed, angle )
set y = PolarProjectionY( y, speed, angle )
call SetUnitPosition( missile, x, y )
call SetUnitFacing( missile, angle )
set distance = DistanceBetweenCoord( x, y, x2, y2 )
if ( distance <= 30 ) then
call ClearUserTimerData( t, true )
call RemoveUnit(missile)
//Quick blow ( precious timer ) if it did not
//there is debug after polledwait
call IssueTargetOrder( dummy, "frostnova", target )
//Nuls
set dummy = null
set missile = null
set target = null
endif
set t = null
set speed = 0.00
set angle = 0.00
set x = 0.00
set y = 0.00
set x2 = 0.00
set y2 = 0.00
set distance = 0.00
endfunction
//Main Trigger Actions
function Trig_Chain_Frost_jass_Actions takes nothing returns nothing
//Local variables declaire
local unit caster //Spell caster
local real x //Coordinate X
local real y //Coordinate Y
local real z //Z (height) is used only by sounds
local unit target //Spell target / chain target
local integer jumps //Current jumps in game
local integer max_jumps //Max spell jumps
local integer i //Loop index i
local integer frost_damage //Spell damage
local unit missile //Chain missile
local group frost_group //Random units in radius ( taken from this group )
local unit dummy //Dummy unit hurter
local real distance //Distance between target and last target
local real height //Needed hight for missile
local real raise //Raise time for missile to get hight using distance
local player p //Player owner of caster (u)
local real angle //Angle used to make dummy facing
local boolexpr bx //BooleanExpresion for Filter function used by frost_group
local timer t //Timer which moves missile
local real sleep //Used in PolledWait for max precius sleep
local real missileFlyHeight //Constant missile fly height //Default: 30
local real missileSpeed //Constant missile speed //Default: 800
local real timerSpeed //Constant missile timer move speed //Default: 0.01
local sound frost_blow //Frost blow sound
local sound field_snd //Frost field sound
local sound missile_fly //Missile fly sound
local sound spell_start //Spell start sound
local group grp_group //Graphics group
local unit grpU //Graphics unit
local terraindeformation td //Used in custom graphics ( this var is not needed ) you can call funct directly
//Init sounds
if ( UseSounds() ) then
set frost_blow = CreateSound( "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget1.wav", false, true, true, 10, 10, "DefaultEAXON" )
call SetSoundDuration( frost_blow, 2904 )
call SetSoundVolume( frost_blow, 110 )
call SetSoundPitch( frost_blow, 0.8 )
call SetSoundChannel( frost_blow, 0 )
set field_snd = CreateSound( "Abilities\\Spells\\NightElf\\Barkskin\\BarkSkinTarget1.wav", false, true, true, 10, 10, "DefaultEAXON" )
call SetSoundDuration( field_snd, 2669 )
call SetSoundVolume( field_snd, 110 )
call SetSoundPitch( field_snd, 0.7 )
call SetSoundChannel( field_snd, 0 )
set missile_fly = CreateSound( "Abilities\\Spells\\NightElf\\FaerieDragonInvis\\PhaseShift1.wav", false, true, true, 10, 10, "DefaultEAXON" )
call SetSoundDuration( missile_fly, 1251 )
call SetSoundVolume( missile_fly, 80 )
call SetSoundPitch( missile_fly, 0.7 )
call SetSoundChannel( missile_fly, 0 )
set spell_start = CreateSound( "Abilities\\Spells\\Other\\BreathOfFrost\\BreathOfFrost1.wav", false, true, true, 10, 10, "DefaultEAXON" )
call SetSoundDuration( spell_start, 2235 )
call SetSoundVolume( spell_start, 90 )
call SetSoundPitch( spell_start, 0.9 )
call SetSoundChannel( spell_start, 0 )
endif
//Init start vars value
set caster = GetTriggerUnit()
set x = GetUnitX(caster)
set y = GetUnitY(caster)
set target = GetSpellTargetUnit()
set p = GetOwningPlayer(caster)
set z = 0
set missileFlyHeight = 30
set missileSpeed = 800
set timerSpeed = 0.01
//Play chain frost start sound
if ( UseSounds() ) then
call PlaySoundEx( spell_start, x, y, z, true )
endif
//Get jumps and max_jumps
if ( GetSpellAbilityId() == CF_RawCode() ) then
set jumps = 6
else
set jumps = 7
endif
set max_jumps = jumps
//Get level damage
if ( GetUnitAbilityLevel( caster, CF_RawCode() ) == 1 ) then
set frost_damage = DL1_RawCode()
elseif ( ( GetUnitAbilityLevel( caster, CF_RawCode() ) == 2 ) or ( GetUnitAbilityLevel( caster, CFU_RawCode() ) == 1 ) ) then
set frost_damage = DL2_RawCode()
elseif ( ( GetUnitAbilityLevel( caster, CF_RawCode() ) == 3 ) or ( GetUnitAbilityLevel( caster, CFU_RawCode() ) == 2 ) ) then
set frost_damage = DL3_RawCode()
else
set frost_damage = DL4_RawCode()
endif
//Jumps loop main
loop
exitwhen jumps < 1
set jumps = jumps - 1
set frost_group = CreateGroup()
//Load missile / pick random nerby unit
if ( jumps + 1 == max_jumps ) then
set missile = CreateUnit( p, Mis_RawCode(), x, y, AngleBetweenCoord( x, y, GetUnitX(target), GetUnitY(target) ) )
else
set x = GetUnitX(target)
set y = GetUnitY(target)
set bx = Filter( function Chain_Frost_group )
set udg_LastTarget = target
call GroupEnumUnitsInRange( frost_group, x, y, 550, bx )
set udg_LastTarget = null
call DestroyBoolExpr( bx )
set bj_groupRandomConsidered = 0
call ForGroup( frost_group, function GroupGiveRandomUnit )
set target = bj_groupRandomCurrentPick
call DestroyGroup(frost_group)
//End trigger if there is no target
if ( target == null or GetUnitState( target, UNIT_STATE_LIFE ) <= 0 ) then
set jumps = 0
set max_jumps = 0
set distance = 0.00
set x = 0.00
set y = 0.00
set p = null
set caster = null
set target = null
set frost_damage = 0
set missileFlyHeight = 0.00
set missileSpeed = 0.00
set timerSpeed = 0.00
set i = 0
call KillSoundWhenDone( frost_blow )
call KillSoundWhenDone( field_snd )
call KillSoundWhenDone( missile_fly )
return
endif
set missile = CreateUnit( p, Mis_RawCode(), x, y, AngleBetweenCoord( x, y, GetUnitX(target), GetUnitY(target) ) )
if ( height > 30. ) then
call SetUnitFlyHeight( missile, height, 0. )
endif
set missileFlyHeight = GetUnitFlyHeight(missile)
endif
//Play missile sound
if ( UseSounds() ) then
set height = GetUnitFlyHeight(target)
if ( height > missileFlyHeight ) then
set z = ( height / 2 ) + ( missileFlyHeight / 2 )
else
set z = missileFlyHeight
endif
call PlaySoundEx( missile_fly, x, y, z, false )
set height = 0.00
set z = 0.00
endif
//Play field sound
if ( UseSounds() ) then
set distance = DistanceBetweenCoord( x, y, GetUnitX(target), GetUnitY(target) ) / 2
set x = PolarProjectionX( x, distance, AngleBetweenCoord( x, y, GetUnitX(target), GetUnitY(target) ) )
set y = PolarProjectionY( y, distance, AngleBetweenCoord( GetUnitX(missile), y, GetUnitX(target), GetUnitY(target) ) )
call PlaySoundEx( field_snd, x, y, z, false )
endif
//Prepare to move missile and dummy load + other stuff
call UnitAddAbility( missile, Loc_RawCode() )
set x = GetUnitX(target)
set y = GetUnitY(target)
set distance = DistanceBetweenCoord( x, y, GetUnitX(missile), GetUnitY(missile) )
call UnitApplyTimedLife( missile, GT_RawCode(), distance / 800 ) // To reduce bugs
//Terrain Deformation ( graphics setup )
if ( UsingGraphics() ) then
set td = TerrainDeformWave( GetUnitX(missile), GetUnitY(missile), x, y, distance, missileSpeed, 70, 50, R2I(distance / missileSpeed), 1 )
set td = null
endif
//Missile fly height setup
set height = GetUnitFlyHeight( target )
if ( height > missileFlyHeight ) then
set height = GetUnitFlyHeight(target)
set raise = height / ( distance / 800 )
call SetUnitFlyHeight( missile, height, raise )
set raise = 0.00
elseif ( height < missileFlyHeight ) then
set raise = ( missileFlyHeight - height ) / ( distance / 800 )
call SetUnitFlyHeight( missile, height, raise )
endif
set angle = GetUnitFacing(target) - 180
set x = PolarProjectionX( x, 150, angle )
set y = PolarProjectionY( y, 150, angle )
set angle = 0.00
set dummy = CreateUnit( p, Dum_RawCode(), x, y, AngleBetweenCoord( x, y, GetUnitX(target), GetUnitY(target) ) )
call UnitAddAbility( dummy, Loc_RawCode() )
call UnitAddAbility( dummy, frost_damage )
//Make AI target not to run
if ( ( jumps + 1 == max_jumps ) and ( GetPlayerController(GetOwningPlayer(target)) != MAP_CONTROL_USER ) ) then
call TriggerSleepAction( bj_WAIT_FOR_COND_MIN_INTERVAL )
call IssuePointOrder( target, "attack", GetUnitX(caster), GetUnitY(caster) )
endif
//===== Timer Setup =======
//=== Move missile ===
//===== *********** =======
call SetUnitUserData(missile, U2I(target))
call SetUnitUserData(dummy, U2I(missile))
set t = CreateTimer()
call SetUserTimerData( t, U2I(dummy) )
call TimerStart( t, timerSpeed, true, function SetMissileXY )
//Sleep while missile dont get target
if ( jumps + 1 == max_jumps ) then
set sleep = ( distance / missileSpeed ) - 0.30
else
set sleep = ( distance / missileSpeed ) - 0.15
endif
if ( sleep < bj_WAIT_FOR_COND_MIN_INTERVAL ) then
set sleep = bj_WAIT_FOR_COND_MIN_INTERVAL
endif
call PolledWait( sleep )
set sleep = 0.00
//Frost blow sound
if ( UseSounds() ) then
set x = GetUnitX(target)
set y = GetUnitY(target)
call PlaySoundEx( frost_blow, x, y, z, false )
endif
//Conitinue code if we have more jumps
call IssueTargetOrder( dummy, "frostnova", target )//Reduce bugs
call UnitApplyTimedLife( dummy, GT_RawCode(), 1.00 )
//Graphics main code
if ( UsingGraphics() ) then
set i = 0
set grp_group = CreateGroup()
loop
exitwhen i >= 10
set grpU = CreateUnit( p, Grp_RawCode(), x, y, i*36 )
call UnitAddAbility( grpU, Loc_RawCode() )
call GroupAddUnit( grp_group, grpU )
set i = i + 1
endloop
set t = CreateTimer()
call SetUserTimerData( t, G2I(grp_group) )
call TimerStart( t, timerSpeed, true, function GraphicsMain )
endif
set missile = null
set dummy = null
endloop
//Clear some vars
call KillSoundWhenDone( frost_blow )
call KillSoundWhenDone( field_snd )
call KillSoundWhenDone( missile_fly )
set caster = null
set target = null
set p = null
set x = 0.00
set y = 0.00
set max_jumps = 0
set distance = 0.00
set frost_damage = 0
set missileFlyHeight = 0.00
set missileSpeed = 0.00
set timerSpeed = 0.00
set i = 0
endfunction
//===========================================================================
function InitTrig_Chain_Frost_jass takes nothing returns nothing
local boolexpr bx = Filter(null)
//Create chain frost trigger
set gg_trg_Chain_Frost_jass = CreateTrigger( )
//Triggers events / condition
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 0), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 1), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 2), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 3), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 4), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 5), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 6), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 7), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 8), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player( 9), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(10), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(11), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(12), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(13), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(14), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call TriggerRegisterPlayerUnitEvent( gg_trg_Chain_Frost_jass, Player(15), EVENT_PLAYER_UNIT_SPELL_EFFECT, bx )
call DestroyBoolExpr(bx)
call TriggerAddCondition( gg_trg_Chain_Frost_jass, Condition( function IsChainFrostCasted ) )
// Main Trigger Actions
call TriggerAddAction( gg_trg_Chain_Frost_jass, function Trig_Chain_Frost_jass_Actions )
//-----------------------------------------------------------------------
endfunction