• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Play animations when have buffs

Status
Not open for further replies.
Level 3
Joined
Oct 13, 2020
Messages
11
Hi, friends! Need help

Can I make a trigger or triggers that will play specific animations, for example, when a unit or group of units are stunned? And how should I do it in a clever way?

And is there a way to play different animations for units,while they have specific buffs.

I've tried some ways, but couldnt get any good result(

Can anybody help?)
 
Level 20
Joined
Feb 27, 2019
Messages
594
I saw from Pyrogasm that the order id stunned units recieve is 851973. You could use that to detect when a unit gets stunned then check its buffs and add it to a group and periodically check if they still have the buff after that.

That doesnt help if you want it for any other buff than one that stuns though.
 
If you use a stun system to apply all your stuns you only need to apply an animation tag as long as the model has the required animations. Let's say "Stand Alternate" shows the stun animation, then you need to add the "Alternate" tag. If you have multiple sources for your stuns you need to apply it at every stun spell. Add the stunned units to a unit group.

To remove it make a periodic trigger that checks all the units in the unit group. Check if the units in the unit group has the "Stunned" buff. If they don't have it, remove the appropriate animation tags, and remove them from the unit group.
 
Level 3
Joined
Oct 13, 2020
Messages
11
Thanks for the tips. I'll try.

How about Evasion. Can I play needed animation for unit, that has the ability, and when someone misses? To make the unit dodge)
 
Level 20
Joined
Feb 27, 2019
Messages
594
Youd need to detect the miss. I dont think a miss can be detected. You can trigger a detectable miss. It can be done well with a damage engine. You can add your own text instead of "miss".

With Damage Engine 5.7.1.1 you can make this trigger:
  • Dodge
    • Events
      • Game - DamageModifierEvent becomes Less than 0.00
    • Conditions
      • (Level of Evasion for DamageEventTarget) Not equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random real number between 0.01 and 1.00) Less than 0.21
        • Then - Actions
          • Set VariableSet DamageEventAmount = 0.00
          • Set VariableSet DamageEventArmorT = ARMOR_TYPE_NONE
          • Set VariableSet DamageEventWeaponT = WEAPON_TYPE_NONE
          • Set VariableSet DmgStr = |cffffff00dodge|r
          • Custom script: call ArcingTextTag.create(udg_DmgStr, udg_DamageEventTarget)
          • Animation - Play DamageEventTarget's stand animation
          • Animation - Queue DamageEventTarget's stand animation
        • Else - Actions
EDIT: Modified the trigger a bit
 
Last edited:
Status
Not open for further replies.
Top