diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index d1cefc5b3..df3930832 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3301,19 +3301,24 @@ void Spell::EffectCreateItem2(SpellEffectIndex eff_idx) return; Player* player = (Player*)m_caster; + // explicit item (possible fake) uint32 item_id = m_spellInfo->EffectItemType[eff_idx]; - DoCreateItem(eff_idx, item_id); + if (item_id) + DoCreateItem(eff_idx, item_id); - // special case: fake item replaced by generate using spell_loot_template + // not explicit loot (with fake item drop if need) if (IsLootCraftingSpell(m_spellInfo)) { - if (!player->HasItemCount(item_id, 1)) - return; + if(item_id) + { + if (!player->HasItemCount(item_id, 1)) + return; - // remove reagent - uint32 count = 1; - player->DestroyItemCount(item_id, count, true); + // remove reagent + uint32 count = 1; + player->DestroyItemCount(item_id, count, true); + } // create some random items player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 02f411a7f..5ebccaa83 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -171,7 +171,8 @@ inline bool IsElementalShield(SpellEntry const *spellInfo) inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) { - return ((spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_RANDOM_ITEM + return (((spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_RANDOM_ITEM + || spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_ITEM_2) && spellInfo->Effect[EFFECT_INDEX_1] == SPELL_EFFECT_SCRIPT_EFFECT) || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data) } @@ -179,9 +180,9 @@ inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) inline bool IsLootCraftingSpell(SpellEntry const *spellInfo) { return (spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_RANDOM_ITEM || - // different random cards from Inscription (121==Virtuoso Inking Set category) - // also Abyssal Shatter (63), any !=0 infact - (spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] != 0)); + // different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item + (spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_ITEM_2 && + (spellInfo->TotemCategory[0] != 0 || spellInfo->EffectItemType[0]==0))); } int32 CompareAuraRanks(uint32 spellId_1, SpellEffectIndex effIndex_1, uint32 spellId_2, SpellEffectIndex effIndex_2);