Yop, Ce patch ajoute les rang + titres PvP
Ligne 6500 de src/game/Player.cpp
J'ai ajouter les lignes avant comme demander par Morphau.
[code=cpp]
void Player::UpdateHonorFields()
{
/// called when rewarding honor and at each save
time_t now = time(NULL);
time_t today = (time(NULL) / DAY) * DAY;
if(m_lastHonorUpdateTime < today)
{
time_t yesterday = today - DAY;
uint16 kills_today = PAIR32_LOPART(GetUInt32Value(PLAYER_FIELD_KILLS));
// update yesterday's contribution
if(m_lastHonorUpdateTime >= yesterday )
{
SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION));
// this is the first update today, reset today's contribution
SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
SetUInt32Value(PLAYER_FIELD_KILLS, MAKE_PAIR32(0,kills_today));
}
else
{
// no honor/kills yesterday or today, reset
SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
SetUInt32Value(PLAYER_FIELD_KILLS, 0);
}
}
m_lastHonorUpdateTime = now // Début du patch ou il y a le "+"
+
+ uint32 HonorKills = GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORBALE_KILLS);
+ uint32 victim_rank = 0;
+
+ if (HonorKills < 10)
+ return;
+
+ if (HonorKills >= 10 && HonorKills < 100)
+ victim_rank = 1;
+ else if (HonorKills >= 100 && HonorKills < 250)
+ victim_rank = 2;
+ else if (HonorKills >= 250 && HonorKills < 500)
+ victim_rank = 3;
+ else if (HonorKills >= 500 && HonorKills < 1500)
+ victim_rank = 4;
+ else if (HonorKills >= 1500 && HonorKills < 5000)
+ victim_rank = 5;
+ else if (HonorKills >= 5000 && HonorKills < 7500)
+ victim_rank = 6;
+ else if (HonorKills >= 7500 && HonorKills < 10000)
+ victim_rank = 7;
+ else if (HonorKills >= 10000 && HonorKills < 12500)
+ victim_rank = 8;
+ else if (HonorKills >= 12500 && HonorKills < 15000)
+ victim_rank = 9;
+ else if (HonorKills >= 15000 && HonorKills < 17500)
+ victim_rank = 10;
+ else if (HonorKills >= 17500 && HonorKills < 20000)
+ victim_rank = 11;
+ else if (HonorKills >= 20000 && HonorKills < 25000)
+ victim_rank = 12;
+ else if (HonorKills >= 25000 && HonorKills < 50000)
+ victim_rank = 13;
+ else if (HonorKills >= 50000)
+ victim_rank = 14;
+
+ if (victim_rank == 0)
+ return;
+
+ if (GetTeam() == HORDE && victim_rank != 0)
+ victim_rank += 14;
+
+ CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(victim_rank);
+ if (!HasTitle(titleEntry))
+ SetTitle(titleEntry);
+ else
+ return;
+
+ SetUInt32Value(PLAYER_CHOSEN_TITLE,victim_rank);
+
+ uint32 startid = 1;
+ if (GetTeam() == HORDE)
+ startid = 15;
+
+ for(uint32 i = startid; i < victim_rank; ++i)
+ {
+ if (i == victim_rank)
+ break;
+ else
+ {
+ if (!HasTitle(titleEntry))
+ continue;
+ else
+ {
+ CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(i);
+ SetTitle(titleEntry,true);
+ }
+ }
+ }
}
[/code]
Source getmangos