[9984] Implement item 43214 work.

* Original version suggested by timmit.
* Required DB support for target requirement.
This commit is contained in:
VladimirMangos 2010-05-27 19:08:24 +04:00
parent 6ce82e4914
commit 86bef7ace5
5 changed files with 27 additions and 17 deletions

View file

@ -516,6 +516,8 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas
(57669,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Replenishment', 'Spell::SetTargetMap'),
(57723,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Exhaustion', 'Spell::cast'),
(57724,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Sated', 'Spell::cast'),
(57908, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Stain Cloth', 'Spell::EffectDummy'),
(57915,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Create Cloth', 'Spell::EffectDummy'),
(58067,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Refreshment', 'Spell::EffectScriptEffect'),
(58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'),
(58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'),

View file

@ -3857,10 +3857,7 @@ void Spell::TakeCastItem()
((Player*)m_caster)->DestroyItemCount(m_CastItem, count, true);
// prevent crash at access to deleted m_targets.getItemTarget
if(m_CastItem == m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
ClearCastItem();
}
}
@ -6634,4 +6631,12 @@ void Spell::SelectMountByAreaAndSkill(Unit* target, uint32 spellId75, uint32 spe
target->CastSpell(target, spellId75, true);
return;
}
void Spell::ClearCastItem()
{
if (m_CastItem==m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
}

View file

@ -497,6 +497,7 @@ class Spell
void CastTriggerSpells();
void CleanupTargetList();
void ClearCastItem();
static void SelectMountByAreaAndSkill(Unit* target, uint32 spellId75, uint32 spellId150, uint32 spellId225, uint32 spellId300, uint32 spellIdSpecial);
protected:

View file

@ -1686,6 +1686,17 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
return;
}
case 57908: // Stain Cloth
{
// nothing do more
finish();
m_caster->CastSpell(m_caster, 57915, false, m_CastItem);
// cast item deleted
ClearCastItem();
break;
}
case 58418: // Portal to Orgrimmar
case 58420: // Portal to Stormwind
return; // implemented in EffectScript[0]
@ -3719,10 +3730,7 @@ void Spell::EffectSummonChangeItem(SpellEffectIndex eff_idx)
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem==m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
ClearCastItem();
player->StoreItem( dest, pNewItem, true);
return;
@ -3737,10 +3745,7 @@ void Spell::EffectSummonChangeItem(SpellEffectIndex eff_idx)
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem==m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
ClearCastItem();
player->BankItem( dest, pNewItem, true);
return;
@ -3755,10 +3760,7 @@ void Spell::EffectSummonChangeItem(SpellEffectIndex eff_idx)
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
// prevent crash at access and unexpected charges counting with item update queue corrupt
if (m_CastItem==m_targets.getItemTarget())
m_targets.setItemTarget(NULL);
m_CastItem = NULL;
ClearCastItem();
player->EquipItem( dest, pNewItem, true);
player->AutoUnequipOffhandIfNeed();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9983"
#define REVISION_NR "9984"
#endif // __REVISION_NR_H__