[Bug Fix] Vampiric Embrace Fixes (#3873)

* [Bug Fix] Vampiric Embrace Fixes

Fixed the difference of procs for Vampiric Embrace between Necros and Shadow Knights.

* Space

* Cleanup

* Update spdat.h

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
Fryguy 2024-01-07 12:12:15 -05:00 committed by GitHub
parent 2ed4effbe3
commit 41d9a15c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 9 deletions

View File

@ -202,6 +202,8 @@
#define SPELL_GUIDE_LEVITATION 39852 #define SPELL_GUIDE_LEVITATION 39852
#define SPELL_GUIDE_SPELL_HASTE 39853 #define SPELL_GUIDE_SPELL_HASTE 39853
#define SPELL_GUIDE_HASTE 39854 #define SPELL_GUIDE_HASTE 39854
#define SPELL_VAMPIRIC_EMBRACE 821
#define SPELL_VAMPIRIC_EMBRACE_OF_SHADOW 822
//spellgroup ids //spellgroup ids
#define SPELLGROUP_FRENZIED_BURNOUT 2754 #define SPELLGROUP_FRENZIED_BURNOUT 2754

View File

@ -1877,11 +1877,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_AddMeleeProc: case SE_AddMeleeProc:
case SE_WeaponProc: case SE_WeaponProc:
{ {
uint16 procid = GetProcID(spell_id, i); uint16 proc_id = GetProcID(spell_id, i);
#ifdef SPELL_EFFECT_SPAM #ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Weapon Proc: %s (id %d)", spells[effect_value].name, procid); snprintf(effect_desc, _EDLEN, "Weapon Proc: %s (id %d)", spells[effect_value].name, procid);
#endif #endif
AddProcToWeapon(procid, false, 100 + spells[spell_id].limit_value[i], spell_id, caster_level, GetSpellProcLimitTimer(spell_id, ProcType::MELEE_PROC)); // Special case for Vampiric Embrace. If this is a Shadow Knight, the proc is different.
if (proc_id == SPELL_VAMPIRIC_EMBRACE && GetClass() == Class::ShadowKnight) {
proc_id = SPELL_VAMPIRIC_EMBRACE_OF_SHADOW;
}
AddProcToWeapon(proc_id, false, 100 + spells[spell_id].limit_value[i], spell_id, caster_level, GetSpellProcLimitTimer(spell_id, ProcType::MELEE_PROC));
break; break;
} }
@ -3721,7 +3726,7 @@ snare has both of them negative, yet their range should work the same:
case 144: // Level 40+ Harm Touch case 144: // Level 40+ Harm Touch
result = ubase + (caster_level * 10) + (caster_level - 40) * 20; result = ubase + (caster_level * 10) + (caster_level - 40) * 20;
break; break;
//these are used in stacking effects... formula unknown //these are used in stacking effects... formula unknown
case 201: case 201:
case 203: case 203:
@ -4246,8 +4251,14 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
case SE_AddMeleeProc: case SE_AddMeleeProc:
case SE_WeaponProc: case SE_WeaponProc:
{ {
uint16 procid = GetProcID(buffs[slot].spellid, i); uint16 proc_id = GetProcID(buffs[slot].spellid, i);
RemoveProcFromWeapon(procid, false);
// Special case for Vampiric Embrace. If this is a Shadow Knight, the proc is different.
if (proc_id == SPELL_VAMPIRIC_EMBRACE && GetClass() == Class::ShadowKnight) {
proc_id = SPELL_VAMPIRIC_EMBRACE_OF_SHADOW;
}
RemoveProcFromWeapon(proc_id, false);
break; break;
} }
@ -7099,7 +7110,7 @@ bool Mob::TryDeathSave() {
} else { } else {
entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName()); entity_list.MessageCloseString(this, false, 200, Chat::MeleeCrit, DEATH_PACT, GetCleanName());
} }
SendHPUpdate(); SendHPUpdate();
BuffFadeBySlot(buffSlot); BuffFadeBySlot(buffSlot);
return true; return true;

View File

@ -316,7 +316,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
Mob* pMob = nullptr; Mob* pMob = nullptr;
int32 orgcasttime; int32 orgcasttime;
if(!IsValidSpell(spell_id)) { if (!IsValidSpell(spell_id)) {
InterruptSpell(); InterruptSpell();
return(false); return(false);
} }
@ -6168,8 +6168,14 @@ bool Mob::IsCombatProc(uint16 spell_id) {
} }
bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 base_spell_id, int level_override, uint32 proc_reuse_time) { bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 base_spell_id, int level_override, uint32 proc_reuse_time) {
if(!IsValidSpell(spell_id)) if(!IsValidSpell(spell_id)) {
return(false); return false;
}
// Special case for Vampiric Embrace. If this is a Shadow Knight, the proc is different.
if (spell_id == SPELL_VAMPIRIC_EMBRACE && GetClass() == Class::ShadowKnight) {
spell_id = SPELL_VAMPIRIC_EMBRACE_OF_SHADOW;
}
int i; int i;
if (bPerma) { if (bPerma) {
@ -6222,6 +6228,11 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
} }
bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) {
// Special case for Vampiric Embrace. If this is a Shadow Knight, the proc is different.
if (spell_id == SPELL_VAMPIRIC_EMBRACE && GetClass() == Class::ShadowKnight) {
spell_id = SPELL_VAMPIRIC_EMBRACE_OF_SHADOW;
}
for (int i = 0; i < m_max_procs; i++) { for (int i = 0; i < m_max_procs; i++) {
if (bAll || SpellProcs[i].spellID == spell_id) { if (bAll || SpellProcs[i].spellID == spell_id) {
SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].spellID = SPELL_UNKNOWN;