当前位置:首页>>魔兽单机>>正文
怀旧60级单机版经验倍率根据阵营分开设置C++
2013-04-17 22:03:17 作者:网络 来源: 浏览次数:0
摘要:怀旧魔兽60级单机版经验倍率根据阵营分开设置的代码
 适用于MANGOS 60级版本的魔兽世界单机版支持



----------------------------- src/game/Formulas.h -----------------------------
 
 struct HonorScores
 {
@@ -316,8 +317,13 @@ namespace MaNGOS
 
             if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsElite())
                 xp_gain *= 2;
+            float rate_xp_kill = 1.0f;
+            if (pl->GetTeam() == HORDE)
+                rate_xp_kill = ConfigMgCore::GetFloatDefault("Rate.XP.Kill.Horde", 1.0f);
+            else
+                rate_xp_kill = sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL);
 
-            return (uint32)(xp_gain * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL));
+            return (uint32)(xp_gain * rate_xp_kill);
         }
 
         inline float xp_in_group_rate(uint32 count, bool isRaid)
 
----------------------------- src/game/Player.cpp -----------------------------
index e43cc0a..6b62a7e 100644
@@ -5503,9 +5503,14 @@ void Player::CheckAreaExploreAndOutdoor()
             {
                 int32 diff = int32(getLevel()) - p->area_level;
                 uint32 XP = 0;
+                float rate_xp_explore = 1.0f;
+                if (GetTeam() == HORDE)
+                    rate_xp_explore = ConfigMgCore::GetFloatDefault("Rate.XP.Explore.Horde", 1.0f);
+                else
+                    rate_xp_explore = sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE);
                 if (diff < -5)
                 {
-                    XP = uint32(sObjectMgr.GetBaseXP(getLevel() + 5) * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
+                    XP = uint32(sObjectMgr.GetBaseXP(getLevel() + 5) * rate_xp_explore);
                 }
                 else if (diff > 5)
                 {
@@ -5515,11 +5520,11 @@ void Player::CheckAreaExploreAndOutdoor()
                     else if (exploration_percent < 0)
                         exploration_percent = 0;
 
-                    XP = uint32(sObjectMgr.GetBaseXP(p->area_level) * exploration_percent / 100 * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
+                    XP = uint32(sObjectMgr.GetBaseXP(p->area_level) * exploration_percent / 100 * rate_xp_explore);
                 }
                 else
                 {
-                    XP = uint32(sObjectMgr.GetBaseXP(p->area_level) * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_EXPLORE));
+                    XP = uint32(sObjectMgr.GetBaseXP(p->area_level) * rate_xp_explore);
                 }
 
                 GiveXP(XP, NULL);
@@ -12249,7 +12254,12 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
     QuestStatusData& q_status = mQuestStatus[quest_id];
 
     // Not give XP in case already completed once repeatable quest
-    uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this) * sWorld.getConfig(CONFIG_FLOAT_RATE_XP_QUEST));
+    float rate_xp_quest = 1.0f;
+    if (GetTeam() == HORDE)
+        rate_xp_quest = ConfigMgCore::GetFloatDefault("Rate.XP.Quest.Horde", 1.0f);
+    else
+        rate_xp_quest = sWorld.getConfig(CONFIG_FLOAT_RATE_XP_QUEST);
+    uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue(this) * rate_xp_quest);
 
     if (getLevel() < sWorld.getConfig(CONFIG_UINT32_MAX_PLAYER_LEVEL))
         GiveXP(XP , NULL);


相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 资源下载 | 魔兽图片 | 单机文档 | 技术攻略 | 玩家视频
备案号:蜀ICP备2024062380号-1
免责声明:本网站为热爱怀旧WOW的玩家们建立的魔兽世界资料网站,仅供交流和学习使用,非盈利和商用.如有侵权之处,请联系我们,我们会在24小时内确认删除侵权内容,谢谢合作。
Copyright © 2024 - 2024 WOWAII.COM Corporation, All Rights Reserved

机器人国度