private static void checkIfCompleteTask(Player p, SlayerTask task)
 {
     task.setAmount(task.getAmount() - 1);
     if (task.getAmount() <= 0)
     {
         doDialogue(p, 1062);
         p.getPackets().sendMessage("You have completed your Slayer task, please return to a Slayer master.");
         p.setSlayerTask(null);
     }
 }
Exemple #2
0
 private static void checkIfCompleteTask(Player p, SlayerTask task)
 {
     task.setAmount(task.getAmount() - 1);
     if (task.getAmount() <= 0) {
         doDialogue(p, 1062);
         p.getPackets().sendMessage("You have completed your Slayer task, please return to a Slayer master.");
         p.setSlayerTask(null);
     }
 }
        private static void doGemDialogue(Player p, int dialogueStatus)
        {
            int newStatus = -1;
            int index     = -1;

            for (int i = 0; i < SLAYER_MASTERS.Length; i++)
            {
                if (p.getSkills().getCombatLevel() >= (int)SLAYER_MASTERS[i][1])
                {
                    index = i;
                }
            }
            switch (dialogueStatus)
            {
            case 1051:
                p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 241, 2);
                p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 241, 3);
                p.getPackets().modifyText("Hello there " + p.getLoginDetails().getUsername() + "! what can i help you with?", 241, 4);
                p.getPackets().animateInterface(9827, 241, 2);
                p.getPackets().sendChatboxInterface2(241);
                newStatus = 1052;
                break;

            case 1052:
                p.getPackets().modifyText("How am i doing so far?.", 238, 1);
                p.getPackets().modifyText("Who are you?", 238, 2);
                p.getPackets().modifyText("Where are you?", 238, 3);
                p.getPackets().modifyText("Got any tips for me?", 238, 4);
                p.getPackets().modifyText("Nevermind.", 238, 5);
                p.getPackets().sendChatboxInterface2(238);
                newStatus = 1053;
                break;

            case 1053:
                p.getPackets().sendPlayerHead(64, 2);
                p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                p.getPackets().modifyText("How am i doing so far?", 64, 4);
                p.getPackets().animateInterface(9827, 64, 2);
                p.getPackets().sendChatboxInterface2(64);
                newStatus = 1054;
                break;

            case 1054:
                if (p.getSlayerTask() != null)
                {
                    SlayerTask task = p.getSlayerTask();
                    object[][] data = getMasterData(task.getMasterIndex());
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                    p.getPackets().modifyText("You're currently assigned to kill " + (string)data[task.getMonsterIndex()][0] + "; only", 242, 4);
                    p.getPackets().modifyText(task.getAmount() + " more to go.", 242, 5);
                    p.getPackets().animateInterface(9827, 242, 2);
                    p.getPackets().sendChatboxInterface2(242);
                }
                else
                {
                    p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                    p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                    p.getPackets().modifyText("You're aren't assigned anything to kill, perhaps", 242, 4);
                    p.getPackets().modifyText("you should come and see me soon.", 242, 5);
                    p.getPackets().animateInterface(9827, 242, 2);
                    p.getPackets().sendChatboxInterface2(242);
                }
                newStatus = 1052;
                break;

            case 1055:
                p.getPackets().sendPlayerHead(64, 2);
                p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                p.getPackets().modifyText("Who are you?", 64, 4);
                p.getPackets().animateInterface(9827, 64, 2);
                p.getPackets().sendChatboxInterface2(64);
                newStatus = 1056;
                break;

            case 1056:
                p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                p.getPackets().modifyText("My name is " + (string)SLAYER_MASTERS[index][2] + ", i am the Slayer", 242, 4);
                p.getPackets().modifyText("master most suited to your combat level.", 242, 5);
                p.getPackets().animateInterface(9827, 242, 2);
                p.getPackets().sendChatboxInterface2(242);
                newStatus = 1052;
                break;

            case 1057:
                p.getPackets().sendPlayerHead(64, 2);
                p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                p.getPackets().modifyText("Where are you?", 64, 4);
                p.getPackets().animateInterface(9827, 64, 2);
                p.getPackets().sendChatboxInterface2(64);
                newStatus = 1058;
                break;

            case 1058:
                p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                p.getPackets().modifyText("I am in " + (string)SLAYER_MASTERS[index][5], 242, 4);
                p.getPackets().modifyText((string)SLAYER_MASTERS[index][6], 242, 5);
                p.getPackets().animateInterface(9827, 242, 2);
                p.getPackets().sendChatboxInterface2(242);
                newStatus = 1052;
                break;

            case 1059:
                p.getPackets().sendPlayerHead(64, 2);
                p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                p.getPackets().modifyText("Do you have any tips for me?", 64, 4);
                p.getPackets().animateInterface(9827, 64, 2);
                p.getPackets().sendChatboxInterface2(64);
                newStatus = 1060;
                break;

            case 1060:
                displayTip(p, index);
                newStatus = 1052;
                break;

            case 1061:
                p.getPackets().sendPlayerHead(64, 2);
                p.getPackets().modifyText(p.getLoginDetails().getUsername(), 64, 3);
                p.getPackets().modifyText("Nevermind, sorry for bothering you..", 64, 4);
                p.getPackets().animateInterface(9827, 64, 2);
                p.getPackets().sendChatboxInterface2(64);
                break;

            case 1062:
                p.getPackets().sendNPCHead((int)SLAYER_MASTERS[index][0], 242, 2);
                p.getPackets().modifyText((string)SLAYER_MASTERS[index][2], 242, 3);
                p.getPackets().modifyText("You have completed your Slayer task, please return", 242, 4);
                p.getPackets().modifyText("to a Slayer master for a new assignment.", 242, 5);
                p.getPackets().animateInterface(9827, 242, 2);
                p.getPackets().sendChatboxInterface2(242);
                break;
            }
            if (newStatus != -1)
            {
                p.setTemporaryAttribute("dialogue", newStatus);
            }
        }