*Core/Spells: Implement TARGET_UNIT_SUMMONER

*Rename TARGET_UNIT_MINIPET to TARGET_UNIT_TARGET_PUPPET.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-08-17 20:19:06 +02:00
parent 67e7786ccc
commit 0284ed4cfe
3 changed files with 12 additions and 6 deletions
+8 -2
View File
@@ -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;
}
+2 -2
View File
@@ -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: