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

Neutral AI

Status
Not open for further replies.
Level 17
Joined
Mar 21, 2011
Messages
1,597
hi,
i have some neutral hostile creeps with abilities in my map. what would be the best solution to let them cast the abilities? (there should be an option to cast the ability onto the current target and an option for casting it on a random unit in a certain AoE
i know there is a basic creep behavior, but that's not what i want to have.
thanks
 
Level 25
Joined
May 11, 2007
Messages
4,651
By disarmed you mean silenced? I don't know if Warcraft 3 cancels current orders if a unit is ordered to cast a spell while silenced, but if not,

then the above trigger will allow your creeps to cast spells when they can and when they cannot they will try but nothing will happen.

For the random unit part,
just do:
  • Actions
    • Set tempPoint1 = (Position of (Triggering unit))
    • Set tempGroup1 = (Units within 512.00 of tempPoint1 matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Attacked unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is Magic Immune) Equal to False))))
    • Set tempUnit = (Random unit from tempGroup1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • tempUnit Not equal to No unit
      • Then - Actions
        • Unit - Order (Attacked unit) to Orc Far Seer - Chain Lightning tempUnit
      • Else - Actions
    • Custom script: call RemoveLocation(udg_tempPoint1)
    • Custom script: call DestroyGroup(udg_tempGroup1)
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
thanks for the trigger, but i know how it works^^ i just wonder whats the most efficient way.
by disarmed i mean disable the unit's ability to do basic attacks
+rep to you


EDIT: i'll just find another way how i'll do the disarm and its fine :)
 
Status
Not open for further replies.
Top