The basic Idea. Hero summons a sacrificial pit. Trigger made will catch the summon, and create X amount of dummy units, those dummy units will cast life drain onto the enemy.
I got up to the life drain casting part, it just doesn't seem to work. Its using the nuetral hostile unit ability life drain.
The dummy units I have were set to nuetral hostile, and wouldn't attack.
I've set the proper acquisiton range, and range of the spell.
Right now I'm picking units within the local location and im trying to force the spel lto be cast on them. The order - use/turn on string is currently "parasite"
they have the mana and proper ability level, I've tested them by making them under my own control and they can cast it fine manually.
Thier attacks are enabled, and if I give them an attack value, they will just go melee the nearby unit.
Here is the script.
Any help and/or suggestions are appreciated
I got up to the life drain casting part, it just doesn't seem to work. Its using the nuetral hostile unit ability life drain.
The dummy units I have were set to nuetral hostile, and wouldn't attack.
I've set the proper acquisiton range, and range of the spell.
Right now I'm picking units within the local location and im trying to force the spel lto be cast on them. The order - use/turn on string is currently "parasite"
they have the mana and proper ability level, I've tested them by making them under my own control and they can cast it fine manually.
Thier attacks are enabled, and if I give them an attack value, they will just go melee the nearby unit.
Here is the script.
JASS:
function PLC takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit()) == 'usap'
endfunction
function PLA takes nothing returns nothing
local unit u = GetSummoningUnit()
local unit z = GetSummonedUnit()
local real x = GetUnitX(z)
local real y = GetUnitY(z)
local integer i = GetUnitAbilityLevel(u, 'A01O')
local real d = i+5
local integer c = i
local location l = GetUnitLoc(z)
local group g = GetUnitsInRangeOfLocAll(1000.00, l)
call UnitApplyTimedLife(z, 'BTLF', d)
loop
exitwhen c == 0
set z = CreateUnit(Player(12), 'nanm', x, y, 0)
call SetUnitVertexColor(z, 0, 0, 0, 0)
call SetUnitAbilityLevel(z,'ACdr',i)
call UnitApplyTimedLife(z, 'BTLF', d)
call SetUnitState(z, UNIT_STATE_LIFE, 10)
call IssueTargetOrder(z, "parasite", GroupPickRandomUnit(g))
set c = c-1
endloop
call RemoveLocation(l)
call DestroyGroup(g)
set g = null
set l = null
set z = null
set u = null
endfunction
//===========================================================================
function InitTrig_PL_Sac takes nothing returns nothing
set gg_trg_PL_Sac = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_PL_Sac, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_PL_Sac, Condition( function PLC ) )
call TriggerAddAction( gg_trg_PL_Sac, function PLA )
endfunction
Any help and/or suggestions are appreciated