[7971] Implement support exotic pets limtations related to hunter telent 53270.

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.
This commit is contained in:
VladimirMangos 2009-06-06 21:14:43 +04:00
parent 01d93fa10d
commit 5ac6b2f34b
10 changed files with 106 additions and 39 deletions

View file

@ -4111,14 +4111,19 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_TAMECREATURE:
{
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())