#!/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
|