From f473d3c18a3aa6c4c0cd98f9396e488676424f4c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 27 二月 2019 16:04:08 +0800
Subject: [PATCH] 6282 【前端】【2.0】封魔之地的飞跃功能

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index cdefe90..d7b8b48 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1823,6 +1823,42 @@
     return
 
 #===============================================================================
+# //B4 14 根据类型来决定移动的方式 #tagMCMoveByType
+# 
+# struct    tagMCMoveByType
+# {
+#    tagHead        Head;
+#    DWORD        ID;    //玩家ID
+#    WORD        PosX;    // 目标X
+#    WORD        PosY;    // 目标Y
+#    BYTE        MoveType;    //移动方式
+# };
+#===============================================================================
+def OnMoveByType(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    
+    #玩家移动通用检查
+    if not __CheckPlayerCanMove(curPlayer):
+        return
+    
+    #先验证目标点是否合法
+    if not GameWorld.GetMap().CanMove(clientData.PosX, clientData.PosY):
+        return
+    
+    curPlayer.StopMove()
+    curPlayer.ChangePos(clientData.PosX, clientData.PosY)
+    sendPack = ChPyNetSendPack.tagMCMoveByType()
+    sendPack.Clear()
+    sendPack.ID = curPlayer.GetID()
+    sendPack.ObjType = curPlayer.GetGameObjType()
+    sendPack.PosX = clientData.PosX
+    sendPack.PosY = clientData.PosY
+    sendPack.MoveType = clientData.MoveType
+    
+    PlayerControl.PyNotifyAll(curPlayer, sendPack, False, -1)
+    return
+
+#===============================================================================
 # //B4 04 战前冲锋 #tagCMRush
 # 
 # struct    tagCMRush
@@ -1856,6 +1892,14 @@
     if GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), clientData.PosX, clientData.PosY) > curPlayer.GetSight():
         return
     
+    #玩家移动通用检查
+    if not __CheckPlayerCanMove(curPlayer):
+        return
+    
+    #先验证目标点是否合法
+    if not GameWorld.GetMap().CanMove(clientData.PosX, clientData.PosY):
+        return
+    
     curPlayer.StopMove()
     #GameWorld.DebugLog("战前冲锋 %s %s"%([curPlayer.GetPosX(), curPlayer.GetPosY()], [clientData.PosX, clientData.PosY]))
     curPlayer.ChangePos(clientData.PosX, clientData.PosY)

--
Gitblit v1.8.0