[8249] Implement support spell_proc_item_enchant table for ppm item enchantments triggering at hit.

* Added a new SQL table, spell_proc_item_enchant, for "custom" ppmRates on Item Enchants that do not use auras.
  With table data this must fix ppm for effect from 8033 and ranks enchanting, and item 6947/10918 and ranks enchanting.

* Implemented SPELLMOD_FREQUENCY_OF_SUCCESS (26).
  That must fix work talent 14113, spell 32645 with ranks, glyph 41094 and item set effect 64917 in frequency part.

Thanks to MaS0n as author alternative patch that partly used in this patch.
Thanks to Thenecromancer as author alternative patch that ideas inspire MaS0n's patch writing and then this patch also.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
nos4r2zod 2009-07-26 04:16:28 +04:00 committed by VladimirMangos
parent 79d49504e0
commit 13b709a10b
14 changed files with 468 additions and 263 deletions

View file

@ -8926,8 +8926,7 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const
{
// proc per minute chance calculation
if (PPM <= 0) return 0.0f;
uint32 result = uint32((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
return result;
return WeaponSpeed * PPM / 600.0f; // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
}
void Unit::Mount(uint32 mount)
@ -11732,7 +11731,10 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
}
// Apply chance modifer aura
if(Player* modOwner = GetSpellModOwner())
{
modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_FREQUENCY_OF_SUCCESS,chance);
}
return roll_chance_f(chance);
}