aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-30 11:33:28 +0800
committermegamage <none@none>2009-07-30 11:33:28 +0800
commit7121d98480d58a4214abcc2e22f678bad76cdecf (patch)
treea2abe6c11df8264a0f96e090770583c8ea9b0d18 /src/game/SpellMgr.cpp
parent61162312231f1722cbb3f1464704bfa74ed30369 (diff)
[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. Author: nos4r2zod *Note: has been implemented before. Only use part of the patch. --HG-- branch : trunk
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp61
1 files changed, 60 insertions, 1 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index f3e02e6d8f3..73aebc61490 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1217,6 +1217,65 @@ void SpellMgr::LoadSpellProcEvents()
sLog.outString( ">> Loaded %u extra spell proc event conditions", count );
}
+/*
+void SpellMgr::LoadSpellProcItemEnchant()
+{
+ mSpellProcItemEnchantMap.clear(); // need for reload case
+
+ uint32 count = 0;
+
+ // 0 1
+ QueryResult *result = WorldDatabase.Query("SELECT entry, ppmRate FROM spell_proc_item_enchant");
+ if( !result )
+ {
+
+ barGoLink bar( 1 );
+
+ bar.step();
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u proc item enchant definitions", count );
+ return;
+ }
+
+ barGoLink bar( result->GetRowCount() );
+
+ do
+ {
+ Field *fields = result->Fetch();
+
+ bar.step();
+
+ uint32 entry = fields[0].GetUInt32();
+ float ppmRate = fields[1].GetFloat();
+
+ SpellEntry const* spellInfo = sSpellStore.LookupEntry(entry);
+
+ if (!spellInfo)
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_proc_item_enchant` does not exist", entry);
+ continue;
+ }
+
+ if ( GetFirstSpellInChain(entry) != entry )
+ {
+ sLog.outErrorDb("Spell %u listed in `spell_proc_item_enchant` is not first rank in chain", entry);
+ // prevent loading since it won't have an effect anyway
+ continue;
+ }
+
+ mSpellProcItemEnchantMap[entry] = ppmRate;
+
+ ++count;
+ } while( result->NextRow() );
+
+ delete result;
+
+ sLog.outString();
+ sLog.outString( ">> Loaded %u proc item enchant definitions", count );
+}
+*/
+
void SpellMgr::LoadSpellBonusess()
{
mSpellBonusMap.clear(); // need for reload case
@@ -3226,7 +3285,7 @@ bool IsDispelableBySpell(SpellEntry const * dispelSpell, uint32 spellId, bool de
return def;
}
-void SpellMgr::LoadSpellEnchantProcData()
+void SpellMgr::LoadSpellProcItemEnchant()
{
mSpellEnchantProcEventMap.clear(); // need for reload case