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
+4
View File
@@ -3125,10 +3125,13 @@ void Spell::EffectCreateItem2(uint32 i)
uint32 item_id = m_spellInfo->EffectItemType[i]; uint32 item_id = m_spellInfo->EffectItemType[i];
if (item_id)
DoCreateItem(i, item_id); DoCreateItem(i, item_id);
// special case: fake item replaced by generate using spell_loot_template // special case: fake item replaced by generate using spell_loot_template
if (IsLootCraftingSpell(m_spellInfo)) if (IsLootCraftingSpell(m_spellInfo))
{
if (item_id)
{ {
if (!player->HasItemCount(item_id, 1)) if (!player->HasItemCount(item_id, 1))
return; return;
@@ -3140,6 +3143,7 @@ void Spell::EffectCreateItem2(uint32 i)
// create some random items // create some random items
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell); player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
} }
}
} }
void Spell::EffectCreateRandomItem(uint32 i) void Spell::EffectCreateRandomItem(uint32 i)
+5 -3
View File
@@ -281,7 +281,8 @@ inline bool IsElementalShield(SpellEntry const *spellInfo)
inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
{ {
return ((spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM return (((spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM
|| spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2)
&& spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT) && spellInfo->Effect[1] == SPELL_EFFECT_SCRIPT_EFFECT)
|| spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0 == SPELL_EFFECT_SCRIPT_EFFECT without any other data) || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0 == SPELL_EFFECT_SCRIPT_EFFECT without any other data)
} }
@@ -289,8 +290,9 @@ inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo)
inline bool IsLootCraftingSpell(SpellEntry const *spellInfo) inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
{ {
return (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM || return (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM ||
// different random cards from Inscription (121 == Virtuoso Inking Set category) // different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item
(spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121)); (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 &&
(spellInfo->TotemCategory[0] != 0 || spellInfo->EffectItemType[0]==0)));
} }
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2); bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);