- Joined
- Jul 9, 2008
- Messages
- 253
Hey guys, I'm here again. Sorry if I disappoint the people that told me to only use X and Y but I just can't get it working
Here is my code:
My idea for this spell was that it simply did a AoE heal, but instead it does nothing.
Help would be appreciated
Thanks in advance, Quetzalcotl
Here is my code:
JASS:
function Trig_Life_Seed_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A009'
endfunction
function Trig_Life_Seed_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local unit u
local group g
local player p
local string sfx = "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl"
local real int = GetHeroInt(caster,true)
local real heal = 2 * int
local location loc = GetSpellTargetLoc()
local location loc2
local real X
local real Y
local integer x = 0
//Actions//
set g = GetUnitsInRangeOfLocAll(250, loc)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if IsUnitAlly(u, p) then
call SetUnitState(u,UNIT_STATE_LIFE,(GetUnitState(u,UNIT_STATE_LIFE)) + heal)
endif
call GroupRemoveUnit(g,u)
set u = null
endloop
call DestroyGroup(g)
loop
exitwhen x > 4
set loc2 = PolarProjectionBJ(loc, 125,(x * 60))
set X = GetLocationX(loc2)
set Y = GetLocationY(loc2)
call DestroyEffect(AddSpecialEffect(sfx,X,Y))
call RemoveLocation(loc2)
set loc2 = null
set x = x + 1
endloop
call RemoveLocation(loc)
//Actions//
set caster = null
set g = null
set sfx = null
set p = null
set loc = null
endfunction
//===========================================================================
function InitTrig_Life_Seed takes nothing returns nothing
set gg_trg_Life_Seed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Life_Seed, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Life_Seed, Condition( function Trig_Life_Seed_Conditions ) )
call TriggerAddAction( gg_trg_Life_Seed, function Trig_Life_Seed_Actions )
endfunction
My idea for this spell was that it simply did a AoE heal, but instead it does nothing.
Help would be appreciated
Thanks in advance, Quetzalcotl