Name | Type | is_array | initial_value |
do_not_copy_me | location | No | |
temppoint1 | location | No | |
temppoint2 | location | No | |
tempunit | unit | No | |
x | real | No | |
y | real | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
//=====================================================\\
// Sparkwave \\
// \\
// Credits go to: \\
// HINDYhat, PurplePoot \\
//=====================================================\\
scope MeinScope initializer Sparkwave
//=================================================\\
//=Now, first we do the usual check which ability \\
//=is being cast \\
//=================================================\\
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
private function Actions takes nothing returns nothing
//=================================================\\
//=Here we define the locals \\
//=================================================\\
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
local unit u
local integer i = GetUnitAbilityLevel(caster, 'A003')
local integer i2 = 0
local real x = GetUnitX(target)
local real y = GetUnitY(target)
local player p = GetOwningPlayer(caster)
//=================================================\\
//=Finally, we create the first and the second \\
//=dummy \\
//=================================================\\
set u = CreateUnit(p, 'n000', x, y, 90)
call UnitApplyTimedLife(u, 'BLTF' , .2)
set u = CreateUnit(p, 'n001', x, y, 90)
call UnitApplyTimedLife(u, 'BLTF' , i*5)
call SetUnitAbilityLevel(u, 'A001', i)
//=========================================================\\
//=As we need six of the third dummy we create one each 60°\\
//=========================================================\\
loop
exitwhen i2 > 5
//=================================================\\
//=We order it to cast 'chainlightning' =\\
//=================================================\\
set u = CreateUnit(p, 'n002', (x + 700.00*Cos((i2*60.00)*bj_DEGTORAD)), y + 700.00*Sin((i2*60)*bj_DEGTORAD), 90.00)
call SetUnitAbilityLevel(u, 'A001', i)
call IssueTargetOrder(u, "chainlightning", target)
call UnitApplyTimedLife(u, 'BLTF' , .2)
//=======================================================\\
//=And increase the loopcount by one and the angle by 60=\\
//=======================================================\\
set i2 = (i2 + 1)
endloop
//=================================================\\
//=To prevent leaks, we null the needed locals =\\
//=================================================\\
set u = null
set target = null
set caster = null
endfunction
private function Sparkwave takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function Conditions))
call TriggerAddAction(t, function Actions)
endfunction
endscope