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

Dummy-hero problem

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
Hi everyone! Hope you are doing fine :)
Today I'm here with a little problem. My hero has a spell that creates an exaxt copy of himself (but it's not the same unit type, it's the COPY-version of himself) which is supposed to repeat the Q spell after him and also copy his HP, MP and items. So, the problem is that when I do all this, my tracing shows me something ridiculous!!! I mean that my copy can be lvl 6, but ingame message shows that it's lvl 0. Look at that:
hfpyf7
upload_2017-11-27_8-8-34.png
And here's the trigger:

  • Infernal Delusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Delusion new
    • Actions
      • Set Player_Number_Int = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Delusion_Caster[Player_Number_Int] = (Triggering unit)
      • Set Infernal_Delusion_Caster_Point[Player_Number_Int] = (Position of Infernal_Delusion_Caster[Player_Number_Int])
      • Set Infernal_Delusion_Random_Point[Player_Number_Int] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Player_Number_Int] with size (200.00, 200.00)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Infernal_Delusion_Caster[Player_Number_Int] belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 1 (Red) at Infernal_Delusion_Random_Point[Player_Number_Int] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Player_Number_Int] = (Last created unit)
        • Else - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 7 (Green) at Infernal_Delusion_Random_Point[Player_Number_Int] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Player_Number_Int] = (Last created unit)
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Player_Number_Int])
      • Game - Display to (All players) the text: (Name of Infernal_Delusion_Dummy[Player_Number_Int])
      • -------- expiration --------
      • Unit - Add a 20.00 second Generic expiration timer to Infernal_Delusion_Dummy[Player_Number_Int]
      • -------- levels --------
      • Hero - Set Infernal_Delusion_Dummy[Player_Number_Int] Hero-level to (Level of Infernal_Delusion_Caster[Player_Number_Int]), Hide level-up graphics
      • Game - Display to (All players) the text: (Dummie's level - + (String((Hero level of Infernal_Delusion_Dummy[Player_Number_Int]))))
      • Unit - Set level of LVLup Armor for Infernal_Delusion_Dummy[Player_Number_Int] to (Level of LVLup Armor for Infernal_Delusion_Caster[Player_Number_Int])
      • Game - Display to (All players) the text: (Dummie's armor level - + (String((Level of LVLup Armor for Infernal_Delusion_Dummy[Player_Number_Int]))))
      • Unit - Set level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[Player_Number_Int] to (Level of Infernal Delusion new for Infernal_Delusion_Caster[Player_Number_Int])
      • Game - Display to (All players) the text: (Level of delusion - + (String((Level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[Player_Number_Int]))))
      • -------- items --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by Infernal_Delusion_Caster[Player_Number_Int] in slot (Integer A)) to Infernal_Delusion_Dummy[Player_Number_Int]
          • Game - Display to (All players) the text: (Name of (Item carried by Infernal_Delusion_Dummy[Player_Number_Int] in slot (Integer A)))
      • -------- HP --------
      • Set Infernal_Delusion_Difference[Player_Number_Int] = ((Max life of Infernal_Delusion_Caster[Player_Number_Int]) - (Max life of Infernal_Delusion_Dummy[Player_Number_Int]))
      • Game - Display to (All players) the text: (HP difference - + (String(Infernal_Delusion_Difference[Player_Number_Int])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Player_Number_Int] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Player_Number_Int])), do (Actions)
            • Loop - Actions
              • Unit - Add LIFE +1 to Infernal_Delusion_Dummy[Player_Number_Int]
              • Unit - Increase level of LIFE +1 for Infernal_Delusion_Dummy[Player_Number_Int]
              • Unit - Remove LIFE +1 from Infernal_Delusion_Dummy[Player_Number_Int]
        • Else - Actions
      • Unit - Set life of Infernal_Delusion_Dummy[Player_Number_Int] to (Percentage life of Infernal_Delusion_Caster[Player_Number_Int])%
      • -------- MP --------
      • Set Infernal_Delusion_Difference[Player_Number_Int] = ((Max mana of Infernal_Delusion_Caster[Player_Number_Int]) - (Max mana of Infernal_Delusion_Dummy[Player_Number_Int]))
      • Game - Display to (All players) the text: (MP difference - + (String(Infernal_Delusion_Difference[Player_Number_Int])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Player_Number_Int] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Player_Number_Int])), do (Actions)
            • Loop - Actions
              • Unit - Add MANA +1 to Infernal_Delusion_Dummy[Player_Number_Int]
              • Unit - Increase level of MANA +1 for Infernal_Delusion_Dummy[Player_Number_Int]
              • Unit - Remove MANA +1 from Infernal_Delusion_Dummy[Player_Number_Int]
        • Else - Actions
      • Unit - Set mana of Infernal_Delusion_Dummy[Player_Number_Int] to (Percentage mana of Infernal_Delusion_Caster[Player_Number_Int])%
      • -------- meteor --------
      • Hero - Learn skill for Infernal_Delusion_Dummy[Player_Number_Int]: Infernal Meteor
      • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[Player_Number_Int]))))
      • Unit - Set level of Infernal Meteor for Infernal_Delusion_Dummy[Player_Number_Int] to (Level of Infernal Meteor for Infernal_Delusion_Caster[Player_Number_Int])
      • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[Player_Number_Int]))))
      • -------- shift position --------
      • Unit - Hide Infernal_Delusion_Caster[Player_Number_Int]
      • Set Infernal_Delusion_Random_Point[Player_Number_Int] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Player_Number_Int] with size (200.00, 200.00)))
      • Unit - Move Infernal_Delusion_Caster[Player_Number_Int] instantly to Infernal_Delusion_Random_Point[Player_Number_Int]
      • Custom script: call SetUnitX (udg_Infernal_Delusion_Caster[udg_Player_Number_Int], GetLocationX (udg_Infernal_Delusion_Random_Point[udg_Player_Number_Int]))
      • Custom script: call SetUnitY (udg_Infernal_Delusion_Caster[udg_Player_Number_Int], GetLocationY (udg_Infernal_Delusion_Random_Point[udg_Player_Number_Int]))
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Player_Number_Int])
      • Unit - Unhide Infernal_Delusion_Caster[Player_Number_Int]
      • Selection - Select Infernal_Delusion_Caster[Player_Number_Int] for (Owner of Infernal_Delusion_Caster[Player_Number_Int])
      • Trigger - Turn on Infernal Delusion loop <gen>
