diff --git a/sql/updates/world/custom/custom_2018_06_18_00_world.sql b/sql/updates/world/custom/custom_2018_06_18_00_world.sql new file mode 100644 index 0000000000..1a13476c0e --- /dev/null +++ b/sql/updates/world/custom/custom_2018_06_18_00_world.sql @@ -0,0 +1,12 @@ +ALTER TABLE `creature_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `disenchant_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `fishing_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `gameobject_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `item_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `mail_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `milling_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `pickpocketing_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `prospecting_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `reference_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `skinning_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; +ALTER TABLE `spell_loot_template` ADD COLUMN `IsCurrency` TINYINT(1) DEFAULT 0 NOT NULL AFTER `QuestRequired`; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 22da44dd4f..0c7ab9dbd1 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -832,11 +832,6 @@ void GameObject::getFishLootJunk(Loot* fishloot, Player* loot_owner) } } -void GameObject::getArchaeologyLoot(Loot* loot, Player* /*loot_owner*/) -{ - loot->AddCurrency(sArchaeologyMgr->GetFindCurrency(GetEntry()), 4, 9); -} - void GameObject::SaveToDB() { // this should only be used when the gameobject has already been loaded diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 781f18a53b..8269b54d7b 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -170,7 +170,6 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject void SendGameObjectDespawn(); void getFishLoot(Loot* loot, Player* loot_owner); void getFishLootJunk(Loot* loot, Player* loot_owner); - void getArchaeologyLoot(Loot* loot, Player* loot_owner); GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); } void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); } GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index eb18ef6bff..b534bbe670 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8672,8 +8672,6 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type) go->getFishLoot(loot, this); else if (loot_type == LOOT_FISHING_JUNK) go->getFishLootJunk(loot, this); - else if (loot_type == LOOT_ARCHAEOLOGY) - go->getArchaeologyLoot(loot, this); if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.groupLootRules) { @@ -25815,21 +25813,6 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) SendEquipError(msg, nullptr, nullptr, item->itemid); } - -void Player::StoreLootCurrency(uint8 lootSlot, Loot* loot) -{ - LootCurrency* currency = loot->LootCurrencyInSlot(lootSlot, this); - - if (!currency) - { - SendEquipError(EQUIP_ERR_LOOT_GONE, nullptr, nullptr); - return; - } - - loot->NotifyCurrencyRemoved(lootSlot); - ModifyCurrency(currency->id, currency->count); -} - uint32 Player::CalculateTalentsPoints() const { // this dbc file has entries only up to level 100 diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2f902ea967..98fe3b599e 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1216,7 +1216,6 @@ class TC_GAME_API Player : public Unit, public GridObject void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - void StoreLootCurrency(uint8 lootSlot, Loot* loot); InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr, uint32* itemLimitCategory = nullptr) const; InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = nullptr, bool swap = false, uint32* no_space_count = nullptr) const; diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 4895452223..d8dedb8848 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -140,7 +140,7 @@ void WorldSession::HandleLootCurrencyOpcode(WorldPacket& recvData) return; } - player->StoreLootCurrency(lootSlot, loot); + loot->LootCurrencyInSlot(lootSlot, player); } void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) diff --git a/src/server/game/Loot/Loot.cpp b/src/server/game/Loot/Loot.cpp index 845f734d9b..b643991369 100644 --- a/src/server/game/Loot/Loot.cpp +++ b/src/server/game/Loot/Loot.cpp @@ -36,15 +36,24 @@ LootItem::LootItem(LootStoreItem const& li) { itemid = li.itemid; conditions = li.conditions; + is_currency = li.is_currency; - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid); - freeforall = proto && (proto->Flags & ITEM_FLAG_MULTI_DROP); - follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES); + if (!is_currency) + { + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid); + freeforall = proto && (proto->Flags & ITEM_FLAG_MULTI_DROP); + follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES); + } + else + { + freeforall = false; + follow_loot_rules = false; + } needs_quest = li.needs_quest; - randomSuffix = GenerateEnchSuffixFactor(itemid); - randomPropertyId = GenerateItemRandomPropertyId(itemid); + randomSuffix = !is_currency ? GenerateEnchSuffixFactor(itemid) : 0; + randomPropertyId = !is_currency ? GenerateItemRandomPropertyId(itemid) : 0; count = 0; is_looted = 0; is_blocked = 0; @@ -91,7 +100,7 @@ void LootItem::AddAllowedLooter(Player const* player) // --------- Loot --------- // -Loot::Loot(uint32 _gold /*= 0*/) : gold(_gold), unlootedCount(0), unlootedCurrency(0), roundRobinPlayer(), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) +Loot::Loot(uint32 _gold /*= 0*/) : gold(_gold), unlootedCount(0), roundRobinPlayer(), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { } @@ -103,6 +112,33 @@ Loot::~Loot() // Inserts the item into the loot (called by LootTemplate processors) void Loot::AddItem(LootStoreItem const& item) { + std::vector& lootItems = item.needs_quest ? quest_items : items; + uint32 limit = item.needs_quest ? MAX_NR_QUEST_ITEMS : MAX_NR_LOOT_ITEMS; + + if (item.is_currency) + { + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(item.itemid); + if (!currency) + return; + + uint32 totalCap = currency->TotalCap > 0 ? currency->TotalCap : 1; + uint32 count = urand(item.mincount, item.maxcount); + uint32 stacks = count / totalCap + ((count % totalCap) ? 1 : 0); + + for (uint32 i = 0; i < stacks && lootItems.size() < limit; ++i) + { + LootItem generatedLoot(item); + generatedLoot.count = std::min(count, currency->TotalCap); + lootItems.push_back(generatedLoot); + count -= currency->TotalCap; + + // Never seen a currency that needs a quest but just in case + if (!item.needs_quest) + ++unlootedCount; + } + return; + } + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item.itemid); if (!proto) return; @@ -110,9 +146,6 @@ void Loot::AddItem(LootStoreItem const& item) uint32 count = urand(item.mincount, item.maxcount); uint32 stacks = count / proto->GetMaxStackSize() + ((count % proto->GetMaxStackSize()) ? 1 : 0); - std::vector& lootItems = item.needs_quest ? quest_items : items; - uint32 limit = item.needs_quest ? MAX_NR_QUEST_ITEMS : MAX_NR_LOOT_ITEMS; - for (uint32 i = 0; i < stacks && lootItems.size() < limit; ++i) { LootItem generatedLoot(item); @@ -128,25 +161,20 @@ void Loot::AddItem(LootStoreItem const& item) } } -void Loot::AddCurrency(uint32 entry, uint32 min, uint32 max) +void Loot::LootCurrencyInSlot(uint8 lootSlot, Player* player) { - uint32 amount = urand(min, max); + if (items[lootSlot].is_looted || !items[lootSlot].is_currency) + return; - currencies.push_back(LootCurrency(entry, amount)); + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(items[lootSlot].itemid); + if (!currency) + return; - unlootedCurrency++; -} + NotifyCurrencyRemoved(lootSlot); + player->ModifyCurrency(items[lootSlot].itemid, items[lootSlot].count); -LootCurrency* Loot::LootCurrencyInSlot(uint32 lootSlot, Player* /*player*/) -{ - if (currencies[lootSlot].looted) - return nullptr; - - currencies[lootSlot].looted = true; - - unlootedCurrency--; - - return &(currencies[lootSlot]); + items[lootSlot].is_looted = true; + unlootedCount--; } // Calls processor of corresponding LootTemplate (which handles everything including references) @@ -214,23 +242,6 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting) // if not auto-processed player will have to come and pick it up manually if (!presentAtLooting) return; - - // Process currency items - uint32 max_slot = GetMaxSlotInLootFor(player); - LootItem const* item = nullptr; - uint32 itemsSize = uint32(items.size()); - for (uint32 i = 0; i < max_slot; ++i) - { - if (i < items.size()) - item = &items[i]; - else - item = &quest_items[i-itemsSize]; - - if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player)) - if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid)) - if (proto->IsCurrencyToken()) - player->StoreLootItem(i, this); - } } NotNormalLootItemList* Loot::FillFFALoot(Player* player) @@ -603,7 +614,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) // blocked rolled items and quest items, and !ffa items for (uint8 i = 0; i < l.items.size(); ++i) { - if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer)) + if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer) && !l.items[i].is_currency) { uint8 slot_type; @@ -658,7 +669,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { for (uint8 i = 0; i < l.items.size(); ++i) { - if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer)) + if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer) && !!l.items[i].is_currency) { if (!l.roundRobinPlayer.IsEmpty() && lv.viewer->GetGUID() != l.roundRobinPlayer) // item shall not be displayed. @@ -677,7 +688,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) uint8 slot_type = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT; for (uint8 i = 0; i < l.items.size(); ++i) { - if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer)) + if (!l.items[i].is_looted && !l.items[i].freeforall && l.items[i].conditions.empty() && l.items[i].AllowedForPlayer(lv.viewer) && !l.items[i].is_currency) { b << uint8(i) << l.items[i]; b << uint8(slot_type); @@ -786,16 +797,14 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } } - for (uint8 i = 0; i < l.currencies.size(); ++i) + for (uint8 i = 0; i < l.items.size(); ++i) { - if (l.currencies[i].count == 0 || l.currencies[i].id == 0 || l.currencies[i].looted) + if (!l.items[i].is_currency || l.items[i].count == 0 || l.items[i].is_looted) continue; - l.currencies[i].index = currenciesShown + itemsShown; - - b << uint8(l.currencies[i].index); - b << uint32(l.currencies[i].id); - b << uint32(l.currencies[i].count); + b << uint8(i); + b << uint32(l.items[i].itemid); + b << uint32(l.items[i].count); ++currenciesShown; } diff --git a/src/server/game/Loot/Loot.h b/src/server/game/Loot/Loot.h index e42d7ca89e..471db294e7 100644 --- a/src/server/game/Loot/Loot.h +++ b/src/server/game/Loot/Loot.h @@ -140,6 +140,7 @@ struct TC_GAME_API LootItem bool is_underthreshold : 1; bool is_counted : 1; bool needs_quest : 1; // quest drop + bool is_currency : 1; // currency loot bool follow_loot_rules : 1; // Constructor, copies most fields from LootStoreItem, generates random count and random suffixes/properties @@ -148,7 +149,8 @@ struct TC_GAME_API LootItem // Empty constructor for creating an empty LootItem to be filled in with DB data LootItem() : itemid(0), randomSuffix(0), randomPropertyId(0), count(0), is_looted(false), is_blocked(false), - freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false) + freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), is_currency(false), + follow_loot_rules(false) { }; // Basic checks for player/item compatibility - if false no chance to see the item in the loot @@ -169,20 +171,6 @@ struct NotNormalLootItem : index(_index), is_looted(_islooted) { } }; -struct LootCurrency -{ - uint8 index; - uint32 id; - uint32 count; - bool looted; - - LootCurrency() - : index(0), id(0), count(0), looted(false) { } - - LootCurrency(uint32 _id, uint32 _count) - : index(0), id(_id), count(_count), looted(false) { } -}; - typedef std::vector NotNormalLootItemList; typedef std::vector LootItemList; typedef std::unordered_map NotNormalLootItemMap; @@ -227,11 +215,9 @@ struct TC_GAME_API Loot std::vector items; std::vector quest_items; - std::vector currencies; uint32 gold; uint8 unlootedCount; - uint8 unlootedCurrency; ObjectGuid roundRobinPlayer; // GUID of the player having the Round-Robin ownership for the loot. If 0, round robin owner has released. LootType loot_type; // required for achievement system uint8 maxDuplicates; // Max amount of items with the same entry that can drop (default is 1; on 25 man raid mode 3) @@ -269,14 +255,13 @@ struct TC_GAME_API Loot quest_items.clear(); gold = 0; unlootedCount = 0; - unlootedCurrency = 0; roundRobinPlayer.Clear(); loot_type = LOOT_NONE; i_LootValidatorRefManager.clearReferences(); } bool empty() const { return items.empty() && gold == 0; } - bool isLooted() const { return gold == 0 && unlootedCount == 0 && unlootedCurrency == 0; } + bool isLooted() const { return gold == 0 && unlootedCount == 0; } void NotifyItemRemoved(uint8 lootIndex); void NotifyQuestItemRemoved(uint8 questIndex); @@ -291,15 +276,14 @@ struct TC_GAME_API Loot // Inserts the item into the loot (called by LootTemplate processors) void AddItem(LootStoreItem const & item); + void LootCurrencyInSlot(uint8 lootSlot, Player* player); + LootItem* LootItemInSlot(uint32 lootslot, Player* player, NotNormalLootItem** qitem = nullptr, NotNormalLootItem** ffaitem = nullptr, NotNormalLootItem** conditem = nullptr); uint32 GetMaxSlotInLootFor(Player* player) const; bool hasItemForAll() const; bool hasItemFor(Player* player) const; bool hasOverThresholdItem() const; - void AddCurrency(uint32 entry, uint32 min, uint32 max); - LootCurrency* LootCurrencyInSlot(uint32 lootSlot, Player* player); - private: void FillNotNormalLootFor(Player* player, bool presentAtLooting); NotNormalLootItemList* FillFFALoot(Player* player); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index a04115039e..d65fdfe284 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -134,8 +134,8 @@ uint32 LootStore::LoadLootTable() // Clearing store (for reloading case) Clear(); - // 0 1 2 3 4 5 6 - QueryResult result = WorldDatabase.PQuery("SELECT Entry, Item, Reference, Chance, QuestRequired, LootMode, GroupId, MinCount, MaxCount FROM %s", GetName()); + // 0 1 2 3 4 5 6 7 8 9 + QueryResult result = WorldDatabase.PQuery("SELECT Entry, Item, Reference, Chance, QuestRequired, IsCurrency, LootMode, GroupId, MinCount, MaxCount FROM %s", GetName()); if (!result) return 0; @@ -150,10 +150,11 @@ uint32 LootStore::LoadLootTable() 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(); - uint8 mincount = fields[7].GetUInt8(); - uint8 maxcount = fields[8].GetUInt8(); + bool iscurrency = fields[5].GetBool(); + uint16 lootmode = fields[6].GetUInt16(); + uint8 groupid = fields[7].GetUInt8(); + uint8 mincount = fields[8].GetUInt8(); + uint8 maxcount = fields[9].GetUInt8(); if (groupid >= 1 << 7) // it stored in 7 bit field { @@ -161,16 +162,16 @@ uint32 LootStore::LoadLootTable() return 0; } - LootStoreItem* storeitem = new LootStoreItem(item, reference, chance, needsquest, lootmode, groupid, mincount, maxcount); + LootStoreItem* storeitem = new LootStoreItem(item, reference, chance, needsquest, iscurrency, lootmode, groupid, mincount, maxcount); - if (!storeitem->IsValid(*this, entry)) // Validity checks + if (!storeitem->IsValid(*this, entry)) // Validity checks { delete storeitem; continue; } // 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) @@ -291,6 +292,9 @@ bool LootStoreItem::Roll(bool rate) const if (reference > 0) // reference case return roll_chance_f(chance* (rate ? sWorld->getRate(RATE_DROP_ITEM_REFERENCED) : 1.0f)); + if (is_currency) + return roll_chance_f(chance); + ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid); float qualityModifier = pProto && rate ? sWorld->getRate(qualityToRate[pProto->Quality]) : 1.0f; @@ -309,11 +313,23 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const if (reference == 0) // item (quest or non-quest) entry, maybe grouped { - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid); - if (!proto) + if (!is_currency) { - 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; + 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); + return false; + } + } + else + { + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(itemid); + if (!currency) + { + TC_LOG_ERROR("sql.sql", "Table '%s' Entry %d CurrencyId %d: currency does not exist in `CurrencyTypes.dbc` - skipped", store.GetName(), entry, itemid); + return false; + } } if (chance == 0 && groupid == 0) // Zero chance is allowed for grouped entries only diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 705d8db539..7e217f0204 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -39,21 +39,21 @@ struct TC_GAME_API LootStoreItem float chance; // chance to drop for both quest and non-quest items, chance to be used for refs uint16 lootmode; bool needs_quest : 1; // quest drop (quest is required for item to drop) + bool is_currency : 1; // currency loot (entry is currency instead of an item) uint8 groupid : 7; uint8 mincount; // mincount for drop items uint8 maxcount; // max drop count for the item mincount or Ref multiplicator - ConditionContainer conditions; // additional loot condition + ConditionContainer conditions; // additional loot condition // Constructor // displayid is filled in IsValid() which must be called after - LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount) - : itemid(_itemid), reference(_reference), chance(_chance), lootmode(_lootmode), - needs_quest(_needs_quest), groupid(_groupid), mincount(_mincount), maxcount(_maxcount) + LootStoreItem(uint32 _itemid, uint32 _reference, float _chance, bool _needs_quest, bool _is_currency, uint16 _lootmode, uint8 _groupid, int32 _mincount, uint8 _maxcount) + : itemid(_itemid), reference(_reference), chance(_chance), needs_quest(_needs_quest), is_currency(_is_currency), + lootmode(_lootmode), groupid(_groupid), mincount(_mincount), maxcount(_maxcount) { } - bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation) - bool IsValid(LootStore const& store, uint32 entry) const; - // Checks correctness of values + bool Roll(bool rate) const; // Checks if the entry takes it's chance (at loot generation) + bool IsValid(LootStore const& store, uint32 entry) const; // Checks correctness of values }; typedef std::list LootStoreItemList; diff --git a/src/server/game/Skills/Archaeology/ArchaeologyMgr.cpp b/src/server/game/Skills/Archaeology/ArchaeologyMgr.cpp index 3e7e591396..e563fb2f50 100644 --- a/src/server/game/Skills/Archaeology/ArchaeologyMgr.cpp +++ b/src/server/game/Skills/Archaeology/ArchaeologyMgr.cpp @@ -285,32 +285,6 @@ uint32 ArchaeologyMgr::GetSiteType(uint16 entry) return _objectMap[entry]; } -uint32 ArchaeologyMgr::GetFindCurrency(uint32 go_entry) -{ - switch (go_entry) - { - case FIND_OBJECT_DRAENEI: - return CURRENCY_TYPE_DRAENEI_FRAGMENT; - case FIND_OBJECT_DWARF: - return CURRENCY_TYPE_DWARF_FRAGMENT; - case FIND_OBJECT_FOSSIL: - return CURRENCY_TYPE_FOSSIL_FRAGMENT; - case FIND_OBJECT_NERUBIAN: - return CURRENCY_TYPE_NERUBIAN_FRAGMENT; - case FIND_OBJECT_NIGHT_ELF: - return CURRENCY_TYPE_NELF_FRAGMENT; - case FIND_OBJECT_ORC: - return CURRENCY_TYPE_ORC_FRAGMENT; - case FIND_OBJECT_TOL_VIR: - return CURRENCY_TYPE_TOLVIR_FRAGMENT; - case FIND_OBJECT_TROLL: - return CURRENCY_TYPE_TROLL_FRAGMENT; - case FIND_OBJECT_VRYKUL: - return CURRENCY_TYPE_VRYKUL_FRAGMENT; - } - return 0; -} - uint16 ArchaeologyMgr::GetNewProject(uint8 branchId, BranchData* branch, std::map>* completedMap, uint32 playerSkill) { std::vector* _rares = &_rareProjects[branchId]; diff --git a/src/server/game/Skills/Archaeology/ArchaeologyMgr.h b/src/server/game/Skills/Archaeology/ArchaeologyMgr.h index b0e8db85cb..45bf900ea4 100644 --- a/src/server/game/Skills/Archaeology/ArchaeologyMgr.h +++ b/src/server/game/Skills/Archaeology/ArchaeologyMgr.h @@ -111,7 +111,6 @@ class TC_GAME_API ArchaeologyMgr void LoadData(); // Site Functionality - static uint32 GetFindCurrency(uint32 go_entry); uint16 GetNewSite(Continent continent, SiteData *sites, bool extended, uint32 playerLevel); bool SetSiteCoords(SiteData &site); uint32 GetSiteType(uint16 entry);