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

[JASS] Unit death as condition?

Status
Not open for further replies.
Level 3
Joined
Dec 28, 2007
Messages
46
Is there any way to check if GetSpellAbilityId() kills a unit? Like for example:

  1. A unit casts xxx ability on enemy
  2. ability of type xxx
  3. target of abilty being cast dies
  4. do xxx actions

Is that possible to check? (number 3)

Edit would I use something like this?

JASS:
function Spell_Kill takes nothing returns nothing
    local unit Spell_Targ = GetSpellTargetUnit()
    
    call TriggerSleepAction(.5)
    if ( GetUnitState(Spell_Targ, UNIT_STATE_LIFE) <= 0 ) then
        //Do actions here
    endif
    
    set Spell_Targ = null
endfunction
 
Status
Not open for further replies.
Top