mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
[Bug Fix] Cancel Magic SE fix (#3890)
* [Bug Fix] Cancel Magic SE fix Cancel Magic should always attempt the first slot for dispell. * Add back TryDispell
This commit is contained in:
parent
2d6c9f881a
commit
fc8ace91cb
@ -939,6 +939,7 @@ public:
|
||||
void TrySympatheticProc(Mob *target, uint32 spell_id);
|
||||
uint16 GetSympatheticFocusEffect(focusType type, uint16 spell_id);
|
||||
bool TryFadeEffect(int slot);
|
||||
void DispelMagic(Mob* casterm, uint16 spell_id, int effect_value);
|
||||
uint16 GetSpellEffectResistChance(uint16 spell_id);
|
||||
int32 GetVulnerability(Mob *caster, uint32 spell_id, uint32 ticsremaining, bool from_buff_tic = false);
|
||||
int64 GetFcDamageAmtIncoming(Mob *caster, int32 spell_id, bool from_buff_tic = false);
|
||||
|
||||
@ -1094,22 +1094,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
|
||||
snprintf(effect_desc, _EDLEN, "Cancel Magic: %d", effect_value);
|
||||
#endif
|
||||
if(GetSpecialAbility(UNDISPELLABLE)){
|
||||
if (caster)
|
||||
if (caster) {
|
||||
caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name);
|
||||
}
|
||||
break;
|
||||
}
|
||||
int buff_count = GetMaxTotalSlots();
|
||||
for(int slot = 0; slot < buff_count; slot++) {
|
||||
if(IsValidSpell(buffs[slot].spellid) &&
|
||||
spells[buffs[slot].spellid].dispel_flag == 0 &&
|
||||
!IsDiscipline(buffs[slot].spellid))
|
||||
{
|
||||
if (caster && TryDispel(caster->GetCasterLevel(spell_id), buffs[slot].casterlevel, effect_value)){
|
||||
BuffFadeBySlot(slot);
|
||||
slot = buff_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DispelMagic(caster, spell_id, effect_value);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -7300,6 +7291,22 @@ bool Mob::PassLimitClass(uint32 Classes_, uint16 Class_)
|
||||
return false;
|
||||
}
|
||||
|
||||
void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value)
|
||||
{
|
||||
for (int slot = 0; slot < GetMaxTotalSlots(); slot++) {
|
||||
if (
|
||||
buffs[slot].spellid != SPELL_UNKNOWN &&
|
||||
spells[buffs[slot].spellid].dispel_flag == 0 &&
|
||||
!IsDiscipline(buffs[slot].spellid)
|
||||
) {
|
||||
if (caster && TryDispel(caster->GetCasterLevel(spell_id), buffs[slot].casterlevel, effect_value)) {
|
||||
BuffFadeBySlot(slot);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint16 Mob::GetSpellEffectResistChance(uint16 spell_id)
|
||||
{
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user