And here's the "meteor" spell that is supposed to show the check message:

  • Infernal Delusion Meteor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Meteor
    • Actions
      • Set Player_Number_Int = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Meteor_Caster[Player_Number_Int] = (Triggering unit)
      • Set Infernal_Meteor_Target_Point[Player_Number_Int] = (Target point of ability being cast)
      • Unit - Order Infernal_Delusion_Dummy[Player_Number_Int] to Human Dragonhawk Rider - Cloud Infernal_Meteor_Target_Point[Player_Number_Int]
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Player_Number_Int])
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Infernal_Delusion_Dummy[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: (Dummy # + ((String((Integer A))) + is alive!))
            • Else - Actions
Any help would be awesome! Thanks in advance!

--------------

I added some tracing to the last trigger like this:
  • Infernal Delusion Meteor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Meteor
    • Actions
      • Set Player_Number_Int = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Meteor_Caster[Player_Number_Int] = (Triggering unit)
      • Set Infernal_Meteor_Target_Point[Player_Number_Int] = (Target point of ability being cast)
      • Unit - Order Infernal_Delusion_Dummy[Player_Number_Int] to Human Dragonhawk Rider - Cloud Infernal_Meteor_Target_Point[Player_Number_Int]
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Player_Number_Int])
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Infernal_Delusion_Dummy[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: (Dummy # + ((String((Integer A))) + is alive!))
              • Game - Display to (All players) the text: (Dummie's level - + (String((Hero level of Infernal_Delusion_Dummy[(Integer A)]))))
              • Game - Display to (All players) the text: (Level of delusion - + (String((Level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[(Integer A)]))))
              • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[(Integer A)]))))
            • Else - Actions
and now it shows this:
upload_2017-11-27_9-58-11.png
 
Last edited:

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
There is a difference between hero level and unit level.
If the level shows 0, for a variable, you expect to be something else, it could be, that the variable is a different unit or no unit at all (null).

First trigger:
Hero - Set Infernal_Delusion_Dummy[Player_Number_Int] Hero-level to (Level of Infernal_Delusion_Caster[Player_Number_Int]), Hide level-up graphics

you set the hero level of the dummy to the unit level of the caster.

Then there is always the possibility that Player_Number_Int is overwritten by triggers that run in between, because they are triggered by events your trigger can trigger.
For example when you create the dummy, an "enters region"-event can fire overwriting Player_Number_Int.

First fix everything regarding unit and hero level.
I would recommend adding text messages to print out Player_Number_Int to make sure it does not get overwritten.
 
Level 10
Joined
Mar 17, 2012
Messages
579
There is a difference between hero level and unit level.
If the level shows 0, for a variable, you expect to be something else, it could be, that the variable is a different unit or no unit at all (null).

First trigger:
Hero - Set Infernal_Delusion_Dummy[Player_Number_Int] Hero-level to (Level of Infernal_Delusion_Caster[Player_Number_Int]), Hide level-up graphics

you set the hero level of the dummy to the unit level of the caster.

Then there is always the possibility that Player_Number_Int is overwritten by triggers that run in between, because they are triggered by events your trigger can trigger.
For example when you create the dummy, an "enters region"-event can fire overwriting Player_Number_Int.

First fix everything regarding unit and hero level.
I would recommend adding text messages to print out Player_Number_Int to make sure it does not get overwritten.

Okay, I've performed some changes and now it works, but I have another problem now:
I have a loop trigger that makes the summoned hero-dummy move to a random point in 200 AoE every 0.5-1.5 seconds. And, as you know, this summoned unit must repeat the so called "Meteor" spell after the caster. So, whil I don't use this "Meteor", the loop works perfectly. But the moment I use it he stops working. Look at that:

