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

Need Help Modifying Advanced Trigger

Status
Not open for further replies.
Level 7
Joined
Feb 20, 2016
Messages
274
What is this trigger, I wonder?

To post your trigger, insert [trigger][/trigger] tags and place the text of triggers in between them.
It's several triggers actually in folders: CAVALRY ATTACK FOLDER and maybe this one TO DETERMINE ANIMATION INDEX (NOT NECESSARY). It's the map I uploaded here.
 

Attachments

  • (8)GardenOfWar modded.w3x
    8 MB · Views: 59
Level 11
Joined
Aug 6, 2009
Messages
697
Put all the triggers in question below in the spoilers.
Still don't know what the problem is. Need to elaborate what you need help on.

  • CAV INDEX ANIMATION
    • Events
    • Conditions
    • Actions
      • Set CAVtemp_unit_type = Knight
      • Set CAVinteger = 5
      • Custom script: set udg_CAVinteger2 = udg_CAVtemp_unit_type
      • Custom script: call SaveIntegerBJ( udg_CAVinteger, 0, udg_CAVinteger2, udg_HASHCAVALRY )
      • Set CAVtemp_unit_type = Raider
      • Set CAVinteger = 2
      • Custom script: set udg_CAVinteger2 = udg_CAVtemp_unit_type
      • Custom script: call SaveIntegerBJ( udg_CAVinteger, 0, udg_CAVinteger2, udg_HASHCAVALRY )
      • Set CAVtemp_unit_type = Huntress
      • Set CAVinteger = 1
      • Custom script: set udg_CAVinteger2 = udg_CAVtemp_unit_type
      • Custom script: call SaveIntegerBJ( udg_CAVinteger, 0, udg_CAVinteger2, udg_HASHCAVALRY )
      • Set CAVtemp_unit_type = Death Knight Undead
      • Set CAVinteger = 0
      • Custom script: set udg_CAVinteger2 = udg_CAVtemp_unit_type
      • Custom script: call SaveIntegerBJ( udg_CAVinteger, 0, udg_CAVinteger2, udg_HASHCAVALRY )
  • CAV INIT
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set CAVDetectGroup = (Units in (Playable map area) matching (((Matching unit) is Plagued) Equal to True))
      • Unit Group - Remove all units from CAVDetectGroup
      • Set CAVKnockbackGroup = (Units in (Playable map area) matching (((Matching unit) is Plagued) Equal to True))
      • Unit Group - Remove all units from CAVKnockbackGroup
      • Set CAVResetGroup = (Units in (Playable map area) matching (((Matching unit) is Plagued) Equal to True))
      • Unit Group - Remove all units from CAVResetGroup
      • Set CAVStunGroup = (Units in (Playable map area) matching (((Matching unit) is Plagued) Equal to True))
      • Unit Group - Remove all units from CAVStunGroup
      • Hashtable - Create a hashtable
      • Set HASHCAVALRY = (Last created hashtable)
      • Trigger - Run CAV INDEX ANIMATION <gen> (checking conditions)
      • -------- CONFIGURATION --------
      • Set CAVMainAbility = Cavalry Attack
      • Set CAVStunAbility = AA Dummy Stun
      • Set CAVDummyUnitType = Dummy Unit (Dummy)
      • Set CAVDamageType = Enhanced
      • Set CAVAttackType = Normal
      • -------- ANIMATION TIME PERIOD --------
      • Set CAVAnimationSpeed_time[1] = 1.00
      • Set CAVAnimationSpeed_time[2] = 1.00
      • Set CAVAnimationSpeed_time[3] = 1.00
      • -------- SQUAD ENGAGE AREA (TAKES ALL WHO HAVE THIS ABILITY IN THE AREA) --------
      • Set CAVSquadEngage[1] = 475.00
      • Set CAVSquadEngage[2] = 475.00
      • Set CAVSquadEngage[3] = 475.00
      • -------- YOU MAY ADD MORE ARRAYS (IF YOU NEED ABILITY MORE THAN 3 LEVELS) --------
      • -------- MOVEMENT SPEED WHILE CHARGING (DISTANCE EVERY SECOND) --------
      • Set CAVSpeed[1] = 420.00
      • Set CAVSpeed[2] = 470.00
      • Set CAVSpeed[3] = 522.00
      • -------- STUN DURATION (10=1 sec) (0=no stun) --------
      • Set CAVStunDuration[1] = 0.00
      • Set CAVStunDuration[2] = 0.00
      • Set CAVStunDuration[3] = 0.00
      • -------- DAMAGE WHILE COLLIDES WITH ENEMY UNITS --------
      • Set CAVDamage[1] = 99999.00
      • Set CAVDamage[2] = 99999.00
      • Set CAVDamage[3] = 99999.00
      • -------- COEFFICIENT OF DAMAGE WHILE HIT ALREADY STUNNED ENEMY --------
      • Set CAVDamagecCoef[1] = 2.00
      • Set CAVDamagecCoef[2] = 2.30
      • Set CAVDamagecCoef[3] = 2.50
      • -------- HIT AREA --------
      • Set CAVHitArea[1] = 80.00
      • Set CAVHitArea[2] = 80.00
      • Set CAVHitArea[3] = 80.00
      • -------- DURATION OF EFFECT (IF UNIT IS STUCKED) --------
      • Set CAVChargeTime[1] = 3.00
      • Set CAVChargeTime[2] = 3.00
      • Set CAVChargeTime[3] = 3.00
      • -------- ANIMATION SPEED --------
      • Set CAVAnimationSpeed[1] = 150.00
      • Set CAVAnimationSpeed[2] = 170.00
      • Set CAVAnimationSpeed[3] = 185.00
      • -------- DISTANCE OF ENDING CHARGE (STOPS CHARGING WHILE REACHING THE POINT BUT THE UNIT HAVE DISTANCE FROM IT) --------
      • Set CAVDistanceOfEnding[1] = 50.00
      • Set CAVDistanceOfEnding[2] = 50.00
      • Set CAVDistanceOfEnding[3] = 50.00
      • -------- ACCELERATION DISTANCE (% OF TOTAL DISTANCE WHERE STUN DURATION AND DAMAGE WERE DECREASED) --------
      • Set CAVAccDistance[1] = 30.00
      • Set CAVAccDistance[2] = 25.00
      • Set CAVAccDistance[3] = 20.00
      • -------- ACCELERATION PENALTY (% OF TOTAL DURATION AND DAMAGE WHILE ACCELERATING) --------
      • -------- FOR EXAMPLE YOU HAVE TOTAL DAMAGE CAVDamage BUT IF UNIT IS ACCELERATING THEN THE CASTER HITS ENEMY DEALING (CAVAccPenalty / 100) x CAVDamage --------
      • Set CAVAccPenalty[1] = 100.00
      • Set CAVAccPenalty[2] = 100.00
      • Set CAVAccPenalty[3] = 100.00
      • -------- ACCELERATION RESTORE RATE (HOW FAST THE CASTER ACCELERATES THEIR MOVEMENT SPEED TO NORMAL PARAMATERS) --------
      • Set CAVAccRate[1] = 45.00
      • Set CAVAccRate[2] = 50.00
      • Set CAVAccRate[3] = 55.00
      • -------- KNOCKBACK DURATION (0=NO KNOCKBACK) --------
      • Set CAVKnockDur[1] = 1.00
      • Set CAVKnockDur[2] = 1.20
      • Set CAVKnockDur[3] = 1.40
      • -------- KNOCKBACK RATE --------
      • Set CAVKnockRate[1] = 250.00
      • Set CAVKnockRate[2] = 300.00
      • Set CAVKnockRate[3] = 350.00
  • CAV LOOP
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CAVResetGroup) Greater than 0
        • Then - Actions
          • -------- // --------
          • -------- This value must equal to preiodic event timer --------
          • -------- // --------
          • Set CAVreal[0] = 0.05
          • Unit Group - Pick every unit in CAVResetGroup and do (Actions)
            • Loop - Actions
              • Set CAVtemp_unit = (Picked unit)
              • Custom script: set udg_CAVinteger = GetHandleIdBJ( udg_CAVtemp_unit)
              • -------- // --------
              • -------- This value 10 as CAVInteger removes the unit from ResetGroup. It is needed for group cast of cavalry attack --------
              • -------- // --------
              • Hashtable - Save ((Load 10 of CAVinteger from HASHCAVALRY) - CAVreal[0]) as 10 of CAVinteger in HASHCAVALRY
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Load 10 of CAVinteger from HASHCAVALRY) Less than or equal to 0.00
                      • (CAVtemp_unit is alive) Not equal to True
                      • (CAVtemp_unit is hidden) Equal to True
                • Then - Actions
                  • Unit Group - Remove CAVtemp_unit from CAVResetGroup
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CAVStunGroup) Greater than 0
        • Then - Actions
          • -------- // --------
          • -------- This value must equal to preiodic event timer --------
          • -------- // --------
          • Set CAVreal[0] = 0.05
          • Unit Group - Pick every unit in CAVStunGroup and do (Actions)
            • Loop - Actions
              • Set CAVtemp_unit = (Picked unit)
              • Custom script: set udg_CAVinteger = GetHandleIdBJ( udg_CAVtemp_unit)
              • -------- // --------
              • -------- 17 as CAVInteger counts the time until Stun effect will removed. --------
              • -------- // --------
              • Set CAVreal[1] = (Load 17 of CAVinteger from HASHCAVALRY)
              • Set CAVreal[1] = (CAVreal[1] - CAVreal[0])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (CAVtemp_unit has buff Stunned (Pause)) Not equal to True
                      • (CAVtemp_unit is alive) Not equal to True
                      • CAVreal[1] Less than or equal to 0.00
                      • (CAVtemp_unit is hidden) Equal to True
                • Then - Actions
                  • Set CAVreal[1] = 0.00
                  • Unit - Remove Stunned (Pause) buff from CAVtemp_unit
                  • Unit Group - Remove CAVtemp_unit from CAVStunGroup
                • Else - Actions
              • Hashtable - Save CAVreal[1] as 17 of CAVinteger in HASHCAVALRY
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CAVKnockbackGroup) Greater than 0
        • Then - Actions
          • -------- // --------
          • -------- This value must equal to preiodic event timer --------
          • -------- // --------
          • Set CAVreal[0] = 0.05
          • Unit Group - Pick every unit in CAVKnockbackGroup and do (Actions)
            • Loop - Actions
              • Set CAVtemp_unit = (Picked unit)
              • Custom script: set udg_CAVinteger = GetHandleIdBJ( udg_CAVtemp_unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (CAVtemp_unit is alive) Not equal to True
                      • (CAVtemp_unit is hidden) Equal to True
                • Then - Actions
                  • Unit - Turn collision for CAVtemp_unit On
                  • Unit Group - Remove CAVtemp_unit from CAVKnockbackGroup
                  • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
                • Else - Actions
                  • -------- // --------
                  • -------- 20 as CAVInteger counts the time until the unti stop the knockback --------
                  • -------- // --------
                  • Hashtable - Save ((Load 20 of CAVinteger from HASHCAVALRY) - CAVreal[0]) as 20 of CAVinteger in HASHCAVALRY
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 20 of CAVinteger from HASHCAVALRY) Greater than 0.00
                    • Then - Actions
                      • -------- // --------
                      • -------- group4 detect buildings one the way --------
                      • -------- // --------
                      • Set CAVpoint[0] = (Position of CAVtemp_unit)
                      • Set CAVpoint[1] = (CAVpoint[0] offset by ((Load 21 of CAVinteger from HASHCAVALRY) x CAVreal[0]) towards (Load 22 of CAVinteger from HASHCAVALRY) degrees)
                      • Set CAVgroup4 = (Units within (1.50 x (Load 9 of CAVinteger from HASHCAVALRY)) of CAVpoint[1] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in CAVgroup3) Not equal to True)) and (((Matching unit) is A structure) Equal to True)))
                      • -------- // --------
                      • -------- CHECK PATHING --------
                      • -------- // --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Terrain pathing at CAVpoint[1] of type Walkability is off) Equal to True
                              • (Number of units in CAVgroup4) Greater than 0
                        • Then - Actions
                          • Unit - Turn collision for CAVtemp_unit On
                          • Unit Group - Remove CAVtemp_unit from CAVKnockbackGroup
                          • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
                        • Else - Actions
                          • Unit - Turn collision for CAVtemp_unit Off
                          • Unit - Move CAVtemp_unit instantly to CAVpoint[1]
                          • Custom script: call RemoveLocation( udg_CAVpoint[0] )
                          • Custom script: call RemoveLocation( udg_CAVpoint[1] )
                      • Custom script: call DestroyGroup( udg_CAVgroup4 )
                    • Else - Actions
                      • Unit - Turn collision for CAVtemp_unit On
                      • Unit Group - Remove CAVtemp_unit from CAVKnockbackGroup
                      • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in CAVDetectGroup) Greater than 0
        • Then - Actions
          • -------- // --------
          • -------- This value must equal to preiodic event timer --------
          • -------- // --------
          • Set CAVreal[0] = 0.05
          • Unit Group - Pick every unit in CAVDetectGroup and do (Actions)
            • Loop - Actions
              • Set CAVtemp_unit = (Picked unit)
              • Custom script: set udg_CAVinteger = GetHandleIdBJ( udg_CAVtemp_unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (CAVtemp_unit has buff Stunned (Pause)) Equal to True
                      • (CAVtemp_unit has buff Stunned) Equal to True
                      • (CAVtemp_unit has buff Volcano) Equal to True
                      • (CAVtemp_unit has buff Impale) Equal to True
                      • (CAVtemp_unit has buff Cluster Rockets) Equal to True
                      • (CAVtemp_unit has buff Aerial Shackles) Equal to True
                      • (CAVtemp_unit has buff Entangling Roots) Equal to True
                      • (CAVtemp_unit is Snared) Equal to True
                      • (CAVtemp_unit is Sleeping) Equal to True
                      • (CAVtemp_unit is alive) Not equal to True
                      • (CAVtemp_unit is hidden) Equal to True
                      • (CAVtemp_unit is paused) Equal to True
                • Then - Actions
                  • Unit - Turn collision for CAVtemp_unit On
                  • Set CAVpoint[4] = (Position of CAVtemp_unit)
                  • Unit - Move CAVtemp_unit instantly to CAVpoint[4]
                  • Custom script: call RemoveLocation( udg_CAVpoint[4] )
                  • Set CAVgroup3 = (Load 0 of CAVinteger in HASHCAVALRY)
                  • Custom script: call DestroyGroup( udg_CAVgroup3 )
                  • Animation - Reset CAVtemp_unit's animation
                  • Unit Group - Remove CAVtemp_unit from CAVDetectGroup
                  • Animation - Change CAVtemp_unit's animation speed to 100.00% of its original speed
                  • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
                • Else - Actions
                  • -------- // --------
                  • -------- 7 as CAVInteger counts the time until the unti stop charging --------
                  • -------- // --------
                  • Hashtable - Save ((Load 7 of CAVinteger from HASHCAVALRY) - CAVreal[0]) as 7 of CAVinteger in HASHCAVALRY
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 7 of CAVinteger from HASHCAVALRY) Greater than 0.00
                    • Then - Actions
                      • -------- // --------
                      • -------- 24 AND 23 CAUSES ANIMATION TIMER. 24 IS INCREASED UNTIL IT BECOMES LARGER THAN 23 AND THE UNIT PLAYS ANIMATION. --------
                      • -------- // --------
                      • Hashtable - Save ((Load 24 of CAVinteger from HASHCAVALRY) + CAVreal[0]) as 24 of CAVinteger in HASHCAVALRY
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Load 24 of CAVinteger from HASHCAVALRY) Greater than or equal to (Load 23 of CAVinteger from HASHCAVALRY)
                        • Then - Actions
                          • Set CAVinteger2 = (Load 20 of CAVinteger from HASHCAVALRY)
                          • Hashtable - Save 0.00 as 24 of CAVinteger in HASHCAVALRY
                          • Custom script: call SetUnitAnimationByIndex( GetEnumUnit(), udg_CAVinteger2 )
                        • Else - Actions
                      • -------- // --------
                      • -------- CAVPOINT[2] is taget point of ability being cast it has coordinates X,Y --------
                      • -------- CAVPOINT[3] is taget point of the caster when it starts charging --------
                      • -------- CAVPOINT[3] and CAVPOINT[2] helps with ACCELERATION EVENT --------
                      • -------- // --------
                      • Set CAVpoint[0] = (Position of CAVtemp_unit)
                      • Set CAVpoint[2] = (Point((Load 3 of CAVinteger from HASHCAVALRY), (Load 4 of CAVinteger from HASHCAVALRY)))
                      • Set CAVpoint[3] = (Point((Load 13 of CAVinteger from HASHCAVALRY), (Load 14 of CAVinteger from HASHCAVALRY)))
                      • -------- // --------
                      • -------- CAVreal[3] is effciency value. It helps for ACCELERATING (if 1 then ACCELERATION is gone and unti moves with normal speed) --------
                      • -------- it also inflicts on animation speed (8 as CAVInteger) --------
                      • -------- // --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between CAVpoint[0] and CAVpoint[3]) Greater than or equal to (((Load 12 of CAVinteger from HASHCAVALRY) / 100.00) x (Distance between CAVpoint[2] and CAVpoint[3]))
                        • Then - Actions
                          • Set CAVreal[3] = 1.00
                        • Else - Actions
                          • Hashtable - Save ((Load 15 of CAVinteger from HASHCAVALRY) + (Load 16 of CAVinteger from HASHCAVALRY)) as 15 of CAVinteger in HASHCAVALRY
                          • Set CAVreal[3] = ((Load 15 of CAVinteger from HASHCAVALRY) / 100.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CAVreal[3] Greater than or equal to 1.00
                        • Then - Actions
                          • Set CAVreal[3] = 1.00
                          • Custom script: call DestroyEffectBJ( AddSpecialEffectLoc("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", udg_CAVpoint[0]) )
                        • Else - Actions
                      • Set CAVpoint[1] = (CAVpoint[0] offset by (CAVreal[3] x (Load 0 of CAVinteger from HASHCAVALRY)) towards (Load 6 of CAVinteger from HASHCAVALRY) degrees)
                      • -------- // --------
                      • -------- group4 detects buildings --------
                      • -------- // --------
                      • Set CAVgroup4 = (Units within (1.50 x (Load 9 of CAVinteger from HASHCAVALRY)) of CAVpoint[1] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in CAVgroup3) Not equal to True)) and (((Matching unit) is A structure) Equal to True)))
                      • -------- CHECK PATHING --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • (Terrain cliff level at CAVpoint[0]) Not equal to (Terrain cliff level at CAVpoint[1])
                              • (Terrain pathing at CAVpoint[0] of type Walkability is off) Equal to True
                              • (Terrain pathing at CAVpoint[1] of type Walkability is off) Equal to True
                              • (Number of units in CAVgroup4) Greater than 0
                        • Then - Actions
                          • Unit - Turn collision for CAVtemp_unit On
                          • Set CAVpoint[4] = (Position of CAVtemp_unit)
                          • Set CAVpoint[5] = (CAVpoint[4] offset by (CAVreal[3] x (Load 0 of CAVinteger from HASHCAVALRY)) towards (180.00 + (Load 6 of CAVinteger from HASHCAVALRY)) degrees)
                          • Unit - Move CAVtemp_unit instantly to CAVpoint[5]
                          • Custom script: call RemoveLocation( udg_CAVpoint[4] )
                          • Custom script: call RemoveLocation( udg_CAVpoint[5] )
                          • Set CAVgroup3 = (Load 0 of CAVinteger in HASHCAVALRY)
                          • Custom script: call DestroyGroup( udg_CAVgroup3 )
                          • Animation - Reset CAVtemp_unit's animation
                          • Unit Group - Remove CAVtemp_unit from CAVDetectGroup
                          • Animation - Change CAVtemp_unit's animation speed to 100.00% of its original speed
                          • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
                        • Else - Actions
                          • Unit - Turn collision for CAVtemp_unit Off
                          • Animation - Change CAVtemp_unit's animation speed to (CAVreal[3] x (Load 8 of CAVinteger from HASHCAVALRY))% of its original speed
                          • Unit - Move CAVtemp_unit instantly to CAVpoint[1], facing (Load 6 of CAVinteger from HASHCAVALRY) degrees
                          • Set CAVreal[2] = (Distance between CAVpoint[1] and CAVpoint[2])
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • CAVreal[2] Greater than or equal to (Load 2 of CAVinteger from HASHCAVALRY)
                            • Then - Actions
                              • Set CAVgroup3 = (Load 0 of CAVinteger in HASHCAVALRY)
                              • Set CAVgroup2 = (Units within (Load 9 of CAVinteger from HASHCAVALRY) of CAVpoint[1] matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in CAVgroup3) Not equal to True)) and (((((Matching unit) is A flying unit) Not equal to True) and ((((Matching
                              • Unit Group - Pick every unit in CAVgroup2 and do (Actions)
                                • Loop - Actions
                                  • Set CAVtemp_unit2 = (Picked unit)
                                  • Set CAVpoint[3] = (Position of CAVtemp_unit2)
                                  • Unit Group - Add CAVtemp_unit2 to CAVgroup3
                                  • Custom script: call DestroyEffectBJ(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", udg_CAVtemp_unit2, "chest"))
                                  • -------- // --------
                                  • -------- If unit is stunned when it deals multiple damage x ( 18 as CAVInteger) --------
                                  • -------- // --------
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Level of AA Spell Immune to Death Aura for CAVtemp_unit2) Equal to 0
                                    • Then - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Or - Any (Conditions) are true
                                            • Conditions
                                              • (CAVtemp_unit2 has buff Stunned (Pause)) Equal to True
                                              • (CAVtemp_unit2 has buff Stunned) Equal to True
                                              • (CAVtemp_unit2 has buff Volcano) Equal to True
                                              • (CAVtemp_unit2 has buff Impale) Equal to True
                                              • (CAVtemp_unit2 has buff Cluster Rockets) Equal to True
                                        • Then - Actions
                                          • Unit - Cause CAVtemp_unit to damage CAVtemp_unit2, dealing (((Load 18 of CAVinteger from HASHCAVALRY) x CAVreal[3]) x (Load 5 of CAVinteger from HASHCAVALRY)) damage of attack type CAVAttackType and damage type CAVDamageType
                                        • Else - Actions
                                          • Unit - Cause CAVtemp_unit to damage CAVtemp_unit2, dealing (CAVreal[3] x (Load 5 of CAVinteger from HASHCAVALRY)) damage of attack type CAVAttackType and damage type CAVDamageType
                                    • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (CAVtemp_unit2 is alive) Equal to True
                                      • (Integer((CAVreal[3] x (Load 11 of CAVinteger from HASHCAVALRY)))) Greater than 0
                                      • (Integer((1.00 x (Load 11 of CAVinteger from HASHCAVALRY)))) Greater than 0
                                    • Then - Actions
                                      • Unit - Create 1 CAVDummyUnitType for (Owner of CAVtemp_unit2) at CAVpoint[3] facing Default building facing degrees
                                      • Unit - Set the custom value of (Last created unit) to (Integer((CAVreal[3] x (Load 11 of CAVinteger from HASHCAVALRY))))
                                      • Unit - Add a 2.00 second Water Elemental expiration timer to (Last created unit)
                                      • Unit - Make (Last created unit) Explode on death
                                      • Unit - Add CAVStunAbility to (Last created unit)
                                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt CAVtemp_unit2
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Load 18 of CAVinteger from HASHCAVALRY) Greater than 0.00
                                          • (Load 19 of CAVinteger from HASHCAVALRY) Greater than 0.00
                                          • (CAVtemp_unit2 is in CAVKnockbackGroup) Not equal to True
                                          • (CAVtemp_unit2 is in CAVDetectGroup) Not equal to True
                                        • Then - Actions
                                          • -------- // --------
                                          • -------- Knockbacked unit stores duration and speedrate --------
                                          • -------- and aslo angle between the caster and the unit --------
                                          • -------- // --------
                                          • Unit Group - Add CAVtemp_unit2 to CAVKnockbackGroup
                                          • Custom script: set udg_CAVinteger3 = GetHandleIdBJ( udg_CAVtemp_unit2)
                                          • Hashtable - Save (CAVreal[3] x (Load 18 of CAVinteger from HASHCAVALRY)) as 20 of CAVinteger3 in HASHCAVALRY
                                          • Hashtable - Save (CAVreal[3] x (Load 19 of CAVinteger from HASHCAVALRY)) as 21 of CAVinteger3 in HASHCAVALRY
                                          • Hashtable - Save (Distance between CAVpoint[1] and CAVpoint[3]) as 22 of CAVinteger3 in HASHCAVALRY
                                        • Else - Actions
                                    • Else - Actions
                                  • Custom script: call RemoveLocation( udg_CAVpoint[3] )
                              • Custom script: call DestroyGroup( udg_CAVgroup2 )
                            • Else - Actions
                              • Unit - Turn collision for CAVtemp_unit On
                              • Set CAVpoint[4] = (Position of CAVtemp_unit)
                              • Unit - Move CAVtemp_unit instantly to CAVpoint[4]
                              • Custom script: call RemoveLocation( udg_CAVpoint[4] )
                              • Set CAVgroup3 = (Load 0 of CAVinteger in HASHCAVALRY)
                              • Custom script: call DestroyGroup( udg_CAVgroup3 )
                              • Animation - Reset CAVtemp_unit's animation
                              • Unit Group - Remove CAVtemp_unit from CAVDetectGroup
                              • Animation - Change CAVtemp_unit's animation speed to 100.00% of its original speed
                              • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
                      • Custom script: call RemoveLocation( udg_CAVpoint[0] )
                      • Custom script: call RemoveLocation( udg_CAVpoint[1] )
                      • Custom script: call RemoveLocation( udg_CAVpoint[2] )
                      • Custom script: call RemoveLocation( udg_CAVpoint[3] )
                      • Custom script: call DestroyGroup( udg_CAVgroup4 )
                    • Else - Actions
                      • Unit - Turn collision for CAVtemp_unit On
                      • Set CAVpoint[4] = (Position of CAVtemp_unit)
                      • Set CAVpoint[5] = (CAVpoint[4] offset by (CAVreal[3] x (Load 0 of CAVinteger from HASHCAVALRY)) towards (180.00 + (Load 6 of CAVinteger from HASHCAVALRY)) degrees)
                      • Unit - Move CAVtemp_unit instantly to CAVpoint[5]
                      • Custom script: call RemoveLocation( udg_CAVpoint[4] )
                      • Custom script: call RemoveLocation( udg_CAVpoint[5] )
                      • Set CAVgroup3 = (Load 0 of CAVinteger in HASHCAVALRY)
                      • Custom script: call DestroyGroup( udg_CAVgroup3 )
                      • Animation - Reset CAVtemp_unit's animation
                      • Unit Group - Remove CAVtemp_unit from CAVDetectGroup
                      • Animation - Change CAVtemp_unit's animation speed to 100.00% of its original speed
                      • Hashtable - Clear all child hashtables of child CAVinteger in HASHCAVALRY
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of units in CAVDetectGroup) Greater than 0
              • (Number of units in CAVKnockbackGroup) Greater than 0
              • (Number of units in CAVStunGroup) Greater than 0
              • (Number of units in CAVResetGroup) Greater than 0
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
  • CAV USE ABILITY
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to CAVMainAbility
        • Then - Actions
          • Set CAVtemp_unit2 = (Triggering unit)
          • Set CAVAbiLevel = (Level of CAVMainAbility for CAVtemp_unit2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CAVtemp_unit2 is in CAVResetGroup) Not equal to True
            • Then - Actions
              • Set CAVtemp_unit2 = (Triggering unit)
              • Set CAVpoint[0] = (Position of CAVtemp_unit2)
              • Set CAVpoint[1] = (Target point of ability being cast)
              • Set CAVreal[0] = 0.00
              • Set CAVreal[1] = 0.00
              • -------- SQAUD ENGAGE RANGE --------
              • Set CAVreal[2] = CAVSquadEngage[CAVAbiLevel]
              • Set CAVgroup = (Units within CAVreal[2] of CAVpoint[0] matching (((((Matching unit) is in CAVDetectGroup) Not equal to True) and ((((Matching unit) is in CAVResetGroup) Not equal to True) and (((Matching unit) is alive) Equal to True))) and (((Level of CAVMainAbility for (M
              • Set CAVinteger2 = CAVAbiLevel
              • Unit - Remove CAVMainAbility from CAVtemp_unit2
              • Unit - Add CAVMainAbility to CAVtemp_unit2
              • Unit - Set level of CAVMainAbility for CAVtemp_unit2 to CAVinteger2
              • Unit Group - Pick every unit in CAVgroup and do (Actions)
                • Loop - Actions
                  • Set CAVtemp_unit = (Picked unit)
                  • Set CAVpoint[3] = (Position of CAVtemp_unit)
                  • Set CAVreal[0] = (CAVreal[0] + (X of CAVpoint[3]))
                  • Set CAVreal[1] = (CAVreal[1] + (Y of CAVpoint[3]))
                  • Custom script: call RemoveLocation( udg_CAVpoint[3] )
              • Set CAVreal[0] = (CAVreal[0] / (Real((Number of units in CAVgroup))))
              • Set CAVreal[1] = (CAVreal[1] / (Real((Number of units in CAVgroup))))
              • Set CAVpoint[2] = (Point(CAVreal[0], CAVreal[1]))
              • Unit Group - Pick every unit in CAVgroup and do (Actions)
                • Loop - Actions
                  • Set CAVtemp_unit = (Picked unit)
                  • Custom script: set udg_CAVinteger2 = GetHandleIdBJ( udg_CAVtemp_unit)
                  • Hashtable - Save 0.50 as 10 of CAVinteger2 in HASHCAVALRY
                  • Set CAVpoint[3] = (Position of CAVtemp_unit)
                  • Set CAVpoint[4] = (CAVpoint[1] offset by (Distance between CAVpoint[3] and CAVpoint[2]) towards (Angle from CAVpoint[2] to CAVpoint[3]) degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (CAVtemp_unit is in CAVResetGroup) Not equal to True
                    • Then - Actions
                      • Unit Group - Add CAVtemp_unit to CAVResetGroup
                    • Else - Actions
                  • Unit - Order CAVtemp_unit to Orc Shadow Hunter - Serpent Ward CAVpoint[4]
                  • Custom script: call RemoveLocation( udg_CAVpoint[3] )
                  • Custom script: call RemoveLocation( udg_CAVpoint[4] )
              • Custom script: call RemoveLocation( udg_CAVpoint[0] )
              • Custom script: call RemoveLocation( udg_CAVpoint[2] )
              • Custom script: call RemoveLocation( udg_CAVpoint[1] )
              • Custom script: call DestroyGroup( udg_CAVgroup )
              • Set CAVtemp_unit = No unit
              • Set CAVtemp_unit2 = No unit
            • Else - Actions
              • Set CAVtemp_unit = (Triggering unit)
              • Set CAVpoint[0] = (Position of CAVtemp_unit)
              • Set CAVpoint[1] = (Target point of ability being cast)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CAVtemp_unit is in CAVDetectGroup) Not equal to True
                • Then - Actions
                  • Unit Group - Add CAVtemp_unit to CAVDetectGroup
                • Else - Actions
              • Custom script: set udg_CAVinteger2 = GetHandleIdBJ( udg_CAVtemp_unit)
              • Hashtable - Clear all child hashtables of child CAVinteger2 in HASHCAVALRY
              • Hashtable - Save (Angle from CAVpoint[0] to CAVpoint[1]) as 6 of CAVinteger2 in HASHCAVALRY
              • Hashtable - Save (X of CAVpoint[1]) as 3 of CAVinteger2 in HASHCAVALRY
              • Hashtable - Save (Y of CAVpoint[1]) as 4 of CAVinteger2 in HASHCAVALRY
              • Hashtable - Save (X of CAVpoint[0]) as 13 of CAVinteger2 in HASHCAVALRY
              • Hashtable - Save (Y of CAVpoint[0]) as 14 of CAVinteger2 in HASHCAVALRY
              • Set CAVgroup2 = (Units within 1.00 of CAVpoint[1])
              • Hashtable - Save Handle OfCAVgroup2 as 0 of CAVinteger2 in HASHCAVALRY
              • -------- ANIMATION INDEX (USE -ANIM XX IN GAME TO FIND WALK ANIMATION INDEX FOR UNIT MODEL) --------
              • Set CAVtemp_unit_type = (Unit-type of CAVtemp_unit2)
              • Custom script: set udg_CAVinteger3 = udg_CAVtemp_unit_type
              • Hashtable - Save (Load 0 of CAVinteger3 from HASHCAVALRY) as 20 of CAVinteger2 in HASHCAVALRY
              • -------- ANIMATION PLAY PERIOD 23 - IS SET IN THE INIT. 24 THE CURRENT TIMER --------
              • Hashtable - Save CAVAnimationSpeed_time[CAVAbiLevel] as 23 of CAVinteger2 in HASHCAVALRY
              • Hashtable - Save CAVAnimationSpeed_time[CAVAbiLevel] as 24 of CAVinteger2 in HASHCAVALRY
              • -------- SPEED EVERY SECOND --------
              • Set CAVreal[0] = CAVSpeed[CAVAbiLevel]
              • Hashtable - Save (CAVreal[0] x 0.05) as 0 of CAVinteger2 in HASHCAVALRY
              • -------- STUN DURATION (10 = 1 sec) --------
              • Set CAVreal[1] = CAVStunDuration[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 11 of CAVinteger2 in HASHCAVALRY
              • -------- DISTANCE OF ENDING CHARGE --------
              • Set CAVreal[1] = CAVDistanceOfEnding[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 2 of CAVinteger2 in HASHCAVALRY
              • -------- DAMAGE ON COLLISION WITH THE TARGET --------
              • Set CAVreal[1] = CAVDamage[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 5 of CAVinteger2 in HASHCAVALRY
              • -------- ADDITIONAL DAMAGE COEFFICIENT WHILE HIT STUNNED ENEMY --------
              • Set CAVreal[1] = CAVDamagecCoef[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] / 1.00) as 18 of CAVinteger2 in HASHCAVALRY
              • -------- TIME OF CHARGE (IF STUCKED) --------
              • Set CAVreal[1] = CAVChargeTime[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 7 of CAVinteger2 in HASHCAVALRY
              • -------- ANIMATION SPEED --------
              • Set CAVreal[1] = CAVAnimationSpeed[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 8 of CAVinteger2 in HASHCAVALRY
              • -------- AREA OF HIT --------
              • Set CAVreal[1] = CAVHitArea[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 9 of CAVinteger2 in HASHCAVALRY
              • -------- ACCELERATION DISTANCE, % ( THIS IS PART OF FULL DISTANCE WHERE DAMAGE AND STUN DURATION WERE DECREASED) --------
              • Set CAVreal[1] = CAVAccDistance[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 12 of CAVinteger2 in HASHCAVALRY
              • -------- ACCENELERATION PENALTY, % DEALS ONLY XX % AND DECREASE STUN DURATION BY (100-XX) % --------
              • Set CAVreal[1] = CAVAccPenalty[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] x 1.00) as 15 of CAVinteger2 in HASHCAVALRY
              • -------- ACCENELERATION RATE RESTORATION, % EVERY SECOND --------
              • Set CAVreal[1] = CAVAccRate[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] / 33.00) as 16 of CAVinteger2 in HASHCAVALRY
              • -------- KNOCKBACK DURATION --------
              • Set CAVreal[1] = CAVKnockDur[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] / 1.00) as 18 of CAVinteger2 in HASHCAVALRY
              • -------- KNOCKBACK RATE --------
              • Set CAVreal[1] = CAVKnockRate[CAVAbiLevel]
              • Hashtable - Save (CAVreal[1] / 1.00) as 19 of CAVinteger2 in HASHCAVALRY
              • Custom script: call RemoveLocation( udg_CAVpoint[1] )
              • Custom script: call RemoveLocation( udg_CAVpoint[0] )
              • Set CAVtemp_unit = No unit
          • Trigger - Turn on CAV LOOP <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to CAVStunAbility
        • Then - Actions
          • Set CAVtemp_unit2 = (Triggering unit)
          • Set CAVtemp_unit = (Target unit of ability being cast)
          • Custom script: set udg_CAVinteger2 = GetHandleIdBJ( udg_CAVtemp_unit)
          • Hashtable - Save ((Real((Custom value of CAVtemp_unit2))) / 10.00) as 17 of CAVinteger2 in HASHCAVALRY
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (CAVtemp_unit is in CAVStunGroup) Not equal to True
            • Then - Actions
              • Unit Group - Add CAVtemp_unit to CAVStunGroup
            • Else - Actions
          • Set CAVtemp_unit = No unit
          • Set CAVtemp_unit2 = No unit
          • Trigger - Turn on CAV LOOP <gen>
        • Else - Actions
  • CAV INIT FOR COMMAND
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to CAV COMMAND read commentary <gen> the event (Player - (Picked player) types a chat message containing - as A substring)
  • CAV COMMAND read commentary
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 2, 5)) Equal to anim
        • Then - Actions
          • Set CAVgroup = (Units in (Playable map area) matching (((Matching unit) is selected by Player 1 (Red)) Equal to True))
          • Unit Group - Pick every unit in CAVgroup and do (Actions)
            • Loop - Actions
              • Custom script: call SetUnitAnimationByIndex( GetEnumUnit(), S2I(SubStringBJ(GetEventPlayerChatString(), 7, 8)) )
          • Custom script: call DestroyGroup( udg_CAVgroup )
        • Else - Actions
 
Level 7
Joined
Feb 20, 2016
Messages
274
Ok, when the hero death knight uses the trample ability he will do an animation (the death coil throw i think). I want him to just do like the others which is to do the trample ability right away.


Btw the version i uploaded first the hero death knight didnt have the ability, reuploaded with the version where he has the ability.
 
Level 11
Joined
Aug 6, 2009
Messages
697
The trigger works correctly, and the death knight animation index is shared with the unit version of the hero.

In order to fix the issue with the death coil animation, you can either set the cast point for the hero in the object editor to 0, or you can create a trigger that uses the
  • Unit - A unit Begins casting an ability
event. This event will fire when the unit begins casting the ability, and will allow you to create an action to change the animation to the walk animation. Though, without setting the cast point to 0 the death knight will be running in place.
13632802402a8008ce7b840c2c038216.png
c5f54c08f4b963db95278fb1312d5ade.png
 
Status
Not open for further replies.
Top