hxp
2025-10-30 47eb171907516123892ea3f5d1888c6394c72382
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -78,7 +78,6 @@
import ItemCommon
import ShareDefine
import PlayerCoat
import PlayerGatherSoul
import PlayerRune
import IpyGameDataPY
import NPCCommon
@@ -132,10 +131,10 @@
#@remarks 远程执行NPC功能
def FuncDirectCall(curPlayer, responseType, funcAnswer, tick, clientData=None):
    #远程事件,状态统一判断
    if not FunctionNPCCommon.CheckPlayerCanStateEvent(curPlayer):
        #退出回包
        SyncMakeItemRefuse(curPlayer, funcAnswer)
        return
    #if not FunctionNPCCommon.CheckPlayerCanStateEvent(curPlayer):
    #    #退出回包
    #    SyncMakeItemRefuse(curPlayer, funcAnswer)
    #    return
    
    callFunc = GameWorld.GetExecFunc(EventSrc, "%s.%s"%(responseType, funcAnswer))
    
@@ -192,36 +191,6 @@
    return GameWorld.GetPsycoFunc(callFunc)(curPlayer, tick)
#===============================================================================
# //08 03 玩家购买物品#tagCBuyItemList
# tagCBuyItemList       *   GettagCBuyItemList();
#
# class   IPY_CBuyItemList
# {
# public:
#
#    int      GetBuyItemIndex();
#    //购买数量
#    int      GetBuyCount();
# };
#===============================================================================
##客户端封包响应//08 03 玩家购买物品#tagCBuyItemList
#@param index 玩家索引
#@param tick 时间戳
#@return 返回值无意义
#@remarks 客户端封包响应//08 03 玩家购买物品#tagCBuyItemList
def BuyItem(index, tick):
    #得到玩家的对象
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    result = FuncDirectCall(curPlayer, "FunctionNPCCommon", "BuyItem", tick)
    if result:
        PlayerControl.NotifyCode(curPlayer, "BuyResSucceed")
    return
#===============================================================================
# //A2 03 回购物品 #tagCMBuyItemBack
# struct tagCMBuyItemBack
@@ -235,31 +204,8 @@
#  @return None
def BuyItemBack(index, clientPack, tick):
    #得到玩家的对象
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    FunctionNPCCommon.BuyItemBack(curPlayer, clientPack, tick)
    return
#===============================================================================
# //08 06 卖物品#tagCPlayerSellItem
# tagCPlayerSellItem       *   GettagCPlayerSellItem();
#
# class   IPY_CPlayerSellItem
# {
# public:
#    //背包类型
#    int      GetPackType();
#    //物品索引
#    int      GetItemIndex();
# };
#===============================================================================
##客户端封包响应//08 06 卖物品#tagCPlayerSellItem
#@param index 玩家索引
#@param tick 时间戳
#@return 返回值无意义
#@remarks 客户端封包响应//08 06 卖物品#tagCPlayerSellItem
def SellItem(index, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    FuncDirectCall(curPlayer, "FunctionNPCCommon", "SellItem", tick)
    #curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    #FunctionNPCCommon.BuyItemBack(curPlayer, clientPack, tick)
    return
#===============================================================================
@@ -386,16 +332,16 @@
#  @return 无返回值
#  @remarks 07 3C通用背包操作#tagCBackpackOperate
def BackpackOperate(index, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    sendPack = IPY_GameWorld.IPY_CBackpackOperate()
    pack_SrcBackpack = sendPack.GetSrcBackpack()
    pack_DesBackPack = sendPack.GetDesBackPack()
    pack_SrcIndex = sendPack.GetSrcIndex()
    pack_DestIndex = sendPack.GetDestIndex()
    pack_ItemCount = sendPack.GetCount()
    FunctionNPCCommon.BackpackOperate(curPlayer, pack_SrcBackpack, pack_DesBackPack,
                                          pack_SrcIndex, pack_DestIndex, pack_ItemCount, tick)
#    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
#    sendPack = IPY_GameWorld.IPY_CBackpackOperate()
#    pack_SrcBackpack = sendPack.GetSrcBackpack()
#    pack_DesBackPack = sendPack.GetDesBackPack()
#    pack_SrcIndex = sendPack.GetSrcIndex()
#    pack_DestIndex = sendPack.GetDestIndex()
#    pack_ItemCount = sendPack.GetCount()
#
#    FunctionNPCCommon.BackpackOperate(curPlayer, pack_SrcBackpack, pack_DesBackPack,
#                                          pack_SrcIndex, pack_DestIndex, pack_ItemCount, tick)
    return
#---------------------------------------------------------------------
#===============================================================================
@@ -425,16 +371,13 @@
    # 符印交换
    if PlayerRune.SwitchRune(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):
        return
    # 聚魂交换
    if PlayerGatherSoul.SwitchGatherSoul(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):
        return
    
    #ʱװ
    if PlayerCoat.SwitchCoat(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):
        return
    
    FunctionNPCCommon.PackItemExchange(curPlayer, pack_SrcBackpack, pack_DesBackPack,
                                          pack_SrcIndex, pack_DestIndex, tick)
    #FunctionNPCCommon.PackItemExchange(curPlayer, pack_SrcBackpack, pack_DesBackPack,
    #                                      pack_SrcIndex, pack_DestIndex, tick)
    return
#===============================================================================