Create dummy:
  • Infernal Delusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Delusion new
    • Actions
      • Set Infernal_Delusion_Player = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Delusion_Caster[Infernal_Delusion_Player] = (Triggering unit)
      • Set Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] = (Position of Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • -------- shift position --------
      • Set Infernal_Delusion_Random_Point[Infernal_Delusion_Player] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] with size (200.00, 200.00)))
      • Unit - Move Infernal_Delusion_Caster[Infernal_Delusion_Player] instantly to Infernal_Delusion_Random_Point[Infernal_Delusion_Player]
      • Custom script: call SetUnitX (udg_Infernal_Delusion_Caster[udg_Infernal_Delusion_Player], GetLocationX (udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player]))
      • Custom script: call SetUnitY (udg_Infernal_Delusion_Caster[udg_Infernal_Delusion_Player], GetLocationY (udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player]))
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player])
      • Selection - Select Infernal_Delusion_Caster[Infernal_Delusion_Player] for (Owner of Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • -------- create dummy --------
      • Set Infernal_Delusion_Random_Point[Infernal_Delusion_Player] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] with size (200.00, 200.00)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Infernal_Delusion_Caster[Infernal_Delusion_Player] belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 1 (Red) at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] = (Last created unit)
        • Else - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 7 (Green) at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] = (Last created unit)
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player])
      • Game - Display to (All players) the text: (Name of Infernal_Delusion_Dummy[Infernal_Delusion_Player])
      • -------- expiration --------
      • Unit - Add a 20.00 second Generic expiration timer to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
      • -------- levels --------
      • Hero - Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] Hero-level to (Hero level of Infernal_Delusion_Caster[Infernal_Delusion_Player]), Hide level-up graphics
      • Game - Display to (All players) the text: (Dummie's level - + (String((Hero level of Infernal_Delusion_Dummy[Infernal_Delusion_Player]))))
      • Unit - Set level of LVLup Armor for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of LVLup Armor for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Game - Display to (All players) the text: (Dummie's armor level - + (String((Level of LVLup Armor for Infernal_Delusion_Dummy[Infernal_Delusion_Player]))))
      • Unit - Set level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of Infernal Delusion new for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Game - Display to (All players) the text: (Level of delusion - + (String((Level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[Infernal_Delusion_Player]))))
      • -------- items --------
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Infernal_Delusion_Item[(Integer B)] = (Item carried by Infernal_Delusion_Caster[Infernal_Delusion_Player] in slot (Integer B))
          • Hero - Create (Item-type of Infernal_Delusion_Item[(Integer B)]) and give it to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
          • Game - Display to (All players) the text: (Name of (Item carried by Infernal_Delusion_Dummy[Infernal_Delusion_Player] in slot (Integer B)))
      • -------- HP --------
      • Set Infernal_Delusion_Difference[Infernal_Delusion_Player] = ((Max life of Infernal_Delusion_Caster[Infernal_Delusion_Player]) - (Max life of Infernal_Delusion_Dummy[Infernal_Delusion_Player]))
      • Game - Display to (All players) the text: (HP difference - + (String(Infernal_Delusion_Difference[Infernal_Delusion_Player])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Infernal_Delusion_Player] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Infernal_Delusion_Player])), do (Actions)
            • Loop - Actions
              • Unit - Add LIFE +1 to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Increase level of LIFE +1 for Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Remove LIFE +1 from Infernal_Delusion_Dummy[Infernal_Delusion_Player]
        • Else - Actions
      • Unit - Set life of Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Percentage life of Infernal_Delusion_Caster[Infernal_Delusion_Player])%
      • -------- MP --------
      • Set Infernal_Delusion_Difference[Infernal_Delusion_Player] = ((Max mana of Infernal_Delusion_Caster[Infernal_Delusion_Player]) - (Max mana of Infernal_Delusion_Dummy[Infernal_Delusion_Player]))
      • Game - Display to (All players) the text: (MP difference - + (String(Infernal_Delusion_Difference[Infernal_Delusion_Player])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Infernal_Delusion_Player] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Infernal_Delusion_Player])), do (Actions)
            • Loop - Actions
              • Unit - Add MANA +1 to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Increase level of MANA +1 for Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Remove MANA +1 from Infernal_Delusion_Dummy[Infernal_Delusion_Player]
        • Else - Actions
      • Unit - Set mana of Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Percentage mana of Infernal_Delusion_Caster[Infernal_Delusion_Player])%
      • -------- meteor --------
      • Hero - Learn skill for Infernal_Delusion_Dummy[Infernal_Delusion_Player]: Infernal Meteor
      • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[Infernal_Delusion_Player]))))
      • Unit - Set level of Infernal Meteor for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of Infernal Meteor for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[Infernal_Delusion_Player]))))
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Caster_Point[udg_Infernal_Delusion_Player])
      • Set Infernal_Delusion_ON[Infernal_Meteor_Player] = True
      • Game - Display to (All players) the text: ON
      • Trigger - Turn on Infernal Delusion loop <gen>
