-- Five persistently-placed NPCs for "The Ley Wardens" intro quest chain (see PLAN.md's "v1.15" for
-- the full design). Unlike npc_waygate_portal (911001, summon-only), these are real static spawns --
-- ScriptName left empty since a plain accept/turn-in questgiver needs no custom CreatureScript, core's
-- default gossip/quest UI handles everything from creature_queststarter/questender + quest_template*
-- (see the follow-up migration, 2026_08_15_10.sql, for the quest content itself).
--
-- All five reuse faction 35 ("hostile to nobody"), already verified safe by npc_waygate_portal
-- (see waygate_network_portal_npc.sql) -- no new faction to verify. `npcflag = 3`
-- (UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER) so each gets a custom greeting line
-- (quest_greeting, keyed directly by the NPC's own entry -- confirmed via
-- data/sql/base/db_world/quest_greeting.sql, no separate ID range needed for greetings at all).
--
-- Display IDs are real, existing, non-hostile creature displays reused for fitting visuals rather
-- than guessed -- checked against the local acore_world DB, not picked blind:
-- - Aemos: 15346 ("[UNUSED] Obsidian Watcher", entry 11959) -- a real shipped display never used in
--   live content, avoiding any risk of confusion with an established character.
-- - Echo of the Ley Wardens / The First Warden: both reuse 16169 ("Spectral Apparition", entry
--   16423) -- deliberately identical, not a shortcut: the two are later revealed (quest 4/5's turn-in
--   text) to be the same kind of thing, an echo cast off by Aemos, so sharing a visual reinforces the
--   twist in hindsight rather than spoiling it up front.
-- - Windcaller Tyese: 4249 ("Cenarion Druid", entry 4052).
-- - Nazrek the Bent: 18027 ("Broken Refugee", entry 19120) -- an ordinary elderly/civilian Broken
--   model, not a corpse/skeleton/hostile one.
--
-- Placement: Aemos and Nazrek the Bent sit a few yards from real, DB-verified landmark NPCs on
-- already-Neutral ground this module has already confirmed safe (Shattrath's Terrace of Light, near
-- A'dal/Khadgar; Shattrath's Lower City, near Voren'thal the Seer) rather than new unverified spots.
-- The Eastern Kingdoms, Kalimdor, and Northrend contacts reuse the *exact* coordinates of existing
-- Waygate destinations (IDs 14, 38, 67 respectively) -- already-tested ground, no new verification
-- needed.
DELETE FROM `creature_template` WHERE `entry` BETWEEN 911002 AND 911006;
INSERT INTO `creature_template`
    (`entry`, `name`, `subname`, `minlevel`, `maxlevel`, `faction`, `npcflag`,
     `speed_walk`, `speed_run`, `unit_class`, `type`, `RegenHealth`, `ScriptName`)
VALUES
    (911002, 'Aemos', 'Warden of the Waygate', 80, 80, 35, 3, 1, 1.14286, 1, 4, 1, ''),
    (911003, 'Echo of the Ley Wardens', 'A Lingering Memory', 80, 80, 35, 3, 1, 1.14286, 1, 10, 1, ''),
    (911004, 'Windcaller Tyese', 'Cenarion Circle', 80, 80, 35, 3, 1, 1.14286, 1, 7, 1, ''),
    (911005, 'Nazrek the Bent', 'Elder of the Lower City', 80, 80, 35, 3, 1, 1.14286, 1, 7, 1, ''),
    (911006, 'The First Warden', 'An Echo Beyond Time', 80, 80, 35, 3, 1, 1.14286, 1, 10, 1, '');

DELETE FROM `creature_template_model` WHERE `CreatureID` BETWEEN 911002 AND 911006;
INSERT INTO `creature_template_model`
    (`CreatureID`, `Idx`, `CreatureDisplayID`, `DisplayScale`, `Probability`)
VALUES
    (911002, 0, 15346, 1, 1),
    (911003, 0, 16169, 1, 1),
    (911004, 0, 4249,  1, 1),
    (911005, 0, 18027, 1, 1),
    (911006, 0, 16169, 1, 1);

-- Aemos: Shattrath, Terrace of Light, a few yards from A'dal (-1863.68, 5430.04, -9.60549) and
-- Khadgar (-1859.87, 5420.07, -10.3805) without overlapping either or the nearby Aldor/Scryer NPCs.
DELETE FROM `creature` WHERE `id` = 911002;
INSERT INTO `creature`
    (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`)
VALUES
    (911002, 530, 1, 1, -1870.5, 5424.0, -9.605, 0.72, 300);

-- Echo of the Ley Wardens: Light's Hope Chapel, Eastern Plaguelands -- exact coordinates of Waygate
-- destination ID 14.
DELETE FROM `creature` WHERE `id` = 911003;
INSERT INTO `creature`
    (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`)
VALUES
    (911003, 0, 1, 1, 2300.90, -5345.09, 90.880, 2.164, 300);

-- Windcaller Tyese: Cenarion Hold, Silithus -- exact coordinates of Waygate destination ID 38.
DELETE FROM `creature` WHERE `id` = 911004;
INSERT INTO `creature`
    (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`)
VALUES
    (911004, 1, 1, 1, -6868.04, 729.91, 45.745, 0.489, 300);

-- Nazrek the Bent: Shattrath, Lower City, a few yards from Voren'thal the Seer
-- (-2272.61, 5576.36, 80.0374) on his own elevation (verified against nearby Enchantress
-- Volali/High Enchanter Bardolan, both also at z~80), not the tradesmen platform below at z~67.
DELETE FROM `creature` WHERE `id` = 911005;
INSERT INTO `creature`
    (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`)
VALUES
    (911005, 530, 1, 1, -2267.0, 5581.5, 80.02, 3.88, 300);

-- The First Warden: Wyrmrest Temple, Dragonblight -- exact coordinates of Waygate destination ID 67.
DELETE FROM `creature` WHERE `id` = 911006;
INSERT INTO `creature`
    (`id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`)
VALUES
    (911006, 571, 1, 1, 3546.74, 273.06, 45.663, 1.815, 300);

-- Custom greeting lines shown alongside the gossip menu (quest_greeting is keyed by the NPC's own
-- entry, type 0 = creature -- no separate ID range needed). One static line per NPC regardless of
-- which quest in the chain is currently active; each is written to read naturally on a first meeting,
-- since that's the highest-impact moment even though the NPC stays a questgiver for longer than that.
DELETE FROM `quest_greeting` WHERE `ID` IN (911002, 911003, 911004, 911005, 911006) AND `type` = 0;
INSERT INTO `quest_greeting` (`ID`, `type`, `Greeting`) VALUES
    (911002, 0, 'You feel it too, don''t you? The stone remembers you before you remember it.'),
    (911003, 0, 'There is more of me elsewhere. Isn''t that a strange thing to say about oneself.'),
    (911004, 0, 'You''ll want to see this before you go.'),
    (911005, 0, 'You have the look of someone about to learn more than they bargained for.'),
    (911006, 0, 'Go on. It''s waited long enough.');
