• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] How to trigger this

Status
Not open for further replies.
Level 7
Joined
May 28, 2011
Messages
101
I want to make it so whenever the player kills a unit, all nearby player units will get mana. For now i can make it so if the player or its allies kills any unit, it will give mana to all nearby units. Here is my problem: I want it to only give mana, if the killed unit is an enemy of the player. He may not get mana by killing his allies or his own units. Here is my try:
  • Mana Consumption
    • Events
      • Unit - A unit Dies
    • Conditions
      • Kael_Thas Equal to 1
    • Actions
      • Player Group - Pick every player in (All enemies of (Owner of (Killing unit)).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to (Picked player)
            • Then - Actions
              • Unit - Move Mana Caster 0287 <gen> instantly to (Position of (Dying unit))
              • Unit - Order Mana Caster 0287 <gen> to Undead Obsidian Statue - Spirit Touch.
            • Else - Actions
I don't know how to make the game understand that it has to be an enemy of the player. This pick player thing doesn't work.
 
You can check "if (Killing unit) Not Equals (No unit)" to ensure there's a killer.
You can make a Boolean Comparison to check "if (Owner of (Killing unit ))" is an enemy of "(Owner of (Dying unit))".

"PickUnitsInRangeAndDoActions" of position of dyning unit, and make actions with "(Picked Unit)".
A PlayerComparison can be done here, inside the "PickUnitAndDoActions", to ensure "(Owner of (Picked unit))" Equals "(Owner of (Dying unit))".
 
Status
Not open for further replies.
Top