Play specific animation

Dinowc

don't expect anything, prepare for everything
Reaction score
223
I want my unit to play his Attack - 2 animation when he casts a spell, but I seem to fail :(

either he plays both attack animations or doesn't do anything
 

Skippy

Active Member
Reaction score
39
Trigger:
  • TRIGGER
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Speed Rage (Tauren)
    • Actions
      • Animation - Play (Triggering unit)'s attack, 2 animation


Somethink like that?

(If you use it, you have to reset animation after some time.)
 

BlackRose

Forum User
Reaction score
239
SetUnitAnimationByIndex().

You have to find out the indexes yourself by using Warcraft 3 Model Viewer or:
JASS:
scope AnimIndexes initializer Init

globals
    
    private group g = CreateGroup()
    private integer i = 0
endglobals


 function Animate takes nothing returns nothing
    call SetUnitAnimationByIndex(GetEnumUnit(),i)
endfunction
 function Actionszz takes nothing returns nothing
    set i = 0    
    call DisableTrigger(GetTriggeringTrigger())
    call GroupClear(g)
    call GroupEnumUnitsSelected(g,Player(0),null)
    loop
        exitwhen i>20
        call ForGroup(g,function Animate)
        call BJDebugMsg("|cffffcc00"+I2S(i))
        call TriggerSleepAction(2)
        set i = i + 1
    endloop
    call EnableTrigger(GetTriggeringTrigger())
endfunction

//===========================================================================
 function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()    
    call TriggerRegisterPlayerChatEvent( trig, Player(0), "-anim", true )
    call TriggerAddAction( trig, function Actionszz )
endfunction

endscope
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top