From 00f3b01ea72069671b928f8b196a89d4b1a39d55 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Tue, 23 Jul 2013 22:50:28 +0200 Subject: Core/Spells: operate spell correction on SpellInfo store instead of dbc (picked from 77b85b2ea0aec6cd3e545e60e46ac60eebb11e47) --- src/server/game/Guilds/GuildMgr.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 282 ++++++++++++++++++------------------ src/server/game/Spells/SpellMgr.h | 7 +- src/server/game/World/World.cpp | 10 +- 4 files changed, 152 insertions(+), 149 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 583cfa11be9..3fc4e839651 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -199,7 +199,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9cedfdf922f..deb96c467e4 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2601,12 +2601,12 @@ void SpellMgr::LoadSpellInfoStore() mSpellInfoMap[i] = new SpellInfo(spellEntry); } - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::UnloadSpellInfoStore() { - for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { if (mSpellInfoMap[i]) delete mSpellInfoMap[i]; @@ -2616,14 +2616,14 @@ void SpellMgr::UnloadSpellInfoStore() void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists() { - for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { if (mSpellInfoMap[i]) mSpellInfoMap[i]->_UnloadImplicitTargetConditionLists(); } } -void SpellMgr::LoadSpellCustomAttr() +void SpellMgr::LoadSpellInfoCustomAttributes() { uint32 oldMSTime = getMSTime(); @@ -2705,7 +2705,7 @@ void SpellMgr::LoadSpellCustomAttr() if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellInfo* procInfo = (SpellInfo*)GetSpellInfo(enchant->spellid[s]); + SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]); if (!procInfo) continue; @@ -2917,36 +2917,36 @@ void SpellMgr::LoadSpellCustomAttr() CreatureAI::FillAISpellInfo(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); } -void SpellMgr::LoadDbcDataCorrections() +void SpellMgr::LoadSpellInfoCorrections() { uint32 oldMSTime = getMSTime(); - SpellEntry* spellInfo = NULL; - for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) + SpellInfo* spellInfo = NULL; + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { - spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i); + spellInfo = mSpellInfoMap[i]; if (!spellInfo) continue; for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { - switch (spellInfo->Effect[j]) + switch (spellInfo->Effects[j].Effect) { case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: - if (!spellInfo->speed && !spellInfo->SpellFamilyName) - spellInfo->speed = SPEED_CHARGE; + if (!spellInfo->Speed && !spellInfo->SpellFamilyName) + spellInfo->Speed = SPEED_CHARGE; break; } } - if (spellInfo->activeIconID == 2158) // flight + if (spellInfo->ActiveIconID == 2158) // flight spellInfo->Attributes |= SPELL_ATTR0_PASSIVE; switch (spellInfo->Id) @@ -2955,28 +2955,28 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 1; break; case 42730: - spellInfo->EffectTriggerSpell[EFFECT_1] = 42739; + spellInfo->Effects[EFFECT_1].TriggerSpell = 42739; break; case 59735: - spellInfo->EffectTriggerSpell[EFFECT_1] = 59736; + spellInfo->Effects[EFFECT_1].TriggerSpell = 59736; break; case 52611: // Summon Skeletons case 52612: // Summon Skeletons - spellInfo->EffectMiscValueB[0] = 64; + spellInfo->Effects[EFFECT_0].MiscValueB = 64; break; case 40244: // Simon Game Visual case 40245: // Simon Game Visual case 40246: // Simon Game Visual case 40247: // Simon Game Visual case 42835: // Spout, remove damage effect, only anim is needed - spellInfo->Effect[0] = 0; + spellInfo->Effects[EFFECT_0].Effect = 0; break; case 30657: // Quake - spellInfo->EffectTriggerSpell[0] = 30571; + spellInfo->Effects[EFFECT_0].TriggerSpell = 30571; break; case 30541: // Blaze (needs conditions entry) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 63665: // Charge (Argent Tournament emote on riders) case 31298: // Sleep (needs target selection script) @@ -2984,18 +2984,18 @@ void SpellMgr::LoadDbcDataCorrections() case 2895: // Wrath of Air Totem rank 1 (Aura) case 68933: // Wrath of Air Totem rank 2 (Aura) case 29200: // Purify Helboar Meat - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 31344: // Howl of Azgalor - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yards instead of 50000?! + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yards instead of 50000?! break; case 42818: // Headless Horseman - Wisp Flight Port case 42821: // Headless Horseman - Wisp Flight Missile - spellInfo->rangeIndex = 6; // 100 yards + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards break; - case 36350: //They Must Burn Bomb Aura (self) - spellInfo->EffectTriggerSpell[0] = 36325; // They Must Burn Bomb Drop (DND) + case 36350: // They Must Burn Bomb Aura (self) + spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND) break; case 49838: // Stop Time spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO; @@ -3004,15 +3004,15 @@ void SpellMgr::LoadDbcDataCorrections() case 62136: // Energize Cores case 54069: // Energize Cores case 56251: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENTRY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY); break; case 50785: // Energize Cores case 59372: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENEMY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY); break; case 8494: // Mana Shield (rank 2) // because of bug in dbc - spellInfo->procChance = 0; + spellInfo->ProcChance = 0; break; case 20335: // Heart of the Crusader case 20336: @@ -3023,8 +3023,8 @@ void SpellMgr::LoadDbcDataCorrections() break; case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER_AREA_PARTY; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_10_YARDS_2; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS_2); break; case 44978: // Wild Magic case 45001: @@ -3095,7 +3095,7 @@ void SpellMgr::LoadDbcDataCorrections() case 33711: // Murmur's Touch case 38794: spellInfo->MaxAffectedTargets = 1; - spellInfo->EffectTriggerSpell[0] = 33760; + spellInfo->Effects[EFFECT_0].TriggerSpell = 33760; break; case 17941: // Shadow Trance case 22008: // Netherwind Focus @@ -3110,17 +3110,17 @@ void SpellMgr::LoadDbcDataCorrections() case 64823: // Item - Druid T8 Balance 4P Bonus case 34477: // Misdirection case 44401: // Missile Barrage - spellInfo->procCharges = 1; + spellInfo->ProcCharges = 1; break; case 44544: // Fingers of Frost - spellInfo->EffectSpellClassMask[0] = flag96(685904631, 1151048, 0); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); break; case 74396: // Fingers of Frost visual buff - spellInfo->procCharges = 2; + spellInfo->ProcCharges = 2; spellInfo->StackAmount = 0; break; case 28200: // Ascendance (Talisman of Ascendance trinket) - spellInfo->procCharges = 6; + spellInfo->ProcCharges = 6; break; case 47201: // Everlasting Affliction case 47202: @@ -3128,16 +3128,16 @@ void SpellMgr::LoadDbcDataCorrections() case 47204: case 47205: // add corruption to affected spells - spellInfo->EffectSpellClassMask[1][0] |= 2; + spellInfo->Effects[EFFECT_1].SpellClassMask[0] |= 2; break; case 51852: // The Eye of Acherus (no spawn in phase 2 in db) - spellInfo->EffectMiscValue[0] |= 1; + spellInfo->Effects[EFFECT_0].MiscValue |= 1; break; case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster - spellInfo->EffectAmplitude[0] = 3000; + spellInfo->Effects[EFFECT_0].Amplitude = 3000; break; case 29809: // Desecration Arm - 36 instead of 37 - typo? :/ - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_7_YARDS); break; // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data // To prevent aura staying on target after talent unlearned @@ -3152,37 +3152,37 @@ void SpellMgr::LoadDbcDataCorrections() break; case 51466: // Elemental Oath (Rank 1) case 51470: // Elemental Oath (Rank 2) - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_APPLY_AURA; - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_ADD_FLAT_MODIFIER; - spellInfo->EffectMiscValue[EFFECT_1] = SPELLMOD_EFFECT2; - spellInfo->EffectSpellClassMask[EFFECT_1] = flag96(0x00000000, 0x00004000, 0x00000000); + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2; + spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000); break; case 47569: // Improved Shadowform (Rank 1) // with this spell atrribute aura can be stacked several times spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFT; break; case 64904: // Hymn of Hope - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; break; case 19465: // Improved Stings (Rank 2) - spellInfo->EffectImplicitTargetA[EFFECT_2] = TARGET_UNIT_CASTER; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); break; case 30421: // Nether Portal - Perseverence - spellInfo->EffectBasePoints[2] += 30000; + spellInfo->Effects[EFFECT_2].BasePoints += 30000; break; case 16834: // Natural shapeshifter case 16835: - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 51735: // Ebon Plague case 51734: case 51726: spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; spellInfo->SpellFamilyFlags[2] = 0x10; - spellInfo->EffectApplyAuraName[1] = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; break; case 41913: // Parasitic Shadowfiend Passive - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends break; case 27892: // To Anchor 1 case 27928: // To Anchor 1 @@ -3190,18 +3190,18 @@ void SpellMgr::LoadDbcDataCorrections() case 27915: // Anchor to Skulls case 27931: // Anchor to Skulls case 27937: // Anchor to Skulls - spellInfo->rangeIndex = 13; + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); break; // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target // this is the only known exception, probably just wrong data case 29214: // Wrath of the Plaguebringer case 54836: // Wrath of the Plaguebringer - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_SRC_AREA_ALLY; - spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_SRC_AREA_ALLY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); break; case 57994: // Wind Shear - improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_MODIFY_THREAT_PERCENT; - spellInfo->EffectBasePoints[EFFECT_1] = -6; // -5% + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT; + spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5% break; case 63675: // Improved Devouring Plague spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; @@ -3218,55 +3218,55 @@ void SpellMgr::LoadDbcDataCorrections() case 58651: // Flametongue Totem rank 6 (Aura) case 58654: // Flametongue Totem rank 7 (Aura) case 58655: // Flametongue Totem rank 8 (Aura) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetA[1] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; - spellInfo->EffectImplicitTargetB[1] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(); break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) case 53244: // Marked for Death (Rank 3) case 53245: // Marked for Death (Rank 4) case 53246: // Marked for Death (Rank 5) - spellInfo->EffectSpellClassMask[0] = flag96(0x00067801, 0x10820001, 0x00000801); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801); break; case 70728: // Exploit Weakness (needs target selection script) case 70840: // Devious Minds (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_PET; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_PET); break; case 70893: // Culling The Herd (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_MASTER; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_MASTER); break; case 54800: // Sigil of the Frozen Conscience - change class mask to custom extended flags of Icy Touch // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a) // this needs research on modifier applying rules, does not seem to be in Attributes fields - spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000); break; case 64949: // Idol of the Flourishing Life - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 34231: // Libram of the Lightbringer case 60792: // Libram of Tolerance case 64956: // Libram of the Resolute - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 28851: // Libram of Light case 28853: // Libram of Divinity case 32403: // Blessed Book of Nagrand - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 45602: // Ride Carpet - spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" + spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; case 64745: // Item - Death Knight T8 Tank 4P Bonus case 64936: // Item - Warrior T8 Protection 4P Bonus - spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) + spellInfo->Effects[EFFECT_0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc @@ -3276,7 +3276,7 @@ void SpellMgr::LoadDbcDataCorrections() case 19975: // Entangling Roots (Rank 1) -- Nature's Grasp Proc case 27010: // Entangling Roots (Rank 7) -- Nature's Grasp Proc case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc - spellInfo->CastingTimeIndex = 1; + spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); break; case 59414: // Pulsing Shockwave Aura (Loken) // this flag breaks movement, remove it @@ -3286,7 +3286,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; break; case 70650: // Death Knight T10 Tank 2P Bonus - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER; + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER; break; case 71838: // Drain Life - Bryntroll Normal case 71839: // Drain Life - Bryntroll Heroic @@ -3298,7 +3298,7 @@ void SpellMgr::LoadDbcDataCorrections() // ULDUAR SPELLS // case 62374: // Pursued (Flame Leviathan) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 63342: // Focused Eyebeam Summon Trigger (Kologarn) spellInfo->MaxAffectedTargets = 1; @@ -3320,12 +3320,12 @@ void SpellMgr::LoadDbcDataCorrections() // then EFFECT_1, etc - instead of applying each effect on target1, then target2, etc. // The above situation causes the visual for this spell to be bugged, so we remove the instakill // effect and implement a script hack for that. - spellInfo->Effect[EFFECT_1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 64386: // Terrifying Screech (Auriaya) case 64389: // Sentinel Blast (Auriaya) case 64678: // Sentinel Blast (Auriaya) - spellInfo->DurationIndex = 28; // 5 seconds, wrong DBC data? + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds, wrong DBC data? break; case 64321: // Potent Pheromones (Freya) // spell should dispel area aura, but doesn't have the attribute @@ -3335,7 +3335,7 @@ void SpellMgr::LoadDbcDataCorrections() break; case 61791: // Ride Vehicle (Yogg-Saron) // TODO: remove this when basepoints of all Ride Vehicle auras are calculated correctly - spellInfo->EffectBasePoints[0] = 1; + spellInfo->Effects[EFFECT_0].BasePoints = 1; break; case 64468: // Empowering Shadows (Yogg-Saron) case 64486: // Empowering Shadows (Yogg-Saron) @@ -3348,11 +3348,11 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 3; break; case 62293: // Cosmic Smash (Algalon the Observer) - spellInfo->EffectImplicitTargetB[0] = TARGET_DEST_CASTER; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER); break; case 62311: // Cosmic Smash (Algalon the Observer) case 64596: // Cosmic Smash (Algalon the Observer) - spellInfo->rangeIndex = 6; // 100yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd break; case 64014: // Expedition Base Camp Teleport case 64024: // Conservatory Teleport @@ -3363,7 +3363,7 @@ void SpellMgr::LoadDbcDataCorrections() case 64031: // Scrapyard Teleport case 64032: // Formation Grounds Teleport case 65042: // Prison of Yogg-Saron Teleport - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; + spellInfo->Effects[0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); break; // ENDOF ULDUAR SPELLS // @@ -3373,7 +3373,7 @@ void SpellMgr::LoadDbcDataCorrections() case 67901: // Infernal Eruption (25N) // increase duration from 15 to 18 seconds because caster is already // unsummoned when spell missile hits the ground so nothing happen in result - spellInfo->DurationIndex = 85; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(85); break; // ENDOF TRIAL OF THE CRUSADER SPELLS // @@ -3389,11 +3389,11 @@ void SpellMgr::LoadDbcDataCorrections() case 70859: // Upper Spire Teleport case 70860: // Frozen Throne Teleport case 70861: // Sindragosa's Lair Teleport - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); break; case 69055: // Bone Slice (Lord Marrowgar) case 70814: // Bone Slice (Lord Marrowgar) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_8_YARDS; // 5yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); // 5yd break; case 69075: // Bone Storm (Lord Marrowgar) case 70834: // Bone Storm (Lord Marrowgar) @@ -3403,62 +3403,62 @@ void SpellMgr::LoadDbcDataCorrections() case 71160: // Plague Stench (Stinky) case 71161: // Plague Stench (Stinky) case 71123: // Decimate (Stinky & Precious) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 71169: // Shadow's Fate spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 72378: // Blood Nova (Deathbringer Saurfang) case 73058: // Blood Nova (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72769: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // no break case 72771: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72723: // Resistant Skin (Deathbringer Saurfang adds) // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client - spellInfo->Effect[2] = 0; + spellInfo->Effects[EFFECT_2].Effect = 0; break; case 70460: // Coldflame Jets (Traps after Saurfang) - spellInfo->DurationIndex = 1; // 10 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1); // 10 seconds break; case 71412: // Green Ooze Summon (Professor Putricide) case 71415: // Orange Ooze Summon (Professor Putricide) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); break; case 71159: // Awaken Plagued Zombies - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 70530: // Volatile Ooze Beam Protection (Professor Putricide) - spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID + spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID break; // THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED case 71604: // Mutated Strength (Professor Putricide) case 72673: // Mutated Strength (Professor Putricide) case 72674: // Mutated Strength (Professor Putricide) case 72675: // Mutated Strength (Professor Putricide) - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 72454: // Mutated Plague (Professor Putricide) case 72464: // Mutated Plague (Professor Putricide) case 72506: // Mutated Plague (Professor Putricide) case 72507: // Mutated Plague (Professor Putricide) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 70911: // Unbound Plague (Professor Putricide) (needs target selection script) case 72854: // Unbound Plague (Professor Putricide) (needs target selection script) case 72855: // Unbound Plague (Professor Putricide) (needs target selection script) case 72856: // Unbound Plague (Professor Putricide) (needs target selection script) - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); break; case 71518: // Unholy Infusion Quest Credit (Professor Putricide) case 72934: // Blood Infusion Quest Credit (Blood-Queen Lana'thel) case 72289: // Frost Infusion Quest Credit (Sindragosa) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // another missing radius + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // another missing radius break; case 71708: // Empowered Flare (Blood Prince Council) case 72785: // Empowered Flare (Blood Prince Council) @@ -3475,98 +3475,98 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 70715: // Column of Frost (visual marker) - spellInfo->DurationIndex = 32; // 6 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(32); // 6 seconds (missing) break; case 71085: // Mana Void (periodic aura) - spellInfo->DurationIndex = 9; // 30 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 seconds (missing) break; case 72015: // Frostbolt Volley (only heroic) case 72016: // Frostbolt Volley (only heroic) - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_40_YARDS; + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_40_YARDS); break; case 70936: // Summon Suppressor (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 72706: // Achievement Check (Valithria Dreamwalker) case 71357: // Order Whelp - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 70598: // Sindragosa's Fury - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); break; case 69846: // Frost Bomb - spellInfo->speed = 0.0f; // This spell's summon happens instantly + spellInfo->Speed = 0.0f; // This spell's summon happens instantly break; case 71614: // Ice Lock spellInfo->Mechanic = MECHANIC_STUN; break; case 72762: // Defile - spellInfo->DurationIndex = 559; // 53 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(559); // 53 seconds break; case 72743: // Defile - spellInfo->DurationIndex = 22; // 45 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(22); // 45 seconds break; case 72754: // Defile case 73708: // Defile case 73709: // Defile case 73710: // Defile - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69030: // Val'kyr Target Search - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69198: // Raging Spirit Visual - spellInfo->rangeIndex = 13; // 50000yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd break; case 73654: // Harvest Souls case 74295: // Harvest Souls case 74296: // Harvest Souls case 74297: // Harvest Souls - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 73655: // Harvest Soul spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; break; case 73540: // Summon Shadow Trap - spellInfo->DurationIndex = 23; // 90 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(23); // 90 seconds break; case 73530: // Shadow Trap (visual) - spellInfo->DurationIndex = 28; // 5 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds break; case 73529: // Shadow Trap - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_10_YARDS; // 10yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd break; case 74282: // Shadow Trap (searcher) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_3_YARDS; // 3yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd break; case 72595: // Restore Soul case 73650: // Restore Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74086: // Destroy Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74302: // Summon Spirit Bomb case 74342: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 1; break; case 74341: // Summon Spirit Bomb case 74343: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 3; break; case 73579: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72350: // Fury of Frostmourne - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 75127: // Kill Frostmourne Players case 72351: // Fury of Frostmourne @@ -3574,18 +3574,18 @@ void SpellMgr::LoadDbcDataCorrections() case 72429: // Mass Resurrection case 73159: // Play Movie case 73582: // Trigger Vile Spirit (Inside, Heroic) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 72376: // Raise Dead spellInfo->MaxAffectedTargets = 3; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 71809: // Jump - spellInfo->rangeIndex = 3; // 20yd - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(3); // 20yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72405: // Broken Frostmourne - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; // ENDOF ICECROWN CITADEL SPELLS // @@ -3595,7 +3595,7 @@ void SpellMgr::LoadDbcDataCorrections() case 77844: // Twilight Cutter case 77845: // Twilight Cutter case 77846: // Twilight Cutter - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 75509: // Twilight Mending spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE; @@ -3632,7 +3632,7 @@ void SpellMgr::LoadDbcDataCorrections() case 49462: // Call Ruby Drake case 49461: // Call Amber Drake case 49345: // Call Emerald Drake - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; // ENDOF OCULUS SPELLS // @@ -3643,11 +3643,11 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; break; case 45524: // Chains of Ice - spellInfo->EffectImplicitTargetA[EFFECT_2] = 0; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(); break; case 2378: // Minor Fortitude - spellInfo->manaCost = 0; - spellInfo->manaPerSecond = 0; + spellInfo->ManaCost = 0; + spellInfo->ManaPerSecond = 0; break; case 24314: // Threatening Gaze spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP; @@ -3660,7 +3660,7 @@ void SpellMgr::LoadDbcDataCorrections() case SPELLFAMILY_PALADIN: // Seals of the Pure should affect Seal of Righteousness if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) - spellInfo->EffectSpellClassMask[0][1] |= 0x20000000; + spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20000000; break; case SPELLFAMILY_DEATHKNIGHT: // Icy Touch - extend FamilyFlags (unused value) for Sigil of the Frozen Conscience to use @@ -3675,5 +3675,5 @@ void SpellMgr::LoadDbcDataCorrections() properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index b7a3294efe3..54eb45d1660 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -692,6 +692,9 @@ class SpellMgr SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); } + private: + SpellInfo* _GetSpellInfo(uint32 spellId) { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } + // Modifiers public: @@ -718,8 +721,8 @@ class SpellMgr void LoadSpellInfoStore(); void UnloadSpellInfoStore(); void UnloadSpellInfoImplicitTargetConditionLists(); - void LoadSpellCustomAttr(); - void LoadDbcDataCorrections(); + void LoadSpellInfoCustomAttributes(); + void LoadSpellInfoCorrections(); private: SpellDifficultySearcherMap mSpellDifficultySearcherMap; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 56f9ec6a3bb..159d315e808 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1303,17 +1303,17 @@ void World::SetInitialWorldSettings() LoadDBCStores(m_dataPath); DetectDBCLang(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading spell dbc data corrections..."); - sSpellMgr->LoadDbcDataCorrections(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo store..."); sSpellMgr->LoadSpellInfoStore(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo corrections..."); + sSpellMgr->LoadSpellInfoCorrections(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SkillLineAbilityMultiMap Data..."); sSpellMgr->LoadSkillLineAbilityMap(); - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading spell custom attributes..."); - sSpellMgr->LoadSpellCustomAttr(); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo custom attributes..."); + sSpellMgr->LoadSpellInfoCustomAttributes(); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Loading GameObject models..."); LoadGameObjectModelList(); -- cgit v1.2.3 From 10390465f2e964bbdaa892e3900980f50470c6c8 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Wed, 24 Jul 2013 15:18:42 +0200 Subject: Core/Spells: add some logs for loading spell_script_names --- src/server/game/Globals/ObjectMgr.cpp | 20 +++++++++++++++----- src/server/game/Spells/SpellMgr.cpp | 6 +++--- src/server/scripts/Commands/cs_learn.cpp | 8 +++----- 3 files changed, 21 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index bc9934c63eb..140fb6afea0 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4862,10 +4862,10 @@ void ObjectMgr::LoadSpellScriptNames() Field* fields = result->Fetch(); int32 spellId = fields[0].GetInt32(); - const char *scriptName = fields[1].GetCString(); + char const* scriptName = fields[1].GetCString(); bool allRanks = false; - if (spellId <= 0) + if (spellId < 0) { allRanks = true; spellId = -spellId; @@ -4874,17 +4874,21 @@ void ObjectMgr::LoadSpellScriptNames() SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) does not exist.", scriptName, spellId); continue; } if (allRanks) { - if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) has no ranks of spell.", scriptName, fields[0].GetInt32()); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is not first rank of spell.", scriptName, fields[0].GetInt32()); continue; } + while (spellInfo) { _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName))); @@ -4892,7 +4896,13 @@ void ObjectMgr::LoadSpellScriptNames() } } else + { + if (spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Scriptname: `%s` spell (Id: %d) is ranked spell. Properly not all ranks are assigned to this script.", scriptName, spellId); + _spellScriptsStore.insert(SpellScriptsContainer::value_type(spellInfo->Id, GetScriptId(scriptName))); + } + ++count; } while (result->NextRow()); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index deb96c467e4..8e8dee97d1b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1335,14 +1335,14 @@ void SpellMgr::LoadSpellRequired() continue; } - SpellInfo const* req_spell = GetSpellInfo(spell_req); - if (!req_spell) + SpellInfo const* reqSpell = GetSpellInfo(spell_req); + if (!reqSpell) { TC_LOG_ERROR(LOG_FILTER_SQL, "req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req); continue; } - if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req)) + if (spell->IsRankOf(reqSpell)) { TC_LOG_ERROR(LOG_FILTER_SQL, "req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id); continue; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 09060e2e01b..baebc3d0bd5 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -116,8 +116,7 @@ public: else targetPlayer->learnSpell(spell, false); - uint32 firstSpell = sSpellMgr->GetFirstSpellInChain(spell); - if (GetTalentSpellCost(firstSpell)) + if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id)) targetPlayer->SendTalentsInfoData(false); return true; @@ -178,8 +177,7 @@ public: continue; // skip spells with first rank learned as talent (and all talents then also) - uint32 firstRank = sSpellMgr->GetFirstSpellInChain(spellInfo->Id); - if (GetTalentSpellCost(firstRank) > 0) + if (GetTalentSpellCost(spellInfo->GetFirstRankSpell()->Id) > 0) continue; // skip broken spells @@ -493,7 +491,7 @@ public: } if (allRanks) - spellId = sSpellMgr->GetFirstSpellInChain (spellId); + spellId = sSpellMgr->GetFirstSpellInChain(spellId); if (target->HasSpell(spellId)) target->removeSpell(spellId, false, !allRanks); -- cgit v1.2.3 From 9fb45ef64c4434608cd94d0698e0ec845bd2dc3c Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 21 Jul 2013 18:56:25 +0200 Subject: Core/Spells: load spell ranks for talents from dbc --- .../world/2013_07_24_01_world_spell_ranks.sql | 682 +++++++++++++++++++++ src/server/game/Spells/SpellMgr.cpp | 85 ++- src/server/game/Spells/SpellMgr.h | 2 + 3 files changed, 761 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2013_07_24_01_world_spell_ranks.sql (limited to 'src') diff --git a/sql/updates/world/2013_07_24_01_world_spell_ranks.sql b/sql/updates/world/2013_07_24_01_world_spell_ranks.sql new file mode 100644 index 00000000000..db1d9803596 --- /dev/null +++ b/sql/updates/world/2013_07_24_01_world_spell_ranks.sql @@ -0,0 +1,682 @@ +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN ( +5923, +5952, +9452, +9453, +9799, +11069, +11070, +11071, +11078, +11083, +11094, +11095, +11100, +11103, +11108, +11115, +11119, +11124, +11151, +11160, +11170, +11175, +11180, +11185, +11189, +11190, +11207, +11210, +11213, +11222, +11232, +11237, +11242, +11247, +11252, +11255, +12163, +12281, +12282, +12284, +12285, +12286, +12287, +12289, +12290, +12295, +12297, +12298, +12299, +12300, +12301, +12308, +12311, +12312, +12313, +12317, +12318, +12319, +12320, +12321, +12322, +12324, +12329, +12700, +12797, +12834, +12862, +13705, +13706, +13709, +13712, +13713, +13715, +13732, +13733, +13741, +13742, +13743, +13754, +13958, +13960, +13975, +13976, +13981, +13983, +14057, +14076, +14079, +14082, +14113, +14128, +14138, +14144, +14156, +14158, +14162, +14165, +14168, +14171, +14174, +14179, +14186, +14520, +14521, +14522, +14523, +14531, +14747, +14748, +14749, +14750, +14889, +14892, +14898, +14901, +14908, +14909, +14910, +14911, +14912, +14913, +15058, +15257, +15259, +15260, +15270, +15273, +15274, +15275, +15318, +15337, +15392, +16035, +16038, +16039, +16040, +16043, +16086, +16089, +16173, +16176, +16178, +16179, +16180, +16181, +16182, +16184, +16187, +16194, +16252, +16254, +16255, +16256, +16258, +16259, +16261, +16262, +16266, +16462, +16487, +16493, +16513, +16538, +16578, +16757, +16814, +16819, +16821, +16833, +16836, +16845, +16850, +16858, +16880, +16896, +16909, +16929, +16934, +16940, +16942, +16947, +16966, +16972, +16998, +17002, +17003, +17050, +17056, +17063, +17069, +17074, +17104, +17106, +17111, +17118, +17123, +17322, +17485, +17778, +17783, +17788, +17793, +17804, +17810, +17815, +17917, +17927, +17954, +17959, +18094, +18096, +18119, +18126, +18135, +18174, +18179, +18182, +18213, +18218, +18271, +18427, +18459, +18462, +18530, +18551, +18692, +18694, +18697, +18703, +18705, +18709, +18731, +18754, +18767, +18769, +18827, +19159, +19168, +19184, +19255, +19286, +19290, +19295, +19370, +19376, +19407, +19416, +19421, +19426, +19454, +19461, +19464, +19485, +19498, +19507, +19549, +19552, +19559, +19572, +19578, +19583, +19590, +19598, +19609, +19616, +19621, +20042, +20049, +20060, +20096, +20101, +20111, +20117, +20127, +20138, +20143, +20174, +20177, +20196, +20205, +20210, +20224, +20234, +20237, +20244, +20254, +20257, +20262, +20335, +20359, +20468, +20487, +20500, +20502, +20504, +23584, +23785, +24443, +24968, +25956, +26022, +27789, +27811, +27839, +27900, +28574, +28996, +28999, +29062, +29074, +29082, +29140, +29187, +29192, +29206, +29438, +29441, +29447, +29590, +29593, +29598, +29721, +29723, +29759, +29787, +29834, +29836, +29888, +30054, +30060, +30143, +30160, +30242, +30288, +30293, +30299, +30319, +30664, +30672, +30675, +30802, +30812, +30816, +30864, +30867, +30872, +30881, +30892, +30894, +30902, +30919, +31122, +31124, +31130, +31208, +31211, +31216, +31221, +31226, +31228, +31234, +31244, +31380, +31569, +31571, +31574, +31579, +31584, +31638, +31641, +31656, +31667, +31670, +31674, +31679, +31682, +31785, +31822, +31825, +31828, +31833, +31837, +31844, +31848, +31850, +31858, +31866, +31871, +31876, +31879, +32043, +32381, +32385, +32477, +33142, +33150, +33158, +33167, +33186, +33191, +33201, +33213, +33221, +33589, +33592, +33597, +33600, +33603, +33851, +33853, +33859, +33872, +33879, +33881, +33886, +34151, +34293, +34297, +34453, +34455, +34462, +34466, +34475, +34482, +34485, +34491, +34494, +34497, +34500, +34506, +34753, +34908, +34935, +34948, +34950, +35029, +35100, +35104, +35363, +35446, +35541, +35578, +35691, +37116, +44378, +44394, +44397, +44400, +44404, +44442, +44445, +44449, +44543, +44546, +44557, +44566, +44745, +45234, +46854, +46859, +46865, +46867, +46908, +46910, +46913, +46945, +46951, +47195, +47198, +47201, +47220, +47230, +47236, +47245, +47258, +47266, +47294, +47507, +47509, +47516, +47535, +47558, +47562, +47569, +47573, +47580, +47586, +48384, +48389, +48409, +48411, +48432, +48483, +48488, +48492, +48496, +48506, +48516, +48532, +48535, +48539, +48962, +48963, +48965, +48977, +48978, +48979, +48985, +48987, +48988, +48997, +49004, +49006, +49013, +49015, +49018, +49023, +49024, +49027, +49032, +49036, +49042, +49137, +49140, +49145, +49146, +49149, +49175, +49182, +49186, +49188, +49189, +49200, +49202, +49208, +49217, +49219, +49220, +49223, +49224, +49226, +49455, +49467, +49471, +49588, +50040, +50117, +50187, +50365, +50384, +50391, +50685, +50880, +51099, +51123, +51179, +51459, +51466, +51468, +51474, +51480, +51483, +51521, +51523, +51525, +51528, +51554, +51556, +51560, +51562, +51625, +51627, +51632, +51634, +51664, +51672, +51682, +51685, +51692, +51698, +51708, +51745, +51883, +52234, +52783, +52795, +53137, +53175, +53178, +53180, +53182, +53186, +53203, +53215, +53221, +53228, +53234, +53241, +53252, +53256, +53262, +53290, +53295, +53298, +53302, +53375, +53379, +53380, +53409, +53427, +53450, +53481, +53483, +53486, +53501, +53511, +53514, +53527, +53551, +53554, +53556, +53569, +53583, +53590, +53620, +53660, +53671, +53695, +53709, +53754, +54037, +54117, +54347, +54639, +54747, +55061, +55091, +55107, +55129, +55620, +55666, +56314, +56333, +56339, +56342, +56636, +56927, +57470, +57810, +57849, +57873, +57878, +58414, +58872, +59088, +61154, +61216, +61680, +61682, +61686, +61689, +62097, +62758, +62759, +62764, +62905, +63117, +63156, +63349, +63370, +63373, +63410, +63504, +63534, +63625, +63646, +63730, +64127, +64353, +65661, +66799); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9cedfdf922f..b1613e8a8cd 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1187,23 +1187,88 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return true; } -void SpellMgr::LoadSpellRanks() +void SpellMgr::UnloadSpellInfoChains() { - uint32 oldMSTime = getMSTime(); + for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr) + mSpellInfoMap[itr->first]->ChainEntry = NULL; + + mSpellChains.clear(); +} +void SpellMgr::LoadSpellTalentRanks() +{ // cleanup core data before reload - remove reference to ChainNode from SpellInfo - for (SpellChainMap::iterator itr = mSpellChains.begin(); itr != mSpellChains.end(); ++itr) + UnloadSpellInfoChains(); + + for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i) { - mSpellInfoMap[itr->first]->ChainEntry = NULL; + TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); + if (!talentInfo) + continue; + + SpellInfo const* lastSpell = NULL; + for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank) + { + if (talentInfo->RankID[rank]) + { + lastSpell = GetSpellInfo(talentInfo->RankID[rank]); + break; + } + } + + if (!lastSpell) + continue; + + SpellInfo const* firstSpell = GetSpellInfo(talentInfo->RankID[0]); + if (!firstSpell) + { + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->RankID[0], i); + continue; + } + + SpellInfo const* prevSpell = NULL; + for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank) + { + uint32 spellId = talentInfo->RankID[rank]; + if (!spellId) + break; + + SpellInfo const* currentSpell = GetSpellInfo(spellId); + if (!currentSpell) + { + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "SpellMgr::LoadSpellTalentRanks: Spell %u (Rank: %u) for TalentEntry %u does not exist.", spellId, rank + 1, i); + break; + } + + SpellChainNode node; + node.first = firstSpell; + node.last = lastSpell; + node.rank = rank + 1; + + node.prev = prevSpell; + node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[rank + 1]) : NULL; + + mSpellChains[spellId] = node; + mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId]; + + prevSpell = currentSpell; + } } - mSpellChains.clear(); +} + +void SpellMgr::LoadSpellRanks() +{ + // cleanup data and load spell ranks for talents from dbc + LoadSpellTalentRanks(); + + uint32 oldMSTime = getMSTime(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank"); if (!result) { TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); - return; } @@ -1280,6 +1345,10 @@ void SpellMgr::LoadSpellRanks() { ++count; int32 addedSpell = itr->first; + + if (mSpellInfoMap[addedSpell]->ChainEntry) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u (rank: %u, first: %u) listed in `spell_ranks` has already ChainEntry from dbc.", addedSpell, itr->second, lastSpell); + mSpellChains[addedSpell].first = GetSpellInfo(lastSpell); mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first); mSpellChains[addedSpell].rank = itr->second; @@ -1296,10 +1365,10 @@ void SpellMgr::LoadSpellRanks() mSpellChains[addedSpell].next = GetSpellInfo(itr->first); } while (true); - } while (!finished); + } + while (!finished); TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void SpellMgr::LoadSpellRequired() diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index b7a3294efe3..6220ece3ded 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -696,6 +696,8 @@ class SpellMgr public: // Loading data at server startup + void UnloadSpellInfoChains(); + void LoadSpellTalentRanks(); void LoadSpellRanks(); void LoadSpellRequired(); void LoadSpellLearnSkills(); -- cgit v1.2.3 From 5a9810ec08d87a0c6af531033c9c02a8d7bf5a25 Mon Sep 17 00:00:00 2001 From: Ascathor Date: Wed, 24 Jul 2013 19:25:36 +0200 Subject: Core/Commands: Added the rank id to .pinfo for guild data --- sql/updates/world/2013_07_24_02_world_trinity_strings.sql | 3 +++ src/server/scripts/Commands/cs_misc.cpp | 10 ++++++---- .../shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2013_07_24_02_world_trinity_strings.sql (limited to 'src') diff --git a/sql/updates/world/2013_07_24_02_world_trinity_strings.sql b/sql/updates/world/2013_07_24_02_world_trinity_strings.sql new file mode 100644 index 00000000000..b14e60c2c9d --- /dev/null +++ b/sql/updates/world/2013_07_24_02_world_trinity_strings.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE entry = 850; +INSERT INTO `trinity_string` (entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8) VALUES +(850, '├─ Rank: %s (ID: %u)', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index fd7bcaab1d3..6c7e8386bdf 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1587,6 +1587,7 @@ public: // Guild data print variables defined so that they exist, but are not necessarily used uint32 guildId = 0; + uint8 guildRankId = 0; std::string guildName; std::string guildRank; std::string note; @@ -1753,8 +1754,9 @@ public: guildId = fields[0].GetUInt32(); guildName = fields[1].GetString(); guildRank = fields[2].GetString(); - note = fields[3].GetString(); - officeNote = fields[4].GetString(); + guildRankId = fields[3].GetUInt8(); + note = fields[4].GetString(); + officeNote = fields[5].GetString(); } } } @@ -1763,7 +1765,7 @@ public: // Output I. LANG_PINFO_PLAYER handler->PSendSysMessage(LANG_PINFO_PLAYER, target ? "" : handler->GetTrinityString(LANG_OFFLINE), nameLink.c_str(), lowguid); - // Output II. LANG_PINFO_GM_ACTIVE + // Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster if (target && target->IsGameMaster()) handler->PSendSysMessage(LANG_PINFO_GM_ACTIVE); @@ -1830,7 +1832,7 @@ public: if (!guildName.empty()) { handler->PSendSysMessage(LANG_PINFO_CHR_GUILD, guildName.c_str(), guildId); - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank.c_str(), uint32(guildRankId)); if (!note.empty()) handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_NOTE, note.c_str()); if (!officeNote.empty()) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 427ccfd5ebf..7e237614f62 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -105,7 +105,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH); - PrepareStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED, "SELECT g.guildid, g.name, gr.rname, gm.pnote, gm.offnote " + PrepareStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED, "SELECT g.guildid, g.name, gr.rname, gr.rid, gm.pnote, gm.offnote " "FROM guild g JOIN guild_member gm ON g.guildid = gm.guildid " "JOIN guild_rank gr ON g.guildid = gr.guildid AND gm.rank = gr.rid WHERE gm.guid = ?", CONNECTION_BOTH); PrepareStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); -- cgit v1.2.3 From e6a146aba83d98b65c9cdb62cd17132637b98c4e Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 21 Jul 2013 15:12:34 +0200 Subject: Core/Spells: allow to use ranked spells in `spell_proc_event` table (like in `spell_proc` table) --- .../world/2013_07_24_03_world_spell_proc_event.sql | 876 +++++++++++++++++++++ src/server/game/Spells/SpellMgr.cpp | 86 +- 2 files changed, 933 insertions(+), 29 deletions(-) create mode 100644 sql/updates/world/2013_07_24_03_world_spell_proc_event.sql (limited to 'src') diff --git a/sql/updates/world/2013_07_24_03_world_spell_proc_event.sql b/sql/updates/world/2013_07_24_03_world_spell_proc_event.sql new file mode 100644 index 00000000000..0e179e54ec8 --- /dev/null +++ b/sql/updates/world/2013_07_24_03_world_spell_proc_event.sql @@ -0,0 +1,876 @@ +ALTER TABLE `spell_proc_event` + CHANGE `entry` `entry` MEDIUMINT(8) DEFAULT 0 NOT NULL; + +DELETE FROM `spell_proc_event` WHERE `entry` IN ( +325, +905, +945, +8134, +8494, +8495, +10191, +10192, +10193, +10431, +10432, +11120, +12487, +12488, +12574, +12575, +12576, +12577, +12598, +12668, +12724, +12725, +12726, +12727, +12799, +12812, +12813, +12814, +12815, +12846, +12847, +12848, +12849, +12867, +12872, +12873, +12958, +12967, +12968, +12969, +12970, +12971, +12972, +12973, +12974, +13867, +14070, +14071, +14160, +14161, +14190, +14193, +14194, +14195, +14318, +14319, +14320, +14321, +14322, +14774, +15338, +15362, +15363, +16196, +16198, +16235, +16240, +16277, +16278, +16279, +16280, +16281, +16282, +16283, +16284, +16489, +16492, +16544, +16923, +16924, +16954, +16961, +17107, +17108, +17796, +17801, +17802, +17803, +18073, +18095, +18120, +19387, +19388, +19573, +20056, +20057, +20179, +20180, +20181, +20182, +20212, +20213, +20214, +20215, +20235, +20336, +20337, +20501, +20927, +20928, +23695, +24398, +25296, +25469, +25472, +25988, +27044, +27131, +27179, +27815, +27816, +28592, +28593, +29075, +29076, +29179, +29180, +29444, +29594, +29838, +30295, +30296, +30301, +30302, +30678, +30679, +30705, +30883, +30884, +30885, +30886, +31126, +31245, +31570, +31572, +31657, +31658, +31835, +31836, +31872, +31877, +31878, +32387, +32392, +32393, +32394, +32593, +32594, +33145, +33146, +33154, +33192, +33193, +33736, +33882, +33883, +34498, +34499, +34502, +34503, +34859, +34860, +34916, +34917, +34938, +34939, +34954, +35102, +35550, +35551, +35552, +35553, +43019, +43020, +44443, +44446, +44448, +44469, +44470, +44471, +44472, +44560, +44561, +45243, +45244, +46855, +46914, +46915, +46949, +47196, +47197, +47202, +47203, +47204, +47205, +47246, +47247, +47259, +47260, +47264, +47265, +47511, +47515, +47517, +47570, +47581, +47582, +48110, +48111, +48112, +48113, +48159, +48160, +48484, +48485, +48499, +48500, +48510, +48511, +48521, +48525, +48544, +48545, +48951, +48952, +49280, +49281, +49283, +49284, +49503, +49504, +49508, +49509, +49529, +49530, +49599, +49627, +49628, +49654, +49655, +50033, +50034, +50115, +50884, +50885, +50886, +50887, +51462, +51463, +51464, +51465, +51478, +51479, +51522, +51524, +51557, +51558, +51563, +51564, +51565, +51566, +51626, +51628, +51629, +51635, +51636, +51665, +51667, +51668, +51669, +51674, +51679, +51696, +51989, +52004, +52005, +52007, +52008, +52129, +52131, +52134, +52136, +52138, +52797, +52798, +52799, +52800, +53179, +53216, +53217, +53222, +53224, +53232, +53237, +53238, +53259, +53260, +53291, +53292, +53376, +53381, +53382, +53488, +53502, +53503, +53530, +53552, +53553, +53576, +53673, +53696, +53710, +53711, +54151, +54154, +54155, +54637, +54638, +54749, +55667, +56343, +56344, +56611, +56612, +56613, +56614, +56637, +56638, +56822, +56834, +56835, +57472, +57880, +57881, +57960, +58874, +59057, +59089, +61345, +61346, +61847, +62765, +63158, +63245, +63374, +63733, +63737, +64129, +66191, +66192, +66814, +66815, +66816, +66817); + +DELETE FROM `spell_proc_event` WHERE `entry` IN ( +324, +974, +1463, +5952, +9799, +11095, +11119, +11180, +11185, +11213, +11255, +12281, +12289, +12298, +12311, +12319, +12797, +12834, +12966, +13165, +13754, +13983, +14156, +14186, +14531, +14892, +15337, +16086, +16176, +16180, +16256, +16257, +16487, +16850, +16880, +16952, +16958, +17106, +17793, +18094, +18096, +18119, +19184, +19572, +20049, +20177, +20210, +20234, +20335, +20500, +20925, +27811, +29074, +29441, +29593, +29834, +30160, +30293, +30299, +30675, +30701, +30881, +31124, +31244, +31569, +31571, +31656, +31833, +31871, +31876, +32385, +33076, +33142, +33150, +33191, +33881, +34497, +34500, +34753, +34914, +34935, +34950, +35100, +35541, +41635, +44442, +44445, +44449, +44557, +45234, +46854, +46867, +46913, +46945, +47195, +47201, +47245, +47258, +47263, +47509, +47516, +47569, +47580, +48483, +48496, +48506, +48516, +48539, +48988, +49004, +49018, +49149, +49188, +49208, +49217, +49219, +49223, +49467, +50880, +51459, +51474, +51521, +51523, +51556, +51562, +51625, +51627, +51634, +51664, +51672, +51692, +51940, +52127, +52795, +53178, +53215, +53221, +53228, +53234, +53256, +53290, +53375, +53380, +53486, +53501, +53527, +53551, +53569, +53671, +53695, +53709, +54639, +54747, +55666, +56342, +56636, +57470, +57878, +58872, +59088, +61846, +62764, +63156, +63373, +63730, +64127, +65661, +66799, +-324, +-974, +-1463, +-5952, +-9799, +-11095, +-11119, +-11180, +-11185, +-11213, +-11255, +-12281, +-12289, +-12298, +-12311, +-12319, +-12797, +-12834, +-12966, +-13165, +-13754, +-13983, +-14156, +-14186, +-14531, +-14892, +-15337, +-16086, +-16176, +-16180, +-16256, +-16257, +-16487, +-16850, +-16880, +-16952, +-16958, +-17106, +-17793, +-18094, +-18096, +-18119, +-19184, +-19572, +-20049, +-20177, +-20210, +-20234, +-20335, +-20500, +-20925, +-27811, +-29074, +-29441, +-29593, +-29834, +-30160, +-30293, +-30299, +-30675, +-30701, +-30881, +-31124, +-31244, +-31569, +-31571, +-31656, +-31833, +-31871, +-31876, +-32385, +-33076, +-33142, +-33150, +-33191, +-33881, +-34497, +-34500, +-34753, +-34914, +-34935, +-34950, +-35100, +-35541, +-41635, +-44442, +-44445, +-44449, +-44557, +-45234, +-46854, +-46867, +-46913, +-46945, +-47195, +-47201, +-47245, +-47258, +-47263, +-47509, +-47516, +-47569, +-47580, +-48483, +-48496, +-48506, +-48516, +-48539, +-48988, +-49004, +-49018, +-49149, +-49188, +-49208, +-49217, +-49219, +-49223, +-49467, +-50880, +-51459, +-51474, +-51521, +-51523, +-51556, +-51562, +-51625, +-51627, +-51634, +-51664, +-51672, +-51692, +-51940, +-52127, +-52795, +-53178, +-53215, +-53221, +-53228, +-53234, +-53256, +-53290, +-53375, +-53380, +-53486, +-53501, +-53527, +-53551, +-53569, +-53671, +-53695, +-53709, +-54639, +-54747, +-55666, +-56342, +-56636, +-57470, +-57878, +-58872, +-59088, +-61846, +-62764, +-63156, +-63373, +-63730, +-64127, +-65661, +-66799); + +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(-324,0,0,0,0,0,0,0,0,0,3), +(-974,0,0,0,0,0,139944,0,0,0,3), +(-1463,0,0,0,0,0,0,1024,0,0,0), +(-5952,0,8,0,1,0,0,0,0,0,0), +(-9799,0,0,0,0,0,0,2,0,0,0), +(-11095,0,3,16,0,0,0,0,0,0,0), +(-11119,4,3,0,0,0,0,2,0,0,0), +(-11180,16,3,0,0,0,0,0,0,0,0), +(-11185,0,3,128,0,0,327680,0,0,0,0), +(-11213,0,3,0,0,0,0,0,0,0,0), +(-11255,0,3,16384,0,0,0,0,0,0,0), +(-12281,0,4,2858419268,4194565,0,0,0,0,0,6), +(-12289,0,4,2,0,0,0,0,0,0,0), +(-12298,0,0,0,0,0,0,112,0,0,0), +(-12311,0,4,2048,1,0,0,0,0,0,0), +(-12319,0,0,0,0,0,0,2,0,0,0), +(-12797,0,4,1024,0,0,0,0,0,0,0), +(-12834,0,0,0,0,0,0,2,0,0,0), +(-12966,0,0,0,0,0,0,65536,0,0,0), +(-13165,0,0,0,0,0,64,0,0,0,0), +(-13754,0,8,16,0,0,0,0,0,0,0), +(-13983,0,0,0,0,0,0,24,0,0,0), +(-14156,0,8,4063232,8,0,0,0,0,0,0), +(-14186,0,8,1082131720,6,0,0,2,0,0,1), +(-14531,0,0,0,0,0,0,2,0,0,0), +(-14892,0,6,268443136,65540,0,0,2,0,0,0), +(-15337,0,6,8396800,2,0,0,2,0,0,0), +(-16086,4,11,0,262144,0,196608,0,0,0,0), +(-16176,0,11,448,0,16,0,2,0,0,0), +(-16180,0,11,448,0,16,0,2,0,100,0), +(-16256,0,0,0,0,0,0,2,0,0,0), +(-16257,0,0,0,0,0,0,65536,0,0,0), +(-16487,0,0,0,0,0,0,2,0,0,0), +(-16850,0,7,4,0,0,0,0,0,0,0), +(-16880,72,7,103,58720258,0,0,2,0,0,0), +(-16952,0,7,233472,1024,262144,0,2,0,0,0), +(-16958,0,0,0,0,0,0,2,0,0,0), +(-17106,0,7,524288,0,0,0,0,0,0,0), +(-17793,0,5,1,0,0,0,0,0,0,0), +(-18094,0,5,10,0,0,0,0,0,0,0), +(-18096,0,5,256,8388608,0,0,2,0,0,0), +(-18119,0,5,0,8388608,0,0,0,0,0,0), +(-19184,0,9,16,8192,0,0,0,0,0,0), +(-19572,0,9,8388608,0,0,16384,0,0,0,0), +(-20049,0,0,0,0,0,0,2,0,0,0), +(-20177,0,0,0,0,0,0,67,0,0,0), +(-20210,0,10,3221225472,65536,0,0,2,0,0,0), +(-20234,0,10,32768,0,0,0,0,0,0,0), +(-20335,0,10,8388608,0,8,16,0,0,100,0), +(-20500,0,4,268435456,0,0,0,0,0,0,0), +(-20925,0,0,0,0,0,0,64,0,0,0), +(-27811,0,0,0,0,0,0,2,0,0,0), +(-29074,20,3,0,0,0,0,2,0,0,0), +(-29441,0,0,0,0,0,0,8,0,0,1), +(-29593,0,0,0,0,0,0,112,0,0,0), +(-29834,0,0,0,0,0,0,65536,0,0,0), +(-30160,0,0,0,0,0,0,2,0,0,0), +(-30293,0,5,897,8519872,0,0,0,0,0,0), +(-30299,126,0,0,0,0,0,0,0,0,0), +(-30675,0,11,3,0,0,0,0,0,0,0), +(-30701,28,0,0,0,0,664232,0,0,100,0), +(-30881,0,0,0,0,0,0,0,0,0,30), +(-31124,0,8,16777222,0,0,0,0,0,0,0), +(-31244,0,8,4063232,9,0,0,52,0,0,0), +(-31569,0,3,65536,0,0,0,0,0,0,0), +(-31571,0,3,0,34,0,16384,0,0,0,0), +(-31656,4,3,134217728,0,0,0,0,0,0,0), +(-31833,0,10,2147483648,0,0,0,0,0,0,0), +(-31871,0,10,16,0,0,16384,0,0,0,0), +(-31876,0,10,8388608,0,0,0,262144,0,0,0), +(-32385,0,5,1,262144,0,0,0,0,0,0), +(-33076,0,0,0,0,0,664232,0,0,0,0), +(-33142,0,0,0,0,0,0,2,0,0,0), +(-33150,0,0,0,0,0,0,2,0,0,0), +(-33191,0,6,32768,1024,64,0,0,0,0,0), +(-33881,0,0,0,0,0,0,2,0,0,0), +(-34497,0,0,0,0,0,0,2,0,0,0), +(-34500,0,0,0,0,0,0,2,0,0,0), +(-34753,0,6,6144,4,4096,0,2,0,0,0), +(-34914,0,6,8192,0,0,0,0,0,0,0), +(-34935,0,0,0,0,0,0,0,0,0,8), +(-34950,0,0,0,0,0,0,2,0,0,0), +(-35100,0,9,4096,0,1,0,0,0,0,0), +(-35541,0,0,0,0,0,8388608,0,0,0,0), +(-41635,0,0,0,0,0,664232,0,0,0,0), +(-44442,0,3,8388608,64,0,0,65536,0,0,1), +(-44445,0,3,19,69632,0,0,0,0,0,0), +(-44449,0,3,551686775,102472,0,0,2,0,0,0), +(-44557,0,3,32,0,0,0,0,0,0,0), +(-45234,0,0,0,0,0,0,2,0,0,0), +(-46854,0,0,0,0,0,0,2,0,0,0), +(-46867,0,0,0,0,0,0,2,0,0,0), +(-46913,0,4,64,1028,0,0,262144,0,0,0), +(-46945,0,4,0,65536,0,0,0,0,0,0), +(-47195,0,5,2,0,0,0,0,0,0,0), +(-47201,0,5,16393,262144,0,0,0,0,0,0), +(-47245,0,5,2,0,0,0,1,0,0,0), +(-47258,0,5,0,8388608,0,0,65536,0,0,0), +(-47263,32,5,0,0,0,0,2,0,0,20), +(-47509,0,0,0,0,0,0,2,0,0,0), +(-47516,0,6,6144,65536,0,0,0,0,0,0), +(-47569,0,6,16384,0,0,16384,0,0,0,0), +(-47580,0,6,0,0,64,0,65536,0,0,0), +(-48483,0,7,34816,1088,0,0,0,0,0,0), +(-48496,0,7,96,33554434,0,0,2,0,0,0), +(-48506,0,7,5,0,0,0,0,0,0,0), +(-48516,0,7,5,0,0,0,2,0,0,30), +(-48539,0,7,16,67108864,0,262144,0,0,0,0), +(-48988,0,0,0,0,0,0,2,0,0,0), +(-49004,0,0,0,0,0,0,51,0,0,0), +(-49018,0,15,20971520,0,0,0,0,0,0,0), +(-49149,0,15,6,131074,0,0,0,0,0,0), +(-49188,0,15,0,131072,0,0,0,0,0,0), +(-49208,0,15,4194304,65536,0,0,0,0,0,0), +(-49217,0,15,0,0,2,0,0,0,0,1), +(-49219,0,0,0,0,0,4,0,0,0,0), +(-49223,0,15,17,134348800,0,0,0,0,0,0), +(-49467,0,15,16,131072,0,0,0,0,0,0), +(-50880,0,15,0,67108864,0,0,0,0,0,0), +(-51459,0,0,0,0,0,4,0,0,0,0), +(-51474,0,0,0,0,0,0,65536,0,0,0), +(-51521,0,11,0,16777216,0,0,0,0,0,0), +(-51523,0,11,0,1,0,65536,0,0,50,0), +(-51556,0,11,192,0,16,0,2,0,0,0), +(-51562,0,11,256,0,16,0,0,0,0,0), +(-51625,0,8,268476416,0,0,0,0,0,0,0), +(-51627,0,0,0,0,0,0,112,0,0,0), +(-51634,0,0,0,0,0,0,2,0,0,0), +(-51664,0,8,131072,8,0,0,0,0,0,0), +(-51672,0,0,0,0,0,0,16,0,0,1), +(-51692,0,8,516,0,0,0,0,0,0,0), +(-51940,0,0,0,0,0,0,0,0,20,0), +(-52127,0,0,0,0,0,0,0,0,0,3), +(-52795,0,6,1,0,0,0,0,0,0,0), +(-53178,0,9,0,268435456,0,65536,0,0,100,0), +(-53215,0,9,1,0,0,0,0,0,0,0), +(-53221,0,9,0,1,0,0,0,0,0,0), +(-53228,0,9,32,16777216,0,0,0,0,0,0), +(-53234,0,9,131072,1,1,0,2,0,0,0), +(-53256,0,9,2048,8388609,0,0,2,0,0,0), +(-53290,0,9,2048,1,512,0,2,0,0,0), +(-53375,0,10,0,8192,0,1024,0,0,0,6), +(-53380,0,10,8388608,163840,0,0,262146,0,0,0), +(-53486,0,10,8388608,163840,0,0,262146,0,0,0), +(-53501,0,0,0,0,0,0,2,0,0,0), +(-53527,1,10,0,0,4,1024,1,0,100,0), +(-53551,0,10,4096,0,0,0,0,0,0,0), +(-53569,0,10,1075838976,65536,0,0,0,0,0,0), +(-53671,0,10,8388608,0,0,0,0,0,0,0), +(-53695,0,10,8388608,0,8,16,0,0,0,0), +(-53709,2,10,16384,0,0,0,0,0,0,0), +(-54639,0,15,4194304,65536,0,0,0,0,0,0), +(-54747,0,0,0,0,0,0,65536,0,0,0), +(-55666,0,15,1,134217728,0,0,0,0,0,0), +(-56342,0,9,24,134217728,147456,0,0,0,0,22), +(-56636,0,4,32,0,0,0,262144,0,0,6), +(-57470,0,6,1,0,0,0,0,0,0,0), +(-57878,0,0,0,0,0,0,16,0,0,0), +(-58872,0,0,0,0,0,0,270403,0,0,0), +(-59088,0,4,0,2,0,1024,0,0,0,0), +(-61846,0,0,0,0,0,64,0,0,0,0), +(-62764,0,9,0,268435456,0,65536,0,0,100,0), +(-63156,0,5,1,192,0,0,0,0,0,0), +(-63373,0,11,2147483648,0,0,65536,0,0,0,0), +(-63730,0,6,2048,4,0,0,0,0,0,0), +(-64127,0,6,1,1,0,0,0,0,0,0), +(-65661,0,15,4194321,537001988,0,16,0,0,100,0), +(-66799,0,15,4194304,0,0,0,0,0,0,0); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9cedfdf922f..7b162b5abf0 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1741,52 +1741,76 @@ void SpellMgr::LoadSpellProcEvents() } uint32 count = 0; - uint32 customProc = 0; + do { Field* fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); + int32 spellId = fields[0].GetInt32(); - SpellInfo const* spell = GetSpellInfo(entry); - if (!spell) + bool allRanks = false; + if (spellId < 0) + { + allRanks = true; + spellId = -spellId; + } + + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", entry); + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` does not exist", spellId); continue; } - SpellProcEventEntry spe; + if (allRanks) + { + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId); + + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) + { + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` is not first rank of spell.", spellId); + continue; + } + } - spe.schoolMask = fields[1].GetInt8(); - spe.spellFamilyName = fields[2].GetUInt16(); - spe.spellFamilyMask[0] = fields[3].GetUInt32(); - spe.spellFamilyMask[1] = fields[4].GetUInt32(); - spe.spellFamilyMask[2] = fields[5].GetUInt32(); - spe.procFlags = fields[6].GetUInt32(); - spe.procEx = fields[7].GetUInt32(); - spe.ppmRate = fields[8].GetFloat(); - spe.customChance = fields[9].GetFloat(); - spe.cooldown = fields[10].GetUInt32(); + SpellProcEventEntry spellProcEvent; - mSpellProcEventMap[entry] = spe; + spellProcEvent.schoolMask = fields[1].GetInt8(); + spellProcEvent.spellFamilyName = fields[2].GetUInt16(); + spellProcEvent.spellFamilyMask[0] = fields[3].GetUInt32(); + spellProcEvent.spellFamilyMask[1] = fields[4].GetUInt32(); + spellProcEvent.spellFamilyMask[2] = fields[5].GetUInt32(); + spellProcEvent.procFlags = fields[6].GetUInt32(); + spellProcEvent.procEx = fields[7].GetUInt32(); + spellProcEvent.ppmRate = fields[8].GetFloat(); + spellProcEvent.customChance = fields[9].GetFloat(); + spellProcEvent.cooldown = fields[10].GetUInt32(); - if (spell->ProcFlags == 0) + while (spellInfo) { - if (spe.procFlags == 0) + if (mSpellProcEventMap.find(spellInfo->Id) != mSpellProcEventMap.end()) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", entry); - continue; + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->Id); + break; } - customProc++; + + if (!spellInfo->ProcFlags && !spellProcEvent.procFlags) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc_event` probally not triggered spell", spellInfo->Id); + + mSpellProcEventMap[spellInfo->Id] = spellProcEvent; + + if (allRanks) + spellInfo = spellInfo->GetNextRankSpell(); + else + break; } - ++count; - } while (result->NextRow()); - if (customProc) - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); - else - TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + ++count; + } + while (result->NextRow()); + TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellProcs() @@ -1826,6 +1850,9 @@ void SpellMgr::LoadSpellProcs() if (allRanks) { + if (!spellInfo->IsRanked()) + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId); + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId); @@ -1855,9 +1882,10 @@ void SpellMgr::LoadSpellProcs() { if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id); + TC_LOG_ERROR(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` already has its first rank in table.", spellInfo->Id); break; } + SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); // take defaults from dbcs -- cgit v1.2.3