1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.PullPlayer
#
# @todo:À­Íæ¼Òµ½Éí±ß
# @author hxp
# @date 2017-02-20
# @version 1.0
#
# ÏêϸÃèÊö: À­Íæ¼Òµ½Éí±ß
#
#-------------------------------------------------------------------------------
#"""Version = 2017-02-20 23:00"""
#-------------------------------------------------------------------------------
import GameWorld
import GameMap
 
#---------------------------------------------------------------------
##ÉèÖóèÎï״̬.
# @param curPlayer Íæ¼ÒʵÀý
# @param cmdList ²ÎÊýÁбí
# @return ·µ»ØÖµÎÞÒâÒå
# @remarks ÉèÖóèÎï״̬
def OnExec(curPlayer, cmdList):
 
    if not cmdList:
        GameWorld.DebugAnswer(curPlayer, "PullPlayer Íæ¼ÒID")
        return
    
    playerID = cmdList[0]
    findPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(playerID)
    if not findPlayer:
        GameWorld.DebugAnswer(curPlayer, "µ±Ç°µØÍ¼Î´ÕÒµ½Íæ¼ÒID: %s" % playerID)
        return
    
    gmPosX, gmPosY = curPlayer.GetPosX(), curPlayer.GetPosY()
    findPos = GameMap.GetEmptyPlaceInArea(gmPosX, gmPosY, 3) # GM¸½½üÕÒÒ»¸ö¿Õλ
    findPosX = findPos.GetPosX()
    findPosY = findPos.GetPosY()
    findPlayer.ResetPos(findPosX, findPosY)
    GameWorld.DebugAnswer(curPlayer, "À­ÈËOK: playerID=%s, setPos(%s,%s)" % (playerID, findPosX, findPosY))
    return