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

How to make NPC unit to cast spell in comba

Status
Not open for further replies.
Level 1
Joined
Dec 20, 2011
Messages
4
Hello!
I tried to look through the topics.. but can't seem to find any tutorial/help on how to make a unit in a map to cast an certain ability upon combat.

Ive created a "raid like" map where heroes: healers, dps, tank needs to work together to clear thrash and bosses.. But i cant get my bosses to do any abilities by themselves.

Are there anyone who know how to make this happend?
Thanks for reading.
Rasserboi

btw im kinda new to triggers etc.. know some just not hero oriented.
 
Last edited by a moderator:
Level 4
Joined
May 23, 2010
Messages
83
how'd you place the bosses on tha map? by triggers or hand-made? You should attach your units to a global variable, and use the event "unit (boss) is attacked/takes damage".
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
For example I do a very simple code for a boss casting basic Blizzard spells:

  • Otzi King Spells
    • Events
      • Unit - Otzi King 0089 <gen> Is attacked
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Random = (Random integer number between 1 and 4)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 1
        • Then - Actions
          • Unit - Add #Avatar (Otzi King) to (Attacked unit)
          • Unit - Order (Attacked unit) to Human Mountain King - Activate Avatar
          • Wait 2.00 seconds
          • Unit - Remove #Avatar (Otzi King) from (Attacked unit)
          • Wait 8.00 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random Equal to 2
            • Then - Actions
              • Unit - Add #War Stomp (Otzi King) to (Attacked unit)
              • Unit - Set level of #War Stomp (Otzi King) for (Attacked unit) to Difficulty_Spell_Level
              • Unit - Order (Attacked unit) to Orc Tauren Chieftain - War Stomp
              • Wait 2.00 seconds
              • Unit - Remove #War Stomp (Otzi King) from (Attacked unit)
              • Wait 8.00 seconds
              • Trigger - Turn on (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random Equal to 3
                • Then - Actions
                  • Unit - Add #Rejuvenation (Otzi King) to (Attacked unit)
                  • Unit - Set level of §Rejuvenation (Otzi King) for (Attacked unit) to Difficulty_Spell_Level
                  • Unit - Order (Attacked unit) to Night Elf Druid Of The Claw - Rejuvenation (Attacked unit)
                  • Wait 2.00 seconds
                  • Unit - Remove #Rejuvenation (Otzi King) from (Attacked unit)
                  • Wait 8.00 seconds
                  • Trigger - Turn on (This trigger)
                • Else - Actions
                  • Unit - Add #Roar (Otzi King) to (Attacked unit)
                  • Unit - Order (Attacked unit) to Night Elf Druid Of The Claw - Roar
                  • Wait 2.00 seconds
                  • Unit - Remove #Roar (Otzi King) from (Attacked unit)
                  • Wait 8.00 seconds
                  • Trigger - Turn on (This trigger)
Very simple & works perfectly.
 
Level 11
Joined
Nov 15, 2007
Messages
800
For example I do a very simple code for a boss casting basic Blizzard spells:

  • Otzi King Spells
    • Events
      • Unit - Otzi King 0089 <gen> Is attacked
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Random = (Random integer number between 1 and 4)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 1
        • Then - Actions
          • Unit - Add #Avatar (Otzi King) to (Attacked unit)
          • Unit - Order (Attacked unit) to Human Mountain King - Activate Avatar
          • Wait 2.00 seconds
          • Unit - Remove #Avatar (Otzi King) from (Attacked unit)
          • Wait 8.00 seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random Equal to 2
            • Then - Actions
              • Unit - Add #War Stomp (Otzi King) to (Attacked unit)
              • Unit - Set level of #War Stomp (Otzi King) for (Attacked unit) to Difficulty_Spell_Level
              • Unit - Order (Attacked unit) to Orc Tauren Chieftain - War Stomp
              • Wait 2.00 seconds
              • Unit - Remove #War Stomp (Otzi King) from (Attacked unit)
              • Wait 8.00 seconds
              • Trigger - Turn on (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random Equal to 3
                • Then - Actions
                  • Unit - Add #Rejuvenation (Otzi King) to (Attacked unit)
                  • Unit - Set level of §Rejuvenation (Otzi King) for (Attacked unit) to Difficulty_Spell_Level
                  • Unit - Order (Attacked unit) to Night Elf Druid Of The Claw - Rejuvenation (Attacked unit)
                  • Wait 2.00 seconds
                  • Unit - Remove #Rejuvenation (Otzi King) from (Attacked unit)
                  • Wait 8.00 seconds
                  • Trigger - Turn on (This trigger)
                • Else - Actions
                  • Unit - Add #Roar (Otzi King) to (Attacked unit)
                  • Unit - Order (Attacked unit) to Night Elf Druid Of The Claw - Roar
                  • Wait 2.00 seconds
                  • Unit - Remove #Roar (Otzi King) from (Attacked unit)
                  • Wait 8.00 seconds
                  • Trigger - Turn on (This trigger)
Very simple & works perfectly.

But if the boss is never attacked, he'll never cast spells. GG all mage team easy boss runs :p
 
Status
Not open for further replies.
Top