[11670] Implement in proper way ITEM_SPELLTRIGGER_ON_STORE (5)

Item spells with this trigger mode expected casted at item add
to inventory/equip slots (exclude bank), and spell auras (if any)
applied while item in like slots. Item expected destroyed at aura
remove by some reason.

Implementation note: because 2 step way item moves from slot to slot
related auras not removed at internal RemoveItem call and removed only
at directly item destroy/remove from player function calles, or at StoreItem
(if item added to not appropriate slot). So need in future careful with new
RemoveItem call cases.
This commit is contained in:
VladimirMangos 2011-06-24 22:26:50 +04:00
parent 3f840222ee
commit 04a469f393
6 changed files with 122 additions and 34 deletions

View file

@ -2513,8 +2513,7 @@ void ObjectMgr::LoadItemRequiredTarget()
{
if (SpellEntry const* pSpellInfo = sSpellStore.LookupEntry(pItemProto->Spells[i].SpellId))
{
if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE)
{
SpellScriptTargetBounds bounds = sSpellMgr.GetSpellScriptTargetBounds(pSpellInfo->Id);
if (bounds.first != bounds.second)