Implement songcap needed for the AA revamp

Added rule Character:UseSpellFileSongCap defaulted to true since
most servers will probably be updating everything.
This commit is contained in:
Michael Cook (mackal)
2015-06-17 02:47:05 -04:00
parent 33b6748c1b
commit 0447321d92
4 changed files with 14 additions and 7 deletions
+8 -3
View File
@@ -1978,7 +1978,11 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
return 10;
uint32 effectmod = 10;
int effectmodcap = RuleI(Character, BaseInstrumentSoftCap);
int effectmodcap = 0;
if (RuleB(Character, UseSpellFileSongCap))
effectmodcap = spells[spell_id].songcap / 10;
else
effectmodcap = RuleI(Character, BaseInstrumentSoftCap);
// this should never use spell modifiers...
// if a spell grants better modifers, they are copied into the item mods
// because the spells are supposed to act just like having the intrument.
@@ -2048,10 +2052,11 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const
effectmod = 10;
return effectmod;
}
effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap;
if (!RuleB(Character, UseSpellFileSongCap))
effectmodcap += aabonuses.songModCap + spellbonuses.songModCap + itembonuses.songModCap;
if (effectmod < 10)
effectmod = 10;
if (effectmod > effectmodcap)
if (effectmodcap && effectmod > effectmodcap) // if the cap is calculated to be 0 using new rules, no cap.
effectmod = effectmodcap;
Log.Out(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id,
effectmod, effectmodcap);