| | |
| | | list Skills; //被动技能
|
| | | };
|
| | |
|
| | | //灵根表 #tagDienstgrad
|
| | |
|
| | | struct tagRolePoint
|
| | | {
|
| | | BYTE _AttrID; //属性ID
|
| | | dict AddAttrInfoPerPoint; //每点增加属性信息
|
| | | BYTE PointQualityAttrID; //点数品质进阶增加属性ID
|
| | | list PointQualityAttrValueList; //点数品质进阶增加属性值列表
|
| | | list PointQualityIntervalList; //点数品质进阶属性点区间列表
|
| | | };
|
| | |
|
| | | //境界表 #tagRealm
|
| | |
|
| | | struct tagRealm
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 06 玩家加点 #tagCMAddPoint
|
| | |
|
| | | class tagCMAddPoint(Structure):
|
| | | Head = tagHead()
|
| | | PointAttrIDCount = 0 #(BYTE PointAttrIDCount)// 加点属性ID个数
|
| | | PointAttrIDList = list() #(vector<BYTE> PointAttrIDList)// 加点属性ID列表
|
| | | PointValueList = list() #(vector<WORD> PointValueList)// 加点属性ID对应的点数列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x06
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PointAttrIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.PointAttrIDList.append(value)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.PointValueList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x06
|
| | | self.PointAttrIDCount = 0
|
| | | self.PointAttrIDList = list()
|
| | | self.PointValueList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.PointAttrIDCount
|
| | | length += 2 * self.PointAttrIDCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDCount)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDList[i])
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.PointValueList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PointAttrIDCount:%d,
|
| | | PointAttrIDList:%s,
|
| | | PointValueList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PointAttrIDCount,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMAddPoint=tagCMAddPoint()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMAddPoint.Head.Cmd,m_NAtagCMAddPoint.Head.SubCmd))] = m_NAtagCMAddPoint
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #B2 01 脱机挂状态 # tagCMLoginState
|
| | |
|
| | | class tagCMLoginState(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AC 07 骑宠Boss信息 #tagGCHorsePetBossInfo
|
| | |
|
| | | class tagGCHorsePetBossInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("IsEnd", c_int), # 是否已结束(按位代表对应线路是否结束)
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAC
|
| | | self.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAC
|
| | | self.SubCmd = 0x07
|
| | | self.IsEnd = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCHorsePetBossInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AC 07 骑宠Boss信息 //tagGCHorsePetBossInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | IsEnd:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsEnd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagGCHorsePetBossInfo=tagGCHorsePetBossInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCHorsePetBossInfo.Cmd,m_NAtagGCHorsePetBossInfo.SubCmd))] = m_NAtagGCHorsePetBossInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AC 01 通知领地争夺占领情况 #tagGCManorWarInfo
|
| | |
|
| | | class tagGCManorInfo(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 07 玩家点数信息 #tagMCRolePointInfo
|
| | |
|
| | | class tagMCRolePointInfo(Structure):
|
| | | Head = tagHead()
|
| | | PointAttrIDCount = 0 #(BYTE PointAttrIDCount)// 点类型个数
|
| | | PointAttrIDList = list() #(vector<BYTE> PointAttrIDList)// 点类型列表
|
| | | PointValueList = list() #(vector<WORD> PointValueList)// 点类型对应已加自由点数列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PointAttrIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.PointAttrIDList.append(value)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.PointValueList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x07
|
| | | self.PointAttrIDCount = 0
|
| | | self.PointAttrIDList = list()
|
| | | self.PointValueList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.PointAttrIDCount
|
| | | length += 2 * self.PointAttrIDCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDCount)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDList[i])
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.PointValueList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PointAttrIDCount:%d,
|
| | | PointAttrIDList:%s,
|
| | | PointValueList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PointAttrIDCount,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCRolePointInfo=tagMCRolePointInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRolePointInfo.Head.Cmd,m_NAtagMCRolePointInfo.Head.SubCmd))] = m_NAtagMCRolePointInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 01 玩家技能连击通知 #tagMCSkillCombo
|
| | |
|
| | | class tagMCSkillCombo(Structure):
|
| | |
| | | #GameWorld.DebugLog("SendToDBPlayerCreate dataMapID=%s,lineID=%s,posX=%s,posY=%s,mapID=%s,copyMapID=%s"
|
| | | # % (dataMapID, lineID, posX, posY, mapID, copyMapID))
|
| | | #根据职业获得默认的属性, #STR//力量 ,PNE//智力,PHY//敏捷,CON//体力
|
| | | baseSTR, basePNE, basePHY, baseCON = __GetPlayerBasePoint(sendPack_Job)
|
| | | baseSTR, basePNE, basePHY, baseCON = 0, 0, 0, 0
|
| | |
|
| | | curPlayer.SendToDBPlayerCreate(
|
| | | curPlayerID, #PlayerID,
|
| | |
| | | # 创角流向
|
| | | #DataRecordPack.DR_CreateRole(curPlayer.GetAccID(), sendPack_Name, sendPack_Job)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 获取玩家基础属性点
|
| | | # @param sendPack_Job 职业类型
|
| | | # @return baseSTR, basePNE, basePHY, baseCON
|
| | | # @remarks 函数详细说明.
|
| | | def __GetPlayerBasePoint(sendPack_Job):
|
| | | baseSTR, basePNE, basePHY, baseCON = (0, 0, 0, 0)
|
| | | #{ ְҵ : { key : value } }
|
| | | |
| | | jobDict = IpyGameDataPY.GetFuncEvalCfg("CreatRolePoint%s" % sendPack_Job, 1)
|
| | | |
| | | if not jobDict:
|
| | | GameWorld.ErrLog('CreatRoleErr RoleBasePoint, job = %s' % (sendPack_Job))
|
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | | |
| | | for key, value in jobDict.items():
|
| | | |
| | | if type(key) == str:
|
| | | key = key.upper()
|
| | | |
| | | if key in ['STR', ShareDefine.Def_Effect_STR]:
|
| | | baseSTR = value
|
| | | |
| | | elif key in ['PNE', ShareDefine.Def_Effect_PNE]:
|
| | | basePNE = value
|
| | | |
| | | elif key in ['PHY', ShareDefine.Def_Effect_PHY]:
|
| | | basePHY = value
|
| | | |
| | | elif key in ['CON', ShareDefine.Def_Effect_CON]:
|
| | | baseCON = value
|
| | | |
| | | else:
|
| | | GameWorld.ErrLog('CreatRoleErr RoleBasePoint, key = %s' % (key))
|
| | | |
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | | #---------------------------------------------------------------------
|
| | | ## 检查玩家名字是否合法(这里的PlayerName为过滤完空格的名字)
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | Def_SkillID_AutoTruck = 62220 # 自动运镖buff
|
| | |
|
| | | #---写死的物品属性效果ID---
|
| | | Def_Effect_Metal = 201 # 金
|
| | | Def_Effect_Wood = 202 # ľ
|
| | | Def_Effect_Water = 203 # ˮ
|
| | | Def_Effect_Fire = 204 # 火
|
| | | Def_Effect_Earth = 205 # 土
|
| | | #增加%d力量
|
| | | Def_Effect_STR = 2 #1006
|
| | | #增加%d真元
|
| | |
| | | Def_Effect_LXWeaponAttrPer = 117 # 诛仙剑2属性加成百分比
|
| | | Def_Effect_XXWeaponAttrPer = 118 # 诛仙剑3属性加成百分比
|
| | | Def_Effect_JXWeaponAttrPer = 119 # 诛仙剑4属性加成百分比
|
| | |
|
| | | Def_Effect_Luck = 120 # 气运
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | CDBPlayerRefresh_SoulSplinters, # 聚魂碎片 197
|
| | | CDBPlayerRefresh_SoulCore, # 核心环 198
|
| | | CDBPlayerRefresh_Honor, # 荣誉 199
|
| | | CDBPlayerRefresh_ZhuxianRate, # 诛仙一击概率 200
|
| | | CDBPlayerRefresh_ZhuxianHurtPer, # 诛仙一击伤害百分比 201
|
| | | ) = range(146, 202)
|
| | | CDBPlayerRefresh_200, # 200
|
| | | CDBPlayerRefresh_Mater, # 金
|
| | | CDBPlayerRefresh_Wood, # ľ
|
| | | CDBPlayerRefresh_Water, # ˮ
|
| | | CDBPlayerRefresh_Fire, # 火
|
| | | CDBPlayerRefresh_Earth, # 土 205
|
| | | ) = range(146, 206)
|
| | |
|
| | | TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
|
| | | TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
|
| | |
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | GameFuncID_AddPoint = 145 # 加点功能
|
| | | GameFuncID_AddPoint = 145 # 加点功能/灵根功能
|
| | | GameFuncID_LittleHelper = 146 # 小助手
|
| | | GameFuncID_TJG = 147 # 脱机挂
|
| | | GameFuncID_SuperGift = 150 # 超值礼包
|
| | |
| | | Def_MFPType_Equip, # 装备(基本装备位) 1 - 废弃
|
| | | Def_MFPType_Plus, # 强化 2
|
| | | Def_MFPType_Stone, # 宝石 3
|
| | | Def_MFPType_Suit, # 套装 4 - 废弃
|
| | | Def_MFPType_LingGen, # 灵根 4
|
| | | Def_MFPType_Wing, # 翅膀 5
|
| | | Def_MFPType_Wash, # 洗练 6
|
| | | Def_MFPType_Pet, # 灵宠 7
|
| | |
| | | Def_MFPType_MagicWeapon3, # 仙族法宝 17
|
| | | Def_MFPType_PetSoul, # 灵宠魂石 18
|
| | | Def_MFPType_HorseSoul, # 坐骑魂石 19
|
| | | Def_MFPType_MagicWeaponSoul, # 法宝之魂 20 - 废弃
|
| | | Def_MFPType_20,
|
| | | Def_MFPType_Dogz, # 神兽 21
|
| | | Def_MFPType_GatherSoul, # 聚魂 22
|
| | | Def_MFPType_MagicWeapon4, # 王者法宝 23
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 20
|
| | | RegisterPackCount = 21
|
| | |
|
| | | PacketCMD_1 = 0xA5
|
| | | PacketSubCMD_1 = 0x04
|
| | |
| | | PacketSubCMD_20=0x31
|
| | | PacketCallFunc_20=OnClientStartCustomScene
|
| | |
|
| | | PacketCMD_21=0xB2
|
| | | PacketSubCMD_21=0x06
|
| | | PacketCallFunc_21=OnAddPoint
|
| | |
|
| | | ;购买相关的
|
| | | [BuySomething]
|
| | | ScriptName = Event\EventSrc\Operate_PlayerBuyZhenQi.py
|
| | |
| | | ChConfig.Def_HurtType_LuckyHit:lambda aObj, dObj, hState:__HurtTypeHappen_LuckyHit(aObj, dObj, hState),
|
| | | ChConfig.Def_HurtType_SuperHit:lambda aObj, dObj, hState:__HurtTypeHappen_SuperHit(aObj, dObj, hState),
|
| | | ChConfig.Def_HurtType_Parry:lambda aObj, dObj, hState:__HurtTypeHappen_Parry(aObj, dObj, hState),
|
| | | ChConfig.Def_HurtType_Zhuxian:lambda aObj, dObj, hState:__HurtTypeHappen_Zhuxian(aObj, dObj, hState),
|
| | | #ChConfig.Def_HurtType_Zhuxian:lambda aObj, dObj, hState:__HurtTypeHappen_Zhuxian(aObj, dObj, hState),
|
| | | }
|
| | |
|
| | | hadCheckList = [] # 已经处理过的伤害类型列表
|
| | |
| | | return True, 0, chanceDefPer
|
| | | return
|
| | |
|
| | | def __HurtTypeHappen_Zhuxian(atkObj, defObj, happenState):
|
| | | """诛仙一击"""
|
| | | rate = PlayerControl.GetZhuXianRate(atkObj)
|
| | | if not rate:
|
| | | return
|
| | | |
| | | if GameWorld.CanHappen(rate):
|
| | | return True, PlayerControl.GetZhuXianHurtPer(atkObj), 0
|
| | | return
|
| | | #def __HurtTypeHappen_Zhuxian(atkObj, defObj, happenState):
|
| | | # """诛仙一击"""
|
| | | # rate = PlayerControl.GetZhuXianRate(atkObj)
|
| | | # if not rate:
|
| | | # return
|
| | | # |
| | | # if GameWorld.CanHappen(rate):
|
| | | # return True, PlayerControl.GetZhuXianHurtPer(atkObj), 0
|
| | | # return
|
| | |
|
| | |
|
| | | def ChangeSkillHurtPer(atkObj, defObj, curSkill, skillPer):
|
| | |
| | | Def_BuffValue_Count = 3 # buff记录的value个数
|
| | |
|
| | | #游戏对象属性--------------------------------------------
|
| | | Def_Calc_AllAttrType_MAX = 127
|
| | | Def_Calc_AllAttrType_MAX = 125
|
| | | #基本属性BUFF计算,顺序与 ObjProperty_AttrByIndex 对应,同时也为buff效果ID同步通知策划
|
| | | TYPE_Calc_AttrList = (
|
| | | #基础属性
|
| | | TYPE_Calc_AttrCurSTR, # 力量 1
|
| | | TYPE_Calc_AttrCurPNE, # 灵力(智力) 2
|
| | | TYPE_Calc_AttrCurPHY, # 身法(敏捷) 3
|
| | | TYPE_Calc_AttrCurCON, # 体质 4
|
| | | TYPE_Calc_Metal, # 金 1
|
| | | TYPE_Calc_Wood, # ľ 2
|
| | | TYPE_Calc_Water, # ˮ 3
|
| | | TYPE_Calc_Fire, # 火 4
|
| | | TYPE_Calc_Earth, # 土 5
|
| | |
|
| | | #战斗属性
|
| | | TYPE_Calc_AttrHP, # 当前HP 5
|
| | | TYPE_Calc_AttrMP, # 当前MP 6
|
| | | TYPE_Calc_AttrMaxHP, # 最大血量 7
|
| | | TYPE_Calc_AttrMaxMP, # 最大魔法值 8
|
| | | TYPE_Calc_AttrATKMin, # 最小攻击力 9
|
| | | TYPE_Calc_AttrATKMax, # 最大攻击力 10
|
| | | TYPE_Calc_AttrMATKMin, # 最小魔法攻击力 11 #废弃:NPC表字段代表境界 |
| | | TYPE_Calc_AttrMATKMax, # 最大魔法攻击力 12 #废弃
|
| | | TYPE_Calc_AttrDEF, # 防御力 13
|
| | | TYPE_Calc_AttrHit, # 命中 14
|
| | | TYPE_Calc_AttrMiss, # 闪避 15
|
| | | TYPE_Calc_AttrMaxHP, # 最大血量 6
|
| | | TYPE_Calc_AttrMaxMP, # 最大魔法值 7
|
| | | TYPE_Calc_AttrDEF, # 防御力 8
|
| | | TYPE_Calc_AttrHit, # 命中 9
|
| | | TYPE_Calc_AttrMiss, # 闪避 10
|
| | | TYPE_Calc_AttrATKMin, # 最小攻击力 11
|
| | | TYPE_Calc_AttrATKMax, # 最大攻击力 12
|
| | | TYPE_Calc_AttrHP, # 当前HP 13
|
| | | TYPE_Calc_AttrMP, # 当前MP 14
|
| | | #TYPE_Calc_AttrMATKMin, # 最小魔法攻击力 #废弃:NPC表字段代表境界 |
| | | #TYPE_Calc_AttrMATKMax, # 最大魔法攻击力 #废弃
|
| | | TYPE_Calc_Luck, # 气运 15
|
| | | TYPE_Calc_AttrSpeed, # 移动速度 16
|
| | | TYPE_Calc_AttrAtkSpeed, # 攻击速度 17
|
| | |
|
| | |
| | | TYPE_Calc_SuiteBasePer, # 套装基础属性百分比
|
| | | TYPE_Calc_PlusBaseAtkPer, # 强化基础攻击百分比
|
| | | TYPE_Calc_ProDef, # 当前防护值 130
|
| | | TYPE_Calc_ZhuxianRate, # 诛仙一击的概率
|
| | | TYPE_Calc_ZhuxianHurtPer, # 诛仙一击的伤害比
|
| | | ) = range(1, Def_Calc_AllAttrType_MAX)
|
| | |
|
| | |
|
| | |
| | | Def_Max_Update_Talent_Time = 3 #最大使用造化丹次数
|
| | |
|
| | | #写死的物品效果都放这边
|
| | |
|
| | | #增加%d伤害值,其中a值为最小伤害值,b值为最大伤害值
|
| | | Def_Effect_AddAtk = ShareDefine.Def_Effect_AddAtk
|
| | | #增加%d防御值 |
| | | Def_Effect_Def = ShareDefine.Def_Effect_Def
|
| | | #增加%d力量
|
| | | Def_Effect_STR = ShareDefine.Def_Effect_STR
|
| | | #增加%d真元
|
| | | Def_Effect_PNE = ShareDefine.Def_Effect_PNE
|
| | | #增加%d筋骨
|
| | | Def_Effect_PHY = ShareDefine.Def_Effect_PHY
|
| | | #增加%d体魄
|
| | | Def_Effect_CON = ShareDefine.Def_Effect_CON
|
| | |
|
| | | #立刻恢复%d的HP(单次恢复)
|
| | | Def_Effect_AddHP_Once = 207
|
| | |
| | | Def_PlayerKey_WingHPPer = "WingHPPer" # 翅膀生命百分比
|
| | | Def_PlayerKey_SuiteBasePer = "SuiteBasePer" # 套装基础属性百分比
|
| | | Def_PlayerKey_PlusBaseAtkPer = "PlusBaseAtkPer" # 强化基础攻击百分比
|
| | | Def_PlayerKey_Metal = "PointMetal" # 金
|
| | | Def_PlayerKey_Wood = "PointWood" # ľ
|
| | | Def_PlayerKey_Water = "PointWater" # ˮ
|
| | | Def_PlayerKey_Fire = "PointFire" # 火
|
| | | Def_PlayerKey_Earth = "PointEarth" # 土
|
| | | Def_PlayerKey_MetalQualityLV = "MetalQualityLV" # 金灵根品级
|
| | | Def_PlayerKey_WoodQualityLV = "WoodQualityLV" # 木灵根品级
|
| | | Def_PlayerKey_WaterQualityLV = "WaterQualityLV" # 水灵根品级
|
| | | Def_PlayerKey_FireQualityLV = "FireQualityLV" # 火灵根品级
|
| | | Def_PlayerKey_EarthQualityLV = "EarthQualityLV" # 土灵根品级
|
| | |
|
| | | #功能索引ShareDefine.Def_AttrFruitFuncList
|
| | | Def_PlayerKey_FruitAttr = "FruitAttr_%s_%s" # 属性果实增加的属性,参数为(功能索引, 物品效果id)
|
| | |
| | |
|
| | | Def_PDict_ExcActionItemCnt = "ExcI_%s_%s" # 活动兑换物品已兑换次数,参数(活动key,兑换物品对应次数编号标识)
|
| | |
|
| | | Def_PDict_AddPointValue = "AddPointValue_%s" # 已加属性点数, 参数(属性ID)
|
| | | Def_PDict_AttrFruitEatCnt = "AttrFruitEatCnt_%s" # 已吃属性果实个数,参数为物品id
|
| | | Def_PDict_AttrFruitAddValue = "AttrFruitAddValue_%s" # 已吃属性果实增加的属性,参数为物品id
|
| | |
|
| | |
| | | #对应 Def_Calc_AllAttrType_MAX
|
| | | ItemEffect_AttrDict = {
|
| | | #基础属性
|
| | | Def_Effect_STR:[[TYPE_Calc_AttrCurSTR], True, TYPE_Linear], # 力量
|
| | | Def_Effect_PNE:[[TYPE_Calc_AttrCurPNE], True, TYPE_Linear], # 智力
|
| | | Def_Effect_PHY:[[TYPE_Calc_AttrCurPHY], True, TYPE_Linear], # 敏捷
|
| | | Def_Effect_CON:[[TYPE_Calc_AttrCurCON], True, TYPE_Linear], # 体力
|
| | | ShareDefine.Def_Effect_Metal:[[TYPE_Calc_Metal], True, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_Wood:[[TYPE_Calc_Wood], True, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_Water:[[TYPE_Calc_Water], True, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_Fire:[[TYPE_Calc_Fire], True, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_Earth:[[TYPE_Calc_Earth], True, TYPE_Linear],
|
| | |
|
| | | #战斗线性
|
| | | ShareDefine.Def_Effect_MaxHP:[[TYPE_Calc_AttrMaxHP], False, TYPE_Linear], # 最大血量
|
| | |
| | | # TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_AddAtk:[[TYPE_Calc_AttrATKMax], False, TYPE_Linear],
|
| | | #ShareDefine.Def_Effect_AddAtk:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_AddMAtk:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | #ShareDefine.Def_Effect_AddMAtk:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_AtkSpeed:[[TYPE_Calc_AttrAtkSpeed], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_ToxinDef:[[TYPE_Calc_AttrPoisonDef], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_ThunderDef:[[TYPE_Calc_AttrThunderDef], False, TYPE_Linear],
|
| | |
| | | ShareDefine.Def_Effect_LuckyHit:[[TYPE_Calc_LuckyHit], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_LuckyHitRate:[[TYPE_Calc_LuckyHitRate], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_LuckyHitRateReduce:[[TYPE_Calc_LuckyHitRateReduce], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_Luck:[[TYPE_Calc_Luck], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_ReduceSkillCD:[[TYPE_Calc_ReduceSkillCD], False, TYPE_Linear],
|
| | | AttrName_MinAtk:[[TYPE_Calc_AttrATKMin], False, TYPE_Linear],
|
| | | AttrName_MaxAtk:[[TYPE_Calc_AttrATKMax], False, TYPE_Linear],
|
| | | AttrName_MinMAtk:[[TYPE_Calc_AttrMATKMin], False, TYPE_Linear],
|
| | | AttrName_MaxMAtk:[[TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | #AttrName_MinMAtk:[[TYPE_Calc_AttrMATKMin], False, TYPE_Linear],
|
| | | #AttrName_MaxMAtk:[[TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | AttrName_Def:[[TYPE_Calc_AttrDEF], False, TYPE_Linear],
|
| | | AttrName_DefRate:[[TYPE_Calc_AttrMiss], False, TYPE_Linear],
|
| | | AttrName_MaxHP:[[TYPE_Calc_AttrMaxHP], False, TYPE_Linear],
|
| | |
| | | AttrName_Hit:[[TYPE_Calc_AttrHit], False, TYPE_Linear],
|
| | | AttrName_Atk:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_Linear],
|
| | | #AttrName_Atk:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_Linear],
|
| | | AttrName_MAtk:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | #AttrName_MAtk:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_Linear],
|
| | | AttrName_AutoRestoreHPPer:[[TYPE_Calc_HPRestorePer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_HPRestore:[[TYPE_Calc_HPRestorePer], False, TYPE_Linear],
|
| | | AttrName_GreatHitRate:[[TYPE_Calc_GreatHitRate], False, TYPE_Linear],
|
| | |
| | | ShareDefine.Def_Effect_DefPer:[[TYPE_Calc_AttrDEF], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_HitRate:[[TYPE_Calc_AttrHit], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_MissRate:[[TYPE_Calc_AttrMiss], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_AddMAtkByPer:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_NoLinear],
|
| | | #ShareDefine.Def_Effect_AddMAtkByPer:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_AddAtkByPer:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_SuperHitPer:[[TYPE_Calc_SuperHit], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_SpeedPer:[[TYPE_Calc_AttrSpeed], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_IceAtkPer:[[TYPE_Calc_AttrIceAtk], False, TYPE_NoLinear],
|
| | | ShareDefine.Def_Effect_IceDefPer:[[TYPE_Calc_AttrIceDef], False, TYPE_NoLinear],
|
| | | #ShareDefine.Def_Effect_AddAtkByPer:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_NoLinear],
|
| | | AttrName_MagAtkPer:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_NoLinear],
|
| | | #AttrName_MagAtkPer:[[TYPE_Calc_AttrMATKMin, TYPE_Calc_AttrMATKMax], False, TYPE_NoLinear],
|
| | | AttrName_AtkPer:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_NoLinear],
|
| | | #AttrName_AtkPer:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_NoLinear],
|
| | | AttrName_BothAtkPer:[[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax], False, TYPE_NoLinear],
|
| | |
| | | #刷属性功能分类索引
|
| | | CalcAttrFuncList = (
|
| | | Def_CalcAttrFunc_RoleBase, # 角色基础 0
|
| | | Def_CalcAttrFunc_EquipBaseWeapon, # 武器物品表基础属性 1 - 废弃
|
| | | Def_CalcAttrFunc_EquipBaseArmor, # 防具物品表基础属性 2 - 废弃
|
| | | Def_CalcAttrFunc_EquipBaseRelics, # 圣器物品表基础属性 3 - 废弃
|
| | | Def_CalcAttrFunc_Equip, # 装备其他(传奇属性 + ) 4 - 废弃 |
| | | Def_CalcAttrFunc_1,
|
| | | Def_CalcAttrFunc_2,
|
| | | Def_CalcAttrFunc_LingGenQuailty, # 灵根品质附加属性 3
|
| | | Def_CalcAttrFunc_LingGen, # 灵根 4
|
| | | Def_CalcAttrFunc_Plus, # 装备位强化 5
|
| | | Def_CalcAttrFunc_PlusEx, # 装备位强化累加 6 - 废弃
|
| | | Def_CalcAttrFunc_6,
|
| | | Def_CalcAttrFunc_Stone, # 装备宝石 7
|
| | | Def_CalcAttrFunc_Suit, # 套装 8 - 废弃
|
| | | Def_CalcAttrFunc_8,
|
| | | Def_CalcAttrFunc_Wing, # 翅膀 9
|
| | | Def_CalcAttrFunc_Wash, # 洗练 10
|
| | | Def_CalcAttrFunc_Pet, # 灵宠 11
|
| | |
| | | Def_CalcAttrFunc_GodWeapon, # 神兵 14
|
| | | Def_CalcAttrFunc_Dienstgrad, # 称号 15
|
| | | Def_CalcAttrFunc_Rune, # 符印 16
|
| | | Def_CalcAttrFunc_17, #
|
| | | Def_CalcAttrFunc_17,
|
| | | Def_CalcAttrFunc_MagicWeapon1, # 人族法宝属性 18
|
| | | Def_CalcAttrFunc_EquipOutOfPrint, # 绝版属性随等级变化 19
|
| | | Def_CalcAttrFunc_EquipAllStars, # 装备全身星级属性 20 - 废弃
|
| | | Def_CalcAttrFunc_20,
|
| | | Def_CalcAttrFunc_Success, # 成就属性 21
|
| | | Def_CalcAttrFunc_VIP, # VIP属性 22
|
| | | Def_CalcAttrFunc_Stove, # 炼丹炉 23
|
| | |
| | | Def_CalcAttrFunc_PetSkill, # 宠物技能属性 31
|
| | | Def_CalcAttrFunc_StoveYao, # 炼丹炉丹药 32
|
| | | Def_CalcAttrFunc_PetSign, # 宠物签到 33
|
| | | Def_CalcAttrFunc_MagicWeaponSoul, # 法宝之魂属性34- 废弃
|
| | | Def_CalcAttrFunc_34,
|
| | | Def_CalcAttrFunc_Dogz, # 神兽35
|
| | | Def_CalcAttrFunc_DogzBattleSkill, # 助战神兽技能36
|
| | | Def_CalcAttrFunc_DogzEquip, # 神兽装备37
|
| | |
| | | # 在此列表中的功能属性,不享受百分比加成,--属性参与战力计算
|
| | | CalcAttrExFuncList = [Def_CalcAttrFunc_MagicWeapon1, Def_CalcAttrFunc_MagicWeapon2, Def_CalcAttrFunc_MagicWeapon3, Def_CalcAttrFunc_MagicWeapon4,
|
| | | Def_CalcAttrFunc_Stove, Def_CalcAttrFunc_VIP, Def_CalcAttrFunc_PetSoul, Def_CalcAttrFunc_HorseSoul,
|
| | | Def_CalcAttrFunc_StoveYao, Def_CalcAttrFunc_PetSign, Def_CalcAttrFunc_MagicWeaponSoul
|
| | | Def_CalcAttrFunc_StoveYao, Def_CalcAttrFunc_PetSign
|
| | | ]
|
| | |
|
| | | # 在此列表中的功能属性,不享受百分比加成,--属性不参与战力计算,战力由技能配置决定
|
| | |
| | | MFPTypeAttrFuncIndexDict = {ShareDefine.Def_MFPType_Role:[Def_CalcAttrFunc_RoleBase],
|
| | | # 因为装备评分和实际战力一直出现不匹配的情况,所以装备战力修改为直接由装备评分做为参数计算战力,所以装备评分计算的所有属性不列入战力计算,祥见评分计算函数 ItemCommom.CalcEquipGS
|
| | | # ShareDefine.Def_MFPType_Equip:[Def_CalcAttrFunc_EquipOutOfPrint],
|
| | | ShareDefine.Def_MFPType_LingGen:[Def_CalcAttrFunc_LingGenQuailty, Def_CalcAttrFunc_LingGen],
|
| | | ShareDefine.Def_MFPType_Plus:[Def_CalcAttrFunc_Plus],
|
| | | ShareDefine.Def_MFPType_Stone:[Def_CalcAttrFunc_Stone],
|
| | | ShareDefine.Def_MFPType_Wing:[Def_CalcAttrFunc_Wing],
|
| | |
| | | ShareDefine.Def_MFPType_MagicWeapon3:[Def_CalcAttrFunc_MagicWeapon3, Def_CalcAttrFunc_Stove, Def_CalcAttrFunc_VIP],
|
| | | ShareDefine.Def_MFPType_MagicWeapon4:[Def_CalcAttrFunc_MagicWeapon4],
|
| | | ShareDefine.Def_MFPType_StoveYao:[Def_CalcAttrFunc_StoveYao],
|
| | | ShareDefine.Def_MFPType_MagicWeaponSoul:[Def_CalcAttrFunc_MagicWeaponSoul],
|
| | | ShareDefine.Def_MFPType_GatherSoul:[Def_CalcAttrFunc_GatherSoul],
|
| | | ShareDefine.Def_MFPType_Coat:[Def_CalcAttrFunc_Coat],
|
| | | # 诛仙装备战力、神兽战力同装备模块战力一致,受评分影响,装备评分相关的战力另外算
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 06 玩家加点 #tagCMAddPoint
|
| | |
|
| | | class tagCMAddPoint(Structure):
|
| | | Head = tagHead()
|
| | | PointAttrIDCount = 0 #(BYTE PointAttrIDCount)// 加点属性ID个数
|
| | | PointAttrIDList = list() #(vector<BYTE> PointAttrIDList)// 加点属性ID列表
|
| | | PointValueList = list() #(vector<WORD> PointValueList)// 加点属性ID对应的点数列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x06
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PointAttrIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.PointAttrIDList.append(value)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.PointValueList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x06
|
| | | self.PointAttrIDCount = 0
|
| | | self.PointAttrIDList = list()
|
| | | self.PointValueList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.PointAttrIDCount
|
| | | length += 2 * self.PointAttrIDCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDCount)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDList[i])
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.PointValueList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PointAttrIDCount:%d,
|
| | | PointAttrIDList:%s,
|
| | | PointValueList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PointAttrIDCount,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMAddPoint=tagCMAddPoint()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMAddPoint.Head.Cmd,m_NAtagCMAddPoint.Head.SubCmd))] = m_NAtagCMAddPoint
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #B2 01 脱机挂状态 # tagCMLoginState
|
| | |
|
| | | class tagCMLoginState(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AC 07 骑宠Boss信息 #tagGCHorsePetBossInfo
|
| | |
|
| | | class tagGCHorsePetBossInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("IsEnd", c_int), # 是否已结束(按位代表对应线路是否结束)
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAC
|
| | | self.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAC
|
| | | self.SubCmd = 0x07
|
| | | self.IsEnd = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagGCHorsePetBossInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AC 07 骑宠Boss信息 //tagGCHorsePetBossInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | IsEnd:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsEnd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagGCHorsePetBossInfo=tagGCHorsePetBossInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagGCHorsePetBossInfo.Cmd,m_NAtagGCHorsePetBossInfo.SubCmd))] = m_NAtagGCHorsePetBossInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AC 01 通知领地争夺占领情况 #tagGCManorWarInfo
|
| | |
|
| | | class tagGCManorInfo(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 07 玩家点数信息 #tagMCRolePointInfo
|
| | |
|
| | | class tagMCRolePointInfo(Structure):
|
| | | Head = tagHead()
|
| | | PointAttrIDCount = 0 #(BYTE PointAttrIDCount)// 点类型个数
|
| | | PointAttrIDList = list() #(vector<BYTE> PointAttrIDList)// 点类型列表
|
| | | PointValueList = list() #(vector<WORD> PointValueList)// 点类型对应已加自由点数列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x07
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.PointAttrIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.PointAttrIDList.append(value)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.PointValueList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB1
|
| | | self.Head.SubCmd = 0x07
|
| | | self.PointAttrIDCount = 0
|
| | | self.PointAttrIDList = list()
|
| | | self.PointValueList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1 * self.PointAttrIDCount
|
| | | length += 2 * self.PointAttrIDCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDCount)
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteBYTE(data, self.PointAttrIDList[i])
|
| | | for i in range(self.PointAttrIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.PointValueList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | PointAttrIDCount:%d,
|
| | | PointAttrIDList:%s,
|
| | | PointValueList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.PointAttrIDCount,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCRolePointInfo=tagMCRolePointInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRolePointInfo.Head.Cmd,m_NAtagMCRolePointInfo.Head.SubCmd))] = m_NAtagMCRolePointInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 01 玩家技能连击通知 #tagMCSkillCombo
|
| | |
|
| | | class tagMCSkillCombo(Structure):
|
| | |
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | ##@package GM.Commands.ResetBaseAttr
|
| | | #
|
| | | ##@package ResetBaseAttr.py
|
| | | #
|
| | | # @todo: 重设玩家属性
|
| | | # @author wdb
|
| | | # @date 2013-06-21
|
| | | # @todo:重置玩家灵根属性点
|
| | | # @author hxp
|
| | | # @date 2019-3-25
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | # 详细描述:
|
| | | #------------------------------------------------------------------------------
|
| | | # 详细描述: 重置玩家灵根属性点
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2019-3-25 下午7:50:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import Item_ResetAttrPoint
|
| | | import GameWorld
|
| | | import PlayerControl
|
| | | #------------------------------------------------------------------------------ |
| | | """Version = 2013-06-21 14:30"""
|
| | |
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | | # @param list 参数列表
|
| | | # @return None
|
| | | def OnExec(curPlayer, cmdlist): |
| | | def OnExec(curPlayer, cmdlist):
|
| | |
|
| | | if curPlayer.GetLV() > 1:
|
| | | GameWorld.DebugAnswer(curPlayer, "LV can not greater than 1")
|
| | | if not cmdlist:
|
| | | GameWorld.DebugAnswer(curPlayer, "重置所有灵根: ResetBaseAttr 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "重置指定灵根: ResetBaseAttr ID 点数")
|
| | | return
|
| | |
|
| | | playerJob = curPlayer.GetJob()
|
| | | |
| | | initBaseAttrPoint = (0, 0, 0, 0)
|
| | | # 获取创建时的基础属性
|
| | | baseSTR, basePNE, basePHY, baseCON = PlayerControl.GetPlayerBasePoint(playerJob)
|
| | | |
| | | # 获取创建时的基础属性错误, 返回
|
| | | if (baseSTR, basePNE, basePHY, baseCON) == initBaseAttrPoint:
|
| | | return initBaseAttrPoint
|
| | |
|
| | | curPlayer.SetBaseSTR(baseSTR)
|
| | | curPlayer.SetBasePNE(basePNE)
|
| | | curPlayer.SetBasePHY(basePHY)
|
| | | curPlayer.SetBaseCON(baseCON)
|
| | |
|
| | | #刷新人物所有状态
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshAllState() |
| | | isOK = False
|
| | | if len(cmdlist) == 1 and cmdlist[0] == 0:
|
| | | isOK = Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, 0, 0)
|
| | | elif len(cmdlist) >= 2:
|
| | | resetID, resetPoint = cmdlist[:2]
|
| | | isOK = Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, resetID, resetPoint)
|
| | | |
| | | if not isOK:
|
| | | GameWorld.DebugAnswer(curPlayer, "重置灵根失败!")
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "重置灵根成功!当前剩余点数: %s" % curPlayer.GetFreePoint())
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | |
| | |
| | | ("list", "Skills", 0),
|
| | | ),
|
| | |
|
| | | "RolePoint":(
|
| | | ("BYTE", "AttrID", 1),
|
| | | ("dict", "AddAttrInfoPerPoint", 0),
|
| | | ("BYTE", "PointQualityAttrID", 0),
|
| | | ("list", "PointQualityAttrValueList", 0),
|
| | | ("list", "PointQualityIntervalList", 0),
|
| | | ),
|
| | |
|
| | | "Realm":(
|
| | | ("WORD", "Lv", 1),
|
| | | ("DWORD", "NeedLV", 0),
|
| | |
| | | def GetLightType(self): return self.LightType # 点亮属性类型
|
| | | def GetLightAttribute(self): return self.LightAttribute # 点亮属性值
|
| | | def GetSkills(self): return self.Skills # 被动技能 |
| | | |
| | | # 灵根表 |
| | | class IPY_RolePoint(): |
| | | |
| | | def __init__(self): |
| | | self.AttrID = 0
|
| | | self.AddAttrInfoPerPoint = {}
|
| | | self.PointQualityAttrID = 0
|
| | | self.PointQualityAttrValueList = []
|
| | | self.PointQualityIntervalList = [] |
| | | return |
| | | |
| | | def GetAttrID(self): return self.AttrID # 属性ID
|
| | | def GetAddAttrInfoPerPoint(self): return self.AddAttrInfoPerPoint # 每点增加属性信息
|
| | | def GetPointQualityAttrID(self): return self.PointQualityAttrID # 点数品质进阶增加属性ID
|
| | | def GetPointQualityAttrValueList(self): return self.PointQualityAttrValueList # 点数品质进阶增加属性值列表
|
| | | def GetPointQualityIntervalList(self): return self.PointQualityIntervalList # 点数品质进阶属性点区间列表 |
| | | |
| | | # 境界表 |
| | | class IPY_Realm(): |
| | |
| | | self.ipyConfigEx = {}
|
| | | self.ipyDienstgradCache = self.__LoadFileData("Dienstgrad", IPY_Dienstgrad)
|
| | | self.ipyDienstgradLen = len(self.ipyDienstgradCache)
|
| | | self.ipyRolePointCache = self.__LoadFileData("RolePoint", IPY_RolePoint)
|
| | | self.ipyRolePointLen = len(self.ipyRolePointCache)
|
| | | self.ipyRealmCache = self.__LoadFileData("Realm", IPY_Realm)
|
| | | self.ipyRealmLen = len(self.ipyRealmCache)
|
| | | self.ipyGodWeaponCache = self.__LoadFileData("GodWeapon", IPY_GodWeapon)
|
| | |
| | |
|
| | | def GetDienstgradCount(self): return self.ipyDienstgradLen
|
| | | def GetDienstgradByIndex(self, index): return self.ipyDienstgradCache[index]
|
| | | def GetRolePointCount(self): return self.ipyRolePointLen
|
| | | def GetRolePointByIndex(self, index): return self.ipyRolePointCache[index]
|
| | | def GetRealmCount(self): return self.ipyRealmLen
|
| | | def GetRealmByIndex(self, index): return self.ipyRealmCache[index]
|
| | | def GetGodWeaponCount(self): return self.ipyGodWeaponLen
|
| | |
| | | #物品使用等级检查
|
| | | if not ItemControler.CheckItemUseLV(curPlayer, curItem):
|
| | | return
|
| | |
|
| | | #使用物品检查是否满足属性
|
| | | if not ItemControler.CheckItemAttrLimit(curPlayer, curItem):
|
| | | PlayerControl.NotifyCode(curPlayer, "itemuse_andyshao_671654")
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | | # #检查对象是否正确
|
| | |
| | | return True
|
| | | return False
|
| | |
|
| | | #物品属性判断------------------------------------------------------------------
|
| | | ## 使用物品检查是否满足属性
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curItem 当前物品
|
| | | # @return False or True
|
| | | def CheckItemAttrLimit(curPlayer, curItem):
|
| | | # 取消限制的物品
|
| | | if curItem.GetUserAttr(ShareDefine.Def_IudetCancelUseLimit) == 1:
|
| | | return True
|
| | | #智力为基础限制
|
| | | if curItem.GetLimitPNE() > curPlayer.GetPNE():
|
| | | return False
|
| | | |
| | | #由于可变属性强化表加载问题, 暂时不处理强化表的属性点限制,以物品表为主,如有需要再开启此判断 20151210 by hxp
|
| | | # 从强化表中获得数据,装备强化限制力量 敏捷
|
| | | # if curItem.GetType() in ReadChConfig.GetEvalChConfig("EquipPlus_EquipType"):
|
| | | # plusInfo = ...
|
| | | # |
| | | # if plusInfo is None:
|
| | | # GameWorld.ErrLog("tagItemPlus.txt can't find equip:%s" % curItem.GetItemTypeID())
|
| | | # return False
|
| | | # |
| | | # limitSTR, limitPHY = plusInfo.GetLimitSTR(), plusInfo.GetLimitPHY()
|
| | | # |
| | | # # 物品表中获得信息
|
| | | # else:
|
| | | limitSTR, limitPHY = curItem.GetLimitSTR(), curItem.GetLimitPHY()
|
| | | |
| | | if limitSTR > curPlayer.GetSTR() or limitPHY > curPlayer.GetPHY():
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | | #物品使用等级判断----------------------------------------------------------------
|
| | | ## 物品使用等级判断
|
| | | # @param curPlayer 玩家
|
| | |
| | | #等级检查
|
| | | if not CheckItemUseLV(curPlayer, curItem, needNotify):
|
| | | return False
|
| | |
|
| | | #使用物品检查是否满足属性
|
| | | if not CheckItemAttrLimit(curPlayer, curItem):
|
| | | if needNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "itemuse_andyshao_671654")
|
| | | return False
|
| | | |
| | | |
| | | #=======================================================================
|
| | | # #马匹检查
|
| | | # if curItem.GetType() == ChConfig.Def_Item_Type_Horse and not CheckCanEquipHorse(curPlayer):
|
| | |
| | | # @version 1.0
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2017-12-15 17:40"""
|
| | | #"""Version = 2017-12-15 17:40"""
|
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | |
|
| | | import ChPlayer
|
| | | import PlayerControl
|
| | | import GameWorld
|
| | | import ItemCommon
|
| | | import ShareDefine
|
| | | import DataRecordPack
|
| | | import IpyGameDataPY
|
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import math
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##批量使用物品
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param curRoleItem: 物品实例
|
| | |
| | | def BatchUseItem(curPlayer, curRoleItem, tick, useCnt, exData):
|
| | | curEff = curRoleItem.GetEffectByIndex(0)
|
| | | effectID = curEff.GetEffectID()
|
| | | if effectID == ChConfig.Def_Effect_ResetAttrPoint:
|
| | | resetAttrID = exData
|
| | | resetCnt = curEff.GetEffectValue(0)
|
| | | else:
|
| | | resetAttrID = curEff.GetEffectValue(0) # 属性ID
|
| | | resetCnt = curEff.GetEffectValue(1) #重置点数
|
| | | if effectID not in ChConfig.Def_Effect_ResetAttrPoint:
|
| | | return
|
| | | resetID = curEff.GetEffectValue(0)
|
| | | resetPoint = curEff.GetEffectValue(0) * useCnt
|
| | | if not DoResetAttrPoint(curPlayer, resetID, resetPoint):
|
| | | return
|
| | |
|
| | | if resetAttrID not in [ShareDefine.Def_Effect_STR,ShareDefine.Def_Effect_PHY,ShareDefine.Def_Effect_CON,ShareDefine.Def_Effect_PNE]:
|
| | | return
|
| | | if not resetCnt:
|
| | | return
|
| | | freePoint = curPlayer.GetFreePoint()
|
| | | #扣除物品
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, useCnt, True, ChConfig.ItemDel_ResetAttrPoint)
|
| | | return True, useCnt
|
| | |
|
| | | baseSTR, basePNE, basePHY, baseCON = PlayerControl.GetPlayerBasePoint(curPlayer.GetJob())
|
| | | # 读出分配前的属性点错误
|
| | | if (baseSTR, basePNE, basePHY, baseCON) == (0, 0, 0, 0):
|
| | | GameWorld.Log("(baseSTR, basePNE, basePHY, baseCON) == (0, 0, 0, 0), Reset attribute Fail!")
|
| | | return False
|
| | | def DoResetAttrPoint(curPlayer, resetID, resetPoint, useItemID=0):
|
| | | '''重置灵根属性点
|
| | | @param resetID: 重置属性ID,0为重置全部
|
| | | @param resetPoint: 重置点数,0为重置全部
|
| | | '''
|
| | |
|
| | | if resetAttrID == ShareDefine.Def_Effect_STR:
|
| | | baseValue = baseSTR
|
| | | keyStr = 'BaseSTR' |
| | | elif resetAttrID == ShareDefine.Def_Effect_PHY:
|
| | | baseValue = basePHY
|
| | | keyStr = 'BasePHY' |
| | | elif resetAttrID == ShareDefine.Def_Effect_CON:
|
| | | baseValue = baseCON
|
| | | keyStr = 'BaseCON' |
| | | elif resetAttrID == ShareDefine.Def_Effect_PNE:
|
| | | baseValue = basePNE
|
| | | keyStr = 'BasePNE' |
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | canResetIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
|
| | | if resetID == 0:
|
| | | resetIDList = canResetIDList
|
| | | resetValueList = [resetPoint for _ in xrange(len(canResetIDList))]
|
| | | elif resetID in canResetIDList:
|
| | | resetIDList = [resetID]
|
| | | resetValueList = [resetPoint]
|
| | | else:
|
| | | return
|
| | | curValue = getattr(curPlayer, 'Get%s'%keyStr)()
|
| | | if curValue <= baseValue:
|
| | | GameWorld.Log(' Item_ResetAttrPoint 该属性点没有可洗的点数 resetAttrID=%s'%resetAttrID)
|
| | | return
|
| | | realUseCnt = min(useCnt, int(math.ceil((curValue-baseValue)/float(resetCnt))))
|
| | | resetPoint = min(curValue-baseValue, realUseCnt * resetCnt)
|
| | | curPlayer.SetFreePoint(freePoint+resetPoint)
|
| | | getattr(curPlayer, 'Set%s'%keyStr)(curValue-resetPoint)
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetAttrID':resetAttrID,'resetPoint':resetPoint})
|
| | | |
| | | resetPointTotal = 0
|
| | | for i, resetID in enumerate(resetIDList):
|
| | | resetPoint = resetValueList[i]
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % resetID)
|
| | | if not resetPoint:
|
| | | realResetPoint = curPoint
|
| | | else:
|
| | | realResetPoint = min(resetPoint, curPoint)
|
| | | resetPointTotal += realResetPoint
|
| | | updPoint = max(curPoint - realResetPoint, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AddPointValue % resetID, updPoint)
|
| | | if useItemID:
|
| | | PlayerControl.NotifyCode(curPlayer, 'WashPoint2', [useItemID, resetID, realResetPoint, updPoint])
|
| | | |
| | | freePoint = curPlayer.GetFreePoint()
|
| | | curPlayer.SetFreePoint(freePoint + resetPointTotal)
|
| | | ChPlayer.NotifyPlayerBasePoint(curPlayer, resetIDList)
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetAttrID':resetID, 'resetPoint':resetPoint})
|
| | | |
| | | #刷新人物所有状态
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | |
| | | #扣除物品
|
| | | ItemCommon.DelItem(curPlayer, curRoleItem, realUseCnt, True, ChConfig.ItemDel_ResetAttrPoint)
|
| | | PlayerControl.NotifyCode(curPlayer, 'WashPoint2', [curRoleItem.GetItemTypeID(), resetAttrID, resetPoint, curValue-resetPoint-baseValue])
|
| | | return True, realUseCnt
|
| | |
|
| | | return True
|
| | |
|
| | | ## 逻辑实现 //返回值为是否使用成功(外层通知特效)
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | #@return 返回值无意义
|
| | | #@remarks //03 01 加属性点#tagCAddPoint
|
| | | def AddPoint(index, tick):
|
| | | GameWorld.GetPsycoFunc(__Func_AddPoint)(index, tick)
|
| | | return
|
| | |
|
| | | ##//03 01 加属性点#tagCAddPoint
|
| | | #@param index 玩家索引
|
| | | #@param tick 时间戳
|
| | | #@return 返回值无意义
|
| | | #@remarks //03 01 加属性点#tagCAddPoint
|
| | | def __Func_AddPoint(index, tick):
|
| | | #// B2 06 玩家加点 #tagCMAddPoint
|
| | | #
|
| | | #struct tagCMAddPoint
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE PointAttrIDCount; // 加点属性ID个数
|
| | | # BYTE PointAttrIDList[PointAttrIDCount]; // 加点属性ID列表
|
| | | # WORD PointValueList[PointAttrIDCount]; // 加点属性ID对应的点数列表
|
| | | #};
|
| | | def OnAddPoint(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | #JobQuotiety = PlayerControl.JobQuotiety
|
| | | pointAttrIDList = clientData.PointAttrIDList
|
| | | pointValueList = clientData.PointValueList
|
| | | if not pointAttrIDList or not pointValueList or len(pointAttrIDList) != len(pointValueList):
|
| | | return
|
| | | |
| | | needTotalPoint = 0
|
| | | for i, attrID in enumerate(pointAttrIDList):
|
| | | if not IpyGameDataPY.GetIpyGameData("RolePoint", attrID):
|
| | | return
|
| | | needTotalPoint += pointValueList[i]
|
| | | |
| | | curFreePoint = curPlayer.GetFreePoint()
|
| | | #job = curPlayer.GetJob()
|
| | | recvAddPoint = IPY_GameWorld.IPY_CAddPoint()
|
| | | addValue = recvAddPoint.GetPoint()
|
| | | |
| | | #检验是否能够加点
|
| | | if addValue < 1 or addValue > curFreePoint:
|
| | | #检验不通过, 返回
|
| | | #GameWorld.ErrLog("(%s,%s)检验是否能够加点,检验不通过, 返回"%(addValue,curFreePoint) , curPlayer.GetPlayerID())
|
| | | if needTotalPoint > curFreePoint:
|
| | | GameWorld.DebugLog("剩余点数不足! curFreePoint(%s) < needTotalPoint(%s)" % (curFreePoint, needTotalPoint))
|
| | | return
|
| | |
|
| | | #封包加点类型
|
| | | addPointType = recvAddPoint.GetType()
|
| | | |
| | | #加点 |
| | | if addPointType == ShareDefine.Def_Effect_STR:
|
| | | curPlayer.SetBaseSTR(addValue + curPlayer.GetBaseSTR())
|
| | | curPlayer.SetFreePoint(curFreePoint - needTotalPoint)
|
| | | for i, attrID in enumerate(pointAttrIDList):
|
| | | addPoint = pointValueList[i]
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | updPoint = curPoint + addPoint
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AddPointValue % attrID, updPoint)
|
| | | GameWorld.DebugLog("玩家加点: attrID=%s,curPoint=%s,addPoint=%s,updPoint=%s" % (attrID, curPoint, addPoint, updPoint))
|
| | |
|
| | | elif addPointType == ShareDefine.Def_Effect_PNE:
|
| | | curPlayer.SetBasePNE(addValue + curPlayer.GetBasePNE())
|
| | | |
| | | elif addPointType == ShareDefine.Def_Effect_PHY:
|
| | | curPlayer.SetBasePHY(addValue + curPlayer.GetBasePHY())
|
| | | |
| | | elif addPointType == ShareDefine.Def_Effect_CON:
|
| | | curPlayer.SetBaseCON(addValue + curPlayer.GetBaseCON())
|
| | | |
| | | else:
|
| | | #异常超出边界
|
| | | GameWorld.ErrLog("AddPoint GetTypeErr = %s" % (addPointType) , curPlayer.GetID())
|
| | | return
|
| | | |
| | | curPlayer.SetFreePoint(curFreePoint - addValue)
|
| | | |
| | | DataRecordPack.DR_Freepoint(curPlayer, "AddPoint", curFreePoint, {"AddPointType":addPointType})
|
| | | playerControl.RefreshPlayerAttrState() |
| | | |
| | | NotifyPlayerBasePoint(curPlayer, pointAttrIDList)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def NotifyPlayerBasePoint(curPlayer):
|
| | | #上线通知基础属性点
|
| | | notifyList = []
|
| | | notifyBasePointDict = {
|
| | | IPY_GameWorld.CDBPlayerRefresh_BaseSTR:'BaseSTR',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BasePHY:'BasePHY',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BaseCON:'BaseCON',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BasePNE:'BasePNE',
|
| | | }
|
| | | for refreshType, keyStr in notifyBasePointDict.items():
|
| | | notifyStruct = ChPyNetSendPack.tagRefreshType()
|
| | | notifyStruct.RefreshType = refreshType
|
| | | notifyStruct.Value = getattr(curPlayer, 'Get%s'%keyStr)()
|
| | | notifyList.append(notifyStruct)
|
| | | def NotifyPlayerBasePoint(curPlayer, syncAttrIDList=[]):
|
| | | # 通知基础属性点,已分配的自由点数
|
| | | |
| | | if not syncAttrIDList:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | syncAttrIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
|
| | |
|
| | | #属性组合包 通知自己
|
| | | sendPack = ChPyNetSendPack.tagObjInfoListRefresh()
|
| | | sendPack.Clear()
|
| | | sendPack.ObjID = curPlayer.GetID()
|
| | | sendPack.ObjType = curPlayer.GetGameObjType()
|
| | | sendPack.Count = len(notifyList)
|
| | | sendPack.RefreshType = notifyList
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | pointAttrIDList = []
|
| | | pointValueList = []
|
| | | for attrID in syncAttrIDList:
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | pointAttrIDList.append(attrID)
|
| | | pointValueList.append(curPoint)
|
| | | |
| | | pointInfo = ChPyNetSendPack.tagMCRolePointInfo()
|
| | | pointInfo.PointAttrIDList = pointAttrIDList
|
| | | pointInfo.PointValueList = pointValueList
|
| | | pointInfo.PointAttrIDCount = len(pointAttrIDList)
|
| | | NetPackCommon.SendFakePack(curPlayer, pointInfo)
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | |
| | | '''加点功能开启 处理给自由属性点及老号处理
|
| | | 清除老服玩家未加点的点数(清零),以前加的加点属性不清除,属性不变,战力不减, 根据最新的加点开启等级和老服玩家的当前等级,相差的差值给予玩家对应的加点点数'''
|
| | | beforeFreePoint = curPlayer.GetFreePoint()
|
| | |
|
| | | |
| | | setFreePoint = GetAllPointByLV(curPlayer)
|
| | | curLV = curPlayer.GetLV()
|
| | | addDataDict = {'beforeFreePoint':beforeFreePoint}
|
| | |
| | | job = curPlayer.GetJob()
|
| | |
|
| | | lvAttrDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAttr%s" % job, 1)
|
| | | pointAttrDict = IpyGameDataPY.GetFuncEvalCfg("PointAttr%s" % job, 1)
|
| | |
|
| | | if not lvAttrDict:
|
| | | GameWorld.ErrLog('无此职业等级刷属性配置!job=%s' % (job), curPlayerID)
|
| | | return
|
| | |
|
| | | if not pointAttrDict:
|
| | | GameWorld.ErrLog('无此职业属性点刷属性配置!job=%s' % (job), curPlayerID)
|
| | | return
|
| | | |
| | | #参与计算的玩家基础属性
|
| | | LV = curPlayer.GetLV()
|
| | | STR = curPlayer.GetSTR()
|
| | | PNE = curPlayer.GetPNE()
|
| | | PHY = curPlayer.GetPHY()
|
| | | CON = curPlayer.GetCON()
|
| | | baseSTR = curPlayer.GetBaseSTR()
|
| | | basePNE = curPlayer.GetBasePNE()
|
| | | basePHY = curPlayer.GetBasePHY()
|
| | | baseCON = curPlayer.GetBaseCON()
|
| | | GameWorld.DebugLog("CalcRoleBaseAttr LV=%s,STR=(%s~%s),PNE=(%s~%s),PHY=(%s~%s),CON=(%s~%s)" |
| | | % (LV, baseSTR, STR, basePNE, PNE, basePHY, PHY, baseCON, CON))
|
| | |
|
| | | allAttrList = [{} for _ in range(4)]
|
| | |
|
| | | # 职业初始属性
|
| | | roleBaseAttrDict = IpyGameDataPY.GetFuncEvalCfg("CreatRoleBaseAttr", 1)
|
| | | if job in roleBaseAttrDict:
|
| | | for attrEffID, value in roleBaseAttrDict[job].items():
|
| | | CalcAttrDict_Type(attrEffID, value, allAttrList)
|
| | | for roleBaseAttrID, value in roleBaseAttrDict[job].items():
|
| | | CalcAttrDict_Type(roleBaseAttrID, value, allAttrList)
|
| | | #GameWorld.DebugLog("初始加属性: %s" % allAttrList)
|
| | |
|
| | | for attrEffID, formula in lvAttrDict.items():
|
| | | calcValue = eval(FormulaControl.GetCompileFormula("LVUPAttr%s_%s" % (job, attrEffID), formula))
|
| | | CalcAttrDict_Type(attrEffID, calcValue, allAttrList)
|
| | | #GameWorld.DebugLog(" attrEffID=%s,value=%s" % (attrEffID, calcValue))
|
| | | |
| | | # 等级成长属性
|
| | | LV = curPlayer.GetLV()
|
| | | for lvAttrID, formula in lvAttrDict.items():
|
| | | calcValue = eval(FormulaControl.GetCompileFormula("LVUPAttr%s_%s" % (job, lvAttrID), formula))
|
| | | CalcAttrDict_Type(lvAttrID, calcValue, allAttrList)
|
| | | #GameWorld.DebugLog(" lvAttrID=%s,calcValue=%s" % (lvAttrID, calcValue))
|
| | | #GameWorld.DebugLog("等级加属性: %s" % allAttrList)
|
| | |
|
| | | for attrEffID, formula in pointAttrDict.items():
|
| | | calcValue = eval(FormulaControl.GetCompileFormula("PointAttr%s_%s" % (job, attrEffID), formula))
|
| | | CalcAttrDict_Type(attrEffID, calcValue, allAttrList)
|
| | | #GameWorld.DebugLog(" attrEffID=%s,value=%s" % (attrEffID, calcValue))
|
| | | # 属性点属性
|
| | | pointValueInfo = {ShareDefine.Def_Effect_Metal:[lambda curObj:GetMetal(curObj), lambda curObj, value:SetMetalQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Wood:[lambda curObj:GetWood(curObj), lambda curObj, value:SetWoodQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Water:[lambda curObj:GetWater(curObj), lambda curObj, value:SetWaterQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Fire:[lambda curObj:GetFire(curObj), lambda curObj, value:SetFireQualityLV(curObj, value)],
|
| | | ShareDefine.Def_Effect_Earth:[lambda curObj:GetEarth(curObj), lambda curObj, value:SetEarthQualityLV(curObj, value)],
|
| | | }
|
| | | lingGenQualityAttrList = [{} for _ in range(4)]
|
| | | for pointAttrID, pointFuncInfo in pointValueInfo.items():
|
| | | pointValue = pointFuncInfo[0](curPlayer)
|
| | | pointFuncInfo[1](curPlayer, 0)
|
| | | if not pointValue:
|
| | | continue
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("RolePoint", pointAttrID)
|
| | | if not ipyData:
|
| | | continue
|
| | | # 每点属性
|
| | | perPointAddAttrDict = ipyData.GetAddAttrInfoPerPoint()
|
| | | for perPointAttrID, perPointAttrValue in perPointAddAttrDict.items():
|
| | | pointAddValue = perPointAttrValue * pointValue
|
| | | CalcAttrDict_Type(perPointAttrID, pointAddValue, allAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)加属性: pointValue=%s,perPointAttrID=%s,pointAddValue=%s" % (pointAttrID, pointValue, perPointAttrID, pointAddValue))
|
| | | |
| | | # 点数品质属性
|
| | | curPQLV = 0
|
| | | pqIntervalList = ipyData.GetPointQualityIntervalList()
|
| | | for pqLV, pqValue in enumerate(pqIntervalList, 1):
|
| | | if pointValue >= pqValue:
|
| | | curPQLV = pqLV
|
| | | else:
|
| | | break
|
| | | pointFuncInfo[1](curPlayer, curPQLV)
|
| | | if not curPQLV:
|
| | | continue
|
| | | pqAttrID = ipyData.GetPointQualityAttrID()
|
| | | pqAttrValueList = ipyData.GetPointQualityAttrValueList()
|
| | | pqAttrValue = 0 if curPQLV > len(pqAttrValueList) else pqAttrValueList[curPQLV - 1]
|
| | | CalcAttrDict_Type(pqAttrID, pqAttrValue, lingGenQualityAttrList)
|
| | | #GameWorld.DebugLog(" 属性点(%s)品阶等级属性: curPQLV=%s,pqAttrID=%s,pqAttrValue=%s" % (pointAttrID, curPQLV, pqAttrID, pqAttrValue))
|
| | | |
| | | #GameWorld.DebugLog("等级属性点加属性: %s" % allAttrList)
|
| | | |
| | | SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase, allAttrList) |
| | | #GameWorld.DebugLog("灵根品阶等级属性: %s" % lingGenQualityAttrList) |
| | | SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase, allAttrList)
|
| | | SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingGenQuailty, lingGenQualityAttrList)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # 2.1 获取所有功能计算点计算的属性值, 统计基础属性累加
|
| | | baseAttrDict = {}
|
| | | baseAttrNolineDict = {}
|
| | | roleBaseAttrInfo = [{} for _ in range(4)]
|
| | | funcAttrInfoList = []
|
| | | for funcIndex in ChConfig.CalcAttrFuncList:
|
| | | if funcIndex in ChConfig.CalcAttrExFuncListNoFightPower:
|
| | |
| | | continue
|
| | |
|
| | | # 基础属性等功能汇总完后统一刷新,因为各功能可能会加属性点数
|
| | | if funcIndex == ChConfig.Def_CalcAttrFunc_RoleBase:
|
| | | funcAttrInfoList.append(roleBaseAttrInfo)
|
| | | if funcIndex in [ChConfig.Def_CalcAttrFunc_RoleBase, ChConfig.Def_CalcAttrFunc_LingGenQuailty]:
|
| | | funcAttrInfoList.append([{} for _ in range(4)])
|
| | | continue
|
| | | attrInfo = GetCalcAttrListValue(curPlayer, funcIndex)
|
| | | if attrInfo != notAttrList:
|
| | |
| | | # 功能有加基础属性值,这里再重新刷新一下基础属性, 基础属性会影响战斗属性, 每次都刷新角色基础属性
|
| | | self.CalcRoleBaseAttr(curPlayer)
|
| | | roleBaseAttrInfo = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_RoleBase)
|
| | | lingGenQualityAttrList = GetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_LingGenQuailty)
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_RoleBase] = roleBaseAttrInfo
|
| | | funcAttrInfoList[ChConfig.Def_CalcAttrFunc_LingGenQuailty] = lingGenQualityAttrList
|
| | | GameWorld.DebugLog("功能点属性: %s, %s" % (ChConfig.Def_CalcAttrFunc_RoleBase, roleBaseAttrInfo))
|
| | | GameWorld.DebugLog("功能点属性: %s, %s" % (ChConfig.Def_CalcAttrFunc_LingGenQuailty, lingGenQualityAttrList))
|
| | |
|
| | | #self.PrintAttr(curPlayer, "基础后")
|
| | |
|
| | |
| | |
|
| | | #再根据BUFF 加上状态
|
| | | SkillShell.CalcBuffer_ActionState(curPlayer)
|
| | | #---------------------------------------------------------------------
|
| | | |
| | | #---------------------------------------------------------------------
|
| | | ## 存入数据库玩家基本属性
|
| | | # @param self 类实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 存入数据库玩家基本属性
|
| | | def __SetPlayerStateInDB(self):
|
| | | curPlayer = self.__Player
|
| | | #力量
|
| | | curPlayerSTR = curPlayer.GetSTR()
|
| | | if curPlayer.GetTotalSTR() != curPlayerSTR: |
| | | curPlayer.SetTotalSTR(curPlayerSTR)
|
| | | #真元
|
| | | curPlayerPNE = curPlayer.GetPNE()
|
| | | if curPlayer.GetTotalPNE() != curPlayerPNE:
|
| | | curPlayer.SetTotalPNE(curPlayerPNE)
|
| | | #筋骨
|
| | | curPlayerPHY = curPlayer.GetPHY()
|
| | | if curPlayer.GetTotalPHY() != curPlayerPHY:
|
| | | curPlayer.SetTotalPHY(curPlayerPHY)
|
| | | #体魄
|
| | | curPlayerCON = curPlayer.GetCON()
|
| | | if curPlayer.GetTotalCON() != curPlayerCON: |
| | | curPlayer.SetTotalCON(curPlayerCON)
|
| | | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 刷新血量和魔
|
| | |
| | | curPlayer.ClearBattleEffect()
|
| | |
|
| | | initAttrDict = {
|
| | | ChConfig.TYPE_Calc_AttrCurSTR:curPlayer.GetBaseSTR(),
|
| | | ChConfig.TYPE_Calc_AttrCurPNE:curPlayer.GetBasePNE(),
|
| | | ChConfig.TYPE_Calc_AttrCurPHY:curPlayer.GetBasePHY(),
|
| | | ChConfig.TYPE_Calc_AttrCurCON:curPlayer.GetBaseCON(),
|
| | | #ChConfig.TYPE_Calc_AttrCurSTR:curPlayer.GetBaseSTR(),
|
| | | #ChConfig.TYPE_Calc_AttrCurPNE:curPlayer.GetBasePNE(),
|
| | | #ChConfig.TYPE_Calc_AttrCurPHY:curPlayer.GetBasePHY(),
|
| | | #ChConfig.TYPE_Calc_AttrCurCON:curPlayer.GetBaseCON(),
|
| | | #ChConfig.TYPE_Calc_AttrSpeed:curPlayer.GetBaseSpeed(),
|
| | | ChConfig.TYPE_Calc_AttrAtkSpeed:ChConfig.Def_BaseAtkSpeed,
|
| | | ChConfig.TYPE_Calc_AttrFightExpRate:GameWorld.GetGameWorld().GetExpRate(),
|
| | |
| | | if not curPlayer.GetCanAttack():
|
| | | curPlayer.SetCanAttack(True)
|
| | |
|
| | | #初始化灵根
|
| | | SetMetal(curPlayer, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % ShareDefine.Def_Effect_Metal))
|
| | | SetWood(curPlayer, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % ShareDefine.Def_Effect_Wood))
|
| | | SetWater(curPlayer, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % ShareDefine.Def_Effect_Water))
|
| | | SetFire(curPlayer, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % ShareDefine.Def_Effect_Fire))
|
| | | SetEarth(curPlayer, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % ShareDefine.Def_Effect_Earth))
|
| | | return True
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | return totalExpRate
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 获取玩家基础属性点
|
| | | # @param job 职业类型
|
| | | # @return baseSTR, basePNE, basePHY, baseCON
|
| | | def GetPlayerBasePoint(job):
|
| | | baseSTR, basePNE, basePHY, baseCON = (0, 0, 0, 0)
|
| | | |
| | | jobDict = IpyGameDataPY.GetFuncEvalCfg("CreatRolePoint%s" % job, 1)
|
| | | |
| | | if not jobDict:
|
| | | GameWorld.ErrLog('CreatRolePoint, job = %s' % (job))
|
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | | |
| | | for key, value in jobDict.items():
|
| | | |
| | | if type(key) == str:
|
| | | key = key.upper()
|
| | | |
| | | if key in ['STR', ShareDefine.Def_Effect_STR]:
|
| | | baseSTR = value
|
| | | |
| | | elif key in ['PNE', ShareDefine.Def_Effect_PNE]:
|
| | | basePNE = value
|
| | | |
| | | elif key in ['PHY', ShareDefine.Def_Effect_PHY]:
|
| | | basePHY = value
|
| | | |
| | | elif key in ['CON', ShareDefine.Def_Effect_CON]:
|
| | | baseCON = value
|
| | | |
| | | else:
|
| | | GameWorld.ErrLog('CreatRolePoint, key = %s' % (key))
|
| | | |
| | | return baseSTR, basePNE, basePHY, baseCON
|
| | |
|
| | |
|
| | | ##记录玩家失去金钱的流向记录,消息中会记录玩家拥有的金钱信息
|
| | | # @param curPlayer 玩家实例
|
| | | # @param moneyType 金钱类型
|
| | |
| | | #===============================================================================
|
| | |
|
| | |
|
| | | # 灵根 - 金木水火土
|
| | | def GetMetal(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Metal)
|
| | | def SetMetal(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_Metal, value)
|
| | | def GetWood(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Wood)
|
| | | def SetWood(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_Wood, value)
|
| | | def GetWater(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Water)
|
| | | def SetWater(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_Water, value)
|
| | | def GetFire(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Fire)
|
| | | def SetFire(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_Fire, value)
|
| | | def GetEarth(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Earth)
|
| | | def SetEarth(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_Earth, value)
|
| | | # 灵根品级 - 金木水火土
|
| | | def GetMetalQualityLV(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MetalQualityLV)
|
| | | def SetMetalQualityLV(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_MetalQualityLV, value)
|
| | | def GetWoodQualityLV(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_WoodQualityLV)
|
| | | def SetWoodQualityLV(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_WoodQualityLV, value)
|
| | | def GetWaterQualityLV(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_WaterQualityLV)
|
| | | def SetWaterQualityLV(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_WaterQualityLV, value)
|
| | | def GetFireQualityLV(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FireQualityLV)
|
| | | def SetFireQualityLV(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_FireQualityLV, value)
|
| | | def GetEarthQualityLV(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_EarthQualityLV)
|
| | | def SetEarthQualityLV(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_EarthQualityLV, value)
|
| | |
|
| | | #---玩家扩展接口, 战斗属性,不存数据库,只通知本人---
|
| | |
|
| | | ##玩家移动速度值, 不含buff对速度的影响; 功能等对速度的影响直接改变此值
|
| | |
| | | #---功能层防御值----
|
| | | def GetFuncDef(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_CopyFuncAttr % (ChConfig.TYPE_Calc_AttrDEF - 1))
|
| | | def SetFuncDef(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_CopyFuncAttr % (ChConfig.TYPE_Calc_AttrDEF - 1), value)
|
| | |
|
| | | #---诛仙一击概率---
|
| | | def GetZhuXianRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ZhuxianRate)
|
| | | def SetZhuXianRate(curPlayer, value): |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ZhuxianRate, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ZhuxianRate, value, False) |
| | |
|
| | | #---诛仙一击伤害百分比---
|
| | | def GetZhuXianHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ZhuxianHurtPer)
|
| | | def SetZhuXianHurtPer(curPlayer, value): |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ZhuxianHurtPer, value)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ZhuxianHurtPer, value, False)
|
| | |
|
| | |
|
| | | ## 增加天梯竞技场积分
|
| | |
| | | Def_SkillID_AutoTruck = 62220 # 自动运镖buff
|
| | |
|
| | | #---写死的物品属性效果ID---
|
| | | Def_Effect_Metal = 201 # 金
|
| | | Def_Effect_Wood = 202 # ľ
|
| | | Def_Effect_Water = 203 # ˮ
|
| | | Def_Effect_Fire = 204 # 火
|
| | | Def_Effect_Earth = 205 # 土
|
| | | #增加%d力量
|
| | | Def_Effect_STR = 2 #1006
|
| | | #增加%d真元
|
| | |
| | | Def_Effect_LXWeaponAttrPer = 117 # 诛仙剑2属性加成百分比
|
| | | Def_Effect_XXWeaponAttrPer = 118 # 诛仙剑3属性加成百分比
|
| | | Def_Effect_JXWeaponAttrPer = 119 # 诛仙剑4属性加成百分比
|
| | |
|
| | | Def_Effect_Luck = 120 # 气运
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | CDBPlayerRefresh_SoulSplinters, # 聚魂碎片 197
|
| | | CDBPlayerRefresh_SoulCore, # 核心环 198
|
| | | CDBPlayerRefresh_Honor, # 荣誉 199
|
| | | CDBPlayerRefresh_ZhuxianRate, # 诛仙一击概率 200
|
| | | CDBPlayerRefresh_ZhuxianHurtPer, # 诛仙一击伤害百分比 201
|
| | | ) = range(146, 202)
|
| | | CDBPlayerRefresh_200, # 200
|
| | | CDBPlayerRefresh_Mater, # 金
|
| | | CDBPlayerRefresh_Wood, # ľ
|
| | | CDBPlayerRefresh_Water, # ˮ
|
| | | CDBPlayerRefresh_Fire, # 火
|
| | | CDBPlayerRefresh_Earth, # 土 205
|
| | | ) = range(146, 206)
|
| | |
|
| | | TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
|
| | | TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
|
| | |
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | GameFuncID_AddPoint = 145 # 加点功能
|
| | | GameFuncID_AddPoint = 145 # 加点功能/灵根功能
|
| | | GameFuncID_LittleHelper = 146 # 小助手
|
| | | GameFuncID_TJG = 147 # 脱机挂
|
| | | GameFuncID_SuperGift = 150 # 超值礼包
|
| | |
| | | Def_MFPType_Equip, # 装备(基本装备位) 1 - 废弃
|
| | | Def_MFPType_Plus, # 强化 2
|
| | | Def_MFPType_Stone, # 宝石 3
|
| | | Def_MFPType_Suit, # 套装 4 - 废弃
|
| | | Def_MFPType_LingGen, # 灵根 4
|
| | | Def_MFPType_Wing, # 翅膀 5
|
| | | Def_MFPType_Wash, # 洗练 6
|
| | | Def_MFPType_Pet, # 灵宠 7
|
| | |
| | | Def_MFPType_MagicWeapon3, # 仙族法宝 17
|
| | | Def_MFPType_PetSoul, # 灵宠魂石 18
|
| | | Def_MFPType_HorseSoul, # 坐骑魂石 19
|
| | | Def_MFPType_MagicWeaponSoul, # 法宝之魂 20 - 废弃
|
| | | Def_MFPType_20,
|
| | | Def_MFPType_Dogz, # 神兽 21
|
| | | Def_MFPType_GatherSoul, # 聚魂 22
|
| | | Def_MFPType_MagicWeapon4, # 王者法宝 23
|
| | |
| | | #生物属性接口,顺序对应ChConfig.TYPE_Calc_AttrList
|
| | | #同个属性Get, Set 写在一起,方便维护 [Get, Set, 属性类型, 是否通知自身, 是否通知周围玩家]
|
| | | ObjProperty_AttrByIndex = [
|
| | | [lambda curObj:curObj.GetSTR(), lambda curObj, value:curObj.SetSTR(value), IPY_PlayerDefine.CDBPlayerRefresh_STR, 1, 0], # 力量
|
| | | [lambda curObj:curObj.GetPNE(), lambda curObj, value:curObj.SetPNE(value), IPY_PlayerDefine.CDBPlayerRefresh_PNE, 1, 0], # 智力
|
| | | [lambda curObj:curObj.GetPHY(), lambda curObj, value:curObj.SetPHY(value), IPY_PlayerDefine.CDBPlayerRefresh_PHY, 1, 0], # 敏捷
|
| | | [lambda curObj:curObj.GetCON(), lambda curObj, value:curObj.SetCON(value), IPY_PlayerDefine.CDBPlayerRefresh_CON, 1, 0], # 体质
|
| | | [lambda curObj:PlayerControl.GetMetal(curObj), lambda curObj, value:PlayerControl.SetMetal(curObj, value), ShareDefine.CDBPlayerRefresh_Mater, 1, 0], # 金
|
| | | [lambda curObj:PlayerControl.GetWood(curObj), lambda curObj, value:PlayerControl.SetWood(curObj, value), ShareDefine.CDBPlayerRefresh_Wood, 1, 0], # ľ
|
| | | [lambda curObj:PlayerControl.GetWater(curObj), lambda curObj, value:PlayerControl.SetWater(curObj, value), ShareDefine.CDBPlayerRefresh_Water, 1, 0], # ˮ
|
| | | [lambda curObj:PlayerControl.GetFire(curObj), lambda curObj, value:PlayerControl.SetFire(curObj, value), ShareDefine.CDBPlayerRefresh_Fire, 1, 0], # 火
|
| | | [lambda curObj:PlayerControl.GetEarth(curObj), lambda curObj, value:PlayerControl.SetEarth(curObj, value), ShareDefine.CDBPlayerRefresh_Earth, 1, 0], # 土
|
| | |
|
| | | [lambda curObj:GameObj.GetHP(curObj), lambda curObj, value:GameObj.SetHP(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_HP, 1, 1], # 当前血量
|
| | | [lambda curObj:curObj.GetMP(), lambda curObj, value:curObj.SetMP(value), IPY_PlayerDefine.CDBPlayerRefresh_MP, 0, 0], # 当前魔量
|
| | | [lambda curObj:GameObj.GetMaxHP(curObj), lambda curObj, value:GameObj.SetMaxHP(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_MaxHP, 1, 1], # 最大血量
|
| | | [lambda curObj:curObj.GetMaxMP(), lambda curObj, value:curObj.SetMaxMP(value), IPY_PlayerDefine.CDBPlayerRefresh_MaxMP, 0, 0], # 最大魔量
|
| | | [lambda curObj:curObj.GetMinAtk(), lambda curObj, value:curObj.SetMinAtk(value), IPY_PlayerDefine.CDBPlayerRefresh_MINATK, 1, 0], # 最小攻击力
|
| | | [lambda curObj:curObj.GetMaxAtk(), lambda curObj, value:curObj.SetMaxAtk(value), IPY_PlayerDefine.CDBPlayerRefresh_MAXATK, 1, 0], # 最大攻击力
|
| | | [lambda curObj:curObj.GetMAtkMin(), lambda curObj, value:curObj.SetMAtkMin(value), IPY_PlayerDefine.CDBPlayerRefresh_MAtkMin, 0, 0], # 最小魔攻
|
| | | [lambda curObj:curObj.GetMAtkMax(), lambda curObj, value:curObj.SetMAtkMax(value), IPY_PlayerDefine.CDBPlayerRefresh_MAtkMax, 0, 0], # 最大魔攻
|
| | | [lambda curObj:curObj.GetDef(), lambda curObj, value:curObj.SetDef(value), IPY_PlayerDefine.CDBPlayerRefresh_DEF, 1, 0], # 防御力
|
| | | [lambda curObj:curObj.GetHit(), lambda curObj, value:curObj.SetHit(value), IPY_PlayerDefine.CDBPlayerRefresh_HIT, 1, 0], # 命中
|
| | | [lambda curObj:curObj.GetMiss(), lambda curObj, value:curObj.SetMiss(value), IPY_PlayerDefine.CDBPlayerRefresh_Miss, 1, 0], # 闪避
|
| | | [lambda curObj:curObj.GetMinAtk(), lambda curObj, value:curObj.SetMinAtk(value), IPY_PlayerDefine.CDBPlayerRefresh_MINATK, 1, 0], # 最小攻击力
|
| | | [lambda curObj:curObj.GetMaxAtk(), lambda curObj, value:curObj.SetMaxAtk(value), IPY_PlayerDefine.CDBPlayerRefresh_MAXATK, 1, 0], # 最大攻击力
|
| | | [lambda curObj:GameObj.GetHP(curObj), lambda curObj, value:GameObj.SetHP(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_HP, 1, 1], # 当前血量
|
| | | [lambda curObj:curObj.GetMP(), lambda curObj, value:curObj.SetMP(value), IPY_PlayerDefine.CDBPlayerRefresh_MP, 0, 0], # 当前魔量
|
| | | #[lambda curObj:curObj.GetMAtkMin(), lambda curObj, value:curObj.SetMAtkMin(value), IPY_PlayerDefine.CDBPlayerRefresh_MAtkMin, 0, 0], # 最小魔攻
|
| | | #[lambda curObj:curObj.GetMAtkMax(), lambda curObj, value:curObj.SetMAtkMax(value), IPY_PlayerDefine.CDBPlayerRefresh_MAtkMax, 0, 0], # 最大魔攻
|
| | | [lambda curObj:curObj.GetLuckValue(), lambda curObj, value:curObj.SetLuckValue(value), IPY_PlayerDefine.CDBPlayerRefresh_LuckValue, 1, 0], # 气运
|
| | | [lambda curObj:PlayerControl.GetSpeedNotBuff(curObj), lambda curObj, value:PlayerControl.SetSpeedNotBuff(curObj, value), 0, 0, 0], # 移动速度
|
| | | [lambda curObj:PlayerControl.GetAtkSpeed(curObj), lambda curObj, value:PlayerControl.SetAtkSpeed(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_BattleValEx1, 1, 1], # 攻击速度
|
| | |
|
| | |
| | | [lambda curObj:PlayerControl.GetSuiteBasePer(curObj), lambda curObj, value:PlayerControl.SetSuiteBasePer(curObj, value), 0, 0, 0], # 套装基础属性百分比
|
| | | [lambda curObj:PlayerControl.GetPlusBaseAtkPer(curObj), lambda curObj, value:PlayerControl.SetPlusBaseAtkPer(curObj, value), 0, 0, 0], # 强化基础攻击百分比
|
| | | [lambda curObj:PlayerControl.GetProDef(curObj), lambda curObj, value:PlayerControl.SetProDef(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_ExAttr4, 1, 0], # 当前防护值
|
| | | [lambda curObj:PlayerControl.GetZhuXianRate(curObj), lambda curObj, value:PlayerControl.SetZhuXianRate(curObj, value), ShareDefine.CDBPlayerRefresh_ZhuxianRate, 1, 0], # 诛仙一击概率
|
| | | [lambda curObj:PlayerControl.GetZhuXianHurtPer(curObj), lambda curObj, value:PlayerControl.SetZhuXianHurtPer(curObj, value), ShareDefine.CDBPlayerRefresh_ZhuxianHurtPer, 1, 0], # 诛仙一击伤害比
|
| | |
|
| | |
|
| | | ]
|
| | |
|
| | | ## 通过索引获得属性值
|
| | |
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseWeapon)
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | | attrTypeList = [attrType]
|
| | | # 攻击力有最大最小 特殊处理
|
| | | if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
|
| | | attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
|
| | | for tmpType in attrTypeList:
|
| | | value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | calcDict[tmpType] = calcDict.get(tmpType, 0) - value
|
| | | |
| | | # 境界装备改版,暂取消
|
| | | return
|
| | | # attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseWeapon)
|
| | | # attrType = curEffect.GetEffectValue(1)
|
| | | # attrTypeList = [attrType]
|
| | | # # 攻击力有最大最小 特殊处理
|
| | | # if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
|
| | | # attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
|
| | | # for tmpType in attrTypeList:
|
| | | # value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | # calcDict[tmpType] = calcDict.get(tmpType, 0) - value
|
| | | # |
| | | # return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|
| | |
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseArmor)
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | |
|
| | | value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | calcDict[attrType] = calcDict.get(attrType, 0) - value
|
| | | |
| | | # 境界装备改版,暂取消
|
| | | return
|
| | | # attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseArmor)
|
| | | # attrType = curEffect.GetEffectValue(1)
|
| | | #
|
| | | # value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | # calcDict[attrType] = calcDict.get(attrType, 0) - value
|
| | | # |
| | | # return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|
| | |
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseWeapon)
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | | attrTypeList = [attrType]
|
| | | # 攻击力有最大最小 特殊处理
|
| | | if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
|
| | | attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
|
| | | for tmpType in attrTypeList:
|
| | | value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | calcDict[tmpType] = calcDict.get(tmpType, 0) + value
|
| | | |
| | | # 境界装备改版,暂取消
|
| | | return
|
| | | # attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseWeapon)
|
| | | # attrType = curEffect.GetEffectValue(1)
|
| | | # attrTypeList = [attrType]
|
| | | # # 攻击力有最大最小 特殊处理
|
| | | # if attrType in [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]:
|
| | | # attrTypeList = [ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax]
|
| | | # for tmpType in attrTypeList:
|
| | | # value = int(attrList[2].get(tmpType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | # calcDict[tmpType] = calcDict.get(tmpType, 0) + value
|
| | | # |
| | | # return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|
| | |
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseArmor)
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | |
|
| | | value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | calcDict[attrType] = calcDict.get(attrType, 0) + value
|
| | | |
| | | # 境界装备改版,暂取消
|
| | | return
|
| | | # attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_EquipBaseArmor)
|
| | | # attrType = curEffect.GetEffectValue(1)
|
| | | #
|
| | | # value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | # calcDict[attrType] = calcDict.get(attrType, 0) + value
|
| | | # |
| | | # return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|