mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
79d49504e0
commit
13b709a10b
14 changed files with 468 additions and 263 deletions
|
|
@ -6997,7 +6997,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
|||
|
||||
if(spellData.SpellPPMRate)
|
||||
{
|
||||
uint32 WeaponSpeed = GetAttackTime(attType);
|
||||
uint32 WeaponSpeed = proto->Delay;
|
||||
chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);
|
||||
}
|
||||
else if(chance > 100.0f)
|
||||
|
|
@ -7027,7 +7027,18 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
|
|||
continue;
|
||||
}
|
||||
|
||||
float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
|
||||
// Use first rank to access spell item enchant procs
|
||||
uint32 firstRank = spellmgr.GetFirstSpellInChain(spellInfo->Id);
|
||||
float ppmRate = spellmgr.GetItemEnchantProcChance(firstRank);
|
||||
|
||||
float chance = ppmRate
|
||||
? GetPPMProcChance(proto->Delay, ppmRate)
|
||||
: pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
|
||||
|
||||
|
||||
ApplySpellMod(spellInfo->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
|
||||
ApplySpellMod(spellInfo->Id,SPELLMOD_FREQUENCY_OF_SUCCESS,chance);
|
||||
|
||||
if (roll_chance_f(chance))
|
||||
{
|
||||
if(IsPositiveSpell(pEnchant->spellid[s]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue