From ebfb4c05586498e9a2796bd64b923a82bbeb7004 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 6 Jun 2009 20:31:23 -0500 Subject: [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 --- src/game/Spell.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/game/Spell.cpp') 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()) -- cgit v1.2.3