Hello Hive
I've trying to get a spell done in JASS.
Basically it is a target AoE spell. All friendly units in the AoE temporarily receive a spell (actually a self-only aura) that lasts until they lose the spell debuff
After a long time correcting syntax so the editor would allow me to 'turn on' the thing, now I find out that it does not work at all (The target units receive no new ability)
Here's the trigger, keep in mind that I'm yet a newbie in the ways of JASS so this may hurt the eyes of seasoned JASSers.
I know that I've not cleared, destroyed and nulled the 'group' local variable, but will the trigger work if I do? I mean, if the group is destroyed before the units lose the buff, wouldn't they remain with the spell given permanently?
I've trying to get a spell done in JASS.
Basically it is a target AoE spell. All friendly units in the AoE temporarily receive a spell (actually a self-only aura) that lasts until they lose the spell debuff
After a long time correcting syntax so the editor would allow me to 'turn on' the thing, now I find out that it does not work at all (The target units receive no new ability)
Here's the trigger, keep in mind that I'm yet a newbie in the ways of JASS so this may hurt the eyes of seasoned JASSers.
JASS:
function InnerV_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A00E' //AoE SPELL THAT WILL ACT AS THE 'TEMPORARY BUFF'
endfunction
function InnerV_Allies takes nothing returns boolean //SUPPOSEDLY THIS FILTERS OUT ENEMY UNITS
if(IsUnitEnemy(GetEnumUnit(),GetOwningPlayer(GetSpellAbilityUnit()))) then
return false
endif
return true
endfunction
function InnerV_Buff takes nothing returns nothing
call UnitAddAbility(GetEnumUnit(),'A000') //ABILITY GRANTED TO THE TARGET UNITS
loop
call TriggerSleepAction(.5)
exitwhen(GetUnitAbilityLevel(GetEnumUnit(),'B017')<1) //BUFF PLACED BY THE 'A00E' SPELL
endloop
call UnitRemoveAbility(GetEnumUnit(),'A000')
endfunction
function InnerV_Actions takes nothing returns nothing//THIS FUNCTION (SUPPOSEDLY) DEFINES THE UNIT GROUP
local location targetarea = GetSpellTargetLoc()
local group targets = CreateGroup()
call GroupEnumUnitsInRangeOfLoc(targets,targetarea,325,Filter(function InnerV_Allies))
call ForGroup(targets,function InnerV_Buff)
endfunction
//===========================================================================
function InitTrig_Inner_Vitality_Aura takes nothing returns nothing
local trigger Inner_Vitality_Aura = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Inner_Vitality_Aura,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Inner_Vitality_Aura,Condition(function InnerV_Conditions))
call TriggerAddAction(Inner_Vitality_Aura,function InnerV_Actions)
set Inner_Vitality_Aura = null
endfunction
I know that I've not cleared, destroyed and nulled the 'group' local variable, but will the trigger work if I do? I mean, if the group is destroyed before the units lose the buff, wouldn't they remain with the spell given permanently?