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

[Trigger] About a spell

Status
Not open for further replies.
Level 6
Joined
Sep 13, 2013
Messages
155
So I created a spell which it should do as the following :

It does 300/370/440/510 damage to the target, (type is magical damage) and the hero itself has an ultimate ability which is based on Metamorphosis (it gets into a form and...) and if you get in the form and you cast this spell, it deals pure damage to the target plus IF your hero kills the targeted hero with this spell, it will heal your hero by the same amount .

The point is how to check after dealing damage that the target is dead or not ? what I did in my trigger is that after dealing damage I checked the life of target unit of ability being cast equal to 0.00, if yes then heal the hero, if not do nothing. but it doesn't work...
 
First.. make a variable for the unit being targeted by the spell and the caster of the spell.
then Make a trigger that checks whether target unit dies.. but this spell will is good for 1 player

  • Cast
    • Events
      • Unit - Starts effect of an ability
    • Conditions
      • Ability being cast Equal to Magic Bolt
    • Actions
      • Set Spell_Caster = (Triggering unit)
      • Set Spell_Target = (Target of unit ability being cast)
      • -------- Spell_Timer determines the time where the unit has died or not. ---------
      • Set Spell_Timer = 1.00
      • Trigger - Turn on Check Timer <gen>
  • Check Timer
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spell_Timer is Greater than 0.00
        • Then - Actions
          • Set Spell_Timer = (Spell_Timer - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Spell_Timer is Less then or Equal to 0.00
                  • Spell_Target is alive Equal to False
            • Then - Actions
              • Trigger - Turn Off this trigger
              • Set Spell_Timer = 0.00
              • Unit - Set life of (Owner of Spell Caster) to life of Spell_Caster + Heal_Amount
              • Set Spell_Target = No unit
              • Set Spell_Caster = No unit
            • Else - Actions
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top