- Joined
- Feb 11, 2011
- Messages
- 1,860
Hello,
I decided to try xe for a spell request I am working on involving a missile. I can't seem to get xemissile working properly, perhaps someone could explain? I'm not good at simply reading and understanding others' code.
This is what I have so far:
- How can I add a model to the missile?
- How can I get onHit working? Currently nothing happens...
Thanks,
Mr_Bean
EDIT: Just realised this should be posted in Triggers and Scripts, sorry!
I decided to try xe for a spell request I am working on involving a missile. I can't seem to get xemissile working properly, perhaps someone could explain? I'm not good at simply reading and understanding others' code.
This is what I have so far:
JASS:
private struct Data extends xemissile
unit caster
xemissile missile
method onHit takes nothing returns nothing
call KillUnit(.caster)
endmethod
private static method create takes unit c, real x, real y returns thistype
local thistype this = thistype.allocate(GetUnitX(c), GetUnitY(c), 0.0, x, y, 0.0)
set .caster = GetTriggerUnit()
set .missile = xemissile.create(GetUnitX(.caster), GetUnitY(.caster), 0.0, x, y, 0.0)
call .missile.launch(1000.0, 0.25)
return this
endmethod
private static method spell takes nothing returns nothing
call thistype.create(GetTriggerUnit(), GetSpellTargetX(), GetSpellTargetY())
endmethod
private static method onInit takes nothing returns nothing
call RegisterSpellEffectEvent(SPELL_ID, function thistype.spell)
endmethod
endstruct
- How can I get onHit working? Currently nothing happens...
Thanks,
Mr_Bean
EDIT: Just realised this should be posted in Triggers and Scripts, sorry!