diff options
Diffstat (limited to 'src')
91 files changed, 2084 insertions, 1849 deletions
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index bb2837be4c4..0e8811d43d1 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -96,7 +96,7 @@ GameObjectModel::~GameObjectModel() bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info) { - ModelList::const_iterator it = model_list.find(info.Displayid); + ModelList::const_iterator it = model_list.find(info.ID); if (it == model_list.end()) return false; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 90bd3e8627a..33772c2c165 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -296,7 +296,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const return false; // copypasta from Spell::CheckRange - uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->type : 0; + uint32 range_type = _spellInfo->RangeEntry ? _spellInfo->RangeEntry->Flags : 0; float max_range = _caster->GetSpellMaxRangeForTarget(target, _spellInfo); float min_range = _caster->GetSpellMinRangeForTarget(target, _spellInfo); diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 037a82713e1..92f7ce21f04 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -936,10 +936,10 @@ class SmartTrigger : public AreaTriggerScript if (!player->IsAlive()) return false; - TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id); + TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->ID); SmartScript script; script.OnInitialize(NULL, trigger); - script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); + script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID); return true; } }; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3de318ff030..4c8348f0238 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3405,7 +3405,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (obj) TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); if (at) - TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); + TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->ID); return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) @@ -3431,7 +3431,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (mEvents.empty() && obj) TC_LOG_ERROR("sql.sql", "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry()); if (mEvents.empty() && at) - TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id); + TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->ID); } void SmartScript::GetScript() @@ -3453,7 +3453,7 @@ void SmartScript::GetScript() } else if (trigger) { - e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType); + e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType); FillScript(e, NULL, trigger); } } @@ -3482,7 +3482,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; - TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); + TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->ID); } else { diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 0ee49095d72..fed0a00d0dc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -370,7 +370,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE: { if (CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(known_title.title_id)) - return source && source->HasTitle(titleInfo->bit_index); + return source && source->HasTitle(titleInfo->MaskID); return false; } @@ -669,7 +669,7 @@ void AchievementMgr<Player>::LoadFromDB(PreparedQueryResult achievementResult, P ca.date = time_t(fields[1].GetUInt32()); ca.changed = false; - _achievementPoints += achievement->points; + _achievementPoints += achievement->Points; // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) @@ -739,7 +739,7 @@ void AchievementMgr<Guild>::LoadFromDB(PreparedQueryResult achievementResult, Pr ca.changed = false; - _achievementPoints += achievement->points; + _achievementPoints += achievement->Points; } while (achievementResult->NextRow()); } @@ -851,7 +851,7 @@ template<class T> void AchievementMgr<T>::SendAchievementEarned(AchievementEntry const* achievement) const { // Don't send for achievements with ACHIEVEMENT_FLAG_HIDDEN - if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) + if (achievement->Flags & ACHIEVEMENT_FLAG_HIDDEN) return; TC_LOG_DEBUG("achievement", "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); @@ -863,7 +863,7 @@ void AchievementMgr<T>::SendAchievementEarned(AchievementEntry const* achievemen guild->BroadcastWorker(_localizer, GetOwner()); } - if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) + if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) { // broadcast realm first reached WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, GetOwner()->GetName().size() + 1 + 8 + 4 + 4); @@ -1342,7 +1342,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type, SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skillline_spell.skillLine) spellCount++; } } @@ -1367,7 +1367,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type, { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skill_line.skillLine) spellCount++; } SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); @@ -1476,7 +1476,7 @@ void AchievementMgr<T>::UpdateAchievementCriteria(AchievementCriteriaTypes type, // check again the completeness for SUMM and REQ COUNT achievements, // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria - if (achievement->flags & ACHIEVEMENT_FLAG_SUMM) + if (achievement->Flags & ACHIEVEMENT_FLAG_SUMM) if (IsCompletedAchievement(achievement)) CompletedAchievement(achievement, referencePlayer); @@ -1502,10 +1502,10 @@ bool AchievementMgr<T>::IsCompletedCriteria(AchievementCriteriaEntry const* achi return false; // counter can never complete - if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER) + if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER) return false; - if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) + if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) { // someone on this realm has already completed that achievement if (sAchievementMgr->IsRealmCompleted(achievement, GetInstanceId(GetOwner()))) @@ -1667,7 +1667,7 @@ template<class T> void AchievementMgr<T>::CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer) { // counter can never complete - if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER) + if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER) return; // already completed and stored @@ -1682,12 +1682,12 @@ template<class T> bool AchievementMgr<T>::IsCompletedAchievement(AchievementEntry const* entry) { // counter can never complete - if (entry->flags & ACHIEVEMENT_FLAG_COUNTER) + if (entry->Flags & ACHIEVEMENT_FLAG_COUNTER) return false; // for achievement with referenced achievement criterias get from referenced and counter from self - uint32 achievementForTestId = entry->refAchievement ? entry->refAchievement : entry->ID; - uint32 achievementForTestCount = entry->count; + uint32 achievementForTestId = entry->SharesCriteria ? entry->SharesCriteria : entry->ID; + uint32 achievementForTestCount = entry->MinimumCriteria; AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementForTestId); if (!cList) @@ -1696,7 +1696,7 @@ bool AchievementMgr<T>::IsCompletedAchievement(AchievementEntry const* entry) // For SUMM achievements, we have to count the progress of each criteria of the achievement. // Oddly, the target count is NOT contained in the achievement, but in each individual criteria - if (entry->flags & ACHIEVEMENT_FLAG_SUMM) + if (entry->Flags & ACHIEVEMENT_FLAG_SUMM) { for (AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr) { @@ -1818,7 +1818,7 @@ void AchievementMgr<T>::SetCriteriaProgress(AchievementCriteriaEntry const* entr m_timedAchievements.erase(timedIter); } - if (criteriaComplete && achievement->flags & ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS && !progress->CompletedGUID) + if (criteriaComplete && achievement->Flags & ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS && !progress->CompletedGUID) progress->CompletedGUID = referencePlayer->GetGUID(); SendCriteriaUpdate(entry, progress, timeElapsed, criteriaComplete); @@ -1905,12 +1905,12 @@ void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achiev if (GetOwner()->IsGameMaster()) return; - if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) + if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; - if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) + if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) if (Guild* guild = referencePlayer->GetGuild()) - guild->AddGuildNews(GUILD_NEWS_PLAYER_ACHIEVEMENT, referencePlayer->GetGUID(), achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + guild->AddGuildNews(GUILD_NEWS_PLAYER_ACHIEVEMENT, referencePlayer->GetGUID(), achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); if (!GetOwner()->GetSession()->PlayerLoading()) SendAchievementEarned(achievement); @@ -1924,10 +1924,10 @@ void AchievementMgr<Player>::CompletedAchievement(AchievementEntry const* achiev sAchievementMgr->SetRealmCompleted(achievement, GetOwner()->GetInstanceId()); - _achievementPoints += achievement->points; + _achievementPoints += achievement->Points; UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, NULL, referencePlayer); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, NULL, referencePlayer); // reward items and titles if any AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement); @@ -1991,19 +1991,19 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve { TC_LOG_DEBUG("achievement", "AchievementMgr<Guild>::CompletedAchievement(%u)", achievement->ID); - if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) + if (achievement->Flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; - if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) + if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) if (Guild* guild = referencePlayer->GetGuild()) - guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, ObjectGuid::Empty, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, ObjectGuid::Empty, achievement->Flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); ca.changed = true; - if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS) + if (achievement->Flags & ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS) { if (referencePlayer->GetGuildId() == GetOwner()->GetId()) ca.guids.insert(referencePlayer->GetGUID()); @@ -2017,10 +2017,10 @@ void AchievementMgr<Guild>::CompletedAchievement(AchievementEntry const* achieve sAchievementMgr->SetRealmCompleted(achievement, referencePlayer->GetInstanceId()); - _achievementPoints += achievement->points; + _achievementPoints += achievement->Points; UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, NULL, referencePlayer); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->Points, 0, 0, NULL, referencePlayer); } struct VisibleAchievementPred @@ -2028,7 +2028,7 @@ struct VisibleAchievementPred bool operator()(CompletedAchievementMap::value_type const& val) { AchievementEntry const* achievement = sAchievementMgr->GetAchievement(val.first); - return achievement && !(achievement->flags & ACHIEVEMENT_FLAG_HIDDEN); + return achievement && !(achievement->Flags & ACHIEVEMENT_FLAG_HIDDEN); } }; @@ -2329,15 +2329,15 @@ bool AchievementMgr<T>::CanUpdateCriteria(AchievementCriteriaEntry const* criter return false; } - if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID)) + if (achievement->MapID != -1 && referencePlayer->GetMapId() != uint32(achievement->MapID)) { TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Wrong map", criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); return false; } - if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) || - (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE)) + if ((achievement->Faction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) || + (achievement->Faction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE)) { TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Wrong faction", criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); @@ -3154,7 +3154,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriaListByAchievement[criteria->achievement].push_back(criteria); - if (achievement && achievement->flags & ACHIEVEMENT_FLAG_GUILD) + if (achievement && achievement->Flags & ACHIEVEMENT_FLAG_GUILD) ++guildCriterias, m_GuildAchievementCriteriasByType[criteria->type].push_back(criteria); else ++criterias, m_AchievementCriteriasByType[criteria->type].push_back(criteria); @@ -3181,16 +3181,16 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId) { AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entryId); - if (!achievement || !achievement->refAchievement) + if (!achievement || !achievement->SharesCriteria) continue; - m_AchievementListByReferencedId[achievement->refAchievement].push_back(achievement); + m_AchievementListByReferencedId[achievement->SharesCriteria].push_back(achievement); ++count; } // Once Bitten, Twice Shy (10 player) - Icecrown Citadel if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539)) - const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar) + const_cast<AchievementEntry*>(achievement)->MapID = 631; // Correct map requirement (currently has Ulduar) TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -3285,7 +3285,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() continue; } - else if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) + else if (achievement->Flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) m_allCompletedAchievements[achievementId] = uint32(0xFFFFFFFF); } while (result->NextRow()); @@ -3337,7 +3337,7 @@ void AchievementGlobalMgr::LoadRewards() continue; } - if (achievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && (!reward.titleId[0] ^ !reward.titleId[1])) + if (achievement->Faction == ACHIEVEMENT_FACTION_ANY && (!reward.titleId[0] ^ !reward.titleId[1])) TC_LOG_ERROR("sql.sql", "Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]); if (reward.titleId[0]) diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 636f7398da6..90d52cd9101 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -359,7 +359,7 @@ class AchievementGlobalMgr if (itr == m_allCompletedAchievements.end()) return false; - if (achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL) + if (achievement->Flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL) return itr->second != instanceId; return true; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 6639799a912..e5b9079f019 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -54,9 +54,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) FactionTemplateEntry const* uEntry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!uEntry) return &mNeutralAuctions; - else if (uEntry->ourMask & FACTION_MASK_ALLIANCE) + else if (uEntry->Mask & FACTION_MASK_ALLIANCE) return &mAllianceAuctions; - else if (uEntry->ourMask & FACTION_MASK_HORDE) + else if (uEntry->Mask & FACTION_MASK_HORDE) return &mHordeAuctions; else return &mNeutralAuctions; @@ -69,7 +69,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 if (MSV <= 0) return AH_MINIMUM_DEPOSIT; - float multiplier = CalculatePct(float(entry->depositPercent), 3); + float multiplier = CalculatePct(float(entry->DepositRate), 3); uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(((multiplier * MSV * count / 3) * timeHr * 3) * sWorld->getRate(RATE_AUCTION_DEPOSIT)); @@ -413,9 +413,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!u_entry) houseid = 7; // goblin auction house - else if (u_entry->ourMask & FACTION_MASK_ALLIANCE) + else if (u_entry->Mask & FACTION_MASK_ALLIANCE) houseid = 1; // human auction house - else if (u_entry->ourMask & FACTION_MASK_HORDE) + else if (u_entry->Mask & FACTION_MASK_HORDE) houseid = 6; // orc auction house else houseid = 7; // goblin auction house @@ -599,13 +599,13 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player { const ItemRandomSuffixEntry* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID); if (itemRandSuffix) - suffix = itemRandSuffix->nameSuffix; + suffix = itemRandSuffix->Name_lang; } else { const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID); if (itemRandProp) - suffix = itemRandProp->nameSuffix; + suffix = itemRandProp->Name_lang; } // dbc local name @@ -670,7 +670,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const uint32 AuctionEntry::GetAuctionCut() const { - int32 cut = int32(CalculatePct(bid, auctionHouseEntry->cutPercent) * sWorld->getRate(RATE_AUCTION_CUT)); + int32 cut = int32(CalculatePct(bid, auctionHouseEntry->ConsignmentRate) * sWorld->getRate(RATE_AUCTION_CUT)); return std::max(cut, 0); } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 13da5affe00..9f90856ce88 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -80,8 +80,8 @@ struct AuctionEntry uint32 factionTemplateId; // helpers - uint32 GetHouseId() const { return auctionHouseEntry->houseId; } - uint32 GetHouseFaction() const { return auctionHouseEntry->faction; } + uint32 GetHouseId() const { return auctionHouseEntry->ID; } + uint32 GetHouseFaction() const { return auctionHouseEntry->FactionID; } uint32 GetAuctionCut() const; uint32 GetAuctionOutBid() const; bool BuildAuctionInfo(WorldPacket & data) const; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index be043aa289a..c021b731714 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1898,7 +1898,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) { m_BracketId = bracketEntry->GetBracketId(); - SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel); + SetLevelRange(bracketEntry->MinLevel, bracketEntry->MaxLevel); } void Battleground::RewardXPAtKill(Player* killer, Player* victim) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index e1a3a9b065c..0e9dcfacd62 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -735,8 +735,8 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate) AddBattleground(bg); } - bg->SetMapId(bgTemplate->BattlemasterEntry->mapid[0]); - bg->SetName(bgTemplate->BattlemasterEntry->name); + bg->SetMapId(bgTemplate->BattlemasterEntry->MapID[0]); + bg->SetName(bgTemplate->BattlemasterEntry->Name_lang); bg->SetInstanceID(0); bg->SetArenaorBGType(bgTemplate->IsArena()); bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam); @@ -845,8 +845,8 @@ void BattlegroundMgr::LoadBattlegroundTemplates() _battlegroundTemplates[bgTypeId] = bgTemplate; - if (bgTemplate.BattlemasterEntry->mapid[1] == -1) // in this case we have only one mapId - _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->mapid[0]] = &_battlegroundTemplates[bgTypeId]; + if (bgTemplate.BattlemasterEntry->MapID[1] == -1) // in this case we have only one mapId + _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->MapID[0]] = &_battlegroundTemplates[bgTypeId]; ++count; } @@ -1204,7 +1204,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) uint32 weight = 0; BattlegroundSelectionWeightMap selectionWeights; - for (int32 mapId : bgTemplate->BattlemasterEntry->mapid) + for (int32 mapId : bgTemplate->BattlemasterEntry->MapID) { if (mapId == -1) break; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 9e330373685..c98502945f7 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -51,7 +51,7 @@ struct BattlegroundTemplate uint32 ScriptId; BattlemasterListEntry const* BattlemasterEntry; - bool IsArena() const { return BattlemasterEntry->type == MAP_ARENA; } + bool IsArena() const { return BattlemasterEntry->InstanceType == MAP_ARENA; } }; class BattlegroundMgr diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 095446bf627..65ae7de2d8c 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -201,8 +201,8 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; - uint32 q_min_level = bracketEntry->minLevel; - uint32 q_max_level = bracketEntry->maxLevel; + uint32 q_min_level = bracketEntry->MinLevel; + uint32 q_max_level = bracketEntry->MaxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 1663f4da049..dfecab6a5d4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -510,9 +510,9 @@ bool BattlegroundEY::SetupBattleground() TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]); continue; } - if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) ) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Cannot spawn buff"); } diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 8b4274022c2..73c067ddf99 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -44,13 +44,13 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): _flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels - if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel + if (ch->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel _flags |= CHANNEL_FLAG_TRADE; - if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels + if (ch->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels _flags |= CHANNEL_FLAG_CITY; - if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel + if (ch->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel _flags |= CHANNEL_FLAG_LFG; else // for all other channels _flags |= CHANNEL_FLAG_NOT_LFG; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index afe55563290..fce0fc99b4a 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -1033,7 +1033,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text) if (!glyphPropEntry) return 0; - return glyphPropEntry->SpellId; + return glyphPropEntry->SpellID; } } diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 3f32447a31f..e671713c643 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -183,7 +183,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - char* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); + char* suffixStrings = _suffix ? _suffix->Name_lang : (_property ? _property->Name_lang : NULL); bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer); if (!res) @@ -299,15 +299,15 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); return false; } - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->SkillLine); if (!skillLine) { - TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); + TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->SkillLine); return false; } - uint32 skillLineNameLength = strlen(skillLine->name); - if (skillLineNameLength > 0 && strncmp(skillLine->name, buffer, skillLineNameLength) == 0) + uint32 skillLineNameLength = strlen(skillLine->DisplayName_lang); + if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName_lang, buffer, skillLineNameLength) == 0) { // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") @@ -372,7 +372,7 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - if (*_achievement->name && strcmp(_achievement->name, buffer) == 0) + if (*_achievement->Title_lang && strcmp(_achievement->Title_lang, buffer) == 0) return true; TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); @@ -522,10 +522,10 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) return false; } // Validate glyph's spell - _spell = sSpellMgr->GetSpellInfo(_glyph->SpellId); + _spell = sSpellMgr->GetSpellInfo(_glyph->SpellID); if (!_spell) { - TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellId); + TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellID); return false; } return true; diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index e359727ecb7..738982d035c 100644 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -133,7 +133,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction) while (ref) { HostileReference* nextRef = ref->next(); - if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->faction == faction) + if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->Faction == faction) { ref->removeReference(); delete ref; diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index eb50545b510..a7cf8478704 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -126,7 +126,7 @@ void LoadDisables() continue; } bool isFlagInvalid = false; - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: if (flags) @@ -190,7 +190,7 @@ void LoadDisables() TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: if (flags & VMAP::VMAP_DISABLE_AREAFLAG) @@ -230,7 +230,7 @@ void LoadDisables() TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: TC_LOG_INFO("misc", "Pathfinding disabled for world map %u.", entry); @@ -364,7 +364,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags return (disabledModes & RAID_STATUSFLAG_25MAN_HEROIC) != 0; } } - else if (mapEntry->map_type == MAP_COMMON) + else if (mapEntry->InstanceType == MAP_COMMON) return true; } return false; diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index f1436dd90e3..b56c68f7ac2 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -27,6 +27,12 @@ DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore(ItemCurrencyCostfmt); DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt); DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt); +DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt); +DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt); +DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt); +DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt); +DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt); typedef std::list<std::string> DB2StoreProblemList; @@ -96,11 +102,17 @@ void LoadDB2Stores(std::string const& dataPath) DB2StoreProblemList bad_db2_files; uint32 availableDb2Locales = 0xFF; - LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellRuneCostStore, db2Path, "SpellRuneCost.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 17a92f98cde..0f8ce80bae5 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -27,6 +27,12 @@ extern DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore; extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore; extern DB2Storage<ItemSparseEntry> sItemSparseStore; extern DB2Storage<KeyChainEntry> sKeyChainStore; +extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore; +extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore; +extern DB2Storage<SpellMiscEntry> sSpellMiscStore; +extern DB2Storage<SpellPowerEntry> sSpellPowerStore; +extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore; +extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore; void LoadDB2Stores(std::string const& dataPath); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 0a60d0b860f..02fcbc0898b 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -150,6 +150,94 @@ struct KeyChainEntry uint8 Key[KEYCHAIN_SIZE]; }; +struct SpellAuraRestrictionsEntry +{ + //uint32 ID; // 0 + uint32 CasterAuraState; // 1 + uint32 TargetAuraState; // 2 + uint32 ExcludeCasterAuraState; // 3 + uint32 ExcludeTargetAuraState; // 4 + uint32 CasterAuraSpell; // 5 + uint32 TargetAuraSpell; // 6 + uint32 ExcludeCasterAuraSpell; // 7 + uint32 ExcludeTargetAuraSpell; // 8 +}; + +struct SpellClassOptionsEntry +{ + uint32 ID; // 0 + uint32 ModalNextSpell; // 1 + flag128 SpellClassMask; // 2 + uint32 SpellClassSet; // 3 +}; + +struct SpellMiscEntry +{ + uint32 ID; // 0 + uint32 Attributes; // 1 + uint32 AttributesEx; // 2 + uint32 AttributesExB; // 3 + uint32 AttributesExC; // 4 + uint32 AttributesExD; // 5 + uint32 AttributesExE; // 6 + uint32 AttributesExF; // 7 + uint32 AttributesExG; // 8 + uint32 AttributesExH; // 9 + uint32 AttributesExI; // 10 + uint32 AttributesExJ; // 11 + uint32 AttributesExK; // 12 + uint32 AttributesExL; // 13 + uint32 AttributesExM; // 14 + uint32 CastingTimeIndex; // 15 + uint32 DurationIndex; // 16 + uint32 RangeIndex; // 17 + uint32 Speed; // 18 + uint32 SpellVisualID[2]; // 19-20 + uint32 SpellIconID; // 21 + uint32 ActiveIconID; // 22 + uint32 SchoolMask; // 23 + //float Unk; // 24 +}; + +struct SpellPowerEntry +{ + uint32 ID; // 0 + uint32 SpellID; // 1 + //uint32 Unk2; // 2 + //uint32 Unk3; // 3 + uint32 ManaCost; // 4 + uint32 ManaCostPerLevel; // 5 + uint32 ManaCostPerSecond; // 6 + //uint32 Unk4; // 7 (All 0 except one spell: 22570) + //uint32 Unk5; // 8 + //uint32 Unk6; // 9 + float ManaCostPercentage; // 10 + //float Unk7; // 11 + //uint32 Unk8; // 12 +}; + +#define MAX_SPELL_REAGENTS 8 + +struct SpellReagentsEntry +{ + uint32 ID; // 0 + int32 Reagent[MAX_SPELL_REAGENTS]; // 1-8 + uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 9-16 + //uint32 Unk1; // 17 + //uint32 Unk2; // 18 +}; + +struct SpellRuneCostEntry +{ + uint32 ID; // 0 + uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy) + //uint32 Unk; // 4 (All 0 except for 2 ids: 2510, 2748) + uint32 RunePowerGain; // 5 + + bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } + bool NoRunicPowerGain() const { return RunePowerGain == 0; } +}; + // GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform #if defined(__GNUC__) #pragma pack() diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h index e2904aed51e..e8bcde8985b 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -23,5 +23,11 @@ char const ItemCurrencyCostfmt[]="xn"; char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiifiiifii"; char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii"; char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; +char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; +char const SpellClassOptionsEntryfmt[] = "niiiiii"; +char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiix"; +char const SpellPowerEntryfmt[] = "nixxiiixxxfxx"; +char const SpellReagentsEntryfmt[] = "niiiiiiiiiiiiiiiixx"; +char const SpellRuneCostEntryfmt[] = "niiixi"; #endif diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 69617deee5f..2e54b797934 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -53,7 +53,6 @@ typedef std::map<WMOAreaTableTripple, WMOAreaTableEntry const*> WMOAreaInfoByTri DBCStorage <AreaTableEntry> sAreaStore(AreaTableEntryfmt); DBCStorage <AreaGroupEntry> sAreaGroupStore(AreaGroupEntryfmt); -DBCStorage <AreaPOIEntry> sAreaPOIStore(AreaPOIEntryfmt); static AreaFlagByAreaID sAreaFlagByAreaID; static AreaFlagByMapID sAreaFlagByMapID; // for instances without generated *.map files @@ -142,11 +141,13 @@ DBCStorage <ItemDamageEntry> sItemDamageTwoHandStore(ItemDamagefmt) DBCStorage <ItemDamageEntry> sItemDamageTwoHandCasterStore(ItemDamagefmt); DBCStorage <ItemDamageEntry> sItemDamageWandStore(ItemDamagefmt); DBCStorage <ItemDisenchantLootEntry> sItemDisenchantLootStore(ItemDisenchantLootfmt); -//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); -DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt); -DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt); -DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt); +//DBCStorage <ItemDisplayInfoEntry> sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently +DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); +DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore(ItemRandomPropertiesfmt); +DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt); +DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt); +DBCStorage <ItemSetSpellEntry> sItemSetSpellStore(ItemSetSpellEntryfmt); +ItemSetSpellsStore sItemSetSpellsStore; DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt); DBCStorage <LightEntry> sLightStore(LightEntryfmt); @@ -166,7 +167,6 @@ DBCStorage <MountTypeEntry> sMountTypeStore(MountTypefmt); DBCStorage <NameGenEntry> sNameGenStore(NameGenfmt); NameGenContainer sGenerateNamesMap; -DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore(NumTalentsAtLevelfmt); DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt); @@ -195,29 +195,23 @@ SpellCategoryStore sSpellsByCategoryStore; PetFamilySpellsStore sPetFamilySpellsStore; -DBCStorage <SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt); DBCStorage <SpellScalingEntry> sSpellScalingStore(SpellScalingEntryfmt); DBCStorage <SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt); DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt); -DBCStorage <SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt); DBCStorage <SpellLevelsEntry> sSpellLevelsStore(SpellLevelsEntryfmt); DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore(SpellInterruptsEntryfmt); DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt); -DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt); DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt); DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); -DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt); DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt); DBCStorage <SpellCategoryEntry> sSpellCategoryStore(SpellCategoryfmt); DBCStorage <SpellEffectEntry> sSpellEffectStore(SpellEffectEntryfmt); -DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore(SpellDifficultyfmt); DBCStorage <SpellDurationEntry> sSpellDurationStore(SpellDurationfmt); DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt); DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt); DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt); -DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt); DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftEntryfmt); DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt); DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt); @@ -349,7 +343,6 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sArmorLocationStore, dbcPath, "ArmorLocation.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");//15595 @@ -359,7 +352,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");//15595 for (uint32 i = 0; i < sCharStartOutfitStore.GetNumRows(); ++i) if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i)) - sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit; + sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit; LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//15595 @@ -376,10 +369,10 @@ void LoadDBCStores(const std::string& dataPath) { uint32 index = 0; for (uint32 j = 0; j < MAX_POWERS; ++j) - if (PowersByClass[power->classId][j] != MAX_POWERS) + if (PowersByClass[power->ClassID][j] != MAX_POWERS) ++index; - PowersByClass[power->classId][power->power] = index; + PowersByClass[power->ClassID][power->PowerType] = index; } } @@ -401,9 +394,9 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i) { FactionEntry const* faction = sFactionStore.LookupEntry(i); - if (faction && faction->team) + if (faction && faction->ParentFactionID) { - SimpleFactionsList &flist = sFactionTeamMap[faction->team]; + SimpleFactionsList &flist = sFactionTeamMap[faction->ParentFactionID]; flist.push_back(i); } } @@ -414,12 +407,12 @@ void LoadDBCStores(const std::string& dataPath) { if (GameObjectDisplayInfoEntry const* info = sGameObjectDisplayInfoStore.LookupEntry(i)) { - if (info->maxX < info->minX) - std::swap(*(float*)(&info->maxX), *(float*)(&info->minX)); - if (info->maxY < info->minY) - std::swap(*(float*)(&info->maxY), *(float*)(&info->minY)); - if (info->maxZ < info->minZ) - std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ)); + if (info->GeoBoxMax.X < info->GeoBoxMin.X) + std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X)); + if (info->GeoBoxMax.Y < info->GeoBoxMin.Y) + std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y)); + if (info->GeoBoxMax.Z < info->GeoBoxMin.Z) + std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z)); } } @@ -457,6 +450,10 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetSpellStore, dbcPath, "ItemSetSpell.dbc");//15595 + for (uint32 i = 0; i < sItemSetSpellStore.GetNumRows(); ++i) + if (ItemSetSpellEntry const* entry = sItemSetSpellStore.LookupEntry(i)) + sItemSetSpellsStore[entry->ItemSetID].push_back(entry); LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//15595 @@ -483,7 +480,7 @@ void LoadDBCStores(const std::string& dataPath) sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, false);//map 0 is missingg from MapDifficulty.dbc use this till its ported to sql for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i) if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i)) - sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0); + sMapDifficultyMap[MAKE_PAIR32(entry->MapID, entry->DifficultyID)] = MapDifficulty(entry->RaidDuration, entry->MaxPlayers, entry->Message_lang[0] > 0); sMapDifficultyStore.Clear(); LoadDBC(availableDbcLocales, bad_dbc_files, sMountCapabilityStore, dbcPath, "MountCapability.dbc");//15595 @@ -492,11 +489,9 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc"); // 19116 for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i) if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i)) - sGenerateNamesMap[entry->Race].Contents[entry->Sex].emplace_back(entry->Name); + sGenNameVectoArraysMap[entry->Race].stringVectorArray[entry->Sex].push_back(std::string(entry->Name)); sNameGenStore.Clear(); - LoadDBC(availableDbcLocales, bad_dbc_files, sNumTalentsAtLevelStore, dbcPath, "NumTalentsAtLevel.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//15595 @@ -506,8 +501,8 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i = 0; i < sPhaseGroupStore.GetNumRows(); ++i) if (PhaseGroupEntry const* group = sPhaseGroupStore.LookupEntry(i)) - if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseId)) - sPhasesByGroup[group->GroupId].insert(phase->ID); + if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID)) + sPhasesByGroup[group->PhaseGroupID].insert(phase->ID); LoadDBC(availableDbcLocales, bad_dbc_files, sPowerDisplayStore, dbcPath, "PowerDisplay.dbc"); @@ -515,7 +510,7 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) + if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS) ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc");//15595 @@ -531,8 +526,8 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc"); for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i) if (SkillRaceClassInfoEntry const* entry = sSkillRaceClassInfoStore.LookupEntry(i)) - if (sSkillLineStore.LookupEntry(entry->SkillId)) - SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry); + if (sSkillLineStore.LookupEntry(entry->SkillID)) + SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry); LoadDBC(availableDbcLocales, bad_dbc_files, sSkillTiersStore, dbcPath, "SkillTiers.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//15595 @@ -545,51 +540,46 @@ void LoadDBCStores(const std::string& dataPath) if (!spell) continue; - if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->SpellCategoriesId)) + if (SpellCategoriesEntry const* category = sSpellCategoriesStore.LookupEntry(spell->CategoriesID)) sSpellsByCategoryStore[category->Category].insert(i); } - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore, dbcPath,"SpellPower.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore, dbcPath,"SpellEquippedItems.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc", &CustomSpellEffectEntryfmt, &CustomSpellEffectEntryIndex);//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex);//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshift.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");//15595 //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//15595 // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded + /* TODO: Requires spells attributes from SpellMisc.db2 is loaded after dbc for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j); if (!skillLine) continue; - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID); if (!spellInfo) continue; - SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId); - if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel)) + SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsID); + if (spellInfo->SpellLevelsID && (!levels || levels->spellLevel)) continue; if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) @@ -600,20 +590,22 @@ void LoadDBCStores(const std::string& dataPath) if (!cFamily) continue; - if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) + if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - sPetFamilySpellsStore[i].insert(spellInfo->Id); + sPetFamilySpellsStore[i].insert(spellInfo->ID); } } } + */ LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//15595 // Create Spelldifficulty searcher + /* TODO: 6.x update to new spell diffs for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i) { SpellDifficultyEntry const* spellDiff = sSpellDifficultyStore.LookupEntry(i); @@ -640,7 +632,7 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 x = 0; x < MAX_DIFFICULTY; ++x) if (newEntry.SpellID[x]) sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID); - } + }*/ // create talent spells set for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) @@ -856,7 +848,7 @@ char const* GetPetName(uint32 petfamily, uint32 /*dbclang*/) CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily); if (!pet_family) return NULL; - return pet_family->Name ? pet_family->Name : NULL; + return pet_family->Name_lang ? pet_family->Name_lang : NULL; } TalentSpellPos const* GetTalentSpellPos(uint32 spellId) @@ -908,7 +900,7 @@ AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_ return sAreaStore.LookupEntry(area_flag); if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id)) - return GetAreaEntryByAreaID(mapEntry->linked_zone); + return GetAreaEntryByAreaID(mapEntry->AreaTableID); return NULL; } @@ -916,13 +908,13 @@ AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_ char const* GetRaceName(uint8 race, uint8 /*locale*/) { ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race); - return raceEntry ? raceEntry->name : NULL; + return raceEntry ? raceEntry->Name_lang : NULL; } char const* GetClassName(uint8 class_, uint8 /*locale*/) { ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); - return classEntry ? classEntry->name : NULL; + return classEntry ? classEntry->Name_lang : NULL; } uint32 GetAreaFlagByMapId(uint32 mapid) @@ -982,8 +974,8 @@ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId) return CONTENT_1_60; // no need enum all maps from phasing - if (mapEntry->rootPhaseMap >= 0) - mapid = mapEntry->rootPhaseMap; + if (mapEntry->ParentMapID >= 0) + mapid = mapEntry->ParentMapID; switch (mapid) { @@ -1079,15 +1071,15 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) { // skip unrelated and too-high brackets - if (entry->mapId != mapid || entry->minLevel > level) + if (entry->MapID != mapid || entry->MinLevel > level) continue; // exactly fit - if (entry->maxLevel >= level) + if (entry->MaxLevel >= level) return entry; // remember for possible out-of-range case (search higher from existed) - if (!maxEntry || maxEntry->maxLevel < entry->maxLevel) + if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel) maxEntry = entry; } } @@ -1099,7 +1091,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB { for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->mapId == mapid && entry->GetBracketId() == id) + if (entry->MapID == mapid && entry->GetBracketId() == id) return entry; return NULL; @@ -1201,7 +1193,6 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_FINGER: case INVTYPE_TRINKET: case INVTYPE_WEAPON: - case INVTYPE_SHIELD: case INVTYPE_RANGED: case INVTYPE_2HWEAPON: case INVTYPE_BAG: @@ -1225,7 +1216,9 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_WRISTS: return Armor[7][armorType]; case INVTYPE_CLOAK: - return CloakArmor; + return ArmorBack; + case INVTYPE_SHIELD: + return ArmorShield; default: break; } @@ -1245,7 +1238,7 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_DAGGER: case ITEM_SUBCLASS_WEAPON_THROWN: *damageMultiplier = 0.3f; - return dpsMod[0]; + return DPSMod[0]; case ITEM_SUBCLASS_WEAPON_AXE2: case ITEM_SUBCLASS_WEAPON_MACE2: case ITEM_SUBCLASS_WEAPON_POLEARM: @@ -1253,12 +1246,12 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_STAFF: case ITEM_SUBCLASS_WEAPON_FISHING_POLE: *damageMultiplier = 0.2f; - return dpsMod[1]; + return DPSMod[1]; case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_CROSSBOW: *damageMultiplier = 0.3f; - return dpsMod[4]; + return DPSMod[4]; case ITEM_SUBCLASS_WEAPON_Obsolete: case ITEM_SUBCLASS_WEAPON_EXOTIC: case ITEM_SUBCLASS_WEAPON_EXOTIC2: @@ -1278,17 +1271,17 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i if (mask & 0x562) { *damageMultiplier = 0.2f; - return dpsMod[3]; + return DPSMod[3]; } if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND)) { *damageMultiplier = 0.3f; - return dpsMod[5]; + return DPSMod[5]; } } *damageMultiplier = 0.3f; - return dpsMod[2]; + return DPSMod[2]; } return 0; } @@ -1302,7 +1295,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) if (!dungeon) continue; - if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty) + if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->DifficultyID) == difficulty) return dungeon; } @@ -1317,8 +1310,8 @@ uint32 GetDefaultMapLight(uint32 mapId) if (!light) continue; - if (light->MapId == mapId && light->X == 0.0f && light->Y == 0.0f && light->Z == 0.0f) - return light->Id; + if (light->MapID == mapId && light->Pos.X == 0.0f && light->Pos.Y == 0.0f && light->Pos.Z == 0.0f) + return light->ID; } return 0; diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 994e830431e..53be6a0ebb9 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -95,7 +95,6 @@ extern DBCStorage <AchievementEntry> sAchievementStore; extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore; extern DBCStorage <AreaTableEntry> sAreaStore;// recommend access using functions extern DBCStorage <AreaGroupEntry> sAreaGroupStore; -extern DBCStorage <AreaPOIEntry> sAreaPOIStore; extern DBCStorage <AreaTriggerEntry> sAreaTriggerStore; extern DBCStorage <ArmorLocationEntry> sArmorLocationStore; extern DBCStorage <AuctionHouseEntry> sAuctionHouseStore; @@ -171,6 +170,8 @@ extern DBCStorage <ItemLimitCategoryEntry> sItemLimitCategoryStore; extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomPropertiesStore; extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore; extern DBCStorage <ItemSetEntry> sItemSetStore; +extern DBCStorage <ItemSetSpellEntry> sItemSetSpellStore; +extern ItemSetSpellsStore sItemSetSpellsStore; extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore; extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore; extern DBCStorage <LockEntry> sLockStore; @@ -179,7 +180,6 @@ extern DBCStorage <MapEntry> sMapStore; extern DBCStorage <MountCapabilityEntry> sMountCapabilityStore; extern DBCStorage <MountTypeEntry> sMountTypeStore; extern DBCStorage <NameGenEntry> sNameGenStore; -extern DBCStorage <NumTalentsAtLevelEntry> sNumTalentsAtLevelStore; extern DBCStorage <PhaseEntry> sPhaseStore; extern DBCStorage <PhaseGroupEntry> sPhaseGroupStore; //extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed @@ -199,7 +199,6 @@ extern DBCStorage <SkillTiersEntry> sSkillTiersStore; extern DBCStorage <SoundEntriesEntry> sSoundEntriesStore; extern DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore; extern DBCStorage <SpellCategoryEntry> sSpellCategoryStore; -extern DBCStorage <SpellDifficultyEntry> sSpellDifficultyStore; extern DBCStorage <SpellDurationEntry> sSpellDurationStore; extern DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore; extern DBCStorage <SpellItemEnchantmentEntry> sSpellItemEnchantmentStore; @@ -208,22 +207,17 @@ extern SpellCategoryStore sSpellsByCategoryStore; extern PetFamilySpellsStore sPetFamilySpellsStore; extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore; extern DBCStorage <SpellRangeEntry> sSpellRangeStore; -extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore; extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore; extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore; extern DBCStorage <SpellEntry> sSpellStore; extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore; -extern DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore; extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore; extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore; -extern DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore; extern DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore; extern DBCStorage <SpellEffectEntry> sSpellEffectStore; extern DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore; extern DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore; extern DBCStorage <SpellLevelsEntry> sSpellLevelsStore; -extern DBCStorage <SpellPowerEntry> sSpellPowerStore; -extern DBCStorage <SpellReagentsEntry> sSpellReagentsStore; extern DBCStorage <SpellScalingEntry> sSpellScalingStore; extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore; extern DBCStorage <SpellTotemsEntry> sSpellTotemsStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 8ac2af5d8ab..7896a1be533 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -38,30 +38,44 @@ #pragma pack(push, 1) #endif +struct DBCPosition2D +{ + float X; + float Y; +}; + +struct DBCPosition3D +{ + float X; + float Y; + float Z; +}; + struct AchievementEntry { - uint32 ID; // 0 - int32 requiredFaction; // 1 -1=all, 0=horde, 1=alliance - int32 mapID; // 2 -1=none - //uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) - char* name; // 4 - //char* description; // 5 - uint32 categoryId; // 6 - uint32 points; // 7 reward points - //uint32 OrderInCategory; // 8 - uint32 flags; // 9 - //uint32 icon; // 10 icon (from SpellIcon.dbc) - //char* reward; // 11 - uint32 count; // 12 - need this count of completed criterias (own or referenced achievement criterias) - uint32 refAchievement; // 13 - referenced achievement (counting of all completed criterias) + uint32 ID; // 0 + int32 Faction; // 1 -1=all, 0=horde, 1=alliance + int32 MapID; // 2 -1=none + //uint32 Supercedes; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) + char* Title_lang; // 4 + //char* Description_lang; // 5 + uint32 Category; // 6 + uint32 Points; // 7 reward points + //uint32 UIOrder; // 8 + uint32 Flags; // 9 + //uint32 IconID; // 10 icon (from SpellIcon.dbc) + //char* Reward_lang; // 11 + uint32 MinimumCriteria; // 12 - need this count of completed criterias (own or referenced achievement criterias) + uint32 SharesCriteria; // 13 - referenced achievement (counting of all completed criterias) + //uint32 CriteriaTree; // 14 }; struct AchievementCategoryEntry { - uint32 ID; // 0 - uint32 parentCategory; // 1 -1 for main category - //char* name; // 2 - //uint32 sortOrder; // 3 + uint32 ID; // 0 + uint32 Parent; // 1 -1 for main category + //char* Name_lang; // 2 + //uint32 UIOrder; // 3 }; struct AchievementCriteriaEntry @@ -571,303 +585,304 @@ struct AreaTableEntry struct AreaGroupEntry { - uint32 AreaGroupId; // 0 - uint32 AreaId[MAX_GROUP_AREA_IDS]; // 1-6 - uint32 nextGroup; // 7 index of next group -}; - -struct AreaPOIEntry -{ - uint32 id; //0 - uint32 icon[11]; //1-11 - float x; //12 - float y; //13 - uint32 mapId; //14 - //uint32 val1; //15 - uint32 zoneId; //16 - //char* name; //17 - name - //char* name2; //18 - name2 - uint32 worldState; //19 - //uint32 val2; //20 - //uint32 unk; //21 + uint32 ID; // 0 + uint32 AreaID[MAX_GROUP_AREA_IDS]; // 1-6 + uint32 NextAreaID; // 7 index of next group }; struct AreaTriggerEntry { - uint32 id; // 0 m_ID - uint32 mapid; // 1 m_ContinentID - float x; // 2 m_x - float y; // 3 m_y - float z; // 4 m_z - //uint32 // 5 - //uint32 // 6 - //uint32 // 7 - float radius; // 8 m_radius - float box_x; // 9 m_box_length - float box_y; // 10 m_box_width - float box_z; // 11 m_box_heigh - float box_orientation; // 12 m_box_yaw + uint32 ID; // 0 + uint32 MapID; // 1 + DBCPosition3D Pos; // 2-4 + //uint32 PhaseUseFlags // 5 + //uint32 PhaseID // 6 + //uint32 PhaseGroupID // 7 + float Radius; // 8 + float BoxLength; // 9 + float BoxWidth; // 10 + float BoxHeight; // 11 + float BoxYaw; // 12 + //uint32 ShapeType // 13 + //uint32 ShapeID // 14 + //uint32 AreaTriggerActionSetID // 15 + //uint32 Flags // 16 }; struct ArmorLocationEntry { - uint32 InventoryType; // 0 - float Value[5]; // 1-5 multiplier for armor types (cloth...plate, no armor?) + uint32 ID; // 0 + float Modifier[5]; // 1-5 multiplier for armor types (cloth...plate, no armor?) }; struct AuctionHouseEntry { - uint32 houseId; // 0 index - uint32 faction; // 1 id of faction.dbc for player factions associated with city - uint32 depositPercent; // 2 1/3 from real - uint32 cutPercent; // 3 - //char* name; // 4 + uint32 ID; // 0 + uint32 FactionID; // 1 id of faction.dbc for player factions associated with city + uint32 DepositRate; // 2 1/3 from real + uint32 ConsignmentRate; // 3 + //char* Name_lang; // 4 }; struct BankBagSlotPricesEntry { - uint32 ID; - uint32 price; + uint32 ID; // 0 + uint32 Cost; // 1 }; struct BannedAddOnsEntry { - uint32 Id; - // uint32 NameMD5[4]; - // uint32 VersionMD5[4]; - // uint32 Timestamp; - // uint32 State; + uint32 ID; // 0 + //uint32 NameMD5[4]; // 1 + //uint32 VersionMD5[4]; // 2 + //uint32 LastModified; // 3 + //uint32 Flags; // 4 }; struct BarberShopStyleEntry { - uint32 Id; // 0 - uint32 type; // 1 value 0 -> hair, value 2 -> facialhair - //char* name; // 2 m_DisplayName_lang - //uint32 unk_name; // 3 m_Description_lang - //float CostMultiplier; // 4 m_Cost_Modifier - uint32 race; // 5 m_race - uint32 gender; // 6 m_sex - uint32 hair_id; // 7 m_data (real ID to hair/facial hair) + uint32 ID; // 0 + uint32 Type; // 1 value 0 -> hair, value 2 -> facialhair + //char* DisplayName_lang; // 2 + //char* Description_lang // 3 + //float CostModifier; // 4 + uint32 Race; // 5 + uint32 Sex; // 6 + uint32 Data; // 7 (real ID to hair/facial hair) }; struct BattlemasterListEntry { - uint32 id; // 0 - int32 mapid[8]; // 1-8 mapid - uint32 type; // 9 map type (3 - BG, 4 - arena) - //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name; // 11 - uint32 maxGroupSize; // 12 maxGroupSize, used for checking if queue as group - uint32 HolidayWorldStateId; // 13 new 3.1 - uint32 minLevel; // 14, min level (sync with PvPDifficulty.dbc content) - uint32 maxLevel; // 15, max level (sync with PvPDifficulty.dbc content) - //uint32 maxGroupSizeRated; // 16 4.0.1 - //uint32 unk; // 17 - 4.0.6.13596 - //uint32 maxPlayers; // 18 4.0.1 - //uint32 unk1; // 19 4.0.3, value 2 for Rated Battlegrounds + uint32 ID; // 0 + uint32 MapID[16]; // 1-16 mapid + uint32 InstanceType; // 17 map type (3 - BG, 4 - arena) + //uint32 GroupsAllowed; // 18 (0 or 1) + char* Name_lang; // 19 + uint32 MaxGroupSize; // 20 maxGroupSize, used for checking if queue as group + uint32 HolidayWorldState; // 21 new 3.1 + uint32 MinLevel; // 22, min level (sync with PvPDifficulty.dbc content) + uint32 MaxLevel; // 23, max level (sync with PvPDifficulty.dbc content) + //uint32 RatedPlayers; // 24 4.0.1 + //uint32 MinPlayers; // 25 - 4.0.6.13596 + //uint32 MaxPlayers; // 26 4.0.1 + //uint32 Flags; // 27 4.0.3, value 2 for Rated Battlegrounds + //uint32 IconFileDataID; // 28 + //char* GameType_lang; // 29 + //uint32 Unk1; // 30 }; #define MAX_OUTFIT_ITEMS 24 struct CharStartOutfitEntry { - //uint32 Id; // 0 - uint8 Race; // 1 - uint8 Class; // 2 - uint8 Gender; // 3 - //uint8 Unused; // 4 - int32 ItemId[MAX_OUTFIT_ITEMS]; // 5-28 - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side - uint32 PetDisplayId; // 77 Pet Model ID for starting pet - uint32 PetFamilyEntry; // 78 Pet Family Entry for starting pet + //uint32 ID; // 0 + uint8 RaceID; // 1 + uint8 ClassID; // 2 + uint8 GenderID; // 3 + //uint8 OutfitID; // 4 + int32 ItemID[MAX_OUTFIT_ITEMS]; // 5-28 + //int32 ItemDisplayID[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side + //int32 InventoryType[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side + uint32 PetDisplayID; // 77 Pet Model ID for starting pet + uint32 PetFamilyID; // 78 Pet Family Entry for starting pet }; struct CharTitlesEntry { - uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() - //uint32 unk1; // 1 flags? - char* nameMale; // 2 m_name_lang - char* nameFemale; // 3 m_name1_lang - uint32 bit_index; // 4 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES - //uint32 // 5 + uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() + //uint32 ConditionID; // 1 + char* NameMale_lang; // 2 m_name_lang + char* NameFemale_lang; // 3 m_name1_lang + uint32 MaskID; // 4 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES + //uint32 Flags; // 5 }; struct ChatChannelsEntry { - uint32 ChannelID; // 0 - uint32 flags; // 1 - //uint32 // 2 m_factionGroup - char* pattern; // 3 m_name_lang - //char* name; // 4 m_shortcut_lang + uint32 ID; // 0 + uint32 Flags; // 1 + //uint32 FactionGroup // 2 + char* Name_lang; // 3 + //char* Shortcut_lang; // 4 }; struct ChrClassesEntry { - uint32 ClassID; // 0 - uint32 powerType; // 1 m_DisplayPower - // 2 m_petNameToken - char* name; // 3 m_name_lang - //char* nameFemale; // 4 m_name_female_lang - //char* nameNeutralGender; // 5 m_name_male_lang - //char* capitalizedName // 6, m_filename - uint32 spellfamily; // 7 m_spellClassSet - //uint32 flags2; // 8 m_flags (0x08 HasRelicSlot) - uint32 CinematicSequence; // 9 m_cinematicSequenceID - uint32 expansion; // 10 m_required_expansion - uint32 APPerStrenth; // 11 Attack Power bonus per point of strength - uint32 APPerAgility; // 12 Attack Power bonus per point of agility - uint32 RAPPerAgility; // 13 Ranged Attack Power bonus per point of agility + uint32 ID; // 0 + uint32 PowerType; // 1 + //char* PetNameToken // 2 + char* Name_lang; // 3 + //char* NameFemale_lang; // 4 + //char* NameMale_lang; // 5 + //char* Filename; // 6 + uint32 SpellClassSet; // 7 + //uint32 Flags; // 8 + uint32 CinematicSequenceID; // 9 + uint32 AttackPowerPerStrength; // 10 Attack Power bonus per point of strength + uint32 AttackPowerPerAgility; // 11 Attack Power bonus per point of agility + uint32 RangedAttackPowerPerAgility; // 12 Ranged Attack Power bonus per point of agility + //uint32 DefaultSpec; // 13 + //uint32 CreateScreenFileDataID; // 14 + //uint32 SelectScreenFileDataID; // 15 + //uint32 LowResScreenFileDataID; // 16 + //uint32 IconFileDataID; // 17 + //uint32 Unk1; // 18 }; struct ChrRacesEntry { - uint32 RaceID; // 0 + uint32 ID; // 0 uint32 Flags; // 1 - uint32 FactionID; // 2 facton template id - // 3 unused - uint32 model_m; // 4 - uint32 model_f; // 5 - // 6 unused - uint32 TeamID; // 7 (7-Alliance 1-Horde) - // 8-11 unused - uint32 CinematicSequence; // 12 id from CinematicSequences.dbc - //uint32 unk_322; // 13 m_alliance (0 alliance, 1 horde, 2 not available?) - char* name; // 14 m_name_lang used for DBC language detection/selection - //char* nameFemale; // 15 m_name_female_lang - //char* nameNeutralGender; // 16 m_name_male_lang - // 17-18 m_facialHairCustomization[2] - // 19 m_hairCustomization - uint32 expansion; // 20 m_required_expansion - //uint32 // 21 (23 for worgens) - //uint32 // 22 4.0.0 - //uint32 // 23 4.0.0 + uint32 FactionID; // 2 faction template id + //uint32 ExplorationSoundID; // 3 + uint32 MaleDisplayID; // 4 + uint32 FemaleDisplayID; // 5 + //char* ClientPrefix; // 6 + //uint32 BaseLanguage; // 7 + //uint32 CreatureType; // 8 + //uint32 ResSicknessSpellID; // 9 + //uint32 SplashSoundID; // 10 + //char* ClientFileString; // 11 + uint32 CinematicSequenceID; // 12 + uint32 TeamID; // 13 m_alliance (0 alliance, 1 horde, 2 neutral) + char* Name_lang; // 14 + //char* NameFemale_lang; // 15 + //char* NameMale_lang; // 16 + //char* FacialHairCustomization[2]; // 17-18 + //char* HairCustomization; // 19 + //uint32 RaceRelated; // 20 + //uint32 UnalteredVisualRaceID; // 21 + //uint32 UAMaleCreatureSoundDataID; // 22 + //uint32 UAFemaleCreatureSoundDataID; // 23 + //uint32 CharComponentTextureLayoutID; // 24 + //uint32 DefaultClassID; // 25 + //uint32 CreateScreenFileDataID; // 26 + //uint32 SelectScreenFileDataID; // 27 + //float MaleCustomizeOffset[3]; // 28-30 + //float FemaleCustomizeOffset[3]; // 31-33 + //uint32 NeutralRaceID; // 34 + //uint32 LowResScreenFileDataID; // 35 + //uint32 HighResMaleDisplayID; // 36 + //uint32 HighResFemaleDisplayID; // 37 + //uint32 CharComponentTexLayoutHiResID; // 38 + //uint32 Unk; // 39 }; struct ChrPowerTypesEntry { - uint32 entry; // 0 - uint32 classId; // 1 - uint32 power; // 2 -}; - -/* not used -struct CinematicCameraEntry -{ - uint32 id; // 0 index - char* filename; // 1 - uint32 soundid; // 2 in SoundEntries.dbc or 0 - float start_x; // 3 - float start_y; // 4 - float start_z; // 5 - float unk6; // 6 speed? + uint32 ID; // 0 + uint32 ClassID; // 1 + uint32 PowerType; // 2 }; -*/ struct CinematicSequencesEntry { - uint32 Id; // 0 index - //uint32 unk1; // 1 always 0 - //uint32 cinematicCamera; // 2 id in CinematicCamera.dbc - // 3-9 always 0 + uint32 ID; // 0 + //uint32 SoundID; // 1 + //uint32 Camera[8]; // 2-9 }; struct CreatureDisplayInfoEntry { - uint32 Displayid; // 0 m_ID - uint32 ModelId; // 1 m_modelID - // 2 m_soundID - uint32 ExtraId; // 3 m_extendedDisplayInfoID - float scale; // 4 m_creatureModelScale - // 5 m_creatureModelAlpha - // 6-8 m_textureVariation[3] - // 9 m_portraitTextureName - // 10 m_sizeClass - // 11 m_bloodID - // 12 m_NPCSoundID - // 13 m_particleColorID - // 14 m_creatureGeosetData - // 15 m_objectEffectPackageID - // 16 + uint32 ID; // 0 + uint32 ModelID; // 1 + //uint32 SoundID; // 2 + uint32 ExtendedDisplayInfoID; // 3 + float CreatureModelScale; // 4 + //uint32 CreatureModelAlpha; // 5 + //char* TextureVariation[3]; // 6-8 + //char* PortraitTextureName; // 9 + //uint32 PortraitCreatureDisplayInfoID; // 10 + //uint32 SizeClass; // 11 + //uint32 BloodID; // 12 + //uint32 NPCSoundID; // 13 + //uint32 ParticleColorID; // 14 + //uint32 CreatureGeosetData; // 15 + //uint32 ObjectEffectPackageID; // 16 + //uint32 AnimReplacementSetID; // 17 + //uint32 Flags; // 18 + //uint32 Gender; // 19 + //uint32 StateSpellVisualKitID; // 20 }; struct CreatureDisplayInfoExtraEntry { - //uint32 Id; // 0 - uint32 Race; // 1 - uint32 Gender; // 2 - //uint32 SkinColor; // 3 - //uint32 FaceType; // 4 - //uint32 HairType; // 5 - //uint32 HairStyle; // 6 - //uint32 FacialHair; // 7 - //uint32 HelmDisplayId; // 8 - //uint32 ShoulderDisplayId; // 9 - //uint32 ShirtDisplayId; // 10 - //uint32 ChestDisplayId; // 11 - //uint32 BeltDisplayId; // 12 - //uint32 LegsDisplayId; // 13 - //uint32 BootsDisplayId; // 14 - //uint32 WristDisplayId; // 15 - //uint32 GlovesDisplayId; // 16 - //uint32 TabardDisplayId; // 17 - //uint32 CloakDisplayId; // 18 - //uint32 CanEquip; // 19 - //char const* Texture; // 20 + //uint32 ID; // 0 + uint32 DisplayRaceID; // 1 + //uint32 DisplaySexID; // 2 + //uint32 SkinID; // 3 + //uint32 FaceID; // 4 + //uint32 HairStyleID; // 5 + //uint32 HairColorID; // 6 + //uint32 FacialHairID; // 7 + //uint32 NPCItemDisplay[11]; // 8-18 + //uint32 Flags; // 19 + //char* FileName; // 20 }; struct CreatureFamilyEntry { - uint32 ID; // 0 m_ID - float minScale; // 1 m_minScale - uint32 minScaleLevel; // 2 m_minScaleLevel - float maxScale; // 3 m_maxScale - uint32 maxScaleLevel; // 4 m_maxScaleLevel - uint32 skillLine[2]; // 5-6 m_skillLine - uint32 petFoodMask; // 7 m_petFoodMask - int32 petTalentType; // 8 m_petTalentType - // 9 m_categoryEnumID - char* Name; // 10 m_name_lang - // 11 m_iconFile + uint32 ID; // 0 + float MinScale; // 1 + uint32 MinScaleLevel; // 2 + float MaxScale; // 3 + uint32 MaxScaleLevel; // 4 + uint32 SkillLine[2]; // 5-6 + uint32 PetFoodMask; // 7 + uint32 PetTalentType; // 8 + //uint32 CategoryEnumID; // 9 + char* Name_lang; // 10 + //char* IconFile; // 11 }; struct CreatureModelDataEntry { - uint32 Id; - uint32 Flags; - //char* ModelPath - //uint32 Unk1; - //float Scale; // Used in calculation of unit collision data - //int32 Unk2 - //int32 Unk3 - //uint32 Unk4 - //uint32 Unk5 - //float Unk6 - //uint32 Unk7 - //float Unk8 - //uint32 Unk9 - //uint32 Unk10 - //float CollisionWidth; - float CollisionHeight; - float MountHeight; // Used in calculation of unit collision data when mounted - //float Unks[11] + uint32 ID; // 0 + uint32 Flags; // 1 + //uint32 FileDataID; // 2 + //uint32 SizeClass; // 3 + //float ModelScale; // 4 + //uint32 BloodID; // 5 + //uint32 FootprintTextureID; // 6 + //float FootprintTextureLength; // 7 + //float FootprintTextureWidth; // 8 + //float FootprintParticleScale; // 9 + //uint32 FoleyMaterialID; // 10 + //uint32 FootstepShakeSize; // 11 + //uint32 DeathThudShakeSize; // 12 + //uint32 SoundID; // 13 + //float CollisionWidth; // 14 + float CollisionHeight; // 15 + float MountHeight; // 16 + //float GeoBoxMin[3]; // 17-19 + //float GeoBoxMax[3]; // 20-22 + //float WorldEffectScale; // 23 + //float AttachedEffectScale; // 24 + //float MissileCollisionRadius; // 25 + //float MissileCollisionPush; // 26 + //float MissileCollisionRaise; // 27 + //float OverrideLootEffectScale; // 28 + //float OverrideNameScale; // 29 + //float OverrideSelectionRadius; // 30 + //float TamedPetBaseScale; // 31 + //uint32 CreatureGeosetDataID; // 32 + //float HoverHeight; // 33 }; #define MAX_CREATURE_SPELL_DATA_SLOT 4 struct CreatureSpellDataEntry { - uint32 ID; // 0 m_ID - uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4] - //uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 m_availability[4] + uint32 ID; // 0 + uint32 Spells[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 + //uint32 Availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 }; struct CreatureTypeEntry { - uint32 ID; // 0 m_ID - //char* Name; // 1 m_name_lang - //uint32 no_expirience; // 2 m_flags no exp? critters, non-combat pets, gas cloud. + uint32 ID; // 0 + //char* Name_lang; // 1 + //uint32 Flags; // 2 no exp? critters, non-combat pets, gas cloud. }; /* not used @@ -882,110 +897,127 @@ struct CurrencyCategoryEntry struct CurrencyTypesEntry { - uint32 ID; // 0 not used - uint32 Category; // 1 may be category - //char* name; // 2 - //char* iconName; // 3 - //uint32 unk4; // 4 all 0 - uint32 HasSubstitution; // 5 archaeology-related (?) - uint32 SubstitutionId; // 6 - uint32 TotalCap; // 7 - uint32 WeekCap; // 8 - uint32 Flags; // 9 - //char* description; // 10 + uint32 ID; // 0 + uint32 CategoryID; // 1 + //char* Name_lang; // 2 + //char* InventoryIcon[2]; // 3-4 + //uint32 SpellWeight; // 5 archaeology-related (?) + //uint32 SpellCategory; // 6 + uint32 MaxQty; // 7 + uint32 MaxEarnablePerWeek; // 8 + uint32 Flags; // 9 + //uint32 Quality; // 10 + //char* Description_lang; // 11 }; struct DestructibleModelDataEntry { - uint32 Id; - uint32 DamagedDisplayId; - //uint32 DamagedUnk1; - //uint32 DamagedUnk2; - //uint32 DamagedUnk3; - uint32 DestroyedDisplayId; - //uint32 DestroyedUnk1; - //uint32 DestroyedUnk2; - //uint32 DestroyedUnk3; - //uint32 DestroyedUnk4; - uint32 RebuildingDisplayId; - //uint32 RebuildingUnk1; - //uint32 RebuildingUnk2; - //uint32 RebuildingUnk3; - //uint32 RebuildingUnk4; - uint32 SmokeDisplayId; - //uint32 SmokeUnk1; - //uint32 SmokeUnk2; - //uint32 SmokeUnk3; - //uint32 SmokeUnk4; - //uint32 UnkDisplayid; - //uint32 Unk6; - //uint32 Unk7; - //uint32 Unk8; + uint32 ID; // 0 + struct + { + uint32 DisplayID; // 1 + //uint32 ImpactEffectDoodadSet; // 2 + //uint32 AmbientDoodadSet; // 3 + //uint32 NameSet; // 4 + } StateDamaged; + struct + { + uint32 DisplayID; // 5 + //uint32 DestructionDoodadSet; // 6 + //uint32 ImpactEffectDoodadSet; // 7 + //uint32 AmbientDoodadSet; // 8 + //uint32 NameSet; // 9 + } StateDestroyed; + struct + { + uint32 DisplayID; // 10 + //uint32 DestructionDoodadSet; // 11 + //uint32 ImpactEffectDoodadSet; // 12 + //uint32 AmbientDoodadSet; // 13 + //uint32 NameSet; // 14 + } StateRebuilding; + struct + { + uint32 DisplayID; // 15 + //uint32 InitDoodadSet; // 16 + //uint32 AmbientDoodadSet; // 17 + //uint32 NameSet; // 18 + } StateSmoke; + //uint32 EjectDirection; // 19 + //uint32 RepairGroundFx; // 20 + //uint32 DoNotHighlight; // 21 + //uint32 HealEffect; // 22 + //uint32 HealEffectSpeed; // 23 }; struct DungeonEncounterEntry { - uint32 id; // 0 unique id - uint32 mapId; // 1 map id - int32 difficulty; // 2 instance mode - //uint32 unk0; // 3 - uint32 encounterIndex; // 4 encounter index for creating completed mask - char* encounterName; // 5 encounter name - //uint32 nameFlags; // 21 - //uint32 unk1; // 22 + uint32 ID; // 0 + uint32 MapID; // 1 + uint32 DifficultyID; // 2 + uint32 OrderIndex; // 3 + //uint32 Bit; // 4 + char* Name_lang; // 5 + //uint32 CreatureDisplayID; // 6 + //uint32 Flags; // 7 }; struct DurabilityCostsEntry { - uint32 Itemlvl; // 0 - uint32 multiplier[29]; // 1-29 + uint32 ID; // 0 + uint32 WeaponSubClassCost[21]; // 1-22 + uint32 ArmorSubClassCost[8]; // 23-30 }; struct DurabilityQualityEntry { - uint32 Id; // 0 - float quality_mod; // 1 + uint32 ID; // 0 + float QualityMod; // 1 }; struct EmotesEntry { - uint32 Id; // 0 - //char* Name; // 1, internal name - //uint32 AnimationId; // 2, ref to animationData - uint32 Flags; // 3, bitmask, may be unit_flags - uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown) - uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType - //uint32 SoundId; // 6, ref to soundEntries - //uint32 unk7 // 7 + uint32 ID; // 0 + //char* EmoteSlashCommand; // 1 + //uint32 AnimID; // 2 ref to animationData + uint32 EmoteFlags; // 3 bitmask, may be unit_flags + uint32 EmoteSpecProc; // 4 Can be 0, 1 or 2 (determine how emote are shown) + uint32 EmoteSpecProcParam; // 5 uncomfirmed, may be enum UnitStandStateType + //uint32 EmoteSoundID; // 6 ref to soundEntries + //uint32 SpellVisualKitID // 7 }; struct EmotesTextEntry { - uint32 Id; - uint32 textid; + uint32 ID; // 0 + //char* Name_lang; // 1 + uint32 EmoteID; // 2 + //uint32 EmoteText[16]; // 3-18 }; struct FactionEntry { - uint32 ID; // 0 m_ID - int32 reputationListID; // 1 m_reputationIndex - uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask - uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask - int32 BaseRepValue[4]; // 10-13 m_reputationBase - uint32 ReputationFlags[4]; // 14-17 m_reputationFlags - uint32 team; // 18 m_parentFactionID - float spilloverRateIn; // 19 Faction gains incoming rep * spilloverRateIn - float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation - uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover - //uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea - char* name; // 23 m_name_lang - //char* description; // 24 m_description_lang - uint32 GroupExpansion; // 25 m_factionGroupExpansion + uint32 ID; // 0 + int32 ReputationIndex; // 1 + uint32 ReputationRaceMask[4]; // 2-5 + uint32 ReputationClassMask[4]; // 6-9 + int32 ReputationBase[4]; // 10-13 + uint32 ReputationFlags[4]; // 14-17 + uint32 ParentFactionID; // 18 + float ParentFactionModIn; // 19 Faction gains incoming rep * ParentFactionModIn + float ParentFactionModOut; // 20 Faction outputs rep * ParentFactionModOut as spillover reputation + uint32 ParentFactionCapIn; // 21 The highest rank the faction will profit from incoming spillover + //uint32 ParentFactionCapOut; // 22 + char* Name_lang; // 23 + //char* Description_lang; // 24 + uint32 Expansion; // 25 + //uint32 Flags; // 26 + //uint32 FriendshipRepID; // 27 // helpers bool CanHaveReputation() const { - return reputationListID >= 0; + return ReputationIndex >= 0; } }; @@ -993,14 +1025,14 @@ struct FactionEntry struct FactionTemplateEntry { - uint32 ID; // 0 m_ID - uint32 faction; // 1 m_faction - uint32 factionFlags; // 2 m_flags - uint32 ourMask; // 3 m_factionGroup - uint32 friendlyMask; // 4 m_friendGroup - uint32 hostileMask; // 5 m_enemyGroup - uint32 enemyFaction[MAX_FACTION_RELATIONS]; // 6 m_enemies[MAX_FACTION_RELATIONS] - uint32 friendFaction[MAX_FACTION_RELATIONS]; // 10 m_friend[MAX_FACTION_RELATIONS] + uint32 ID; // 0 + uint32 Faction; // 1 + uint32 Flags; // 2 + uint32 Mask; // 3 m_factionGroup + uint32 FriendMask; // 4 m_friendGroup + uint32 EnemyMask; // 5 m_enemyGroup + uint32 Enemies[MAX_FACTION_RELATIONS]; // 6 + uint32 Friends[MAX_FACTION_RELATIONS]; // 10 //------------------------------------------------------- end structure // helpers @@ -1008,80 +1040,79 @@ struct FactionTemplateEntry { if (ID == entry.ID) return true; - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return false; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friends[i] == entry.Faction) return true; } - return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask); + return (FriendMask & entry.Mask) || (Mask & entry.FriendMask); } bool IsHostileTo(FactionTemplateEntry const& entry) const { if (ID == entry.ID) return false; - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return true; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friends[i] == entry.Faction) return false; } - return (hostileMask & entry.ourMask) != 0; + return (EnemyMask & entry.Mask) != 0; } - bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; } + bool IsHostileToPlayers() const { return (EnemyMask & FACTION_MASK_PLAYER) !=0; } bool IsNeutralToAll() const { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] != 0) + if (Enemies[i] != 0) return false; - return hostileMask == 0 && friendlyMask == 0; + return EnemyMask == 0 && FriendMask == 0; } - bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } + bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } }; struct GameObjectDisplayInfoEntry { - uint32 Displayid; // 0 m_ID - char* filename; // 1 - //uint32 unk1[10]; //2-11 - float minX; - float minY; - float minZ; - float maxX; - float maxY; - float maxZ; - //uint32 transport; //18 + uint32 ID; // 0 + uint32 FileDataID; // 1 + //uint32 Sound[10]; // 2-11 + DBCPosition3D GeoBoxMin; // 12-14 + DBCPosition3D GeoBoxMax; // 15-17 + //uint32 ObjectEffectPackageID; // 18 + //float OverrideLootEffectScale; // 19 + //float OverrideNameScale; // 20 }; struct GemPropertiesEntry { - uint32 ID; // 0 m_id - uint32 spellitemenchantement; // 1 m_enchant_id - // 2 m_maxcount_inv - // 3 m_maxcount_item - uint32 color; // 4 m_type - uint32 minJewelCraftingSkill; // 5 m_minJewelCraftingSkill + uint32 ID; // 0 + uint32 EnchantID; // 1 + //uint32 MaxCountInv; // 2 + //uint32 MaxCountItem; // 3 + uint32 Type; // 4 + uint32 MinItemLevel; // 5 }; struct GlyphPropertiesEntry { - uint32 Id; - uint32 SpellId; - uint32 TypeFlags; - uint32 IconId; // GlyphIconId (SpellIcon.dbc) + uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 Type; // 2 + uint32 SpellIconID; // 3 GlyphIconId (SpellIcon.dbc) + //uint32 GlyphExclusiveCategoryID; // 4 }; struct GlyphSlotEntry { - uint32 Id; - uint32 TypeFlags; - uint32 Order; + uint32 ID; // 0 + uint32 Type; // 1 + //uint32 Tooltip; // 2 }; // All Gt* DBC store data for 100 levels, some by 100 per class/race @@ -1175,9 +1206,9 @@ struct GtOCTBaseMPByClassEntry struct GuildPerkSpellsEntry { - //uint32 Id; - uint32 Level; - uint32 SpellId; + //uint32 ID; // 0 + uint32 GuildLevel; // 1 + uint32 SpellID; // 2 }; /* no used @@ -1202,49 +1233,49 @@ struct HolidayNamesEntry struct HolidaysEntry { - uint32 Id; // 0 m_ID - uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 m_duration - uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) - uint32 Region; // 37 m_region (wow region) - uint32 Looping; // 38 m_looping - uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 m_calendarFlags - //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) - //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) - char* TextureFilename; // 51 m_textureFilename - uint32 Priority; // 52 m_priority - uint32 CalendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) - //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) + uint32 ID; // 0 m_ID + uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 m_duration + uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) + uint32 Region; // 37 m_region (wow region) + uint32 Looping; // 38 m_looping + uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 m_calendarFlags + //uint32 HolidayNameID; // 49 m_holidayNameID (HolidayNames.dbc) + //uint32 HolidayDescriptionID; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) + char* TextureFilename; // 51 m_textureFilename + uint32 Priority; // 52 m_priority + uint32 CalendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) + //uint32 Flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; // ImportPriceArmor.dbc struct ImportPriceArmorEntry { - uint32 InventoryType; // 1 Id/InventoryType - float ClothFactor; // 2 Price factor cloth - float LeatherFactor; // 3 Price factor leather - float MailFactor; // 4 Price factor mail - float PlateFactor; // 5 Price factor plate + uint32 ID; // 1 Id/InventoryType + float ClothFactor; // 2 Price factor cloth + float LeatherFactor; // 3 Price factor leather + float MailFactor; // 4 Price factor mail + float PlateFactor; // 5 Price factor plate }; // ImportPriceQuality.dbc struct ImportPriceQualityEntry { - uint32 QualityId; // 1 Quality Id (+1?) - float Factor; // 2 Price factor + uint32 ID; // 1 Quality Id (+1?) + float Factor; // 2 Price factor }; // ImportPriceShield.dbc struct ImportPriceShieldEntry { - uint32 Id; // 1 Unk id (only 1 and 2) - float Factor; // 2 Price factor + uint32 ID; // 1 Unk id (only 1 and 2) + float Factor; // 2 Price factor }; // ImportPriceWeapon.dbc struct ImportPriceWeaponEntry { - uint32 Id; // 1 Unk id (mainhand - 0, offhand - 1, weapon - 2, 2hweapon - 3, ranged/rangedright/relic - 4) - float Factor; // 2 Price factor + uint32 ID; // 1 Unk id (mainhand - 0, offhand - 1, weapon - 2, 2hweapon - 3, ranged/rangedright/relic - 4) + float Factor; // 2 Price factor }; // ItemPriceBase.dbc @@ -1255,6 +1286,7 @@ struct ItemPriceBaseEntry float WeaponFactor; // 4 Price factor for weapons }; +// 6.x - removeme struct ItemReforgeEntry { uint32 Id; @@ -1275,263 +1307,270 @@ struct ItemReforgeEntry // ItemDamageWand.dbc struct ItemDamageEntry { - uint32 Id; // 0 item level - float DPS[7]; // 1-7 multiplier for item quality - uint32 Id2; // 8 item level + uint32 ID; // 0 item level + float DPS[7]; // 1-7 multiplier for item quality + uint32 ItemLevel; // 8 item level }; struct ItemArmorQualityEntry { - uint32 Id; // 0 item level - float Value[7]; // 1-7 multiplier for item quality - uint32 Id2; // 8 item level + uint32 ID; // 0 item level + float QualityMod[7]; // 1-7 multiplier for item quality + uint32 ItemLevel; // 8 item level }; struct ItemArmorShieldEntry { - uint32 Id; // 0 item level - uint32 Id2; // 1 item level - float Value[7]; // 2-8 multiplier for item quality + uint32 ID; // 0 item level + uint32 ItemLevel; // 1 item level + float Quality[7]; // 2-8 quality }; struct ItemArmorTotalEntry { - uint32 Id; // 0 item level - uint32 Id2; // 1 item level - float Value[4]; // 2-5 multiplier for armor types (cloth...plate) + uint32 ID; // 0 item level + uint32 ItemLevel; // 1 item level + float Value[4]; // 2-5 multiplier for armor types (cloth...plate) }; // ItemClass.dbc struct ItemClassEntry { - uint32 Class; // 1 item class id - //uint32 Unk; // 2 unk - //uint32 IsWeapon; // 3 1 for weapon, 0 for everything else - float PriceFactor; // 4 used to calculate certain prices - //char* Name; // class name + uint32 ID; // 0 item class id + //uint32 Flags; // 1 Weapon - 1, others - 0 + float PriceMod; // 2 used to calculate certain prices + //char* Name_lang; // 3 class name }; struct ItemBagFamilyEntry { - uint32 ID; // 0 - //char* name; // 1 m_name_lang + uint32 ID; // 0 + //char* Name_lang; // 1 m_name_lang }; struct ItemDisplayInfoEntry { - uint32 ID; // 0 m_ID - // 1 m_modelName[2] - // 2 m_modelTexture[2] - // 3 m_inventoryIcon - // 4 m_geosetGroup[3] - // 5 m_flags - // 6 m_spellVisualID - // 7 m_groupSoundIndex - // 8 m_helmetGeosetVis[2] - // 9 m_texture[2] - // 10 m_itemVisual[8] - // 11 m_particleColorID + uint32 ID; // 0 + //char* ModelName[2]; // 1-2 + //char* ModelTexture[2]; // 3-4 + //uint32 GeoSetGroup[3]; // 5-7 + //uint32 Flags; // 8 + //uint32 SpellVisualID; // 9 + //uint32 HelmetGeosetVis[2]; // 10-11 + //char* Texture[9]; // 12-20 + //uint32 ItemVisual; // 21 + //uint32 ParticleColorID; // 22 }; struct ItemDisenchantLootEntry { - uint32 Id; - uint32 ItemClass; - int32 ItemSubClass; - uint32 ItemQuality; - uint32 MinItemLevel; - uint32 MaxItemLevel; - uint32 RequiredDisenchantSkill; + uint32 ID; // 0 + uint32 ItemClass; // 1 + int32 ItemSubClass; // 2 + uint32 ItemQuality; // 3 + uint32 MinItemLevel; // 4 + uint32 MaxItemLevel; // 5 + uint32 RequiredDisenchantSkill; // 6 }; struct ItemLimitCategoryEntry { uint32 ID; // 0 Id - //char* name; // 1 m_name_lang - uint32 maxCount; // 2, m_quantity max allowed equipped as item or in gem slot - uint32 mode; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) + //char* Name_lang; // 1 m_name_lang + uint32 Quantity; // 2, m_quantity max allowed equipped as item or in gem slot + uint32 Flags; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) }; -#define MAX_ITEM_ENCHANTMENT_EFFECTS 3 +#define MAX_ITEM_ENCHANTMENT_EFFECTS 5 struct ItemRandomPropertiesEntry { - uint32 ID; // 0 m_ID - //char* internalName // 1 m_Name - uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_Enchantment - // 5-6 unused - char* nameSuffix; // 7 m_name_lang + uint32 ID; // 0 + //char* Name; // 1 + uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-6 + char* Name_lang; // 7 }; struct ItemRandomSuffixEntry { - uint32 ID; // 0 m_ID - char* nameSuffix; // 1 m_name_lang - // 2 m_internalName - uint32 enchant_id[5]; // 3-7 m_enchantment - uint32 prefix[5]; // 8-12 m_allocationPct + uint32 ID; // 0 + char* Name_lang; // 1 + //char* InternalName; // 2 + uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 3-7 + uint32 AllocationPct[MAX_ITEM_ENCHANTMENT_EFFECTS];// 8-12 }; -#define MAX_ITEM_SET_ITEMS 10 +#define MAX_ITEM_SET_ITEMS 17 #define MAX_ITEM_SET_SPELLS 8 struct ItemSetEntry { - //uint32 id // 0 m_ID - char* name; // 1 m_name_lang - uint32 itemId[MAX_ITEM_SET_ITEMS]; // 2-18 m_itemID - uint32 spells[MAX_ITEM_SET_SPELLS]; // 19-26 m_setSpellID - uint32 items_to_triggerspell[MAX_ITEM_SET_SPELLS]; // 27-34 m_setThreshold - uint32 required_skill_id; // 35 m_requiredSkill - uint32 required_skill_value; // 36 m_requiredSkillRank + uint32 ID; // 0 + char* Name_lang; // 1 + uint32 ItemID[MAX_ITEM_SET_ITEMS]; // 2-18 + uint32 RequiredSkill; // 19 + uint32 RequiredSkillRank; // 20 +}; + +struct ItemSetSpellEntry +{ + uint32 ID; // 0 + uint32 ItemSetID; // 1 + uint32 SpellID; // 2 + uint32 Threshold; // 3 + uint32 ChrSpecID; // 4 }; +typedef std::vector<ItemSetSpellEntry const*> ItemSetSpells; +typedef std::unordered_map<uint32, ItemSetSpells> ItemSetSpellsStore; + struct LFGDungeonEntry { - uint32 ID; // 0 - char* name; // 1 - uint32 minlevel; // 2 - uint32 maxlevel; // 3 - uint32 reclevel; // 4 - uint32 recminlevel; // 5 - uint32 recmaxlevel; // 6 - int32 map; // 7 - uint32 difficulty; // 8 - uint32 flags; // 9 - uint32 type; // 10 - //uint32 unk2; // 11 - //char* iconname; // 12 - uint32 expansion; // 13 - //uint32 unk4; // 14 - uint32 grouptype; // 15 - //char* desc; // 16 Description - uint32 randomCategoryId; // 17 RandomDungeonID assigned for this dungeon + uint32 ID; // 0 + char* Name_lang; // 1 + uint32 MinLevel; // 2 + uint32 MaxLevel; // 3 + uint32 TargetLevel; // 4 + //uint32 TargetLevelMin; // 5 + //uint32 TargetLevelMax; // 6 + int32 MapID; // 7 + uint32 DifficultyID; // 8 + uint32 Flags; // 9 + uint32 Type; // 10 + //uint32 Faction; // 11 + //char* TextureFilename; // 12 + uint32 Expansion; // 13 + //uint32 OrderIndex; // 14 + uint32 GroupID; // 15 + //char* Description_lang; // 16 + //uint32 RandomID; // 17 + //uint32 CountTank; // 18 + //uint32 CountHealer; // 19 + //uint32 CountDamage; // 20 + //uint32 ScenarioID; // 21 + //uint32 SubType; // 22 + //uint32 BonusReputationAmount; // 23 + //uint32 MentorCharLevel; // 24 + //uint32 MentorItemLevel; // 25 + // Helpers - uint32 Entry() const { return ID + (type << 24); } + uint32 Entry() const { return ID + (Type << 24); } }; struct LightEntry { - uint32 Id; - uint32 MapId; - float X; - float Y; - float Z; - //float FalloffStart; - //float FalloffEnd; - //uint32 SkyAndFog; - //uint32 WaterSettings; - //uint32 SunsetParams; - //uint32 OtherParams; - //uint32 DeathParams; - //uint32 Unknown; - //uint32 Unknown; - //uint32 Unknown; + uint32 ID; // 0 + uint32 MapID; // 1 + DBCPosition3D Pos; // 2-4 + //float FalloffStart; // 5 + //float FalloffEnd; // 6 + //uint32 LightParamsID[8]; // 7-14 }; struct LiquidTypeEntry { - uint32 Id; - //char* Name; - //uint32 Flags; - uint32 Type; - //uint32 SoundId; - uint32 SpellId; - //float MaxDarkenDepth; - //float FogDarkenIntensity; - //float AmbDarkenIntensity; - //float DirDarkenIntensity; - //uint32 LightID; - //float ParticleScale; - //uint32 ParticleMovement; - //uint32 ParticleTexSlots; - //uint32 LiquidMaterialID; - //char* Texture[6]; - //uint32 Color[2]; - //float Unk1[18]; - //uint32 Unk2[4]; + uint32 ID; // 0 + //char* Name; // 1 + //uint32 Flags; // 2 + uint32 Type; // 3 m_soundBank + //uint32 SoundID; // 4 + uint32 SpellID; // 5 + //float MaxDarkenDepth; // 6 + //float FogDarkenIntensity; // 7 + //float AmbDarkenIntensity; // 8 + //float DirDarkenIntensity; // 9 + //uint32 LightID; // 10 + //float ParticleScale; // 11 + //uint32 ParticleMovement; // 12 + //uint32 ParticleTexSlots; // 13 + //uint32 MaterialID; // 14 + //char* Texture[6]; // 15-20 + //uint32 Color[2]; // 21-23 + //float Unk1[18]; // 24-41 + //uint32 Unk2[4]; // 42-45 }; #define MAX_LOCK_CASE 8 struct LockEntry { - uint32 ID; // 0 m_ID - uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type - uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index - uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill - //uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action + uint32 ID; // 0 + uint32 Type[MAX_LOCK_CASE]; // 1-8 + uint32 Index[MAX_LOCK_CASE]; // 9-16 + uint32 Skill[MAX_LOCK_CASE]; // 17-24 + //uint32 Action[MAX_LOCK_CASE]; // 25-32 }; struct PhaseEntry { - uint32 ID; // 0 - char* Name; // 1 - uint32 flag; // 2 + uint32 ID; // 0 + char* Name; // 1 + uint32 Flaga; // 2 }; struct PhaseGroupEntry { - uint32 ID; - uint32 PhaseId; - uint32 GroupId; + uint32 ID; + uint32 PhaseID; + uint32 PhaseGroupID; }; struct MailTemplateEntry { uint32 ID; // 0 - //char* subject; // 1 m_subject_lang - char* content; // 2 m_body_lang + //char* Subject_lang; // 1 + char* Body_lang; // 2 }; struct MapEntry { - uint32 MapID; // 0 - //char* internalname; // 1 unused - uint32 map_type; // 2 - uint32 Flags; // 3 - //uint32 unk4; // 4 4.0.1 - //uint32 isPvP; // 5 m_PVP 0 or 1 for battlegrounds (not arenas) - char* name; // 6 m_MapName_lang - uint32 linked_zone; // 7 m_areaTableID - //char* hordeIntro; // 8 m_MapDescription0_lang - //char* allianceIntro; // 9 m_MapDescription1_lang - uint32 multimap_id; // 10 m_LoadingScreenID (LoadingScreens.dbc) - //float BattlefieldMapIconScale; // 11 m_minimapIconScale - int32 entrance_map; // 12 m_corpseMapID map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) - float entrance_x; // 13 m_corpseX entrance x coordinate in ghost mode (in most cases = normal entrance) - float entrance_y; // 14 m_corpseY entrance y coordinate in ghost mode (in most cases = normal entrance) - //uint32 timeOfDayOverride; // 15 m_timeOfDayOverride - uint32 addon; // 16 m_expansionID - uint32 expireTime; // 17 m_raidOffset - uint32 maxPlayers; // 18 m_maxPlayers - int32 rootPhaseMap; // 19 new 4.0.0, mapid, related to phasing + uint32 ID; // 0 + //char* Directory; // 1 + uint32 InstanceType; // 2 + uint32 Flags; // 3 + //uint32 MapType; // 4 + //uint32 unk5; // 5 + char* MapName_lang; // 6 + uint32 AreaTableID; // 7 + //char* MapDescription0_lang; // 8 Horde + //char* MapDescription1_lang; // 9 Alliance + uint32 LoadingScreenID; // 10 LoadingScreens.dbc + //float MinimapIconScale; // 11 + int32 CorpseMapID; // 12 map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) + DBCPosition2D CorpsePos; // 13 entrance coordinates in ghost mode (in most cases = normal entrance) + //uint32 TimeOfDayOverride; // 15 + uint32 ExpansionID; // 16 + uint32 RaidOffset; // 17 + uint32 MaxPlayers; // 18 + int32 ParentMapID; // 19 related to phasing + //uint32 CosmeticParentMapID // 20 + //uint32 TimeOffset // 21 // Helpers - uint32 Expansion() const { return addon; } + uint32 Expansion() const { return ExpansionID; } - bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; } - bool IsNonRaidDungeon() const { return map_type == MAP_INSTANCE; } - bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } - bool IsRaid() const { return map_type == MAP_RAID; } - bool IsBattleground() const { return map_type == MAP_BATTLEGROUND; } - bool IsBattleArena() const { return map_type == MAP_ARENA; } - bool IsBattlegroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } - bool IsWorldMap() const { return map_type == MAP_COMMON; } + bool IsDungeon() const { return InstanceType == MAP_INSTANCE || InstanceType == MAP_RAID; } + bool IsNonRaidDungeon() const { return InstanceType == MAP_INSTANCE; } + bool Instanceable() const { return InstanceType == MAP_INSTANCE || InstanceType == MAP_RAID || InstanceType == MAP_BATTLEGROUND || InstanceType == MAP_ARENA; } + bool IsRaid() const { return InstanceType == MAP_RAID; } + bool IsBattleground() const { return InstanceType == MAP_BATTLEGROUND; } + bool IsBattleArena() const { return InstanceType == MAP_ARENA; } + bool IsBattlegroundOrArena() const { return InstanceType == MAP_BATTLEGROUND || InstanceType == MAP_ARENA; } + bool IsWorldMap() const { return InstanceType == MAP_COMMON; } bool GetEntrancePos(int32 &mapid, float &x, float &y) const { - if (entrance_map < 0) + if (CorpseMapID < 0) return false; - mapid = entrance_map; - x = entrance_x; - y = entrance_y; + mapid = CorpseMapID; + x = CorpsePos.X; + y = CorpsePos.Y; return true; } bool IsContinent() const { - return MapID == 0 || MapID == 1 || MapID == 530 || MapID == 571; + return ID == 0 || ID == 1 || ID == 530 || ID == 571 || ID == 870 || ID == 1116; } bool IsDynamicDifficultyMap() const { return (Flags & MAP_FLAG_DYNAMIC_DIFFICULTY) != 0; } @@ -1539,135 +1578,130 @@ struct MapEntry struct MapDifficultyEntry { - //uint32 Id; // 0 - uint32 MapId; // 1 - uint32 Difficulty; // 2 (for arenas: arena slot) - char* areaTriggerText; // 3 m_message_lang (text showed when transfer to map failed) - uint32 resetTime; // 4, m_raidDuration in secs, 0 if no fixed reset time - uint32 maxPlayers; // 5, m_maxPlayers some heroic versions have 0 when expected same amount as in normal version - //char* difficultyString; // 6 m_difficultystring + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 DifficultyID; // 2 (for arenas: arena slot) + char* Message_lang; // 3 m_message_lang (text showed when transfer to map failed) + uint32 RaidDuration; // 4 m_raidDuration in secs, 0 if no fixed reset time + uint32 MaxPlayers; // 5 m_maxPlayers some heroic versions have 0 when expected same amount as in normal version + //char* LockID; // 6 }; struct MountCapabilityEntry { - uint32 Id; - uint32 Flags; - uint32 RequiredRidingSkill; - uint32 RequiredArea; - uint32 RequiredAura; - uint32 RequiredSpell; - uint32 SpeedModSpell; - int32 RequiredMap; + uint32 ID; // 0 + uint32 Flags; // 1 + uint32 RequiredRidingSkill; // 2 + uint32 RequiredArea; // 3 + uint32 RequiredAura; // 4 + uint32 RequiredSpell; // 5 + uint32 SpeedModSpell; // 6 + int32 RequiredMap; // 7 }; #define MAX_MOUNT_CAPABILITIES 24 struct MountTypeEntry { - uint32 Id; - uint32 MountCapability[MAX_MOUNT_CAPABILITIES]; + uint32 ID; // 0 + uint32 MountCapability[MAX_MOUNT_CAPABILITIES]; // 1-24 }; struct MovieEntry { - uint32 Id; // 0 index - //char* filename; // 1 - //uint32 unk1; // 2 m_volume - //uint32 unk2; // 3 4.0.0 + uint32 ID; // 0 index + //uint32 Volume; // 1 + //uint32 KeyID; // 2 + //uint32 AudioFileDataID; // 3 + //uint32 SubtitleFileDataID; // 4 }; struct NameGenEntry { - //uint32 Id; - char* Name; - uint32 Race; - uint32 Sex; -}; - -struct NumTalentsAtLevelEntry -{ - //uint32 Level; // 0 index - float Talents; // 1 talent count + //uint32 ID; // 0 + char* Name; // 1 + uint32 Race; // 2 + uint32 Sex; // 3 }; #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry { - uint32 id; // 0 - uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 - //uint32 unk0; // 11 - //char* SpellBarName; // 12 + uint32 ID; // 0 + uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10 + //uint32 Flags; // 11 + //char* PlayerActionbarFileDataID; // 12 }; struct PowerDisplayEntry { - uint32 Id; // 0 - uint32 PowerType; // 1 - //char* Name; // 2 - //uint32 R; // 3 - //uint32 G; // 4 - //uint32 B; // 5 + uint32 ID; // 0 + uint32 PowerType; // 1 + //char* GlobalStringBaseTag; // 2 + //uint8 Red; // 3 + //uint8 Green; // 3 + //uint8 Blue; // 3 + //uint8 _padding0; // 3 }; struct PvPDifficultyEntry { - //uint32 id; // 0 m_ID - uint32 mapId; // 1 - uint32 bracketId; // 2 - uint32 minLevel; // 3 - uint32 maxLevel; // 4 - uint32 difficulty; // 5 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 BracketID; // 2 m_rangeIndex + uint32 MinLevel; // 3 + uint32 MaxLevel; // 4 // helpers - BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(bracketId); } + BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(BracketID); } }; struct QuestSortEntry { - uint32 id; // 0 m_ID - //char* name; // 1 m_SortName_lang + uint32 ID; // 0 + //char* SortName_lang; // 1 }; struct QuestXPEntry { - uint32 id; - uint32 Exp[10]; + uint32 ID; // 0 + uint32 Exp[10]; // 1 }; struct QuestFactionRewEntry { - uint32 id; - int32 QuestRewFactionValue[10]; + uint32 ID; // 0 + int32 QuestRewFactionValue[10]; // 1-10 }; struct RandomPropertiesPointsEntry { - //uint32 Id; // 0 hidden key - uint32 itemLevel; // 1 - uint32 EpicPropertiesPoints[5]; // 2-6 - uint32 RarePropertiesPoints[5]; // 7-11 - uint32 UncommonPropertiesPoints[5]; // 12-16 + uint32 ItemLevel; // 0 + uint32 EpicPropertiesPoints[5]; // 1-5 + uint32 RarePropertiesPoints[5]; // 6-10 + uint32 UncommonPropertiesPoints[5]; // 11-15 }; struct ScalingStatDistributionEntry { - uint32 Id; // 0 - int32 StatMod[10]; // 1-10 - uint32 Modifier[10]; // 11-20 - //uint32 unk1; // 21 - uint32 MaxLevel; // 22 m_maxlevel + uint32 ID; // 0 + int32 StatID[10]; // 1-10 + uint32 Modifier[10]; // 11-20 + //uint32 MinLevel; // 21 + uint32 MaxLevel; // 22 m_maxlevel }; struct ScalingStatValuesEntry { - uint32 Id; // 0 - uint32 Level; // 1 - uint32 dpsMod[6]; // 2-7 DPS mod for level - uint32 Spellpower; // 8 spell power for level - uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution - uint32 Armor[8][4]; // 14-46 Armor for level - uint32 CloakArmor; // 47 armor for cloak + uint32 ID; // 0 + uint32 CharLevel; // 1 + uint32 DPSMod[6]; // 2-7 DPS mod for level + uint32 SpellPower; // 8 spell power for level + uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution + uint32 Armor[8][4]; // 14-46 Armor for level + uint32 ArmorBack; // 47 + uint32 ArmorShield; // 48 uint32 GetStatMultiplier(uint32 inventoryType) const; uint32 GetArmor(uint32 inventoryType, uint32 armorType) const; @@ -1683,143 +1717,135 @@ struct ScalingStatValuesEntry struct SkillLineEntry { - uint32 id; // 0 m_ID - int32 categoryId; // 1 m_categoryID - //uint32 skillCostID; // 2 m_skillCostsID - char* name; // 3 m_displayName_lang - //char* description; // 4 m_description_lang - uint32 spellIcon; // 5 m_spellIconID - //char* alternateVerb; // 6 m_alternateVerb_lang - uint32 canLink; // 7 m_canLink (prof. with recipes) + uint32 ID; // 0 m_ID + int32 CategoryID; // 1 m_categoryID + char* DisplayName_lang; // 2 m_displayName_lang + //char* Description_lang; // 3 m_description_lang + uint32 SpellIconID; // 4 m_spellIconID + //char* AlternateVerb_lang; // 5 m_alternateVerb_lang + uint32 CanLink; // 6 m_canLink (prof. with recipes) + //uint32 ParentSkillLineID; // 7 + //uint32 Flags; // 8 }; struct SkillLineAbilityEntry { - uint32 id; // 0 m_ID - uint32 skillId; // 1 m_skillLine - uint32 spellId; // 2 m_spell - uint32 racemask; // 3 m_raceMask - uint32 classmask; // 4 m_classMask - //uint32 racemaskNot; // 5 m_excludeRace - //uint32 classmaskNot; // 6 m_excludeClass - uint32 req_skill_value; // 7 m_minSkillLineRank - uint32 forward_spellid; // 8 m_supercededBySpell - uint32 AutolearnType; // 9 m_acquireMethod - uint32 max_value; // 10 m_trivialSkillLineRankHigh - uint32 min_value; // 11 m_trivialSkillLineRankLow - uint32 character_points[2]; // 12-13 m_characterPoints + uint32 ID; // 0 + uint32 SkillLine; // 1 + uint32 SpellID; // 2 + uint32 RaceMask; // 3 + uint32 ClassMask; // 4 + uint32 MinSkillLineRank; // 7 + uint32 SupercedesSpell; // 8 + uint32 AquireMethod; // 9 + uint32 TrivialSkillLineRankHigh; // 10 + uint32 TrivialSkillLineRankLow; // 11 + uint32 NumSkillUps; // 12 + uint32 UniqueBit; // 13 + uint32 TradeSkillCategoryID; // 14 }; struct SkillRaceClassInfoEntry { - //uint32 Id; // 0 m_ID - uint32 SkillId; // 1 m_skillID - uint32 RaceMask; // 2 m_raceMask - uint32 ClassMask; // 3 m_classMask - uint32 Flags; // 4 m_flags - //uint32 Unk; // 5 m_unk - //uint32 MinLevel; // 6 m_minLevel - uint32 SkillTier; // 7 m_skillTierID - //uint32 SkillCostType; // 8 m_skillCostIndex + //uint32 ID; // 0 + uint32 SkillID; // 1 + uint32 RaceMask; // 2 + uint32 ClassMask; // 3 + uint32 Flags; // 4 + //uint32 Availability; // 5 + //uint32 MinLevel; // 6 + uint32 SkillTierID; // 7 }; #define MAX_SKILL_STEP 16 struct SkillTiersEntry { - uint32 Id; // 0 m_ID - //uint32 StepCost[MAX_SKILL_STEP]; // 1-16 m_cost - uint32 MaxSkill[MAX_SKILL_STEP]; // 17-32 m_valueMax + uint32 ID; // 0 + uint32 Value[MAX_SKILL_STEP]; // 1-16 }; struct SoundEntriesEntry { - uint32 Id; // 0 m_ID - //uint32 Type; // 1 m_soundType - //char* InternalName; // 2 m_name - //char* FileName[10]; // 3-12 m_File[10] - //uint32 Unk13[10]; // 13-22 m_Freq[10] - //char* 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 + uint32 ID; // 0 + //uint32 SoundType; // 1 + //char* Name; // 2 + //uint32 FileDataID[20]; // 3-22 + //uint32 Freq[20]; // 23-42 + //float VolumeFloat; // 43 + //uint32 Flags; // 44 + //float MinDistance; // 45 + //float DistanceCutoff; // 46 + //uint32 EAXDef; // 47 + //uint32 SoundEntriesAdvancedID; // 48 + //float VolumeVariationPlus; // 49 + //float VolumeVariationMinus; // 50 + //float PitchVariationPlus; // 51 + //float PitchVariationMinus; // 52 + //float PitchAdjust; // 53 + //uint32 DialogType; // 54 + //uint32 BusOverwriteID; // 55 }; // SpellEffect.dbc struct SpellEffectEntry { - uint32 Id; // 0 m_ID - uint32 Effect; // 1 m_effect - float EffectValueMultiplier; // 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 - flag96 EffectSpellClassMask; // 18 19 20 m_effectSpellClassMask1(2/3), effect 0 - uint32 EffectTriggerSpell; // 21 m_effectTriggerSpell - uint32 EffectImplicitTargetA; // 22 m_implicitTargetA - uint32 EffectImplicitTargetB; // 23 m_implicitTargetB - uint32 EffectSpellId; // 24 new 4.0.0 - uint32 EffectIndex; // 25 new 4.0.0 - //uint32 Unk0 // 26 4.2.0 only 0 or 1 + uint32 ID; // 0 + uint32 DifficultyID; // 1 + uint32 Effect; // 2 + float EffectAmplitude; // 3 + uint32 EffectAura; // 4 + uint32 EffectAuraPeriod; // 5 + uint32 EffectBasePoints; // 6 + float EffectBonusCoefficient; // 7 + float EffectChainAmplitude; // 8 + uint32 EffectChainTargets; // 9 + uint32 EffectDieSides; // 10 + uint32 EffectItemType; // 11 + uint32 EffectMechanic; // 12 + int32 EffectMiscValue; // 13 + int32 EffectMiscValueB; // 14 + float EffectPointsPerResource; // 15 + uint32 EffectRadiusIndex; // 16 + uint32 EffectRadiusMaxIndex; // 17 + float EffectRealPointsPerLevel; // 18 + flag128 EffectSpellClassMask; // 19-22 + uint32 EffectTriggerSpell; // 23 + float EffectPosFacing; // 24 + uint32 ImplicitTarget[2]; // 25-26 + uint32 SpellID; // 27 + uint32 EffectIndex; // 28 + uint32 EffectAttributes; // 29 + float BonusCoefficientFromAP; // 30 }; #define MAX_SPELL_EFFECTS 3 #define MAX_EFFECT_MASK 7 -#define MAX_SPELL_REAGENTS 8 // 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 -}; - -// 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 + uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 CumulativeAura; // 3 + uint32 ProcChance; // 4 + uint32 ProcCharges; // 5 + uint32 ProcTypeMask; // 6 + uint32 ProcCategoryRecovery; // 7 + uint32 SpellProcsPerMinuteID; // 8 }; // 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 + //uint32 ID; // 0 + uint32 FacingCasterFlags; // 1 + //uint32 MinFactionID; // 1 + //uint32 MinReputation; // 3 + uint32 RequiredAreasID; // 4 + //uint32 RequiredAuraVision; // 5 + uint32 RequiresSpellFocus; // 6 }; #define MAX_SPELL_TOTEMS 2 @@ -1827,73 +1853,53 @@ struct SpellCastingRequirementsEntry // SpellTotems.dbc struct SpellTotemsEntry { - uint32 Id; // 0 m_ID - uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID - uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem + uint32 ID; // 0 m_ID + uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID + uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem }; // Spell.dbc 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 - 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 - char* SpellName; // 21 m_name_lang - char* Rank; // 22 m_nameSubtext_lang - //char* Description; // 23 m_description_lang not used - //char* 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 SpellCoef; // 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 + uint32 ID; // 0 + char* Name_lang; // 1 + //char* NameSubtext_lang; // 2 + //char* Description_lang; // 3 + //char* AuraDescription_lang; // 4 + uint32 RuneCostID; // 5 + uint32 SpellMissileID; // 6 + uint32 DescriptionVariablesID; // 7 + uint32 ScalingID; // 8 + uint32 AuraOptionsID; // 9 + uint32 AuraRestrictionsID; // 10 + uint32 CastingRequirementsID; // 11 + uint32 CategoriesID; // 12 + uint32 ClassOptionsID; // 13 + uint32 CooldownsID; // 14 + uint32 EquippedItemsID; // 15 + uint32 InterruptsID; // 16 + uint32 LevelsID; // 17 + uint32 ReagentsID; // 18 + uint32 ShapeshiftID; // 19 + uint32 TargetRestrictionsID; // 20 + uint32 TotemsID; // 21 + uint32 RequiredProjectID; // 22 + uint32 MiscID; // 23 }; // SpellCategories.dbc struct SpellCategoriesEntry { - //uint32 Id; // 0 m_ID - uint32 Category; // 1 m_category - uint32 DmgClass; // 153 m_defenseType - uint32 Dispel; // 2 m_dispelType - uint32 Mechanic; // 3 m_mechanic - uint32 PreventionType; // 154 m_preventionType - uint32 StartRecoveryCategory; // 145 m_startRecoveryCategory + //uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 Category; // 3 + uint32 DefenseType; // 4 + uint32 DispelType; // 5 + uint32 Mechanic; // 6 + uint32 PreventionType; // 7 + uint32 StartRecoveryCategory; // 8 + //uint32 ChargeCategory; // 9 }; typedef std::set<uint32> SpellCategorySet; @@ -1903,222 +1909,196 @@ typedef std::map<uint32, PetFamilySpellsSet > PetFamilySpellsStore; struct SpellCastTimesEntry { - uint32 ID; // 0 - int32 CastTime; // 1 + uint32 ID; // 0 + int32 CastTime; // 1 //float CastTimePerLevel; // 2 unsure / per skill? //int32 MinCastTime; // 3 unsure }; struct SpellCategoryEntry { - uint32 Id; - uint32 Flags; - // uint32 unk; - // char* Name; -}; - -struct SpellDifficultyEntry -{ - uint32 ID; // 0 - int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2 + uint32 ID; // 0 + uint32 Flags; // 1 + //uint8 UsesPerWeek; // 2 + //uint8 Padding[3]; // 2 + //char* Name_lang; // 3 + //uint32 MaxCharges; // 4 + //uint32 ChargeRecoveryTime; // 5 }; struct SpellFocusObjectEntry { - uint32 ID; // 0 - //char* Name; // 1 m_name_lang + uint32 ID; // 0 + //char* Name_lang; // 1 }; struct SpellRadiusEntry { - uint32 ID; - float RadiusMin; - float RadiusPerLevel; - float RadiusMax; + uint32 ID; // 0 + //float Radius; // 1 + float RadiusMin; // 2 + float RadiusPerLevel; // 3 + float RadiusMax; // 4 }; struct SpellRangeEntry { - uint32 ID; - float minRangeHostile; - float minRangeFriend; - float maxRangeHostile; - float maxRangeFriend; //friend means unattackable unit here - uint32 type; - //char* Name; // 6-21 m_displayName_lang - //char* ShortName; // 23-38 m_displayNameShort_lang + uint32 ID; // 0 + float MinRangeHostile; // 1 + float MinRangeFriend; // 2 + float MaxRangeHostile; // 3 + float MaxRangeFriend; // 4 friend means unattackable unit here + uint32 Flags; // 5 + //char* DisplayName_lang; // 6 + //char* DisplayNameShort_lang; // 7 }; // SpellEquippedItems.dbc struct SpellEquippedItemsEntry { - //uint32 Id; // 0 m_ID - int32 EquippedItemClass; // 70 m_equippedItemClass (value) - int32 EquippedItemInventoryTypeMask; // 72 m_equippedItemInvTypes (mask) - int32 EquippedItemSubClassMask; // 71 m_equippedItemSubclass (mask) + //uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + int32 EquippedItemClass; // 3 m_equippedItemClass (value) + int32 EquippedItemInventoryTypeMask; // 4 m_equippedItemInvTypes (mask) + int32 EquippedItemSubClassMask; // 5 m_equippedItemSubclass (mask) }; // SpellCooldowns.dbc struct SpellCooldownsEntry { - //uint32 Id; // 0 m_ID - uint32 CategoryRecoveryTime; // 31 m_categoryRecoveryTime - uint32 RecoveryTime; // 30 m_recoveryTime - uint32 StartRecoveryTime; // 146 m_startRecoveryTime -}; - -// SpellClassOptions.dbc -struct SpellClassOptionsEntry -{ - //uint32 Id; // 0 m_ID - //uint32 modalNextSpell; // 1 m_modalNextSpell not used - flag96 SpellFamilyFlags; // 2-4 - uint32 SpellFamilyName; // 5 m_spellClassSet - //char* Description; // 6 4.0.0 + //uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 CategoryRecoveryTime; // 3 + uint32 RecoveryTime; // 4 + uint32 StartRecoveryTime; // 5 }; // SpellInterrupts.dbc struct SpellInterruptsEntry { - //uint32 Id; // 0 m_ID - uint32 AuraInterruptFlags; // 1 m_auraInterruptFlags - //uint32 // 2 4.0.0 - uint32 ChannelInterruptFlags; // 3 m_channelInterruptFlags - //uint32 // 4 4.0.0 - uint32 InterruptFlags; // 5 m_interruptFlags + //uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 AuraInterruptFlags[2]; // 3-4 + uint32 ChannelInterruptFlags[2]; // 5-6 + uint32 InterruptFlags; // 7 }; // SpellLevels.dbc struct SpellLevelsEntry { - //uint32 Id; // 0 m_ID - uint32 baseLevel; // 1 m_baseLevel - uint32 maxLevel; // 2 m_maxLevel - uint32 spellLevel; // 3 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 -}; - -struct SpellRuneCostEntry -{ - uint32 ID; // 0 - uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy) - uint32 runePowerGain; // 4 - - bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } - bool NoRunicPowerGain() const { return runePowerGain == 0; } + //uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + uint32 BaseLevel; // 3 + uint32 MaxLevel; // 4 + uint32 SpellLevel; // 5 }; #define MAX_SHAPESHIFT_SPELLS 8 struct SpellShapeshiftFormEntry { - uint32 ID; // 0 - //uint32 buttonPosition; // 1 unused - //char* Name; // 2 unused - uint32 flags1; // 3 - int32 creatureType; // 4 <=0 humanoid, other normal creature types - //uint32 spellIcon; // 5 unused, related to next field - uint32 attackSpeed; // 6 - // Models changed, 0 is main model, the rest 3 are unused. - uint32 modelID_A; // 7 alliance modelid (0 means no model) - uint32 modelID_H; // 8 horde modelid (but only for one form) - //uint32 unk3; // 9 unused always 0 - //uint32 unk4; // 10 unused always 0 - uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting - //uint32 unk5; // 19 - //uint32 unk6; // 20 + uint32 ID; // 0 + //uint32 BonusActionBar; // 1 + //char* Name_lang; // 2 + uint32 Flags; // 3 + int32 CreatureType; // 4 <=0 humanoid, other normal creature types + //uint32 AttackIconID; // 5 unused, related to next field + uint32 CombatRoundTime; // 6 + uint32 CreatureDisplayID[4]; // 7-10 (0 - Alliance, 1 - Horde) + uint32 PresetSpellID[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting + //uint32 MountTypeID; // 19 + //uint32 ExitSoundEntriesID; // 20 }; // SpellShapeshift.dbc struct SpellShapeshiftEntry { - uint32 Id; // 0 - m_ID - uint32 StancesNot; // 3 - m_shapeshiftExclude - // uint32 unk_320_2; // 2 - 3.2.0 - uint32 Stances; // 1 - m_shapeshiftMask - // uint32 unk_320_3; // 4 - 3.2.0 - // uint32 StanceBarOrder; // 5 - m_stanceBarOrder not used + uint32 ID; // 0 + uint32 ShapeshiftExclude[2]; // 1-2 + uint32 ShapeshiftMask[2]; // 3-4 + //uint32 StanceBarOrder; // 5 }; // SpellTargetRestrictions.dbc struct SpellTargetRestrictionsEntry { - uint32 Id; // 0 m_ID - uint32 MaxAffectedTargets; // 1 m_maxTargets - uint32 MaxTargetLevel; // 2 m_maxTargetLevel - uint32 TargetCreatureType; // 3 m_targetCreatureType - uint32 Targets; // 4 m_targets -}; - -// 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 + uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 DifficultyID; // 2 + float ConeAngle; // 3 + float Width; // 4 + uint32 MaxAffectedTargets; // 5 + uint32 MaxTargetLevel; // 6 + uint32 TargetCreatureType; // 7 + uint32 Targets; // 8 }; // SpellScaling.dbc struct SpellScalingEntry { - //uint32 Id; // 0 m_ID - int32 CastTimeMin; // 1 - int32 CastTimeMax; // 2 - int32 CastTimeMaxLevel; // 3 - int32 ScalingClass; // 4 (index * 100) + charLevel - 1 => gtSpellScaling.dbc - float Multiplier[3]; // 5-7 - float RandomMultiplier[3]; // 8-10 - float OtherMultiplier[3]; // 11-13 - float CoefBase; // 14 some coefficient, mostly 1.0f - int32 CoefLevelBase; // 15 some level + uint32 ID; // 0 + int32 CastTimeMin; // 1 + int32 CastTimeMax; // 2 + uint32 CastTimeMaxLevel; // 3 + int32 ScalingClass; // 4 + float NerfFactor; // 5 + uint32 NerfMaxLevel; // 6 + uint32 MaxScalingLevel; // 7 + uint32 ScalesFromItemLevel; // 8 }; struct SpellDurationEntry { - uint32 ID; - int32 Duration[3]; + uint32 ID; + int32 Duration[3]; }; struct SpellItemEnchantmentEntry { - uint32 ID; // 0 m_ID - //uint32 charges; // 1 m_charges - uint32 type[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_effect[MAX_ITEM_ENCHANTMENT_EFFECTS] - uint32 amount[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 m_effectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS] - //uint32 amount2[MAX_ITEM_ENCHANTMENT_EFFECTS] // 8-10 m_effectPointsMax[MAX_ITEM_ENCHANTMENT_EFFECTS] - uint32 spellid[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 11-13 m_effectArg[MAX_ITEM_ENCHANTMENT_EFFECTS] - char* 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 new in 3.1 - // 22 new in 3.1 + uint32 ID; // 0 + uint32 Charges; // 1 + uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 + uint32 EffectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 + uint32 EffectSpellID[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 8-10 + //char* Name_lang // 11 + uint32 ItemVisual; // 12 + uint32 Flags; // 13 + uint32 SRCItemID; // 14 + uint32 ConditionID; // 15 + uint32 RequiredSkillID; // 16 + uint32 RequiredSkillRank; // 17 + uint32 MinLevel; // 18 + uint32 MaxLevel; // 19 + uint32 ItemLevel; // 20 + int32 ScalingClass; // 21 + int32 ScalingClassRestricted; // 22 + float EffectScalingPoints[MAX_ITEM_ENCHANTMENT_EFFECTS];//23 }; struct SpellItemEnchantmentConditionEntry { - uint32 ID; // 0 m_ID + uint32 ID; // 0 + uint8 LTOperandType[5]; // 1-2 + //uint8 Padding[3]; // 1-2 + uint32 LTOperand[5]; // 2-6 + uint8 Operator[5]; // 7-8 + uint8 RTOperandType[5]; // 8-9 + //uint8 Padding[2]; // 9 + uint32 RTOperand[5]; // 10-14 + uint8 Logic[5]; // 15-16 + //uint8 Padding[3]; // 16 + + /*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] + //uint8 Logic[5] // 25-30 m_logic[5]*/ }; struct StableSlotPricesEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index db6fd04d369..af091f80a55 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -22,46 +22,45 @@ // x - skip<uint32>, X - skip<uint8>, s - char*, f - float, i - uint32, b - uint8, d - index (not included) // n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc -char const Achievementfmt[] = "niixsxiixixxii"; +char const Achievementfmt[] = "niixsxiixixxiix"; const std::string CustomAchievementfmt = "pppaaaapapaapp"; const std::string CustomAchievementIndex = "ID"; char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii"; char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx"; char const AreaGroupEntryfmt[] = "niiiiiii"; -char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx"; -char const AreaTriggerEntryfmt[] = "nifffxxxfffff"; +char const AreaTriggerEntryfmt[] = "nifffxxxfffffxxxx"; char const ArmorLocationfmt[] = "nfffff"; char const AuctionHouseEntryfmt[] = "niiix"; char const BankBagSlotPricesEntryfmt[] = "ni"; char const BannedAddOnsfmt[] = "nxxxxxxxxxx"; char const BarberShopStyleEntryfmt[] = "nixxxiii"; -char const BattlemasterListEntryfmt[] = "niiiiiiiiixsiiiixxxx"; +char const BattlemasterListEntryfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx"; char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii"; char const CharTitlesEntryfmt[] = "nxssix"; char const ChatChannelsEntryfmt[] = "nixsx"; -char const ChrClassesEntryfmt[] = "nixsxxxixiiiii"; -char const ChrRacesEntryfmt[] = "niixiixixxxxixsxxxxxixxx"; +char const ChrClassesEntryfmt[] = "nixsxxxixiiiixxxxx"; +char const ChrRacesEntryfmt[] = "niixiixxxxxxiisxxxxxxxxxxxxxxxxxxxxxxxxx"; char const ChrClassesXPowerTypesfmt[] = "nii"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; -char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxx"; -char const CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx"; -char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxffxxxxxxxxxxxxxxx"; +char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx"; +char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx"; char const CreatureFamilyfmt[] = "nfifiiiiixsx"; +char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx"; char const CreatureSpellDatafmt[] = "niiiixxxx"; char const CreatureTypefmt[] = "nxx"; -char const CurrencyTypesfmt[] = "nixxxiiiiix"; -char const DestructibleModelDatafmt[] = "ixxixxxixxxixxxixxxxxxxx"; -char const DungeonEncounterfmt[] = "niixisxx"; +char const CurrencyTypesfmt[] = "nixxxxxiiixx"; +char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxixxxxxxxx"; +char const DungeonEncounterfmt[] = "niiixsxx"; char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const DurabilityQualityfmt[] = "nf"; char const EmotesEntryfmt[] = "nxxiiixx"; char const EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixsxi"; char const FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; -char const GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffxxx"; +char const GameObjectDisplayInfofmt[] = "nixxxxxxxxxxffffffxxx"; char const GemPropertiesEntryfmt[] = "nixxii"; -char const GlyphPropertiesfmt[] = "niii"; -char const GlyphSlotfmt[] = "nii"; +char const GlyphPropertiesfmt[] = "niiix"; +char const GlyphSlotfmt[] = "nix"; char const GtBarberShopCostBasefmt[] = "xf"; char const GtCombatRatingsfmt[] = "xf"; char const GtOCTHpPerStaminafmt[] = "df"; @@ -89,24 +88,25 @@ char const ItemBagFamilyfmt[] = "nx"; char const ItemArmorQualityfmt[] = "nfffffffi"; char const ItemArmorShieldfmt[] = "nifffffff"; char const ItemArmorTotalfmt[] = "niffff"; -char const ItemClassfmt[] = "dixxfx"; +char const ItemClassfmt[] = "nxfx"; char const ItemDamagefmt[] = "nfffffffi"; char const ItemDisenchantLootfmt[] = "niiiiii"; //char const ItemDisplayTemplateEntryfmt[] = "nxxxxxxxxxxixxxxxxxxxxx"; char const ItemLimitCategoryEntryfmt[] = "nxii"; -char const ItemRandomPropertiesfmt[] = "nxiiixxs"; +char const ItemRandomPropertiesfmt[] = "nxiiiiis"; char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii"; -char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixixxx"; -char const LightEntryfmt[] = "nifffxxxxxxxxxx"; -char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const ItemSetEntryfmt[] = "nsiiiiiiiiiiiiiiiiiii"; +char const ItemSetSpellEntryfmt[] = "niiii"; +char const LFGDungeonEntryfmt[] = "nsiiixxiiiixxixixxxxxxxxxx"; +char const LightEntryfmt[] = "nifffxxxxxxxxxxxxx"; +char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; char const PhaseEntryfmt[] = "nsi"; char const PhaseGroupfmt[] = "nii"; char const MailTemplateEntryfmt[] = "nxs"; -char const MapEntryfmt[] = "nxiixxsixxixiffxiiii"; +char const MapEntryfmt[] = "nxiixxsixxixiffxiiiixx"; char const MapDifficultyEntryfmt[] = "diisiix"; -char const MovieEntryfmt[] = "nxxx"; +char const MovieEntryfmt[] = "nxxxx"; char const MountCapabilityfmt[] = "niiiiiii"; char const MountTypefmt[] = "niiiiiiiiiiiiiiiiiiiiiiii"; char const NameGenfmt[] = "dsii"; @@ -115,50 +115,41 @@ char const OverrideSpellDatafmt[] = "niiiiiiiiiixx"; char const QuestFactionRewardfmt[] = "niiiiiiiiii"; char const QuestSortEntryfmt[] = "nx"; char const QuestXPfmt[] = "niiiiiiiiii"; -char const PowerDisplayfmt[] = "nixxxx"; -char const PvPDifficultyfmt[] = "diiiii"; -char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char const PowerDisplayfmt[] = "nixx"; +char const PvPDifficultyfmt[] = "diiii"; +char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiii"; char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiixi"; -char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const SkillLinefmt[] = "nisxixi"; -char const SkillLineAbilityfmt[] = "niiiixxiiiiiii"; -char const SkillRaceClassInfofmt[] = "diiiixxix"; -char const SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii"; -char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const SkillLinefmt[] = "nisxixixx"; +char const SkillLineAbilityfmt[] = "niiiiiiiiiiii"; +char const SkillRaceClassInfofmt[] = "diiiixxi"; +char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii"; +char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const SpellCastTimefmt[] = "nixx"; -char const SpellCategoriesEntryfmt[] = "diiiiii"; -char const SpellCategoryfmt[] = "nixx"; -char const SpellDifficultyfmt[] = "niiii"; -const std::string CustomSpellDifficultyfmt = "ppppp"; -const std::string CustomSpellDifficultyIndex = "id"; +char const SpellCategoriesEntryfmt[] = "diiiiiiiix"; +char const SpellCategoryfmt[] = "nixxxx"; char const SpellDurationfmt[] = "niii"; -// 0 10 20 26 -char const SpellEffectEntryfmt[] = "nifiiiffiiiiiifiifiiiiiiiix"; +char const SpellEffectEntryfmt[] = "niifiiiffiiiiiifiifiiiiifiiiiif"; const std::string CustomSpellEffectEntryfmt = "ppppppppppppppappppppppppp"; const std::string CustomSpellEffectEntryIndex = "Id"; -// 0 10 20 30 40 47 -char const SpellEntryfmt[] = "niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix"; +char const SpellEntryfmt[] = "nixxxiiiiiiiiiiiiiiiiiii"; const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaapppaaapa"; const std::string CustomSpellEntryIndex = "Id"; char const SpellFocusObjectfmt[] = "nx"; -char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiisiiiiiiix"; -char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; -char const SpellRadiusfmt[] = "nfff"; +char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiiiiii"; +char const SpellItemEnchantmentConditionfmt[] = "nbbbbbXXXiiiiibbbbbbbbbbXXiiiiibbbbbXXX"; +char const SpellRadiusfmt[] = "nxfff"; char const SpellRangefmt[] = "nffffixx"; -char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii"; -char const SpellScalingEntryfmt[] = "diiiiffffffffffi"; +char const SpellScalingEntryfmt[] = "niiiifiii"; char const SpellTotemsEntryfmt[] = "niiii"; -char const SpellTargetRestrictionsEntryfmt[] = "nxiiii"; +char const SpellTargetRestrictionsEntryfmt[] = "niiffiiii"; char const SpellPowerEntryfmt[] = "diiiiixf"; -char const SpellInterruptsEntryfmt[] = "dixixi"; -char const SpellEquippedItemsEntryfmt[] = "diii"; -char const SpellAuraOptionsEntryfmt[] = "niiii"; -char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; +char const SpellInterruptsEntryfmt[] = "diiiiiii"; +char const SpellEquippedItemsEntryfmt[] = "diiiii"; +char const SpellAuraOptionsEntryfmt[] = "niiiiiiii"; char const SpellCastingRequirementsEntryfmt[] = "dixxixi"; -char const SpellClassOptionsEntryfmt[] = "dxiiiix"; -char const SpellCooldownsEntryfmt[] = "diii"; +char const SpellCooldownsEntryfmt[] = "diiiii"; char const SpellLevelsEntryfmt[] = "diii"; -char const SpellRuneCostfmt[] = "niiii"; char const SpellShapeshiftEntryfmt[] = "nixixx"; char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiixx"; char const StableSlotPricesfmt[] = "ni"; @@ -178,6 +169,6 @@ char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiii char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxx"; char const WorldMapAreaEntryfmt[] = "xinxffffixxxxx"; char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxx"; -char const WorldSafeLocsEntryfmt[] = "niffffx"; +char const WorldSafeLocsEntryfmt[] = "niffff"; #endif diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 71b8eba3cdf..863324f278c 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -183,7 +183,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) if (!dungeon) continue; - switch (dungeon->type) + switch (dungeon->Type) { case LFG_TYPE_DUNGEON: case LFG_TYPE_HEROIC: diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 2869c6cea74..dea8d996c53 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -271,10 +271,10 @@ struct LFGDungeonData maxlevel(0), difficulty(REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f), requiredItemLevel(0) { } - LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->name), map(dbc->map), - type(dbc->type), expansion(dbc->expansion), group(dbc->grouptype), - minlevel(dbc->minlevel), maxlevel(dbc->maxlevel), difficulty(Difficulty(dbc->difficulty)), - seasonal((dbc->flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f), + LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->Name_lang), map(dbc->MapID), + type(dbc->Type), expansion(dbc->Expansion), group(dbc->GroupID), + minlevel(dbc->MinLevel), maxlevel(dbc->MaxLevel), difficulty(Difficulty(dbc->DifficultyID)), + seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f), requiredItemLevel(0) { } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3a27207b833..7fb3822c888 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -409,7 +409,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/) // checked and error show at loading templates if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction)) { - if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP) + if (factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP) SetPvP(true); else SetPvP(false); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 716ee946778..2b13c859255 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -1875,9 +1875,9 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const float cosB = dy / dist; dx = dist * (cosA * cosB + sinA * sinB); dy = dist * (cosA * sinB - sinA * cosB); - return dx < info->maxX + radius && dx > info->minX - radius - && dy < info->maxY + radius && dy > info->minY - radius - && dz < info->maxZ + radius && dz > info->minZ - radius; + return dx < info->GeoBoxMax.X + radius && dx > info->GeoBoxMin.X - radius + && dy < info->GeoBoxMax.Y + radius && dy > info->GeoBoxMin.Y - radius + && dz < info->GeoBoxMax.Z + radius && dz > info->GeoBoxMin.Z - radius; } void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= NULL*/) @@ -2017,8 +2017,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->DamagedDisplayId) - modelId = modelData->DamagedDisplayId; + if (modelData->StateDamaged.DisplayID) + modelId = modelData->StateDamaged.DisplayID; SetDisplayId(modelId); if (setHealth) @@ -2045,8 +2045,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->DestroyedDisplayId) - modelId = modelData->DestroyedDisplayId; + if (modelData->StateDestroyed.DisplayID) + modelId = modelData->StateDestroyed.DisplayID; SetDisplayId(modelId); if (setHealth) @@ -2064,8 +2064,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->RebuildingDisplayId) - modelId = modelData->RebuildingDisplayId; + if (modelData->StateRebuilding.DisplayID) + modelId = modelData->StateRebuilding.DisplayID; SetDisplayId(modelId); // restores to full health diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 2eb4026bf07..4b4874666fd 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -43,7 +43,7 @@ void AddItemsSetItem(Player* player, Item* item) return; } - if (set->required_skill_id && player->GetSkillValue(set->required_skill_id) < set->required_skill_value) + if (set->RequiredSkill && player->GetSkillValue(set->RequiredSkill) < set->RequiredSkillRank) return; ItemSetEffect* eff = NULL; @@ -74,18 +74,18 @@ void AddItemsSetItem(Player* player, Item* item) } ++eff->item_count; + + ItemSetSpells& spells = sItemSetSpellsStore[setid]; - for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; ++x) + for (uint32 x = 0; x < spells.size(); ++x) { - if (!set->spells [x]) - continue; //not enough for spell - if (set->items_to_triggerspell[x] > eff->item_count) + if (spells[x]->Threshold > eff->item_count) continue; uint32 z = 0; for (; z < MAX_ITEM_SET_SPELLS; ++z) - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == spells[x]->SpellID) break; if (z < MAX_ITEM_SET_SPELLS) @@ -96,10 +96,10 @@ void AddItemsSetItem(Player* player, Item* item) { if (!eff->spells[y]) // free slot { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spells[x]->SpellID); if (!spellInfo) { - TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid); + TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", spells[x]->SpellID, setid); break; } @@ -140,19 +140,18 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto) return; --eff->item_count; + + ItemSetSpells& spells = sItemSetSpellsStore[setid]; - for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; x++) + for (uint32 x = 0; x < spells.size(); x++) { - if (!set->spells[x]) - continue; - // enough for spell - if (set->items_to_triggerspell[x] <= eff->item_count) + if (spells[x]->Threshold <= eff->item_count) continue; for (uint32 z = 0; z < MAX_ITEM_SET_SPELLS; z++) { - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == spells[x]->SpellID) { // spell can be not active if not fit form requirement player->ApplyEquipSpell(eff->spells[z], NULL, false); @@ -626,7 +625,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) SetState(ITEM_CHANGED, GetOwner()); } for (uint32 i = PROP_ENCHANTMENT_SLOT_1; i < PROP_ENCHANTMENT_SLOT_1 + 3; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_1], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_1], 0, 0); } } else @@ -643,7 +642,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) } for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i <= PROP_ENCHANTMENT_SLOT_4; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); } } } @@ -774,7 +773,7 @@ bool Item::HasEnchantRequiredSkill(const Player* player) const if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) + if (enchantEntry->RequiredSkillID && player->GetSkillValue(enchantEntry->RequiredSkillID) < enchantEntry->RequiredSkillRank) return false; } @@ -793,8 +792,8 @@ uint32 Item::GetEnchantRequiredLevel() const if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredLevel > level) - level = enchantEntry->requiredLevel; + if (enchantEntry->MinLevel > level) + level = enchantEntry->MinLevel; } return level; @@ -810,7 +809,7 @@ bool Item::IsBoundByEnchant() const if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) + if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND) return true; } @@ -940,7 +939,7 @@ bool Item::GemsFitSockets() const uint8 GemColor = 0; - uint32 gemid = enchantEntry->GemID; + uint32 gemid = enchantEntry->SRCItemID; if (gemid) { ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid); @@ -948,7 +947,7 @@ bool Item::GemsFitSockets() const { GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties); if (gemProperty) - GemColor = gemProperty->color; + GemColor = gemProperty->Type; } } @@ -971,7 +970,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const if (!enchantEntry) continue; - if (GemID == enchantEntry->GemID) + if (GemID == enchantEntry->SRCItemID) ++count; } return count; @@ -990,7 +989,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const if (!enchantEntry) continue; - ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID); + ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID); if (!gemProto) continue; @@ -1459,7 +1458,7 @@ uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*= { ItemClassEntry const* classEntry = sItemClassStore.LookupEntry(proto->Class); if (classEntry) - cost *= classEntry->PriceFactor; + cost *= classEntry->PriceMod; else cost = 0; } @@ -1496,10 +1495,10 @@ int32 Item::GetReforgableStat(ItemModType statType) const for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) - if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) - for (int k = 0; k < 5; ++k) - if (randomSuffix->enchant_id[k] == enchant->ID) - return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000); + if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectSpellID[f]) == statType) + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + if (randomSuffix->Enchantment[k] == enchant->ID) + return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000); } else { @@ -1510,10 +1509,10 @@ int32 Item::GetReforgableStat(ItemModType statType) const for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) - if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) + if (enchant->Effect[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->EffectSpellID[f]) == statType) for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) - if (randomProp->enchant_id[k] == enchant->ID) - return int32(enchant->amount[k]); + if (randomProp->Enchantment[k] == enchant->ID) + return int32(enchant->EffectPointsMin[k]); } return 0; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index d8e999bbc86..32781f68e34 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -573,16 +573,6 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] = MAX_ITEM_SUBCLASS_GLYPH }; -inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass) -{ - switch (ItemClass) - { - case ITEM_CLASS_WEAPON: return ItemSubClass; - case ITEM_CLASS_ARMOR: return ItemSubClass + 21; - } - return 0; -} - // 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 #if defined(__GNUC__) #pragma pack(1) diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e9799a3c648..9d8d0d1f6e9 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -747,7 +747,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) SetDisplayId(creature->GetDisplayId()); if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name); + SetName(cFamily->Name_lang); else SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex())); @@ -760,7 +760,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner) return false; if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name); + SetName(cFamily->Name_lang); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); @@ -834,15 +834,15 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) //scale CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family); - if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET) + if (cFamily && cFamily->MinScale > 0.0f && petType == HUNTER_PET) { float scale; - if (getLevel() >= cFamily->maxScaleLevel) - scale = cFamily->maxScale; - else if (getLevel() <= cFamily->minScaleLevel) - scale = cFamily->minScale; + if (getLevel() >= cFamily->MaxScaleLevel) + scale = cFamily->MaxScale; + else if (getLevel() <= cFamily->MinScaleLevel) + scale = cFamily->MinScale; else - scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale); + scale = cFamily->MinScale + float(getLevel() - cFamily->MinScaleLevel) / cFamily->MaxScaleLevel * (cFamily->MaxScale - cFamily->MinScale); SetObjectScale(scale); } @@ -1045,7 +1045,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const if (!cFamily) return false; - uint32 diet = cFamily->petFoodMask; + uint32 diet = cFamily->PetFoodMask; uint32 FoodMask = 1 << (item->FoodType-1); return (diet & FoodMask) != 0; } @@ -1633,7 +1633,7 @@ bool Pet::resetTalents() return false; // Check pet talent type CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family); - if (!pet_family || pet_family->petTalentType < 0) + if (!pet_family || pet_family->PetTalentType < 0) return false; uint8 level = getLevel(); @@ -1658,7 +1658,7 @@ bool Pet::resetTalents() continue; // unlearn only talents for pets family talent type - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask)) continue; for (uint8 j = 0; j < MAX_TALENT_RANK; ++j) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1ad85c237ac..6b1e8fc95fa 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -966,7 +966,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac SetMap(sMapMgr->CreateMap(info->mapId, this)); - uint8 powertype = cEntry->powerType; + uint8 powertype = cEntry->PowerType; SetObjectScale(1.0f); @@ -1127,10 +1127,10 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac { 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); @@ -1430,7 +1430,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) @@ -2639,9 +2639,9 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) // not unfriendly if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) - if (factionTemplate->faction) - if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) - if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) + if (factionTemplate->Faction) + if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->Faction)) + if (faction->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) return NULL; // not too far @@ -3688,13 +3688,13 @@ 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; ///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16 - if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || (pSkill->id == SKILL_LOCKPICKING && _spell_idx->second->max_value == 0)) - LearnDefaultSkill(pSkill->id, 0); + if ((_spell_idx->second->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || (pSkill->ID == SKILL_LOCKPICKING && _spell_idx->second->TrivialSkillLineRankHigh == 0)) + LearnDefaultSkill(pSkill->ID, 0); } } } @@ -3718,8 +3718,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); @@ -5235,8 +5235,13 @@ 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 = 0; + if (ditemProto->Class == ITEM_CLASS_WEAPON) + dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass]; + else if (ditemProto->Class == ITEM_CLASS_ARMOR) + dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass]; + + uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->QualityMod)); costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST)); @@ -5330,13 +5335,13 @@ void Player::RepopAtGraveyard() bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) { - 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; @@ -5401,22 +5406,22 @@ void Player::UpdateLocalChannels(uint32 newZone) if (CanJoinConstantChannelInZone(channel, current_zone)) { - if (!(channel->flags & CHANNEL_DBC_FLAG_GLOBAL)) + if (!(channel->Flags & CHANNEL_DBC_FLAG_GLOBAL)) { - if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) + if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) continue; // Already on the channel, as city channel names are not changing char new_channel_name_buf[100]; char const* currentNameExt; - if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) + if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY); else currentNameExt = current_zone_name.c_str(); - snprintf(new_channel_name_buf, 100, channel->pattern, currentNameExt); + snprintf(new_channel_name_buf, 100, channel->Name_lang, currentNameExt); - joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ChannelID); + joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ID); if (usedChannel) { if (joinChannel != usedChannel) @@ -5429,7 +5434,7 @@ void Player::UpdateLocalChannels(uint32 newZone) } } else - joinChannel = cMgr->GetJoinChannel(channel->pattern, channel->ChannelID); + joinChannel = cMgr->GetJoinChannel(channel->Name_lang, channel->ID); } else removeChannel = usedChannel; @@ -5854,24 +5859,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); } } @@ -6011,7 +6016,7 @@ void Player::UpdateSkillsForLevel() if (GetSkillRangeType(rcEntry) != SKILL_RANGE_LEVEL) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6043,10 +6048,10 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (!rcEntry) continue; - if (IsProfessionOrRidingSkill(rcEntry->SkillId)) + if (IsProfessionOrRidingSkill(rcEntry->SkillID)) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6124,8 +6129,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->SpellID)); // Clear profession lines if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id) @@ -6152,7 +6157,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) } SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, id); - if (skillEntry->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillEntry->CategoryID == SKILL_CATEGORY_PROFESSION) { if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1)) SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, id); @@ -6618,8 +6623,8 @@ uint32 Player::TeamForRace(uint8 race) { switch (rEntry->TeamID) { + case 0: return ALLIANCE; 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); } @@ -6744,7 +6749,7 @@ void Player::RewardReputation(Unit* victim, float rate) Map const* map = GetMap(); if (map && map->IsNonRaidDungeon()) if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty())) - if (dungeon->reclevel == 80) + if (dungeon->TargetLevel == 80) ChampioningFaction = GetChampioningFaction(); } @@ -7115,7 +7120,7 @@ void Player::SendCurrencies() const CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); // not send init meta currencies. - if (!entry || entry->Category == CURRENCY_CATEGORY_META_CONQUEST) + if (!entry || entry->CategoryID == CURRENCY_CATEGORY_META_CONQUEST) continue; uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; @@ -7264,7 +7269,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (count > 0) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); - if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) + if (currency->CategoryID == CURRENCY_CATEGORY_META_CONQUEST) { // count was changed to week limit, now we can modify original points. ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog); @@ -7350,12 +7355,12 @@ uint32 Player::GetCurrencyWeekCap(CurrencyTypesEntry const* currency) const return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION; } - return currency->WeekCap; + return currency->MaxEarnablePerWeek; } uint32 Player::GetCurrencyTotalCap(CurrencyTypesEntry const* currency) const { - uint32 cap = currency->TotalCap; + uint32 cap = currency->MaxQty; switch (currency->ID) { @@ -7878,9 +7883,9 @@ 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]; + statType = ssd->StatID[i]; val = (ssv->GetStatMultiplier(proto->InventoryType) * ssd->Modifier[i]) / 10000; } else @@ -8056,7 +8061,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // Apply Spell Power from ScalingStatValue if set if (ssv && proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) - if (int32 spellbonus = int32(ssv->Spellpower)) + if (int32 spellbonus = int32(ssv->SpellPower)) ApplySpellPowerBonus(spellbonus, apply); // If set ScalingStatValue armor get it or use item armor @@ -8435,7 +8440,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 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); @@ -8454,15 +8459,15 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 continue; } - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]); if (!spellInfo) { TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell(%s, name: %s, enchant: %i): unknown spell %i is cast, ignoring...", - GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->spellid[s]); + GetGUID().ToString().c_str(), GetName().c_str(), pEnchant->ID, pEnchant->EffectSpellID[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) { @@ -8473,7 +8478,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 } // Apply spell mods - ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); + ApplySpellMod(pEnchant->EffectSpellID[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); // Shiv has 100% chance to apply the poison if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT) @@ -8559,13 +8564,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->EffectSpellID[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->EffectSpellID[s]); continue; } @@ -9706,12 +9711,12 @@ void Player::SendBGWeekendWorldStates() 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); } } } @@ -10492,13 +10497,13 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_NOT_EQUIPPABLE; } - 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_IS; @@ -13696,17 +13701,17 @@ 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; // Cogwheel gems dont have requirement data set in SpellItemEnchantment.dbc, but they do have it in Item-sparse.db2 - if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->GemID)) + if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->SRCItemID)) if (gem->RequiredSkill && GetSkillValue(gem->RequiredSkill) < gem->RequiredSkillRank) return; @@ -13716,18 +13721,18 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool && !item->GetTemplate()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color) { // 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))) - return; + SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)); + if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID))) + return; } if (!item->IsBroken()) { for (int 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->EffectSpellID[s]; switch (enchant_display_type) { @@ -13757,11 +13762,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (item_rand) { // Search enchant_amount - for (int k = 0; k < 5; ++k) + 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; } } @@ -13785,9 +13790,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; } } @@ -13803,11 +13808,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); if (item_rand_suffix) { - for (int k = 0; k < 5; ++k) + 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; } } @@ -14071,12 +14076,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); } @@ -14087,11 +14092,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); } } @@ -17906,13 +17911,13 @@ void Player::_LoadGlyphAuras() { if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(GetGlyphSlot(i))) { - if (gp->TypeFlags == gs->TypeFlags) + if (gp->Type == gs->Type) { - CastSpell(this, gp->SpellId, true); + CastSpell(this, gp->SpellID, true); continue; } else - TC_LOG_ERROR("entities.player", "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->TypeFlags, gs->TypeFlags); + TC_LOG_ERROR("entities.player", "Player %s has glyph with typeflags %u in slot with typeflags %u, removing.", m_name.c_str(), gp->Type, gs->Type); } else TC_LOG_ERROR("entities.player", "Player %s has not existing glyph slot entry %u on index %u", m_name.c_str(), GetGlyphSlot(i), i); @@ -18673,7 +18678,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) bool deleteInstance = false; MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); - std::string mapname = mapEntry ? mapEntry->name : "Unknown"; + std::string mapname = mapEntry ? mapEntry->MapName_lang : "Unknown"; if (!mapEntry || !mapEntry->IsDungeon()) { @@ -20355,7 +20360,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->IsRaid() || diff == DUNGEON_DIFFICULTY_HEROIC) { ++itr; continue; @@ -20974,7 +20979,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) OpcodeServer opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; - flag96 _mask = 0; + flag96 _mask; uint32 modTypeCount = 0; // count of mods per one mod->op WorldPacket data(opcode); data << uint32(1); // count of different mod->op's in packet @@ -21586,10 +21591,10 @@ void Player::InitDataForForm(bool reapplyMods) ShapeshiftForm form = GetShapeshiftForm(); SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); - if (ssEntry && ssEntry->attackSpeed) + 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 @@ -21613,8 +21618,8 @@ void Player::InitDataForForm(bool reapplyMods) default: // 0, for example { ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass()); - if (cEntry && cEntry->powerType < MAX_POWERS && uint32(getPowerType()) != cEntry->powerType) - setPowerType(Powers(cEntry->powerType)); + if (cEntry && cEntry->PowerType < MAX_POWERS && uint32(getPowerType()) != cEntry->PowerType) + setPowerType(Powers(cEntry->PowerType)); break; } } @@ -22478,7 +22483,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) if (!enchantEntry) continue; - uint32 gemid = enchantEntry->GemID; + uint32 gemid = enchantEntry->SRCItemID; if (!gemid) continue; @@ -22490,7 +22495,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) { @@ -22505,15 +22510,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; @@ -22556,7 +22561,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? @@ -22600,7 +22605,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); } @@ -23379,7 +23384,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) { @@ -23486,8 +23491,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; @@ -23602,31 +23607,31 @@ 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->SpellID)) continue; - if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AquireMethod != 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->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + RemoveSpell(ability->SpellID); // need learn else if (!IsInWorld()) - AddSpell(ability->spellId, true, true, true, false, false, true); + AddSpell(ability->SpellID, true, true, true, false, false, true); else - LearnSpell(ability->spellId, true, true); + LearnSpell(ability->SpellID, true, true); } } @@ -23871,10 +23876,10 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const float Player::GetReputationPriceDiscount(Creature const* creature) const { FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry(); - if (!vendor_faction || !vendor_faction->faction) + if (!vendor_faction || !vendor_faction->Faction) return 1.0f; - ReputationRank rank = GetReputationRank(vendor_faction->faction); + ReputationRank rank = GetReputationRank(vendor_faction->Faction); if (rank <= REP_NEUTRAL) return 1.0f; @@ -23893,11 +23898,11 @@ 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; return true; @@ -24694,8 +24699,8 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) if (!res) { m_MirrorTimerFlags &= ~(UNDERWATER_INWATER | UNDERWATER_INLAVA | UNDERWATER_INSLIME | UNDERWARER_INDARKWATER); - if (_lastLiquid && _lastLiquid->SpellId) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID) + RemoveAurasDueToSpell(_lastLiquid->SpellID); _lastLiquid = NULL; return; @@ -24704,25 +24709,25 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) if (uint32 liqEntry = liquid_status.entry) { LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); - if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellID); - if (liquid && liquid->SpellId) + if (liquid && liquid->SpellID) { if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) { - if (!HasAura(liquid->SpellId)) - CastSpell(this, liquid->SpellId, true); + if (!HasAura(liquid->SpellID)) + CastSpell(this, liquid->SpellID, true); } else - RemoveAurasDueToSpell(liquid->SpellId); + RemoveAurasDueToSpell(liquid->SpellID); } _lastLiquid = liquid; } - else if (_lastLiquid && _lastLiquid->SpellId) + else if (_lastLiquid && _lastLiquid->SpellID) { - RemoveAurasDueToSpell(_lastLiquid->SpellId); + RemoveAurasDueToSpell(_lastLiquid->SpellID); _lastLiquid = NULL; } @@ -24884,7 +24889,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n uint8 facialhair = GetByteValue(PLAYER_BYTES_2, 0); uint8 skincolor = GetByteValue(PLAYER_BYTES, 0); - 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); @@ -24903,7 +24908,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n if (facialhair != newfacialhair) cost += bsc->cost * 0.75f; // +3/4 of price - if (newSkin && skincolor != newSkin->hair_id) + if (newSkin && skincolor != newSkin->Data) cost += bsc->cost * 0.75f; // +5/6 of price return uint32(cost); @@ -24914,7 +24919,7 @@ void Player::InitGlyphsForLevel() uint32 slot = 0; for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows() && slot < MAX_GLYPH_SLOT_INDEX; ++i) if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i)) - SetGlyphSlot(slot++, gs->Id); + SetGlyphSlot(slot++, gs->ID); uint8 level = getLevel(); uint32 slotMask = 0; @@ -24961,8 +24966,8 @@ bool Player::HasTitle(uint32 bitIndex) const 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) { @@ -24980,7 +24985,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 GetSession()->SendPacket(&data); } @@ -25309,10 +25314,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) SendEquipError(msg, NULL, NULL, item->itemid); } +// 6.x - removeme uint32 Player::CalculateTalentsPoints() const { // this dbc file has entries only up to level 100 - NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min<uint32>(getLevel(), 100)); + /*NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min<uint32>(getLevel(), 100)); if (!count) return 0; @@ -25336,7 +25342,8 @@ uint32 Player::CalculateTalentsPoints() const if (talentPointsForLevel > baseForLevel) talentPointsForLevel = baseForLevel; - return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT)); + return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));*/ + return 0; } bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const @@ -25415,13 +25422,13 @@ void Player::_LoadSkills(PreparedQueryResult result) SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, skill); uint16 step = 0; - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (skillLine) { - if (skillLine->categoryId == SKILL_CATEGORY_SECONDARY) + if (skillLine->CategoryID == SKILL_CATEGORY_SECONDARY) step = max / 75; - if (skillLine->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillLine->CategoryID == SKILL_CATEGORY_PROFESSION) { step = max / 75; @@ -25486,7 +25493,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; @@ -25520,11 +25527,11 @@ 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_IS; // there is an equip limit on this item - if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot)) return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED; } @@ -25818,11 +25825,11 @@ 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->petTalentMask)) return; // find current max talent rank (0~5) @@ -26080,7 +26087,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) @@ -26089,7 +26096,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) if (!talentTabInfo) continue; - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask)) continue; for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId) @@ -26645,7 +26652,7 @@ void Player::ActivateSpec(uint8 spec) // remove secondary glyph if (uint32 oldglyph = GetGlyph(GetActiveSpec(), slot)) if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) - RemoveAurasDueToSpell(old_gp->SpellId); + RemoveAurasDueToSpell(old_gp->SpellID); SetActiveSpec(spec); uint32 spentTalents = 0; @@ -26700,7 +26707,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); } @@ -27257,13 +27264,13 @@ float Player::GetCollisionHeight(bool mounted) const if (!mountDisplayInfo) return GetCollisionHeight(false); - CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId); + CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID); if (!mountModelData) return GetCollisionHeight(false); CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()); ASSERT(displayInfo); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelID); ASSERT(modelData); float scaleMod = GetObjectScale(); // 99% sure about this @@ -27275,7 +27282,7 @@ float Player::GetCollisionHeight(bool mounted) const //! Dismounting case - use basic default model data CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()); ASSERT(displayInfo); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelId); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(displayInfo->ModelID); ASSERT(modelData); return modelData->CollisionHeight; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0f5418e24e7..f01846f5593 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -165,7 +165,7 @@ struct SpellModifier SpellModType type : 8; int16 charges : 16; int32 value; - flag96 mask; + flag128 mask; uint32 spellId; Aura* const ownerAura; }; @@ -2539,7 +2539,7 @@ class Player : public Unit, public GridObject<Player> void CompletedAchievement(AchievementEntry const* entry); bool HasTitle(uint32 bitIndex) const; - bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->bit_index); } + bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->MaskID); } void SetTitle(CharTitlesEntry const* title, bool lost = false); //bool isActiveObject() const { return true; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 541a7c711ec..b832292d89b 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -318,17 +318,17 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) if (ranged) { index = UNIT_FIELD_RANGED_ATTACK_POWER; - val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RAPPerAgility; + val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RangedAttackPowerPerAgility; } else { - float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrenth, 0.0f); - float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f); + float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->AttackPowerPerStrength, 0.0f); + float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerAgility, 0.0f); SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); // Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ? - if (form && form->flags1 & 0x20) - agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f); + if (form && form->Flags & 0x20) + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerStrength, 0.0f); val2 = strengthValue + agilityValue; } @@ -542,11 +542,11 @@ void Player::UpdateMastery() if (!aura->HasEffect(j)) continue; - float mult = aura->GetSpellInfo()->Effects[j].BonusMultiplier; + float mult = aura->GetSpellInfo()->Effects[j].BonusCoefficient; if (G3D::fuzzyEq(mult, 0.0f)) continue; - aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier)); + aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusCoefficient)); } } } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4593288d548..0152b132370 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2949,8 +2949,8 @@ void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z) ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); if (!res) { - if (_lastLiquid && _lastLiquid->SpellId) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID) + RemoveAurasDueToSpell(_lastLiquid->SpellID); RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); _lastLiquid = NULL; @@ -2960,26 +2960,26 @@ void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z) if (uint32 liqEntry = liquid_status.entry) { LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); - if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID && _lastLiquid->ID != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellID); - if (liquid && liquid->SpellId) + if (liquid && liquid->SpellID) { if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) { - if (!HasAura(liquid->SpellId)) - CastSpell(this, liquid->SpellId, true); + if (!HasAura(liquid->SpellID)) + CastSpell(this, liquid->SpellID, true); } else - RemoveAurasDueToSpell(liquid->SpellId); + RemoveAurasDueToSpell(liquid->SpellID); } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_ABOVEWATER); _lastLiquid = liquid; } - else if (_lastLiquid && _lastLiquid->SpellId) + else if (_lastLiquid && _lastLiquid->SpellID) { - RemoveAurasDueToSpell(_lastLiquid->SpellId); + RemoveAurasDueToSpell(_lastLiquid->SpellID); RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); _lastLiquid = NULL; } @@ -3728,7 +3728,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui if (!casterGUID || aura->GetCasterGUID() == casterGUID) { SpellInfo const* spell = aura->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3)) + if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3)) { RemoveAura(iter); continue; @@ -3990,7 +3990,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) { SpellInfo const* spell = (*i)->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3)) + if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3)) { if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID) continue; @@ -5521,7 +5521,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return true; } // Seed of Corruption (Mobs cast) - no die req - if (dummySpell->SpellFamilyFlags.IsEqual(0, 0, 0) && dummySpell->SpellIconID == 1932) + if (!dummySpell->SpellFamilyFlags && dummySpell->SpellIconID == 1932) { // if damage is more than need deal finish spell if (triggeredByAura->GetAmount() <= int32(damage)) @@ -5625,7 +5625,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* blessHealing = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!blessHealing) return false; - basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].Amplitude)); + basepoints0 = int32(CalculatePct(damage, triggerAmount) / (blessHealing->GetMaxDuration() / blessHealing->Effects[0].ApplyAuraPeriod)); } break; } @@ -5745,7 +5745,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); // Add remaining ticks to damage done basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); } @@ -6032,7 +6032,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere Item* addWeapon = player->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true); uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0; SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id_add); - if (pEnchant && pEnchant->spellid[0] == dummySpell->Id) + if (pEnchant && pEnchant->EffectSpellID[0] == dummySpell->Id) chance += 14; if (!roll_chance_i(chance)) @@ -6129,7 +6129,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); } break; } @@ -6143,7 +6143,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere SpellInfo const* triggeredSpell = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!triggeredSpell) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (triggeredSpell->GetMaxDuration() / triggeredSpell->Effects[0].ApplyAuraPeriod); // Add remaining ticks to healing done basepoints0 += GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_HEAL); } @@ -6159,7 +6159,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { Aura* flameShock = aurEff->GetBase(); int32 maxDuration = flameShock->GetMaxDuration(); - int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetAmplitude(); + int32 newDuration = flameShock->GetDuration() + 2 * aurEff->GetPeriod(); flameShock->SetDuration(newDuration); // is it blizzlike to change max duration for FS? @@ -6303,7 +6303,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (AuraEffect* glyph=GetAuraEffect(63332, 0)) AddPct(basepoints0, glyph->GetAmount()); - basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].Amplitude); + basepoints0 = basepoints0 / (unholyBlight->GetMaxDuration() / unholyBlight->Effects[0].ApplyAuraPeriod); basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; } @@ -6777,7 +6777,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (!TriggerPS) return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].Amplitude); + basepoints0 = CalculatePct(int32(damage), triggerAmount) / (TriggerPS->GetMaxDuration() / TriggerPS->Effects[0].ApplyAuraPeriod); basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; } @@ -7323,12 +7323,12 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const return *repRank; if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction)) + if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction)) { if (targetFactionEntry->CanHaveReputation()) { // check contested flags - if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD + if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD && selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; @@ -7360,14 +7360,14 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem if (Player const* targetPlayerOwner = target->GetAffectingPlayer()) { // check contested flags - if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD + if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD && targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry)) return *repRank; if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) { if (factionEntry->CanHaveReputation()) { @@ -7388,7 +7388,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem return REP_FRIENDLY; if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry)) return REP_FRIENDLY; - if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) + if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) return REP_HOSTILE; // neutral by default return REP_NEUTRAL; @@ -7407,11 +7407,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const bool Unit::IsHostileToPlayers() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction || !my_faction->faction) + if (!my_faction || !my_faction->Faction) return false; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsHostileToPlayers(); @@ -7420,11 +7420,11 @@ bool Unit::IsHostileToPlayers() const bool Unit::IsNeutralToAll() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction || !my_faction->faction) + if (!my_faction || !my_faction->Faction) return true; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsNeutralToAll(); @@ -10322,7 +10322,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry()) { if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate))) - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction)) if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry)) if (!(repState->Flags & FACTION_FLAG_AT_WAR)) return false; @@ -11398,7 +11398,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell { if (!spellInfo->RangeEntry) return 0; - if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile) + if (spellInfo->RangeEntry->MaxRangeFriend == spellInfo->RangeEntry->MaxRangeHostile) return spellInfo->GetMaxRange(); if (target == NULL) return spellInfo->GetMaxRange(true); @@ -11409,7 +11409,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell { if (!spellInfo->RangeEntry) return 0; - if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile) + if (spellInfo->RangeEntry->MinRangeFriend == spellInfo->RangeEntry->MinRangeHostile) return spellInfo->GetMinRange(); return spellInfo->GetMinRange(!IsHostileTo(target)); } @@ -11420,8 +11420,8 @@ uint32 Unit::GetCreatureType() const { ShapeshiftForm form = GetShapeshiftForm(); SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); - if (ssEntry && ssEntry->creatureType > 0) - return ssEntry->creatureType; + if (ssEntry && ssEntry->CreatureType > 0) + return ssEntry->CreatureType; else return CREATURE_TYPE_HUMANOID; } @@ -11454,7 +11454,7 @@ bool Unit::IsInDisallowedMountForm() const if (!shapeshift) return true; - if (!(shapeshift->flags1 & 0x1)) + if (!(shapeshift->Flags & 0x1)) return true; } @@ -11465,12 +11465,12 @@ bool Unit::IsInDisallowedMountForm() const if (!display) return true; - CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId); + CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID); if (!displayExtra) return true; - CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId); - ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race); + CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelID); + ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID); if (model && !(model->Flags & 0x80)) if (race && !(race->Flags & 0x4)) @@ -15206,21 +15206,21 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const uint32 modelid = 0; SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form); - if (formEntry && formEntry->modelID_A) + if (formEntry && formEntry->CreatureDisplayID[0]) { // Take the alliance modelid as default if (GetTypeId() != TYPEID_PLAYER) - return formEntry->modelID_A; + return formEntry->CreatureDisplayID[0]; else { if (Player::TeamForRace(getRace()) == ALLIANCE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; else - modelid = formEntry->modelID_H; + modelid = formEntry->CreatureDisplayID[1]; // If the player is horde but there are no values for the horde modelid - take the alliance modelid if (!modelid && Player::TeamForRace(getRace()) == HORDE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; } } @@ -16037,7 +16037,7 @@ void Unit::StopAttackFaction(uint32 faction_id) { if (Unit* victim = GetVictim()) { - if (victim->GetFactionTemplateEntry()->faction == faction_id) + if (victim->GetFactionTemplateEntry()->Faction == faction_id) { AttackStop(); if (IsNonMeleeSpellCast(false)) @@ -16052,7 +16052,7 @@ void Unit::StopAttackFaction(uint32 faction_id) AttackerSet const& attackers = getAttackers(); for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();) { - if ((*itr)->GetFactionTemplateEntry()->faction == faction_id) + if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id) { (*itr)->AttackStop(); itr = attackers.begin(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 576ebf4f547..49b9c2c45ae 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -950,7 +950,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (cInfo->scale <= 0.0f) { if (displayScaleEntry) - const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->scale; + const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale; else const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f; } @@ -2373,7 +2373,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH || itemSubclass > ITEM_SUBCLASS_ARMOR_PLATE) return 0; - return uint32(armorQuality->Value[quality] * armorTotal->Value[itemSubclass - 1] * location->Value[itemSubclass - 1] + 0.5f); + return uint32(armorQuality->QualityMod[quality] * armorTotal->Value[itemSubclass - 1] * location->Modifier[itemSubclass - 1] + 0.5f); } // shields @@ -2381,7 +2381,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (!shield) return 0; - return uint32(shield->Value[quality] + 0.5f); + return uint32(shield->Quality[quality] + 0.5f); } uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel) @@ -2490,18 +2490,18 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, disenchant->MinItemLevel <= itemTemplate.ItemLevel && disenchant->MaxItemLevel >= itemTemplate.ItemLevel) { - if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic) + if (disenchant->ID == 60 || disenchant->ID == 61) // epic item disenchant ilvl range 66-99 (classic) { if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300) continue; // skip to epic item disenchant ilvl range 90-199 (TBC) } - else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC) + else if (disenchant->ID == 66 || disenchant->ID == 67) // epic item disenchant ilvl range 90-199 (TBC) { if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300)) continue; } - *disenchantID = disenchant->Id; + *disenchantID = disenchant->ID; *requiredDisenchantSkill = disenchant->RequiredDisenchantSkill; return; } @@ -2792,10 +2792,10 @@ void ObjectMgr::LoadItemTemplates() for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { - if (entry->ItemId[j] <= 0) + if (entry->ItemID[j] <= 0) continue; - uint32 item_id = entry->ItemId[j]; + uint32 item_id = entry->ItemID[j]; if (!GetItemTemplate(item_id)) notFoundOutfit.insert(item_id); @@ -3098,10 +3098,10 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 bool found = false; for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) { - if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId) + if (entry->ItemID[x] > 0 && uint32(entry->ItemID[x]) == itemId) { found = true; - const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0; + const_cast<CharStartOutfitEntry*>(entry)->ItemID[x] = 0; break; } } @@ -3188,8 +3188,8 @@ void ObjectMgr::LoadPlayerInfo() info->positionY = positionY; info->positionZ = positionZ; info->orientation = orientation; - info->displayId_m = rEntry->model_m; - info->displayId_f = rEntry->model_f; + info->displayId_m = rEntry->MaleDisplayID; + info->displayId_f = rEntry->FemaleDisplayID; _playerInfo[current_race][current_class] = info; ++count; @@ -5303,7 +5303,7 @@ void ObjectMgr::LoadInstanceEncounters() if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->Name_lang, lastEncounterDungeon); continue; } @@ -5312,7 +5312,7 @@ void ObjectMgr::LoadInstanceEncounters() { if (itr != dungeonLastBosses.end()) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->Name_lang, itr->second->ID, itr->second->Name_lang); continue; } @@ -5326,7 +5326,7 @@ void ObjectMgr::LoadInstanceEncounters() CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry); if (!creatureInfo) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang); continue; } const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS; @@ -5335,29 +5335,29 @@ void ObjectMgr::LoadInstanceEncounters() case ENCOUNTER_CREDIT_CAST_SPELL: if (!sSpellMgr->GetSpellInfo(creditEntry)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang); continue; } break; default: - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->Name_lang); continue; } - if (dungeonEncounter->difficulty == -1) + if (dungeonEncounter->DifficultyID == -1) { for (uint32 i = 0; i < MAX_DIFFICULTY; ++i) { - if (GetMapDifficultyData(dungeonEncounter->mapId, Difficulty(i))) + if (GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i))) { - DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, i)]; + DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, i)]; encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon)); } } } else { - DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)]; + DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, dungeonEncounter->DifficultyID)]; encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon)); } @@ -5998,9 +5998,9 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float { // if find graveyard at different map from where entrance placed (or no entrance data), use any first if (!mapEntry - || mapEntry->entrance_map < 0 - || uint32(mapEntry->entrance_map) != entry->map_id - || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) + || mapEntry->CorpseMapID < 0 + || uint32(mapEntry->CorpseMapID) != entry->map_id + || (mapEntry->CorpsePos.X == 0 && mapEntry->CorpsePos.Y == 0)) // Check X and Y { // not have any corrdinates for check distance anyway entryFar = entry; @@ -6008,8 +6008,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float } // at entrance map calculate distance (2D); - float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x) - +(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y); + float dist2 = (entry->x - mapEntry->CorpsePos.X)*(entry->x - mapEntry->CorpsePos.X) + +(entry->y - mapEntry->CorpsePos.Y)*(entry->y - mapEntry->CorpsePos.Y); if (foundEntr) { if (dist2 < distEntr) @@ -6301,7 +6301,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const bool useParentDbValue = false; uint32 parentId = 0; const MapEntry* mapEntry = sMapStore.LookupEntry(Map); - if (!mapEntry || mapEntry->entrance_map < 0) + if (!mapEntry || mapEntry->CorpseMapID < 0) return NULL; if (mapEntry->IsDungeon()) @@ -6315,12 +6315,12 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const useParentDbValue = true; } - uint32 entrance_map = uint32(mapEntry->entrance_map); + uint32 entrance_map = uint32(mapEntry->CorpseMapID); for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr) if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId)) { AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); - if (atEntry && atEntry->mapid == Map) + if (atEntry && atEntry->MapID == Map) return &itr->second; } return NULL; @@ -7079,7 +7079,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() continue; } - if (factionEntry->team == 0) + if (factionEntry->ParentFactionID == 0) { TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); continue; @@ -7097,7 +7097,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() continue; } - if (factionSpillover->reputationListID < 0) + if (factionSpillover->ReputationIndex < 0) { TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId); continue; @@ -7853,11 +7853,11 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac for (int i = 0; i < 4; i++) { - if ((!factionEntry->BaseRepClassMask[i] || - factionEntry->BaseRepClassMask[i] & classMask) && - (!factionEntry->BaseRepRaceMask[i] || - factionEntry->BaseRepRaceMask[i] & raceMask)) - return factionEntry->BaseRepValue[i]; + if ((!factionEntry->ReputationClassMask[i] || + factionEntry->ReputationClassMask[i] & classMask) && + (!factionEntry->ReputationRaceMask[i] || + factionEntry->ReputationRaceMask[i] & raceMask)) + return factionEntry->ReputationBase[i]; } return 0; @@ -7865,17 +7865,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry) { - SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (!skill) return SKILL_RANGE_NONE; - if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier)) + if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID)) return SKILL_RANGE_RANK; - if (rcEntry->SkillId == SKILL_RUNEFORGING) + if (rcEntry->SkillID == SKILL_RUNEFORGING) return SKILL_RANGE_MONO; - switch (skill->categoryId) + switch (skill->CategoryID) { case SKILL_CATEGORY_ARMOR: return SKILL_RANGE_MONO; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 045e8705f19..5f6c4f0765b 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1353,8 +1353,24 @@ class ObjectMgr void LoadRealmNames(); std::string GetRealmName(uint32 realm) const; + ExpansionRequirementContainer const& GetRaceExpansionRequirements() const { return _raceExpansionRequirementStore; } + uint8 GetRaceExpansionRequirement(uint8 race) const + { + auto itr = _raceExpansionRequirementStore.find(race); + if (itr != _raceExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } + ExpansionRequirementContainer const& GetClassExpansionRequirements() const { return _classExpansionRequirementStore; } + uint8 GetClassExpansionRequirement(uint8 class_) const + { + auto itr = _classExpansionRequirementStore.find(class_); + if (itr != _classExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } private: // first free id for selected id type diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 640410483e9..2aa40942171 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1851,7 +1851,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* // check for min / max count uint32 memberscount = GetMembersCount(); - if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds + if (memberscount > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side // get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.) @@ -1881,7 +1881,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match @@ -2008,7 +2008,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) 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->IsRaid() || diff == DUNGEON_DIFFICULTY_HEROIC) { ++itr; continue; @@ -2093,7 +2093,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) return NULL; Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); - return GetBoundInstance(difficulty, mapEntry->MapID); + return GetBoundInstance(difficulty, mapEntry->ID); } InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId) diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 92f9bbd20d4..bb800fccbd8 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -226,7 +226,7 @@ void GroupMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() != 0, true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->ID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() != 0, true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index a7fd0ca34ef..7b71c6e826a 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2349,8 +2349,8 @@ void Guild::SendLoginInfo(WorldSession* session) for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level <= GetLevel()) - player->LearnSpell(entry->SpellId, true); + if (entry->GuildLevel <= GetLevel()) + player->LearnSpell(entry->SpellID, true); SendGuildReputationWeeklyCap(session, member->GetWeekReputation()); @@ -2805,8 +2805,8 @@ void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level <= GetLevel()) - player->RemoveSpell(entry->SpellId, false, false); + if (entry->GuildLevel <= GetLevel()) + player->RemoveSpell(entry->SpellID, false, false); } _DeleteMemberFromDB(guid.GetCounter()); @@ -3561,8 +3561,8 @@ void Guild::GiveXP(uint32 xp, Player* source) std::vector<uint32> perksToLearn; for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level > oldLevel && entry->Level <= GetLevel()) - perksToLearn.push_back(entry->SpellId); + if (entry->GuildLevel > oldLevel && entry->GuildLevel <= GetLevel()) + perksToLearn.push_back(entry->SpellID); // Notify all online players that guild level changed and learn perks for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 81a16a5d2f1..67a00d3dff8 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -62,10 +62,9 @@ void GuildFinderMgr::LoadGuildSettings() bool listed = (fields[5].GetUInt8() != 0); std::string comment = fields[6].GetString(); - TeamId guildTeam = TEAM_ALLIANCE; + TeamId guildTeam = TEAM_NEUTRAL; if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(fields[7].GetUInt8())) - if (raceEntry->TeamID == 1) - guildTeam = TEAM_HORDE; + guildTeam = (TeamId)raceEntry->TeamID; LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment); _guildSettings[guildId] = settings; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index bad38c91e79..9197ea15b3d 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -67,7 +67,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit) WorldPacket data(SMSG_AUCTION_HELLO, 12); data << guid; - data << uint32(ahEntry->houseId); + data << uint32(ahEntry->ID); data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled SendPacket(&data); } diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 83302e3201f..ed4429ebaa3 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -158,7 +158,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) { HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(666); - data << uint32(holiday->Id); // m_ID + data << uint32(holiday->ID); // m_ID data << uint32(holiday->Region); // m_region, might be looping data << uint32(holiday->Looping); // m_looping, might be region data << uint32(holiday->Priority); // m_priority diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index d5d9f6e0b3a..f605e138ce3 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -359,17 +359,19 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CharacterCrea } // prevent character creating Expansion race without Expansion account - if (raceEntry->expansion > Expansion()) + uint8 raceExpansionRequirement = sObjectMgr->GetRaceExpansionRequirement(charCreate.CreateInfo->Race); + if (raceExpansionRequirement > Expansion()) { - TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, charCreate.CreateInfo->Race); + TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceExpansionRequirement, charCreate.CreateInfo->Race); SendCharCreate(CHAR_CREATE_EXPANSION); return; } // prevent character creating Expansion class without Expansion account - if (classEntry->expansion > Expansion()) + uint8 classExpansionRequirement = sObjectMgr->GetClassExpansionRequirement(charCreate.CreateInfo->Class); + if (classExpansionRequirement > Expansion()) { - TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, charCreate.CreateInfo->Class); + TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classExpansionRequirement, charCreate.CreateInfo->Class); SendCharCreate(CHAR_CREATE_EXPANSION_CLASS); return; } @@ -950,10 +952,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass())) { - if (cEntry->CinematicSequence) - pCurrChar->SendCinematicStart(cEntry->CinematicSequence); + if (cEntry->CinematicSequenceID) + pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID); else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace())) - pCurrChar->SendCinematicStart(rEntry->CinematicSequence); + pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID); // send new char string if not empty if (!sWorld->GetNewCharString().empty()) @@ -1335,17 +1337,17 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); - if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->getRace() || bs_hair->gender != _player->getGender()) + if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->getGender()) return; BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair); - if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->getRace() || bs_facialHair->gender != _player->getGender()) + if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->getGender()) return; BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor); - if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender())) + if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->getGender())) return; GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f); @@ -1361,7 +1363,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) return; } - uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); + uint32 cost = _player->GetBarberShopCost(bs_hair->Data, Color, bs_facialHair->Data, bs_skinColor); // 0 - ok // 1, 3 - not enough money @@ -1377,11 +1379,11 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) _player->ModifyMoney(-int64(cost)); // it isn't free _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost); - _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id)); + _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->Data)); _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color)); - _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->hair_id)); + _player->SetByteValue(PLAYER_BYTES_2, 0, uint8(bs_facialHair->Data)); if (bs_skinColor) - _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id)); + _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->Data)); _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); @@ -1403,7 +1405,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData) { if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) { - _player->RemoveAurasDueToSpell(gp->SpellId); + _player->RemoveAurasDueToSpell(gp->SpellID); _player->SetGlyph(slot, 0); _player->SendTalentsInfoData(false); } @@ -2123,28 +2125,28 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // new team if (team == TEAM_ALLIANCE) { - uint32 bitIndex = htitleInfo->bit_index; - uint32 index = bitIndex / 32; - uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (atitleInfo->bit_index % 32); + uint32 maskID = htitleInfo->MaskID; + uint32 index = maskID / 32; + uint32 old_flag = 1 << (maskID % 32); + uint32 new_flag = 1 << (atitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[atitleInfo->bit_index / 32] |= new_flag; + knownTitles[atitleInfo->MaskID / 32] |= new_flag; } } else { - uint32 bitIndex = atitleInfo->bit_index; - uint32 index = bitIndex / 32; - uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (htitleInfo->bit_index % 32); + uint32 maskID = atitleInfo->MaskID; + uint32 index = maskID / 32; + uint32 old_flag = 1 << (maskID % 32); + uint32 new_flag = 1 << (htitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[htitleInfo->bit_index / 32] |= new_flag; + knownTitles[htitleInfo->MaskID / 32] |= new_flag; } } @@ -2218,10 +2220,10 @@ void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/) if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass())) { - if (classEntry->CinematicSequence) - _player->SendCinematicStart(classEntry->CinematicSequence); + if (classEntry->CinematicSequenceID) + _player->SendCinematicStart(classEntry->CinematicSequenceID); else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace())) - _player->SendCinematicStart(raceEntry->CinematicSequence); + _player->SendCinematicStart(raceEntry->CinematicSequenceID); } } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2798a81a7c5..a2fc248bb61 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -741,7 +741,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) if (!em) return; - uint32 emote_anim = em->textid; + uint32 emote_anim = em->EmoteID; switch (emote_anim) { diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 677de370e34..f6566044278 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -829,7 +829,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) return; } - uint32 price = slotEntry->price; + uint32 price = slotEntry->Cost; if (!_player->HasEnoughMoney(uint64(price))) { @@ -1123,19 +1123,19 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) } // tried to put normal gem in meta socket - if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META) + if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->Type != SOCKET_COLOR_META) return; // tried to put meta gem in normal socket - if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META) + if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->Type == SOCKET_COLOR_META) return; // tried to put normal gem in cogwheel socket - if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->color != SOCKET_COLOR_COGWHEEL) + if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->Type != SOCKET_COLOR_COGWHEEL) return; // tried to put cogwheel gem in normal socket - if (itemProto->Socket[i].Color != SOCKET_COLOR_COGWHEEL && GemProps[i]->color == SOCKET_COLOR_COGWHEEL) + if (itemProto->Socket[i].Color != SOCKET_COLOR_COGWHEEL && GemProps[i]->Type == SOCKET_COLOR_COGWHEEL) return; } @@ -1143,7 +1143,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) uint32 OldEnchants[MAX_GEM_SOCKETS]; for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments { - GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; + GemEnchants[i] = (GemProps[i]) ? GemProps[i]->EnchantID : 0; OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i)); } @@ -1176,7 +1176,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j])) { - if (iGemProto->ItemId == enchantEntry->GemID) + if (iGemProto->ItemId == enchantEntry->SRCItemID) { _player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL); return; @@ -1205,13 +1205,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { // existing gem if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j])) - if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID)) + if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->SRCItemID)) if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory) ++limit_newcount; } } - if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->maxCount) + if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->Quantity) { _player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL); return; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index ce7cdad7247..44c51800c57 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -810,7 +810,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) return; } - bodyItem->SetText(mailTemplateEntry->content); + bodyItem->SetText(mailTemplateEntry->Body_lang); } else bodyItem->SetText(m->body); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 6a5a1267154..b28068538ce 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -863,24 +863,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) return; } - if (player->GetMapId() != atEntry->mapid) + if (player->GetMapId() != atEntry->MapID) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->mapid, player->GetMapId(), triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->MapID, player->GetMapId(), triggerId); return; } // delta is safe radius const float delta = 5.0f; - if (atEntry->radius > 0) + if (atEntry->Radius > 0) { // if we have radius check it - float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z); - if (dist > atEntry->radius + delta) + float dist = player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z); + if (dist > atEntry->Radius + delta) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->radius, dist, triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->Radius, dist, triggerId); return; } } @@ -892,26 +892,26 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) // is-in-cube check and we have to calculate only one point instead of 4 // 2PI = 360°, keep in mind that ingame orientation is counter-clockwise - double rotation = 2 * M_PI - atEntry->box_orientation; + double rotation = 2 * M_PI - atEntry->BoxYaw; double sinVal = std::sin(rotation); double cosVal = std::cos(rotation); - float playerBoxDistX = player->GetPositionX() - atEntry->x; - float playerBoxDistY = player->GetPositionY() - atEntry->y; + float playerBoxDistX = player->GetPositionX() - atEntry->Pos.X; + float playerBoxDistY = player->GetPositionY() - atEntry->Pos.Y; - float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal); - float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal); + float rotPlayerX = float(atEntry->Pos.X + playerBoxDistX * cosVal - playerBoxDistY*sinVal); + float rotPlayerY = float(atEntry->Pos.Y + playerBoxDistY * cosVal + playerBoxDistX*sinVal); // box edges are parallel to coordiante axis, so we can treat every dimension independently :D - float dz = player->GetPositionZ() - atEntry->z; - float dx = rotPlayerX - atEntry->x; - float dy = rotPlayerY - atEntry->y; - if ((std::fabs(dx) > atEntry->box_x / 2 + delta) || - (std::fabs(dy) > atEntry->box_y / 2 + delta) || - (std::fabs(dz) > atEntry->box_z / 2 + delta)) + float dz = player->GetPositionZ() - atEntry->Pos.Z; + float dx = rotPlayerX - atEntry->Pos.X; + float dy = rotPlayerY - atEntry->Pos.Y; + if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) || + (std::fabs(dy) > atEntry->BoxWidth / 2 + delta) || + (std::fabs(dz) > atEntry->BoxHeight / 2 + delta)) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->box_x / 2, atEntry->box_y / 2, atEntry->box_z / 2, rotPlayerX, rotPlayerY, dz, triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->BoxLength / 2, atEntry->BoxWidth / 2, atEntry->BoxHeight / 2, rotPlayerX, rotPlayerY, dz, triggerId); return; } } @@ -931,7 +931,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) { // set resting flag we are in the inn player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); - player->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z); + player->InnEnter(time(NULL), atEntry->MapID, atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z); player->SetRestType(REST_TYPE_IN_TAVERN); if (sWorld->IsFFAPvPRealm()) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index eebccd7408a..21ef1fc6ae0 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -158,14 +158,14 @@ void WorldSession::HandleMoveWorldportAckOpcode() if (mInstance) { Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid()); - if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID, diff)) + if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->ID, diff)) { if (mapDiff->resetTime) { - if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID, diff)) + if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->ID, diff)) { uint32 timeleft = uint32(timeReset - time(NULL)); - GetPlayer()->SendInstanceResetWarning(mEntry->MapID, diff, timeleft); + GetPlayer()->SendInstanceResetWarning(mEntry->ID, diff, timeleft); } } } diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 865dfd15bb4..1f88585b5ae 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -251,14 +251,14 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket& /*recvData*/) // search entrance map for proper show entrance if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapid)) { - if (corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) + if (corpseMapEntry->IsDungeon() && corpseMapEntry->CorpseMapID >= 0) { // if corpse map have entrance - if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->entrance_map)) + if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->CorpseMapID)) { - mapid = corpseMapEntry->entrance_map; - x = corpseMapEntry->entrance_x; - y = corpseMapEntry->entrance_y; + mapid = corpseMapEntry->CorpseMapID; + x = corpseMapEntry->CorpsePos.X; + y = corpseMapEntry->CorpsePos.Y; z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT); } } diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index f739c0f35dd..9aef1b62f7c 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -96,7 +96,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance { // initialize reset time // for normal instances if no creatures are killed the instance will reset in two hours - if (entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL) + if (entry->IsRaid() || difficulty > DUNGEON_DIFFICULTY_NORMAL) resetTime = GetResetTimeFor(mapId, difficulty); else { @@ -213,7 +213,7 @@ time_t InstanceSave::GetResetTimeForDB() { // only save the reset time for normal instances const MapEntry* entry = sMapStore.LookupEntry(GetMapId()); - if (!entry || entry->map_type == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC) + if (!entry || entry->IsRaid() || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC) return 0; else return GetResetTime(); diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index bb02b114e48..a8255d62777 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -600,11 +600,11 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi DungeonEncounter const* encounter = *itr; if (encounter->creditType == type && encounter->creditEntry == creditEntry) { - completedEncounters |= 1 << encounter->dbcEntry->encounterIndex; + completedEncounters |= 1 << encounter->dbcEntry->OrderIndex; if (encounter->lastEncounterDungeon) { dungeonId = encounter->lastEncounterDungeon; - TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName, dungeonId); + TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->Name_lang, dungeonId); break; } } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 6d41d669dcf..bde2f17b132 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1568,7 +1568,7 @@ void LoadLootTemplates_Disenchant() if (!disenchant) continue; - uint32 lootid = disenchant->Id; + uint32 lootid = disenchant->ID; if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Disenchant.ReportNonExistingId(lootid); else diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index d18244a05bd..16a8f110a15 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2038,7 +2038,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R { if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(_liquidEntry[idx])) { - entry = liquidEntry->Id; + entry = liquidEntry->ID; type &= MAP_LIQUID_TYPE_DARK_WATER; uint32 liqTypeIdx = liquidEntry->Type; if (entry < 21) @@ -2272,7 +2272,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const areaflag = gmap->getArea(x, y); // this used while not all *.map files generated (instances) else - areaflag = GetAreaFlagByMapId(i_mapEntry->MapID); + areaflag = GetAreaFlagByMapId(i_mapEntry->ID); } if (isOutdoors) @@ -2470,7 +2470,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const char const* Map::GetMapName() const { - return i_mapEntry ? i_mapEntry->name : "UNNAMEDMAP\x0"; + return i_mapEntry ? i_mapEntry->MapName_lang : "UNNAMEDMAP\x0"; } void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellCoord cellpair) @@ -3212,7 +3212,7 @@ uint32 InstanceMap::GetMaxPlayers() const if (mapDiff && mapDiff->maxPlayers) return mapDiff->maxPlayers; - return GetEntry()->maxPlayers; + return GetEntry()->MaxPlayers; } uint32 InstanceMap::GetMaxResetDelay() const diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index cfd3328231b..091fbb95aa5 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -321,7 +321,7 @@ class Map : public GridRefManager<NGridType> } time_t GetGridExpiry(void) const { return i_gridExpiry; } - uint32 GetId(void) const { return i_mapEntry->MapID; } + uint32 GetId(void) const { return i_mapEntry->ID; } static bool ExistMap(uint32 mapid, int gx, int gy); static bool ExistVMap(uint32 mapid, int gx, int gy); diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 498c669ba01..8dfa4449e12 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -227,16 +227,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); - - uint8 spawnMode; - - if (bracketEntry) - spawnMode = bracketEntry->difficulty; - else - spawnMode = REGULAR_DIFFICULTY; - - BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode); + BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, REGULAR_DIFFICULTY); ASSERT(map->IsBattlegroundOrArena()); map->SetBG(bg); bg->SetBgMap(map); diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 9297e2a3d6a..ac9e5918442 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -135,7 +135,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) Difficulty targetDifficulty, requestedDifficulty; targetDifficulty = requestedDifficulty = player->GetDifficulty(entry->IsRaid()); // Get the highest available difficulty if current setting is higher than the instance allows - MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty); + MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty); if (!mapDiff) { player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, requestedDifficulty); @@ -146,7 +146,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (player->IsGameMaster()) return true; - char const* mapName = entry->name; + char const* mapName = entry->MapName_lang; Group* group = player->GetGroup(); if (entry->IsRaid()) diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index b2b029e1df2..359a8f3946a 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -86,13 +86,13 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const uint32 classMask = _player->getClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) - return factionEntry->BaseRepValue[i]; + return factionEntry->ReputationBase[i]; } // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0 @@ -140,11 +140,11 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con uint32 classMask = _player->getClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) return factionEntry->ReputationFlags[i]; } @@ -263,11 +263,11 @@ void ReputationMgr::Initialize() { FactionEntry const* factionEntry = sFactionStore.LookupEntry(i); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { FactionState newFaction; newFaction.ID = factionEntry->ID; - newFaction.ReputationListID = factionEntry->reputationListID; + newFaction.ReputationListID = factionEntry->ReputationIndex; newFaction.Standing = 0; newFaction.Flags = GetDefaultStateFlags(factionEntry); newFaction.needSend = true; @@ -309,12 +309,12 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi // check for sub-factions that receive spillover SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID); // if has no sub-factions, check for factions with same parent - if (!flist && factionEntry->team && factionEntry->spilloverRateOut != 0.0f) + if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionModOut != 0.0f) { - spillOverRepOut *= factionEntry->spilloverRateOut; - if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team)) + spillOverRepOut *= factionEntry->ParentFactionModOut; + if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->ParentFactionID)) { - FactionStateList::iterator parentState = _factions.find(parent->reputationListID); + FactionStateList::iterator parentState = _factions.find(parent->ReputationIndex); // some team factions have own reputation standing, in this case do not spill to other sub-factions if (parentState != _factions.end() && (parentState->second.Flags & FACTION_FLAG_SPECIAL)) { @@ -322,7 +322,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } else // spill to "sister" factions { - flist = GetFactionTeamList(factionEntry->team); + flist = GetFactionTeamList(factionEntry->ParentFactionID); } } } @@ -333,9 +333,9 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi { if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr)) { - if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn)) + if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCapIn)) continue; - int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn); + int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionModIn); if (spilloverRep != 0 || !incremental) res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental); } @@ -344,7 +344,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } // spillover done, update faction itself - FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex); if (faction != _factions.end()) { res = SetOneFactionReputation(factionEntry, standing, incremental); @@ -356,7 +356,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental) { - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr != _factions.end()) { int32 BaseRep = GetBaseReputation(factionEntry); @@ -402,23 +402,23 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in return false; } -void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry) +void ReputationMgr::SetVisible(FactionTemplateEntry const* factionTemplateEntry) { - if (!factionTemplateEntry->faction) + if (!factionTemplateEntry->Faction) return; - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) // Never show factions of the opposing team - if (!(factionEntry->BaseRepRaceMask[1] & _player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom)) + if (!(factionEntry->ReputationRaceMask[1] & _player->getRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom)) SetVisible(factionEntry); } void ReputationMgr::SetVisible(FactionEntry const* factionEntry) { - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) return; - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr == _factions.end()) return; @@ -519,9 +519,9 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) Field* fields = result->Fetch(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt16()); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { - FactionState* faction = &_factions[factionEntry->reputationListID]; + FactionState* faction = &_factions[factionEntry->ReputationIndex]; // update standing to current faction->Standing = fields[1].GetInt32(); diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index b624bc95011..68f6ae6ca0b 100644 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -86,7 +86,7 @@ class ReputationMgr FactionState const* GetState(FactionEntry const* factionEntry) const { - return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : NULL; + return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : NULL; } FactionState const* GetState(RepListID id) const @@ -111,7 +111,7 @@ class ReputationMgr ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const { - ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->faction); + ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->Faction); return forceItr != _forcedReactions.end() ? &forceItr->second : NULL; } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 4d4ef75ba35..ac0b5bbf2e6 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -513,7 +513,7 @@ void ScriptMgr::OnGroupRateCalculation(float& rate, uint32 count, bool isRaid) MapEntry const* C = I->second->GetEntry(); \ if (!C) \ continue; \ - if (C->MapID == V->GetId()) \ + if (C->ID == V->GetId()) \ { #define SCR_MAP_END \ @@ -925,7 +925,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) ASSERT(player); ASSERT(trigger); - GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false); + GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->ID), tmpscript, false); return tmpscript->OnTrigger(player, trigger); } diff --git a/src/server/game/Server/Packets/CharacterPackets.cpp b/src/server/game/Server/Packets/CharacterPackets.cpp index 7b36d6e0b5d..7f6fefbf058 100644 --- a/src/server/game/Server/Packets/CharacterPackets.cpp +++ b/src/server/game/Server/Packets/CharacterPackets.cpp @@ -113,7 +113,7 @@ WorldPackets::Character::CharEnumResult::CharacterInfo::CharacterInfo(Field* fie if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)) { - VisualItems[slot].DisplayEnchantId = enchant->aura_id; + VisualItems[slot].DisplayEnchantId = enchant->ItemVisual; break; } } diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index e8a89039031..4d9800acedd 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -122,7 +122,7 @@ void LoadSkillDiscoveryTable() } for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); + SkillDiscoveryStore[-int32(_spell_idx->second->SkillLine)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); } else { @@ -164,7 +164,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) return 0; SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); - uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0); + uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->SkillLine) : uint32(0); float full_chance = 0; for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cb7df6c2650..4e31af725a9 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -476,10 +476,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // default amount calculation int32 amount = 0; - if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusMultiplier, 0.0f)) + if (!(m_spellInfo->AttributesEx8 & SPELL_ATTR8_MASTERY_SPECIALIZATION) || G3D::fuzzyEq(m_spellInfo->Effects[m_effIndex].BonusCoefficient, 0.0f)) amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); else if (caster && caster->GetTypeId() == TYPEID_PLAYER) - amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusMultiplier); + amount = int32(caster->GetFloatValue(PLAYER_MASTERY) * m_spellInfo->Effects[m_effIndex].BonusCoefficient); // check item enchant aura cast if (!amount && caster) @@ -498,13 +498,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) { for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++) { - SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]); + SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]); if (pEnchant) { for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++) - if (pEnchant->spellid[t] == m_spellInfo->Id) + if (pEnchant->EffectSpellID[t] == m_spellInfo->Id) { - amount = uint32((item_rand_suffix->prefix[k] * castItem->GetItemSuffixFactor()) / 10000); + amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000); break; } } @@ -557,7 +557,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) case SPELL_AURA_MOUNTED: if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB()))) { - amount = mountCapability->Id; + amount = mountCapability->ID; m_canBeRecalculated = false; } break; @@ -604,15 +604,15 @@ int32 AuraEffect::CalculateAmount(Unit* caster) void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/) { - m_amplitude = m_spellInfo->Effects[m_effIndex].Amplitude; + m_period = m_spellInfo->Effects[m_effIndex].ApplyAuraPeriod; // prepare periodics switch (GetAuraType()) { case SPELL_AURA_OBS_MOD_POWER: // 3 spells have no amplitude set - if (!m_amplitude) - m_amplitude = 1 * IN_MILLISECONDS; + if (!m_period) + m_period = 1 * IN_MILLISECONDS; case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_OBS_MOD_HEALTH: @@ -631,7 +631,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru break; } - GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_amplitude); + GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_period); if (!m_isPeriodic) return; @@ -639,11 +639,11 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru Player* modOwner = caster ? caster->GetSpellModOwner() : NULL; // Apply casting time mods - if (m_amplitude) + if (m_period) { // Apply periodic time mod if (modOwner) - modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_amplitude); + modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_period); if (caster) { @@ -651,17 +651,17 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru if (m_spellInfo->IsChanneled()) { if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - caster->ModSpellCastTime(m_spellInfo, m_amplitude); + caster->ModSpellCastTime(m_spellInfo, m_period); } else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); + m_period = int32(m_period * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); } } if (load) // aura loaded from db { - m_tickNumber = m_amplitude ? GetBase()->GetDuration() / m_amplitude : 0; - m_periodicTimer = m_amplitude ? GetBase()->GetDuration() % m_amplitude : 0; + m_tickNumber = m_period ? GetBase()->GetDuration() / m_period : 0; + m_periodicTimer = m_period ? GetBase()->GetDuration() % m_period : 0; if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY) ++m_tickNumber; } @@ -675,8 +675,8 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru { m_periodicTimer = 0; // Start periodic on next tick or at aura apply - if (m_amplitude && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)) - m_periodicTimer += m_amplitude; + if (m_period && !(m_spellInfo->AttributesEx5 & SPELL_ATTR5_START_PERIODIC_AT_APPLY)) + m_periodicTimer += m_period; } } } @@ -859,7 +859,7 @@ void AuraEffect::Update(uint32 diff, Unit* caster) ++m_tickNumber; // update before tick (aura can be removed in TriggerSpell or PeriodicTick calls) - m_periodicTimer += m_amplitude - diff; + m_periodicTimer += m_period - diff; UpdatePeriodic(caster); std::list<AuraApplication*> effectApplications; @@ -1128,7 +1128,7 @@ void AuraEffect::CleanupTriggeredSpells(Unit* target) // needed for spell 43680, maybe others /// @todo is there a spell flag, which can solve this in a more sophisticated way? if (m_spellInfo->Effects[GetEffIndex()].ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL && - uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].Amplitude) + uint32(m_spellInfo->GetDuration()) == m_spellInfo->Effects[GetEffIndex()].ApplyAuraPeriod) return; target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID()); @@ -1250,12 +1250,12 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const { if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId)) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellID); if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) continue; if (spellInfo->Stances & (1 << (GetMiscValue() - 1))) - target->CastSpell(target, glyph->SpellId, true, NULL, this); + target->CastSpell(target, glyph->SpellID, true, NULL, this); } } } @@ -1902,12 +1902,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i) { - if (!shapeInfo->stanceSpell[i]) + if (!shapeInfo->PresetSpellID[i]) continue; if (apply) - target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]); + target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]); else - target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]); + target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]); } } } @@ -4596,7 +4596,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod if (target->GetTypeId() != TYPEID_PLAYER) return; - flag96 mask; + flag128 mask; Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE); for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask; @@ -4604,6 +4604,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]); target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+1, mask[1]); target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+2, mask[2]); + target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1+3, mask[3]); } void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -5293,7 +5294,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, overrideId); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->AddTemporarySpell(spellId); } else @@ -5301,7 +5302,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 0); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->RemoveTemporarySpell(spellId); } } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index d07885aaa83..22571f4851e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -47,7 +47,7 @@ class AuraEffect uint32 GetId() const { return m_spellInfo->Id; } uint32 GetEffIndex() const { return m_effIndex; } int32 GetBaseAmount() const { return m_baseAmount; } - int32 GetAmplitude() const { return m_amplitude; } + int32 GetPeriod() const { return m_period; } int32 GetMiscValueB() const { return m_spellInfo->Effects[m_effIndex].MiscValueB; } int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; } @@ -81,8 +81,8 @@ class AuraEffect void UpdatePeriodic(Unit* caster); uint32 GetTickNumber() const { return m_tickNumber; } - int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;} - void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;} + int32 GetTotalTicks() const { return m_period ? (GetBase()->GetMaxDuration() / m_period) : 1;} + void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_period; m_tickNumber = 0;} bool IsPeriodic() const { return m_isPeriodic; } void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; } @@ -112,7 +112,7 @@ class AuraEffect SpellModifier* m_spellmod; int32 m_periodicTimer; - int32 m_amplitude; + int32 m_period; uint32 m_tickNumber; uint8 const m_effIndex; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d0c40f2bb2b..67df56d892e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -781,14 +781,14 @@ void Aura::RefreshTimers() bool resetPeriodic = true; if (m_spellInfo->AttributesEx8 & SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER) { - int32 minAmplitude = m_maxDuration; + int32 minPeriod = m_maxDuration; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (AuraEffect const* eff = GetEffect(i)) - if (int32 ampl = eff->GetAmplitude()) - minAmplitude = std::min(ampl, minAmplitude); + if (int32 period = eff->GetPeriod()) + minPeriod = std::min(period, minPeriod); // If only one tick remaining, roll it over into new duration - if (GetDuration() <= minAmplitude) + if (GetDuration() <= minPeriod) { m_maxDuration += GetDuration(); resetPeriodic = false; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2dc6aa3f7a7..7781e4fcc0c 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1451,7 +1451,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli void Spell::SelectImplicitChainTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask) { - uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTarget; + uint32 maxTargets = m_spellInfo->Effects[effIndex].ChainTargets; if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this); @@ -2626,8 +2626,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA duration = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (AuraEffect const* eff = m_spellAura->GetEffect(i)) - if (int32 amplitude = eff->GetAmplitude()) // amplitude is hastened by UNIT_MOD_CAST_SPEED - duration = std::max(std::max(origDuration / amplitude, 1) * amplitude, duration); + if (int32 period = eff->GetPeriod()) // period is hastened by UNIT_MOD_CAST_SPEED + duration = std::max(std::max(origDuration / period, 1) * period, duration); // if there is no periodic effect if (!duration) @@ -4546,7 +4546,7 @@ void Spell::TakeRunePower(bool didHit) // you can gain some runic power when use runes if (didHit) - if (int32 rp = int32(runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME))) + if (int32 rp = int32(runeCostData->RunePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME))) player->ModifyPower(POWER_RUNIC_POWER, int32(rp)); } @@ -4815,7 +4815,7 @@ SpellCastResult Spell::CheckCast(bool strict) { if (m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraState), m_spellInfo, m_caster)) return SPELL_FAILED_CASTER_AURASTATE; - if (m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraStateNot), m_spellInfo, m_caster)) + if (m_spellInfo->ExcludeCasterAuraState && m_caster->HasAuraState(AuraStateType(m_spellInfo->ExcludeCasterAuraState), m_spellInfo, m_caster)) return SPELL_FAILED_CASTER_AURASTATE; // Note: spell 62473 requres casterAuraSpell = triggering spell @@ -5095,7 +5095,7 @@ SpellCastResult Spell::CheckCast(bool strict) { uint32 glyphId = m_spellInfo->Effects[i].MiscValue; if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyphId)) - if (m_caster->HasAura(gp->SpellId)) + if (m_caster->HasAura(gp->SpellID)) return SPELL_FAILED_UNIQUE_GLYPH; break; } @@ -5476,7 +5476,7 @@ SpellCastResult Spell::CheckCast(bool strict) InstanceTemplate const* it = sObjectMgr->GetInstanceTemplate(m_caster->GetMapId()); if (it) allowMount = it->AllowMount; - if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->AreaGroupId) + if (m_caster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->RequiredAreasID) return SPELL_FAILED_NO_MOUNTS_ALLOWED; if (m_caster->IsInDisallowedMountForm()) @@ -5812,7 +5812,7 @@ SpellCastResult Spell::CheckRange(bool strict) if (m_spellInfo->RangeEntry->ID == 1) return SPELL_CAST_OK; - range_type = m_spellInfo->RangeEntry->type; + range_type = m_spellInfo->RangeEntry->Flags; } Unit* target = m_targets.GetUnitTarget(); @@ -6132,7 +6132,7 @@ SpellCastResult Spell::CheckItems() { for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - switch (enchantEntry->type[s]) + switch (enchantEntry->Effect[s]) { case ITEM_ENCHANTMENT_TYPE_USE_SPELL: if (isItemUsable) @@ -6158,7 +6158,7 @@ SpellCastResult Spell::CheckItems() { if (!enchantEntry) return SPELL_FAILED_ERROR; - if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) + if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND) return SPELL_FAILED_NOT_TRADEABLE; } break; @@ -6175,7 +6175,7 @@ SpellCastResult Spell::CheckItems() SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) return SPELL_FAILED_ERROR; - if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND) + if (pEnchant->Flags & ENCHANTMENT_CAN_SOULBOUND) return SPELL_FAILED_NOT_TRADEABLE; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 5dcdcc9fcea..c383ba0d51f 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2447,12 +2447,12 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (!rcEntry) return; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier); + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID); if (!tier) return; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->MaxSkill[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->Value[damage - 1]); } void Spell::EffectPlayMovie(SpellEffIndex effIndex) @@ -2571,7 +2571,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) bool add_socket = false; for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i) { - if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) + if (enchant->Effect[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) { add_socket = true; break; @@ -4026,7 +4026,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) { if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) { - if (newGlyphProperties->TypeFlags != newGlyphSlot->TypeFlags) + if (newGlyphProperties->Type != newGlyphSlot->Type) { SendCastResult(SPELL_FAILED_INVALID_GLYPH); return; // glyph slot mismatch @@ -4038,12 +4038,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) { if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) { - player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellID); player->SetGlyph(m_glyphIndex, 0); } } - player->CastSpell(m_caster, newGlyphProperties->SpellId, true); + player->CastSpell(m_caster, newGlyphProperties->SpellID, true); player->SetGlyph(m_glyphIndex, newGlyph); player->SendTalentsInfoData(false); } @@ -4052,7 +4052,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) { if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) { - player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellID); player->SetGlyph(m_glyphIndex, 0); player->SendTalentsInfoData(false); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a5804ffd648..9fc99e431d3 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -346,30 +346,31 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con _spellInfo = spellInfo; _effIndex = _effect ? _effect->EffectIndex : effIndex; Effect = _effect ? _effect->Effect : 0; - ApplyAuraName = _effect ? _effect->EffectApplyAuraName : 0; - Amplitude = _effect ? _effect->EffectAmplitude : 0; + ApplyAuraName = _effect ? _effect->EffectAura : 0; + ApplyAuraPeriod = _effect ? _effect->EffectAuraPeriod : 0; DieSides = _effect ? _effect->EffectDieSides : 0; RealPointsPerLevel = _effect ? _effect->EffectRealPointsPerLevel : 0.0f; BasePoints = _effect ? _effect->EffectBasePoints : 0; - PointsPerComboPoint = _effect ? _effect->EffectPointsPerComboPoint : 0.0f; - ValueMultiplier = _effect ? _effect->EffectValueMultiplier : 0.0f; - DamageMultiplier = _effect ? _effect->EffectDamageMultiplier : 0.0f; - BonusMultiplier = _effect ? _effect->EffectBonusMultiplier : 0.0f; + PointsPerResource = _effect ? _effect->EffectPointsPerResource : 0.0f; + Amplitude = _effect ? _effect->EffectAmplitude : 0.0f; + ChainAmplitude = _effect ? _effect->EffectChainAmplitude : 0.0f; + BonusCoefficient = _effect ? _effect->EffectBonusCoefficient : 0.0f; MiscValue = _effect ? _effect->EffectMiscValue : 0; MiscValueB = _effect ? _effect->EffectMiscValueB : 0; Mechanic = Mechanics(_effect ? _effect->EffectMechanic : 0); - TargetA = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetA : 0); - TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0); + TargetA = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[0] : 0); + TargetB = SpellImplicitTargetInfo(_effect ? _effect->ImplicitTarget[1] : 0); RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : NULL; MaxRadiusEntry = _effect && _effect->EffectRadiusMaxIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusMaxIndex) : NULL; - ChainTarget = _effect ? _effect->EffectChainTarget : 0; + ChainTargets = _effect ? _effect->EffectChainTargets : 0; ItemType = _effect ? _effect->EffectItemType : 0; TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; - SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0); + SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag128(); ImplicitTargetConditions = NULL; - ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f; - DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f; - ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f; + // TODO: 6.x these values are no longer in dbc + ScalingMultiplier = /*scaling ? scaling->Multiplier[_effIndex] :*/ 0.0f; + DeltaScalingMultiplier = /*scaling ? scaling->RandomMultiplier[_effIndex] :*/ 0.0f; + ComboScalingMultiplier = /*scaling ? scaling->OtherMultiplier[_effIndex] :*/ 0.0f; } bool SpellEffectInfo::IsEffect() const @@ -432,7 +433,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { float basePointsPerLevel = RealPointsPerLevel; int32 basePoints = bp ? *bp : BasePoints; - float comboDamage = PointsPerComboPoint; + float comboDamage = PointsPerResource; // base amount modification based on spell lvl vs caster lvl if (ScalingMultiplier != 0.0f) @@ -589,7 +590,7 @@ int32 SpellEffectInfo::CalcBaseValue(int32 value) const float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const { - float multiplier = ValueMultiplier; + float multiplier = Amplitude; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell); return multiplier; @@ -597,7 +598,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const { - float multiplier = DamageMultiplier; + float multiplier = ChainAmplitude; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplier, spell); return multiplier; @@ -863,50 +864,57 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects) { - Id = spellEntry->Id; - Attributes = spellEntry->Attributes; - AttributesEx = spellEntry->AttributesEx; - AttributesEx2 = spellEntry->AttributesEx2; - AttributesEx3 = spellEntry->AttributesEx3; - AttributesEx4 = spellEntry->AttributesEx4; - AttributesEx5 = spellEntry->AttributesEx5; - AttributesEx6 = spellEntry->AttributesEx6; - AttributesEx7 = spellEntry->AttributesEx7; - AttributesEx8 = spellEntry->AttributesEx8; - AttributesEx9 = spellEntry->AttributesEx9; - AttributesEx10 = spellEntry->AttributesEx10; + Id = spellEntry->ID; + + SpellName = spellEntry->Name_lang; + //Rank = spellEntry->Rank; + RuneCostID = spellEntry->RuneCostID; + //SpellDifficultyId = spellEntry->DifficultyID; + SpellScalingId = spellEntry->ScalingID; + SpellAuraOptionsId = spellEntry->AuraOptionsID; + SpellAuraRestrictionsId = spellEntry->AuraRestrictionsID; + SpellCastingRequirementsId = spellEntry->CastingRequirementsID; + SpellCategoriesId = spellEntry->CategoriesID; + SpellClassOptionsId = spellEntry->ClassOptionsID; + SpellCooldownsId = spellEntry->CooldownsID; + SpellEquippedItemsId = spellEntry->EquippedItemsID; + SpellInterruptsId = spellEntry->InterruptsID; + SpellLevelsId = spellEntry->LevelsID; + //SpellPowerId = spellEntry->PowerID; + SpellReagentsId = spellEntry->ReagentsID; + SpellShapeshiftId = spellEntry->ShapeshiftID; + SpellTargetRestrictionsId = spellEntry->TargetRestrictionsID; + SpellTotemsId = spellEntry->TotemsID; + SpellMiscId = spellEntry->MiscID; + + // SpellMiscEntry + SpellMiscEntry const* _misc = GetSpellMisc(); + Attributes = _misc ? _misc->Attributes : 0; + AttributesEx = _misc ? _misc->AttributesEx : 0; + AttributesEx2 = _misc ? _misc->AttributesExB : 0; + AttributesEx3 = _misc ? _misc->AttributesExC : 0; + AttributesEx4 = _misc ? _misc->AttributesExD : 0; + AttributesEx5 = _misc ? _misc->AttributesExE : 0; + AttributesEx6 = _misc ? _misc->AttributesExF : 0; + AttributesEx7 = _misc ? _misc->AttributesExG : 0; + AttributesEx8 = _misc ? _misc->AttributesExH : 0; + AttributesEx9 = _misc ? _misc->AttributesExI : 0; + AttributesEx10 = _misc ? _misc->AttributesExJ : 0; + AttributesEx11 = _misc ? _misc->AttributesExK : 0; + AttributesEx12 = _misc ? _misc->AttributesExL : 0; + AttributesEx13 = _misc ? _misc->AttributesExM : 0; + CastTimeEntry = _misc ? (_misc->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(_misc->CastingTimeIndex) : NULL) : NULL; + DurationEntry = _misc ? (_misc->DurationIndex ? sSpellDurationStore.LookupEntry(_misc->DurationIndex) : NULL) : NULL; + RangeEntry = _misc ? (_misc->RangeIndex ? sSpellRangeStore.LookupEntry(_misc->RangeIndex) : NULL) : NULL; + Speed = _misc ? _misc->Speed : 0; + SchoolMask = _misc ? _misc->SchoolMask : 0; AttributesCu = 0; - CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL; - DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL; - PowerType = spellEntry->powerType; - RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL; - Speed = spellEntry->speed; - + //PowerType = _misc ? _misc->powerType : 0; for (uint8 i = 0; i < 2; ++i) - SpellVisual[i] = spellEntry->SpellVisual[i]; - - SpellIconID = spellEntry->SpellIconID; - ActiveIconID = spellEntry->activeIconID; - SpellName = spellEntry->SpellName; - Rank = spellEntry->Rank; - SchoolMask = spellEntry->SchoolMask; - RuneCostID = spellEntry->runeCostID; - SpellDifficultyId = spellEntry->SpellDifficultyId; - SpellScalingId = spellEntry->SpellScalingId; - SpellAuraOptionsId = spellEntry->SpellAuraOptionsId; - SpellAuraRestrictionsId = spellEntry->SpellAuraRestrictionsId; - SpellCastingRequirementsId = spellEntry->SpellCastingRequirementsId; - SpellCategoriesId = spellEntry->SpellCategoriesId; - SpellClassOptionsId = spellEntry->SpellClassOptionsId; - SpellCooldownsId = spellEntry->SpellCooldownsId; - SpellEquippedItemsId = spellEntry->SpellEquippedItemsId; - SpellInterruptsId = spellEntry->SpellInterruptsId; - SpellLevelsId = spellEntry->SpellLevelsId; - SpellPowerId = spellEntry->SpellPowerId; - SpellReagentsId = spellEntry->SpellReagentsId; - SpellShapeshiftId = spellEntry->SpellShapeshiftId; - SpellTargetRestrictionsId = spellEntry->SpellTargetRestrictionsId; - SpellTotemsId = spellEntry->SpellTotemsId; + SpellVisual[i] = _misc ? _misc->SpellVisualID[i] : 0; + + SpellIconID = _misc ? _misc->SpellIconID : 0; + ActiveIconID = _misc ? _misc->ActiveIconID : 0; // SpellDifficultyEntry for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -918,46 +926,46 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe CastTimeMax = _scaling ?_scaling->CastTimeMax : 0; CastTimeMaxLevel = _scaling ? _scaling->CastTimeMaxLevel : 0; ScalingClass = _scaling ? _scaling->ScalingClass : 0; - CoefBase = _scaling ? _scaling->CoefBase : 0; - CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0; + CoefBase = _scaling ? _scaling->NerfFactor : 0; + CoefLevelBase = _scaling ? _scaling->NerfMaxLevel : 0; // SpellAuraOptionsEntry SpellAuraOptionsEntry const* _options = GetSpellAuraOptions(); - ProcFlags = _options ? _options->procFlags : 0; - ProcChance = _options ? _options->procChance : 0; - ProcCharges = _options ? _options->procCharges : 0; - StackAmount = _options ? _options->StackAmount : 0; + ProcFlags = _options ? _options->ProcTypeMask : 0; + ProcChance = _options ? _options->ProcChance : 0; + ProcCharges = _options ? _options->ProcCharges : 0; + StackAmount = _options ? _options->CumulativeAura : 0; // SpellAuraRestrictionsEntry SpellAuraRestrictionsEntry const* _aura = GetSpellAuraRestrictions(); CasterAuraState = _aura ? _aura->CasterAuraState : 0; TargetAuraState = _aura ? _aura->TargetAuraState : 0; - CasterAuraStateNot = _aura ? _aura->CasterAuraStateNot : 0; - TargetAuraStateNot = _aura ? _aura->TargetAuraStateNot : 0; - CasterAuraSpell = _aura ? _aura->casterAuraSpell : 0; - TargetAuraSpell = _aura ? _aura->targetAuraSpell : 0; - ExcludeCasterAuraSpell = _aura ? _aura->excludeCasterAuraSpell : 0; - ExcludeTargetAuraSpell = _aura ? _aura->excludeTargetAuraSpell : 0; + ExcludeCasterAuraState = _aura ? _aura->ExcludeCasterAuraState : 0; + ExcludeTargetAuraState = _aura ? _aura->ExcludeTargetAuraState : 0; + CasterAuraSpell = _aura ? _aura->CasterAuraSpell : 0; + TargetAuraSpell = _aura ? _aura->TargetAuraSpell : 0; + ExcludeCasterAuraSpell = _aura ? _aura->ExcludeCasterAuraSpell : 0; + ExcludeTargetAuraSpell = _aura ? _aura->ExcludeTargetAuraSpell : 0; // SpellCastingRequirementsEntry SpellCastingRequirementsEntry const* _castreq = GetSpellCastingRequirements(); RequiresSpellFocus = _castreq ? _castreq->RequiresSpellFocus : 0; FacingCasterFlags = _castreq ? _castreq->FacingCasterFlags : 0; - AreaGroupId = _castreq ? _castreq->AreaGroupId : -1; + RequiredAreasID = _castreq ? _castreq->RequiredAreasID : -1; // SpellCategoriesEntry SpellCategoriesEntry const* _categorie = GetSpellCategories(); CategoryEntry = _categorie ? sSpellCategoryStore.LookupEntry(_categorie->Category) : NULL; - Dispel = _categorie ? _categorie->Dispel : 0; + Dispel = _categorie ? _categorie->DispelType : 0; Mechanic = _categorie ? _categorie->Mechanic : 0; StartRecoveryCategory = _categorie ? _categorie->StartRecoveryCategory : 0; - DmgClass = _categorie ? _categorie->DmgClass : 0; + DmgClass = _categorie ? _categorie->DefenseType : 0; PreventionType = _categorie ? _categorie->PreventionType : 0; // SpellClassOptionsEntry SpellClassOptionsEntry const* _class = GetSpellClassOptions(); - SpellFamilyName = _class ? _class->SpellFamilyName : 0; - SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0); + SpellFamilyName = _class ? _class->SpellClassSet : 0; + SpellFamilyFlags = _class ? _class->SpellClassMask : flag128(0); // SpellCooldownsEntry SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns(); @@ -974,21 +982,22 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe // SpellInterruptsEntry SpellInterruptsEntry const* _interrupt = GetSpellInterrupts(); InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0; - AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0; - ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0; + // TODO: 6.x these flags have 2 parts + AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags[0] : 0; + ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags[0] : 0; // SpellLevelsEntry SpellLevelsEntry const* _levels = GetSpellLevels(); - MaxLevel = _levels ? _levels->maxLevel : 0; - BaseLevel = _levels ? _levels->baseLevel : 0; - SpellLevel = _levels ? _levels->spellLevel : 0; + MaxLevel = _levels ? _levels->MaxLevel : 0; + BaseLevel = _levels ? _levels->BaseLevel : 0; + SpellLevel = _levels ? _levels->SpellLevel : 0; // SpellPowerEntry SpellPowerEntry const* _power = GetSpellPower(); - ManaCost = _power ? _power->manaCost : 0; - ManaCostPerlevel = _power ? _power->manaCostPerlevel : 0; + ManaCost = _power ? _power->ManaCost : 0; + ManaCostPerlevel = _power ? _power->ManaCostPerLevel : 0; ManaCostPercentage = _power ? _power->ManaCostPercentage : 0; - ManaPerSecond = _power ? _power->manaPerSecond : 0; + ManaPerSecond = _power ? _power->ManaCostPerSecond : 0; // SpellReagentsEntry SpellReagentsEntry const* _reagents = GetSpellReagents(); @@ -999,8 +1008,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe // SpellShapeshiftEntry SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift(); - Stances = _shapeshift ? _shapeshift->Stances : 0; - StancesNot = _shapeshift ? _shapeshift->StancesNot : 0; + // TODO: 6.x these maks have 2 parts + Stances = _shapeshift ? _shapeshift->ShapeshiftMask[0] : 0; + StancesNot = _shapeshift ? _shapeshift->ShapeshiftExclude[0] : 0; // SpellTargetRestrictionsEntry SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions(); @@ -1026,7 +1036,7 @@ SpellInfo::~SpellInfo() uint32 SpellInfo::GetCategory() const { - return CategoryEntry ? CategoryEntry->Id : 0; + return CategoryEntry ? CategoryEntry->ID : 0; } bool SpellInfo::HasEffect(SpellEffects effect) const @@ -1131,10 +1141,10 @@ bool SpellInfo::IsAbilityLearnedWithProfession() const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { SkillLineAbilityEntry const* pAbility = _spell_idx->second; - if (!pAbility || pAbility->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + if (!pAbility || pAbility->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) continue; - if (pAbility->req_skill_value > 0) + if (pAbility->MinSkillLineRank > 0) return true; } @@ -1146,7 +1156,7 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - if (_spell_idx->second->skillId == uint32(skillType)) + if (_spell_idx->second->SkillLine == uint32(skillType)) return true; return false; @@ -1490,7 +1500,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form); return SPELL_CAST_OK; } - actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells + actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells } if (actAsShifted) @@ -1510,7 +1520,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const // Check if stance disables cast of not-stance spells // Example: cannot cast any other spells in zombie or ghoul form /// @todo Find a way to disable use of these spells clientside - if (shapeInfo && shapeInfo->flags1 & 0x400) + if (shapeInfo && shapeInfo->Flags & 0x400) { if (!(stanceMask & Stances)) return SPELL_FAILED_ONLY_SHAPESHIFT; @@ -1522,19 +1532,19 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player) const { // normal case - if (AreaGroupId > 0) + if (RequiredAreasID > 0) { bool found = false; - AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(AreaGroupId); + AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(RequiredAreasID); while (groupEntry) { for (uint8 i = 0; i < MAX_GROUP_AREA_IDS; ++i) - if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id) + if (groupEntry->AreaID[i] == zone_id || groupEntry->AreaID[i] == area_id) found = true; - if (found || !groupEntry->nextGroup) + if (found || !groupEntry->NextAreaID) break; // Try search in next group - groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup); + groupEntry = sAreaGroupStore.LookupEntry(groupEntry->NextAreaID); } if (!found) @@ -1546,7 +1556,7 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a { uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id); MapEntry const* mapEntry = sMapStore.LookupEntry(v_map); - if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent()) + if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent()) return SPELL_FAILED_INCORRECT_AREA; } @@ -1798,7 +1808,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; - if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster)) + if (ExcludeTargetAuraState && unitTarget->HasAuraState(AuraStateType(ExcludeTargetAuraState), this, caster)) return SPELL_FAILED_TARGET_AURASTATE; } @@ -1865,7 +1875,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const if (Effects[effIndex].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT) { SpellShapeshiftFormEntry const* shapeShiftFromEntry = sSpellShapeshiftFormStore.LookupEntry(Effects[effIndex].MiscValue); - if (shapeShiftFromEntry && (shapeShiftFromEntry->flags1 & 1) == 0) // unk flag + if (shapeShiftFromEntry && (shapeShiftFromEntry->Flags & 1) == 0) // unk flag checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED; break; } @@ -2168,7 +2178,7 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const return SPELL_SPECIFIC_STING; // only hunter aspects have this (but not all aspects in hunter family) - if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) + if (SpellFamilyFlags & flag96(0x00380000, 0x00440000, 0x00001010)) return SPELL_SPECIFIC_ASPECT; break; @@ -2238,8 +2248,8 @@ float SpellInfo::GetMinRange(bool positive) const if (!RangeEntry) return 0.0f; if (positive) - return RangeEntry->minRangeFriend; - return RangeEntry->minRangeHostile; + return RangeEntry->MinRangeFriend; + return RangeEntry->MinRangeHostile; } float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const @@ -2248,9 +2258,9 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const return 0.0f; float range; if (positive) - range = RangeEntry->maxRangeFriend; + range = RangeEntry->MaxRangeFriend; else - range = RangeEntry->maxRangeHostile; + range = RangeEntry->MaxRangeHostile; if (caster) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell); @@ -2317,8 +2327,8 @@ uint32 SpellInfo::GetMaxTicks() const case SPELL_AURA_PERIODIC_DAMAGE: case SPELL_AURA_PERIODIC_HEAL: case SPELL_AURA_PERIODIC_LEECH: - if (Effects[x].Amplitude != 0) - return DotDuration / Effects[x].Amplitude; + if (Effects[x].ApplyAuraPeriod != 0) + return DotDuration / Effects[x].ApplyAuraPeriod; break; } } @@ -2881,6 +2891,11 @@ SpellTotemsEntry const* SpellInfo::GetSpellTotems() const return SpellTotemsId ? sSpellTotemsStore.LookupEntry(SpellTotemsId) : NULL; } +SpellMiscEntry const* SpellInfo::GetSpellMisc() const +{ + return SpellMiscId ? sSpellMiscStore.LookupEntry(SpellMiscId) : NULL; +} + SpellAuraOptionsEntry const* SpellInfo::GetSpellAuraOptions() const { return SpellAuraOptionsId ? sSpellAuraOptionsStore.LookupEntry(SpellAuraOptionsId) : NULL; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index ea29eb1b00f..edf997db0e5 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -233,14 +233,14 @@ class SpellEffectInfo public: uint32 Effect; uint32 ApplyAuraName; - uint32 Amplitude; + uint32 ApplyAuraPeriod; int32 DieSides; float RealPointsPerLevel; int32 BasePoints; - float PointsPerComboPoint; - float ValueMultiplier; - float DamageMultiplier; - float BonusMultiplier; + float PointsPerResource; + float Amplitude; + float ChainAmplitude; + float BonusCoefficient; int32 MiscValue; int32 MiscValueB; Mechanics Mechanic; @@ -248,19 +248,19 @@ public: SpellImplicitTargetInfo TargetB; SpellRadiusEntry const* RadiusEntry; SpellRadiusEntry const* MaxRadiusEntry; - uint32 ChainTarget; + uint32 ChainTargets; uint32 ItemType; uint32 TriggerSpell; - flag96 SpellClassMask; + flag128 SpellClassMask; std::list<Condition*>* ImplicitTargetConditions; // SpellScalingEntry float ScalingMultiplier; float DeltaScalingMultiplier; float ComboScalingMultiplier; - SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0), - RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0), - BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0), + SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), ApplyAuraPeriod(0), DieSides(0), + RealPointsPerLevel(0), BasePoints(0), PointsPerResource(0), Amplitude(0), ChainAmplitude(0), + BonusCoefficient(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTargets(0), ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {} SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* effect); @@ -316,6 +316,9 @@ public: uint32 AttributesEx8; uint32 AttributesEx9; uint32 AttributesEx10; + uint32 AttributesEx11; + uint32 AttributesEx12; + uint32 AttributesEx13; uint32 AttributesCu; uint32 Stances; uint32 StancesNot; @@ -325,8 +328,8 @@ public: uint32 FacingCasterFlags; uint32 CasterAuraState; uint32 TargetAuraState; - uint32 CasterAuraStateNot; - uint32 TargetAuraStateNot; + uint32 ExcludeCasterAuraState; + uint32 ExcludeTargetAuraState; uint32 CasterAuraSpell; uint32 TargetAuraSpell; uint32 ExcludeCasterAuraSpell; @@ -370,10 +373,10 @@ public: uint32 MaxTargetLevel; uint32 MaxAffectedTargets; uint32 SpellFamilyName; - flag96 SpellFamilyFlags; + flag128 SpellFamilyFlags; uint32 DmgClass; uint32 PreventionType; - int32 AreaGroupId; + int32 RequiredAreasID; uint32 SchoolMask; uint32 SpellDifficultyId; uint32 SpellScalingId; @@ -391,6 +394,7 @@ public: uint32 SpellShapeshiftId; uint32 SpellTargetRestrictionsId; uint32 SpellTotemsId; + uint32 SpellMiscId; // SpellScalingEntry int32 CastTimeMin; int32 CastTimeMax; @@ -418,6 +422,7 @@ public: SpellScalingEntry const* GetSpellScaling() const; SpellShapeshiftEntry const* GetSpellShapeshift() const; SpellTotemsEntry const* GetSpellTotems() const; + SpellMiscEntry const* GetSpellMisc() const; SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects); ~SpellInfo(); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 46fac6340a8..cf25599cfaa 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -35,20 +35,20 @@ bool IsPrimaryProfessionSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_PROFESSION; } bool IsWeaponSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_WEAPON; } bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) { SkillLineAbilityMapBounds skillBounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr) - if (itr->second->skillId == skillId) + if (itr->second->SkillLine == skillId) return true; return false; @@ -466,9 +466,10 @@ void SpellMgr::SetSpellDifficultyId(uint32 spellId, uint32 id) mSpellDifficultySearcherMap[spellId] = id; } +// TODO: 6.x adapt to new spell diff system uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const { - if (!GetSpellInfo(spellId)) + /*if (!GetSpellInfo(spellId)) return spellId; if (!caster || !caster->GetMap() || !caster->GetMap()->IsDungeon()) @@ -506,6 +507,8 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]); return uint32(difficultyEntry->SpellID[mode]); + */ + return 0; } SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const @@ -2207,7 +2210,7 @@ void SpellMgr::LoadSkillLineAbilityMap() if (!SkillInfo) continue; - mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo)); + mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->SpellID, SkillInfo)); ++count; } @@ -2432,7 +2435,7 @@ void SpellMgr::LoadPetLevelupSpellMap() for (uint8 j = 0; j < 2; ++j) { - if (!creatureFamily->skillLine[j]) + if (!creatureFamily->SkillLine[j]) continue; for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k) @@ -2441,17 +2444,17 @@ void SpellMgr::LoadPetLevelupSpellMap() if (!skillLine) continue; - //if (skillLine->skillId != creatureFamily->skillLine[0] && - // (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1])) + //if (skillLine->skillId != creatureFamily->SkillLine[0] && + // (!creatureFamily->SkillLine[1] || skillLine->skillId != creatureFamily->SkillLine[1])) // continue; - if (skillLine->skillId != creatureFamily->skillLine[j]) + if (skillLine->SkillLine != creatureFamily->SkillLine[j]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - SpellInfo const* spell = GetSpellInfo(skillLine->spellId); + SpellInfo const* spell = GetSpellInfo(skillLine->SpellID); if (!spell) // not exist or triggered or talent continue; @@ -2543,7 +2546,7 @@ void SpellMgr::LoadPetDefaultSpells() int32 petSpellsId = -int32(itr->second.PetSpellDataId); PetDefaultSpellsEntry petDefSpells; for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j) - petDefSpells.spellid[j] = spellDataEntry->spellId[j]; + petDefSpells.spellid[j] = spellDataEntry->Spells[j]; if (LoadPetDefaultSpells_helper(&itr->second, petDefSpells)) { @@ -2813,7 +2816,7 @@ void SpellMgr::LoadSpellInfoStore() if (!effect) continue; - effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect; + effectsBySpell[effect->SpellID].effects[effect->EffectIndex] = effect; } for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) @@ -2951,10 +2954,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes() for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]); + SpellInfo* procInfo = _GetSpellInfo(enchant->EffectSpellID[s]); if (!procInfo) continue; @@ -3188,7 +3191,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->ProcCharges = 1; break; case 44544: // Fingers of Frost - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(685904631, 1151048, 0, 0); break; case 74396: // Fingers of Frost visual buff spellInfo->ProcCharges = 2; @@ -3212,7 +3215,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].MiscValue |= 1; break; case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster - spellInfo->Effects[EFFECT_0].Amplitude = 3000; + spellInfo->Effects[EFFECT_0].ApplyAuraPeriod = 3000; break; // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data // To prevent aura staying on target after talent unlearned @@ -3231,7 +3234,7 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2; - spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000); + spellInfo->Effects[EFFECT_1].SpellClassMask = flag128(0x00000000, 0x00004000, 0x00000000, 0x00000000); break; case 47569: // Improved Shadowform (Rank 1) // with this spell atrribute aura can be stacked several times @@ -3273,7 +3276,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00067801, 0x10820001, 0x00000801, 0x00000000); break; case 5176: // Wrath case 2912: // Starfire @@ -3294,22 +3297,22 @@ void SpellMgr::LoadSpellInfoCorrections() // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a) // this needs research on modifier applying rules, does not seem to be in Attributes fields - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000040, 0x00000000, 0x00000000, 0x00000000); break; case 64949: // Idol of the Flourishing Life - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x00000000, 0x02000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 34231: // Libram of the Lightbringer case 60792: // Libram of Tolerance case 64956: // Libram of the Resolute - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x80000000, 0x00000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 28851: // Libram of Light case 28853: // Libram of Divinity case 32403: // Blessed Book of Nagrand - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag128(0x40000000, 0x00000000, 0x00000000, 0x00000000); spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 45602: // Ride Carpet @@ -3540,7 +3543,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 71266: // Swarming Shadows case 72890: // Swarming Shadows - spellInfo->AreaGroupId = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel + spellInfo->RequiredAreasID = 0; // originally, these require area 4522, which is... outside of Icecrown Citadel break; case 70602: // Corruption case 48278: // Paralyze diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 0b351e310f4..ec435e0bb2f 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -277,11 +277,11 @@ public: if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale; + std::string name = target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang; if (name.empty()) continue; - char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -290,9 +290,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, localeNames[loc], knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, name.c_str(), localeNames[loc], knownStr, activeStr); } } @@ -566,7 +566,7 @@ public: { FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 162e1665177..c1f4f027c60 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -391,9 +391,9 @@ public: return false; } - if (!MapManager::IsValidMapCoord(at->mapid, at->x, at->y, at->z)) + if (!MapManager::IsValidMapCoord(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z)) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->x, at->y, at->mapid); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos.X, at->Pos.Y, at->MapID); handler->SetSentErrorMessage(true); return false; } @@ -408,7 +408,7 @@ public: else player->SaveRecallPosition(); - player->TeleportTo(at->mapid, at->x, at->y, at->z, player->GetOrientation()); + player->TeleportTo(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z, player->GetOrientation()); return true; } diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 60523428e6f..eb5be0950aa 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -152,7 +152,7 @@ public: ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass()); if (!classEntry) return true; - uint32 family = classEntry->spellfamily; + uint32 family = classEntry->SpellClassSet; for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) { @@ -160,7 +160,7 @@ public: if (!entry) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->SpellID); if (!spellInfo) continue; @@ -266,7 +266,7 @@ public: return false; } - if (petFamily->petTalentType < 0) // not hunter pet + if (petFamily->PetTalentType < 0) // not hunter pet { handler->SendSysMessage(LANG_WRONG_PET_TYPE); handler->SetSentErrorMessage(true); @@ -284,7 +284,7 @@ public: continue; // prevent learn talent for different family (cheating) - if (((1 << petFamily->petTalentType) & talentTabInfo->petTalentMask) == 0) + if (((1 << petFamily->PetTalentType) & talentTabInfo->petTalentMask) == 0) continue; // search highest talent rank @@ -352,10 +352,10 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) && - skillInfo->canLink) // only prof. with recipes have + if ((skillInfo->CategoryID == SKILL_CATEGORY_PROFESSION || skillInfo->CategoryID == SKILL_CATEGORY_SECONDARY) && + skillInfo->CanLink) // only prof. with recipes have { - HandleLearnSkillRecipesHelper(target, skillInfo->id); + HandleLearnSkillRecipesHelper(target, skillInfo->ID); } } @@ -395,12 +395,12 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && - skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) || - !skillInfo->canLink) // only prof with recipes have set + if ((skillInfo->CategoryID != SKILL_CATEGORY_PROFESSION && + skillInfo->CategoryID != SKILL_CATEGORY_SECONDARY) || + !skillInfo->CanLink) // only prof with recipes have set continue; - name = skillInfo->name; + name = skillInfo->DisplayName_lang; if (name.empty()) continue; @@ -413,10 +413,10 @@ public: if (!targetSkillInfo) return false; - HandleLearnSkillRecipesHelper(target, targetSkillInfo->id); + HandleLearnSkillRecipesHelper(target, targetSkillInfo->ID); - uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id); - target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel); + uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->ID); + target->SetSkill(targetSkillInfo->ID, target->GetSkillStep(targetSkillInfo->ID), maxLevel, maxLevel); handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str()); return true; } @@ -432,26 +432,26 @@ public: continue; // wrong skill - if (skillLine->skillId != skillId) + if (skillLine->SkillLine != skillId) continue; // not high rank - if (skillLine->forward_spellid) + if (skillLine->SupercedesSpell) continue; // skip racial skills - if (skillLine->racemask != 0) + if (skillLine->RaceMask != 0) continue; // skip wrong class skills - if (skillLine->classmask && (skillLine->classmask & classmask) == 0) + if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->SpellID); if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false)) continue; - player->LearnSpell(skillLine->spellId, false); + player->LearnSpell(skillLine->SpellID, false); } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 714d1851a3e..7d8fec52143 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -299,7 +299,7 @@ public: { FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL; - std::string name = factionEntry->name; + std::string name = factionEntry->Name_lang; if (name.empty()) continue; @@ -461,7 +461,7 @@ public: ItemSetEntry const* set = sItemSetStore.LookupEntry(id); if (set) { - std::string name = set->name; + std::string name = set->Name_lang; if (name.empty()) continue; @@ -724,7 +724,7 @@ public: SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id); if (skillInfo) { - std::string name = skillInfo->name; + std::string name = skillInfo->DisplayName_lang; if (name.empty()) continue; @@ -1072,7 +1072,7 @@ public: CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); if (titleInfo) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale; + std::string name = target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang; if (name.empty()) continue; @@ -1088,7 +1088,7 @@ public: char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : ""; - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -1097,9 +1097,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, "", knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, titleNameStr, "", knownStr, activeStr); ++counter; } @@ -1132,7 +1132,7 @@ public: { if (MapEntry const* mapInfo = sMapStore.LookupEntry(id)) { - std::string name = mapInfo->name; + std::string name = mapInfo->MapName_lang; if (name.empty()) continue; @@ -1150,7 +1150,7 @@ public: if (mapInfo->IsContinent()) ss << handler->GetTrinityString(LANG_CONTINENT); - switch (mapInfo->map_type) + switch (mapInfo->InstanceType) { case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index bd7cb9175fa..4c2b7d40a89 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -202,7 +202,7 @@ public: char const* unknown = handler->GetTrinityString(LANG_UNKNOWN); handler->PSendSysMessage(LANG_MAP_POSITION, - mapId, (mapEntry ? mapEntry->name : unknown), + mapId, (mapEntry ? mapEntry->MapName_lang : unknown), zoneId, (zoneEntry ? zoneEntry->area_name : unknown), areaId, (areaEntry ? areaEntry->area_name : unknown), object->GetPhaseMask(), @@ -1359,7 +1359,7 @@ public: // add the skill to the player's book with step 1 (which is the first rank, in most cases something // like 'Apprentice <skill>'. target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, handler->GetNameLink(target).c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->DisplayName_lang, handler->GetNameLink(target).c_str(), level, max); return true; } @@ -1714,7 +1714,7 @@ public: } if (target) - handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name, + handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->MapName_lang, (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)), (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN))); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 0075891ba5f..24283dca7ac 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1233,16 +1233,16 @@ public: return false; } - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) { - handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId); + handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId); handler->SetSentErrorMessage(true); return false; } target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry)); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 46fe0c64330..9d2621c0010 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -93,7 +93,7 @@ public: return false; } - uint8 powerType = classEntry->powerType; + uint8 powerType = classEntry->PowerType; // reset m_form if no aura if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 0826e0ca476..60d376d867a 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -94,9 +94,9 @@ public: std::string tNameLink = handler->GetNameLink(target); target->SetTitle(titleInfo); // to be sure that title now known - target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index); + target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->MaskID); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, tNameLink.c_str()); return true; } @@ -138,7 +138,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str()); + snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -186,7 +186,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str()); + snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); @@ -225,7 +225,7 @@ public: for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i) if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i)) - titles2 &= ~(uint64(1) << tEntry->bit_index); + titles2 &= ~(uint64(1) << tEntry->MaskID); titles &= ~titles2; // remove not existed titles diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 44d503ac672..beaff689a8d 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -928,7 +928,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript uint32 questId = 0; uint32 orphanId = 0; - switch (trigger->id) + switch (trigger->ID) { case AT_DOWN_AT_THE_DOCKS: questId = QUEST_DOWN_AT_THE_DOCKS; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index a0f871eacff..416c27b7353 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -1847,7 +1847,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE); - GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK); + GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), NULL, TRIGGERED_FULL_MASK); GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 5d6d075a09d..4a99ced5d55 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -155,7 +155,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; @@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 638538872e8..0ff7d116a88 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -628,7 +628,7 @@ class spell_dk_death_strike : public SpellScriptLoader if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID())) { // Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method - int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].DamageMultiplier); + int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].ChainAmplitude); if (AuraEffect const* aurEff = GetCaster()->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_DEATH_STRIKE, EFFECT_2)) heal = AddPct(heal, aurEff->GetAmount()); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 68a21cc61c6..9b3b38875af 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -312,13 +312,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader for (uint8 s = 0; s < 3; ++s) { - if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectSpellID[s]); if (!spellInfo) { - TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->spellid[s]); + TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->EffectSpellID[s]); continue; } @@ -327,13 +327,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader continue; // Do not reproc deadly - if (spellInfo->SpellFamilyFlags.IsEqual(0x10000, 0x80000, 0)) + if (spellInfo->SpellFamilyFlags == flag96(0x10000, 0x80000, 0)) continue; if (spellInfo->IsPositive()) - player->CastSpell(player, enchant->spellid[s], true, item); + player->CastSpell(player, enchant->EffectSpellID[s], true, item); else - player->CastSpell(target, enchant->spellid[s], true, item); + player->CastSpell(target, enchant->EffectSpellID[s], true, item); } } } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 24fa9ee31ae..128cddef1c1 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1249,7 +1249,7 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader if (!warlock || !swapVictim) return; - flag96 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask; + flag128 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask; Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras(); SoulSwapOverrideAuraScript* swapSpellScript = NULL; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 5e976b12071..3b6b68d3fce 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -245,7 +245,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader ApplyPct(damage, 16 * GetSpellInfo()->GetRank()); SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC); - uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].Amplitude; + uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].ApplyAuraPeriod; // Add remaining ticks to damage done if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID())) diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index a1e328ebaf0..535d1f3e1d1 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -180,7 +180,7 @@ class AreaTrigger_at_last_rites : public AreaTriggerScript WorldLocation pPosition; - switch (trigger->id) + switch (trigger->ID) { case 5332: case 5338: @@ -233,7 +233,7 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE || (player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED))) { - switch (trigger->id) + switch (trigger->ID) { case AT_SHOLAZAR: player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true); @@ -312,7 +312,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override { - uint32 triggerId = trigger->id; + uint32 triggerId = trigger->ID; // Second trigger happened too early after first, skip for now if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN) return false; @@ -370,8 +370,8 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript if (!player->IsAlive()) return false; - uint32 triggerId = trigger->id; - if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) + uint32 triggerId = trigger->ID; + if (sWorld->GetGameTime() - _triggerTimes[trigger->ID] < SUMMON_COOLDOWN) return false; switch (triggerId) @@ -400,7 +400,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); player->AddAura(SPELL_A52_NEURALYZER, player); - _triggerTimes[trigger->id] = sWorld->GetGameTime(); + _triggerTimes[trigger->ID] = sWorld->GetGameTime(); return false; } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 752ea2feb1c..800b533d216 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -236,7 +236,7 @@ public: { uint32 Spell = 0; - switch (pFaction->faction) + switch (pFaction->Faction) { case 1011: Spell = SPELL_REP_LC; break; case 935: Spell = SPELL_REP_SHAT; break; diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 216fe08d64a..90d19f7f7eb 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -27,6 +27,7 @@ #include <vector> #include <list> #include <map> +#include <stdarg.h> template<typename T> struct Optional @@ -388,7 +389,142 @@ class HookList } }; -class flag96 +template<uint8 T_size> +class flag +{ +protected: + uint32 part[T_size]; + +public: + flag() + { + memset(part, 0, sizeof(uint32)*T_size); + } + + flag(uint32 first, ...) + { + va_list ap; + part[0] = first; + + va_start(ap, first); + for (int i = 1; i < T_size; ++i) + part[i] = va_arg(ap, uint32); + va_end(ap); + } + + inline bool operator <(const flag<T_size>& right) const + { + for (uint8 i = T_size; i > 0; --i) + { + if (part[i - 1] < right.part[i - 1]) + return true; + else if (part[i - 1] > right.part[i - 1]) + return false; + } + return false; + } + + inline bool operator ==(const flag<T_size>& right) const + { + for (uint8 i = 0; i < T_size; ++i) + if (part[i] != right.part[i]) + return false; + return true; + } + + inline bool operator !=(const flag<T_size>& right) const + { + return !this->operator ==(right); + } + + inline flag<T_size>& operator =(const flag<T_size>& right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] = right.part[i]; + return *this; + } + + inline flag<T_size> operator &(const flag<T_size> &right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] & right.part[i]; + return fl; + } + + inline flag<T_size>& operator &=(const flag<T_size> &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] &= right.part[i]; + return *this; + } + + inline flag<T_size> operator |(const flag<T_size> &right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] | right.part[i]; + return fl; + } + + inline flag<T_size>& operator |=(const flag<T_size> &right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] |= right.part[i]; + return *this; + } + + inline flag<T_size> operator ~() const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = ~part[i]; + return fl; + } + + inline flag<T_size> operator ^(const flag<T_size>& right) const + { + flag<T_size> fl; + for (uint8 i = 0; i < T_size; ++i) + fl.part[i] = part[i] ^ right.part[i]; + return fl; + } + + inline flag<T_size>& operator ^=(const flag<T_size>& right) + { + for (uint8 i = 0; i < T_size; ++i) + part[i] ^= right.part[i]; + return *this; + } + + inline operator bool() const + { + for (uint8 i = 0; i < T_size; ++i) + if (part[i] != 0) + return true; + return false; + } + + inline bool operator !() const + { + return !this->operator bool(); + } + + inline uint32& operator [](uint8 el) + { + return part[el]; + } + + inline const uint32& operator [](uint8 el) const + { + return part[el]; + } +}; + +typedef flag<3> flag96; +typedef flag<4> flag128; + +/*class flag96 { private: uint32 part[3]; @@ -519,7 +655,7 @@ public: { return part[el]; } -}; +};*/ enum ComparisionType { diff --git a/src/tools/map_extractor/loadlib/DBFilesClientList.h b/src/tools/map_extractor/loadlib/DBFilesClientList.h index 11a771512ff..aadfe7a3666 100644 --- a/src/tools/map_extractor/loadlib/DBFilesClientList.h +++ b/src/tools/map_extractor/loadlib/DBFilesClientList.h @@ -247,6 +247,7 @@ char const* DBFilesClientList[] = "DBFilesClient\\WorldStateZoneSounds.dbc", "DBFilesClient\\ZoneMusic.dbc", "DBFilesClient\\ZoneIntroMusicTable.dbc", + "DBFilesClient\\WorldSafeLocs.dbc", "DBFilesClient\\WorldStateUI.dbc", "DBFilesClient\\WorldState.dbc", "DBFilesClient\\WorldMapTransforms.dbc", |