mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Core/Quests: kill QUEST_OBJECTIVE_FLAG_2_QUEST_BOUND_ITEM implementation and restore regular quest item loot behavior
closes #30145
This commit is contained in:
@@ -1398,23 +1398,28 @@ void Spell::DoCreateItem(uint32 itemId, ItemContext context /*= ItemContext::NON
|
||||
if (num_to_add)
|
||||
{
|
||||
// create the new item and store it
|
||||
if (Item* pItem = player->StoreNewItem(dest, newitemid, true, GenerateItemRandomBonusListId(newitemid), GuidSet(), context, bonusListIDs))
|
||||
Item* pItem = player->StoreNewItem(dest, newitemid, true, GenerateItemRandomBonusListId(newitemid), GuidSet(), context, bonusListIDs);
|
||||
|
||||
// was it successful? return error if not
|
||||
if (!pItem)
|
||||
{
|
||||
// set the "Crafted by ..." property of the item
|
||||
if (pItem->GetTemplate()->HasSignature())
|
||||
pItem->SetCreator(player->GetGUID());
|
||||
|
||||
// send info to the client
|
||||
player->SendNewItem(pItem, num_to_add, true, true);
|
||||
|
||||
if (pItem->GetQuality() > ITEM_QUALITY_EPIC || (pItem->GetQuality() == ITEM_QUALITY_EPIC && pItem->GetItemLevel(player) >= MinNewsItemLevel))
|
||||
if (Guild* guild = player->GetGuild())
|
||||
guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->GetId());
|
||||
player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
// set the "Crafted by ..." property of the item
|
||||
if (pItem->GetTemplate()->HasSignature())
|
||||
pItem->SetCreator(player->GetGUID());
|
||||
|
||||
// send info to the client
|
||||
player->SendNewItem(pItem, num_to_add, true, true);
|
||||
|
||||
if (pItem->GetQuality() > ITEM_QUALITY_EPIC || (pItem->GetQuality() == ITEM_QUALITY_EPIC && pItem->GetItemLevel(player) >= MinNewsItemLevel))
|
||||
if (Guild* guild = player->GetGuild())
|
||||
guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->GetId());
|
||||
|
||||
// we succeeded in creating at least one item, so a levelup is possible
|
||||
if (!m_CastItem)
|
||||
player->UpdateCraftSkill(m_spellInfo);
|
||||
player->UpdateCraftSkill(m_spellInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user