[DiscordArchive] Why is SpellBaseDamageBonusDone recalculated for each aura it's used by at least in ACore? Why not s
[DiscordArchive] Why is SpellBaseDamageBonusDone recalculated for each aura it's used by at least in ACore? Why not s
Archived author: whatwere • Posted: 2022-07-25T14:45:13.674000+00:00
Original source
Why is SpellBaseDamageBonusDone recalculated for each aura it's used by at least in ACore? Why not save values for 1 of each schoolMasks instead with UpdateSpellDamageAndHealingBonus and use that?
Archived author: Deamon • Posted: 2022-07-25T15:06:36.103000+00:00
Original source
I'm not familiar with the code, but as far as I remember, the spell damage can depend on several auras. For mages: intellect buff, that arcane buff that increases damage by 20%, buff from druid mark of wild, buff from elixir, buff from potion
All this stuff are auras. Thus you need to go through active auras on player and opponent to Calc final damage done
Archived author: whatwere • Posted: 2022-07-25T15:08:45.545000+00:00
Original source
This is already recalculated by UpdateSpellDamageAndHealingBonus on every aura change and value change though in
```
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBasePowerBonusDone(SpellSchoolMask(1 << i)));```
Archived author: whatwere • Posted: 2022-07-25T15:09:04.001000+00:00
Original source
This is used exclusively for client
Archived author: whatwere • Posted: 2022-07-25T15:10:01.697000+00:00
Original source
And the only auras calculated in SpellBasePowerBonusDone seem to be done with schoolMask rather than spellFamilyMask unless I'm really missing something
Archived author: whatwere • Posted: 2022-07-25T15:10:54.686000+00:00
Original source
In theory you could have a per-player bool on every spell power change to only recalculate when the spell damage modifiers are called upon, and store them until the next spell power change