• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

After Spell nothing happens??

Status
Not open for further replies.
Level 8
Joined
Mar 23, 2007
Messages
302
Ok, here we go again, i cant figure out whats wrong here...

what is this about:
Its a Spell, kind a ultimate of a city. Costs 0 mana and has a 360sec coldown.
Target unit gets catched by entangling roots til it dies , dealing 50 dmg every second. If this unit dies, every unit within 300 range will be entangled too, a.s.o.

what does not work:
ehm, nothing, means after the first entanged dead unit no other unit is affected.

Details:
This trigger runs whenever a unit dies With Specific Buff
I used 2 different spells for this and a new created Buff.
the first one is for the City to be able to cast it all over the world.
the second one is for the DUMMY unit to cast it after the dead of an affected unit. Ths Buff is given to both spells.

The Code:
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 RemoveLocation(L)
set L = null
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 IssueTargetOrder( b, "entanglingroots",u2)
    call UnitApplyTimedLife(  b, 'BTLF',4.00 )
    endif
    call GroupRemoveUnit(G, u2)
endloop
call DestroyGroup(G)
set P = null
set G = null
set b = null
set u = null
set u2 = null
set L = null
endfunction

What i did not forget:
I checked the integers (mb i did somthing wrong there, but no, all fine)
I checked the Manacosts, Range, allowedTargets, etc
This is why i realy have no idead why nothing happens.

So, after that all i was wondering if some one here could help me Out...
PLEAS
 
Level 8
Joined
Mar 23, 2007
Messages
302
he?
i dont get what u mean. :weekani:
u mean i can NOT check if a dying unit has a specific buff
and if it has it then do whatever.
i think i can, i will check this.

and the other thing, pleas explain it a bit more.

no offense, cuz after reading it again, i feel this sound like it.
 
Level 9
Joined
May 27, 2006
Messages
498
As the entangled unit is immobiled forever (until it dies), just set its position at the beggining of the spell, and also set the entangled unit to a variable. Then make another trigger that checks if that unit dies. Example:
Variables:
TempPoint - point type variable, position of entangled unit
EntangledUnitVar - unit type variable, the first unit entangled
  • Events:
    • Unit - A unit dies.
  • Conditions:
    • (Triggering unit) equal to EntangledUnitVar
  • Actions:
    • Custom script: set bj_WantDestroyGroup=true
    • Unit Group - Pick every unit in range 300 of TempPoint and do (Actions)
      • Do blah blah blah...
    • Custom script: call RemoveLocation(udg_TempPoint)

@Equal
I think Wolf means to place a dummy unit at position of the entangled one, am i right?

EDIT:
Sorry i wrote it as a trigger, not code, but im completely noobish at JASS :p
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
There is a cool way for that which I love
when someone is entagled
local unit target = entagle
loop
exitwhen target is dead
TSA(0.5)
endloop
entagle others
 
Status
Not open for further replies.
Top