• 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.

Making computer controlled units use abilities

Status
Not open for further replies.
Level 2
Joined
Jan 13, 2011
Messages
19
how do i do this?

and also how can i make special units have phases like in wow or bosses in the map impossible bosses?
if you dont noe
a unit is at 100% hp
it uses list (a) of spells
when unit reaches 70% hp
it uses list (b) of spells
When unit reaches 30% hp
it uses list (c) of spells
when unit reaches 10% hp
it uses list (d) of spells

Please help.
 
Level 11
Joined
May 31, 2008
Messages
698
If you want them to cast only one ability, then you could probably change the "Default active ability" and i think they will automatically cast that. But other than that, you would have to trigger it.
Are you trying to make an a.i.?
cause that would require just a bunch of triggers, depending on how many types of units you have and how many abilities that they have.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Example Trigger:
  • Example Triggered Boss
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of (Triggering unit)) Greater than 80.00
          • (Percentage life of (Triggering unit)) Less than or equal to 100.00
        • Then - Actions
          • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt (Attacking unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Triggering unit)) Greater than 50.00
              • (Percentage life of (Triggering unit)) Less than or equal to 80.00
            • Then - Actions
              • Unit - Order (Triggering unit) to Neutral Beastmaster - Stampede (Center of (Playable map area))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Triggering unit)) Greater than 20.00
                  • (Percentage life of (Triggering unit)) Less than or equal to 50.00
                • Then - Actions
                  • Unit - Order (Triggering unit) to Orc Blademaster - Mirror Image
                • Else - Actions
It's with the "Conditions" where this function becomes available
 
Level 2
Joined
Jan 13, 2011
Messages
19
Oh thx, I really needed this. Tyvm.
Does this work with spells which are used repeatedly and with a varity of spells, like between 100 - 80 in the list there are 5 spells then between 80 - 50 there's a new list with 5 completely different spells. And do they have to be on the hero/unit or in some sort of menu.
 
Level 11
Joined
May 31, 2008
Messages
698
If you want there to be a random chance to cast one of the 5 spells that your boss has, then

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Percentage life of (Triggering unit)) Greater than 80.00
      • (Percentage life of (Triggering unit)) Less than or equal to 100.00
    • then
      • set int = random integer between 1 and 5
      • If - Conditions
        • int = 1
      • then
        • cast spell a
      • else
      • If - Conditions
        • int = 2
      • then
        • cast spell b
      • else
you get the idea, just make a condition for if int = 1,2,3,4,5 for each percent of health and make the hero cast a spell for each integer. int is an integer variable

and yes, the hero does have to actually have the ability in order to cast it
 
Status
Not open for further replies.
Top