Moderator
M
Moderator
22:25, 9th Feb 2014
BPower:
Required changes made and overall good coding.
Approved.
BPower:
Required changes made and overall good coding.
Approved.
scope StaticFieldA
native UnitAlive takes unit id returns boolean
globals
private constant real FPS = 0.0312500
private constant string MODEL_PATH = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
private constant integer SPELL_ID = 'A000'
private constant string LIGHTNING_ID = "FORK"
private constant real LIGHTNING_RED = 0.15
private constant real LIGHTNING_GREEN = 0.45
private constant real LIGHTNING_BLUE = 1.
private constant real LIGHTNING_ALPHA = 1.
private constant real DURATION = 0.75
private constant attacktype A_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype D_TYPE = DAMAGE_TYPE_MAGIC
endglobals
private constant function MaxDamage takes integer level returns real
return 75.*level
endfunction
private constant function MinDamage takes integer level returns real
return 30.*level
endfunction
private constant function Aoe takes integer level returns real
return 600 + 75.*level
endfunction
private function UnitFilter takes player source, unit targ returns boolean
return IsUnitEnemy(targ, source) and UnitAlive(targ) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE)
endfunction
//! textmacro_once STATIC_FIELD_ALLOC
if thistype(0).prev == 0 then
set count = count + 1
set this = count
else
set this = thistype(0).prev
set thistype(0).prev = thistype(0).prev.prev
endif
if thistype(0).next == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
else
set thistype(0).next.prev = this
endif
set this.next = thistype(0).next
set thistype(0).next = this
set this.prev = thistype(0)
//! endtextmacro
private struct Caster extends array
real x
real y
real temp
thistype prev
thistype next
static integer count
static timer period
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.temp = this.temp - FPS
if this.temp <= 0 then
call DestroyEffect(AddSpecialEffect(MODEL_PATH, this.x, this.y))
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method add takes real x, real y returns nothing
local thistype this
//! runtextmacro STATIC_FIELD_ALLOC()
set this.x = x
set this.y = y
set this.temp = DURATION
endmethod
static method onInit takes nothing returns nothing
set count = 0
set period = CreateTimer()
endmethod
endstruct
private struct SF extends array
unit targ
unit cast
lightning light
real dmg
real cx
real cy
real cz
real tx
real ty
real x
real y
real z
integer steps
thistype prev
thistype next
static integer count
static timer period
static group g
static location loc
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
call UnitDamageTarget(this.cast, this.targ, this.dmg, true, false, A_TYPE, D_TYPE, null)
call DestroyLightning(this.light)
call SetUnitPropWindow(this.targ, GetUnitDefaultPropWindow(this.targ)*bj_DEGTORAD)
set this.light = null
set this.cast = null
set this.targ = null
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.tx = this.tx+this.x
set this.ty = this.ty+this.y
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(this.targ)
if IsTerrainWalkable(this.tx, this.ty) then
call MoveLightningEx(this.light, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetUnitX(this.targ, this.tx)
call SetUnitY(this.targ, this.ty)
endif
set this.steps = this.steps - 1
if this.steps == 0 then
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method cond takes nothing returns boolean
local thistype this
local integer lvl
local real angle
local unit u
local unit v
local real x
local real y
local player p
local real dist
if GetSpellAbilityId() == SPELL_ID then
set u = GetTriggerUnit()
set x = GetUnitX(u)
set y = GetUnitY(u)
set p = GetOwningPlayer(u)
set lvl = GetUnitAbilityLevel(u, SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
if UnitFilter(p,v) then
//! runtextmacro STATIC_FIELD_ALLOC()
set this.cast = u
set this.targ = v
set this.cx = x
set this.cy = y
set this.tx = GetUnitX(v)
set this.ty = GetUnitY(v)
set angle = Atan2(this.ty-y, this.tx-x)
set dist = SquareRoot((this.tx-x)*(this.tx-x) + (this.ty-y)*(this.ty-y))
set this.dmg = MinDamage(lvl) + (dist/Aoe(lvl))*(MaxDamage(lvl)-MinDamage(lvl))
set this.x = -(dist/DURATION)*FPS*Cos(angle)
set this.y = -(dist/DURATION)*FPS*Sin(angle)
call MoveLocation(loc, x, y)
set this.cz = GetLocationZ(loc) + 20
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(v)
set this.light = AddLightningEx(LIGHTNING_ID, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
set this.steps = R2I(DURATION/FPS)
call SetUnitPropWindow(this.targ, 0)
endif
endloop
call Caster.add(x,y)
set u = null
set p = null
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.cond))
call Preload(MODEL_PATH)
set count = 0
set period = CreateTimer()
set g = CreateGroup()
set loc = Location(0,0)
set t = null
endmethod
endstruct
endscope
scope StaticFieldE
//native UnitAlive takes unit id returns boolean
globals
private constant real FPS = 0.0312500
private constant string MODEL_PATH = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
private constant integer SPELL_ID = 'A001'
private constant string LIGHTNING_ID = "FORK"
private constant real LIGHTNING_RED = 1
private constant real LIGHTNING_GREEN = 0.45
private constant real LIGHTNING_BLUE = 0.15
private constant real LIGHTNING_ALPHA = 1.
private constant real DURATION = 0.75
private constant attacktype A_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype D_TYPE = DAMAGE_TYPE_MAGIC
private constant real SPEED = 600.
endglobals
private constant function MaxDamage takes integer level returns real
return 75.*level
endfunction
private constant function MinDamage takes integer level returns real
return 30.*level
endfunction
private constant function Aoe takes integer level returns real
return 600 + 75.*level
endfunction
private function UnitFilter takes player source, unit targ returns boolean
return IsUnitEnemy(targ, source) and UnitAlive(targ) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE)
endfunction
//! textmacro_once STATIC_FIELD_ALLOC
if thistype(0).prev == 0 then
set count = count + 1
set this = count
else
set this = thistype(0).prev
set thistype(0).prev = thistype(0).prev.prev
endif
if thistype(0).next == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
else
set thistype(0).next.prev = this
endif
set this.next = thistype(0).next
set thistype(0).next = this
set this.prev = thistype(0)
//! endtextmacro
private struct SF extends array
unit targ
unit cast
lightning light
real dmg
real cx
real cy
real cz
real tx
real ty
real x
real y
real z
integer steps
thistype prev
thistype next
static integer count
static timer period
static group g
static location loc
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
call UnitDamageTarget(this.cast, this.targ, this.dmg, true, false, A_TYPE, D_TYPE, null)
call DestroyLightning(this.light)
call SetUnitPropWindow(this.targ, GetUnitDefaultPropWindow(this.targ)*bj_DEGTORAD)
set this.light = null
set this.cast = null
set this.targ = null
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.tx = this.tx+this.x
set this.ty = this.ty+this.y
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(this.targ)
if IsTerrainWalkable(this.tx, this.ty) then
call MoveLightningEx(this.light, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetUnitX(this.targ, this.tx)
call SetUnitY(this.targ, this.ty)
endif
set this.steps = this.steps - 1
if this.steps == 0 then
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method cond takes nothing returns boolean
local thistype this
local integer lvl
local real angle
local unit u
local unit v
local real x
local real y
local player p
local real dist
if GetSpellAbilityId() == SPELL_ID then
set u = GetTriggerUnit()
set x = GetUnitX(u)
set y = GetUnitY(u)
set p = GetOwningPlayer(u)
set lvl = GetUnitAbilityLevel(u, SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
call DestroyEffect(AddSpecialEffect(MODEL_PATH, x, y))
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
if UnitFilter(p,v) then
//! runtextmacro STATIC_FIELD_ALLOC()
set this.cast = u
set this.targ = v
set this.cx = x
set this.cy = y
set this.tx = GetUnitX(v)
set this.ty = GetUnitY(v)
set angle = Atan2(this.ty-y, this.tx-x)
set dist = SquareRoot((this.tx-x)*(this.tx-x) + (this.ty-y)*(this.ty-y))
set this.dmg = MinDamage(lvl) + (1-(dist/Aoe(lvl)))*(MaxDamage(lvl)-MinDamage(lvl))
set this.x = SPEED*FPS*Cos(angle)
set this.y = SPEED*FPS*Sin(angle)
call MoveLocation(loc, x, y)
set this.cz = GetLocationZ(loc)
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(v)
set this.light = AddLightningEx(LIGHTNING_ID, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
set this.steps = R2I(DURATION/FPS)
call SetUnitPropWindow(this.targ, 0)
endif
endloop
set u = null
set p = null
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.cond))
call Preload(MODEL_PATH)
set count = 0
set period = CreateTimer()
set g = CreateGroup()
set loc = Location(0,0)
set t = null
endmethod
endstruct
endscope
scope DistantFieldA
//native UnitAlive takes unit id returns boolean
globals
private constant real FPS = 0.0312500
private constant string MODEL_PATH = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
private constant integer SPELL_ID = 'A002'
private constant string LIGHTNING_ID = "FORK"
private constant real LIGHTNING_RED = 0.15
private constant real LIGHTNING_GREEN = 0.45
private constant real LIGHTNING_BLUE = 1.
private constant real LIGHTNING_ALPHA = 1.
private constant real DURATION = 0.75
private constant attacktype A_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype D_TYPE = DAMAGE_TYPE_MAGIC
endglobals
private constant function MaxDamage takes integer level returns real
return 75.*level
endfunction
private constant function MinDamage takes integer level returns real
return 30.*level
endfunction
private constant function Aoe takes integer level returns real
return 600 + 75.*level
endfunction
private function UnitFilter takes player source, unit targ returns boolean
return IsUnitEnemy(targ, source) and UnitAlive(targ) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE)
endfunction
//! textmacro_once STATIC_FIELD_ALLOC
if thistype(0).prev == 0 then
set count = count + 1
set this = count
else
set this = thistype(0).prev
set thistype(0).prev = thistype(0).prev.prev
endif
if thistype(0).next == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
else
set thistype(0).next.prev = this
endif
set this.next = thistype(0).next
set thistype(0).next = this
set this.prev = thistype(0)
//! endtextmacro
private struct Caster extends array
real x
real y
real temp
thistype prev
thistype next
static integer count
static timer period
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.temp = this.temp - FPS
if this.temp <= 0 then
call DestroyEffect(AddSpecialEffect(MODEL_PATH, this.x, this.y))
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method add takes real x, real y returns nothing
local thistype this
//! runtextmacro STATIC_FIELD_ALLOC()
set this.x = x
set this.y = y
set this.temp = DURATION
endmethod
static method onInit takes nothing returns nothing
set count = 0
set period = CreateTimer()
endmethod
endstruct
private struct SF extends array
unit targ
unit cast
lightning light
real dmg
real cx
real cy
real cz
real tx
real ty
real x
real y
real z
integer steps
thistype prev
thistype next
static integer count
static timer period
static group g
static location loc
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
call UnitDamageTarget(this.cast, this.targ, this.dmg, true, false, A_TYPE, D_TYPE, null)
call DestroyLightning(this.light)
call SetUnitPropWindow(this.targ, GetUnitDefaultPropWindow(this.targ)*bj_DEGTORAD)
set this.light = null
set this.cast = null
set this.targ = null
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.tx = this.tx+this.x
set this.ty = this.ty+this.y
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(this.targ)
if IsTerrainWalkable(this.tx, this.ty) then
call MoveLightningEx(this.light, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetUnitX(this.targ, this.tx)
call SetUnitY(this.targ, this.ty)
endif
set this.steps = this.steps - 1
if this.steps == 0 then
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method cond takes nothing returns boolean
local thistype this
local integer lvl
local real angle
local unit u
local unit v
local real x
local real y
local player p
local real dist
if GetSpellAbilityId() == SPELL_ID then
set u = GetTriggerUnit()
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set p = GetOwningPlayer(u)
set lvl = GetUnitAbilityLevel(u, SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
if UnitFilter(p,v) then
//! runtextmacro STATIC_FIELD_ALLOC()
set this.cast = u
set this.targ = v
set this.cx = x
set this.cy = y
set this.tx = GetUnitX(v)
set this.ty = GetUnitY(v)
set angle = Atan2(this.ty-y, this.tx-x)
set dist = SquareRoot((this.tx-x)*(this.tx-x) + (this.ty-y)*(this.ty-y))
set this.dmg = MinDamage(lvl) + (dist/Aoe(lvl))*(MaxDamage(lvl)-MinDamage(lvl))
set this.x = -(dist/DURATION)*FPS*Cos(angle)
set this.y = -(dist/DURATION)*FPS*Sin(angle)
call MoveLocation(loc, x, y)
set this.cz = GetLocationZ(loc) + 20
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(v)
set this.light = AddLightningEx(LIGHTNING_ID, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
set this.steps = R2I(DURATION/FPS)
call SetUnitPropWindow(this.targ, 0)
endif
endloop
call Caster.add(x,y)
set u = null
set p = null
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.cond))
call Preload(MODEL_PATH)
set count = 0
set period = CreateTimer()
set g = CreateGroup()
set loc = Location(0,0)
set t = null
endmethod
endstruct
endscope
scope DistantFieldE
//native UnitAlive takes unit id returns boolean
globals
private constant real FPS = 0.0312500
private constant string MODEL_PATH = "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl"
private constant integer SPELL_ID = 'A003'
private constant string LIGHTNING_ID = "FORK"
private constant real LIGHTNING_RED = 1
private constant real LIGHTNING_GREEN = 0.45
private constant real LIGHTNING_BLUE = 0.15
private constant real LIGHTNING_ALPHA = 1.
private constant real DURATION = 0.75
private constant attacktype A_TYPE = ATTACK_TYPE_MAGIC
private constant damagetype D_TYPE = DAMAGE_TYPE_MAGIC
private constant real SPEED = 600.
endglobals
private constant function MaxDamage takes integer level returns real
return 75.*level
endfunction
private constant function MinDamage takes integer level returns real
return 30.*level
endfunction
private constant function Aoe takes integer level returns real
return 600 + 75.*level
endfunction
private function UnitFilter takes player source, unit targ returns boolean
return IsUnitEnemy(targ, source) and UnitAlive(targ) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE)
endfunction
//! textmacro_once STATIC_FIELD_ALLOC
if thistype(0).prev == 0 then
set count = count + 1
set this = count
else
set this = thistype(0).prev
set thistype(0).prev = thistype(0).prev.prev
endif
if thistype(0).next == 0 then
call TimerStart(period, FPS, true, function thistype.periodic)
else
set thistype(0).next.prev = this
endif
set this.next = thistype(0).next
set thistype(0).next = this
set this.prev = thistype(0)
//! endtextmacro
private struct SF extends array
unit targ
unit cast
lightning light
real dmg
real cx
real cy
real cz
real tx
real ty
real x
real y
real z
integer steps
thistype prev
thistype next
static integer count
static timer period
static group g
static location loc
method destroy takes nothing returns nothing
if this.next != 0 then
set this.next.prev = this.prev
endif
set this.prev.next = this.next
set this.prev = thistype(0).prev
set thistype(0).prev = this
if thistype(0).next == 0 then
call PauseTimer(period)
endif
call UnitDamageTarget(this.cast, this.targ, this.dmg, true, false, A_TYPE, D_TYPE, null)
call DestroyLightning(this.light)
call SetUnitPropWindow(this.targ, GetUnitDefaultPropWindow(this.targ)*bj_DEGTORAD)
set this.light = null
set this.cast = null
set this.targ = null
endmethod
static method periodic takes nothing returns nothing
local thistype this = thistype(0).next
loop
exitwhen this == 0
set this.tx = this.tx+this.x
set this.ty = this.ty+this.y
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(this.targ)
if IsTerrainWalkable(this.tx, this.ty) then
call MoveLightningEx(this.light, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetUnitX(this.targ, this.tx)
call SetUnitY(this.targ, this.ty)
endif
set this.steps = this.steps - 1
if this.steps == 0 then
call this.destroy()
endif
set this = this.next
endloop
endmethod
static method cond takes nothing returns boolean
local thistype this
local integer lvl
local real angle
local unit u
local unit v
local real x
local real y
local player p
local real dist
if GetSpellAbilityId() == SPELL_ID then
set u = GetTriggerUnit()
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set p = GetOwningPlayer(u)
set lvl = GetUnitAbilityLevel(u, SPELL_ID)
call GroupEnumUnitsInRange(g, x, y, Aoe(lvl), null)
call DestroyEffect(AddSpecialEffect(MODEL_PATH, x, y))
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
if UnitFilter(p,v) then
//! runtextmacro STATIC_FIELD_ALLOC()
set this.cast = u
set this.targ = v
set this.cx = x
set this.cy = y
set this.tx = GetUnitX(v)
set this.ty = GetUnitY(v)
set angle = Atan2(this.ty-y, this.tx-x)
set dist = SquareRoot((this.tx-x)*(this.tx-x) + (this.ty-y)*(this.ty-y))
set this.dmg = MinDamage(lvl) + (1-(dist/Aoe(lvl)))*(MaxDamage(lvl)-MinDamage(lvl))
set this.x = SPEED*FPS*Cos(angle)
set this.y = SPEED*FPS*Sin(angle)
call MoveLocation(loc, x, y)
set this.cz = GetLocationZ(loc) + 20
call MoveLocation(loc, this.tx, this.ty)
set this.z = GetLocationZ(loc) + 20 + GetUnitFlyHeight(v)
set this.light = AddLightningEx(LIGHTNING_ID, true, this.cx, this.cy, this.cz, this.tx, this.ty, this.z)
call SetLightningColor(this.light, LIGHTNING_RED, LIGHTNING_GREEN, LIGHTNING_BLUE, LIGHTNING_ALPHA)
set this.steps = R2I(DURATION/FPS)
call SetUnitPropWindow(this.targ, 0)
endif
endloop
set u = null
set p = null
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.cond))
call Preload(MODEL_PATH)
set count = 0
set period = CreateTimer()
set g = CreateGroup()
set loc = Location(0,0)
set t = null
endmethod
endstruct
endscope