From 451d422b8a68eb0ce060dbf0e6f6d980a8d13d07 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 21 Feb 2014 04:04:18 -0500 Subject: [PATCH] Keep track of base spell id for SpellProcs/PermaProcs This will fix numhits issue for procs from spells --- zone/client_packet.cpp | 2 +- zone/mob.h | 2 +- zone/pets.cpp | 4 ++-- zone/spell_effects.cpp | 4 ++-- zone/spells.cpp | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 387afa3ec..af17626fb 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9466,7 +9466,7 @@ void Client::CompleteConnect() case SE_AddMeleeProc: case SE_WeaponProc: { - AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100+spells[buffs[j1].spellid].base2[x1]); + AddProcToWeapon(GetProcID(buffs[j1].spellid, x1), false, 100+spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); break; } case SE_DefensiveProc: diff --git a/zone/mob.h b/zone/mob.h index 6ae558915..f636b5ea7 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -500,7 +500,7 @@ public: bool AddSkillProc(uint16 spell_id, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN); bool RemoveSkillProc(uint16 spell_id, bool bAll = false); bool HasSkillProcs() const; - bool AddProcToWeapon(uint16 spell_id, bool bPerma = false, uint16 iChance = 3); + bool AddProcToWeapon(uint16 spell_id, bool bPerma = false, uint16 iChance = 3, uint16 base_spell_id = SPELL_UNKNOWN); bool RemoveProcFromWeapon(uint16 spell_id, bool bAll = false); bool HasProcs() const; diff --git a/zone/pets.cpp b/zone/pets.cpp index 7254f2690..5e81c3f84 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -605,9 +605,9 @@ void NPC::SetPetState(SpellBuff_Struct *pet_buffs, uint32 *items) { // We need to reapply buff based procs // We need to do this here so suspended pets also regain their procs. if (spells[buffs[j1].spellid].base2[x1] == 0) { - AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100); + AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100, buffs[j1].spellid); } else { - AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100+spells[buffs[j1].spellid].base2[x1]); + AddProcToWeapon(GetProcID(buffs[j1].spellid,x1), false, 100+spells[buffs[j1].spellid].base2[x1], buffs[j1].spellid); } break; case SE_Charm: diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 75c83cb3e..28f806483 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1695,9 +1695,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) #endif if(spells[spell_id].base2[i] == 0) - AddProcToWeapon(procid, false, 100); + AddProcToWeapon(procid, false, 100, spell_id); else - AddProcToWeapon(procid, false, spells[spell_id].base2[i]+100); + AddProcToWeapon(procid, false, spells[spell_id].base2[i]+100, spell_id); break; } diff --git a/zone/spells.cpp b/zone/spells.cpp index ca3fef4fa..7da17ff82 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4824,7 +4824,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { return false; } -bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance) { +bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 base_spell_id) { if(spell_id == SPELL_UNKNOWN) return(false); @@ -4834,7 +4834,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance) { if (PermaProcs[i].spellID == SPELL_UNKNOWN) { PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; - PermaProcs[i].base_spellID = SPELL_UNKNOWN; + PermaProcs[i].base_spellID = base_spell_id; mlog(SPELLS__PROCS, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; @@ -4846,7 +4846,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; - SpellProcs[i].base_spellID = SPELL_UNKNOWN;; + SpellProcs[i].base_spellID = base_spell_id;; mlog(SPELLS__PROCS, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; }