How to destroy the timer?

Komaqtion

You can change this now in User CP.
Reaction score
469
Hi!
I've created a spell, which creates some effects and then some dummies that move out from the caster.

Everything works except that the timer never stops :(
And i have no idea how to stop it after some time, since if i use TriggerSleepAction, it's not MUI anymore since i've used some globals that get overwritten.

And also, the dumies move faster each time i use the spell-

(Note: I'm new to JASS so might not understand everything :( Please explain :D)

JASS:
scope Dummy initializer init
globals
    private unit array du
    private real array pointx
    private real array pointy
    private constant string e = "Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl"
    private constant string e2 = "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"
    private constant string e1 = "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"
    private constant integer SPELL_ID = '0000'
    private constant integer unitid = 'h000'
    private constant integer aid = 'Aloc'
    private constant integer bid = 'BTLF'
endglobals

private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function Move_Dummy takes nothing returns nothing
local unit u = GetTriggerUnit()
local real xd
local real yd
local integer i = 0
    loop
        exitwhen i==16
        set xd = GetUnitX(du<i>)
        set yd = GetUnitY(du<i>)
        set pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        call SetUnitX(du<i>,pointx<i>)
        call SetUnitY(du<i>,pointy<i>)
        set i = i+1
    endloop
endfunction

private function Effects takes nothing returns nothing
    local integer i = 0
    local unit u = GetTriggerUnit()
    local real xu = GetUnitX(u)
    local real yu = GetUnitY(u)
    local player p = GetOwningPlayer(u)
    local timer t = CreateTimer()
    call DestroyEffect(AddSpecialEffect(e,xu,yu))
    loop
        exitwhen i==16
        set pointx<i> = xu+200*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yu+200*Sin((i*22.5)*bj_DEGTORAD)
        call DestroyEffect(AddSpecialEffect(e,pointx<i>,pointy<i>))
        call DestroyEffect(AddSpecialEffect(e2,pointx<i>,pointy<i>))
        call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        set du<i> = CreateUnit(p,unitid,xu,yu,bj_RADTODEG*Atan2(pointy<i>-yu,pointx<i>-xu))
        call UnitApplyTimedLife(du<i>,&#039;BTLF&#039;,2.5)
        call UnitAddAbility(du<i>,aid)
        call AddSpecialEffectTarget(e1,du<i>,&quot;chest&quot;)
        set i = i+1
    endloop
    call TimerStart(t,0.05,true,function Move_Dummy)
    set u = null
    set p = null
    call TriggerSleepAction(2.5)
    call DestroyTimer(t)
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
    set t = null
endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Data does not transfer from one function to another without a struct/timer attaching system.

Once you get those you can use an integer variable "ticks".
Everytime the callback function runs, set "ticks" equal to "ticks + 0.05".
Once ticks reaches "2.5" then destroy the timer.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Do you know of any good attachment systems then ??? Preferably easy to use :S

And btw, am i currently using the timer in the correct way ??
 

Viikuna

No Marlo no game.
Reaction score
265
Actually, you should never destroy timers. They should be recycled like TimerUtils does, or you can use static timers like KT2 does.

I think you can just fine use them both. KT2 is good for periodic timers, like knockbacks and damage over time and stuff like that. TimerUtils is more flexible so you can use it in cases where KT2 does not work.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, since i'm moving the dummies here, should i then use KT2 ??

And could some1 help me use this script with KT2 ???

JASS:
private function Move_Dummy takes nothing returns nothing
local unit u = GetTriggerUnit()
local real xd
local real yd
local integer i = 0
    loop
        exitwhen i==16
        set xd = GetUnitX(du<i>)
        set yd = GetUnitY(du<i>)
        set pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        call SetUnitX(du<i>,pointx<i>)
        call SetUnitY(du<i>,pointy<i>)
        set i = i+1
    endloop
endfunction

</i></i></i></i></i></i></i></i></i></i>


Since this is what i use for moving the dummies :D
 

WolfieeifloW

WEHZ Helper
Reaction score
372
I use TU (Blue flavour) just because it's what I used when I was learning.
A struct would also make this all much easier :p .
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just to test, i tried using the exec count, since it just can't seem to understand structs :(, and this is what i got:

JASS:
scope Dummy initializer init
globals
    private unit array du
    private real array pointx
    private real array pointy
    private constant string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
    private constant string e2 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;
    private constant string e1 = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;
    private constant integer SPELL_ID = &#039;0000&#039;
    private constant integer unitid = &#039;h000&#039;
    private constant integer aid = &#039;Aloc&#039;
    private constant integer bid = &#039;BTLF&#039;
endglobals

private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

function Move_Dummy takes nothing returns nothing
local unit u = GetTriggerUnit()
local real xd
local real yd
local integer i = 0
    loop
        exitwhen i==16
        set xd = GetUnitX(du<i>)
        set yd = GetUnitY(du<i>)
        set pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        call SetUnitX(du<i>,pointx<i>)
        call SetUnitY(du<i>,pointy<i>)
        set i = i+1
    endloop
endfunction

private function Effects takes nothing returns nothing
    local integer execCount = GetTriggerExecCount(GetTriggeringTrigger())
    local unit u = GetTriggerUnit()
    local real xu = GetUnitX(u)
    local real yu = GetUnitY(u)
    local player p = GetOwningPlayer(u)
    local timer array t
    local integer array i
    set t[execCount] = CreateTimer()
    set i[execCount] = 0
    call DestroyEffect(AddSpecialEffect(e,xu,yu))
    loop
        exitwhen i[execCount]==16
        set pointx[i[execCount]] = xu+200*Cos((i[execCount]*22.5)*bj_DEGTORAD)
        set pointy[i[execCount]] = yu+200*Sin((i[execCount]*22.5)*bj_DEGTORAD)
        call DestroyEffect(AddSpecialEffect(e,pointx[i[execCount]],pointy[i[execCount]]))
        call DestroyEffect(AddSpecialEffect(e2,pointx[i[execCount]],pointy[i[execCount]]))
        call UnitDamagePoint(u,0,10,pointx[i[execCount]],pointy[i[execCount]],50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        set du[i[execCount]] = CreateUnit(p,unitid,xu,yu,bj_RADTODEG*Atan2(pointy[i[execCount]]-yu,pointx[i[execCount]]-xu))
        call UnitApplyTimedLife(du[i[execCount]],&#039;BTLF&#039;,2.5)
        call UnitAddAbility(du[i[execCount]],aid)
        call AddSpecialEffectTarget(e1,du[i[execCount]],&quot;chest&quot;)
        set i[execCount] = i[execCount]+1
    endloop
    call TimerStart(t[execCount],0.05,true,function Move_Dummy)
    set u = null
    set p = null
    call TriggerSleepAction(2.5)
    set execCount = GetTriggerExecCount(GetTriggeringTrigger())
    call PauseTimer(t[execCount])
    call DestroyTimer(t[execCount])
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
    set t = null
endfunction
endscope</i></i></i></i></i></i></i></i></i></i>


But doesn't work :(
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
A struct will throw away these massive variables. Jass is as easy as ABC to achieve MUI with many systems nowadays.

This is the fully MUI version : (Needs ABC)

JASS:
scope Dummy initializer init

globals
    private constant string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
    private constant string e2 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;
    private constant string e1 = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;
    private constant integer SPELL_ID = &#039;0000&#039;
    private constant integer unitid = &#039;h000&#039;
    private constant integer aid = &#039;Aloc&#039;
    private constant integer bid = &#039;BTLF&#039;
endglobals


private struct Data
    unit array du [17]
    unit cs
    real array pointx [17]
    real array pointy [17]
    
    static method create takes unit u returns Data
        local Data a = Data.allocate()
        set a.cs = u
        return a
    endmethod
    
endstruct
private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function Move_Dummy takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local Data a = GetTimerStructA(t)
    local real xd
    local real yd
    local integer i = 0
    loop
        exitwhen i==16
        set xd = GetUnitX(a.du<i>)
        set yd = GetUnitY(a.du<i>)
        set a.pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set a.pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        call SetUnitX(a.du<i>,a.pointx<i>)
        call SetUnitY(a.du<i>,a.pointy<i>)
        set i = i+1
    endloop
    set t = null
endfunction

private function Effects takes nothing returns nothing
    local Data a = Data.create(GetTriggerUnit())
    local real xu = GetUnitX(a.cs)
    local real yu = GetUnitY(a.cs)
    local player p = GetOwningPlayer(a.cs)
    local timer t = CreateTimer()
    local integer i = 0
    call DestroyEffect(AddSpecialEffect(e,xu,yu))
    loop
        exitwhen i&gt;=16
        set a.pointx<i> = xu+200*Cos((i*22.5)*bj_DEGTORAD)
        set a.pointy<i> = yu+200*Sin((i*22.5)*bj_DEGTORAD)
        call DestroyEffect(AddSpecialEffect(e,a.pointx<i>,a.pointy<i>))
        call DestroyEffect(AddSpecialEffect(e2,a.pointx<i>,a.pointy<i>))
        call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        set a.du<i> = CreateUnit(p,unitid,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
        call UnitApplyTimedLife(a.du<i>,&#039;BTLF&#039;,2.5)
        call UnitAddAbility(a.du<i>,aid)
        call AddSpecialEffectTarget(e1,a.du<i>,&quot;chest&quot;)
        set i = i+1
    endloop
    call SetTimerStructA(t,a)
    call TimerStart(t,0.05,true,function Move_Dummy)
    set p = null
    call TriggerSleepAction(2.5)
    call ClearTimerStructA(t)
    call PauseTimer(t)
    call DestroyTimer(t)
    set t = null
    call a.destroy()
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
    set t = null
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


Key Timers 2 version :
JASS:
scope Dummy initializer init

globals
    private constant string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
    private constant string e2 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;
    private constant string e1 = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;
    private constant integer SPELL_ID = &#039;0000&#039;
    private constant integer unitid = &#039;h000&#039;
    private constant integer aid = &#039;Aloc&#039;
    private constant integer bid = &#039;BTLF&#039;
endglobals


private struct Data
    unit array du [17]
    unit cs
    real array pointx [17]
    real array pointy [17]
    boolean b
    
    static method create takes unit u returns Data
        local Data a = Data.allocate()
        set a.cs = u
        set a.b = false
        return a
    endmethod
    
endstruct
private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function Move_Dummy takes nothing returns boolean
    local Data a = KT_GetData()
    local real xd
    local real yd
    local integer i = 0
    loop
        exitwhen i==16
        set xd = GetUnitX(a.du<i>)
        set yd = GetUnitY(a.du<i>)
        set a.pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set a.pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        call SetUnitX(a.du<i>,a.pointx<i>)
        call SetUnitY(a.du<i>,a.pointy<i>)
        set i = i+1
    endloop
    return a.b
endfunction

private function Effects takes nothing returns nothing
    local Data a = Data.create(GetTriggerUnit())
    local real xu = GetUnitX(a.cs)
    local real yu = GetUnitY(a.cs)
    local player p = GetOwningPlayer(a.cs)
    local integer i = 0
    call DestroyEffect(AddSpecialEffect(e,xu,yu))
    loop
        exitwhen i&gt;=16
        set a.pointx<i> = xu+200*Cos((i*22.5)*bj_DEGTORAD)
        set a.pointy<i> = yu+200*Sin((i*22.5)*bj_DEGTORAD)
        call DestroyEffect(AddSpecialEffect(e,a.pointx<i>,a.pointy<i>))
        call DestroyEffect(AddSpecialEffect(e2,a.pointx<i>,a.pointy<i>))
        call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        set a.du<i> = CreateUnit(p,unitid,xu,yu,bj_RADTODEG*Atan2(a.pointy<i>-yu,a.pointx<i>-xu))
        call UnitApplyTimedLife(a.du<i>,&#039;BTLF&#039;,2.5)
        call UnitAddAbility(a.du<i>,aid)
        call AddSpecialEffectTarget(e1,a.du<i>,&quot;chest&quot;)
        set i = i+1
    endloop
    call KT_Add(function Move_Dummy,a,.05)
    set p = null
    call TriggerSleepAction(2.5)
    set a.b = true
    call a.destroy()
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
    set t = null
endfunction
endscope

</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


For Jass Newbie, I suggest you use ABC, since it is easier to understand how the system works.
P/S : When Jesus4lyf saw this thread, he will suggest you use his KT2 since his system is faster, better and so on. :D
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
I suggest you use ABC, since it is easier to understand how the system works.
Not really. You don't have to clear the struct's value and such with most other known methods, and how can anything be easier to understand than Set/Get?

And also
JASS:
call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
</i></i>

:nuts:
JASS:
        call AddSpecialEffectTarget(e1,a.du<i>,&quot;chest&quot;)
</i>

Where are you destroying this?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
And also
JASS:
call UnitDamagePoint(a.cs,0,10,a.pointx<i>,a.pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
</i></i>



What's wrong here ???

EDIT: Do you mean it should be damage target ??
I don't really kow that much about unit groups in JASS :S

JASS:
        call AddSpecialEffectTarget(e1,a.du<i>,&quot;chest&quot;)
</i>

Where are you destroying this?


How would i go about destroying this then?? I've heard something about structs, .onDestroy :S
 

wraithseeker

Tired.
Reaction score
122
That would work? If you are using AddSpecialEffectTarget doesn't it usually mean the effect doesn't have a death animation?

Make another struct member a effect and then refer that effect to this created effect and then destroy it on onDestroy.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Please explain, wraithseeker :( I can't understand !

And kingkingyyk3, as wraithseeker said, i can't be destroyed right away, since it's lika a buff effect, and needs to be destroyed when the dummies are destroyed.
Meaning after 2.5 seconds :D
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Then use this extremely useful little snippet:

JASS:
function d takes effect f, real t returns nothing
    call TriggerSleepAction(t)
    call DestroyEffect(f)
endfunction

function DestroyEffectTimed takes effect f, real t returns nothing
    call d.execute(f, t)
endfunction


Which is called this way:
JASS:
call DestroyEffectTimed(AddSpecialEffectTarget(...), 2.5)


EDIT: Do you mean it should be damage target ??
I don't really kow that much about unit groups in JASS :S
DamagePoint damages everything within that point, be it allied, enemy or neutral. Heck, it even damages the caster. Not to mention that it disconnects mac users. Grouping the units would be a better way of progressing.

JASS:
scope Dummy initializer init
globals
    private unit array du
    private real array pointx
    private real array pointy
    private constant string e = &quot;Abilities\\Spells\\Human\\Flare\\FlareCaster.mdl&quot;
    private constant string e2 = &quot;Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl&quot;
    private constant string e1 = &quot;Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl&quot;
    private constant integer SPELL_ID = &#039;0000&#039;
    private constant integer unitid = &#039;h000&#039;
    private constant integer aid = &#039;Aloc&#039;
    private constant integer bid = &#039;BTLF&#039;
    private player SomePlayer
endglobals

private function Spell_Check takes nothing returns boolean
    return GetSpellAbilityId() == SPELL_ID
endfunction

private function GroupEm takes nothing returns boolean
    if GetWidgetLife(GetFilterUnit()) &gt; 0.405 and IsUnitEnemy(GetFilterUnit(), SomePlayer) and IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE == false then
           call UnitDamageTarget(GetFilterUnit(), GetFilterUnit(), 50, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
     endif
     return false
endfunction

private function Move_Dummy takes nothing returns nothing
local unit u = GetTriggerUnit()
local real xd
local real yd
local integer i = 0
   loop
        exitwhen i==16
        set xd = GetUnitX(du<i>)
        set yd = GetUnitY(du<i>)
        set pointx<i> = xd+10*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yd+10*Sin((i*22.5)*bj_DEGTORAD)
        set SomePlayer = GetOwningPlayer(u)
        call GroupEnumUnitsInRange(g, pointx<i>, pointy<i>, 10, Filter(function GroupEm)) // We&#039;ll be damaging them in the filter function
    //    call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        call SetUnitX(du<i>,pointx<i>)
        call SetUnitY(du<i>,pointy<i>)
        set i = i+1
    endloop
endfunction

private function Effects takes nothing returns nothing
    local integer i = 0
    local unit u = GetTriggerUnit()
    local real xu = GetUnitX(u)
    local real yu = GetUnitY(u)
    local player p = GetOwningPlayer(u)
    local timer t = CreateTimer()
    call DestroyEffect(AddSpecialEffect(e,xu,yu))
    loop
        exitwhen i==16
        set pointx<i> = xu+200*Cos((i*22.5)*bj_DEGTORAD)
        set pointy<i> = yu+200*Sin((i*22.5)*bj_DEGTORAD)
        call DestroyEffect(AddSpecialEffect(e,pointx<i>,pointy<i>))
        call DestroyEffect(AddSpecialEffect(e2,pointx<i>,pointy<i>))
// Same deal here as the above. You can just use the same filter function here too
        set SomePlayer = GetOwningPlayer(u)
        call GroupEnumUnitsInRange(g, pointx<i>, pointy<i>, 10, Filter(function GroupEm))
        //   call UnitDamagePoint(u,0,10,pointx<i>,pointy<i>,50,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
        set du<i> = CreateUnit(p,unitid,xu,yu,bj_RADTODEG*Atan2(pointy<i>-yu,pointx<i>-xu))
        call UnitApplyTimedLife(du<i>,&#039;BTLF&#039;,2.5)
        call UnitAddAbility(du<i>,aid)
        call AddSpecialEffectTarget(e1,du<i>,&quot;chest&quot;)
        set i = i+1
    endloop
    call TimerStart(t,0.05,true,function Move_Dummy)
    set u = null
    set p = null
    call TriggerSleepAction(2.5)
    call DestroyTimer(t)
endfunction

private function init takes nothing returns nothing
    local trigger t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t,Condition(function Spell_Check))
    call TriggerAddAction(t,function Effects)
endfunction
endscope
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top