10202 【越南】【香港】【主干】【砍树】聚魂(增加聚魂战令6; 增加战令GM命令: Zhanling)
2个文件已修改
1个文件已添加
90 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhanling.py 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGatherTheSoul.py 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerZhanling.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhanling.py
New file
@@ -0,0 +1,72 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.Zhanling
#
# @todo:战令
# @author hxp
# @date 2024-07-12
# @version 1.0
#
# 详细描述: 战令
#
#-------------------------------------------------------------------------------
#"""Version = 2024-07-12 19:00"""
#-------------------------------------------------------------------------------
import ChConfig
import PlayerControl
import PlayerZhanling
import GameWorld
#---------------------------------------------------------------------
#逻辑实现
## GM命令执行入口
#  @param curPlayer 当前玩家
#  @param msgList 参数列表
#  @return None
#  @remarks 函数详细说明.
def OnExec(curPlayer, msgList):
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "重置奖励: Zhanling 0 类型")
        GameWorld.DebugAnswer(curPlayer, "设置战令: Zhanling 类型 是否激活普通   高级")
        return
    value = msgList[0]
    if value == 0:
        zhanlingType = msgList[1] if len(msgList) > 1 else 1
        for keyNum in range(10):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingReward % (zhanlingType, keyNum), 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingRewardH % (zhanlingType, keyNum), 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingRewardFree % (zhanlingType, keyNum), 0)
        PlayerZhanling.SyncZhanlingInfo(curPlayer, zhanlingType)
        GameWorld.DebugAnswer(curPlayer, "重置战令(%s)奖励!" % (zhanlingType))
    else:
        zhanlingType = value
        activiteC = msgList[1] if len(msgList) > 1 else 0
        activiteH = msgList[2] if len(msgList) > 2 else 0
        state = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingState)
        if activiteC:
            updState = state|pow(2, zhanlingType)
        else:
            updState = state&(pow(2, 31 + 1) - 1 - pow(2, zhanlingType))
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingState, updState)
        state = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingStateH)
        if activiteH:
            updState = state|pow(2, zhanlingType)
        else:
            updState = state&(pow(2, 31 + 1) - 1 - pow(2, zhanlingType))
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingStateH, updState)
        PlayerZhanling.SyncZhanlingInfo(curPlayer, zhanlingType)
        GameWorld.DebugAnswer(curPlayer, "设置战令类型:%s 普通:%s 高级:%s" % (zhanlingType, activiteC, activiteH))
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGatherTheSoul.py
@@ -169,6 +169,18 @@
    RefreshGatherTheSoulAttr(curPlayer, True)
    return
def GetGatherTheSoulTotalLV(curPlayer):
    totalSoulLV = 0
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for index in range(ipyDataMgr.GetGatherTheSoulCount()):
        ipyData = ipyDataMgr.GetGatherTheSoulByIndex(index)
        soulID = ipyData.GetSoulID()
        soulLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GatherTheSoulLV % soulID)
        if not soulLV:
            continue
        totalSoulLV += soulLV
    return totalSoulLV
def GetHoleSoulColorCount(curPlayer, soulColor, isDownward):
    ## 获取镶嵌聚魂品质个数
    colorCount = 0
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerZhanling.py
@@ -20,6 +20,7 @@
import IpyGameDataPY
import PlayerControl
import ChPyNetSendPack
import PlayerGatherTheSoul
import ItemControler
import IPY_GameWorld
import PlayerGubao
@@ -33,7 +34,8 @@
ZhanlingType_SkyTower,
ZhanlingType_GubaoStar,
ZhanlingType_Login,
) = range(1, 1 + 5)
ZhanlingType_GatherTheSoulLV,
) = range(1, 1 + 6)
def OnPlayerLogin(curPlayer):
    for zhanlingType in ZhanlingTypeList:
@@ -103,6 +105,8 @@
        if not firstLoginTime:
            return
        curValue = GameWorld.GetDiff_Day(int(time.time()), firstLoginTime) + 1      
    elif zhanlingType == ZhanlingType_GatherTheSoulLV:
        curValue = PlayerGatherTheSoul.GetGatherTheSoulTotalLV(curPlayer)
    else:
        return