xdh
2019-04-13 10a2b69436a1ebb09fa49a339655e150bfda70a8
6457 新增GM命令 AddFairyEvent 事件ID 事件ID。。
1个文件已修改
1个文件已添加
78 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
New file
@@ -0,0 +1,73 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package GM.Commands.AddFairyEvent
#
# @todo:增加缥缈事件
# @author xdh
# @date 2019-4-13
# @version 1.0
#
# 详细描述: 增加缥缈事件
#
#---------------------------------------------------------------------
"""Version = 2019-4-13 16:00"""
#---------------------------------------------------------------------
import IpyGameDataPY
import GameWorld
import ChConfig
import PlayerFairyDomain
import PlayerControl
import ShareDefine
import random
#---------------------------------------------------------------------
#逻辑实现
## GM命令执行入口
#  @param curPlayer 当前玩家
#  @param msgList 参数列表
#  @return None
#  @remarks 函数详细说明.
def OnExec(curPlayer, msgList):
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "AddFairyEvent 事件ID")
        return
    fdEventIDList = msgList
    openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
    otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)
    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
    for i in xrange(maxEventCnt):
        prefdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
        if prefdEventID:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % prefdEventID, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % prefdEventID, 0)
        fdEventID = fdEventIDList[i] if i < len(fdEventIDList) else 0
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventID % i, fdEventID)
        if fdEventID:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdEventID, PlayerFairyDomain.FDEventState_CanVisit)
            if fdEventID in PlayerFairyDomain.AdventuresTypeList:
                ipyData = IpyGameDataPY.InterpolationSearch('FairyAdventures', 'OpenServerDay', openServerDay, {'EventID':fdEventID})
                if ipyData:
                    conditionList = ipyData.GetCondition()
                    condition = random.choice(conditionList)
                    index = conditionList.index(condition)
                    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
    #设置寻访中
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 1)
    #设置初始体力
    initEnergy = IpyGameDataPY.GetFuncCfg('ImmortalDomainStrength')
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEnergy, initEnergy)
    PlayerFairyDomain.NotifyVisitFairyDomainInfo(curPlayer, fdEventIDList)
    PlayerFairyDomain.NotifyFairyAdventuresInfo(curPlayer)
    GameWorld.DebugAnswer(curPlayer, "新增 事件 fdEventIDList=%s"%fdEventIDList)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -168,7 +168,8 @@
    for i in xrange(maxEventCnt):
        fdEventID = fdEventIDList[i] if i < len(fdEventIDList) else 0
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventID % i, fdEventID)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdEventID, FDEventState_CanVisit)
        if fdEventID:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainEventState % fdEventID, FDEventState_CanVisit)
    #设置寻访中
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 1)
    #设置初始体力
@@ -281,6 +282,8 @@
    maxEventCnt = max([info[1] for info in otherCntRateList]) + 1  #最大可出现事件个数
    for i in xrange(maxEventCnt):
        fdEventID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainEventID % i)
        if fdEventID not in AdventuresTypeList:
            continue
        adventuresdata = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyAdventuresData % fdEventID)
        if not adventuresdata:
            continue