Request change update and null exception fixer.

This commit is contained in:
SkalFate 2026-07-13 11:10:19 -06:00
parent 72fcc0c798
commit 6da88b8945
2 changed files with 19 additions and 33 deletions

View file

@ -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 };

View file

@ -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);