DROP TABLE IF EXISTS loot_global;
CREATE TABLE loot_global (
	id         INTEGER PRIMARY KEY,
	type       TEXT NOT NULL DEFAULT 'Zone',
	loot_table INTEGER NOT NULL,
	value1     INTEGER NOT NULL DEFAULT 0,
	value2     INTEGER NOT NULL DEFAULT 0,
	value3     INTEGER NOT NULL DEFAULT 0,
	value4     INTEGER NOT NULL DEFAULT 0,
	FOREIGN KEY (loot_table) REFERENCES loottable(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE INDEX idx_loot_global_loot_table ON loot_global(loot_table);

INSERT INTO loot_global VALUES
(1,'Zone',100,253,0,0,0),
(5,'Zone',130,278,0,0,0),
(17,'Zone',158,239,0,0,0),
(18,'Zone',163,121,0,0,0),
(19,'Zone',178,108,0,0,0),
(20,'Zone',181,117,0,0,0),
(21,'Zone',182,73,0,0,0),
(22,'Zone',191,263,0,0,0),
(23,'Zone',199,385,0,0,0),
(24,'Zone',200,261,0,0,0),
(25,'Zone',212,265,0,0,0),
(26,'Zone',215,273,0,0,0),
(28,'Zone',216,269,0,0,0),
(29,'Zone',217,89,0,0,0),
(30,'Zone',229,386,0,0,0),
(31,'Zone',230,480,0,0,0),
(32,'Zone',231,398,0,0,0),
(33,'Zone',232,396,0,0,0),
(34,'Zone',233,481,0,0,0),
(35,'Zone',234,465,0,0,0),
(36,'Zone',235,464,0,0,0),
(37,'Zone',275,453,0,0,0),
(38,'Zone',276,457,0,0,0),
(39,'Zone',277,610,0,0,0),
(40,'Zone',278,612,0,0,0),
(41,'Zone',279,488,0,0,0),
(42,'Zone',280,551,0,0,0),
(43,'Zone',281,484,0,0,0),
(44,'Zone',282,486,0,0,0),
(45,'Zone',283,543,0,0,0),
(46,'Zone',284,614,0,0,0),
(50,'Zone',177,470,0,0,0),
(53,'Zone',201,258,0,0,0),
(54,'Zone',167,154,0,0,0),
(55,'Zone',175,34,0,0,0),
(81,'Level',50,1,4,0,0),
(82,'Level',46,5,9,0,0),
(83,'Level',47,10,14,0,0),
(84,'Level',48,15,19,0,0),
(85,'Level',52,20,24,0,0),
(86,'Level',53,25,29,0,0),
(87,'Level',90,1,9,0,0),
(88,'Level',56,30,34,0,0),
(89,'Level',57,35,39,0,0),
(90,'Level',91,10,19,0,0),
(91,'Level',60,40,44,0,0),
(92,'Level',61,45,49,0,0),
(93,'Level',92,20,29,0,0),
(94,'Level',66,50,54,0,0),
(95,'Level',67,55,59,0,0),
(96,'Level',93,30,39,0,0),
(97,'Level',68,60,64,0,0),
(98,'Level',69,65,69,0,0),
(99,'Level',94,40,49,0,0),
(100,'Level',72,70,74,0,0),
(101,'Level',95,50,59,0,0),
(102,'Level',75,75,79,0,0),
(103,'Level',76,80,84,0,0),
(104,'Level',77,85,89,0,0),
(105,'Level',96,60,69,0,0),
(106,'Level',97,70,79,0,0),
(107,'Level',1854,1,4,0,0),
(108,'Level',1855,5,9,0,0),
(109,'Level',103,10,14,0,0),
(110,'Level',98,80,89,0,0),
(111,'Level',104,15,19,0,0),
(112,'Level',105,20,24,0,0),
(113,'Level',106,25,29,0,0),
(114,'Level',107,30,34,0,0),
(115,'Level',108,35,39,0,0),
(116,'Level',109,40,44,0,0),
(117,'Level',110,45,49,0,0),
(118,'Level',99,90,99,0,0),
(119,'Level',111,50,54,0,0),
(120,'Level',112,55,59,0,0),
(121,'Level',113,60,64,0,0),
(122,'Level',81,10,19,0,0),
(123,'Level',114,65,69,0,0),
(124,'Level',115,70,74,0,0),
(125,'Level',82,20,29,0,0),
(126,'Level',116,75,79,0,0),
(127,'Level',117,80,84,0,0),
(128,'Level',118,85,89,0,0),
(129,'Level',83,30,39,0,0),
(131,'Level',84,40,49,0,0),
(132,'Level',49,10,19,0,0),
(133,'Level',54,20,24,0,0),
(134,'Level',55,25,29,0,0),
(135,'Level',85,50,59,0,0),
(136,'Level',58,30,34,0,0),
(137,'Level',59,35,39,0,0),
(138,'Level',62,40,44,0,0),
(139,'Level',86,60,69,0,0),
(140,'Level',63,45,49,0,0),
(141,'Level',64,50,54,0,0),
(142,'Level',65,55,59,0,0),
(143,'Level',87,70,79,0,0),
(144,'Level',70,60,64,0,0),
(145,'Level',71,65,69,0,0),
(146,'Level',88,80,89,0,0),
(147,'Level',73,75,79,0,0),
(148,'Level',89,90,99,0,0),
(149,'Level',78,80,84,0,0),
(151,'Racial',24,300,1,100,0),
(152,'Zone',119,33,0,0,0),
(153,'Racial',33,317,1,100,0),
(154,'Racial',23,298,1,100,0),
(155,'Racial',28,313,1,100,0),
(156,'Racial',6,281,1,100,0),
(157,'Racial',27,137,1,100,0),
(158,'Racial',32,246,1,100,0),
(159,'Racial',17,249,1,100,0),
(160,'Racial',22,258,1,100,0),
(161,'Racial',10,245,1,100,0),
(162,'Racial',19,253,1,100,0),
(163,'Racial',9,156,1,100,0),
(164,'Racial',11,287,1,100,0),
(165,'Racial',39,121,1,100,0),
(166,'Racial',13,288,1,100,0),
(167,'Racial',29,314,1,100,0),
(168,'Racial',16,290,1,100,0),
(169,'Racial',42,332,1,100,0),
(170,'Racial',30,315,1,100,0),
(171,'Racial',15,105,1,100,0),
(172,'Racial',34,320,1,100,0),
(173,'Racial',36,260,1,100,0),
(174,'Racial',38,340,1,100,0),
(175,'Racial',43,343,1,100,0),
(176,'Racial',8,283,1,100,0),
(177,'Racial',21,334,1,100,0),
(178,'Racial',12,247,1,100,0),
(179,'Racial',14,104,1,100,0),
(180,'Racial',37,118,1,100,0),
(181,'Racial',31,143,1,100,0),
(182,'Racial',35,322,1,100,0),
(183,'Racial',20,117,1,100,0),
(184,'Racial',7,282,1,100,0),
(185,'Racial',4,280,1,100,0),
(186,'Racial',26,301,1,100,0),
(187,'Racial',5,114,1,100,0),
(188,'Zone',169,155,0,0,0),
(189,'Zone',1947,201,1,100,0),
(190,'Zone',162,195,4,15,0),
(191,'Zone',1974,256,1,50,0),
(192,'Zone',121,196,1,30,0),
(193,'Zone',161,196,1,30,0),
(194,'Zone',159,119,0,0,0),
(195,'Zone',186,114,0,0,0),
(197,'Zone',128,33,0,0,0),
(198,'Zone',165,179,0,0,0),
(199,'Zone',164,249,0,0,0),
(200,'Zone',166,39,0,0,0),
(201,'Zone',174,41,0,0,0),
(202,'Zone',172,171,0,0,0),
(203,'Zone',187,115,0,0,0),
(204,'Zone',189,70,0,0,0),
(205,'Zone',179,88,0,0,0),
(206,'Zone',183,85,0,0,0),
(207,'Zone',190,116,0,0,0),
(208,'Zone',180,87,0,0,0),
(209,'Zone',194,262,0,0,0),
(210,'Zone',192,264,0,0,0),
(211,'Zone',1364,623,0,0,0),
(213,'Zone',170,15,0,0,0),
(214,'Zone',184,91,0,0,0),
(215,'Zone',196,99,0,0,0),
(216,'Zone',265,242,0,0,0),
(217,'Zone',202,189,0,0,0),
(218,'Zone',198,28,0,0,0),
(219,'Zone',173,192,0,0,0),
(220,'Zone',204,101,0,0,0),
(221,'Zone',205,61,0,0,0),
(222,'Zone',206,62,0,0,0),
(223,'Zone',220,814,0,0,0),
(224,'Zone',207,68,0,0,0),
(225,'Zone',208,95,0,0,0),
(226,'Zone',209,79,0,0,0),
(227,'Zone',211,82,0,0,0),
(228,'Zone',213,104,0,0,0),
(229,'Zone',254,94,0,0,0),
(230,'Zone',218,270,0,0,0),
(231,'Zone',219,455,0,0,0),
(232,'Zone',224,35,0,0,0),
(233,'Zone',265,242,0,0,0),
(234,'Zone',257,259,0,0,0),
(235,'Zone',240,513,0,0,0),
(236,'Zone',1836,200,0,0,0),
(237,'Zone',168,156,0,0,0),
(238,'Zone',137,124,0,0,0),
(239,'Zone',160,198,0,0,0),
(240,'Zone',1886,125,0,0,0),
(241,'Zone',261,303,0,0,0),
(242,'Zone',171,197,0,0,0),
(243,'Zone',210,7,0,0,0),
(244,'Zone',221,32,0,0,0),
(245,'Zone',222,642,0,0,0),
(246,'Zone',226,172,0,0,0),
(247,'Zone',243,601,0,0,0),
(248,'Zone',244,600,0,0,0),
(249,'Zone',246,64,0,0,0),
(250,'Zone',247,93,0,0,0),
(253,'Zone',242,103,0,0,0),
(254,'Zone',251,107,0,0,0),
(255,'Zone',266,76,0,0,0),
(256,'Zone',253,106,0,0,0),
(257,'Zone',255,332,0,0,0),
(258,'Zone',256,560,0,0,0),
(259,'Zone',263,296,0,0,0),
(260,'Zone',268,407,0,0,0),
(261,'Zone',264,267,0,0,0),
(262,'Zone',288,81,0,0,0),
(263,'Racial',2002,263,1,100,0),
(264,'Racial',2003,115,1,100,0),
(268,'Level',1995,0,0,0,1),
(269,'Level',2012,0,0,0,1),
(270,'Level',2013,0,0,0,1),
(271,'Level',2014,0,0,0,2),
(272,'Level',2004,0,0,0,2),
(273,'Level',1979,0,0,0,2),
(274,'Level',2022,0,0,0,3),
(275,'Level',2015,0,0,0,3),
(276,'Level',2005,0,0,0,3),
(277,'Zone',2053,325,3,10,0),
(278,'Level',1873,1,9,0,0),
(279,'Level',1874,1,9,0,0),
(280,'Zone',2102,826,0,0,0),
(282,'Zone',2112,325,3,10,0),
(283,'Zone',2102,827,0,0,0),
(284,'Zone',2114,826,0,0,0),
(285,'Zone',2114,827,0,0,0),
(286,'Racial',2092,300,1,9,0),
(287,'Racial',2105,298,1,9,0),
(290,'Zone',1952,830,0,0,0),
(291,'Racial',2119,298,1,100,0),
(292,'Racial',2120,117,1,100,0),
(293,'Racial',2118,300,1,100,0),
(295,'Zone',2102,829,0,0,0),
(296,'Zone',2114,829,0,0,0),
(297,'Zone',2165,829,0,0,0),
(298,'Zone',2165,829,0,0,0),
(299,'Zone',2166,829,0,0,0),
(300,'Zone',2102,834,0,0,0),
(301,'Zone',2114,834,0,0,0),
(303,'Zone',2171,12,0,0,0),
(304,'Zone',2174,834,0,0,0),
(305,'Zone',2174,830,0,0,0),
(306,'Zone',2174,827,0,0,0),
(307,'Zone',2174,829,0,0,0),
(308,'Zone',2174,826,0,0,0),
(309,'Zone',2177,12,10,14,0),
(310,'Zone',2178,12,15,19,0),
(311,'Zone',2179,12,10,14,0),
(312,'Zone',2180,12,15,19,0),
(313,'Zone',2215,12,8,16,0),
(314,'Zone',2177,17,10,14,0),
(315,'Zone',2178,17,15,19,0),
(316,'Zone',2179,17,10,14,0),
(317,'Zone',2180,17,15,19,0),
(318,'Zone',2227,17,0,0,0),
(319,'Zone',2225,17,0,0,0),
(320,'Zone',2226,17,0,0,0),
(321,'Zone',2228,17,0,0,0),
(322,'Zone',2229,17,0,0,0),
(323,'Zone',2230,17,0,0,0),
(324,'Zone',2231,830,0,0,0),
(325,'Zone',2232,830,0,0,0),
(326,'Zone',2233,830,0,0,0),
(327,'Zone',2234,830,0,0,0),
(328,'Zone',2235,830,0,0,0),
(329,'Zone',2236,830,0,0,0),
(330,'Zone',2231,829,0,0,0),
(331,'Zone',2232,829,0,0,0),
(332,'Zone',2233,829,0,0,0),
(333,'Zone',2234,829,0,0,0),
(334,'Zone',2235,829,0,0,0),
(335,'Zone',2236,829,0,0,0),
(336,'Zone',2231,827,0,0,0),
(337,'Zone',2232,827,0,0,0),
(338,'Zone',2233,827,0,0,0),
(339,'Zone',2234,827,0,0,0),
(340,'Zone',2235,827,0,0,0),
(341,'Zone',2236,827,0,0,0),
(342,'Zone',2231,834,0,0,0),
(343,'Zone',2232,834,0,0,0),
(344,'Zone',2233,834,0,0,0),
(345,'Zone',2234,834,0,0,0),
(346,'Zone',2235,834,0,0,0),
(347,'Zone',2236,834,0,0,0),
(348,'Zone',2231,826,0,0,0),
(349,'Zone',2232,826,0,0,0),
(350,'Zone',2233,826,0,0,0),
(351,'Zone',2234,826,0,0,0),
(352,'Zone',2235,826,0,0,0),
(353,'Zone',2236,826,0,0,0),
(354,'Zone',2239,12,0,0,0),
(355,'Zone',2237,12,0,0,0),
(356,'Zone',2238,12,0,0,0),
(357,'Zone',2240,12,0,0,0),
(358,'Zone',2241,12,0,0,0),
(359,'Zone',2242,12,0,0,0),
(360,'Zone',2102,842,0,0,0),
(361,'Zone',2114,842,0,0,0),
(362,'Zone',2231,842,0,0,0),
(363,'Zone',2232,842,0,0,0),
(364,'Zone',2233,842,0,0,0),
(365,'Zone',2234,842,0,0,0),
(366,'Zone',2235,842,0,0,0),
(367,'Zone',2236,842,0,0,0),
(368,'Zone',124,834,0,0,0),
(369,'Zone',2102,841,0,0,0),
(370,'Zone',2114,841,0,0,0),
(371,'Zone',2231,841,0,0,0),
(372,'Zone',2232,841,0,0,0),
(373,'Zone',2233,841,0,0,0),
(374,'Zone',2234,841,0,0,0),
(375,'Zone',2235,841,0,0,0),
(376,'Zone',2236,841,0,0,0),
(377,'Zone',2177,33,10,14,0),
(378,'Zone',2178,33,15,20,0),
(379,'Zone',2179,33,10,14,0),
(380,'Zone',2180,33,15,20,0),
(381,'Zone',2237,33,0,0,0),
(382,'Zone',2238,33,0,0,0),
(383,'Zone',2239,33,0,0,0),
(384,'Zone',2240,33,0,0,0),
(385,'Zone',2241,33,0,0,0),
(386,'Zone',2242,33,0,0,0),
(387,'Level',2326,20,29,0,0),
(388,'Level',2327,20,29,0,0),
(389,'Level',2328,20,29,0,0),
(390,'Level',2329,20,29,0,0),
(391,'Level',2330,20,29,0,0),
(392,'Level',2331,20,29,0,0);
