From 54c13f69ac0f3f043ae964fb6174c49876a92941 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 24 六月 2019 11:50:04 +0800
Subject: [PATCH] 6603 【后端】【2.0】增加新版的sp和被动技能 - 新增技能类型

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 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 d5d041e..35e701d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Skill/SkillShell.py
@@ -47,7 +47,6 @@
 import IpyGameDataPY
 import PyGameData
 import EventShell
-#import EquipZhuXian
 #---------------------------------------------------------------------
 GameWorld.ImportAll("Script\\Skill\\" , "GameSkills")
 GameWorld.ImportAll("Script\\Skill\\" , "GameBuffs")
@@ -55,6 +54,7 @@
 
 # 记录客户端伤害 {(objID, objType):[HurtHP, AttackType]}
 g_ClientHurtDict = collections.OrderedDict()
+g_UseSkillPlayerID = 0  # 全服攻击为单线程 记录的是当前使用技能的玩家 用于判断g_ClientHurtDict的归属
 
 #---------------------------------------------------------------------
 ##C++调用函数, 重新读取所有技能
@@ -92,6 +92,10 @@
 def GetSkillFireAim(curSkill):
     return curSkill.GetTag()%10
 
+# 当前释放主动技能的玩家
+def GetUseSkillPlayerID():
+    global g_UseSkillPlayerID
+    return g_UseSkillPlayerID
 
 # 客户端伤血列表,修改了遍历对象和计算血量
 def GetClientHurtDict():
@@ -100,7 +104,9 @@
 
 def ClearClientHurtDict(curPlayer):
     global g_ClientHurtDict
+    global g_UseSkillPlayerID
     g_ClientHurtDict = collections.OrderedDict()
+    g_UseSkillPlayerID = 0
     
     
 def GetClientHurtByObj(objID, objType):
@@ -122,15 +128,14 @@
 # 技能开始初始化客户端伤血列表
 def InitClientHurtDict(curPlayer, curSkill, hurtList):
     global g_ClientHurtDict
+    global g_UseSkillPlayerID
     ClearClientHurtDict(curPlayer)
     
     #技能攻击最大数量
     hurtCount = SkillCommon.GetSkillArea_Atk_Count(curPlayer, curSkill)
-    #===========================================================================
-    # if len(hurtList) > hurtCount:
-    #    # 客户端目标过多
-    #    return False
-    #===========================================================================
+    if len(hurtList) > hurtCount:
+        # 客户端目标过多
+        return False
     
 #    mapType = GameWorld.GetMap().GetMapFBType()
     # 野外小怪或者其他指定的怪为了更及时的打击感,由客户端计算
@@ -159,7 +164,8 @@
             return False
         
         g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
-        
+    
+    g_UseSkillPlayerID = curPlayer.GetID()
     return True
 #---------------------------------------------------------------------    
 # 非客户端玩家释放的技能
@@ -171,11 +177,16 @@
         # 玩家普通也是技能,正常是不会走到这边
         return False
     
+    if GetUseSkillPlayerID() != attacker.GetID():
+        # 非释放者
+        return False
+    
     useSkillData = attacker.GetUseSkill()
     if useSkillData and curSkill.GetSkillTypeID() != useSkillData.GetSkillTypeID():
         # 默认群攻附加触发buff的对象与攻击对象一致
         if not SkillCommon.IsBuff(curSkill):
             return False
+    
     
     if not GetClientHurtDict():
         return False
@@ -1360,6 +1371,10 @@
     if curPlayer.GetHP() <= 0:
         return
     
+    if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
+        #GameWorld.DebugLog("自定义场景中,不检查!")
+        return True
+    
     #===========================================================================
     # if curPlayer.IsMoving():
     #    GameWorld.DebugLog("移动中不可使用技能")
@@ -1901,10 +1916,6 @@
     if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
         if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
             return False
-    #诛仙技能学习判断
-    #if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_ZhuXian:
-    #    if not EquipZhuXian.CheckLearnZhuXianSkill(curPlayer, curSkillTypeID):
-    #        return False
         
     #经验检测
     skillLvUpNeedExp = upSkill.GetLVUpCostExp()
@@ -2108,7 +2119,7 @@
         #可升级则激活升一级
         EventShell.EventRespons_ElementSkill(curPlayer, mainSkillID, skillElementType, updSelectSkillLV)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementLV % selectSkillID, updSelectSkillLV)
-        if not curElementSkillID or curElementSkillID == selectSkillID:
+        if curElementSkillID == selectSkillID:
             #正在使用的专精技能,则立即生效
             isChangeSkill = True
     else: # 使用
@@ -3260,7 +3271,8 @@
     #--- 1. 先取得触发技能---
     
     #先检查数据库有没该类技能,如果最高等级不一样会找不到
-    exSkill = GameWorld.GetGameData().FindSkillByType(skillEnhanceID, skillLV)
+    #exSkill = GameWorld.GetGameData().FindSkillByType(skillEnhanceID, skillLV)
+    exSkill = GameWorld.GetGameData().GetSkillBySkillID(skillEnhanceID)
     #异常
     if not exSkill:
         GameWorld.ErrLog("对象 = %s, 找不到附加技能ID = %s, skillLv = %s"%(attacker.GetID() , skillEnhanceID , useSkill.GetSkillLV()))
@@ -3456,7 +3468,7 @@
     
     #这个技能是Buff
     if SkillCommon.IsBuff(curSkill):
-        if ChConfig.Def_SkillType_LstPlsBuffAtk == curSkill.GetSkillType():
+        if curSkill.GetSkillType() in [ChConfig.Def_SkillType_LstPlsBuffAtk, ChConfig.Def_SkillType_PassiveLstPlsBuffAtk]:
             defender = attacker
         return __DoLogic_AddBuff(attacker, defender, curSkill, isEnhanceSkill, tick, tagRoundPosX, tagRoundPosY)
     
@@ -3755,7 +3767,7 @@
     GameWorld.DebugLog("释放被动触发技能 : %s- %s"%(skillAim, curSkill.GetSkillID()))
 
     if skillAim == ChConfig.Def_UseSkillAim_None:
-        if curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List:
+        if curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List and affectTag != ChConfig.Def_UseSkillTag_Self:
             if target and target.GetGameObjType() == IPY_GameWorld.gotNPC and target.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
                 owner = NPCCommon.GetNpcObjOwnerDetail(target)
                 if owner and owner.GetID() == attacker.GetID():

--
Gitblit v1.8.0