hxp
2023-01-08 9e65b1227144d715b48bdac99290a292108bec53
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
#!/usr/bin/python
# -*- coding: GBK -*-
 
##@package SetWorldPos
# ÉèÖÃÍæ¼Ò×ø±ê
#
# @author eggxp
# @date 2010-4-23
# @version 1.0
#
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
# VER = "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ
#
# Ä£¿éÏêϸ˵Ã÷
import PlayerControl
import GameWorld
 
## É趨ÈËÎïµÄÔÚÊÀ½çÖеÄλÖà
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param playerList ²ÎÊýÁбí [[µØÍ¼id] [λÖÃx] [λÖÃy] [lineID]]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, paramList):
    #ÊäÈëÃüÁî¸ñʽ´íÎó
    if not paramList:
        GameWorld.DebugAnswer(curPlayer, "SetWorldPos mapID posX posY")
        return
    mapID, posX, posY = paramList[:3]
    lineID = paramList[3] if len(paramList) > 3 else - 1
    if not mapID:
        mapID = GameWorld.GetGameWorld().GetMapID()
    if not posX:
        posX = curPlayer.GetPosX()
    if not posY:
        posY = curPlayer.GetPosY()
    PlayerControl.PlayerResetWorldPos(curPlayer, mapID, posX, posY, True, lineID)
    return