Jump to content

Dalaran Restricted Flight Area


Recommended Posts

edit: Dalaran Restricted Flight Area Fix :)

//Patch file-> r1 crash found

//tested on rev.9626 and failed

edit: Patch file-> r2 http://filebeam.com/1f71c512e3966d93255777f58536803f

notes: Fixed crash from last rev. tested on rev.9626

edit: Patch file-> r3 http://filebeam.com/e733da84d17b761f1840bba5fae488fb

notes: Adds config option in mangos.conf enable/disable - tested on rev.9626

edit: Patch file-> r4 http://filebeam.com/c04c89d7bdfdf3b20587eac108f3bd77

notes: fixed text - tested on rev.9662

edit rev.5 never got uploaded and was lost

edit: Patch file-> r6 http://filebeam.com/d3f58f6009be42a8574d95248ffc3176

notes: clean up and fix some bugs with Restricted Flight Area - casting or not casting when it should - (tested on rev.9723)

edit: Patch file->r7 http://filebeam.com/65fe71c61b71fcbd183f43a410f464eb

notes: Added check for safe zones! + added isGameMaster check - (tested on rev.9723)

edit: Patch file->r8

notes: small clean up not uploaded

edit: Patch file->r9 http://filebeam.com/f217f455a2148a92955b1c7c1cf54259

notes: more cleaning - (tested on rev.9723)

edit: Patch file->r10 http://filebeam.com/3f86506c258131bf6008d303fad3a11a

notes: player spam fix - (tested on rev.9730)

Rev.10

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 33875a1..7110508 100644
--- 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_VALUE_COUNT
};

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

If you are having problems with the Restricted Flight Area debuff being casted in Krasus' Landing then you might want to look at this.

http://getmangos.eu/community/showthread.php?13451-Better-area-detection-for-Krasus-Landing

edit: well its not 100% blizzlike but its getting there :)

maybe someone here can help fix some of the things I could not get working so far :P

----What works so far----

1.If you are on Krasus' Landing you can mount and fly without being dismounted

2.If you fly into dalaran and you are under 700.0 PositionZ you will be giving Restricted Flight Area debuff and see text and hear sound

3.fly you go back over 700.0 Z || leave dalaran || go to Krasus' Landing - the debuff will be taken off

4.If you don't and the debuff hits 0 you will be dismounted and given a Parachute

5.when you hit the ground the Parachute will taken away

----What does not----

1.//Text is not sent the way it should edit: - Fixed in r4 !

2.//Screen should shake when you are given the debuff -- edit: (Does not do this anymore on retail thank you - piroy1337) - It might of never did that but I can't remember lol have not played on retail in over 3-1/2 months

3.There should be places in dalaran where you can land without being dismounted "safe-zones" edit: - Fixed in r7 still needs a little work

4.And some other smaller bugs edit: - most of them have been fixed

Link to comment
Share on other sites

  • 40 years later...

first of all thanks for your work, i am playing on retail

and just tested 5mins ago some things.

There is no Shake at all, so you can remove that from todo :P.

You could try to implement the TEXT after gaining the Debuff, by some Script dunno :P

like you mentioned about safezones, ALL places where it has grass are safezones :P

Link to comment
Share on other sites

Updated to rev.6! If you have any suggestions to make this work even better feel free to share them

thank you! :)

edit: forgot I was the last one to post before this lol sorry about that.

edit: Updated to rev.9 :)

make it so that when this patch is turned off (disabled), Dalaran is a zone where you can freely fly :P (so disabling results in the exact opposite)

Link to comment
Share on other sites

make it so that when this patch is turned off (disabled), Dalaran is a zone where you can freely fly :P (so disabling results in the exact opposite)

if its 0 thats is disabled you should be able to fly fleely :)

if its 1 its enabled

if its 2 its enabled with "SafeZones"

works fine just retested and checked it you can freely fly if config is set to 0 :)

Link to comment
Share on other sites

for prevent spamming for all players when 1 is concerned, change this :

PlayDirectSound(9417);
MonsterTextEmote("Warning: You've entered a no-fly zone and are about to be dismounted!", GetGUID(), true);

into this

PlayDirectSound(9417,this);
MonsterWhisper("Warning: You've entered a no-fly zone and are about to be dismounted!", GetGUID(), true);

Link to comment
Share on other sites

for prevent spamming for all players when 1 is concerned, change this :

PlayDirectSound(9417);
MonsterTextEmote("Warning: You've entered a no-fly zone and are about to be dismounted!", GetGUID(), true);

into this

PlayDirectSound(9417,this);
MonsterWhisper("Warning: You've entered a no-fly zone and are about to be dismounted!", GetGUID(), true);

Thank you fixed in rev.10

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use