aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorQAston <none@none>2010-08-17 20:19:06 +0200
committerQAston <none@none>2010-08-17 20:19:06 +0200
commit0284ed4cfeefe7f84488975beb908bb597e610c4 (patch)
tree641e01985a209324b1e76f7af8237418881ab8b3 /src/server/game/Spells
parent67e7786ccc33119eeb3b08aed7c8ad52677d4b88 (diff)
*Core/Spells: Implement TARGET_UNIT_SUMMONER
*Rename TARGET_UNIT_MINIPET to TARGET_UNIT_TARGET_PUPPET. --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Spell.cpp10
-rw-r--r--src/server/game/Spells/SpellMgr.cpp4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 2a9d7ecbe8b..f65f7e5bb78 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2015,6 +2015,11 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
if (Guardian* pet = m_caster->GetGuardianPet())
AddUnitTarget(pet, i);
break;
+ case TARGET_UNIT_SUMMONER:
+ if (m_caster->isSummon())
+ if (Unit* unit = m_caster->ToTempSummon()->GetSummoner())
+ AddUnitTarget(unit, i);
+ break;
case TARGET_UNIT_PARTY_CASTER:
case TARGET_UNIT_RAID_CASTER:
pushType = PUSH_CASTER_CENTER;
@@ -2069,8 +2074,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
case TARGET_UNIT_TARGET_ALLY:
case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_PARTY:
- case TARGET_UNIT_MINIPET:
- case TARGET_UNIT_UNK_92:
+ case TARGET_UNIT_TARGET_PUPPET:
AddUnitTarget(target, i);
break;
case TARGET_UNIT_PARTY_TARGET:
@@ -6877,6 +6881,8 @@ bool Spell::IsValidSingleTargetEffect(Unit const* target, Targets type) const
return m_caster != target && m_caster->IsInPartyWith(target);
case TARGET_UNIT_TARGET_RAID:
return m_caster->IsInRaidWith(target);
+ case TARGET_UNIT_TARGET_PUPPET:
+ return target->HasUnitTypeMask(UNIT_MASK_PUPPET) && m_caster == target->GetOwner();
}
return true;
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 97092eed362..b69cc32139d 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -119,9 +119,10 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_PASSENGER_5:
case TARGET_UNIT_PASSENGER_6:
case TARGET_UNIT_PASSENGER_7:
+ case TARGET_UNIT_SUMMONER:
SpellTargetType[i] = TARGET_TYPE_UNIT_CASTER;
break;
- case TARGET_UNIT_MINIPET:
+ case TARGET_UNIT_TARGET_PUPPET:
case TARGET_UNIT_TARGET_ALLY:
case TARGET_UNIT_TARGET_RAID:
case TARGET_UNIT_TARGET_ANY:
@@ -130,7 +131,6 @@ SpellMgr::SpellMgr()
case TARGET_UNIT_PARTY_TARGET:
case TARGET_UNIT_CLASS_TARGET:
case TARGET_UNIT_CHAINHEAL:
- case TARGET_UNIT_UNK_92:
SpellTargetType[i] = TARGET_TYPE_UNIT_TARGET;
break;
case TARGET_UNIT_NEARBY_ENEMY: