(function () {
// 1) Basic bot filter (extend if you like)
function isBot() {
return /(bot|crawl|spider|google|bing|slurp|yandex|facebook|linkedin|pinterest|preview|whatsapp|discord|telegram|headless|puppeteer)/i
.test(navigator.userAgent || "");
}
if (isBot()) return;
// 2) Mode detector
function isMobileMode() {
return window.matchMedia("(max-width: 767px)").matches ||
/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent || "");
}
// 3) Your ad configs (swap keys/sizes to match your network units)
const AD = {
mobile: { key: "aa6d52a6037d0558c2a19dc52b6aa824", width: 320, height: 50 }, // 320x50
desktop: { key: "a49752dcde88f4fde5987d25efbb7168", width: 468, height: 60 } // 468x60
};
// 4) Create container if it doesn't exist
function ensureContainer() {
let container = document.getElementById("ad-container");
if (!container) {
container = document.createElement("div");
container.id = "ad-container";
container.style.display = "none";
document.body.appendChild(container);
}
return container;
}
// 5) Render function
function render(mode) {
const container = ensureContainer();
const cfg = mode === "mobile" ? AD.mobile : AD.desktop;
// Set global atOptions for ad network
window.atOptions = {
key: cfg.key,
format: "iframe",
height: cfg.height,
width: cfg.width,
params: {}
};
// Clear previous ad/script then inject
container.innerHTML = "";
container.style.display = "block";
const s = document.createElement("script");
s.src = `//selfportraitproved.com/${cfg.key}/invoke.js`;
s.async = true;
container.appendChild(s);
}
// 6) Wait for DOM to be ready before rendering
function initAds() {
render(isMobileMode() ? "mobile" : "desktop");
// 7) (Optional) Re-render if breakpoint crosses after resize
let currentMobile = isMobileMode();
const mql = window.matchMedia("(max-width: 767px)");
if (mql.addEventListener) {
mql.addEventListener("change", (e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
} else if (mql.addListener) { // older browsers
mql.addListener((e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
}
}
// 8) Execute when DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initAds);
} else {
initAds();
}
})();
Rookwood Castle is a large, partially ruined castle in the Feldcroft Region of Hogwarts Legacy’s Highlands map, located a short distance to the northwest of Feldcroft village. It is a Bandit Castle Camp and is home to two Collection Chests and one Infamous Foe. There are also two Treasure Vaults nearby, both of which contain valuable loot, one of which is particularly tricky to solve.
Related: How to solve all Rookwood Castle Merlin Trials in Hogwarts Legacy
How to solve the Treasure Vault west of Rookwood Castle
The entrance to this Treasure Vault is on the beach at the westernmost edge of the map, and your first task is to open its doors, but that’s just a simple matter of casting Depulso on them. Inside you’ll find a puzzle in which you have to do something with blocks marked with arrows. To solve this Rookwood Treasure Vault puzzle, you need to place the loose blocks on the grid to the right so that they match those on the grid to the left. So, the arrow on the block on the top-left should be pointing up, and the arrow on the top-right should be pointing right. Use Wingardium Leviosa to move the blocks, and if the arrows are pointing the wrong way, use left and right on the D-pad to rotate them while holding them with Wingardium Leviosa.
How to solve the Treasure Vault northwest of Rookwood Castle
The entrance to this Treasure Vault is in a crevasse in the rocks and is guarded by spiders, so kill them with fire first. The entrance is open, so you don’t need to figure out how to get in, although you’ll need to use fire magic to burn away some spider’s webs blocking the passage. The puzzle inside the vault is a bit confusing at first but is actually very simple. There’s a little leafy tornado at the end of the passage, and when you get near it, it teleports a short distance away. You might think you have to use a spell to catch it or something, but no, you just have to make it teleport several times until eventually it disappears and a chest appears in its place.
👉 For more insights, check out this resource.