Нашел у себя еще одну версию, автора, к сожалению, не помню...
Код:
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 8cedbab..554a5cd 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -14581,6 +14664,98 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_social = sSocialMgr.LoadFromDB(holder->GetResult(PLAYER_LOGIN_QUERY_LOADSOCIALLIST), GetGUIDLow());
+ //new titles system
+ if (uint32 hks = GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORBALE_KILLS))
+ {
+ uint64 titles = GetUInt64Value(PLAYER__FIELD_KNOWN_TITLES);
+
+ //clear all prevous hk titles
+ titles &= ~0xFFFFFFF;
+
+ uint64 newTitle = 0;
+
+ if (GetTeam() == ALLIANCE)
+ {
+ if (hks > 0 && hks < 200)
+ newTitle |= PLAYER_TITLE_PRIVATE;
+ else if (hks >= 200 && hks < 500)
+ newTitle |= PLAYER_TITLE_CORPORAL;
+ else if (hks >= 500 && hks < 1000)
+ newTitle |= PLAYER_TITLE_SERGEANT_A;
+ else if (hks >= 1000 && hks < 1500)
+ newTitle |= PLAYER_TITLE_MASTER_SERGEANT;
+ else if (hks >= 1500 && hks < 2000)
+ newTitle |= PLAYER_TITLE_SERGEANT_MAJOR;
+ else if (hks >= 2000 && hks < 2500)
+ newTitle |= PLAYER_TITLE_KNIGHT;
+ else if (hks >= 2500 && hks < 3000)
+ newTitle |= PLAYER_TITLE_KNIGHT_LIEUTENANT;
+ else if (hks >= 3000 && hks < 3500)
+ newTitle |= PLAYER_TITLE_KNIGHT_CAPTAIN;
+ else if (hks >= 3500 && hks < 4000)
+ newTitle |= PLAYER_TITLE_KNIGHT_CHAMPION;
+ else if (hks >= 4000 && hks < 4500)
+ newTitle |= PLAYER_TITLE_LIEUTENANT_COMMANDER;
+ else if (hks >= 4500 && hks < 5000)
+ newTitle |= PLAYER_TITLE_COMMANDER;
+ else if (hks >= 5000 && hks < 5500)
+ newTitle |= PLAYER_TITLE_MARSHAL;
+ else if (hks >= 5500 && hks < 8000)
+ newTitle |= PLAYER_TITLE_FIELD_MARSHAL;
+ else if (hks >= 8000)
+ newTitle |= PLAYER_TITLE_GRAND_MARSHAL;
+ } else
+ {
+ if (hks > 0 && hks < 200)
+ newTitle |= PLAYER_TITLE_SCOUT;
+ else if (hks >= 200 && hks < 500)
+ newTitle |= PLAYER_TITLE_GRUNT;
+ else if (hks >= 500 && hks < 1000)
+ newTitle |= PLAYER_TITLE_SERGEANT_H;
+ else if (hks >= 1000 && hks < 1500)
+ newTitle |= PLAYER_TITLE_SENIOR_SERGEANT;
+ else if (hks >= 1500 && hks < 2000)
+ newTitle |= PLAYER_TITLE_FIRST_SERGEANT;
+ else if (hks >= 2000 && hks < 2500)
+ newTitle |= PLAYER_TITLE_STONE_GUARD;
+ else if (hks >= 2500 && hks < 3000)
+ newTitle |= PLAYER_TITLE_BLOOD_GUARD;
+ else if (hks >= 3000 && hks < 3500)
+ newTitle |= PLAYER_TITLE_LEGIONNAIRE;
+ else if (hks >= 3500 && hks < 4000)
+ newTitle |= PLAYER_TITLE_CENTURION;
+ else if (hks >= 4000 && hks < 4500)
+ newTitle |= PLAYER_TITLE_CHAMPION;
+ else if (hks >= 4500 && hks < 5000)
+ newTitle |= PLAYER_TITLE_LIEUTENANT_GENERAL;
+ else if (hks >= 5000 && hks < 5500)
+ newTitle |= PLAYER_TITLE_GENERAL;
+ else if (hks >= 5500 && hks < 8000)
+ newTitle |= PLAYER_TITLE_WARLORD;
+ else if (hks >= 8000)
+ newTitle |= PLAYER_TITLE_HIGH_WARLORD;
+ }
+
+ titles |= newTitle;
+
+ SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES, titles);
+ uint64 chosen = uint64(1) << GetUInt32Value(PLAYER_CHOSEN_TITLE);
+ if (chosen <= PLAYER_TITLE_HIGH_WARLORD)
+ {
+ //refresh PLAYER_CHOSEN_TITLE
+ uint32 bitPos = 0;
+
+ //determine bit position
+ if (newTitle > 0)
+ {
+ while (uint64(1) << ++bitPos != newTitle && bitPos < sizeof(newTitle) * 8);
+
+ SetUInt32Value(PLAYER_CHOSEN_TITLE, bitPos);
+ }
+ }
+
+ }
+
// check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES
// note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
if(uint32 curTitle = GetUInt32Value(PLAYER_CHOSEN_TITLE))