chadpiety123
New Member
- Reaction score
- 0
Is there something wrong? It's just supposed to buff every unit in an area including both enemies and allies. I don't get it it won't work.
EDIT: I changed it to this one and added the event, but it still won't work. I used Curse as the base ability of the buff, and blizzard as the base ability of the AoE.
EDIT2: I removed the leaks I knew how to remove and added the creategroup() function. Unfortunately, still not working. It doesn't buff the area at all.
EDIT3: Still not working after optimizing GroupActions and replacing GetTriggerUnit and GetTriggerPlayer
EDIT: I changed it to this one and added the event, but it still won't work. I used Curse as the base ability of the buff, and blizzard as the base ability of the AoE.
EDIT2: I removed the leaks I knew how to remove and added the creategroup() function. Unfortunately, still not working. It doesn't buff the area at all.
EDIT3: Still not working after optimizing GroupActions and replacing GetTriggerUnit and GetTriggerPlayer
JASS:
scope ExertionDummy
globals
private constant integer DUMMYSPELL = 039;A000039;
private constant integer MAINSPELL = 039;A001039;
private constant integer DUMMYUNIT = 039;h003039;
private constant integer TIMEDLIFE = 039;BTLF039;
private constant real LIFEDURATION = 1.5
private constant real AOE = 500
private constant string DSCOMMAND = "blizzard"
private constant string MSCOMMAND = "curse"
unit CASTER
endglobals
function ExertionGroupConditions takes nothing returns boolean
return IsUnitAliveBJ(GetFilterUnit()) == true
endfunction
function GroupActions takes nothing returns nothing
local unit u = GetEnumUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit d = CreateUnit(GetOwningPlayer(CASTER), DUMMYUNIT, x, y, 0)
call UnitApplyTimedLife(d, TIMEDLIFE, LIFEDURATION)
call UnitAddAbility(d, MAINSPELL)
call SetUnitAbilityLevel(d, MAINSPELL, GetUnitAbilityLevel(CASTER, DUMMYSPELL))
call IssueTargetOrder(d, MSCOMMAND, u)
set u = null
set d = null
endfunction
function DummyActions takes nothing returns nothing
local integer i = 0
local group g = CreateGroup()
local unit array uarray
local real locationX = GetLocationX(GetSpellTargetLoc())
local real locationY = GetLocationY(GetSpellTargetLoc())
set CASTER = GetTriggerUnit()
call GroupEnumUnitsInRange(g, locationX, locationY, AOE, Condition(function ExertionGroupConditions))
call ForGroup(g, function GroupActions)
call DestroyGroup(g)
set CASTER = null
endfunction
function DummyConditions takes nothing returns boolean
return GetSpellAbilityId() == DUMMYSPELL
endfunction
//===========================================================================
function ExertionDummyTrigger takes nothing returns nothing
local trigger ExertionDummy = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ExertionDummy, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ExertionDummy, Condition(function DummyConditions))
call TriggerAddAction(ExertionDummy, function DummyActions)
endfunction
endscope