[11449] Correct script effect of spell 50218

Also for related copy weapon/copy offhand weapon

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2011-05-09 00:06:00 +02:00
parent a4e91c3593
commit fac122184f
2 changed files with 5 additions and 5 deletions

View file

@ -6498,7 +6498,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
if (Item* pItem = ((Player*)unitTarget)->GetWeaponForAttack(BASE_ATTACK))
if (Item* pItem = ((Player*)unitTarget)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
{
((Creature*)m_caster)->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, pItem->GetEntry());
@ -6620,7 +6620,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
if (Item* pItem = ((Player*)unitTarget)->GetWeaponForAttack(OFF_ATTACK))
if (Item* pItem = ((Player*)unitTarget)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
((Creature*)m_caster)->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, pItem->GetEntry());
@ -6884,12 +6884,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
switch(eff_idx)
{
case EFFECT_INDEX_1:
if (((Player*)m_originalCaster)->GetWeaponForAttack(BASE_ATTACK))
if (((Player*)m_originalCaster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
unitTarget->CastSpell(m_originalCaster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
return;
case EFFECT_INDEX_2:
if (((Player*)m_originalCaster)->GetWeaponForAttack(OFF_ATTACK))
if (((Player*)m_originalCaster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
unitTarget->CastSpell(m_originalCaster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
return;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11448"
#define REVISION_NR "11449"
#endif // __REVISION_NR_H__