Note: I code for 1.26 war3.
I am attempting to make a simple stun system based on Flux's Buff System. However, on usage, it gives me a fatal error (this fatal error does not occur on 1.31 for some reason).
The code below uses a 'thunderbolt' spell ('A001') with the same buff as 'Aura Slow (Tornado)' ('ASTU'). The error happens 1-2 seconds after execution of " call IssueTargetOrder(dummy, "thunderbolt", this.target)". Nevertheless, execution happens.
The idea and execution of this system is not mine but @Laiev.
I am attempting to make a simple stun system based on Flux's Buff System. However, on usage, it gives me a fatal error (this fatal error does not occur on 1.31 for some reason).
The code below uses a 'thunderbolt' spell ('A001') with the same buff as 'Aura Slow (Tornado)' ('ASTU'). The error happens 1-2 seconds after execution of " call IssueTargetOrder(dummy, "thunderbolt", this.target)". Nevertheless, execution happens.
The idea and execution of this system is not mine but @Laiev.
JASS:
scope StunBuff
/* -------------------------------------------------------------------------- */
/* Stun */
/* -------------------------------------------------------------------------- */
globals
// The raw code of the ability used to stun an unit
private constant integer STUN = 'A001'
endglobals
struct StunBuff extends Buff
private static constant integer RAWCODE = 'ASTU'
private static constant integer DISPEL_TYPE = BUFF_NEGATIVE
private static constant integer STACK_TYPE = BUFF_STACK_FULL
method onRemove takes nothing returns nothing
//
endmethod
method onApply takes nothing returns nothing
local unit dummy = CreateUnit (Player(PLAYER_NEUTRAL_PASSIVE),'eRez', GetUnitX(this.target), GetUnitY(this.target), 270)
call GetRecycledDummyAnyAngle(GetUnitX(this.target), GetUnitY(this.target), GetUnitFlyHeight(this.target))
call PauseUnit(dummy, false)
call UnitAddAbility(dummy, STUN)
call IssueTargetOrder(dummy, "thunderbolt", this.target)
call DummyAddRecycleTimer(dummy, 1.)
set dummy = null
endmethod
implement BuffApply
endstruct
endscope