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

[Trigger] Dispatch Spell

Status
Not open for further replies.
Level 30
Joined
Sep 30, 2008
Messages
1,460
This bug is a lot simpler than it might seem at first :)

Basically, I have made a GUI triggered spell which, when casted, causes the heroes pets to explode, dealing area damage depending on the units level.

The bugs I have are as follows:

- I need a way to make the spell unable to target any unit, except the pets

- The area damage that is dealt harms allies as well

Any idea how to fix these? Ive provided my code so far below :)

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • And - All (Conditions) are true
      • Conditions
        • (Ability being cast) Equal to |cffff8040Dispatch|r
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • Then - Actions
        • Set Player = Player Group - Player 1 (Red)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • Then - Actions
            • Set Player = Player Group - Player 2 (Blue)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
              • Then - Actions
                • Set Player = Player Group - Player 3 (Teal)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                  • Then - Actions
                    • Set Player = Player Group - Player 4 (Purple)
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                      • Then - Actions
                        • Set Player = Player Group - Player 5 (Yellow)
                      • Else - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
                          • Then - Actions
                            • Set Player = Player Group - Player 6 (Orange)
                          • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of (Target unit of ability being cast)) Not equal to |cff4e4e4eMongrol|r (Level 1)
            • (Unit-type of (Target unit of ability being cast)) Not equal to |cff4e4e4eMongrol|r (Level 2)
            • (Unit-type of (Target unit of ability being cast)) Not equal to |cff4e4e4eMongrol|r (Level 3)
            • (Unit-type of (Target unit of ability being cast)) Not equal to |cff4e4e4eMongrol|r (Level 4)
      • Then - Actions
        • Game - Display to Player the text: You must select one...
        • Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 80.00)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Unit-type of (Target unit of ability being cast)) Equal to |cff4e4e4eMongrol|r (Level 1)
      • Then - Actions
        • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\ExplosionBIG.mdx
        • Set Dispatch[0] = (Last created special effect)
        • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Target unit of ability being cast)), dealing 75.00 damage of attack type Spells and damage type Normal
        • Unit - Explode (Target unit of ability being cast)
        • Wait 2.00 game-time seconds
        • Special Effect - Destroy Dispatch[0]
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Unit-type of (Target unit of ability being cast)) Equal to |cff4e4e4eMongrol|r (Level 2)
          • Then - Actions
            • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\ExplosionBIG.mdx
            • Set Dispatch[0] = (Last created special effect)
            • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Target unit of ability being cast)), dealing 150.00 damage of attack type Spells and damage type Normal
            • Unit - Explode (Target unit of ability being cast)
            • Wait 2.00 game-time seconds
            • Special Effect - Destroy Dispatch[0]
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Or - Any (Conditions) are true
                  • Conditions
                    • (Unit-type of (Target unit of ability being cast)) Equal to |cff4e4e4eMongrol|r (Level 3)
              • Then - Actions
                • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\ExplosionBIG.mdx
                • Set Dispatch[0] = (Last created special effect)
                • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Target unit of ability being cast)), dealing 225.00 damage of attack type Spells and damage type Normal
                • Unit - Explode (Target unit of ability being cast)
                • Wait 2.00 game-time seconds
                • Special Effect - Destroy Dispatch[0]
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Or - Any (Conditions) are true
                      • Conditions
                        • (Unit-type of (Target unit of ability being cast)) Equal to |cff4e4e4eMongrol|r (Level 4)
                  • Then - Actions
                    • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using war3mapImported\ExplosionBIG.mdx
                    • Set Dispatch[0] = (Last created special effect)
                    • Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Target unit of ability being cast)), dealing 300.00 damage of attack type Spells and damage type Normal
                    • Unit - Explode (Target unit of ability being cast)
                    • Wait 2.00 game-time seconds
                    • Special Effect - Destroy Dispatch[0]
                  • Else - Actions
 
If you're not using it yet, you could use unit's classification. That is, set the Mongrols as Ancient, and select only "Ancient" in the Targets Allowed field.

As for the damage, you will have to use "Pick Every Unit", what's not so good at all, but do it. Because "Damage Area" will not mind about what unit it's damaging.
In the group the "Pick" selects, you can specify only enemies of Player, like:

Unit Group - Pick every unit in (Units within 200 of (Position of (Target Unit)) matching ((Matching unit) belongs to an enemy of Player))

which will make your life easier :p

And you don't need a If statement for every level. You can set the Point Value of each Mongrol (or even Unit Level) to the pet's level.
So instead of doing a fixed damage, you use (point-value of (Target unit) * 75)
 
Level 30
Joined
Sep 30, 2008
Messages
1,460
If you're not using it yet, you could use unit's classification. That is, set the Mongrols as Ancient, and select only "Ancient" in the Targets Allowed field.

As for the damage, you will have to use "Pick Every Unit", what's not so good at all, but do it. In the group the "Pick" selects, you can specify only enemies of Player, which will make your life easier :p

And you don't need a If statement for every level. You can set the Point Value of each Mongrol (or even Unit Level) to the pet's level.
So instead of doing a fixed damage, you use (point-value of (Target unit) * 75)

Those are some neat ideas :D especially classifying the mongrols as ancients :D

Solved my problem perfectly! +rep :D
 
Status
Not open for further replies.
Top