[12660] Implement mount capabilities by Shauren.

Also  update AreaFlags enum, implement mount capabilities check at teleport.

----------------------------
commit is partially based on ec5eabdc69
This commit is contained in:
sanctum32 2013-08-05 23:43:55 +03:00 committed by Antz
parent a253344a02
commit 46d4f07052
8 changed files with 105 additions and 36 deletions

View file

@ -6105,12 +6105,13 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_AURA_MOUNTED:
{
if (m_caster->IsInWater())
return SPELL_FAILED_ONLY_ABOVEWATER;
if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->GetTransport())
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
if (spellEffect->EffectMiscValueB && !m_caster->GetMountCapability(spellEffect->EffectMiscValueB))
return SPELL_FAILED_NOT_HERE;
// Ignore map check if spell have AreaId. AreaId already checked and this prevent special mount spells
if (m_caster->GetTypeId() == TYPEID_PLAYER && !sMapStore.LookupEntry(m_caster->GetMapId())->IsMountAllowed() && !m_IsTriggeredSpell && !m_spellInfo->GetAreaGroupId())
return SPELL_FAILED_NO_MOUNTS_ALLOWED;