374 【活动内容】开服庆典-服务端(庆典入口关闭后自动转化未使用的庆典积分)
| | |
| | | Def_ItemID_VIPExperience = 985 # VIP体验卡
|
| | |
|
| | | # 直接转换为对应数值的物品ID列表
|
| | | Def_ItemID_GoldMoney = 20 # 直接给仙玉
|
| | | Def_ItemID_GoldMoney = 1 # 直接给仙玉/元宝
|
| | | Def_ItemID_SilverMoney = 22 # 直接给铜钱
|
| | | Def_ItemID_FamilyContribution = 26 # 直接给战盟贡献点
|
| | | Def_ItemID_SP = 29 # 直接给sp
|
| | |
| | | Def_ItemID_FuncSysPrivilege, Def_ItemID_FCPartyPoint, Def_ItemID_BTGMPoint, Def_ItemID_GuShenMoney,
|
| | | Def_ItemID_GongdePoint, Def_ItemID_TongTianPoint,
|
| | | Def_ItemID_FamilyFlagWarPoint]
|
| | | # 货币类型对应直接给货币物品ID
|
| | | MoneyItemIDDict = {IPY_GameWorld.TYPE_Price_Gold_Money:Def_ItemID_GoldMoney,
|
| | | IPY_GameWorld.TYPE_Price_Gold_Paper:Def_ItemID_GoldPaper,
|
| | | ShareDefine.TYPE_Price_GongdePoint:Def_ItemID_GongdePoint,
|
| | | ShareDefine.TYPE_Price_FamilyFlagWarPoint:Def_ItemID_FamilyFlagWarPoint,
|
| | | }
|
| | | #---------------------------------------------------------------------
|
| | | #写死的物品类型都放这边
|
| | | Def_ItemType_All = -1 #所有类型
|
| | |
| | | import PlayerOnline
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ItemCommon
|
| | | import BattleObj
|
| | | import ChPlayer
|
| | | import ObjPool
|
| | |
| | | serverID = GameWorld.GetGameWorld().GetServerID()
|
| | | GameWorld.Log("服务器启动初始化InitGameWorld: serverID=%s" % serverID)
|
| | | DBDataMgr.OnServerStart() # 优先加载公共数据
|
| | | ItemCommon.InitPyItem()
|
| | | LoadDBPlayer()
|
| | | PlayerViewCache.LoadRobot()
|
| | | PyGameData.g_initGameTime = int(time.time()) # 放到加载数据之后
|
| | |
| | | # @remarks 函数详细说明 每条分线都会触发该函数
|
| | | def InitGameWorld(tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | ItemCommon.InitPyItem()
|
| | | #处理副本逻辑
|
| | | FBLogic.OnInit(tick)
|
| | | #初始化地图时钟
|
| | |
| | | PyGameData.EquipItemSkillIDList = []
|
| | | PyGameData.DailyUseCountLimitItemIDList = []
|
| | | PyGameData.AutoTransformCountItemIDList = []
|
| | | PyGameData.MoneyItemIDDict = {}
|
| | |
|
| | | gameData = GameWorld.GetGameData()
|
| | | for i in range(0, gameData.GetItemCount()):
|
| | |
| | | PyGameData.g_stoneLevelIDDict[(stoneEffType, stoneLevel)] = itemID
|
| | | elif curEffID == ChConfig.Def_Effect_ItemCount:
|
| | | PyGameData.AutoTransformCountItemIDList.append(itemID)
|
| | | elif curEffID == ChConfig.Def_Effect_ItemGiveMoney:
|
| | | moneyValue = itemEff.GetEffectValue(0)
|
| | | moneyType = itemEff.GetEffectValue(1)
|
| | | if moneyValue == 1 and moneyType:
|
| | | PyGameData.MoneyItemIDDict[moneyType] = itemID
|
| | |
|
| | | if GetIsEquip(findItemData):
|
| | | for skillIndex in xrange(findItemData.GetAddSkillCount()):
|
| | |
| | |
|
| | | if PyGameData.AutoTransformCountItemIDList:
|
| | | GameWorld.Log("自动转化为物品个数的物品ID列表: %s" % PyGameData.AutoTransformCountItemIDList)
|
| | | |
| | | GameWorld.Log("货币类型1个数量对应物品ID: %s" % PyGameData.MoneyItemIDDict)
|
| | | |
| | | PyGameData.InitPyItem = True
|
| | | return
|
| | |
|
| | | def GetMoneyItemID(moneyType):
|
| | | ## 获取货币类型对应的物品ID
|
| | | if moneyType not in PyGameData.MoneyItemIDDict:
|
| | | GameWorld.ErrLog("没有该货币类型对应的物品ID! moneyType=%s" % moneyType)
|
| | | return 0
|
| | | return PyGameData.MoneyItemIDDict[moneyType]
|
| | |
|
| | | ## 物品触发技能增加buff
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curItem 物品
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import DBDataMgr
|
| | | import PlayerMail
|
| | | import ShareDefine
|
| | | import GameFuncComm
|
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | | import PlayerTreasure
|
| | | import PlayerBillboard
|
| | |
| | | import PlayerControl
|
| | | import NetPackCommon
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ObjPool
|
| | | import math
|
| | |
|
| | | # 开服冲榜类型对应功能ID
|
| | | OSAFuncIDDict = {
|
| | |
| | | ## ------------------------------------------- 开服庆典 ---------------------------------------------
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | if GetOSACelebrationState(curPlayer) == 3:
|
| | | __autoChangeCelebrationPoint(curPlayer)
|
| | | return
|
| | | SyncOSACelebrationInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | if GetOSACelebrationState(curPlayer) == 3:
|
| | | __autoChangeCelebrationPoint(curPlayer)
|
| | | return
|
| | | return
|
| | |
|
| | | def __autoChangeCelebrationPoint(curPlayer):
|
| | | ## 活动结束后自动转换庆典积分
|
| | | unUsePoint = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_OSAPoint)
|
| | | if unUsePoint <= 0:
|
| | | return
|
| | | moneyItemID = ItemCommon.GetMoneyItemID(IPY_GameWorld.TYPE_Price_Gold_Money)
|
| | | if not moneyItemID:
|
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | oneNeedPoint = IpyGameDataPY.GetFuncCfg("OSACelebration", 3) # 多少积分=1元宝
|
| | | changeMoney = int(math.ceil(unUsePoint / float(oneNeedPoint)))
|
| | | itemList = [[moneyItemID, changeMoney]]
|
| | | GameWorld.DebugLog("自动转化未使用的庆典积分: unUsePoint=%s,oneNeedPoint=%s,changeMoney=%s,itemList=%s" |
| | | % (unUsePoint, oneNeedPoint, changeMoney, itemList), playerID)
|
| | | PlayerMail.SendMailByKey("OSACelebrationPoint", playerID, itemList)
|
| | | return
|
| | |
|
| | | def GetOSACelebrationState(curPlayer):
|
| | | ## 玩家是否在开服庆典活动中
|
| | | # @return: 0-未开启;1-活动中;2-结束显示期;3-结束关闭期
|
| | |
| | | PlayerActivity.OnDay(curPlayer)
|
| | | PlayerLLMJ.PlayerOnDay(curPlayer)
|
| | | FunctionNPCCommon.ShopItemOnDay(curPlayer)
|
| | | OpenServerActivity.PlayerOnDay(curPlayer)
|
| | |
|
| | | # 特殊时间点X点过天
|
| | | elif onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | |
| | | DailyUseCountLimitItemIDList = [] # 每日有使用个数限制的物品ID列表
|
| | | EquipItemSkillIDList = [] # 装备技能ID列表
|
| | | AutoTransformCountItemIDList = [] # 自动转化为对应物品个数的物品ID列表
|
| | | MoneyItemIDDict = {} # 货币类型1个数量对应物品ID字典 {moneyType:itemID, ...}
|
| | | g_stoneLevelIDDict = {} # 宝石类型等级对应物品ID {(stoneEffType, stoneLevel):itemID, ...}
|
| | |
|
| | | g_refreshAttrBillboardFunc = [] # 刷属性后需要触发的同步排行榜函数列表
|