aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Player
diff options
context:
space:
mode:
authorPeter Keresztes Schmidt <carbenium@outlook.com>2020-07-12 15:36:55 +0200
committerGitHub <noreply@github.com>2020-07-12 15:36:55 +0200
commitc92950b3e1f6366d85d707365a8ad2caddafeecc (patch)
tree9c034dc61e7b8dc5d480bfd476a6631b8d9dd592 /src/server/game/Entities/Player
parent352944266822f8c8d3bfdd6078c6f82d3555dd85 (diff)
Core/DataStores: Update DBC field names to generated ones (#24999)
Diffstat (limited to 'src/server/game/Entities/Player')
-rw-r--r--src/server/game/Entities/Player/Player.cpp546
1 files changed, 278 insertions, 268 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index bfd4b0c636e..6a478c0f868 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -495,7 +495,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
SetMap(sMapMgr->CreateMap(info->mapId, this));
- uint8 powertype = cEntry->powerType;
+ uint8 powertype = cEntry->DisplayPower;
SetObjectScale(1.0f);
@@ -603,10 +603,10 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
{
for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j)
{
- if (oEntry->ItemId[j] <= 0)
+ if (oEntry->ItemID[j] <= 0)
continue;
- uint32 itemId = oEntry->ItemId[j];
+ uint32 itemId = oEntry->ItemID[j];
// just skip, reported in ObjectMgr::LoadItemTemplates
ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId);
@@ -916,7 +916,7 @@ void Player::HandleDrowning(uint32 time_diff)
SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10);
}
- if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellId))
+ if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellID))
{
// Breath timer not activated - activate it
if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER)
@@ -1574,7 +1574,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
*data << uint32(proto->DisplayInfoID);
*data << uint8(proto->InventoryType);
- *data << uint32(enchant ? enchant->aura_id : 0);
+ *data << uint32(enchant ? enchant->ItemVisual : 0);
}
return true;
@@ -2342,20 +2342,20 @@ void Player::SetInWater(bool apply)
bool Player::IsInAreaTriggerRadius(AreaTriggerEntry const* trigger) const
{
- if (!trigger || GetMapId() != trigger->mapid)
+ if (!trigger || GetMapId() != trigger->ContinentID)
return false;
- if (trigger->radius > 0.f)
+ if (trigger->Radius > 0.f)
{
// if we have radius check it
- float dist = GetDistance(trigger->x, trigger->y, trigger->z);
- if (dist > trigger->radius)
+ float dist = GetDistance(trigger->Pos.X, trigger->Pos.Y, trigger->Pos.Z);
+ if (dist > trigger->Radius)
return false;
}
else
{
- Position center(trigger->x, trigger->y, trigger->z, trigger->box_orientation);
- if (!IsWithinBox(center, trigger->box_x / 2.f, trigger->box_y / 2.f, trigger->box_z / 2.f))
+ Position center(trigger->Pos.X, trigger->Pos.Y, trigger->Pos.Z, trigger->BoxYaw);
+ if (!IsWithinBox(center, trigger->BoxLength / 2.f, trigger->BoxWidth / 2.f, trigger->BoxHeight / 2.f))
return false;
}
@@ -2930,7 +2930,7 @@ void Player::SendUnlearnSpells()
bool hasSupercededSpellInfoInClient = false;
for (auto boundsItr = skillLineAbilities.first; boundsItr != skillLineAbilities.second; ++boundsItr)
{
- if (boundsItr->second->forward_spellid)
+ if (boundsItr->second->SupercededBySpell)
{
hasSupercededSpellInfoInClient = true;
break;
@@ -3087,7 +3087,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning)
for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
{
// skip learning spell and no rank spell case
- uint32 rankSpellId = talentInfo->RankID[rank];
+ uint32 rankSpellId = talentInfo->SpellRank[rank];
if (!rankSpellId || rankSpellId == spellId)
continue;
@@ -3119,7 +3119,7 @@ static bool IsUnlearnSpellsPacketNeededForSpell(uint32 spellId)
bool hasSupercededSpellInfoInClient = false;
for (auto boundsItr = skillLineAbilities.first; boundsItr != skillLineAbilities.second; ++boundsItr)
{
- if (boundsItr->second->forward_spellid)
+ if (boundsItr->second->SupercededBySpell)
{
hasSupercededSpellInfoInClient = true;
break;
@@ -3290,7 +3290,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
{
// skip learning spell and no rank spell case
- uint32 rankSpellId = talentInfo->RankID[rank];
+ uint32 rankSpellId = talentInfo->SpellRank[rank];
if (!rankSpellId || rankSpellId == spellId)
continue;
@@ -3433,19 +3433,19 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// not ranked skills
for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx)
{
- SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId);
+ SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine);
if (!pSkill)
continue;
- if (pSkill->id == fromSkill)
+ if (pSkill->ID == fromSkill)
continue;
///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16
// Also added for runeforging. It's already confirmed this happens upon learning for Death Knights, not from character creation.
- if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
- LearnDefaultSkill(pSkill->id, 0);
+ if ((_spell_idx->second->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || ((pSkill->ID == SKILL_LOCKPICKING || pSkill->ID == SKILL_RUNEFORGING) && _spell_idx->second->TrivialSkillLineRankHigh == 0))
+ LearnDefaultSkill(pSkill->ID, 0);
- if (pSkill->id == SKILL_MOUNTS && !Has310Flyer(false))
+ if (pSkill->ID == SKILL_MOUNTS && !Has310Flyer(false))
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED &&
spellInfo->Effects[i].CalcValue() == 310)
@@ -3472,8 +3472,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// not ranked skills
for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx)
{
- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId);
- UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->SkillLine);
+ UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->SkillLine);
}
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId);
@@ -3694,11 +3694,11 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
{
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
- SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId);
+ SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine);
if (!pSkill)
continue;
- if (_spell_idx->second->skillId == SKILL_MOUNTS)
+ if (_spell_idx->second->SkillLine == SKILL_MOUNTS)
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
@@ -3803,7 +3803,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId)
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(itr->first);
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
- if (_spell_idx->second->skillId != SKILL_MOUNTS)
+ if (_spell_idx->second->SkillLine != SKILL_MOUNTS)
break; // We can break because mount spells belong only to one skillline (at least 310 flyers do)
spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
@@ -3907,7 +3907,7 @@ bool Player::ResetTalents(bool no_cost)
if (!talentInfo)
continue;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+ TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
@@ -3921,18 +3921,18 @@ bool Player::ResetTalents(bool no_cost)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
// skip non-existing talent ranks
- if (talentInfo->RankID[rank] == 0)
+ if (talentInfo->SpellRank[rank] == 0)
continue;
- SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]);
+ SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellRank[rank]);
if (!_spellEntry)
continue;
- RemoveSpell(talentInfo->RankID[rank], true);
+ RemoveSpell(talentInfo->SpellRank[rank], true);
// search for spells that the talent teaches and unlearn them
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
RemoveSpell(_spellEntry->Effects[i].TriggerSpell, true);
// if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
- PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
+ PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->SpellRank[rank]);
if (plrTalent != m_talents[m_activeSpec]->end())
plrTalent->second->state = PLAYERSPELL_REMOVED;
}
@@ -4936,8 +4936,18 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
return TotalCost;
}
- uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)];
- uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod));
+ uint32 dmultiplier;
+ switch (ditemProto->Class)
+ {
+ case ITEM_CLASS_WEAPON:
+ dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass];
+ case ITEM_CLASS_ARMOR:
+ dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass];
+ default:
+ dmultiplier = 0;
+ }
+
+ uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->Data));
costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST));
@@ -4991,7 +5001,7 @@ void Player::RepopAtGraveyard()
bool shouldResurrect = false;
// Such zones are considered unreachable as a ghost and the player must be automatically revived
- if ((!IsAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
+ if ((!IsAlive() && zone && zone->Flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
{
shouldResurrect = true;
SpawnCorpseBones();
@@ -5017,12 +5027,12 @@ void Player::RepopAtGraveyard()
// and don't show spirit healer location
if (ClosestGrave)
{
- TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation(), shouldResurrect ? TELE_REVIVE_AT_TELEPORT : 0);
+ TeleportTo(ClosestGrave->Continent, ClosestGrave->Loc.X, ClosestGrave->Loc.Y, ClosestGrave->Loc.Z, GetOrientation(), shouldResurrect ? TELE_REVIVE_AT_TELEPORT : 0);
if (isDead()) // not send if alive, because it used in TeleportTo()
{
WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap
- data << ClosestGrave->map_id;
- data << TaggedPosition<Position::XYZ>(ClosestGrave->x, ClosestGrave->y, ClosestGrave->z);
+ data << ClosestGrave->Continent;
+ data << TaggedPosition<Position::XYZ>(ClosestGrave->Loc.X, ClosestGrave->Loc.Y, ClosestGrave->Loc.Z);
SendDirectMessage(&data);
}
}
@@ -5034,13 +5044,13 @@ void Player::RepopAtGraveyard()
bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) const
{
- if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE)
+ if (channel->Flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->Flags & AREA_FLAG_ARENA_INSTANCE)
return false;
- if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL)))
+ if ((channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->Flags & AREA_FLAG_SLAVE_CAPITAL)))
return false;
- if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
+ if ((channel->Flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId())
return false;
return true;
@@ -5107,12 +5117,12 @@ void Player::UpdateLocalChannels(uint32 newZone)
if (CanJoinConstantChannelInZone(channelEntry, current_zone))
{
- if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL))
+ if (!(channelEntry->Flags & CHANNEL_DBC_FLAG_GLOBAL))
{
- if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
+ if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel)
continue; // Already on the channel, as city channel names are not changing
- joinChannel = cMgr->GetSystemChannel(channelEntry->ChannelID, current_zone);
+ joinChannel = cMgr->GetSystemChannel(channelEntry->ID, current_zone);
if (usedChannel)
{
if (joinChannel != usedChannel)
@@ -5125,7 +5135,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
}
}
else
- joinChannel = cMgr->GetSystemChannel(channelEntry->ChannelID);
+ joinChannel = cMgr->GetSystemChannel(channelEntry->ID);
}
else
removeChannel = usedChannel;
@@ -5242,14 +5252,14 @@ void Player::UpdateDamageDoneMods(WeaponAttackType attackType, int32 skipEnchant
for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i)
{
- switch (enchantmentEntry->type[i])
+ switch (enchantmentEntry->Effect[i])
{
case ITEM_ENCHANTMENT_TYPE_DAMAGE:
- amount += enchantmentEntry->amount[i];
+ amount += enchantmentEntry->EffectPointsMin[i];
break;
case ITEM_ENCHANTMENT_TYPE_TOTEM:
if (GetClass() == CLASS_SHAMAN)
- amount += enchantmentEntry->amount[i] * item->GetTemplate()->Delay / 1000.0f;
+ amount += enchantmentEntry->EffectPointsMin[i] * item->GetTemplate()->Delay / 1000.0f;
break;
default:
break;
@@ -5318,7 +5328,7 @@ float Player::GetMeleeCritFromAgility() const
if (critBase == nullptr || critRatio == nullptr)
return 0.0f;
- float crit = critBase->base + GetStat(STAT_AGILITY)*critRatio->ratio;
+ float crit = critBase->Data + GetStat(STAT_AGILITY)*critRatio->Data;
return crit*100.0f;
}
@@ -5371,8 +5381,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) cons
float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
// calculate diminishing (green in char screen) and non-diminishing (white) contribution
- diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1];
- nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]);
+ diminishing = 100.0f * bonus_agility * dodgeRatio->Data * crit_to_dodge[pclass-1];
+ nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->Data * crit_to_dodge[pclass-1]);
}
float Player::GetSpellCritFromIntellect() const
@@ -5388,7 +5398,7 @@ float Player::GetSpellCritFromIntellect() const
if (critBase == nullptr || critRatio == nullptr)
return 0.0f;
- float crit = critBase->base + GetStat(STAT_INTELLECT) * critRatio->ratio;
+ float crit = critBase->Data + GetStat(STAT_INTELLECT) * critRatio->Data;
return crit * 100.0f;
}
@@ -5405,7 +5415,7 @@ float Player::GetRatingMultiplier(CombatRating cr) const
if (!Rating || !classRating)
return 1.0f; // By default use minimum coefficient (not must be called)
- return classRating->ratio / Rating->ratio;
+ return classRating->Data / Rating->Data;
}
float Player::GetRatingBonusValue(CombatRating cr) const
@@ -5446,7 +5456,7 @@ float Player::OCTRegenHPPerSpirit() const
if (baseSpirit > 50)
baseSpirit = 50;
float moreSpirit = spirit - baseSpirit;
- float regen = baseSpirit * baseRatio->ratio + moreSpirit * moreRatio->ratio;
+ float regen = baseSpirit * baseRatio->Data + moreSpirit * moreRatio->Data;
return regen;
}
@@ -5465,7 +5475,7 @@ float Player::OCTRegenMPPerSpirit() const
// Formula get from PaperDollFrame script
float spirit = GetStat(STAT_SPIRIT);
- float regen = spirit * moreRatio->ratio;
+ float regen = spirit * moreRatio->Data;
return regen;
}
@@ -5671,24 +5681,24 @@ bool Player::UpdateCraftSkill(uint32 spellid)
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
- if (_spell_idx->second->skillId)
+ if (_spell_idx->second->SkillLine)
{
- uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId);
+ uint32 SkillValue = GetPureSkillValue(_spell_idx->second->SkillLine);
// Alchemy Discoveries here
SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid);
if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY)
{
- if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this))
+ if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->SkillLine, spellid, this))
LearnSpell(discoveredSpell, false);
}
uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING);
- return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue,
- _spell_idx->second->max_value,
- (_spell_idx->second->max_value + _spell_idx->second->min_value)/2,
- _spell_idx->second->min_value),
+ return UpdateSkillPro(_spell_idx->second->SkillLine, SkillGainChance(SkillValue,
+ _spell_idx->second->TrivialSkillLineRankHigh,
+ (_spell_idx->second->TrivialSkillLineRankHigh + _spell_idx->second->TrivialSkillLineRankLow)/2,
+ _spell_idx->second->TrivialSkillLineRankLow),
craft_skill_gain);
}
}
@@ -6039,8 +6049,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
// remove all spells that related to this skill
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j))
- if (pAbility->skillId == id)
- RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId));
+ if (pAbility->SkillLine == id)
+ RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->Spell));
}
}
else if (newVal) //add
@@ -6403,7 +6413,7 @@ void Player::SendCinematicStart(uint32 CinematicSequenceId) const
SendDirectMessage(packet.Write());
if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId))
- _cinematicMgr->SetActiveCinematicCamera(sequence->cinematicCamera);
+ _cinematicMgr->SetActiveCinematicCamera(sequence->Camera[0]);
}
void Player::SendMovieStart(uint32 movieId)
@@ -6437,16 +6447,16 @@ void Player::CheckAreaExploreAndOutdoor()
return;
}
- uint32 offset = areaEntry->exploreFlag / 32;
+ uint32 offset = areaEntry->AreaBit / 32;
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
TC_LOG_ERROR("entities.player", "Player::CheckAreaExploreAndOutdoor: Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).",
- areaEntry->exploreFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
+ areaEntry->AreaBit, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE);
return;
}
- uint32 val = (uint32)(1 << (areaEntry->exploreFlag % 32));
+ uint32 val = (uint32)(1 << (areaEntry->AreaBit % 32));
uint32 currFields = GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
if (!(currFields & val))
@@ -6455,7 +6465,7 @@ void Player::CheckAreaExploreAndOutdoor()
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA, GetAreaId());
- if (areaEntry->area_level > 0)
+ if (areaEntry->ExplorationLevel > 0)
{
if (IsMaxLevel())
{
@@ -6463,7 +6473,7 @@ void Player::CheckAreaExploreAndOutdoor()
}
else
{
- int32 diff = int32(GetLevel()) - areaEntry->area_level;
+ int32 diff = int32(GetLevel()) - areaEntry->ExplorationLevel;
uint32 XP;
if (diff < -5)
{
@@ -6475,16 +6485,16 @@ void Player::CheckAreaExploreAndOutdoor()
if (exploration_percent < 0)
exploration_percent = 0;
- XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE));
+ XP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE));
}
else
{
- XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE));
+ XP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*sWorld->getRate(RATE_XP_EXPLORE));
}
if (sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO))
{
- uint32 minScaledXP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE)) * sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO) / 100;
+ uint32 minScaledXP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*sWorld->getRate(RATE_XP_EXPLORE)) * sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO) / 100;
XP = std::max(minScaledXP, XP);
}
@@ -6500,12 +6510,12 @@ uint32 Player::TeamForRace(uint8 race)
{
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
{
- switch (rEntry->TeamID)
+ switch (rEntry->BaseLanguage)
{
case 1: return HORDE;
case 7: return ALLIANCE;
}
- TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
+ TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->BaseLanguage);
}
else
TC_LOG_ERROR("entities.player", "Race (%u) not found in DBC: wrong DBC files?", uint32(race));
@@ -6628,7 +6638,7 @@ void Player::RewardReputation(Unit* victim, float rate)
Map const* map = GetMap();
if (map->IsNonRaidDungeon())
if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty()))
- if (dungeon->reclevel == 80)
+ if (dungeon->TargetLevel == 80)
ChampioningFaction = GetChampioningFaction();
}
@@ -6684,7 +6694,7 @@ void Player::RewardReputation(Quest const* quest)
if (QuestFactionRewEntry const* questFactionRewEntry = sQuestFactionRewardStore.LookupEntry(row))
{
uint32 field = abs(quest->RewardFactionValueId[i]);
- rep = questFactionRewEntry->QuestRewFactionValue[field];
+ rep = questFactionRewEntry->Difficulty[field];
}
}
@@ -6799,7 +6809,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto
// [29..38] Other title and player name
// [39+] Nothing
uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE);
- // Get Killer titles, CharTitlesEntry::bit_index
+ // Get Killer titles, CharTitlesEntry::MaskID
// Ranks:
// title[1..14] -> rank[5..18]
// title[15..28] -> rank[5..18]
@@ -7013,7 +7023,7 @@ void Player::UpdateArea(uint32 newArea)
AreaTableEntry const* area = sAreaTableStore.LookupEntry(newArea);
bool oldFFAPvPArea = pvpInfo.IsInFFAPvPArea;
- pvpInfo.IsInFFAPvPArea = area && (area->flags & AREA_FLAG_ARENA);
+ pvpInfo.IsInFFAPvPArea = area && (area->Flags & AREA_FLAG_ARENA);
UpdatePvPState(true);
// check if we were in ffa arena and we left
@@ -7035,7 +7045,7 @@ void Player::UpdateArea(uint32 newArea)
RemoveByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_SANCTUARY);
uint32 const areaRestFlag = (GetTeam() == ALLIANCE) ? AREA_FLAG_REST_ZONE_ALLIANCE : AREA_FLAG_REST_ZONE_HORDE;
- if (area && area->flags & areaRestFlag)
+ if (area && area->Flags & areaRestFlag)
SetRestFlag(REST_FLAG_IN_FACTION_AREA);
else
RemoveRestFlag(REST_FLAG_IN_FACTION_AREA);
@@ -7076,19 +7086,19 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
GetMap()->SendZoneDynamicInfo(newZone, this);
- // in PvP, any not controlled zone (except zone->team == 6, default case)
+ // in PvP, any not controlled zone (except zone->FactionGroupMask == 6, default case)
// in PvE, only opposition team capital
- switch (zone->team)
+ switch (zone->FactionGroupMask)
{
case AREATEAM_ALLY:
- pvpInfo.IsInHostileArea = GetTeam() != ALLIANCE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
+ pvpInfo.IsInHostileArea = GetTeam() != ALLIANCE && (sWorld->IsPvPRealm() || zone->Flags & AREA_FLAG_CAPITAL);
break;
case AREATEAM_HORDE:
- pvpInfo.IsInHostileArea = GetTeam() != HORDE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
+ pvpInfo.IsInHostileArea = GetTeam() != HORDE && (sWorld->IsPvPRealm() || zone->Flags & AREA_FLAG_CAPITAL);
break;
case AREATEAM_NONE:
// overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this
- pvpInfo.IsInHostileArea = sWorld->IsPvPRealm() || InBattleground() || zone->flags & AREA_FLAG_WINTERGRASP;
+ pvpInfo.IsInHostileArea = sWorld->IsPvPRealm() || InBattleground() || zone->Flags & AREA_FLAG_WINTERGRASP;
break;
default: // 6 in fact
pvpInfo.IsInHostileArea = false;
@@ -7098,7 +7108,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
// Treat players having a quest flagging for PvP as always in hostile area
pvpInfo.IsHostile = pvpInfo.IsInHostileArea || HasPvPForcingQuest();
- if (zone->flags & AREA_FLAG_CAPITAL) // Is in a capital city
+ if (zone->Flags & AREA_FLAG_CAPITAL) // Is in a capital city
{
if (!pvpInfo.IsHostile || zone->IsSanctuary())
SetRestFlag(REST_FLAG_IN_CITY);
@@ -7349,7 +7359,7 @@ ScalingStatValuesEntry const* Player::GetScalingStatValuesFor(ItemTemplate const
return nullptr;
// req. check at equip, but allow use for extended range if range limit max level, set proper level
- uint32 const ssd_level = std::min(uint32(GetLevel()), ssd->MaxLevel);
+ uint32 const ssd_level = std::min(uint32(GetLevel()), ssd->Maxlevel);
return sScalingStatValuesStore.LookupEntry(ssd_level);
}
@@ -7370,10 +7380,10 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply
// If set ScalingStatDistribution need get stats and values from it
if (ssd && ssv)
{
- if (ssd->StatMod[i] < 0)
+ if (ssd->StatID[i] < 0)
continue;
- statType = ssd->StatMod[i];
- val = (ssv->getssdMultiplier(proto->ScalingStatValue) * ssd->Modifier[i]) / 10000;
+ statType = ssd->StatID[i];
+ val = (ssv->getssdMultiplier(proto->ScalingStatValue) * ssd->Bonus[i]) / 10000;
}
else
{
@@ -8008,7 +8018,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id);
@@ -8030,15 +8040,15 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_WHITE_HIT) && damageInfo.GetSpellInfo())
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
- GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->spellid[s]);
+ GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->EffectArg[s]);
continue;
}
- float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
+ float chance = pEnchant->EffectPointsMin[s] != 0 ? float(pEnchant->EffectPointsMin[s]) : GetWeaponProcChance();
if (entry)
{
if (entry->ProcsPerMinute)
@@ -8048,7 +8058,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
}
// Apply spell mods
- ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
+ ApplySpellMod(pEnchant->EffectArg[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
// Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT)
@@ -8141,13 +8151,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
+ if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectArg[s]);
continue;
}
@@ -9407,12 +9417,12 @@ void Player::SendBGWeekendWorldStates() const
for (uint32 i = 1; i < sBattlemasterListStore.GetNumRows(); ++i)
{
BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(i);
- if (bl && bl->HolidayWorldStateId)
+ if (bl && bl->HolidayWorldState)
{
- if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->id))
- SendUpdateWorldState(bl->HolidayWorldStateId, 1);
+ if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->ID))
+ SendUpdateWorldState(bl->HolidayWorldState, 1);
else
- SendUpdateWorldState(bl->HolidayWorldStateId, 0);
+ SendUpdateWorldState(bl->HolidayWorldState, 0);
}
}
}
@@ -10290,13 +10300,13 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
}
- if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE)
+ if (limitEntry->Flags == ITEM_LIMIT_CATEGORY_MODE_HAVE)
{
uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem);
- if (curcount + count > uint32(limitEntry->maxCount))
+ if (curcount + count > uint32(limitEntry->Quantity))
{
if (no_space_count)
- *no_space_count = count + curcount - limitEntry->maxCount;
+ *no_space_count = count + curcount - limitEntry->Quantity;
if (itemLimitCategory)
*itemLimitCategory = pProto->ItemLimitCategory;
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED;
@@ -11361,7 +11371,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
ScalingStatDistributionEntry const* ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0;
// check allowed level (extend range to upper values if MaxLevel more or equal max player level, this let GM set high level with 1...max range items)
- if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < GetLevel())
+ if (ssd && ssd->Maxlevel < DEFAULT_MAX_LEVEL && ssd->Maxlevel < GetLevel())
return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED;
uint8 eslot = FindEquipSlot(pProto, slot, swap);
@@ -13729,13 +13739,13 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
if (!pEnchant)
return;
- if (!ignore_condition && pEnchant->EnchantmentCondition && !EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1))
+ if (!ignore_condition && pEnchant->ConditionID && !EnchantmentFitsRequirements(pEnchant->ConditionID, -1))
return;
- if (pEnchant->requiredLevel > GetLevel())
+ if (pEnchant->MinLevel > GetLevel())
return;
- if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill))
+ if (pEnchant->RequiredSkillID > 0 && pEnchant->RequiredSkillRank > GetSkillValue(pEnchant->RequiredSkillID))
return;
// If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements
@@ -13745,7 +13755,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
// Check if the requirements for the prismatic socket are met before applying the gem stats
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if (!pPrismaticEnchant || (pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill)))
+ if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID)))
return;
}
@@ -13753,9 +13763,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- uint32 enchant_display_type = pEnchant->type[s];
- uint32 enchant_amount = pEnchant->amount[s];
- uint32 enchant_spell_id = pEnchant->spellid[s];
+ uint32 enchant_display_type = pEnchant->Effect[s];
+ uint32 enchant_amount = pEnchant->EffectPointsMin[s];
+ uint32 enchant_spell_id = pEnchant->EffectArg[s];
switch (enchant_display_type)
{
@@ -13786,9 +13796,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// Search enchant_amount
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
- if (item_rand->enchant_id[k] == enchant_id)
+ if (item_rand->Enchantment[k] == enchant_id)
{
- basepoints = int32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000);
+ basepoints = int32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -13815,9 +13825,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
- if (item_rand->enchant_id[k] == enchant_id)
+ if (item_rand->Enchantment[k] == enchant_id)
{
- enchant_amount = uint32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000);
+ enchant_amount = uint32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -13835,9 +13845,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
{
- if (item_rand_suffix->enchant_id[k] == enchant_id)
+ if (item_rand_suffix->Enchantment[k] == enchant_id)
{
- enchant_amount = uint32((item_rand_suffix->prefix[k] * item->GetItemSuffixFactor()) / 10000);
+ enchant_amount = uint32((item_rand_suffix->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000);
break;
}
}
@@ -14093,12 +14103,12 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
if (!Enchant)
return;
- if (Enchant->requiredSkill == skill_id)
+ if (Enchant->RequiredSkillID == skill_id)
{
// Checks if the enchantment needs to be applied or removed
- if (curr_value < Enchant->requiredSkillValue && new_value >= Enchant->requiredSkillValue)
+ if (curr_value < Enchant->RequiredSkillRank && new_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
- else if (new_value < Enchant->requiredSkillValue && curr_value >= Enchant->requiredSkillValue)
+ else if (new_value < Enchant->RequiredSkillRank && curr_value >= Enchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
@@ -14109,11 +14119,11 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
{
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if (pPrismaticEnchant && pPrismaticEnchant->requiredSkill == skill_id)
+ if (pPrismaticEnchant && pPrismaticEnchant->RequiredSkillID == skill_id)
{
- if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue)
+ if (curr_value < pPrismaticEnchant->RequiredSkillRank && new_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);
- else if (new_value < pPrismaticEnchant->requiredSkillValue && curr_value >= pPrismaticEnchant->requiredSkillValue)
+ else if (new_value < pPrismaticEnchant->RequiredSkillRank && curr_value >= pPrismaticEnchant->RequiredSkillRank)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false);
}
}
@@ -17518,8 +17528,8 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder)
else // has start node, teleport to it
{
TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has too short taxi destination list, teleport to original node.", GetGUID().ToString().c_str());
- mapId = nodeEntry->map_id;
- Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f);
+ mapId = nodeEntry->ContinentID;
+ Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f);
}
m_taxi.ClearTaxiDestinations();
}
@@ -17528,11 +17538,11 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder)
{
// save source node as recall coord to prevent recall and fall from sky
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
- if (nodeEntry && nodeEntry->map_id == GetMapId())
+ if (nodeEntry && nodeEntry->ContinentID == GetMapId())
{
ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
- mapId = nodeEntry->map_id;
- Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f);
+ mapId = nodeEntry->ContinentID;
+ Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f);
}
// flight will started later
@@ -18095,13 +18105,13 @@ void Player::_LoadGlyphAuras()
{
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(GetGlyphSlot(i)))
{
- if (gp->TypeFlags == gs->TypeFlags)
+ if (gp->GlyphSlotFlags == gs->Type)
{
- CastSpell(this, gp->SpellId, true);
+ CastSpell(this, gp->SpellID, true);
continue;
}
else
- TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has glyph with typeflags %u in slot with typeflags %u, removing.", GetName().c_str(), GetGUID().ToString().c_str(), gp->TypeFlags, gs->TypeFlags);
+ TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has glyph with typeflags %u in slot with typeflags %u, removing.", GetName().c_str(), GetGUID().ToString().c_str(), gp->GlyphSlotFlags, gs->Type);
}
else
TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has not existing glyph slot entry %u on index %u", GetName().c_str(), GetGUID().ToString().c_str(), GetGlyphSlot(i), i);
@@ -18840,7 +18850,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
bool deleteInstance = false;
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
- std::string mapname = mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : "Unknown";
+ std::string mapname = mapEntry ? mapEntry->MapName[sWorld->GetDefaultDbcLocale()] : "Unknown";
if (!mapEntry || !mapEntry->IsDungeon())
{
@@ -20501,7 +20511,7 @@ void Player::ResetInstances(uint8 method, bool isRaid)
if (method == INSTANCE_RESET_ALL)
{
// the "reset all instances" method can only reset normal maps
- if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC)
+ if (entry->InstanceType == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC)
{
++itr;
continue;
@@ -21469,7 +21479,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
m_taxi.ClearTaxiDestinations();
ModifyMoney(-(int32)totalcost);
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost);
- TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, GetOrientation());
+ TeleportTo(lastPathNode->ContinentID, lastPathNode->Pos.X, lastPathNode->Pos.Y, lastPathNode->Pos.Z, GetOrientation());
return false;
}
else
@@ -21491,8 +21501,8 @@ bool Player::ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid /*= 0*/)
std::vector<uint32> nodes;
nodes.resize(2);
- nodes[0] = entry->from;
- nodes[1] = entry->to;
+ nodes[0] = entry->FromTaxiNode;
+ nodes[1] = entry->ToTaxiNode;
return ActivateTaxiPathTo(nodes, nullptr, spellid);
}
@@ -21533,7 +21543,7 @@ void Player::ContinueTaxiFlight() const
TaxiPathNodeList const& nodeList = sTaxiPathNodesByPath[path];
float distPrev;
- float distNext = GetExactDistSq(nodeList[0]->LocX, nodeList[0]->LocY, nodeList[0]->LocZ);
+ float distNext = GetExactDistSq(nodeList[0]->Loc.X, nodeList[0]->Loc.Y, nodeList[0]->Loc.Z);
for (uint32 i = 1; i < nodeList.size(); ++i)
{
@@ -21541,17 +21551,17 @@ void Player::ContinueTaxiFlight() const
TaxiPathNodeEntry const* prevNode = nodeList[i-1];
// skip nodes at another map
- if (node->MapID != GetMapId())
+ if (node->ContinentID != GetMapId())
continue;
distPrev = distNext;
- distNext = GetExactDistSq(node->LocX, node->LocY, node->LocZ);
+ distNext = GetExactDistSq(node->Loc.X, node->Loc.Y, node->Loc.Z);
float distNodes =
- (node->LocX - prevNode->LocX)*(node->LocX - prevNode->LocX) +
- (node->LocY - prevNode->LocY)*(node->LocY - prevNode->LocY) +
- (node->LocZ - prevNode->LocZ)*(node->LocZ - prevNode->LocZ);
+ (node->Loc.X - prevNode->Loc.X)*(node->Loc.X - prevNode->Loc.X) +
+ (node->Loc.Y - prevNode->Loc.Y)*(node->Loc.Y - prevNode->Loc.Y) +
+ (node->Loc.Z - prevNode->Loc.Z)*(node->Loc.Z - prevNode->Loc.Z);
if (distNext + distPrev < distNodes)
{
@@ -21588,11 +21598,11 @@ void Player::InitDataForForm(bool reapplyMods)
{
ShapeshiftForm form = GetShapeshiftForm();
- SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form);
- if (ssEntry && ssEntry->attackSpeed)
+ SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
+ if (ssEntry && ssEntry->CombatRoundTime)
{
- SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed);
- SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed);
+ SetAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime);
+ SetAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime);
SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
}
else
@@ -21652,16 +21662,16 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
{
ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost);
ASSERT(iece);
- if (iece->reqhonorpoints)
- ModifyHonorPoints(-int32(iece->reqhonorpoints * count));
+ if (iece->HonorPoints)
+ ModifyHonorPoints(-int32(iece->HonorPoints * count));
- if (iece->reqarenapoints)
- ModifyArenaPoints(-int32(iece->reqarenapoints * count));
+ if (iece->ArenaPoints)
+ ModifyArenaPoints(-int32(iece->ArenaPoints * count));
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i)
{
- if (iece->reqitem[i])
- DestroyItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count), true);
+ if (iece->ItemID[i])
+ DestroyItemCount(iece->ItemID[i], (iece->ItemCount[i] * count), true);
}
}
@@ -21789,14 +21799,14 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
}
// honor points price
- if (GetHonorPoints() < (iece->reqhonorpoints * count))
+ if (GetHonorPoints() < (iece->HonorPoints * count))
{
SendEquipError(EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS, nullptr, nullptr);
return false;
}
// arena points price
- if (GetArenaPoints() < (iece->reqarenapoints * count))
+ if (GetArenaPoints() < (iece->ArenaPoints * count))
{
SendEquipError(EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS, nullptr, nullptr);
return false;
@@ -21805,7 +21815,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
// item base price
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i)
{
- if (iece->reqitem[i] && !HasItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count)))
+ if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], (iece->ItemCount[i] * count)))
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr);
return false;
@@ -21813,7 +21823,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
}
// check for personal arena rating requirement
- if (GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating)
+ if (GetMaxPersonalArenaRatingRequirement(iece->ArenaBracket) < iece->RequiredArenaRating)
{
// probably not the proper equip err
SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, nullptr, nullptr);
@@ -22061,7 +22071,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (!enchantEntry)
continue;
- uint32 gemid = enchantEntry->GemID;
+ uint32 gemid = enchantEntry->SrcItemID;
if (!gemid)
continue;
@@ -22073,7 +22083,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (!gemProperty)
continue;
- uint8 GemColor = gemProperty->color;
+ uint8 GemColor = gemProperty->Type;
for (uint8 b = 0, tmpcolormask = 1; b < 4; b++, tmpcolormask <<= 1)
{
@@ -22088,15 +22098,15 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
for (uint8 i = 0; i < 5; i++)
{
- if (!Condition->Color[i])
+ if (!Condition->LtOperandType[i])
continue;
- uint32 _cur_gem = curcount[Condition->Color[i] - 1];
+ uint32 _cur_gem = curcount[Condition->LtOperandType[i] - 1];
// if have <CompareColor> use them as count, else use <value> from Condition
- uint32 _cmp_gem = Condition->CompareColor[i] ? curcount[Condition->CompareColor[i] - 1]: Condition->Value[i];
+ uint32 _cmp_gem = Condition->RtOperandType[i] ? curcount[Condition->RtOperandType[i] - 1]: Condition->RtOperand[i];
- switch (Condition->Comparator[i])
+ switch (Condition->Operator[i])
{
case 2: // requires less <color> than (<value> || <comparecolor>) gems
activate &= (_cur_gem < _cmp_gem) ? true : false;
@@ -22140,7 +22150,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply)
if (!enchantEntry)
continue;
- uint32 condition = enchantEntry->EnchantmentCondition;
+ uint32 condition = enchantEntry->ConditionID;
if (condition)
{
//was enchant active with/without item?
@@ -22184,7 +22194,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply)
continue;
//only metagems to be (de)activated, so only enchants with condition
- uint32 condition = enchantEntry->EnchantmentCondition;
+ uint32 condition = enchantEntry->ConditionID;
if (condition)
ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply);
}
@@ -22221,7 +22231,7 @@ void Player::SetBattlegroundEntryPoint()
if (GetMap()->IsDungeon())
{
if (WorldSafeLocsEntry const* entry = sObjectMgr->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()))
- m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f);
+ m_bgData.joinPos = WorldLocation(entry->Continent, entry->Loc.X, entry->Loc.Y, entry->Loc.Z, 0.0f);
else
TC_LOG_ERROR("entities.player", "Player::SetBattlegroundEntryPoint: Dungeon (MapID: %u) has no linked graveyard, setting home location as entry point.", GetMapId());
}
@@ -22950,7 +22960,7 @@ void Player::ResetSpells(bool myClassOnly)
ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(GetClass());
if (!clsEntry)
return;
- family = clsEntry->spellfamily;
+ family = clsEntry->SpellClassSet;
for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter)
{
@@ -23062,8 +23072,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
if (!rank)
break;
- SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier);
- uint16 maxValue = tier->MaxSkill[std::max<int32>(rank - 1, 0)];
+ SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID);
+ uint16 maxValue = tier->Value[std::max<int32>(rank - 1, 0)];
uint16 skillValue = 1;
if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
skillValue = maxValue;
@@ -23148,37 +23158,37 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j);
- if (!ability || ability->skillId != skillId)
+ if (!ability || ability->SkillLine != skillId)
continue;
- if (!sSpellMgr->GetSpellInfo(ability->spellId))
+ if (!sSpellMgr->GetSpellInfo(ability->Spell))
continue;
- if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
+ if (ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
// Check race if set
- if (ability->racemask && !(ability->racemask & raceMask))
+ if (ability->RaceMask && !(ability->RaceMask & raceMask))
continue;
// Check class if set
- if (ability->classmask && !(ability->classmask & classMask))
+ if (ability->ClassMask && !(ability->ClassMask & classMask))
continue;
// need unlearn spell
- if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
- RemoveSpell(ability->spellId);
+ if (skillValue < ability->MinSkillLineRank && ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
+ RemoveSpell(ability->Spell);
// need learn
else
{
// used to avoid double Seal of Righteousness on paladins, it's the only player spell which has both spell and forward spell in auto learn
- if (ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && ability->forward_spellid)
+ if (ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && ability->SupercededBySpell)
{
bool skipCurrent = false;
- auto bounds = sSpellMgr->GetSkillLineAbilityMapBounds(ability->forward_spellid);
+ auto bounds = sSpellMgr->GetSkillLineAbilityMapBounds(ability->SupercededBySpell);
for (auto itr = bounds.first; itr != bounds.second; ++itr)
{
- if (itr->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && skillValue >= itr->second->req_skill_value)
+ if (itr->second->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && skillValue >= itr->second->MinSkillLineRank)
{
skipCurrent = true;
break;
@@ -23190,9 +23200,9 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
}
if (!IsInWorld())
- AddSpell(ability->spellId, true, true, true, false, false, ability->skillId);
+ AddSpell(ability->Spell, true, true, true, false, false, ability->SkillLine);
else
- LearnSpell(ability->spellId, true, ability->skillId);
+ LearnSpell(ability->Spell, true, ability->SkillLine);
}
}
}
@@ -23457,10 +23467,10 @@ float Player::GetReputationPriceDiscount(Creature const* creature) const
float Player::GetReputationPriceDiscount(FactionTemplateEntry const* factionTemplate) const
{
- if (!factionTemplate || !factionTemplate->faction)
+ if (!factionTemplate || !factionTemplate->Faction)
return 1.0f;
- ReputationRank rank = GetReputationRank(factionTemplate->faction);
+ ReputationRank rank = GetReputationRank(factionTemplate->Faction);
if (rank <= REP_NEUTRAL)
return 1.0f;
@@ -23484,15 +23494,15 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const
for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx)
{
// skip wrong race skills
- if (_spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0)
+ if (_spell_idx->second->RaceMask && (_spell_idx->second->RaceMask & racemask) == 0)
continue;
// skip wrong class skills
- if (_spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0)
+ if (_spell_idx->second->ClassMask && (_spell_idx->second->ClassMask & classmask) == 0)
continue;
// skip wrong class and race skill saved in SkillRaceClassInfo.dbc
- if (!GetSkillRaceClassInfo(_spell_idx->second->skillId, GetRace(), GetClass()))
+ if (!GetSkillRaceClassInfo(_spell_idx->second->SkillLine, GetRace(), GetClass()))
continue;
return true;
@@ -24500,7 +24510,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n
uint8 facialhair = GetFacialStyle();
uint8 skincolor = GetSkinId();
- if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->hair_id == skincolor)))
+ if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->Data == skincolor)))
return 0;
GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1);
@@ -24511,16 +24521,16 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n
float cost = 0;
if (hairstyle != newhairstyle)
- cost += bsc->cost; // full price
+ cost += bsc->Data; // full price
if ((haircolor != newhaircolor) && (hairstyle == newhairstyle))
- cost += bsc->cost * 0.5f; // +1/2 of price
+ cost += bsc->Data * 0.5f; // +1/2 of price
if (facialhair != newfacialhair)
- cost += bsc->cost * 0.75f; // +3/4 of price
+ cost += bsc->Data * 0.75f; // +3/4 of price
- if (newSkin && skincolor != newSkin->hair_id)
- cost += bsc->cost * 0.75f; // +5/6 of price
+ if (newSkin && skincolor != newSkin->Data)
+ cost += bsc->Data * 0.75f; // +5/6 of price
return uint32(cost);
}
@@ -24529,8 +24539,8 @@ void Player::InitGlyphsForLevel()
{
for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i)
if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i))
- if (gs->Order)
- SetGlyphSlot(gs->Order - 1, gs->Id);
+ if (gs->Tooltip)
+ SetGlyphSlot(gs->Tooltip - 1, gs->ID);
uint8 level = GetLevel();
uint32 value = 0;
@@ -24582,13 +24592,13 @@ bool Player::HasTitle(uint32 bitIndex) const
bool Player::HasTitle(CharTitlesEntry const* title) const
{
- return HasTitle(title->bit_index);
+ return HasTitle(title->MaskID);
}
void Player::SetTitle(CharTitlesEntry const* title, bool lost)
{
- uint32 fieldIndexOffset = title->bit_index / 32;
- uint32 flag = 1 << (title->bit_index % 32);
+ uint32 fieldIndexOffset = title->MaskID / 32;
+ uint32 flag = 1 << (title->MaskID % 32);
if (lost)
{
@@ -24606,7 +24616,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
}
WorldPacket data(SMSG_TITLE_EARNED, 4 + 4);
- data << uint32(title->bit_index);
+ data << uint32(title->MaskID);
data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost
SendDirectMessage(&data);
}
@@ -25007,11 +25017,11 @@ void Player::_LoadSkills(PreparedQueryResult result)
}
uint16 skillStep = 0;
- if (SkillTiersEntry const* skillTier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier))
+ if (SkillTiersEntry const* skillTier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
{
for (uint32 i = 0; i < MAX_SKILL_STEP; ++i)
{
- if (skillTier->MaxSkill[skillStep] == max)
+ if (skillTier->Value[skillStep] == max)
{
skillStep = i + 1;
break;
@@ -25091,7 +25101,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi
if (!enchantEntry)
continue;
- ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->GemID);
+ ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->SrcItemID);
if (!pGem)
continue;
@@ -25125,13 +25135,13 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8
// NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case
- if (limit_count > limitEntry->maxCount)
+ if (limit_count > limitEntry->Quantity)
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED;
// there is an equip limit on this item
- if (HasItemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot))
+ if (HasItemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot))
return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED;
- else if (HasGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot))
+ else if (HasGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot))
return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED;
}
@@ -25250,7 +25260,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
if (!talentInfo)
return;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+ TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
return;
@@ -25263,7 +25273,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
uint8 curtalent_maxrank = 0; // 0 = not learned any rank
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- if (talentInfo->RankID[rank] && HasSpell(talentInfo->RankID[rank]))
+ if (talentInfo->SpellRank[rank] && HasSpell(talentInfo->SpellRank[rank]))
{
curtalent_maxrank = (rank + 1);
break;
@@ -25279,15 +25289,15 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
return;
// Check if it requires another talent
- if (talentInfo->DependsOn > 0)
+ if (talentInfo->PrereqTalent > 0)
{
- if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
+ if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->PrereqTalent))
{
bool hasEnoughRank = false;
- for (uint8 rank = talentInfo->DependsOnRank; rank < MAX_TALENT_RANK; rank++)
+ for (uint8 rank = talentInfo->PrereqRank; rank < MAX_TALENT_RANK; rank++)
{
- if (depTalentInfo->RankID[rank] != 0)
- if (HasSpell(depTalentInfo->RankID[rank]))
+ if (depTalentInfo->SpellRank[rank] != 0)
+ if (HasSpell(depTalentInfo->SpellRank[rank]))
hasEnoughRank = true;
}
if (!hasEnoughRank)
@@ -25298,22 +25308,22 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
// Find out how many points we have in this field
uint32 spentPoints = 0;
- uint32 tTab = talentInfo->TalentTab;
- if (talentInfo->Row > 0)
+ uint32 tTab = talentInfo->TabID;
+ if (talentInfo->TierID > 0)
for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++) // Loop through all talents.
if (TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i)) // the way talents are tracked
- if (tmpTalent->TalentTab == tTab)
+ if (tmpTalent->TabID == tTab)
for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
- if (tmpTalent->RankID[rank] != 0)
- if (HasSpell(tmpTalent->RankID[rank]))
+ if (tmpTalent->SpellRank[rank] != 0)
+ if (HasSpell(tmpTalent->SpellRank[rank]))
spentPoints += (rank + 1);
// not have required min points spent in talent tree
- if (spentPoints < (talentInfo->Row * MAX_TALENT_RANK))
+ if (spentPoints < (talentInfo->TierID * MAX_TALENT_RANK))
return;
// spell not set in talent.dbc
- uint32 spellid = talentInfo->RankID[talentRank];
+ uint32 spellid = talentInfo->SpellRank[talentRank];
if (spellid == 0)
{
TC_LOG_ERROR("entities.player", "Player::LearnTalent: Talent.dbc has no spellInfo for talent: %u (spell id = 0)", talentId);
@@ -25357,7 +25367,7 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
if (!talentInfo)
return;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+ TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
return;
@@ -25372,18 +25382,18 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
if (!pet_family)
return;
- if (pet_family->petTalentType < 0) // not hunter pet
+ if (pet_family->PetTalentType < 0) // not hunter pet
return;
// prevent learn talent for different family (cheating)
- if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
+ if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID))
return;
// find current max talent rank (0~5)
uint8 curtalent_maxrank = 0; // 0 = not learned any rank
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- if (talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank]))
+ if (talentInfo->SpellRank[rank] && pet->HasSpell(talentInfo->SpellRank[rank]))
{
curtalent_maxrank = (rank + 1);
break;
@@ -25399,15 +25409,15 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
return;
// Check if it requires another talent
- if (talentInfo->DependsOn > 0)
+ if (talentInfo->PrereqTalent > 0)
{
- if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn))
+ if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->PrereqTalent))
{
bool hasEnoughRank = false;
- for (uint8 rank = talentInfo->DependsOnRank; rank < MAX_TALENT_RANK; rank++)
+ for (uint8 rank = talentInfo->PrereqRank; rank < MAX_TALENT_RANK; rank++)
{
- if (depTalentInfo->RankID[rank] != 0)
- if (pet->HasSpell(depTalentInfo->RankID[rank]))
+ if (depTalentInfo->SpellRank[rank] != 0)
+ if (pet->HasSpell(depTalentInfo->SpellRank[rank]))
hasEnoughRank = true;
}
if (!hasEnoughRank)
@@ -25418,8 +25428,8 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
// Find out how many points we have in this field
uint32 spentPoints = 0;
- uint32 tTab = talentInfo->TalentTab;
- if (talentInfo->Row > 0)
+ uint32 tTab = talentInfo->TabID;
+ if (talentInfo->TierID > 0)
{
uint32 numRows = sTalentStore.GetNumRows();
for (uint32 i = 0; i < numRows; ++i) // Loop through all talents.
@@ -25428,13 +25438,13 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i);
if (tmpTalent) // the way talents are tracked
{
- if (tmpTalent->TalentTab == tTab)
+ if (tmpTalent->TabID == tTab)
{
for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
{
- if (tmpTalent->RankID[rank] != 0)
+ if (tmpTalent->SpellRank[rank] != 0)
{
- if (pet->HasSpell(tmpTalent->RankID[rank]))
+ if (pet->HasSpell(tmpTalent->SpellRank[rank]))
{
spentPoints += (rank + 1);
}
@@ -25446,11 +25456,11 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa
}
// not have required min points spent in talent tree
- if (spentPoints < (talentInfo->Row * MAX_PET_TALENT_RANK))
+ if (spentPoints < (talentInfo->TierID * MAX_PET_TALENT_RANK))
return;
// spell not set in talent.dbc
- uint32 spellid = talentInfo->RankID[talentRank];
+ uint32 spellid = talentInfo->SpellRank[talentRank];
if (spellid == 0)
{
TC_LOG_ERROR("entities.player", "Talent.dbc contains talent: %u Rank: %u spell id = 0", talentId, talentRank);
@@ -25573,14 +25583,14 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
continue;
// skip another tab talents
- if (talentInfo->TalentTab != talentTabId)
+ if (talentInfo->TabID != talentTabId)
continue;
// find max talent rank (0~4)
int8 curtalent_maxrank = -1;
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- if (talentInfo->RankID[rank] && HasTalent(talentInfo->RankID[rank], specIdx))
+ if (talentInfo->SpellRank[rank] && HasTalent(talentInfo->SpellRank[rank], specIdx))
{
curtalent_maxrank = rank;
break;
@@ -25591,7 +25601,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
if (curtalent_maxrank < 0)
continue;
- *data << uint32(talentInfo->TalentID); // Talent.dbc
+ *data << uint32(talentInfo->ID); // Talent.dbc
*data << uint8(curtalent_maxrank); // talentMaxRank (0-4)
++talentIdCount;
@@ -25631,7 +25641,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
return;
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
- if (!pet_family || pet_family->petTalentType < 0)
+ if (!pet_family || pet_family->PetTalentType < 0)
return;
for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
@@ -25640,7 +25650,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
if (!talentTabInfo)
continue;
- if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
+ if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID))
continue;
for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId)
@@ -25650,14 +25660,14 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
continue;
// skip another tab talents
- if (talentInfo->TalentTab != talentTabId)
+ if (talentInfo->TabID != talentTabId)
continue;
// find max talent rank (0~4)
int8 curtalent_maxrank = -1;
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- if (talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank]))
+ if (talentInfo->SpellRank[rank] && pet->HasSpell(talentInfo->SpellRank[rank]))
{
curtalent_maxrank = rank;
break;
@@ -25668,7 +25678,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data)
if (curtalent_maxrank < 0)
continue;
- *data << uint32(talentInfo->TalentID); // Talent.dbc
+ *data << uint32(talentInfo->ID); // Talent.dbc
*data << uint8(curtalent_maxrank); // talentMaxRank (0-4)
++talentIdCount;
@@ -26117,7 +26127,7 @@ void Player::ActivateSpec(uint8 spec)
if (!talentInfo)
continue;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+ TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
@@ -26131,10 +26141,10 @@ void Player::ActivateSpec(uint8 spec)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
// skip non-existing talent ranks
- if (talentInfo->RankID[rank] == 0)
+ if (talentInfo->SpellRank[rank] == 0)
continue;
- RemoveSpell(talentInfo->RankID[rank], true); // removes the talent, and all dependant, learned, and chained spells..
- if (SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]))
+ RemoveSpell(talentInfo->SpellRank[rank], true); // removes the talent, and all dependant, learned, and chained spells..
+ if (SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellRank[rank]))
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellInfo for valid trigger spells
if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
RemoveSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches
@@ -26150,7 +26160,7 @@ void Player::ActivateSpec(uint8 spec)
// remove secondary glyph
if (uint32 oldglyph = m_Glyphs[m_activeSpec][slot])
if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph))
- RemoveAurasDueToSpell(old_gp->SpellId);
+ RemoveAurasDueToSpell(old_gp->SpellID);
SetActiveSpec(spec);
uint32 spentTalents = 0;
@@ -26162,7 +26172,7 @@ void Player::ActivateSpec(uint8 spec)
if (!talentInfo)
continue;
- TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
+ TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID);
if (!talentTabInfo)
continue;
@@ -26175,12 +26185,12 @@ void Player::ActivateSpec(uint8 spec)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
// skip non-existing talent ranks
- if (talentInfo->RankID[rank] == 0)
+ if (talentInfo->SpellRank[rank] == 0)
continue;
// if the talent can be found in the newly activated PlayerTalentMap
- if (HasTalent(talentInfo->RankID[rank], m_activeSpec))
+ if (HasTalent(talentInfo->SpellRank[rank], m_activeSpec))
{
- LearnSpell(talentInfo->RankID[rank], false); // add the talent to the PlayerSpellMap
+ LearnSpell(talentInfo->SpellRank[rank], false); // add the talent to the PlayerSpellMap
spentTalents += (rank + 1); // increment the spentTalents count
}
}
@@ -26194,7 +26204,7 @@ void Player::ActivateSpec(uint8 spec)
// apply primary glyph
if (glyph)
if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph))
- CastSpell(this, gp->SpellId, true);
+ CastSpell(this, gp->SpellID, true);
SetGlyph(slot, glyph);
}
@@ -26302,12 +26312,12 @@ void Player::SendRefundInfo(Item* item)
WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4);
data << uint64(item->GetGUID()); // item guid
data << uint32(item->GetPaidMoney()); // money cost
- data << uint32(iece->reqhonorpoints); // honor point cost
- data << uint32(iece->reqarenapoints); // arena point cost
+ data << uint32(iece->HonorPoints); // honor point cost
+ data << uint32(iece->ArenaPoints); // arena point cost
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
{
- data << uint32(iece->reqitem[i]);
- data << uint32(iece->reqitemcount[i]);
+ data << uint32(iece->ItemID[i]);
+ data << uint32(iece->ItemCount[i]);
}
data << uint32(0);
data << uint32(GetTotalPlayedTime() - item->GetPlayedTime());
@@ -26372,8 +26382,8 @@ void Player::RefundItem(Item* item)
bool store_error = false;
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i)
{
- uint32 count = iece->reqitemcount[i];
- uint32 itemid = iece->reqitem[i];
+ uint32 count = iece->ItemCount[i];
+ uint32 itemid = iece->ItemID[i];
if (count && itemid)
{
@@ -26400,12 +26410,12 @@ void Player::RefundItem(Item* item)
data << uint64(item->GetGUID()); // item guid
data << uint32(0); // 0, or error code
data << uint32(item->GetPaidMoney()); // money cost
- data << uint32(iece->reqhonorpoints); // honor point cost
- data << uint32(iece->reqarenapoints); // arena point cost
+ data << uint32(iece->HonorPoints); // honor point cost
+ data << uint32(iece->ArenaPoints); // arena point cost
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data
{
- data << uint32(iece->reqitem[i]);
- data << uint32(iece->reqitemcount[i]);
+ data << uint32(iece->ItemID[i]);
+ data << uint32(iece->ItemCount[i]);
}
SendDirectMessage(&data);
@@ -26423,8 +26433,8 @@ void Player::RefundItem(Item* item)
// Grant back extendedcost items
for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i)
{
- uint32 count = iece->reqitemcount[i];
- uint32 itemid = iece->reqitem[i];
+ uint32 count = iece->ItemCount[i];
+ uint32 itemid = iece->ItemID[i];
if (count && itemid)
{
ItemPosCountVec dest;
@@ -26440,11 +26450,11 @@ void Player::RefundItem(Item* item)
ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB
// Grant back Honor points
- if (uint32 honorRefund = iece->reqhonorpoints)
+ if (uint32 honorRefund = iece->HonorPoints)
ModifyHonorPoints(honorRefund, trans);
// Grant back Arena points
- if (uint32 arenaRefund = iece->reqarenapoints)
+ if (uint32 arenaRefund = iece->ArenaPoints)
ModifyArenaPoints(arenaRefund, trans);
SaveInventoryAndGoldToDB(trans);
@@ -26647,9 +26657,9 @@ std::string Player::GetMapAreaAndZoneString() const
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId))
{
int locale = GetSession()->GetSessionDbcLocale();
- areaName = area->area_name[locale];
- if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone))
- zoneName = zone->area_name[locale];
+ areaName = area->AreaName[locale];
+ if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->ParentAreaID))
+ zoneName = zone->AreaName[locale];
}
std::ostringstream str;