diff --git a/Server/src/main/content/region/desert/quest/thetouristrap/MaleSlaveDialogue.java b/Server/src/main/content/region/desert/quest/thetouristrap/MaleSlaveDialogue.java index 000c7522b..794b2532f 100644 --- a/Server/src/main/content/region/desert/quest/thetouristrap/MaleSlaveDialogue.java +++ b/Server/src/main/content/region/desert/quest/thetouristrap/MaleSlaveDialogue.java @@ -122,21 +122,7 @@ public final class MaleSlaveDialogue extends DialoguePlugin { break; case 13: interpreter.sendItemMessage(1845, "The slave gives you his dirty, flea infested robe."); - /** - * This action has to be done at this point for authenticity and should be handled either through - * equipment phase and or inventory phase. - */ - short indx_SlaveClothes = 0; - for(Item i : TouristTrap.DESERT_CLOTHES){ - if (player.getEquipment().containsItem(i)) { - player.getEquipment().remove(i); - player.getEquipment().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes],true, false); - } else if (player.getInventory().containsItem(i)) { - player.getInventory().remove(i); - player.getInventory().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes], true); - } - indx_SlaveClothes++; - } + change_Clothes(player); stage++; break; case 14: @@ -320,21 +306,7 @@ public final class MaleSlaveDialogue extends DialoguePlugin { break; case 3: interpreter.sendItemMessage(1845, "The slave gives you his dirty, flea infested robe."); - /** - * This action has to be done at this point for authenticity and should handle both options of - * equipment and or inventory checkup. - */ - short indx_SlaveClothes = 0; - for(Item i : TouristTrap.DESERT_CLOTHES){ - if (player.getEquipment().containsItem(i)) { - player.getEquipment().remove(i); - player.getEquipment().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes],true, false); - } else if (player.getInventory().containsItem(i)) { - player.getInventory().remove(i); - player.getInventory().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes], true); - } - indx_SlaveClothes++; - } + change_Clothes(player); stage++; break; case 4: @@ -380,6 +352,20 @@ public final class MaleSlaveDialogue extends DialoguePlugin { return true; } + private void change_Clothes (Player player) { + short indx_SlaveClothes = 0; + for(Item i : TouristTrap.DESERT_CLOTHES){ + if (player.getEquipment().containsItem(i)) { + player.getEquipment().remove(i); + player.getEquipment().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes],true, false); + } else if (player.getInventory().containsItem(i)) { + player.getInventory().remove(i); + player.getInventory().add(TouristTrap.SLAVE_CLOTHES[indx_SlaveClothes]); + } + indx_SlaveClothes++; + } + } + @Override public int[] getIds() { return new int[] { 825, 826, 4985 }; diff --git a/Server/src/main/content/region/desert/quest/thetouristrap/TouristTrap.java b/Server/src/main/content/region/desert/quest/thetouristrap/TouristTrap.java index 603b85273..08a9ff25f 100644 --- a/Server/src/main/content/region/desert/quest/thetouristrap/TouristTrap.java +++ b/Server/src/main/content/region/desert/quest/thetouristrap/TouristTrap.java @@ -39,7 +39,7 @@ public final class TouristTrap extends Quest { /** * The slave clothes items. */ - public static final Item[] SLAVE_CLOTHES = new Item[] { new Item(1846), new Item(1844), new Item(1845) }; + public static final Item[] SLAVE_CLOTHES = new Item[] { new Item(1844), new Item(1845), new Item(1846) }; /** * Teh tenti pineapple item. @@ -209,8 +209,8 @@ public final class TouristTrap extends Quest { * @param player the player. */ public static void jail(final Player player, String dialogue, NPC shownNPC) { - if(shownNPC == null){ - shownNPC.setId(4999); + if(shownNPC == null) { + shownNPC = new NPC(4999); } player.getDialogueInterpreter().sendDialogues(shownNPC, FacialExpression.ANGRY, dialogue);