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

[General] Need help with a roar ability trigger

Enraging Roar
The Warlord lets loose a furious roar that instills bloodrage in nearby friendly units.
Lasts 45 seconds.
Increases the attack rate by 40/55/70, but drains 4 hit points per second.

In my modmap have got this roar ability on a hero that when cast applies an orcish version of unholy frenzy simply named bloodrage to all that have been in range. Except it has been reported that it does not function correctly, apparently only one unit was getting the buff so set about to trying to fix it.

I would like to change the trigger so that it takes effect when the ability gets used, as every other roar ability also works at moment of cast.
If i set the event to
  • Unit - A unit Starts the effect of an ability
it seems to not work, probably because tries to take effect before the buff has come on the unit.
Another issue i have got is to how can make it work using only one dummy instead of having to summon one per affected unit ?

  • Enraging Roar
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Enraging Roar
    • Actions
      • Set WarCry_AoE = 500.00
      • Set WarCry_Caster = (Triggering unit)
      • Set WarCry_Player = (Triggering player)
      • Set WarCry_Point = (Position of WarCry_Caster)
      • Set WarCry_Group = (Units within (WarCry_AoE + 300.00) of WarCry_Point)
      • Unit Group - Pick every unit in WarCry_Group and do (Actions)
        • Loop - Actions
          • Set WarCry_Target = (Picked unit)
          • Custom script: if IsUnitInRange(udg_WarCry_Target, udg_WarCry_Caster, udg_WarCry_AoE) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Enraging Roar for WarCry_Caster) Equal to 1
              • (WarCry_Target is alive) Equal to True
              • (WarCry_Target belongs to an enemy of WarCry_Player) Equal to False
              • (WarCry_Target has buff Enraging Roar ) Equal to True
            • Then - Actions
              • Unit - Create 1 Dummy Unit (0 Collision) for WarCry_Player at (Position of WarCry_Caster) facing WarCry_Point
              • Set WarCry_Dummy = (Last created unit)
              • Unit - Add a 0.30 second Generic expiration timer to WarCry_Dummy
              • Unit - Add Bloodrage (dummy) to WarCry_Dummy
              • Unit - Set level of Bloodrage (dummy) for WarCry_Dummy to 1
              • Unit - Order WarCry_Dummy to Undead Necromancer - Unholy Frenzy WarCry_Target
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Enraging Roar for WarCry_Caster) Equal to 2
              • (WarCry_Target is alive) Equal to True
              • (WarCry_Target belongs to an enemy of WarCry_Player) Equal to False
              • (WarCry_Target has buff Enraging Roar ) Equal to True
            • Then - Actions
              • Unit - Create 1 Dummy Unit (0 Collision) for WarCry_Player at (Position of WarCry_Caster) facing WarCry_Point
              • Set WarCry_Dummy = (Last created unit)
              • Unit - Add a 0.30 second Generic expiration timer to WarCry_Dummy
              • Unit - Add Bloodrage (dummy) to WarCry_Dummy
              • Unit - Set level of Bloodrage (dummy) for WarCry_Dummy to 2
              • Unit - Order WarCry_Dummy to Undead Necromancer - Unholy Frenzy WarCry_Target
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Enraging Roar for WarCry_Caster) Equal to 3
              • (WarCry_Target is alive) Equal to True
              • (WarCry_Target belongs to an enemy of WarCry_Player) Equal to False
              • (WarCry_Target has buff Enraging Roar ) Equal to True
            • Then - Actions
              • Unit - Create 1 Dummy Unit (0 Collision) for WarCry_Player at (Position of WarCry_Caster) facing WarCry_Point
              • Set WarCry_Dummy = (Last created unit)
              • Unit - Add a 0.30 second Generic expiration timer to WarCry_Dummy
              • Unit - Add Bloodrage (dummy) to WarCry_Dummy
              • Unit - Set level of Bloodrage (dummy) for WarCry_Dummy to 3
              • Unit - Order WarCry_Dummy to Undead Necromancer - Unholy Frenzy WarCry_Target
            • Else - Actions
          • Custom script: endif
      • Custom script: call RemoveLocation (udg_WarCry_Point)
      • Custom script: call DestroyGroup(udg_WarCry_Group)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
You can simplify the trigger to this:
  • Enraging Roar
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Enraging Roar
    • Actions
      • Set WarCry_AoE = 500.00
      • Set WarCry_Caster = (Triggering unit)
      • Set WarCry_Player = (Triggering player)
      • Set WarCry_Point = (Position of WarCry_Caster)
      • Unit - Create 1 Dummy Unit (0 Collision) for WarCry_Player at WarCry_Point facing default building degrees
      • Set WarCry_Dummy = (Last created unit)
      • Unit - Add a 0.30 second Generic expiration timer to WarCry_Dummy
      • Unit - Add Bloodrage (dummy) to WarCry_Dummy
      • Unit - Set level of Bloodrage (dummy) for WarCry_Dummy to (Level of (Ability being cast))
      • Set WarCry_Group = (Units within (WarCry_AoE + 300.00) of WarCry_Point)
      • Unit Group - Pick every unit in WarCry_Group and do (Actions)
        • Loop - Actions
          • Set WarCry_Target = (Picked unit)
          • Custom script: if IsUnitInRange(udg_WarCry_Target, udg_WarCry_Caster, udg_WarCry_AoE) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (WarCry_Target is alive) Equal to True
              • (WarCry_Target belongs to an enemy of WarCry_Player) Equal to False
            • Then - Actions
              • Unit - Order WarCry_Dummy to Undead Necromancer - Unholy Frenzy WarCry_Target
            • Else - Actions
          • Custom script: endif
      • Custom script: call RemoveLocation (udg_WarCry_Point)
      • Custom script: call DestroyGroup(udg_WarCry_Group)
1) I don't see the point of using two buffs here since Unholy Frenzy applies the buff that we actually need for attack speed / life loss. Set Enraging Roar's Targets Allowed to None so it doesn't do anything. If you need both buffs I still wouldn't bother checking for it in the Conditions.
2) Reference the (Level of the (Ability being cast)) to scale the Dummy ability instead of creating multiple If Then Else statements.
3) IsUnitInRange() isn't all that necessary and may be a waste of effort for minimal gain. I see you're using it to get a proper Area of Effect but I recall this method not even working properly in this use case.
4) We can use a single Dummy unit to cast Unholy Frenzy (and any ability) any number of times in the same game frame.

To get a proper working Dummy unit follow these steps:
1) Copy and paste the Locust unit.
2) Change it's Model, Shadow, Attacks Enabled, and Movement Type to None. Change it's Speed Base to 0.

You can use this Dummy unit in all of your triggers to cast spells without issues. It won't have to turn to face it's target and can cast spells "instantly" thanks to it's 0.00 Art - Cast Point / Art - Cast Backswing and Movement fields.

Most information is outdated so I recommend looking up my posts made in the last 2-3 years if you want the most up to date info. I have basically documented my entire learning experience going from GUI nooby to now able to code basically anything I want (of course thanks to the fine folks at Hive for assisting me along the way). My go to method is to google search "Hiveworkshop uncle X TOPIC", I know that sounds conceited but I've responded to almost every thread in the WEHZ/Trigger Scripts forums for the last few years and have kept up on the latest working solutions. I also have a million demo maps to play around with, although you appear to be on an older version so you probably can't open them.
 
Last edited:
Top