1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

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

Discussion in 'Triggers & Scripts' started by Saishy, Nov 29, 2008.

  1. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    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))


    :(
     
  2. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,911
    Resources:
    0
    Resources:
    0
    Only with storm bolt? Or with spells in general?
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,545
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     
  4. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    ... 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!
     

    Attached Files:

    Last edited: Nov 30, 2008
  5. Saishy

    Saishy

    Joined:
    Mar 23, 2008
    Messages:
    947
    Resources:
    0
    Resources:
    0
    Double Bump!