From 3128b603606057b8b6ddbaf6a86e4493b4ce292a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 17 十二月 2019 18:22:39 +0800
Subject: [PATCH] 8358 【主干】【后端】坐骑修改
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSignDay.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py | 8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py | 18
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 103 --
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_510.py | 25
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py | 18
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 103 --
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py | 8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Cross.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 64 ++
PySysDB/PySysDBPY.h | 24
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py | 14
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_511.py | 49
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py | 9
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py | 1100 ++++++++++---------------------------
/dev/null | 46 -
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSignDay.py | 3
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Horse.py | 59 ++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py | 43
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py | 10
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 9
25 files changed, 587 insertions(+), 1,151 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index d608cc5..6a8bed5 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -348,6 +348,30 @@
char SysMark; //广播提示
};
+//坐骑升级表
+
+struct tagHorseLVUp
+{
+ BYTE _HorseLV; //坐骑等级
+ DWORD HorseSkinID; //外观物品ID
+ WORD NeedEatCount; //升级所需个数(非累计)
+ list LVAttrType; //每级额外属性类型(非累积)
+ list LVAttrValue; //每级额外属性值(非累积)
+};
+
+//坐骑幻化表
+
+struct tagHorseSkinPlus
+{
+ BYTE _ID; //幻化编号ID
+ DWORD HorseSkinPlusID; //外观物品ID
+ DWORD UnlockItemID; //解锁坐骑物品编号
+ BYTE UnlockItemCnt; //解锁所需物品数量
+ list AttrType; //激活加成属性类型
+ list AttrValue; //激活加成属性值
+ DWORD InitFightPower; //皮肤额外战力
+};
+
//玩家等级表
struct tagPlayerLV
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 08ec62a..4a4ef65 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -7905,7 +7905,7 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("HorseID", c_int), #坐骑ID
+ ("HorseID", c_int), #坐骑幻化ID
]
def __init__(self):
@@ -10444,7 +10444,6 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("HorseID", c_int), #坐骑ID
("UseItemCnt", c_ubyte), #消耗材料个数
("IsAutoBuy", c_ubyte), #是否自动购买
]
@@ -10463,7 +10462,6 @@
def Clear(self):
self.Cmd = 0xA5
self.SubCmd = 0x27
- self.HorseID = 0
self.UseItemCnt = 0
self.IsAutoBuy = 0
return
@@ -10478,14 +10476,12 @@
DumpString = '''// A5 27 坐骑提升 //tagCMHorseUp:
Cmd:%s,
SubCmd:%s,
- HorseID:%d,
UseItemCnt:%d,
IsAutoBuy:%d
'''\
%(
self.Cmd,
self.SubCmd,
- self.HorseID,
self.UseItemCnt,
self.IsAutoBuy
)
@@ -10656,7 +10652,8 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("Index", c_int), #选择索引
+ ("ChooseType", c_ubyte), # 1-按等阶,2-按幻化
+ ("LVID", c_ubyte), # 阶等级或幻化ID
]
def __init__(self):
@@ -10673,7 +10670,8 @@
def Clear(self):
self.Cmd = 0xA5
self.SubCmd = 0x02
- self.Index = 0
+ self.ChooseType = 0
+ self.LVID = 0
return
def GetLength(self):
@@ -10686,12 +10684,14 @@
DumpString = '''//A5 02 坐骑选择 //tagPlayerChooseHorse:
Cmd:%s,
SubCmd:%s,
- Index:%d
+ ChooseType:%d,
+ LVID:%d
'''\
%(
self.Cmd,
self.SubCmd,
- self.Index
+ self.ChooseType,
+ self.LVID
)
return DumpString
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 50f31f9..3b45d4a 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -19143,16 +19143,20 @@
#------------------------------------------------------
#A3 01 坐骑培养信息 #tagTrainHorseData
-class tagMCHorseInfo(Structure):
+class tagTrainHorseData(Structure):
_pack_ = 1
_fields_ = [
- ("HorseID", c_int), #ID
- ("LV", c_ubyte), #等级
- ("Exp", c_int), #经验
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("LV", c_ubyte), #等阶
+ ("EatItemCount", c_ushort), #当前阶已吃丹个数
+ ("SkinPlusState", c_int), #幻化激活状态,按位存储是否激活,幻化编号ID对应位
]
def __init__(self):
self.Clear()
+ self.Cmd = 0xA3
+ self.SubCmd = 0x01
return
def ReadData(self, stringData, _pos=0, _len=0):
@@ -19161,102 +19165,39 @@
return _pos + self.GetLength()
def Clear(self):
- self.HorseID = 0
+ self.Cmd = 0xA3
+ self.SubCmd = 0x01
self.LV = 0
- self.Exp = 0
+ self.EatItemCount = 0
+ self.SkinPlusState = 0
return
def GetLength(self):
- return sizeof(tagMCHorseInfo)
+ return sizeof(tagTrainHorseData)
def GetBuffer(self):
return string_at(addressof(self), self.GetLength())
def OutputString(self):
DumpString = '''//A3 01 坐骑培养信息 //tagTrainHorseData:
- HorseID:%d,
+ Cmd:%s,
+ SubCmd:%s,
LV:%d,
- Exp:%d
+ EatItemCount:%d,
+ SkinPlusState:%d
'''\
%(
- self.HorseID,
+ self.Cmd,
+ self.SubCmd,
self.LV,
- self.Exp
- )
- return DumpString
-
-
-class tagTrainHorseData(Structure):
- Head = tagHead()
- Multiple = 0 #(BYTE Multiple)//下次暴击倍数
- Num = 0 #(BYTE Num)//个数
- InfoList = list() #(vector<tagMCHorseInfo> InfoList)// 坐骑数据列表
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x01
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.Multiple,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- for i in range(self.Num):
- temInfoList = tagMCHorseInfo()
- _pos = temInfoList.ReadData(_lpData, _pos)
- self.InfoList.append(temInfoList)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x01
- self.Multiple = 0
- self.Num = 0
- self.InfoList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- length += 1
- for i in range(self.Num):
- length += self.InfoList[i].GetLength()
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteBYTE(data, self.Multiple)
- data = CommFunc.WriteBYTE(data, self.Num)
- for i in range(self.Num):
- data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Multiple:%d,
- Num:%d,
- InfoList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Multiple,
- self.Num,
- "..."
+ self.EatItemCount,
+ self.SkinPlusState
)
return DumpString
m_NAtagTrainHorseData=tagTrainHorseData()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Head.Cmd,m_NAtagTrainHorseData.Head.SubCmd))] = m_NAtagTrainHorseData
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Cmd,m_NAtagTrainHorseData.SubCmd))] = m_NAtagTrainHorseData
#------------------------------------------------------
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index e05b503..ec439b6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3803,10 +3803,11 @@
Def_PDict_OSC_RecordData = "OSCRecordData_%s" # 开服活动记录数值, 参数(活动类型)
Def_PDict_OSC_EndMailState = "EndMailState" # 开服活动结束发放邮件处理状态, 记录该状态的目的是防止开服活动版本变更导致旧号重复补发奖励;
-# 坐骑 Def_PDictType_Horse
-Def_PDict_Horser_LV = "Horser_LV_%d" # 坐骑等级 0代表未激活 1代表1级
-Def_PDict_Horser_Exp = "Horser_Exp_%d" # 坐骑经验
-Def_PDict_Horser_Multiple = "Horser_Multiple" # 坐骑下次升阶暴击倍数
+# 坐骑
+Def_PDict_HorserLV = "HorserLV" # 坐骑等级
+Def_PDict_HorserEatItemCount = "HorserEatItemCount" # 当前阶已吃培养丹个数
+Def_PDict_HorserSkinPlusState = "HorserSkinPlusState" # 坐骑幻化皮肤激活状态,按二进制位存储,每位代表幻化ID是否已激活
+
#骑宠觉醒
Def_PDict_HorsePetSkinData = "HorsePetSkinData%d_%s" #觉醒等级*100+外观索引 参数(类型,关联ID) 1-坐骑 2-灵宠
Def_PDict_HorsePetSkinExp = "HorsePetSkinExp%d_%s" #经验 参数(类型,关联ID) 1-坐骑 2-灵宠
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 08ec62a..4a4ef65 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -7905,7 +7905,7 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("HorseID", c_int), #坐骑ID
+ ("HorseID", c_int), #坐骑幻化ID
]
def __init__(self):
@@ -10444,7 +10444,6 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("HorseID", c_int), #坐骑ID
("UseItemCnt", c_ubyte), #消耗材料个数
("IsAutoBuy", c_ubyte), #是否自动购买
]
@@ -10463,7 +10462,6 @@
def Clear(self):
self.Cmd = 0xA5
self.SubCmd = 0x27
- self.HorseID = 0
self.UseItemCnt = 0
self.IsAutoBuy = 0
return
@@ -10478,14 +10476,12 @@
DumpString = '''// A5 27 坐骑提升 //tagCMHorseUp:
Cmd:%s,
SubCmd:%s,
- HorseID:%d,
UseItemCnt:%d,
IsAutoBuy:%d
'''\
%(
self.Cmd,
self.SubCmd,
- self.HorseID,
self.UseItemCnt,
self.IsAutoBuy
)
@@ -10656,7 +10652,8 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("Index", c_int), #选择索引
+ ("ChooseType", c_ubyte), # 1-按等阶,2-按幻化
+ ("LVID", c_ubyte), # 阶等级或幻化ID
]
def __init__(self):
@@ -10673,7 +10670,8 @@
def Clear(self):
self.Cmd = 0xA5
self.SubCmd = 0x02
- self.Index = 0
+ self.ChooseType = 0
+ self.LVID = 0
return
def GetLength(self):
@@ -10686,12 +10684,14 @@
DumpString = '''//A5 02 坐骑选择 //tagPlayerChooseHorse:
Cmd:%s,
SubCmd:%s,
- Index:%d
+ ChooseType:%d,
+ LVID:%d
'''\
%(
self.Cmd,
self.SubCmd,
- self.Index
+ self.ChooseType,
+ self.LVID
)
return DumpString
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 50f31f9..3b45d4a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -19143,16 +19143,20 @@
#------------------------------------------------------
#A3 01 坐骑培养信息 #tagTrainHorseData
-class tagMCHorseInfo(Structure):
+class tagTrainHorseData(Structure):
_pack_ = 1
_fields_ = [
- ("HorseID", c_int), #ID
- ("LV", c_ubyte), #等级
- ("Exp", c_int), #经验
+ ("Cmd", c_ubyte),
+ ("SubCmd", c_ubyte),
+ ("LV", c_ubyte), #等阶
+ ("EatItemCount", c_ushort), #当前阶已吃丹个数
+ ("SkinPlusState", c_int), #幻化激活状态,按位存储是否激活,幻化编号ID对应位
]
def __init__(self):
self.Clear()
+ self.Cmd = 0xA3
+ self.SubCmd = 0x01
return
def ReadData(self, stringData, _pos=0, _len=0):
@@ -19161,102 +19165,39 @@
return _pos + self.GetLength()
def Clear(self):
- self.HorseID = 0
+ self.Cmd = 0xA3
+ self.SubCmd = 0x01
self.LV = 0
- self.Exp = 0
+ self.EatItemCount = 0
+ self.SkinPlusState = 0
return
def GetLength(self):
- return sizeof(tagMCHorseInfo)
+ return sizeof(tagTrainHorseData)
def GetBuffer(self):
return string_at(addressof(self), self.GetLength())
def OutputString(self):
DumpString = '''//A3 01 坐骑培养信息 //tagTrainHorseData:
- HorseID:%d,
+ Cmd:%s,
+ SubCmd:%s,
LV:%d,
- Exp:%d
+ EatItemCount:%d,
+ SkinPlusState:%d
'''\
%(
- self.HorseID,
+ self.Cmd,
+ self.SubCmd,
self.LV,
- self.Exp
- )
- return DumpString
-
-
-class tagTrainHorseData(Structure):
- Head = tagHead()
- Multiple = 0 #(BYTE Multiple)//下次暴击倍数
- Num = 0 #(BYTE Num)//个数
- InfoList = list() #(vector<tagMCHorseInfo> InfoList)// 坐骑数据列表
- data = None
-
- def __init__(self):
- self.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x01
- return
-
- def ReadData(self, _lpData, _pos=0, _Len=0):
- self.Clear()
- _pos = self.Head.ReadData(_lpData, _pos)
- self.Multiple,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos)
- for i in range(self.Num):
- temInfoList = tagMCHorseInfo()
- _pos = temInfoList.ReadData(_lpData, _pos)
- self.InfoList.append(temInfoList)
- return _pos
-
- def Clear(self):
- self.Head = tagHead()
- self.Head.Clear()
- self.Head.Cmd = 0xA3
- self.Head.SubCmd = 0x01
- self.Multiple = 0
- self.Num = 0
- self.InfoList = list()
- return
-
- def GetLength(self):
- length = 0
- length += self.Head.GetLength()
- length += 1
- length += 1
- for i in range(self.Num):
- length += self.InfoList[i].GetLength()
-
- return length
-
- def GetBuffer(self):
- data = ''
- data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
- data = CommFunc.WriteBYTE(data, self.Multiple)
- data = CommFunc.WriteBYTE(data, self.Num)
- for i in range(self.Num):
- data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
- return data
-
- def OutputString(self):
- DumpString = '''
- Head:%s,
- Multiple:%d,
- Num:%d,
- InfoList:%s
- '''\
- %(
- self.Head.OutputString(),
- self.Multiple,
- self.Num,
- "..."
+ self.EatItemCount,
+ self.SkinPlusState
)
return DumpString
m_NAtagTrainHorseData=tagTrainHorseData()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Head.Cmd,m_NAtagTrainHorseData.Head.SubCmd))] = m_NAtagTrainHorseData
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagTrainHorseData.Cmd,m_NAtagTrainHorseData.SubCmd))] = m_NAtagTrainHorseData
#------------------------------------------------------
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
index b33a408..4209422 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
@@ -2481,12 +2481,6 @@
# @remarks <Check_HorseClasslv type="类型" value="值"/>
def ConditionType_Check_Horseclasslv(curPlayer, curMission, curConditionNode):
return False
-# conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
-# conditionType = curConditionNode.GetAttribute("type")
-# curHorseClassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV,
-# 0, ChConfig.Def_PDictType_Horse)
-#
-# return QuestRunnerValue.GetEval(conditionType,curHorseClassLV,conditionValue)
##坐骑是否达到多少阶多少星
# @param curPlayer 玩家实例
@@ -7053,7 +7047,7 @@
# @return None <Horselv value="坐骑等级"/>
def ConditionType_Horselv(curPlayer, curMission, curActionNode):
horseLV = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
- return PlayerHorse.GetHorseCurMaxLV(curPlayer) >= horseLV
+ return PlayerHorse.GetHorseSumLV(curPlayer) >= horseLV
##是否已购买VIP礼包
# @param None
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActiveHorse.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActiveHorse.py
deleted file mode 100644
index e31527e..0000000
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActiveHorse.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/python
-# -*- coding: GBK -*-
-#-------------------------------------------------------------------------------
-#
-#-------------------------------------------------------------------------------
-#
-##@package GM.Commands.ActiveHorse
-#
-# @todo:激活坐骑
-# @author xdh
-# @date 2015-3-22
-# @version 1.0
-#
-# 详细描述: 激活坐骑
-#
-#---------------------------------------------------------------------
-"""Version = 2015-03-22 23:00"""
-#---------------------------------------------------------------------
-
-import ShareDefine
-import GameWorld
-import OpenFunc
-import PlayerHorse
-
-
-#---------------------------------------------------------------------
-#逻辑实现
-
-## GM命令执行入口
-# @param curPlayer 当前玩家
-# @param msgList 参数列表
-# @return None
-# @remarks 函数详细说明.
-def OnExec(curPlayer, msgList):
- if not msgList:
- GameWorld.DebugAnswer(curPlayer, "ActiveHorse 第几只坐骑 阶级 经验")
- GameWorld.DebugAnswer(curPlayer, "阶级 经验 选填")
- return
- OpenFunc.DoGMOpenFunc(curPlayer, ShareDefine.GameFuncID_Horse)
- index = msgList[0]
- classlv = msgList[1] if len(msgList) > 1 else 1
- exp = msgList[2] if len(msgList) > 2 else None
- PlayerHorse.DoHorseActivate(curPlayer, index, classlv, exp)
- return
-
-
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Cross.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Cross.py
index 400ee8f..3ced421 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Cross.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Cross.py
@@ -12,11 +12,7 @@
# @note:
#
#---------------------------------------------------------------------
-import ShareDefine
import GameWorld
-import OpenFunc
-import PlayerHorse
-
#---------------------------------------------------------------------
#逻辑实现
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Horse.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Horse.py
new file mode 100644
index 0000000..089198d
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Horse.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GM.Commands.Horse
+#
+# @todo:坐骑
+# @author hxp
+# @date 2019-12-17
+# @version 1.0
+#
+# 详细描述: 坐骑
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-12-17 18:30"""
+#-------------------------------------------------------------------------------
+
+import GameWorld
+import ChConfig
+import PlayerControl
+import PlayerHorse
+
+
+#---------------------------------------------------------------------
+#逻辑实现
+
+## GM命令执行入口
+# @param curPlayer 当前玩家
+# @param msgList 参数列表
+# @return None
+# @remarks 函数详细说明.
+def OnExec(curPlayer, msgList):
+
+ if not msgList:
+ GameWorld.DebugAnswer(curPlayer, "重置所有: Horse 0")
+ GameWorld.DebugAnswer(curPlayer, "设置培养: Horse 等阶 丹数")
+ return
+
+ if len(msgList) == 1:
+ if msgList[0] == 0:
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserLV, 1)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserEatItemCount, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, 0)
+
+ elif len(msgList) == 2:
+ lv, eatItemCount = msgList
+ if lv < 1:
+ GameWorld.DebugAnswer(curPlayer, "等级不能小于1")
+ return
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserLV, lv)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserEatItemCount, eatItemCount)
+ else:
+ return
+
+ PlayerHorse.RefreshHorseAttr(curPlayer)
+ PlayerHorse.PlayerHorseLogin(curPlayer)
+ return
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSignDay.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSignDay.py
index c7de4f7..34879fd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSignDay.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetSignDay.py
@@ -18,7 +18,6 @@
import PlayerControl
import PlayerSignDay
import PlayerMagicWeapon
-import PlayerHorse
import GameWorld
import ChConfig
@@ -67,7 +66,6 @@
PlayerMagicWeapon.CalcMagicWeaponAttr(curPlayer)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
- PlayerHorse.RefreshHorseAttr(curPlayer)
GameWorld.DebugAnswer(curPlayer, "设置已签次数:%s,可补次数:%s,是否次月:%s" % (signNum, canAddSignNum, isMulti))
GameWorld.DebugAnswer(curPlayer, "本轮开始签到时间:%s" % (startTimeStr))
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 8d397e9..308f582 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -291,6 +291,24 @@
("char", "SysMark", 0),
),
+ "HorseLVUp":(
+ ("BYTE", "HorseLV", 1),
+ ("DWORD", "HorseSkinID", 0),
+ ("WORD", "NeedEatCount", 0),
+ ("list", "LVAttrType", 0),
+ ("list", "LVAttrValue", 0),
+ ),
+
+ "HorseSkinPlus":(
+ ("BYTE", "ID", 1),
+ ("DWORD", "HorseSkinPlusID", 0),
+ ("DWORD", "UnlockItemID", 0),
+ ("BYTE", "UnlockItemCnt", 0),
+ ("list", "AttrType", 0),
+ ("list", "AttrValue", 0),
+ ("DWORD", "InitFightPower", 0),
+ ),
+
"PlayerLV":(
("WORD", "LV", 1),
("DWORD", "ExpPoint", 0),
@@ -2103,6 +2121,44 @@
def GetAttrValue(self): return self.AttrValue # 激活加成属性值
def GetSkillID(self): return self.SkillID # 可获得的技能ID
def GetSysMark(self): return self.SysMark # 广播提示
+
+# 坐骑升级表
+class IPY_HorseLVUp():
+
+ def __init__(self):
+ self.HorseLV = 0
+ self.HorseSkinID = 0
+ self.NeedEatCount = 0
+ self.LVAttrType = []
+ self.LVAttrValue = []
+ return
+
+ def GetHorseLV(self): return self.HorseLV # 坐骑等级
+ def GetHorseSkinID(self): return self.HorseSkinID # 外观物品ID
+ def GetNeedEatCount(self): return self.NeedEatCount # 升级所需个数(非累计)
+ def GetLVAttrType(self): return self.LVAttrType # 每级额外属性类型(非累积)
+ def GetLVAttrValue(self): return self.LVAttrValue # 每级额外属性值(非累积)
+
+# 坐骑幻化表
+class IPY_HorseSkinPlus():
+
+ def __init__(self):
+ self.ID = 0
+ self.HorseSkinPlusID = 0
+ self.UnlockItemID = 0
+ self.UnlockItemCnt = 0
+ self.AttrType = []
+ self.AttrValue = []
+ self.InitFightPower = 0
+ return
+
+ def GetID(self): return self.ID # 幻化编号ID
+ def GetHorseSkinPlusID(self): return self.HorseSkinPlusID # 外观物品ID
+ def GetUnlockItemID(self): return self.UnlockItemID # 解锁坐骑物品编号
+ def GetUnlockItemCnt(self): return self.UnlockItemCnt # 解锁所需物品数量
+ def GetAttrType(self): return self.AttrType # 激活加成属性类型
+ def GetAttrValue(self): return self.AttrValue # 激活加成属性值
+ def GetInitFightPower(self): return self.InitFightPower # 皮肤额外战力
# 玩家等级表
class IPY_PlayerLV():
@@ -4842,6 +4898,10 @@
self.ipyHorseLen = len(self.ipyHorseCache)
self.ipyHorseUpCache = self.__LoadFileData("HorseUp", IPY_HorseUp)
self.ipyHorseUpLen = len(self.ipyHorseUpCache)
+ self.ipyHorseLVUpCache = self.__LoadFileData("HorseLVUp", IPY_HorseLVUp)
+ self.ipyHorseLVUpLen = len(self.ipyHorseLVUpCache)
+ self.ipyHorseSkinPlusCache = self.__LoadFileData("HorseSkinPlus", IPY_HorseSkinPlus)
+ self.ipyHorseSkinPlusLen = len(self.ipyHorseSkinPlusCache)
self.ipyPlayerLVCache = self.__LoadFileData("PlayerLV", IPY_PlayerLV)
self.ipyPlayerLVLen = len(self.ipyPlayerLVCache)
self.ipyGMAttrCache = self.__LoadFileData("GMAttr", IPY_GMAttr)
@@ -5318,6 +5378,10 @@
def GetHorseByIndex(self, index): return self.ipyHorseCache[index]
def GetHorseUpCount(self): return self.ipyHorseUpLen
def GetHorseUpByIndex(self, index): return self.ipyHorseUpCache[index]
+ def GetHorseLVUpCount(self): return self.ipyHorseLVUpLen
+ def GetHorseLVUpByIndex(self, index): return self.ipyHorseLVUpCache[index]
+ def GetHorseSkinPlusCount(self): return self.ipyHorseSkinPlusLen
+ def GetHorseSkinPlusByIndex(self, index): return self.ipyHorseSkinPlusCache[index]
def GetPlayerLVCount(self): return self.ipyPlayerLVLen
def GetPlayerLVByIndex(self, index): return self.ipyPlayerLVCache[index]
def GetGMAttrCount(self): return self.ipyGMAttrLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index d9fc0ed..a5594f8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -1462,7 +1462,7 @@
def GetShopItemPrice(itemID, priceType):
''' 获取商城物品对应价格 '''
# 系统固定商店类型: 仙玉(2-常用道具,3-成长变强),绑玉(4-绑玉商城)
- priceTypeShopTypeDict = {IPY_GameWorld.TYPE_Price_Gold_Money:[2, 3],
+ priceTypeShopTypeDict = {IPY_GameWorld.TYPE_Price_Gold_Money:[1, 2, 3],
IPY_GameWorld.TYPE_Price_Gold_Paper:[5, 4],
}
ipyData = None
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py
index 6fed33f..4aedf30 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/OperControlManager.py
@@ -171,9 +171,7 @@
#下马
if not IsCanDoAction(curServerActionState, IPY_GameWorld.oalRide):
- #是否可以下马
- if PlayerHorse.CheckPlayerRideHorseDown(curObj) == True:
- PlayerHorse.PlayerRideHorseDown(curObj, True)
+ PlayerHorse.PlayerRideHorseDown(curObj, True)
if not IsCanDoAction(curServerActionState, IPY_GameWorld.oalTransmit):
#是否在传送的进度条中
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index 149b771..230dd3c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -47,7 +47,6 @@
import PlayerFamily
import PlayerOnlinePrize
import NPCCustomRefresh
-import PlayerHorse
import PlayerLoginDayAward
import NPCCommon
import FunctionNPCCommon
@@ -500,9 +499,6 @@
PlayerLoginDayAward.NotePlayerLoginDayCnt(curPlayer)
#------------------------------------------------------------------------------
-
- # 坐骑OnDay
- PlayerHorse.HorseOnDay(curPlayer)
PlayerVip.VipOnDay(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py
index 776a11a..58b713d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py
@@ -221,14 +221,7 @@
def CheckFeastWeekPartyActionCnt(curPlayer):
ipyDataMgr = IpyGameDataPY.IPY_Data()
for actionType in ChConfig.AheadFinishWPActList:
- if actionType == ChConfig.Def_WPAct_Horse:
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- index = ipyData.GetHorseID()
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % index, 0, ChConfig.Def_PDictType_Horse)
- if lv:
- AddFeastWeekPartyActionCnt(curPlayer, actionType, index, False)
- elif actionType == ChConfig.Def_WPAct_Pet:
+ if actionType == ChConfig.Def_WPAct_Pet:
petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)
for petDataIndex in range(petDataPack.GetCount()):
petItem = petDataPack.GetAt(petDataIndex)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
index 2fe9c69..5825d98 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
@@ -1,20 +1,20 @@
#!/usr/bin/python
# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package Player.PlayerHorse
+#
+# @todo:坐骑
+# @author hxp
+# @date 2019-12-17
+# @version 1.0
+#
+# 详细描述: 坐骑
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-12-17 18:30"""
+#-------------------------------------------------------------------------------
-##@package PlayerHorse
-# 骑马事件逻辑处理
-#
-# @author eggxp
-# @date 2010-4-28
-# @version 6.4
-#
-# 模块详细说明
-# 修改时间 修改人 修改内容
-# @change: "2016-11-29 15:30" hxp 技能战力算在功能上
-# @change: "2017-08-11 21:30" xdh 手游版坐骑
-#---------------------------------------------------------------------
-#"""Version = 2017-08-11 21:30"""
-#---------------------------------------------------------------------
import ChPyNetSendPack
import IPY_GameWorld
import GameWorld
@@ -34,69 +34,31 @@
import GameFuncComm
import EventShell
import IpyGameDataPY
-import PlayerSuccess
-import SkillShell
-import SkillCommon
-import PlayerMagicWeapon
-import PassiveBuffEffMng
import CrossPlayerData
-import PlayerWeekParty
import PlayerPet
-#---------------------------------------------------------------------
-#---------------------------------------------------------------------
-#===============================================================================
-# #玩家骑马, 要:
-# #1.设置玩家为骑乘状态,
-#
-# #玩家下马, 要:
-# #1.设置为空闲状态
-#===============================================================================
-############################################
- #如果玩家要上马:
- #1. 如果玩家不在空闲状态, 返回
- #2. 如果玩家没有装备马匹, 返回
- #3. 设定玩家进入准备状态(类似于挖宝准备)
- #4. 准备状态结束后, 调用这个模块的DoPlayerRideHorse函数, 刷新所有状态
-############################################
-
-################################################
-#注意1:
-#玩家在刷新所有状态的时候:
-#如果玩家有装备马匹, 但是没有骑马, 不刷新马匹装备产生的buff
-#注意2:
-#玩家移动的时候, 如果玩家有马匹 , 则允许玩家移动
-################################################
Def_HorseEquipIndex = 5
-## 玩家骑马脚本(封包参数)
-# @param index 玩家索引
-# @param tick 当前时间
-# @return None
-# @remarks 函数详细说明.
-def OnRideHorse(index, tick):
- GameWorld.GetPsycoFunc(__Func_OnRideHorse)(index, tick)
- return
-## 玩家骑马脚本(封包参数)
-# @param index 玩家索引
-# @param tick 当前时间
-# @return None
-# @remarks 函数详细说明.
-def __Func_OnRideHorse(index, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+#//03 09 玩家骑马#tagCRideHorse
+#
+#struct tagCRideHorse
+#{
+# tagHead Head;
+# BYTE Ride; //1: 骑马 0: 下马
+#};
+def OnRideHorse(index, tick):
- # 判断玩家是否可以升级马匹
- if not CheckCanTrainHorse(curPlayer):
- return
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
+ return False
cdTime = ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_HorseChangState]
# 判断时间是否超过间隔
if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_HorseChangState) <= cdTime:
#没有到刷新间隔
return
-
curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_HorseChangState, tick)
pack = IPY_GameWorld.IPY_CRideHorse()
@@ -112,34 +74,16 @@
if not OperControlManager.IsObjCanDoAction(curPlayer,
ChConfig.Def_Obj_ActState_ClientAct,
IPY_GameWorld.oalRide):
- return
+ return
#下马
if curPlayerRideType == 0 :
- #是否可以下马
- if CheckPlayerRideHorseDown(curPlayer) != True :
- return
PlayerRideHorseDown(curPlayer, True)
#骑马
elif curPlayerRideType == 1:
- #是否可以骑马
- #if curPlayer.GetPlayerAction() not in [IPY_GameWorld.paNull, IPY_GameWorld.paAttack]:
- #CanNotRideHoreWrongState 对不起,您的当前状态,无法上马
- # PlayerControl.NotifyCode(curPlayer, "CanNotRideHoreWrongState")
- # return
-
- #移动中不执行此操作
-
- if not CheckPlayerRideHorseUp(curPlayer):
- return
-
PlayerRideHorseUp(curPlayer, True)
- #此处不加PlayerRideHorseUp, 等待PlayerState调用 PlayerRideHorseUp
- #PlayerControl.Sync_PrepareBegin(curPlayer, ChConfig.Def_RidehorseTime, IPY_GameWorld.pstHorse)
-
- #if curPlayer.IsMoving():
- # curPlayer.Move(curPlayer.GetDestPosX(), curPlayer.GetDestPosY())
+
return
def CrossServer_RideHorse(curPlayer, dataList):
@@ -151,27 +95,11 @@
return
-#---------------------下马逻辑
-
-## 是否可以下马
-# @param curPlayer 当前玩家
-# @return None or True
-# @remarks 函数详细说明.
-def CheckPlayerRideHorseDown(curPlayer) :
- if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvHorse :
- #GameWorld.Log("不在骑马状态,无法下马")
+def PlayerRideHorseDown(curPlayer, refreshState=True) :
+ ## 玩家下马
+ if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvHorse:
return
- #GameWorld.Log("玩家下马" , curPlayer.GetPlayerID())
- return True
-
-## 玩家下马
-# @param curPlayer 当前玩家
-# @param refreshState: 是否需要刷新状态
-# @return None
-# @remarks 函数详细说明.
-def PlayerRideHorseDown(curPlayer, refreshState=True) :
- #设置玩家无交通工具
curPlayer.SetPlayerVehicle(IPY_GameWorld.pvNull)
curPlayer.Sync_GetoffHorse()
@@ -179,69 +107,41 @@
playerControl.RefreshPlayerAttrByBuff()
return
-#----------------------上马逻辑
-
-## 是否可以上马
-# @param curPlayer 当前玩家
-# @return None or True
-# @remarks 函数详细说明.
-def CheckPlayerRideHorseUp(curPlayer):
+def PlayerRideHorseUp(curPlayer, refreshState=True, isNotify=True) :
+ ## 玩家上马
+
# 未加载成功骑乘会导致模型加载失败报错
if not curPlayer.GetInitOK():
- return False
+ return
customMapID = PlayerControl.GetCustomMapID(curPlayer)
if customMapID:
ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
if not ipyMapData or not ipyMapData.GetCanRide():
PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
- return False
+ return
else:
#地图不允许骑马 RideLimit_lhs_0
if not GameWorld.GetMap().GetMapCanRide():
PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
- return False
-
+ return
+
#检查玩家状态,只有在空闲状态才能上马
if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvNull :
#GameWorld.Log("已经有交通工具,无法上马")
- return False
+ return
#检查是否装备指定ID物品
playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
#无指定道具
if itemRideHorse.IsEmpty():
- #PlayerControl.NotifyCode(curPlayer, "NotPrepareSteed")
- return False
-
+ return
- #无耐久也能上马
-#===============================================================================
-# #无耐久,无法激活
-# if itemRideHorse.GetCurDurg() <= 0 :
-# GameWorld.Log("装备的马匹耐久为0,无法上马")
-# return
-#===============================================================================
-
- #GameWorld.Log("玩家上马" , curPlayer.GetPlayerID())
- return True
-
-## 玩家上马
-# @param curPlayer: 当前玩家
-# @param refreshState: 是否需要刷新状态
-# @return 上马是否成功
-# @remarks 函数详细说明.
-def PlayerRideHorseUp(curPlayer, refreshState=True, isNotify=True) :
-
- if not CheckPlayerRideHorseUp(curPlayer):
- GameWorld.Log("Can not Ride Horse")
- return False
-
if curPlayer.GetPlayerAction() == IPY_GameWorld.paGameEvent:
tick = GameWorld.GetGameWorld().GetTick()
PlayerGameEvent.StopGameEvent(curPlayer, tick)
-
+
#设置玩家为骑马状态
curPlayer.SetPlayerVehicle(IPY_GameWorld.pvHorse)
#设置马匹为普通移动状态
@@ -253,132 +153,145 @@
playerControl = PlayerControl.PlayerControl(curPlayer)
playerControl.RefreshPlayerAttrByBuff()
return True
-
-## 判断玩家是否可以升级马匹
-# @param curPlayer 玩家
-# @return 无意义
-def CheckCanTrainHorse(curPlayer):
-
- if curPlayer.GetHP() <= 0 or curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
- return False
-
- if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
- #对应的任务限制未完成
- return False
-
- return True
-
-
-## 通知客户端,培养情况
-# @param curPlayer
-# @return 无意义
-def Sync_HorseTrainData(curPlayer):
- Sync_HorseClassData(curPlayer)
- return
#=====================================================================
+
+#//A5 01 坐骑激活 #tagPlayerActivateHorse
+#
+#struct tagPlayerActivateHorse
+#{
+# tagHead Head;
+# DWORD HorseID; //坐骑幻化ID
+#};
+def ActivateHorseSkinItem(index, curPackData, tick):
+ curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+ playerID = curPlayer.GetPlayerID()
+ activateID = curPackData.HorseID
+
+ if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
+ return
+
+ activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
+ if activateState & pow(2, activateID):
+ GameWorld.DebugLog("该坐骑已幻化!activateState=%s,activateID=%s" % (activateState, activateID))
+ return
+
+ ipyData = IpyGameDataPY.GetIpyGameData("HorseSkinPlus", activateID)
+ if not ipyData:
+ return
+
+ needItemID = ipyData.GetUnlockItemID()
+ needItemCnt = ipyData.GetUnlockItemCnt()
+ itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+ hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, needItemCnt)
+ if not hasEnough:
+ GameWorld.DebugLog("坐骑幻化道具不足! needItemID=%s,needItemCnt=%s" % (needItemID, needItemCnt))
+ return
+ ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, ChConfig.ItemDel_Horse)
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, activateState|pow(2, activateID))
+
+ playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
+ itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
+ #无指定道具
+ if itemRideHorse.IsEmpty():
+ DoChangeHorse(curPlayer, 2, activateID, tick)
+
+ Sync_HorseClassData(curPlayer)
+ GameWorld.Log("坐骑激活成功!activateID=%s" % (activateID), playerID)
+
+ # 刷属性,更新排行榜
+ RefreshHorseAttr(curPlayer)
+ PlayerControl.WorldNotify(0, "GetMount", [curPlayer.GetName(), ipyData.GetHorseSkinPlusID()])
+ return
+
+
#//A5 02 坐骑选择 #tagPlayerChooseHorse
#
#struct tagPlayerChooseHorse
#{
# tagHead Head;
-# BYTE Index; //选择索引
+# BYTE ChooseType; // 1-按等阶,2-按幻化
+# BYTE LVID; // 阶等级或幻化ID
#};
-#=====================================================================
-## 玩家更换马匹
-# @param index 玩家索引
-# @param packData 封包数据
-# @param tick 时间戳
-# @return 无意义
def OnPlayerChangeHorse(index, packData, tick):
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-
+
+ if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
+ return
+
#检查换装间隔
if tick - curPlayer.GetLastChangeEquipTick() <= ChConfig.Def_MinChangeEquipTime:
return
-
curPlayer.SetLastChangeEquipTick(tick)
- # 判断玩家是否可以升级马匹
- if not CheckCanTrainHorse(curPlayer):
- return
-
- horseIndex = packData.Index
+ chooseType = packData.ChooseType
+ lvID = packData.LVID
- DoChangeHorse(curPlayer, horseIndex, tick)
+ if not DoChangeHorse(curPlayer, chooseType, lvID, tick):
+ return
if not GameWorld.IsCrossServer():
- dataList = [horseIndex]
+ dataList = [chooseType, lvID]
CrossPlayerData.SendDataToCrossServer(curPlayer, CrossPlayerData.CrossData_HorseChange, dataList)
+
return
def CrossServer_ChangeHorse(curPlayer, dataList):
## 跨服处理 坐骑变更
- horseIndex = dataList[0]
- ipyData = IpyGameDataPY.GetIpyGameData("Horse", horseIndex)
- if not ipyData:
- return
-
- horseItemID = ipyData.GetItemID()
-
- if ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, IPY_GameWorld.rptEquip):
- return
-
- isOK = ItemControler.PutItemInTempSwap(curPlayer, horseItemID)
- if not isOK:
- return
-
- curHorse = ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, ShareDefine.rptTempSwap)
- if not curHorse:
- return
-
- isRideHorse = curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse
- if isRideHorse:
- PlayerRideHorseDown(curPlayer, False)
-
- #---执行玩家换装逻辑---
+ chooseType, lvID = dataList
tick = GameWorld.GetGameWorld().GetTick()
- if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ItemCommon.GetEquipPackIndex(curHorse), tick):
- if isRideHorse:
- PlayerRideHorseUp(curPlayer, False)
-
+ DoChangeHorse(curPlayer, chooseType, lvID, tick)
return
-def DoChangeHorse(curPlayer, horseIndex, tick):
- ipyData = IpyGameDataPY.GetIpyGameData("Horse", horseIndex)
- if not ipyData:
- return
+def DoChangeHorse(curPlayer, chooseType, lvID, tick):
+ ''' 坐骑选择
+ @param chooseType: 1-按阶,2-按幻化
+ @param lvID: 阶等级或幻化ID
+ '''
- horseItemID = ipyData.GetItemID()
+ # 按阶
+ if chooseType == 1:
+ horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
+ if horseLV < lvID:
+ GameWorld.DebugLog("坐骑等级不足,无法使用该坐骑皮肤! horseLV=%s,lvID=%s" % (horseLV, lvID))
+ return
+
+ horseIpyData = IpyGameDataPY.GetIpyGameData("HorseLVUp", lvID)
+ if not horseIpyData:
+ return
+ horseItemID = horseIpyData.GetHorseSkinID()
+
+ # 按幻化
+ elif chooseType == 2:
+ activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
+ if not activateState & pow(2, lvID):
+ GameWorld.DebugLog("坐骑幻化未激活,无法使用该坐骑皮肤! activateState=%s,lvID=%s" % (activateState, lvID))
+ return
+
+ skinPlusIpyData = IpyGameDataPY.GetIpyGameData("HorseSkinPlus", lvID)
+ if not skinPlusIpyData:
+ return
+ horseItemID = skinPlusIpyData.GetHorseSkinPlusID()
+
+ else:
+ return
if not horseItemID:
- GameWorld.DebugLog("找不到选择的坐骑ID horseIndex=%s" % (horseIndex))
- return
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseIndex, 0, ChConfig.Def_PDictType_Horse)
- if horseLV < ipyData.GetUseNeedRank():
- GameWorld.DebugLog("%s阶坐骑才能切换外观 curLv=%s, horseIndex=%s" % (ipyData.GetUseNeedRank(), horseLV, horseIndex))
+ GameWorld.DebugLog("找不到选择的坐骑ID! chooseType=%s,lvID=%s" % (chooseType, lvID))
return
if ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, IPY_GameWorld.rptEquip):
- GameWorld.DebugLog("OnPlayerChangeHorse() had equipped horse(%s)" % horseItemID)
+ GameWorld.DebugLog("已经选择了该坐骑,无需重新选择! horseItemID=%s" % horseItemID)
return
isOK = ItemControler.PutItemInTempSwap(curPlayer, horseItemID)
if not isOK:
- GameWorld.DebugLog("OnPlayerChangeHorse() horse(%s) put in pack(%s) fail" \
- % (horseItemID, ShareDefine.rptTempSwap))
return
curHorse = ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, ShareDefine.rptTempSwap)
if not curHorse:
- GameWorld.DebugLog("OnPlayerChangeHorse() pack(%s) no horse(%s) item" \
- % (ShareDefine.rptTempSwap, horseItemID))
return
- curHorse.SetUserAttr(ShareDefine.Def_IudetHorsePetSkinIndex, GetHorsePetSkinIndex(curPlayer, 1, horseIndex))
- #检查玩家状态是否可以换装
- if not ChEquip.CheckPlayerCanEquipItem(curPlayer):
- return
-
isRideHorse = curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse
# 如果骑乘状态,先下马,换装,再上马
@@ -389,640 +302,221 @@
if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ItemCommon.GetEquipPackIndex(curHorse), tick):
if isRideHorse:
PlayerRideHorseUp(curPlayer, False)
- return
-
- return
-
-## 马匹功能开启
-def DoHorseOpen(curPlayer):
-# maxStarLV, maxClassLV, horsesList, npcList = ReadChConfig.GetEvalChConfig("HorseTrainUpgrade")
-# horseID = horsesList[0]
-#
-# if ItemCommon.FindItemInPackByItemID(curPlayer, horseID, IPY_GameWorld.rptEquip):
-# return
-#
-# isOK = ItemControler.PutItemInTempSwap(curPlayer, horseID)
-# if not isOK:
-# return
-#
-# curHorse = ItemCommon.FindItemInPackByItemID(curPlayer, horseID, ShareDefine.rptTempSwap)
-# if not curHorse:
-# return
-#
-# #---执行玩家换装逻辑---
-# tick = GameWorld.GetGameWorld().GetTick()
-# ChEquip.DoPlayerEquipItem(curPlayer, curHorse, Def_HorseEquipIndex, tick)
-#
-# __HorseLearnSkill(curPlayer, 0)
-# # 计算属性 防止给第一只坐骑后,客户端坐骑战斗力为0
-# RefreshHorseAttr(curPlayer, False)
-#
-# EventReport.WriteEvent_custom_mission_log(curPlayer, ChConfig.CME_Class_Horse, ChConfig.CME_Log_End, 1, cmeInfoEx="0")
+
return True
-def RefreshHorseAttr(curPlayer, isCheckOpen=True, isUpdateBill=True):
+def DoHorseOpen(curPlayer):
+ ## 马匹功能开启
+ horseLV = 1
+ ipyData = IpyGameDataPY.GetIpyGameData("HorseLVUp", horseLV)
+ if not ipyData:
+ return
+
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserLV, horseLV)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserEatItemCount, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserSkinPlusState, 0)
+
+ horseID = ipyData.GetHorseSkinID()
+ if not ItemCommon.FindItemInPackByItemID(curPlayer, horseID, IPY_GameWorld.rptEquip):
+ isOK = ItemControler.PutItemInTempSwap(curPlayer, horseID)
+ if not isOK:
+ return
+
+ curHorse = ItemCommon.FindItemInPackByItemID(curPlayer, horseID, ShareDefine.rptTempSwap)
+ if not curHorse:
+ return
+ #---执行玩家换装逻辑---
+ tick = GameWorld.GetGameWorld().GetTick()
+ ChEquip.DoPlayerEquipItem(curPlayer, curHorse, Def_HorseEquipIndex, tick)
+
+ GameWorld.DebugLog("坐骑功能开启! horseLV=%s,horseID=%s" % (horseLV, horseID))
+ Sync_HorseClassData(curPlayer)
+ RefreshHorseAttr(curPlayer)
+ return True
+
+def RefreshHorseAttr(curPlayer, isUpdateBill=True):
# 坐骑功能属性变更刷新
- CalcHorseAttrEx(curPlayer, isCheckOpen)
+ CalcHorseAttrEx(curPlayer)
# 需要更新坐骑榜、强制刷新属性
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState(billboardFunc=PlayerBillboard.UpdateHorseBillboard if isUpdateBill else None)
return
-################################################################################
-
-
-## 成就
-# @param curPlayer 玩家实例
-# @param srcBackpack 背包类型
-# @param packIndex 背包索引
-# @param skillPackIndex 技能书背包索引
-# @return 物品实例
-def __SetSuccess(curPlayer):
- #allLV = GetHorseSkillAllLV(curPlayer)
-
- # 成就
- #PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_HorseSkillBookLV, allLV)
- return
-
-## 获取坐骑技能等级列表
-# @param curPlayer 玩家实例
-# @return
-def GetHorseSkillInfo(curPlayer):
- horseSkillIDList = GetHorseSkillList()
-
- skillManager = curPlayer.GetSkillManager()
- skilllvList = []
- for skillresid in horseSkillIDList:
- Skill = skillManager.FindSkillBySkillTypeID(skillresid)
- #未学习
- if Skill == None :
- skilllv = 0
- else:
- skilllv = Skill.GetSkillLV()
- skilllvList.append(skilllv)
+def CalcHorseAttrEx(curPlayer):
+ ## 计算马匹属性
+ if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
+ return
- return skilllvList
-
-## 获取坐骑技能ID
-def GetHorseSkillList():
- horseSkillIDList = []
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseUpCount()):
- ipyData = ipyDataMgr.GetHorseUpByIndex(i)
- skillIDList = ipyData.GetSkillID()
- if not skillIDList:
- continue
- for skillID in skillIDList:
- horseSkillIDList.append(skillID)
- return horseSkillIDList
-
-## 检查是否可以学习坐骑技能
-def CheckLearnHorseSkill(curPlayer, curSkillTypeID):
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseUpCount()):
- ipyData = ipyDataMgr.GetHorseUpByIndex(i)
- skillIDList = ipyData.GetSkillID()
- if curSkillTypeID not in skillIDList:
- continue
- horseID = ipyData.GetHorseID()
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if horseLV < ipyData.GetLV():
- GameWorld.DebugLog(' 该坐骑%s级才解锁此技能 curSkillTypeID=%s'%(ipyData.GetLV(), curSkillTypeID))
- return False
- return True
- #不是坐骑技能
- return True
-
-
-## 计算马匹属性
-# @param curPlayer 玩家
-# @param allAttrList 属性列表
-# @return None
-def CalcHorseAttrEx(curPlayer, isCheckOpen=True):
allAttrList = [{} for _ in range(4)]
allAttrListHorseSoul = [{} for _ in range(4)]
- skillAttrList = [{} for _ in range(4)]
allAttrListSkin = [{} for _ in range(4)]
- # 判断玩家是否可以升级马匹
- if isCheckOpen and not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
- #对应的任务限制未完成
- return
- maxSpeed = 0 #坐骑最大移动速度
- # 坐骑技能添加属性百分比增加在buff中已转为固定属性,只对进阶属性有效不含 移动速度
- skillFPEx = __CalcHorseSkillAttr(curPlayer, skillAttrList)
- initFPAdd = 0 #初始战力
+ horseSpeed = 0 # 坐骑功能增加的速度值,骑乘时才有效果
+ horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
+ # 等阶培养属性
+ totalItemCount = 0
ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if not horseLV:
- continue
- initFPAdd += ipyData.GetInitFightPower()
- horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, horseLV)
- if not horseUpData:
- continue
- attrTypeList = horseUpData.GetAttrType()
- attrValueList = horseUpData.GetAttrValue()
- for i, attrID in enumerate(attrTypeList):
+ for index in xrange(ipyDataMgr.GetHorseLVUpCount()):
+ horseIpyData = ipyDataMgr.GetHorseLVUpByIndex(index)
+ if horseIpyData.GetHorseLV() >= horseLV:
+ totalItemCount += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount)
+ break
+
+ # 等阶额外属性
+ totalItemCount += horseIpyData.GetNeedEatCount()
+ lvAttrTypeList = horseIpyData.GetLVAttrType()
+ lvAttrValueList = horseIpyData.GetLVAttrValue()
+ for i, attrID in enumerate(lvAttrTypeList):
+ attrValue = lvAttrValueList[i]
if attrID == ShareDefine.Def_Effect_Speed:
- maxSpeed = max(maxSpeed, attrValueList[i])
+ horseSpeed += attrValue
continue
- PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
- skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (1, horseID), 0)
- skinIpyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', 1, horseID, skinData/100)
- if skinIpyData:
- for attrID, attrValue in skinIpyData.GetAttrInfo().items():
- PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListSkin)
+ PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
+
+ # 等阶培养丹累加个数属性
+ eatItemAttrInfo = IpyGameDataPY.GetFuncCfg("HorseUpItem", 3)
+ for attrID, attrValue in eatItemAttrInfo:
+ PlayerControl.CalcAttrDict_Type(attrID, attrValue * totalItemCount, allAttrList)
+
+ # 幻化属性
+ initFPAdd = 0 #初始战力
+ activateState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
+ for index in xrange(ipyDataMgr.GetHorseSkinPlusCount()):
+ skinPlusIpyData = ipyDataMgr.GetHorseSkinPlusByIndex(index)
+ skinPlusID = skinPlusIpyData.GetID()
+ if not activateState & pow(2, skinPlusID):
+ continue
+ initFPAdd += skinPlusIpyData.GetInitFightPower()
+ attrTypeList = skinPlusIpyData.GetAttrType()
+ attrValueList = skinPlusIpyData.GetAttrValue()
+ for i, attrID in enumerate(attrTypeList):
+ attrValue = attrValueList[i]
+ if attrID == ShareDefine.Def_Effect_Speed:
+ horseSpeed += attrValue
+ continue
+ PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListSkin)
+
+ curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Horse, initFPAdd)
- curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Horse, skillFPEx+initFPAdd)
- PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkill, skillAttrList)
+ #GameWorld.DebugLog("坐骑功能属性: horseLV=%s,horseSpeed=%s,totalItemCount=%s,initFPAdd=%s" % (horseLV, horseSpeed, totalItemCount, initFPAdd))
# 先缓存值,骑乘状态时进行附加
- GameWorld.DebugLog('坐骑取最大移动速度,maxSpeed=%s' % maxSpeed)
- curPlayer.SetDict(ChConfig.Def_PlayerKey_SpeedHorse, maxSpeed)
+ curPlayer.SetDict(ChConfig.Def_PlayerKey_SpeedHorse, horseSpeed)
# 果实对坐骑的加成, 魂石果实算附加属性层,单独计算
fightPowerEx = PlayerAttrFruit.CalcAttrFruitAddAtrr(curPlayer, allAttrListHorseSoul, ShareDefine.Def_AttrFruitFunc_Horse)
curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_HorseSoul, fightPowerEx)
- #PlayerControl.CalcFuncPackItem(curPlayer, ShareDefine.Def_Pack_Type_HorseSkill, allAttrList)
-
# 保存计算值
PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Horse, allAttrList)
PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSoul, allAttrListHorseSoul)
PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkin, allAttrListSkin)
-
return
-def __CalcHorseSkillAttr(curPlayer, allAttrList):
- # 计算技能属性
- skillFPEx = 0
- skillManager = curPlayer.GetSkillManager()
- #GameWorld.DebugLog("1刷坐骑技能属性: %s" % allAttrList)
- for i in range(0 , skillManager.GetSkillCount()):
- curSkill = skillManager.GetSkillByIndex(i)
- if not curSkill:
- continue
-
- if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_HorseSkill:
- continue
-
- if not SkillCommon.isPassiveAttr(curSkill):
- continue
-
-
- for effectIndex in xrange(curSkill.GetEffectCount()):
- curEffect = curSkill.GetEffect(effectIndex)
- SkillShell.CalcBuffEffAttr(curPlayer, curEffect, allAttrList)
-
-
- #GameWorld.DebugLog("2刷坐骑技能属性: skillFPEx=%s, %s" % ( skillFPEx, allAttrList))
- return skillFPEx
-
-## // A5 27 坐骑提升 #tagCMHorseUp
-## 坐骑升阶
-# @param curPlayer
-# @return None
+#// A5 27 坐骑提升 #tagCMHorseUp
+#
+#struct tagCMHorseUp
+#{
+# tagHead Head;
+# BYTE UseItemCnt; //消耗材料个数
+# BYTE IsAutoBuy; //是否自动购买
+#};
def OnHorseClassLVUP(index, curPackData, tick):
curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
costItemCount = curPackData.UseItemCnt # 消耗材料个数
isAutoBuy = curPackData.IsAutoBuy # 是否自动购买
- horseID = curPackData.HorseID
+
# 判断玩家是否可以升级马匹
if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
- #对应的任务限制未完成
- GameWorld.DebugLog("HorseClassLVUP 坐骑未开启。。。")
- return
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if horseLV <= 0:
- GameWorld.DebugLog("坐骑提升 该坐骑未激活 horseID=%s" % horseID)
+ GameWorld.DebugLog("坐骑未开启!")
return
- horseIpyData = IpyGameDataPY.GetIpyGameData("Horse", horseID)
+ horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
+ curEatItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount)
+ if horseLV <= 0:
+ GameWorld.DebugLog("坐骑提升 该坐骑未激活 horseLV=%s" % horseLV)
+ return
+
+ horseIpyData = IpyGameDataPY.GetIpyGameData("HorseLVUp", horseLV)
if not horseIpyData:
return
- maxLV = horseIpyData.GetMaxLV()
- if horseLV >= maxLV:
- GameWorld.DebugLog("HorseClassLVUP 该坐骑已满级 horseID=%s" % horseID)
+ needEatCount = horseIpyData.GetNeedEatCount()
+ if not needEatCount:
+ GameWorld.DebugLog("坐骑已满级!horseLV=%s" % horseLV)
return
- horseUpIpyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, horseLV)
- if not horseUpIpyData:
- return
- needExp = horseUpIpyData.GetNeedExp()
- if not needExp:
- return
- curExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_Exp % horseID,
- 0,
- ChConfig.Def_PDictType_Horse)
-
- curItemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
-
- itemIndexList = []
- costItemIDList = IpyGameDataPY.GetFuncEvalCfg('HorseUpItem')
-
- #扣材料
- nowCnt = 0
- for itemID in costItemIDList:
- hasEnough, indexList, findItemIsBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(itemID, curItemPack, costItemCount - nowCnt)
-
- itemIndexList.extend(indexList)
- if hasEnough:
- #足够退出
- break
-
- if itemIndexList:
- nowCnt = 0
- for itemIndex in itemIndexList:
- curItem = curItemPack.GetAt(itemIndex)
-
- #检查物品
- if not ItemCommon.CheckItemCanUse(curItem):
- continue
-
- itemCnt = curItem.GetCount()
- nowCnt += itemCnt
-
- if not hasEnough and not isAutoBuy:
- GameWorld.DebugLog("HorseClassLVUP 升阶道具不足。。。")
+ costItemID = IpyGameDataPY.GetFuncCfg("HorseUpItem", 1)
+ if not costItemID or not costItemCount:
return
- autoBuyItemID = costItemIDList[0]
- if itemIndexList:
- curItem = curItemPack.GetAt(itemIndexList[0])
- else:
- curItem = GameWorld.GetGameData().GetItemByTypeID(autoBuyItemID)
- if not curItem:
+ costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
+ lackCnt = costItemCount - bindCnt - unBindCnt
+ if lackCnt >= 0 and not isAutoBuy:
+ GameWorld.DebugLog("消耗道具不足,无法升级坐骑!costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s"
+ % (costItemID, costItemCount, bindCnt, unBindCnt, lackCnt))
return
if lackCnt > 0:
- if not isAutoBuy:
+ lackCost = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCnt})
+ if lackCost <= 0:
return
- itemGold = ItemCommon.GetShopItemPrice(curItem.GetItemTypeID(), IPY_GameWorld.TYPE_Price_Gold_Money)
- #lackCost = ItemCommon.GetAutoBuyItemNeedGold({autoBuyItemID:lackCnt})
- if itemGold <= 0:
+ infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
+ if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, lackCost, ChConfig.Def_Cost_BuyStoreItem, infoDict):
return
- costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, itemGold*lackCnt)
- if not costMoneyList:
- return
- infoDict = {ChConfig.Def_Cost_Reason_SonKey:autoBuyItemID}
- for moneyType, moneyCnt in costMoneyList:
- if not PlayerControl.PayMoney(curPlayer, moneyType, moneyCnt,
- ChConfig.Def_Cost_BuyStoreItem, infoDict, lackCnt):
- return
- lastMultiple = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_Multiple, 1, ChConfig.Def_PDictType_Horse)
- multiple = 1 if costItemCount == 1 else lastMultiple #本次倍数 (只用1个材料不能多倍)
- if multiple > 1:
- EventShell.EventRespons_HorseMultiple(curPlayer, multiple)
- playerName = curPlayer.GetName()
-# needSysHorseLVDict = IpyGameDataPY.GetFuncEvalCfg('NeedSysHorseLV')
-# needSysHorseLVList = needSysHorseLVDict.get(horseID, [])
- curEff = curItem.GetEffectByIndex(0)
- addExp = curEff.GetEffectValue(0) * costItemCount * multiple
- updExp = curExp + addExp
+ # 扣除消耗
+ delCnt = max(0, costItemCount - lackCnt) # 实际扣除的个数
+ if delCnt:
+ ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delCnt, ChConfig.ItemDel_Horse)
+
updClassLV = horseLV
- for lv in range(horseLV, maxLV):
- ipyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
- if not ipyData:
- break
- upNeedExp = ipyData.GetNeedExp()
- if updExp < upNeedExp:
- break
- updClassLV +=1
- upIpyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, updClassLV)
- if not upIpyData:
- break
- updExp -= upNeedExp
+ updEatItemCount = curEatItemCount + costItemCount
+ GameWorld.DebugLog("坐骑培养: horseLV=%s,curEatItemCount=%s,costItemCount=%s,updEatItemCount=%s,needEatCount=%s"
+ % (horseLV, curEatItemCount, costItemCount, updEatItemCount, needEatCount))
+
+ if updEatItemCount >= needEatCount:
+ updClassLV += 1
+ updEatItemCount -= needEatCount
+ GameWorld.DebugLog(" 升阶: updClassLV=%s,updEatItemCount=%s" % (updClassLV, updEatItemCount))
- #解锁技能
-
- skillIDList = upIpyData.GetSkillID()
- if skillIDList:
- sysMark = upIpyData.GetSysMark() or 'MountUpLv'
- for skillID in skillIDList:
- __GiveSkill(curPlayer, skillID, tick)
- PlayerControl.WorldNotify(0, sysMark, [playerName, horseID, updClassLV, skillID])
- if not skillIDList and updClassLV == maxLV:
- PlayerControl.WorldNotify(0, 'MountUpLvMax', [playerName, horseID])
-
- #X坐骑X等级成就
- PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_HorseAllLV, 1, [horseID, updClassLV])
-
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserLV, updClassLV)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorserEatItemCount, updEatItemCount)
+
+ # 升阶
+ if updClassLV > horseLV:
EventShell.EventRespons_HorseLV(curPlayer, updClassLV)
EventShell.EventRespons_HorseUp(curPlayer)
+ # 玩家马匹进阶
+ DataRecordPack.DR_NewHorseByClassUp(curPlayer, updClassLV, 0)
+ # 记录开服活动马匹阶级
+ OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_HorseLV, updClassLV)
- addLV = updClassLV - horseLV
- if addLV:
- __HorseClassLVUP(curPlayer, horseID, updClassLV)
- if updClassLV >= maxLV:
- updExp = 0
-
-
- #扣除物品
- delCnt = max(0, costItemCount - lackCnt) # 实际扣除的个数
- if itemIndexList:
- ItemCommon.ReduceItem(curPlayer, curItemPack, itemIndexList, delCnt, True, ChConfig.ItemDel_Horse)
- # 更新经验值
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_Exp % horseID, updExp, ChConfig.Def_PDictType_Horse)
- # 下次暴击倍数
- horseSuperRateDict = IpyGameDataPY.GetFuncEvalCfg('HorseSuperRate')
- keyNO = 0 #默认0
- rateDict = horseSuperRateDict.get(keyNO, {})
- rateList = rateDict.get(multiple, [])
- nextMultiple = GameWorld.GetResultByRandomList(rateList, 1)
- if costItemCount != 1 or nextMultiple > lastMultiple:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_Multiple, nextMultiple, ChConfig.Def_PDictType_Horse)
-
- Sync_HorseClassData(curPlayer, horseID)
- # 活跃度
- #PlayerActivity.AddActivityFinishCnt(curPlayer, ShareDefine.ActivityNum_HorseUP)
- #EventReport.WriteEvent_horse_class(curPlayer, horseLV, curExp, delCnt, updClassLV, updExp)
- return
-
-## 坐骑阶级提升
-# @param curPlayer
-# @param horseID: 坐骑id
-# @param updateClassLV: 更新的阶级
-# @return None
-def __HorseClassLVUP(curPlayer, horseID, updateClassLV):
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV%horseID, updateClassLV, ChConfig.Def_PDictType_Horse)
- #EventReport.WriteEvent_custom_mission_log(curPlayer, ChConfig.CME_Class_Horse, ChConfig.CME_Log_End, 1, cmeInfoEx=str(updateClassLV))
- sumLV = GetHorseSumLV(curPlayer)
-
+ Sync_HorseClassData(curPlayer)
# 刷属性,更新排行榜
RefreshHorseAttr(curPlayer)
- # 玩家马匹进阶
- DataRecordPack.DR_NewHorseByClassUp(curPlayer, updateClassLV, horseID)
-
- # 记录开服活动马匹阶级
- OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_HorseLV, sumLV)
return
-
-## 给技能
-# @param curPlayer
-# @param skillResID 技能源ID
-# @param tick 时间戳
-# @return None
-def __GiveSkill(curPlayer, skillResID, tick):
-
- skillData = GameWorld.GetGameData().FindSkillByType(skillResID, 1)
- if skillData == None:
- GameWorld.DebugLog("__GiveSkill() hasn't find skill(%s)" % skillResID)
- return
- if not SkillCommon.CheckSkillJob(curPlayer, skillData):
- return
- if not SkillShell.CheckLearnSkillCondition(curPlayer, skillData):
- GameWorld.DebugLog("__GiveSkill() learn skill(%s) condition isn't enough" % skillResID)
- return
- skillManager = curPlayer.GetSkillManager()
- if skillManager.FindSkillBySkillTypeID(skillResID):
- GameWorld.DebugLog("__GiveSkill() have learned skill(%s)" % skillResID)
- return
- GameWorld.DebugLog(' 激活坐骑技能 skillResID=%s' % (skillResID))
- skillManager.LVUpSkillBySkillTypeID(skillResID)
- #PlayerControl.NotifyCode(curPlayer, "GetSkillInfo", [skillResID])
- if not SkillCommon.isPassiveAttr(skillData):
- PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer, skillData.GetSkillID())
-
- DataRecordPack.DR_LearnORUPSkill(curPlayer, skillResID, 0)
- PlayerControl.PlayerControl(curPlayer).RefreshSkillFightPowerEx(skillResID, 0)
- return
-
-
-##OnDay时处理
-# @param curPlayer 玩家
-# @return None
-def HorseOnDay(curPlayer):
- return
-
-
-##坐骑登录处理
-# @param curPlayer 玩家
-# @return None
def PlayerHorseLogin(curPlayer):
+ ##坐骑登录处理
+ if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
+ return
+
Sync_HorseClassData(curPlayer)
SyncHorsePetSkinData(curPlayer)
return
-
-## 通知客户端,培养情况
-# @param curPlayer
-# @return 无意义
-def Sync_HorseClassData(curPlayer, horseID= -1):
+def Sync_HorseClassData(curPlayer):
horseData = ChPyNetSendPack.tagTrainHorseData()
horseData.Clear()
-
- horseData.InfoList = []
-
- if horseID == -1:
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- index = ipyData.GetHorseID()
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % index,
- 0, ChConfig.Def_PDictType_Horse)
- if not lv:
- continue
- skinInfo = ChPyNetSendPack.tagMCHorseInfo()
- skinInfo.Clear()
- skinInfo.HorseID = index
- skinInfo.LV = lv
- skinInfo.Exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_Exp % index,
- 0, ChConfig.Def_PDictType_Horse)
- horseData.InfoList.append(skinInfo)
- else:
- skinInfo = ChPyNetSendPack.tagMCHorseInfo()
- skinInfo.Clear()
- skinInfo.HorseID = horseID
- skinInfo.LV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID,
- 0, ChConfig.Def_PDictType_Horse)
- skinInfo.Exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_Exp % horseID,
- 0, ChConfig.Def_PDictType_Horse)
- horseData.InfoList.append(skinInfo)
-
- horseData.Num = len(horseData.InfoList)
- horseData.Multiple = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_Multiple, 1, ChConfig.Def_PDictType_Horse)
+ horseData.LV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
+ horseData.EatItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount)
+ horseData.SkinPlusState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState)
NetPackCommon.SendFakePack(curPlayer, horseData)
return
-#------------------------------------------------------------------------
-
-#//A5 01 坐骑激活 #tagPlayerActivateHorse
-#
-#struct tagPlayerActivateHorse
-#{
-# tagHead Head;
-# BYTE HorseID; //坐骑ID
-#};
-
-## 激活坐骑
-# @param curPlayer
-# @return None
-def ActivateHorseSkinItem(index, curPackData, tick):
- curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
- playerID = curPlayer.GetPlayerID()
- if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
- GameWorld.Log("坐骑功能未开启,无法激活坐骑!", playerID)
- return False
- horseID = curPackData.HorseID
- ipyData = IpyGameDataPY.GetIpyGameData('Horse', horseID)
-
- if not ipyData:
- GameWorld.ErrLog("坐骑幻化物品异常,无该幻化物品信息!检查tagHorse.txt! horseID=%s" % horseID, playerID)
- return False
-
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID,
- 0, ChConfig.Def_PDictType_Horse)
- if horseLV > 0:
- GameWorld.DebugLog('该坐骑已激活 horseID=%s' % horseID)
- return
-
- needItemID = ipyData.GetUnlockItemID()
- needItemCnt = ipyData.GetUnlockItemCnt()
- itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
- hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, needItemCnt)
- if not hasEnough:
- GameWorld.DebugLog("ActivateHorseSkinItem() item(%s[%s]) isn't enough" % (needItemID, needItemCnt))
- return
- ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, ChConfig.ItemDel_Horse)
- #设置初始等级
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV % horseID, ipyData.GetInitLV(), ChConfig.Def_PDictType_Horse)
- for _ in xrange(ipyData.GetInitLV()):
- EventShell.EventRespons_HorseUp(curPlayer)
- # 记录开服活动马匹阶级
- sumLV = GetHorseSumLV(curPlayer)
- OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_HorseLV, sumLV)
- PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Horse, horseID, False)
-
- playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
- itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
- #无指定道具
- if itemRideHorse.IsEmpty():
- DoChangeHorse(curPlayer, horseID, tick)
-# curHorseSkin = None
-# horseItemID = ipyData.GetItemID()
-# isOK = ItemControler.PutItemInTempSwap(curPlayer, horseItemID)
-# if isOK:
-# curHorseSkin = ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, ShareDefine.rptTempSwap)
-# if curHorseSkin and not curHorseSkin.IsEmpty():
-# tick = GameWorld.GetGameWorld().GetTick()
-# PlayerRideHorseDown(curPlayer, False)
-# # 执行玩家换装逻辑
-# if ChEquip.DoPlayerEquipItem(curPlayer, curHorseSkin, Def_HorseEquipIndex, tick):
-# PlayerRideHorseUp(curPlayer, False)
-
-
- #GameWorld.DebugLog("给幻化坐骑物品giveOK=%s" % giveOK)
-
- Sync_HorseClassData(curPlayer, horseID)
- GameWorld.Log("坐骑激活成功!horseID=%s" % (horseID), playerID)
-
- # 刷属性,更新排行榜
- RefreshHorseAttr(curPlayer)
- sysMark = ipyData.GetUnlockSys() or 'GetMount'
- PlayerControl.WorldNotify(0, sysMark, [curPlayer.GetName(), ipyData.GetItemID()])
-#
-# HorseSkinNotifyDict = ReadChConfig.GetEvalChConfig("HorseSkinNotify")
-# if horseSkinID in HorseSkinNotifyDict:
-# notifyMark = HorseSkinNotifyDict[horseSkinID]
-# PlayerControl.WorldNotify(0, notifyMark, [curPlayer.GetPlayerName(), horseSkinID])
-
- return True
-
-def DoHorseActivate(curPlayer, index, classLV, classExp=None):
- '''GM命令测试用
- @param index: 第几只坐骑或坐骑ID
- '''
- ipyData = IpyGameDataPY.GetIpyGameDataNotLog('Horse', index)
- if not ipyData:
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- if index > ipyDataMgr.GetHorseCount() or index < 1:
- GameWorld.DebugAnswer(curPlayer, '不存在本只坐骑')
- return
- horseID = ipyDataMgr.GetHorseByIndex(index-1).GetHorseID()
- ipyData = IpyGameDataPY.GetIpyGameData('Horse', horseID)
- if not ipyData:
- return
- else:
- horseID = index
- maxLV = ipyData.GetMaxLV()
- classLV = min(classLV, maxLV)
- befClassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
-
- #设置初始等级
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV % horseID, classLV, ChConfig.Def_PDictType_Horse)
- if classExp != None and type(classExp) == int:
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_Exp % horseID, classExp, ChConfig.Def_PDictType_Horse)
-
- #处理技能
- tick = GameWorld.GetGameWorld().GetTick()
- playerSkillManager = curPlayer.GetSkillManager()
- for lv in xrange(1, maxLV + 1):
- upIpyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
- if not upIpyData:
- break
- skillIDList = upIpyData.GetSkillID()
- if not skillIDList:
- continue
-
- if befClassLV >= lv and classLV < lv:
- for skillID in skillIDList:
- playerSkillManager.DeleteSkillBySkillTypeID(skillID)
- elif befClassLV < lv and classLV >= lv:
- for skillID in skillIDList:
- __GiveSkill(curPlayer, skillID, tick)
-
- pControl = PlayerControl.PlayerControl(curPlayer)
- pControl.RefreshAllSkill()
-
- Sync_HorseClassData(curPlayer, horseID)
- GameWorld.Log("坐骑激活成功!horseID=%s,befClassLV=%s,classLV=%s,classExp=%s"
- % (horseID, befClassLV, classLV, classExp), curPlayer.GetPlayerID())
- # 刷属性,更新排行榜
- RefreshHorseAttr(curPlayer)
- return
-
-# 坐骑总等级
def GetHorseSumLV(curPlayer):
- sumLV = 0
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if not horseLV:
- continue
- sumLV += horseLV
-
- return sumLV
-
-def GetHorseCurMaxLV(curPlayer):
- ##获取坐骑当前最大等级
- maxLV = 0
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if horseLV > maxLV:
- maxLV = horseLV
- return maxLV
-
-
-def IsHorseMaxLV(curPlayer, horseID):
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if horseLV <= 0:
- return
- horseIpyData = IpyGameDataPY.GetIpyGameData("Horse", horseID)
- if not horseIpyData:
- return
- maxLV = horseIpyData.GetMaxLV()
- return horseLV >= maxLV
-
+ ## 坐骑总等级
+ return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV)
#============================骑宠觉醒=============================
#// A5 29 骑宠觉醒 #tagCMHorsePetAwake
@@ -1042,16 +536,18 @@
if not IpyGameDataPY.GetIpyGameDataByCondition('HorsePetSkin', {'Type':skintype, 'ID':horsePetID}):
return
if skintype == 1:
- if not IsHorseMaxLV(curPlayer, horsePetID):
- GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s'%horsePetID)
- return
+ #坐骑玩法修改,暂关闭坐骑觉醒
+ return
+# if not IsHorseMaxLV(curPlayer, horsePetID):
+# GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s' % horsePetID)
+# return
else:
if not PlayerPet.IsPetMaxLV(curPlayer, horsePetID):
- GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s'%horsePetID)
+ GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s' % horsePetID)
return
skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
- curSkinLV, curSkinIndex = skinData/100, skinData%100
+ curSkinLV, curSkinIndex = skinData / 100, skinData % 100
ipyData = IpyGameDataPY.GetIpyGameData('HorsePetSkin', skintype, horsePetID, curSkinLV)
if not ipyData:
return
@@ -1082,7 +578,7 @@
updSkinIndex = curSkinIndex
if updExp >= upNeedExp:
for _ in xrange(10):
- ipyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', skintype, horsePetID, updSkinLV+1)
+ ipyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', skintype, horsePetID, updSkinLV + 1)
if not ipyData:
break
if updExp < upNeedExp:
@@ -1092,7 +588,7 @@
updSkinIndex = ipyData.GetSkinIndex()
upNeedExp = ipyData.GetNeedExp()
- updSkinData = updSkinLV*100+updSkinIndex
+ updSkinData = updSkinLV * 100 + updSkinIndex
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), updSkinData)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinExp % (skintype, horsePetID), updExp)
if curSkinIndex != updSkinIndex:
@@ -1123,13 +619,13 @@
if not ipyData:
return
skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
- curSkinLV, curSkinIndex = skinData/100, skinData%100
+ curSkinLV, curSkinIndex = skinData / 100, skinData % 100
if skinIndex == curSkinIndex:
return
if curSkinLV < ipyData.GetSkinLV():
return
- updSkinData = curSkinLV*100+skinIndex
+ updSkinData = curSkinLV * 100 + skinIndex
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), updSkinData)
__DoHorsePetSkinChange(curPlayer, skintype, horsePetID, skinIndex)
@@ -1141,6 +637,8 @@
##骑宠觉醒外观更换
ChEquip.ChangeEquipfacadeByHorsePetSkin(curPlayer, skinType, skinIndex)
if skinType == 1:#坐骑
+ # 坐骑功能修改,暂关闭觉醒
+ return
playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
#无指定道具
@@ -1160,7 +658,7 @@
def GetHorsePetSkinIndex(curPlayer, skintype, horsePetID):
# 获取骑宠觉醒外观索引
skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
- return skinData%100
+ return skinData % 100
def SyncHorsePetSkinData(curPlayer, skinList=None):
if not skinList:
@@ -1182,7 +680,7 @@
skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
if not curExp and not skinData:
continue
- curSkinLV, curSkinIndex = skinData/100, skinData%100
+ curSkinLV, curSkinIndex = skinData / 100, skinData % 100
skinInfo.Exp = curExp
skinInfo.SkinLV = curSkinLV
skinInfo.SkinIndex = curSkinIndex
@@ -1191,4 +689,4 @@
NetPackCommon.SendFakePack(curPlayer, packData)
return
-
\ No newline at end of file
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSignDay.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSignDay.py
index 5f6d3ec..92d26c0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSignDay.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSignDay.py
@@ -30,14 +30,12 @@
import ChPyNetSendPack
import PlayerMagicWeapon
import PlayerPet
-import PlayerSuccess
import PlayerControl
import GameWorld
import ChConfig
import GameFuncComm
import IpyGameDataPY
import ItemCommon
-import PlayerHorse
import time
#===============================================================================
@@ -166,7 +164,6 @@
# 刷签到附加功能属性
PlayerMagicWeapon.CalcMagicWeaponAttr(curPlayer)
PlayerPet.CalcPetItemAddPlayerAttr(curPlayer)
- PlayerHorse.CalcHorseAttrEx(curPlayer)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
mwID = IpyGameDataPY.GetFuncCfg('MWSignDayAttr', 2)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
index 135532a..aceaebe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
@@ -305,16 +305,6 @@
for i in xrange(1, maxType + 1):
weaponLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % i)
UptateSuccessProgress(curPlayer, succType, weaponLV, [i])
- elif succType == ShareDefine.SuccType_HorseAllLV:
- ResetSuccessByType(curPlayer, succType)
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- index = ipyData.GetHorseID()
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % index, 0, ChConfig.Def_PDictType_Horse)
- if not lv:
- continue
- for rlv in xrange(1, lv+1):
- DoAddSuccessProgress(curPlayer, succType, 1, [index, rlv])
elif succType == ShareDefine.SuccType_EquipPlusLV:
ResetSuccessByType(curPlayer, succType)
for pType, indexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
index 75c4012..e529d59 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -275,15 +275,11 @@
## 坐骑信息
def __GetHorseInfo(curPlayer):
- horseList = []
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if horseLV:
- horseList.append({"id":horseID, 'lv':horseLV})
- return horseList
+ horseInfo = {"LV":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserLV),
+ "EatItemCount":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserEatItemCount),
+ "SkinPlusState":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorserSkinPlusState),
+ }
+ return horseInfo
## 神器信息
def __GetGodWeaponInfo(curPlayer):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
index fcddb73..b18350d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
@@ -224,14 +224,7 @@
def CheckWeekPartyActionCnt(curPlayer):
ipyDataMgr = IpyGameDataPY.IPY_Data()
for actionType in ChConfig.AheadFinishWPActList:
- if actionType == ChConfig.Def_WPAct_Horse:
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- index = ipyData.GetHorseID()
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % index, 0, ChConfig.Def_PDictType_Horse)
- if lv:
- AddWeekPartyActionCnt(curPlayer, actionType, index, False)
- elif actionType == ChConfig.Def_WPAct_Pet:
+ if actionType == ChConfig.Def_WPAct_Pet:
petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)
for petDataIndex in range(petDataPack.GetCount()):
petItem = petDataPack.GetAt(petDataIndex)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_510.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_510.py
index 9effe9e..de3d739 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_510.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_510.py
@@ -47,17 +47,18 @@
return ChConfig.TYPE_Linear
def GetHorseAttrByType(curPlayer, horseID, attrType):
- horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if not horseLV:
- return 0
- horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, horseLV)
- if not horseUpData:
- return 0
- attrTypeList = horseUpData.GetAttrType()
- attrValueList = horseUpData.GetAttrValue()
- if attrType not in attrTypeList:
- return 0
-
- return attrValueList[attrTypeList.index(attrType)]
+ return 0
+# horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
+# if not horseLV:
+# return 0
+# horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, horseLV)
+# if not horseUpData:
+# return 0
+# attrTypeList = horseUpData.GetAttrType()
+# attrValueList = horseUpData.GetAttrValue()
+# if attrType not in attrTypeList:
+# return 0
+#
+# return attrValueList[attrTypeList.index(attrType)]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_511.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_511.py
index cf1b639..da20ea2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_511.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_511.py
@@ -47,28 +47,29 @@
return ChConfig.TYPE_Linear
def GetHorseAttrByQuality(curPlayer, quality, attrType):
- value = 0
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- if ipyData.GetQuality() != quality:
- # 非此品质排除
- continue
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if not lv:
- continue
-
- horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
- if not horseUpData:
- continue
-
- attrTypeList = horseUpData.GetAttrType()
- attrValueList = horseUpData.GetAttrValue()
- if attrType not in attrTypeList:
- continue
-
- value += attrValueList[attrTypeList.index(attrType)]
-
- return value
+ return 0
+# value = 0
+# ipyDataMgr = IpyGameDataPY.IPY_Data()
+# for i in xrange(ipyDataMgr.GetHorseCount()):
+# ipyData = ipyDataMgr.GetHorseByIndex(i)
+# horseID = ipyData.GetHorseID()
+# if ipyData.GetQuality() != quality:
+# # 非此品质排除
+# continue
+# lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
+# if not lv:
+# continue
+#
+# horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
+# if not horseUpData:
+# continue
+#
+# attrTypeList = horseUpData.GetAttrType()
+# attrValueList = horseUpData.GetAttrValue()
+# if attrType not in attrTypeList:
+# continue
+#
+# value += attrValueList[attrTypeList.index(attrType)]
+#
+# return value
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py
index c5c3cf2..7098fe0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/GameBuffs/Buff_521.py
@@ -49,25 +49,26 @@
return ChConfig.TYPE_Linear
def GetHorseAttrByQuality(curPlayer, attrType):
- value = 0
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetHorseCount()):
- ipyData = ipyDataMgr.GetHorseByIndex(i)
- horseID = ipyData.GetHorseID()
- lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
- if not lv:
- continue
-
- horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
- if not horseUpData:
- continue
-
- attrTypeList = horseUpData.GetAttrType()
- attrValueList = horseUpData.GetAttrValue()
- if attrType not in attrTypeList:
- continue
-
- value += attrValueList[attrTypeList.index(attrType)]
-
- return value
+ return 0
+# value = 0
+# ipyDataMgr = IpyGameDataPY.IPY_Data()
+# for i in xrange(ipyDataMgr.GetHorseCount()):
+# ipyData = ipyDataMgr.GetHorseByIndex(i)
+# horseID = ipyData.GetHorseID()
+# lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
+# if not lv:
+# continue
+#
+# horseUpData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
+# if not horseUpData:
+# continue
+#
+# attrTypeList = horseUpData.GetAttrType()
+# attrValueList = horseUpData.GetAttrValue()
+# if attrType not in attrTypeList:
+# continue
+#
+# value += attrValueList[attrTypeList.index(attrType)]
+#
+# return value
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index 16e804c..417c3da 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -1905,10 +1905,10 @@
if not CheckLearnSkillCondition(curPlayer, upSkill):
return False
- #坐骑技能学习判断
- if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
- if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
- return False
+# #坐骑技能学习判断
+# if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
+# if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
+# return False
#天赋技学习点数判断
if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
--
Gitblit v1.8.0