• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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