Make SPA 112 affect fizzle rate not effective caster level

Per dev quote, SPA 112 "Modifies casting skills of the affected
entity by BaseEffect for the purposes of determining whether or not a
fizzle occurs when casting spells."

Fixes issues caused by having a spell with this effect on caster such
as wrong target debuff durations and buff refreshes not taking hold.
This commit is contained in:
hg 2018-09-13 19:25:05 -04:00
parent 953bee6c21
commit a73bf221ed
5 changed files with 27 additions and 3 deletions

View File

@ -1217,8 +1217,12 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break; break;
} }
case SE_CastingLevel2:
case SE_CastingLevel: { case SE_CastingLevel: {
newbon->adjusted_casting_skill += base1;
break;
}
case SE_CastingLevel2: {
newbon->effective_casting_level += base1; newbon->effective_casting_level += base1;
break; break;
} }
@ -1917,8 +1921,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break; break;
} }
case SE_CastingLevel2:
case SE_CastingLevel: // Brilliance of Ro case SE_CastingLevel: // Brilliance of Ro
{
new_bonus->adjusted_casting_skill += effect_value;
break;
}
case SE_CastingLevel2:
{ {
new_bonus->effective_casting_level += effect_value; new_bonus->effective_casting_level += effect_value;
break; break;
@ -3867,8 +3876,13 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
aabonuses.Corrup = effect_value; aabonuses.Corrup = effect_value;
break; break;
case SE_CastingLevel2:
case SE_CastingLevel: // Brilliance of Ro case SE_CastingLevel: // Brilliance of Ro
spellbonuses.adjusted_casting_skill = effect_value;
aabonuses.adjusted_casting_skill = effect_value;
itembonuses.adjusted_casting_skill = effect_value;
break;
case SE_CastingLevel2:
spellbonuses.effective_casting_level = effect_value; spellbonuses.effective_casting_level = effect_value;
aabonuses.effective_casting_level = effect_value; aabonuses.effective_casting_level = effect_value;
itembonuses.effective_casting_level = effect_value; itembonuses.effective_casting_level = effect_value;

View File

@ -354,6 +354,7 @@ struct StatBonuses {
int32 skillmod[EQEmu::skills::HIGHEST_SKILL + 1]; int32 skillmod[EQEmu::skills::HIGHEST_SKILL + 1];
int32 skillmodmax[EQEmu::skills::HIGHEST_SKILL + 1]; int32 skillmodmax[EQEmu::skills::HIGHEST_SKILL + 1];
int effective_casting_level; int effective_casting_level;
int adjusted_casting_skill; // SPA 112 for fizzles
int reflect_chance; // chance to reflect incoming spell int reflect_chance; // chance to reflect incoming spell
uint32 singingMod; uint32 singingMod;
uint32 Amplification; // stacks with singingMod uint32 Amplification; // stacks with singingMod

View File

@ -333,6 +333,11 @@ int Lua_StatBonuses::Geteffective_casting_level() const {
return self->effective_casting_level; return self->effective_casting_level;
} }
int Lua_StatBonuses::Getadjusted_casting_skill() const {
Lua_Safe_Call_Int();
return self->adjusted_casting_skill;
}
int Lua_StatBonuses::Getreflect_chance() const { int Lua_StatBonuses::Getreflect_chance() const {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->reflect_chance; return self->reflect_chance;
@ -1347,6 +1352,7 @@ luabind::scope lua_register_stat_bonuses() {
.def("skillmod", &Lua_StatBonuses::Getskillmod) .def("skillmod", &Lua_StatBonuses::Getskillmod)
.def("skillmodmax", &Lua_StatBonuses::Getskillmodmax) .def("skillmodmax", &Lua_StatBonuses::Getskillmodmax)
.def("effective_casting_level", &Lua_StatBonuses::Geteffective_casting_level) .def("effective_casting_level", &Lua_StatBonuses::Geteffective_casting_level)
.def("adjusted_casting_skill", &Lua_StatBonuses::Getadjusted_casting_skill)
.def("reflect_chance", &Lua_StatBonuses::Getreflect_chance) .def("reflect_chance", &Lua_StatBonuses::Getreflect_chance)
.def("singingMod", &Lua_StatBonuses::GetsingingMod) .def("singingMod", &Lua_StatBonuses::GetsingingMod)
.def("Amplification", &Lua_StatBonuses::GetAmplification) .def("Amplification", &Lua_StatBonuses::GetAmplification)

View File

@ -91,6 +91,7 @@ public:
int32 Getskillmod(int idx) const; int32 Getskillmod(int idx) const;
int32 Getskillmodmax(int idx) const; int32 Getskillmodmax(int idx) const;
int Geteffective_casting_level() const; int Geteffective_casting_level() const;
int Getadjusted_casting_skill() const;
int Getreflect_chance() const; int Getreflect_chance() const;
uint32 GetsingingMod() const; uint32 GetsingingMod() const;
uint32 GetAmplification() const; uint32 GetAmplification() const;

View File

@ -752,6 +752,8 @@ bool Client::CheckFizzle(uint16 spell_id)
act_skill = GetSkill(spells[spell_id].skill); act_skill = GetSkill(spells[spell_id].skill);
act_skill += GetLevel(); // maximum of whatever the client can cheat act_skill += GetLevel(); // maximum of whatever the client can cheat
act_skill += itembonuses.adjusted_casting_skill + spellbonuses.adjusted_casting_skill + aabonuses.adjusted_casting_skill;
Log(Logs::Detail, Logs::Spells, "Adjusted casting skill: %d+%d+%d+%d+%d=%d", GetSkill(spells[spell_id].skill), GetLevel(), itembonuses.adjusted_casting_skill, spellbonuses.adjusted_casting_skill, aabonuses.adjusted_casting_skill, act_skill);
//spell specialization //spell specialization
float specialize = GetSpecializeSkillValue(spell_id); float specialize = GetSpecializeSkillValue(spell_id);