forked from Elfocrash/L2dotNET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBypassUserCmd.cs
More file actions
60 lines (54 loc) · 2.28 KB
/
Copy pathBypassUserCmd.cs
File metadata and controls
60 lines (54 loc) · 2.28 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using L2dotNET.Controllers;
using L2dotNET.Models.Player;
using L2dotNET.Network.serverpackets;
using L2dotNET.World;
namespace L2dotNET.Network.clientpackets
{
class BypassUserCmd : PacketBase
{
private readonly GameClient _client;
private readonly int _command;
public BypassUserCmd(IServiceProvider serviceProvider, Packet packet, GameClient client) : base(serviceProvider)
{
_client = client;
_command = packet.ReadInt();
}
public override void RunImpl()
{
L2Player player = _client.CurrentPlayer;
switch (_command)
{
case 0: // [loc]
int regId = 0; //MapRegionTable.getInstance().getRegionSysId(player.X, player.Y);
if (regId > 0)
player.SendPacket(new SystemMessage((SystemMessage.SystemMessageId)regId).AddNumber(player.X).AddNumber(player.Y).AddNumber(player.Z));
else
player.SendPacket(new SystemMessage(SystemMessage.SystemMessageId.NotImplementedYet2361).AddString("Nowhere"));
int x = (player.X >> 15) + 9 + 8;
int y = (player.Y >> 15) + 10 + 11;
player.SendMessage($"Current loc is X:{player.X} Y:{player.Y} Z:{player.Z}");
player.BroadcastUserInfo(); //for debug reasons
break;
case 52: // /unstuck
L2WorldRegion worldRegion = L2World.Instance.GetRegion(player.X, player.Y);
player.SetRegion(worldRegion);
List<L2Player> knowns = player.GetKnownPlayers();
//player.SpawnMe();
player.SendMessage("Unstuck not implemented yet.");
//player.knownObjects;
break;
case 62: // /dismount
player.SendMessage("Dismount not implemented yet.");
break;
case 77: // [time]
GameTime.Instance.ShowInfo(player);
break;
default:
player.SendMessage($"cmd alias {_command}");
break;
}
}
}
}