• 🏆 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] One buff at a time

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
I want to make a spell that gives friendly unit permament buff, when used on another unit I want buff to dissapear from unit(1) and stay on unit(2) untill spell is casted again.

Here's my attempt which works, but its not MUI:
  • Inspire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Squire
    • Actions
      • Set InspireMax = (InspireMax + 1)
      • Set Unit[InspireMax] = (Target unit of ability being cast)
      • Unit - Remove Inspire buff from Unit[(InspireMax - 1)]
      • Unit - Remove Endurance Aura buff from Unit[(InspireMax - 1)]
      • Unit - Remove Item Damage Bonus (+15) from Unit[(InspireMax - 1)]
      • Unit - Add Item Damage Bonus (+15) to Unit[InspireMax]
      • Unit - Add Inspire buff to Unit[InspireMax]
 
Level 5
Joined
Dec 25, 2018
Messages
110
I am trying something like this:
  • Inspire
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Squire
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Inspire1 Equal to 0
        • Then - Actions
          • Set Inspire1 = (Inspire1 + 1)
          • Set InspireUnit[Inspire1] = (Target unit of ability being cast)
          • Animation - Play InspireUnit[Inspire1]'s Stand Victory animation
          • Unit - Remove Inspire buff from InspireUnit[Inspire1]
          • Unit - Remove Endurance Aura buff from InspireUnit[Inspire1]
          • Unit - Remove Item Damage Bonus (+15) from InspireUnit[Inspire1]
          • Unit - Add Item Damage Bonus (+15) to InspireUnit[Inspire1]
          • Unit - Add Inspire buff to InspireUnit[Inspire1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Inspire2 Equal to 0
            • Then - Actions
              • Set Inspire2 = (Inspire2 + 1)
              • Set InspireUnit2[Inspire2] = (Target unit of ability being cast)
              • Animation - Play InspireUnit2[Inspire2]'s Stand Victory animation
              • Unit - Remove Inspire buff from InspireUnit2[(Inspire2 - 1)]
              • Unit - Remove Endurance Aura buff from InspireUnit2[(Inspire2 - 1)]
              • Unit - Remove Item Damage Bonus (+15) from InspireUnit2[(Inspire2 - 1)]
              • Unit - Add Item Damage Bonus (+15) to InspireUnit2[Inspire2]
              • Unit - Add Inspire buff to InspireUnit2[Inspire2]
            • Else - Actions
But still doens't work like I want to, is this the right direction or should I try something different?
 
Level 5
Joined
Jun 13, 2017
Messages
83
I think you should remove the buffs first then make
  • Set Inspire1 = (Inspire1 + 1)
your post is not clear enough, how many units can have these buffs ?

if one just remove first then set to new and there is no need for the
  • Set Inspire1 = (Inspire1 + 1)
just make it without arrays.

if one unit from each player just do the number of player owner of unit as array.

if multiple units from each player
then you could give your units custom value then do it like this:
  • First Remove all buffs
  • Unit - Remove Inspire from inspireUnit[Custom Value of Triggering unit]
  • same for all other buffs
  • then
  • Set InspireUnit[Custom Value of Triggering Unit] = target of ability
  • now you have new unit with that variable
  • Add buffs here
  • Unit - Add Inspire from inspireUnit[Custom Value of Triggering unit]
 
Level 5
Joined
Dec 25, 2018
Messages
110
Yeah I want it to be 1 unit from each player.
So this is What u meant?
  • Set InspireUnit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
 
Status
Not open for further replies.
Top