• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] My spell don't work with storm bolt

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
I did that spell:

  • Kawarimi Cast 2test
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Kawarimi no Jutsu (based in berserker)
      • (Level of Kawarimi no Jutsu (based in berserker) for (Triggering unit)) Equal to 1
    • Actions
      • Trigger - Add to Kawarimi working <gen> the event (Unit - (Learning Hero) Takes damage)
      • Trigger - Turn on Kawarimi working <gen>
  • Kawarimi working
    • Events
    • Conditions
      • ((Triggering unit) has buff Kawarimi no Jutsu (based in wind walk)) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
      • Unit - Remove Kawarimi no Jutsu (based in wind walk) buff from (Triggering unit)
      • Set SpellPoint[0] = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Kyubi Jinchuuriki
        • Then - Actions
          • Unit - Create 1 Naruto bunshin for Neutral Passive at SpellPoint[0] facing Default building facing degrees
          • Animation - Play (Last created unit)'s Death animation
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Create 1 Dummy Caster for Neutral Passive at SpellPoint[0] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Kawarimi (based in Invisibility) for (Last created unit) to (Level of Kawarimi no Jutsu (based in berserker) for (Triggering unit))
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Triggering unit)
        • Else - Actions
          • Unit - Create 1 Log for Neutral Passive at SpellPoint[0] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Special Effect - Create a special effect at SpellPoint[0] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
          • Special Effect - Destroy (Last created special effect)
          • Sound - Play poof_edited <gen> at 100.00% volume, located at SpellPoint[0] with Z offset 0.00
          • Unit - Create 1 Dummy Caster for Neutral Passive at SpellPoint[0] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Kawarimi (based in Invisibility) for (Last created unit) to (Level of Kawarimi no Jutsu (based in berserker) for (Triggering unit))
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility (Triggering unit)
      • Custom script: call RemoveLocation(udg_SpellPoint[0])
But when someone cast storm bolt on my hero, the effects are displayed, my unit become invis, but the damage isn't recovered with:

  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
:(
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Because the event triggers before the damage is delt. Thus you reheal to max HP and then take the damage. To avoid this you have to simply delay it for one cycle (via a timer set to expire in 0 seconds) and then reheal the ammount as then the damage would have been taken so you would be rehealing after the damage.

This is a commonproblem due to like I said, the events fire before the actual thing that triggers them does.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Because the event triggers before the damage is delt. Thus you reheal to max HP and then take the damage. To avoid this you have to simply delay it for one cycle (via a timer set to expire in 0 seconds) and then reheal the ammount as then the damage would have been taken so you would be rehealing after the damage.

This is a commonproblem due to like I said, the events fire before the actual thing that triggers them does.
... o.o"

I don't know how to do that...
I mean, use the timer and still have a MUI spell...

Edit: I found something strange, I put that:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Damage taken) Greater than or equal to (Life of (Triggering unit))
    • Then - Actions
      • Game - Display to (All players) the text: THEN
      • Game - Display to (All players) the text: (String((Damage taken)))
      • Game - Display to (All players) the text: (String((Life of (Triggering unit))))
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
      • Wait 0.00 seconds
      • Unit - Remove Negative buffs from (Triggering unit)
    • Else - Actions
      • Game - Display to (All players) the text: ELSE
      • Game - Display to (All players) the text: (String((Damage taken)))
      • Game - Display to (All players) the text: (String((Life of (Triggering unit))))
      • Wait 0.00 seconds
      • Custom script: call SetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE, life)
      • Unit - Remove Negative buffs from (Triggering unit)
But with storm bolt it ALWAYS go to the ELSE... (My unit die to the storm bolt)
Wtf?

Edit2: IMAGE INCLUDED! First one with storm bolt, second with normal attack!
 

Attachments

  • error13.JPG
    error13.JPG
    184.1 KB · Views: 118
  • error14.JPG
    error14.JPG
    200.9 KB · Views: 111
Last edited:
Status
Not open for further replies.
Top