Ejemplo n.º 1
0
        public void SendSel(bool[] sels)
        {
            ChangeTradePacket ch = (ChangeTradePacket)Packet.Create(PacketType.CHANGETRADE);

            ch.Offers = sels;
            client.SendToServer(ch);
        }
Ejemplo n.º 2
0
 private void OnTextPacketReceived(Client client, TextPacket packet)
 {
     if (packet.Text.Contains("ORYXSH0P.NET"))
     {
         var editAccListPacket = Packet.Create(PacketType.EDITACCOUNTLIST) as EditAccountListPacket;
         editAccListPacket.Add = true;
         editAccListPacket.AccountListId = 1;
         editAccListPacket.ObjectId = packet.ObjectId;
         client.SendToServer(editAccListPacket);
         packet.Send = false;
     }
 }
Ejemplo n.º 3
0
        private void OnText(Client client, Packet packet)
        {
            if (!ChatAssistConfig.Default.Enabled) return;
            //TextPacket text = (TextPacket)packet;
            TextPacket text = packet.To<TextPacket>();

            if (ChatAssistConfig.Default.DisableMessages && text.Recipient == "")
            {
                text.Send = false;
                return;
            }

            foreach (string filter in ChatAssistConfig.Default.Blacklist)
            {
                if (text.Text.ToLower().Contains(filter.ToLower()))
                {
                    // Is spam
                    if (ChatAssistConfig.Default.CensorSpamMessages)
                    {
                        text.Text = "...";
                        text.CleanText = "...";
                        return;
                    }

                    text.Send = false;

                    if (ChatAssistConfig.Default.AutoIgnoreSpamMessage ||
                       (ChatAssistConfig.Default.AutoIgnoreSpamPM && text.Recipient != ""))
                    {
                        // Ignore
                        PlayerTextPacket playerText = new PlayerTextPacket();
                        playerText.Text = "/ignore " + text.Name;
                        client.SendToServer(playerText);
                        return;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void OnTPCommand(Client client, string command, string[] args)
        {
            TeleportState state = _states[client];
            if (args.Length == 0) return;

            foreach (var pair in state.PlayerNames)
            {
                if (pair.Value.ToLower().Contains(args[0].ToLower()))
                {
                    TeleportPacket teleport = (TeleportPacket)Packet.Create(PacketType.TELEPORT);
                    teleport.ObjectId = pair.Key;
                    client.SendToServer(teleport);
                    client.SendToClient(PluginUtils.CreateNotification(
                        client.ObjectId, "Teleported to " + pair.Value));
                    return; ;
                }
            }

            client.SendToClient(PluginUtils.CreateNotification(
                client.ObjectId, "Player with \"" + args[0] + "\" in their name was not found!"));
        }
Ejemplo n.º 5
0
        private void OnTQCommand(Client client, string command, string[] args)
        {
            TeleportState state = _states[client];
            if (state.QuestId != -1 && state.QuestLocation != null)
            {
                float minDistance = state.QuestLocation.DistanceSquaredTo(client.PlayerData.Pos);
                int target = client.ObjectId;

                foreach (var pair in state.PlayerLocations)
                {
                    float distance = pair.Value.DistanceSquaredTo(state.QuestLocation);
                    if (distance < minDistance)
                    {
                        minDistance = distance;
                        target = pair.Key;
                    }
                }

                if (target != client.ObjectId)
                {
                    TeleportPacket teleport = (TeleportPacket)Packet.Create(PacketType.TELEPORT);
                    teleport.ObjectId = target;
                    client.SendToServer(teleport);
                    client.SendToClient(PluginUtils.CreateNotification(
                        client.ObjectId, "Teleported to " + state.PlayerNames[target]));
                }
                else
                {
                    client.SendToClient(PluginUtils.CreateNotification(
                        client.ObjectId, "You're the closest to your quest!"));
                }
            }
        }
Ejemplo n.º 6
0
        private void OnMove(Client client, Packet packet)
        {
            if (!_states.ContainsKey(client)) return;
            LootState state = _states[client];

            foreach (int bagId in state.LootBagItems.Keys)
            {
                float distance = state.LootBagLocations[bagId].DistanceTo(client.PlayerData.Pos);
                if (LootHelperConfig.Default.AutoLoot && Environment.TickCount - state.LastLoot > 900 && distance <= 1)
                {
                    for (int bi = 0; bi < state.LootBagItems[bagId].Length; bi++)
                    {
                        if (state.LootBagItems[bagId][bi] == -1)
                            continue;

                        if (!LootHelperConfig.Default.AutoLootList.Contains(ReverseLookup(state.LootBagItems[bagId][bi])))
                            continue;

                        state.LastLoot = Environment.TickCount;
                        for (int i = 4; i < client.PlayerData.Slot.Length; i++)
                        {
                            if (client.PlayerData.Slot[i] == -1)
                            {
                                InvSwapPacket invSwap = (InvSwapPacket)Packet.Create(PacketType.INVSWAP);
                                invSwap.Time = client.Time + 10;
                                invSwap.Position = client.PlayerData.Pos;

                                invSwap.SlotObject1 = new SlotObject();
                                invSwap.SlotObject1.ObjectId = bagId;
                                invSwap.SlotObject1.SlotId = (byte)bi;
                                invSwap.SlotObject1.ObjectType = (short)state.LootBagItems[bagId][bi];

                                invSwap.SlotObject2 = new SlotObject();
                                invSwap.SlotObject2.ObjectId = client.ObjectId;
                                invSwap.SlotObject2.SlotId = (byte)(i);
                                invSwap.SlotObject2.ObjectType = -1;

                                client.SendToServer(invSwap);
                                break;
                            }
                        }
                    }
                }

                if (LootHelperConfig.Default.LootNotifications && Environment.TickCount - state.LastNotif > 2000 && distance < 15)
                {
                    state.LastNotif = Environment.TickCount;
                    string message = "";

                    foreach (int item in state.LootBagItems[bagId])
                        if (item != -1) message += ReverseLookup(item) + "\\n";

                    if (message.Length > 3)
                        client.SendToClient(PluginUtils.CreateNotification(
                            bagId, LootHelperConfig.Default.NotificationColor.ToArgb(), message));
                }
            }
        }
Ejemplo n.º 7
0
 private void T(Client client, Packet packet)
 {if (enabled == true) { 
     TextPacket t = (TextPacket)packet;
     bool found = false;
     string foundname = "NaN";
     int founddifficulty = 69;
     foreach (var Entry in Data.Entries.ToArray())
     {if (Entry.Enabled){
         foreach (var KeyWord in Entry.KeyWords)
         {
             if (t.Text.ToLower().Contains(KeyWord.ToLower()) || t.Text.ToLower().Contains(Entry.Name))
             while (foundname == "NaN") { foundname = Entry.Name; founddifficulty = Entry.Difficulty; } found = true;
         }
     }}
     if (found)
     {
         if (foundname != "NaN")
         {
             client.SendToClient(PluginUtils.CreateNotification(client.ObjectId,GetColor(founddifficulty), foundname + " called!"));
             client.SendToClient(PluginUtils.CreateOryxNotification(t.Name, t.Text)); found = true;
             if (t.Name != client.PlayerData.Name) t.Send = false;
             System.Media.SystemSounds.Exclamation.Play();
             if (autotp)
             {
                 PlayerTextPacket p = (PlayerTextPacket)Packet.Create(PacketType.PLAYERTEXT);
                 p.Text = "/teleport " + t.Name;
                 client.SendToServer(p);
             }
         }
     }
 }}