public override void Process(Data.Interfaces.IConnection connection, string[] msg) { try { Player player = connection.Player; int mapId = int.Parse(msg[0]); WorldPosition Position = Data.Data.BindPoints[mapId][0]; Global.Global.TeleportService.ForceTeleport(player, Position); } catch (Exception e) { Alert(connection, "Wrong syntax!"); Alert(connection, "Syntax: @goto {map_id}"); Log.Warn(e.ToString()); } }
public void ProcessMessage(Data.Interfaces.IConnection connection, string playerName, string message, Data.Enums.ChatType type) { switch (type) { case ChatType.Whisper: Player pl = PlayerService.GetPlayerByName(playerName); if (pl != null) { new SpChatMessage(pl, message, type).Send(connection); new SpChatMessage(connection.Player, message, type).Send(pl.Connection); } else { new SpChatMessage(connection.Player, "Player is not online", ChatType.Info).Send(connection); } break; default: VisibleService.Send(connection.Player, new SpChatMessage(connection.Player, message, type)); break; } }
public override void Process(Data.Interfaces.IConnection connection, string[] msg) { try { Player player = connection.Player; Player target = player.Target as Player; if (target == null) { target = player; } string type = ""; int value = 1; switch (msg.Length) { case 2: { type = msg[0]; value = int.Parse(msg[1]); break; } case 3: { target = Global.Global.VisibleService.FindTarget(player, msg[0]); type = msg[1]; value = int.Parse(msg[2]); break; } } switch (type) { case "level": { long exp = Data.Data.PlayerExperience[value]; Global.Global.PlayerService.SetExp(target, exp, null); break; } case "exp": { Global.Global.PlayerService.SetExp(target, target.Exp + value, null); break; } case "skillpoint": { target.SkillPoint = value; Global.Global.PlayerService.SetExp(target, target.Exp, null); break; } case "ability": { target.AbilityPoint = value; new SpPlayerStats(target).Send(target); break; } case "honor": { target.HonorPoint = value; new SpPlayerStats(target).Send(target); break; } case "karma": { target.KarmaPoint = value; new SpPlayerStats(target).Send(target); break; } } } catch (Exception e) { Print(connection, "Wrong syntax!"); Print(connection, "Syntax: @set {level|exp|skillpoint|ability|honor|karma}{value}"); Log.Warn(e.ToString()); } }