aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorille <ille000@gmx.de>2011-04-08 23:16:57 +0300
committerShocker <shocker@freakz.ro>2011-04-08 23:16:57 +0300
commita2bcb9425cbcc52e411ef418072c50fae4586eda (patch)
treea0055e348dba481c7b68066108123e13aecda467
parent5f4337f7e9e11b7992a39a88969ba9f4502d00dc (diff)
Core/Spells: Fix cloning spells
Closes #1162
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp7
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp47
2 files changed, 48 insertions, 6 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index b2f6526b217..261deff3b17 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3448,14 +3448,17 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const * aurApp, uint8 mod
if (apply)
{
Unit * caster = GetCaster();
- if (!caster)
+ if (!caster || caster == target)
return;
- // Set display id (probably for portrait?)
+ // What must be cloned? at least display and scale
target->SetDisplayId(caster->GetDisplayId());
+ target->SetCreatorGUID(caster->GetGUID());
+ //target->SetFloatValue(OBJECT_FIELD_SCALE_X, caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?)
target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
}
else
{
+ target->SetCreatorGUID(0);
target->SetDisplayId(target->GetNativeDisplayId());
target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE);
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index ca0e1d594e0..7569d68c5eb 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4402,13 +4402,52 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
return;
}
case 45204: // Clone Me!
+ case 45785: // Sinister Reflection Clone
+ case 49889: // Mystery of the Infinite: Future You's Mirror Image Aura
+ case 50218: // The Cleansing: Your Inner Turmoil's Mirror Image Aura
+ case 51719: // Altar of Quetz'lun: Material You's Mirror Image Aura
+ case 57528: // Nightmare Figment Mirror Image
+ case 69828: // Halls of Reflection Clone
+ m_caster->CastSpell(unitTarget, damage, true);
+ break;
case 41055: // Copy Weapon
+ case 63416:
+ case 69891:
+ m_caster->CastSpell(unitTarget, damage, true);
+ if (unitTarget->GetTypeId() == TYPEID_PLAYER)
+ break;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (Item * mainItem = m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
+ }
+ else
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID));
+ break;
case 45206: // Copy Off-hand Weapon
- unitTarget->CastSpell(m_caster, damage, false);
+ case 69892:
+ m_caster->CastSpell(unitTarget, damage, true);
+ if (unitTarget->GetTypeId() == TYPEID_PLAYER)
+ break;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (Item * offItem = m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
+ }
+ else
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1));
break;
- case 45205: // Copy Offhand Weapon
- case 41054: // Copy Weapon
- m_caster->CastSpell(unitTarget, damage, false);
+ case 57593: // Copy Ranged Weapon
+ m_caster->CastSpell(unitTarget, damage, true);
+ if (unitTarget->GetTypeId() == TYPEID_PLAYER)
+ break;
+ if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (Item * rangedItem = m_caster->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
+ }
+ else
+ unitTarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2));
break;
case 55693: // Remove Collapsing Cave Aura
if (!unitTarget)