mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[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:
parent
a4e91c3593
commit
fac122184f
2 changed files with 5 additions and 5 deletions
|
|
@ -6498,7 +6498,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
||||||
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
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());
|
((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)
|
if (m_caster->GetTypeId() != TYPEID_UNIT || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
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());
|
((Creature*)m_caster)->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, pItem->GetEntry());
|
||||||
|
|
||||||
|
|
@ -6884,12 +6884,12 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
||||||
switch(eff_idx)
|
switch(eff_idx)
|
||||||
{
|
{
|
||||||
case EFFECT_INDEX_1:
|
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);
|
unitTarget->CastSpell(m_originalCaster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
case EFFECT_INDEX_2:
|
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);
|
unitTarget->CastSpell(m_originalCaster, m_spellInfo->CalculateSimpleValue(eff_idx), true);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11448"
|
#define REVISION_NR "11449"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue