• 🏆 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!

Unit type in range

Status
Not open for further replies.
Level 5
Joined
Aug 20, 2015
Messages
133
Hi everyone, i want to create a ward using spell
It curses enemies that trying to attack allies or cast any spel
It gives a movement speed boost to allied heroes, who are attacked\attacking or casts any spell, and if they alredy have ms boost - they recover a % of missing health
and all of this occures only if Magic Ward is in range of 800 of triggering unit
however, the main issue here is locating that damn ward =\
any suggestions to improve detection? this is my attempt
using 26a (and i have licence copy of the original game)
  • magic ward
    • Events
      • Unit - A unit Is attacked
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempPoint2 = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within 800.00 of TempPoint2) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Sentry Ward
            • Then - Actions
              • Set TempUnit2 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Triggering unit)) is an ally of (Owner of TempUnit2)) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Triggering unit) is A Hero) Equal to True
                      • ((Triggering unit) has buff Speed Bonus) Equal to False
                    • Then - Actions
                      • Hero - Create magic ward rune and give it to (Triggering unit)
                    • Else - Actions
                      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (((Max life of (Triggering unit)) - (Life of (Triggering unit))) x 0.01))
                      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Last edited:
Level 5
Joined
Aug 20, 2015
Messages
133
this is nice solution, i added 2 auras - one with negative and one with positive buffs
so now it should work fine, thanks a lot
 
Status
Not open for further replies.
Top