From 532b65f401d5ad98f9db9ed8c01cf6b91cddc9c2 Mon Sep 17 00:00:00 2001 From: Intel Date: Thu, 6 Nov 2014 00:08:18 +0200 Subject: Core/DataStores: Updated Achievement.dbc struct --- src/server/game/Chat/ChatLink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 3f32447a31f..7e4f1d1a0ff 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -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); -- cgit v1.2.3 From 7c72f27b7c83b10636e57e30ca036f5b6bc5820e Mon Sep 17 00:00:00 2001 From: Intel Date: Fri, 7 Nov 2014 17:39:16 +0200 Subject: Core/DataStores: Updated ChatChannels.dbc, ChrClasses.dbc, ChrRaces.dbc structs --- src/server/game/Chat/Channels/Channel.cpp | 6 +- src/server/game/DataStores/DBCStores.cpp | 4 +- src/server/game/DataStores/DBCStructure.h | 98 ++++++++++++++++----------- src/server/game/DataStores/DBCfmt.h | 4 +- src/server/game/Entities/Player/Player.cpp | 28 ++++---- src/server/game/Entities/Unit/StatSystem.cpp | 8 +-- src/server/game/Globals/ObjectMgr.cpp | 4 +- src/server/game/Globals/ObjectMgr.h | 16 +++++ src/server/game/Guilds/GuildFinderMgr.cpp | 5 +- src/server/game/Handlers/CharacterHandler.cpp | 22 +++--- src/server/scripts/Commands/cs_learn.cpp | 2 +- src/server/scripts/Commands/cs_reset.cpp | 2 +- 12 files changed, 118 insertions(+), 81 deletions(-) (limited to 'src/server/game/Chat') 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/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index af24e182869..653b94ffa2f 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -914,13 +914,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) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 18096038b79..a099680b692 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -699,53 +699,73 @@ struct CharTitlesEntry 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 @@ -1535,7 +1555,7 @@ struct MapEntry bool IsContinent() const { - return ID == 0 || ID == 1 || ID == 530 || ID == 571 || ID == 1116; + return ID == 0 || ID == 1 || ID == 530 || ID == 571 || ID == 870 || ID == 1116; } bool IsDynamicDifficultyMap() const { return (Flags & MAP_FLAG_DYNAMIC_DIFFICULTY) != 0; } diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 92de682017c..0f12fd0f220 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -38,8 +38,8 @@ 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"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 985d03bd539..1d322cf61eb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -965,7 +965,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); @@ -5329,13 +5329,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; @@ -5400,22 +5400,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) @@ -5428,7 +5428,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; @@ -6617,8 +6617,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); } @@ -21612,8 +21612,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; } } @@ -23378,7 +23378,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) { diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 541a7c711ec..729cd4f1a41 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); + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerStrength, 0.0f); val2 = strengthValue + agilityValue; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8ec41b82d7f..c46131270b4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 045e8705f19..b56500a1a10 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 const GetRaceExpansionRequirement(uint8 race) + { + auto itr = _raceExpansionRequirementStore.find(race); + if (itr != _raceExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } + ExpansionRequirementContainer const& GetClassExpansionRequirements() const { return _classExpansionRequirementStore; } + uint8 const GetClassExpansionRequirement(uint8 race) + { + auto itr = _classExpansionRequirementStore.find(race); + if (itr != _classExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } private: // first free id for selected id type 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/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index afbc283676d..d868cd1bd13 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -356,17 +356,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; } @@ -940,10 +942,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()) @@ -2241,10 +2243,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/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 60523428e6f..886e866d66a 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) { 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)) -- cgit v1.2.3 From a7f56c2208a5ae63011721a8fd69b8b2a33ac653 Mon Sep 17 00:00:00 2001 From: Intel Date: Sat, 8 Nov 2014 20:21:17 +0200 Subject: Core/DataStores: Updated GameObjectDisplayInfo.dbc, GemProperties.dbc, GlyphProperties.dbc, GlyphSlot.dbc, GuildPerkSpells.dbc structs --- src/server/collision/Models/GameObjectModel.cpp | 2 +- src/server/game/Chat/Chat.cpp | 2 +- src/server/game/Chat/ChatLink.cpp | 4 +- src/server/game/DataStores/DBCStores.cpp | 12 +-- src/server/game/DataStores/DBCStructure.h | 97 +++++++++++----------- src/server/game/DataStores/DBCfmt.h | 6 +- src/server/game/Entities/GameObject/GameObject.cpp | 6 +- src/server/game/Entities/Item/Item.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 14 ++-- src/server/game/Guilds/Guild.cpp | 12 +-- src/server/game/Handlers/CalendarHandler.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 10 +-- src/server/game/Reputation/ReputationMgr.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 8 +- 17 files changed, 93 insertions(+), 94 deletions(-) (limited to 'src/server/game/Chat') 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/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 7e4f1d1a0ff..4077c875511 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -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/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index cfe595b3140..1ce2252e310 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -411,12 +411,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)); } } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index beadfad83a9..cd462e5f5ee 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1079,41 +1079,40 @@ struct FactionTemplateEntry 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 @@ -1207,9 +1206,9 @@ struct GtOCTBaseMPByClassEntry struct GuildPerkSpellsEntry { - //uint32 Id; - uint32 Level; - uint32 SpellId; + //uint32 ID; // 0 + uint32 GuildLevel; // 1 + uint32 SpellID; // 2 }; /* no used @@ -1234,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 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 725e0f51b42..327acec4982 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -57,10 +57,10 @@ 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"; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index c010e3f1506..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*/) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 2eb4026bf07..0fd97b41f00 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -948,7 +948,7 @@ bool Item::GemsFitSockets() const { GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties); if (gemProperty) - GemColor = gemProperty->color; + GemColor = gemProperty->Type; } } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3dec68360da..711b4030465 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17910,13 +17910,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); @@ -22494,7 +22494,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) { @@ -24915,7 +24915,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; @@ -26646,7 +26646,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; @@ -26701,7 +26701,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); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 125239dd539..d92716a0fec 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2374,8 +2374,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()); @@ -2830,8 +2830,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()); @@ -3586,8 +3586,8 @@ void Guild::GiveXP(uint32 xp, Player* source) std::vector 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/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 d868cd1bd13..1aa19063123 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1395,7 +1395,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); } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 69ebd8717cc..69c8ffb143c 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -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)); } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index d5ca307344d..359a8f3946a 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -333,7 +333,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi { if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr)) { - if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCapOut)) + if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCapIn)) continue; int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionModIn); if (spilloverRep != 0 || !incremental) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cb7df6c2650..64a0c92d107 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -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); } } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 659e7ad46ef..cb2e2e82e9d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 5dcdcc9fcea..0f84226cf06 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -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); } -- cgit v1.2.3 From b0f898ea8e7a659e9f1288a47a484f371476fc57 Mon Sep 17 00:00:00 2001 From: Intel Date: Sat, 8 Nov 2014 21:58:26 +0200 Subject: Core/DataStores: Updated item dbcs --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 4 +- src/server/game/Chat/ChatLink.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 16 ++- src/server/game/DataStores/DBCStores.h | 2 + src/server/game/DataStores/DBCStructure.h | 126 +++++++++++----------- src/server/game/DataStores/DBCfmt.h | 7 +- src/server/game/Entities/Item/Item.cpp | 41 ++++--- src/server/game/Entities/Player/Player.cpp | 26 ++--- src/server/game/Globals/ObjectMgr.cpp | 10 +- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/scripts/Commands/cs_lookup.cpp | 2 +- 13 files changed, 129 insertions(+), 115 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index e853ce1671f..e5b9079f019 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -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 diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 4077c875511..ea6df4c984c 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) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1ce2252e310..1baa3441226 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -140,11 +140,13 @@ DBCStorage sItemDamageTwoHandStore(ItemDamagefmt) DBCStorage sItemDamageTwoHandCasterStore(ItemDamagefmt); DBCStorage sItemDamageWandStore(ItemDamagefmt); DBCStorage sItemDisenchantLootStore(ItemDisenchantLootfmt); -//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); -DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); -DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); -DBCStorage sItemSetStore(ItemSetEntryfmt); +//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently +DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); +DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); +DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); +DBCStorage sItemSetStore(ItemSetEntryfmt); +DBCStorage sItemSetSpellStore(ItemSetSpellEntryfmt); +ItemSetSpellsStore sItemSetSpellsStore; DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); DBCStorage sLightStore(LightEntryfmt); @@ -454,6 +456,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 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 3fc688d23ff..bc514374157 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -170,6 +170,8 @@ extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; +extern DBCStorage sItemSetSpellStore; +extern ItemSetSpellsStore sItemSetSpellsStore; extern DBCStorage sLFGDungeonStore; extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index cd462e5f5ee..125a74b3190 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1306,117 +1306,123 @@ 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 ItemSetSpells; +typedef std::unordered_map ItemSetSpellsStore; + struct LFGDungeonEntry { uint32 ID; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 327acec4982..75cf0c4b2e5 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -88,14 +88,15 @@ 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 ItemSetEntryfmt[] = "nsiiiiiiiiiiiiiiiiiii"; +char const ItemSetSpellEntryfmt[] = "niiii"; char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixixxx"; char const LightEntryfmt[] = "nifffxxxxxxxxxx"; char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 0fd97b41f00..c98ea4b2911 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); } } } @@ -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; } @@ -1497,9 +1496,9 @@ int32 Item::GetReforgableStat(ItemModType statType) const 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); + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + if (randomSuffix->Enchantment[k] == enchant->ID) + return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000); } else { @@ -1512,7 +1511,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const 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 < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) - if (randomProp->enchant_id[k] == enchant->ID) + if (randomProp->Enchantment[k] == enchant->ID) return int32(enchant->amount[k]); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 711b4030465..47f6906ef78 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10496,13 +10496,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; @@ -13761,11 +13761,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; } } @@ -13789,9 +13789,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; } } @@ -13807,11 +13807,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; } } @@ -25521,11 +25521,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; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 91f9a686eb4..0e5c82510b4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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->Modifier[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; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 69c8ffb143c..87d17a8fc7c 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1211,7 +1211,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) } } - 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/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/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 64a0c92d107..1142240a3af 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -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) { - amount = uint32((item_rand_suffix->prefix[k] * castItem->GetItemSuffixFactor()) / 10000); + amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000); break; } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 96806bc3d70..67505e713de 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -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; -- cgit v1.2.3 From 2a4f56107f6e066211eebfe85ee70a9f5a9735fb Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 9 Nov 2014 02:51:35 +0200 Subject: Core/DataStores: Even more converted dbcs --- src/server/game/Achievements/AchievementMgr.cpp | 4 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 4 +- src/server/game/Chat/ChatLink.cpp | 8 +- src/server/game/DataStores/DBCStores.cpp | 37 ++--- src/server/game/DataStores/DBCStructure.h | 179 +++++++++++---------- src/server/game/DataStores/DBCfmt.h | 18 +-- src/server/game/Entities/Player/Player.cpp | 74 ++++----- src/server/game/Globals/ObjectMgr.cpp | 8 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Maps/MapInstanced.cpp | 11 +- src/server/game/Skills/SkillDiscovery.cpp | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/Spells/SpellInfo.cpp | 6 +- src/server/game/Spells/SpellMgr.cpp | 14 +- src/server/scripts/Commands/cs_learn.cpp | 34 ++-- src/server/scripts/Commands/cs_lookup.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 2 +- 19 files changed, 205 insertions(+), 212 deletions(-) (limited to 'src/server/game/Chat') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 47424798ec0..fed0a00d0dc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1342,7 +1342,7 @@ void AchievementMgr::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::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); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 396b549c0bc..ee3cb147b9f 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1902,7 +1902,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/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/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index ea6df4c984c..e671713c643 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -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(": ") diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1acb88b9ae5..18965178656 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -515,7 +515,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 +531,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 @@ -584,7 +584,7 @@ void LoadDBCStores(const std::string& dataPath) if (!skillLine) continue; - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID); if (!spellInfo) continue; @@ -600,10 +600,10 @@ 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); @@ -1081,15 +1081,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; } } @@ -1101,7 +1101,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; @@ -1203,7 +1203,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: @@ -1227,7 +1226,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; } @@ -1247,7 +1248,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: @@ -1255,12 +1256,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: @@ -1280,17 +1281,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; } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b9a891ccec4..22bf5f20317 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1628,80 +1628,80 @@ struct NameGenEntry 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; @@ -1717,73 +1717,74 @@ 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 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index d01d33ac685..84e98751a28 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -115,16 +115,16 @@ 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"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b01b602449e..139b36a35da 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3687,13 +3687,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); } } } @@ -3717,8 +3717,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); @@ -5858,24 +5858,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); } } @@ -6015,7 +6015,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; @@ -6047,10 +6047,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; @@ -6128,8 +6128,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) @@ -6156,7 +6156,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); @@ -7882,9 +7882,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 @@ -8060,7 +8060,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 @@ -23490,8 +23490,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) if (!rank) break; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier); - uint16 maxValue = tier->MaxSkill[std::max(rank - 1, 0)]; + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID); + uint16 maxValue = tier->Value[std::max(rank - 1, 0)]; uint16 skillValue = 1; if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; @@ -23606,31 +23606,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); } } @@ -23897,11 +23897,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; @@ -25418,13 +25418,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; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0e5c82510b4..97e2a40a02f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 8795bd812de..2aa40942171 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -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 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/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 c8fbbcbec53..ef83bdced50 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5293,7 +5293,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 +5301,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/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0f84226cf06..c441bd9b3f7 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(skillval, 1), tier->MaxSkill[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max(skillval, 1), tier->Value[damage - 1]); } void Spell::EffectPlayMovie(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8eb358cdcbb..917f69547a1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1131,10 +1131,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 +1146,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; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7aebc202d81..4463fc0da75 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; @@ -2207,7 +2207,7 @@ void SpellMgr::LoadSkillLineAbilityMap() if (!SkillInfo) continue; - mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo)); + mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->SpellID, SkillInfo)); ++count; } @@ -2445,13 +2445,13 @@ void SpellMgr::LoadPetLevelupSpellMap() // (!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; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index bed6715fec1..eb5be0950aa 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -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; @@ -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 67505e713de..7d8fec52143 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -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; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d51150edb66..4c2b7d40a89 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -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 '. 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; } -- cgit v1.2.3