// need call before fields update to have chance move yesterday data to appropriate fields before today data change.
@@ -6345,20 +6346,49 @@
// [15..28] Horde honor titles and player name
// [29..38] Other title and player name
// [39+] Nothing
- uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE);
- // Get Killer titles, CharTitlesEntry::bit_index
+ // PLAYER__FIELD_KNOWN_TITLES describe which titles player can use,
+ // so we must find biggest pvp title , even for killer to find extra honor value
+ uint32 vtitle = pVictim->GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES);
+ uint32 victim_title = 0;
+ uint32 ktitle = GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES);
+ uint32 killer_title = 0;
+ if(PLAYER_TITLE_MASK_ALL_PVP & ktitle)
+ {
+ for(int i = ((GetTeam() == ALLIANCE) ? 1:HKRANKMAX);i!=((GetTeam() == ALLIANCE) ? HKRANKMAX : (2*HKRANKMAX-1));i++)
+ {
+ if(ktitle & (1<<i))
+ killer_title = i;
+ }
+ }
+ if(PLAYER_TITLE_MASK_ALL_PVP & vtitle)
+ {
+ for(int i = ((pVictim->GetTeam() == ALLIANCE) ? 1:HKRANKMAX);i!=((pVictim->GetTeam() == ALLIANCE) ? HKRANKMAX : (2*HKRANKMAX-1));i++)
+ {
+ if(vtitle & (1<<i))
+ victim_title = i;
+ }
+ }
+ // Get Killer titles, CharTitlesEntry::bit_index
// Ranks:
// title[1..14] -> rank[5..18]
// title[15..28] -> rank[5..18]
// title[other] -> 0
if (victim_title == 0)
victim_guid = 0; // Don't show HK: <rank> message, only log.
- else if (victim_title < 15)
+ else if (victim_title < HKRANKMAX)
victim_rank = victim_title + 4;
- else if (victim_title < 29)
+ else if (victim_title < (2*HKRANKMAX-1))
victim_rank = victim_title - 14 + 4;
else
victim_guid = 0; // Don't show HK: <rank> message, only log.
+
+ // now find rank difference
+ if (killer_title == 0 && victim_rank>4)
+ rank_diff = victim_rank - 4;
+ else if (killer_title < HKRANKMAX)
+ rank_diff = (victim_rank>(killer_title + 4))? (victim_rank - (killer_title + 4)) : 0;
+ else if (killer_title < (2*HKRANKMAX-1))
+ rank_diff = (victim_rank>(killer_title - (HKRANKMAX-1) +4))? (victim_rank - (killer_title - (HKRANKMAX-1) + 4)) : 0;
}
if (k_level <= 5)
@@ -6377,11 +6407,13 @@
honor = ((f * diff_level * (190 + v_rank*10))/6);
honor *= ((float)k_level) / 70.0f; //factor of dependence on levels of the killer
+ honor *= 1 + sWorld.getRate(RATE_PVP_RANK_EXTRA_HONOR)*(((float)rank_diff) / 10.0f);
// count the number of playerkills in one day
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
// and those in a lifetime
ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true);
+ UpdateKnownTitles();
}
else
{
@@ -6460,6 +6492,30 @@
return true;
}