| | |
| | | #@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))
|
| | |
|
| | |
| | | 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
|
| | |
| | | # @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
|
| | |
|
| | | #===============================================================================
|
| | |
| | | # @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
|
| | | #---------------------------------------------------------------------
|
| | | #===============================================================================
|
| | |
| | | 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
|
| | |
|
| | | #===============================================================================
|