• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Order to cast on unit with most buffs

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
I think I'm going to ask this here, to get a reply faster...

Basically, I have a spell that I want to do the following:

1. Removes positive buffs from the target enemy unit, and deals damage based on the amount of buffs. (DONE!)
2. Make it automatically target units with buffs. (DONE!)

3. Make it target the enemy unit with the MOST positive buffs. If one unit has 1 positive buff, and another within the same range has 5, I want it to automatically target the one with 5.

Not sure how to do the last one...

Also, is there a way to check if a unit becomes idle? (Solved but need to know how to make it MUI)

Need to know how to make it MUI, but:
  • BuffBurn Idle
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Arcane Spell Breaker) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Equal to (Order(none))
            • Then - Actions
              • Set BBAttackMove = True
            • Else - Actions
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
3. Make it target the enemy unit with the MOST positive buffs. If one unit has 1 positive buff, and another within the same range has 5, I want it to automatically target the one with 5.
What if there are more than 1 units that have same amount of buffs?
Will it be random by then ?

You can put all those units in an array, and then compare them one by one, until you found the biggest one.

Also, is there a way to check if a unit becomes idle? (Solved but need to know how to make it MUI)
http://www.hiveworkshop.com/forums/...9/?prev=search=is%20unit%20moving&d=list&r=20
Read the instructions on how to implement.

Basically the idea behind this system is to use GetUnitX/Y values to compare current value and before value from the same unit using indexing.
 
Level 12
Joined
May 20, 2009
Messages
822
What if there are more than 1 units that have same amount of buffs?
Will it be random by then ?

You can put all those units in an array, and then compare them one by one, until you found the biggest one.


http://www.hiveworkshop.com/forums/...9/?prev=search=is%20unit%20moving&d=list&r=20
Read the instructions on how to implement.

Basically the idea behind this system is to use GetUnitX/Y values to compare current value and before value from the same unit using indexing.

Yes, it will be randomly chosen if units have the same amount.

I don't know how to make an array that would compare them, also I found a solution for the last thing. I just need to figure this out then to make it all MUI compatible.

I think I'll put my triggers in here, just in case.


  • BuffBurn AutoCast On
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • (Issued order) Equal to (Order(poisonarrows))
        • Then - Actions
          • Set BuffBurnAutoCastOn = True
        • Else - Actions
  • BuffBurn AutoCast Off
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • (Issued order) Equal to (Order(unpoisonarrows))
        • Then - Actions
          • Set BuffBurnAutoCastOn = False
        • Else - Actions
  • BuffBurn Target Unit
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(attack))
              • (Issued order) Equal to (Order(smart))
        • Then - Actions
          • Set BBAttackMove = False
        • Else - Actions
  • BuffBurn AttackTarget Point
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • (Issued order) Equal to (Order(attack))
          • (Issued order) Equal to (Order(patrol))
        • Then - Actions
          • Set BBAttackMove = True
        • Else - Actions
  • BuffBurn MoveTarget Point
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(move))
              • (Issued order) Equal to (Order(smart))
        • Then - Actions
          • Set BBAttackMove = False
        • Else - Actions
  • BuffBurn NoTarget
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Ordered unit)) Equal to Arcane Spell Breaker
          • Or - Any (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(holdposition))
              • (Issued order) Equal to (Order(stop))
        • Then - Actions
          • Set BBAttackMove = True
        • Else - Actions
  • BuffBurn Idle
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Arcane Spell Breaker) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Equal to (Order(none))
            • Then - Actions
              • Set BBAttackMove = True
            • Else - Actions
  • BuffBurn Autocast
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BBUnitGroup and do (Actions)
        • Loop - Actions
          • Set BBUnit = (Picked unit)
          • Unit Group - Pick every unit in (Units within 700.00 of (Position of BBUnit)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BuffBurnAutoCastOn Equal to True
                  • BBAttackMove Equal to True
                  • And - All (Conditions) are true
                    • Conditions
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) is A structure) Equal to False
                      • (Picked unit) Not equal to BBUnit
                      • ((Picked unit) belongs to an ally of (Owner of BBUnit)) Equal to False
                      • Or - Any (Conditions) are true
                        • Conditions
                          • ((Picked unit) belongs to an enemy of (Owner of BBUnit)) Equal to True
                          • (Owner of (Picked unit)) Equal to Neutral Hostile
                          • (Owner of (Picked unit)) Equal to Neutral Victim
                          • (Owner of (Picked unit)) Equal to Neutral Extra
                          • (Owner of (Picked unit)) Equal to Neutral Passive
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of Positive buffs considered Magic or physical on (Picked unit) (Exclude expiration timers, Exclude auras)) Greater than 0
                    • Then - Actions
                      • Unit - Order BBUnit to Neutral - Poison Arrows (Picked unit)
                    • Else - Actions
                • Else - Actions
  • BuffBurn
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to Arcane Spell Breaker
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamagedUnit has buff Buff Burn (Calculate Initial Damage) ) Equal to True
        • Then - Actions
          • Unit - Remove Buff Burn (Calculate Initial Damage) buff from GDD_DamagedUnit
          • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing ((Real((Number of Positive buffs considered Magic or physical on (Triggering unit) (Exclude expiration timers, Exclude auras)))) x 5.00) damage of attack type Spells and damage type Normal
          • Unit - Remove Positive buffs considered Magic or physical from GDD_DamagedUnit (Exclude expiration timers, Exclude auras)
        • Else - Actions
 
Status
Not open for further replies.
Top