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

Make a unit cast an ability

Status
Not open for further replies.
Level 1
Joined
May 29, 2006
Messages
5
Hi all, I'm making a map in the style of Tales of Kaltazar: Boreal Conflict and am having trouble making the AI controlled units cast spells. Spells that are autocast like slow will cast, but other like healing wave won't cast.

I have a unit that has the ability healing wave and he never casts it.
 
Level 1
Joined
May 29, 2006
Messages
5
So, make a trigger which checks if the unit is in combat, and if it is have a chance to cast heal?
 
Level 1
Joined
Feb 1, 2008
Messages
2
It should be something like this..

For the sake of this, I'll just use a peasant...

  • Event - Unit - Peasant 0000 <gen>'s life becomes Less than 100.00
  • Action - Unit - Order Priest 0001 <gen> to Human Priest - Heal Peasant 0000 <gen>
 
Level 1
Joined
May 29, 2006
Messages
5
It should be something like this..

For the sake of this, I'll just use a peasant...

  • Event - Unit - Peasant 0000 <gen>'s life becomes Less than 100.00
  • Action - Unit - Order Priest 0001 <gen> to Human Priest - Heal Peasant 0000 <gen>

I don't think that's gonna work...is there anyway to make a unit cast an ability if it can? Or a way to make an ability autocast?
 
Level 7
Joined
Nov 13, 2006
Messages
243
if you make it autocast it will be fucked up and it will consume mana uber fast because it will trigger every time it is finished cooling down ...

do it like this

Event - Periodic Event 0.1 seconds
Condition - Game Over equal to False
Action -
If/Then/Else
If-
If unit in range <range here> of triggering unit> life equal or less then <hp you want>
Then-
Order unit to "Shadow Hunter - Healing Wave" Triggering unit
Else - Do Nothing
 
Level 1
Joined
May 29, 2006
Messages
5
hmm, that would probably works, thanks

edit: this trigger seems to work

  • Events
    • Unit - A unit Is attacked
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Life of (Triggering unit)) Less than or equal to ((Max life of (Triggering unit)) - 70.00)
        • (Distance between (Position of (Triggering unit)) and (Position of (Random unit from (Units of type Paladin)))) Less than or equal to 700.00
      • Then - Actions
        • Unit Group - Pick every unit in (Units of type Paladin) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Distance between (Position of (Triggering unit)) and (Position of (Picked unit))) Less than or equal to 700.00
              • Then - Actions
                • Unit - Order (Picked unit) to Human Paladin - Holy Light (Triggering unit)
              • Else - Actions
                • Do nothing
      • Else - Actions
        • Do nothing


Edit 2: Nevermind, I can't use the Unit - Order (Picked unit) to Human Paladin - Holy Light (Triggering unit) to cast a custom ability?
 
Last edited:
Level 1
Joined
May 29, 2006
Messages
5
hmm...what if its based of the Healing Wave (Neutral) ability? Is there a way to make that unit cast that?
 
Status
Not open for further replies.
Top