Komaqtion
You can change this now in User CP.
- Reaction score
- 469
Hi!
Since my last/first spell now finally got approved (Thanks Andrewgosu !!! ) I thought i could start on my next one
But, right away i got problems... Here's the current trigger:
This spell is supposed to create effects every 0.05 seconds at the caster (It's not nearly finished so haven't gotten to the point of destroying the effects or the data or anything yet).
This it now does, though the effects never gets destroyed and the other effects, like the movement speed and stuff never gets set back either
What's wrong (If you checked my other spell you know I'm only learning vJASS atm, so this is what i come up with XD)
Since my last/first spell now finally got approved (Thanks Andrewgosu !!! ) I thought i could start on my next one
But, right away i got problems... Here's the current trigger:
JASS:
scope SearingDash initializer init
globals
private constant integer ABIL_ID = 039;A000039;
private constant string EFFECT_1 = "Environment\\SmallBuildingFire\\SmallBuildingFire2.mdl"
endglobals
globals
endglobals
private struct Data
effect e
real x
real y
real speed
unit caster
timer t
boolean b = false
static method create takes unit u returns Data
local Data d = Data.allocate()
set d.caster = u
return d
endmethod
method onDestroy takes nothing returns nothing
local Data d = Data.allocate()
call DestroyEffect(.e)
endmethod
endstruct
private function Spell_Check takes nothing returns boolean
return GetSpellAbilityId() == ABIL_ID
endfunction
private function Periodic takes nothing returns boolean
local Data d = KT_GetData()
set d.t = NewTimer()
set d.x = GetUnitX(d.caster)
set d.y = GetUnitY(d.caster)
set d.e = AddSpecialEffect(EFFECT_1,d.x,d.y)
return d.b
endfunction
private function TimerStop takes nothing returns nothing
local Data D = KT_GetData()
set D.b = true
call SetUnitMoveSpeed(D.caster, D.speed)
call SetUnitPathing(D.caster,true)
call SetUnitVertexColor(D.caster,255,255,255,100)
call D.destroy()
endfunction
private function Spell takes nothing returns nothing
local Data D = Data.create(GetTriggerUnit())
set D.t = NewTimer()
set D.x = GetUnitX(D.caster)
set D.y = GetUnitY(D.caster)
set D.speed = GetUnitMoveSpeed(D.caster)
call SetUnitMoveSpeed(D.caster, 522)
call SetUnitPathing(D.caster,false)
call SetUnitVertexColor(D.caster,255,255,255,85)
call KT_Add(function Periodic, D, 0.1)
call TimerStart(D.t,5,false,function TimerStop)
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 Spell)
endfunction
endscope
This spell is supposed to create effects every 0.05 seconds at the caster (It's not nearly finished so haven't gotten to the point of destroying the effects or the data or anything yet).
This it now does, though the effects never gets destroyed and the other effects, like the movement speed and stuff never gets set back either
What's wrong (If you checked my other spell you know I'm only learning vJASS atm, so this is what i come up with XD)