From b813aa21bc48546c8e5adead95ba4cb4e8e02148 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 14 十一月 2018 14:11:10 +0800
Subject: [PATCH] 4730 【后端】【1.3】神兵系统修改(激活方式修改、升级支持自动锤炼)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py | 63 +++++++++++++++++++++++++++----
1 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
index 3a70b61..90e1ef6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
@@ -36,6 +36,8 @@
import ChEquip
import PlayerVip
+import random
+
g_succInfoDict = {}
g_potentialsSkillDict = {}
##登录处理
@@ -387,8 +389,20 @@
#infoDict = {"SkillID":skillTypeID, "SkillLV":upSkillLv, ChConfig.Def_Cost_Reason_SonKey:upSkill.GetSkillName()}
if not PlayerControl.PlayerLostZhenQi(curPlayer, needSP):
return
-
- if not GameWorld.CanHappen(initRate):
+ playerID = curPlayer.GetPlayerID()
+ maxRateValue = ShareDefine.Def_MaxRateValue
+ randValue = random.randint(0, maxRateValue-1)
+ canHappen = randValue < initRate
+ GameWorld.DebugLog("canHappen=%s,randValue=%s,initRate=%s,maxRateValue=%s"
+ % (canHappen, randValue, initRate, maxRateValue), playerID)
+ # 不是百分百成功的记录合成流向
+ if initRate != maxRateValue:
+ drDict = {"PlayerID":playerID, "AccID":curPlayer.GetAccID(), "skillTypeID":skillTypeID, "IsSuccess":canHappen,
+ "initRate":initRate, "randValue":randValue, "maxRateValue":maxRateValue}
+
+ DataRecordPack.SendEventPack("MagicWeaponSkillUp", drDict, curPlayer)
+
+ if not canHappen:
GameWorld.DebugLog("法宝技能升级,curSkillID=%s, maxRate=%s 升级失败" % (curSkillID, initRate))
curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitMagicWeaponSkillUp, 0)
return
@@ -439,12 +453,21 @@
curPlayer.Sync_MakeItemAnswer(ShareDefine.Def_mitMagicWeaponSkillUp, 1)
- SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_MWSkillUp, 1, True)
+ SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_MWSkillUp, GetSPSkillTotalLV(curPlayer))
PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_MWSkillUp, 1, [skillTypeID])
EventShell.EventRespons_MWSkillUp(curPlayer)
return
-
+def GetSPSkillTotalLV(curPlayer):
+ #潜力技能总等级
+ totalLV = 0
+ skillManager = curPlayer.GetSkillManager()
+ for i in xrange(skillManager.GetSkillCount()):
+ curSkill = skillManager.GetSkillByIndex(i)
+ if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_FbSPSkill:
+ continue
+ totalLV += curSkill.GetSkillLV()
+ return totalLV
def NotifyMagicWeapon(curPlayer, isLogin=False):
#通知法宝信息
@@ -511,8 +534,13 @@
for attid, attnum in IpyGameDataPY.GetFuncEvalCfg('MWSignDayAttr', 1, {}).items():
addAttr[int(attid)] = attnum * totalSignNum
GameWorld.AddDictValue(allAttrDict, addAttr)
-
-
+ fbpasslv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWFBPassLevel % magicWeaponID)
+ if fbpasslv: #副本关卡属性
+ fbipyData = IpyGameDataPY.GetIpyGameData('MagicWeaponFB', magicWeaponID, fbpasslv)
+ if fbipyData:
+ attrDict = fbipyData.AttrDict()
+ GameWorld.AddDictValue(allAttrDict, attrDict)
+
for effID, value in allAttrDict.items():
if treasureType == 1:
PlayerControl.CalcAttrDict_Type(effID, value, allAttrList1)
@@ -876,13 +904,15 @@
mwLv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponLV % mwID)
curUpExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MagicWeaponUpExp % mwID)
state = GetIsClickMagicWeapon(curPlayer, mwID)
- if not mwLv and not curUpExp and not state:
+ FBPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWFBPassLevel % mwID)
+ if not mwLv and not curUpExp and not state and not FBPassLV:
continue
pack = ChPyNetSendPack.tagMCMagicWeaponInfo()
pack.MWID = mwID
pack.LV = mwLv
pack.Exp = curUpExp
pack.State = state
+ pack.FBPassLV = FBPassLV
sendPack.InfoList.append(pack)
sendPack.Count = len(sendPack.InfoList)
if sendPack.Count:
@@ -916,6 +946,9 @@
multiple = 1 #倍数
if singleValue:
gotValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulGotValue % privilege)
+ maxValue = privilegeIpyData.GetMaxValue()
+ if maxValue:
+ gotValue = min(maxValue, gotValue)
multiple = gotValue/singleValue
for attid, attnum in attrInfo.items():
addAttr[int(attid)] = attnum * multiple
@@ -947,14 +980,20 @@
GameWorld.DebugLog('领取法宝之魂奖励,对应法宝之魂未激活,或未配置 privilege=%s'%privilege)
return
singleValue = ipyData.GetSingleValue()
+ maxValue = ipyData.GetMaxValue()
if singleValue:
#达到进度则可领取属性
curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulCurValue % privilege)
gotValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MWSoulGotValue % privilege)
+ if gotValue >= curValue:
+ return
canGetCnt = (curValue - gotValue) / singleValue
+ if canGetCnt <= 0 and maxValue and curValue >= maxValue:
+ canGetCnt = 1 #已达到次数上限,最后一次不管是否满足都让领(一般是因为配置错误或者变更导致)
if canGetCnt <= 0:
return
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MWSoulGotValue % privilege, gotValue+canGetCnt*singleValue)
+ updGotCnt = min(maxValue, gotValue+canGetCnt*singleValue) if maxValue else gotValue+canGetCnt*singleValue
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MWSoulGotValue % privilege, updGotCnt)
CalcMagicWeaponSoulAttr(curPlayer)
PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
@@ -1090,4 +1129,12 @@
for attrID, attrValue in allAttrDict.items():
PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_MagicWeaponSoul, allAttrList)
+ return
+
+def UptateMWFBPasslv(curPlayer, mwID, passLV):
+ GameWorld.Log('更新关卡 mwID=%s,level=%s'%(mwID, passLV))
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MWFBPassLevel % mwID, passLV)
+ CalcMagicWeaponAttr(curPlayer)
+ PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
+ Sycn_MagicWeaponLV(curPlayer, mwID)
return
\ No newline at end of file
--
Gitblit v1.8.0