[Trigger] Help with two things

Status
Not open for further replies.

old

old

Level 6
Joined
May 8, 2016
Messages
112
How can i in
1- Add attack animation to when this skill is cast

  • QJS Hash Table
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set QJS_arrowTable = (Last created hashtable)
  • QJS AttackDamageType
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Attack Type Presets --------
      • Set QJS_atkTypePreset[0] = Spells
      • Set QJS_atkTypePreset[1] = Normal
      • Set QJS_atkTypePreset[2] = Pierce
      • Set QJS_atkTypePreset[3] = Siege
      • Set QJS_atkTypePreset[4] = Magic
      • Set QJS_atkTypePreset[5] = Chaos
      • Set QJS_atkTypePreset[6] = Hero
      • -------- Damage Type Presets --------
      • Set QJS_dmgTypePreset[0] = Unknown
      • Set QJS_dmgTypePreset[1] = Normal
      • Set QJS_dmgTypePreset[2] = Enhanced
      • Set QJS_dmgTypePreset[3] = Fire
      • Set QJS_dmgTypePreset[4] = Cold
      • Set QJS_dmgTypePreset[5] = Lightning
      • Set QJS_dmgTypePreset[6] = Poison
      • Set QJS_dmgTypePreset[7] = Disease
      • Set QJS_dmgTypePreset[8] = Divine
      • Set QJS_dmgTypePreset[9] = Magic
      • Set QJS_dmgTypePreset[10] = Sonic
      • Set QJS_dmgTypePreset[11] = Acid
      • Set QJS_dmgTypePreset[12] = Force
      • Set QJS_dmgTypePreset[13] = Death
      • Set QJS_dmgTypePreset[14] = Mind
      • Set QJS_dmgTypePreset[15] = Plant
      • Set QJS_dmgTypePreset[16] = Defensive
      • Set QJS_dmgTypePreset[17] = Demolition
      • Set QJS_dmgTypePreset[18] = Slow Poison
      • Set QJS_dmgTypePreset[19] = Spirit Link
      • Set QJS_dmgTypePreset[20] = Shadow Strike
      • Set QJS_dmgTypePreset[21] = Universal
  • Arrow Create
    • Events
    • Conditions
    • Actions
      • Set QJS_tempPos = (Position of QJ_Caster)
      • -------- Create Arrow Unit for Caster --------
      • Unit - Create 1 QJ_Model for (Owner of QJ_Caster) at QJS_tempPos facing QJ_TargetPoint
      • Animation - Change (Last created unit)'s size to ((100.00 x QJ_Size)%, (100.00 x QJ_Size)%, ((100.00 x QJ_Size) + 1.00)%) of its original size
      • -------- Homing Limit for Target Unit only --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_TargetUnit Equal to No unit
        • Then - Actions
          • Set QJ_Homing = False
        • Else - Actions
      • -------- Attack Type ID Limit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • QJ_attackTypeID Greater than 6
              • QJ_attackTypeID Less than 0
        • Then - Actions
          • Set QJ_attackTypeID = 0
        • Else - Actions
      • -------- Damage Type Limit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • QJ_damageTypeID Greater than 21
              • QJ_attackTypeID Less than 0
        • Then - Actions
          • Set QJ_damageTypeID = 0
        • Else - Actions
      • -------- Save stuff to hashtable of Arrow System --------
      • -------- Target Unit or Target Position --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_TargetUnit Equal to No unit
        • Then - Actions
          • -------- Target Point --------
          • -------- Calculate Distance and Angle --------
          • Set QJS_Angle = (Angle from QJS_tempPos to QJ_TargetPoint)
          • Set QJS_Distance = 1300.00
        • Else - Actions
          • Set QJS_tempPos_Target = (Position of QJ_TargetUnit)
          • -------- Target Unit --------
          • Set QJS_Angle = (Angle from QJS_tempPos to QJS_tempPos_Target)
          • Set QJS_Distance = (Distance between QJS_tempPos and QJS_tempPos_Target)
          • -------- Save Victim --------
          • Hashtable - Save Handle OfQJ_TargetUnit as (Key victim) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Clear --------
          • Custom script: call RemoveLocation(udg_QJS_tempPos_Target)
      • -------- Save Caster --------
      • Hashtable - Save Handle OfQJ_Caster as (Key caster) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save if Homing is False --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_Homing Equal to False
        • Then - Actions
          • -------- Save Angle --------
          • Hashtable - Save QJS_Angle as (Key angle) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Save Distance --------
          • Hashtable - Save QJS_Distance as (Key dist) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Save Damage --------
      • Hashtable - Save QJ_Damage as (Key dmg) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Speed --------
      • Hashtable - Save QJ_Speed as (Key spd) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Attack Type ID --------
      • Hashtable - Save QJ_attackTypeID as (Key atkid) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Damage Type ID --------
      • Hashtable - Save QJ_damageTypeID as (Key dmgid) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Collision --------
      • Hashtable - Save QJ_Collision as (Key collision) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Homing --------
      • Hashtable - Save QJ_Homing as (Key homing) of (Key (Last created unit)) in QJS_arrowTable
      • -------- AoE --------
      • Hashtable - Save QJ_AoE as (Key aoe) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save AoE Radius / AoE Effect --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_AoE Equal to True
        • Then - Actions
          • -------- Save AoE Radius --------
          • Hashtable - Save QJ_AoERadius as (Key aoeradius) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Save AoE Effect --------
          • Hashtable - Save QJ_AoESFX as (Key aoesfx) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Pierce --------
      • Hashtable - Save QJ_Pierce as (Key pierce) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Pierce Damaged Group (Empty) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_Pierce Equal to True
        • Then - Actions
          • Custom script: set udg_QJS_DamagedGroup = CreateGroup()
          • Hashtable - Save Handle OfQJS_DamagedGroup as (Key dgroup) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Turn Collision for Arrow Off --------
      • Unit - Turn collision for (Last created unit) Off
      • -------- Add arrow unit to group --------
      • Unit Group - Add (Last created unit) to QJS_arrowGroup
      • -------- Turn On Move --------
      • Trigger - Turn on Arrow Move <gen>
      • -------- Clear --------
      • Custom script: call RemoveLocation(udg_QJS_tempPos)
  • Arrow Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- Pick every unit in arrow group --------
      • Unit Group - Pick every unit in QJS_arrowGroup and do (Actions)
        • Loop - Actions
          • -------- Load values --------
          • -------- Load Caster --------
          • Set QJ_Caster = (Load (Key caster) of (Key (Picked unit)) in QJS_arrowTable)
          • -------- Load Victim --------
          • Set QJ_TargetUnit = (Load (Key victim) of (Key (Picked unit)) in QJS_arrowTable)
          • -------- Load Damage --------
          • Set QJ_Damage = (Load (Key dmg) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Speed --------
          • Set QJ_Speed = (Load (Key spd) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Attack Type ID --------
          • Set QJ_attackTypeID = (Load (Key atkid) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Damage Type ID --------
          • Set QJ_damageTypeID = (Load (Key dmgid) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Collision --------
          • Set QJ_Collision = (Load (Key collision) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load AoE --------
          • Set QJ_AoE = (Load (Key aoe) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Homing --------
          • Set QJ_Homing = (Load (Key homing) of (Key (Picked unit)) from QJS_arrowTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QJ_Homing Equal to True
            • Then - Actions
              • -------- Set Position --------
              • Set QJS_arrowPos = (Position of (Picked unit))
              • Set QJS_victimPos = (Position of QJ_TargetUnit)
              • -------- Update Angle & Distance --------
              • Set QJS_Angle = (Angle from QJS_arrowPos to QJS_victimPos)
              • Set QJS_Distance = (Distance between QJS_arrowPos and QJS_victimPos)
              • -------- Distance - 50 if not Bug --------
              • Set QJS_Distance = (QJS_Distance - 50.00)
              • -------- Clear --------
              • Custom script: call RemoveLocation(udg_QJS_arrowPos)
              • Custom script: call RemoveLocation(udg_QJS_victimPos)
            • Else - Actions
              • -------- Load Angle --------
              • Set QJS_Angle = (Load (Key angle) of (Key (Picked unit)) from QJS_arrowTable)
              • -------- Load Distance --------
              • Set QJS_Distance = (Load (Key dist) of (Key (Picked unit)) from QJS_arrowTable)
          • -------- Load Pierce --------
          • Set QJ_Pierce = (Load (Key pierce) of (Key (Picked unit)) from QJS_arrowTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QJ_Pierce Equal to True
            • Then - Actions
              • Set QJS_DamagedGroup = (Load (Key dgroup) of (Key (Picked unit)) in QJS_arrowTable)
            • Else - Actions
          • -------- Movement --------
          • Set QJS_tempPos = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • QJS_Distance Greater than 0.00
            • Then - Actions
              • -------- Move Position --------
              • Set QJS_movePos = (QJS_tempPos offset by QJ_Speed towards QJS_Angle degrees)
              • -------- Collision --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QJ_Collision Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at QJS_movePos of type Walkability is off) Equal to True
                    • Then - Actions
                      • -------- Hit Cliff/Rock --------
                      • Floating Text - Create floating text that reads Hit Obstacle! at QJS_movePos with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                      • -------- If Pierce = False --------
                      • -------- Don't Do damage as pierce arrow will do damage while moving. --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_Pierce Equal to False
                        • Then - Actions
                          • -------- Deal Damage If AoE is On --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • QJ_AoE Equal to True
                            • Then - Actions
                              • -------- Attack Type ID Coversion --------
                              • Set QJS_AttackType = QJS_atkTypePreset[QJ_attackTypeID]
                              • -------- Damage Type ID Coversion --------
                              • Set QJS_DamageType = QJS_dmgTypePreset[QJ_damageTypeID]
                              • -------- Load AoE Radius --------
                              • Set QJ_AoERadius = (Load (Key aoeradius) of (Key (Picked unit)) from QJS_arrowTable)
                              • -------- Load Effect --------
                              • Set QJ_AoESFX = (Load (Key aoesfx) of (Key (Picked unit)) from QJS_arrowTable)
                              • -------- Create AoE Effect --------
                              • Special Effect - Create a special effect at QJS_movePos using QJ_AoESFX
                              • Special Effect - Destroy (Last created special effect)
                              • -------- Set Victim Group in AoE Range --------
                              • Set QJS_victimGroup = (Units within QJ_AoERadius of QJS_movePos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True)))
                              • -------- Damage --------
                              • Unit Group - Pick every unit in QJS_victimGroup and do (Actions)
                                • Loop - Actions
                                  • Unit - Cause QJ_Caster to damage (Picked unit), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                            • Else - Actions
                              • -------- No Damage if AoE off --------
                        • Else - Actions
                          • -------- If Pierce True, clear off Damaged Group --------
                          • Unit Group - Remove all units from QJS_DamagedGroup
                          • Custom script: call DestroyGroup(udg_QJS_DamagedGroup)
                      • -------- Turn Collision for Arrow On --------
                      • Unit - Turn collision for (Picked unit) On
                      • -------- Kill Arrow --------
                      • Unit - Kill (Picked unit)
                      • -------- Remove from Arrow Group --------
                      • Unit Group - Remove (Picked unit) from QJS_arrowGroup
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in QJS_arrowGroup) Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                      • -------- Clear Hash Table --------
                      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in QJS_arrowTable
                      • -------- Clear --------
                      • Custom script: call RemoveLocation(udg_QJS_movePos)
                    • Else - Actions
                      • -------- Move Arrow --------
                      • Unit - Move (Picked unit) instantly to QJS_movePos, facing QJS_Angle degrees
                      • -------- Update Distance --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_Homing Equal to False
                        • Then - Actions
                          • Hashtable - Save (QJS_Distance - QJ_Speed) as (Key dist) of (Key (Picked unit)) in QJS_arrowTable
                        • Else - Actions
                      • -------- If Pierce = True --------
                      • -------- Do Damage --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_Pierce Equal to True
                        • Then - Actions
                          • -------- Attack Type ID Coversion --------
                          • Set QJS_AttackType = QJS_atkTypePreset[QJ_attackTypeID]
                          • -------- Damage Type ID Coversion --------
                          • Set QJS_DamageType = QJS_dmgTypePreset[QJ_damageTypeID]
                          • -------- Check for AoE --------
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • QJ_AoE Equal to True
                            • Then - Actions
                              • -------- Load AoE Radius --------
                              • Set QJ_AoERadius = (Load (Key aoeradius) of (Key (Picked unit)) from QJS_arrowTable)
                              • -------- Load Effect --------
                              • Set QJ_AoESFX = (Load (Key aoesfx) of (Key (Picked unit)) from QJS_arrowTable)
                            • Else - Actions
                              • -------- AoE Radius = Default, 150 --------
                              • Set QJ_AoERadius = 150.00
                          • -------- Set Victim Group --------
                          • Set QJS_victimGroup = (Units within QJ_AoERadius of QJS_movePos matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True) and (((Matching unit) is in QJS_DamagedGroup) Equal to False))))
                          • Unit Group - Pick every unit in QJS_victimGroup and do (Actions)
                            • Loop - Actions
                              • Set QJS_victimPos = (Position of (Picked unit))
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • QJ_AoE Equal to True
                                • Then - Actions
                                  • -------- Create AoE Effect --------
                                  • Special Effect - Create a special effect at QJS_victimPos using QJ_AoESFX
                                  • Special Effect - Destroy (Last created special effect)
                                • Else - Actions
                              • -------- Damage --------
                              • Unit - Cause QJ_Caster to damage (Picked unit), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                              • -------- Damage Text --------
                              • Floating Text - Create floating text that reads Hit! at QJS_victimPos with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                              • Floating Text - Change (Last created floating text): Disable permanence
                              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                              • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                              • -------- Add to Damage Group --------
                              • Unit Group - Add (Picked unit) to QJS_DamagedGroup
                              • -------- Clear --------
                              • Custom script: call RemoveLocation(udg_QJS_victimPos)
                          • -------- Update Damaged Group in Hash Table --------
                          • Hashtable - Save Handle OfQJS_DamagedGroup as (Key dgroup) of (Key (Picked unit)) in QJS_arrowTable
                          • -------- Clear --------
                          • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                        • Else - Actions
                • Else - Actions
                  • -------- Move Arrow --------
                  • Unit - Move (Picked unit) instantly to QJS_movePos, facing QJS_Angle degrees
                  • -------- Update Distance --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QJ_Homing Equal to False
                    • Then - Actions
                      • Hashtable - Save (QJS_Distance - QJ_Speed) as (Key dist) of (Key (Picked unit)) in QJS_arrowTable
                    • Else - Actions
                  • -------- If Pierce = True --------
                  • -------- Do Damage --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QJ_Pierce Equal to True
                    • Then - Actions
                      • -------- Attack Type ID Coversion --------
                      • Set QJS_AttackType = QJS_atkTypePreset[QJ_attackTypeID]
                      • -------- Damage Type ID Coversion --------
                      • Set QJS_DamageType = QJS_dmgTypePreset[QJ_damageTypeID]
                      • -------- Check for AoE --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_AoE Equal to True
                        • Then - Actions
                          • -------- Load AoE Radius --------
                          • Set QJ_AoERadius = (Load (Key aoeradius) of (Key (Picked unit)) from QJS_arrowTable)
                          • -------- Load Effect --------
                          • Set QJ_AoESFX = (Load (Key aoesfx) of (Key (Picked unit)) from QJS_arrowTable)
                        • Else - Actions
                          • -------- AoE Radius = Default, 150 --------
                          • Set QJ_AoERadius = 150.00
                      • -------- Set Victim Group --------
                      • Set QJS_victimGroup = (Units within QJ_AoERadius of QJS_movePos matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True) and (((Matching unit) is in QJS_DamagedGroup) Equal to False))))
                      • Unit Group - Pick every unit in QJS_victimGroup and do (Actions)
                        • Loop - Actions
                          • Set QJS_victimPos = (Position of (Picked unit))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • QJ_AoE Equal to True
                            • Then - Actions
                              • -------- Create AoE Effect --------
                              • Special Effect - Create a special effect at QJS_victimPos using QJ_AoESFX
                              • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                          • -------- Damage --------
                          • Unit - Cause QJ_Caster to damage (Picked unit), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                          • -------- Damage Text --------
                          • Floating Text - Create floating text that reads Hit! at QJS_victimPos with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                          • -------- Add to Damage Group --------
                          • Unit Group - Add (Picked unit) to QJS_DamagedGroup
                          • -------- Clear --------
                          • Custom script: call RemoveLocation(udg_QJS_victimPos)
                      • -------- Update Damaged Group in Hash Table --------
                      • Hashtable - Save Handle OfQJS_DamagedGroup as (Key dgroup) of (Key (Picked unit)) in QJS_arrowTable
                      • -------- Clear --------
                      • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                    • Else - Actions
              • -------- Clear --------
              • Custom script: call RemoveLocation(udg_QJS_movePos)
            • Else - Actions
              • -------- End --------
              • -------- Pierce = False --------
              • -------- Remove End Damage as Moving will do Damage --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • QJ_Pierce Equal to False
                • Then - Actions
                  • -------- Attack Type ID Coversion --------
                  • Set QJS_AttackType = QJS_atkTypePreset[QJ_attackTypeID]
                  • -------- Damage Type ID Coversion --------
                  • Set QJS_DamageType = QJS_dmgTypePreset[QJ_damageTypeID]
                  • -------- Position of Arrow --------
                  • Set QJS_arrowPos = (Position of (Picked unit))
                  • -------- Deal Damage --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • QJ_TargetUnit Equal to No unit
                    • Then - Actions
                      • -------- Target Point --------
                      • -------- Check for AoE or Single Target --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_AoE Equal to True
                        • Then - Actions
                          • -------- AOE --------
                          • -------- Load AoE Radius --------
                          • Set QJ_AoERadius = (Load (Key aoeradius) of (Key (Picked unit)) from QJS_arrowTable)
                          • -------- Load Effect --------
                          • Set QJ_AoESFX = (Load (Key aoesfx) of (Key (Picked unit)) from QJS_arrowTable)
                          • -------- Create AoE Effect --------
                          • Special Effect - Create a special effect at QJS_arrowPos using QJ_AoESFX
                          • Special Effect - Destroy (Last created special effect)
                          • -------- Set Victim Group in AoE Range --------
                          • Set QJS_victimGroup = (Units within QJ_AoERadius of QJS_arrowPos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True)))
                          • -------- Damage --------
                          • Unit Group - Pick every unit in QJS_victimGroup and do (Actions)
                            • Loop - Actions
                              • Unit - Cause QJ_Caster to damage (Picked unit), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                          • -------- Clear --------
                          • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                        • Else - Actions
                          • -------- Single Target --------
                          • -------- Set Victim Group --------
                          • Set QJS_victimGroup = (Units within 150.00 of QJS_arrowPos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True)))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in QJS_victimGroup) Greater than 0
                            • Then - Actions
                              • Unit - Cause QJ_Caster to damage (Random unit from QJS_victimGroup), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                            • Else - Actions
                          • -------- Clear --------
                          • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                    • Else - Actions
                      • -------- Target Unit --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • QJ_AoE Equal to True
                        • Then - Actions
                          • -------- AOE --------
                          • -------- Load AoE Radius --------
                          • Set QJ_AoERadius = (Load (Key aoeradius) of (Key (Picked unit)) from QJS_arrowTable)
                          • -------- Load Effect --------
                          • Set QJ_AoESFX = (Load (Key aoesfx) of (Key (Picked unit)) from QJS_arrowTable)
                          • -------- Create AoE Effect --------
                          • Special Effect - Create a special effect at QJS_arrowPos using QJ_AoESFX
                          • Special Effect - Destroy (Last created special effect)
                          • -------- Set Victim Group in AoE Range --------
                          • Set QJS_victimGroup = (Units within QJ_AoERadius of QJS_arrowPos matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of QJ_Caster)) Equal to True)))
                          • -------- Damage --------
                          • Unit Group - Pick every unit in QJS_victimGroup and do (Actions)
                            • Loop - Actions
                              • Unit - Cause QJ_Caster to damage (Picked unit), dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                          • -------- Clear --------
                          • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                        • Else - Actions
                          • -------- Single Target --------
                          • -------- Set Victim Group --------
                          • Set QJS_victimGroup = (Units within 150.00 of QJS_arrowPos matching ((Matching unit) Equal to QJ_TargetUnit))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (QJ_TargetUnit is alive) Equal to True
                              • (Number of units in QJS_victimGroup) Greater than 0
                            • Then - Actions
                              • Unit - Cause QJ_Caster to damage QJ_TargetUnit, dealing QJ_Damage damage of attack type QJS_AttackType and damage type QJS_DamageType
                            • Else - Actions
                              • -------- Miss. --------
                              • Floating Text - Create floating text that reads Miss! at QJS_arrowPos with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                              • Floating Text - Change (Last created floating text): Disable permanence
                              • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
                              • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
                          • -------- Clear --------
                          • Custom script: call DestroyGroup(udg_QJS_victimGroup)
                • Else - Actions
                  • -------- If Pierce True, clear off Damaged Group --------
                  • Unit Group - Remove all units from QJS_DamagedGroup
                  • Custom script: call DestroyGroup(udg_QJS_DamagedGroup)
              • -------- Clear --------
              • Custom script: call RemoveLocation(udg_QJS_arrowPos)
              • -------- Turn Collision for Arrow On --------
              • Unit - Turn collision for (Picked unit) On
              • -------- Kill Arrow --------
              • Unit - Kill (Picked unit)
              • -------- Remove from Arrow Group --------
              • Unit Group - Remove (Picked unit) from QJS_arrowGroup
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in QJS_arrowGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • -------- Clear Hash Table --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in QJS_arrowTable
          • -------- Clear --------
          • Custom script: call RemoveLocation(udg_QJS_tempPos)
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
1. Add Attack animation to what? The caster? Or the "arrow"?
Likely its going to be SetUnitAnimationByIndex(yourUnit, index) You'll have to figure out what number it is yourself as it varies by model.
2. You didn't list a 2nd thing.
 

