禁止在达拉然飞行的代码
--- a/src/game/Player.cpp+++ b/src/game/Player.cpp
@@ -1385,6 +1385,45 @@ void Player::Update( uint32 p_time )
//because we don't want player's ghost teleported from graveyard
if(IsHasDelayedTeleport() && isAlive())
TeleportTo(m_teleport_dest, m_teleport_options);
+
+ uint32 DalaranRestrictedFlightArea = sWorld.getConfig(CONFIG_UINT32_DALARAN_RESTRICTED_FLIGHT_AREA);
+
+ if (DalaranRestrictedFlightArea >= 1)
+ {
+ if (GetMapId() == 571 && IsInWorld())
+ {
+ if (GetPositionZ() > 640.0 && GetPositionZ() < 700.0 && GetZoneId() == 4395 && GetAreaId() != 4564 && CanFly() && !isGameMaster())
+ {
+ if (!HasAura(58600) && !HasAura(61243)) // Check for Restricted Flight Area and Parachute Visual
+ {
+ if ((DalaranRestrictedFlightArea != 2) ||
+ !((GetPositionX()-5886.80f)*(GetPositionX()-5886.80f)+(GetPositionY()-651.28f)*(GetPositionY()-651.28f) < 29.89 || // The Well by the North Bank
+ (GetPositionX()-5711.05f)*(GetPositionX()-5711.05f)+(GetPositionY()-646.02f)*(GetPositionY()-646.02f) < 37.70 || // The spinning thing in the middle of The Eventide
+ (GetPositionX()-5816.89f)*(GetPositionX()-5816.89f)+(GetPositionY()-745.91f)*(GetPositionY()-745.91f) < 548.24 || // The grass by The Violet Citadel
+ GetAreaId() == 4619)) // The Violet Citadel
+ {
+ CastSpell(this, 58600, true);
+ PlayDirectSound(9417, this);
+ MonsterWhisper("Warning: You've entered a no-fly zone and are about to be dismounted!", GetGUID(), true);
+ }
+ }
+ }
+ else if (HasAura(58600)) // Restricted Flight Area
+ {
+ RemoveAurasDueToSpell(58600);
+ }
+ if (HasAura(61243)) // Parachute Visual
+ {
+ float x, y, z;
+ GetPosition(x, y, z);
+ float ground_Z = GetMap()->GetHeight(x, y, z, true);
+ if (fabs(ground_Z - z) < 0.1f)
+ {
+ RemoveAurasDueToSpell(61243);
+ }
+ }
+ }
+ }
}
void Player::setDeathState(DeathState s)
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 35362de..8c1e83f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2509,11 +2509,13 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
case 58600: // Restricted Flight Area
{
- // Remove Flight Auras
- m_target->CastSpell(m_target, 58601, true);
- // Parachute
- m_target->CastSpell(m_target, 45472, true);
+ if (GetAuraDuration() == 0)
+ {
+ m_target->CastSpell(m_target, 58601, true); // Remove Flight Auras
+ m_target->CastSpell(m_target, 45472, true); // Parachute Buff
+ m_target->CastSpell(m_target, 61243, true); // Parachute Visual
return;
+ }
}
}
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 30b093a..6fa6960 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -592,6 +592,8 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_ALL_TAXI_PATHS, "AllFlightPaths", false);
+ setConfig(CONFIG_UINT32_DALARAN_RESTRICTED_FLIGHT_AREA, "DalaranRestrictedFlightArea", 0);
+
setConfig(CONFIG_BOOL_INSTANCE_IGNORE_LEVEL, "Instance.IgnoreLevel", false);
setConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID, "Instance.IgnoreRaid", false);
diff --git a/src/game/World.h b/src/game/World.h
index a4e4f6f..26909a0 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -177,6 +177,7 @@ enum eConfigUInt32Values
CONFIG_UINT32_TIMERBAR_FIRE_GMLEVEL,
CONFIG_UINT32_TIMERBAR_FIRE_MAX,
CONFIG_UINT32_MIN_LEVEL_STAT_SAVE,
+ CONFIG_UINT32_DALARAN_RESTRICTED_FLIGHT_AREA,
CONFIG_UINT32_CHARDELETE_KEEP_DAYS,
CONFIG_UINT32_CHARDELETE_METHOD,
CONFIG_UINT32_CHARDELETE_MIN_LEVEL,
diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in
index 5d4053f..b7d86f4 100644
--- a/src/mangosd/mangosd.conf.dist.in
+++ b/src/mangosd/mangosd.conf.dist.in
@@ -506,6 +506,12 @@ LogColors = ""
# Default: 0 (false)
# 1 (true)
#
+# DalaranRestrictedFlightArea
+# Players that try to fly over Dalaran for more than 10 sec will be dismounted.
+# Default 0 (Disabled)
+# 1 (Enable.DalaranRestrictedFlightArea)
+# 2 (Enable.SafeZones+1)
+#
# AlwaysMaxSkillForLevel
# Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc.
# Default: 0 (false)
@@ -687,6 +693,7 @@ StartArenaPoints = 0
InstantLogout = 1
DisableWaterBreath = 4
AllFlightPaths = 0
+DalaranRestrictedFlightArea = 0
AlwaysMaxSkillForLevel = 0
ActivateWeather = 1
CastUnstuck = 1
|