public void ScroolRandom(short _x = 0, short _y = 0)
{
int index = 0;
short x = _x;
short y = _y;
if (x == 0 && y == 0)
{
while (true)
{
x = (short)IRandom.Random(1, (int)this.GetGameMap().mnWidth);
y = (short)IRandom.Random(1, (int)this.GetGameMap().mnHeight);
if (this.GetGameMap().CanMove(x, y)) break;
if (index > 100) return;
index++;
}
}
//先清除自身对象
this.ClearThis();
this.SetPoint(x, y);
NetMsg.MsgScroolRandom msg = new NetMsg.MsgScroolRandom();
msg.Create(null, GetGamePackKeyEx());
msg.time = System.Environment.TickCount;
msg.x = msg._x = this.GetCurrentX();
msg.y = msg._y = this.GetCurrentY();
msg.roleid = this.GetTypeId();
this.SendData(msg.GetBuffer());
this.GetVisibleList().Clear();
GameStruct.Action act = new GameStruct.Action(GameStruct.Action.MOVE);
this.PushAction(act);
//幻兽也要跟随
this.GetEudemonSystem().FlyPlay();
}