- Joined
- Mar 23, 2007
- Messages
- 302
hi,
Whats about:
A simple Spell that entangles a Unit for 50 dmg til it dies. Heroes only for 4 sec.
If this Unit dies then all otheru nits within 300 range will be affected with the same spell. If those unit dies, all unit in 300 range for each died unit will be affected too. And so on.... til no unit is in the range of 300 of any dying unit.
What i need:
How do i detect if a unit has a buff when it dies?
Or is there an ability that does not show up if a unit has it?
(usualy even if u cant see the ability it can move other Icons randomly, so how to preven this then?)
OR is there any way to check this? I mean the Sand King in Dota for example
has an orb that only stays 0.2 sec but if the unit dies with this buff (somting happens) it explodes.
I thougt about:
Adding a empty Spell book, placing there a dummy ability, remove spell bock so that ability stays absolutly invisible for player. When the unit dies check for this ability and cause the Trigger to work. This is realy hard to do, so if ther is any other way to do that , I would be very happy if someone would help me.
Here is what i got so far.
Whats about:
A simple Spell that entangles a Unit for 50 dmg til it dies. Heroes only for 4 sec.
If this Unit dies then all otheru nits within 300 range will be affected with the same spell. If those unit dies, all unit in 300 range for each died unit will be affected too. And so on.... til no unit is in the range of 300 of any dying unit.
What i need:
How do i detect if a unit has a buff when it dies?
Or is there an ability that does not show up if a unit has it?
(usualy even if u cant see the ability it can move other Icons randomly, so how to preven this then?)
OR is there any way to check this? I mean the Sand King in Dota for example
has an orb that only stays 0.2 sec but if the unit dies with this buff (somting happens) it explodes.
I thougt about:
Adding a empty Spell book, placing there a dummy ability, remove spell bock so that ability stays absolutly invisible for player. When the unit dies check for this ability and cause the Trigger to work. This is realy hard to do, so if ther is any other way to do that , I would be very happy if someone would help me.
Here is what i got so far.
JASS:
function Trig_Painroots_Conditions takes nothing returns boolean
return (GetUnitAbilityLevel(GetDyingUnit(), 'B004') > 0) == true
endfunction
function Trig_Painroots_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
local unit b
local unit u2
local player P = GetOwningPlayer(u)
local location L = GetUnitLoc(u)
local real X = GetUnitX(u)
local real Y = GetUnitY(u)
local group G = GetUnitsInRangeOfLocAll(300.00, L)
call DisplayTimedTextToPlayer(Player(0),0,0,60,"Spell: Start")
call RemoveLocation(L)
set L = null
call DisplayTimedTextToPlayer(Player(0),0,0,60,"Spell: Location Removed + Start Loop")
loop
set u2 = FirstOfGroup(G)
exitwhen u2 == null
if (((GetUnitState(u2, UNIT_STATE_LIFE) > 0 )==true)and( u2 != GetDyingUnit())and(IsUnitType(u2,UNIT_TYPE_STRUCTURE )== false)) then
set b = CreateUnit(P,'n00I',X,Y,0 )
call DisplayTimedTextToPlayer(Player(0),0,0,60,"Spell: Unit Created")
call IssueTargetOrder( b, "entanglingroots",u2)
call UnitApplyTimedLife( b, 'BTLF',2.00 )
endif
call GroupRemoveUnit(G, u2)
endloop
call DisplayTimedTextToPlayer(Player(0),0,0,60,"Spell: End Spell + End Loop")
call DestroyGroup(G)
set P = null
set G = null
set b = null
set u = null
set u2 = null
set L = null
endfunction