• 🏆 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] Buff Aplication Problem

Status
Not open for further replies.
Level 10
Joined
Jan 21, 2007
Messages
576
Alright here is the basic idea of my spell (npt the effects). You have a chance on hit to apply a buff to a enemy target, if the unit already has the buff the buff will become level 2, then level 3 on another succsesful proc. It applies the rank 1 buff fine but then when it procs agian it removes the level 1 buff then applies it agian, im not sure why. Heres the trigger.

EDIT: Btw i have 3 spells, 1 has all the rank 1 buffs (NOT LEVEL 1) another has all rank 2 buffs, and a third has all rank 3 buffs.

  • SB BA
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set Dice = (Random integer number between 1 and 100)
      • -------- Level 1 Applications --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Silencing Blows 1,2,3,4,5,6,7,8,9 for (Attacking unit)) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dice Less than or equal to 10
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [1.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [1.3] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [2.1] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [2.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [2.3] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.1] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.3] ) Equal to False
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 1 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 1 Buffs for (Last created unit) to 1
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [1.1] ) Equal to True
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 2 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 2 Buffs for (Last created unit) to 1
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                  • Unit - Remove Silencing Blows [1.1] buff from (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [1.2] ) Equal to True
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 3 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 3 Buffs for (Last created unit) to 1
                  • Unit - Remove Silencing Blows [1.2] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • -------- Level 2 Applications --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Silencing Blows 1,2,3,4,5,6,7,8,9 for (Attacking unit)) Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dice Less than or equal to 20
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [2.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [2.3] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.1] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.3] ) Equal to False
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 1 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 1 Buffs for (Last created unit) to 2
                  • Unit - Remove Silencing Blows [1.3] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [2.1] ) Equal to True
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 2 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 2 Buffs for (Last created unit) to 2
                  • Unit - Remove Silencing Blows [2.1] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [2.2] ) Equal to True
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 3 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 3 Buffs for (Last created unit) to 2
                  • Unit - Remove Silencing Blows [2.2] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • -------- Level 3 Applications --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Silencing Blows 1,2,3,4,5,6,7,8,9 for (Attacking unit)) Equal to 3
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dice Less than or equal to 30
            • Then - Actions
              • Game - Display to (All players) the text: Proc
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [3.2] ) Equal to False
                  • ((Attacked unit) has buff Silencing Blows [3.3] ) Equal to False
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 1 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 1 Buffs for (Last created unit) to 3
                  • Unit - Remove Silencing Blows [2.3] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [3.1] ) Equal to True
                • Then - Actions
                  • Unit - Remove Silencing Blows [3.1] buff from (Attacked unit)
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 2 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 2 Buffs for (Last created unit) to 3
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Attacked unit) has buff Silencing Blows [3.2] ) Equal to True
                • Then - Actions
                  • Set L = (Position of (Attacking unit))
                  • Unit - Create 1 Dummy Unit for (Owner of (Attacking unit)) at L facing Default building facing degrees
                  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation(udg_L)
                  • Unit - Add Dark Bindings Tier 3 Buffs to (Last created unit)
                  • Unit - Set level of Dark Bindings Tier 3 Buffs for (Last created unit) to 3
                  • Unit - Remove Silencing Blows [3.2] buff from (Attacked unit)
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Attacked unit)
                • Else - Actions
            • Else - Actions
        • Else - Actions
 
Level 10
Joined
Jun 16, 2007
Messages
415
hmmm lets see if i can help....

  • Events
    • A unit is being attacked
  • Conditions
    • Attacking Unit has YOURABILITY
  • Actions
    • Set HitOrNot = Random Integer between 1 and 10
    • If (HitOrNot bigger than 7) then (Do Nothing) else (Skip Remaining Actions)
    • Unit- Create 1 Dummy for (Owner of Attacking Unit) at (Position of (Attacked Unit)) facing (Standard)
    • Unit - Add YOURBUFFSPELL to (Last Created Unit)
    • Unit - Set level of YOURBUFFSPELL for (Last Created Unit) to (Custom Value of ((Attacked Unit) + 1))
    • Unit - Order (Last Created Unit) to (YOURBUFFSPELLORDER) (Attacked Unit)
    • Unit - Set custom value of (Attacked Unit) to (Custom Value of ((Attacked Unit) + 1))
Now all you have to do, is make a second trigger, which removes the buff after a certain time from the (Attacked Unit), also you need a YOURABILITY, you could base it off a critical strike, but with 0% chance. And a YOURBUFFSPELL, should be a spell, which has x levels, were x is the number of times you want your buff to stack. Then you need a buff for every level of this spell and voilá your spell is ready! I hope I helped you.
 
Status
Not open for further replies.
Top