private void OnCreateSuccess(Client client, Packet packet) { if (_enabled) { PluginUtils.Delay(2100, () => client.SendToClient(PluginUtils.CreateOryxNotification( "Auto Ability", "Use your ability to Activate Auto Ability"))); } }
private void OnWebCommand(Client client, string command, string[] args) { if (command == "market") { Process.Start("https://www.realmeye.com/current-offers"); } else if (command == "player") { if (args.Length > 0) { Process.Start("https://www.realmeye.com/player/" + args[0]); } } else if (command == "sell") { if (args.Length > 1) { int item1 = 0; int item2 = 0; if (ItemAbbrs.ContainsKey(args[0].ToLower())) { // Try to find the item id from our list of abbreviations try { item1 = GameData.Items.ByName(ItemAbbrs[args[0].ToLower()]).ID; } catch { } } else { // Try to find the item id from the string entered as is try { item1 = GameData.Items.ByName(args[0]).ID; } catch { } } if (ItemAbbrs.ContainsKey(args[1].ToLower())) { // Try to find the item id from our list of abbreviations try { item2 = GameData.Items.ByName(ItemAbbrs[args[1].ToLower()]).ID; } catch { } } else { // Try to find the item id from the string entered as is try { item2 = GameData.Items.ByName(args[1]).ID; } catch { } } if (item2 == 0) { client.SendToClient(PluginUtils.CreateOryxNotification("Error", "Couldn't find any item with the name or abbreviation \"" + args[1] + "\"")); return; } Process.Start("https://www.realmeye.com/offers-to/sell/" + item2.ToString() + "/" + item1.ToString()); } } }
private void OnDreconCommand(Client client, string command, string[] args) { if (client.State.LastDungeon != null) { SendReconnect(client, client.State.LastDungeon); } else { client.SendToClient(PluginUtils.CreateOryxNotification("K Relay", "Last dungeon is unknown!")); } }
public void OnCommand(Client client, string command, string[] args) { if (args.Length == 0) { return; } else { if (args[0] == "on") { // Enabled all Config.Default.SpriteTrees = true; Config.Default.SpriteSpace = true; Config.Default.SpriteFloor = true; Config.Default.IceSlide = true; client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "All Enabled")); } else if (args[0] == "off") { // Disable all Config.Default.SpriteTrees = false; Config.Default.SpriteSpace = false; Config.Default.SpriteFloor = false; Config.Default.IceSlide = false; client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "All Disabled")); } else if (args[0] == "trees") { Config.Default.SpriteTrees = (args[1] == "on" ? true : false); client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "Sprite Trees: " + (Config.Default.SpriteTrees ? "Enabled" : " Disabled"))); } else if (args[0] == "space") { Config.Default.SpriteSpace = (args[1] == "on" ? true : false); client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "Sprite Space: " + (Config.Default.SpriteSpace ? "Enabled" : " Disabled"))); } else if (args[0] == "floor") { Config.Default.SpriteSpace = (args[1] == "on" ? true : false); client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "Sprite Floor: " + (Config.Default.SpriteFloor ? "Enabled" : " Disabled"))); } else if (args[0] == "ice") { Config.Default.IceSlide = (args[1] == "on" ? true : false); client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "Ice Slide: " + (Config.Default.IceSlide ? "Enabled" : " Disabled"))); } else { client.SendToClient(PluginUtils.CreateOryxNotification("Sprite", "Invalid Argument: " + args[0])); } } }
private void OnWCCommand(Client client, string command, string[] args) { string message = "Inc Holders: "; foreach (var pair in _incHolders) { message += pair.Value + ","; } client.SendToClient(PluginUtils.CreateOryxNotification("Inc Finder", message)); }
public void Initialize(Proxy proxy) { proxy.HookPacket(PacketType.MAPINFO, OnMapInfo); proxy.HookPacket(PacketType.UPDATE, OnUpdate); proxy.HookCommand("mapcacher", (Client client, string cmd, string[] args) => { Config.Default.enabled = !Config.Default.enabled; Config.Default.Save(); client.SendToClient(PluginUtils.CreateOryxNotification("MapCacher", "Map resending is now " + (Config.Default.enabled ? "enabled" : "disabled"))); }); proxy.ClientDisconnected += OnDisconnect; }
private void OnConnectCommand(Client client, string command, string[] args) { if (args.Length == 0) { /* * string LastConnection = ((MapInfoPacket)client.State["MapInfo"]).Name; * string Text = GameData.GameData.Servers.Map.Single(x => x.Value.Address == Proxy.DefaultServer).Value.Name + ", "; * * Text = LastConnection == "Realm of the Mad God" ? client.State.LastReconnect.Name.Split('.').Last() : LastConnection; * Text += GameData.GameData.Servers.Map.Where(x => x.Value.Address == client.State.ConTargetAddress).Count() == 0 ? client.State.LastRealm.Name.Split('.').Last() : LastConnection; * * TextPacket tpacket = (TextPacket)Packet.Create(PacketType.TEXT); * tpacket.BubbleTime = 184; * tpacket.NumStars = -1; * tpacket.ObjectId = -1; * tpacket.Name = ""; * tpacket.Recipient = ""; * tpacket.CleanText = ""; * tpacket.Text = Text; * client.SendToClient(tpacket); */ } else if (args.Length == 1) { string serverNameUpper = args[0].ToUpper(); IEnumerable <ServerStructure> servers = GameData.GameData.Servers.Map.Where(x => x.Key == serverNameUpper || x.Value.Name.ToUpper() == serverNameUpper).Select(x => x.Value); if (servers.Count() == 1) { ServerStructure server = servers.First(); ChangeDefault(server); ReconnectPacket reconnect = (ReconnectPacket)Packet.Create(PacketType.RECONNECT); reconnect.Host = server.Address; reconnect.Port = 2050; reconnect.GameId = -2; reconnect.Name = "Nexus"; reconnect.IsFromArena = false; reconnect.Key = new byte[0]; reconnect.KeyTime = 0; reconnect.Stats = string.Empty; SendReconnect(client, reconnect); } else { client.SendToClient(PluginUtils.CreateOryxNotification("K Relay", "Unknown server!")); } } }
private void OnUpdate(Client client, Packet packet) { UpdatePacket update = (UpdatePacket)packet; // New Objects foreach (Entity entity in update.NewObjs) { bool inc = false; string name = ""; foreach (StatData statData in entity.Status.Data) { if (!statData.IsStringData() && (statData.Id >= 8 && statData.Id <= 19) || (statData.Id >= 71 && statData.Id <= 78)) { if (statData.IntValue == INC_ID) { inc = true; } } if (statData.Id == StatsType.Name) { name = statData.StringValue; } } if (inc && entity.Status.ObjectId != client.ObjectId) { if (!_incHolders.ContainsKey(entity.Status.ObjectId)) { _incHolders.Add(entity.Status.ObjectId, name); } client.SendToClient(PluginUtils.CreateOryxNotification("Inc Finder", name + " has an Incantation!")); } } // Removed Objects foreach (int drop in update.Drops) { if (_incHolders.ContainsKey(drop)) { client.SendToClient(PluginUtils.CreateOryxNotification( "Inc Finder", _incHolders[drop] + " has left!")); _incHolders.Remove(drop); } } }
public void OnSwitch(Client client, string command, string[] args) { if (client.PlayerData.HasBackpack == false) { client.SendToClient(PluginUtils.CreateOryxNotification("Item Switcher", "YOU DONT HAVE A BACKPACK!")); return; } if (args.Length == 0) { Swap(client, new SlotObject { ObjectId = client.ObjectId, SlotId = 4, ObjectType = client.PlayerData.Slot[4] }, new SlotObject { ObjectId = client.ObjectId, SlotId = 12, ObjectType = client.PlayerData.BackPack[0] }, true); } else if (args.Length == 1) { int slot; if (Int32.TryParse(args[0], out slot)) { slot = slot + 3; Swap(client, new SlotObject { ObjectId = client.ObjectId, SlotId = (byte)slot, ObjectType = client.PlayerData.Slot[slot] }, new SlotObject { ObjectId = client.ObjectId, SlotId = (byte)(slot + 8), ObjectType = client.PlayerData.BackPack[slot - 4] }); } } }
private void OnConnectCommand(Client client, string command, string[] args) { if (args.Length == 1) { if (GameData.GameData.Servers.Map.ContainsKey(args[0].ToUpper())) { ReconnectPacket reconnect = (ReconnectPacket)Packet.Create(PacketType.RECONNECT); reconnect.Host = GameData.GameData.Servers.ByID(args[0].ToUpper()).Address; reconnect.Port = 2050; reconnect.GameId = -2; reconnect.Name = "Nexus"; reconnect.IsFromArena = false; reconnect.Key = new byte[0]; reconnect.KeyTime = 0; SendReconnect(client, reconnect); } else { client.SendToClient(PluginUtils.CreateOryxNotification("K Relay", "Unknown server!")); } } }
public static void OryxMessage(this Client client, string fmt, params object[] args) { client.SendToClient(PluginUtils.CreateOryxNotification("Auto Nexus", string.Format(fmt, args))); }
public static void DisplayChatNotification(this Client client, string text, string name = "NTX Bot") { // Send an Oryx notification to the client with the specified message client.SendToClient(PluginUtils.CreateOryxNotification(name, text)); }
private void OnClientStat(Client client, Packet packet) { ClientStatPacket clientStat = (ClientStatPacket)packet; string toDisplay = clientStat.Name + " has increased to " + clientStat.Value; if (clientStat.Name.Equals("Shots")) //0: 'Shots', { toDisplay = "Bullets shot : " + clientStat.Value; } else if (clientStat.Name.Equals("ShotsThatDamage")) //1: 'ShotsThatDamage', { toDisplay = "Bullets that damaged : " + clientStat.Value; } else if (clientStat.Name.Equals("SpecialAbilityUses")) //2: 'SpecialAbilityUses', { toDisplay = "Ability uses : " + clientStat.Value; } else if (clientStat.Name.Equals("TilesUncovered")) //3: 'TilesUncovered', { toDisplay = "Tiles uncovered : " + clientStat.Value; } else if (clientStat.Name.Equals("Teleports")) //4: 'Teleports', { toDisplay = "Teleports : " + clientStat.Value; } else if (clientStat.Name.Equals("PotionsDrunk")) //5: 'PotionsDrunk', { toDisplay = "Potions drank : " + clientStat.Value; } else if (clientStat.Name.Equals("MonsterKills")) //6: 'MonsterKills', { toDisplay = "Monster kills : " + clientStat.Value; } else if (clientStat.Name.Equals("MonsterAssists")) //7: 'MonsterAssists', { toDisplay = "Monster assists : " + clientStat.Value; } else if (clientStat.Name.Equals("GodKills")) //8: 'GodKills', { toDisplay = "God kills : " + clientStat.Value; } else if (clientStat.Name.Equals("GodAssists")) //9: 'GodAssists', { toDisplay = "God assists : " + clientStat.Value; } else if (clientStat.Name.Equals("CubeKills")) //10: 'CubeKills', { toDisplay = "Cube kills : " + clientStat.Value; } else if (clientStat.Name.Equals("OryxKills")) //11: 'OryxKills', { toDisplay = "Oryx kills : " + clientStat.Value; } else if (clientStat.Name.Equals("QuestsCompleted")) //12: 'QuestsCompleted', { toDisplay = "Quests completed : " + clientStat.Value; } else if (clientStat.Name.Equals("PirateCavesCompleted")) //13: 'PirateCavesCompleted', { toDisplay = "Pirate Cave(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("UndeadLairsCompleted")) //14: 'UndeadLairsCompleted', { toDisplay = "Undead Lair(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("AbyssOfDemonsCompleted")) //15: 'AbyssOfDemonsCompleted', { toDisplay = "Abyss of Demon(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("SnakePitsCompleted")) //16: 'SnakePitsCompleted', { toDisplay = "Snake Pit(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("SpiderDensCompleted")) //17: 'SpiderDensCompleted', { toDisplay = "Spider Den(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("SpriteWorldsCompleted")) //18: 'SpriteWorldsCompleted', { toDisplay = "Sprite World(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("LevelUpAssists")) //19: 'LevelUpAssists', { toDisplay = "Level-up assist(s) : " + clientStat.Value; } else if (clientStat.Name.Equals("MinutesActive")) //20: 'MinutesActive', { toDisplay = "Minute(s) active : " + clientStat.Value; } else if (clientStat.Name.Equals("TombsCompleted")) //21: 'TombsCompleted', { toDisplay = "Tomb(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("TrenchesCompleted")) //22: 'TrenchesCompleted', { toDisplay = "Trenche(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("JunglesCompleted")) //23: 'JunglesCompleted', { toDisplay = "Jungle(s) completed : " + clientStat.Value; } else if (clientStat.Name.Equals("ManorsCompleted")) //24: 'ManorsCompleted', { toDisplay = "Manor(s) completed : " + clientStat.Value; } else { //print(toDisplay = "Unknown -> Name :" + clientStat.Name + " Value :" + clientStat.Value); } client.SendToClient( PluginUtils.CreateOryxNotification( "ClientStat Announcer", toDisplay)); }
private void OnChatAssistCommand(Client client, string command, string[] args) { if (args.Length == 0) { return; } if (args[0] == "settings") { PluginUtils.ShowGUI(new FrmChatAssistSettings()); } else if (args[0] == "on") { ChatAssistConfig.Default.Enabled = true; client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Chat Assist Enabled!")); } else if (args[0] == "off") { ChatAssistConfig.Default.Enabled = false; client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Chat Assist Disabled!")); } else if (args[0] == "add") { if (args.Length > 1) { // This is needed because args are seperated by whitespaces and the string to filter coud contain whitespaces so we concatenate them together string toFilter = ""; for (int i = 1; i < args.Length; ++i) { toFilter += args[i] + " "; } toFilter = toFilter.Remove(toFilter.Length - 1); // Remove the trailing space ChatAssistConfig.Default.Blacklist.Add(toFilter); client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, toFilter + " added to spam filter!")); ChatAssistConfig.Default.Save(); // Save our changes } else { client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Missing message to filter!")); } } else if (args[0] == "remove" || args[0] == "rem") { if (args.Length > 1) { string toRemove = ""; for (int i = 1; i < args.Length; ++i) { toRemove += args[i] + " "; } toRemove = toRemove.Remove(toRemove.Length - 1); // Remove the trailing space if (ChatAssistConfig.Default.Blacklist.Contains(toRemove)) { ChatAssistConfig.Default.Blacklist.Remove(toRemove); client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, toRemove + " removed from spam filter!")); ChatAssistConfig.Default.Save(); // Save our changes } else { client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Couldn't find " + toRemove + " in spam filter!")); } } else { client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Missing message to remove!")); } } else if (args[0] == "list") { if (ChatAssistConfig.Default.Blacklist.Count == 0) { client.SendToClient(PluginUtils.CreateNotification(client.ObjectId, "Spam filter is empty!")); return; } string message = "Spam filter contains: "; // Construct our list foreach (string filter in ChatAssistConfig.Default.Blacklist) { message += filter + ", "; } message = message.Remove(message.Length - 2); client.SendToClient(PluginUtils.CreateOryxNotification("ChatAssist", message)); } }