diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-12-30 15:45:37 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2024-01-09 12:50:47 +0100 |
commit | 0c21c06e6e1857254757bd2669f2fcb26a0b6c59 (patch) | |
tree | ecce6bc11d5653be74704a2b871e9af9d400f2ed /src/server/game/Spells/SpellEffects.cpp | |
parent | dbf2f88e40c3e760b4508f0dafaedd065ba95479 (diff) |
Core/Quests: Implemented QUEST_OBJECTIVE_FLAG_2_QUEST_BOUND_ITEM that makes required items not be stored in inventory
(cherry picked from commit 4dce6ab228c54319032b346d2d791262eac3d9cd)
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e87a902032b..7d49a9e2033 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1366,25 +1366,19 @@ void Spell::DoCreateItem(uint32 itemId, ItemContext context /*= ItemContext::NON if (num_to_add) { // create the new item and store it - Item* pItem = player->StoreNewItem(dest, newitemid, true, sItemEnchantmentMgr->GenerateRandomProperties(newitemid), GuidSet(), context); - - // was it successful? return error if not - if (!pItem) + if (Item* pItem = player->StoreNewItem(dest, newitemid, true, sItemEnchantmentMgr->GenerateRandomProperties(newitemid), GuidSet(), context)) { - 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()); - // 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); - // 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()); + 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 player->UpdateCraftSkill(m_spellInfo); |