The_Kingpin
Member (Who are you and why should I care?)
- Reaction score
- 40
Yeah, nvm.
private function tAct takes nothing returns nothing
local timer t = GetExpiredTimer()
local Soul_Rip SR = GetTimerStructA(t)
call ClearTimerStructA(t)
call SR.destroy()
call DestroyTimer(t)
set t = null
endfunction
private function tAct takes nothing returns nothing
local timer t = GetExpiredTimer()
local Soul_Rip SR = ClearTimerStructA(t) // <---- small trick
call SR.destroy()
call DestroyTimer(t)
set t = null
endfunction
method onDestroy takes nothing returns nothing
set .caster = null
set .target = null
call DestroyTrigger(.Infect)
call DestroyTrigger(.Amplify)
call DestroyGroup(.reg)
set .Infect = null
set .Amplify = null
set .reg = null
endmethod
method onDestroy takes nothing returns nothing
//set .caster = null // Don't null struct members they are not locals.
//set .target = null
call DestroyTrigger(.Infect)
call DestroyTrigger(.Amplify)
call DestroyGroup(.reg)
//set .Infect = null
//set .Amplify = null
//set .reg = null
endmethod
struct ZombieData
unit hero // owner of zombie
unit zombie
integer counter // for attack six times thing
private static ZombieData array PUI
static method create takes unit hero, unit zombie returns ZombieData
local ZombieData ret = ZombieData.allocate()
set ret.hero = hero
set ret.zombie = zombie
set ret.counter = 0
set ZombieData.PUI[GetUnitIndex(zombie)] = ret // zombie -> ZombieData link
return ret
endmethod
static method Get takes unit zombie returns ZombieData
return ZombieData.PUI[GetUnitIndex(zombie)]
endmethod
method onDestroy takes nothing returns nothing
set ZombieData.PUI[GetUnitIndex(.zombie)] = 0 // break the link
endmethod
endstruct
function ZombyDiesActions takes nothing returns nothing
local ZombieData data = ZombieData.Get(GetTriggerUnit())
call SetUnitState(data.hero, UNIT_STATE_LIFE, GetUnitState(data.hero, UNIT_STATE_LIFE) + 50.0)
call data.destroy()
endfunction
function RaiseDeadActions takes nothing returns nothing
set Dirges[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetTriggerUnit()
endfunction
function ZombieDiesActions takes nothing returns nothing
local unit zombie = GetTriggerUnit
local unit hero = Dirges[GetPlayerId(GetOwningPlayer(zombie))]
local real x = GetUnitX(zombie)
local real y = GetUnitY(zombie)
// Cast some heal magic on hero from the position of dying unit
endfunction