- Joined
- Sep 25, 2005
- Messages
- 71
Was recently a bit puzzled after coming back having not touched the w3edit in what seems like forever. The idea struck me to create a spell that was "charged" like I've seen before - spell is cast, spell begins channeled, effect begins to scale to the end of channeling, and whenever the channeling is broken, the effect occurs to scale of the duration of charging.
Here's what I have so far, a basic event registry with no actual effect taking place:
I'm just a little puzzled where I set up the trigger for stopping the cast, considering I can't compile the trigger being anywhere before the init.
Here's what I have so far, a basic event registry with no actual effect taking place:
JASS:
scope chargeBall initializer init
globals
private constant integer ABIL_ID = 'A111'
endglobals
struct chargeBall
//effects go here
endstruct
private function checkChargeBall takes nothing returns boolean
//if it's the spell, then do the things
if GetSpellAbilityId() == ABIL_ID then
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "effect")
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger localTrigVar = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(localTrigVar, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition( localTrigVar, Condition(function checkChargeBall))
set localTrigVar = null
endfunction
endscope
I'm just a little puzzled where I set up the trigger for stopping the cast, considering I can't compile the trigger being anywhere before the init.