Loop:
  • Infernal Delusion loop
    • Events
      • Time - Every (Random real number between 0.50 and 1.50) seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Infernal_Delusion_ON[(Integer A)] Equal to True
                  • (Infernal_Delusion_Dummy[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Set Infernal_Delusion_Caster_Point[(Integer A)] = (Position of Infernal_Delusion_Caster[(Integer A)])
              • Set Infernal_Delusion_Dummy_Point[(Integer A)] = (Position of Infernal_Delusion_Dummy[(Integer A)])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Infernal_Delusion_Caster_Point[(Integer A)] and Infernal_Delusion_Dummy_Point[(Integer A)]) Greater than 200.00
                • Then - Actions
                  • Unit - Order Infernal_Delusion_Dummy[(Integer A)] to Move To Infernal_Delusion_Caster_Point[(Integer A)]
                • Else - Actions
                  • Set Infernal_Delusion_Random_Point[(Integer A)] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[(Integer A)] with size (200.00, 200.00)))
                  • Unit - Order Infernal_Delusion_Dummy[(Integer A)] to Attack-Move To Infernal_Delusion_Random_Point[(Integer A)]
                  • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[GetForLoopIndexA()])
              • Custom script: call RemoveLocation(udg_Infernal_Delusion_Caster_Point[GetForLoopIndexA()])
              • Custom script: call RemoveLocation(udg_Infernal_Delusion_Dummy_Point[GetForLoopIndexA()])
            • Else - Actions
