so i decided to learn JASS, I understand the general idea and when i see a basic script i can understand what the elements do. BUT i can't manage to get them right myself. here is the code, im trying to learn JASS so i don't care if sombody yells at me because i can only learn right . I got loads of errors when trying to test my map. The script is for a (basic?) heal spell. but i don't know if i used the 'Ahea' thing right. (took it from the heal spell in the object manager) I created this script by looking at many tutorials on this site, it's not a copy i wrote everything myself but i looked at the tuts to get a general idea on how to set it up(if that makes sence?)
hope sombody wants to tell me what is wrong here
thanks!
JASS:
function Cond takes nothing returns boolean
return GetSpellAbilityId()=='Ahea'
endfunction
function Action takes nothing returns real heal
local unit caster
local real heal
local integer level
set caster = GetTriggerUnit()
set level = GetHeroLevel(caster)
if level < 2 then
set heal = 30.
elseif level == 2 then
set heal = 35.
elseif level == 3 then
set heal = 45.
return heal
endif
endfunction
//---------------------------------------------------
function InitTrig_heal takes nothing returns nothing
local trigger t
set t =CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t Condition(function Cond))
call TriggerAddAction(t, function Action)
endfunction
hope sombody wants to tell me what is wrong here
thanks!