From 77c5ef1b8155e0d87468d9e9fccd18232d281a14 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 07 四月 2021 16:13:55 +0800
Subject: [PATCH] 8870 【BT2】【后端】战力、伤害、玩家生命的数值调整为大数值(buff值限制不超过20E)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py |   80 ++++++++++++++++++++++++++++++++--------
 1 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
index 16e804c..dfab201 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -140,8 +140,9 @@
 #    mapType = GameWorld.GetMap().GetMapFBType()
     # 野外小怪或者其他指定的怪为了更及时的打击感,由客户端计算
     for hurobj in hurtList:
-        if hurobj.HurtHP == 0:
-            g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
+        hurtHP = hurobj.HurtHP + hurobj.HurtHPEx * ShareDefine.Def_PerPointValue
+        if hurtHP == 0:
+            g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
             continue
         if hurobj.ObjType != IPY_GameWorld.gotNPC:
             # 非NPC
@@ -163,7 +164,7 @@
             # 重复对象
             return False
         
-        g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
+        g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
     
     g_UseSkillPlayerID = curPlayer.GetID()
     return True
@@ -206,7 +207,7 @@
         PlayerControl.NotifyCode(curPlayer , "Play_Attack_Null")
         return
     
-    if curPlayer.GetHP() <= 0:
+    if GameObj.GetHP(curPlayer) <= 0:
         #玩家已经死亡
         PlayerControl.NotifyCode(curPlayer, "PK_chenxin_612029")
         return False
@@ -258,7 +259,7 @@
 
     #还在冷却时间内无法释放
     if SkillCommon.RefreshSkillRemainTime(playerSkill, tick) != 0:
-        PlayerControl.NotifyCode(curPlayer, "UseSkillCDLimit")
+        #PlayerControl.NotifyCode(curPlayer, "UseSkillCDLimit")
         #AttackFailNotify(curPlayer, curSkill, ChConfig.SkillFail_CD)
         playerSkill.Sync_Skill()
         return False
@@ -290,7 +291,7 @@
 #    #7:检查玩家的HP是否足够
 #    curSkillNeedHP = curSkill.GetHP()
 #    
-#    if curSkillNeedHP > 0 and curPlayer.GetHP() < curSkillNeedHP:
+#    if curSkillNeedHP > 0 and GameObj.GetHP(curPlayer) < curSkillNeedHP:
 #        curPlayer.Notify_AttackFail(0, 0, 0, 0, IPY_GameWorld.afrHP)
 #        PlayerControl.NotifyCode(curPlayer, "PK_jin_0")
 #        GameWorld.DebugLog("检查玩家的HP是否足够")
@@ -579,6 +580,18 @@
     
     return True
 
+def IsNPCSkillResist(curNPC):
+    ## NPC是否技能抵抗,对应技能表中伤害类型HurtType为3的技能,即对boss无效的技能
+    
+    if curNPC.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
+        #GameWorld.DebugLog("预警状态下默认抵抗")
+        return True
+    
+    bossIpyData = IpyGameDataPY.GetIpyGameDataNotLog("BOSSInfo", curNPC.GetNPCID())
+    if bossIpyData and bossIpyData.GetSkillResist():
+        return True
+    
+    return False
 
 ##是否召唤兽对主人使用技能
 # @param curNPC NPC实例
@@ -775,7 +788,7 @@
     # NPC仇恨吸引,由客户端决定,适用于小怪
     # '''
     # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-    # if curPlayer.GetHP() <= 0:
+    # if GameObj.GetHP(curPlayer) <= 0:
     #    return
     # 
     # if not curPlayer.GetVisible():
@@ -794,7 +807,7 @@
     #    npcAngry = npcObj.GetNPCAngry()
     #    angryValue = npcAngry.FindNPCAngry(playerID, IPY_GameWorld.gotPlayer)
     #    
-    #    if angryValue != None and angryValue.GetAngryValue() != 0 :
+    #    if angryValue != None and GameObj.GetAngryValue(angryValue) != 0 :
     #        #该对象已经在仇恨列表中,不重复添加
     #        continue
     #    
