• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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,601
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
781
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