Update IsExplicitDiscoverySpell/IsLootCraftingSpell and related code. by Vladimir.

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2010-04-11 11:24:05 +04:00
parent cdec48b9ef
commit 45e750148a
2 changed files with 17 additions and 11 deletions
+12 -8
View File
@@ -3125,20 +3125,24 @@ void Spell::EffectCreateItem2(uint32 i)
uint32 item_id = m_spellInfo->EffectItemType[i];
DoCreateItem(i, item_id);
if (item_id)
DoCreateItem(i, item_id);
// special case: fake item replaced by generate using spell_loot_template
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);
// create some random items
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
}
}
}