Throw Potion Trigger help!

Level 4
Joined
Dec 5, 2011
Messages
75
Hi i need some help with this trigger because some parts are not working:
-the special effecst not showing ingame
-how do i manage the trigger with adding hit point?cant make i works too

  • Throw Potion
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Throw Potion
    • Actions
      • Set LastLocation = (Position of (Casting unit))
      • Unit - Create 1 Dummy0 for (Owner of (Casting unit)) at LastLocation facing Default building facing (270.0) degrees
        • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Level of Throw Potion for (Casting unit)) Equal to (==) (Integer A)
              • Then - Actions
                • Unit - Add Dummy Potion to (Last created unit)
                • Unit - Set level of Dummy Potion for (Last created unit) to (Integer A)
                • Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Target unit of ability being cast)
                • Wait 1.00 seconds
                • Unit - Remove (Last created unit) from the game
                • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\Human\Heal\HealTarget.mdl
                • Special Effect - Destroy (Last created special effect)
                • Custom script: call RemoveLocation (udg_LastLocation)
              • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Throw Potion for (Casting unit)) Equal to (==) 1
            • (Ability being cast) Equal to (==) Throw Potion
          • Then - Actions
            • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 30.00)
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Ability being cast) Equal to (==) Throw Potion
            • (Level of Throw Potion for (Casting unit)) Equal to (==) 2
          • Then - Actions
            • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 70.00)
          • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Throw Potion for (Casting unit)) Equal to (==) 3
            • (Ability being cast) Equal to (==) Throw Potion
          • Then - Actions
            • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 150.00)
          • Else - Actions
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
  • Unit - Remove (Last created unit) from the game
Rather add an expiration timer to Last Created Unit instead of waiting 1 second and then removing it. Remove "Unit - Remove (Last created unit) from the game" and place this BEFORE the "Wait 1.00 seconds" action:

  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Can you also explain what this spell is meant to do?
 
Level 5
Joined
Sep 27, 2011
Messages
141
If you are going to use last created unit after a wait just set it to a variable also set all the points to variables then remove them and rather than having an if then else for each level. Use a formula eg set life of target unit to life of target unit + (200 - 65 x level of ability)
 
Level 4
Joined
Dec 5, 2011
Messages
75
  • Unit - Remove (Last created unit) from the game
Rather add an expiration timer to Last Created Unit instead of waiting 1 second and then removing it. Remove "Unit - Remove (Last created unit) from the game" and place this BEFORE the "Wait 1.00 seconds" action:

  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Can you also explain what this spell is meant to do?
the hero Throws a potion from inventory that will heal the target
lvl1 = 30 heal
lvl2 =70 heal
lvl3 150 heal

adding a expiration time worked Thanks!

Target unit of ability being cast won't work after a wait.

Mind the leaks: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
Oh maybe thats the problem let me try fix
what on my trigger will leak?

EDIT:The way you guys explained worked thanks !! i have set location of target and the caster and also removed the wait
+REP to all thxx
SOLVED!
 
Last edited:
Top