Add support field 'allowMount' to instance_template table (see http://trinitydatabase.org/index.php?/topic/14994-7656-instance-template/), this will define whether or not mounting is allowed in an instance, instead of defining it hard coded in the core.
--HG-- branch : trunk
This commit is contained in:
@@ -1145,15 +1145,6 @@ struct MapEntry
|
||||
bool IsBattleArena() const { return map_type == MAP_ARENA; }
|
||||
bool IsBattleGroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
|
||||
|
||||
bool IsMountAllowed() const
|
||||
{
|
||||
return !IsDungeon() ||
|
||||
MapID==209 || MapID==269 || MapID==309 || // TanarisInstance, CavernsOfTime, Zul'gurub
|
||||
MapID==509 || MapID==534 || MapID==560 || // AhnQiraj, HyjalPast, HillsbradPast
|
||||
MapID==568 || MapID==580 || MapID==615 || // ZulAman, Sunwell Plateau, Obsidian Sanctrum
|
||||
MapID==616 || MapID==595; // Eye Of Eternity, The Culling of Stratholme
|
||||
}
|
||||
|
||||
bool GetEntrancePos(int32 &mapid, float &x, float &y) const
|
||||
{
|
||||
if(entrance_map < 0)
|
||||
|
||||
@@ -216,6 +216,7 @@ struct InstanceTemplate
|
||||
float startLocZ;
|
||||
float startLocO;
|
||||
uint32 script_id;
|
||||
bool allowMount;
|
||||
};
|
||||
|
||||
enum LevelRequirementVsMode
|
||||
|
||||
@@ -149,6 +149,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
}
|
||||
}
|
||||
|
||||
bool allowMount = !mEntry->IsDungeon();
|
||||
if (mInstance)
|
||||
{
|
||||
Difficulty diff = GetPlayer()->GetDifficulty(mEntry->IsRaid());
|
||||
@@ -156,7 +157,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
{
|
||||
if (mapDiff->resetTime)
|
||||
{
|
||||
|
||||
if (uint32 timeReset = sInstanceSaveManager.GetResetTimeFor(mEntry->MapID,diff))
|
||||
{
|
||||
uint32 timeleft = timeReset - time(NULL);
|
||||
@@ -164,10 +164,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
||||
}
|
||||
}
|
||||
}
|
||||
allowMount = mInstance->allowMount;
|
||||
}
|
||||
|
||||
// mount allow check
|
||||
if(!mEntry->IsMountAllowed())
|
||||
if (!allowMount)
|
||||
_player->RemoveAurasByType(SPELL_AURA_MOUNTED);
|
||||
|
||||
// update zone immediately, otherwise leave channel will cause crash in mtmap
|
||||
|
||||
+1
-1
@@ -5315,7 +5315,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
|
||||
|
||||
// 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->AreaGroupId)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !objmgr.GetInstanceTemplate(m_caster->GetMapId())->allowMount && !m_IsTriggeredSpell && !m_spellInfo->AreaGroupId)
|
||||
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
|
||||
|
||||
ShapeshiftForm form = m_caster->m_form;
|
||||
|
||||
@@ -38,8 +38,8 @@ const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii";
|
||||
const char ItemPrototypesrcfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiisiiiii";
|
||||
const char ItemPrototypedstfmt[]="iiiisiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiffiiiiiiiiiifiiifiiiiiifiiiiiifiiiiiifiiiiiifiiiisiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiii";
|
||||
const char PageTextfmt[]="isii";
|
||||
const char InstanceTemplatesrcfmt[]="iiiffffs";
|
||||
const char InstanceTemplatedstfmt[]="iiiffffi";
|
||||
const char InstanceTemplatesrcfmt[]="iiiffffsb";
|
||||
const char InstanceTemplatedstfmt[]="iiiffffib";
|
||||
|
||||
SQLStorage sCreatureStorage(CreatureInfosrcfmt, CreatureInfodstfmt, "entry","creature_template");
|
||||
SQLStorage sCreatureDataAddonStorage(CreatureDataAddonInfofmt,"guid","creature_addon");
|
||||
|
||||
Reference in New Issue
Block a user