Update IsExplicitDiscoverySpell/IsLootCraftingSpell and related code. by Vladimir.
--HG-- branch : trunk
This commit is contained in:
@@ -3125,20 +3125,24 @@ void Spell::EffectCreateItem2(uint32 i)
|
|||||||
|
|
||||||
uint32 item_id = m_spellInfo->EffectItemType[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
|
// special case: fake item replaced by generate using spell_loot_template
|
||||||
if (IsLootCraftingSpell(m_spellInfo))
|
if (IsLootCraftingSpell(m_spellInfo))
|
||||||
{
|
{
|
||||||
if (!player->HasItemCount(item_id, 1))
|
if (item_id)
|
||||||
return;
|
{
|
||||||
|
if (!player->HasItemCount(item_id, 1))
|
||||||
|
return;
|
||||||
|
|
||||||
// remove reagent
|
// remove reagent
|
||||||
uint32 count = 1;
|
uint32 count = 1;
|
||||||
player->DestroyItemCount(item_id, count, true);
|
player->DestroyItemCount(item_id, count, true);
|
||||||
|
|
||||||
// create some random items
|
// create some random items
|
||||||
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
|
player->AutoStoreLoot(m_spellInfo->Id, LootTemplates_Spell);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user