- Joined
- Feb 28, 2007
- Messages
- 3,480
O hai, I just finished my first vJass spell, and I just wanna know if iamdoinitrite.
Yah, it's a simple spell, but it's just for training, obviously.
Thanks.
Yah, it's a simple spell, but it's just for training, obviously.
JASS:
scope Fire initializer Init
globals
private constant integer SPELL_ID = 'A000'
private constant real DAMAGE = 50
private constant damagetype D_TYPE = DAMAGE_TYPE_NORMAL
private constant attacktype A_TYPE = ATTACK_TYPE_MAGIC
endglobals
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELL_ID
endfunction
private function Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit target = GetSpellTargetUnit()
call UnitDamageTarget(caster,target,DAMAGE,true,false,A_TYPE,D_TYPE,null)
set caster = null
set target = null
endfunction
private function Init takes nothing returns nothing
local trigger Trg = CreateTrigger()
call TriggerAddAction(Trg, function Actions)
call TriggerAddCondition(Trg, Condition(function Conditions))
call TriggerRegisterAnyUnitEventBJ(Trg,EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
endscope
Last edited: