| | |
| | | DWORD NeedExp; //需要经验
|
| | | dict AddAttr; //属性
|
| | | list UnLockSkill; //解锁的技能
|
| | | DWORD PrivilegeID; //特权ID
|
| | | DWORD ActiveMWID; //激活法宝ID
|
| | | list ItemAward; //物品奖励[itemID,cnt,isbind]
|
| | | };
|
| | |
|
| | | //法宝特权表
|
| | |
| | | DWORD MaxValue; //最大进度
|
| | | dict AddAttr; //属性
|
| | | list ItemAward; //物品奖励
|
| | | list SuccessList; //需要完成成就
|
| | | };
|
| | |
|
| | | //法宝技能升级表
|
| | |
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("PriID", c_int), # 特权ID
|
| | | ("State", c_ubyte), #激活状态
|
| | | ("CurValue", c_int), #当前总进度
|
| | | ("GotValue", c_int), #已领取进度
|
| | | ("ItemAwardState", c_ubyte), #物品奖励是否已领取
|
| | |
| | |
|
| | | def Clear(self):
|
| | | self.PriID = 0
|
| | | self.State = 0
|
| | | self.CurValue = 0
|
| | | self.GotValue = 0
|
| | | self.ItemAwardState = 0
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''// A3 53 法宝特权数据 //tagMCMWPrivilegeDataInfo:
|
| | | PriID:%d,
|
| | | State:%d,
|
| | | CurValue:%d,
|
| | | GotValue:%d,
|
| | | ItemAwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.PriID,
|
| | | self.State,
|
| | | self.CurValue,
|
| | | self.GotValue,
|
| | | self.ItemAwardState
|
| | |
| | |
|
| | | m_NAtagMCMWPrivilegeDataInfo=tagMCMWPrivilegeDataInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMWPrivilegeDataInfo.Head.Cmd,m_NAtagMCMWPrivilegeDataInfo.Head.SubCmd))] = m_NAtagMCMWPrivilegeDataInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 0E 通知法宝之魂激活状态 #tagMCMWSoulState
|
| | |
|
| | | class tagMCMWSoulState(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("State", c_int), #激活状态
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x0E
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x0E
|
| | | self.State = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCMWSoulState)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 0E 通知法宝之魂激活状态 //tagMCMWSoulState:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | State:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.State
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCMWSoulState=tagMCMWSoulState()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMWSoulState.Cmd,m_NAtagMCMWSoulState.SubCmd))] = m_NAtagMCMWSoulState
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | )=range(5)
|
| | |
|
| | | # 战斗力模块类型
|
| | | Def_MFPType_Max = 23
|
| | | Def_MFPType_Max = 24
|
| | | ModuleFightPowerTypeList = (
|
| | | Def_MFPType_Role, # 角色 0
|
| | | Def_MFPType_Equip, # 装备(基本装备位) 1
|
| | |
| | | Def_MFPType_MagicWeapon3, # 仙族法宝 17
|
| | | Def_MFPType_PetSoul, # 灵宠魂石 18
|
| | | Def_MFPType_HorseSoul, # 坐骑魂石 19
|
| | | Def_MFPType_MagicWeaponSoul, # 法宝之魂 20
|
| | | Def_MFPType_Other, # 其他
|
| | |
|
| | | #以下暂时没用到,改时再处理
|
| | |
| | | DailyActionID_TowerSD, # 符印塔扫荡
|
| | | DailyActionID_XXX12, # 废弃12
|
| | | DailyActionID_Tower, # 符印塔
|
| | | DailyActionID_MagicWeapon, # 觉醒法宝
|
| | | DailyActionID_MagicWeapon, # 法宝集魂
|
| | | DailyActionID_FBHelp, # 助战副本
|
| | | DailyActionID_BOSSHome, # BOSS之家
|
| | | ) = range(1, 16 + 1)
|
| | |
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 5
|
| | | RegisterPackCount = 6
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x0D
|
| | |
| | | PacketSubCMD_5=0x16
|
| | | PacketCallFunc_5=SaveMagicWeaponState
|
| | |
|
| | | PacketCMD_6=0xA5
|
| | | PacketSubCMD_6=0x12
|
| | | PacketCallFunc_6=OnActiveMWSoul
|
| | |
|
| | | ;副本
|
| | | [FBCommon]
|
| | | ScriptName = GameWorldLogic\FBProcess\FBCommon.py
|
| | |
| | |
|
| | | #仙魔之争
|
| | | Def_FBMapID_XMZZ = 31010
|
| | |
|
| | | #神兽副本
|
| | | Def_FBMapID_Dogz = 21110
|
| | | #副本关闭时未拾取的物品邮件发放给玩家
|
| | | #这里只有需要的副本才配置,不做默认逻辑,防止某些副本实际不能给导致刷物品,如麒麟之府
|
| | | Def_SendUnPickItemMailMapIDList = [Def_FBMapID_IceLode, Def_FBMapID_PersonalBoss, Def_FBMapID_MunekadoTrial,
|
| | |
| | | 'Guard':[Def_FBMapID_Guard], #守护副本
|
| | | 'SealDemon':[Def_FBMapID_SealDemon, Def_FBMapID_SealDemonEx], #封魔坛
|
| | | 'XMZZ':[Def_FBMapID_XMZZ], #仙魔之争
|
| | | #'Dogz':[Def_FBMapID_Dogz], #神兽副本
|
| | | }
|
| | |
|
| | | #特殊副本ID, 由系统分配, 进入时候不验证IsMapCopyFull
|
| | |
| | | Def_PDict_MWSoulCurValue = "MWSoulCurValue_%s" #法宝特权当前进度 参数特权ID
|
| | | Def_PDict_MWSoulGotValue = "MWSoulGotValue_%s" #法宝特权已领取进度 参数特权ID
|
| | | Def_PDict_MWSoulGotItemState = "MWSoulGotItemState_%s" #法宝特权领取物品奖励状态 参数特权ID
|
| | | Def_PDict_MWSoulActiveState = "MWSoulActiveState_%s" #法宝之魂激活状态 参数(key编号)
|
| | |
|
| | | #炼丹炉
|
| | | Def_PDict_AlchemyLV = "AlchemyLV" #炼丹等级
|
| | |
| | | Def_CalcAttrFunc_PetSkill, # 宠物技能属性 31
|
| | | Def_CalcAttrFunc_StoveYao, # 炼丹炉丹药 32
|
| | | Def_CalcAttrFunc_PetSign, # 宠物签到 33
|
| | | ) = range(34)
|
| | | Def_CalcAttrFunc_MagicWeaponSoul, # 法宝之魂属性34
|
| | | ) = range(35)
|
| | |
|
| | |
|
| | | # 在此列表中的功能属性,不享受百分比加成,--属性参与战力计算
|
| | | CalcAttrExFuncList = [Def_CalcAttrFunc_MagicWeapon1, Def_CalcAttrFunc_MagicWeapon2, Def_CalcAttrFunc_MagicWeapon3,
|
| | | Def_CalcAttrFunc_Stove, Def_CalcAttrFunc_VIP, Def_CalcAttrFunc_PetSoul, Def_CalcAttrFunc_HorseSoul,
|
| | | Def_CalcAttrFunc_StoveYao, Def_CalcAttrFunc_PetSign,
|
| | | Def_CalcAttrFunc_StoveYao, Def_CalcAttrFunc_PetSign, Def_CalcAttrFunc_MagicWeaponSoul
|
| | | ]
|
| | |
|
| | | # 在此列表中的功能属性,不享受百分比加成,--属性不参与战力计算,战力由技能配置决定
|
| | |
| | | ShareDefine.Def_MFPType_MagicWeapon2:[Def_CalcAttrFunc_MagicWeapon2],
|
| | | ShareDefine.Def_MFPType_MagicWeapon3:[Def_CalcAttrFunc_MagicWeapon3, Def_CalcAttrFunc_Stove, Def_CalcAttrFunc_VIP],
|
| | | ShareDefine.Def_MFPType_StoveYao:[Def_CalcAttrFunc_StoveYao],
|
| | | ShareDefine.Def_MFPType_MagicWeaponSoul:[Def_CalcAttrFunc_MagicWeaponSoul],
|
| | | ShareDefine.Def_MFPType_Other:[Def_CalcAttrFunc_Success, Def_CalcAttrFunc_FamilyTech, Def_CalcAttrFunc_EquipDecompose],
|
| | | }
|
| | |
|
| | |
| | | MWPrivilege_RuneDecompose, # 符印分解经验加成
|
| | | MWPrivilege_Horse, # 坐骑每提升5级攻击提升点数
|
| | | MWPrivilege_Pet, # 每激活1只宠物,生命上限提升
|
| | | MWPrivilege_KillBossAddAttr, # 每击杀2只世界boss,领取50攻击(最高5000)
|
| | | MWPrivilege_MWSkillUp, # 每提升5级技能潜力,真实伤害+200(最高18000)
|
| | | MWPrivilege_WingHP, # 翅膀生命属性+30%
|
| | | MWPrivilege_EquipSuit, # 套装基础属性+20%
|
| | | MWPrivilege_EquipWash, # 每日免费领取50个洗练石
|
| | |
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("PriID", c_int), # 特权ID
|
| | | ("State", c_ubyte), #激活状态
|
| | | ("CurValue", c_int), #当前总进度
|
| | | ("GotValue", c_int), #已领取进度
|
| | | ("ItemAwardState", c_ubyte), #物品奖励是否已领取
|
| | |
| | |
|
| | | def Clear(self):
|
| | | self.PriID = 0
|
| | | self.State = 0
|
| | | self.CurValue = 0
|
| | | self.GotValue = 0
|
| | | self.ItemAwardState = 0
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''// A3 53 法宝特权数据 //tagMCMWPrivilegeDataInfo:
|
| | | PriID:%d,
|
| | | State:%d,
|
| | | CurValue:%d,
|
| | | GotValue:%d,
|
| | | ItemAwardState:%d
|
| | | '''\
|
| | | %(
|
| | | self.PriID,
|
| | | self.State,
|
| | | self.CurValue,
|
| | | self.GotValue,
|
| | | self.ItemAwardState
|
| | |
| | |
|
| | | m_NAtagMCMWPrivilegeDataInfo=tagMCMWPrivilegeDataInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMWPrivilegeDataInfo.Head.Cmd,m_NAtagMCMWPrivilegeDataInfo.Head.SubCmd))] = m_NAtagMCMWPrivilegeDataInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 0E 通知法宝之魂激活状态 #tagMCMWSoulState
|
| | |
|
| | | class tagMCMWSoulState(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("State", c_int), #激活状态
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x0E
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x0E
|
| | | self.State = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCMWSoulState)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 0E 通知法宝之魂激活状态 //tagMCMWSoulState:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | State:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.State
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCMWSoulState=tagMCMWSoulState()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCMWSoulState.Cmd,m_NAtagMCMWSoulState.SubCmd))] = m_NAtagMCMWSoulState
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | ShareDefine.Def_MFPType_MagicWeapon3:"仙族",
|
| | | ShareDefine.Def_MFPType_PetSoul:"宠魂",
|
| | | ShareDefine.Def_MFPType_HorseSoul:"骑魂",
|
| | | ShareDefine.Def_MFPType_MagicWeaponSoul:"法宝之魂",
|
| | | ShareDefine.Def_MFPType_Other:"其他",
|
| | | }
|
| | |
|
| | |
| | | ChConfig.Def_CalcAttrFunc_PetSkill:"宠物技能属性",
|
| | | ChConfig.Def_CalcAttrFunc_StoveYao:"炼丹炉丹药",
|
| | | ChConfig.Def_CalcAttrFunc_PetSign:"宠物签到",
|
| | | ChConfig.Def_CalcAttrFunc_MagicWeaponSoul:"法宝之魂",
|
| | | }
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower 模块类型(可选)")
|
| | |
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | | wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID)
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = PlayerVip.GetPrivilegeValue(curPlayer, extraTimesVIPPriID)
|
| | |
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | | wmpIpyData = PlayerMagicWeapon.GetMagicWeaponPrivilege(curPlayer, MWPrivilegeID)
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | maxTimes += mwAddCnt #法宝增加的次数加到基础次数里
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | |
| | | ("DWORD", "NeedExp", 0),
|
| | | ("dict", "AddAttr", 0),
|
| | | ("list", "UnLockSkill", 0),
|
| | | ("DWORD", "PrivilegeID", 0),
|
| | | ("DWORD", "ActiveMWID", 0),
|
| | | ("list", "ItemAward", 0),
|
| | | ),
|
| | |
|
| | | "TreasurePrivilege":(
|
| | |
| | | ("DWORD", "MaxValue", 0),
|
| | | ("dict", "AddAttr", 0),
|
| | | ("list", "ItemAward", 0),
|
| | | ("list", "SuccessList", 0),
|
| | | ),
|
| | |
|
| | | "TreasureSkill":(
|
| | |
| | | self.NeedExp = 0
|
| | | self.AddAttr = {}
|
| | | self.UnLockSkill = []
|
| | | self.PrivilegeID = 0 |
| | | self.ActiveMWID = 0
|
| | | self.ItemAward = [] |
| | | return |
| | | |
| | | def GetMWID(self): return self.MWID # 法宝ID
|
| | |
| | | def GetNeedExp(self): return self.NeedExp # 需要经验
|
| | | def GetAddAttr(self): return self.AddAttr # 属性
|
| | | def GetUnLockSkill(self): return self.UnLockSkill # 解锁的技能
|
| | | def GetPrivilegeID(self): return self.PrivilegeID # 特权ID |
| | | def GetActiveMWID(self): return self.ActiveMWID # 激活法宝ID
|
| | | def GetItemAward(self): return self.ItemAward # 物品奖励[itemID,cnt,isbind] |
| | | |
| | | # 法宝特权表 |
| | | class IPY_TreasurePrivilege(): |
| | |
| | | self.SingleValue = 0
|
| | | self.MaxValue = 0
|
| | | self.AddAttr = {}
|
| | | self.ItemAward = [] |
| | | self.ItemAward = []
|
| | | self.SuccessList = [] |
| | | return |
| | | |
| | | def GetPrivilegeID(self): return self.PrivilegeID # 特权ID
|
| | |
| | | def GetSingleValue(self): return self.SingleValue # 进度
|
| | | def GetMaxValue(self): return self.MaxValue # 最大进度
|
| | | def GetAddAttr(self): return self.AddAttr # 属性
|
| | | def GetItemAward(self): return self.ItemAward # 物品奖励 |
| | | def GetItemAward(self): return self.ItemAward # 物品奖励
|
| | | def GetSuccessList(self): return self.SuccessList # 需要完成成就 |
| | | |
| | | # 法宝技能升级表 |
| | | class IPY_TreasureSkill(): |
| | |
| | |
|
| | | SyncAllEquipAttrActiveInfo(curPlayer, activeType)
|
| | | if activeType == 0:
|
| | | PlayerMagicWeapon.CalcMagicWeaponAttr(curPlayer)
|
| | | PlayerMagicWeapon.CalcMagicWeaponSoulAttr(curPlayer)
|
| | | else:
|
| | | RefreshPlayerEquipAttribute(curPlayer)
|
| | |
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillWorldBoss, 1)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
|
| | | PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_KillBossAddAttr, 1, True)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | elif limitIndex == 1: #BOSS之家
|
| | |
| | | PlayerPet.CalcPetItemAddPlayerAttr(curPlayer)
|
| | | PlayerRune.RefreshRuneAttr(curPlayer)
|
| | | PlayerMagicWeapon.CalcMagicWeaponAttr(curPlayer)
|
| | | PlayerMagicWeapon.CalcMagicWeaponSoulAttr(curPlayer)
|
| | | PlayerSuccess.CalcSuccessAttr(curPlayer)
|
| | | PlayerVip.CalcVIPAttr(curPlayer)
|
| | | PlayerRefineStove.CalcStoveAttr(curPlayer)
|
| | |
| | | import PlayerSuccess
|
| | | import EventShell
|
| | | import PassiveBuffEffMng
|
| | | import OpenServerCampaign
|
| | | import ItemControler
|
| | | import PlayerActivity
|
| | | import ChEquip
|
| | |
| | |
|
| | | #解锁技能
|
| | | upIpyData = IpyGameDataPY.GetIpyGameData('TreasureUp', mwID, mwLV)
|
| | | if upIpyData:
|
| | | skillIDList = upIpyData.GetUnLockSkill()
|
| | | for skillID in skillIDList:
|
| | | GiveSkill(curPlayer, skillID, GameWorld.GetGameWorld().GetTick())
|
| | | if upIpyData.GetPrivilegeID():
|
| | | PlayerControl.WorldNotify(0, 'TreasureSoulWakeUp', [curPlayer.GetName(), upIpyData.GetPrivilegeID()])
|
| | | |
| | | if not upIpyData:
|
| | | return
|
| | | skillIDList = upIpyData.GetUnLockSkill()
|
| | | for skillID in skillIDList:
|
| | | GiveSkill(curPlayer, skillID, GameWorld.GetGameWorld().GetTick())
|
| | | #物品奖励
|
| | | itemAward = upIpyData.GetItemAward()
|
| | | if itemAward:
|
| | | itemID, itemCnt, isBind = itemAward
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
|
| | | if 1 > packSpace:
|
| | | PlayerControl.SendMailByKey('TreasureWakeUp', [curPlayer.GetID()], [itemAward])
|
| | | else:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind,
|
| | | [IPY_GameWorld.rptItem], True, showSysInfo=True, event=["MWAward", False, {"mwID":mwID}])
|
| | | activeMWID = upIpyData.GetActiveMWID()
|
| | | if activeMWID == mwID:
|
| | | GameWorld.ErrLog(' TreasureUp.txt 配置异常 不可激活自身法宝 mwID=%s'%mwID)
|
| | | elif activeMWID:
|
| | | DoActiveMW(curPlayer, activeMWID)
|
| | |
|
| | | CalcMagicWeaponAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | |
| | |
|
| | | curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitMagicWeaponSkillUp, 1)
|
| | |
|
| | |
|
| | | SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_MWSkillUp, 1, True)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MWSkillUp, 1, [skillTypeID])
|
| | | EventShell.EventRespons_MWSkillUp(curPlayer)
|
| | | return
|
| | |
| | |
|
| | | def CalcMagicWeaponAttr(curPlayer):
|
| | | ## 计算法宝属性
|
| | | |
| | | allAttrList1 = [{} for _ in range(4)] #人族法宝
|
| | | allAttrList2 = [{} for _ in range(4)] #魔族法宝
|
| | | allAttrList3 = [{} for _ in range(4)] #仙族法宝
|
| | | |
| | | signDayMWID = IpyGameDataPY.GetFuncCfg('MWSignDayAttr', 2)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetTreasureCount()):
|
| | | treasureIpyData = ipyDataMgr.GetTreasureByIndex(i)
|
| | |
| | | if upIpyData:
|
| | | attrDict = upIpyData.GetAddAttr()
|
| | | GameWorld.AddDictValue(allAttrDict, attrDict)
|
| | |
|
| | | privilegeID = upIpyData.GetPrivilegeID()
|
| | | if privilegeID:
|
| | | # 法宝之魂
|
| | | attrDict = GetMagicWeaponPrivilegeAttr(curPlayer, privilegeID)
|
| | | GameWorld.AddDictValue(allAttrDict, attrDict)
|
| | | if magicWeaponID == signDayMWID:
|
| | | #签到属性
|
| | | totalSignNum = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalSignNum) # 总签到天数
|
| | | addAttr = {}
|
| | | for attid, attnum in IpyGameDataPY.GetFuncEvalCfg('MWSignDayAttr', 1, {}).items():
|
| | | addAttr[int(attid)] = attnum * totalSignNum
|
| | | GameWorld.AddDictValue(allAttrDict, addAttr)
|
| | |
|
| | | treasureType = treasureIpyData.GetTreasureType()
|
| | | for effID, value in allAttrDict.items():
|
| | |
| | |
|
| | | DoActiveMW(curPlayer, mwID, nextMWLV)
|
| | |
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_MagicWeapon)
|
| | | return
|
| | |
|
| | | def AddMagicWeaponUpExp(curPlayer, mwID, addExp):
|
| | |
| | | curUpExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponUpExp % mwID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponUpExp % mwID, curUpExp+addExp)
|
| | | Sycn_MagicWeaponLV(curPlayer, mwID)
|
| | | # 每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_MagicWeapon)
|
| | | return
|
| | |
|
| | | def Sycn_MagicWeaponLV(curPlayer, mwID= -1):
|
| | |
| | |
|
| | | def GetMagicWeaponPrivilege(curPlayer, privilege):
|
| | | #法宝等级权限
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('TreasureUp', {'PrivilegeID':privilege}, False, False)
|
| | | if not ipyData:
|
| | | return 0
|
| | |
|
| | | mwID = ipyData.GetMWID()
|
| | | mwLV = ipyData.GetLV()
|
| | | curMWLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponLV % mwID)
|
| | | if curMWLV < mwLV:
|
| | | if not GetIsActiveMWSoul(curPlayer, privilege):
|
| | | return 0
|
| | | privilegeIpyData = IpyGameDataPY.GetIpyGameDataNotLog('TreasurePrivilege', privilege)
|
| | | if not privilegeIpyData:
|
| | |
| | | attrInfo = {}
|
| | | singleValue = privilegeIpyData.GetSingleValue()
|
| | |
|
| | | if privilege == ChConfig.MWPrivilege_SignDayAddAttr:
|
| | | totalSignNum = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TotalSignNum) # 总签到天数
|
| | | for attid, attnum in attrInfo.items():
|
| | | addAttr[int(attid)] = attnum * totalSignNum
|
| | | elif privilege == ChConfig.MWPrivilege_EquipPlus:
|
| | | if privilege == ChConfig.MWPrivilege_EquipPlus:
|
| | | #强化加成
|
| | | addAttr = ChEquip.CalcAllEquipAllPlusLVAttr(curPlayer)
|
| | | else:
|
| | |
| | | if canGetCnt <= 0:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MWSoulGotValue % privilege, gotValue+canGetCnt*singleValue)
|
| | | CalcMagicWeaponAttr(curPlayer)
|
| | | CalcMagicWeaponSoulAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | |
|
| | |
|
| | |
| | | pack.CurValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulCurValue % priID)
|
| | | pack.GotValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulGotValue % priID)
|
| | | pack.ItemAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulGotItemState % priID)
|
| | | if not isForce and max([pack.CurValue, pack.GotValue, pack.ItemAwardState]) == 0:
|
| | | pack.State = GetIsActiveMWSoul(curPlayer, priID)
|
| | | if not isForce and max([pack.CurValue, pack.GotValue, pack.ItemAwardState, pack.State]) == 0:
|
| | | continue
|
| | | pack.PriID = priID
|
| | | sendPack.InfoList.append(pack)
|
| | |
| | | def SetMagicWeaponClickState(curPlayer, mwID, state=1):
|
| | | #设置法宝是否点击认主状态
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_MagicWeaponIsClick, mwID % 100, state, True, [mwID / 100])
|
| | | return
|
| | |
|
| | |
|
| | | #// A5 12 激活法宝之魂 #tagCMActiveMWSoul
|
| | | #
|
| | | #struct tagCMActiveMWSoul
|
| | | #
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE ID; //编号
|
| | | #};
|
| | | def OnActiveMWSoul(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | soulID = clientData.ID
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('TreasurePrivilege', soulID)
|
| | | if not ipyData:
|
| | | return
|
| | | if GetIsActiveMWSoul(curPlayer, soulID):
|
| | | GameWorld.Log(' 该法宝之魂已经激活!! soulID=%s'%soulID)
|
| | | return
|
| | | #检查成就
|
| | | succList = ipyData.GetSuccessList()
|
| | | for succID in succList:
|
| | | if not PlayerSuccess.GetSuccHasGot(curPlayer, succID):
|
| | | GameWorld.DebugLog(' 激活法宝之魂 成就未完成 soulID=%s,succID=%s'%(soulID, succID))
|
| | | return
|
| | | |
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_MWSoulActiveState, soulID, 1, True)
|
| | | |
| | | CalcMagicWeaponSoulAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | |
| | | #֪ͨ
|
| | | Sycn_MWPrivilegeData(curPlayer, soulID)
|
| | | return
|
| | |
|
| | | def GetIsActiveMWSoul(curPlayer, soulID):
|
| | | #获取法宝之魂是否已激活
|
| | | return GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_MWSoulActiveState, soulID)
|
| | |
|
| | | def CalcMagicWeaponSoulAttr(curPlayer):
|
| | | #法宝之魂属性刷新
|
| | | allAttrList = [{} for _ in range(4)]
|
| | | allAttrDict = {}
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyMgr.GetTreasurePrivilegeCount()):
|
| | | ipyData = ipyMgr.GetTreasurePrivilegeByIndex(i)
|
| | | soulID = ipyData.GetPrivilegeID()
|
| | | if not GetIsActiveMWSoul(curPlayer, soulID):
|
| | | continue
|
| | | attrDict = GetMagicWeaponPrivilegeAttr(curPlayer, soulID)
|
| | | GameWorld.AddDictValue(allAttrDict, attrDict)
|
| | | |
| | | for attrID, attrValue in allAttrDict.items():
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_MagicWeaponSoul, allAttrList)
|
| | | return |
| | |
| | | PlayerPet.CalcPetItemAddPlayerAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | |
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('TreasureUp', {'PrivilegeID':ChConfig.MWPrivilege_SignDayAddAttr}, False, False)
|
| | | privilegeIpyData = IpyGameDataPY.GetIpyGameDataNotLog('TreasurePrivilege', ChConfig.MWPrivilege_SignDayAddAttr)
|
| | | if ipyData and privilegeIpyData:
|
| | | mwID = ipyData.GetMWID()
|
| | | effDict = privilegeIpyData.GetEffectValue()
|
| | | mwID = IpyGameDataPY.GetFuncCfg('MWSignDayAttr', 2)
|
| | | if mwID:
|
| | | effDict = IpyGameDataPY.GetFuncEvalCfg('MWSignDayAttr', 1, {})
|
| | | if PlayerMagicWeapon.GetIsActiveMagicWeapon(curPlayer, mwID) and effDict:
|
| | | PlayerControl.NotifyCode(curPlayer, "SignInText1", [mwID, effDict.keys()[0], effDict.values()[0]])
|
| | |
|
| | |
| | | )=range(5)
|
| | |
|
| | | # 战斗力模块类型
|
| | | Def_MFPType_Max = 23
|
| | | Def_MFPType_Max = 24
|
| | | ModuleFightPowerTypeList = (
|
| | | Def_MFPType_Role, # 角色 0
|
| | | Def_MFPType_Equip, # 装备(基本装备位) 1
|
| | |
| | | Def_MFPType_MagicWeapon3, # 仙族法宝 17
|
| | | Def_MFPType_PetSoul, # 灵宠魂石 18
|
| | | Def_MFPType_HorseSoul, # 坐骑魂石 19
|
| | | Def_MFPType_MagicWeaponSoul, # 法宝之魂 20
|
| | | Def_MFPType_Other, # 其他
|
| | |
|
| | | #以下暂时没用到,改时再处理
|
| | |
| | | DailyActionID_TowerSD, # 符印塔扫荡
|
| | | DailyActionID_XXX12, # 废弃12
|
| | | DailyActionID_Tower, # 符印塔
|
| | | DailyActionID_MagicWeapon, # 觉醒法宝
|
| | | DailyActionID_MagicWeapon, # 法宝集魂
|
| | | DailyActionID_FBHelp, # 助战副本
|
| | | DailyActionID_BOSSHome, # BOSS之家
|
| | | ) = range(1, 16 + 1)
|