old

old

Level 6
Joined
May 8, 2016
Messages
112
1. Add Attack animation to what? The caster? Or the "arrow"?
Likely its going to be SetUnitAnimationByIndex(yourUnit, index) You'll have to figure out what number it is yourself as it varies by model.
2. You didn't list a 2nd thing.
The animation to the caster. When it cast this spell
  • Flare
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flare Triggered
    • Actions
      • -------- Set all variables that is needed --------
      • Animation - Play QJ_Caster's attack animation
      • Set QJ_Caster = (Triggering unit)
      • Set QJ_attackTypeID = 4
      • Set QJ_damageTypeID = 1
      • Set QJ_Damage = 50.00
      • Set QJ_Speed = 55.00
      • Set QJ_Size = 0.40
      • Set QJ_TargetUnit = No unit
      • Set QJ_TargetPoint = (Target point of ability being cast)
      • Set QJ_Homing = False
      • Set QJ_Collision = False
      • Set QJ_Pierce = True
      • Set QJ_AoE = True
      • Set QJ_AoERadius = 120.00
      • Set QJ_AoESFX = Abilities\Weapons\SteamTank\SteamTankImpact.mdl
      • Set QJ_Model = Flare Dummy
      • -------- Run Arrow Create --------
      • Trigger - Run Arrow Create <gen> (ignoring conditions)
