Update IsExplicitDiscoverySpell/IsLootCraftingSpell and related code. by Vladimir.
--HG-- branch : trunk
This commit is contained in:
@@ -3125,10 +3125,13 @@ void Spell::EffectCreateItem2(uint32 i)
|
||||
|
||||
uint32 item_id = m_spellInfo->EffectItemType[i];
|
||||
|
||||
if (item_id)
|
||||
DoCreateItem(i, item_id);
|
||||
|
||||
// special case: fake item replaced by generate using spell_loot_template
|
||||
if (IsLootCraftingSpell(m_spellInfo))
|
||||
{
|
||||
if (item_id)
|
||||
{
|
||||
if (!player->HasItemCount(item_id, 1))
|
||||
return;
|
||||
@@ -3140,6 +3143,7 @@ void Spell::EffectCreateItem2(uint32 i)
|
||||
// create some random items
|
||||
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectCreateRandomItem(uint32 i)
|
||||
|
||||
+5
-3
@@ -281,7 +281,8 @@ inline bool IsElementalShield(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->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)
|
||||
{
|
||||
return (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM ||
|
||||
// different random cards from Inscription (121 == Virtuoso Inking Set category)
|
||||
(spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 && spellInfo->TotemCategory[0] == 121));
|
||||
// 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] != 0 || spellInfo->EffectItemType[0]==0)));
|
||||
}
|
||||
|
||||
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);
|
||||
|
||||
Reference in New Issue
Block a user