5107 【越南】【香港】【主干】【砍树】神兵系统修改(神兵技能支持升级;增加神兵命令 GodWeapon)
1个文件已修改
1个文件已添加
89 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/GodWeapon.py 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/GodWeapon.py
New file
@@ -0,0 +1,54 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.GodWeapon
#
# @todo:神兵
# @author hxp
# @date 2024-08-15
# @version 1.0
#
# 详细描述: 神兵
#
#-------------------------------------------------------------------------------
#"""Version = 2024-08-15 16:30"""
#-------------------------------------------------------------------------------
import ChConfig
import PlayerControl
import PlayerGodWeapon
import GameWorld
## GM命令执行入口
#  @param curPlayer 当前玩家
#  @param msgList 参数列表
#  @return None
#  @remarks 函数详细说明.
def OnExec(curPlayer, msgList):
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "重置神兵: GodWeapon 0")
        GameWorld.DebugAnswer(curPlayer, "设置神兵: GodWeapon 类型 等级 经验")
        GameWorld.DebugAnswer(curPlayer, "类型: 1-生命;2-攻击;3-暴击;4-护盾")
        GameWorld.DebugAnswer(curPlayer, "注: 神兵技能成就任务等需要手动升级才有效")
        return
    weaponTypeList = [1, 2, 3, 4]
    if msgList[0] == 0:
        for weaponType in weaponTypeList:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GodWeaponLV % weaponType, 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GodWeaponExp % weaponType, 0)
        PlayerGodWeapon.Sync_GodWeaponLVInfo(curPlayer)
    else:
        weaponType = msgList[0]
        if weaponType not in weaponTypeList:
            GameWorld.DebugAnswer(curPlayer, "神兵类型不存在! %s" % weaponType)
            return
        weaponLV = msgList[1] if len(msgList) > 1 else 1
        weaponExp = msgList[2] if len(msgList) > 2 else 0
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GodWeaponLV % weaponType, weaponLV)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GodWeaponExp % weaponType, weaponExp)
        PlayerGodWeapon.Sync_GodWeaponLVInfo(curPlayer, weaponType)
    PlayerGodWeapon.RefreshGodWeaponAttr(curPlayer)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
@@ -376,30 +376,43 @@
def __GiveGodWeaponSkill(curPlayer, skillResId):
def __GiveGodWeaponSkill(curPlayer, skillID):
    # 神器学习技能
    skillManager = curPlayer.GetSkillManager()
    if skillManager.FindSkillBySkillTypeID(skillResId):
        GameWorld.DebugLog("godSkill() have learned skill(%s)" % skillResId)
    if skillManager.FindSkillBySkillID(skillID):
        GameWorld.DebugLog("godSkill() have learned skill(%s)" % skillID)
        return
    
    skillData = GameWorld.GetGameData().FindSkillByType(skillResId, 1)
    skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
    if skillData == None:
        GameWorld.DebugLog("godSkill() hasn't find skill(%s)" % skillResId)
        GameWorld.DebugLog("godSkill() hasn't find skill(%s)" % skillID)
        return
    if not SkillShell.CheckLearnSkillCondition(curPlayer, skillData):
        GameWorld.DebugLog("godSkill() learn skill(%s) condition isn't enough" % skillResId)
        GameWorld.DebugLog("godSkill() learn skill(%s) condition isn't enough" % skillID)
        return
    skillLV = skillData.GetSkillLV()
    skillTypeID = skillData.GetSkillTypeID()
    
    skillManager.LVUpSkillBySkillTypeID(skillResId)
    befSkillID, beforeFightPower = 0, 0
    befSkill = skillManager.FindSkillBySkillTypeID(skillTypeID)
    if befSkill:
        befSkillLV = befSkill.GetSkillLV()
        befSkillID = befSkill.GetSkillID()
        beforeFightPower = befSkill.GetFightPower()
        if skillLV <= befSkillLV:
            GameWorld.DebugLog("godSkill() learn skill(%s) skillLV(%s) <= befSkillLV(%s),befSkillID=%s no need learn."
                               % (skillID, skillLV, befSkillLV, befSkillID))
            return
    skillManager.LearnSkillByID(skillID)
    #PlayerControl.NotifyCode(curPlayer, "Skill_andyshao_31379", [skillResId])
    GameWorld.DebugLog("godSkill() skill(%s) success!" % skillResId)
    DataRecordPack.DR_LearnORUPSkill(curPlayer, skillResId, 0)
    GameWorld.DebugLog("godSkill() skill(%s) success! befSkillID=%s,beforeFightPower=%s" % (skillID, befSkillID, beforeFightPower))
    DataRecordPack.DR_LearnORUPSkill(curPlayer, skillID, 0)
    
    #if SkillCommon.isPassiveSkill(skillData):
    #    buffType = SkillCommon.GetBuffType(skillData)
    #    BuffSkill.DoAddBuff(curPlayer, buffType, skillData, GameWorld.GetGameWorld().GetTick(), [], curPlayer)
    PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer, skillResId)
    PlayerControl.PlayerControl(curPlayer).RefreshSkillFightPowerEx(skillResId, 0)
    PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer, skillID)
    PlayerControl.PlayerControl(curPlayer).RefreshSkillFightPowerEx(skillID, beforeFightPower)
    return True