Targetted abilities.

The_Reaping

Member
Reaction score
2
Edit:

Okay, my skill theme has changed. What it needs to do is for every 6/5/4/3 spells cast within a certain range, only from enemies, the explodes dealing damage. I can do the explosion bit, no problem. I just can't can't do the first bit..
 

tommerbob

Minecraft. :D
Reaction score
110
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
      • (target unit of ability being cast) equal to [your unit]
    • Actions
      • do actions
 

The_Reaping

Member
Reaction score
2
Trigger:
  • Events
    • Unit - A unit starts the effect of an ability
    • Conditions
      • (target unit of ability being cast) equal to [your unit]
    • Actions
      • do actions

Hmm.. [your unit] would be under what.. Because you can only have "triggering unit" and target unit of ability being cast only refers to the Event - A Unit Begins Casting An Ability. Also, my skill idea has changed.
 

tommerbob

Minecraft. :D
Reaction score
110
Use an integer variable to track the number of spells cast. and do actions accordingly.
 

The_Reaping

Member
Reaction score
2
Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set CombustCounter = (CombustCounter + 1)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Combust for (Picked unit)) Equal to 1
              • CombustCounter Equal to 6
            • Then - Actions
              • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 1
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Unit - Remove (Last created unit) from the game
              • Set CombustCounter = 0
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Combust for (Picked unit)) Equal to 2
                  • CombustCounter Equal to 5
                • Then - Actions
                  • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                  • Unit - Add Combust (Damage and Stun) to (Last created unit)
                  • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 2
                  • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                  • Unit - Remove (Last created unit) from the game
                  • Set CombustCounter = 0
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Combust for (Picked unit)) Equal to 3
                      • CombustCounter Equal to 4
                    • Then - Actions
                      • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                      • Unit - Add Combust (Damage and Stun) to (Last created unit)
                      • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 3
                      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                      • Unit - Remove (Last created unit) from the game
                      • Set CombustCounter = 0
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Level of Combust for (Picked unit)) Equal to 4
                          • CombustCounter Equal to 3
                        • Then - Actions
                          • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
                          • Unit - Add Combust (Damage and Stun) to (Last created unit)
                          • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to 4
                          • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
                          • Unit - Remove (Last created unit) from the game
                          • Set CombustCounter = 0
                        • Else - Actions


Will this work? :/ I don't think it will tbh.
 

tommerbob

Minecraft. :D
Reaction score
110
You can combine all of those If/Then/Else into one, and set the level of "Combust (Damage and Stun)" to the same level as the Combust ability, like this:

Trigger:
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
    • Unit - Create 1 Spell Dummy for (Picked player) at (Position of (Picked unit)) facing Default building facing degrees
    • Unit - Add Combust (Damage and Stun) to (Last created unit)
    • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
    • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
    • Unit - Remove (Last created unit) from the game
    • Set CombustCounter = 0


and then use another If/Then/Else for tracking the CombustCounter.

Also, you do not pick any players in this trigger, so (picked player) will not work.
 

The_Reaping

Member
Reaction score
2
Eh, I can't figure it out.. It's just confusing me. :/ Could you post the entire code? if it's not too much to ask :p I'll learn better from that.
 

tommerbob

Minecraft. :D
Reaction score
110
I don't have time to look at it right at the moment, but I will later today. As soon as I can, I'll take a look at let you know.
 

tommerbob

Minecraft. :D
Reaction score
110
Okay sorry, I've been really busy today. I was planning on looking at it today, but real life came calling. I'll get to it tomorrow.

EDIT:

Okay I'm looking at the map right now. Just to clarify, do you want it to be MUI or does it matter?
 

tommerbob

Minecraft. :D
Reaction score
110
(sorry for double post, forgot to mention I would just edit my last post)

Okay, it was hard to test the spell in your map because the enemies would rarely cast spells. But I changed the code a bit, it should be working correctly. I also added a debug line to track when the trigger runs, and how many the Combust Counts is at. You can easily remove that.

Trigger:
  • Combust Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Combust
    • Actions
      • Unit - Add Combust (Visuals) to (Triggering unit)
      • Unit - Set level of Combust (Visuals) for (Triggering unit) to (Level of Combust for (Triggering unit))
      • Set Combust_MaxCount = (7 - (Level of Combust for (Triggering unit)))
      • Trigger - Turn on Combust Counter <gen>


Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set Combust_Counter = (Combust_Counter + 1)
                  • Game - Display to (All players) the text: Enemy spell is cast
                  • Game - Display to (All players) the text: (Combust Counter is + (String(Combust_Counter)))
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combust_Counter Greater than or equal to Combust_MaxCount
            • Then - Actions
              • Set Combust_Point = (Position of (Picked unit))
              • Unit - Create 1 Spell Dummy for (Owner of (Picked unit)) at Combust_Point facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Set Combust_Counter = 0
              • Custom script: call RemoveLocation(udg_Combust_Point)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)


Here is the test map:
 

Attachments

  • Rage_Demon_Test_Map.w3x
    59 KB · Views: 146

The_Reaping

Member
Reaction score
2
(sorry for double post, forgot to mention I would just edit my last post)

Okay, it was hard to test the spell in your map because the enemies would rarely cast spells. But I changed the code a bit, it should be working correctly. I also added a debug line to track when the trigger runs, and how many the Combust Counts is at. You can easily remove that.

Trigger:
  • Combust Learned
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Combust
    • Actions
      • Unit - Add Combust (Visuals) to (Triggering unit)
      • Unit - Set level of Combust (Visuals) for (Triggering unit) to (Level of Combust for (Triggering unit))
      • Set Combust_MaxCount = (7 - (Level of Combust for (Triggering unit)))
      • Trigger - Turn on Combust Counter <gen>


Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set TempGroup = (Units of type Rage Demon)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) is an enemy of (Owner of (Picked unit))) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Picked unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
                • Then - Actions
                  • Set Combust_Counter = (Combust_Counter + 1)
                  • Game - Display to (All players) the text: Enemy spell is cast
                  • Game - Display to (All players) the text: (Combust Counter is + (String(Combust_Counter)))
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Combust_Counter Greater than or equal to Combust_MaxCount
            • Then - Actions
              • Set Combust_Point = (Position of (Picked unit))
              • Unit - Create 1 Spell Dummy for (Owner of (Picked unit)) at Combust_Point facing Default building facing degrees
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
              • Unit - Add Combust (Damage and Stun) to (Last created unit)
              • Unit - Set level of Combust (Damage and Stun) for (Last created unit) to (Level of Combust for (Picked unit))
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Set Combust_Counter = 0
              • Custom script: call RemoveLocation(udg_Combust_Point)
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)


Here is the test map:

I tested it.. But whenever the counter gets to the required amount.. it crashes :/ I made triggers to check when one of the heroes is attack and make him cast a spell.
 

HydraRancher

Truth begins in lies
Reaction score
197
It's because you are creating an infinite loop. [DEL]You forgot to add a condition to check if it is your ability being cast.[/DEL]

I mean you forgot to add a condition to check that it is NOT Warstomp.

Trigger:
  • Combust Counter
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Not equal to Combust (Damage and Stun)
    • Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top