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

Ranged heroes bash triggers spell shield

Status
Not open for further replies.
Level 45
Joined
Feb 27, 2007
Messages
5,578
You could fake it with PauseUnitEx and a DDS. You could try making whatever applies the stun an ultimate ability so maybe it pierces the spell shield (I don't know if this would still trigger the shield or what, but ultimates ignore spell immunity/resistant skin). You could do this by applying it with a dummy cast storm bolt by a hero-type dummy with storm bolt as an ultimate, or try flagging the bash spell as an ultimate.
 

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
You could fake it with PauseUnitEx and a DDS. You could try making whatever applies the stun an ultimate ability so maybe it pierces the spell shield (I don't know if this would still trigger the shield or what, but ultimates ignore spell immunity/resistant skin). You could do this by applying it with a dummy cast storm bolt by a hero-type dummy with storm bolt as an ultimate, or try flagging the bash spell as an ultimate.
Unfortunately, spell shield works even against ultimates.
 

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
You could fake it with PauseUnitEx and a DDS. You could try making whatever applies the stun an ultimate ability so maybe it pierces the spell shield (I don't know if this would still trigger the shield or what, but ultimates ignore spell immunity/resistant skin). You could do this by applying it with a dummy cast storm bolt by a hero-type dummy with storm bolt as an ultimate, or try flagging the bash spell as an ultimate.
When I use PauseUnitEx the GUI for this unit is gone (there are no abilities or commands). Is there any other method or what to do to prevent the gui from turning black?
1678541446088.png
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
That's not PauseUnitEx, that's Pause.
  • Custom script: call BlzPauseUnitEx(udg_YourUnit, true)
  • Custom script: call BlzPauseUnitEx(udg_YourUnit, false)
This function is only available through code (custom script). Also, it can really screw things up if you don't understand how it works.
 

KPC

KPC

Level 7
Joined
Jun 15, 2018
Messages
195
That's not PauseUnitEx, that's Pause.
  • Custom script: call BlzPauseUnitEx(udg_YourUnit, true)
  • Custom script: call BlzPauseUnitEx(udg_YourUnit, false)
This function is only available through code (custom script). Also, it can really screw things up if you don't understand how it works.
I did something like that. It works but please tell me is this done correctly?

My question is, am I not doing something that once a unit is stunned, I can't stun it again? Like does stun trigger works for already stunned unit?

  • Bash
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageAttack Equal to True
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Custom script: local unit u = udg_DamageEventTarget
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set VariableSet CV = (Custom value of DamageEventTarget)
          • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AR_Counter[CV] Equal to 1
            • Then - Actions
              • Custom script: call BlzPauseUnitEx(udg_DamageEventTarget, true)
              • Unit - Add Stunned (buff) to DamageEventTarget
            • Else - Actions
          • Wait 1.00 seconds
          • Custom script: set udg_AR_Unit = u
          • Set VariableSet CV = (Custom value of AR_Unit)
          • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • AR_Counter[CV] Equal to 0
            • Then - Actions
              • Custom script: call BlzPauseUnitEx(udg_AR_Unit, false)
              • Unit - Remove Stunned (buff) from AR_Unit
              • Set VariableSet AR_Counter[CV] = 0
            • Else - Actions
        • Else - Actions
      • Custom script: set u = null
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
You can call this function:
  • Custom script: call BlzPauseUnitEx(udg_DamageEventTarget, true)
As many times as you want. You just need to make sure that you undo it the same number of times:
  • Custom script: call BlzPauseUnitEx(udg_AR_Unit, false)
The logic is pretty straightforward, a unit has 0 stun counters by default and isn't considered stunned. Calling this function as true will +1 this counter, check if it's equal to 1, and stun the unit if so. Calling this function as false will -1 this counter, check if it's now equal to 0, and unstun the unit if so.

You could make a unit "stun immune" by making sure this counter is always < 0 which is pretty neat. Or, if you're not careful, you can permanently stun a unit if you increase the counter above 0 and fail to subtract it back down again.

Your trigger looks good though, AR_Counter serves useful as a way to Add/Remove the "buff" ability and prevent the function from stacking.

Here's the same trigger after I cleaned some things up:
  • Bash
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • IsDamageAttack Equal to True
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Custom script: local unit udg_AR_Unit = udg_DamageEventTarget
      • Set VariableSet CV = (Custom value of udg_AR_Unit)
      • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AR_Counter[CV] Equal to 1
        • Then - Actions
          • Custom script: call BlzPauseUnitEx(udg_AR_Unit, true)
          • Unit - Add Stunned (buff) to udg_AR_Unit
        • Else - Actions
      • Wait 1.00 second game-time
      • Set VariableSet CV = (Custom value of AR_Unit)
      • Set VariableSet AR_Counter[CV] = (AR_Counter[CV] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AR_Counter[CV] Equal to 0
        • Then - Actions
          • Custom script: call BlzPauseUnitEx(udg_AR_Unit, false)
          • Unit - Remove Stunned (buff) from AR_Unit
        • Else - Actions
      • Custom script: set udg_AR_Unit = null
I don't love the usage of Waits but if you don't care then whatever.

Also, I assume you'll have some Condition to check if the (Damage source) actually has the Bash ability.
 
Last edited:
Status
Not open for further replies.
Top