aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-14 18:42:53 -0600
committermegamage <none@none>2009-01-14 18:42:53 -0600
commit14e38a3ddf27a7ced018c59864c81dd6eb35217f (patch)
treed29e76ad51fea59cba9c808651929f549f7ba392 /src/game/SpellHandler.cpp
parent83e7f653fe6a1aad6121fa7606da620d14938e0c (diff)
*Update to Mangos 7093.
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellHandler.cpp')
-rw-r--r--src/game/SpellHandler.cpp54
1 files changed, 1 insertions, 53 deletions
diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp
index 8648e7a76c6..a30dee9d67b 100644
--- a/src/game/SpellHandler.cpp
+++ b/src/game/SpellHandler.cpp
@@ -128,59 +128,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
if(!Script->ItemUse(pUser,pItem,targets))
{
// no script or script not process request by self
-
- // special learning case
- if((pItem->GetProto()->Spells[0].SpellId==SPELL_ID_GENERIC_LEARN) || (pItem->GetProto()->Spells[0].SpellId==SPELL_ID_GENERIC_LEARN_PET))
- {
- uint32 learn_spell_id = pItem->GetProto()->Spells[0].SpellId;
- uint32 learning_spell_id = pItem->GetProto()->Spells[1].SpellId;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(learn_spell_id);
- if(!spellInfo)
- {
- sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, learn_spell_id);
- pUser->SendEquipError(EQUIP_ERR_NONE,pItem,NULL);
- return;
- }
-
- Spell *spell = new Spell(pUser, spellInfo, false);
- spell->m_CastItem = pItem;
- spell->m_cast_count = cast_count; //set count of casts
- spell->m_currentBasePoints[0] = learning_spell_id;
- spell->prepare(&targets);
- return;
- }
-
- // use triggered flag only for items with many spell casts and for not first cast
- int count = 0;
-
- for(int i = 0; i < 5; ++i)
- {
- _Spell const& spellData = pItem->GetProto()->Spells[i];
-
- // no spell
- if(!spellData.SpellId)
- continue;
-
- // wrong triggering type
- if( spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_USE && spellData.SpellTrigger != ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
- continue;
-
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
- if(!spellInfo)
- {
- sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, spellData.SpellId);
- continue;
- }
-
- Spell *spell = new Spell(pUser, spellInfo, (count > 0));
- spell->m_CastItem = pItem;
- spell->m_cast_count = cast_count; // set count of casts
- spell->m_glyphIndex = glyphIndex; // glyph index
- spell->prepare(&targets);
-
- ++count;
- }
+ pUser->CastItemUseSpell(pItem,targets,cast_count,glyphIndex);
}
}