Meteor begin:
  • Infernal Delusion Meteor
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Meteor
    • Actions
      • Set Infernal_Meteor_Player = (Player number of (Owner of (Triggering unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Infernal Mage COPY
        • Then - Actions
          • Set Infernal_Delusion_ON[Infernal_Meteor_Player] = False
          • Game - Display to (All players) the text: OFF
        • Else - Actions
Meteor start:
  • Infernal Meteor cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Meteor
    • Actions
      • Set Infernal_Meteor_Player = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Meteor_Caster[Infernal_Meteor_Player] = (Triggering unit)
      • Set Infernal_Meteor_Target_Point[Infernal_Meteor_Player] = (Target point of ability being cast)
      • Set Infernal_Meteor_Distance[Infernal_Meteor_Player] = 1200
      • Set Infernal_Meteor_Point[Infernal_Meteor_Player] = (Position of Infernal_Meteor_Caster[Infernal_Meteor_Player])
      • Set Infernal_Meteor_Angle[Infernal_Meteor_Player] = (Angle from Infernal_Meteor_Point[Infernal_Meteor_Player] to Infernal_Meteor_Target_Point[Infernal_Meteor_Player])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Equal to Infernal Mage COPY
        • Then - Actions
          • Set Infernal_Delusion_Dummy[Infernal_Meteor_Player] = Infernal_Meteor_Caster[Infernal_Meteor_Player]
          • Set Infernal_Delusion_ON[Infernal_Meteor_Player] = True
          • Game - Display to (All players) the text: ON
        • Else - Actions
          • Unit - Order Infernal_Delusion_Dummy[Infernal_Meteor_Player] to Human Dragonhawk Rider - Cloud Infernal_Meteor_Target_Point[Infernal_Meteor_Player]
      • Unit - Create 1 Infernal Meteor for (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) at Infernal_Meteor_Point[Infernal_Meteor_Player] facing Infernal_Meteor_Angle[Infernal_Meteor_Player] degrees
      • Set Infernal_Meteor[Infernal_Meteor_Player] = (Last created unit)
      • Unit Group - Add Infernal_Meteor[Infernal_Meteor_Player] to Infernal_Meteors
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Point[udg_Infernal_Meteor_Player])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Not equal to Player 1 (Red)
              • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Not equal to Player 7 (Green)
        • Then - Actions
          • Unit Group - Add Infernal_Meteor_Caster[Infernal_Meteor_Player] to Infernal_Meteor_Casters
        • Else - Actions
      • Trigger - Turn on Infernal Meteor loop <gen>
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Infernal_Delusion_Dummy[(Integer A)] is alive) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: (Dummy # + ((String((Integer A))) + is alive!))
              • Game - Display to (All players) the text: (Dummie's level - + (String((Hero level of Infernal_Delusion_Dummy[(Integer A)]))))
              • Game - Display to (All players) the text: (Level of delusion - + (String((Level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[(Integer A)]))))
              • Game - Display to (All players) the text: (METEOR level - + (String((Level of Infernal Meteor for Infernal_Delusion_Dummy[(Integer A)]))))
            • Else - Actions
Any ideas?
P.S. I can of course remove the ON/OFF boolean, but then the spell might be interrupted by the periodic event...
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Time - Every (Random real number between 0.50 and 1.50) seconds of game time:
this does not work, as you think it does. Actually a random number between 0.5 and 1.5 seconds is chosen at the start of the map. This duration will be used for the rest of the game.

Meteor begin and Meteor start use the same event and condition. This means they always run at the "same" time, but sequentially.

One trigger contains:
Set Infernal_Delusion_ON[Infernal_Meteor_Player] = True
the other one contains:
Set Infernal_Delusion_ON[Infernal_Meteor_Player] = False

You can't really say which one runs first and you should fix the problem, that the result of your spell depends on the order in which these triggers are executed.

In this case I assume it is first set to true, then to false and remains there preventing your loop trigger from working.

What you should do is only having one trigger that runs when this ability is cast by the actual hero:

hero casts spell:
-> order dummy to cast spell
-> set on to false
wait until dummy finished casting (if duration is varying, because it is a channeling spell, you should use a periodic event. If it is fixed, you should use a timer)
-> set on to true
 
Level 10
Joined
Mar 17, 2012
Messages
579
You can't really say which one runs first and you should fix the problem

Somehow I was pretty certain that "Begins casting" happens before "Starts the effect" because I can make unit "stop" to prevent spell from casting if he "Begins casting"

hero casts spell:
-> order dummy to cast spell
-> set on to false
wait until dummy finished casting (if duration is varying, because it is a channeling spell, you should use a periodic event. If it is fixed, you should use a timer)
-> set on to true

Sounds good, it sounds like an alternative way :)

By the way, there is a problem with spell cooldown. Some time ago when I was moving the caster to a random point by changing X and Y there were no problems, but now it doesn't have a cooldown. Any ideas why?
 
This shows in which order the spell events apply Casting Events Guide.

By the way, there is a problem with spell cooldown. Some time ago when I was moving the caster to a random point by changing X and Y there were no problems, but now it doesn't have a cooldown. Any ideas why?
If an unit interupts instantly on starts the effect the cooldown is skipped.

This does not what one might expect:
  • Time - Every (Random real number between 0.50 and 1.50) seconds of game time
it becomes this: rolling the intervale at map init and never changes it again.
call TriggerRegisterTimerEventPeriodic( gg_trg_Trigger, GetRandomReal(0.5, 1.5) )
 
Level 10
Joined
Mar 17, 2012
Messages
579
If an unit interupts instantly on starts the effect the cooldown is skipped.

But what can it be interrupted with? I mean when I had a "Unit - Move unit instantly" action, it was obvious. But now when I changed it to
  • call SetUnitX (udg_Infernal_Delusion_Caster[udg_Infernal_Delusion_Player], GetLocationX (udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player]))
I have no idea why it STARTED being interrupred suddenly (because it worked fine for a while)

Edited: Ahhhhhh, my bad, found it! I've got an extra line :D so dumb, so dumb, so dumb... :D

call TriggerRegisterTimerEventPeriodic( gg_trg_Trigger, GetRandomReal(0.5, 1.5) )

is it going to get a random number every time?
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
is it going to get a random number every time?
No.

What you need to do is to not use a periodic trigger. Use something like this:

  • Events
    • Time - YourTimer expires
  • Conditions
  • Actions
    • -------- rest of trigger here --------
    • Countdown Timer - Start YourTimer as a One-shot timer that will expire in (Random real number between 0.50 and 1.50) seconds
This will make the trigger repeat endlessly and have a random interval. You do need to start the timer once elsewhere though, or run it manually. Presumably at game start.
 
Level 10
Joined
Mar 17, 2012
Messages
579
Well, if anyone is going to be interested in this kind of spell, I'm giving you these triggers. I'm really happy that it finally worked :D
Please, proofread it if you don't mind :)

Create a dummy:
  • Infernal Delusion
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Delusion new
    • Actions
      • Set Infernal_Delusion_Player = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Delusion_Caster[Infernal_Delusion_Player] = (Triggering unit)
      • Set Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] = (Position of Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Special Effect - Create a special effect at Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- shift position --------
      • Unit - Hide Infernal_Delusion_Caster[Infernal_Delusion_Player]
      • Set Infernal_Delusion_Random_Point[Infernal_Delusion_Player] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] with size (200.00, 200.00)))
      • Custom script: call SetUnitX (udg_Infernal_Delusion_Caster[udg_Infernal_Delusion_Player], GetLocationX (udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player]))
      • Custom script: call SetUnitY (udg_Infernal_Delusion_Caster[udg_Infernal_Delusion_Player], GetLocationY (udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player]))
      • Special Effect - Create a special effect at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player])
      • Unit - Unhide Infernal_Delusion_Caster[Infernal_Delusion_Player]
      • Selection - Select Infernal_Delusion_Caster[Infernal_Delusion_Player] for (Owner of Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • -------- create dummy --------
      • Set Infernal_Delusion_Random_Point[Infernal_Delusion_Player] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Infernal_Delusion_Player] with size (200.00, 200.00)))
      • Special Effect - Create a special effect at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] using Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Infernal_Delusion_Caster[Infernal_Delusion_Player] belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 1 (Red) at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] = (Last created unit)
        • Else - Actions
          • Unit - Create 1 Infernal Mage COPY for Player 7 (Green) at Infernal_Delusion_Random_Point[Infernal_Delusion_Player] facing Default building facing degrees
          • Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] = (Last created unit)
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Player])
      • -------- expiration --------
      • Unit - Add a 20.00 second Generic expiration timer to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
      • -------- levels --------
      • Hero - Set Infernal_Delusion_Dummy[Infernal_Delusion_Player] Hero-level to (Hero level of Infernal_Delusion_Caster[Infernal_Delusion_Player]), Hide level-up graphics
      • Unit - Set level of LVLup Armor for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of LVLup Armor for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Unit - Set level of Infernal Delusion check (+1) for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of Infernal Delusion new for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • -------- items --------
      • For each (Integer B) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Infernal_Delusion_Item[(Integer B)] = (Item carried by Infernal_Delusion_Caster[Infernal_Delusion_Player] in slot (Integer B))
          • Hero - Create (Item-type of Infernal_Delusion_Item[(Integer B)]) and give it to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
      • -------- HP --------
      • Set Infernal_Delusion_Difference[Infernal_Delusion_Player] = ((Max life of Infernal_Delusion_Caster[Infernal_Delusion_Player]) - (Max life of Infernal_Delusion_Dummy[Infernal_Delusion_Player]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Infernal_Delusion_Player] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Infernal_Delusion_Player])), do (Actions)
            • Loop - Actions
              • Unit - Add LIFE +1 to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Increase level of LIFE +1 for Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Remove LIFE +1 from Infernal_Delusion_Dummy[Infernal_Delusion_Player]
        • Else - Actions
      • Unit - Set life of Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Percentage life of Infernal_Delusion_Caster[Infernal_Delusion_Player])%
      • -------- MP --------
      • Set Infernal_Delusion_Difference[Infernal_Delusion_Player] = ((Max mana of Infernal_Delusion_Caster[Infernal_Delusion_Player]) - (Max mana of Infernal_Delusion_Dummy[Infernal_Delusion_Player]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Infernal_Delusion_Difference[Infernal_Delusion_Player] Greater than 0.00
        • Then - Actions
          • For each (Integer A) from 1 to (Integer(Infernal_Delusion_Difference[Infernal_Delusion_Player])), do (Actions)
            • Loop - Actions
              • Unit - Add MANA +1 to Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Increase level of MANA +1 for Infernal_Delusion_Dummy[Infernal_Delusion_Player]
              • Unit - Remove MANA +1 from Infernal_Delusion_Dummy[Infernal_Delusion_Player]
        • Else - Actions
      • Unit - Set mana of Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Percentage mana of Infernal_Delusion_Caster[Infernal_Delusion_Player])%
      • -------- meteor --------
      • Hero - Learn skill for Infernal_Delusion_Dummy[Infernal_Delusion_Player]: Infernal Meteor
      • Unit - Set level of Infernal Meteor for Infernal_Delusion_Dummy[Infernal_Delusion_Player] to (Level of Infernal Meteor for Infernal_Delusion_Caster[Infernal_Delusion_Player])
      • Custom script: call RemoveLocation(udg_Infernal_Delusion_Caster_Point[udg_Infernal_Delusion_Player])
      • Set Infernal_Delusion_ON[Infernal_Delusion_Player] = True
      • Trigger - Turn on Infernal Delusion loop <gen>
Dummy movement:
  • Infernal Delusion loop
    • Events
      • Time - Every 0.60 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Infernal_Delusion_Int) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Infernal_Delusion_ON[Infernal_Delusion_Int] Equal to True
                  • (Infernal_Delusion_Dummy[Infernal_Delusion_Int] is alive) Equal to True
            • Then - Actions
              • Set Infernal_Delusion_Caster_Point[Infernal_Delusion_Int] = (Position of Infernal_Delusion_Caster[Infernal_Delusion_Int])
              • Set Infernal_Delusion_Dummy_Point[Infernal_Delusion_Int] = (Position of Infernal_Delusion_Dummy[Infernal_Delusion_Int])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Infernal_Delusion_Caster_Point[Infernal_Delusion_Int] and Infernal_Delusion_Dummy_Point[Infernal_Delusion_Int]) Greater than 200.00
                • Then - Actions
                  • Unit - Order Infernal_Delusion_Dummy[Infernal_Delusion_Int] to Move To Infernal_Delusion_Caster_Point[Infernal_Delusion_Int]
                • Else - Actions
                  • Set Infernal_Delusion_ON[Infernal_Delusion_Int] = False
                  • Set Infernal_Delusion_ON[Infernal_Delusion_Int] = True
                  • Set Infernal_Delusion_Random_Point[Infernal_Delusion_Int] = (Random point in (Region centered at Infernal_Delusion_Caster_Point[Infernal_Delusion_Int] with size (200.00, 200.00)))
                  • Unit - Order Infernal_Delusion_Dummy[Infernal_Delusion_Int] to Attack-Move To Infernal_Delusion_Random_Point[Infernal_Delusion_Int]
                  • Custom script: call RemoveLocation(udg_Infernal_Delusion_Random_Point[udg_Infernal_Delusion_Int])
              • Custom script: call RemoveLocation(udg_Infernal_Delusion_Caster_Point[udg_Infernal_Delusion_Int])
              • Custom script: call RemoveLocation(udg_Infernal_Delusion_Dummy_Point[udg_Infernal_Delusion_Int])
            • Else - Actions
