Core/Items: Implemented trading soulbound loot items
Core/DBLayer: Converted more more player-related queries into prepared statements Core/Items: Fixed loading of enchantments Closes issue #4130. --HG-- branch : trunk
This commit is contained in:
@@ -381,6 +381,11 @@ bool LootItem::AllowedForPlayer(Player const * player) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void LootItem::AddAllowedLooter(const Player *player)
|
||||
{
|
||||
allowedGUIDs.insert(player->GetGUIDLow());
|
||||
}
|
||||
|
||||
//
|
||||
// --------- Loot ---------
|
||||
//
|
||||
@@ -557,13 +562,17 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player)
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
LootItem &item = items[i];
|
||||
if (!item.is_looted && !item.freeforall && !item.conditions.empty() && item.AllowedForPlayer(player))
|
||||
if (!item.is_looted && !item.freeforall && item.AllowedForPlayer(player))
|
||||
{
|
||||
ql->push_back(QuestItem(i));
|
||||
if (!item.is_counted)
|
||||
item.AddAllowedLooter(player);
|
||||
if (!item.conditions.empty())
|
||||
{
|
||||
++unlootedCount;
|
||||
item.is_counted = true;
|
||||
ql->push_back(QuestItem(i));
|
||||
if (!item.is_counted)
|
||||
{
|
||||
++unlootedCount;
|
||||
item.is_counted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,12 +124,15 @@ struct LootStoreItem
|
||||
// Checks correctness of values
|
||||
};
|
||||
|
||||
typedef std::set<uint32> AllowedLooterSet;
|
||||
|
||||
struct LootItem
|
||||
{
|
||||
uint32 itemid;
|
||||
uint32 randomSuffix;
|
||||
int32 randomPropertyId;
|
||||
ConditionList conditions; // additional loot condition
|
||||
AllowedLooterSet allowedGUIDs;
|
||||
uint8 count : 8;
|
||||
bool is_looted : 1;
|
||||
bool is_blocked : 1;
|
||||
@@ -144,6 +147,9 @@ struct LootItem
|
||||
|
||||
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
|
||||
bool AllowedForPlayer(Player const * player) const;
|
||||
|
||||
void AddAllowedLooter(Player const* player);
|
||||
AllowedLooterSet* GetAllowedLooters() { return &allowedGUIDs; }
|
||||
};
|
||||
|
||||
struct QuestItem
|
||||
|
||||
Reference in New Issue
Block a user