Use spell_loot_table for item creating in case SPELL_EFFECT_CREATE_ITEM_2 (157) and itemType==0

This commit is contained in:
VladimirMangos 2009-02-06 06:00:01 +03:00
parent 118eb563b5
commit f94377622e
6 changed files with 30 additions and 6 deletions

View file

@ -215,7 +215,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectNULL, //154 unused
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
&Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
&Spell::EffectCreateItem, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
&Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create/learn item/spell for profession
&Spell::EffectMilling, //158 SPELL_EFFECT_MILLING milling
&Spell::EffectRenamePet //159 SPELL_EFFECT_ALLOW_RENAME_PET allow rename pet once again
};
@ -2682,6 +2682,22 @@ void Spell::EffectCreateItem(uint32 i)
DoCreateItem(i,m_spellInfo->EffectItemType[i]);
}
void Spell::EffectCreateItem2(uint32 i)
{
// special case: generate using spell_loot_template
if(!m_spellInfo->EffectItemType[i])
{
if(m_caster->GetTypeId()!=TYPEID_PLAYER)
return;
// create some random items
if(!((Player*)m_caster)->AutoStoreLootItem(m_spellInfo->Id,LootTemplates_Spell))
player->SendEquipError( msg, NULL, NULL );
return;
}
DoCreateItem(i,m_spellInfo->EffectItemType[i]);
}
void Spell::EffectPersistentAA(uint32 i)
{
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));