Begin casting the Meteor:
  • Infernal Meteor begin delusion
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Infernal Meteor
          • (Unit-type of (Triggering unit)) Not equal to Infernal Mage COPY
    • Actions
      • Set Infernal_Meteor_Player = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Meteor_Target_Point[Infernal_Meteor_Player] = (Target point of ability being cast)
      • Set Infernal_Delusion_ON[Infernal_Meteor_Player] = False
      • Unit - Order Infernal_Delusion_Dummy[Infernal_Meteor_Player] to Human Dragonhawk Rider - Cloud Infernal_Meteor_Target_Point[Infernal_Meteor_Player]
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Infernal_Meteor_Player])
Start casting the Meteor:
  • Infernal Meteor cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Meteor
    • Actions
      • Set Infernal_Meteor_Player = (Player number of (Owner of (Triggering unit)))
      • Set Infernal_Meteor_Caster[Infernal_Meteor_Player] = (Triggering unit)
      • Set Infernal_Meteor_Target_Point[Infernal_Meteor_Player] = (Target point of ability being cast)
      • Set Infernal_Meteor_Distance[Infernal_Meteor_Player] = 1200
      • Set Infernal_Meteor_Point[Infernal_Meteor_Player] = (Position of Infernal_Meteor_Caster[Infernal_Meteor_Player])
      • Set Infernal_Meteor_Angle[Infernal_Meteor_Player] = (Angle from Infernal_Meteor_Point[Infernal_Meteor_Player] to Infernal_Meteor_Target_Point[Infernal_Meteor_Player])
      • Unit - Create 1 Infernal Meteor for (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) at Infernal_Meteor_Point[Infernal_Meteor_Player] facing Infernal_Meteor_Angle[Infernal_Meteor_Player] degrees
      • Set Infernal_Meteor[Infernal_Meteor_Player] = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to Infernal_Meteor[Infernal_Meteor_Player]
      • Unit Group - Add Infernal_Meteor[Infernal_Meteor_Player] to Infernal_Meteors
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Not equal to Player 1 (Red)
              • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Not equal to Player 7 (Green)
        • Then - Actions
          • Set Infernal_Meteor_Damage[Infernal_Meteor_Player] = ((((Real((Level of Infernal Meteor for Infernal_Meteor_Caster[Infernal_Meteor_Player]))) x 15.00) + 0.00) + ((Real((Intelligence of Infernal_Meteor_Caster[Infernal_Meteor_Player] (Include bonuses)))) x (((Real((Level of Infernal Meteor for Infernal_Meteor_C
          • Unit Group - Add Infernal_Meteor_Caster[Infernal_Meteor_Player] to Infernal_Meteor_Casters
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Infernal_Meteor_Caster[Infernal_Meteor_Player]) Equal to Infernal Mage COPY
            • Then - Actions
              • Set Infernal_Meteor_Damage[Infernal_Meteor_Player] = (((((Real((Level of Infernal Meteor for Infernal_Meteor_Caster[Infernal_Meteor_Player]))) x 15.00) + 0.00) + ((Real((Intelligence of Infernal_Meteor_Caster[Infernal_Meteor_Player] (Include bonuses)))) x (((Real((Level of Infernal Meteor for Infernal_Meteor_
              • Unit Group - Pick every unit in Infernal_Meteor_Casters and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) belongs to an ally of (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Player])) Equal to True
                    • Then - Actions
                      • Set Infernal_Delusion_Int = (Player number of (Owner of (Picked unit)))
                    • Else - Actions
              • Set Infernal_Delusion_ON[Infernal_Delusion_Int] = True
            • Else - Actions
              • Set Infernal_Delusion_ON[Infernal_Delusion_Int] = True
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Point[udg_Infernal_Meteor_Player])
      • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Infernal_Meteor_Player])
      • Trigger - Turn on Infernal Meteor loop <gen>
Meteor work (skill shot):
  • Infernal Meteor loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Infernal_Meteors is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
        • Else - Actions
      • Unit Group - Pick every unit in Infernal_Meteors and do (Actions)
        • Loop - Actions
          • Set Infernal_Meteor_Int = (Player number of (Owner of (Picked unit)))
          • Set Infernal_Meteor[Infernal_Meteor_Int] = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Infernal_Meteor_Distance[Infernal_Meteor_Int] Greater than 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Infernal_Meteor[Infernal_Meteor_Int] is alive) Equal to True
                • Then - Actions
                  • Set Infernal_Meteor_Distance[Infernal_Meteor_Int] = (Infernal_Meteor_Distance[Infernal_Meteor_Int] - 30)
                  • Set Infernal_Meteor_Point[Infernal_Meteor_Int] = (Position of Infernal_Meteor[Infernal_Meteor_Int])
                  • Set Infernal_Meteor_Movement[Infernal_Meteor_Int] = (Infernal_Meteor_Point[Infernal_Meteor_Int] offset by 30.00 towards Infernal_Meteor_Angle[Infernal_Meteor_Int] degrees)
                  • Unit - Move Infernal_Meteor[Infernal_Meteor_Int] instantly to Infernal_Meteor_Movement[Infernal_Meteor_Int], facing Infernal_Meteor_Angle[Infernal_Meteor_Int] degrees
                  • Set Infernal_Meteor_Group[Infernal_Meteor_Int] = (Units within 100.00 of Infernal_Meteor_Movement[Infernal_Meteor_Int] matching ((((Matching unit) belongs to an enemy of (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Int])) Equal to True) and ((((Matching unit) is An Ancient) Not equal to True) and (((Mat
                  • Unit Group - Pick every unit in Infernal_Meteor_Group[Infernal_Meteor_Int] and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in Infernal_Meteor_Group[Infernal_Meteor_Int]) Greater than 0
                        • Then - Actions
                          • Set Infernal_Meteor_Picked = (Random unit from Infernal_Meteor_Group[Infernal_Meteor_Int])
                          • Unit - Kill Infernal_Meteor[Infernal_Meteor_Int]
                          • -------- stacks --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • (Level of Infernal Explosion for Infernal_Meteor_Caster[Infernal_Meteor_Int]) Greater than 0
                                  • Infernal_Explosion_Stack[Infernal_Meteor_Int] Less than 4
                            • Then - Actions
                              • Set Infernal_Explosion_Stack[Infernal_Meteor_Int] = (Infernal_Explosion_Stack[Infernal_Meteor_Int] + 1)
                              • Floating Text - Destroy Combo_Mage[Infernal_Meteor_Int]
                              • Floating Text - Create floating text that reads (|cffff0000 + Infernal_Explosion_String[Infernal_Explosion_Stack[Infernal_Meteor_Int]]) above Infernal_Meteor_Caster[Infernal_Meteor_Int] with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 20.00% transparency
                              • Set Combo_Mage[Infernal_Meteor_Int] = (Last created floating text)
                              • Floating Text - Hide Combo_Mage[Infernal_Meteor_Int] for (All players)
                              • Floating Text - Show Combo_Mage[Infernal_Meteor_Int] for (Player group((Owner of Infernal_Meteor_Caster[Infernal_Meteor_Int])))
                              • Floating Text - Set the velocity of Combo_Mage[Infernal_Meteor_Int] to 20.00 towards 270.00 degrees
                            • Else - Actions
                          • -------- delusion stack --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Or - Any (Conditions) are true
                                • Conditions
                                  • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Int]) Equal to Player 1 (Red)
                                  • (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Int]) Equal to Player 7 (Green)
                            • Then - Actions
                              • Unit Group - Pick every unit in Infernal_Meteor_Casters and do (Actions)
                                • Loop - Actions
                                  • Set Player_Number_Int = (Player number of (Owner of (Picked unit)))
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • And - All (Conditions) are true
                                        • Conditions
                                          • ((Picked unit) belongs to an ally of (Owner of Infernal_Meteor_Caster[Infernal_Meteor_Int])) Equal to True
                                          • (Level of Infernal Explosion for Infernal_Meteor_Caster[Player_Number_Int]) Greater than 0
                                          • Infernal_Explosion_Stack[Player_Number_Int] Less than 4
                                    • Then - Actions
                                      • Set Infernal_Explosion_Stack[Player_Number_Int] = (Infernal_Explosion_Stack[Player_Number_Int] + 1)
                                      • Floating Text - Destroy Combo_Mage[Player_Number_Int]
                                      • Floating Text - Create floating text that reads (|cffff0000 + Infernal_Explosion_String[Infernal_Explosion_Stack[Player_Number_Int]]) above Infernal_Meteor_Caster[Player_Number_Int] with Z offset 0.00, using font size 12.00, color (100.00%, 100.00%, 100.00%), and 20.00% transparency
                                      • Set Combo_Mage[Player_Number_Int] = (Last created floating text)
                                      • Floating Text - Hide Combo_Mage[Player_Number_Int] for (All players)
                                      • Floating Text - Show Combo_Mage[Player_Number_Int] for (Player group((Owner of Infernal_Meteor_Caster[Player_Number_Int])))
                                      • Floating Text - Set the velocity of Combo_Mage[Player_Number_Int] to 20.00 towards 270.00 degrees
                                    • Else - Actions
                            • Else - Actions
                          • -------- damage --------
                          • Unit - Cause Infernal_Meteor_Caster[Infernal_Meteor_Int] to damage Infernal_Meteor_Picked, dealing Infernal_Meteor_Damage[Infernal_Meteor_Int] damage of attack type Spells and damage type Fire
                          • Special Effect - Create a special effect attached to the chest of Infernal_Meteor_Picked using OrbOfFire.mdx
                          • Special Effect - Destroy (Last created special effect)
                          • Set Infernal_Meteor_Distance[Infernal_Meteor_Int] = 0
                          • Unit - Remove Infernal_Meteor[Infernal_Meteor_Int] from the game
                          • Unit Group - Remove Infernal_Meteor[Infernal_Meteor_Int] from Infernal_Meteors
                          • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Infernal_Meteor_Int])
                          • Custom script: call DestroyGroup(udg_Infernal_Meteor_Group[udg_Infernal_Meteor_Int])
                        • Else - Actions
                • Else - Actions
                  • Set Infernal_Meteor_Distance[Infernal_Meteor_Int] = 0
            • Else - Actions
              • Set Infernal_Meteor_Distance[Infernal_Meteor_Int] = 0
              • Unit Group - Remove Infernal_Meteor[Infernal_Meteor_Int] from Infernal_Meteors
              • Unit - Remove Infernal_Meteor[Infernal_Meteor_Int] from the game
              • Custom script: call RemoveLocation(udg_Infernal_Meteor_Target_Point[udg_Infernal_Meteor_Int])
          • Custom script: call RemoveLocation(udg_Infernal_Meteor_Point[udg_Infernal_Meteor_Int])
          • Custom script: call RemoveLocation(udg_Infernal_Meteor_Movement[udg_Infernal_Meteor_Int])
          • Custom script: call DestroyGroup(udg_Infernal_Meteor_Group[udg_Infernal_Meteor_Int])
 
Status
Not open for further replies.
Top