diff options
author | Machiavelli <none@none> | 2010-03-21 17:34:25 +0100 |
---|---|---|
committer | Machiavelli <none@none> | 2010-03-21 17:34:25 +0100 |
commit | 48051d1cd6e026c3b397e6719a61e16d1f8fa581 (patch) | |
tree | a4e5f6a6ea17bfb6358aa189a07b656434c744d5 | |
parent | 450b2fba9db1df41613193f3f7bc7805bce23db3 (diff) |
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
-rw-r--r-- | src/game/DBCStructure.h | 9 | ||||
-rw-r--r-- | src/game/Map.h | 1 | ||||
-rw-r--r-- | src/game/MovementHandler.cpp | 5 | ||||
-rw-r--r-- | src/game/Spell.cpp | 2 | ||||
-rw-r--r-- | src/shared/Database/SQLStorage.cpp | 4 |
5 files changed, 7 insertions, 14 deletions
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 956a7927bbf..326dba8223b 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -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) diff --git a/src/game/Map.h b/src/game/Map.h index 292431eeecb..682e05533f9 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -216,6 +216,7 @@ struct InstanceTemplate float startLocZ; float startLocO; uint32 script_id; + bool allowMount; }; enum LevelRequirementVsMode diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 522b35219db..b29d0fc1c2c 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -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 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d8cdfe3ee96..188864933d0 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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; diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp index d858ca21af0..a5c4a6523e2 100644 --- a/src/shared/Database/SQLStorage.cpp +++ b/src/shared/Database/SQLStorage.cpp @@ -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"); |