Merge pull request #1588 from KayenEQ/spa154and209updates

[Spells] Update to SPA 154 and SPA 209 Dispel Bene/Detrimental
This commit is contained in:
KayenEQ
2021-10-09 00:57:42 -04:00
committed by GitHub
2 changed files with 12 additions and 16 deletions
+10 -14
View File
@@ -1086,14 +1086,19 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name);
break;
}
/*
TODO: Parsing shows there is no level modifier. However, a consistent -2% modifer was
found on spell with value 950 (95% spells would have 7% failure rates).
Further investigation is needed. ~ Kayen
*/
int chance = spells[spell_id].base[i];
int buff_count = GetMaxTotalSlots();
for(int slot = 0; slot < buff_count; slot++) {
if (buffs[slot].spellid != SPELL_UNKNOWN &&
IsDetrimentalSpell(buffs[slot].spellid) &&
spells[buffs[slot].spellid].dispel_flag == 0)
{
if (caster && TryDispel(caster->GetLevel(),buffs[slot].casterlevel, effect_value)){
if (zone->random.Int(1, 1000) <= chance){
BuffFadeBySlot(slot);
slot = buff_count;
}
@@ -1112,14 +1117,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name);
break;
}
int chance = spells[spell_id].base[i];
int buff_count = GetMaxTotalSlots();
for(int slot = 0; slot < buff_count; slot++) {
if (buffs[slot].spellid != SPELL_UNKNOWN &&
IsBeneficialSpell(buffs[slot].spellid) &&
spells[buffs[slot].spellid].dispel_flag == 0)
{
if (caster && TryDispel(caster->GetLevel(),buffs[slot].casterlevel, effect_value)){
if (zone->random.Int(1, 1000) <= chance) {
BuffFadeBySlot(slot);
slot = buff_count;
}
@@ -7071,15 +7077,6 @@ uint16 Mob::GetSpellEffectResistChance(uint16 spell_id)
bool Mob::TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier){
/*Live 5-20-14 Patch Note: Updated all spells which use Remove Detrimental and
Cancel Beneficial spell effects to use a new method. The chances for those spells to
affect their targets have not changed unless otherwise noted.*/
/*This should provide a somewhat accurate conversion between pre 5/14 base values and post.
until more information is avialble - Kayen*/
if (level_modifier >= 100)
level_modifier = level_modifier/100;
//Dispels - Check level of caster agianst buffs level (level of the caster who cast the buff)
//Effect value of dispels are treated as a level modifier.
//Values for scaling were obtain from live parses, best estimates.
@@ -7106,7 +7103,6 @@ bool Mob::TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier){
return false;
}
bool Mob::ImprovedTaunt(){
if (spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL]){