Name | Type | is_array | initial_value |
real | real | No | |
unit | unit | No |
function Trig_Falmes_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A009'
endfunction
function Trig_Falmes_Actions takes nothing returns nothing
local integer a = 0
local unit u = GetTriggerUnit()
local unit u1 = null
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real g = 3.14159/180
local integer dur = 100
local integer utime = 5
local player p = GetOwningPlayer(GetTriggerUnit())
local string s = "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeEmbers.mdl"
local effect f1 = AddSpecialEffectTarget(s, u, "foot left")
local effect f2 = AddSpecialEffectTarget(s, u, "foot right")
call SetUnitMoveSpeed( u, GetUnitMoveSpeed(u) + 50 )
call SetUnitPathing( u, false )
loop
exitwhen a > dur
set x = GetUnitX(u)
set y = GetUnitY(u)
if ( GetUnitState(u, ConvertUnitState(0)) > 0 ) then
set u1 = CreateUnit (p, 'h002', x , y, 0)
call UnitApplyTimedLife( u1, 'BTLF', utime )
call SetUnitPathing( u1, false )
call TriggerSleepAction(0.05)
endif
set a = a + 1
endloop
call DestroyEffect(f1)
call DestroyEffect(f2)
call SetUnitMoveSpeed( u, GetUnitMoveSpeed(u) - 150 )
call SetUnitPathing( u, true )
set u = null
set u1 = null
set p = null
set f1 = null
set f2 = null
set s = null
endfunction
//===========================================================================
function InitTrig_Flames takes nothing returns nothing
set gg_trg_Flames = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flames, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Flames, Condition( function Trig_Falmes_Conditions ) )
call TriggerAddAction( gg_trg_Flames, function Trig_Falmes_Actions )
endfunction
function Trig_Arrow_Rain_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'ANcl'
endfunction
function Unit_Group3 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'ANcl')) * 50
if (IsUnitEnemy(u, GetTriggerPlayer())==true) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Trig_Arrow_Rain_Actions takes nothing returns nothing
local integer a = 0
local integer b = 0
local integer c = 0
local integer d = 0
local integer e = 0
local unit u = GetTriggerUnit()
local unit u1 = null
local unit u2 = null
local real x1 = GetUnitX(u)
local real y1 = GetUnitY(u)
local real x2 = GetSpellTargetX()
local real y2 = GetSpellTargetY()
local real x3 = 0
local real y3 = 0
local real x4 = 0
local real y4 = 0
local real g = 3.14159/180
local player p = GetOwningPlayer(u)
local string s = "Abilities\\Spells\\Other\\Drain\\ManaDrainTarget.mdl"
local effect f = AddSpecialEffectTarget(s, u, "origin")
local group gr = CreateGroup()
loop
exitwhen a > 1000
loop
exitwhen b > 10
set x3 = x1 + GetRandomReal(0, 200.00) * Cos(g * GetRandomReal(0, 360.0))
set y3 = y1 + GetRandomReal(0, 200.00) * Sin(g * GetRandomReal(0, 360.0))
set u1 = CreateUnit (p, 'h000', x3 , y3, 0)
call UnitAddAbility(u1, 'Amrf' )
call UnitRemoveAbility(u1, 'Amrf' )
call SetUnitFlyHeight( u1, 1500.00, GetRandomReal(800.00, 1000.00) )
call UnitApplyTimedLife( u1,'BTLF', 3.00 )
set u1 = null
set b = b + 1
endloop
if (a > 5) then
loop
exitwhen c > 10
set x4 = x2 + GetRandomReal(0, 200.00) * Cos(g * GetRandomReal(0, 359.0))
set y4 = y2 + GetRandomReal(0, 200.00) * Sin(g * GetRandomReal(0, 359.0))
set u2 = CreateUnit (p, 'h001', x4 , y4, 0)
call UnitAddAbility(u2, 'Amrf' )
call UnitRemoveAbility(u2, 'Amrf' )
call SetUnitFlyHeight( u2, GetRandomReal(5.00, 40.00), GetRandomReal(900.00, 1000.00) )
call UnitApplyTimedLife( u2,'BTLF', 6.00 )
set c = c + 1
endloop
set d = d + 1
if ((a - I2R(R2I(a / 4)) * 4) == 0) then
call GroupEnumUnitsInRange(gr,x2,y2,200.00,Condition(function Unit_Group3))
call SetUnitState(u, ConvertUnitState(2), GetUnitState(u,ConvertUnitState(2)) - 5)
endif
endif
call TriggerSleepAction(0.1)
if ((OrderId2StringBJ(GetUnitCurrentOrder(u)) != "channel") and (GetUnitState(u, ConvertUnitState(0)) > 0)) then
set a = 10000
elseif (GetUnitState(u, ConvertUnitState(2)) < 5.00) then
set a = 10000
call IssueImmediateOrder( GetTriggerUnit(), "stop" )
endif
set a = a + 1
set e = e + 1
set b = 0
set c = 0
endloop
call DestroyEffect(f)
set d = e - d
set a = 0
loop
exitwhen a > d
loop
exitwhen c > 10
set x4 = x2 + GetRandomReal(0, 200.00) * Cos(g * GetRandomReal(0, 359.0))
set y4 = y2 + GetRandomReal(0, 200.00) * Sin(g * GetRandomReal(0, 359.0))
set u2 = CreateUnit (p, 'h001', x4 , y4, 0)
call UnitAddAbility(u2, 'Amrf' )
call UnitRemoveAbility(u2, 'Amrf' )
call SetUnitFlyHeight( u2, GetRandomReal(10.00, 30.00), GetRandomReal(900.00, 1000.00) )
call UnitApplyTimedLife( u2,'BTLF', 6.00 )
set c = c + 1
endloop
call TriggerSleepAction(0.1)
// if ((a - I2R(R2I(a / 4)) * 4) == 0) then
if ((a / 4 * 4) == 0) then
call GroupEnumUnitsInRange(gr,x2,y2,200.00,Condition(function Unit_Group3))
endif
set a = a + 1
set c = 0
endloop
call DestroyGroup(gr)
set gr = null
set u = null
set u1 = null
set u2 = null
set p = null
set s = null
endfunction
//===========================================================================
function InitTrig_Arrow_Rain takes nothing returns nothing
set gg_trg_Arrow_Rain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arrow_Rain, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Arrow_Rain, Condition( function Trig_Arrow_Rain_Conditions ) )
call TriggerAddAction( gg_trg_Arrow_Rain, function Trig_Arrow_Rain_Actions )
endfunction
function Trig_Untitled_Trigger_003_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A007'
endfunction
function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
local unit uc = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local unit u1
local unit u2
local unit u3
local unit u4
local unit u5
local integer a = 0
local integer h1 = 330
local integer h2 = 320
local integer d = 10
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real g = (3.14159/180)
local real x1 = x + 300 * Cos(g * 0)
local real y1 = y + 300 * Sin(g * 0)
local real x2 = x + 300 * Cos(g * 72)
local real y2 = y + 300 * Sin(g * 72)
local real x3 = x + 300 * Cos(g * 144)
local real y3 = y + 300 * Sin(g * 144)
local real x4 = x + 300 * Cos(g * 216)
local real y4 = y + 300 * Sin(g * 216)
local real x5 = x + 300 * Cos(g * 288)
local real y5 = y + 300 * Sin(g * 288)
local real sp = 100
local real hp = GetUnitState(u, ConvertUnitState(0))
local real chp = hp
local real cchp = GetUnitState(uc, ConvertUnitState(0))
local real mhp = hp/33
local lightning l1 = null
local lightning l2 = null
local lightning l3 = null
local lightning l4 = null
local lightning l5 = null
local lightning l6 = null
local lightning l7 = null
local lightning l8 = null
local lightning l9 = null
local lightning l10 = null
local player p = GetOwningPlayer(GetTriggerUnit())
local string s1 = "Abilities\\Spells\\Human\\DivineShield\\DivineShieldTarget.mdl"
local effect f = AddSpecialEffectTarget(s1, u, "origin")
call SetUnitInvulnerable( u, true )
call PauseUnit( u, true )
set u1 = CreateUnit (p, 'h003', x1 , y1, 0)
call UnitAddAbility(u1, 'Amrf' )
call UnitRemoveAbility(u1, 'Amrf' )
call SetUnitFlyHeight( u1, h1, sp*4 )
set u2 = CreateUnit (p, 'h003', x2 , y2, 0)
call UnitAddAbility(u2, 'Amrf' )
call UnitRemoveAbility(u2, 'Amrf' )
call SetUnitFlyHeight( u2, h1, sp*4 )
set u3 = CreateUnit (p, 'h003', x3 , y3, 0)
call UnitAddAbility(u3, 'Amrf' )
call UnitRemoveAbility(u3, 'Amrf' )
call SetUnitFlyHeight( u3, h1, sp*4 )
set u4 = CreateUnit (p, 'h003', x4 , y4, 0)
call UnitAddAbility(u4, 'Amrf' )
call UnitRemoveAbility(u4, 'Amrf' )
call SetUnitFlyHeight( u4, h1, sp*4 )
set u5 = CreateUnit (p, 'h003', x5 , y5, 0)
call UnitAddAbility(u5, 'Amrf' )
call UnitRemoveAbility(u5, 'Amrf' )
call SetUnitFlyHeight( u5, h1, sp*4 )
call UnitAddAbility(u, 'Amrf' )
call UnitRemoveAbility(u, 'Amrf' )
call SetUnitFlyHeight( u, h2, sp )
call TriggerSleepAction(3.2)
call UnitApplyTimedLife( u1, 'BUan', d + 15 )
call UnitApplyTimedLife( u2, 'BUan', d + 15 )
call UnitApplyTimedLife( u3, 'BUan', d + 15 )
call UnitApplyTimedLife( u4, 'BUan', d + 15 )
call UnitApplyTimedLife( u5, 'BUan', d + 15 )
set l1 = AddLightningEx("DRAL", true, x1, y1, 320, x, y, 320)
call SetLightningColor(l1, 1, 0, 0, 1)
set l2 = AddLightningEx("DRAL", true, x2, y2, 320, x, y, 320)
call SetLightningColor(l2, 1, 0, 0, 1)
set l3 = AddLightningEx("DRAL", true, x3, y3, 320, x, y, 320)
call SetLightningColor(l3, 1, 0, 0, 1)
set l4 = AddLightningEx("DRAL", true, x4, y4, 320, x, y, 320)
call SetLightningColor(l4, 1, 0, 0, 1)
set l5 = AddLightningEx("DRAL", true, x5, y5, 320, x, y, 320)
call SetLightningColor(l5, 1, 0, 0, 1)
call TriggerSleepAction(0.01)
set l6 = AddLightningEx("LEAS", true, x1, y1, 320, x5, y5, 320)
call SetLightningColor(l6, 0, 0, 1, 1)
call TriggerSleepAction(0.01)
set l7 = AddLightningEx("LEAS", true, x2, y2, 320, x1, y1, 320)
call SetLightningColor(l7, 0, 0, 1, 1)
call TriggerSleepAction(0.01)
set l8 = AddLightningEx("LEAS", true, x3, y3, 320, x2, y2, 320)
call SetLightningColor(l8, 0, 0, 1, 1)
call TriggerSleepAction(0.01)
set l9 = AddLightningEx("LEAS", true, x4, y4, 320, x3, y3, 320)
call SetLightningColor(l9, 0, 0, 1, 1)
call TriggerSleepAction(0.01)
set l10 = AddLightningEx("LEAS", true, x5, y5, 320, x4, y4, 320)
call SetLightningColor(l10, 0, 0, 1, 1)
loop
exitwhen a > d
call TriggerSleepAction(1)
call SetUnitState(u, ConvertUnitState(0), chp-mhp)
call SetUnitState(uc, ConvertUnitState(0), cchp+mhp)
set chp = GetUnitState(u, ConvertUnitState(0))
set cchp = GetUnitState(uc, ConvertUnitState(0))
set a= a + 1
endloop
call TriggerSleepAction(1)
call DestroyLightning(l1)
call DestroyLightning(l2)
call DestroyLightning(l3)
call DestroyLightning(l4)
call DestroyLightning(l5)
call DestroyLightning(l6)
call DestroyLightning(l7)
call DestroyLightning(l8)
call DestroyLightning(l9)
call DestroyLightning(l10)
call SetUnitFlyHeight( u1, 1500, sp*4 )
call SetUnitFlyHeight( u2, 1500, sp*4 )
call SetUnitFlyHeight( u3, 1500, sp*4 )
call SetUnitFlyHeight( u4, 1500, sp*4 )
call SetUnitFlyHeight( u5, 1500, sp*4 )
call UnitAddAbility(u, 'Amrf' )
call UnitRemoveAbility(u, 'Amrf' )
call SetUnitFlyHeight( u, 0, sp )
call TriggerSleepAction(3)
call PauseUnit( u, false )
call SetUnitInvulnerable( u, false )
call DestroyEffect(f)
set u = null
set u1 = null
set u2 = null
set u3 = null
set u4 = null
set u5 = null
set p = null
set f = null
set s1 = null
set l1 = null
set l2 = null
set l3 = null
set l4 = null
set l5 = null
set l6 = null
set l7 = null
set l8 = null
set l9 = null
set l10 = null
endfunction
//===========================================================================
function InitTrig_Magical_sword takes nothing returns nothing
set gg_trg_Magical_sword = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Magical_sword, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Magical_sword, Condition( function Trig_Untitled_Trigger_003_Conditions ) )
call TriggerAddAction( gg_trg_Magical_sword, function Trig_Untitled_Trigger_003_Actions )
endfunction
function Unit_Group1 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'A006')) * 50
if ((IsUnitEnemy(u, GetTriggerPlayer())==true)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Unit_Group2 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real dmg = 10 + (GetUnitAbilityLevel(u, 'A006')) * 50
local real d = SquareRoot((GetUnitX(ut)-GetUnitX(u)) * (GetUnitX(ut)-GetUnitX(u)) + (GetUnitY(ut)-GetUnitY(u))*(GetUnitY(ut)-GetUnitY(u)))
if ((IsUnitEnemy(u, GetTriggerPlayer())==true) and (d > 300)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Trig_Firebolt_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A006'
endfunction
function Trig_Firebolt_Actions takes nothing returns nothing
local unit uc = GetTriggerUnit()
local integer a = 0
local integer d1 = 150
local integer d2 = 900
local integer fnr = 36
local real h = 180 / 3.14159
local real g = 360 / fnr * 3.14159/180
local real r
local real ux = GetUnitX(uc)
local real uy = GetUnitY(uc)
local real x1
local real y1
local real x2
local real y2
local unit u
local player p = GetOwningPlayer(GetTriggerUnit())
local group gr = CreateGroup()
loop
exitwhen a > fnr
set x1 = ux + d1 * Cos(g*a)
set y1 = uy + d1 * Sin(g*a)
set x2 = ux + d2 * Cos(g*a)
set y2 = uy + d2 * Sin(g*a)
set r = h * Atan2(y2 - y1, x2 - x1)
set u = CreateUnit (p, 'h004', x1 , y1, r)
call SetUnitPathing( u, false )
call IssuePointOrder (u, "move" , x2, y2)
call UnitApplyTimedLife( u, 'BTLF', 1.3 )
set a = a + 1
endloop
call GroupEnumUnitsInRange(gr,ux,uy,300.00,Condition(function Unit_Group1))
call TriggerSleepAction(0.5)
call GroupEnumUnitsInRange(gr,ux,uy,600.00,Condition(function Unit_Group2))
call DestroyGroup(gr)
set uc = null
set p = null
set u = null
set gr = null
endfunction
//===========================================================================
function InitTrig_Explosive_nova takes nothing returns nothing
set gg_trg_Explosive_nova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Explosive_nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Explosive_nova, Condition( function Trig_Firebolt_Conditions ) )
call TriggerAddAction( gg_trg_Explosive_nova, function Trig_Firebolt_Actions )
endfunction
function Trig_Jump_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A008'
endfunction
function Unit_Group takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'A008')) * 50
if (IsUnitEnemy(u, GetTriggerPlayer())==true) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Trig_Jump_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local integer a = 0
local integer h = 400
local real fsp1 = 600
local real fsp2 = 900
local integer d = 10
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real x1 = x + 330 * Cos(GetUnitFacing(u)* 3.14159/180)
local real y1 = y + 330 * Sin(GetUnitFacing(u)* 3.14159/180)
local player p = GetOwningPlayer(GetTriggerUnit())
local string s1 = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
local effect f = null
local group gr = CreateGroup()
call SetUnitInvulnerable( u, true )
call UnitAddAbility(u, 'Amrf' )
call UnitRemoveAbility(u, 'Amrf' )
call SetUnitFlyHeight( u, h, fsp1 )
call IssuePointOrder (u, "move" , x1, y1)
call TriggerSleepAction(0.5)
call UnitAddAbility(u, 'Amrf' )
call UnitRemoveAbility(u, 'Amrf' )
call SetUnitFlyHeight( u, 0, fsp2 )
call TriggerSleepAction(0.3)
set x = GetUnitX(u)
set y = GetUnitY(u)
set f = AddSpecialEffect(s1,x,y)
call GroupEnumUnitsInRange(gr,x,y,250.00,Condition(function Unit_Group))
call TriggerSleepAction(0.2)
call SetUnitInvulnerable( u, false )
call DestroyEffect(f)
call DestroyGroup(gr)
set u = null
set gr = null
set p = null
set f = null
set s1 = null
endfunction
//===========================================================================
function InitTrig_Jump takes nothing returns nothing
set gg_trg_Jump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Jump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Jump, Condition( function Trig_Jump_Conditions ) )
call TriggerAddAction( gg_trg_Jump, function Trig_Jump_Actions )
endfunction
function Unit_Group4 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitX(u)
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'A004')) * 50
if ((IsUnitEnemy(u, GetTriggerPlayer())==true)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Trig_Frostnova_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A004'
endfunction
function Trig_Frostnova_Actions takes nothing returns nothing
local unit uc = GetTriggerUnit()
local integer a = 0
local integer d1 = 50
local integer d2 = 600
local integer fnr = 36
local real h = 180 / 3.14159
local real g = 360 / fnr * 3.14159/180
local real r
local real ux = GetUnitX(uc)
local real uy = GetUnitY(uc)
local real x1
local real y1
local real x2
local real y2
local unit u
local player p = GetOwningPlayer(GetTriggerUnit())
local group gr = CreateGroup()
loop
exitwhen a > fnr
set x1 = ux + d1 * Cos(g*a)
set y1 = uy + d1 * Sin(g*a)
set x2 = ux + d2 * Cos(g*a)
set y2 = uy + d2 * Sin(g*a)
set r = h * Atan2(y2 - y1, x2 - x1)
set u = CreateUnit (p, 'h005', x1 , y1, r)
call SetUnitPathing( u, false )
call IssuePointOrder (u, "move" , x2, y2)
call UnitApplyTimedLife( u, 'BTLF', 1.5 )
set a = a + 1
endloop
call TriggerSleepAction(0.5)
call GroupEnumUnitsInRange(gr,ux,uy,600.00,Condition(function Unit_Group4))
call DestroyGroup(gr)
set uc = null
set p = null
set u = null
set gr = null
endfunction
//===========================================================================
function InitTrig_Frostnova takes nothing returns nothing
set gg_trg_Frostnova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frostnova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frostnova, Condition( function Trig_Frostnova_Conditions ) )
call TriggerAddAction( gg_trg_Frostnova, function Trig_Frostnova_Actions )
endfunction
function Unit_Group6 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real x1 = GetUnitX(ut)
local real y1 = GetUnitY(ut)
local real x2 = GetUnitX(u)
local real y2 = GetUnitY(u)
local real ang = Atan2( y2 - y1, x2 - x1)
local real x3 = x1 + 500 * Cos(ang)
local real y3 = y1 + 500 * Sin(ang)
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'A005')) * 50
if ((IsUnitEnemy(u, GetTriggerPlayer())==true)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
call IssuePointOrder (u, "move" , x3, y3)
call SetUnitFacing(u, ang*180/3.14159-180)
call SetUnitPosition (u, x3, y3)
endif
set u = null
set ut = null
return false
endfunction
function Trig_Firenova_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A005'
endfunction
function Trig_Firenova_Actions takes nothing returns nothing
local unit uc = GetTriggerUnit()
local integer a = 0
local integer d1 = 150
local integer d2 = 550
local integer fnr = 24
local real h = 180 / 3.14159
local real g = 360 / fnr * 3.14159/180
local real r
local real ux = GetUnitX(uc)
local real uy = GetUnitY(uc)
local real x1
local real y1
local real x2
local real y2
local unit u
local player p = GetOwningPlayer(GetTriggerUnit())
local group gr = CreateGroup()
loop
exitwhen a > fnr
set x1 = ux + d1 * Cos(g*a)
set y1 = uy + d1 * Sin(g*a)
set x2 = ux + d2 * Cos(g*a)
set y2 = uy + d2 * Sin(g*a)
set r = h * Atan2(y2 - y1, x2 - x1)
set u = CreateUnit (p, 'h006', x1 , y1, r)
call SetUnitPathing( u, false )
call IssuePointOrder (u, "move" , x2, y2)
call UnitApplyTimedLife( u, 'BTLF', 1.5 )
set a = a + 1
endloop
call TriggerSleepAction(0.5)
call GroupEnumUnitsInRange(gr,ux,uy,600.00,Condition(function Unit_Group6))
call DestroyGroup(gr)
set uc = null
set p = null
set u = null
set gr = null
endfunction
//===========================================================================
function InitTrig_Firenova takes nothing returns nothing
set gg_trg_Firenova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Firenova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Firenova, Condition( function Trig_Firenova_Conditions ) )
call TriggerAddAction( gg_trg_Firenova, function Trig_Firenova_Actions )
endfunction
function Trig_Dot_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A002'
endfunction
function Trig_Dot_Actions takes nothing returns nothing
local unit uc = GetTriggerUnit()
local unit ut = GetSpellTargetUnit()
local integer a = 0
local integer h1 = 330
local integer h2 = 320
local integer d = 20
//local real hp = GetUnitState(ut, ConvertUnitState(0))/100 //current hp 1%
local real hp = (GetUnitState(ut, ConvertUnitState(1)))/100 //max hp 1%
local real dmg = 10 * (GetUnitAbilityLevel(uc, 'A002')) + hp
local player p = GetOwningPlayer(ut)
local string s = "Abilities\\Spells\\NightElf\\shadowstrike\\shadowstrike.mdl"
local effect f = AddSpecialEffectTarget(s, ut, "overhead")
call TriggerSleepAction(3.2)
loop
exitwhen a > d
if ( GetUnitState(ut, ConvertUnitState(0)) > 0 ) then
call UnitDamageTarget(uc, ut, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
call TriggerSleepAction(1)
endif
set a= a + 1
endloop
call DestroyEffect(f)
set ut = null
set uc = null
set p = null
set f = null
set s = null
endfunction
//===========================================================================
function InitTrig_Dot takes nothing returns nothing
set gg_trg_Dot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dot, Condition( function Trig_Dot_Conditions ) )
call TriggerAddAction( gg_trg_Dot, function Trig_Dot_Actions )
endfunction
function Unit_Group5 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'AOsh')) * 50
if ((IsUnitEnemy(u, GetTriggerPlayer())==true)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
endif
set u = null
set ut = null
return false
endfunction
function Trig_Flamebreath_Conditions takes nothing returns boolean
local boolean b = false
if ( GetSpellAbilityId() == 'AOsh' ) then
set b = true
endif
return b
endfunction
function Trig_Flamebreath_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit d
local integer a = 1
local integer d1 = 50
local integer d2 = 450
local real h = 3.14159/180
local real ang =180/3.14159*Atan2( GetSpellTargetY() - GetUnitY(u), GetSpellTargetX() - GetUnitX(u))
local real r
local real ux = GetUnitX(u)
local real uy = GetUnitY(u)
local real x1
local real y1
local real x2
local real y2
local real x3 = ux + 250 * Cos(ang*h)
local real y3 = uy + 250 * Sin(ang*h)
local unit u
local player p = GetOwningPlayer(GetTriggerUnit())
local group gr = CreateGroup()
loop
exitwhen a > 5
set r = (ang+20-(a*8))
set x2 = ux + d2 * Cos(h*r)
set y2 = uy + d2 * Sin(h*r)
set d = CreateUnit (p, 'h005', ux , uy, r)
call IssuePointOrder (d, "breathoffire" , x2, y2)
call UnitApplyTimedLife( d, 'BTLF', 1 )
set a = a + 1
endloop
call TriggerSleepAction(0.5)
call GroupEnumUnitsInRange(gr,x3,y3,100.00,Condition(function Unit_Group5))
call DestroyGroup(gr)
set u = null
set d = null
set p = null
set gr = null
endfunction
//===========================================================================
function InitTrig_Flamebreath takes nothing returns nothing
set gg_trg_Flamebreath = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flamebreath, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flamebreath, Condition( function Trig_Flamebreath_Conditions ) )
call TriggerAddAction( gg_trg_Flamebreath, function Trig_Flamebreath_Actions )
endfunction
function Trig_Shurikken_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Trig_Shurikken_Actions takes nothing returns nothing
local boolean exit = false
local unit u = GetTriggerUnit()
local unit ut = GetSpellTargetUnit()
local unit us = null
local unit pu = null
local unit lu = null
local integer mu = 3 + (GetUnitAbilityLevel(u, 'A000'))*2
local integer cu = 0
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real nx = GetUnitX(ut)
local real ny = GetUnitY(ut)
local real xs
local real ys
local real dx = 0
local real dy = 0
local real d = 600
local real dmg = 10 + (GetUnitAbilityLevel(u, 'A000')) * 50
local player p = GetOwningPlayer(u)
local group gr = CreateGroup()
set us = CreateUnit (p, 'h007', x , y, 0)
loop
exitwhen ( cu >= mu )
set exit = false
if (cu>0) then
call GroupEnumUnitsInRange(gr,xs,ys,450.00,null)
loop
set pu = GroupPickRandomUnit(gr)
exitwhen (pu==null) or (exit==true)
if ((IsUnitEnemy(pu, GetTriggerPlayer())) and (pu!=ut) and (pu!=lu) and (GetUnitState(pu, ConvertUnitState(0)) > 0)) then
set lu = ut
set ut = pu
set d = 450
set exit = true
endif
call GroupRemoveUnit(gr, pu)
endloop
endif
if (ut == null) then
call SetUnitExploded(us, true)
call KillUnit(us)
endif
call IssueTargetOrder( us, "attack", ut )
loop
exitwhen ( d < 80.00 )
set xs = GetUnitX(us)
set ys = GetUnitY(us)
set nx = GetUnitX(ut)
set ny = GetUnitY(ut)
set dx = nx - xs
set dy = ny - ys
set d = SquareRoot(dx * dx + dy * dy)
call TriggerSleepAction(0.05)
endloop
call UnitDamageTarget(u, ut, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
set cu = cu + 1
endloop
call UnitApplyTimedLife( us, 'BUan', 0.1 )
call DestroyGroup(gr)
set ut = null
set us = null
set u = null
set lu = null
set p = null
set gr = null
endfunction
//===========================================================================
function InitTrig_Shurikken takes nothing returns nothing
set gg_trg_Shurikken = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shurikken, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shurikken, Condition( function Trig_Shurikken_Conditions ) )
call TriggerAddAction( gg_trg_Shurikken, function Trig_Shurikken_Actions )
endfunction