8377 新增任务接口(上架橙装、购买橙装、货币变更、更新货币;活跃放置各状态接口)
| | |
| | | RunQuestEvent(curPlayer, "xbxz", MWID, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_AddAuctionEquip(curPlayer, color):
|
| | | # 上架装备拍品
|
| | | RunQuestEvent(curPlayer, "addauctionequip", color, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_BuyAuctionEquip(curPlayer, color):
|
| | | # 购买装备拍品
|
| | | RunQuestEvent(curPlayer, "buyauctionequip", color, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_OnMoneyChange(curPlayer, moneyType):
|
| | | # 货币变更时
|
| | | |
| | | # 暂开放灵石
|
| | | if moneyType not in [IPY_GameWorld.TYPE_Price_Gold_Paper]:
|
| | | return
|
| | | RunQuestEvent(curPlayer, "onmoneychange", moneyType, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_ActivityPlace(curPlayer, event, runall=True):
|
| | | ''' 活跃放置事件
|
| | | @param event: 可启动 canstart、启动 start、可领奖 cangetreward、领奖 getreward
|
| | | '''
|
| | | RunQuestEvent(curPlayer, "activityplace", event, Def_RunQuestType_RunAll if runall else Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #================================================================================
|
| | |
| | | value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Activity_TotalPoint, 0) >= value
|
| | |
|
| | | ##活跃放置判断可否领奖
|
| | | # @param None
|
| | | # @return None <Check_Activityplacereward />
|
| | | def ConditionType_Check_Activityplacereward(curPlayer, curMission, curActionNode):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount) > 0
|
| | |
|
| | | ##设置当前货币类型对应值
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Money key="任务存值key名" moneytype="货币类型"/>
|
| | | def DoType_Set_Money(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | moneytype = GameWorld.ToIntDef(curActionNode.GetAttribute("moneytype"), 0)
|
| | | if not moneytype:
|
| | | return
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, PlayerControl.GetMoney(curPlayer, moneytype))
|
| | | return
|
| | |
|
| | | ##设置仙宝寻主领奖进度
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | |
| | | return
|
| | | updPoint = curPoint + addValue
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, updPoint)
|
| | | |
| | | costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
|
| | | if updPoint >= costPoint:
|
| | | EventShell.EventRespons_ActivityPlace(curPlayer, "canstart", True)
|
| | | return
|
| | |
|
| | | def CostActivityPoint(curPlayer, costPoint, isOnlyCheck=False):
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceExpCount, 0)
|
| | | GameWorld.DebugLog(" 没有剩余次数,更新启动时间: %s" % curTime)
|
| | |
|
| | | EventShell.EventRespons_ActivityPlace(curPlayer, "start")
|
| | | |
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | if isQuick:
|
| | | PlayerControl.NotifyCode(curPlayer, "ActivityPlaceQuickFinishOK")
|
| | |
|
| | | EventShell.EventRespons_ActivityPlace(curPlayer, "cangetreward")
|
| | | |
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | GameWorld.DebugLog("领取活跃放置奖励: rewardItemCount=%s,rewardItemList=%s" % (rewardItemCount, rewardItemList))
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, rewardItemList)
|
| | |
|
| | | EventShell.EventRespons_ActivityPlace(curPlayer, "getreward")
|
| | | |
| | | Sync_ActivityPlaceInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | import ChConfig
|
| | | import ShareDefine
|
| | | import PlayerActivity
|
| | | import EventShell
|
| | | import NPCCommon
|
| | |
|
| | | import random
|
| | |
| | |
|
| | | #扣物品
|
| | | if curPlayer and not familyID:
|
| | | if ItemCommon.CheckItemIsEquip(curItem):
|
| | | EventShell.EventRespons_AddAuctionEquip(curPlayer, curItem.GetItemColor())
|
| | | ItemCommon.DelItem(curPlayer, curItem, curItem.GetCount())
|
| | | else:
|
| | | if not ItemControler.GetIsAuctionItem(curItem):
|
| | |
| | | elif type_Price == IPY_GameWorld.TYPE_Price_Silver_Paper:
|
| | | __PayMoneyAfterBySilverPaper(curPlayer, price)
|
| | |
|
| | | EventShell.EventRespons_OnMoneyChange(curPlayer, type_Price)
|
| | | |
| | | #活跃度处理
|
| | | PlayerActivity.OnPayMoneyActivity(curPlayer, type_Price, price)
|
| | |
|
| | |
| | |
|
| | | def __GiveMoneyAfter(curPlayer, priceType, value, giveType, addDataDict):
|
| | | # 除钻石及绑钻外,未指定操作类型的不记录
|
| | | |
| | | EventShell.EventRespons_OnMoneyChange(curPlayer, priceType)
|
| | | |
| | | if priceType not in [IPY_GameWorld.TYPE_Price_Gold_Money, IPY_GameWorld.TYPE_Price_Gold_Paper] \
|
| | | and giveType == ChConfig.Def_GiveMoney_Unknown:
|
| | | #GameWorld.DebugLog("该货币没有指定来源类型不记录!priceType=%s,giveType=%s" % (priceType, giveType))
|
| | |
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import EventShell
|
| | | import ChConfig
|
| | |
|
| | |
|
| | |
| | | curCreateItem.SetUserData(userData, len(userData))
|
| | | ItemCommon.MakeEquipGS(curCreateItem)
|
| | |
|
| | | if ItemCommon.CheckItemIsEquip(curCreateItem):
|
| | | EventShell.EventRespons_BuyAuctionEquip(curPlayer, curCreateItem.GetItemColor())
|
| | | |
| | | drDict = {"ItemGUID":itemGUID, "ItemID":itemID, "ItemCount":itemCount, "UserData":userData}
|
| | | isOK = ItemControler.DoLogic_PutItemInPack(curPlayer, curCreateItem, event=[ChConfig.ItemGive_BourseItem, True, drDict],
|
| | | packIndexList=[IPY_GameWorld.rptItem])
|