diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 59f8a8f9e..1c06f5918 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -2221,11 +2221,12 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim) { continue; } - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + uint32 rangeIndex = spellInfo->GetRangeIndex(); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(rangeIndex); float range = GetSpellMaxRange(srange); float minrange = GetSpellMinRange(srange); - float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT); + float dist = GetCombatDistance(pVictim, rangeIndex == SPELL_RANGE_IDX_COMBAT); // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // continue; @@ -2285,11 +2286,12 @@ SpellEntry const* Creature::ReachWithSpellCure(Unit* pVictim) { continue; } - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + uint32 rangeIndex = spellInfo->GetRangeIndex(); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(rangeIndex); float range = GetSpellMaxRange(srange); float minrange = GetSpellMinRange(srange); - float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT); + float dist = GetCombatDistance(pVictim, rangeIndex == SPELL_RANGE_IDX_COMBAT); // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // continue; @@ -2623,9 +2625,9 @@ bool Creature::LoadCreatureAddon(bool reload) SpellEntry const* spellInfo = sSpellStore.LookupEntry(*cAura); // Already checked on load // Get Difficulty mode for initial case (npc not yet added to world) - if (spellInfo->SpellDifficultyId && !reload && GetMap()->IsDungeon()) - if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(spellInfo->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) - spellInfo = spellEntry; + //if (spellInfo->SpellDifficultyId && !reload && GetMap()->IsDungeon()) + // if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(spellInfo->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) + // spellInfo = spellEntry; CastSpell(this, spellInfo, true); } @@ -2720,14 +2722,14 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const* if (pSpellInfo) { - switch (pSpellInfo->rangeIndex) + switch (pSpellInfo->GetRangeIndex()) { case SPELL_RANGE_IDX_SELF_ONLY: return false; case SPELL_RANGE_IDX_ANYWHERE: return true; case SPELL_RANGE_IDX_COMBAT: return CanReachWithMeleeAttack(pTarget); } - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->GetRangeIndex()); float max_range = GetSpellMaxRange(srange); float min_range = GetSpellMinRange(srange); float dist = GetCombatDistance(pTarget, false); diff --git a/src/game/Object/CreatureAI.cpp b/src/game/Object/CreatureAI.cpp index dcf045dd3..3417e8aba 100644 --- a/src/game/Object/CreatureAI.cpp +++ b/src/game/Object/CreatureAI.cpp @@ -67,7 +67,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry* pSpell, } // Check for power (also done by Spell::CheckCast()) - if (m_creature->GetPower((Powers)pSpell->powerType) < Spell::CalculatePowerCost(pSpell, m_creature)) + if (m_creature->GetPower((Powers)pSpell->GetPowerType()) < Spell::CalculatePowerCost(pSpell, m_creature)) { return CAST_FAIL_POWER; } @@ -78,12 +78,12 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry* pSpell, } } - if (const SpellRangeEntry* pSpellRange = sSpellRangeStore.LookupEntry(pSpell->rangeIndex)) + if (const SpellRangeEntry* pSpellRange = sSpellRangeStore.LookupEntry(pSpell->GetRangeIndex())) { if (pTarget != m_creature) { // pTarget is out of range of this spell (also done by Spell::CheckCast()) - float fDistance = m_creature->GetCombatDistance(pTarget, pSpell->rangeIndex == SPELL_RANGE_IDX_COMBAT); + float fDistance = m_creature->GetCombatDistance(pTarget, pSpell->GetRangeIndex() == SPELL_RANGE_IDX_COMBAT); if (fDistance > (m_creature->IsHostileTo(pTarget) ? pSpellRange->maxRange : pSpellRange->maxRangeFriendly)) { diff --git a/src/game/Object/CreatureEventAI.cpp b/src/game/Object/CreatureEventAI.cpp index 448e65b1c..7842a6423 100644 --- a/src/game/Object/CreatureEventAI.cpp +++ b/src/game/Object/CreatureEventAI.cpp @@ -810,9 +810,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); - if (spellInfo && !(spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT || spellInfo->rangeIndex == SPELL_RANGE_IDX_SELF_ONLY) && target != m_creature) + if (spellInfo && !(spellInfo->GetRangeIndex() == SPELL_RANGE_IDX_COMBAT || spellInfo->GetRangeIndex() == SPELL_RANGE_IDX_SELF_ONLY) && target != m_creature) { - SpellRangeEntry const* spellRange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + SpellRangeEntry const* spellRange = sSpellRangeStore.LookupEntry(spellInfo->GetRangeIndex()); if (spellRange) m_LastSpellMaxRange = spellRange->maxRange; } @@ -1586,7 +1586,7 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) if (i->Event.event_type == EVENT_T_SPELLHIT) // If spell id matches (or no spell id) & if spell school matches (or no spell school) if (!i->Event.spell_hit.spellId || pSpell->Id == i->Event.spell_hit.spellId) - if (pSpell->SchoolMask & i->Event.spell_hit.schoolMask) + if (pSpell->GetSchoolMask() & i->Event.spell_hit.schoolMask) { ProcessEvent(*i, pUnit); } diff --git a/src/game/Object/CreatureEventAIMgr.cpp b/src/game/Object/CreatureEventAIMgr.cpp index 940984c31..c82cc84b4 100644 --- a/src/game/Object/CreatureEventAIMgr.cpp +++ b/src/game/Object/CreatureEventAIMgr.cpp @@ -377,7 +377,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() continue; } - if ((temp.spell_hit.schoolMask & pSpell->SchoolMask) != pSpell->SchoolMask) + if ((temp.spell_hit.schoolMask & pSpell->GetSchoolMask()) != pSpell->GetSchoolMask()) { sLog.outErrorEventAI("Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i); } @@ -746,7 +746,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (!sLog.HasLogFilter(LOG_FILTER_EVENT_AI_DEV) && spell) { // spell must be cast on self, but is not - if ((IsOnlySelfTargeting(spell) || spell->rangeIndex == SPELL_RANGE_IDX_SELF_ONLY) && action.cast.target != TARGET_T_SELF && !(action.cast.castFlags & CAST_FORCE_TARGET_SELF)) + if ((IsOnlySelfTargeting(spell) || spell->GetRangeIndex() == SPELL_RANGE_IDX_SELF_ONLY) && action.cast.target != TARGET_T_SELF && !(action.cast.castFlags & CAST_FORCE_TARGET_SELF)) { sLog.outErrorEventAI("Event %u Action %u uses SpellID %u that must be self cast (target is %u)", i, j + 1, action.cast.spellId, action.cast.target); } diff --git a/src/game/Object/DynamicObject.cpp b/src/game/Object/DynamicObject.cpp index a7d799de2..bd9e9d566 100644 --- a/src/game/Object/DynamicObject.cpp +++ b/src/game/Object/DynamicObject.cpp @@ -102,7 +102,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit* caster, uint32 spellId, SpellEf bytes |= 0x00 << 16; bytes |= 0x00 << 24; */ - SetUInt32Value(DYNAMICOBJECT_BYTES, spellProto->SpellVisual[0] | (type << 28)); + SetUInt32Value(DYNAMICOBJECT_BYTES, spellProto->GetSpellVisual(0) | (type << 28)); SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId); SetFloatValue(DYNAMICOBJECT_RADIUS, radius); diff --git a/src/game/Object/GameObject.cpp b/src/game/Object/GameObject.cpp index 416ff5bb1..976e84b95 100644 --- a/src/game/Object/GameObject.cpp +++ b/src/game/Object/GameObject.cpp @@ -1084,7 +1084,7 @@ void GameObject::TriggerLinkedGameObject(Unit* target) if (trapSpell) // checked at load already { - range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(trapSpell->rangeIndex)); + range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(trapSpell->GetRangeIndex())); } // search nearest linked GO diff --git a/src/game/Object/ObjectMgr.cpp b/src/game/Object/ObjectMgr.cpp index bf264b196..e2a9582e9 100644 --- a/src/game/Object/ObjectMgr.cpp +++ b/src/game/Object/ObjectMgr.cpp @@ -2125,9 +2125,9 @@ void ObjectMgr::LoadItemPrototypes() } */ - if (proto->Unk0 != dbcitem->Unk0) + if (proto->Unk0 != dbcitem->SoundOverrideSubclass) { - sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).", i, proto->Unk0, dbcitem->Unk0); + sLog.outErrorDb("Item (Entry: %u) not correct %i Unk0, must be %i (still using DB value).", i, proto->Unk0, dbcitem->SoundOverrideSubclass); // It safe let use Unk0 from DB } @@ -3490,6 +3490,10 @@ void ObjectMgr::LoadPlayerInfo() if (sWorld.getConfig(CONFIG_UINT32_EXPANSION) < EXPANSION_CATA && (race == RACE_WORGEN || race == RACE_GOBLIN)) continue; + // skip expansion classes / races if not playing with expansion + if (sWorld.getConfig(CONFIG_UINT32_EXPANSION) < EXPANSION_MOP && (class_ == CLASS_MONK || race == RACE_PANDAREN_NEUTRAL || race == RACE_PANDAREN_ALLI || race == RACE_PANDAREN_HORDE)) + continue; + // fatal error if no level 1 data if (!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0) { @@ -3699,6 +3703,16 @@ void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, Play info->stats[STAT_AGILITY] += (lvl > 38 ? 2 : (lvl > 8 && (lvl % 2) ? 1 : 0)); info->stats[STAT_INTELLECT] += (lvl > 38 ? 3 : (lvl > 4 ? 1 : 0)); info->stats[STAT_SPIRIT] += (lvl > 38 ? 3 : (lvl > 5 ? 1 : 0)); + break; + case CLASS_MONK: + info->stats[STAT_STRENGTH] += (lvl > 38 ? 2 : (lvl > 6 && (lvl % 2) ? 1 : 0)); + info->stats[STAT_STAMINA] += (lvl > 32 ? 2 : (lvl > 4 ? 1 : 0)); + info->stats[STAT_AGILITY] += (lvl > 38 ? 2 : (lvl > 8 && (lvl % 2) ? 1 : 0)); + info->stats[STAT_INTELLECT] += (lvl > 38 ? 3 : (lvl > 4 ? 1 : 0)); + info->stats[STAT_SPIRIT] += (lvl > 38 ? 3 : (lvl > 5 ? 1 : 0)); + break; + default: + break; } } } @@ -4014,10 +4028,18 @@ void ObjectMgr::LoadQuests() "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," // 154 155 156 157 158 159 "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," - // 160 161 162 153 + // 160 161 162 163 "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," // 164 165 166 167 - "SoundAccept, SoundTurnIn, StartScript, CompleteScript" + "SoundAccept, SoundTurnIn, StartScript, CompleteScript," + // 168 169 170 171 172 173 174 + "ReqSpellLearned, PortraitGiver, PortraitTurnIn, PortraitGiverName, PortraitGiverText, PortraitTurnInName, PortraitTurnInText, " + // 175 176 177 178 179 180 181 182 + "ReqCurrencyId1, ReqCurrencyId2, ReqCurrencyId3, ReqCurrencyId4, ReqCurrencyCount1, ReqCurrencyCount2, ReqCurrencyCount3, ReqCurrencyCount4, " + // 183 184 185 186 187 188 189 190 + "RewCurrencyId1, RewCurrencyId2, RewCurrencyId3, RewCurrencyId4, RewCurrencyCount1, RewCurrencyCount2, RewCurrencyCount3, RewCurrencyCount4, " + // 191 192 193 194 + "RewSkill, RewSkillValue, SoundAccept, SoundTurnIn " " FROM quest_template"); if (!result) { @@ -8727,7 +8749,7 @@ bool PlayerCondition::Meets(Player const* player, Map const* map, WorldObject co { Unit::SpellAuraHolderMap const& auras = player->GetSpellAuraHolderMap(); for (Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - if ((itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_MOUNTED) || itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNK4)) && itr->second->GetSpellProto()->SpellVisual[0] == 3580) + if ((itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_MOUNTED) || itr->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNK4)) && itr->second->GetSpellProto()->GetSpellVisual(0) == 3580) { return true; } diff --git a/src/game/Object/Player.cpp b/src/game/Object/Player.cpp index fb039b50f..d5cd5b66c 100644 --- a/src/game/Object/Player.cpp +++ b/src/game/Object/Player.cpp @@ -13357,8 +13357,8 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply) return; } - ItemReforgeEntry const* reforge = sItemReforgeStore.LookupEntry(item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT)); - if (!reforge) +// ItemReforgeEntry const* reforge = sItemReforgeStore.LookupEntry(item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT)); +/* if (!reforge) { return; } @@ -13584,7 +13584,7 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply) case ITEM_MOD_MASTERY_RATING: ApplyRatingMod(CR_MASTERY, int32(addValue), apply); break; - } + }*/ } void Player::SendEnchantmentDurations() @@ -22528,7 +22528,7 @@ uint32 Player::GetResurrectionSpellId() for (AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) { // Soulstone Resurrection // prio: 3 (max, non death persistent) - if (prio < 2 && (*itr)->GetSpellProto()->SpellVisual[0] == 99 && (*itr)->GetSpellProto()->SpellIconID == 92) + if (prio < 2 && (*itr)->GetSpellProto()->GetSpellVisual(0) == 99 && (*itr)->GetSpellProto()->Id == 92) { switch ((*itr)->GetId()) { @@ -26026,11 +26026,11 @@ float Player::GetCollisionHeight(bool mounted) const return GetCollisionHeight(false); } - CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId); - if (!mountModelData) - { - return GetCollisionHeight(false); - } + //CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId); + //if (!mountModelData) + //{ + // return GetCollisionHeight(false); + //} CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()); if (!displayInfo) @@ -26038,16 +26038,16 @@ float Player::GetCollisionHeight(bool mounted) const sLog.outError("GetCollisionHeight::Unable to find CreatureDisplayInfoEntry for %u", GetNativeDisplayId()); return 0; } - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); - if (!modelData) - { - sLog.outError("GetCollisionHeight::Unable to find CreatureModelDataEntry for %u", displayInfo->ModelId); - return 0; - } + //CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); + //if (!modelData) + //{ + // sLog.outError("GetCollisionHeight::Unable to find CreatureModelDataEntry for %u", displayInfo->ModelId); + // return 0; + //} - float scaleMod = GetObjectScale(); // 99% sure about this + //float scaleMod = GetObjectScale(); // 99% sure about this - return scaleMod * mountModelData->MountHeight + modelData->CollisionHeight * 0.5f; + //return scaleMod * mountModelData->MountHeight + modelData->CollisionHeight * 0.5f; } else { @@ -26058,14 +26058,15 @@ float Player::GetCollisionHeight(bool mounted) const sLog.outError("GetCollisionHeight::Unable to find CreatureDisplayInfoEntry for %u", GetNativeDisplayId()); return 0; } - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); - if (!modelData) - { - sLog.outError("GetCollisionHeight::Unable to find CreatureModelDataEntry for %u", displayInfo->ModelId); - return 0; - } + //CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); + //if (!modelData) + //{ + // sLog.outError("GetCollisionHeight::Unable to find CreatureModelDataEntry for %u", displayInfo->ModelId); + // return 0; + //} - return modelData->CollisionHeight; + //return modelData->CollisionHeight; + return 0; } } diff --git a/src/game/Object/SpellMgr.cpp b/src/game/Object/SpellMgr.cpp index 012bc7e73..f820e44a2 100644 --- a/src/game/Object/SpellMgr.cpp +++ b/src/game/Object/SpellMgr.cpp @@ -34,6 +34,7 @@ #include "BattleGround/BattleGroundMgr.h" #include "MapManager.h" #include "Unit.h" +#include "DB2Structure.h" bool IsPrimaryProfessionSkill(uint32 skill) { @@ -71,7 +72,7 @@ int32 GetSpellDuration(SpellEntry const* spellInfo) { return 0; } - SpellDurationEntry const* du = sSpellDurationStore.LookupEntry(spellInfo->DurationIndex); + SpellDurationEntry const* du = sSpellDurationStore.LookupEntry(spellInfo->GetDurationIndex()); if (!du) { return 0; @@ -85,7 +86,7 @@ int32 GetSpellMaxDuration(SpellEntry const* spellInfo) { return 0; } - SpellDurationEntry const* du = sSpellDurationStore.LookupEntry(spellInfo->DurationIndex); + SpellDurationEntry const* du = sSpellDurationStore.LookupEntry(spellInfo->GetDurationIndex()); if (!du) { return 0; @@ -149,7 +150,7 @@ uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell) else castTime = uint32(spellScalingEntry->castTimeMax); } - else if (SpellCastTimesEntry const* spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->CastingTimeIndex)) + else if (SpellCastTimesEntry const* spellCastTimeEntry = sSpellCastTimesStore.LookupEntry(spellInfo->GetCastingTimeIndex())) { if (spell) { @@ -540,7 +541,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) { // Well Fed buffs (must be exclusive with Food / Drink replenishment effects, or else Well Fed will cause them to be removed) // SpellIcon 2560 is Spell 46687, does not have this flag - if (spellInfo->HasAttribute(SPELL_ATTR_EX2_FOOD_BUFF) || spellInfo->SpellIconID == 2560) + if (spellInfo->HasAttribute(SPELL_ATTR_EX2_FOOD_BUFF) || spellInfo->GetSpellIconID() == 2560) { return SPELL_WELL_FED; } @@ -599,7 +600,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) // "Well Fed" buff from Blessed Sunfruit, Blessed Sunfruit Juice, Alterac Spring Water if (spellInfo->HasAttribute(SPELL_ATTR_CASTABLE_WHILE_SITTING) && (interrupts && interrupts->InterruptFlags & SPELL_INTERRUPT_FLAG_AUTOATTACK) && - (spellInfo->SpellIconID == 52 || spellInfo->SpellIconID == 79)) + (spellInfo->GetSpellIconID() == 52 || spellInfo->GetSpellIconID() == 79)) return SPELL_WELL_FED; break; } @@ -637,7 +638,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId) } // skip Heart of the Crusader that have also same spell family mask - if (spellInfo->IsFitToFamilyMask(UI64LIT(0x00000820180400)) && spellInfo->HasAttribute(SPELL_ATTR_EX3_UNK9) && (spellInfo->SpellIconID != 237)) + if (spellInfo->IsFitToFamilyMask(UI64LIT(0x00000820180400)) && spellInfo->HasAttribute(SPELL_ATTR_EX3_UNK9) && (spellInfo->GetSpellIconID() != 237)) { return SPELL_JUDGEMENT; } @@ -1181,7 +1182,7 @@ bool IsSingleTargetSpells(SpellEntry const* spellInfo1, SpellEntry const* spellI // TODO - need better check // Equal icon and spellfamily if( spellInfo1->GetSpellFamilyName() == spellInfo2->GetSpellFamilyName() && - spellInfo1->SpellIconID == spellInfo2->SpellIconID ) + spellInfo1->GetSpellIconID() == spellInfo2->GetSpellIconID() ) return true; SpellSpecific spec1 = GetSpellSpecific(spellInfo1->Id); @@ -1249,7 +1250,7 @@ SpellCastResult GetErrorAtShapeshiftedCast(SpellEntry const* spellInfo, uint32 f else { // needs shapeshift - if(!(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && shapeShift && shapeShift->Stances != 0) + if (!spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && shapeShift && shapeShift->Stances != 0) { return SPELL_FAILED_ONLY_SHAPESHIFT; } @@ -1532,8 +1533,52 @@ void SpellMgr::LoadSpellProcEvents() { mSpellProcEventMap.clear(); // need for reload case - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - QueryResult* result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMaskA0, SpellFamilyMaskA1, SpellFamilyMaskA2, SpellFamilyMaskB0, SpellFamilyMaskB1, SpellFamilyMaskB2, SpellFamilyMaskC0, SpellFamilyMaskC1, SpellFamilyMaskC2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); + // 0 1 2 + QueryResult* result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, " + // 3 4 5 + "SpellFamilyMaskA0, SpellFamilyMaskA1, SpellFamilyMaskA2, " + // 6 7 8 + "SpellFamilyMaskB0, SpellFamilyMaskB1, SpellFamilyMaskB2, " + // 9 10 11 + "SpellFamilyMaskC0, SpellFamilyMaskC1, SpellFamilyMaskC2, " + // 12 13 14 + "SpellFamilyMaskD0, SpellFamilyMaskD1, SpellFamilyMaskD2, " + // 15 16 17 + "SpellFamilyMaskE0, SpellFamilyMaskE1, SpellFamilyMaskE2, " + // 18 19 20 + "SpellFamilyMaskF0, SpellFamilyMaskF1, SpellFamilyMaskF2, " + // 21 22 23 + "SpellFamilyMaskG0, SpellFamilyMaskG1, SpellFamilyMaskG2, " + // 24 25 26 + "SpellFamilyMaskH0, SpellFamilyMaskH1, SpellFamilyMaskH2, " + // 27 28 29 + "SpellFamilyMaskI0, SpellFamilyMaskI1, SpellFamilyMaskI2, " + // 30 31 32 + "SpellFamilyMaskJ0, SpellFamilyMaskJ1, SpellFamilyMaskJ2, " + // 33 34 35 + "SpellFamilyMaskK0, SpellFamilyMaskK1, SpellFamilyMaskK2, " + // 36 37 38 + "SpellFamilyMaskL0, SpellFamilyMaskL1, SpellFamilyMaskL2, " + // 39 40 41 + "SpellFamilyMaskM0, SpellFamilyMaskM1, SpellFamilyMaskM2, " + // 42 43 44 + "SpellFamilyMaskN0, SpellFamilyMaskN1, SpellFamilyMaskN2, " + // 45 46 47 + "SpellFamilyMaskO0, SpellFamilyMaskO1, SpellFamilyMaskO2, " + // 48 49 50 + "SpellFamilyMaskP0, SpellFamilyMaskP1, SpellFamilyMaskP2, " + // 51 52 53 + "SpellFamilyMaskQ0, SpellFamilyMaskQ1, SpellFamilyMaskQ2, " + // 54 55 56 + "SpellFamilyMaskR0, SpellFamilyMaskR1, SpellFamilyMaskR2, " + // 57 58 59 + "SpellFamilyMaskS0, SpellFamilyMaskS1, SpellFamilyMaskS2, " + // 60 61 62 + "SpellFamilyMaskT0, SpellFamilyMaskT1, SpellFamilyMaskT2, " + // 63 64 65 + "SpellFamilyMaskU0, SpellFamilyMaskU1, SpellFamilyMaskU2, " + // 66 67 68 69 70 + "procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { BarGoLink bar(1); @@ -1565,11 +1610,11 @@ void SpellMgr::LoadSpellProcEvents() (uint64)fields[i + 3].GetUInt32() | ((uint64)fields[i + 6].GetUInt32() << 32), fields[i + 9].GetUInt32()); } - spe.procFlags = fields[12].GetUInt32(); - spe.procEx = fields[13].GetUInt32(); - spe.ppmRate = fields[14].GetFloat(); - spe.customChance = fields[15].GetFloat(); - spe.cooldown = fields[16].GetUInt32(); + spe.procFlags = fields[66].GetUInt32(); + spe.procEx = fields[67].GetUInt32(); + spe.ppmRate = fields[68].GetFloat(); + spe.customChance = fields[69].GetFloat(); + spe.cooldown = fields[70].GetUInt32(); rankHelper.RecordRank(spe, entry); } @@ -1909,7 +1954,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr else // For spells need check school/spell family/family mask { // Check (if set) for school - if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & procSpell->SchoolMask) == 0) + if (spellProcEvent->schoolMask && (spellProcEvent->schoolMask & procSpell->GetSchoolMask()) == 0) { return false; } @@ -2120,7 +2165,7 @@ bool SpellMgr::canStackSpellRanksInSpellBook(SpellEntry const* spellInfo) const { return false; } - if (spellInfo->powerType != POWER_MANA && spellInfo->powerType != POWER_HEALTH) + if (spellInfo->GetPowerType() != POWER_MANA && spellInfo->GetPowerType() != POWER_HEALTH) { return false; } @@ -2151,7 +2196,7 @@ bool SpellMgr::canStackSpellRanksInSpellBook(SpellEntry const* spellInfo) const } // Seal of Righteousness, 2 version of same rank SpellClassOptionsEntry const* classOptions = spellInfo->GetSpellClassOptions(); - if (classOptions && (classOptions->SpellFamilyFlags & UI64LIT(0x0000000008000000)) && spellInfo->SpellIconID == 25) + if (classOptions && (classOptions->SpellFamilyFlags & UI64LIT(0x0000000008000000)) && spellInfo->GetSpellIconID() == 25) { return false; } @@ -2186,6 +2231,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons SpellClassOptionsEntry const* classOptions1 = spellInfo_1->GetSpellClassOptions(); SpellClassOptionsEntry const* classOptions2 = spellInfo_2->GetSpellClassOptions(); + uint32 spellVisual_1 = spellInfo_1->GetSpellVisual(); + uint32 spellVisual_2 = spellInfo_2->GetSpellVisual(); + uint32 spellIconID_1 = spellInfo_1->GetSpellIconID(); + uint32 spellIconID_2 = spellInfo_2->GetSpellIconID(); // Resurrection sickness if ((spellInfo_1->Id == SPELL_ID_PASSIVE_RESURRECTION_SICKNESS) != (spellInfo_2->Id == SPELL_ID_PASSIVE_RESURRECTION_SICKNESS)) @@ -2218,25 +2267,25 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Soulstone Resurrection and Twisting Nether (resurrector) - if (spellInfo_1->SpellIconID == 92 && spellInfo_2->SpellIconID == 92 && ( - (spellInfo_1->SpellVisual[0] == 99 && spellInfo_2->SpellVisual[0] == 0) || - (spellInfo_2->SpellVisual[0] == 99 && spellInfo_1->SpellVisual[0] == 0))) + if (spellIconID_1 == 92 && spellIconID_2 == 92 && ( + (spellVisual_1 == 99 && spellVisual_2 == 0) || + (spellVisual_2 == 99 && spellVisual_1 == 0))) return false; // Heart of the Wild, Agility and various Idol Triggers - if (spellInfo_1->SpellIconID == 240 && spellInfo_2->SpellIconID == 240) + if (spellIconID_1 == 240 && spellIconID_2 == 240) { return false; } // Personalized Weather (thunder effect should overwrite rainy aura) - if (spellInfo_1->SpellIconID == 2606 && spellInfo_2->SpellIconID == 2606) + if (spellIconID_1 == 2606 && spellIconID_2 == 2606) { return false; } // Mirrored Soul (FoS - Devourer) - and other Boss spells - if (spellInfo_1->SpellIconID == 3176 && spellInfo_2->SpellIconID == 3176) + if (spellIconID_1 == 3176 && spellIconID_2 == 3176) { return false; } @@ -2277,19 +2326,19 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Blood Fury and Rage of the Unraveller - if (spellInfo_1->SpellIconID == 1662 && spellInfo_2->SpellIconID == 1662) + if (spellIconID_1 == 1662 && spellIconID_2 == 1662) { return false; } // Kindred Spirits - if (spellInfo_1->SpellIconID == 3559 && spellInfo_2->SpellIconID == 3559) + if (spellIconID_1 == 3559 && spellIconID_2 == 3559) { return false; } // Vigilance and Damage Reduction (Vigilance triggered spell) - if (spellInfo_1->SpellIconID == 2834 && spellInfo_2->SpellIconID == 2834) + if (spellIconID_1 == 2834 && spellIconID_2 == 2834) { return false; } @@ -2360,8 +2409,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Shard of Flame and Mote of Flame - if ((spellInfo_1->SpellIconID == 2302 && spellInfo_1->SpellVisual[0] == 0) || - (spellInfo_2->SpellIconID == 2302 && spellInfo_2->SpellVisual[0] == 0)) + if ((spellInfo_1->GetSpellIconID() == 2302 && spellInfo_1->GetSpellVisual() == 0) || + (spellInfo_2->GetSpellIconID() == 2302 && spellInfo_2->GetSpellVisual() == 0)) return false; // Felblaze Visual and Fog of Corruption @@ -2415,7 +2464,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Halls of Reflection Clone - if (spellInfo_1->SpellIconID == 692 && spellInfo_2->SpellIconID == 692) + if (spellInfo_1->Id == 692 && spellInfo_2->Id == 692) { return false; } @@ -2423,7 +2472,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } case SPELLFAMILY_MAGE: // Arcane Intellect and Insight - if (spellInfo_2->SpellIconID == 125 && spellInfo_1->Id == 18820) + if (spellIconID_2 == 125 && spellInfo_1->Id == 18820) { return false; } @@ -2431,7 +2480,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_WARRIOR: { // Scroll of Protection and Defensive Stance (multi-family check) - if (spellInfo_1->SpellIconID == 276 && spellInfo_1->SpellVisual[0] == 196 && spellInfo_2->Id == 71) + if (spellIconID_1 == 276 && spellVisual_1 == 196 && spellInfo_2->Id == 71) { return false; } @@ -2447,7 +2496,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_DRUID: { // Scroll of Stamina and Leader of the Pack (multi-family check) - if (spellInfo_1->SpellIconID == 312 && spellInfo_1->SpellVisual[0] == 216 && spellInfo_2->Id == 24932) + if (spellIconID_1 == 312 && spellVisual_1 == 216 && spellInfo_2->Id == 24932) { return false; } @@ -2463,7 +2512,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_ROGUE: { // Garrote-Silence -> Garrote (multi-family check) - if (spellInfo_1->SpellIconID == 498 && spellInfo_1->SpellVisual[0] == 0 && spellInfo_2->SpellIconID == 498) + if (spellIconID_1 == 498 && spellVisual_1 == 0 && spellIconID_2 == 498) { return false; } @@ -2488,13 +2537,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_PALADIN: { // Unstable Currents and other -> *Sanctity Aura (multi-family check) - if (spellInfo_2->SpellIconID == 502 && spellInfo_1->SpellIconID == 502 && spellInfo_1->SpellVisual[0] == 969) + if (spellIconID_2 == 502 && spellIconID_1 == 502 && spellVisual_1 == 969) { return false; } // *Band of Eternal Champion and Seal of Command(multi-family check) - if (spellId_1 == 35081 && spellInfo_2->SpellIconID == 561 && spellInfo_2->SpellVisual[0] == 7992) + if (spellId_1 == 35081 && spellIconID_2 == 561 && spellVisual_2 == 7992) { return false; } @@ -2509,7 +2558,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } } // Dragonmaw Illusion, Blood Elf Illusion, Human Illusion, Illidari Agent Illusion, Scarlet Crusade Disguise - if (spellInfo_1->SpellIconID == 1691 && spellInfo_2->SpellIconID == 1691) + if (spellIconID_1 == 1691 && spellIconID_2 == 1691) { return false; } @@ -2523,12 +2572,12 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Blink & Improved Blink - if (classOptions1 && (classOptions1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) || - (classOptions2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) ) + if (classOptions1 && (classOptions1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellVisual_2 == 72 && spellIconID_2 == 1499) || + (classOptions2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellVisual_1 == 72 && spellIconID_1 == 1499) ) return false; // Fingers of Frost effects - if (spellInfo_1->SpellIconID == 2947 && spellInfo_2->SpellIconID == 2947) + if (spellIconID_1 == 2947 && spellIconID_2 == 2947) { return false; } @@ -2544,19 +2593,19 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; } // Detect Invisibility and Mana Shield (multi-family check) - if (spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968) + if (spellInfo_2->Id == 132 && spellIconID_1 == 209 && spellVisual_1 == 968) { return false; } // Combustion and Fire Protection Aura (multi-family check) - if (spellInfo_1->Id == 11129 && spellInfo_2->SpellIconID == 33 && spellInfo_2->SpellVisual[0] == 321) + if (spellInfo_1->Id == 11129 && spellIconID_2 == 33 && spellVisual_2 == 321) { return false; } // Arcane Intellect and Insight - if (spellInfo_1->SpellIconID == 125 && spellInfo_2->Id == 18820) + if (spellIconID_1 == 125 && spellInfo_2->Id == 18820) { return false; } @@ -2566,44 +2615,44 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if( classOptions2 && classOptions2->SpellFamilyName == SPELLFAMILY_WARLOCK ) { // Siphon Life and Drain Life - if ((spellInfo_1->SpellIconID == 152 && spellInfo_2->SpellIconID == 546) || - (spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546)) + if ((spellIconID_1 == 152 && spellIconID_2 == 546) || + (spellIconID_2 == 152 && spellIconID_1 == 546)) return false; // Corruption & Seed of corruption - if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932) || - (spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932)) - if (spellInfo_1->SpellVisual[0] != 0 && spellInfo_2->SpellVisual[0] != 0) + if ((spellIconID_1 == 313 && spellIconID_2 == 1932) || + (spellIconID_2 == 313 && spellIconID_1 == 1932)) + if (spellVisual_1 != 0 && spellVisual_2 != 0) return true; // can't be stacked // Corruption and Unstable Affliction - if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 2039) || - (spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 2039)) + if ((spellIconID_1 == 313 && spellIconID_2 == 2039) || + (spellIconID_2 == 313 && spellIconID_1 == 2039)) return false; // (Corruption or Unstable Affliction) and (Curse of Agony or Curse of Doom) - if (((spellInfo_1->SpellIconID == 313 || spellInfo_1->SpellIconID == 2039) && (spellInfo_2->SpellIconID == 544 || spellInfo_2->SpellIconID == 91)) || - ((spellInfo_2->SpellIconID == 313 || spellInfo_2->SpellIconID == 2039) && (spellInfo_1->SpellIconID == 544 || spellInfo_1->SpellIconID == 91))) + if (((spellIconID_1 == 313 || spellIconID_1 == 2039) && (spellIconID_2 == 544 || spellIconID_2 == 91)) || + ((spellIconID_2 == 313 || spellIconID_2 == 2039) && (spellIconID_1 == 544 || spellIconID_1 == 91))) return false; // Shadowflame and Curse of Agony - if ((spellInfo_1->SpellIconID == 544 && spellInfo_2->SpellIconID == 3317) || - (spellInfo_2->SpellIconID == 544 && spellInfo_1->SpellIconID == 3317)) + if ((spellIconID_1 == 544 && spellIconID_2 == 3317) || + (spellIconID_2 == 544 && spellIconID_1 == 3317)) return false; // Shadowflame and Curse of Doom - if ((spellInfo_1->SpellIconID == 91 && spellInfo_2->SpellIconID == 3317) || - (spellInfo_2->SpellIconID == 91 && spellInfo_1->SpellIconID == 3317)) + if ((spellIconID_1 == 91 && spellIconID_2 == 3317) || + (spellIconID_2 == 91 && spellIconID_1 == 3317)) return false; // Metamorphosis, diff effects - if (spellInfo_1->SpellIconID == 3314 && spellInfo_2->SpellIconID == 3314) + if (spellIconID_1 == 3314 && spellIconID_2 == 3314) { return false; } } // Detect Invisibility and Mana Shield (multi-family check) - if (spellInfo_1->Id == 132 && spellInfo_2->SpellIconID == 209 && spellInfo_2->SpellVisual[0] == 968) + if (spellInfo_1->Id == 132 && spellIconID_2 == 209 && spellVisual_2 == 968) { return false; } @@ -2617,13 +2666,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Battle Shout and Rampage - if ((spellInfo_1->SpellIconID == 456 && spellInfo_2->SpellIconID == 2006) || - (spellInfo_2->SpellIconID == 456 && spellInfo_1->SpellIconID == 2006)) + if ((spellIconID_1 == 456 && spellIconID_2 == 2006) || + (spellIconID_2 == 456 && spellIconID_1 == 2006)) return false; // Glyph of Revenge (triggered), and Sword and Board (triggered) - if ((spellInfo_1->SpellIconID == 856 && spellInfo_2->SpellIconID == 2780) || - (spellInfo_2->SpellIconID == 856 && spellInfo_1->SpellIconID == 2780)) + if ((spellIconID_1 == 856 && spellIconID_2 == 2780) || + (spellIconID_2 == 856 && spellIconID_1 == 2780)) return false; // Defensive/Berserker/Battle stance aura can not stack (needed for dummy auras) @@ -2639,13 +2688,13 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } // Defensive Stance and Scroll of Protection (multi-family check) - if (spellInfo_1->Id == 71 && spellInfo_2->SpellIconID == 276 && spellInfo_2->SpellVisual[0] == 196) + if (spellInfo_1->Id == 71 && spellIconID_2 == 276 && spellVisual_2 == 196) { return false; } // Bloodlust and Bloodthirst (multi-family check) - if (spellInfo_2->Id == 2825 && spellInfo_1->SpellIconID == 38 && spellInfo_1->SpellVisual[0] == 0) + if (spellInfo_2->Id == 2825 && spellIconID_1 == 38 && spellVisual_1 == 0) { return false; } @@ -2674,8 +2723,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if (classOptions2 && classOptions2->SpellFamilyName == SPELLFAMILY_DRUID ) { //Omen of Clarity and Blood Frenzy - if ((classOptions1 && (classOptions1->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_1->SpellIconID == 108) && (classOptions2->SpellFamilyFlags & UI64LIT(0x20000000000000))) || - ((classOptions2->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_2->SpellIconID == 108) && (classOptions1->SpellFamilyFlags & UI64LIT(0x20000000000000)))) + if ((classOptions1 && (classOptions1->SpellFamilyFlags == UI64LIT(0x0) && spellIconID_1 == 108) && (classOptions2->SpellFamilyFlags & UI64LIT(0x20000000000000))) || + ((classOptions2->SpellFamilyFlags == UI64LIT(0x0) && spellIconID_2 == 108) && (classOptions1->SpellFamilyFlags & UI64LIT(0x20000000000000)))) return false; // Tree of Life (Shapeshift) and 34123 Tree of Life (Passive) @@ -2684,12 +2733,12 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Lifebloom and Wild Growth - if ((spellInfo_1->SpellIconID == 2101 && spellInfo_2->SpellIconID == 2864) || - (spellInfo_2->SpellIconID == 2101 && spellInfo_1->SpellIconID == 2864)) + if ((spellIconID_1 == 2101 && spellIconID_2 == 2864) || + (spellIconID_2 == 2101 && spellIconID_1 == 2864)) return false; // Innervate and Glyph of Innervate and some other spells - if (spellInfo_1->SpellIconID == 62 && spellInfo_2->SpellIconID == 62) + if (spellIconID_1 == 62 && spellIconID_2 == 62) { return false; } @@ -2715,7 +2764,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Savage Roar and Savage Roar (triggered) - if (spellInfo_1->SpellIconID == 2865 && spellInfo_2->SpellIconID == 2865) + if (spellIconID_1 == 2865 && spellIconID_2 == 2865) { return false; } @@ -2727,7 +2776,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } // Leader of the Pack and Scroll of Stamina (multi-family check) - if (spellInfo_1->Id == 24932 && spellInfo_2->SpellIconID == 312 && spellInfo_2->SpellVisual[0] == 216) + if (spellInfo_1->Id == 24932 && spellIconID_2 == 312 && spellVisual_2 == 216) { return false; } @@ -2748,20 +2797,20 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Sprint & Sprint (waterwalk) - if (spellInfo_1->SpellIconID == 516 && spellInfo_2->SpellIconID == 516 && + if (spellIconID_1 == 516 && spellIconID_2 == 516 && ((spellInfo_1->GetCategory() == 44 && spellInfo_2->GetCategory() == 0) || (spellInfo_2->GetCategory() == 44 && spellInfo_1->GetCategory() == 0))) return false; } // Overkill - if (spellInfo_1->SpellIconID == 2285 && spellInfo_2->SpellIconID == 2285) + if (spellIconID_1 == 2285 && spellIconID_2 == 2285) { return false; } // Garrote -> Garrote-Silence (multi-family check) - if (spellInfo_1->SpellIconID == 498 && spellInfo_2->SpellIconID == 498 && spellInfo_2->SpellVisual[0] == 0) + if (spellIconID_1 == 498 && spellIconID_2 == 498 && spellVisual_2 == 0) { return false; } @@ -2780,19 +2829,19 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; // Deterrence - if (spellInfo_1->SpellIconID == 83 && spellInfo_2->SpellIconID == 83) + if (spellIconID_1 == 83 && spellIconID_2 == 83) { return false; } // Bestial Wrath - if (spellInfo_1->SpellIconID == 1680 && spellInfo_2->SpellIconID == 1680) + if (spellIconID_1 == 1680 && spellIconID_2 == 1680) { return false; } // Aspect of the Viper & Vicious Viper - if (spellInfo_1->SpellIconID == 2227 && spellInfo_2->SpellIconID == 2227) + if (spellIconID_1 == 2227 && spellIconID_2 == 2227) { return false; } @@ -2820,37 +2869,37 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } // Swift Retribution / Improved Devotion Aura (talents) and Paladin Auras - if ((spellInfo_1->IsFitToFamilyMask(UI64LIT(0x0), 0x00000020) && (spellInfo_2->SpellIconID == 291 || spellInfo_2->SpellIconID == 3028)) || - (spellInfo_2->IsFitToFamilyMask(UI64LIT(0x0), 0x00000020) && (spellInfo_1->SpellIconID == 291 || spellInfo_1->SpellIconID == 3028))) + if ((spellInfo_1->IsFitToFamilyMask(UI64LIT(0x0), 0x00000020) && (spellIconID_2 == 291 || spellIconID_2 == 3028)) || + (spellInfo_2->IsFitToFamilyMask(UI64LIT(0x0), 0x00000020) && (spellIconID_1 == 291 || spellIconID_1 == 3028))) return false; // Beacon of Light and Light's Beacon - if ((spellInfo_1->SpellIconID == 3032) && (spellInfo_2->SpellIconID == 3032)) + if ((spellIconID_1 == 3032) && (spellIconID_2 == 3032)) { return false; } // Concentration Aura and Improved Concentration Aura and Aura Mastery - if ((spellInfo_1->SpellIconID == 1487) && (spellInfo_2->SpellIconID == 1487)) + if ((spellIconID_1 == 1487) && (spellIconID_2 == 1487)) { return false; } // Seal of Corruption (caster/target parts stacking allow, other stacking checked by spell specs) - if (spellInfo_1->SpellIconID == 2292 && spellInfo_2->SpellIconID == 2292) + if (spellIconID_1 == 2292 && spellIconID_2 == 2292) { return false; } // Divine Sacrifice and Divine Guardian - if (spellInfo_1->SpellIconID == 3837 && spellInfo_2->SpellIconID == 3837) + if (spellIconID_1 == 3837 && spellIconID_2 == 3837) { return false; } // Blood Corruption, Holy Vengeance, Righteous Vengeance - if ((spellInfo_1->SpellIconID == 2292 && spellInfo_2->SpellIconID == 3025) || - (spellInfo_2->SpellIconID == 2292 && spellInfo_1->SpellIconID == 3025)) + if ((spellIconID_1 == 2292 && spellIconID_2 == 3025) || + (spellIconID_2 == 2292 && spellIconID_1 == 3025)) return false; } @@ -2861,19 +2910,19 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } // Combustion and Fire Protection Aura (multi-family check) - if (spellInfo_2->Id == 11129 && spellInfo_1->SpellIconID == 33 && spellInfo_1->SpellVisual[0] == 321) + if (spellInfo_2->Id == 11129 && spellIconID_1 == 33 && spellVisual_1 == 321) { return false; } // *Sanctity Aura -> Unstable Currents and other (multi-family check) - if (spellInfo_1->SpellIconID==502 && classOptions2->SpellFamilyName == SPELLFAMILY_GENERIC && spellInfo_2->SpellIconID==502 && spellInfo_2->SpellVisual[0]==969 ) + if (spellIconID_1==502 && classOptions2->SpellFamilyName == SPELLFAMILY_GENERIC && spellIconID_2==502 && spellVisual_2==969 ) { return false; } // *Seal of Command and Band of Eternal Champion (multi-family check) - if (spellInfo_1->SpellIconID == 561 && spellInfo_1->SpellVisual[0] == 7992 && spellId_2 == 35081) + if (spellIconID_1 == 561 && spellVisual_1 == 7992 && spellId_2 == 35081) { return false; } @@ -2882,24 +2931,24 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if (classOptions2 && classOptions2->SpellFamilyName == SPELLFAMILY_SHAMAN ) { // Windfury weapon - if (spellInfo_1->SpellIconID==220 && spellInfo_2->SpellIconID==220 && + if (spellIconID_1==220 && spellIconID_2==220 && !classOptions1->IsFitToFamilyMask(classOptions2->SpellFamilyFlags)) return false; // Ghost Wolf - if (spellInfo_1->SpellIconID == 67 && spellInfo_2->SpellIconID == 67) + if (spellIconID_1 == 67 && spellIconID_2 == 67) { return false; } // Totem of Wrath (positive/negative), ranks checked early - if (spellInfo_1->SpellIconID == 2019 && spellInfo_2->SpellIconID == 2019) + if (spellIconID_1 == 2019 && spellIconID_2 == 2019) { return false; } } // Bloodlust and Bloodthirst (multi-family check) - if (spellInfo_1->Id == 2825 && spellInfo_2->SpellIconID == 38 && spellInfo_2->SpellVisual[0] == 0) + if (spellInfo_1->Id == 2825 && spellIconID_2 == 38 && spellVisual_2 == 0) { return false; } @@ -2908,25 +2957,25 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if (classOptions2 && classOptions2->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT) { // Lichborne and Lichborne (triggered) - if (spellInfo_1->SpellIconID == 61 && spellInfo_2->SpellIconID == 61) + if (spellIconID_1 == 61 && spellIconID_2 == 61) { return false; } // Frost Presence and Frost Presence (triggered) - if (spellInfo_1->SpellIconID == 2632 && spellInfo_2->SpellIconID == 2632) + if (spellIconID_1 == 2632 && spellIconID_2 == 2632) { return false; } // Unholy Presence and Unholy Presence (triggered) - if (spellInfo_1->SpellIconID == 2633 && spellInfo_2->SpellIconID == 2633) + if (spellIconID_1 == 2633 && spellIconID_2 == 2633) { return false; } // Blood Presence and Blood Presence (triggered) - if (spellInfo_1->SpellIconID == 2636 && spellInfo_2->SpellIconID == 2636) + if (spellIconID_1 == 2636 && spellIconID_2 == 2636) { return false; } @@ -2937,8 +2986,8 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons } // more generic checks - if (spellInfo_1->SpellIconID == spellInfo_2->SpellIconID && - spellInfo_1->SpellIconID != 0 && spellInfo_2->SpellIconID != 0) + if (spellIconID_1 == spellIconID_2 && + spellIconID_1 != 0 && spellIconID_2 != 0) { bool isModifier = false; for (int i = 0; i < MAX_EFFECT_INDEX; ++i) @@ -4840,15 +4889,15 @@ void SpellMgr::CheckUsedSpells(char const* table) } } - if (spellIcon >= 0 && spellEntry->SpellIconID != uint32(spellIcon)) + if (spellIcon >= 0 && spellEntry->GetSpellIconID() != uint32(spellIcon)) { - sLog.outError("Spell %u '%s' icon(%u) <> %u but used in %s.", spell, name.c_str(), spellEntry->SpellIconID, spellIcon, code.c_str()); + sLog.outError("Spell %u '%s' icon(%u) <> %u but used in %s.", spell, name.c_str(), spellEntry->GetSpellIconID(), spellIcon, code.c_str()); continue; } - if (spellVisual >= 0 && spellEntry->SpellVisual[0] != uint32(spellVisual)) + if (spellVisual >= 0 && spellEntry->GetSpellVisual() != uint32(spellVisual)) { - sLog.outError("Spell %u '%s' visual(%u) <> %u but used in %s.", spell, name.c_str(), spellEntry->SpellVisual[0], spellVisual, code.c_str()); + sLog.outError("Spell %u '%s' visual(%u) <> %u but used in %s.", spell, name.c_str(), spellEntry->GetSpellVisual(), spellVisual, code.c_str()); continue; } @@ -4919,10 +4968,10 @@ void SpellMgr::CheckUsedSpells(char const* table) } } - if (spellIcon >= 0 && spellEntry->SpellIconID != uint32(spellIcon)) + if (spellIcon >= 0 && spellEntry->GetSpellIconID() != uint32(spellIcon)) continue; - if (spellVisual >= 0 && spellEntry->SpellVisual[0] != uint32(spellVisual)) + if (spellVisual >= 0 && spellEntry->GetSpellVisual() != uint32(spellVisual)) continue; if(category >= 0 && spellEntry->GetCategory() != uint32(category)) @@ -4987,7 +5036,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto break; case SPELLFAMILY_MAGE: // Dragon's Breath - if (spellproto->SpellIconID == 1548) + if (spellproto->GetSpellIconID() == 1548) { return DIMINISHING_DISORIENT; } @@ -5005,7 +5054,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto return DIMINISHING_CHEAPSHOT_POUNCE; } // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) - else if (spellproto->SpellIconID == 163) + else if (spellproto->GetSpellIconID() == 163) { return DIMINISHING_LIMITONLY; } @@ -5014,7 +5063,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto case SPELLFAMILY_HUNTER: { // Freezing Trap & Freezing Arrow & Wyvern Sting - if (spellproto->SpellIconID == 180 || spellproto->SpellIconID == 1721) + if (spellproto->GetSpellIconID() == 180 || spellproto->GetSpellIconID() == 1721) { return DIMINISHING_DISORIENT; } @@ -5070,7 +5119,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto case SPELLFAMILY_PRIEST: { // Shackle Undead - if (spellproto->SpellIconID == 27) + if (spellproto->GetSpellIconID() == 27) { return DIMINISHING_DISORIENT; } @@ -5079,7 +5128,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto case SPELLFAMILY_DEATHKNIGHT: { // Hungering Cold (no flags) - if (spellproto->SpellIconID == 2797) + if (spellproto->GetSpellIconID() == 2797) { return DIMINISHING_DISORIENT; } diff --git a/src/game/Object/SpellMgr.h b/src/game/Object/SpellMgr.h index ec7fcbe9a..9f287687a 100644 --- a/src/game/Object/SpellMgr.h +++ b/src/game/Object/SpellMgr.h @@ -603,7 +603,7 @@ inline bool IsNeedCastSpellAtFormApply(SpellEntry const* spellInfo, ShapeshiftFo } // passive spells with SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT are already active without shapeshift, do no recast! - return (shapeShift->Stances & (1<<(form-1)) && !(spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)); + return (shapeShift->Stances & (1<<(form-1)) && !spellInfo->HasAttribute(SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT)); } inline bool IsNeedCastSpellAtOutdoor(SpellEntry const* spellInfo) @@ -618,7 +618,7 @@ inline bool NeedsComboPoints(SpellEntry const* spellInfo) inline SpellSchoolMask GetSpellSchoolMask(SpellEntry const* spellInfo) { - return SpellSchoolMask(spellInfo->SchoolMask); + return SpellSchoolMask(spellInfo->GetSchoolMask()); } inline uint32 GetSpellMechanicMask(SpellEntry const* spellInfo, uint32 effectMask) diff --git a/src/game/Object/Totem.cpp b/src/game/Object/Totem.cpp index 01784cb07..32bbdacac 100644 --- a/src/game/Object/Totem.cpp +++ b/src/game/Object/Totem.cpp @@ -197,7 +197,7 @@ void Totem::SetTypeBySummonSpell(SpellEntry const* spellProto) if (GetSpellCastTime(totemSpell)) m_type = TOTEM_ACTIVE; } - if (spellProto->SpellIconID == 2056) + if (spellProto->Id == 2056) m_type = TOTEM_STATUE; // Jewelery statue } diff --git a/src/game/Object/TotemAI.cpp b/src/game/Object/TotemAI.cpp index 2f80bda07..9e53f322d 100644 --- a/src/game/Object/TotemAI.cpp +++ b/src/game/Object/TotemAI.cpp @@ -78,7 +78,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) } // Get spell rangy - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->GetRangeIndex()); float max_range = GetSpellMaxRange(srange); // SPELLMOD_RANGE not applied in this place just because nonexistent range mods for attacking totems diff --git a/src/game/Object/Unit.cpp b/src/game/Object/Unit.cpp index 83e48976a..ec668072d 100644 --- a/src/game/Object/Unit.cpp +++ b/src/game/Object/Unit.cpp @@ -149,7 +149,7 @@ void MovementInfo::Read(ByteBuffer& data, uint16 opcode) break; case MSEFlags2: if (hasMovementFlags2) - moveFlags2 = data.ReadBits(12); + moveFlags2 = data.ReadBits(13); break; case MSEHasUnknownBit: data.ReadBit(); @@ -342,7 +342,7 @@ void MovementInfo::Write(ByteBuffer& data, uint16 opcode) const break; case MSEFlags2: if (moveFlags2) - data.WriteBits(moveFlags2, 12); + data.WriteBits(moveFlags2, 13); break; case MSETimestamp: if (si.hasTimeStamp) @@ -1120,7 +1120,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa AuraList const& vDummyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY); for (AuraList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr) { - if ((*itr)->GetSpellProto()->SpellIconID == 1654) + if ((*itr)->GetSpellProto()->GetSpellIconID() == 1654) { spiritOfRedemtionTalentReady = *itr; break; @@ -1814,7 +1814,7 @@ void Unit::CastSpell(float x, float y, float z, SpellEntry const* spellInfo, boo uint32 Unit::SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellID); - SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchoolMask(spellInfo->SchoolMask)); + SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchoolMask(spellInfo->GetSchoolMask())); CalculateSpellDamage(&damageInfo, damage, spellInfo); damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); @@ -2385,7 +2385,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) data << uint32(i_spellProto->Id); data << uint32(damage); // Damage data << uint32(overkill); // Overkill - data << uint32(i_spellProto->SchoolMask); + data << uint32(i_spellProto->GetSchoolMask()); data << uint32(0); // FIXME: Resist pVictim->SendMessageToSet(&data, true); @@ -2605,7 +2605,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM { SpellEntry const* itr_spellProto = (*itr)->GetSpellProto(); // Frost Warding (chance full absorb) - if (itr_spellProto->GetSpellFamilyName() == SPELLFAMILY_MAGE && itr_spellProto->SpellIconID == 501) + if (itr_spellProto->GetSpellFamilyName() == SPELLFAMILY_MAGE && itr_spellProto->GetSpellIconID() == 501) { // chance stored in next dummy effect chance = itr_spellProto->CalculateSimpleValue(EFFECT_INDEX_1); @@ -2659,7 +2659,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_GENERIC: { // Astral Shift - if (spellProto->SpellIconID == 3066) + if (spellProto->GetSpellIconID() == 3066) { // reduces all damage taken while stun, fear or silence if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) @@ -2667,7 +2667,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM continue; } // Nerves of Steel - if (spellProto->SpellIconID == 2115) + if (spellProto->GetSpellIconID() == 2115) { // while affected by Stun and Fear if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING)) @@ -2675,7 +2675,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM continue; } // Spell Deflection - if (spellProto->SpellIconID == 3006) + if (spellProto->GetSpellIconID() == 3006) { // You have a chance equal to your Parry chance if (damagetype == SPELL_DIRECT_DAMAGE &&// Only for direct spell damage @@ -2709,7 +2709,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_DRUID: { // Primal Tenacity - if (spellProto->SpellIconID == 2253) + if (spellProto->GetSpellIconID() == 2253) { // reduces all damage taken while Stunned and in Cat Form if (GetShapeshiftForm() == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED)) @@ -2729,7 +2729,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_ROGUE: { // Cheat Death (make less prio with Guardian Spirit case) - if (spellProto->SpellIconID == 2109) + if (spellProto->GetSpellIconID() == 2109) { if (!preventDeathSpell && GetTypeId() == TYPEID_PLAYER && // Only players @@ -2748,7 +2748,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_PRIEST: { // Guardian Spirit - if (spellProto->SpellIconID == 2873) + if (spellProto->GetSpellIconID() == 2873) { preventDeathSpell = (*i)->GetSpellProto(); preventDeathAmount = (*i)->GetModifier()->m_amount; @@ -2788,7 +2788,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_SHAMAN: { // Astral Shift - if (spellProto->SpellIconID == 3066) + if (spellProto->GetSpellIconID() == 3066) { // reduces all damage taken while stun, fear or silence if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) @@ -2800,7 +2800,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_DEATHKNIGHT: { // Shadow of Death - if (spellProto->SpellIconID == 1958) + if (spellProto->GetSpellIconID() == 1958) { // TODO: absorb only while transform continue; @@ -2964,7 +2964,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM // Incanter's Absorption if (itr_spellProto->GetSpellFamilyName() == SPELLFAMILY_GENERIC && - itr_spellProto->SpellIconID == 2941) + itr_spellProto->GetSpellIconID() == 2941) { int32 amount = int32(incanterAbsorption * (*itr)->GetModifier()->m_amount / 100); @@ -3019,7 +3019,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_ROGUE: { // Cheat Death - if (preventDeathSpell->SpellIconID == 2109) + if (preventDeathSpell->GetSpellIconID() == 2109) { CastSpell(this, 31231, true); ((Player*)this)->AddSpellCooldown(31231, 0, time(NULL) + 60); @@ -3033,7 +3033,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM case SPELLFAMILY_PRIEST: { // Guardian Spirit - if (preventDeathSpell->SpellIconID == 2873) + if (preventDeathSpell->GetSpellIconID() == 2873) { int32 healAmount = GetMaxHealth() * preventDeathAmount / 100; CastCustomSpell(this, 48153, &healAmount, NULL, NULL, true); @@ -5282,10 +5282,11 @@ void Unit::RemoveAuraHolderFromStack(uint32 spellId, uint32 stackAmount, ObjectG void Unit::RemoveAurasDueToSpell(uint32 spellId, SpellAuraHolder* except, AuraRemoveMode mode) { - SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); - if (spellEntry && spellEntry->SpellDifficultyId && IsInWorld() && GetMap()->IsDungeon()) - if (SpellEntry const* spellDiffEntry = GetSpellEntryByDifficulty(spellEntry->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) - spellId = spellDiffEntry->Id; + // FIXME + //SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); + //if (spellEntry && spellEntry->SpellDifficultyId && IsInWorld() && GetMap()->IsDungeon()) + // if (SpellEntry const* spellDiffEntry = GetSpellEntryByDifficulty(spellEntry->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) + // spellId = spellDiffEntry->Id; SpellAuraHolderBounds bounds = GetSpellAuraHolderBounds(spellId); for (SpellAuraHolderMap::iterator iter = bounds.first; iter != bounds.second;) @@ -5763,10 +5764,11 @@ bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const bool Unit::HasAuraOfDifficulty(uint32 spellId) const { - SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); - if (spellEntry && spellEntry->SpellDifficultyId && IsInWorld() && GetMap()->IsDungeon()) - if (SpellEntry const* spellDiffEntry = GetSpellEntryByDifficulty(spellEntry->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) - spellId = spellDiffEntry->Id; + // FIXME + //SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); + //if (spellEntry && spellEntry->SpellDifficultyId && IsInWorld() && GetMap()->IsDungeon()) + // if (SpellEntry const* spellDiffEntry = GetSpellEntryByDifficulty(spellEntry->SpellDifficultyId, GetMap()->GetDifficulty(), GetMap()->IsRaid())) + // spellId = spellDiffEntry->Id; return m_spellAuraHolders.find(spellId) != m_spellAuraHolders.end(); } @@ -7439,7 +7441,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u case 7277: { // Merciless Combat - if ((*i)->GetSpellProto()->SpellIconID == 2656) + if ((*i)->GetSpellProto()->GetSpellIconID() == 2656) { if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) DoneTotalMod *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f; @@ -7488,7 +7490,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u case SPELLFAMILY_MAGE: { // Ice Lance - if (spellProto->SpellIconID == 186) + if (spellProto->GetSpellIconID() == 186) { if (pVictim->IsFrozen() || IsIgnoreUnitState(spellProto, IGNORE_UNIT_TARGET_NON_FROZEN)) { @@ -7511,7 +7513,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u Unit::AuraList const& ttw = GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = ttw.begin(); i != ttw.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 3263) + if ((*i)->GetSpellProto()->GetSpellIconID() == 3263) { DoneTotalMod *= ((*i)->GetModifier()->m_amount + 100.0f) / 100.0f; break; @@ -7566,7 +7568,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) { - if ((*iter)->GetSpellProto()->SpellIconID == 1771) + if ((*iter)->GetSpellProto()->GetSpellIconID() == 1771) { DoneTotalMod *= ((*iter)->GetModifier()->m_amount + 100.0f) / 100.0f; break; @@ -7648,7 +7650,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* pCaster, SpellEntry const* spellProto, return pdamage; } - uint32 schoolMask = spellProto->SchoolMask; + uint32 schoolMask = spellProto->GetSchoolMask(); // Taken total percent damage auras float TakenTotalMod = 1.0f; @@ -7883,7 +7885,7 @@ bool Unit::IsSpellCrit(Unit* pVictim, SpellEntry const* spellProto, SpellSchoolM case SPELLFAMILY_MAGE: { // Fire Blast - if (spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000002)) && spellProto->SpellIconID == 12) + if (spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000002)) && spellProto->GetSpellIconID() == 12) { // Glyph of Fire Blast if (pVictim->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) || pVictim->IsInRoots()) @@ -7903,7 +7905,7 @@ bool Unit::IsSpellCrit(Unit* pVictim, SpellEntry const* spellProto, SpellSchoolM { // Improved Flash Heal if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_PRIEST && - (*i)->GetSpellProto()->SpellIconID == 2542) + (*i)->GetSpellProto()->GetSpellIconID() == 2542) { crit_chance += (*i)->GetModifier()->m_amount; break; @@ -7921,7 +7923,7 @@ bool Unit::IsSpellCrit(Unit* pVictim, SpellEntry const* spellProto, SpellSchoolM Unit::AuraList const& improvedSwarm = GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator iter = improvedSwarm.begin(); iter != improvedSwarm.end(); ++iter) { - if ((*iter)->GetSpellProto()->SpellIconID == 1771) + if ((*iter)->GetSpellProto()->GetSpellIconID() == 1771) { crit_chance += (*iter)->GetModifier()->m_amount; break; @@ -8453,7 +8455,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* pVictim, uint32 pdamage, WeaponAttackTyp bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE))); Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType, true, false) : NULL; uint32 creatureTypeMask = pVictim->GetCreatureTypeMask(); - uint32 schoolMask = spellProto ? spellProto->SchoolMask : uint32(GetMeleeDamageSchoolMask()); + uint32 schoolMask = spellProto ? spellProto->GetSchoolMask() : uint32(GetMeleeDamageSchoolMask()); // FLAT damage bonus auras // ======================= @@ -8557,7 +8559,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* pVictim, uint32 pdamage, WeaponAttackTyp case 7277: { // Merciless Combat - if ((*i)->GetSpellProto()->SpellIconID == 2656) + if ((*i)->GetSpellProto()->GetSpellIconID() == 2656) { if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) DonePercent *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f; @@ -8726,7 +8728,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* pCaster, uint32 pdamage, WeaponAttackTy // differentiate for weapon damage based spells bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE))); - uint32 schoolMask = spellProto ? spellProto->SchoolMask : uint32(GetMeleeDamageSchoolMask()); + uint32 schoolMask = spellProto ? spellProto->GetSchoolMask() : uint32(GetMeleeDamageSchoolMask()); uint32 mechanicMask = spellProto ? GetAllSpellMechanicMask(spellProto) : 0; // Shred also have bonus as MECHANIC_BLEED damages @@ -10525,7 +10527,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt } } - if (!gtScalingEntry && spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellLevel && + if (!gtScalingEntry && spellProto->HasAttribute(SPELL_ATTR_LEVEL_DAMAGE_CALCULATION) && spellLevel && spellEffect->Effect != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && spellEffect->Effect != SPELL_EFFECT_KNOCK_BACK && (spellEffect->Effect != SPELL_EFFECT_APPLY_AURA || spellEffect->EffectApplyAuraName != SPELL_AURA_MOD_DECREASE_SPEED)) @@ -10580,7 +10582,7 @@ int32 Unit::CalculateAuraDuration(SpellEntry const* spellProto, uint32 effectMas { case SPELLFAMILY_DRUID: // Thorns - if (spellProto->SpellIconID == 53 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000100))) + if (spellProto->GetSpellIconID() == 53 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000100))) { // Glyph of Thorns if (Aura* aur = GetAura(57862, EFFECT_INDEX_0)) @@ -10589,14 +10591,14 @@ int32 Unit::CalculateAuraDuration(SpellEntry const* spellProto, uint32 effectMas break; case SPELLFAMILY_PALADIN: // Blessing of Might - if (spellProto->SpellIconID == 298 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000002))) + if (spellProto->GetSpellIconID() == 298 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000000002))) { // Glyph of Blessing of Might if (Aura* aur = GetAura(57958, EFFECT_INDEX_0)) duration += aur->GetModifier()->m_amount * MINUTE * IN_MILLISECONDS; } // Blessing of Wisdom - else if (spellProto->SpellIconID == 306 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000010000))) + else if (spellProto->GetSpellIconID() == 306 && spellProto->IsFitToFamilyMask(UI64LIT(0x0000000000010000))) { // Glyph of Blessing of Wisdom if (Aura* aur = GetAura(57979, EFFECT_INDEX_0)) diff --git a/src/game/Object/Vehicle.cpp b/src/game/Object/Vehicle.cpp index a751728fc..5bf3593c3 100644 --- a/src/game/Object/Vehicle.cpp +++ b/src/game/Object/Vehicle.cpp @@ -165,12 +165,12 @@ void VehicleInfo::Initialize() if (vehicleFlags & VEHICLE_FLAG_FIXED_POSITION) pVehicle->SetRoot(true); - // Initialize power type based on DBC values (creatures only) - if (pVehicle->GetTypeId() == TYPEID_UNIT) - { - if (PowerDisplayEntry const* powerEntry = sPowerDisplayStore.LookupEntry(GetVehicleEntry()->m_powerDisplayID)) - pVehicle->SetPowerType(Powers(powerEntry->power)); - } +// // Initialize power type based on DBC values (creatures only) +// if (pVehicle->GetTypeId() == TYPEID_UNIT) +// { +// if (PowerDisplayEntry const* powerEntry = sPowerDisplayStore.LookupEntry(GetVehicleEntry()->m_powerDisplayID)) +// pVehicle->SetPowerType(Powers(powerEntry->power)); +// } m_isInitialized = true; } diff --git a/src/game/Server/DB2Stores.cpp b/src/game/Server/DB2Stores.cpp index 37e6f217f..509efb250 100644 --- a/src/game/Server/DB2Stores.cpp +++ b/src/game/Server/DB2Stores.cpp @@ -37,6 +37,7 @@ DB2Storage sItemStore(Itemfmt); DB2Storage sItemCurrencyCostStore(ItemCurrencyCostfmt); DB2Storage sItemExtendedCostStore(ItemExtendedCostEntryfmt); +DB2Storage sSpellReagentsStore(SpellReagentsEntryfmt); typedef std::list StoreProblemList1; uint32 DB2FileCount = 0; @@ -112,6 +113,7 @@ void LoadDB2Stores(const std::string& dataPath) LoadDB2(availableDb2Locales,bad_db2_files,sItemStore, db2Path,"Item.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sItemCurrencyCostStore, db2Path,"ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sItemExtendedCostStore, db2Path,"ItemExtendedCost.db2"); + LoadDB2(availableDb2Locales,bad_db2_files,sSpellReagentsStore, db2Path,"SpellReagents.db2"); // error checks if (bad_db2_files.size() >= DB2FileCount) diff --git a/src/game/Server/DB2Stores.h b/src/game/Server/DB2Stores.h index 935ccda04..b5cf35186 100755 --- a/src/game/Server/DB2Stores.h +++ b/src/game/Server/DB2Stores.h @@ -34,6 +34,7 @@ extern DB2Storage sItemStore; extern DB2Storage sItemCurrencyCostStore; extern DB2Storage sItemExtendedCostStore; +extern DB2Storage sSpellReagentsStore; void LoadDB2Stores(const std::string& dataPath); diff --git a/src/game/Server/DB2Structure.h b/src/game/Server/DB2Structure.h index 583d2ab64..87403140d 100644 --- a/src/game/Server/DB2Structure.h +++ b/src/game/Server/DB2Structure.h @@ -40,7 +40,7 @@ struct ItemEntry uint32 ID; // 0 uint32 Class; // 1 uint32 SubClass; // 2 - int32 Unk0; // 3 + int32 SoundOverrideSubclass; // 3 int32 Material; // 4 uint32 DisplayId; // 5 uint32 InventoryType; // 6 @@ -93,4 +93,16 @@ struct ItemExtendedCostEntry } }; +#define MAX_SPELL_REAGENTS 8 + +// SpellReagents.dbc +struct SpellReagentsEntry +{ + //uint32 Id; // 0 m_ID + int32 Reagent[MAX_SPELL_REAGENTS]; // 1-8 m_reagent + uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 9-16 m_reagentCount + // 17 5.x + // 18 5.x +}; + #endif diff --git a/src/game/Server/DB2fmt.h b/src/game/Server/DB2fmt.h index 595ccf5ce..d575b01ac 100644 --- a/src/game/Server/DB2fmt.h +++ b/src/game/Server/DB2fmt.h @@ -28,5 +28,6 @@ const char Itemfmt[]="niiiiiii"; const char ItemCurrencyCostfmt[]="di"; const char ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiixxixx"; +const char SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiiixx"; #endif diff --git a/src/game/Server/DBCEnums.h b/src/game/Server/DBCEnums.h index ade8a1fd4..eccf0c1dd 100644 --- a/src/game/Server/DBCEnums.h +++ b/src/game/Server/DBCEnums.h @@ -76,8 +76,8 @@ enum AchievementFlags ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // ACHIEVEMENT_FLAG_UNK3 = 0x00000400, // ACHIEVEMENT_FLAG_HIDE_NAME_IN_TIE ACHIEVEMENT_FLAG_REALM_FIRST_GUILD = 0x00000800, // first guild on realm done something - ACHIEVEMENT_FLAG_UNK4 = 0x00001000, // as guild group? - ACHIEVEMENT_FLAG_UNK5 = 0x00002000, // as guild group? + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS = 0x00001000, // Shows in guild news + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER = 0x00002000, // Shows in guild news header ACHIEVEMENT_FLAG_GUILD = 0x00004000, // ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // @@ -109,12 +109,12 @@ enum AchievementCriteriaTypes { ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0, ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS = 3, // struct { uint32 itemCount; } ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5, ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9, - // you have to complete a daily quest x times in a row - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, // you have to complete a daily quest x times in a row ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11, ACHIEVEMENT_CRITERIA_TYPE_CURRENCY_EARNED = 12, ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13, @@ -566,10 +566,36 @@ enum SpellEffectIndex { EFFECT_INDEX_0 = 0, ///< The first spell effect EFFECT_INDEX_1 = 1, ///< The second spell effect - EFFECT_INDEX_2 = 2 ///< The third spell effect + EFFECT_INDEX_2 = 2, + EFFECT_INDEX_3 = 3, + EFFECT_INDEX_4 = 4, + EFFECT_INDEX_5 = 5, + EFFECT_INDEX_6 = 6, + EFFECT_INDEX_7 = 7, + EFFECT_INDEX_8 = 8, + EFFECT_INDEX_9 = 9, + EFFECT_INDEX_10 = 10, + EFFECT_INDEX_11 = 11, + EFFECT_INDEX_12 = 12, + EFFECT_INDEX_13 = 13, + EFFECT_INDEX_14 = 14, + EFFECT_INDEX_15 = 15, + EFFECT_INDEX_16 = 16, + EFFECT_INDEX_17 = 17, + EFFECT_INDEX_18 = 18, + EFFECT_INDEX_19 = 19, + EFFECT_INDEX_20 = 20, }; -#define MAX_EFFECT_INDEX 3 +#define EFFECT_MASK_ALL \ + ((1 << EFFECT_INDEX_0) | (1 << EFFECT_INDEX_1) | (1 << EFFECT_INDEX_2) | \ + (1 << EFFECT_INDEX_3) | (1 << EFFECT_INDEX_4) | (1 << EFFECT_INDEX_5) | \ + (1 << EFFECT_INDEX_6) | (1 << EFFECT_INDEX_7) | (1 << EFFECT_INDEX_8) | \ + (1 << EFFECT_INDEX_9) | (1 << EFFECT_INDEX_10) | (1 << EFFECT_INDEX_11) | \ + (1 << EFFECT_INDEX_12) | (1 << EFFECT_INDEX_13) | (1 << EFFECT_INDEX_14) | \ + (1 << EFFECT_INDEX_15) | (1 << EFFECT_INDEX_16) | (1 << EFFECT_INDEX_17) | \ + (1 << EFFECT_INDEX_18) | (1 << EFFECT_INDEX_19) | (1 << EFFECT_INDEX_20)) +#define MAX_EFFECT_INDEX 21 enum SpellFamily { diff --git a/src/game/Server/DBCStores.cpp b/src/game/Server/DBCStores.cpp index 79d9ebe50..59f82b74b 100644 --- a/src/game/Server/DBCStores.cpp +++ b/src/game/Server/DBCStores.cpp @@ -32,6 +32,7 @@ #include "ObjectGuid.h" #include "DBCfmt.h" +#include "DB2fmt.h" #include @@ -86,7 +87,7 @@ DBCStorage sCinematicSequencesStore(CinematicSequences DBCStorage sCreatureDisplayInfoStore(CreatureDisplayInfofmt); DBCStorage sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt); DBCStorage sCreatureFamilyStore(CreatureFamilyfmt); -DBCStorage sCreatureModelDataStore(CreatureModelDatafmt); +//DBCStorage sCreatureModelDataStore(CreatureModelDatafmt); DBCStorage sCreatureSpellDataStore(CreatureSpellDatafmt); // sCreatureModelDataStore DBCStorage sCreatureTypeStore(CreatureTypefmt); DBCStorage sCurrencyTypesStore(CurrencyTypesfmt); @@ -142,9 +143,9 @@ DBCStorage sItemDamageWandStore(ItemDamagefmt); DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); -DBCStorage sItemReforgeStore(ItemReforgefmt); +//DBCStorage sItemReforgeStore(ItemReforgefmt); DBCStorage sItemSetStore(ItemSetEntryfmt); -DBCStorage sLfgDungeonsStore(LfgDungeonsEntryfmt); +//DBCStorage sLfgDungeonsStore(LfgDungeonsEntryfmt); DBCStorage sLiquidTypeStore(LiquidTypefmt); DBCStorage sLockStore(LockEntryfmt); @@ -166,7 +167,7 @@ DBCStorage sQuestSortStore(QuestSortEntryfmt); DBCStorage sQuestXPLevelStore(QuestXPLevelfmt); DBCStorage sPhaseStore(Phasefmt); -DBCStorage sPowerDisplayStore(PowerDisplayfmt); +//DBCStorage sPowerDisplayStore(PowerDisplayfmt); DBCStorage sPvPDifficultyStore(PvPDifficultyfmt); DBCStorage sRandomPropertiesPointsStore(RandomPropertiesPointsfmt); @@ -196,7 +197,6 @@ DBCStorage sSpellEquippedItemsStore(SpellEquippedItems DBCStorage sSpellInterruptsStore(SpellInterruptsEntryfmt); DBCStorage sSpellLevelsStore(SpellLevelsEntryfmt); DBCStorage sSpellPowerStore(SpellPowerEntryfmt); -DBCStorage sSpellReagentsStore(SpellReagentsEntryfmt); DBCStorage sSpellScalingStore(SpellScalingEntryfmt); DBCStorage sSpellShapeshiftStore(SpellShapeshiftEntryfmt); DBCStorage sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt); @@ -208,6 +208,7 @@ DBCStorage sSpellCastTimesStore(SpellCastTimefmt); DBCStorage sSpellDifficultyStore(SpellDifficultyfmt); DBCStorage sSpellDurationStore(SpellDurationfmt); DBCStorage sSpellFocusObjectStore(SpellFocusObjectfmt); +DBCStorage sSpellMiscStore(SpellMiscfmt); DBCStorage sSpellRadiusStore(SpellRadiusfmt); DBCStorage sSpellRangeStore(SpellRangefmt); DBCStorage sSpellRuneCostStore(SpellRuneCostfmt); @@ -485,16 +486,16 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sArmorLocationStore, dbcPath,"ArmorLocation.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sArmorLocationStore, dbcPath,"ArmorLocation.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sBattlemasterListStore, dbcPath,"BattleMasterList.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrPowerTypesStore, dbcPath,"ChrClassesXPowerTypes.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sChrPowerTypesStore, dbcPath,"ChrClassesXPowerTypes.dbc"); for (uint32 i = 0; i < MAX_CLASSES; ++i) { for (uint32 j = 0; j < MAX_POWERS; ++j) @@ -533,7 +534,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoStore, dbcPath,"CreatureDisplayInfo.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureDisplayInfoExtraStore,dbcPath,"CreatureDisplayInfoExtra.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureFamilyStore, dbcPath,"CreatureFamily.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureModelDataStore, dbcPath,"CreatureModelData.dbc"); +// LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureModelDataStore, dbcPath,"CreatureModelData.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureSpellDataStore, dbcPath,"CreatureSpellData.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCreatureTypeStore, dbcPath,"CreatureType.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sCurrencyTypesStore, dbcPath,"CurrencyTypes.dbc"); @@ -554,93 +555,92 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sFactionTemplateStore, dbcPath, "FactionTemplate.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGameObjectDisplayInfoStore, dbcPath, "GameObjectDisplayInfo.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGemPropertiesStore, dbcPath, "GemProperties.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphPropertiesStore, dbcPath, "GlyphProperties.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphSlotStore, dbcPath, "GlyphSlot.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sFactionTemplateStore, dbcPath, "FactionTemplate.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGameObjectDisplayInfoStore, dbcPath, "GameObjectDisplayInfo.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGemPropertiesStore, dbcPath, "GemProperties.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphPropertiesStore, dbcPath, "GlyphProperties.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGlyphSlotStore, dbcPath, "GlyphSlot.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtBarberShopCostBaseStore, dbcPath, "gtBarberShopCostBase.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtBarberShopCostBaseStore, dbcPath, "gtBarberShopCostBase.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTClassCombatRatingScalarStore, dbcPath, "gtOCTClassCombatRatingScalar.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTHpPerStaminaStore, dbcPath,"gtOCTHpPerStamina.dbc"); - // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtSpellScalingStore, dbcPath,"gtSpellScaling.dbc"); // 15595 - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTBaseHPByClassStore, dbcPath,"gtOCTBaseHPByClass.dbc"); // 15595 - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTBaseMPByClassStore, dbcPath,"gtOCTBaseMPByClass.dbc"); // 15595 - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorQualityStore, dbcPath,"ItemArmorQuality.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorShieldStore, dbcPath,"ItemArmorShield.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorTotalStore, dbcPath,"ItemArmorTotal.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemReforgeStore, dbcPath, "ItemReforge.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageAmmoStore, dbcPath,"ItemDamageAmmo.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageOneHandStore, dbcPath,"ItemDamageOneHand.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageOneHandCasterStore,dbcPath,"ItemDamageOneHandCaster.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageRangedStore, dbcPath,"ItemDamageRanged.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageThrownStore, dbcPath,"ItemDamageThrown.dbc"); - // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTHpPerStaminaStore, dbcPath,"gtOCTHpPerStamina.dbc"); + // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtSpellScalingStore, dbcPath,"gtSpellScaling.dbc"); // 15595 + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTBaseHPByClassStore, dbcPath,"gtOCTBaseHPByClass.dbc"); // 15595 + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTBaseMPByClassStore, dbcPath,"gtOCTBaseMPByClass.dbc"); // 15595 + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorQualityStore, dbcPath,"ItemArmorQuality.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorShieldStore, dbcPath,"ItemArmorShield.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemArmorTotalStore, dbcPath,"ItemArmorTotal.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); +// LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemReforgeStore, dbcPath, "ItemReforge.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageAmmoStore, dbcPath,"ItemDamageAmmo.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageOneHandStore, dbcPath,"ItemDamageOneHand.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageOneHandCasterStore, dbcPath,"ItemDamageOneHandCaster.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageRangedStore, dbcPath,"ItemDamageRanged.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageThrownStore, dbcPath,"ItemDamageThrown.dbc"); + // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageTwoHandStore, dbcPath,"ItemDamageTwoHand.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageTwoHandCasterStore,dbcPath,"ItemDamageTwoHandCaster.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageWandStore, dbcPath,"ItemDamageWand.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLfgDungeonsStore, dbcPath, "LFGDungeons.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapStore, dbcPath, "Map.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageTwoHandStore, dbcPath,"ItemDamageTwoHand.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageTwoHandCasterStore, dbcPath,"ItemDamageTwoHandCaster.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDamageWandStore, dbcPath,"ItemDamageWand.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc"); +// LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLfgDungeonsStore, dbcPath, "LFGDungeons.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMailTemplateStore, dbcPath, "MailTemplate.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapStore, dbcPath, "Map.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapDifficultyStore, dbcPath, "MapDifficulty.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMapDifficultyStore, dbcPath, "MapDifficulty.dbc"); // fill data for (uint32 i = 1; i < sMapDifficultyStore.GetNumRows(); ++i) if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i)) sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = entry; - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files, sMountCapabilityStore, dbcPath,"MountCapability.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files, sMountTypeStore, dbcPath,"MountType.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sNumTalentsAtLevelStore, dbcPath,"NumTalentsAtLevel.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestFactionRewardStore, dbcPath, "QuestFactionReward.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestXPLevelStore, dbcPath, "QuestXP.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPhaseStore, dbcPath,"Phase.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPowerDisplayStore, dbcPath,"PowerDisplay.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files, sMountCapabilityStore, dbcPath,"MountCapability.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files, sMountTypeStore, dbcPath,"MountType.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestFactionRewardStore, dbcPath, "QuestFactionReward.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sQuestXPLevelStore, dbcPath, "QuestXP.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPhaseStore, dbcPath,"Phase.dbc"); +// LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPowerDisplayStore, dbcPath,"PowerDisplay.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc"); for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) MANGOS_ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCategoriesStore, dbcPath,"SpellCategories.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellEffectStore, dbcPath,"SpellEffect.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCategoriesStore, dbcPath,"SpellCategories.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellEffectStore, dbcPath,"SpellEffect.dbc"); for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) { @@ -681,7 +681,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellLevelsStore, dbcPath,"SpellLevels.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellPowerStore, dbcPath,"SpellPower.dbc"); - LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellReagentsStore, dbcPath,"SpellReagents.dbc"); + //LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellScalingStore, dbcPath,"SpellScaling.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellShapeshiftStore, dbcPath,"SpellShapeshift.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc"); @@ -695,7 +695,7 @@ void LoadDBCStores(const std::string& dataPath) continue; SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); - if (spellInfo && (spellInfo->Attributes & (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) == (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) + if (spellInfo && (spellInfo->GetAttributes() & (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) == (SPELL_ATTR_UNK4 | SPELL_ATTR_PASSIVE | SPELL_ATTR_UNK7 | SPELL_ATTR_UNK8)) { for (unsigned int i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) { @@ -711,19 +711,20 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc"); + //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellDifficultyStore, dbcPath,"SpellDifficulty.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc"); - //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sStableSlotPricesStore, dbcPath,"StableSlotPrices.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc"); - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellMiscStore, dbcPath, "SpellMisc.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc"); + //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sStableSlotPricesStore, dbcPath,"StableSlotPrices.dbc"); + LoadDBC(availableDbcLocales, bar, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc"); + //LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc"); // create talent spells set for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) @@ -735,7 +736,7 @@ void LoadDBCStores(const std::string& dataPath) sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j); } - LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc"); + //LoadDBC(availableDbcLocales, bar, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc"); // prepare fast data access to bit pos of talent ranks for use at inspecting { @@ -764,7 +765,7 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales,bar,bad_dbc_files, sTalentTreePrimarySpellsStore, dbcPath, "TalentTreePrimarySpells.dbc"); + //LoadDBC(availableDbcLocales,bar,bad_dbc_files, sTalentTreePrimarySpellsStore, dbcPath, "TalentTreePrimarySpells.dbc"); for (uint32 i = 0; i < sTalentTreePrimarySpellsStore.GetNumRows(); ++i) if (TalentTreePrimarySpellsEntry const* talentSpell = sTalentTreePrimarySpellsStore.LookupEntry(i)) if (sSpellStore.LookupEntry(talentSpell->SpellId)) @@ -905,7 +906,7 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (!sAreaStore.LookupEntry(6539) || // last area (areaflag) added in 5.1.0 + if (!sAreaStore.LookupEntry(5491) || // last area (areaflag) added in 5.4.1 17538 !sCharTitlesStore.LookupEntry(389) || // last char title added in 5.4.1 17538 !sGemPropertiesStore.LookupEntry(2467) || // last gem property added in 5.4.1 17538 !sMapStore.LookupEntry(1173) || // last map added in 5.4.1 17538 diff --git a/src/game/Server/DBCStores.h b/src/game/Server/DBCStores.h index f0ec08119..e6edbaa1d 100644 --- a/src/game/Server/DBCStores.h +++ b/src/game/Server/DBCStores.h @@ -141,7 +141,7 @@ extern DBCStorage sCinematicSequencesStore; extern DBCStorage sCreatureDisplayInfoStore; extern DBCStorage sCreatureDisplayInfoExtraStore; extern DBCStorage sCreatureFamilyStore; -extern DBCStorage sCreatureModelDataStore; +//extern DBCStorage sCreatureModelDataStore; extern DBCStorage sCreatureSpellDataStore; extern DBCStorage sCreatureTypeStore; extern DBCStorage sCurrencyTypesStore; @@ -189,9 +189,9 @@ extern DBCStorage sItemDamageWandStore; extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; -extern DBCStorage sItemReforgeStore; +//extern DBCStorage sItemReforgeStore; extern DBCStorage sItemSetStore; -extern DBCStorage sLfgDungeonsStore; +//extern DBCStorage sLfgDungeonsStore; extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; @@ -207,7 +207,7 @@ extern DBCStorage sQuestFactionRewardStore; extern DBCStorage sQuestSortStore; extern DBCStorage sQuestXPLevelStore; extern DBCStorage sPhaseStore; -extern DBCStorage sPowerDisplayStore; +//extern DBCStorage sPowerDisplayStore; // extern DBCStorage sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access extern DBCStorage sRandomPropertiesPointsStore; extern DBCStorage sScalingStatDistributionStore; @@ -224,6 +224,7 @@ extern DBCStorage sSpellItemEnchantmentStore; extern DBCStorage sSpellItemEnchantmentConditionStore; extern SpellCategoryStore sSpellCategoryStore; extern PetFamilySpellsStore sPetFamilySpellsStore; +extern DBCStorage sSpellMiscStore; extern DBCStorage sSpellRadiusStore; extern DBCStorage sSpellRangeStore; extern DBCStorage sSpellRuneCostStore; @@ -240,7 +241,7 @@ extern DBCStorage sSpellEquippedItemsStore; extern DBCStorage sSpellInterruptsStore; extern DBCStorage sSpellLevelsStore; extern DBCStorage sSpellPowerStore; -extern DBCStorage sSpellReagentsStore; +//extern DBCStorage sSpellReagentsStore; extern DBCStorage sSpellScalingStore; extern DBCStorage sSpellShapeshiftStore; extern DBCStorage sSpellTargetRestrictionsStore; diff --git a/src/game/Server/DBCStructure.cpp b/src/game/Server/DBCStructure.cpp index 1a40451ac..44ec3ee43 100644 --- a/src/game/Server/DBCStructure.cpp +++ b/src/game/Server/DBCStructure.cpp @@ -25,6 +25,7 @@ #include "Common.h" #include "DBCStructure.h" #include "DBCStores.h" +#include "DB2Stores.h" #include "SharedDefines.h" int32 SpellEntry::CalculateSimpleValue(SpellEffectIndex eff) const @@ -96,7 +97,7 @@ SpellLevelsEntry const* SpellEntry::GetSpellLevels() const SpellPowerEntry const* SpellEntry::GetSpellPower() const { - return SpellPowerId ? sSpellPowerStore.LookupEntry(SpellPowerId) : NULL; + return sSpellPowerStore.LookupEntry(Id); } SpellReagentsEntry const* SpellEntry::GetSpellReagents() const @@ -124,6 +125,11 @@ SpellTotemsEntry const* SpellEntry::GetSpellTotems() const return SpellTotemsId ? sSpellTotemsStore.LookupEntry(SpellTotemsId) : NULL; } +SpellMiscEntry const* SpellEntry::GetSpellMisc() const +{ + return SpellMiscId ? sSpellMiscStore.LookupEntry(SpellMiscId) : NULL; +} + uint32 SpellEntry::GetManaCost() const { SpellPowerEntry const* power = GetSpellPower(); @@ -357,3 +363,135 @@ uint32 SpellEntry::GetEffectApplyAuraNameByIndex(SpellEffectIndex index) const SpellEffectEntry const* effect = GetSpellEffect(index); return effect ? effect->EffectApplyAuraName : 0; } + +uint32 SpellEntry::GetAttributes() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->Attributes : 0; +} + +uint32 SpellEntry::GetAttributesEx() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx : 0; +} + +uint32 SpellEntry::GetAttributesEx2() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx2 : 0; +} + +uint32 SpellEntry::GetAttributesEx3() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx3 : 0; +} + +uint32 SpellEntry::GetAttributesEx4() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx4 : 0; +} + +uint32 SpellEntry::GetAttributesEx5() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx5 : 0; +} + +uint32 SpellEntry::GetAttributesEx6() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx6 : 0; +} + +uint32 SpellEntry::GetAttributesEx7() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx7 : 0; +} + +uint32 SpellEntry::GetAttributesEx8() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx8 : 0; +} + +uint32 SpellEntry::GetAttributesEx9() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx9 : 0; +} + +uint32 SpellEntry::GetAttributesEx10() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx10 : 0; +} + +uint32 SpellEntry::GetAttributesEx11() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx11 : 0; +} + +uint32 SpellEntry::GetAttributesEx12() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->AttributesEx12 : 0; +} + +uint32 SpellEntry::GetCastingTimeIndex() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->CastingTimeIndex : 0; +} + +uint32 SpellEntry::GetDurationIndex() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->DurationIndex : 0; +} + +uint32 SpellEntry::GetRangeIndex() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->rangeIndex : 0; +} + +float SpellEntry::GetSpeed() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->speed : 0.0f; +} + +uint32 SpellEntry::GetSpellVisual(int idx) const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->SpellVisual[idx] : 0; +} + +uint32 SpellEntry::GetSpellIconID() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->SpellIconID : 0; +} + +uint32 SpellEntry::GetActiveIconID() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->activeIconID : 0; +} + +uint32 SpellEntry::GetSchoolMask() const +{ + SpellMiscEntry const* misc = GetSpellMisc(); + return misc ? misc->SchoolMask : 0; +} + +uint32 SpellEntry::GetPowerType() const +{ + SpellPowerEntry const* power = GetSpellPower(); + return power ? power->powerType : 0; +} diff --git a/src/game/Server/DBCStructure.h b/src/game/Server/DBCStructure.h index 6076709b1..e042913a5 100644 --- a/src/game/Server/DBCStructure.h +++ b/src/game/Server/DBCStructure.h @@ -35,6 +35,8 @@ #include #include +#include "DB2Structure.h" + // Structures using to access raw DBC data and required packing to portability // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform @@ -62,6 +64,7 @@ struct AchievementEntry DBCString titleReward; // 11 m_reward_lang uint32 count; // 12 m_minimum_criteria - need this count of completed criterias (own or referenced achievement criterias) uint32 refAchievement; // 13 m_shares_criteria - referenced achievement (counting of all completed criterias) + // 14 5.x }; struct AchievementCategoryEntry @@ -542,23 +545,28 @@ struct AreaTableEntry uint32 zone; // 2 m_ParentAreaID uint32 exploreFlag; // 3 m_AreaBit uint32 flags; // 4 m_flags - // 5 m_SoundProviderPref - // 6 m_SoundProviderPrefUnderwater - // 7 m_AmbienceID - // 8 m_ZoneMusic - // 9 m_IntroSound - int32 area_level; // 10 m_ExplorationLevel - DBCString area_name; // 11 m_AreaName_lang - uint32 team; // 12 m_factionGroupMask - uint32 LiquidTypeOverride[4]; // 13-16 m_liquidTypeID[4] - // 17 m_minElevation - // 18 m_ambient_multiplier - // 19 m_lightid - //uint32 unk20; // 20 4.0.0 - //uint32 unk21; // 21 4.0.0 - //uint32 unk22; // 22 4.0.0 - //uint32 unk23; // 23 4.0.0 - //uint32 unk24; // 24 4.0.1, may be worldStateId + // 5 5.x + // 6 m_SoundProviderPref + // 7 m_SoundProviderPrefUnderwater + // 8 m_AmbienceID + // 9 m_ZoneMusic + // 10 5.x + // 11 m_IntroSound + int32 area_level; // 12 m_ExplorationLevel + DBCString area_name; // 13 m_AreaName_lang + uint32 team; // 14 m_factionGroupMask + uint32 LiquidTypeOverride[4]; // 15-18 m_liquidTypeID[4] + // 19 m_minElevation + // 20 m_ambient_multiplier + // 21 m_lightid + //uint32 unk20; // 22 4.0.0 + //uint32 unk21; // 23 4.0.0 + //uint32 unk22; // 24 4.0.0 + //uint32 unk23; // 25 4.0.0 + //uint32 unk24; // 26 4.0.1, may be worldStateId + // 27 5.x + // 28 5.x + // 29 5.x }; struct AreaGroupEntry @@ -583,6 +591,9 @@ struct AreaTriggerEntry float box_y; // 10 m_box_width float box_z; // 11 m_box_heigh float box_orientation; // 12 m_box_yaw + // 13 5.x + // 14 5.x + // 15 5.x }; struct ArmorLocationEntry @@ -621,18 +632,20 @@ struct BarberShopStyleEntry struct BattlemasterListEntry { uint32 id; // 0 m_ID - int32 mapid[8]; // 1-8 m_mapID[8] - uint32 type; // 9 m_instanceType - //uint32 canJoinAsGroup; // 10 m_groupsAllowed - DBCString name; // 11 m_name_lang - uint32 maxGroupSize; // 12 m_maxGroupSize - uint32 HolidayWorldStateId; // 13 m_holidayWorldState - uint32 minLevel; // 14, m_minlevel (sync with PvPDifficulty.dbc content) - uint32 maxLevel; // 15, m_maxlevel (sync with PvPDifficulty.dbc content) - uint32 maxGroupSizeRated; // 16 4.0.1 - uint32 minPlayers; // 17 4.0.6.13596 - uint32 maxPlayers; // 18 4.0.1 - uint32 rated; // 19 4.0.3, value 2 for Rated Battlegrounds + int32 mapid[16]; // 1-16 m_mapID[10] + uint32 type; // 17 m_instanceType + //uint32 canJoinAsGroup; // 18 m_groupsAllowed + DBCString name; // 19 m_name_lang + uint32 maxGroupSize; // 20 m_maxGroupSize + uint32 HolidayWorldStateId; // 21 m_holidayWorldState + uint32 minLevel; // 22 m_minlevel (sync with PvPDifficulty.dbc content) + uint32 maxLevel; // 23 m_maxlevel (sync with PvPDifficulty.dbc content) + uint32 maxGroupSizeRated; // 24 4.0.1 + uint32 minPlayers; // 25 4.0.6.13596 + uint32 maxPlayers; // 26 4.0.1 + uint32 rated; // 27 4.0.3, value 2 for Rated Battlegrounds + //uint32 // 28 5.4.1 + //uint32 // 29 5.4.1 }; /*struct Cfg_CategoriesEntry @@ -683,8 +696,7 @@ struct ChatChannelsEntry uint32 ChannelID; // 0 m_ID uint32 flags; // 1 m_flags //uint32 // 2 m_factionGroup - DBCString pattern; // 3 m_name_lang -// char* pattern[16]; // 3 m_name_lang + DBCString pattern; // 3 m_name_lang //char* name; // 4 m_shortcut_lang }; @@ -700,26 +712,30 @@ struct ChrClassesEntry uint32 spellfamily; // 7 m_spellClassSet //uint32 flags2; // 8 m_flags (0x08 HasRelicSlot) uint32 CinematicSequence; // 9 m_cinematicSequenceID - uint32 expansion; // 10 m_required_expansion - uint32 apPerStr; // 11 attack power per strength - uint32 apPerAgi; // 12 attack power per agility - uint32 rapPerAgi; // 13 ranged attack power per agility + uint32 apPerStr; // 10 attack power per strength + uint32 apPerAgi; // 11 attack power per agility + uint32 rapPerAgi; // 12 ranged attack power per agility + // 13 5.x + // 14 5.x + // 15 5.x + // 16 5.x + // 17 5.x }; struct ChrRacesEntry { uint32 RaceID; // 0 m_ID - // 1 m_flags + // 1 m_flags uint32 FactionID; // 2 m_factionID - // 3 m_ExplorationSoundID + // 3 m_ExplorationSoundID uint32 model_m; // 4 m_MaleDisplayId uint32 model_f; // 5 m_FemaleDisplayId - // 6 m_ClientPrefix + // 6 m_ClientPrefix uint32 TeamID; // 7 m_BaseLanguage (7-Alliance 1-Horde) - // 8 m_creatureType - // 9 m_ResSicknessSpellID - // 10 m_SplashSoundID - // 11 m_clientFileString + // 8 m_creatureType + // 9 m_ResSicknessSpellID + // 10 m_SplashSoundID + // 11 m_clientFileString uint32 CinematicSequence; // 12 m_cinematicSequenceID // uint32 unk_322; // 13 m_alliance (0 alliance, 1 horde, 2 not available?) DBCString name; // 14 m_name_lang used for DBC language detection/selection @@ -731,6 +747,7 @@ struct ChrRacesEntry //uint32 // 21 (23 for worgens) //uint32 // 22 4.0.0 //uint32 // 23 4.0.0 + // 24-35 5.x }; struct ChrPowerTypesEntry @@ -775,6 +792,9 @@ struct CreatureDisplayInfoEntry // 14 m_creatureGeosetData // 15 m_objectEffectPackageID // 16 all 0 + // 17 5.x + // 18 5.x + // 19 5.4.1 }; struct CreatureDisplayInfoExtraEntry @@ -864,7 +884,8 @@ struct CurrencyTypesEntry uint32 TotalCap; // 7 uint32 WeekCap; // 8 uint32 Flags; // 9 - //DBCString description; // 10 + //uint32 // 10 5.4.1 + //DBCString description; // 11 bool HasPrecision() const { return Flags & CURRENCY_FLAG_HAS_PRECISION; } bool HasSeasonCount() const { return Flags & CURRENCY_FLAG_HAS_SEASON_COUNT; } @@ -909,6 +930,7 @@ struct DungeonEncounterEntry DBCString encounterName; // 5 - encounter name //uint32 nameLangFlags; // 6 m_name_lang_flags //uint32 spellIconID; // 7 m_spellIconID + //uint32 // 8 5.4.1 }; struct DurabilityCostsEntry @@ -959,6 +981,8 @@ struct FactionEntry DBCString name; // 23 m_name_lang //char* description; // 24 m_description_lang //uint32 // 25 + //uint32 // 26 5.4.1 + //uint32 // 27 5.4.1 // helpers @@ -1460,11 +1484,11 @@ struct MapDifficultyEntry struct MovieEntry { uint32 Id; // 0 m_ID - //char* filename; // 1 m_filename - //uint32 unk1; // 2 m_volume - //uint32 unk2; // 3 4.0.0 + //uint32 unk1; // 1 m_volume + //uint32 unk2; // 2 5.x + //uint32 unk3; // 3 4.0.0 + //uint32 unk4; // 4 5.x }; - struct MountCapabilityEntry { uint32 Id; @@ -1570,13 +1594,14 @@ struct ScalingStatValuesEntry { uint32 Id; // 0 m_ID uint32 Level; // 1 m_charlevel - uint32 dpsMod[6]; // 2-7 DPS mod for level - uint32 spellBonus; // 8 spell power for level - uint32 ssdMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution - uint32 armorMod[4]; // 14-17 Armor for level - uint32 armorMod2[4]; // 18-21 Armor for level - //uint32 trash[24]; // 22-45 - //uint32 unk2; // 46 unk, probably also Armor for level (flag 0x80000?) + uint32 dpsMod[6]; // 2-7 DPS mod for level + // 8 5.x unk bonus + uint32 spellBonus; // 9 spell power for level + uint32 ssdMultiplier[5]; // 10-14 Multiplier for ScalingStatDistribution + uint32 armorMod[4]; // 15-18 Armor for level + uint32 armorMod2[4]; // 19-22 Armor for level + //uint32 trash[24]; // 23-47 + //uint32 unk2; // 48 unk, probably also Armor for level (flag 0x80000?) /*struct ScalingStatValuesEntry { @@ -1719,20 +1744,20 @@ struct SoundEntriesEntry uint32 Id; // 0 m_ID uint32 Type; // 1 m_soundType DBCString InternalName; // 2 m_name - DBCString FileName[10]; // 3-12 m_File[10] - DBCString Unk13[10]; // 13-22 m_Freq[10] - DBCString Path; // 23 m_DirectoryBase - // 24 m_volumeFloat - // 25 m_flags - // 26 m_minDistance - // 27 m_distanceCutoff - // 28 m_EAXDef - // 29 m_soundEntriesAdvancedID, new in 3.1 - //unk // 30 4.0.0 - //unk // 31 4.0.0 - //unk // 32 4.0.0 - //unk // 33 4.0.0 - //unk // 34 4.3.0 + ///uint32 unk[10]; // 3-12 unk[10] + //uint32 unk2[10]; // 13-22 unk[10] + // 23 m_volumeFloat + // 24 m_flags + // 25 m_minDistance + // 26 m_distanceCutoff + // 27 m_EAXDef + // 28 m_soundEntriesAdvancedID, new in 3.1 + // 29 4.0.0 + // 30 4.0.0 + // 31 4.0.0 + // 32 4.0.0 + // 33 4.3.0 + // 34 5.x }; struct ClassFamilyMask @@ -1777,67 +1802,67 @@ struct ClassFamilyMask // SpellAuraOptions.dbc struct SpellAuraOptionsEntry { - //uint32 Id; // 0 m_ID - uint32 StackAmount; // 1 m_cumulativeAura - uint32 procChance; // 2 m_procChance - uint32 procCharges; // 3 m_procCharges - uint32 procFlags; // 4 m_procTypeMask + //uint32 Id; // 0 m_ID + // 1 5.x + // 2 5.x + uint32 StackAmount; // 3 m_cumulativeAura + uint32 procChance; // 4 m_procChance + uint32 procCharges; // 5 m_procCharges + uint32 procFlags; // 6 m_procTypeMask + //uint32 // 7 5.4.1 + //uint32 // 8 5.4.1 }; // SpellAuraRestrictions.dbc struct SpellAuraRestrictionsEntry { //uint32 Id; // 0 m_ID - uint32 CasterAuraState; // 1 m_casterAuraState - uint32 TargetAuraState; // 2 m_targetAuraState - uint32 CasterAuraStateNot; // 3 m_excludeCasterAuraState - uint32 TargetAuraStateNot; // 4 m_excludeTargetAuraState - uint32 casterAuraSpell; // 5 m_casterAuraSpell - uint32 targetAuraSpell; // 6 m_targetAuraSpell - uint32 excludeCasterAuraSpell; // 7 m_excludeCasterAuraSpell - uint32 excludeTargetAuraSpell; // 8 m_excludeTargetAuraSpell + // 1 5.x + // 2 5.x + uint32 CasterAuraState; // 21 m_casterAuraState + uint32 TargetAuraState; // 22 m_targetAuraState + uint32 CasterAuraStateNot; // 23 m_excludeCasterAuraState + uint32 TargetAuraStateNot; // 24 m_excludeTargetAuraState + uint32 casterAuraSpell; // 25 m_casterAuraSpell + uint32 targetAuraSpell; // 26 m_targetAuraSpell + uint32 excludeCasterAuraSpell; // 27 m_excludeCasterAuraSpell + uint32 excludeTargetAuraSpell; // 28 m_excludeTargetAuraSpell }; // SpellCastingRequirements.dbc struct SpellCastingRequirementsEntry { - //uint32 Id; // 0 m_ID - uint32 FacingCasterFlags; // 1 m_facingCasterFlags - //uint32 MinFactionId; // 2 m_minFactionID not used - //uint32 MinReputation; // 3 m_minReputation not used - int32 AreaGroupId; // 4 m_requiredAreaGroupId - //uint32 RequiredAuraVision; // 5 m_requiredAuraVision not used - uint32 RequiresSpellFocus; // 6 m_requiresSpellFocus -}; - -// SpellCastTimes.dbc -struct SpellCastTimesEntry -{ - uint32 ID; // 0 m_ID - int32 CastTime; // 1 m_base - float CastTimePerLevel; // 2 m_perLevel - int32 MinCastTime; // 3 m_minimum + //uint32 Id; // 0 m_ID + uint32 FacingCasterFlags; // 20 m_facingCasterFlags + //uint32 MinFactionId; // 159 m_minFactionID not used + //uint32 MinReputation; // 160 m_minReputation not used + int32 AreaGroupId; // 164 m_requiredAreaGroupId + //uint32 RequiredAuraVision; // 161 m_requiredAuraVision not used + uint32 RequiresSpellFocus; // 19 m_requiresSpellFocus }; // SpellCategories.dbc struct SpellCategoriesEntry { //uint32 Id; // 0 m_ID - uint32 Category; // 1 m_category - uint32 DmgClass; // 2 m_defenseType - uint32 Dispel; // 3 m_dispelType - uint32 Mechanic; // 4 m_mechanic - uint32 PreventionType; // 5 m_preventionType - uint32 StartRecoveryCategory; // 6 m_startRecoveryCategory + // 1 5.x + // 2 5.x + uint32 Category; // 3 m_category + uint32 DmgClass; // 4 m_defenseType + uint32 Dispel; // 5 m_dispelType + uint32 Mechanic; // 6 m_mechanic + uint32 PreventionType; // 7 m_preventionType + uint32 StartRecoveryCategory; // 8 m_startRecoveryCategory + // 9 5.x }; // SpellClassOptions.dbc struct SpellClassOptionsEntry { //uint32 Id; // 0 m_ID - //uint32 modalNextSpell; // 1 m_modalNextSpell not used - ClassFamilyMask SpellFamilyFlags; // 2-4 m_spellClassMask NOTE: size is 12 bytes!!! - uint32 SpellFamilyName; // 5 m_spellClassSet + //uint32 modalNextSpell; // 50 m_modalNextSpell not used + ClassFamilyMask SpellFamilyFlags; // 149-151 m_spellClassMask NOTE: size is 12 bytes!!! + uint32 SpellFamilyName; // 148 m_spellClassSet //char* Description; // 6 4.0.0 // helpers @@ -1871,39 +1896,43 @@ struct SpellClassOptionsEntry struct SpellCooldownsEntry { //uint32 Id; // 0 m_ID - uint32 CategoryRecoveryTime; // 1 m_categoryRecoveryTime - uint32 RecoveryTime; // 2 m_recoveryTime - uint32 StartRecoveryTime; // 3 m_startRecoveryTime + // 1 5.x + // 2 5.x + uint32 CategoryRecoveryTime; // 3 m_categoryRecoveryTime + uint32 RecoveryTime; // 4 m_recoveryTime + uint32 StartRecoveryTime; // 5 m_startRecoveryTime }; // SpellEffect.dbc struct SpellEffectEntry { //uint32 Id; // 0 m_ID - uint32 Effect; // 1 m_effect - float EffectMultipleValue; // 2 m_effectAmplitude - uint32 EffectApplyAuraName; // 3 m_effectAura - uint32 EffectAmplitude; // 4 m_effectAuraPeriod - int32 EffectBasePoints; // 5 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) - float EffectBonusMultiplier; // 6 m_effectBonus - float EffectDamageMultiplier; // 7 m_effectChainAmplitude - uint32 EffectChainTarget; // 8 m_effectChainTargets - int32 EffectDieSides; // 9 m_effectDieSides - uint32 EffectItemType; // 10 m_effectItemType - uint32 EffectMechanic; // 11 m_effectMechanic - int32 EffectMiscValue; // 12 m_effectMiscValue - int32 EffectMiscValueB; // 13 m_effectMiscValueB - float EffectPointsPerComboPoint; // 14 m_effectPointsPerCombo - uint32 EffectRadiusIndex; // 15 m_effectRadiusIndex - spellradius.dbc - uint32 EffectRadiusMaxIndex; // 16 4.0.0 - float EffectRealPointsPerLevel; // 17 m_effectRealPointsPerLevel - ClassFamilyMask EffectSpellClassMask; // 18 19 20 m_effectSpellClassMask - uint32 EffectTriggerSpell; // 21 m_effectTriggerSpell - uint32 EffectImplicitTargetA; // 22 m_implicitTargetA - uint32 EffectImplicitTargetB; // 23 m_implicitTargetB - uint32 EffectSpellId; // 24 m_spellId - spell.dbc - uint32 EffectIndex; // 25 m_spellEffectIdx - //uint32 unk; // 26 4.2.0 only 0 or 1 + uint32 Difficulty; // 1 m_difficulty + uint32 Effect; // 2 m_effect + float EffectMultipleValue; // 3 m_effectAmplitude + uint32 EffectApplyAuraName; // 4 m_effectAura + uint32 EffectAmplitude; // 5 m_effectAuraPeriod + int32 EffectBasePoints; // 6 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) + //float unk_320_4; // 7 3.2.0 + float DmgMultiplier; // 8 m_effectChainAmplitude + uint32 EffectChainTarget; // 9 m_effectChainTargets + int32 EffectDieSides; // 10 m_effectDieSides + uint32 EffectItemType; // 11 m_effectItemType + uint32 EffectMechanic; // 12 m_effectMechanic + int32 EffectMiscValue; // 13 m_effectMiscValue + int32 EffectMiscValueB; // 14 m_effectMiscValueB + float EffectPointsPerComboPoint; // 15 m_effectPointsPerCombo + uint32 EffectRadiusIndex; // 16 m_effectRadiusIndex - spellradius.dbc + uint32 EffectRadiusMaxIndex; // 17 4.0.0 + float EffectRealPointsPerLevel; // 18 m_effectRealPointsPerLevel + ClassFamilyMask EffectSpellClassMask; // 19-21 m_effectSpellClassMask + uint32 EffectSpellClassMask4; // 22 5.x FIXME + uint32 EffectTriggerSpell; // 23 m_effectTriggerSpell + uint32 EffectImplicitTargetA; // 24 m_implicitTargetA + uint32 EffectImplicitTargetB; // 25 m_implicitTargetB + uint32 EffectSpellId; // 26 new 4.0.0 + uint32 EffectIndex; // 27 new 4.0.0 + //uint32 unk; // 28 4.2.0 // helpers @@ -1924,123 +1953,55 @@ struct SpellEffectEntry struct SpellEquippedItemsEntry { //uint32 Id; // 0 m_ID - int32 EquippedItemClass; // 1 m_equippedItemClass (value) - int32 EquippedItemInventoryTypeMask; // 2 m_equippedItemInvTypes (mask) - int32 EquippedItemSubClassMask; // 3 m_equippedItemSubclass (mask) -}; - -// SpellFocusObject.dbc -struct SpellFocusObjectEntry -{ - uint32 ID; // 0 m_ID - //char* Name; // 1 m_name_lang + // 1 unk 5.1.0 + // 2 unk 5.1.0 + int32 EquippedItemClass; // 3 m_equippedItemClass (value) + int32 EquippedItemInventoryTypeMask; // 4 m_equippedItemInvTypes (mask) + int32 EquippedItemSubClassMask; // 5 m_equippedItemSubclass (mask) }; // SpellInterrupts.dbc struct SpellInterruptsEntry { //uint32 Id; // 0 m_ID - uint32 AuraInterruptFlags; // 1 m_auraInterruptFlags - //uint32 // 2 4.0.0 - uint32 ChannelInterruptFlags; // 3 m_channelInterruptFlags + // 1 unk 5.1.0 + // 2 unk 5.1.0 + uint32 AuraInterruptFlags; // 3 m_auraInterruptFlags //uint32 // 4 4.0.0 - uint32 InterruptFlags; // 5 m_interruptFlags -}; - -// SpellItemEnchantment.dbc -struct SpellItemEnchantmentEntry -{ - uint32 ID; // 0 m_ID - //uint32 charges; // 1 m_charges - uint32 type[3]; // 2-4 m_effect[3] - uint32 amount[3]; // 5-7 m_effectPointsMin[3] - //uint32 amount2[3] // 8-10 m_effectPointsMax[3] - uint32 spellid[3]; // 11-13 m_effectArg[3] - DBCString description; // 14 m_name_lang - uint32 aura_id; // 15 m_itemVisual - uint32 slot; // 16 m_flags - uint32 GemID; // 17 m_src_itemID - uint32 EnchantmentCondition; // 18 m_condition_id - uint32 requiredSkill; // 19 m_requiredSkillID - uint32 requiredSkillValue; // 20 m_requiredSkillRank - uint32 requiredLevel; // 21 m_requiredLevel - 3.1 - // 22 new in 3.1 -}; - -// SpellItemEnchantmentCondition.dbc -struct SpellItemEnchantmentConditionEntry -{ - uint32 ID; // 0 m_ID - uint8 Color[5]; // 1-5 m_lt_operandType[5] - //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5] - uint8 Comparator[5]; // 11-15 m_operator[5] - uint8 CompareColor[5]; // 15-20 m_rt_operandType[5] - uint32 Value[5]; // 21-25 m_rt_operand[5] - //uint8 Logic[5] // 25-30 m_logic[5] + uint32 ChannelInterruptFlags; // 5 m_channelInterruptFlags + //uint32 // 6 4.0.0 + uint32 InterruptFlags; // 7 m_interruptFlags }; // SpellLevels.dbc struct SpellLevelsEntry { //uint32 Id; // 0 m_ID - uint32 baseLevel; // 1 m_baseLevel - uint32 maxLevel; // 2 m_maxLevel - uint32 spellLevel; // 3 m_spellLevel + // 1 unk 5.1.0 + // 2 unk 5.1.0 + uint32 baseLevel; // 3 m_baseLevel + uint32 maxLevel; // 4 m_maxLevel + uint32 spellLevel; // 5 m_spellLevel }; // SpellPower.dbc struct SpellPowerEntry { - //uint32 Id; // 0 - m_ID - uint32 manaCost; // 1 - m_manaCost - uint32 manaCostPerlevel; // 2 - m_manaCostPerLevel - uint32 ManaCostPercentage; // 3 - m_manaCostPct - uint32 manaPerSecond; // 4 - m_manaPerSecond - uint32 manaPerSecondPerLevel; // 5 m_manaPerSecondPerLevel - //uint32 PowerDisplayId; // 6 - m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 - float ManaCostPercentageFloat; // 7 4.3.0 + //uint32 Id; // 0 - m_ID + uint32 SpellId; // 1 5.x + // 2 5.x + uint32 powerType; // 3 m_powerType + uint32 manaCost; // 4 m_manaCost + uint32 manaCostPerlevel; // 5 m_manaCostPerLevel + uint32 ManaCostPercentage; // 6 m_manaCostPct + uint32 manaPerSecond; // 7 m_manaPerSecond + //uint32 PowerDisplayId; // 8 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 + //uint32 unk1; // 9 4.0.0 + //unk // 10 4.3.0 + // 11 5.x + // 12 5.x }; -// SpellRadius.dbc -struct SpellRadiusEntry -{ - uint32 ID; // 0 m_ID - float Radius; // 1 m_radius - float RadiusPerLevel; // 2 m_radiusPerLevel - float RadiusMax; // 3 m_radiusMax -}; - -// SpellRange.dbc -struct SpellRangeEntry -{ - uint32 ID; // 0 m_ID - float minRange; // 1 m_rangeMin[2] - float minRangeFriendly; // 2 - float maxRange; // 3 m_rangeMax[2] - float maxRangeFriendly; // 4 - uint32 type; // 5 m_flags - //char* Name; // 6-21 m_displayName_lang - //char* ShortName; // 23-38 m_displayNameShort_lang -}; - -// SpellReagents.dbc -struct SpellReagentsEntry -{ - //uint32 Id; // 0 m_ID - int32 Reagent[MAX_SPELL_REAGENTS]; // 54-61 m_reagent - uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 62-69 m_reagentCount -}; - -// SpellRuneCost.dbc -struct SpellRuneCostEntry -{ - uint32 ID; // 0 m_ID - uint32 RuneCost[3]; // 1-3 m_blood m_unholy m_frost (0=blood, 1=frost, 2=unholy) - uint32 runePowerGain; // 4 m_runicPower - - bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } - bool NoRunicPowerGain() const { return runePowerGain == 0; } -}; // SpellScaling.dbc struct SpellScalingEntry @@ -2062,102 +2023,114 @@ struct SpellScalingEntry // SpellShapeshift.dbc struct SpellShapeshiftEntry { - //uint32 Id; // 0 m_ID - uint32 StancesNot; // 1 m_shapeshiftMask - // uint32 unk_320_2; // 2 3.2.0 - uint32 Stances; // 3 m_shapeshiftExclude - // uint32 unk_320_3; // 4 3.2.0 - // uint32 StanceBarOrder; // 5 m_stanceBarOrder not used + //uint32 Id; // 0 m_ID + uint32 StancesNot; // 13 m_shapeshiftMask + // uint32 unk_320_2; // 14 3.2.0 + uint32 Stances; // 15 m_shapeshiftExclude + // uint32 unk_320_3; // 16 3.2.0 + // uint32 StanceBarOrder; // 155 m_stanceBarOrder not used }; -// SpellShapeshiftForm.dbc -struct SpellShapeshiftFormEntry -{ - uint32 ID; // 0 m_ID - //uint32 buttonPosition; // 1 m_bonusActionBar - //char* Name; // 2 m_name_lang - uint32 flags1; // 3 m_flags - int32 creatureType; // 4 m_creatureType <=0 humanoid, other normal creature types - //uint32 unk1; // 5 m_attackIconID - uint32 attackSpeed; // 6 m_combatRoundTime - uint32 modelID_A; // 7 m_creatureDisplayID[4] - uint32 modelID_H; // 8 - //uint32 unk3; // 9 unused always 0 - //uint32 unk4; // 10 unused always 0 - uint32 spellId[8]; // 11-18 m_presetSpellID[8] - //uint32 unk5; // 19 unused, !=0 for flight forms - //uint32 unk6; // 20 -}; +//// SpellShapeshiftForm.dbc +//struct SpellShapeshiftFormEntry +//{ +// uint32 ID; // 0 m_ID +// //uint32 buttonPosition; // 1 m_bonusActionBar +// //char* Name; // 2 m_name_lang +// uint32 flags1; // 3 m_flags +// int32 creatureType; // 4 m_creatureType <=0 humanoid, other normal creature types +// //uint32 unk1; // 5 m_attackIconID +// uint32 attackSpeed; // 6 m_combatRoundTime +// uint32 modelID_A; // 7 m_creatureDisplayID[4] +// uint32 modelID_H; // 8 +// //uint32 unk3; // 9 unused always 0 +// //uint32 unk4; // 10 unused always 0 +// uint32 spellId[8]; // 11-18 m_presetSpellID[8] +// //uint32 unk5; // 19 unused, !=0 for flight forms +// //uint32 unk6; // 20 +//}; // SpellTargetRestrictions.dbc struct SpellTargetRestrictionsEntry { //uint32 Id; // 0 m_ID - float MaxTargetRadius; // 1 - m_maxTargetRadius - uint32 MaxAffectedTargets; // 1 - m_maxTargets - uint32 MaxTargetLevel; // 2 - m_maxTargetLevel - uint32 TargetCreatureType; // 3 - m_targetCreatureType - uint32 Targets; // 4 - m_targets + // 1 unk 5.1.0 + // 2 unk 5.1.0 + float MaxTargetRadius; // 3 m_maxTargetRadius + //float // 4 unk 5.1.0 + uint32 MaxAffectedTargets; // 5 m_maxTargets + uint32 MaxTargetLevel; // 6 m_maxTargetLevel + uint32 TargetCreatureType; // 7 m_targetCreatureType + uint32 Targets; // 8 m_targets }; // SpellTotems.dbc struct SpellTotemsEntry { - //uint32 Id; // 0 m_ID - uint32 TotemCategory[MAX_SPELL_TOTEM_CATEGORIES]; // 1 2 m_requiredTotemCategoryID - uint32 Totem[MAX_SPELL_TOTEMS]; // 3 4 m_totem + //uint32 Id; // 0 m_ID + uint32 TotemCategory[MAX_SPELL_TOTEM_CATEGORIES]; // 162-163 m_requiredTotemCategoryID + uint32 Totem[MAX_SPELL_TOTEMS]; // 52-53 m_totem }; +// SpellMisc.dbc +struct SpellMiscEntry +{ + //uint32 Id; // 0 + //uint32 SpellId; // 1 + //uint32 // 2 unk + uint32 Attributes; // 3 + uint32 AttributesEx; // 4 + uint32 AttributesEx2; // 5 + uint32 AttributesEx3; // 6 + uint32 AttributesEx4; // 7 + uint32 AttributesEx5; // 8 + uint32 AttributesEx6; // 9 + uint32 AttributesEx7; // 10 + uint32 AttributesEx8; // 11 + uint32 AttributesEx9; // 12 + uint32 AttributesEx10; // 13 + uint32 AttributesEx11; // 14 + uint32 AttributesEx12; // 15 + uint32 CastingTimeIndex; // 16 m_castingTimeIndex + uint32 DurationIndex; // 17 m_durationIndex + uint32 rangeIndex; // 18 m_rangeIndex + float speed; // 19 m_speed + uint32 SpellVisual[2]; // 20-21 m_spellVisualID + uint32 SpellIconID; // 22 m_spellIconID + uint32 activeIconID; // 23 m_activeIconID + uint32 SchoolMask; // 24 m_schoolMask +}; + +struct SpellReagentsEntry; + // Spell.dbc -struct SpellEntry +struct SpellEntry { uint32 Id; // 0 m_ID - uint32 Attributes; // 1 m_attribute - uint32 AttributesEx; // 2 m_attributesEx - uint32 AttributesEx2; // 3 m_attributesExB - uint32 AttributesEx3; // 4 m_attributesExC - uint32 AttributesEx4; // 5 m_attributesExD - uint32 AttributesEx5; // 6 m_attributesExE - uint32 AttributesEx6; // 7 m_attributesExF - uint32 AttributesEx7; // 8 m_attributesExG (0x20 - totems, 0x4 - paladin auras, etc...) - uint32 AttributesEx8; // 9 m_attributesExH - uint32 AttributesEx9; // 10 m_attributesExI - uint32 AttributesEx10; // 11 m_attributesExJ - uint32 CastingTimeIndex; // 12 m_castingTimeIndex - uint32 DurationIndex; // 13 m_durationIndex - uint32 powerType; // 14 m_powerType - uint32 rangeIndex; // 15 m_rangeIndex - float speed; // 16 m_speed - uint32 SpellVisual[2]; // 17-18 m_spellVisualID - uint32 SpellIconID; // 19 m_spellIconID - uint32 activeIconID; // 20 m_activeIconID - DBCString SpellName; // 21 m_name_lang - DBCString Rank; // 22 m_nameSubtext_lang - //DBCString Description; // 23 m_description_lang not used - //DBCString ToolTip; // 24 m_auraDescription_lang not used - uint32 SchoolMask; // 25 m_schoolMask - uint32 runeCostID; // 26 m_runeCostID - //uint32 spellMissileID; // 27 m_spellMissileID not used - //uint32 spellDescriptionVariableID; // 28 m_spellDescriptionVariableID, 3.2.0 - uint32 SpellDifficultyId; // 29 m_spellDifficultyID - id from SpellDifficulty.dbc - //float unk_f1; // 30 - uint32 SpellScalingId; // 31 SpellScaling.dbc - uint32 SpellAuraOptionsId; // 32 SpellAuraOptions.dbc - uint32 SpellAuraRestrictionsId; // 33 SpellAuraRestrictions.dbc - uint32 SpellCastingRequirementsId; // 34 SpellCastingRequirements.dbc - uint32 SpellCategoriesId; // 35 SpellCategories.dbc - uint32 SpellClassOptionsId; // 36 SpellClassOptions.dbc - uint32 SpellCooldownsId; // 37 SpellCooldowns.dbc - //uint32 unkIndex7; // 38 all zeros... - uint32 SpellEquippedItemsId; // 39 SpellEquippedItems.dbc - uint32 SpellInterruptsId; // 40 SpellInterrupts.dbc - uint32 SpellLevelsId; // 41 SpellLevels.dbc - uint32 SpellPowerId; // 42 SpellPower.dbc - uint32 SpellReagentsId; // 43 SpellReagents.dbc - uint32 SpellShapeshiftId; // 44 SpellShapeshift.dbc - uint32 SpellTargetRestrictionsId; // 45 SpellTargetRestrictions.dbc - uint32 SpellTotemsId; // 46 SpellTotems.dbc - //uint32 ResearchProject; // 47 ResearchProject.dbc + DBCString SpellName; // 1 m_name_lang + DBCString Rank; // 2 m_nameSubtext_lang + //DBCString Description; // 3 m_description_lang not used + //DBCString ToolTip; // 4 m_auraDescription_lang not used + uint32 runeCostID; // 5 m_runeCostID + //uint32 spellMissileID; // 6 m_spellMissileID not used + //uint32 spellDescriptionVariableID; // 7 m_spellDescriptionVariableID, 3.2.0 + //float unk_f1; // 8 + uint32 SpellScalingId; // 9 SpellScaling.dbc + uint32 SpellAuraOptionsId; // 10 SpellAuraOptions.dbc + uint32 SpellAuraRestrictionsId; // 11 SpellAuraRestrictions.dbc + uint32 SpellCastingRequirementsId; // 12 SpellCastingRequirements.dbc + uint32 SpellCategoriesId; // 13 SpellCategories.dbc + uint32 SpellClassOptionsId; // 14 SpellClassOptions.dbc + uint32 SpellCooldownsId; // 15 SpellCooldowns.dbc + uint32 SpellEquippedItemsId; // 16 SpellEquippedItems.dbc + uint32 SpellInterruptsId; // 17 SpellInterrupts.dbc + uint32 SpellLevelsId; // 18 SpellLevels.dbc + uint32 SpellReagentsId; // 19 SpellReagents.dbc + uint32 SpellShapeshiftId; // 20 SpellShapeshift.dbc + uint32 SpellTargetRestrictionsId; // 21 SpellTargetRestrictions.dbc + uint32 SpellTotemsId; // 22 SpellTotems.dbc + //uint32 ResearchProject; // 23 ResearchProject.dbc + uint32 SpellMiscId; // 24 SpellMisc.dbc // helpers int32 CalculateSimpleValue(SpellEffectIndex eff) const; @@ -2180,6 +2153,7 @@ struct SpellEntry SpellShapeshiftEntry const* GetSpellShapeshift() const; SpellTargetRestrictionsEntry const* GetSpellTargetRestrictions() const; SpellTotemsEntry const* GetSpellTotems() const; + SpellMiscEntry const* GetSpellMisc() const; // single fields uint32 GetManaCost() const; @@ -2221,6 +2195,15 @@ struct SpellEntry uint32 GetCasterAuraState() const; uint32 GetTargets() const; uint32 GetEffectApplyAuraNameByIndex(SpellEffectIndex index) const; + uint32 GetCastingTimeIndex() const; + uint32 GetDurationIndex() const; + uint32 GetRangeIndex() const; + float GetSpeed() const; + uint32 GetSpellVisual(int idx = 0) const; + uint32 GetSpellIconID() const; + uint32 GetActiveIconID() const; + uint32 GetSchoolMask() const; + uint32 GetPowerType() const; bool IsFitToFamilyMask(uint64 familyFlags, uint32 familyFlags2 = 0) const { @@ -2246,17 +2229,32 @@ struct SpellEntry return classOpt && classOpt->IsFitToFamily(family, mask); } - inline bool HasAttribute(SpellAttributes attribute) const { return Attributes & attribute; } - inline bool HasAttribute(SpellAttributesEx attribute) const { return AttributesEx & attribute; } - inline bool HasAttribute(SpellAttributesEx2 attribute) const { return AttributesEx2 & attribute; } - inline bool HasAttribute(SpellAttributesEx3 attribute) const { return AttributesEx3 & attribute; } - inline bool HasAttribute(SpellAttributesEx4 attribute) const { return AttributesEx4 & attribute; } - inline bool HasAttribute(SpellAttributesEx5 attribute) const { return AttributesEx5 & attribute; } - inline bool HasAttribute(SpellAttributesEx6 attribute) const { return AttributesEx6 & attribute; } - inline bool HasAttribute(SpellAttributesEx7 attribute) const { return AttributesEx7 & attribute; } - inline bool HasAttribute(SpellAttributesEx8 attribute) const { return AttributesEx8 & attribute; } - inline bool HasAttribute(SpellAttributesEx9 attribute) const { return AttributesEx9 & attribute; } - inline bool HasAttribute(SpellAttributesEx10 attribute) const { return AttributesEx10 & attribute; } + uint32 GetAttributes() const; + uint32 GetAttributesEx() const; + uint32 GetAttributesEx2() const; + uint32 GetAttributesEx3() const; + uint32 GetAttributesEx4() const; + uint32 GetAttributesEx5() const; + uint32 GetAttributesEx6() const; + uint32 GetAttributesEx7() const; + uint32 GetAttributesEx8() const; + uint32 GetAttributesEx9() const; + uint32 GetAttributesEx10() const; + uint32 GetAttributesEx11() const; + uint32 GetAttributesEx12() const; + inline bool HasAttribute(SpellAttributes attribute) const { return GetAttributes() & attribute; } + inline bool HasAttribute(SpellAttributesEx attribute) const { return GetAttributesEx() & attribute; } + inline bool HasAttribute(SpellAttributesEx2 attribute) const { return GetAttributesEx2() & attribute; } + inline bool HasAttribute(SpellAttributesEx3 attribute) const { return GetAttributesEx3() & attribute; } + inline bool HasAttribute(SpellAttributesEx4 attribute) const { return GetAttributesEx4() & attribute; } + inline bool HasAttribute(SpellAttributesEx5 attribute) const { return GetAttributesEx5() & attribute; } + inline bool HasAttribute(SpellAttributesEx6 attribute) const { return GetAttributesEx6() & attribute; } + inline bool HasAttribute(SpellAttributesEx7 attribute) const { return GetAttributesEx7() & attribute; } + inline bool HasAttribute(SpellAttributesEx8 attribute) const { return GetAttributesEx8() & attribute; } + inline bool HasAttribute(SpellAttributesEx9 attribute) const { return GetAttributesEx9() & attribute; } + inline bool HasAttribute(SpellAttributesEx10 attribute) const { return GetAttributesEx10() & attribute; } + inline bool HasAttribute(SpellAttributesEx11 attribute) const { return GetAttributesEx11() & attribute; } + inline bool HasAttribute(SpellAttributesEx12 attribute) const { return GetAttributesEx12() & attribute; } private: // prevent creating custom entries (copy data from original in fact) @@ -2272,6 +2270,70 @@ struct SpellEntry #define LOADED_SPELLDBC_FIELD_POS_EQUIPPED_ITEM_CLASS 65 // Must be converted to -1 #define LOADED_SPELLDBC_FIELD_POS_SPELLNAME_0 132 // Links to "MaNGOS server-side spell" +struct SpellCastTimesEntry +{ + uint32 ID; // 0 m_ID + int32 CastTime; // 1 m_base + float CastTimePerLevel; // 2 m_perLevel + int32 MinCastTime; // 3 m_minimum +}; + +struct SpellFocusObjectEntry +{ + uint32 ID; // 0 m_ID + //char* Name; // 1 m_name_lang +}; + +struct SpellRadiusEntry +{ + uint32 ID; // 0 m_ID + float Radius; // 1 m_radius + // 2 m_radiusPerLevel + //float // 3 5.x + //float RadiusMax; // 4 m_radiusMax +}; + +struct SpellRangeEntry +{ + uint32 ID; // 0 m_ID + float minRange; // 1 m_rangeMin[2] + float minRangeFriendly; // 2 + float maxRange; // 3 m_rangeMax[2] + float maxRangeFriendly; // 4 + //uint32 Flags; // 5 m_flags + //char* Name; // 6-21 m_displayName_lang + //char* ShortName; // 23-38 m_displayNameShort_lang +}; + +struct SpellRuneCostEntry +{ + uint32 ID; // 0 m_ID + uint32 RuneCost[3]; // 1-3 m_blood m_unholy m_frost (0=blood, 1=frost, 2=unholy) + //uint32 // 4 5.x + uint32 runePowerGain; // 5 m_runicPower + + bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } + bool NoRunicPowerGain() const { return runePowerGain == 0; } +}; + +struct SpellShapeshiftFormEntry +{ + uint32 ID; // 0 m_ID + //uint32 buttonPosition; // 1 m_bonusActionBar + //char* Name; // 2 m_name_lang + uint32 flags1; // 3 m_flags + int32 creatureType; // 4 m_creatureType <=0 humanoid, other normal creature types + //uint32 unk1; // 5 m_attackIconID + uint32 attackSpeed; // 6 m_combatRoundTime + uint32 modelID_A; // 7 m_creatureDisplayID[4] + uint32 modelID_H; // 8 + //uint32 unk3; // 9 unused always 0 + //uint32 unk4; // 10 unused always 0 + uint32 spellId[8]; // 11-18 m_presetSpellID[8] + //uint32 unk5; // 19 unused, !=0 for flight forms + //uint32 unk6; // 20 +}; + struct SpellDifficultyEntry { uint32 ID; // 0 m_ID @@ -2284,6 +2346,41 @@ struct SpellDurationEntry int32 Duration[3]; // m_duration, m_durationPerLevel, m_maxDuration }; +struct SpellItemEnchantmentEntry +{ + uint32 ID; // 0 m_ID + //uint32 charges; // 1 m_charges + uint32 type[3]; // 2-4 m_effect[3] + uint32 amount[3]; // 5-7 m_effectPointsMin[3] + uint32 spellid[3]; // 8-10 m_effectArg[3] + DBCString description; // 11 m_name_lang + uint32 aura_id; // 12 m_itemVisual + uint32 slot; // 13 m_flags + uint32 GemID; // 14 m_src_itemID + uint32 EnchantmentCondition; // 15 m_condition_id + //uint32 requiredSkill; // 16 m_requiredSkillID + //uint32 requiredSkillValue; // 17 m_requiredSkillRank + uint32 requiredLevel; // 18 new in 3.1 + //float // 19 5.x + //uint32 minItemLevel; // 20 new in 3.1 + //int32 // 21 5.x + //int32 // 22 5.4.1 + //float // 23 5.x + //uint32 // 24 5.x + //uint32 // 25 5.x +}; + +struct SpellItemEnchantmentConditionEntry +{ + uint32 ID; // 0 m_ID + uint8 Color[5]; // 1-5 m_lt_operandType[5] + //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5] + uint8 Comparator[5]; // 11-15 m_operator[5] + uint8 CompareColor[5]; // 15-20 m_rt_operandType[5] + uint32 Value[5]; // 21-25 m_rt_operand[5] + //uint8 Logic[5] // 25-30 m_logic[5] +}; + struct SummonPropertiesEntry { uint32 Id; // 0 m_id @@ -2347,9 +2444,10 @@ struct TaxiNodesEntry float z; // 4 m_z DBCString name; // 5 m_Name_lang uint32 MountCreatureID[2]; // 6-7 m_MountCreatureID[2] - //uint32 unk; // 8 - 4.2.0 - //float unk1; // 9 - 4.2.0 - //float unk2; // 10 - 4.2.0 + //uint32 // 8 5.4.1 + //uint32 unk; // 9 4.2.0 + //float unk1; // 10 4.2.0 + //float unk2; // 11 4.2.0 }; struct TaxiPathEntry @@ -2400,35 +2498,36 @@ struct VehicleEntry { uint32 m_ID; // 0 uint32 m_flags; // 1 - float m_turnSpeed; // 2 - float m_pitchSpeed; // 3 - float m_pitchMin; // 4 - float m_pitchMax; // 5 - uint32 m_seatID[MAX_VEHICLE_SEAT]; // 6-13 - float m_mouseLookOffsetPitch; // 14 - float m_cameraFadeDistScalarMin; // 15 - float m_cameraFadeDistScalarMax; // 16 - float m_cameraPitchOffset; // 17 - float m_facingLimitRight; // 18 - float m_facingLimitLeft; // 19 - float m_msslTrgtTurnLingering; // 20 - float m_msslTrgtPitchLingering; // 21 - float m_msslTrgtMouseLingering; // 22 - float m_msslTrgtEndOpacity; // 23 - float m_msslTrgtArcSpeed; // 24 - float m_msslTrgtArcRepeat; // 25 - float m_msslTrgtArcWidth; // 26 - float m_msslTrgtImpactRadius[2]; // 27-28 - DBCString m_msslTrgtArcTexture; // 29 - DBCString m_msslTrgtImpactTexture; // 30 - DBCString m_msslTrgtImpactModel[2]; // 31-32 - float m_cameraYawOffset; // 33 - uint32 m_uiLocomotionType; // 34 - float m_msslTrgtImpactTexRadius; // 35 - uint32 m_uiSeatIndicatorType; // 36 m_vehicleUIIndicatorID - uint32 m_powerDisplayID; // 37 - // 38 new in 3.1 - // 39 new in 3.1 + //uint32 // 2 5.x + float m_turnSpeed; // 3 + float m_pitchSpeed; // 4 + float m_pitchMin; // 5 + float m_pitchMax; // 6 + uint32 m_seatID[MAX_VEHICLE_SEAT]; // 7-14 + float m_mouseLookOffsetPitch; // 15 + float m_cameraFadeDistScalarMin; // 16 + float m_cameraFadeDistScalarMax; // 17 + float m_cameraPitchOffset; // 18 + float m_facingLimitRight; // 19 + float m_facingLimitLeft; // 20 + float m_msslTrgtTurnLingering; // 21 + float m_msslTrgtPitchLingering; // 22 + float m_msslTrgtMouseLingering; // 23 + float m_msslTrgtEndOpacity; // 24 + float m_msslTrgtArcSpeed; // 25 + float m_msslTrgtArcRepeat; // 26 + float m_msslTrgtArcWidth; // 27 + float m_msslTrgtImpactRadius[2]; // 28-29 + DBCString m_msslTrgtArcTexture; // 30 + DBCString m_msslTrgtImpactTexture; // 31 + DBCString m_msslTrgtImpactModel[2]; // 32-33 + float m_cameraYawOffset; // 34 + uint32 m_uiLocomotionType; // 35 + float m_msslTrgtImpactTexRadius; // 36 + uint32 m_uiSeatIndicatorType; // 37 m_vehicleUIIndicatorID + uint32 m_powerType; // 38 m_powerDisplayID + // 39 new in 3.1 + // 30 new in 3.1 }; struct VehicleSeatEntry @@ -2558,6 +2657,7 @@ struct WorldMapOverlayEntry // 12 m_hitRectLeft // 13 m_hitRectBottom // 14 m_hitRectRight + // 15 5.x }; struct WorldSafeLocsEntry @@ -2567,7 +2667,8 @@ struct WorldSafeLocsEntry float x; // 2 m_locX float y; // 3 m_locY float z; // 4 m_locZ - //char* name; // 5 m_AreaName_lang + //float // 5 5.x + //char* name; // 6 m_AreaName_lang }; struct WorldPvPAreaEntry @@ -2609,11 +2710,9 @@ struct SpellEffect { SpellEffect() { - effects[0] = NULL; - effects[1] = NULL; - effects[2] = NULL; + memset(effects, 0, sizeof(effects)); } - SpellEffectEntry const* effects[3]; + SpellEffectEntry const* effects[MAX_EFFECT_INDEX]; }; typedef std::map SpellEffectMap; diff --git a/src/game/Server/DBCfmt.h b/src/game/Server/DBCfmt.h index 5630900b6..4c08132f4 100644 --- a/src/game/Server/DBCfmt.h +++ b/src/game/Server/DBCfmt.h @@ -25,144 +25,135 @@ #ifndef MANGOS_DBCSFRM_H #define MANGOS_DBCSFRM_H -const char Achievementfmt[]= "niiissiiiiisiix"; // 5.3.0 Checked -const char AchievementCriteriafmt[]= "niiiiiiiixsiiiiixxxxxxxx"; // 5.3.0 Checked -const char AreaTableEntryfmt[]= "iiinixxxxxisiiiiixxxxxxxxx"; -const char AreaGroupEntryfmt[] = "niiiiiii"; // 5.3.0 Checked -const char AreaTriggerEntryfmt[]= "nifffxxxfffff"; // TODO: 5.3.0 DIFFERENT -const char ArmorLocationfmt[]="nfffff"; // 5.3.0 Checked -const char AuctionHouseEntryfmt[]= "niiix"; // 5.3.0 Checked -const char BankBagSlotPricesEntryfmt[] = "ni"; // 5.3.0 Checked -const char BarberShopStyleEntryfmt[]= "nixxxiii"; // TODO: 5.3.0 DIFFERENT -const char BattlemasterListEntryfmt[]="niiiiiiiiixsiiiiiiii"; // TODO: 5.3.0 DIFFERENT +const char Achievementfmt[]= "niiissiiiiisiix"; // 5.3.0 Checked +const char AchievementCriteriafmt[]="niiiiiiiixsiiiiixxxxxxx"; +const char AreaTableEntryfmt[]="iiinixxxxxxxisiiiiixxxxxxxxxxx"; // 16357 +const char AreaGroupEntryfmt[] = "niiiiiii"; // 5.3.0 Checked +const char AreaTriggerEntryfmt[]="nifffxxxfffffxxx"; // 16357 +const char ArmorLocationfmt[]="nfffff"; // 5.3.0 Checked +const char AuctionHouseEntryfmt[]= "niiix"; // 5.3.0 Checked +const char BankBagSlotPricesEntryfmt[] = "ni"; //5.3.0 Checked +const char BarberShopStyleEntryfmt[]= "nixxxiii"; // TODO: 5.3.0 DIFFERENT +const char BattlemasterListEntryfmt[]="niiiiiiiiiiiiiiiiixsiiiiiiiixx"; // 16357 const char CharStartOutfitEntryfmt[]= "diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // TODO: 5.3.0 DIFFERENT -const char CharTitlesEntryfmt[]="nxsxix"; // 5.3.0 Checked -const char ChatChannelsEntryfmt[]="iixsx"; // 5.3.0 Checked +const char CharTitlesEntryfmt[]="nxsxix"; // 5.3.0 Checked +const char ChatChannelsEntryfmt[]="iixsx"; // 5.3.0 Checked // ChatChannelsEntryfmt, index not used (more compact store) -const char ChrClassesEntryfmt[]= "nixsxxxixiiiii"; // TODO: 5.3.0 DIFFERENT -const char ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxx"; // TODO: 5.3.0 DIFFERENT -const char ChrClassesXPowerTypesfmt[]="nii"; // 5.3.0 Checked -const char CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; // 5.3.0 Checked -const char CreatureDisplayInfofmt[]="nxxifxxxxxxxxxxxx"; // TODO: 5.3.0 DIFFERENT -const char CreatureDisplayInfoExtrafmt[] = "nixxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked -const char CreatureFamilyfmt[]="nfifiiiiixsx"; // 5.3.0 Checked -const char CreatureModelDatafmt[] = "nxxxxxxxxxxxxxxffxxxxxxxxxxxxxx"; -const char CreatureSpellDatafmt[] = "niiiixxxx"; // 5.3.0 Checked -const char CreatureTypefmt[]="nxx"; // 5.3.0 Checked -const char CurrencyTypesfmt[]="nisxxxxiiix"; // TODO: 5.3.0 DIFFERENT -const char DestructibleModelDataFmt[] = "nixxxixxxxixxxxixxxxxxxx"; // 5.3.0 Checked -const char DungeonEncounterfmt[]="niiiisxx"; // 5.3.0 Checked -const char DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; // TODO: 5.3.0 DIFFERENT -const char DurabilityQualityfmt[] = "nf"; // TODO: 5.3.0 DIFFERENT -const char EmotesEntryfmt[]="nxxiiixx"; // 5.3.0 Checked -const char EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; // 5.3.0 Checked -const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxx"; // TODO: 5.3.0 DIFFERENT -const char FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; // 5.3.0 Checked -const char GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffxxx"; // 5.3.0 Checked -const char GemPropertiesEntryfmt[]="nixxix"; // 5.3.0 Checked -const char GlyphPropertiesfmt[] = "niii"; // 5.3.0 Checked -const char GlyphSlotfmt[] = "nii"; // 5.3.0 Checked -const char GtBarberShopCostBasefmt[]="xf"; // 5.3.0 Checked -const char GtCombatRatingsfmt[]="xf"; // 5.3.0 Checked -const char GtChanceToMeleeCritBasefmt[]="xf"; // 5.3.0 Checked -const char GtChanceToMeleeCritfmt[]="xf"; // 5.3.0 Checked -const char GtChanceToSpellCritBasefmt[]="xf"; // 5.3.0 Checked -const char GtChanceToSpellCritfmt[]="xf"; // 5.3.0 Checked +const char ChrClassesEntryfmt[]="nixsxxxixiiiixxxxx"; // 16357 +const char ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxxxxxxxxxxxxxx"; // 16357 +const char ChrClassesXPowerTypesfmt[]="nii"; // 5.3.0 Checked +const char CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; // 5.3.0 Checked +const char CreatureDisplayInfofmt[]="nxxifxxxxxxxxxxxxxxx"; // 16357 +const char CreatureDisplayInfoExtrafmt[] = "nixxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked +const char CreatureFamilyfmt[]="nfifiiiiixsx"; // 5.3.0 Checked +const char CreatureSpellDatafmt[] = "niiiixxxx"; // 5.3.0 Checked +const char DestructibleModelDataFmt[] = "nixxxixxxxixxxxixxxxxxxx"; +const char DungeonEncounterfmt[]="niiiisxxx"; +const char CreatureTypefmt[]="nxx"; // 5.3.0 Checked +const char CurrencyTypesfmt[]="nisxxxxiiixx"; +const char DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; // TODO: 5.3.0 DIFFERENT +const char DurabilityQualityfmt[] = "nf"; // TODO: 5.3.0 DIFFERENT +const char EmotesEntryfmt[]="nxxiiixx"; // 5.3.0 Checked +const char EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; // 5.3.0 Checked +const char FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxxxx"; +const char FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; // 5.3.0 Checked +const char GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffxxx"; // 5.3.0 Checked +const char GemPropertiesEntryfmt[]="nixxix"; // 5.3.0 Checked +const char GlyphPropertiesfmt[] = "niii"; // 5.3.0 Checked +const char GlyphSlotfmt[] = "nii"; // 5.3.0 Checked +const char GtBarberShopCostBasefmt[]="xf"; // 5.3.0 Checked +const char GtCombatRatingsfmt[]="xf"; +const char GtChanceToMeleeCritBasefmt[]="xf"; // 5.3.0 Checked +const char GtChanceToMeleeCritfmt[]="xf"; // 5.3.0 Checked +const char GtChanceToSpellCritBasefmt[]="xf"; // 5.3.0 Checked +const char GtOCTClassCombatRatingScalarfmt[]="df"; +const char GtChanceToSpellCritfmt[]="xf"; // 5.3.0 Checked +const char GtOCTHpPerStaminafmt[]="df"; // 16357 const char GtOCTRegenHPfmt[]="xf"; -const char GtOCTBaseHPByClassfmt[]="df"; // 5.3.0 Checked -const char GtOCTBaseMPByClassfmt[]="df"; // 5.3.0 Checked -const char GtOCTClassCombatRatingScalarfmt[] = "df"; // 5.3.0 Checked -const char GtOCTHpPerStaminafmt[]="df"; // 5.3.0 Checked -//const char GtOCTRegenHPfmt[]="xf"; const char GtRegenHPPerSptfmt[]="xf"; -const char GtRegenMPPerSptfmt[]="xf"; // 5.3.0 Checked -const char GtSpellScalingfmt[]="df"; // 5.3.0 Checked -//const char GtOCTBaseHPByClassfmt[]="df"; -//const char GtOCTBaseMPByClassfmt[]="df"; -const char Holidaysfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked -const char ItemArmorQualityfmt[]="nfffffffi"; // 5.3.0 Checked -const char ItemArmorShieldfmt[]="nifffffff"; // 5.3.0 Checked -const char ItemArmorTotalfmt[]="niffff"; // 5.3.0 Checked -const char ItemBagFamilyfmt[]="nx"; // 5.3.0 Checked -const char ItemClassfmt[]="nixxfs"; // TODO: 5.3.0 DIFFERENT +const char GtRegenMPPerSptfmt[]="xf"; // 5.3.0 Checked +const char GtSpellScalingfmt[]="df"; // 5.3.0 Checked +const char GtOCTBaseHPByClassfmt[]="df"; +const char GtOCTBaseMPByClassfmt[]="df"; +const char Holidaysfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked +const char ItemClassfmt[]="nxfs"; // 16357 +const char ItemArmorQualityfmt[]="nfffffffi"; // 5.3.0 Checked +const char ItemArmorShieldfmt[]="nifffffff"; // 5.3.0 Checked +const char ItemArmorTotalfmt[]="niffff"; // 5.3.0 Checked +const char ItemBagFamilyfmt[]="nx"; // 5.3.0 Checked // const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; // const char ItemCondExtCostsEntryfmt[]="xiii"; const char ItemDamagefmt[]="nfffffffi"; -const char ItemLimitCategoryEntryfmt[]="nxii"; // 5.3.0 Checked -const char ItemRandomPropertiesfmt[]="nxiiiiis"; // 5.3.0 Checked -const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; // 5.3.0 Checked -const char ItemReforgefmt[]="nifif"; -const char ItemSetEntryfmt[]="dsxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii"; // 5.3.0 Checked -const char LfgDungeonsEntryfmt[] = "isiiiiifiiifsisisiiii"; -const char LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked -const char LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; // 5.3.0 Checked -const char MailTemplateEntryfmt[]="nxs"; // 5.3.0 Checked -const char MapEntryfmt[]="nsiiiisissififfiiiii"; // TODO: 5.3.0 DIFFERENT -const char MapDifficultyEntryfmt[]="niisiis"; // 5.3.0 Checked -const char MovieEntryfmt[]="nxxx"; +const char ItemLimitCategoryEntryfmt[]="nxii"; // 5.3.0 Checked +const char ItemRandomPropertiesfmt[]="nxiiiiis"; // 5.3.0 Checked +const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; // 5.3.0 Checked +const char ItemSetEntryfmt[]="dsxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii"; // 5.3.0 Checked +const char LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked +const char LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; // 5.3.0 Checked +const char MailTemplateEntryfmt[]="nxs"; // 5.3.0 Checked +const char MapEntryfmt[]="nsiiisissififfiiiii"; // 16357 +const char MapDifficultyEntryfmt[]="niisiis"; // 5.3.0 Checked const char MountCapabilityfmt[]="niiiiiii"; const char MountTypefmt[]="niiiiiiiiiiiiiiiiiiiiiiii"; +const char MovieEntryfmt[]="nxxxx"; // 16357 const char NumTalentsAtLevelfmt[]="df"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestFactionRewardfmt[] = "niiiiiiiiii"; -const char QuestSortEntryfmt[]="nx"; // 5.3.0 Checked -const char QuestXPLevelfmt[] = "niiiiiiiiii"; // 5.3.0 Checked -const char Phasefmt[]="nii"; // 5.3.0 Checked -const char PowerDisplayfmt[] = "nixxxx"; +const char QuestSortEntryfmt[]="nx"; // 5.3.0 Checked +const char QuestXPLevelfmt[] = "niiiiiiiiii"; // 5.3.0 Checked +const char Phasefmt[]="nii"; // 5.3.0 Checked const char PvPDifficultyfmt[] = "diiiii"; -const char RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; // 5.3.0 Checked -const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; // 5.3.0 Checked -const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxx"; -const char SkillLinefmt[]="nisxixi"; -const char SkillLineAbilityfmt[] = "niiiixxiiiiiix"; -const char SkillRaceClassInfofmt[]="diiiiixxx"; -const char SoundEntriesfmt[]="nissssssssssssssssssssssxxxxxxxxxxx"; -const char SpellCastTimefmt[]="niii"; // 5.3.0 Checked -const char SpellDurationfmt[] = "niii"; // 5.3.0 Checked +const char RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; // 5.3.0 Checked +const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; // 5.3.0 Checked +const char ScalingStatValuesfmt[]="iniiiiiixiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxx"; // 16357 +const char SkillLinefmt[]="nisxixixx"; // 16357 +const char SkillLineAbilityfmt[]="niiiiiiiiixxx"; // 16357 +const char SkillRaceClassInfofmt[]="diiiiixx"; // 16357 +const char SoundEntriesfmt[]="nisxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // 17538 +const char SpellCastTimefmt[]="niii"; // 5.3.0 Checked +const char SpellDurationfmt[] = "niii"; // 5.3.0 Checked const char SpellDifficultyfmt[] = "niiii"; -// 1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 -const char SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; -const char SpellAuraOptionsEntryfmt[]="diiii"; -const char SpellAuraRestrictionsEntryfmt[]="diiiiiiii"; -const char SpellCastingRequirementsEntryfmt[]="dixxixi"; // 5.3.0 Checked -const char SpellCategoriesEntryfmt[]="diiiiii"; +const char SpellEntryfmt[]="nssxxixxxiiiiiiiiiiiiiixi"; // 16357 +const char SpellAuraOptionsEntryfmt[]="dxxiiiixx"; // 16357 +const char SpellAuraRestrictionsEntryfmt[]="dxxiiiiiiii"; // 16357 +const char SpellCastingRequirementsEntryfmt[]="dixxixi"; // 5.3.0 Checked +const char SpellCategoriesEntryfmt[]="dxxiiiiiix"; // 16357 const char SpellClassOptionsEntryfmt[]="dxiiiix"; -const char SpellCooldownsEntryfmt[]="diii"; -// 1 10 20 30 -const char SpellEffectEntryfmt[]="difiiiffiiiiiifiifiiiiiiiix"; -const char SpellEquippedItemsEntryfmt[]="diii"; -const char SpellInterruptsEntryfmt[]="dixixi"; -const char SpellLevelsEntryfmt[]="diii"; -const char SpellPowerEntryfmt[]="diiiiixf"; -const char SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii"; +const char SpellCooldownsEntryfmt[]="dxxiii"; // 16357 +const char SpellEffectEntryfmt[]="diifiiixfiiiiiifiifiiiiixiiiix"; // 16357 +const char SpellEquippedItemsEntryfmt[]="dxxiii"; // 16357 +const char SpellInterruptsEntryfmt[]="dxxixixi"; // 16357 +const char SpellLevelsEntryfmt[]="dxxiii"; // 16357 +const char SpellPowerEntryfmt[]="xnxiiiiixxxxx"; // 16357 const char SpellScalingEntryfmt[]="diiiiffffffffffi"; -const char SpellShapeshiftEntryfmt[]="dixixx"; // 5.3.0 Checked -const char SpellTargetRestrictionsEntryfmt[]="dfiiii"; -const char SpellTotemsEntryfmt[]="diiii"; // 5.3.0 Checked +const char SpellShapeshiftEntryfmt[]="dixixx"; // 5.3.0 Checked +const char SpellTargetRestrictionsEntryfmt[]="dxxfxiiii"; // 16357 +const char SpellTotemsEntryfmt[]="diiii"; // 5.3.0 Checked const char SpellFocusObjectfmt[]="nx"; -const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiisiiiiiiix"; -const char SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; // 5.3.0 Checked -const char SpellRadiusfmt[]="nfff"; -const char SpellRangefmt[]="nffffixx"; // 5.3.0 Checked -const char SpellRuneCostfmt[] = "niiii"; -const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx"; // 5.3.0 Checked +const char SpellItemEnchantmentfmt[]="nxiiiiiiiiisiiiixxixxxxxxx"; // 17538 +const char SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; // 5.3.0 Checked +const char SpellMiscfmt[]="dxxiiiiiiiiiiiiiiiifiiiii"; // 17538 +const char SpellRadiusfmt[]="nfxxx"; // 16357 +const char SpellRangefmt[]="nffffxxx"; // 5.3.0 Checked +const char SpellRuneCostfmt[]="niiixi"; // 16357 +const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx"; // 5.3.0 Checked //const char StableSlotPricesfmt[] = "ni"; // removed -const char SummonPropertiesfmt[] = "niiiii"; // 5.3.0 Checked +const char SummonPropertiesfmt[] = "niiiii"; // 5.3.0 Checked const char TalentEntryfmt[]="niiiiiiiiixxixxxxxx"; const char TalentTabEntryfmt[]="nxxiiixxiii"; const char TalentTreePrimarySpellsfmt[]="diix"; -const char TaxiNodesEntryfmt[]="nifffsiixxx"; // 5.3.0 Checked -const char TaxiPathEntryfmt[] = "niii"; // 5.3.0 Checked -const char TaxiPathNodeEntryfmt[] = "diiifffiiii"; // 5.3.0 Checked -const char TotemCategoryEntryfmt[]="nxii"; // 5.3.0 Checked -const char TransportAnimationEntryfmt[]="diixxxx"; // 5.3.0 Checked -const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; -const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked -const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxx"; // 5.3.0 Checked -const char WorldMapAreaEntryfmt[]="xinxffffixxxxx"; // 5.3.0 Checked -const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxx"; -const char WorldSafeLocsEntryfmt[]="nifffx"; +const char TaxiNodesEntryfmt[]="nifffsiixxxx"; +const char TaxiPathEntryfmt[] = "niii"; // 5.3.0 Checked +const char TaxiPathNodeEntryfmt[] = "diiifffiiii"; // 5.3.0 Checked +const char TotemCategoryEntryfmt[]="nxii"; // 5.3.0 Checked +const char TransportAnimationEntryfmt[]="diixxxx"; // 5.3.0 Checked +const char VehicleEntryfmt[]="nixffffiiiiiiiifffffffffffffffssssfifiixx"; // 16357 +const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; // 5.3.0 Checked +const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxx"; // 5.3.0 Checked +const char WorldMapAreaEntryfmt[]="xinxffffixxxxx"; // 5.3.0 Checked +const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxx"; // 16357 +const char WorldSafeLocsEntryfmt[]="nifffxx"; // 16357 const char WorldPvPAreaEnrtyfmt[]="niiiiii"; #endif \ No newline at end of file diff --git a/src/game/Server/SharedDefines.h b/src/game/Server/SharedDefines.h index ae68374ac..fb4f94360 100644 --- a/src/game/Server/SharedDefines.h +++ b/src/game/Server/SharedDefines.h @@ -684,6 +684,76 @@ enum SpellAttributesEx10 SPELL_ATTR_EX10_UNK31 = 0x80000000,// 31 not used }; +enum SpellAttributesEx11 +{ + SPELL_ATTR_EX11_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX11_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX11_UNK2 = 0x00000004,// 2 + SPELL_ATTR_EX11_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX11_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX11_UNK5 = 0x00000020,// 5 + SPELL_ATTR_EX11_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX11_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX11_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX11_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX11_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX11_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX11_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX11_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX11_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX11_UNK15 = 0x00008000,// 15 + SPELL_ATTR_EX11_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX11_UNK17 = 0x00020000,// 17 + SPELL_ATTR_EX11_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX11_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX11_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX11_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX11_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX11_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX11_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX11_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX11_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX11_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX11_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX11_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX11_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX11_UNK31 = 0x80000000,// 31 +}; +enum SpellAttributesEx12 +{ + SPELL_ATTR_EX12_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX12_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX12_UNK2 = 0x00000004,// 2 + SPELL_ATTR_EX12_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX12_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX12_UNK5 = 0x00000020,// 5 + SPELL_ATTR_EX12_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX12_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX12_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX12_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX12_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX12_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX12_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX12_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX12_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX12_UNK15 = 0x00008000,// 15 + SPELL_ATTR_EX12_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX12_UNK17 = 0x00020000,// 17 + SPELL_ATTR_EX12_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX12_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX12_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX12_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX12_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX12_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX12_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX12_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX12_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX12_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX12_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX12_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX12_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX12_UNK31 = 0x80000000,// 31 +}; #define MAX_TALENT_SPEC_COUNT 2 #define MAX_GLYPH_SLOT_INDEX 6 #define REQ_PRIMARY_TREE_TALENTS 31 diff --git a/src/game/WorldHandlers/CharacterHandler.cpp b/src/game/WorldHandlers/CharacterHandler.cpp index 982a68282..bf07e20cf 100644 --- a/src/game/WorldHandlers/CharacterHandler.cpp +++ b/src/game/WorldHandlers/CharacterHandler.cpp @@ -83,7 +83,10 @@ bool LoginQueryHolder::Initialize() "health, power1, power2, power3, power4, power5, specCount, activeSpec, exploredZones, equipmentCache, knownTitles, actionBars, slot FROM characters WHERE guid = '%u'", m_guid.GetCounter()); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT groupId FROM group_member WHERE memberGuid ='%u'", m_guid.GetCounter()); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", m_guid.GetCounter()); - res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'", m_guid.GetCounter()); + res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,item_guid,spell,stackcount,remaincharges," + "basepoints0,basepoints1,basepoints2,basepoints3,basepoints4,basepoints5,basepoints6,basepoints7,basepoints8,basepoints9,basepoints10,basepoints11,basepoints12,basepoints13,basepoints14,basepoints15,basepoints16,basepoints17,basepoints18,basepoints19,basepoints20," + "periodictime0,periodictime1,periodictime2,periodictime3,periodictime4,periodictime5,periodictime6,periodictime7,periodictime8,periodictime9,periodictime10,periodictime11,periodictime12,periodictime13,periodictime14,periodictime15,periodictime16,periodictime17,periodictime18,periodictime19,periodictime20," + "maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'", m_guid.GetCounter()); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", m_guid.GetCounter()); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4,itemcount5,itemcount6 FROM character_queststatus WHERE guid = '%u'", m_guid.GetCounter()); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS, "SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", m_guid.GetCounter()); @@ -151,9 +154,7 @@ void WorldSession::HandleCharEnum(QueryResult* result) ByteBuffer buffer; - data.WriteBits(0, 23); - data.WriteBit(1); - data.WriteBits(result ? result->GetRowCount() : 0, 17); + data.WriteBits(result ? result->GetRowCount() : 0, 16); if (result) { @@ -168,7 +169,13 @@ void WorldSession::HandleCharEnum(QueryResult* result) } } while (result->NextRow()); + } + data.WriteBit(1); + data.WriteBits(0, 21); + + if (!buffer.empty()) + { data.FlushBits(); data.append(buffer); } @@ -208,14 +215,14 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data) { + // extract other data required for player creating + uint8 gender, skin, face, hairStyle, hairColor, facialHair, outfitId; std::string name; - uint8 race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId; + uint8 race_, class_; - recv_data >> gender >> hairColor >> outfitId; - recv_data >> race_ >> class_ >> face>> facialHair >> skin >> hairStyle; - - uint8 nameLength = recv_data.ReadBits(7); - name = recv_data.ReadString(nameLength); + recv_data >> class_ >> hairStyle >> facialHair >> race_; + recv_data >> face >> skin >> gender >> hairColor >> outfitId; + name = recv_data.ReadString(recv_data.ReadBits(8)); WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases @@ -253,23 +260,25 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recv_data) return; } + // FIXME // prevent character creating Expansion race without Expansion account - if (raceEntry->expansion > Expansion()) - { - data << (uint8)CHAR_CREATE_EXPANSION; - sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_); - SendPacket(&data); - return; - } + //if (raceEntry->expansion > Expansion()) + //{ + // data << (uint8)CHAR_CREATE_EXPANSION; + // sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_); + // SendPacket(&data); + // return; + //} + // FIXME // prevent character creating Expansion class without Expansion account - if (classEntry->expansion > Expansion()) - { - data << (uint8)CHAR_CREATE_EXPANSION_CLASS; - sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_); - SendPacket(&data); - return; - } + //if (classEntry->expansion > Expansion()) + //{ + // data << (uint8)CHAR_CREATE_EXPANSION_CLASS; + // sLog.outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_); + // SendPacket(&data); + // return; + //} // prevent character creating with invalid name if (!normalizePlayerName(name)) @@ -631,6 +640,13 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recv_data) void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recv_data) { + ObjectGuid playerGuid; + + recv_data.ReadGuidMask<1, 5, 0, 2, 7, 6, 3, 4>(playerGuid); + recv_data.ReadGuidBytes<6, 4, 3, 5, 0, 2, 7, 1>(playerGuid); + float unk = recv_data.ReadSingle(); + + DEBUG_LOG("WORLD: Received opcode Player Logon Message from %s, unk float: %f", playerGuid.GetString().c_str(), unk); if (PlayerLoading() || GetPlayer() != NULL) { sLog.outError("Player tryes to login again, AccountId = %d", GetAccountId()); @@ -639,13 +655,6 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recv_data) m_playerLoading = true; - ObjectGuid playerGuid; - - recv_data.ReadGuidMask<2, 0, 4, 3, 5, 6, 1, 7>(playerGuid); - recv_data.ReadGuidBytes<0, 3, 7, 6, 1, 2, 4, 5>(playerGuid); - - DEBUG_LOG("WORLD: Received opcode Player Logon Message from %s", playerGuid.GetString().c_str()); - LoginQueryHolder* holder = new LoginQueryHolder(GetAccountId(), playerGuid); if (!holder->Initialize()) { @@ -691,21 +700,20 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) SendAccountDataTimes(PER_CHARACTER_CACHE_MASK); data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 34); // added in 2.2.0 - data << uint8(2); // status data << uint32(1); // Scrolls of Ressurection? data << uint32(1); data << uint32(2); data << uint32(0); - data.WriteBit(true); - data.WriteBit(true); + data << uint8(2); // complain system status data.WriteBit(false); + data.WriteBit(false); // session time alert data.WriteBit(true); - data.WriteBit(false); - data.WriteBit(false); // enable(1)/disable(0) voice chat interface in client + data.WriteBit(false); // enable(1)/disable(0) voice chat interface in client ? + data.WriteBit(true); // quick ticket? + data << uint32(60); + data << uint32(10); data << uint32(1); data << uint32(0); - data << uint32(10); - data << uint32(60); SendPacket(&data); // Send MOTD @@ -1076,7 +1084,7 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(QueryResult* result, uin WorldSession* session = sWorld.FindSession(accountId); if (!session) { - delete result; + if (result) delete result; return; } diff --git a/src/game/WorldHandlers/ChatHandler.cpp b/src/game/WorldHandlers/ChatHandler.cpp index a1740e5b3..fbe4f8711 100644 --- a/src/game/WorldHandlers/ChatHandler.cpp +++ b/src/game/WorldHandlers/ChatHandler.cpp @@ -246,12 +246,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) case CHAT_MSG_WHISPER: { - std::string to, msg; - uint32 toLength = recv_data.ReadBits(10); uint32 msgLength = recv_data.ReadBits(9); - to = recv_data.ReadString(toLength); - msg = recv_data.ReadString(msgLength); - + uint32 toLength = recv_data.ReadBits(10); + std::string msg = recv_data.ReadString(msgLength); + std::string to = recv_data.ReadString(toLength); if (msg.empty()) { break; @@ -266,6 +264,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) { return; } + if (msg.empty()) + break; if (!normalizePlayerName(to)) { diff --git a/src/game/WorldHandlers/ItemHandler.cpp b/src/game/WorldHandlers/ItemHandler.cpp index 78821af07..2d97f19eb 100644 --- a/src/game/WorldHandlers/ItemHandler.cpp +++ b/src/game/WorldHandlers/ItemHandler.cpp @@ -1609,19 +1609,19 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) return; } - ItemReforgeEntry const* stats = sItemReforgeStore.LookupEntry(reforgeEntry); - if (!stats) - { - sLog.outDebug("WORLD: HandleReforgeItemOpcode - Player (Guid: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGuidStr().c_str(), reforgeEntry); - SendReforgeResult(false); - return; - } +// ItemReforgeEntry const* stats = sItemReforgeStore.LookupEntry(reforgeEntry); + //if (!stats) + //{ + // sLog.outDebug("WORLD: HandleReforgeItemOpcode - Player (Guid: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGuidStr().c_str(), reforgeEntry); + // SendReforgeResult(false); + // return; + //} - if (!item->GetReforgableStat(ItemModType(stats->SourceStat)) || item->GetReforgableStat(ItemModType(stats->FinalStat))) // Cheating, you cant reforge to a stat that the item already has, nor reforge from a stat that the item does not have - { - SendReforgeResult(false); - return; - } + //if (!item->GetReforgableStat(ItemModType(stats->SourceStat)) || item->GetReforgableStat(ItemModType(stats->FinalStat))) // Cheating, you cant reforge to a stat that the item already has, nor reforge from a stat that the item does not have + //{ + // SendReforgeResult(false); + // return; + //} if (player->GetMoney() < uint64(item->GetSpecialPrice())) // cheating { diff --git a/src/game/WorldHandlers/LFGMgr.cpp b/src/game/WorldHandlers/LFGMgr.cpp index 545030481..f1f6ee7e7 100644 --- a/src/game/WorldHandlers/LFGMgr.cpp +++ b/src/game/WorldHandlers/LFGMgr.cpp @@ -198,32 +198,32 @@ void LFGMgr::JoinLFG(uint32 roles, std::set dungeons, std::string commen if (result == ERR_LFG_OK) { // additional checks on dungeon selection - for (std::set::iterator it = dungeons.begin(); it != dungeons.end(); ++it) - { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*it); - switch (dungeon->typeID) - { - case LFG_TYPE_RANDOM_DUNGEON: - if (dungeons.size() > 1) - result = ERR_LFG_INVALID_SLOT; - else - isRandom = true; - case LFG_TYPE_DUNGEON: - case LFG_TYPE_HEROIC_DUNGEON: - if (isRaid) - result = ERR_LFG_MISMATCHED_SLOTS; - isDungeon = true; - break; - case LFG_TYPE_RAID: - if (isDungeon) - result = ERR_LFG_MISMATCHED_SLOTS; - isRaid = true; - break; - default: // one of the other types - result = ERR_LFG_INVALID_SLOT; - break; - } - } + //for (std::set::iterator it = dungeons.begin(); it != dungeons.end(); ++it) + //{ + // LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*it); + // switch (dungeon->typeID) + // { + // case LFG_TYPE_RANDOM_DUNGEON: + // if (dungeons.size() > 1) + // result = ERR_LFG_INVALID_SLOT; + // else + // isRandom = true; + // case LFG_TYPE_DUNGEON: + // case LFG_TYPE_HEROIC_DUNGEON: + // if (isRaid) + // result = ERR_LFG_MISMATCHED_SLOTS; + // isDungeon = true; + // break; + // case LFG_TYPE_RAID: + // if (isDungeon) + // result = ERR_LFG_MISMATCHED_SLOTS; + // isRaid = true; + // break; + // default: // one of the other types + // result = ERR_LFG_INVALID_SLOT; + // break; + // } + //} } // since our join result may have just changed, check it again @@ -234,23 +234,23 @@ void LFGMgr::JoinLFG(uint32 roles, std::set dungeons, std::string commen // store the current dungeon id (replaced into the dungeon set later) randomDungeonID = *dungeons.begin(); // fetch all dungeons with our groupID and add to set - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*dungeons.begin()); + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*dungeons.begin()); - if (dungeon) - { - uint32 group = dungeon->group_id; + //if (dungeon) + //{ + // uint32 group = dungeon->group_id; - for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) - { - LfgDungeonsEntry const* dungeonList = sLfgDungeonsStore.LookupEntry(id); - if (dungeonList) - { - if (dungeonList->group_id == group) - dungeons.insert(dungeonList->ID); // adding to set - } - } - } - else + // for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) + // { + // LfgDungeonsEntry const* dungeonList = sLfgDungeonsStore.LookupEntry(id); + // if (dungeonList) + // { + // if (dungeonList->group_id == group) + // dungeons.insert(dungeonList->ID); // adding to set + // } + // } + //} + //else result = ERR_LFG_NO_LFG_OBJECT; } } @@ -567,67 +567,67 @@ void LFGMgr::SetPlayerUpdateType(ObjectGuid guid, LfgUpdateType updateType) ItemRewards LFGMgr::GetDungeonItemRewards(uint32 dungeonId, DungeonTypes type) { ItemRewards rewards; - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonId); - if (dungeon) - { - uint32 minLevel = dungeon->minLevel; - uint32 maxLevel = dungeon->maxLevel; - uint32 avgLevel = (minLevel+maxLevel)/2; // otherwise there are issues + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonId); + //if (dungeon) + //{ + // uint32 minLevel = dungeon->minLevel; + // uint32 maxLevel = dungeon->maxLevel; + // uint32 avgLevel = (minLevel+maxLevel)/2; // otherwise there are issues - DungeonFinderItemsMap const& itemBuffer = sObjectMgr.GetDungeonFinderItemsMap(); - for (DungeonFinderItemsMap::const_iterator it = itemBuffer.begin(); it != itemBuffer.end(); ++it) - { - DungeonFinderItems itemCache = it->second; - if (itemCache.dungeonType == type) - { - // should only be one of this inequality in the map - if ((avgLevel >= itemCache.minLevel) && (avgLevel <= itemCache.maxLevel)) - { - rewards.itemId = itemCache.itemReward; - rewards.itemAmount = itemCache.itemAmount; - return rewards; - } - } - } - } + // DungeonFinderItemsMap const& itemBuffer = sObjectMgr.GetDungeonFinderItemsMap(); + // for (DungeonFinderItemsMap::const_iterator it = itemBuffer.begin(); it != itemBuffer.end(); ++it) + // { + // DungeonFinderItems itemCache = it->second; + // if (itemCache.dungeonType == type) + // { + // // should only be one of this inequality in the map + // if ((avgLevel >= itemCache.minLevel) && (avgLevel <= itemCache.maxLevel)) + // { + // rewards.itemId = itemCache.itemReward; + // rewards.itemAmount = itemCache.itemAmount; + // return rewards; + // } + // } + // } + //} return rewards; } DungeonTypes LFGMgr::GetDungeonType(uint32 dungeonId) { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonId); - if (dungeon) - { - switch (dungeon->expansionLevel) - { - case 0: - return DUNGEON_CLASSIC; - case 1: - { - if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) - { - return DUNGEON_TBC; - } - else if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) - { - return DUNGEON_TBC_HEROIC; - } - } - case 2: - { - if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) - { - return DUNGEON_WOTLK; - } - else if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) - { - return DUNGEON_WOTLK_HEROIC; - } - } - default: - return DUNGEON_UNKNOWN; - } - } + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonId); + //if (dungeon) + //{ + // switch (dungeon->expansionLevel) + // { + // case 0: + // return DUNGEON_CLASSIC; + // case 1: + // { + // if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) + // { + // return DUNGEON_TBC; + // } + // else if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) + // { + // return DUNGEON_TBC_HEROIC; + // } + // } + // case 2: + // { + // if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) + // { + // return DUNGEON_WOTLK; + // } + // else if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) + // { + // return DUNGEON_WOTLK_HEROIC; + // } + // } + // default: + // return DUNGEON_UNKNOWN; + // } + //} return DUNGEON_UNKNOWN; } @@ -703,18 +703,18 @@ dungeonEntries LFGMgr::FindRandomDungeonsForPlayer(uint32 level, uint8 expansion dungeonEntries randomDungeons; // go through the dungeon dbc and select the applicable dungeons - for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) - { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(id); - if (dungeon) - { - if ( (dungeon->typeID == LFG_TYPE_RANDOM_DUNGEON) - || (IsSeasonal(dungeon->flags) && IsSeasonActive(dungeon->ID)) ) - if ((uint8)dungeon->expansionLevel <= expansion && dungeon->minLevel <= level - && dungeon->maxLevel >= level) - randomDungeons[dungeon->ID] = dungeon->Entry(); - } - } + //for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) + //{ + // LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(id); + // if (dungeon) + // { + // if ( (dungeon->typeID == LFG_TYPE_RANDOM_DUNGEON) + // || (IsSeasonal(dungeon->flags) && IsSeasonActive(dungeon->ID)) ) + // if ((uint8)dungeon->expansionLevel <= expansion && dungeon->minLevel <= level + // && dungeon->maxLevel >= level) + // randomDungeons[dungeon->ID] = dungeon->Entry(); + // } + //} return randomDungeons; } @@ -725,47 +725,47 @@ dungeonForbidden LFGMgr::FindRandomDungeonsNotForPlayer(Player* plr) dungeonForbidden randomDungeons; - for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) - { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(id); - if (dungeon) - { - uint32 forbiddenReason = 0; + //for (uint32 id = 0; id < sLfgDungeonsStore.GetNumRows(); ++id) + //{ + // LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(id); + // if (dungeon) + // { + // uint32 forbiddenReason = 0; - if ((uint8)dungeon->expansionLevel > expansion) - forbiddenReason = (uint32)LFG_FORBIDDEN_EXPANSION; - else if (dungeon->typeID == LFG_TYPE_RAID) - forbiddenReason = (uint32)LFG_FORBIDDEN_RAID; - else if (dungeon->minLevel > level) - forbiddenReason = (uint32)LFG_FORBIDDEN_LOW_LEVEL; - else if (dungeon->maxLevel < level) - forbiddenReason = (uint32)LFG_FORBIDDEN_HIGH_LEVEL; - else if (IsSeasonal(dungeon->flags) && !IsSeasonActive(dungeon->ID)) // check pointers/function args - forbiddenReason = (uint32)LFG_FORBIDDEN_NOT_IN_SEASON; - else if (DungeonFinderRequirements const* req = sObjectMgr.GetDungeonFinderRequirements((uint32)dungeon->mapID, dungeon->difficulty)) - { - if (req->minItemLevel && (plr->GetEquipGearScore(false,false) < req->minItemLevel)) - forbiddenReason = (uint32)LFG_FORBIDDEN_LOW_GEAR_SCORE; - else if (req->achievement && !plr->GetAchievementMgr().HasAchievement(req->achievement)) - forbiddenReason = (uint32)LFG_FORBIDDEN_MISSING_ACHIEVEMENT; - else if (plr->GetTeam() == ALLIANCE && req->allianceQuestId && !plr->GetQuestRewardStatus(req->allianceQuestId)) - forbiddenReason = (uint32)LFG_FORBIDDEN_QUEST_INCOMPLETE; - else if (plr->GetTeam() == HORDE && req->hordeQuestId && !plr->GetQuestRewardStatus(req->hordeQuestId)) - forbiddenReason = (uint32)LFG_FORBIDDEN_QUEST_INCOMPLETE; - else - if (req->item) - { - if (!plr->HasItemCount(req->item, 1) && (!req->item2 || !plr->HasItemCount(req->item2, 1))) - forbiddenReason = LFG_FORBIDDEN_MISSING_ITEM; - } - else if (req->item2 && !plr->HasItemCount(req->item2, 1)) - forbiddenReason = LFG_FORBIDDEN_MISSING_ITEM; - } + // if ((uint8)dungeon->expansionLevel > expansion) + // forbiddenReason = (uint32)LFG_FORBIDDEN_EXPANSION; + // else if (dungeon->typeID == LFG_TYPE_RAID) + // forbiddenReason = (uint32)LFG_FORBIDDEN_RAID; + // else if (dungeon->minLevel > level) + // forbiddenReason = (uint32)LFG_FORBIDDEN_LOW_LEVEL; + // else if (dungeon->maxLevel < level) + // forbiddenReason = (uint32)LFG_FORBIDDEN_HIGH_LEVEL; + // else if (IsSeasonal(dungeon->flags) && !IsSeasonActive(dungeon->ID)) // check pointers/function args + // forbiddenReason = (uint32)LFG_FORBIDDEN_NOT_IN_SEASON; + // else if (DungeonFinderRequirements const* req = sObjectMgr.GetDungeonFinderRequirements((uint32)dungeon->mapID, dungeon->difficulty)) + // { + // if (req->minItemLevel && (plr->GetEquipGearScore(false,false) < req->minItemLevel)) + // forbiddenReason = (uint32)LFG_FORBIDDEN_LOW_GEAR_SCORE; + // else if (req->achievement && !plr->GetAchievementMgr().HasAchievement(req->achievement)) + // forbiddenReason = (uint32)LFG_FORBIDDEN_MISSING_ACHIEVEMENT; + // else if (plr->GetTeam() == ALLIANCE && req->allianceQuestId && !plr->GetQuestRewardStatus(req->allianceQuestId)) + // forbiddenReason = (uint32)LFG_FORBIDDEN_QUEST_INCOMPLETE; + // else if (plr->GetTeam() == HORDE && req->hordeQuestId && !plr->GetQuestRewardStatus(req->hordeQuestId)) + // forbiddenReason = (uint32)LFG_FORBIDDEN_QUEST_INCOMPLETE; + // else + // if (req->item) + // { + // if (!plr->HasItemCount(req->item, 1) && (!req->item2 || !plr->HasItemCount(req->item2, 1))) + // forbiddenReason = LFG_FORBIDDEN_MISSING_ITEM; + // } + // else if (req->item2 && !plr->HasItemCount(req->item2, 1)) + // forbiddenReason = LFG_FORBIDDEN_MISSING_ITEM; + // } - if (forbiddenReason) - randomDungeons[dungeon->Entry()] = forbiddenReason; - } - } + // if (forbiddenReason) + // randomDungeons[dungeon->Entry()] = forbiddenReason; + // } + //} return randomDungeons; } @@ -793,18 +793,18 @@ void LFGMgr::UpdateNeededRoles(ObjectGuid guid, LFGPlayers* information) std::set::iterator itr = information->dungeonList.begin(); - // check dungeon type for max of each role [normal heroic etc.] - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*itr); - if (dungeon) - { - // atm we're just handling DUNGEON_DIFFICULTY_NORMAL - if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) - { - information->neededTanks = NORMAL_TANK_OR_HEALER_COUNT - tankCount; - information->neededHealers = NORMAL_TANK_OR_HEALER_COUNT - healCount; - information->neededDps = NORMAL_DAMAGE_COUNT - dpsCount; - } - } + //// check dungeon type for max of each role [normal heroic etc.] + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(*itr); + //if (dungeon) + //{ + // // atm we're just handling DUNGEON_DIFFICULTY_NORMAL + // if (dungeon->difficulty == DUNGEON_DIFFICULTY_NORMAL) + // { + // information->neededTanks = NORMAL_TANK_OR_HEALER_COUNT - tankCount; + // information->neededHealers = NORMAL_TANK_OR_HEALER_COUNT - healCount; + // information->neededDps = NORMAL_DAMAGE_COUNT - dpsCount; + // } + //} m_playerData[guid] = *information; } @@ -1112,12 +1112,12 @@ void LFGMgr::SendQueueStatus() uint32 LFGMgr::GetDungeonEntry(uint32 ID) { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(ID); - if (dungeon) - { - return dungeon->Entry(); - } - else + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(ID); + //if (dungeon) + //{ + // return dungeon->Entry(); + //} + //else { return 0; } @@ -1524,21 +1524,21 @@ void LFGMgr::CreateDungeonGroup(LFGProposal* proposal) } // set dungeon difficulty for group - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(proposal->dungeonID); - if (!dungeon) - { - return; - } + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(proposal->dungeonID); + //if (!dungeon) + //{ + // return; + //} - pGroup->SetDungeonDifficulty(Difficulty(dungeon->difficulty)); //todo: check for raids and if so call setraiddifficulty + //pGroup->SetDungeonDifficulty(Difficulty(dungeon->difficulty)); //todo: check for raids and if so call setraiddifficulty - // Add group to our group set and group map, then teleport to the dungeon - ObjectGuid groupGuid = pGroup->GetObjectGuid(); - LFGGroupStatus groupStatus(LFG_STATE_IN_DUNGEON, dungeon->ID, proposal->currentRoles, pGroup->GetLeaderGuid()); + //// Add group to our group set and group map, then teleport to the dungeon + //ObjectGuid groupGuid = pGroup->GetObjectGuid(); + //LFGGroupStatus groupStatus(LFG_STATE_IN_DUNGEON, dungeon->ID, proposal->currentRoles, pGroup->GetLeaderGuid()); - m_groupSet.insert(groupGuid); - m_groupStatusMap[groupGuid] = groupStatus; - TeleportToDungeon(dungeon->ID, pGroup); + //m_groupSet.insert(groupGuid); + //m_groupStatusMap[groupGuid] = groupStatus; + //TeleportToDungeon(dungeon->ID, pGroup); pGroup->SendUpdate(); } @@ -1547,38 +1547,38 @@ void LFGMgr::TeleportToDungeon(uint32 dungeonID, Group* pGroup) { // if the group's leader is already in the dungeon, teleport anyone not in dungeon to them // if nobody is in the dungeon, teleport all to beginning of dungeon (sObjectMgr.GetMapEntranceTrigger(mapid [not dungeonid])) - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonID); - if (!dungeon || !pGroup) - { - return; - } + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(dungeonID); + //if (!dungeon || !pGroup) + //{ + // return; + //} - uint32 mapID = (uint32)dungeon->mapID; - float x, y, z, o; - LFGTeleportError err = LFG_TELEPORTERROR_OK; + //uint32 mapID = (uint32)dungeon->mapID; + //float x, y, z, o; + //LFGTeleportError err = LFG_TELEPORTERROR_OK; - Player* pGroupLeader = ObjectAccessor::FindPlayer(pGroup->GetLeaderGuid()); + //Player* pGroupLeader = ObjectAccessor::FindPlayer(pGroup->GetLeaderGuid()); - if (pGroupLeader && pGroupLeader->GetMapId() == mapID) // Already in the dungeon - { - // set teleport location to that of the group leader - x = pGroupLeader->GetPositionX(); - y = pGroupLeader->GetPositionY(); - z = pGroupLeader->GetPositionZ(); - o = pGroupLeader->GetOrientation(); - } - else - { - if (AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(mapID)) - { - x = at->target_X; - y = at->target_Y; - z = at->target_Z; - o = at->target_Orientation; - } - else - err = LFG_TELEPORTERROR_INVALID_LOCATION; - } + //if (pGroupLeader && pGroupLeader->GetMapId() == mapID) // Already in the dungeon + //{ + // // set teleport location to that of the group leader + // x = pGroupLeader->GetPositionX(); + // y = pGroupLeader->GetPositionY(); + // z = pGroupLeader->GetPositionZ(); + // o = pGroupLeader->GetOrientation(); + //} + //else + //{ + // if (AreaTrigger const* at = sObjectMgr.GetMapEntranceTrigger(mapID)) + // { + // x = at->target_X; + // y = at->target_Y; + // z = at->target_Z; + // o = at->target_Orientation; + // } + // else + // err = LFG_TELEPORTERROR_INVALID_LOCATION; + //} dungeonForbidden lockedDungeons; for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) @@ -1596,23 +1596,23 @@ void LFGMgr::TeleportToDungeon(uint32 dungeonID, Group* pGroup) plrErr = LFG_TELEPORTERROR_IN_VEHICLE; lockedDungeons = FindRandomDungeonsNotForPlayer(pGroupPlr); - if (lockedDungeons.find(dungeon->Entry()) != lockedDungeons.end()) - plrErr = LFG_TELEPORTERROR_INVALID_LOCATION; + //if (lockedDungeons.find(dungeon->Entry()) != lockedDungeons.end()) + // plrErr = LFG_TELEPORTERROR_INVALID_LOCATION; - if (err == LFG_TELEPORTERROR_OK && plrErr == LFG_TELEPORTERROR_OK && pGroupPlr->GetMapId() != mapID) - { - if (pGroupPlr->GetMap() && !pGroupPlr->GetMap()->IsDungeon() && !pGroupPlr->GetMap()->IsRaid() && !pGroupPlr->InBattleGround()) - pGroupPlr->SetBattleGroundEntryPoint(); // store current position and such + //if (err == LFG_TELEPORTERROR_OK && plrErr == LFG_TELEPORTERROR_OK && pGroupPlr->GetMapId() != mapID) + //{ + // if (pGroupPlr->GetMap() && !pGroupPlr->GetMap()->IsDungeon() && !pGroupPlr->GetMap()->IsRaid() && !pGroupPlr->InBattleGround()) + // pGroupPlr->SetBattleGroundEntryPoint(); // store current position and such - if (!pGroupPlr->TeleportTo(mapID, x, y, z, o)) - plrErr = LFG_TELEPORTERROR_INVALID_LOCATION; - } + // if (!pGroupPlr->TeleportTo(mapID, x, y, z, o)) + // plrErr = LFG_TELEPORTERROR_INVALID_LOCATION; + //} - if (err != LFG_TELEPORTERROR_OK) - pGroupPlr->GetSession()->SendLfgTeleportError(err); - else if (plrErr != LFG_TELEPORTERROR_OK) - pGroupPlr->GetSession()->SendLfgTeleportError(plrErr); - else + //if (err != LFG_TELEPORTERROR_OK) + // pGroupPlr->GetSession()->SendLfgTeleportError(err); + //else if (plrErr != LFG_TELEPORTERROR_OK) + // pGroupPlr->GetSession()->SendLfgTeleportError(plrErr); + //else SetPlayerState(pGroupPlr->GetObjectGuid(), LFG_STATE_IN_DUNGEON); } } @@ -1633,9 +1633,9 @@ void LFGMgr::TeleportPlayer(Player* pPlayer, bool out) // Get dungeon info and then teleport the player out if applicable if (out) { - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(status->dungeonID); - if (dungeon && pPlayer->GetMapId() == dungeon->mapID) - pPlayer->TeleportToBGEntryPoint(); + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(status->dungeonID); + //if (dungeon && pPlayer->GetMapId() == dungeon->mapID) + // pPlayer->TeleportToBGEntryPoint(); } } @@ -1806,9 +1806,9 @@ void LFGMgr::HandleBossKilled(Player* pPlayer) // check if player did a random dungeon uint32 randomDungeonId = 0; - LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(status->dungeonID); - if (dungeon->typeID == LFG_TYPE_RANDOM_DUNGEON || IsSeasonal(dungeon->flags)) - randomDungeonId = dungeon->ID; + //LfgDungeonsEntry const* dungeon = sLfgDungeonsStore.LookupEntry(status->dungeonID); + //if (dungeon->typeID == LFG_TYPE_RANDOM_DUNGEON || IsSeasonal(dungeon->flags)) + // randomDungeonId = dungeon->ID; // get rewards uint32 groupPlrLevel = pGroupPlr->getLevel(); diff --git a/src/game/WorldHandlers/PetHandler.cpp b/src/game/WorldHandlers/PetHandler.cpp index 4f751ff17..4ea8cf180 100644 --- a/src/game/WorldHandlers/PetHandler.cpp +++ b/src/game/WorldHandlers/PetHandler.cpp @@ -248,7 +248,7 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data) SpellCastResult result = spell->CheckPetCast(unit_target); - const SpellRangeEntry* sRange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex); + const SpellRangeEntry* sRange = sSpellRangeStore.LookupEntry(spellInfo->GetRangeIndex()); if (unit_target && !(pet->IsWithinDistInMap(unit_target, sRange->maxRange) && pet->IsWithinLOSInMap(unit_target)) && !(GetPlayer()->IsFriendlyTo(unit_target) || pet->HasAuraType(SPELL_AURA_MOD_POSSESS))) diff --git a/src/game/WorldHandlers/Spell.cpp b/src/game/WorldHandlers/Spell.cpp index f6db62093..13eacb654 100644 --- a/src/game/WorldHandlers/Spell.cpp +++ b/src/game/WorldHandlers/Spell.cpp @@ -379,14 +379,14 @@ Spell::Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid or MANGOS_ASSERT(caster != NULL && info != NULL); MANGOS_ASSERT(info == sSpellStore.LookupEntry(info->Id) && "`info` must be pointer to sSpellStore element"); - if (info->SpellDifficultyId && caster->IsInWorld() && caster->GetMap()->IsDungeon()) - { - if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(info->SpellDifficultyId, caster->GetMap()->GetDifficulty(), caster->GetMap()->IsRaid())) - m_spellInfo = spellEntry; - else - m_spellInfo = info; - } - else + //if (info->SpellDifficultyId && caster->IsInWorld() && caster->GetMap()->IsDungeon()) + //{ + // if (SpellEntry const* spellEntry = GetSpellEntryByDifficulty(info->SpellDifficultyId, caster->GetMap()->GetDifficulty(), caster->GetMap()->IsRaid())) + // m_spellInfo = spellEntry; + // else + // m_spellInfo = info; + //} + //else m_spellInfo = info; m_triggeredBySpellInfo = triggeredBy; @@ -496,7 +496,7 @@ template WorldObject* Spell::FindCorpseUsing() { // non-standard target selection - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex()); float max_range = GetSpellMaxRange(srange); WorldObject* result = NULL; @@ -960,7 +960,7 @@ void Spell::AddUnitTarget(Unit* pVictim, SpellEffectIndex effIndex) WorldObject* affectiveObject = GetAffectiveCasterObject(); // Spell have speed (possible inherited from triggering spell) - need calculate incoming time - float speed = m_spellInfo->speed == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->speed : m_spellInfo->speed; + float speed = m_spellInfo->GetSpeed() == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->GetSpeed() : m_spellInfo->GetSpeed(); if (speed > 0.0f && affectiveObject && (pVictim != affectiveObject || (m_targets.m_targetMask & (TARGET_FLAG_SOURCE_LOCATION | TARGET_FLAG_DEST_LOCATION)))) { // calculate spell incoming interval @@ -984,13 +984,13 @@ void Spell::AddUnitTarget(Unit* pVictim, SpellEffectIndex effIndex) m_delayMoment = target.timeDelay; } // Spell casted on self - mostly TRIGGER_MISSILE code - else if (m_spellInfo->speed > 0.0f && affectiveObject && pVictim == affectiveObject) + else if (m_spellInfo->GetSpeed() > 0.0f && affectiveObject && pVictim == affectiveObject) { float dist = 0.0f; if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) dist = affectiveObject->GetDistance(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ); - target.timeDelay = (uint64) floor(dist / m_spellInfo->speed * 1000.0f); + target.timeDelay = (uint64) floor(dist / m_spellInfo->GetSpeed() * 1000.0f); } else target.timeDelay = UI64LIT(0); @@ -1053,7 +1053,7 @@ void Spell::AddGOTarget(GameObject* pVictim, SpellEffectIndex effIndex) WorldObject* affectiveObject = GetAffectiveCasterObject(); // Spell can have speed - need calculate incoming time - float speed = m_spellInfo->speed == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->speed : m_spellInfo->speed; + float speed = m_spellInfo->GetSpeed() == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->GetSpeed() : m_spellInfo->GetSpeed(); if (speed > 0.0f && affectiveObject && pVictim != affectiveObject) { // calculate spell incoming interval @@ -1148,7 +1148,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) procVictim = PROC_FLAG_NONE; } - float speed = m_spellInfo->speed == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->speed : m_spellInfo->speed; + float speed = m_spellInfo->GetSpeed() == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->GetSpeed() : m_spellInfo->GetSpeed(); if (speed > 0.0f) { // mark effects that were already handled in Spell::HandleDelayedSpellLaunch on spell launch as processed @@ -1254,7 +1254,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Haunt (NOTE: for avoid use additional field damage stored in dummy value (replace unused 100%) // apply before deal damage because aura can be removed at target kill SpellClassOptionsEntry const *classOpt = m_spellInfo->GetSpellClassOptions(); - if (classOpt && classOpt->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellIconID == 3172 && + if (classOpt && classOpt->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->GetSpellIconID() == 3172 && (classOpt->SpellFamilyFlags & UI64LIT(0x0004000000000000))) if(Aura* dummy = unitTarget->GetDummyAura(m_spellInfo->Id)) dummy->GetModifier()->m_amount = damageInfo.damage; @@ -1325,7 +1325,7 @@ void Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask) Unit* realCaster = GetAffectiveCaster(); // Recheck immune (only for delayed spells) - float speed = m_spellInfo->speed == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->speed : m_spellInfo->speed; + float speed = m_spellInfo->GetSpeed() == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->GetSpeed() : m_spellInfo->GetSpeed(); if (speed && ( unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) || unit->IsImmuneToSpell(m_spellInfo, unit == realCaster))) @@ -1448,7 +1448,7 @@ void Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask) if (m_applyMultiplierMask & (1 << effectNumber)) { // Get multiplier - float multiplier = spellEffect ? spellEffect->EffectDamageMultiplier : 1.0f; + float multiplier = spellEffect ? spellEffect->DmgMultiplier : 1.0f; // Apply multiplier mods if (realCaster) if (Player* modOwner = realCaster->GetSpellModOwner()) @@ -1581,7 +1581,7 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo* target) if (m_applyMultiplierMask & (1 << effectNumber)) { // Get multiplier - float multiplier = spellEffect ? spellEffect->EffectDamageMultiplier : 1.0f; + float multiplier = spellEffect ? spellEffect->DmgMultiplier : 1.0f; // Apply multiplier mods if (real_caster) if (Player* modOwner = real_caster->GetSpellModOwner()) @@ -2178,7 +2178,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& // search all GO's with entry, within range of m_destN MaNGOS::GameObjectEntryInPosRangeCheck go_check(*m_caster, i_spellST->targetEntry, x, y, z, radius); MaNGOS::GameObjectListSearcher checker(tempTargetGOList, go_check); - Cell::VisitGridObjects(m_caster, checker, radius + GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex))); + Cell::VisitGridObjects(m_caster, checker, radius + GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex()))); } } @@ -2189,7 +2189,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& { MaNGOS::GameObjectTypeInPosRangeCheck go_check(*m_caster, GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING, x, y, z, radius, spellEffect->Effect == SPELL_EFFECT_WMO_DAMAGE, spellEffect->Effect == SPELL_EFFECT_WMO_REPAIR); MaNGOS::GameObjectListSearcher checker(tempTargetGOList, go_check); - Cell::VisitGridObjects(m_caster, checker, radius + GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex))); + Cell::VisitGridObjects(m_caster, checker, radius + GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex()))); } } @@ -2365,7 +2365,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& targetUnitMap.push_back(target); } // Circle of Healing - else if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_PRIEST && m_spellInfo->SpellVisual[0] == 8253) + else if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_PRIEST && m_spellInfo->GetSpellVisual() == 8253) { Unit* target = m_targets.getUnitTarget(); if (!target) @@ -2379,7 +2379,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, target, radius, count, true, false, true); } // Wild Growth - else if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_DRUID && m_spellInfo->SpellIconID == 2864) + else if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_DRUID && m_spellInfo->GetSpellIconID() == 2864) { Unit* target = m_targets.getUnitTarget(); if (!target) @@ -2454,7 +2454,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& case TARGET_IN_FRONT_OF_CASTER: { SpellNotifyPushType pushType = PUSH_IN_FRONT; - switch (m_spellInfo->SpellVisual[0]) // Some spell require a different target fill + switch (m_spellInfo->GetSpellVisual()) // Some spell require a different target fill { case 3879: pushType = PUSH_IN_BACK; break; case 7441: pushType = PUSH_IN_FRONT_15; break; @@ -2881,7 +2881,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& { if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) { - SpellRangeEntry const* rEntry = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex); + SpellRangeEntry const* rEntry = sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex()); float minRange = GetSpellMinRange(rEntry); float maxRange = GetSpellMaxRange(rEntry); float dist = minRange + rand_norm_f() * (maxRange - minRange); @@ -3028,7 +3028,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& break; case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: // AreaAura - if ((m_spellInfo->Attributes == (SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_CASTABLE_WHILE_MOUNTED | SPELL_ATTR_CASTABLE_WHILE_SITTING)) || (m_spellInfo->Attributes == SPELL_ATTR_NOT_SHAPESHIFT)) + if ((m_spellInfo->GetAttributes() == (SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_CASTABLE_WHILE_MOUNTED | SPELL_ATTR_CASTABLE_WHILE_SITTING)) || (m_spellInfo->GetAttributes() == SPELL_ATTR_NOT_SHAPESHIFT)) SetTargetMap(effIndex, TARGET_AREAEFFECT_PARTY, targetUnitMap); break; case SPELL_EFFECT_SKIN_PLAYER_CORPSE: @@ -3393,7 +3393,7 @@ void Spell::cast(bool skipCheck) else if (m_spellInfo->Id == 71904) AddTriggeredSpell(73422); // Weak Alcohol - else if (m_spellInfo->SpellIconID == 1306 && m_spellInfo->SpellVisual[0] == 11359) + else if (m_spellInfo->Id == 1306 && m_spellInfo->GetSpellVisual(0) == 11359) AddTriggeredSpell(51655); // BOTM - Create Empty Brew Bottle break; } @@ -3608,7 +3608,7 @@ void Spell::cast(bool skipCheck) procTarget = m_caster; // Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells - float speed = m_spellInfo->speed == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->speed : m_spellInfo->speed; + float speed = m_spellInfo->GetSpeed() == 0.0f && m_triggeredBySpellInfo ? m_triggeredBySpellInfo->GetSpeed() : m_spellInfo->GetSpeed(); if (speed > 0.0f) { @@ -4215,7 +4215,7 @@ void Spell::SendSpellStart() if ((m_caster->GetTypeId() == TYPEID_PLAYER || m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsPet()) && - m_spellInfo->powerType != POWER_HEALTH) + m_spellInfo->GetPowerType() != POWER_HEALTH) castFlags |= CAST_FLAG_PREDICTED_POWER; if (m_casttime && (IsSpellHaveEffect(m_spellInfo, SPELL_EFFECT_HEAL) || IsSpellHaveEffect(m_spellInfo, SPELL_EFFECT_HEAL_PCT)) || @@ -4240,7 +4240,7 @@ void Spell::SendSpellStart() data << m_targets; if (castFlags & CAST_FLAG_PREDICTED_POWER) // predicted power - data << uint32(m_caster->GetPower(Powers(m_spellInfo->powerType))); + data << uint32(m_caster->GetPower(Powers(m_spellInfo->GetPowerType()))); if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes { @@ -4314,7 +4314,7 @@ void Spell::SendSpellGo() if ((m_caster->GetTypeId() == TYPEID_PLAYER || m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsPet()) && - m_spellInfo->powerType != POWER_HEALTH) + m_spellInfo->GetPowerType() != POWER_HEALTH) castFlags |= CAST_FLAG_PREDICTED_POWER; if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_DEATH_KNIGHT && m_spellInfo->runeCostID) @@ -4342,7 +4342,7 @@ void Spell::SendSpellGo() data << m_targets; if (castFlags & CAST_FLAG_PREDICTED_POWER) // predicted power - data << uint32(m_caster->GetPower(Powers(m_spellInfo->powerType))); + data << uint32(m_caster->GetPower(Powers(m_spellInfo->GetPowerType()))); if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes { @@ -4864,10 +4864,11 @@ void Spell::TakePower() return; } + Powers powerType = Powers(m_spellInfo->GetPowerType()); bool hit = true; if (m_caster->GetTypeId() == TYPEID_PLAYER) { - if (m_spellInfo->powerType == POWER_RAGE || m_spellInfo->powerType == POWER_ENERGY || m_spellInfo->powerType == POWER_HOLY_POWER) + if (powerType == POWER_RAGE || powerType == POWER_ENERGY || powerType == POWER_HOLY_POWER) { ObjectGuid targetGuid = m_targets.getUnitTargetGuid(); if (!targetGuid.IsEmpty()) @@ -4888,20 +4889,19 @@ void Spell::TakePower() } // health as power used - if (m_spellInfo->powerType == POWER_HEALTH) + if (powerType == POWER_HEALTH) { m_caster->ModifyHealth(-(int32)m_powerCost); m_caster->SendSpellNonMeleeDamageLog(m_caster, m_spellInfo->Id, m_powerCost, GetSpellSchoolMask(m_spellInfo), 0, 0, false, 0, false); return; } - if (m_spellInfo->powerType >= MAX_POWERS) + if (powerType >= MAX_POWERS) { - sLog.outError("Spell::TakePower: Unknown power type '%d'", m_spellInfo->powerType); + sLog.outError("Spell::TakePower: Unknown power type '%d'", powerType); return; } - Powers powerType = Powers(m_spellInfo->powerType); if (powerType == POWER_HOLY_POWER) { @@ -5543,7 +5543,7 @@ SpellCastResult Spell::CheckCast(bool strict) // Fire Shield if (classOptions && classOptions->SpellFamilyName == SPELLFAMILY_WARLOCK && - m_spellInfo->SpellIconID == 16) + m_spellInfo->GetSpellIconID() == 16) return SPELL_FAILED_BAD_TARGETS; // Focus Magic (main spell) @@ -5695,7 +5695,7 @@ SpellCastResult Spell::CheckCast(bool strict) } // Must be behind the target. - if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK9) && target->HasInArc(M_PI_F, m_caster)) + if (m_spellInfo->GetAttributesEx2() == SPELL_ATTR_EX2_UNK20 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK9) && target->HasInArc(M_PI_F, m_caster)) { // Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags // Exclusion for Mutilate:Facing Limitation was removed in 2.0.1 and 3.0.3, but they still use the same, old Ex-Flags @@ -5710,7 +5710,7 @@ SpellCastResult Spell::CheckCast(bool strict) } // Target must be facing you. - if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(M_PI_F, m_caster)) + if ((m_spellInfo->GetAttributes() == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(M_PI_F, m_caster)) { SendInterrupted(2); return SPELL_FAILED_NOT_INFRONT; @@ -5803,7 +5803,7 @@ SpellCastResult Spell::CheckCast(bool strict) sLog.outErrorDb("Spell entry %u, effect %i has EffectImplicitTargetA/EffectImplicitTargetB = TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT, but gameobject are not defined in `spell_script_target`", m_spellInfo->Id, j); } - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex()); float range = GetSpellMaxRange(srange); // override range with default when it's not provided @@ -6051,7 +6051,7 @@ SpellCastResult Spell::CheckCast(bool strict) { UnitList targets; - float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck unitCheck(m_caster, m_caster, radius); MaNGOS::UnitListSearcher checker(targets, unitCheck); @@ -6069,7 +6069,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_AFFECTING_COMBAT; } } - else if (m_spellInfo->SpellIconID == 156) // Holy Shock + else if (m_spellInfo->GetSpellIconID() == 156) // Holy Shock { // spell different for friends and enemies // hart version required facing @@ -6079,7 +6079,7 @@ SpellCastResult Spell::CheckCast(bool strict) } } // Fire Nova - if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_SHAMAN && m_spellInfo->SpellIconID == 33) + if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_SHAMAN && m_spellInfo->GetSpellIconID() == 33) { // fire totems slot if (!m_caster->GetTotemGuid(TOTEM_SLOT_FIRE)) @@ -6112,7 +6112,7 @@ SpellCastResult Spell::CheckCast(bool strict) case SPELL_EFFECT_SCHOOL_DAMAGE: { // Hammer of Wrath - if (m_spellInfo->SpellVisual[0] == 7250) + if (m_spellInfo->GetSpellVisual() == 7250) { if (!m_targets.getUnitTarget()) { @@ -7107,7 +7107,7 @@ SpellCastResult Spell::CheckCasterAuras() const if (unitflag & UNIT_FLAG_STUNNED) { // Pain Suppression (have SPELL_ATTR_EX5_USABLE_WHILE_STUNNED that must be used only with glyph) - if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_PRIEST && m_spellInfo->SpellIconID == 2178) + if (m_spellInfo->GetSpellFamilyName() == SPELLFAMILY_PRIEST && m_spellInfo->GetSpellIconID() == 2178) { if (!m_caster->HasAura(63248)) // Glyph of Pain Suppression spellUsableWhileStunned = false; @@ -7279,8 +7279,9 @@ SpellCastResult Spell::CheckRange(bool strict) { Unit* target = m_targets.getUnitTarget(); + uint32 rangeIndex = m_spellInfo->GetRangeIndex(); // special range cases - switch (m_spellInfo->rangeIndex) + switch (rangeIndex) { // self cast doesn't need range checking -- also for Starshards fix // spells that can be cast anywhere also need no check @@ -7314,7 +7315,7 @@ SpellCastResult Spell::CheckRange(bool strict) // add radius of caster and ~5 yds "give" for non stricred (landing) check float range_mod = strict ? 1.25f : 6.25; - SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex); + SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(rangeIndex); bool friendly = target ? target->IsFriendlyTo(m_caster) : false; float max_range = GetSpellMaxRange(srange, friendly) + range_mod; float min_range = GetSpellMinRange(srange, friendly); @@ -7325,7 +7326,7 @@ SpellCastResult Spell::CheckRange(bool strict) if (target && target != m_caster) { // distance from target in checks - float dist = m_caster->GetCombatDistance(target, m_spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT); + float dist = m_caster->GetCombatDistance(target, rangeIndex == SPELL_RANGE_IDX_COMBAT); if (dist > max_range) { @@ -7364,20 +7365,21 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel return 0; } + Powers powerType = Powers(spellInfo->GetPowerType()); // Spell drain all exist power on cast (Only paladin lay of Hands) if (spellInfo->HasAttribute(SPELL_ATTR_EX_DRAIN_ALL_POWER)) { // If power type - health drain all - if (spellInfo->powerType == POWER_HEALTH) + if (powerType == POWER_HEALTH) { return caster->GetHealth(); } // Else drain all power - if (spellInfo->powerType < MAX_POWERS) + if (powerType < MAX_POWERS) { - return caster->GetPower(Powers(spellInfo->powerType)); + return caster->GetPower(Powers(powerType)); } - sLog.outError("Spell::CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); + sLog.outError("Spell::CalculateManaCost: Unknown power type '%d' in spell %d", powerType, spellInfo->Id); return 0; } @@ -7386,7 +7388,7 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel // PCT cost from total amount if (uint32 manaCostPct = spellInfo->GetManaCostPercentage()) { - switch (spellInfo->powerType) + switch (powerType) { // health as power used case POWER_HEALTH: @@ -7398,14 +7400,14 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel case POWER_RAGE: case POWER_FOCUS: case POWER_ENERGY: - powerCost += manaCostPct * caster->GetMaxPower(Powers(spellInfo->powerType)) / 100; + powerCost += manaCostPct * caster->GetMaxPower(Powers(powerType)) / 100; break; case POWER_RUNE: case POWER_RUNIC_POWER: DEBUG_LOG("Spell::CalculateManaCost: Not implemented yet!"); break; default: - sLog.outError("Spell::CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); + sLog.outError("Spell::CalculateManaCost: Unknown power type '%d' in spell %d", powerType, spellInfo->Id); return 0; } } @@ -7416,7 +7418,7 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel for (Unit::AuraList::const_iterator itr = pwrCostAuras.begin(); itr != pwrCostAuras.end(); ++itr) { if (((*itr)->GetModifier()->m_miscvalue & schoolMask) && - (!(*itr)->GetSpellEffect()->EffectMiscValueB || (*itr)->GetSpellEffect()->EffectMiscValueB & (1 << spellInfo->powerType))) + (!(*itr)->GetSpellEffect()->EffectMiscValueB || (*itr)->GetSpellEffect()->EffectMiscValueB & (1 << powerType))) powerCost += (*itr)->GetModifier()->m_amount; } @@ -7438,7 +7440,7 @@ uint32 Spell::CalculatePowerCost(SpellEntry const* spellInfo, Unit* caster, Spel for (Unit::AuraList::const_iterator itr = pwrCostPctAuras.begin(); itr != pwrCostPctAuras.end(); ++itr) { if (((*itr)->GetModifier()->m_miscvalue & schoolMask) && - (!(*itr)->GetSpellEffect()->EffectMiscValueB || (*itr)->GetSpellEffect()->EffectMiscValueB & (1 << spellInfo->powerType))) + (!(*itr)->GetSpellEffect()->EffectMiscValueB || (*itr)->GetSpellEffect()->EffectMiscValueB & (1 << powerType))) pctCostMultiplier += (*itr)->GetModifier()->m_amount / 100.0f; } @@ -7457,6 +7459,7 @@ SpellCastResult Spell::CheckPower() return SPELL_CAST_OK; } + Powers powerType = Powers(m_spellInfo->GetPowerType()); // Do precise power regen on spell cast if (m_powerCost > 0 && m_caster->GetTypeId() == TYPEID_PLAYER) { @@ -7467,7 +7470,7 @@ SpellCastResult Spell::CheckPower() } // health as power used - need check health amount - if (m_spellInfo->powerType == POWER_HEALTH) + if (powerType == POWER_HEALTH) { if (m_caster->GetHealth() <= m_powerCost) { @@ -7477,14 +7480,14 @@ SpellCastResult Spell::CheckPower() } // Check valid power type - if (m_spellInfo->powerType >= MAX_POWERS) + if (powerType >= MAX_POWERS) { - sLog.outError("Spell::CheckMana: Unknown power type '%d'", m_spellInfo->powerType); + sLog.outError("Spell::CheckMana: Unknown power type '%d'", powerType); return SPELL_FAILED_UNKNOWN; } // check rune cost only if a spell has PowerType == POWER_RUNE - if (m_spellInfo->powerType == POWER_RUNE) + if (powerType == POWER_RUNE) { SpellCastResult failReason = CheckRunePower(); if (failReason != SPELL_CAST_OK) @@ -7494,7 +7497,6 @@ SpellCastResult Spell::CheckPower() } // Check power amount - Powers powerType = Powers(m_spellInfo->powerType); if (m_caster->GetPower(powerType) < m_powerCost) { return SPELL_FAILED_NO_POWER; @@ -8331,8 +8333,8 @@ bool Spell::CheckTarget(Unit* target, SpellEffectIndex eff) bool Spell::IsNeedSendToClient() const { - return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || IsChanneledSpell(m_spellInfo) || - m_spellInfo->speed > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell); + return m_spellInfo->GetSpellVisual() || m_spellInfo->GetSpellVisual(1) || IsChanneledSpell(m_spellInfo) || + m_spellInfo->GetSpeed() > 0.0f || (!m_triggeredByAuraSpell && !m_IsTriggeredSpell); } bool Spell::IsTriggeredSpellWithRedundentCastTime() const @@ -8840,7 +8842,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r if (uint32 radiusIndex = spellEffect->GetRadiusIndex()) radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellEffect->GetRadiusIndex())); else - radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); if (Unit* realCaster = GetAffectiveCaster()) { if (Player* modOwner = realCaster->GetSpellModOwner()) @@ -8907,6 +8909,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r case 62978: // Summon Guardian (Ulduar, Yogg Saron) case 63018: // Searing Light (Ulduar, XT-002) case 63024: // Gravity Bomb (Ulduar, XT-002) + case 63387: // Rapid Burst case 63545: // Icicle (Ulduar, Hodir) case 63744: // Sara's Anger (Ulduar, Yogg-Saron) case 63745: // Sara's Blessing (Ulduar, Yogg-Saron) @@ -8919,6 +8922,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r case 64402: // Rocket Strike (Ulduar, Mimiron) case 64425: // Summon Scrap Bot Trigger (Ulduar, Mimiron) use for Assault Bots, hits npc 33856 case 64465: // Shadow Beacon (Ulduar, Yogg-Saron) + case 64531: // Rapid Burst (h) case 64543: // Melt Ice (Ulduar, Hodir) case 64623: // Frost Bomb (Ulduar, Mimiron) case 65121: // Searing Light (h) (Ulduar, XT-002) @@ -9078,7 +9082,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r case SPELLFAMILY_WARRIOR: { // Sunder Armor (main spell) - if (m_spellInfo->IsFitToFamilyMask(UI64LIT(0x0000000000004000), 0x00000000) && m_spellInfo->SpellVisual[0] == 406) + if (m_spellInfo->IsFitToFamilyMask(UI64LIT(0x0000000000004000), 0x00000000) && m_spellInfo->GetSpellVisual() == 406) if (m_caster->HasAura(58387)) // Glyph of Sunder Armor EffectChainTarget = 2; break; @@ -9092,7 +9096,7 @@ void Spell::GetSpellRangeAndRadius(SpellEffectEntry const* spellEffect, float& r } case SPELLFAMILY_DEATHKNIGHT: { - if (m_spellInfo->SpellIconID == 1737) // Corpse Explosion // TODO - spell 50445? + if (m_spellInfo->GetSpellIconID() == 1737) // Corpse Explosion // TODO - spell 50445? unMaxTargets = 1; break; } diff --git a/src/game/WorldHandlers/SpellAuras.cpp b/src/game/WorldHandlers/SpellAuras.cpp index 853140b36..40333ba56 100644 --- a/src/game/WorldHandlers/SpellAuras.cpp +++ b/src/game/WorldHandlers/SpellAuras.cpp @@ -1221,7 +1221,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) SpellClassOptionsEntry const * opt = spellProto->GetSpellClassOptions(); // Everlasting Affliction, overwrite wrong data, if will need more better restore support of spell_affect table - if (opt && spellProto->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && spellProto->SpellIconID == 3169) + if (opt && spellProto->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && spellProto->Id == 3169) { // Corruption and Unstable Affliction const_cast(opt)->SpellFamilyFlags = ClassFamilyMask(UI64LIT(0x0000010000000002)); @@ -2795,7 +2795,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) for (Unit::AuraList::const_iterator itr = modifierAuras.begin(); itr != modifierAuras.end(); ++itr) { // Unrelenting Assault - if ((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARRIOR && (*itr)->GetSpellProto()->SpellIconID == 2775) + if ((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARRIOR && (*itr)->GetSpellProto()->Id == 2775) { switch ((*itr)->GetSpellProto()->Id) { @@ -3439,7 +3439,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) case SPELLFAMILY_WARLOCK: { // Haunt - if (classOptions && GetSpellProto()->SpellIconID == 3172 && (classOptions->SpellFamilyFlags & UI64LIT(0x0004000000000000))) + if (classOptions && GetSpellProto()->Id == 3172 && (classOptions->SpellFamilyFlags & UI64LIT(0x0004000000000000))) { // NOTE: for avoid use additional field damage stored in dummy value (replace unused 100% if (apply) @@ -3531,14 +3531,14 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } // Predatory Strikes - if (target->GetTypeId() == TYPEID_PLAYER && GetSpellProto()->SpellIconID == 1563) + if (target->GetTypeId() == TYPEID_PLAYER && GetSpellProto()->Id == 1563) { ((Player*)target)->UpdateAttackPowerAndDamage(); return; } // Improved Moonkin Form - if (GetSpellProto()->SpellIconID == 2855) + if (GetSpellProto()->Id == 2855) { uint32 spell_id; switch (GetId()) @@ -3844,7 +3844,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) // If spell that caused this aura has Croud Control or Daze effect if ((aurMechMask & MECHANIC_NOT_REMOVED_BY_SHAPESHIFT) || // some Daze spells have these parameters instead of MECHANIC_DAZE (skip snare spells) - (aurSpellInfo->SpellIconID == 15 && aurSpellInfo->GetDispel() == 0 && + (aurSpellInfo->Id == 15 && aurSpellInfo->GetDispel() == 0 && (aurMechMask & (1 << (MECHANIC_SNARE-1))) == 0)) { ++iter; @@ -3908,7 +3908,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) Unit::AuraList const& mDummy = target->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 238) + if ((*i)->GetSpellProto()->Id == 238) { furorChance = (*i)->GetModifier()->m_amount; break; @@ -3946,7 +3946,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) { if(itr->second.state == PLAYERSPELL_REMOVED) continue; SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); - if (spellInfo && spellInfo->GetSpellFamilyName() == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139) + if (spellInfo && spellInfo->GetSpellFamilyName() == SPELLFAMILY_WARRIOR && spellInfo->Id == 139) Rage_val += target->CalculateSpellDamage(target, spellInfo, EFFECT_INDEX_0) * 10; } } @@ -4250,7 +4250,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) { model_id = Creature::ChooseDisplayId(ci); } // Will use the default model here // Polymorph (sheep/penguin case) - if (GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_MAGE && GetSpellProto()->SpellIconID == 82) + if (GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_MAGE && GetSpellProto()->Id == 82) { if (Unit* caster = GetCaster()) { @@ -5055,7 +5055,7 @@ void Aura::HandleModStealth(bool apply, bool Real) for (Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) { // Master of Subtlety - if ((*i)->GetSpellProto()->SpellIconID == 2114) + if ((*i)->GetSpellProto()->Id == 2114) { target->RemoveAurasDueToSpell(31666); int32 bp = (*i)->GetModifier()->m_amount; @@ -5100,7 +5100,7 @@ void Aura::HandleModStealth(bool apply, bool Real) for (Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) { // Master of Subtlety - if ((*i)->GetSpellProto()->SpellIconID == 2114) + if ((*i)->GetSpellProto()->Id == 2114) target->CastSpell(target, 31666, true); // Overkill else if ((*i)->GetId() == 58426 && classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x0000000000400000)) @@ -5463,7 +5463,7 @@ void Aura::HandleAuraModIncreaseMountedSpeed(bool apply, bool Real) target->UpdateSpeed(MOVE_RUN, true); // Festive Holiday Mount - if (apply && GetSpellProto()->SpellIconID != 1794 && target->HasAura(62061)) + if (apply && GetSpellProto()->Id != 1794 && target->HasAura(62061)) // Reindeer Transformation target->CastSpell(target, 25860, true, NULL, this); } @@ -5492,7 +5492,7 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real) target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314); // Festive Holiday Mount - if (apply && GetSpellProto()->SpellIconID != 1794 && target->HasAura(62061)) + if (apply && GetSpellProto()->Id != 1794 && target->HasAura(62061)) // Reindeer Transformation target->CastSpell(target, 25860, true, NULL, this); } @@ -5608,7 +5608,7 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/) target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, misc, apply); // Bestial Wrath - if (GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_HUNTER && GetSpellProto()->SpellIconID == 1680) + if (GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_HUNTER && GetSpellProto()->Id == 1680) { // The Beast Within cast on owner if talent present if (Unit* owner = target->GetOwner()) @@ -5617,7 +5617,7 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/) Unit::AuraList const& dummyAuras = owner->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (Unit::AuraList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 2229) + if ((*i)->GetSpellProto()->Id == 2229) { if (apply) owner->CastSpell(owner, 34471, true, NULL, this); @@ -5984,7 +5984,7 @@ void Aura::HandlePeriodicHeal(bool apply, bool /*Real*/) } // Gift of the Naaru (have diff spellfamilies) - if (GetSpellProto()->SpellIconID == 329 && GetSpellProto()->SpellVisual[0] == 7625) + if (GetSpellProto()->Id == 329 && GetSpellProto()->GetSpellVisual(0) == 7625) { int32 ap = int32(0.22f * caster->GetTotalAttackPowerValue(BASE_ATTACK)); int32 holy = caster->SpellBaseDamageBonusDone(GetSpellSchoolMask(GetSpellProto())); @@ -5994,7 +5994,7 @@ void Aura::HandlePeriodicHeal(bool apply, bool /*Real*/) m_modifier.m_amount += ap > holy ? ap : holy; } // Lifeblood - else if (GetSpellProto()->SpellIconID == 3088 && GetSpellProto()->SpellVisual[0] == 8145) + else if (GetSpellProto()->Id == 3088 && GetSpellProto()->GetSpellVisual(0) == 8145) { int32 healthBonus = int32(0.0032f * caster->GetMaxHealth()); m_modifier.m_amount += healthBonus; @@ -6144,7 +6144,7 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) case SPELLFAMILY_PALADIN: { // Holy Vengeance / Blood Corruption - if (classOptions->SpellFamilyFlags & UI64LIT(0x0000080000000000) && spellProto->SpellVisual[0] == 7902) + if (classOptions->SpellFamilyFlags & UI64LIT(0x0000080000000000) && spellProto->GetSpellVisual(0) == 7902) { // AP * 0.025 + SPH * 0.013 bonus per tick float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); @@ -7398,7 +7398,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) for (Unit::SpellAuraHolderMap::iterator itr = tAuras.begin(); itr != tAuras.end();) { SpellEntry const *spellInfo = itr->second->GetSpellProto(); - if (itr->second->IsPassive() && (spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) + if (itr->second->IsPassive() && (spellInfo->GetAttributesEx2() & SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT) && (spellInfo->GetStancesNot() & (1<<(form-1)))) { target->RemoveAurasDueToSpell(itr->second->GetId()); @@ -7414,7 +7414,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) Unit::AuraList const& ShapeShifterAuras = target->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = ShapeShifterAuras.begin(); i != ShapeShifterAuras.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 2851) + if ((*i)->GetSpellProto()->Id == 2851) { int32 ShiftMod = (*i)->GetModifier()->m_amount; target->CastCustomSpell(target, MasterShaperSpellId, &ShiftMod, NULL, NULL, true); @@ -7444,7 +7444,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) for (Unit::AuraList::const_iterator i = modAuras.begin(); i != modAuras.end(); ++i) { if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DRUID && - (*i)->GetSpellProto()->SpellIconID == 961) + (*i)->GetSpellProto()->Id == 961) { int32 bp = (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2); if (bp) @@ -7461,7 +7461,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) for (Unit::AuraList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i) { if ((*i)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_DRUID && - (*i)->GetSpellProto()->SpellIconID == 2855) + (*i)->GetSpellProto()->Id == 2855) { uint32 spell_id = 0; switch ((*i)->GetId()) @@ -7487,7 +7487,7 @@ void Aura::HandleShapeshiftBoosts(bool apply) Unit::AuraList const& mModTotalStatPct = target->GetAurasByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE); for (Unit::AuraList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 240 && (*i)->GetModifier()->m_miscvalue == 3) + if ((*i)->GetSpellProto()->Id == 240 && (*i)->GetModifier()->m_miscvalue == 3) { int32 HotWMod = (*i)->GetModifier()->m_amount; if (GetModifier()->m_miscvalue == FORM_CAT) @@ -7808,7 +7808,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) for (Unit::AuraList::const_iterator itr = borrowedTime.begin(); itr != borrowedTime.end(); ++itr) { SpellEntry const* i_spell = (*itr)->GetSpellProto(); - if(i_spell->GetSpellFamilyName()==SPELLFAMILY_PRIEST && i_spell->SpellIconID == 2899 && i_spell->GetEffectMiscValue((*itr)->GetEffIndex()) == 24) + if(i_spell->GetSpellFamilyName()==SPELLFAMILY_PRIEST && i_spell->Id == 2899 && i_spell->GetEffectMiscValue((*itr)->GetEffIndex()) == 24) { DoneActualBenefit += DoneActualBenefit * (*itr)->GetModifier()->m_amount / 100; break; @@ -7866,7 +7866,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) SpellEntry const* vSpell = (*itr)->GetSpellProto(); // Rapture (main spell) - if(vSpell->GetSpellFamilyName() == SPELLFAMILY_PRIEST && vSpell->SpellIconID == 2894 && vSpell->GetSpellEffectIdByIndex(EFFECT_INDEX_1)) + if(vSpell->GetSpellFamilyName() == SPELLFAMILY_PRIEST && vSpell->Id == 2894 && vSpell->GetSpellEffectIdByIndex(EFFECT_INDEX_1)) { switch ((*itr)->GetEffIndex()) { @@ -8028,7 +8028,7 @@ void Aura::PeriodicTick() } // Curse of Agony damage-per-tick calculation - if (classOptions && classOptions->SpellFamilyName==SPELLFAMILY_WARLOCK && (classOptions->SpellFamilyFlags & UI64LIT(0x0000000000000400)) && spellProto->SpellIconID==544) + if (classOptions && classOptions->SpellFamilyName==SPELLFAMILY_WARLOCK && (classOptions->SpellFamilyFlags & UI64LIT(0x0000000000000400)) && spellProto->Id==544) { // 1..4 ticks, 1/2 from normal tick damage if (GetAuraTicks() <= 4) @@ -8226,7 +8226,7 @@ void Aura::PeriodicTick() canApplyHealthPart = false; // heal for caster damage (must be alive) - if (target != pCaster && spellProto->SpellVisual[0] == 163 && !pCaster->IsAlive()) + if (target != pCaster && spellProto->GetSpellVisual(0) == 163 && !pCaster->IsAlive()) canApplyHealthPart = false; if (canApplyHealthPart) @@ -8243,7 +8243,7 @@ void Aura::PeriodicTick() pdamage = amount; // Wild Growth (1/7 - 6 + 2*ramainTicks) % - if (classOptions && classOptions->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellIconID == 2864) + if (classOptions && classOptions->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->Id == 2864) { int32 ticks = GetAuraMaxTicks(); int32 remainingTicks = ticks - GetAuraTicks(); @@ -8288,7 +8288,7 @@ void Aura::PeriodicTick() target->GetHostileRefManager().threatAssist(pCaster, float(gain) * 0.5f * sSpellMgr.GetSpellThreatMultiplier(spellProto), spellProto); // apply damage part to caster if needed (ex. health funnel) - if (target != pCaster && spellProto->SpellVisual[0] == 163) + if (target != pCaster && spellProto->GetSpellVisual(0) == 163) { uint32 damage = spellProto->GetManaPerSecond(); uint32 absorb = 0; @@ -8547,7 +8547,7 @@ void Aura::PeriodicTick() gain = uint32(gain * m_spellEffect->EffectMultipleValue); // maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG - SpellNonMeleeDamage damageInfo(pCaster, target, spellProto->Id, SpellSchoolMask(spellProto->SchoolMask)); + SpellNonMeleeDamage damageInfo(pCaster, target, spellProto->Id, SpellSchoolMask(spellProto->GetSchoolMask())); pCaster->CalculateSpellDamage(&damageInfo, gain, spellProto); damageInfo.target->CalculateAbsorbResistBlock(pCaster, &damageInfo, spellProto); @@ -9140,7 +9140,7 @@ void Aura::PeriodicDummyTick() } // Prey on the Weak - if (spell->SpellIconID == 2983) + if (spell->Id == 2983) { Unit* victim = target->getVictim(); if (victim && (target->GetHealth() * 100 / target->GetMaxHealth() > victim->GetHealth() * 100 / victim->GetMaxHealth())) @@ -9224,7 +9224,7 @@ void Aura::PeriodicDummyTick() Spell::UnitList targets; { // eff_radius ==0 - float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spell->rangeIndex)); + float radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spell->GetRangeIndex())); MaNGOS::AnyUnfriendlyVisibleUnitInObjectRangeCheck u_check(target, target, radius); MaNGOS::UnitListSearcher checker(targets, u_check); @@ -9322,7 +9322,7 @@ void Aura::PeriodicDummyTick() // if (spell->SpellFamilyFlags & UI64LIT(0x0000000000004000)) // return; // Bladed Armor - if (spell->SpellIconID == 2653) + if (spell->Id == 2653) { // Increases your attack power by $s1 for every $s2 armor value you have. // Calculate AP bonus (from 1 effect of this spell) @@ -9331,10 +9331,10 @@ void Aura::PeriodicDummyTick() return; } // Reaping -// if (spell->SpellIconID == 22) +// if (spell->Id == 22) // return; // Blood of the North -// if (spell->SpellIconID == 30412) +// if (spell->Id == 30412) // return; // Hysteria if (spell->IsFitToFamilyMask(UI64LIT(0x0000000020000000))) @@ -9886,7 +9886,7 @@ SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit* target, Wor m_duration = m_maxDuration = CalculateSpellDuration(spellproto, unitCaster); - if (m_maxDuration == -1 || (m_isPassive && spellproto->DurationIndex == 0)) + if (m_maxDuration == -1 || (m_isPassive && spellproto->GetDurationIndex() == 0)) { m_permanent = true; } @@ -10592,7 +10592,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) case SPELLFAMILY_MAGE: { // Ice Barrier (non stacking from one caster) - if (m_spellProto->SpellIconID == 32) + if (m_spellProto->Id == 32) { if ((!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) || m_removeMode == AURA_REMOVE_BY_SHIELD_BREAK) { @@ -10600,7 +10600,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) for (Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) { // Shattered Barrier - if ((*itr)->GetSpellProto()->SpellIconID == 2945) + if ((*itr)->GetSpellProto()->Id == 2945) { cast_at_remove = true; // first rank have 50% chance @@ -10718,7 +10718,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { SpellEntry const* dummyEntry = (*itr)->GetSpellProto(); // Improved Fear - if (dummyEntry->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && dummyEntry->SpellIconID == 98) + if (dummyEntry->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && dummyEntry->Id == 98) { cast_at_remove = true; switch ((*itr)->GetModifier()->m_amount) @@ -10760,7 +10760,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) case SPELLFAMILY_PRIEST: { // Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch - if ((m_spellProto->SpellIconID == 234 && m_spellProto->SpellVisual[0]) || m_spellProto->SpellIconID == 2213) + if ((m_spellProto->Id == 234 && m_spellProto->GetSpellVisual(0)) || m_spellProto->Id == 2213) { if (!apply && m_removeMode == AURA_REMOVE_BY_DISPEL) { @@ -10775,7 +10775,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { // Shadow Affinity if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_PRIEST - && (*itr)->GetSpellProto()->SpellIconID == 178) + && (*itr)->GetSpellProto()->Id == 178) { // custom cast code int32 basepoints0 = (*itr)->GetModifier()->m_amount * caster->GetCreateMana() / 100; @@ -10824,8 +10824,8 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { SpellEntry const* dummyEntry = (*itr)->GetSpellProto(); // Body and Soul (talent ranks) - if (dummyEntry->GetSpellFamilyName() == SPELLFAMILY_PRIEST && dummyEntry->SpellIconID == 2218 && - dummyEntry->SpellVisual[0]==0) + if (dummyEntry->GetSpellFamilyName() == SPELLFAMILY_PRIEST && dummyEntry->Id == 2218 && + dummyEntry->GetSpellVisual(0)==0) { chance = (*itr)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1); break; @@ -10996,7 +10996,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) Unit::AuraList const& dummyAuras = m_target->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr) { - if ((*itr)->GetSpellProto()->SpellIconID == 3029) + if ((*itr)->GetSpellProto()->Id == 3029) { percent = (*itr)->GetModifier()->m_amount; break; @@ -11061,7 +11061,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { // skip same icon if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && - (*itr)->GetSpellProto()->SpellIconID == 2636) + (*itr)->GetSpellProto()->Id == 2636) { heal_pct = (*itr)->GetModifier()->m_amount; break; @@ -11088,7 +11088,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { // skip same icon if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && - (*itr)->GetSpellProto()->SpellIconID == 2633) + (*itr)->GetSpellProto()->Id == 2633) { power_pct = (*itr)->GetModifier()->m_amount; break; @@ -11112,7 +11112,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { // skip same icon if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && - (*itr)->GetSpellProto()->SpellIconID == 2632) + (*itr)->GetSpellProto()->Id == 2632) { stamina_pct = (*itr)->GetModifier()->m_amount; break; @@ -11139,7 +11139,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) { // skip same icon if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && - (*itr)->GetSpellProto()->SpellIconID == 2633) + (*itr)->GetSpellProto()->Id == 2633) { power_pct = (*itr)->GetModifier()->m_amount; break; @@ -11164,7 +11164,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) } // Improved Blood Presence - if (GetSpellProto()->SpellIconID == 2636 && m_isPassive) + if (GetSpellProto()->Id == 2636 && m_isPassive) { // if presence active: Frost Presence or Unholy Presence if (apply && (m_target->HasAura(48263) || m_target->HasAura(48265))) @@ -11184,7 +11184,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) } // Improved Frost Presence - if (GetSpellProto()->SpellIconID == 2632 && m_isPassive) + if (GetSpellProto()->Id == 2632 && m_isPassive) { // if presence active: Unholy Presence or Blood Presence if (apply && (m_target->HasAura(48265) || m_target->HasAura(48266))) @@ -11205,7 +11205,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) } // Improved Unholy Presence - if (GetSpellProto()->SpellIconID == 2633 && m_isPassive) + if (GetSpellProto()->Id == 2633 && m_isPassive) { // if presence active: Unholy Presence if (apply && m_target->HasAura(48265)) @@ -11308,7 +11308,7 @@ void SpellAuraHolder::Update(uint32 diff) { if (Unit* caster = GetCaster()) { - Powers powertype = Powers(GetSpellProto()->powerType); + Powers powertype = Powers(GetSpellProto()->GetPowerType()); m_timeCla = 1*IN_MILLISECONDS; if (SpellPowerEntry const* spellPower = GetSpellProto()->GetSpellPower()) @@ -11337,7 +11337,7 @@ void SpellAuraHolder::Update(uint32 diff) if (caster->GetChannelObjectGuid() == m_target->GetObjectGuid()) { // Get spell range - float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->rangeIndex)); + float max_range = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellProto->GetRangeIndex())); if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_RANGE, max_range); @@ -11366,7 +11366,7 @@ void SpellAuraHolder::SetAuraMaxDuration(int32 duration) // possible overwrite persistent state if (duration > 0) { - if (!(IsPassive() && GetSpellProto()->DurationIndex == 0)) + if (!(IsPassive() && GetSpellProto()->GetDurationIndex() == 0)) { SetPermanent(false); } diff --git a/src/game/WorldHandlers/SpellEffects.cpp b/src/game/WorldHandlers/SpellEffects.cpp index f6a7aabbd..09150cbb2 100644 --- a/src/game/WorldHandlers/SpellEffects.cpp +++ b/src/game/WorldHandlers/SpellEffects.cpp @@ -459,7 +459,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) case SPELLFAMILY_MAGE: // remove Arcane Blast buffs at any non-Arcane Blast arcane damage spell. // NOTE: it removed at hit instead cast because currently spell done-damage calculated at hit instead cast - if ((m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_ARCANE) && !(classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x20000000))) + if ((m_spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_ARCANE) && !(classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x20000000))) m_caster->RemoveAurasDueToSpell(36032); // Arcane Blast buff break; case SPELLFAMILY_WARRIOR: @@ -502,7 +502,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) case SPELLFAMILY_WARLOCK: { // Incinerate Rank 1 & 2 - if ((classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->SpellIconID==2128) + if ((classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->GetSpellIconID()==2128) { // Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff. // Check aura state for speed but aura state set not only for Immolate spell @@ -604,7 +604,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) for (Unit::AuraList::const_iterator i = ImprMindBlast.begin(); i != ImprMindBlast.end(); ++i) { if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_PRIEST && - ((*i)->GetSpellProto()->SpellIconID == 95)) + ((*i)->GetSpellProto()->GetSpellIconID() == 95)) { int chance = (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1); if (roll_chance_i(chance)) @@ -620,11 +620,11 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) { SpellEffectEntry const* rakeSpellEffect = m_spellInfo->GetSpellEffect(EFFECT_INDEX_2); // Ferocious Bite - if (m_caster->GetTypeId()==TYPEID_PLAYER && (classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x000800000)) && m_spellInfo->SpellVisual[0]==6587) + if (m_caster->GetTypeId()==TYPEID_PLAYER && (classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x000800000)) && m_spellInfo->GetSpellVisual()==6587) { // converts up to 30 points of energy into ($f1+$AP/410) additional damage float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); - float multiple = ap / 410 + effect->EffectDamageMultiplier; + float multiple = ap / 410 + effect->DmgMultiplier; damage += int32(((Player*)m_caster)->GetComboPoints() * ap * 7 / 100); uint32 energy = m_caster->GetPower(POWER_ENERGY); uint32 used_energy = energy > 30 ? 30 : energy; @@ -681,7 +681,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) Unit::AuraList const& auraList = ((Player*)m_caster)->GetAurasByType(SPELL_AURA_MOD_DURATION_OF_EFFECTS_BY_DISPEL); for (Unit::AuraList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter) { - if ((*iter)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->SpellIconID == 1960) + if ((*iter)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_ROGUE && (*iter)->GetSpellProto()->GetSpellIconID() == 1960) { if (int32 chance = (*iter)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2)) if (roll_chance_i(chance)) @@ -720,7 +720,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) case SPELLFAMILY_HUNTER: { // Gore - if (m_spellInfo->SpellIconID == 1578) + if (m_spellInfo->GetSpellIconID() == 1578) { if (m_caster->HasAura(57627)) // Charge 6 sec post-affect damage *= 2; @@ -745,7 +745,7 @@ void Spell::EffectSchoolDMG(SpellEffectEntry const* effect) damage += int32(ap * 0.2f) + int32(holy * 32 / 100); } // Judgement of Vengeance/Corruption ${1+0.22*$SPH+0.14*$AP} + 10% for each application of Holy Vengeance/Blood Corruption on the target - else if ((classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x800000000)) && m_spellInfo->SpellIconID==2292) + else if ((classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x800000000)) && m_spellInfo->GetSpellIconID()==2292) { uint32 debuf_id; switch (m_spellInfo->Id) @@ -2037,7 +2037,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) // big fire GameObject* pGo = NULL; - float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); MaNGOS::NearestGameObjectEntryInPosRangeCheck go_check_big(*unitTarget, 187675, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), fMaxDist); MaNGOS::GameObjectSearcher checker1(pGo, go_check_big); @@ -2179,7 +2179,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) Creature* creatureTarget = (Creature*)unitTarget; - if (const SpellCastTimesEntry* pCastTime = sSpellCastTimesStore.LookupEntry(pSpell->CastingTimeIndex)) + if (const SpellCastTimesEntry* pCastTime = sSpellCastTimesStore.LookupEntry(pSpell->GetCastingTimeIndex())) creatureTarget->ForcedDespawn(pCastTime->CastTime + 1); } return; @@ -2196,7 +2196,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) // look for gameobject within max spell range of unitTarget, and respawn if found GameObject* pGo = NULL; - float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); MaNGOS::NearestGameObjectEntryInPosRangeCheck go_check(*unitTarget, 187675, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), fMaxDist); MaNGOS::GameObjectSearcher checker(pGo, go_check); @@ -2729,7 +2729,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) // Expecting pTargetDummy to be summoned by AI at death of target creatures. Creature* pTargetDummy = NULL; - float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 28523, true, false, fRange * 2); MaNGOS::CreatureLastSearcher searcher(pTargetDummy, u_check); @@ -2828,7 +2828,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) // look for gameobjects within max spell range of unitTarget, and respawn if found std::list lList; - float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float fMaxDist = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); MaNGOS::GameObjectEntryInPosRangeCheck go_check(*unitTarget, 182071, unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), fMaxDist); MaNGOS::GameObjectListSearcher checker(lList, go_check); @@ -3618,7 +3618,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) { SpellClassOptionsEntry const* warClassOptions = m_spellInfo->GetSpellClassOptions(); // Charge - if (warClassOptions && (warClassOptions->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->SpellVisual[0] == 867) + if (warClassOptions && (warClassOptions->SpellFamilyFlags & UI64LIT(0x1)) && m_spellInfo->GetSpellVisual() == 867) { int32 chargeBasePoints0 = damage; m_caster->CastCustomSpell(m_caster, 34846, &chargeBasePoints0, NULL, NULL, true); @@ -3644,7 +3644,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) if (Aura* aura = m_caster->GetDummyAura(58367)) rage_modified += aura->GetModifier()->m_amount * 10; - int32 basePoints0 = damage+int32(rage_modified * effect->EffectDamageMultiplier + + int32 basePoints0 = damage+int32(rage_modified * effect->DmgMultiplier + m_caster->GetTotalAttackPowerValue(BASE_ATTACK)*0.2f); m_caster->CastCustomSpell(unitTarget, 20647, &basePoints0, NULL, NULL, true, 0); @@ -3656,7 +3656,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) for (Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { // Only Sudden Death have this SpellIconID with SPELL_AURA_PROC_TRIGGER_SPELL - if ((*itr)->GetSpellProto()->SpellIconID == 1989) + if ((*itr)->GetSpellProto()->GetSpellIconID() == 1989) { // saved rage top stored in next affect uint32 lastrage = (*itr)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1) * 10; @@ -3769,7 +3769,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) // Improved Life Tap mod Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY); for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr) - if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208) + if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->GetSpellIconID() == 208) mana = ((*itr)->GetModifier()->m_amount + 100)* mana / 100; m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true); @@ -3779,7 +3779,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) Unit::AuraList const& mod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); for (Unit::AuraList::const_iterator itr = mod.begin(); itr != mod.end(); ++itr) { - if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982) + if((*itr)->GetSpellProto()->GetSpellFamilyName()==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->GetSpellIconID() == 1982) manaFeedVal+= (*itr)->GetModifier()->m_amount; } if (manaFeedVal > 0) @@ -3962,7 +3962,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); for (Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter) { - if ((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->GetDispel()==0) + if ((*iter)->GetSpellProto()->GetSpellIconID()==15 && (*iter)->GetSpellProto()->GetDispel()==0) { found = true; break; @@ -4057,7 +4057,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) } case SPELLFAMILY_PALADIN: { - switch (m_spellInfo->SpellIconID) + switch (m_spellInfo->GetSpellIconID()) { case 156: // Holy Shock { @@ -4185,7 +4185,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) { SpellClassOptionsEntry const* shamClassOptions = m_spellInfo->GetSpellClassOptions(); // Cleansing Totem - if (shamClassOptions && (shamClassOptions->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->SpellIconID==1673) + if (shamClassOptions && (shamClassOptions->SpellFamilyFlags & UI64LIT(0x0000000004000000)) && m_spellInfo->GetSpellIconID()==1673) { if (unitTarget) m_caster->CastSpell(unitTarget, 52025, true); @@ -4209,7 +4209,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) Unit::AuraList const& mDummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) // only its have dummy with specific icon - if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_SHAMAN && (*i)->GetSpellProto()->SpellIconID == 338) + if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_SHAMAN && (*i)->GetSpellProto()->GetSpellIconID() == 338) damage += (*i)->GetModifier()->m_amount * damage / 100; // Glyph of Healing Stream Totem @@ -4288,7 +4288,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) return; } // Fire Nova - if (m_spellInfo->SpellIconID == 33) + if (m_spellInfo->GetSpellIconID() == 33) { // fire totems slot Totem* totem = m_caster->GetTotem(TOTEM_SLOT_FIRE); @@ -4367,14 +4367,14 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) } SpellEffectEntry const* dsSpellEffect = m_spellInfo->GetSpellEffect(EFFECT_INDEX_0); - int32 bp = int32(count * m_caster->GetMaxHealth() * (dsSpellEffect ? dsSpellEffect->EffectDamageMultiplier : 0.0f) / 100); + int32 bp = int32(count * m_caster->GetMaxHealth() * (dsSpellEffect ? dsSpellEffect->DmgMultiplier : 0.0f) / 100); // Improved Death Strike (percent stored in nonexistent EFFECT_INDEX_2 effect base points) Unit::AuraList const& auraMod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); for (Unit::AuraList::const_iterator iter = auraMod.begin(); iter != auraMod.end(); ++iter) { // only required spell have spellicon for SPELL_AURA_ADD_FLAT_MODIFIER - if ((*iter)->GetSpellProto()->SpellIconID == 2751 && (*iter)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT) + if ((*iter)->GetSpellProto()->GetSpellIconID() == 2751 && (*iter)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT) { bp += (*iter)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2) * bp / 100; break; @@ -4416,7 +4416,7 @@ void Spell::EffectDummy(SpellEffectEntry const* effect) Unit::AuraList const& dummyList = m_caster->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator itr = dummyList.begin(); itr != dummyList.end(); ++itr) { - if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && (*itr)->GetSpellProto()->SpellIconID == 2710) + if ((*itr)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_DEATHKNIGHT && (*itr)->GetSpellProto()->GetSpellIconID() == 2710) { if (roll_chance_i((*itr)->GetModifier()->m_amount)) // don't consume if found { @@ -4768,7 +4768,7 @@ void Spell::EffectJump(SpellEffectEntry const* effect) // Try to normalize Z coord because GetContactPoint do nothing with Z axis m_caster->UpdateAllowedPositionZ(x, y, z); - float speed = m_spellInfo->speed ? m_spellInfo->speed : 27.0f; + float speed = m_spellInfo->GetSpeed() ? m_spellInfo->GetSpeed() : 27.0f; m_caster->GetMotionMaster()->MoveDestination(x, y, z, o, speed, 2.5f); } @@ -6009,7 +6009,7 @@ void Spell::EffectSummonType(SpellEffectEntry const* effect) if (prop_id == 61) // mixed guardians, totems, statues { // * Stone Statue, etc -- fits much better totem AI - if (m_spellInfo->SpellIconID == 2056) + if (m_spellInfo->GetSpellIconID() == 2056) summonResult = DoSummonTotem(effect); else { @@ -7098,13 +7098,13 @@ void Spell::EffectEnchantItemTmp(SpellEffectEntry const* effect) else if(classOptions && classOptions->SpellFamilyName == SPELLFAMILY_SHAMAN) duration = 1800; // 30 mins // other cases with this SpellVisual already selected - else if (m_spellInfo->SpellVisual[0] == 215) + else if (m_spellInfo->GetSpellVisual(0) == 215) duration = 1800; // 30 mins // some fishing pole bonuses - else if (m_spellInfo->SpellVisual[0] == 563) + else if (m_spellInfo->GetSpellVisual(0) == 563) duration = 600; // 10 mins // shaman rockbiter enchantments - else if (m_spellInfo->SpellVisual[0] == 0) + else if (m_spellInfo->GetSpellVisual(0) == 0) duration = 1800; // 30 mins else if (m_spellInfo->Id == 29702) duration = 300; // 5 mins @@ -7455,7 +7455,7 @@ void Spell::EffectWeaponDmg(SpellEffectEntry const* effect) case SPELLFAMILY_WARRIOR: { // Devastate - if (m_spellInfo->SpellVisual[0] == 12295 && m_spellInfo->SpellIconID == 1508) + if (m_spellInfo->GetSpellVisual() == 12295 && m_spellInfo->GetSpellIconID() == 1508) { // Sunder Armor Aura* sunder = unitTarget->GetAura(SPELL_AURA_MOD_RESISTANCE_PCT, SPELLFAMILY_WARRIOR, UI64LIT(0x0000000000004000), 0x00000000, m_caster->GetObjectGuid()); @@ -7570,7 +7570,7 @@ void Spell::EffectWeaponDmg(SpellEffectEntry const* effect) { // Blood Strike, Heart Strike, Obliterate // Blood-Caked Strike - if (m_spellInfo->SpellIconID == 1736) + if (m_spellInfo->GetSpellIconID() == 1736) { uint32 count = 0; Unit::SpellAuraHolderMap const& auras = unitTarget->GetSpellAuraHolderMap(); @@ -7584,17 +7584,17 @@ void Spell::EffectWeaponDmg(SpellEffectEntry const* effect) if (count) { // Effect 1(for Blood-Caked Strike)/3(other) damage is bonus - float bonus = count * CalculateDamage(m_spellInfo->SpellIconID == 1736 ? EFFECT_INDEX_0 : EFFECT_INDEX_2, unitTarget) / 100.0f; + float bonus = count * CalculateDamage(m_spellInfo->GetSpellIconID() == 1736 ? EFFECT_INDEX_0 : EFFECT_INDEX_2, unitTarget) / 100.0f; // Blood Strike, Blood-Caked Strike and Obliterate store bonus*2 if ((classOptions && classOptions->SpellFamilyFlags & UI64LIT(0x0002000000400000)) || - m_spellInfo->SpellIconID == 1736) + m_spellInfo->GetSpellIconID() == 1736) bonus /= 2.0f; totalDamagePercentMod *= 1.0f + bonus; } // Heart Strike secondary target - if (m_spellInfo->SpellIconID == 3145) + if (m_spellInfo->GetSpellIconID() == 3145) if (m_targets.getUnitTarget() != unitTarget) weaponDamagePercentMod /= 2.0f; } @@ -10977,7 +10977,7 @@ void Spell::EffectScriptEffect(SpellEffectEntry const* effect) for (Unit::AuraList::const_iterator i = auras.begin(); i != auras.end(); ++i) { // Invigoration (master talent) - if ((*i)->GetModifier()->m_miscvalue == 8 && (*i)->GetSpellProto()->SpellIconID == 3487) + if ((*i)->GetModifier()->m_miscvalue == 8 && (*i)->GetSpellProto()->GetSpellIconID() == 3487) { if (roll_chance_i((*i)->GetModifier()->m_amount)) { @@ -11872,7 +11872,7 @@ void Spell::EffectBlock(SpellEffectEntry const* /*effect*/) void Spell::EffectLeapForward(SpellEffectEntry const* effect) { - float dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->rangeIndex)); + float dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->GetRangeIndex())); const float IN_OR_UNDER_LIQUID_RANGE = 0.8f; // range to make player under liquid or on liquid surface from liquid level G3D::Vector3 prevPos, nextPos; @@ -12238,18 +12238,11 @@ void Spell::EffectPlayerPull(SpellEffectEntry const* effect) return; } - float x, y, z; - m_caster->GetPosition(x, y, z); + float dist = unitTarget->GetDistance2d(m_caster); + if (damage && dist > damage) + dist = float(damage); - // move back a bit - x = x - (0.6 * cos(m_caster->GetOrientation() + M_PI_F)); - y = y - (0.6 * sin(m_caster->GetOrientation() + M_PI_F)); - - // Try to normalize Z coord because GetContactPoint do nothing with Z axis - unitTarget->UpdateAllowedPositionZ(x, y, z); - - float speed = m_spellInfo->speed ? m_spellInfo->speed : 27.0f; - unitTarget->GetMotionMaster()->MoveJump(x, y, z, speed, 2.5f); + unitTarget->KnockBackFrom(m_caster, -dist, float(effect->EffectMiscValue) / 10); } void Spell::EffectDispelMechanic(SpellEffectEntry const* effect) @@ -12465,15 +12458,15 @@ void Spell::EffectTransmitted(SpellEffectEntry const* effect) if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) m_targets.getDestination(fx, fy, fz); // FIXME: this can be better check for most objects but still hack - else if (effect->GetRadiusIndex() && m_spellInfo->speed == 0) + else if (effect->GetRadiusIndex() && m_spellInfo->GetSpeed() == 0) { float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(effect->GetRadiusIndex())); m_caster->GetClosePoint(fx, fy, fz, DEFAULT_WORLD_OBJECT_SIZE, dis); } else { - float min_dis = GetSpellMinRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); - float max_dis = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex)); + float min_dis = GetSpellMinRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); + float max_dis = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->GetRangeIndex())); float dis = rand_norm_f() * (max_dis - min_dis) + min_dis; // special code for fishing bobber (TARGET_SELF_FISHING), should not try to avoid objects diff --git a/src/game/WorldHandlers/UnitAuraProcHandler.cpp b/src/game/WorldHandlers/UnitAuraProcHandler.cpp index 3f8d13d4a..43517dea0 100644 --- a/src/game/WorldHandlers/UnitAuraProcHandler.cpp +++ b/src/game/WorldHandlers/UnitAuraProcHandler.cpp @@ -1217,7 +1217,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura case SPELLFAMILY_MAGE: { // Magic Absorption - if (dummySpell->SpellIconID == 459) // only this spell have SpellIconID == 459 and dummy aura + if (dummySpell->Id == 459) // only this spell have Id == 459 and dummy aura { if (GetPowerType() != POWER_MANA) { @@ -1231,7 +1231,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Master of Elements - if (dummySpell->SpellIconID == 1920) + if (dummySpell->Id == 1920) { if (!procSpell) { @@ -1252,7 +1252,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } // Arcane Potency - if (dummySpell->SpellIconID == 2120) + if (dummySpell->Id == 2120) { if (!procSpell) { @@ -1272,7 +1272,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } // Hot Streak - if (dummySpell->SpellIconID == 2999) + if (dummySpell->Id == 2999) { if (effIndex != EFFECT_INDEX_0) { @@ -1301,7 +1301,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_OK; } // Burnout - if (dummySpell->SpellIconID == 2998) + if (dummySpell->Id == 2998) { if (!procSpell) { @@ -1404,7 +1404,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Second Wind - if (dummySpell->SpellIconID == 1697) + if (dummySpell->Id == 1697) { // only for spells and hit/crit (trigger start always) and not start from self casted spells (5530 Mace Stun Effect for example) if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT | PROC_EX_CRITICAL_HIT)) || this == pVictim) @@ -1476,7 +1476,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_OK; } // Seed of Corruption (Mobs cast) - no die req - if (dummyClassOptions && dummyClassOptions->SpellFamilyFlags == UI64LIT(0x0) && dummySpell->SpellIconID == 1932) + if (dummyClassOptions && dummyClassOptions->SpellFamilyFlags == UI64LIT(0x0) && dummySpell->Id == 1932) { Modifier* mod = triggeredByAura->GetModifier(); // if damage is more than need deal finish spell @@ -1497,7 +1497,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_OK; } // Fel Synergy - if (dummySpell->SpellIconID == 3222) + if (dummySpell->Id == 3222) { target = GetPet(); if (!target) @@ -1591,7 +1591,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_OK; // no hidden cooldown } - switch (dummySpell->SpellIconID) + switch (dummySpell->Id) { // Improved Shadowform case 217: @@ -1880,7 +1880,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura if (spellEffect && spellEffect->GetRadiusIndex()) radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellEffect->GetRadiusIndex())); else - radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(procSpell->rangeIndex)); + radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(procSpell->GetRangeIndex())); ((Player*)this)->ApplySpellMod(procSpell->Id, SPELLMOD_RADIUS, radius); @@ -1903,7 +1903,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } } // King of the Jungle - if (dummySpell->SpellIconID == 2850) + if (dummySpell->Id == 2850) { switch (effIndex) { @@ -1925,7 +1925,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } } // Eclipse - if (dummySpell->SpellIconID == 2856) + if (dummySpell->Id == 2856) { if (!procSpell) { @@ -1961,7 +1961,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_FAILED; } // Living Seed - else if (dummySpell->SpellIconID == 2860) + else if (dummySpell->Id == 2860) { triggered_spell_id = 48504; basepoints[0] = triggerAmount * damage / 100; @@ -2009,7 +2009,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } } // Cut to the Chase - if (dummySpell->SpellIconID == 2909) + if (dummySpell->Id == 2909) { // "refresh your Slice and Dice duration to its 5 combo point maximum" // lookup Slice and Dice @@ -2028,13 +2028,13 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_FAILED; } // Deadly Brew - if (dummySpell->SpellIconID == 2963) + if (dummySpell->Id == 2963) { triggered_spell_id = 44289; break; } // Quick Recovery - if (dummySpell->SpellIconID == 2116) + if (dummySpell->Id == 2116) { if (!procSpell) { @@ -2057,7 +2057,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura case SPELLFAMILY_HUNTER: { // Thrill of the Hunt - if (dummySpell->SpellIconID == 2236) + if (dummySpell->Id == 2236) { if (!procSpell) { @@ -2077,14 +2077,14 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Hunting Party - if (dummySpell->SpellIconID == 3406) + if (dummySpell->Id == 3406) { triggered_spell_id = 57669; target = this; break; } // Lock and Load - if (dummySpell->SpellIconID == 3579) + if (dummySpell->Id == 3579) { // Proc only from periodic (from trap activation proc another aura of this spell) if (!(procFlag & PROC_FLAG_ON_DO_PERIODIC) || !roll_chance_i(triggerAmount)) @@ -2096,7 +2096,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Rapid Recuperation - if (dummySpell->SpellIconID == 3560) + if (dummySpell->Id == 3560) { // This effect only from Rapid Killing (mana regen) if (!(procClassOptions && procClassOptions->SpellFamilyFlags & UI64LIT(0x0100000000000000))) @@ -2146,14 +2146,14 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Righteous Vengeance - if (dummySpell->SpellIconID == 3025) + if (dummySpell->Id == 3025) { triggered_spell_id = 61840; basepoints[0] = triggerAmount * damage / 100 / GetSpellAuraMaxTicks(triggered_spell_id); break; } // Sheath of Light - if (dummySpell->SpellIconID == 3030) + if (dummySpell->Id == 3030) { triggered_spell_id = 54203; basepoints[0] = triggerAmount * damage / 100 / GetSpellAuraMaxTicks(triggered_spell_id); @@ -2772,7 +2772,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura } } // Storm, Earth and Fire - if (dummySpell->SpellIconID == 3063) + if (dummySpell->Id == 3063) { // Earthbind Totem summon only if (procSpell->Id != 2484) @@ -2789,7 +2789,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Ancestral Awakening - if (dummySpell->SpellIconID == 3065) + if (dummySpell->Id == 3065) { triggered_spell_id = 52759; basepoints[0] = triggerAmount * damage / 100; @@ -2848,7 +2848,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Improved Water Shield - if (dummySpell->SpellIconID == 2287) + if (dummySpell->Id == 2287) { if (!procSpell) { @@ -2882,7 +2882,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_FAILED; } // Lightning Overload - if (dummySpell->SpellIconID == 2018) // only this spell have SpellFamily Shaman SpellIconID == 2018 and dummy aura + if (dummySpell->Id == 2018) // only this spell have SpellFamily Shaman Id == 2018 and dummy aura { if (!procSpell || GetTypeId() != TYPEID_PLAYER || !pVictim) { @@ -2940,7 +2940,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_OK; } // Static Shock - if (dummySpell->SpellIconID == 3059) + if (dummySpell->Id == 3059) { // lookup Lightning Shield AuraList const& vs = GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL); @@ -2976,7 +2976,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura return SPELL_AURA_PROC_FAILED; } // Frozen Power - if (dummySpell->SpellIconID == 3780) + if (dummySpell->Id == 3780) { Unit* caster = triggeredByAura->GetCaster(); @@ -3003,7 +3003,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura case SPELLFAMILY_DEATHKNIGHT: { // Butchery - if (dummySpell->SpellIconID == 2664) + if (dummySpell->Id == 2664) { basepoints[0] = triggerAmount; triggered_spell_id = 50163; @@ -3038,7 +3038,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Necrosis - if (dummySpell->SpellIconID == 2709) + if (dummySpell->Id == 2709) { // only melee auto attack affected and Rune Strike if (procSpell && procSpell->Id != 56815) @@ -3051,7 +3051,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Threat of Thassarian - if (dummySpell->SpellIconID == 2023) + if (dummySpell->Id == 2023) { // Must Dual Wield if (!procSpell || !haveOffhandWeapon()) @@ -3151,7 +3151,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Wandering Plague - if (dummySpell->SpellIconID == 1614) + if (dummySpell->Id == 1614) { if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, pVictim))) { @@ -3162,7 +3162,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura break; } // Blood-Caked Blade - if (dummySpell->SpellIconID == 138) + if (dummySpell->Id == 138) { // only main hand melee auto attack affected and Rune Strike if ((procFlag & PROC_FLAG_SUCCESSFUL_OFFHAND_HIT) || (procSpell && procSpell->Id != 56815)) @@ -3473,7 +3473,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d } case SPELLFAMILY_MAGE: { - if (auraSpellInfo->SpellIconID == 2127) // Blazing Speed + if (auraSpellInfo->Id == 2127) // Blazing Speed { switch (auraSpellInfo->Id) { @@ -3500,7 +3500,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d (((Creature*)pVictim)->GetCreatureInfo()->MechanicImmuneMask & (1 << (MECHANIC_STUN - 1))) == 0) return SPELL_AURA_PROC_FAILED; } - else if (auraSpellInfo->SpellIconID == 2947) // Fingers of Frost + else if (auraSpellInfo->Id == 2947) // Fingers of Frost { // proc chance for spells in basepoints if (!roll_chance_i(triggerAmount)) @@ -3513,7 +3513,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d case SPELLFAMILY_WARRIOR: { // Deep Wounds (replace triggered spells to directly apply DoT), dot spell have familyflags - if (auraClassOptions && auraClassOptions->SpellFamilyFlags == UI64LIT(0x0) && auraSpellInfo->SpellIconID == 243) + if (auraClassOptions && auraClassOptions->SpellFamilyFlags == UI64LIT(0x0) && auraSpellInfo->Id == 243) { float weaponDamage; // DW should benefit of attack power, damage percent mods etc. @@ -3539,7 +3539,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d trigger_spell_id = 12721; break; } - else if (auraSpellInfo->SpellIconID == 2961) // Taste for Blood + else if (auraSpellInfo->Id == 2961) // Taste for Blood { // only at real damage if (!damage) @@ -3565,7 +3565,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d Unit::AuraList const& mDummyAura = GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = mDummyAura.begin(); i != mDummyAura.end(); ++i) { - if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && (*i)->GetSpellProto()->SpellIconID == 113) + if ((*i)->GetSpellProto()->GetSpellFamilyName() == SPELLFAMILY_WARLOCK && (*i)->GetSpellProto()->Id == 113) { // basepoints of trigger spell stored in dummyeffect of spellProto int32 basepoints2 = GetMaxPower(POWER_MANA) * (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_2) / 100; @@ -3587,7 +3587,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d } } // Nether Protection - else if (auraSpellInfo->SpellIconID == 1985) + else if (auraSpellInfo->Id == 1985) { if (!procSpell) { @@ -3653,7 +3653,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d trigger_spell_id = 37595; } // Blessed Recovery - else if (auraSpellInfo->SpellIconID == 1875) + else if (auraSpellInfo->Id == 1875) { switch (auraSpellInfo->Id) { @@ -3706,7 +3706,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d } case SPELLFAMILY_ROGUE: { - if (auraSpellInfo->SpellIconID == 2260) // Combat Potency + if (auraSpellInfo->Id == 2260) // Combat Potency { if (!(procFlags & PROC_FLAG_SUCCESSFUL_OFFHAND_HIT)) { @@ -3719,7 +3719,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d case SPELLFAMILY_HUNTER: { // Piercing Shots - if (auraSpellInfo->SpellIconID == 3247 && auraSpellInfo->SpellVisual[0] == 0) + if (auraSpellInfo->Id == 3247 && auraSpellInfo->GetSpellVisual(0) == 0) { basepoints[0] = damage * triggerAmount / 100 / 8; trigger_spell_id = 63468; @@ -3735,7 +3735,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d } } // Lock and Load - else if (auraSpellInfo->SpellIconID == 3579) + else if (auraSpellInfo->Id == 3579) { // Check for Lock and Load Marker if (HasAura(67544)) @@ -3755,7 +3755,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d { /* // Blessed Life - if (auraSpellInfo->SpellIconID == 2137) + if (auraSpellInfo->Id == 2137) { switch (auraSpellInfo->Id) { @@ -3782,7 +3782,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d target = this; } // Illumination - else if (auraSpellInfo->SpellIconID == 241) + else if (auraSpellInfo->Id == 241) { if (!procSpell) { @@ -3955,7 +3955,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d target = this; } // Nature's Guardian - else if (auraSpellInfo->SpellIconID == 2013) + else if (auraSpellInfo->Id == 2013) { // Check health condition - should drop to less 30% (trigger at any attack with result health less 30%, independent original health state) int32 health30 = int32(GetMaxHealth()) * 3 / 10; @@ -3976,7 +3976,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d case SPELLFAMILY_DEATHKNIGHT: { // Acclimation - if (auraSpellInfo->SpellIconID == 1930) + if (auraSpellInfo->Id == 1930) { if (!procSpell) { @@ -3997,7 +3997,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d } } // Blade Barrier - else if (auraSpellInfo->SpellIconID == 85) + else if (auraSpellInfo->Id == 85) { if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT || !((Player*)this)->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) @@ -4085,7 +4085,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d case 35095: { SpellPowerEntry const* spellPower = procSpell->GetSpellPower(); - if(!spellPower || !procSpell || procSpell->powerType!=POWER_MANA || spellPower->manaCost==0 && spellPower->ManaCostPercentage==0 && spellPower->manaCostPerlevel==0) + if(!spellPower || !procSpell || procSpell->GetPowerType()!=POWER_MANA || spellPower->manaCost==0 && spellPower->ManaCostPercentage==0 && spellPower->manaCostPerlevel==0) { return SPELL_AURA_PROC_FAILED; } @@ -4115,7 +4115,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d AuraList const& dummyAuras = owner->GetAurasByType(SPELL_AURA_DUMMY); for (AuraList::const_iterator i = dummyAuras.begin(); i != dummyAuras.end(); ++i) { - if ((*i)->GetSpellProto()->SpellIconID == 3220) + if ((*i)->GetSpellProto()->Id == 3220) { basepoints[0] = basepoints[1] = int32(spellDamage * (*i)->GetModifier()->m_amount / 100); break; @@ -4262,7 +4262,7 @@ SpellAuraProcResult Unit::HandleProcTriggerDamageAuraProc(Unit* pVictim, uint32 SpellEntry const* spellInfo = triggeredByAura->GetSpellProto(); DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by auratype %u of spell %u)", triggeredByAura->GetModifier()->m_amount, spellInfo->Id, triggeredByAura->GetModifier()->m_auraname, triggeredByAura->GetId()); - SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchoolMask(spellInfo->SchoolMask)); + SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, SpellSchoolMask(spellInfo->GetSchoolMask())); CalculateSpellDamage(&damageInfo, triggeredByAura->GetModifier()->m_amount, spellInfo); damageInfo.target->CalculateAbsorbResistBlock(this, &damageInfo, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); @@ -4292,7 +4292,7 @@ SpellAuraProcResult Unit::HandleOverrideClassScriptAuraProc(Unit* pVictim, uint3 { case 836: // Improved Blizzard (Rank 1) { - if (!procSpell || procSpell->SpellVisual[0] != 9487) + if (!procSpell || procSpell->GetSpellVisual(0) != 9487) { return SPELL_AURA_PROC_FAILED; } @@ -4301,7 +4301,7 @@ SpellAuraProcResult Unit::HandleOverrideClassScriptAuraProc(Unit* pVictim, uint3 } case 988: // Improved Blizzard (Rank 2) { - if (!procSpell || procSpell->SpellVisual[0] != 9487) + if (!procSpell || procSpell->GetSpellVisual(0) != 9487) { return SPELL_AURA_PROC_FAILED; } @@ -4310,7 +4310,7 @@ SpellAuraProcResult Unit::HandleOverrideClassScriptAuraProc(Unit* pVictim, uint3 } case 989: // Improved Blizzard (Rank 3) { - if (!procSpell || procSpell->SpellVisual[0] != 9487) + if (!procSpell || procSpell->GetSpellVisual(0) != 9487) { return SPELL_AURA_PROC_FAILED; } @@ -4423,7 +4423,7 @@ SpellAuraProcResult Unit::HandleMendingAuraProc(Unit* /*pVictim*/, uint32 /*dama if (spellEffect && spellEffect->GetRadiusIndex()) radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellEffect->GetRadiusIndex())); else - radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); + radius = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spellProto->GetRangeIndex())); if (Player* caster = ((Player*)triggeredByAura->GetCaster())) { @@ -4469,7 +4469,7 @@ SpellAuraProcResult Unit::HandleModCastingSpeedNotStackAuraProc(Unit* /*pVictim* SpellAuraProcResult Unit::HandleReflectSpellsSchoolAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) { // Skip Melee hits and spells ws wrong school - return !(procSpell == NULL || (triggeredByAura->GetModifier()->m_miscvalue & procSpell->SchoolMask) == 0) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; + return !(procSpell == NULL || (triggeredByAura->GetModifier()->m_miscvalue & procSpell->GetSchoolMask()) == 0) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; } SpellAuraProcResult Unit::HandleModPowerCostSchoolAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) @@ -4477,7 +4477,7 @@ SpellAuraProcResult Unit::HandleModPowerCostSchoolAuraProc(Unit* /*pVictim*/, ui // Skip melee hits and spells ws wrong school or zero cost return !(procSpell == NULL || (procSpell->GetManaCost() == 0 && procSpell->GetManaCostPercentage() == 0) || // Cost check - (triggeredByAura->GetModifier()->m_miscvalue & procSpell->SchoolMask) == 0) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; // School check + (triggeredByAura->GetModifier()->m_miscvalue & procSpell->GetSchoolMask()) == 0) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; // School check } SpellAuraProcResult Unit::HandleMechanicImmuneResistanceAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 /*cooldown*/) @@ -4593,7 +4593,7 @@ SpellAuraProcResult Unit::HandleModDamagePercentDoneAuraProc(Unit* /*pVictim*/, CastCustomSpell(this, 34075, &bp, NULL, NULL, true, castItem, triggeredByAura); } // Arcane Blast - else if (spellInfo->Id == 36032 && procSpell->GetSpellFamilyName() == SPELLFAMILY_MAGE && procSpell->SpellIconID == 2294) + else if (spellInfo->Id == 36032 && procSpell->GetSpellFamilyName() == SPELLFAMILY_MAGE && procSpell->Id == 2294) // prevent proc from self(spell that triggered this aura) return SPELL_AURA_PROC_FAILED;