/* Remove Aquatic Form from Druid Trainers - it is a quest reward instead */
DELETE FROM `npc_trainer` WHERE `SpellID` = 1066;

/* Restore Aquatic Form as a reward for Aquatic Form quests */
UPDATE `quest_template` SET `RewardSpell` = 1446 WHERE `ID` IN (31, 5061);

/* Remove Conjure Water (Rank 7) from Mage Trainers - it is a quest reward instead */
DELETE FROM `npc_trainer` WHERE `SpellID` = 10140;

/* Correct Vanilla level for Druid Travel Form */
UPDATE `npc_trainer` SET `ReqLevel` = 30 WHERE `SpellID` = 783;

/* Remove Summon Imp from Trainer - it is a quest reward instead */
DELETE FROM `npc_trainer` WHERE `ID`=200009 AND `SpellID`=688;

/* Remove Summon Felsteed from Trainer - it is a quest reward instead */
DELETE FROM `npc_trainer` WHERE `ID`=200010 AND `SpellID`=1710;

/* Remove Sense Undead from Trainer - it is a quest reward for Tome of Valor quest line */
DELETE FROM `npc_trainer` WHERE `SpellID`=5502;

-- Remove starting dual wield skill for rogues, add to trainers at level 10
DELETE FROM `playercreateinfo_skills` WHERE `skill`=118;
INSERT INTO `playercreateinfo_skills` (`raceMask`, `classMask`, `skill`, `rank`, `comment`) VALUES (0, 32, 118, 0, 'Dual Wield');
DELETE FROM `npc_trainer` WHERE `ID` = 200015 AND `SpellID` = 674;
INSERT INTO `npc_trainer` (`ID`, `SpellID`, `MoneyCost`, `ReqSkillLine`, `ReqSkillRank`, `ReqLevel`) VALUES (200015, 674, 300, 0, 0, 10);

-- Class skills taught by dropped items that should not be taught by trainers
DELETE FROM npc_trainer
WHERE SpellID IN (19801, 21302, 21562, 21564, 21849, 21850, 23028, 
    25286, 25288, 25289, 25290, 25291, 25292, 25294, 25295, 25296, 25297, 25298, 25299, 
    25300, 25302, 25304, 25306, 25307, 25309, 25311, 25314, 25315, 25316, 25345, 25357, 25361, 25392, 
    26991, 27090, 27127, 27683, 28609, 28610, 28612, 29228, 31016, 31018, 31709, 33717, 39374);

/* Restore Tome of Tranquilizing Shot to Lucifron */
DELETE FROM `creature_loot_template` WHERE `Entry`=12118 AND `Item`=16665 AND `Reference`=0 AND `GroupId`=0;
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(12118, 16665, 0, 100, 0, 1, 0, 1, 1, NULL);

