Ejemplo n.º 1
0
 public static void resetAllSkills(Player p)
 {
     Fletching.setFletchItem(p, null);
     Herblore.setHerbloreItem(p, null);
     Cooking.setCookingItem(p, null);
     Mining.resetMining(p);
     Smithing.resetSmithing(p);
     Woodcutting.resetWoodcutting(p);
     Fishing.resetFishing(p);
     Crafting.resetCrafting(p);
     p.removeTemporaryAttribute("harvesting");
 }
Ejemplo n.º 2
0
        private void handleItemOnItem(Player player, Packet packet)
        {
            int itemSlot = packet.readUShort();
            int unused   = packet.readInt();
            int withSlot = packet.readLEShort();
            int unused2  = packet.readInt();
            int itemUsed = packet.readLEShortA();
            int usedWith = packet.readLEShortA();

            if (itemSlot > 28 || itemSlot < 0 || withSlot > 28 || withSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            SkillHandler.resetAllSkills(player);
            player.getPackets().closeInterfaces();
            if (player.getInventory().getSlot(itemSlot).getItemId() == itemUsed && player.getInventory().getSlot(withSlot).getItemId() == usedWith)
            {
                if (Fletching.isFletching(player, itemUsed, usedWith))
                {
                    return;
                }
                else if (Herblore.doingHerblore(player, itemUsed, usedWith))
                {
                    return;
                }
                else if (Herblore.mixDoses(player, itemUsed, usedWith, itemSlot, withSlot))
                {
                    return;
                }
                else if (Crafting.wantsToCraft(player, itemUsed, usedWith))
                {
                    return;
                }
                else if (Firemaking.isFiremaking(player, itemUsed, usedWith, itemSlot, withSlot))
                {
                    return;
                }
                else if (Farming.plantSapling(player, itemUsed, usedWith))
                {
                    return;
                }
                else
                {
                    player.getPackets().sendMessage("Nothing interesting happens.");
                }
            }
        }
Ejemplo n.º 3
0
        public void CheckChanges()
        {
            var context = BulkOrderSystem.GetContext(Player, false);

            if (context != null)
            {
                foreach (var kvp in context.Entries)
                {
                    switch (kvp.Key)
                    {
                    case BODType.Smith:
                        if (Smithy == null)
                        {
                            Smithy = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Smithy.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Tailor:
                        if (Tailor == null)
                        {
                            Tailor = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Tailor.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Alchemy:
                        if (Alchemy == null)
                        {
                            Alchemy = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Alchemy.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Inscription:
                        if (Inscription == null)
                        {
                            Inscription = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Inscription.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Tinkering:
                        if (Tinkering == null)
                        {
                            Tinkering = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Tinkering.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Cooking:
                        if (Cooking == null)
                        {
                            Cooking = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Cooking.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Fletching:
                        if (Fletching == null)
                        {
                            Fletching = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Fletching.CheckChanges(kvp.Value);
                        }
                        break;

                    case BODType.Carpentry:
                        if (Carpentry == null)
                        {
                            Carpentry = new BODData(kvp.Key, kvp.Value);
                        }
                        else
                        {
                            Carpentry.CheckChanges(kvp.Value);
                        }
                        break;
                    }
                }
            }
        }