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

Split Cold Arrows doesn't do the damage it's supposed to do

Status
Not open for further replies.
Level 14
Joined
Jul 19, 2007
Messages
772
I have an ability in my map named Split Cold Arrows and it's meant to deal a flat initial damage + the Hero's total agility as damage but it doesn't seems to do the damage it's supposed to do at all. What could be wrong?

  • Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set VariableSet SpellHash = (Last created hashtable)
      • Custom script: call SaveTriggerHandle(udg_SpellHash, StringHash("triggers"), 'A02A', gg_trg_Split_Cold_Arrows)
  • Call Spells
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Cold Arrows
    • Actions
      • Custom script: call TriggerExecute(LoadTriggerHandle(udg_SpellHash, StringHash("triggers"), GetSpellAbilityId()))
  • Split Cold Arrows
    • Events
    • Conditions
    • Actions
      • Set VariableSet Caster = (Triggering unit)
      • Set VariableSet Target = (Target unit of ability being cast)
      • Set VariableSet TempLoc = (Position of Caster)
      • Set VariableSet TempLoc2 = (Position of Target)
      • Set VariableSet AbilityLevel = (Level of (Ability being cast) for Caster)
      • Set VariableSet DummyDamage = ((Agility of Caster (Include bonuses)) + (150 x AbilityLevel))
      • Set VariableSet TempGroup = (Units within 400.00 of TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering playe
      • Set VariableSet TempInt2 = (Level of Split Cold Arrows for Caster)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Attack for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
          • Set VariableSet TempUnit = (Last created unit)
          • Unit - Add Split Cold Arrows Dummy to TempUnit
          • Unit - Set level of Split Cold Arrows Dummy for TempUnit to TempInt2
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Set Base Damage of TempUnit to DummyDamage for weapon index: 0
          • Unit - Order TempUnit to Neutral Sea Witch - Activate Frost Arrows.
          • Unit - Order TempUnit to Attack Once (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
      • Custom script: call DestroyGroup (udg_TempGroup)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
So the damage is setup correctly: DummyDamage = Agility + (150 * Level of ability)

But you're only setting the Base Damage of the Dummy. The number of Dice or the number of Sides could be affecting it:
  • Unit - Set Base Damage of TempUnit to DummyDamage for weapon index: 0
There's also the Attack Type of the Dummy unit that would change the outcome.

Also, you should reference Caster and not (Triggering unit) here:
  • Unit - Create 1 Dummy Attack for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
  • Unit - Create 1 Dummy Attack for (Owner of Caster) at TempLoc facing Default building facing degrees
Also, AbilityLevel and TempInt2 are the same exact thing. Use one or the other.


And what is the point of that Hashtable?
You can delete that Init trigger and simply move the Actions from Split Cold Arrows into Call Spells.
  • Split Cold Arrows New
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Cold Arrows
    • Actions
      • Set VariableSet Caster = (Triggering unit)
      • Set VariableSet Target = (Target unit of ability being cast)
      • Set VariableSet TempLoc = (Position of Caster)
      • Set VariableSet TempLoc2 = (Position of Target)
      • Set VariableSet AbilityLevel = (Level of (Ability being cast) for Caster)
      • Set VariableSet DummyDamage = ((Agility of Caster (Include bonuses)) + (150 x AbilityLevel))
      • Set VariableSet TempGroup = (Units within 400.00 of TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering playe
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Attack for (Owner of Caster) at TempLoc facing Default building facing degrees
          • Set VariableSet TempUnit = (Last created unit)
          • Unit - Add Split Cold Arrows Dummy to TempUnit
          • Unit - Set level of Split Cold Arrows Dummy for TempUnit to AbilityLevel
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Set Base Damage of TempUnit to DummyDamage for weapon index: 0
          • Unit - Order TempUnit to Neutral Sea Witch - Activate Frost Arrows.
          • Unit - Order TempUnit to Attack Once (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
      • Custom script: call DestroyGroup (udg_TempGroup)
 
Level 14
Joined
Jul 19, 2007
Messages
772
So the damage is setup correctly: DummyDamage = Agility + (150 * Level of ability)

But you're only setting the Base Damage of the Dummy. The number of Dice or the number of Sides could be affecting it:
  • Unit - Set Base Damage of TempUnit to DummyDamage for weapon index: 0
There's also the Attack Type of the Dummy unit that would change the outcome.

Also, you should reference Caster and not (Triggering unit) here:
  • Unit - Create 1 Dummy Attack for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
  • Unit - Create 1 Dummy Attack for (Owner of Caster) at TempLoc facing Default building facing degrees
Also, AbilityLevel and TempInt2 are the same exact thing. Use one or the other.


And what is the point of that Hashtable?
You can delete that Init trigger and simply move the Actions from Split Cold Arrows into Call Spells.
  • Split Cold Arrows New
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Cold Arrows
    • Actions
      • Set VariableSet Caster = (Triggering unit)
      • Set VariableSet Target = (Target unit of ability being cast)
      • Set VariableSet TempLoc = (Position of Caster)
      • Set VariableSet TempLoc2 = (Position of Target)
      • Set VariableSet AbilityLevel = (Level of (Ability being cast) for Caster)
      • Set VariableSet DummyDamage = ((Agility of Caster (Include bonuses)) + (150 x AbilityLevel))
      • Set VariableSet TempGroup = (Units within 400.00 of TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering playe
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Attack for (Owner of Caster) at TempLoc facing Default building facing degrees
          • Set VariableSet TempUnit = (Last created unit)
          • Unit - Add Split Cold Arrows Dummy to TempUnit
          • Unit - Set level of Split Cold Arrows Dummy for TempUnit to AbilityLevel
          • Unit - Add a 1.00 second Generic expiration timer to TempUnit
          • Unit - Set Base Damage of TempUnit to DummyDamage for weapon index: 0
          • Unit - Order TempUnit to Neutral Sea Witch - Activate Frost Arrows.
          • Unit - Order TempUnit to Attack Once (Picked unit)
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Custom script: call RemoveLocation (udg_TempLoc2)
      • Custom script: call DestroyGroup (udg_TempGroup)
Well I didn't create this ability I took it from a spellpack... I don't get how the dices and sides of the attacks works like but they are set to 1 in the Dummy Attack and attack type is pierce.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
The dice and sides determine the damage range. That's why units can deal damage like 10-20 or 10-12, etc...

Then there's the Attack Types:

Piercing attacks do extra damage to Unarmored units and Light armor, and reduced damage to Fortified, Medium armor, and Heroes.
 
Status
Not open for further replies.
Top