/* Restore AQ20 Book Drops */
DELETE FROM `reference_loot_template` WHERE `entry` IN (30420, 30421, 30424, 30426, 30427);
INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Chance`, `GroupId`, `MinCount`, `MaxCount`) VALUES
(30420, 21282, 0, 1, 1, 1),
(30420, 21279, 0, 1, 1, 1),
(30420, 21283, 0, 1, 1, 1),
(30420, 21281, 0, 1, 1, 1),
(30420, 21291, 0, 1, 1, 1),
(30420, 21288, 0, 1, 1, 1),
(30420, 21214, 0, 1, 1, 1),
(30420, 21280, 0, 1, 1, 1),
(30420, 21297, 0, 1, 1, 1),
(30421, 21292, 0, 1, 1, 1),
(30424, 21300, 0, 1, 1, 1),
(30424, 21302, 0, 1, 1, 1),
(30424, 21299, 0, 1, 1, 1),
(30424, 21307, 0, 1, 1, 1),
(30421, 21298, 0, 1, 1, 1),
(30424, 21290, 0, 1, 1, 1),
(30424, 21304, 0, 1, 1, 1),
(30424, 21306, 0, 1, 1, 1),
(30421, 21296, 0, 1, 1, 1),
(30421, 21295, 0, 1, 1, 1),
(30424, 21303, 0, 1, 1, 1),
(30421, 21294, 0, 1, 1, 1),
(30421, 21285, 0, 1, 1, 1),
(30421, 21284, 0, 1, 1, 1),
(30421, 21287, 0, 1, 1, 1),
(30421, 21289, 0, 1, 1, 1),
(30426, 21302, 0, 2, 1, 1),
(30426, 21299, 0, 2, 1, 1),
(30426, 21214, 0, 2, 1, 1),
(30426, 21300, 0, 2, 1, 1),
(30426, 21283, 0, 2, 1, 1),
(30426, 21279, 0, 2, 1, 1),
(30426, 21296, 0, 2, 1, 1),
(30426, 21282, 0, 2, 1, 1),
(30426, 21280, 0, 2, 1, 1),
(30426, 21298, 0, 2, 1, 1),
(30426, 21297, 0, 2, 1, 1),
(30426, 21303, 0, 2, 1, 1),
(30426, 21295, 0, 2, 1, 1),
(30426, 21284, 0, 2, 1, 1),
(30426, 21290, 0, 2, 1, 1),
(30426, 21289, 0, 2, 1, 1),
(30426, 21291, 0, 2, 1, 1),
(30426, 21307, 0, 2, 1, 1),
(30426, 21292, 0, 2, 1, 1),
(30426, 21288, 0, 2, 1, 1),
(30426, 21287, 0, 2, 1, 1),
(30426, 21306, 0, 2, 1, 1),
(30426, 21285, 0, 2, 1, 1),
(30426, 21294, 0, 2, 1, 1),
(30426, 21304, 0, 2, 1, 1),
(30426, 21281, 0, 2, 1, 1),
(30427, 21307, 0, 4, 1, 1),
(30427, 21291, 0, 4, 1, 1),
(30427, 21300, 0, 4, 1, 1),
(30427, 21302, 0, 4, 1, 1),
(30427, 21290, 0, 4, 1, 1),
(30427, 21306, 0, 4, 1, 1),
(30427, 21292, 0, 4, 1, 1),
(30427, 21304, 0, 4, 1, 1),
(30427, 21294, 0, 4, 1, 1),
(30427, 21303, 0, 4, 1, 1),
(30427, 21299, 0, 4, 1, 1),
(30427, 21295, 0, 4, 1, 1),
(30427, 21298, 0, 4, 1, 1),
(30427, 21296, 0, 4, 1, 1),
(30427, 21297, 0, 4, 1, 1),
(30427, 21279, 0, 4, 1, 1),
(30427, 21283, 0, 4, 1, 1),
(30427, 21285, 0, 4, 1, 1),
(30427, 21282, 0, 4, 1, 1),
(30427, 21287, 0, 4, 1, 1),
(30427, 21281, 0, 4, 1, 1),
(30427, 21214, 0, 4, 1, 1),
(30427, 21288, 0, 4, 1, 1),
(30427, 21280, 0, 4, 1, 1),
(30427, 21289, 0, 4, 1, 1),
(30427, 21284, 0, 4, 1, 1);

REPLACE INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `GroupId`, `MinCount`, `MaxCount`) VALUES
(15339, 30424, 30424, 100, 0, 1, 1),
(15339, 30421, 30421, 100, 0, 1, 1),
(15339, 30420, 30420, 100, 0, 1, 1),
(15340, 30426, 30426, 100, 4, 1, 1),
(15340, 30427, 30427, 100, 4, 1, 1),
(15341, 30427, 30427, 100, 4, 1, 1),
(15341, 30426, 30426, 100, 4, 1, 1),
(15348, 30426, 30426, 100, 4, 1, 1),
(15369, 30427, 30427, 100, 4, 1, 1),
(15369, 30426, 30426, 100, 4, 1, 1),
(15370, 30427, 30427, 100, 4, 1, 1),
(15370, 30426, 30426, 100, 4, 1, 1);

/* Restore drops from Grimoire of Shadow Ward IV */
DELETE FROM `creature_loot_template` WHERE `Item` = 22891;
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Chance`, `GroupId`, `MinCount`, `MaxCount`) VALUES
(8895, 22891, 0.02, 0, 1, 1),
(8898, 22891, 0.02, 0, 1, 1),
(8899, 22891, 0.02, 0, 1, 1),
(8903, 22891, 0.02, 0, 1, 1),
(8906, 22891, 0.02, 0, 1, 1),
(8907, 22891, 0.04, 0, 1, 1),
(8908, 22891, 0.05, 0, 1, 1),
(8910, 22891, 0.02, 0, 1, 1),
(8911, 22891, 0.02, 0, 1, 1),
(8914, 22891, 0.02, 0, 1, 1),
(9044, 22891, 0.02, 0, 1, 1),
(9045, 22891, 0.03, 0, 1, 1),
(9096, 22891, 0.03, 0, 1, 1),
(9098, 22891, 0.02, 0, 1, 1),
(9197, 22891, 0.05, 0, 1, 1),
(9201, 22891, 0.02, 0, 1, 1),
(9216, 22891, 0.05, 0, 1, 1),
(9239, 22891, 0.05, 0, 1, 1),
(9240, 22891, 0.02, 0, 1, 1),
(9241, 22891, 0.02, 0, 1, 1),
(9257, 22891, 0.03, 0, 1, 1),
(9258, 22891, 0.02, 0, 1, 1),
(9259, 22891, 0.04, 0, 1, 1),
(9260, 22891, 0.03, 0, 1, 1),
(9261, 22891, 0.02, 0, 1, 1),
(9262, 22891, 0.04, 0, 1, 1),
(9263, 22891, 0.02, 0, 1, 1),
(9265, 22891, 0.02, 0, 1, 1),
(9266, 22891, 0.05, 0, 1, 1),
(9268, 22891, 0.02, 0, 1, 1),
(9269, 22891, 0.02, 0, 1, 1),
(9583, 22891, 0.03, 0, 1, 1),
(9692, 22891, 0.03, 0, 1, 1),
(9693, 22891, 0.06, 0, 1, 1),
(9716, 22891, 0.02, 0, 1, 1),
(9717, 22891, 0.02, 0, 1, 1),
(9817, 22891, 0.05, 0, 1, 1),
(9818, 22891, 0.03, 0, 1, 1),
(9819, 22891, 0.04, 0, 1, 1),
(10083, 22891, 0.02, 0, 1, 1),
(10317, 22891, 0.05, 0, 1, 1),
(10318, 22891, 0.04, 0, 1, 1),
(10319, 22891, 0.05, 0, 1, 1),
(10366, 22891, 0.03, 0, 1, 1),
(10372, 22891, 0.02, 0, 1, 1),
(10374, 22891, 0.02, 0, 1, 1),
(10381, 22891, 0.03, 0, 1, 1),
(10382, 22891, 0.02, 0, 1, 1),
(10384, 22891, 0.05, 0, 1, 1),
(10385, 22891, 0.09, 0, 1, 1),
(10390, 22891, 0.02, 0, 1, 1),
(10398, 22891, 0.02, 0, 1, 1),
(10399, 22891, 0.04, 0, 1, 1),
(10400, 22891, 0.02, 0, 1, 1),
(10405, 22891, 0.02, 0, 1, 1),
(10406, 22891, 0.03, 0, 1, 1),
(10407, 22891, 0.02, 0, 1, 1),
(10408, 22891, 0.04, 0, 1, 1),
(10409, 22891, 0.02, 0, 1, 1),
(10412, 22891, 0.02, 0, 1, 1),
(10413, 22891, 0.02, 0, 1, 1),
(10414, 22891, 0.02, 0, 1, 1),
(10416, 22891, 0.02, 0, 1, 1),
(10417, 22891, 0.02, 0, 1, 1),
(10418, 22891, 0.03, 0, 1, 1),
(10419, 22891, 0.02, 0, 1, 1),
(10420, 22891, 0.05, 0, 1, 1),
(10421, 22891, 0.04, 0, 1, 1),
(10422, 22891, 0.02, 0, 1, 1),
(10423, 22891, 0.04, 0, 1, 1),
(10424, 22891, 0.04, 0, 1, 1),
(10425, 22891, 0.05, 0, 1, 1),
(10426, 22891, 0.03, 0, 1, 1),
(10447, 22891, 0.03, 0, 1, 1),
(10463, 22891, 0.03, 0, 1, 1),
(10464, 22891, 0.02, 0, 1, 1),
(10469, 22891, 0.03, 0, 1, 1),
(10470, 22891, 0.04, 0, 1, 1),
(10471, 22891, 0.03, 0, 1, 1),
(10476, 22891, 0.04, 0, 1, 1),
(10477, 22891, 0.02, 0, 1, 1),
(10478, 22891, 0.03, 0, 1, 1),
(10486, 22891, 0.02, 0, 1, 1),
(10487, 22891, 0.02, 0, 1, 1),
(10488, 22891, 0.03, 0, 1, 1),
(10489, 22891, 0.06, 0, 1, 1),
(10491, 22891, 0.03, 0, 1, 1),
(10495, 22891, 0.02, 0, 1, 1),
(10498, 22891, 0.02, 0, 1, 1),
(10499, 22891, 0.03, 0, 1, 1),
(10500, 22891, 0.02, 0, 1, 1),
(10680, 22891, 0.02, 0, 1, 1),
(10681, 22891, 0.02, 0, 1, 1),
(10742, 22891, 0.03, 0, 1, 1),
(10762, 22891, 0.12, 0, 1, 1),
(11032, 22891, 0.02, 0, 1, 1),
(11043, 22891, 0.02, 0, 1, 1),
(11257, 22891, 0.03, 0, 1, 1),
(11441, 22891, 0.02, 0, 1, 1),
(11444, 22891, 0.02, 0, 1, 1),
(11450, 22891, 0.02, 0, 1, 1),
(11455, 22891, 0.03, 0, 1, 1),
(11456, 22891, 0.02, 0, 1, 1),
(11458, 22891, 0.02, 0, 1, 1),
(11459, 22891, 0.02, 0, 1, 1),
(11462, 22891, 0.02, 0, 1, 1),
(11472, 22891, 0.02, 0, 1, 1),
(11473, 22891, 0.02, 0, 1, 1),
(11483, 22891, 0.02, 0, 1, 1),
(11551, 22891, 0.04, 0, 1, 1),
(11582, 22891, 0.03, 0, 1, 1),
(12457, 22891, 0.02, 0, 1, 1),
(12460, 22891, 0.02, 0, 1, 1),
(12461, 22891, 0.03, 0, 1, 1),
(12463, 22891, 0.06, 0, 1, 1),
(12459, 22891, 0.02, 0, 1, 1),
(12465, 22891, 0.02, 0, 1, 1),
(12467, 22891, 0.02, 0, 1, 1),
(13197, 22891, 0.02, 0, 1, 1),
(13285, 22891, 0.02, 0, 1, 1),
(12397, 22891, 0.02, 0, 1, 1),
(10371, 22891, 0.02, 0, 1, 1),
(11471, 22891, 0.02, 0, 1, 1),
(11448, 22891, 0.02, 0, 1, 1),
(11480, 22891, 0.02, 0, 1, 1),
(10391, 22891, 0.03, 0, 1, 1);
