吾爱尚玩资源基地
标题:
WOTLK335的自定义服务端的军衔设置系统
[打印本页]
作者:
admin
时间:
2016-4-19 22:52
标题:
WOTLK335的自定义服务端的军衔设置系统
diff --git a/src/game/Player.cpp b/src/game/Player.cppindex 5e73975..303c94c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -6496,6 +6496,75 @@ void Player::UpdateHonorFields()
}
m_lastHonorUpdateTime = now;
+
+ 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);
+ }
+ }
+ }
}
///Calculate the amount of honor gained based on the victim
作者:
微信
时间:
2016-10-9 23:21
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/)
Powered by Discuz! X3.4