From 04f08d26a72ab29b11fc2aaef65bc54078cc2086 Mon Sep 17 00:00:00 2001
From: MrSmite <mrsmite@att.net>
Date: Fri, 14 Dec 2012 00:46:36 -0500
Subject: Implements saving of loot (items / money) contained inside lootable
 inventory items.

* Unlooted items / money persist across player sessions
* Loot inside items is tied to the item rather than the player so if trading
  partially looted items becomes possible, this implementation will still work

* New tables added:

    characters_database.sql (first time users)
    characters_create_item_loot.sql (existing users)

Implementation Can be tested with:

 Watertight Trunk [21113]
 Bulging Sack of Gems [25422]
 Fat Sack of Coins [11937]

Closes #2048
---
 sql/base/characters_database.sql | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

(limited to 'sql/base/characters_database.sql')

diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index d8cdd409bf7..9e16db1f381 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -1954,6 +1954,41 @@ LOCK TABLES `item_instance` WRITE;
 /*!40000 ALTER TABLE `item_instance` ENABLE KEYS */;
 UNLOCK TABLES;
 
+--
+-- Table structure for table `item_loot_items`
+--
+
+DROP TABLE IF EXISTS `item_loot_items`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `item_loot_items` (
+  `container_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'guid of container (item_instance.guid)',
+  `item_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'loot item entry (item_instance.itemEntry)',
+  `item_count` int(10) NOT NULL DEFAULT '0' COMMENT 'stack size',
+  `follow_rules` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'follow loot rules',
+  `ffa` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'free-for-all',
+  `blocked` tinyint(1) NOT NULL DEFAULT '0',
+  `counted` tinyint(1) NOT NULL DEFAULT '0',
+  `under_threshold` tinyint(1) NOT NULL DEFAULT '0',
+  `needs_quest` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'quest drop',
+  `rnd_prop` int(10) NOT NULL DEFAULT '0' COMMENT 'random enchantment added when originally rolled',
+  `rnd_suffix` int(10) NOT NULL DEFAULT '0' COMMENT 'random suffix added when originally rolled'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `item_loot_money`
+--
+
+DROP TABLE IF EXISTS `item_loot_money`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `item_loot_money` (
+  `container_id` int(10) NOT NULL DEFAULT '0' COMMENT 'guid of container (item_instance.guid)',
+  `money` int(10) NOT NULL DEFAULT '0' COMMENT 'money loot (in copper)'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
 --
 -- Table structure for table `item_refund_instance`
 --
-- 
cgit v1.2.3