@@ -958,6 +971,7 @@
 #    DWORD        ObjID;
 #    BYTE        AttackType;        //爆击, miss
 #    DWORD        HurtHP;
+#    DWORD        HurtHPEx;
 # };
 # 
 # struct    tagCMSuperAtk
@@ -1368,7 +1382,7 @@
 # @return 返回值真, 检查通过
 # @remarks 检查客户端发送技能封包, 这里只简单检查一下
 def __CheckPlayerUseSkill_ClientPack(curPlayer, posX, posY, curSkill):
-    if curPlayer.GetHP() <= 0:
+    if GameObj.GetHP(curPlayer) <= 0:
         return
     
     if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
@@ -1905,10 +1919,10 @@
     if not CheckLearnSkillCondition(curPlayer, upSkill):
         return False
     
-    #坐骑技能学习判断
-    if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
-        if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
-            return False
+#    #坐骑技能学习判断
+#    if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
+#        if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
+#            return False
     #天赋技学习点数判断
     if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
         if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
@@ -2133,7 +2147,7 @@
             GameWorld.DebugLog('更换专精 不成功 selectSkillID=%s'%selectSkillID)
             return
         
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
+        UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID)
         #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
         if curElementSkillID and curElementSkillID != selectSkillID:
             #原技能删除
@@ -2148,6 +2162,40 @@
         curControl.RefreshPlayerAttrState()
        
     NotifyElementSkillInfo(curPlayer, mainSkillID, selectSkillID if updSelectSkillLV != activeSkillLV else 0)
+    return
+
+def UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID):
+    ## 更新专精技能选择, selectSkillID 可能被重置为0
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
+    #GameWorld.DebugLog("更新专精技能选择  mainSkillID=%s, selectSkillID=%s" % (mainSkillID, selectSkillID))
+    
+    # 以下额外更新选择的专精技能对应编号,用于表现其他玩家不同专精技能特效用
+    mainSkillList = IpyGameDataPY.GetFuncEvalCfg("SkillActTypeIdSort", curPlayer.GetJob())
+    if mainSkillID not in mainSkillList:
+        return
+    mainSkillIndex = mainSkillList.index(mainSkillID)
+    if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
+        exAttrValue = curPlayer.GetExAttr7()
+        exAttrIndex = mainSkillIndex
+    else:
+        exAttrValue = curPlayer.GetExAttr8()
+        exAttrIndex = mainSkillIndex - ShareDefine.Def_PDictDigitCnt
+    
+    elementSkillNum = 0
+    if selectSkillID:
+        ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', selectSkillID)
+        if ipyData:
+            elementSkillNum = ipyData.GetElementSkillNum()
+            
+    updExAttrValue = GameWorld.ChangeDataByDigitPlace(exAttrValue, exAttrIndex, elementSkillNum)
+    #GameWorld.DebugLog("    exAttrValue=%s,exAttrIndex=%s,elementSkillNum=%s,updExAttrValue=%s" 
+    #                   % (exAttrValue, exAttrIndex, elementSkillNum, updExAttrValue))
+    
+    # 需要广播周围玩家
+    if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
+        curPlayer.SetExAttr7(updExAttrValue, True)
+    else:
+        curPlayer.SetExAttr8(updExAttrValue, True)
     return
 
 def RefreshElementSkill(curPlayer, skillTypeID, isChangeLV=True):
@@ -2192,7 +2240,7 @@
         if updSkillLV == 0:#重置为未选状态
             ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', skillTypeID)
             mainSkillID = ipyData.GetMainSkillID()
-            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, 0)
+            UpdateElementSkillSelect(curPlayer, mainSkillID, 0)
             #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
             isNotify = True
     else:
@@ -3795,7 +3843,7 @@
                 return False
             
             target = petOwner
-            if target.GetHP() <= 0:
+            if GameObj.GetHP(target) <= 0:
                 return False
         
         if affectTag not in [ChConfig.Def_UseSkillTag_None, ChConfig.Def_UseSkillTag_Self]:

--
Gitblit v1.8.0