diff --git a/Server/src/main/content/global/skill/summoning/familiar/FamiliarManager.java b/Server/src/main/content/global/skill/summoning/familiar/FamiliarManager.java index 3e8e3b7e8..e65c36cf1 100644 --- a/Server/src/main/content/global/skill/summoning/familiar/FamiliarManager.java +++ b/Server/src/main/content/global/skill/summoning/familiar/FamiliarManager.java @@ -1,5 +1,6 @@ package content.global.skill.summoning.familiar; +import content.data.Quests; import content.global.skill.summoning.pet.Pet; import content.global.skill.summoning.pet.Pets; import core.cache.def.impl.ItemDefinition; @@ -31,6 +32,15 @@ import static core.api.ContentAPIKt.*; */ public final class FamiliarManager { + /** + * These varbits are packed into varp 1160. Legacy code added 243269632 directly to the raw varp, + * which toggled the Summoning orb visibility on every login. + * They are now written as individual varbits, but two of them remain unknown. + */ + private static final int VARBIT_SUMMONING_ORB_VISIBILITY = 4280; + private static final int VARBIT_SUMMONING_UNKNOWN1 = 4281; + private static final int VARBIT_SUMMONING_UNKNOWN2 = 4282; + /** * The familiars mapping. */ @@ -158,7 +168,11 @@ public final class FamiliarManager { if (hasFamiliar()) { familiar.init(); } - player.getFamiliarManager().setConfig(243269632); + boolean unlocked = player.getQuestRepository().isComplete(Quests.WOLF_WHISTLE); + + setVarbit(player, VARBIT_SUMMONING_ORB_VISIBILITY, unlocked ? 1 : 0); + setVarbit(player, VARBIT_SUMMONING_UNKNOWN1, 0); + setVarbit(player, VARBIT_SUMMONING_UNKNOWN2, 7); } /** @@ -456,16 +470,6 @@ public final class FamiliarManager { return true; } - /** - * Sets a config value. - * @param value the value. - */ - public void setConfig(int value) { - int current = getVarp(player, 1160); - int newVal = current + value; - setVarp(player, 1160, newVal); - } - /** * Gets the familiar. * @return The familiar. diff --git a/Server/src/main/content/region/asgarnia/taverley/quest/WolfWhistle.java b/Server/src/main/content/region/asgarnia/taverley/quest/WolfWhistle.java index ec4661ccf..29160561d 100644 --- a/Server/src/main/content/region/asgarnia/taverley/quest/WolfWhistle.java +++ b/Server/src/main/content/region/asgarnia/taverley/quest/WolfWhistle.java @@ -23,6 +23,11 @@ public class WolfWhistle extends Quest { */ public static final Item WOLF_BONES = new Item(2859, 2); + /** + * Gates the visibility of the Summoning orb next to the minimap behind quest completion. + */ + private static final int VARBIT_SUMMONING_ORB_VISIBILITY = 4280; + /** * Constructs a new {@code WolfWhistle} {@code Object}. */ @@ -164,6 +169,7 @@ public class WolfWhistle extends Quest { player.getSkills().addExperience(Skills.SUMMONING, 276); player.getInventory().add(new Item(12158, 275), player); player.removeAttribute("searched-body"); + setVarbit(player, VARBIT_SUMMONING_ORB_VISIBILITY, 1); player.getQuestRepository().syncronizeTab(player); player.getInterfaceManager().openInfoBars(); }