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

[Spell] Frost Arrows Dynamic Damage

Status
Not open for further replies.
Level 5
Joined
Jan 19, 2018
Messages
126
Hello Hive!
I am working a Frost Arrow Spell that deals damage partially based on the casters intelligence. It works when I make the unit cast Frost Arrows, but the extra damage is not being dealt when the unit auto casts it.
Here is my simple trigger:
  • Frost Arrows
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frost Arrows (Alleria WIndrunner)
    • Actions
      • -------- Store Casting Unit --------
      • Set FrostArrowCaster = (Casting unit)
      • -------- Store Target Unit --------
      • Set FrostArrowTarget = (Target unit of ability being cast)
      • -------- Wait Ingame to Compensate for Missile Travel (Waiting TIme = Distance Between Units/Missile Speed) --------
      • Wait ((Distance between (Position of (Casting unit)) and (Position of FrostArrowTarget)) / 1500.00) game-time seconds
      • -------- Special Effect Based on Level --------
      • -------- Damage Target Unit (Damage = (Ability Level x 5) + (Hero Intelligence/2 x Ability Level)) --------
      • Unit - Cause FrostArrowCaster to damage FrostArrowTarget, dealing (((Real((Level of (Ability being cast) for (Casting unit)))) x 5.00) + ((Real((Intelligence of (Casting unit) (Include bonuses)))) x ((Real((Level of (Ability being cast) for (Casting unit)))) / 2.00))) damage of attack type Spells and damage type Magic
I have another auto-cast that does work. It deals extra healing based on intelligence when auto-cast so I don't know why the frost arrows isn't working.
Here is the auto-cast that does work which is what I based my Frost Arrows trigger off of:
  • Flash Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Flash Heal (Calia Menethil)
    • Actions
      • Unit - Set life of (Target unit of ability being cast) to (((Life of (Target unit of ability being cast)) + (20.00 x (Real((Level of (Ability being cast) for (Casting unit)))))) + ((Real((Intelligence of (Casting unit) (Include bonuses)))) x ((Real((Level of (Ability being cast) for (Casting unit)))) x 0.50)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Casting unit)) Greater than or equal to 2
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Casting unit) using DivineRage.mdx
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using DivineRage.mdx
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Casting unit)) Equal to 3
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using HolyBlast.mdx
        • Else - Actions
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Arrow autocast is different. Arrows won't trigger the spell cast events when used on autocast.

The general solution is to use a buff placing arrow (like frost arrow) and detect, when the arrow hits the target using a DDS:
Use a unique buff for the arrow ability. When a unit is damaged and has this buff, you know that the unit was hit by the arrow. You then remove the buff and perform whatever action you want to happen, when the arrow hits a target.
 
Level 13
Joined
Jul 15, 2007
Messages
763
Jampion is right, auto-cast attack modifiers such as Frost Arrow, Searing Arrow and Black Arrow will not trigger "starts the effect of an ability" event (and other similiar events) if cast automatically (but they will trigger if you manually cast them).

His solution is also the best though recreating the slow may require some more work.
 
Status
Not open for further replies.
Top