- Joined
- May 4, 2007
- Messages
- 2,260
Guys this is a spell made by emilj3 and changed by me. umilj3 made this spell from a dota map, however the spell he made had bugs and leak problems so serious that i was forced to change it.
Here is my correction.
Guys i have 2 questions, does my correction leak ?
And by the way i was forced to add an expiration timer to the dummy unit. The question is that because the dummy unit has 45 secs expirations timer, if it is nullified correctly.
Will this trigger nullify the local even if the unit still exists ?
Is the unit nullified when the expiration time ends, or before ?
I know this is confusing, but i need to know... anyway thx to emilj3 by creating the spell. However i must correct it ...
Here is my correction.
JASS:
function SheepStrike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00W'
endfunction
function SheepStrike_Actions takes nothing returns nothing
local location l = GetUnitLoc(GetTriggerUnit())
local location m = GetSpellTargetLoc()
local unit u = CreateUnit( GetOwningPlayer(GetTriggerUnit()), 'h01H', GetLocationX(l), GetLocationY(l), bj_UNIT_FACING)
call UnitAddAbility(u, 'A01A')
call SetUnitAbilityLevelSwapped( 'A01A', u, GetUnitAbilityLevelSwapped('A00W', GetTriggerUnit()) )
call IssuePointOrder( u, "stampede", GetLocationX(m), GetLocationY(m) )
call UnitApplyTimedLife(u, 'BTLF', 35)
call RemoveLocation(l)
set l = null
call RemoveLocation(m)
set m = null
set u = null
endfunction
//===========================================================================
function InitTrig_SheepStrike takes nothing returns nothing
local trigger SheepStrike = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( SheepStrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( SheepStrike, Condition( function SheepStrike_Conditions ) )
call TriggerAddAction( SheepStrike, function SheepStrike_Actions )
endfunction
Guys i have 2 questions, does my correction leak ?
And by the way i was forced to add an expiration timer to the dummy unit. The question is that because the dummy unit has 45 secs expirations timer, if it is nullified correctly.
Will this trigger nullify the local even if the unit still exists ?
Is the unit nullified when the expiration time ends, or before ?
I know this is confusing, but i need to know... anyway thx to emilj3 by creating the spell. However i must correct it ...