[Bug Fix] Corpse Call removing Resurrection Effects (#4410)

* [Bug Fix] Corpse Call removing Rez Effects

When calling a corpse, it should not remove rez effects.

* Update client_process.cpp

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
Fryguy 2024-07-22 06:26:40 -04:00 committed by GitHub
parent c73a1e8bea
commit 3b0fa015a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1032,32 +1032,62 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
name, (uint16)spells[SpellID].base_value[0],
SpellID, ZoneID, InstanceID);
if (RuleB(Spells, BuffsFadeOnDeath)) {
BuffFadeNonPersistDeath();
}
const bool use_old_resurrection = (
RuleB(Character, UseOldRaceRezEffects) &&
(
GetRace() == Race::Barbarian ||
GetRace() == Race::Dwarf ||
GetRace() == Race::Troll ||
GetRace() == Race::Ogre
)
);
const uint16 resurrection_sickness_spell_id = (
use_old_resurrection ?
RuleI(Character, OldResurrectionSicknessSpellID) :
RuleI(Character, ResurrectionSicknessSpellID)
);
int SpellEffectDescNum = GetSpellEffectDescriptionNumber(SpellID);
// Rez spells with Rez effects have this DescNum (first is Titanium, second is 6.2 Client)
if(RuleB(Character, UseResurrectionSickness) && SpellEffectDescNum == 82 || SpellEffectDescNum == 39067) {
SetHP(GetMaxHP() / 5);
SetMana(0);
int resurrection_sickness_spell_id = (
RuleB(Character, UseOldRaceRezEffects) &&
(
GetRace() == BARBARIAN ||
GetRace() == DWARF ||
GetRace() == TROLL ||
GetRace() == OGRE
) ?
RuleI(Character, OldResurrectionSicknessSpellID) :
RuleI(Character, ResurrectionSicknessSpellID)
);
if (RuleB(Spells, BuffsFadeOnDeath)) {
BuffFadeNonPersistDeath();
}
SpellOnTarget(resurrection_sickness_spell_id, this);
} else if (SpellID == SPELL_DIVINE_REZ) {
if (RuleB(Spells, BuffsFadeOnDeath)) {
BuffFadeNonPersistDeath();
}
RestoreHealth();
RestoreMana();
RestoreEndurance();
} else {
if (RuleB(Character, UseResurrectionSickness)) {
bool has_resurrection_sickness = false;
for (int slot = 0; slot < GetMaxTotalSlots(); slot++) {
if (IsValidSpell(buffs[slot].spellid) && IsResurrectionSicknessSpell(buffs[slot].spellid)){
has_resurrection_sickness = true;
break;
}
}
// Need to wipe buffs after checking if client had rez effects.
if (RuleB(Spells, BuffsFadeOnDeath)) {
BuffFadeNonPersistDeath();
}
if (has_resurrection_sickness) {
SpellOnTarget(resurrection_sickness_spell_id, this);
}
}
SetHP(GetMaxHP() / 20);
SetMana(GetMaxMana() / 20);
SetEndurance(GetMaxEndurance() / 20);