• 🏆 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] Increasing stats of a trigger enhanced spell based on level

Status
Not open for further replies.
Level 4
Joined
Jan 14, 2017
Messages
75
How is it possible to increase the stats of a custom spell (like damage, amount of targets hit etc.) based on the level (without a pattern like 20/40/60)? I already know to do the following:

  • My Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Siphon Life
    • Actions
      • -------- Damage --------
      • Set SiphonLife_Damage[1] = 15.00
      • Set SiphonLife_Damage[2] = 20.00
      • Set SiphonLife_Damage[2] = 30.00
      • -------- Other stats, just ignore them --------
      • Set SiphonLife_Healing[1] = 7.00
      • Set SiphonLife_Healing[2] = 10.00
      • Set SiphonLife_Healing[3] = 10.00
      • Set SiphonLife_FinalHeal[1] = 10.00
      • Set SiphonLife_FinalHeal[2] = 25.00
      • Set SiphonLife_FinalHeal[3] = 40.00
But how do I get the spell to deal the correct damage when I use the Damage Target action (If my spell were Level 2, how would I get it to deal 20 damage instead of 15?) / do the correct healing?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
What you are doing in your trigger My Spell should be the configuration of your spell. it does not need to run everytime the spell is cast, but before the first spell is cast. Map Initialization would be a good event for it.

In the the Damage Target action you use as damage: SiphonLife_Damage[Level], where Level is: Unit - Level of (Ability being Cast) for (Triggering Unit)
It is good to use a variable for Level, so you have to use "Unit - Level of (Ability being Cast) for (Triggering Unit)" only once. You will most likely need Level for the other values too.
 
Status
Not open for further replies.
Top