- Joined
- Aug 31, 2006
- Messages
- 132
Well i was trying jass but the spell i made didnt work at all.
I did read any tutorial but still cant find the error -
The spell is supposed to to remove a % of hp of nearby units of the caster, but when i cast the spell absolutely nothing happens.
I did read any tutorial but still cant find the error -
JASS:
function Condy takes nothing returns boolean
return GetSpellAbilityId()=='A000'
endfunction
function MyFuncy takes nothing returns nothing
local group GroupUnits = CreateGroup()
local unit caster = GetSpellAbilityUnit()
local location temploc = GetUnitLoc(caster)
local unit temp
local integer tempnumber = 3
call GroupEnumUnitsInRangeOfLoc(GroupUnits, temploc, 400, null)
loop
set temp = FirstOfGroup(GroupUnits)
exitwhen temp == null or tempnumber == 0
call UnitDamageTarget(caster, temp, 50, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
call GroupRemoveUnit(GroupUnits, temp)
set tempnumber = tempnumber - 1
endloop
set GroupUnits = null
set caster = null
set temploc = null
set temp = null
endfunction
function InitTrig takes nothing returns nothing
local trigger gg_trg_Triggy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Triggy, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Triggy, Condition(function Condy))
call TriggerAddAction(gg_trg_Triggy, function MyFuncy)
endfunction
The spell is supposed to to remove a % of hp of nearby units of the caster, but when i cast the spell absolutely nothing happens.
Last edited by a moderator: