• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Can anyone help me make this jass ability scale with attributes pls

Status
Not open for further replies.
The spell does not save the caster nor the stats currently.
Therefore we need to save the amount of attributes on cast, to do so Add a variable to the global block:
private integer array spellStats
inside "private function OnCast " save the current amount of the attribute scaling the spell onto that variable
set spellStats[id] = GetHeroInt(u,true)
or
set spellStats[id] = GetHeroStr(u,true)
or
set spellStats[id] = GetHeroAgi(u,true)

The spell knows now the amount of int the hero had when casting the spell.
Remains injecting the spellStats[id] variable into the UnitDamageTarget calls:
which you find inside "private function LoopEnum"
JASS:
call UnitDamageTarget(d, u, PartialDamage(spellLevel[id]) + spellStats[id] * 1.0, true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
call UnitDamageTarget(d, u, Damage(spellLevel[id]) + spellStats[id] * 4.0, true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE_WHOKNOWS)
 
Status
Not open for further replies.
Top