diff options
| author | megamage <none@none> | 2009-06-06 20:31:23 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-06-06 20:31:23 -0500 |
| commit | ebfb4c05586498e9a2796bd64b923a82bbeb7004 (patch) | |
| tree | e13aa0c3c6232b194f84e9aacf491b2d0ad5fb58 /src/game/Spell.cpp | |
| parent | 724e5fe5ce7c91f9f144602a94720a33da845777 (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.cpp | 9 |
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()) |
