- Joined
- Oct 16, 2011
- Messages
- 308
I was looking for a way to make a Spell Steal using Flux's Buff System which would also work on buffs whose effects arent really triggered (Polymorph, Inner Fire, Banish, etc.) by adding the 'OrderId' of a casted spell and a 'SpellStealPriority' integer in its Buff in the Buff System. My idea is:
Link to Flux's Buff System
- Loop and get the buff with highest 'SpellStealPrio'
- Remove the buff
- Dummy casts the buff on another unit using its 'OrderId'
Link to Flux's Buff System
JASS:
scope HumanPolymorph
struct HumanPolymorphBuff extends Buff
private timer t
private static constant integer RAWCODE = 'A035' // Blank/Dummy Ability
private static constant integer DISPEL_TYPE = BUFF_NEGATIVE
private static constant integer STACK_TYPE = BUFF_STACK_NONE
method onRemove takes nothing returns nothing
call UnitRemoveAbility(this.target, 'Bply')
endmethod
method onApply takes nothing returns nothing
endmethod
implement BuffApply
endstruct
struct HumanPolymorph extends array
private static method onCast takes nothing returns nothing
local HumanPolymorphBuff b
set b = HumanPolymorphBuff.add(GetTriggerUnit(), GetSpellTargetUnit())
set b.duration = 60
endmethod
static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent('Aply', function thistype.onCast)
endmethod
endstruct
endscope
JASS:
scope HumanInnerFire
struct HumanInnerFireBuff extends Buff
private timer t
private static constant integer RAWCODE = 'A035' // Blank/Dummy Ability
private static constant integer DISPEL_TYPE = BUFF_POSITIVE
private static constant integer STACK_TYPE = BUFF_STACK_NONE
method onRemove takes nothing returns nothing
call UnitRemoveAbility(this.target, 'Binf')
endmethod
method onApply takes nothing returns nothing
endmethod
implement BuffApply
endstruct
struct HumanInnerFire extends array
private static method onCast takes nothing returns nothing
local HumanInnerFireBuff b
set b = HumanInnerFireBuff.add(GetTriggerUnit(), GetSpellTargetUnit())
set b.duration = 60
endmethod
static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent('Ainf', function thistype.onCast)
endmethod
endstruct
endscope