mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Loot/LootMgr.cpp
This commit is contained in:
215
sql/updates/world/2014_09_27_03_world.sql
Normal file
215
sql/updates/world/2014_09_27_03_world.sql
Normal file
@@ -0,0 +1,215 @@
|
||||
-- Alter creature_loot_template
|
||||
ALTER TABLE `creature_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `creature_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `creature_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `creature_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `creature_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `creature_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `creature_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `creature_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `creature_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter disenchant_loot_template
|
||||
ALTER TABLE `disenchant_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `disenchant_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `disenchant_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `disenchant_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `disenchant_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `disenchant_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `disenchant_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `disenchant_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `disenchant_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `disenchant_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter fishing_loot_template
|
||||
ALTER TABLE `fishing_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `fishing_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `fishing_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `fishing_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `fishing_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `fishing_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `fishing_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `fishing_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `fishing_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `fishing_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter gameobject_loot_template
|
||||
ALTER TABLE `gameobject_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `gameobject_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `gameobject_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `gameobject_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `gameobject_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `gameobject_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `gameobject_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `gameobject_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `gameobject_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter item_loot_template
|
||||
ALTER TABLE `item_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `item_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `item_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `item_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `item_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `item_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `item_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `item_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `item_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `item_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `item_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `item_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `item_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `item_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `item_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `item_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter mail_loot_template
|
||||
ALTER TABLE `mail_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `mail_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `mail_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `mail_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `mail_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `mail_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `mail_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `mail_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `mail_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `mail_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter milling_loot_template
|
||||
ALTER TABLE `milling_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `milling_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `milling_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `milling_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `milling_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `milling_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `milling_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `milling_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `milling_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `milling_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter pickpocketing_loot_template
|
||||
ALTER TABLE `pickpocketing_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `pickpocketing_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `pickpocketing_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `pickpocketing_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `pickpocketing_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `pickpocketing_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `pickpocketing_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter prospecting_loot_template
|
||||
ALTER TABLE `prospecting_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `prospecting_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `prospecting_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `prospecting_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `prospecting_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `prospecting_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `prospecting_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `prospecting_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `prospecting_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `prospecting_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter reference_loot_template
|
||||
ALTER TABLE `reference_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `reference_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `reference_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `reference_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `reference_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `reference_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `reference_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `reference_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `reference_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `reference_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter skinning_loot_template
|
||||
ALTER TABLE `skinning_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `skinning_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `skinning_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `skinning_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `skinning_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `skinning_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `skinning_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `skinning_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `skinning_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `skinning_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
|
||||
-- Alter spell_loot_template
|
||||
ALTER TABLE `spell_loot_template` DROP PRIMARY KEY;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `entry` `Entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `item` `Item` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `spell_loot_template` ADD COLUMN `Reference` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0 AFTER `Item`;
|
||||
UPDATE `spell_loot_template` SET `Reference` = `mincountOrRef` * -1 WHERE `mincountOrRef` < 0;
|
||||
UPDATE `spell_loot_template` SET `mincountOrRef` = 1 WHERE `Reference` > 0;
|
||||
ALTER TABLE `spell_loot_template` ADD COLUMN `QuestRequired` BOOL NOT NULL DEFAULT 0 AFTER `ChanceOrQuestChance`;
|
||||
UPDATE `spell_loot_template` SET `QuestRequired` = 1 WHERE `ChanceOrQuestChance` < 0;
|
||||
UPDATE `spell_loot_template` SET `ChanceOrQuestChance` = `ChanceOrQuestChance` * -1 WHERE `ChanceOrQuestChance` < 0;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `ChanceOrQuestChance` `Chance` FLOAT NOT NULL DEFAULT 100;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `lootmode` `LootMode` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `groupid` `GroupId` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `MinCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `spell_loot_template` CHANGE `maxcount` `MaxCount` TINYINT(3) UNSIGNED NOT NULL DEFAULT 1;
|
||||
ALTER TABLE `spell_loot_template` ADD COLUMN `Comment` VARCHAR(255) AFTER `MaxCount`;
|
||||
ALTER TABLE `spell_loot_template` ADD PRIMARY KEY (`Entry`,`Item`);
|
||||
@@ -133,7 +133,7 @@ uint32 LootStore::LoadLootTable()
|
||||
Clear();
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT entry, item, ChanceOrQuestChance, lootmode, groupid, mincountOrRef, maxcount FROM %s", GetName());
|
||||
QueryResult result = WorldDatabase.PQuery("SELECT Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount FROM %s", GetName());
|
||||
|
||||
if (!result)
|
||||
return 0;
|
||||
@@ -146,25 +146,27 @@ uint32 LootStore::LoadLootTable()
|
||||
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 item = fields[1].GetUInt32();
|
||||
float chanceOrQuestChance = fields[2].GetFloat();
|
||||
uint16 lootmode = fields[3].GetUInt16();
|
||||
uint8 group = fields[4].GetUInt8();
|
||||
int32 mincountOrRef = fields[5].GetInt32();
|
||||
int32 maxcount = fields[6].GetUInt8();
|
||||
uint32 reference = fields[2].GetUInt32();
|
||||
float chance = fields[3].GetFloat();
|
||||
bool needsquest = fields[4].GetBool();
|
||||
uint16 lootmode = fields[5].GetUInt16();
|
||||
uint8 groupid = fields[6].GetUInt8();
|
||||
int32 mincount = fields[7].GetUInt8();
|
||||
int32 maxcount = fields[8].GetUInt8();
|
||||
|
||||
if (maxcount > std::numeric_limits<uint8>::max())
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: MaxCount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max());
|
||||
continue; // error already printed to log/console.
|
||||
}
|
||||
|
||||
if (group >= 1 << 7) // it stored in 7 bit field
|
||||
if (groupid >= 1 << 7) // it stored in 7 bit field
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: group (%u) must be less %u - skipped", GetName(), entry, item, group, 1 << 7);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: GroupId (%u) must be less %u - skipped", GetName(), entry, item, groupid, 1 << 7);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LootStoreItem* storeitem = new LootStoreItem(item, chanceOrQuestChance, lootmode, group, mincountOrRef, maxcount);
|
||||
LootStoreItem* storeitem = new LootStoreItem(item, reference, chance, needsquest, lootmode, groupid, mincount, maxcount);
|
||||
|
||||
if (!storeitem->IsValid(*this, entry)) // Validity checks
|
||||
{
|
||||
@@ -173,7 +175,7 @@ uint32 LootStore::LoadLootTable()
|
||||
}
|
||||
|
||||
// Looking for the template of the entry
|
||||
// often entries are put together
|
||||
// often entries are put together
|
||||
if (m_LootTemplates.empty() || tab->first != entry)
|
||||
{
|
||||
// Searching the template (in case template Id changed)
|
||||
@@ -267,12 +269,12 @@ void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const
|
||||
{
|
||||
// all still listed ids isn't referenced
|
||||
for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr)
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d isn't %s and not referenced from loot, and thus useless.", GetName(), *itr, GetEntryName());
|
||||
}
|
||||
|
||||
void LootStore::ReportNotExistedId(uint32 id) const
|
||||
void LootStore::ReportNonExistingId(uint32 id) const
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName());
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d (%s) does not exist but is used as loot id in DB.", GetName(), id, GetEntryName());
|
||||
}
|
||||
|
||||
//
|
||||
@@ -286,7 +288,7 @@ bool LootStoreItem::Roll(bool rate) const
|
||||
if (chance >= 100.0f)
|
||||
return true;
|
||||
|
||||
if (mincountOrRef < 0) // reference case
|
||||
if (reference > 0) // reference case
|
||||
return roll_chance_f(chance* (rate ? sWorld->getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f));
|
||||
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
|
||||
@@ -299,47 +301,47 @@ bool LootStoreItem::Roll(bool rate) const
|
||||
// Checks correctness of values
|
||||
bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
|
||||
{
|
||||
if (mincountOrRef == 0)
|
||||
if (mincount == 0)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: wrong MinCount (%d) - skipped", store.GetName(), entry, itemid, mincount);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mincountOrRef > 0) // item (quest or non-quest) entry, maybe grouped
|
||||
if (reference == 0) // item (quest or non-quest) entry, maybe grouped
|
||||
{
|
||||
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid);
|
||||
if (!proto)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: item entry not listed in `item_template` - skipped", store.GetName(), entry, itemid);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chance == 0 && group == 0) // Zero chance is allowed for grouped entries only
|
||||
if (chance == 0 && groupid == 0) // Zero chance is allowed for grouped entries only
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: equal-chanced grouped entry, but group not defined - skipped", store.GetName(), entry, itemid);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chance != 0 && chance < 0.000001f) // loot with low chance
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: low chance (%f) - skipped",
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: low chance (%f) - skipped",
|
||||
store.GetName(), entry, itemid, chance);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (maxcount < mincountOrRef) // wrong max count
|
||||
if (maxcount < mincount) // wrong max count
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: MaxCount (%u) less that MinCount (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincount);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else // mincountOrRef < 0
|
||||
else // if reference loot
|
||||
{
|
||||
if (needs_quest)
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: quest chance will be treated as non-quest chance", store.GetName(), entry, itemid);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: quest required will be ignored", store.GetName(), entry, itemid);
|
||||
else if (chance == 0) // no chance for the reference
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' entry %d item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
|
||||
TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d Item %d: zero chance is specified for a reference, skipped", store.GetName(), entry, itemid);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -417,7 +419,7 @@ void Loot::AddItem(LootStoreItem const& item)
|
||||
if (!proto)
|
||||
return;
|
||||
|
||||
uint32 count = urand(item.mincountOrRef, item.maxcount);
|
||||
uint32 count = urand(item.mincount, item.maxcount);
|
||||
uint32 stacks = count / proto->GetMaxStackSize() + ((count % proto->GetMaxStackSize()) ? 1 : 0);
|
||||
|
||||
std::vector<LootItem>& lootItems = item.needs_quest ? quest_items : items;
|
||||
@@ -1218,24 +1220,24 @@ void LootTemplate::LootGroup::CheckLootRefs(LootTemplateMap const& /*store*/, Lo
|
||||
for (LootStoreItemList::const_iterator ieItr = ExplicitlyChanced.begin(); ieItr != ExplicitlyChanced.end(); ++ieItr)
|
||||
{
|
||||
LootStoreItem* item = *ieItr;
|
||||
if (item->mincountOrRef < 0)
|
||||
if (item->reference > 0)
|
||||
{
|
||||
if (!LootTemplates_Reference.GetLootFor(-item->mincountOrRef))
|
||||
LootTemplates_Reference.ReportNotExistedId(-item->mincountOrRef);
|
||||
if (!LootTemplates_Reference.GetLootFor(item->reference))
|
||||
LootTemplates_Reference.ReportNonExistingId(item->reference);
|
||||
else if (ref_set)
|
||||
ref_set->erase(-item->mincountOrRef);
|
||||
ref_set->erase(item->reference);
|
||||
}
|
||||
}
|
||||
|
||||
for (LootStoreItemList::const_iterator ieItr = EqualChanced.begin(); ieItr != EqualChanced.end(); ++ieItr)
|
||||
{
|
||||
LootStoreItem* item = *ieItr;
|
||||
if (item->mincountOrRef < 0)
|
||||
if (item->reference > 0)
|
||||
{
|
||||
if (!LootTemplates_Reference.GetLootFor(-item->mincountOrRef))
|
||||
LootTemplates_Reference.ReportNotExistedId(-item->mincountOrRef);
|
||||
if (!LootTemplates_Reference.GetLootFor(item->reference))
|
||||
LootTemplates_Reference.ReportNonExistingId(item->reference);
|
||||
else if (ref_set)
|
||||
ref_set->erase(-item->mincountOrRef);
|
||||
ref_set->erase(item->reference);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1256,16 +1258,16 @@ LootTemplate::~LootTemplate()
|
||||
// Adds an entry to the group (at loading stage)
|
||||
void LootTemplate::AddEntry(LootStoreItem* item)
|
||||
{
|
||||
if (item->group > 0 && item->mincountOrRef > 0) // Group
|
||||
if (item->groupid > 0 && item->reference == 0) // Group
|
||||
{
|
||||
if (item->group >= Groups.size())
|
||||
Groups.resize(item->group, NULL); // Adds new group the the loot template if needed
|
||||
if (!Groups[item->group - 1])
|
||||
Groups[item->group - 1] = new LootGroup();
|
||||
if (item->groupid >= Groups.size())
|
||||
Groups.resize(item->groupid, NULL); // Adds new group the the loot template if needed
|
||||
if (!Groups[item->groupid - 1])
|
||||
Groups[item->groupid - 1] = new LootGroup();
|
||||
|
||||
Groups[item->group-1]->AddEntry(item); // Adds new entry to the group
|
||||
Groups[item->groupid - 1]->AddEntry(item); // Adds new entry to the group
|
||||
}
|
||||
else // Non-grouped entries and references are stored together
|
||||
else // Non-grouped entries and references are stored together
|
||||
Entries.push_back(item);
|
||||
}
|
||||
|
||||
@@ -1304,7 +1306,7 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId
|
||||
if (!Groups[groupId - 1])
|
||||
return;
|
||||
|
||||
Groups[groupId-1]->Process(loot, lootMode);
|
||||
Groups[groupId - 1]->Process(loot, lootMode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1318,15 +1320,15 @@ void LootTemplate::Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId
|
||||
if (!item->Roll(rate))
|
||||
continue; // Bad luck for the entry
|
||||
|
||||
if (item->mincountOrRef < 0) // References processing
|
||||
if (item->reference > 0) // References processing
|
||||
{
|
||||
LootTemplate const* Referenced = LootTemplates_Reference.GetLootFor(-item->mincountOrRef);
|
||||
LootTemplate const* Referenced = LootTemplates_Reference.GetLootFor(item->reference);
|
||||
if (!Referenced)
|
||||
continue; // Error message already printed at loading stage
|
||||
|
||||
uint32 maxcount = uint32(float(item->maxcount) * sWorld->getRate(RATE_DROP_ITEM_REFERENCED_AMOUNT));
|
||||
for (uint32 loop = 0; loop < maxcount; ++loop) // Ref multiplicator
|
||||
Referenced->Process(loot, rate, lootMode, item->group);
|
||||
Referenced->Process(loot, rate, lootMode, item->groupid);
|
||||
}
|
||||
else // Plain entries (not a reference, not grouped)
|
||||
loot.AddItem(*item); // Chance is already checked, just add
|
||||
@@ -1355,12 +1357,12 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con
|
||||
for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i)
|
||||
{
|
||||
LootStoreItem* item = *i;
|
||||
if (item->mincountOrRef < 0) // References
|
||||
if (item->reference > 0) // References
|
||||
{
|
||||
LootTemplateMap::const_iterator Referenced = store.find(-item->mincountOrRef);
|
||||
LootTemplateMap::const_iterator Referenced = store.find(item->reference);
|
||||
if (Referenced == store.end())
|
||||
continue; // Error message [should be] already printed at loading stage
|
||||
if (Referenced->second->HasQuestDrop(store, item->group))
|
||||
if (Referenced->second->HasQuestDrop(store, item->groupid))
|
||||
return true;
|
||||
}
|
||||
else if (item->needs_quest)
|
||||
@@ -1387,19 +1389,19 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co
|
||||
if (!Groups[groupId - 1])
|
||||
return false;
|
||||
|
||||
return Groups[groupId-1]->HasQuestDropForPlayer(player);
|
||||
return Groups[groupId - 1]->HasQuestDropForPlayer(player);
|
||||
}
|
||||
|
||||
// Checking non-grouped entries
|
||||
for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i)
|
||||
{
|
||||
LootStoreItem* item = *i;
|
||||
if (item->mincountOrRef < 0) // References processing
|
||||
if (item->reference > 0) // References processing
|
||||
{
|
||||
LootTemplateMap::const_iterator Referenced = store.find(-item->mincountOrRef);
|
||||
LootTemplateMap::const_iterator Referenced = store.find(item->reference);
|
||||
if (Referenced == store.end())
|
||||
continue; // Error message already printed at loading stage
|
||||
if (Referenced->second->HasQuestDropForPlayer(store, player, item->group))
|
||||
if (Referenced->second->HasQuestDropForPlayer(store, player, item->groupid))
|
||||
return true;
|
||||
}
|
||||
else if (player->HasQuestForItem(item->itemid))
|
||||
@@ -1431,12 +1433,12 @@ void LootTemplate::CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_se
|
||||
for (LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
|
||||
{
|
||||
LootStoreItem* item = *ieItr;
|
||||
if (item->mincountOrRef < 0)
|
||||
if (item->reference > 0)
|
||||
{
|
||||
if (!LootTemplates_Reference.GetLootFor(-item->mincountOrRef))
|
||||
LootTemplates_Reference.ReportNotExistedId(-item->mincountOrRef);
|
||||
if (!LootTemplates_Reference.GetLootFor(item->reference))
|
||||
LootTemplates_Reference.ReportNonExistingId(item->reference);
|
||||
else if (ref_set)
|
||||
ref_set->erase(-item->mincountOrRef);
|
||||
ref_set->erase(item->reference);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1506,7 +1508,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
|
||||
bool LootTemplate::isReference(uint32 id)
|
||||
{
|
||||
for (LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
|
||||
if ((*ieItr)->itemid == id && (*ieItr)->mincountOrRef < 0)
|
||||
if ((*ieItr)->itemid == id && (*ieItr)->reference > 0)
|
||||
return true;
|
||||
|
||||
return false;//not found or not reference
|
||||
@@ -1528,7 +1530,7 @@ void LoadLootTemplates_Creature()
|
||||
if (uint32 lootid = itr->second.lootid)
|
||||
{
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Creature.ReportNotExistedId(lootid);
|
||||
LootTemplates_Creature.ReportNonExistingId(lootid);
|
||||
else
|
||||
lootIdSetUsed.insert(lootid);
|
||||
}
|
||||
@@ -1563,7 +1565,7 @@ void LoadLootTemplates_Disenchant()
|
||||
|
||||
uint32 lootid = disenchant->Id;
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Disenchant.ReportNotExistedId(lootid);
|
||||
LootTemplates_Disenchant.ReportNonExistingId(lootid);
|
||||
else
|
||||
lootIdSetUsed.insert(lootid);
|
||||
}
|
||||
@@ -1620,7 +1622,7 @@ void LoadLootTemplates_Gameobject()
|
||||
if (uint32 lootid = itr->second.GetLootId())
|
||||
{
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Gameobject.ReportNotExistedId(lootid);
|
||||
LootTemplates_Gameobject.ReportNonExistingId(lootid);
|
||||
else
|
||||
lootIdSetUsed.insert(lootid);
|
||||
}
|
||||
@@ -1707,7 +1709,7 @@ void LoadLootTemplates_Pickpocketing()
|
||||
if (uint32 lootid = itr->second.pickpocketLootId)
|
||||
{
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Pickpocketing.ReportNotExistedId(lootid);
|
||||
LootTemplates_Pickpocketing.ReportNonExistingId(lootid);
|
||||
else
|
||||
lootIdSetUsed.insert(lootid);
|
||||
}
|
||||
@@ -1794,7 +1796,7 @@ void LoadLootTemplates_Skinning()
|
||||
if (uint32 lootid = itr->second.SkinLootId)
|
||||
{
|
||||
if (lootIdSet.find(lootid) == lootIdSet.end())
|
||||
LootTemplates_Skinning.ReportNotExistedId(lootid);
|
||||
LootTemplates_Skinning.ReportNonExistingId(lootid);
|
||||
else
|
||||
lootIdSetUsed.insert(lootid);
|
||||
}
|
||||
@@ -1838,7 +1840,7 @@ void LoadLootTemplates_Spell()
|
||||
// ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example
|
||||
if (!(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT) || (spellInfo->Attributes & SPELL_ATTR0_TRADESPELL))
|
||||
{
|
||||
LootTemplates_Spell.ReportNotExistedId(spell_id);
|
||||
LootTemplates_Spell.ReportNonExistingId(spell_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -125,19 +125,20 @@ class LootStore;
|
||||
struct LootStoreItem
|
||||
{
|
||||
uint32 itemid; // id of the item
|
||||
float chance; // always positive, chance to drop for both quest and non-quest items, chance to be used for refs
|
||||
int32 mincountOrRef; // mincount for drop items (positive) or minus referenced TemplateleId (negative)
|
||||
uint32 reference; // referenced TemplateleId
|
||||
float chance; // chance to drop for both quest and non-quest items, chance to be used for refs
|
||||
bool needs_quest : 1; // quest drop (quest is required for item to drop)
|
||||
uint16 lootmode;
|
||||
uint8 group :7;
|
||||
bool needs_quest :1; // quest drop (negative ChanceOrQuestChance in DB)
|
||||
uint8 maxcount :8; // max drop count for the item (mincountOrRef positive) or Ref multiplicator (mincountOrRef negative)
|
||||
uint8 groupid : 7;
|
||||
uint8 mincount; // mincount for drop items
|
||||
uint8 maxcount : 8; // max drop count for the item mincount or Ref multiplicator
|
||||
ConditionList conditions; // additional loot condition
|
||||
|
||||
// Constructor, converting ChanceOrQuestChance -> (chance, needs_quest)
|
||||
// Constructor
|
||||
// displayid is filled in IsValid() which must be called after
|
||||
LootStoreItem(uint32 _itemid, float _chanceOrQuestChance, uint16 _lootmode, uint8 _group, int32 _mincountOrRef, uint8 _maxcount)
|
||||
: itemid(_itemid), chance(std::fabs(_chanceOrQuestChance)), mincountOrRef(_mincountOrRef), lootmode(_lootmode),
|
||||
group(_group), needs_quest(_chanceOrQuestChance < 0), maxcount(_maxcount)
|
||||
LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount)
|
||||
: itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest),
|
||||
lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount)
|
||||
{ }
|
||||
|
||||
bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation)
|
||||
@@ -165,7 +166,7 @@ struct LootItem
|
||||
bool canSave;
|
||||
|
||||
// Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties
|
||||
// Should be called for non-reference LootStoreItem entries only (mincountOrRef > 0)
|
||||
// Should be called for non-reference LootStoreItem entries only (reference = 0)
|
||||
explicit LootItem(LootStoreItem const& li);
|
||||
|
||||
// Empty constructor for creating an empty LootItem to be filled in with DB data
|
||||
@@ -215,7 +216,7 @@ class LootStore
|
||||
uint32 LoadAndCollectLootIds(LootIdSet& ids_set);
|
||||
void CheckLootRefs(LootIdSet* ref_set = NULL) const; // check existence reference and remove it from ref_set
|
||||
void ReportUnusedIds(LootIdSet const& ids_set) const;
|
||||
void ReportNotExistedId(uint32 id) const;
|
||||
void ReportNonExistingId(uint32 id) const;
|
||||
|
||||
bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); }
|
||||
bool HaveQuestLootFor(uint32 loot_id) const;
|
||||
|
||||
Reference in New Issue
Block a user