From 316f661570469b67ebfc5b1fed08f9617f4638e3 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 02 三月 2020 16:36:26 +0800
Subject: [PATCH] 8389 【后端开发】天星塔挑战榜(增加天星塔全服挑战表)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerYinji.py |   42 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerYinji.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerYinji.py
index a6cc28f..85d9dbe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerYinji.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerYinji.py
@@ -18,14 +18,15 @@
 import GameWorld
 import ChPyNetSendPack
 import NetPackCommon
+import ChConfig
+import ShareDefine
 
 Def_LastYinji_Tick = "lastyjtick"   # 上一次印记消失时间
 
-#CDBPlayerRefresh_XP
 def AddYinji(curPlayer, cnt):
-    beforeCnt = GetYinjiCnt(curPlayer)
+    beforeCnt = PlayerControl.GetYinjiCnt(curPlayer)
     #上限    X个
-    curPlayer.SetXP(min(beforeCnt + cnt, IpyGameDataPY.GetFuncCfg('Yinji', 2)))
+    PlayerControl.SetYinjiCnt(curPlayer, min(beforeCnt + cnt, IpyGameDataPY.GetFuncCfg('Yinji', 2)))
     
     if beforeCnt == 0:
         # 第一次加印记需重计时
@@ -34,22 +35,21 @@
     return
 
 def SubYinji(curPlayer, cnt):
-    curPlayer.SetXP(max(curPlayer.GetXP() - cnt, 0))
+    PlayerControl.SetYinjiCnt(curPlayer, max(PlayerControl.GetYinjiCnt(curPlayer) - cnt, 0))
     return
 
-def GetYinjiCnt(curPlayer):
-    return curPlayer.GetXP()
 
 
 # 每X秒自动减少1个印记
 def ProcessPlayerYinji(curPlayer, tick):
-    if GetYinjiCnt(curPlayer) == 0:
+    if PlayerControl.GetYinjiCnt(curPlayer) == 0:
         return
     
     if tick - curPlayer.GetDictByKey(Def_LastYinji_Tick) < PlayerControl.GetLostYinjiTime(curPlayer):
         return
     
     StartYinjiTick(curPlayer)
+    
     
     SubYinji(curPlayer, 1)
     
@@ -58,4 +58,30 @@
     curPlayer.SetDict(Def_LastYinji_Tick, GameWorld.GetGameWorld().GetTick())
     pack = ChPyNetSendPack.tagMCYinjiStartTime()
 
-    NetPackCommon.SendFakePack(curPlayer, pack)
\ No newline at end of file
+    NetPackCommon.SendFakePack(curPlayer, pack)
+    
+    
+def OnLoadMap(curPlayer):
+    PlayerControl.SetYinjiCnt(curPlayer, 0)
+    return
+    
+#===============================================================================
+# // B4 0D 战斗印记 #tagCMYinji
+# 
+# struct    tagCMYinji
+# {
+#    tagHead        Head;
+#    BYTE        Count;
+#    BYTE        Type;    // 0 加,1减
+# };
+#===============================================================================
+def OnYinji(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    if curPlayer.GetSightLevel() == 0:
+        return
+    if clientData.Type == 0:
+        AddYinji(curPlayer, clientData.Count)
+    elif clientData.Type == 1:
+        SubYinji(curPlayer, clientData.Count)
+    return
+

--
Gitblit v1.8.0