吾爱尚玩资源基地

标题: 魔兽私服服务端MANGOS-TBC 决斗PVP后胜利获得金币 [打印本页]

作者: admin    时间: 2016-4-20 22:56
标题: 魔兽私服服务端MANGOS-TBC 决斗PVP后胜利获得金币
diff -Nuar oregoncore-current/src/game/Player.cpp oregoncore-pq/src/game/Player.cpp--- oregoncore-current/src/game/Player.cpp        2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/Player.cpp        2011-01-01 10:12:59.000000000 -0500
@@ -6829,6 +6829,30 @@
     if (uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL))
         duel->opponent->RewardHonor(NULL,1,amount);

+    // Gold after duel (the winner) - ImpConfig
+    if(uint32 amount = sWorld.getConfig(CONFIG_GOLD_AFTER_DUEL))
+    {
+        int copper = amount * 10000;
+
+        // set string varables
+        int buffer;
+        char const *duelwincstr;
+        char const *duelosecstr;
+        std::stringstream ss;
+
+        // create chat message
+        ss << "You receive " << amount << " Gold for conquering " << GetName() << " in a duel!";
+
+        // convert string to const chr
+        std::string duelwinstr = ss.str();
+        duelwincstr = duelwinstr.c_str();
+        // give player gold
+        duel->opponent->ModifyMoney(copper);
+
+        // send chat message
+        ChatHandler(duel->opponent).SendSysMessage(duelwincstr);
+    }
+
     //cleanups
     SetUInt64Value(PLAYER_DUEL_ARBITER, 0);
     SetUInt32Value(PLAYER_DUEL_TEAM, 0);
diff -Nuar oregoncore-current/src/game/World.cpp oregoncore-pq/src/game/World.cpp
--- oregoncore-current/src/game/World.cpp        2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/World.cpp        2011-01-01 10:12:59.000000000 -0500
@@ -1087,6 +1087,9 @@
     m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
     if (m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
         m_configs[CONFIG_HONOR_AFTER_DUEL]= 0;
+    m_configs[CONFIG_GOLD_AFTER_DUEL] = sConfig.GetIntDefault("GoldAfterDuel", 0);
+    if(m_configs[CONFIG_GOLD_AFTER_DUEL] < 0)
+        m_configs[CONFIG_GOLD_AFTER_DUEL]= 0;
     m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false);
     m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false);
     m_configs[CONFIG_ALWAYS_MAXSKILL] = sConfig.GetBoolDefault("AlwaysMaxWeaponSkill", false);
diff -Nuar oregoncore-current/src/game/World.h oregoncore-pq/src/game/World.h
--- oregoncore-current/src/game/World.h        2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/game/World.h        2011-01-01 10:12:59.000000000 -0500
@@ -215,6 +215,7 @@
     CONFIG_BG_START_MUSIC,
     CONFIG_START_ALL_SPELLS,
     CONFIG_HONOR_AFTER_DUEL,
+    CONFIG_GOLD_AFTER_DUEL,
     CONFIG_START_ALL_EXPLORED,
     CONFIG_START_ALL_REP,
     CONFIG_ALWAYS_MAXSKILL,
diff -Nuar oregoncore-current/src/oregoncore/oregoncore.conf.dist oregoncore-pq/src/oregoncore/oregoncore.conf.dist
--- oregoncore-current/src/oregoncore/oregoncore.conf.dist        2011-01-01 10:03:08.000000000 -0500
+++ oregoncore-pq/src/oregoncore/oregoncore.conf.dist        2011-01-01 10:12:59.000000000 -0500
@@ -1914,6 +1914,10 @@
#        The amount of honor points the duel winner will get after a duel.
#        Default: 0 - disable
#
+#    GoldAfterDuel
+#        The base amount, in gold, to award the winner of a duel.
+#        Default: 0 - disable
+#
#    AlwaysMaxWeaponSkill
#        Players will automatically gain max weapon/defense skill when
#         logging in, leveling up etc.
@@ -1988,6 +1992,7 @@
PlayerStart.MapsExplored = 0
MusicInBattleground = 0
HonorPointsAfterDuel = 0
+GoldAfterDuel = 0
AlwaysMaxWeaponSkill = 0
PvPToken.Enable = 0
PvPToken.MapAllowType = 4


回复下载完整代码






作者: 森罗万象    时间: 2020-12-8 08:18
受教了,学习一下




欢迎光临 吾爱尚玩资源基地 (http://bbs.523play.com/) Powered by Discuz! X3.4