Name | Type | is_array | initial_value |
//////////////////////////////////////////////////////////////////////
// Frozen Blast by 1)ark_NiTe //
// Originally made for Against the Darkness //
// //
// r = angle that wave will be fired towards //
// //
// Notes: //
// //
// 1. Change the spells and dummy units rawcodes in the constants. //
// 2. Damage/duration data can be changed by accessing the spells //
// in the object editor //
// a.) Damage for each Frozen Blast Wave is modified in the //
// Frozen Blast (Actual Ability). //
// b.) Cooldown/spell description is modified in the Frozen //
// Blast (Dummy Ability). //
//////////////////////////////////////////////////////////////////////
//==================================================================================================================================
// Start of constants. These provide the user with easier implementing//changing of the spell's rawcodes. All of these can be changed.
//==================================================================================================================================
constant function Frozen_Blast_ID takes nothing returns integer
return 'A000' // Frozen Blast actual ability rawcode. This is the spell that will be cast by a dummy unit.
endfunction
constant function Frozen_Blast_Dummy_ID takes nothing returns integer
return 'A001' // Frozen Blast dummy ability rawcode. This is the spell that the Hero will use.
endfunction
constant function Slow_ID takes nothing returns integer
return 'A002' // Slow (Frozen Blast) rawcode.
endfunction
constant function Dummy_ID takes nothing returns integer
return 'h002' // Dummy unit rawcode
endfunction
//==================================================================================================================================
//End of constants. Do not touch anything below this if you are unfamiliar with JASS.
//==================================================================================================================================
//==================================================================================================================================
//Spell conditions.
//==================================================================================================================================
function Trig_Blast_Conditions takes nothing returns boolean
return GetSpellAbilityId() == Frozen_Blast_Dummy_ID()
endfunction
//==================================================================================================================================
//Filter function grouping enemies to be slowed.
//==================================================================================================================================
function Slow_Filter takes nothing returns boolean
return IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetOwningPlayer(GetFilterUnit())) == true
endfunction
//==================================================================================================================================
//Spell actions. Main block of coding
//==================================================================================================================================
function Trig_Blast_Actions takes nothing returns nothing
//Locals are declared
local unit t = GetTriggerUnit()
local real px = GetWidgetX(t)
local real py = GetWidgetY(t)
local real qx
local real qy
local unit array d
local unit array u
local unit e
local group g = CreateGroup()
local real r = 0.00
local integer i = 0
local integer z = 0
local integer l = GetUnitAbilityLevel(t, Frozen_Blast_Dummy_ID())
//Frozen Blasts are created. A blast occurs every 30 degrees out around the Hero 12 times (360 degrees).
loop
exitwhen i == 12
set i = i + 1
set r = r + .52359
set d[i] = CreateUnit(GetOwningPlayer(t), Dummy_ID(), px, py, 270.0)
call UnitAddAbility(d[i], Frozen_Blast_ID())
call SetUnitAbilityLevel(t, Frozen_Blast_ID(), l)
call UnitApplyTimedLife(d[i], 'BTLF', 1.00)
set qx = px + 300 * Cos(r)
set qy = py + 300 * Sin(r)
call IssuePointOrder (d[i], "carrionswarm", qx, qy)
set d[i] = null
endloop
call GroupEnumUnitsInRange(g, px, py, 650.00, Condition(function Slow_Filter))
set i = 0
set z = CountUnitsInGroup(g)
//Dummy units cast Slow (Frozen Blast) on the units in the area
loop
exitwhen i >= z
set i = i + 1
set u[i] = FirstOfGroup(g)
call GroupRemoveUnit( g, u[i] )
set e = CreateUnit(GetOwningPlayer(t), Dummy_ID(), px, py, 270.0)
call UnitApplyTimedLife(e, 'BTLF', 1.00)
call UnitAddAbility(e, Slow_ID())
call IssueTargetOrder(e, "slow", u[i])
set u[i] = null
endloop
set e = null
set t = null
endfunction
function AntiLeaker takes nothing returns boolean
return true
endfunction
//===========================================================================
function InitTrig_Frozen_Blast takes nothing returns nothing
local trigger t = CreateTrigger( )
local filterfunc f = Filter(function AntiLeaker)
local integer i = 0
loop
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, f)
set i = i + 1
exitwhen i == 16
endloop
call TriggerAddCondition(t, Condition( function Trig_Blast_Conditions ) )
call TriggerAddAction(t, function Trig_Blast_Actions )
call DestroyFilter(f)
set f = null
set t = null
endfunction