From d21b930eb4497ce8f1b7b0d9a822c786608c3f03 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 02 十一月 2023 14:49:32 +0800
Subject: [PATCH] 9990 【主干】【BT0.1】物品出售支持不同货币

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index 9925c55..b6efd84 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -989,11 +989,11 @@
 # @return 返回值真, 检查通过
 # @remarks 出售指定背包物品
 def SellPackItem(curPlayer, packType, itemIndexList, shopType):
-    totalSellPrice = 0
     backPack = curPlayer.GetItemManager().GetPack(packType)
     if backPack == None:
         return False
     
+    totalSellPriceDict = {}
     hasSellOK = False
     notForceRecordEquipTypeList = range(ChConfig.Def_ItemType_retWeapon, ChConfig.Def_ItemType_retNeck)
     for itemIndex in itemIndexList:
@@ -1009,7 +1009,7 @@
         curItemSellPrice, curItemSellType = __GetItemSellPrice(curPlayer, curItem)
         #获得整组销售价格
         curAllItemSellPrice = int(curItemSellPrice) * curItemCount
-        totalSellPrice += curAllItemSellPrice
+        totalSellPriceDict[curItemSellType] = totalSellPriceDict.get(curItemSellType, 0) + curAllItemSellPrice
         #GameWorld.Log('curItemSellPrice=%s,curAllItemSellPrice=%s,curItemCount=%s'%(curItemSellPrice,curAllItemSellPrice,curItemCount))
         
         #===========================================================================================
@@ -1025,10 +1025,11 @@
         #PutItemInBuyBackPack(curPlayer, curItem)
     if not hasSellOK:
         return False
-    #玩家钱增加
-    addDataDict = {}
-    PlayerControl.GiveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Silver_Money, totalSellPrice, ChConfig.Def_GiveMoney_SellPackItem, addDataDict, False)
-    PlayerControl.NotifyCode(curPlayer, "GetMoney01", [IPY_GameWorld.TYPE_Price_Silver_Money, totalSellPrice])
+    for priceType, priceMoney in totalSellPriceDict.items():
+        #玩家钱增加
+        addDataDict = {}
+        PlayerControl.GiveMoney(curPlayer, priceType, priceMoney, ChConfig.Def_GiveMoney_SellPackItem, addDataDict, False)
+        PlayerControl.NotifyCode(curPlayer, "GetMoney01", [priceType, priceMoney])
     return True
 
 
@@ -1107,7 +1108,9 @@
     
     # 修改此函数请同时修改 脱机挂出售
     #当前物品价格 原价出售
-    priceType = IPY_GameWorld.TYPE_Price_Silver_Money
+    priceType = curItem.GetGoldPaperPrice()
+    if not priceType:
+        priceType = IPY_GameWorld.TYPE_Price_Silver_Money
     curItemPrice = curItem.GetSilverPrice()
     return curItemPrice, priceType
 

--
Gitblit v1.8.0