Keep track of base spell id for SpellProcs/PermaProcs

This will fix numhits issue for procs from spells
This commit is contained in:
Michael Cook (mackal) 2014-02-21 04:04:18 -05:00
parent 808977f69a
commit 451d422b8a
5 changed files with 9 additions and 9 deletions

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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;
}

View File

@ -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;
}