From a68de46865d8c8d85be3d60cece7d08770f7ae0a Mon Sep 17 00:00:00 2001 From: Player Name Date: Mon, 27 Apr 2026 13:16:37 +0200 Subject: [PATCH 1/4] Log stuff --- .../skill/construction/npc/HouseServantDialogue.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java index ddb967ebe..d81bc9f42 100644 --- a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java +++ b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java @@ -461,7 +461,7 @@ public class HouseServantDialogue extends DialoguePlugin { return; } if (type == ServantType.MAID || type == ServantType.RICK) { - interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I am unable to take planks to the sawmill."); + interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I am unable to take logs to the sawmill."); return; } int amt = player.getInventory().getAmount(item); @@ -480,18 +480,19 @@ public class HouseServantDialogue extends DialoguePlugin { } end(); if (player.getInventory().remove(new Item(item.getId(), amt)) && player.getInventory().remove(new Item(Items.COINS_995, amt * plank.getPrice()))) { - manager.getServant().setItem(new Item(plank.getPlank().getId(), amt)); servant.setInvisible(true); servant.getLocks().lockMovement(100); GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)){ - @Override public boolean pulse() { servant.setInvisible(false); servant.getLocks().unlockMovement(); + manager.getServant().setItem(new Item(plank.getPlank().getId(), amt)); + interpreter.open(servant.getId(), servant); servant.setAttribute("con:lastfetch", new Item(item.getId(), 1)); servant.setAttribute("con:lastfetchtype", "sawmill"); - interpreter.open(servant.getId(), servant); + manager.getServant().setUses(manager.getServant().getUses() + 1); + follow(player, servant); return true; } }); From 9bd4b17d023435dda437b2164b3255880838b491 Mon Sep 17 00:00:00 2001 From: Player Name Date: Mon, 27 Apr 2026 13:17:15 +0200 Subject: [PATCH 2/4] Dungeon stuff --- .../skill/construction/npc/HouseServantDialogue.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java index d81bc9f42..eb20f613d 100644 --- a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java +++ b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java @@ -523,10 +523,15 @@ public class HouseServantDialogue extends DialoguePlugin { servant.setInvisible(true); servant.getLocks().lockMovement(100); GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)) { - @Override public boolean pulse() { - if (player == null || player.getHouseManager().getHouseRegion() != player.getViewport().getRegion()) { //TODO: Check if in dungeon? + if (player == null) { + return true; + } + Region pr = player.getViewport().getRegion(); + Region hr = player.getHouseManager().getHouseRegion(); + Region dr = player.getHouseManager().getDungeonRegion(); + if (pr != hr && pr != dr) { return true; } int amt = player.getBank().getAmount(item.getId()); @@ -549,7 +554,6 @@ public class HouseServantDialogue extends DialoguePlugin { follow(player, servant); return true; } - }); } From ad99ce2cc67b372b05c356371b7de8cf6ff3fa4c Mon Sep 17 00:00:00 2001 From: Player Name Date: Mon, 27 Apr 2026 13:46:07 +0200 Subject: [PATCH 3/4] Just some infra work --- .../npc/HouseServantDialogue.java | 41 +++++++++---------- .../construction/npc/HouseServantPlugin.java | 21 ++++++---- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java index eb20f613d..152a049d0 100644 --- a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java +++ b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java @@ -16,6 +16,7 @@ import core.game.node.item.Item; import core.game.system.task.Pulse; import core.game.world.GameWorld; import core.game.world.map.Location; +import core.game.world.map.Region; import core.game.world.map.path.Pathfinder; import content.global.handlers.iface.SawmillPlankInterface.Plank; import org.rs09.consts.Items; @@ -27,16 +28,15 @@ import org.rs09.consts.Items; * @version 0.98 (TODO: Missing a few dialogues) */ public class HouseServantDialogue extends DialoguePlugin { + /** + * If using the sawmill or unnoting planks. + */ + private boolean fetchRun; /** - * If using the sawmill. + * The logs or noted planks. */ - private boolean sawmill; - - /** - * The logs - */ - private Item logs; + private Item fetchItem; /** * Constructs a new {@code ServantDialogue} {@code Object}. @@ -66,8 +66,8 @@ public class HouseServantDialogue extends DialoguePlugin { HouseManager manager = player.getHouseManager(); boolean inHouse = manager.isInHouse(player); if (args.length > 1) { //Parse options from our "use-with" handler - sawmill = (boolean) args[1]; - logs = (Item) args[2]; + fetchRun = (boolean) args[1]; + fetchItem = (Item) args[2]; } if (player.getIronmanManager().checkRestriction(IronmanMode.ULTIMATE)) { player.sendMessage("Ultimate Ironmen cannot hire butlers."); @@ -95,7 +95,7 @@ public class HouseServantDialogue extends DialoguePlugin { } if (inHouse) { follow(player, servant); - if (sawmill) { + if (fetchRun) { interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "Very well, I will take these logs to the mill and", "have them converted into planks."); stage = 110; return true; @@ -197,7 +197,7 @@ public class HouseServantDialogue extends DialoguePlugin { return true; } end(); - sawmillRun(player, (Item) servant.getAttribute("con:lastfetch")); + fetchRun(player, (Item) servant.getAttribute("con:lastfetch")); } break; case 2: @@ -381,7 +381,7 @@ public class HouseServantDialogue extends DialoguePlugin { break; case 110: end(); - sawmillRun(player, logs); + fetchRun(player, fetchItem); break; case 150: if (servant.getItem()== null) { @@ -423,10 +423,10 @@ public class HouseServantDialogue extends DialoguePlugin { * @param item * @return true or false if they have the requirements to use the servant. */ - private boolean prereqs(final Player player, final Item item, boolean sawmill) { + private boolean prereqs(final Player player, final Item item, boolean fetchRun) { HouseManager manager = player.getHouseManager(); Servant servant = manager.getServant(); - if (!sawmill && player.getInventory().freeSlots() < 1) { + if (!fetchRun && player.getInventory().freeSlots() < 1) { interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "You don't have any space in your inventory."); stage = 100; return false; @@ -449,18 +449,19 @@ public class HouseServantDialogue extends DialoguePlugin { } /** - * Goes to the sawmill. + * Goes to the sawmill or bank. * @param player * @param item */ - private void sawmillRun(final Player player, final Item item) { + private void fetchRun(final Player player, final Item item) { HouseManager manager = player.getHouseManager(); final Servant servant = manager.getServant(); final ServantType type = manager.getServant().getType(); + final boolean sawmill = item.isNoted(); if (servant == null || item == null || !prereqs(player, item, true)) { return; } - if (type == ServantType.MAID || type == ServantType.RICK) { + if (sawmill && (type == ServantType.MAID || type == ServantType.RICK)) { interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I am unable to take logs to the sawmill."); return; } @@ -482,12 +483,13 @@ public class HouseServantDialogue extends DialoguePlugin { if (player.getInventory().remove(new Item(item.getId(), amt)) && player.getInventory().remove(new Item(Items.COINS_995, amt * plank.getPrice()))) { servant.setInvisible(true); servant.getLocks().lockMovement(100); + int finalAmt = amt; GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)){ @Override public boolean pulse() { servant.setInvisible(false); servant.getLocks().unlockMovement(); - manager.getServant().setItem(new Item(plank.getPlank().getId(), amt)); + manager.getServant().setItem(new Item(plank.getPlank().getId(), finalAmt)); interpreter.open(servant.getId(), servant); servant.setAttribute("con:lastfetch", new Item(item.getId(), 1)); servant.setAttribute("con:lastfetchtype", "sawmill"); @@ -525,9 +527,6 @@ public class HouseServantDialogue extends DialoguePlugin { GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)) { @Override public boolean pulse() { - if (player == null) { - return true; - } Region pr = player.getViewport().getRegion(); Region hr = player.getHouseManager().getHouseRegion(); Region dr = player.getHouseManager().getDungeonRegion(); diff --git a/Server/src/main/content/global/skill/construction/npc/HouseServantPlugin.java b/Server/src/main/content/global/skill/construction/npc/HouseServantPlugin.java index 68af6493e..2a2542eaa 100644 --- a/Server/src/main/content/global/skill/construction/npc/HouseServantPlugin.java +++ b/Server/src/main/content/global/skill/construction/npc/HouseServantPlugin.java @@ -6,6 +6,8 @@ import core.game.interaction.UseWithHandler; import core.plugin.Initializable; import core.plugin.Plugin; import core.plugin.ClassScanner; +import org.rs09.consts.Items; +import org.rs09.consts.NPCs; /** * Handles interaction with the house servant. @@ -19,11 +21,13 @@ import core.plugin.ClassScanner; */ @Initializable public class HouseServantPlugin extends UseWithHandler { - /** * The item IDS to use. */ - final static int[] IDS = { 1511, 1521, 6333, 6332 }; + final static int[] IDS = { + Items.LOGS_1511, Items.OAK_LOGS_1521, Items.TEAK_LOGS_6333, Items.MAHOGANY_LOGS_6332, + Items.PLANK_961, Items.OAK_PLANK_8779, Items.TEAK_PLANK_8781, Items.MAHOGANY_PLANK_8783 //noted planks + }; /** * Constructs a new {@code HouseServantPlugin} {@code Object}. @@ -34,11 +38,11 @@ public class HouseServantPlugin extends UseWithHandler { @Override public Plugin newInstance(Object arg) throws Throwable { - addHandler(4235, NPC_TYPE, this); - addHandler(4237, NPC_TYPE, this); - addHandler(4239, NPC_TYPE, this); - addHandler(4241, NPC_TYPE, this); - addHandler(4243, NPC_TYPE, this); + addHandler(NPCs.RICK_4235, NPC_TYPE, this); + addHandler(NPCs.MAID_4237, NPC_TYPE, this); + addHandler(NPCs.COOK_4239, NPC_TYPE, this); + addHandler(NPCs.BUTLER_4241, NPC_TYPE, this); + addHandler(NPCs.DEMON_BUTLER_4243, NPC_TYPE, this); ClassScanner.definePlugin(new HouseServantDialogue()); return this; } @@ -51,5 +55,4 @@ public class HouseServantPlugin extends UseWithHandler { event.getPlayer().getDialogueInterpreter().open(event.getUsedWith().asNpc().getId(), event.getUsedWith().asNpc(), true, event.getUsedItem()); return true; } - -} \ No newline at end of file +} From 24beca35c48855dfeee5a38b395dabc1adf0c966 Mon Sep 17 00:00:00 2001 From: Player Name Date: Mon, 27 Apr 2026 14:13:05 +0200 Subject: [PATCH 4/4] Plank unnote wip but it's just too much trash --- .../npc/HouseServantDialogue.java | 130 ++++++++++++------ 1 file changed, 86 insertions(+), 44 deletions(-) diff --git a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java index 152a049d0..b0c79d4c9 100644 --- a/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java +++ b/Server/src/main/content/global/skill/construction/npc/HouseServantDialogue.java @@ -29,10 +29,15 @@ import org.rs09.consts.Items; */ public class HouseServantDialogue extends DialoguePlugin { /** - * If using the sawmill or unnoting planks. + * If going outside to run logs by the sawmill or unnote planks at the bank. */ private boolean fetchRun; + /** + * If making planks. + */ + private boolean sawmill; + /** * The logs or noted planks. */ @@ -68,6 +73,7 @@ public class HouseServantDialogue extends DialoguePlugin { if (args.length > 1) { //Parse options from our "use-with" handler fetchRun = (boolean) args[1]; fetchItem = (Item) args[2]; + sawmill = fetchRun && !fetchItem.getDefinition().isUnnoted(); } if (player.getIronmanManager().checkRestriction(IronmanMode.ULTIMATE)) { player.sendMessage("Ultimate Ironmen cannot hire butlers."); @@ -95,11 +101,16 @@ public class HouseServantDialogue extends DialoguePlugin { } if (inHouse) { follow(player, servant); - if (fetchRun) { + if (sawmill) { interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "Very well, I will take these logs to the mill and", "have them converted into planks."); stage = 110; return true; - } + } + if (fetchRun) { + interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "Shall I redeem that certificate for " + (player.isMale() ? "sir" : "madam")); + stage = 200; + return true; + } if (servant.getItem().getAmount() > 0) { if(player.getInventory().freeSlots() < 1){ interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I have returned with what you asked me to", "retrieve. As I see your inventory is full, I shall wait", "with these " + servant.getItem().getAmount()+" items until you are ready."); @@ -404,11 +415,26 @@ public class HouseServantDialogue extends DialoguePlugin { if (flag) { interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I still have " + servant.getItem().getAmount() + " left for you to take from me."); stage = 100; - } else{ + } else { end(); } break; + case 200: + options("Yes", "No, just take it to the bank", "No, never mind"); + stage++; + break; + case 201: + switch (buttonId) { + case 1: + // Enter amount + case 2: + case 3: + break; + } + break; } + case 202: + // I regret that I am only able to carry 20 items, sir return true; } @@ -457,49 +483,65 @@ public class HouseServantDialogue extends DialoguePlugin { HouseManager manager = player.getHouseManager(); final Servant servant = manager.getServant(); final ServantType type = manager.getServant().getType(); - final boolean sawmill = item.isNoted(); - if (servant == null || item == null || !prereqs(player, item, true)) { + if (!prereqs(player, item, true)) { return; } - if (sawmill && (type == ServantType.MAID || type == ServantType.RICK)) { - interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I am unable to take logs to the sawmill."); - return; - } - int amt = player.getInventory().getAmount(item); - if (amt < 1) { - interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "You don't have any more of that type of log."); - return; - } - for (Plank plank : Plank.values()) { - if (plank.getLog().getId() == item.getId()) { - if (amt > type.getCapacity()) { - amt = type.getCapacity(); + if (sawmill) { + if (type == ServantType.MAID || type == ServantType.RICK) { + interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "I am unable to take logs to the sawmill."); + return; + } + int amt = Math.min(player.getInventory().getAmount(item), type.getCapacity()); + if (amt < 1) { + interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "You don't have any more of that type of log."); + return; + } + for (Plank plank : Plank.values()) { + if (plank.getLog().getId() == item.getId()) { + if (!player.getInventory().contains(995, plank.getPrice() * amt)) { + interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "You don't have enough coins for me to do that.", "I can hold " + type.getCapacity() + " logs and each of this type of log", "costs " + plank.getPrice() + " coins each to convert into plank form."); + return; + } + end(); + if (player.getInventory().remove(new Item(item.getId(), amt)) && player.getInventory().remove(new Item(Items.COINS_995, amt * plank.getPrice()))) { + servant.setInvisible(true); + servant.getLocks().lockMovement(100); + GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)){ + @Override + public boolean pulse() { + servant.setInvisible(false); + servant.getLocks().unlockMovement(); + manager.getServant().setItem(new Item(plank.getPlank().getId(), amt)); + interpreter.open(servant.getId(), servant); + servant.setAttribute("con:lastfetch", new Item(item.getId(), 1)); + servant.setAttribute("con:lastfetchtype", "sawmill"); + manager.getServant().setUses(manager.getServant().getUses() + 1); + follow(player, servant); + return true; + } + }); + } + break; } - if (!player.getInventory().contains(995, plank.getPrice() * amt)) { - interpreter.sendDialogues(servant, servant.getId() == 4243 ? FacialExpression.HALF_GUILTY : null, "You don't have enough coins for me to do that.", "I can hold " + type.getCapacity() + " logs and each of this type of log", "costs " + plank.getPrice() + " coins each to convert into plank form."); - return; - } - end(); - if (player.getInventory().remove(new Item(item.getId(), amt)) && player.getInventory().remove(new Item(Items.COINS_995, amt * plank.getPrice()))) { - servant.setInvisible(true); - servant.getLocks().lockMovement(100); - int finalAmt = amt; - GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)){ - @Override - public boolean pulse() { - servant.setInvisible(false); - servant.getLocks().unlockMovement(); - manager.getServant().setItem(new Item(plank.getPlank().getId(), finalAmt)); - interpreter.open(servant.getId(), servant); - servant.setAttribute("con:lastfetch", new Item(item.getId(), 1)); - servant.setAttribute("con:lastfetchtype", "sawmill"); - manager.getServant().setUses(manager.getServant().getUses() + 1); - follow(player, servant); - return true; - } - }); - } - break; + } + } else { //just unnote + int amt = Math.min(item.getAmount(), type.getCapacity()); + if (player.getInventory().remove(new Item(item.getId(), amt))) { + servant.setInvisible(true); + servant.getLocks().lockMovement(100); + GameWorld.getPulser().submit(new Pulse((int) (type.getTimer() / 0.6)){ + @Override + public boolean pulse() { + servant.setInvisible(false); + servant.getLocks().unlockMovement(); + manager.getServant().setItem(new Item(item.getId()-1, amt)); + interpreter.open(servant.getId(), servant); + // Purposefully not setting last fetch + manager.getServant().setUses(manager.getServant().getUses() + 1); + follow(player, servant); + return true; + } + }); } } }