diff --git a/Server/src/main/content/global/skill/construction/BuildingUtils.java b/Server/src/main/content/global/skill/construction/BuildingUtils.java index 2ee636337..59e116afd 100644 --- a/Server/src/main/content/global/skill/construction/BuildingUtils.java +++ b/Server/src/main/content/global/skill/construction/BuildingUtils.java @@ -346,9 +346,9 @@ public final class BuildingUtils { objectId += player.getHouseManager().getCrest().ordinal(); } if (objectId == object.getId() && hotspot.getCurrentX() == l.getChunkOffsetX() && hotspot.getCurrentY() == l.getChunkOffsetY()) { + Decoration decoration = hotspot.getHotspot().getDecorations()[hotspot.getDecorationIndex()]; player.animate(REMOVE_ANIMATION); removeDecoration(player, region, room, hotspot, object, style); - Decoration decoration = Decoration.forObjectId(object.getId()); for (Item item : decoration.getRefundItems()) { addItemOrDrop(player, item.getId(), item.getAmount()); } diff --git a/Server/src/main/content/global/skill/construction/CrestType.kt b/Server/src/main/content/global/skill/construction/CrestType.kt index d296bb8b3..c9bfc22fd 100644 --- a/Server/src/main/content/global/skill/construction/CrestType.kt +++ b/Server/src/main/content/global/skill/construction/CrestType.kt @@ -8,7 +8,7 @@ import org.rs09.consts.Items /** * Enumerates the various crests the player can purchase for the Construction skill, as well as their requirements. - * ORDINAL BOUND, see HeraldicProduct.kt + * ORDINAL BOUND * @author Bishop */ diff --git a/Server/src/main/content/global/skill/construction/Decoration.java b/Server/src/main/content/global/skill/construction/Decoration.java index 4191cb1a9..b86a78cd5 100644 --- a/Server/src/main/content/global/skill/construction/Decoration.java +++ b/Server/src/main/content/global/skill/construction/Decoration.java @@ -899,7 +899,11 @@ public enum Decoration { if (h.getCurrentX() == l.getChunkOffsetX() && h.getCurrentY() == l.getChunkOffsetY()) { if (h.getDecorationIndex() != -1) { Decoration deco = h.getHotspot().getDecorations()[h.getDecorationIndex()]; - if (deco.getObjectId(player.getHouseManager().getStyle()) == object.getId()) { + int id = deco.getObjectId(player.getHouseManager().getStyle()); + if (h.getHotspot().getType() == BuildHotspotType.CREST) { + id += player.getHouseManager().getCrest().ordinal(); + } + if (id == object.getId()) { return deco; } } diff --git a/Server/src/main/content/global/skill/construction/HouseManager.java b/Server/src/main/content/global/skill/construction/HouseManager.java index 4db8e8191..5a46876e2 100644 --- a/Server/src/main/content/global/skill/construction/HouseManager.java +++ b/Server/src/main/content/global/skill/construction/HouseManager.java @@ -101,6 +101,10 @@ public final class HouseManager { public void parse(JSONObject data){ location = HouseLocation.values()[Integer.parseInt( data.get("location").toString())]; style = HousingStyle.values()[Integer.parseInt( data.get("style").toString())]; + Object crestRaw = data.get("crest"); + if (crestRaw != null) { + crest = CrestType.values()[Integer.parseInt(crestRaw.toString())]; + } Object servRaw = data.get("servant"); if(servRaw != null){ servant = Servant.parse((JSONObject) servRaw); diff --git a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt index f0ec194a9..f163794b4 100644 --- a/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt +++ b/Server/src/main/content/region/asgarnia/falador/dialogue/SirReniteeDialogue.kt @@ -141,7 +141,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("change_crest") npc(ChatAnim.NEUTRAL, "Mmm, very well. Changing your crest will cost", "5,000 coins.") exec { player, _ -> - if (amountInInventory(player, Items.COINS_995) < CrestType.MISTHALIN.cost) { + if (amountInInventory(player, Items.COINS_995) < CrestType.ASGARNIA.cost) { loadLabel(player, "no_money") } else { loadLabel(player, "choose_symbol") @@ -213,7 +213,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy") exec { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) if (crest.eligible(player) && removeItem(player, Item(Items.COINS_995, crest.cost))) { player.houseManager.crest = crest if (crest == CrestType.SARADOMIN && !player.achievementDiaryManager.getDiary(DiaryType.FALADOR).isComplete(2, 1)) { @@ -227,7 +227,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_ok") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) val messages = when (crest) { CrestType.ARRAV -> arrayOf("Ah yes, the shield that you helped to retrieve. You have", @@ -277,7 +277,7 @@ class SirReniteeDialogueFile : DialogueLabeller() { label("crest_buy_fail") manual { player, _ -> - val crest = getAttribute(player, attributeTempCrest, CrestType.MISTHALIN) + val crest = getAttribute(player, attributeTempCrest, CrestType.ASGARNIA) val messages = when (crest) { CrestType.ARRAV -> arrayOf("But that legendary shield is still lost! I don't think", diff --git a/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt b/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt index 351c8dc34..c9676f93f 100644 --- a/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt +++ b/Server/src/main/core/game/node/entity/player/info/login/PlayerSaver.kt @@ -197,6 +197,7 @@ class PlayerSaver (val player: Player){ val houseData = JSONObject() houseData.put("location",manager.location.ordinal.toString()) houseData.put("style",manager.style.ordinal.toString()) + houseData.put("crest",manager.crest.ordinal.toString()) if(manager.hasServant()){ val servant = JSONObject() servant.put("type",manager.servant.type.ordinal.toString())