aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-06 20:31:23 -0500
committermegamage <none@none>2009-06-06 20:31:23 -0500
commitebfb4c05586498e9a2796bd64b923a82bbeb7004 (patch)
treee13aa0c3c6232b194f84e9aacf491b2d0ad5fb58 /src/game/Spell.cpp
parent724e5fe5ce7c91f9f144602a94720a33da845777 (diff)
[7971] Implement support exotic pets limtations related to hunter telent 53270. Author: VladimirMangos
Note: before this commit hunters can tame exotic pets like any other. After patch like not propertly contriolled pets will auto-dismiss at loading if talent not learned. --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index f7fb0137c78..a40f184cb61 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4672,14 +4672,19 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
case 1515:
{
+ if (m_caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_BAD_TARGETS;
+
if (!m_targets.getUnitTarget() || m_targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
- if (m_targets.getUnitTarget()->getLevel() > m_caster->getLevel())
+ Creature* target = (Creature*)m_targets.getUnitTarget();
+
+ if (target->getLevel() > m_caster->getLevel())
return SPELL_FAILED_HIGHLEVEL;
// use SMSG_PET_TAME_FAILURE?
- if (!((Creature*)m_targets.getUnitTarget())->GetCreatureInfo()->isTameable ())
+ if (!target->GetCreatureInfo()->isTameable (((Player*)m_caster)->CanTameExoticPets()))
return SPELL_FAILED_BAD_TARGETS;
if(m_caster->GetPetGUID())