DB/Fix: fix startup errors and modify the procedure a bit more so any custom entries (> 250000) will be preserved

This commit is contained in:
zxbiohazardzx
2012-01-16 11:51:16 +01:00
committed by ZxBiohazardZx
parent cdc20c1036
commit fced58a552
3 changed files with 26 additions and 69 deletions

View File

@@ -1,43 +0,0 @@
SET @Bag := 20469;
SET @RefA := 10022;
SET @RefB := 10023;
SET @RefC := 10024;
-- Add missing recipes to "Decoded True Believer Clippings" (i20469)
DELETE FROM `item_loot_template` WHERE `entry` = 20469;
INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
-- Decoded Twilight Texts:
(@Bag,20676,Chance,1,0,1,3),
(@Bag,20541,Chance,1,0,1,3),
(@Bag,20545,Chance,1,0,1,3),
(@Bag,20679,Chance,1,0,1,3),
(@Bag,20677,Chance,1,0,1,3),
(@Bag,20678,Chance,1,0,1,3),
(@Bag,20552,Chance,1,0,1,3),
-- scrolls via reference
(@Bag,1,100,1,0,-10001,1), -- one from level V scrolls
(@Bag,2,4,1,0,-@RefA,1), -- one from Crest of Beckoning
(@Bag,2,4,1,0,-@RefB,1), -- one from Sigil of Beckoning
(@Bag,2,4,1,0,-@RefC,1), -- one from Scepter of Beckoning
-- special pattern drops:
(@Bag,20546,3,1,0,1,1), -- Runed Stygian Leggings
(@Bag,20547,3,1,0,1,1), -- Runed Stygian Boots
(@Bag,20548,3,1,0,1,1), -- Runed Stygian Belt
(@Bag,20553,3,1,0,1,1), -- Darkrune Gauntlets
(@Bag,20554,3,1,0,1,1), -- Darkrune Breastplate
(@Bag,20555,3,1,0,1,1); -- Darkrune Helm
-- References:
DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefA,@RefB,@RefC);
INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
(@RefA,20518,0,1,1,1,1), -- Scroll: Crest of Beckoning
(@RefA,20526,0,1,1,1,1), -- Scroll: Crest of Beckoning
(@RefA,20527,0,1,1,1,1), -- Scroll: Crest of Beckoning
(@RefA,20528,0,1,1,1,1), -- Scroll: Crest of Beckoning
(@RefB,20531,0,1,1,1,1), -- Scroll: Sigil of Beckoning
(@RefB,20532,0,1,1,1,1), -- Scroll: Sigil of Beckoning
(@RefB,20533,0,1,1,1,1), -- Scroll: Sigil of Beckoning
(@RefB,20535,0,1,1,1,1), -- Scroll: Sigil of Beckoning
(@RefC,20540,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20542,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20543,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20544,0,1,1,1,1); -- Scroll: Scepter of Beckoning

View File

@@ -34,12 +34,12 @@ INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`loo
(@RefC,20540,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20542,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20543,0,1,1,1,1), -- Scroll: Scepter of Beckoning
(@RefC,20544,0,1,1,1,1); -- Scroll: Scepter of Beckoning
(@RefC,20544,0,1,1,1,1), -- Scroll: Scepter of Beckoning
-- Decoded Twilight Texts:
(@RefD,20676,0,1,0,1,3),
(@RefD,20541,0,1,0,1,3),
(@RefD,20545,0,1,0,1,3),
(@RefD,20679,0,1,0,1,3),
(@RefD,20677,0,1,0,1,3),
(@RefD,20678,0,1,0,1,3),
(@RefD,20552,0,1,0,1,3),
(@RefD,20676,0,1,1,1,3),
(@RefD,20541,0,1,1,1,3),
(@RefD,20545,0,1,1,1,3),
(@RefD,20679,0,1,1,1,3),
(@RefD,20677,0,1,1,1,3),
(@RefD,20678,0,1,1,1,3),
(@RefD,20552,0,1,1,1,3);

View File

@@ -33,7 +33,7 @@ BEGIN
KEY `idx_id` (`id`),
KEY `idx_oldguid_tmp` (`old_guid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Creature System' AUTO_INCREMENT=250001;
ALTER TABLE `creature_addon` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL;
ALTER TABLE `creature_formations` ADD COLUMN `new_guid_leader` INT(10) UNSIGNED NOT NULL;
ALTER TABLE `creature_formations` ADD COLUMN `new_guid_member` INT(10) UNSIGNED NOT NULL;
@@ -43,19 +43,6 @@ BEGIN
ALTER TABLE `game_event_npc_vendor` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL;
ALTER TABLE `game_event_npcflag` ADD COLUMN `new_guid` INT(10) UNSIGNED NOT NULL;
ALTER TABLE `smart_scripts` ADD COLUMN `new_guid` INT(10) NOT NULL;
INSERT INTO `creature_temp`
(
`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`,
`position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`,
`currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`,
`unit_flags`, `dynamicflags`, `old_guid`
) SELECT
`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`,
`position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`,
`currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`,
`unit_flags`, `dynamicflags`, `guid`
FROM `creature` WHERE `guid` < 250001 ORDER BY `id` ASC;
INSERT INTO `creature_temp`
(
@@ -68,8 +55,21 @@ BEGIN
`position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`,
`currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`,
`unit_flags`, `dynamicflags`, `guid`
FROM `creature` WHERE `guid` > 250000 ORDER BY `id` ASC;
FROM `creature` WHERE `guid` < 250001 ORDER BY `id` ASC;
INSERT INTO `creature_temp`
(
`guid`,`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`,
`position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`,
`currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`,
`unit_flags`, `dynamicflags`, `old_guid`
) SELECT
`guid`,`id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`,
`position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`,
`currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`,
`unit_flags`, `dynamicflags`, `guid`
FROM `creature` WHERE `guid` >= 250001 ORDER BY `id` ASC;
UPDATE game_event_npc_vendor p
INNER JOIN creature_temp pp
ON p.guid = pp.old_guid
@@ -109,11 +109,11 @@ BEGIN
WHERE
entryorguid < 0 AND
source_type = 0;
DROP TABLE `creature`;
ALTER TABLE `creature_temp` DROP COLUMN `old_guid`;
RENAME TABLE `creature_temp` TO `creature`;
ALTER TABLE game_event_npc_vendor DISABLE KEYS;
UPDATE `game_event_npc_vendor` SET `guid`=`new_guid`;
ALTER TABLE `game_event_npc_vendor` DROP COLUMN `new_guid`;