The second thing is how to make this spell ignore doodads (Don't hit and stop) and increase the speed of the spell

  • Heroic Leap AntiCast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Execute
    • Actions
      • Set HL_Caster[0] = (Triggering unit)
      • Set HL_Point[0] = (Position of HL_Caster[0])
      • Set HL_Point[1] = (Target point of ability being cast)
      • Set HL_Distance[0] = (Distance between HL_Point[0] and HL_Point[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HL_Distance[0] Less than 10.00
        • Then - Actions
          • Unit - Order HL_Caster[0] to Stop
        • Else - Actions
      • Custom script: call RemoveLocation(udg_HL_Point[0])
      • Custom script: call RemoveLocation(udg_HL_Point[1])
  • Heroic Leap Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Execute
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HL_Times Equal to 0
        • Then - Actions
          • Trigger - Turn on Heroic Leap Loop <gen>
        • Else - Actions
      • Set HL_Times = (HL_Times + 1)
      • Set HL_Skip = (HL_Skip + 1)
      • Set HL_Caster[HL_Times] = (Casting unit)
      • Set HL_Point[0] = (Position of HL_Caster[HL_Times])
      • Set HL_Point[1] = (Target point of ability being cast)
      • Set HL_Angle[HL_Times] = (Angle from HL_Point[0] to HL_Point[1])
      • Set HL_Distance[HL_Times] = (Distance between HL_Point[0] and HL_Point[1])
      • Set HL_Off[HL_Times] = False
      • Custom script: call RemoveLocation(udg_HL_Point[0])
      • Custom script: call RemoveLocation(udg_HL_Point[1])
      • Unit - Turn collision for HL_Caster[HL_Times] Off
      • Unit - Pause HL_Caster[HL_Times]
      • Unit - Make HL_Caster[HL_Times] Invulnerable
      • Special Effect - Create a special effect attached to the weapon of HL_Caster[HL_Times] using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
      • Set HL_SpecialEffect[HL_Times] = (Last created special effect)
      • Animation - Change HL_Caster[HL_Times]'s animation speed to (77.00 / ((HL_Distance[HL_Times] / 20.00) x 0.03))% of its original speed
      • Animation - Play HL_Caster[HL_Times]'s attack slam animation
  • Heroic Leap Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HL) from 1 to HL_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HL_Off[HL] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HL_Distance[HL] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Turn collision for HL_Caster[HL] Off
                  • Set HL_Point[0] = (Position of HL_Caster[HL])
                  • Set HL_Point[1] = (HL_Point[0] offset by 150.00 towards HL_Angle[HL] degrees)
                  • Environment - Create a 0.15 second Temporary crater deformation at HL_Point[1] with radius 250.00 and depth 80.00
                  • Special Effect - Create a special effect at HL_Point[1] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: set bj_wantDestroyGroup=true
                  • Unit Group - Pick every unit in (Units within 250.00 of HL_Point[1] matching (((((Matching unit) belongs to an enemy of (Owner of HL_Caster[HL])) Equal to True) and (((Matching unit) is alive) Equal to True)) and (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) i and do (Actions)
                    • Loop - Actions
                      • Unit - Cause HL_Caster[HL] to damage (Picked unit), dealing 50.00 damage of attack type Hero and damage type Normal
                  • Custom script: call RemoveLocation(udg_HL_Point[0])
                  • Custom script: call RemoveLocation(udg_HL_Point[1])
                  • Animation - Change HL_Caster[HL]'s animation speed to 100.00% of its original speed
                  • Animation - Reset HL_Caster[HL]'s animation
                  • Set HL_Off[HL] = True
                  • Set HL_Skip = (HL_Skip - 1)
                  • Special Effect - Destroy HL_SpecialEffect[HL]
                  • Unit - Unpause HL_Caster[HL]
                  • Unit - Make HL_Caster[HL] Vulnerable
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HL_Skip Less than or equal to 0
                    • Then - Actions
                      • Unit - Turn collision for HL_Caster[HL] On
                    • Else - Actions
                      • Trigger - Turn off (This trigger)
                      • Set HL_Times = 0
                • Else - Actions
                  • Set HL_Point[0] = (Position of HL_Caster[HL])
                  • Set HL_Point[1] = (HL_Point[0] offset by 20.00 towards HL_Angle[HL] degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at (Center of (Playable map area)) of type Walkability is off) Equal to True
                    • Then - Actions
                      • Set HL_Point[1] = HL_Point[0]
                      • Set HL_Distance[HL] = 0.00
                    • Else - Actions
                  • Unit - Move HL_Caster[HL] instantly to HL_Point[1]
                  • Set HL_Distance[HL] = (HL_Distance[HL] - 20.00)
                  • Custom script: call RemoveLocation(udg_HL_Point[0])
                  • Custom script: call RemoveLocation(udg_HL_Point[1])
            • Else - Actions
OBS: In Object editor i already changed the Art-Animation, but didnt work.


  • Unit - Turn collision for HL_Caster[HL_Times] Off
I tried to do this, but if this is "OFF", the Caster flies in cliff, wich is terrible.
 
Last edited:

old

old

Level 6
Joined
May 8, 2016
Messages
112
You should be able to make the Flare Triggered spell use the unit's "attack" instead of its "spell effect" animation by modifying one of the spell's Object Editor fields. Look for "Art - Animation" fields and experiment.
^.-? If you mean change the Art in OE i already did it but it won't work. I think is something in trigger so that's why i'm here.
 
Level 41
Joined
Feb 27, 2007
Messages
5,229
After some quick testing and reading it appears that it depends on what ability you based your custom one on, and when it doesn't play properly the spell may need to have a cast time. Other spells will play the animation regardless of cast time. Check out the attached map and you'll see:
  • Select the hero and learn each ability once
  • Cast Black Magic on a unit to see the default spell animation (spell from a request thread, ignore what it does)
  • Cast Thunder clap and the hero will play his death animation
  • Cast Flame Strike and the hero will play no animation at all (not even default spell)
What's the difference? Thunder Clap happens instantly so whichever animation is assigned to it will play in full no matter what. You can change the animation for Thunder Clap to "attack" and he'll play the attack animation-- they all work. Flame strike normally has a cast time and the animation you set for the spell will only play for the duration of the cast time. I've set the Flame Strike cast time to be 0 in the OE so it comes out instantly but this means the animation plays for 0.00 seconds (not helpful). Change the duration to 3.00 seconds and you'll see the whole death animation happen before the spell; change it to 1.00 seconds and you'll see part of the animation play before it casts but it will then stop abruptly.

Finally, you can manually play animations with triggers but know that two animations cannot be played simultaneously and they can't be queued either
  • Animation - Play (triggering unit)'s attack animation

What spell is yours based on? You may also find this tutorial helpful (though hard to read).
 

Attachments

  • Test Map - Black Magic.w3x
    183.6 KB · Views: 48
Level 20
Joined
Aug 13, 2013
Messages
1,696
It's impossible it didn't work seriously as long as you've input a valid animation string that the model does have. " attack slam " try this by adding a comma unless they are really converged in the Magos Editor " attack, slam ".
Edit: Yes you can't play two animations at the same time.
 
Level 41
Joined
Feb 27, 2007
Messages
5,229
It's impossible it didn't work seriously as long as you've input a valid animation string that the model does have. " attack slam " try this by adding a comma unless they are really converged in the Magos Editor " attack, slam "
Actually you need to add each part as separate animation names not as one. So you put in "attack" and then "slam" as two entries in the animation list, not "attack, slam" as one entry. Look at Thunderclap's animation field to see what I mean.
 
Level 41
Joined
Feb 27, 2007
Messages
5,229
I see but you're still not correct-- you actually don't need the comma to play a special animation like that. Try it with a Mountain King in a blank map:
  • ----- Works -----
  • Animation - Play Mountain King 001 <gen>'s spell slam animation
  • ----- Doesn't Work-----
  • Animation - Play Mountain King 001 <gen>'s spell, slam animation
  • Animation - Play Mountain King 001 <gen>'s spell,slam animation
You can try it in my test map.
 

old

old

Level 6
Joined
May 8, 2016
Messages
112
Alright i think i confuse you all. I'll do the right things now to don't open another post and take place of someone who need help too
---THE FIRST THING--- is to add the attack animation for the Flare shoot, Flare is a skill using that arrow system (QJS), and no, Object editor is already changed the Art-animation to attack but didn't work.

---THE SECOND THING--- is to make the HEROIC LEAP - The hero leaps to the target area and hit the ground in front of him- to don't stop in doodads, it means when you cast the spell in a target, your caster jumps, but if there is a doodad in front of him he stops the skill, hitting the doodad. NOTE: if you tell me "turn collision of HL_caster off" i tried to do this, and the caster can "fly" over cliff.

Both of them i hope to you guys post the trigger with BBcode, this means that you should show me what should i change and where should i change.

FIRST THING
  • QJS Hash Table
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set QJS_arrowTable = (Last created hashtable)
  • QJS AttackDamageType
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Attack Type Presets --------
      • Set QJS_atkTypePreset[0] = Spells
      • Set QJS_atkTypePreset[1] = Normal
      • Set QJS_atkTypePreset[2] = Pierce
      • Set QJS_atkTypePreset[3] = Siege
      • Set QJS_atkTypePreset[4] = Magic
      • Set QJS_atkTypePreset[5] = Chaos
      • Set QJS_atkTypePreset[6] = Hero
      • -------- Damage Type Presets --------
      • Set QJS_dmgTypePreset[0] = Unknown
      • Set QJS_dmgTypePreset[1] = Normal
      • Set QJS_dmgTypePreset[2] = Enhanced
      • Set QJS_dmgTypePreset[3] = Fire
      • Set QJS_dmgTypePreset[4] = Cold
      • Set QJS_dmgTypePreset[5] = Lightning
      • Set QJS_dmgTypePreset[6] = Poison
      • Set QJS_dmgTypePreset[7] = Disease
      • Set QJS_dmgTypePreset[8] = Divine
      • Set QJS_dmgTypePreset[9] = Magic
      • Set QJS_dmgTypePreset[10] = Sonic
      • Set QJS_dmgTypePreset[11] = Acid
      • Set QJS_dmgTypePreset[12] = Force
      • Set QJS_dmgTypePreset[13] = Death
      • Set QJS_dmgTypePreset[14] = Mind
      • Set QJS_dmgTypePreset[15] = Plant
      • Set QJS_dmgTypePreset[16] = Defensive
      • Set QJS_dmgTypePreset[17] = Demolition
      • Set QJS_dmgTypePreset[18] = Slow Poison
      • Set QJS_dmgTypePreset[19] = Spirit Link
      • Set QJS_dmgTypePreset[20] = Shadow Strike
      • Set QJS_dmgTypePreset[21] = Universal
  • Arrow Create
    • Events
    • Conditions
    • Actions
      • Set QJS_tempPos = (Position of QJ_Caster)
      • -------- Create Arrow Unit for Caster --------
      • Unit - Create 1 QJ_Model for (Owner of QJ_Caster) at QJS_tempPos facing QJ_TargetPoint
      • Animation - Change (Last created unit)'s size to ((100.00 x QJ_Size)%, (100.00 x QJ_Size)%, ((100.00 x QJ_Size) + 1.00)%) of its original size
      • -------- Homing Limit for Target Unit only --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_TargetUnit Equal to No unit
        • Then - Actions
          • Set QJ_Homing = False
        • Else - Actions
      • -------- Attack Type ID Limit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • QJ_attackTypeID Greater than 6
              • QJ_attackTypeID Less than 0
        • Then - Actions
          • Set QJ_attackTypeID = 0
        • Else - Actions
      • -------- Damage Type Limit --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • QJ_damageTypeID Greater than 21
              • QJ_attackTypeID Less than 0
        • Then - Actions
          • Set QJ_damageTypeID = 0
        • Else - Actions
      • -------- Save stuff to hashtable of Arrow System --------
      • -------- Target Unit or Target Position --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_TargetUnit Equal to No unit
        • Then - Actions
          • -------- Target Point --------
          • -------- Calculate Distance and Angle --------
          • Set QJS_Angle = (Angle from QJS_tempPos to QJ_TargetPoint)
          • Set QJS_Distance = 1300.00
        • Else - Actions
          • Set QJS_tempPos_Target = (Position of QJ_TargetUnit)
          • -------- Target Unit --------
          • Set QJS_Angle = (Angle from QJS_tempPos to QJS_tempPos_Target)
          • Set QJS_Distance = (Distance between QJS_tempPos and QJS_tempPos_Target)
          • -------- Save Victim --------
          • Hashtable - Save Handle OfQJ_TargetUnit as (Key victim) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Clear --------
          • Custom script: call RemoveLocation(udg_QJS_tempPos_Target)
      • -------- Save Caster --------
      • Hashtable - Save Handle OfQJ_Caster as (Key caster) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save if Homing is False --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_Homing Equal to False
        • Then - Actions
          • -------- Save Angle --------
          • Hashtable - Save QJS_Angle as (Key angle) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Save Distance --------
          • Hashtable - Save QJS_Distance as (Key dist) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Save Damage --------
      • Hashtable - Save QJ_Damage as (Key dmg) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Speed --------
      • Hashtable - Save QJ_Speed as (Key spd) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Attack Type ID --------
      • Hashtable - Save QJ_attackTypeID as (Key atkid) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Damage Type ID --------
      • Hashtable - Save QJ_damageTypeID as (Key dmgid) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Collision --------
      • Hashtable - Save QJ_Collision as (Key collision) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Homing --------
      • Hashtable - Save QJ_Homing as (Key homing) of (Key (Last created unit)) in QJS_arrowTable
      • -------- AoE --------
      • Hashtable - Save QJ_AoE as (Key aoe) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save AoE Radius / AoE Effect --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_AoE Equal to True
        • Then - Actions
          • -------- Save AoE Radius --------
          • Hashtable - Save QJ_AoERadius as (Key aoeradius) of (Key (Last created unit)) in QJS_arrowTable
          • -------- Save AoE Effect --------
          • Hashtable - Save QJ_AoESFX as (Key aoesfx) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Pierce --------
      • Hashtable - Save QJ_Pierce as (Key pierce) of (Key (Last created unit)) in QJS_arrowTable
      • -------- Save Pierce Damaged Group (Empty) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • QJ_Pierce Equal to True
        • Then - Actions
          • Custom script: set udg_QJS_DamagedGroup = CreateGroup()
          • Hashtable - Save Handle OfQJS_DamagedGroup as (Key dgroup) of (Key (Last created unit)) in QJS_arrowTable
        • Else - Actions
      • -------- Turn Collision for Arrow Off --------
      • Unit - Turn collision for (Last created unit) Off
      • -------- Add arrow unit to group --------
      • Unit Group - Add (Last created unit) to QJS_arrowGroup
      • -------- Turn On Move --------
      • Trigger - Turn on Arrow Move <gen>
      • -------- Clear --------
      • Custom script: call RemoveLocation(udg_QJS_tempPos)
  • Flare
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flare Triggered
    • Actions
      • -------- Set all variables that is needed --------
      • Set QJ_Caster = (Triggering unit)
      • Set QJ_attackTypeID = 4
      • Set QJ_damageTypeID = 1
      • Set QJ_Damage = 50.00
      • Set QJ_Speed = 55.00
      • Set QJ_Size = 0.40
      • Set QJ_TargetUnit = No unit
      • Set QJ_TargetPoint = (Target point of ability being cast)
      • Set QJ_Homing = False
      • Set QJ_Collision = False
      • Set QJ_Pierce = True
      • Set QJ_AoE = True
      • Set QJ_AoERadius = 120.00
      • Set QJ_AoESFX = Abilities\Weapons\SteamTank\SteamTankImpact.mdl
      • Set QJ_Model = Flare Dummy
      • -------- Run Arrow Create --------
      • Trigger - Run Arrow Create <gen> (ignoring conditions)
SECOND THING
  • Heroic Leap AntiCast
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Execute
    • Actions
      • Set HL_Caster[0] = (Triggering unit)
      • Set HL_Point[0] = (Position of HL_Caster[0])
      • Set HL_Point[1] = (Target point of ability being cast)
      • Set HL_Distance[0] = (Distance between HL_Point[0] and HL_Point[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HL_Distance[0] Less than 10.00
        • Then - Actions
          • Unit - Order HL_Caster[0] to Stop
        • Else - Actions
      • Custom script: call RemoveLocation(udg_HL_Point[0])
      • Custom script: call RemoveLocation(udg_HL_Point[1])
  • Heroic Leap Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Execute
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HL_Times Equal to 0
        • Then - Actions
          • Trigger - Turn on Heroic Leap Loop <gen>
        • Else - Actions
      • Set HL_Times = (HL_Times + 1)
      • Set HL_Skip = (HL_Skip + 1)
      • Set HL_Caster[HL_Times] = (Casting unit)
      • Set HL_Point[0] = (Position of HL_Caster[HL_Times])
      • Set HL_Point[1] = (Target point of ability being cast)
      • Set HL_Angle[HL_Times] = (Angle from HL_Point[0] to HL_Point[1])
      • Set HL_Distance[HL_Times] = (Distance between HL_Point[0] and HL_Point[1])
      • Set HL_Off[HL_Times] = False
      • Custom script: call RemoveLocation(udg_HL_Point[0])
      • Custom script: call RemoveLocation(udg_HL_Point[1])
      • Unit - Turn collision for HL_Caster[HL_Times] On
      • Unit - Pause HL_Caster[HL_Times]
      • Unit - Make HL_Caster[HL_Times] Invulnerable
      • Special Effect - Create a special effect attached to the weapon of HL_Caster[HL_Times] using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
      • Set HL_SpecialEffect[HL_Times] = (Last created special effect)
      • Animation - Change HL_Caster[HL_Times]'s animation speed to (77.00 / ((HL_Distance[HL_Times] / 20.00) x 0.03))% of its original speed
      • Animation - Play HL_Caster[HL_Times]'s attack slam animation
  • Heroic Leap Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HL) from 1 to HL_Times, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HL_Off[HL] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HL_Distance[HL] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Turn collision for HL_Caster[HL] Off
                  • Set HL_Point[0] = (Position of HL_Caster[HL])
                  • Set HL_Point[1] = (HL_Point[0] offset by 150.00 towards HL_Angle[HL] degrees)
                  • Environment - Create a 0.15 second Temporary crater deformation at HL_Point[1] with radius 250.00 and depth 80.00
                  • Special Effect - Create a special effect at HL_Point[1] using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: set bj_wantDestroyGroup=true
                  • Unit Group - Pick every unit in (Units within 250.00 of HL_Point[1] matching (((((Matching unit) belongs to an enemy of (Owner of HL_Caster[HL])) Equal to True) and (((Matching unit) is alive) Equal to True)) and (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) i and do (Actions)
                    • Loop - Actions
                      • Unit - Cause HL_Caster[HL] to damage (Picked unit), dealing 50.00 damage of attack type Hero and damage type Normal
                  • Custom script: call RemoveLocation(udg_HL_Point[0])
                  • Custom script: call RemoveLocation(udg_HL_Point[1])
                  • Animation - Change HL_Caster[HL]'s animation speed to 100.00% of its original speed
                  • Animation - Reset HL_Caster[HL]'s animation
                  • Set HL_Off[HL] = True
                  • Set HL_Skip = (HL_Skip - 1)
                  • Special Effect - Destroy HL_SpecialEffect[HL]
                  • Unit - Unpause HL_Caster[HL]
                  • Unit - Make HL_Caster[HL] Vulnerable
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HL_Skip Less than or equal to 0
                    • Then - Actions
                      • Unit - Turn collision for HL_Caster[HL] On
                    • Else - Actions
                      • Trigger - Turn off (This trigger)
                      • Set HL_Times = 0
                • Else - Actions
                  • Set HL_Point[0] = (Position of HL_Caster[HL])
                  • Set HL_Point[1] = (HL_Point[0] offset by 20.00 towards HL_Angle[HL] degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at (Center of (Playable map area)) of type Walkability is off) Equal to True
                    • Then - Actions
                      • Set HL_Point[1] = HL_Point[0]
                      • Set HL_Distance[HL] = 0.00
                    • Else - Actions
                  • Unit - Move HL_Caster[HL] instantly to HL_Point[1]
                  • Set HL_Distance[HL] = (HL_Distance[HL] - 20.00)
                  • Custom script: call RemoveLocation(udg_HL_Point[0])
                  • Custom script: call RemoveLocation(udg_HL_Point[1])
            • Else - Actions
 
Last edited:
Level 41
Joined
Feb 27, 2007
Messages
5,229
First thing: right after the line "Set QJ_Caster = (Triggering unit)" in Flare trigger add
  • Animation - Play QJ_Caster's attack animation
Second thing: first of all this line has an error:
  • If - Conditions
    • (Terrain pathing at (Center of (Playable map area)) of type Walkability is off) Equal to True
    • ------- Should be -------
    • (Terrain pathing at (HL_Point[1]) of type Walkability is off) Equal to True
Aside from that there really isn't a way to do that without turning off unit pathing. As a solution you could compare the height of the current position and its new position and if that is > 50 or something then you know you're going off a cliff so you stop the spell. However, that will require you to turn pathing off for the unit for the duration of the leap (turn it back on after), so when it's over the unit might end up stuck in unpathable terrain.

You could also remove instantaneously remove all destructibles in the way while checking the pathing of the area and then add them back after the check is complete but that would be a lot of data and a lot of destructibles getting removed/recreated. I don't see any other possible solutions to this problem though.
 

old

old

Level 6
Joined
May 8, 2016
Messages
112
First thing: right after the line "Set QJ_Caster = (Triggering unit)" in Flare trigger add
  • Animation - Play QJ_Caster's attack animation
Second thing: first of all this line has an error:
  • If - Conditions
    • (Terrain pathing at (Center of (Playable map area)) of type Walkability is off) Equal to True
    • ------- Should be -------
    • (Terrain pathing at (HL_Point[1]) of type Walkability is off) Equal to True
Aside from that there really isn't a way to do that without turning off unit pathing. As a solution you could compare the height of the current position and its new position and if that is > 50 or something then you know you're going off a cliff so you stop the spell. However, that will require you to turn pathing off for the unit for the duration of the leap (turn it back on after), so when it's over the unit might end up stuck in unpathable terrain.

You could also remove instantaneously remove all destructibles in the way while checking the pathing of the area and then add them back after the check is complete but that would be a lot of data and a lot of destructibles getting removed/recreated. I don't see any other possible solutions to this problem though.
1-Didn't work, the caster still doing no animation while the missile goes.
2-Ok this spell was just a test, i have another one like this, lets back to the First Thing
 

old

old

Level 6
Joined
May 8, 2016
Messages
112
Make sure the spell has no animations in its art-animation field if you're doing it with the trigger. That trigger DOES work I used it myself on my own map, so if it's still not happening then the model doesn't have an animation called "attack".
Nah, NOthing... I tried with "spell" animation but ~piff...
The model is MageHunter (a hooded guy with a pistol)
This trigger is used to more than Flare skill, does it affect something?
 
Level 41
Joined
Feb 27, 2007
Messages
5,229
I just tried it with two heroes. The Blood Mage has cast backswing, cast point, attack1 backswing, attack1 damage point, attack2 backswing, and attack2 damage point all set to 0. The Mountain King has all default values. They both play their attack animation when ordered through triggers at map init AND when anyone casts Black Magic (test spell in the map). So if it's not playing then some other trigger must be setting their animation speed to something weird or overwriting the animation with another one.
 

Attachments

  • Test Map - Black Magic.w3x
    193.9 KB · Views: 43
Status
Not open for further replies.
Top