• 🏆 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] Spellpower incrasing by stats?

Status
Not open for further replies.
Level 1
Joined
Apr 11, 2015
Messages
5
Somebody knows, how to incrase the power of spell by hero stats? For example i have a healing spell, and i want incrase the healing power by Int. How can i do this?
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Only works on triggered spells as nedio said. You can actually work around that on some spells like stormbolt and such by simplly adding the damage once the ability is cast. But it gets complicated with over-time abilities.

Baiscially you do something like: deal 50 + (intellect of unit * 0.30). This would deal base damage (50) + 30% of the unit's intellect.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You have to detect when the ability is healing.
Holy Light is easy in this case because it heals exactly after the "Starts the effect of an ability" event.
So if you want to heal additional health then you simply do this:
  • Holy Light
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit2 belongs to an ally of (Owner of TempUnit)) Equal to True
        • Then - Actions
          • -------- Target is an ally --------
          • Set TempReal = (0.30 x (Real((Intelligence of TempUnit (Include bonuses)))))
          • Unit - Set life of TempUnit2 to ((Life of TempUnit2) + TempReal)
        • Else - Actions
          • -------- Target is an enemy --------
          • Set TempReal = (0.15 x (Real((Intelligence of TempUnit (Include bonuses)))))
          • Unit - Cause TempUnit to damage TempUnit2, dealing TempReal damage of attack type Spells and damage type Normal
This trigger simply adds 15% of INT to the damage when casting on enemies and heals for 30% of INT more when casting on allies.

If you want to trigger the complete damage, you change TempReal to whatever you want.
  • Holy Light
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit2 belongs to an ally of (Owner of TempUnit)) Equal to True
        • Then - Actions
          • -------- Target is an ally --------
          • Set TempReal = (0.30 x (Real((Intelligence of TempUnit (Include bonuses)))))
          • Set TempReal = (TempReal + (200.00 + (200.00 x (Real((Level of (Ability being cast) for TempUnit))))))
          • Unit - Set life of TempUnit2 to ((Life of TempUnit2) + TempReal)
        • Else - Actions
          • -------- Target is an enemy --------
          • Set TempReal = (0.30 x (Real((Intelligence of TempUnit (Include bonuses)))))
          • Set TempReal = (TempReal + (100.00 + (100.00 x (Real((Level of (Ability being cast) for TempUnit))))))
          • Unit - Cause TempUnit to damage TempUnit2, dealing TempReal damage of attack type Spells and damage type Normal
This trigger also increases the damage by 100 + 100 X level.
level 1 = 200 + 15% INT + value from object editor
level 2 = 300 + 15% INT + value from object editor
level 3 = 400 + 15% INT + value from object editor
It also increases the heal by 200 + 200 X level
level 1 = 400 + 30% INT + value from object editor
level 2 = 600 + 30% INT + value from object editor
level 3 = 800 + 30% INT + value from object editor

You can figure out what you exactly want.
Be carefull that not every ability does the functional effect when that event fires.
Imagine missiles.
 
Status
Not open for further replies.
Top