[Spell] How make a AOE Stun Spell

What did you try? Post the triggers. How is it supposed to work?
1765577640625.png
 
The trigger looks fine at first glance. I would display game messages to make sure the trigger is executing and that certain actions in the trigger are executing. In this case I would display a game message at the start of the actions to make sure the event executes and the event conditions are correct and also inside the pick every unit in group to make sure it runs. Do this and report back. This will narrow down what is causing problems.
 

Replace the unit in group actions with the example provided from the system once you add it to your map, I think it will fit nicely assuming you're using 1.31 or higher
 

Replace the unit in group actions with the example provided from the system once you add it to your map, I think it will fit nicely assuming you're using 1.31 or higher

Yes i'm using the 1.31 version.
 
here you go :D i also attach a map for you
  • Stun AOE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AOE Stun
    • Actions
      • Set VariableSet Stun_Caster = (Triggering unit)
      • Set VariableSet Stun_DMG = ((Real((Intelligence of Stun_Caster (Include bonuses)))) x 2.00)
      • Set VariableSet Stun_Targetpoint = (Target point of ability being cast)
      • Set VariableSet Stun_AOE = (Units within 400.00 of Stun_Targetpoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Stun_Caster).) Equal to True))).)
      • Unit Group - Pick every unit in Stun_AOE and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Stun Dummy for (Owner of Stun_Caster) at Stun_Targetpoint facing Default building facing degrees
          • Unit - Add AOE Stun to (Last created unit)
          • Unit - Set level of AOE Stun for (Last created unit) to (Level of AOE Stun for Stun_Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Cause Stun_Caster to damage (Picked unit), dealing Stun_DMG damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_Stun_AOE)
      • Custom script: call RemoveLocation(udg_Stun_Targetpoint)
 

Attachments

here you go :D i also attach a map for you
  • Stun AOE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AOE Stun
    • Actions
      • Set VariableSet Stun_Caster = (Triggering unit)
      • Set VariableSet Stun_DMG = ((Real((Intelligence of Stun_Caster (Include bonuses)))) x 2.00)
      • Set VariableSet Stun_Targetpoint = (Target point of ability being cast)
      • Set VariableSet Stun_AOE = (Units within 400.00 of Stun_Targetpoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Stun_Caster).) Equal to True))).)
      • Unit Group - Pick every unit in Stun_AOE and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Stun Dummy for (Owner of Stun_Caster) at Stun_Targetpoint facing Default building facing degrees
          • Unit - Add AOE Stun to (Last created unit)
          • Unit - Set level of AOE Stun for (Last created unit) to (Level of AOE Stun for Stun_Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Cause Stun_Caster to damage (Picked unit), dealing Stun_DMG damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_Stun_AOE)
      • Custom script: call RemoveLocation(udg_Stun_Targetpoint)
You're making a few common mistakes.

1. Your Dummy unit is setup incorrectly and will delay the cast.
2. You should only ever need one Dummy unit to cast your ability, even multiple times.
3. It makes more sense to use War Stomp here then something with missiles/delays like Cluster Rockets. Try to keep it simple.

To create a proper Dummy unit:
  • Copy and paste the Locust. This unit has most of the necessary settings by default.
  • Set it's Model = None (or ideally use an imported Dummy.mdx).
  • Set it's Shadow = None, Attacks Enabled = None, Movement Type = None, Speed Base = 0.
  • You can tweak other settings like it's Sight Radius or Classification if you'd like.

With these fixes in place your trigger would look like this:
  • Stun AOE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AOE Stun (Hero)
    • Actions
      • Set VariableSet Stun_Caster = (Triggering unit)
      • Set VariableSet Stun_Damage = ((Real((Intelligence of Stun_Caster (Include bonuses)))) x 2.00)
      • Set VariableSet Stun_Point = (Target point of ability being cast)
      • Set VariableSet Stun_Group = (Units within 400.00 of Stun_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Stun_Caster).) Equal to True))).)
      • -------- --------
      • Unit - Create 1 Stun Dummy for (Owner of Stun_Caster) at Stun_Point facing Default building facing degrees
      • Set VariableSet Stun_Dummy = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to Stun_Dummy
      • Unit - Add AOE Stun (War Stomp) to Stun_Dummy
      • Unit - Set level of AOE Stun (War Stomp) for Stun_Dummy to (Level of AOE Stun (Hero) for Stun_Caster)
      • Unit - Order Stun_Dummy to Orc Tauren Chieftain - War Stomp
      • -------- --------
      • Unit Group - Pick every unit in Stun_Group and do (Actions)
        • Loop - Actions
          • Unit - Cause Stun_Caster to damage (Picked unit), dealing Stun_Damage damage of attack type Spells and damage type Normal
      • -------- --------
      • Custom script: call DestroyGroup(udg_Stun_Group)
      • Custom script: call RemoveLocation(udg_Stun_Point)
Or if you wanted that single Dummy to cast Storm Bolt on all of the enemy units you would do this:
  • Stun AOE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to AOE Stun (Hero)
    • Actions
      • Set VariableSet Stun_Caster = (Triggering unit)
      • Set VariableSet Stun_Damage = ((Real((Intelligence of Stun_Caster (Include bonuses)))) x 2.00)
      • Set VariableSet Stun_Point = (Target point of ability being cast)
      • Set VariableSet Stun_Group = (Units within 400.00 of Stun_Point matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Stun_Caster).) Equal to True))).)
      • -------- --------
      • Unit - Create 1 Stun Dummy for (Owner of Stun_Caster) at Stun_Point facing Default building facing degrees
      • Set VariableSet Stun_Dummy = (Last created unit)
      • Unit - Add a 1.00 second Generic expiration timer to Stun_Dummy
      • Unit - Add AOE Stun (Storm Bolt) to Stun_Dummy
      • Unit - Set level of AOE Stun (Storm Bolt) for Stun_Dummy to (Level of AOE Stun (Hero) for Stun_Caster)
      • -------- --------
      • Unit Group - Pick every unit in Stun_Group and do (Actions)
        • Loop - Actions
          • Unit - Order Stun_Dummy to Human Mountain King - Storm Bolt (Picked unit)
          • Unit - Cause Stun_Caster to damage (Picked unit), dealing Stun_Damage damage of attack type Spells and damage type Normal
      • -------- --------
      • Custom script: call DestroyGroup(udg_Stun_Group)
      • Custom script: call RemoveLocation(udg_Stun_Point)
You would set Storm Bolt's Missile Speed to 0 to make it impact it's target as fast as possible. Remember, there's all sorts of delays in Warcraft that you can cause problems. But it's easy to remove them and get snappy and responsive effects. This can even fix bugs.

Some other things to think about:
  • The duration of the Expiration Timer would ideally outlast any important ability effects such as damage over time. This is to retain things like the (Killing unit) Event Response in your other triggers.
  • The Dummy unit may need vision of it's target. Solutions include granting momentary vision or having the Dummy owned by an "all seeing" hostile Computer player. Keep in mind that kill credit will go to the owner of this unit.
  • Whenever you deal triggered damage there's potential that the damaged unit dies, which causes the "A unit Dies" Event to fire. This Event breaks the "trigger queue rules" and will run any associated Conditions/Actions immediately. Solutions include using variables to track data that can be overwritten, dealing damage as late as possible, and using one central "A unit Dies" Event for everything death related.
 
Last edited:
Back
Top