• 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.

[Solved] Buffs and Dead Units

Status
Not open for further replies.
Level 11
Joined
Oct 11, 2012
Messages
711
Hey all. Help with the following trigger please, thanks.
JASS:
function Actions takes nothing returns nothing
    if GetUnitAbilityLevel(GetDyingUnit(), 'Besh') > 0 then
        call DisplayTextToPlayer( Player(0), 0, 0, "test" )
    endif
endfunction
function InitTrig_u takes nothing returns nothing
    set gg_trg_u = CreateTrigger()
    call TriggerRegisterUnitEvent( gg_trg_u, gg_unit_nfsh_0001, EVENT_UNIT_DEATH )
    call TriggerAddAction(gg_trg_u, function Actions)
endfunction

I cannot figure out why it does not work....

Edit:
It seems like that you cannot check the buff of a dying unit....
 
Last edited by a moderator:
Level 4
Joined
Aug 18, 2013
Messages
71
From the looks of your code, this is you playing with jass to see how it works, am I wrong?

I'd imagine a dead unit would no longer have buffs since the unit's flags change but the targetable flags do not. Basically, you can't apply an ability to a dead unit unless it is allowed, and buffs are even goofier.

You could use DDS and detect when a unit is about to die? Then kill it in case of a miracle :) God works in strange ways ;P
 
Level 11
Joined
Oct 11, 2012
Messages
711
From the looks of your code, this is you playing with jass to see how it works, am I wrong?

I'd imagine a dead unit would no longer have buffs since the unit's flags change but the targetable flags do not. Basically, you can't apply an ability to a dead unit unless it is allowed, and buffs are even goofier.

You could use DDS and detect when a unit is about to die? Then kill it in case of a miracle :) God works in strange ways ;P

That is correct, dead units do not have buffs.

Thank you all. +Reps.
 
Status
Not open for further replies.
Top