arcemu/arcemu — pull request #2 by MesoX (2011-11-08 20:33:00+00:00)
Title: Implemented few new item flags

What does this patch fix:

At first I've updated enum with Item Flags (they were old/not correct). Then I've started to implementing some of those item flags and found, that column Faction in items table (added somewhere aroud 3.3.0) should be rather called flags2, so I've added enum for them too (thanks MaNGOS).

Newly implemented flags:

* ITEM_FLAG_INDESTRUCTIBLE
* ITEM_FLAG_FREE_FOR_ALL
* ITEM_FLAG_USEABLE_IN_ARENA
* ITEM_FLAG2_HORDE_ONLY
* ITEM_FLAG2_ALLIANCE_ONLY
* ITEM_FLAG2_EXT_COST_REQUIRES_GOLD

A part of ITEM_FLAG_FREE_FOR_ALL is removing ffa_loot columns, which are now useless, since ffa is checked from item flags.

How to reproduce?
ITEM_FLAG_INDESTRUCTIBLE - get any of shaman's totem and try to destroy it from inventory.
ITEM_FLAG_FREE_FOR_ALL - make group of at least 2 people, spawn creature/go which has in loot item, which is ffa, kill/open go, loot teh item with 1 person and then try to loot same item with second person.
ITEM_FLAG_USEABLE_IN_ARENA - http://www.wowhead.com/items?filter=cr=155;crs=1;crv=0 these are only items usable in arena. try to get any other consumable item and use it during arena match.
ITEM_FLAG2_HORDE_ONLY + ITEM_FLAG2_ALLIANCE_ONLY - SELECT * FROM `items` WHERE `flags2` & 1; checks in database for horde items only, then you may try to add any of those items to any creature's loot (with 100% chance) and try to kill & loot this creature with ally player. You should never get this item.
ITEM_FLAG2_EXT_COST_REQUIRES_GOLD - This fixes weird thing about extended costs. There are many items which have normal buyprice and 2 vendors are selling them. First on retail should sells this item just for money and second just for extended cost. Current problem is that normal buyprice is added to every vendor, so second vendor will sell this item for extended cost + money. This flag however marks those items, which should use both extended cost and money for selling (like this http://www.wowhead.com/item=17348).

Here is the required SQL update:

ALTER TABLE `items` CHANGE `faction` `flags2` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `loot_creatures` DROP `ffa_loot`;
ALTER TABLE `loot_fishing` DROP `ffa_loot`;
ALTER TABLE `loot_gameobjects` DROP `ffa_loot`;
ALTER TABLE `loot_items` DROP `ffa_loot`;
ALTER TABLE `loot_pickpocketing` DROP `ffa_loot`;
ALTER TABLE `loot_skinning` DROP `ffa_loot`;