--
-- Encounter Journal: minimal sample data.
-- Showcases one dungeon (Deadmines, map 36) and one raid (Naxxramas, map 533),
-- with one encounter each, a creature card, a section tree (overview + 1 ability)
-- and a couple of loot rows. Loot item_ids reference real WotLK item_template entries.
--
-- IDs used by the sample stay above 9000 to avoid collisions with future imports.
--

START TRANSACTION;

DELETE FROM `custom_ej_loot`            WHERE `encounter_id`    BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_section`         WHERE `encounter_id`    BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_creature`        WHERE `encounter_id`    BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_encounter`       WHERE `id`              BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_tier_instance`   WHERE `instance_id`     BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_instance`        WHERE `id`              BETWEEN 9000 AND 9999;
DELETE FROM `custom_ej_tier`            WHERE `id`              BETWEEN 9000 AND 9999;

-- ---------------------------------------------------------------------------
-- Tiers
-- ---------------------------------------------------------------------------
INSERT INTO `custom_ej_tier` (`id`, `name`, `flags`, `sort_order`) VALUES
  (9001, 'Classic',           0, 10),
  (9002, 'Wrath of the Lich King', 0, 20);

-- ---------------------------------------------------------------------------
-- Dungeon: The Deadmines (map 36)
-- ---------------------------------------------------------------------------
-- instance.flags = 0 (dungeon)
INSERT INTO `custom_ej_instance`
  (`id`, `name`, `description`, `button_icon`, `small_button_icon`,
   `background`, `lore_background`, `map_id`, `area_id`, `world_map_area_id`,
   `flags`, `sort_order`)
VALUES
  (9001, 'The Deadmines',
   'Beneath the quiet town of Moonbrook lies the Defias Brotherhood''s '
   'shipyard, where Edwin VanCleef forges his revenge against the city of '
   'Stormwind.',
   'Interface\\EncounterJournal\\UI-EJ-DUNGEONBUTTON-DEADMINES',
   'Interface\\EncounterJournal\\UI-EJ-SMALLBUTTON-DEADMINES',
   'Interface\\EncounterJournal\\UI-EJ-DUNGEON-DEADMINES',
   '',
   36, 1581, 0,
   0, 10);

INSERT INTO `custom_ej_tier_instance` (`tier_id`, `instance_id`, `sort_order`)
VALUES (9001, 9001, 10);

-- Encounter: Edwin VanCleef
INSERT INTO `custom_ej_encounter`
  (`id`, `instance_id`, `name`, `description`,
   `map_position_x`, `map_position_y`, `floor_index`, `world_map_area_id`,
   `first_section_id`, `difficulty_mask`, `flags`, `sort_order`)
VALUES
  (9001, 9001, 'Edwin VanCleef',
   'Once a master stonemason, VanCleef built much of postwar Stormwind. '
   'Cheated of his pay, he founded the Defias Brotherhood to take revenge.',
   0.85, 0.65, 1, 0,
   9001, 0x1, 0, 100);

-- Creature card
INSERT INTO `custom_ej_creature`
  (`id`, `encounter_id`, `creature_id`, `name`, `description`,
   `creature_display_id`, `icon`, `difficulty_mask`, `sort_order`)
VALUES
  (9001, 9001, 639, 'Edwin VanCleef',
   'Leader of the Defias Brotherhood.',
   822, '', 0x1, 10);

-- Sections
-- Tree: 9001 (Overview) -> next 9002 (Abilities)
--                                   sub  9003 (Strike)
INSERT INTO `custom_ej_section`
  (`id`, `encounter_id`, `parent_section_id`, `next_section_id`,
   `sub_section_id`, `name`, `description`,
   `creature_display_id`, `description_spell_id`, `icon_spell_id`,
   `icon`, `flags`, `icon_flags`, `sort_order`, `type`,
   `difficulty_mask`, `creature_id`)
VALUES
  (9001, 9001, 0, 9002, 0,
   'Overview',
   'VanCleef calls in waves of his lieutenants before engaging the party '
   'directly. Stay mobile and interrupt his casts.',
   0, 0, 0, NULL, 0x1, 0, 10, 0, 0x1, 639),

  (9002, 9001, 0, 0, 9003,
   'Abilities',
   '', 0, 0, 0, NULL, 0, 0, 20, 0, 0x1, 639),

  (9003, 9001, 9002, 0, 0,
   'Strike',
   'A heavy melee strike on VanCleef''s current target.',
   0, 6975, 6975, NULL, 0, 0, 10, 0, 0x1, 639);

-- Loot (real WotLK items): Cruel Barb (mh sword), Buccaneer''s Bracers
INSERT INTO `custom_ej_loot`
  (`encounter_id`, `item_id`, `difficulty_mask`, `faction_mask`,
   `class_mask`, `flags`, `sort_order`)
VALUES
  (9001, 1937, 0x1, -1, -1, 0, 10),  -- Cruel Barb
  (9001, 2169, 0x1, -1, -1, 0, 20);  -- Buccaneer''s Bracers

-- ---------------------------------------------------------------------------
-- Raid: Naxxramas (map 533)
-- ---------------------------------------------------------------------------
-- instance.flags = 0x10 (raid)
INSERT INTO `custom_ej_instance`
  (`id`, `name`, `description`, `button_icon`, `small_button_icon`,
   `background`, `lore_background`, `map_id`, `area_id`, `world_map_area_id`,
   `flags`, `sort_order`)
VALUES
  (9101, 'Naxxramas',
   'Necropolis of the lich Kel''Thuzad, anchored above the Dragonblight. '
   'Liberated and reactivated as a fortress of the Scourge.',
   'Interface\\EncounterJournal\\UI-EJ-RAIDBUTTON-NAXXRAMAS',
   'Interface\\EncounterJournal\\UI-EJ-SMALLBUTTON-NAXXRAMAS',
   'Interface\\EncounterJournal\\UI-EJ-RAID-NAXXRAMAS',
   '',
   533, 3456, 0,
   0x10, 10);

INSERT INTO `custom_ej_tier_instance` (`tier_id`, `instance_id`, `sort_order`)
VALUES (9002, 9101, 10);

-- Encounter: Patchwerk (10/25, normal/heroic combinations -> mask 0xF)
INSERT INTO `custom_ej_encounter`
  (`id`, `instance_id`, `name`, `description`,
   `map_position_x`, `map_position_y`, `floor_index`, `world_map_area_id`,
   `first_section_id`, `difficulty_mask`, `flags`, `sort_order`)
VALUES
  (9101, 9101, 'Patchwerk',
   'Kel''Thuzad''s favored creation: an abomination stitched from the '
   'corpses of more than a hundred victims.',
   0.40, 0.50, 1, 0,
   9101, 0xF, 0, 100);

INSERT INTO `custom_ej_creature`
  (`id`, `encounter_id`, `creature_id`, `name`, `description`,
   `creature_display_id`, `icon`, `difficulty_mask`, `sort_order`)
VALUES
  (9101, 9101, 16028, 'Patchwerk',
   'Kel''Thuzad''s flagship abomination.',
   23323, '', 0xF, 10);

INSERT INTO `custom_ej_section`
  (`id`, `encounter_id`, `parent_section_id`, `next_section_id`,
   `sub_section_id`, `name`, `description`,
   `creature_display_id`, `description_spell_id`, `icon_spell_id`,
   `icon`, `flags`, `icon_flags`, `sort_order`, `type`,
   `difficulty_mask`, `creature_id`)
VALUES
  (9101, 9101, 0, 9102, 0,
   'Overview',
   'Tank-and-spank with a fixed enrage timer. Two well-geared tanks must '
   'soak Hateful Strikes; healers run hot from the start.',
   0, 0, 0, NULL, 0x1, 0, 10, 0, 0xF, 16028),

  (9102, 9101, 0, 0, 9103,
   'Abilities',
   '', 0, 0, 0, NULL, 0, 0, 20, 0, 0xF, 16028),

  (9103, 9101, 9102, 0, 0,
   'Hateful Strike',
   'Patchwerk strikes the highest-health target within melee range for '
   'massive physical damage.',
   0, 28308, 28308, NULL, 0, 0, 10, 0, 0xF, 16028);

-- Loot: a few real Patchwerk drops (10-normal mask 0x1, 25-normal mask 0x2)
INSERT INTO `custom_ej_loot`
  (`encounter_id`, `item_id`, `difficulty_mask`, `faction_mask`,
   `class_mask`, `flags`, `sort_order`)
VALUES
  (9101, 39262, 0x1, -1, -1, 0, 10),   -- Stained-Glass Shard of Light
  (9101, 39263, 0x1, -1, -1, 0, 20),   -- Wraith Spear
  (9101, 40548, 0x2, -1, -1, 0, 30),   -- Patchwork Bracers (25-man)
  (9101, 40549, 0x2, -1, -1, 0, 40);   -- Severed Visionary Tendrils (25-man)

COMMIT;
