diff options
author | Nay <dnpd.dd@gmail.com> | 2012-08-28 19:02:22 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-08-28 19:02:22 +0100 |
commit | 6af514d592115dda44dde46a2f2420b35cbd08a9 (patch) | |
tree | 71e91bf8e6dce112542dcc4d53bc7f1071860b02 /src | |
parent | 9fe45d68707d45f7a82e3314566edc66ff1d84a2 (diff) | |
parent | ff886b626e7aaa9d8359cfbddc69227dd3f30883 (diff) |
Merge remote-tracking branch 'origin/master' into mmaps
Diffstat (limited to 'src')
-rw-r--r-- | src/server/authserver/Authentication/AuthCodes.cpp | 48 | ||||
-rwxr-xr-x | src/server/authserver/Authentication/AuthCodes.h | 13 | ||||
-rwxr-xr-x | src/server/authserver/Server/AuthSocket.cpp | 113 | ||||
-rw-r--r-- | src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Battlefield/Zones/BattlefieldWG.h | 23 | ||||
-rwxr-xr-x | src/server/game/Entities/Creature/GossipDef.cpp | 12 | ||||
-rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.cpp | 5 | ||||
-rwxr-xr-x | src/server/game/Quests/QuestDef.h | 2 |
9 files changed, 143 insertions, 83 deletions
diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index ace18e7b45c..bdb96ca0d25 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -16,15 +16,36 @@ */ #include "AuthCodes.h" +#include <cstddef> namespace AuthHelper { - bool IsPreBCAcceptedClientBuild(int build) + static RealmBuildInfo const PostBcAcceptedClientBuilds[] = + { + {15595, 4, 3, 4, ' '}, + {14545, 4, 2, 2, ' '}, + {13623, 4, 0, 6, 'a'}, + {12340, 3, 3, 5, 'a'}, + {11723, 3, 3, 3, 'a'}, + {11403, 3, 3, 2, ' '}, + {11159, 3, 3, 0, 'a'}, + {10505, 3, 2, 2, 'a'}, + {9947, 3, 1, 3, ' '}, + {8606, 2, 4, 3, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + static RealmBuildInfo const PreBcAcceptedClientBuilds[] = { - int accepted_versions[] = PRE_BC_ACCEPTED_CLIENT_BUILD; + {6005, 1, 12, 2, ' '}, + {5875, 1, 12, 1, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + bool IsPreBCAcceptedClientBuild(int build) + { + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) return true; return false; @@ -32,10 +53,8 @@ namespace AuthHelper bool IsPostBCAcceptedClientBuild(int build) { - int accepted_versions[] = POST_BC_ACCEPTED_CLIENT_BUILD; - - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) return true; return false; @@ -45,4 +64,17 @@ namespace AuthHelper { return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); } + + RealmBuildInfo const* GetBuildInfo(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) + return &PostBcAcceptedClientBuilds[i]; + + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return &PreBcAcceptedClientBuilds[i]; + + return NULL; + } }; diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index f940d459d40..148225377ff 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,9 +65,6 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} -#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} - enum ExpansionFlags { POST_BC_EXP_FLAG = 0x2, @@ -75,8 +72,18 @@ enum ExpansionFlags NO_VALID_EXP_FLAG = 0x0 }; +struct RealmBuildInfo +{ + int Build; + int MajorVersion; + int MinorVersion; + int BugfixVersion; + int HotfixVersion; +}; + namespace AuthHelper { + RealmBuildInfo const* GetBuildInfo(int build); bool IsAcceptedClientBuild(int build); bool IsPostBCAcceptedClientBuild(int build); bool IsPreBCAcceptedClientBuild(int build); diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 0794d9a802a..2ad80c7f62d 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -343,7 +343,7 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; - _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); + _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); _os = (const char*)ch->os; if (_os.size() > 4) @@ -352,19 +352,19 @@ bool AuthSocket::_HandleLogonChallenge() // Restore string order as its byte order is reversed std::reverse(_os.begin(), _os.end()); - pkt << (uint8)AUTH_LOGON_CHALLENGE; - pkt << (uint8)0x00; + pkt << uint8(AUTH_LOGON_CHALLENGE); + pkt << uint8(0x00); // Verify that this IP is not in the ip_banned table LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS)); - const std::string& ip_address = socket().getRemoteAddress(); - PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); + std::string const& ip_address = socket().getRemoteAddress(); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED); stmt->setString(0, ip_address); PreparedQueryResult result = LoginDatabase.Query(stmt); if (result) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); } else @@ -411,12 +411,12 @@ bool AuthSocket::_HandleLogonChallenge() { if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } else { - pkt << (uint8)WOW_FAIL_SUSPENDED; + pkt << uint8(WOW_FAIL_SUSPENDED); sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); } } @@ -450,7 +450,10 @@ bool AuthSocket::_HandleLogonChallenge() unk3.SetRand(16 * 8); // Fill the response packet with the result - pkt << uint8(WOW_SUCCESS); + if (AuthHelper::IsAcceptedClientBuild(_build)) + pkt << uint8(WOW_SUCCESS); + else + pkt << uint8(WOW_FAIL_VERSION_INVALID); // B may be calculated < 32B so we force minimal length to 32B pkt.append(B.AsByteArray(32), 32); // 32 bytes @@ -749,7 +752,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Reinitialize build, expansion and the account securitylevel _build = ch->build; - _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); + _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); _os = (const char*)ch->os; if (_os.size() > 4) @@ -766,11 +769,11 @@ bool AuthSocket::_HandleReconnectChallenge() // Sending response ByteBuffer pkt; - pkt << (uint8)AUTH_RECONNECT_CHALLENGE; - pkt << (uint8)0x00; + pkt << uint8(AUTH_RECONNECT_CHALLENGE); + pkt << uint8(0x00); _reconnectProof.SetRand(16 * 8); pkt.append(_reconnectProof.AsByteArray(16), 16); // 16 bytes random - pkt << (uint64)0x00 << (uint64)0x00; // 16 bytes zeros + pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros socket().send((char const*)pkt.contents(), pkt.size()); return true; } @@ -800,9 +803,9 @@ bool AuthSocket::_HandleReconnectProof() { // Sending response ByteBuffer pkt; - pkt << (uint8)AUTH_RECONNECT_PROOF; - pkt << (uint8)0x00; - pkt << (uint16)0x00; // 2 bytes zeros + pkt << uint8(AUTH_RECONNECT_PROOF); + pkt << uint8(0x00); + pkt << uint16(0x00); // 2 bytes zeros socket().send((char const*)pkt.contents(), pkt.size()); _authed = true; return true; @@ -849,73 +852,87 @@ bool AuthSocket::_HandleRealmList() for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { // don't work with realms which not compatible with the client - if ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild != _build) - continue; - else if ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild)) + bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild)); + + // No SQL injection. id of realm is controlled by the database. + uint32 flag = i->second.flag; + RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild); + if (!okBuild) + { + if (!buildInfo) continue; - uint8 AmountOfCharacters; + flag |= REALM_FLAG_OFFLINE | REALM_FLAG_SPECIFYBUILD; // tell the client what build the realm is for + } - // No SQL injection. id of realm is controlled by the database. + if (!buildInfo) + flag &= ~REALM_FLAG_SPECIFYBUILD; + + std::string name = i->first; + if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD) + { + std::ostringstream ss; + ss << name << " (" << buildInfo->MajorVersion << '.' << buildInfo->MinorVersion << '.' << buildInfo->BugfixVersion << ')'; + name = ss.str(); + } + + uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; + + uint8 AmountOfCharacters = 0; stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM); stmt->setUInt32(0, i->second.m_ID); stmt->setUInt32(1, id); result = LoginDatabase.Query(stmt); if (result) AmountOfCharacters = (*result)[0].GetUInt8(); - else - AmountOfCharacters = 0; - - uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; pkt << i->second.icon; // realm type - if ( _expversion & POST_BC_EXP_FLAG ) // only 2.x and 3.x clients + if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients pkt << lock; // if 1, then realm locked - pkt << uint8(i->second.flag); // RealmFlags - pkt << i->first; + pkt << uint8(flag); // RealmFlags + pkt << name; pkt << i->second.address; pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients - pkt << (uint8)0x2C; // unk, may be realm number/id? + pkt << uint8(0x2C); // unk, may be realm number/id? else - pkt << (uint8)0x0; // 1.12.1 and 1.12.2 clients + pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients - if (i->second.flag & REALM_FLAG_SPECIFYBUILD) + if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD) { - // TODO: Make this customizable - pkt << uint8(3); - pkt << uint8(3); - pkt << uint8(5); - pkt << uint16(12340); + pkt << uint8(buildInfo->MajorVersion); + pkt << uint8(buildInfo->MinorVersion); + pkt << uint8(buildInfo->BugfixVersion); + pkt << uint16(buildInfo->Build); } ++RealmListSize; } - if ( _expversion & POST_BC_EXP_FLAG ) // 2.x and 3.x clients + if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients { - pkt << (uint8)0x10; - pkt << (uint8)0x00; + pkt << uint8(0x10); + pkt << uint8(0x00); } else // 1.12.1 and 1.12.2 clients { - pkt << (uint8)0x00; - pkt << (uint8)0x02; + pkt << uint8(0x00); + pkt << uint8(0x02); } // make a ByteBuffer which stores the RealmList's size ByteBuffer RealmListSizeBuffer; - RealmListSizeBuffer << (uint32)0; + RealmListSizeBuffer << uint32(0); if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients - RealmListSizeBuffer << (uint16)RealmListSize; + RealmListSizeBuffer << uint16(RealmListSize); else - RealmListSizeBuffer << (uint32)RealmListSize; + RealmListSizeBuffer << uint32(RealmListSize); ByteBuffer hdr; - hdr << (uint8) REALM_LIST; - hdr << (uint16)(pkt.size() + RealmListSizeBuffer.size()); + hdr << uint8(REALM_LIST); + hdr << uint16(pkt.size() + RealmListSizeBuffer.size()); hdr.append(RealmListSizeBuffer); // append RealmList's size buffer hdr.append(pkt); // append realms in the realmlist @@ -983,7 +1000,9 @@ PatcherRunnable::PatcherRunnable(class AuthSocket* as) } // Send content of patch file to the client -void PatcherRunnable::run() {} +void PatcherRunnable::run() +{ +} // Preload MD5 hashes of existing patch files on server #ifndef _WIN32 diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 6d2d823e341..97e7bb5bef2 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -25,12 +25,6 @@ #include "SpellAuras.h" #include "Vehicle.h" -enum WintergrastData -{ - BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp - BATTLEFIELD_WG_MAPID = 571, // Northrend -}; - enum WGVehicles { NPC_WG_SEIGE_ENGINE_ALLIANCE = 28312, @@ -178,7 +172,7 @@ bool BattlefieldWG::SetupBattlefield() GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o); BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this); b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId); - if (!m_IsEnabled && go->GetGOInfo()->entry == GO_WINTERGRASP_VAULT_GATE) + if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE) go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); BuildingsInZone.insert(b); } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 9f024bb0ba6..734154020d9 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -44,6 +44,12 @@ typedef std::set<WGWorkshop*> Workshop; typedef std::set<Group*> GroupSet; //typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ? +enum WintergrastData +{ + BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp + BATTLEFIELD_WG_MAPID = 571, // Northrend +}; + enum WintergraspSpells { // Wartime auras @@ -435,7 +441,6 @@ class BattlefieldWG : public Battlefield GameObject* m_titansRelic; }; -uint32 const NORTHREND_WINTERGRASP = 4197; uint8 const WG_MAX_OBJ = 32; uint8 const WG_KEEPGAMEOBJECT_MAX = 44; uint8 const WG_MAX_TURRET = 15; @@ -544,6 +549,8 @@ enum WintergraspGameObject GO_WINTERGRASP_FORTRESS_GATE = 190375, GO_WINTERGRASP_VAULT_GATE = 191810, + GO_WINTERGRASP_KEEP_COLLISION_WALL = 194323, + }; struct WintergraspObjectPositionData @@ -1201,8 +1208,8 @@ struct BfWGGameObjectBuilding { m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE) - if (GameObject * go = m_Build->FindNearestGameObject(194323, 10.0f)) - go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true); + if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) + go->EnableCollision(true); // Update worldstate m_State = BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (m_Team * 3); @@ -1258,8 +1265,8 @@ struct BfWGGameObjectBuilding m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team)); break; case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST: - if (GameObject* go = m_Build->FindNearestGameObject(194323, 10.0f)) - go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f)) + go->EnableCollision(false); m_WG->SetRelicInteractible(true); if (m_WG->GetRelic()) m_WG->GetRelic()->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); @@ -1413,7 +1420,7 @@ struct BfWGGameObjectBuilding { Position towerCannonPos; TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos); - if (Creature *turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0))) + if (Creature* turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0))) { m_TurretTopList.insert(turret->GetGUID()); switch (go->GetEntry()) @@ -1653,9 +1660,9 @@ struct WintergraspWorkshopData // Spawning Associate gameobject and store them void AddGameObject(WintergraspObjectPositionData obj) { - if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o)) + if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o)) m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject); - if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o)) + if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o)) m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject); } diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 63e186ffc42..ec196280d99 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -367,8 +367,8 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, } // rewarded honor points. Multiply with 10 to satisfy client - data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0.0f); // new 3.3.0, honor multiplier? + data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest))); + data << float(0.0f); // unk, honor multiplier? data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(quest->GetRewSpellCast()); // casted spell data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) @@ -454,8 +454,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << int32(quest->GetRewSpellCast()); // casted spell // rewarded honor points - data << Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0); // new reward honor (multipled by ~62 at client side) + data << uint32(quest->GetRewHonorAddition()); + data << float(quest->GetRewHonorMultiplier()); data << uint32(quest->GetSrcItemId()); // source item id data << uint32(quest->GetFlags() & 0xFFFF); // quest flags data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) @@ -598,8 +598,8 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST)); // rewarded honor points. Multiply with 10 to satisfy client - data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0); // unk, honor multiplier? + data << uint32(10 * quest->CalculateHonorGain(_session->GetPlayer()->GetQuestLevel(quest))); + data << float(0.0f); // unk, honor multiplier? data << uint32(0x08); // unused by client? data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(quest->GetRewSpellCast()); // casted spell diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f97582a0198..8660b040037 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16374,7 +16374,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); } - data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier()); + data << uint32(10 * quest->CalculateHonorGain(GetQuestLevel(quest))); data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); GetSession()->SendPacket(&data); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 9221da53003..b58011efe42 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -238,10 +238,11 @@ uint32 Quest::CalculateHonorGain(uint8 level) const if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) { // values stored from 0.. for 1... - TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1); + TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level); if (!tc) return 0; - honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161); + + honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f); honor += GetRewHonorAddition(); } diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 7f22b441afe..6155e33d35e 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -194,7 +194,7 @@ class Quest int32 GetZoneOrSort() const { return ZoneOrSort; } uint32 GetMinLevel() const { return MinLevel; } uint32 GetMaxLevel() const { return MaxLevel; } - uint32 GetQuestLevel() const { return Level; } + int32 GetQuestLevel() const { return Level; } uint32 GetType() const { return Type; } uint32 GetRequiredClasses() const { return RequiredClasses; } uint32 GetRequiredRaces() const { return RequiredRaces; } |