Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.5] Scripts/Spells: Problems with mounts which change depending on your Riding skill and location #18627

Closed
ghost opened this issue Dec 27, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 27, 2016

Description:
You can fly with mounts which change depending on your Riding skill and location (e.g. 72286, Invincible) in some areas where it shouldn't be possible.
There are areas (e.g. 3479, The Veiled Sea on map 530) which don't have the AREA_FLAG_NO_FLY_ZONE flag but lie on the bc or northrend maps.

spell_generic.cpp

class spell_gen_mount

     uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
     if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
         canFly = true;

    AreaTableEntry const* area = sAreaTableStore.LookupEntry(target->GetAreaId());
    if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)))
        canFly = false;

Current behaviour: (Tell us what happens.)
You can fly with speed changing mounts in areas where you shouldn't be able to.

Expected behaviour: (Tell us what should happen instead.)

Steps to reproduce the problem:

  1. .go xyz -4264 -11335 6 530
  2. .cast 72286
  3. Jump

Branch(es): 3.3.5 / master (Tell us which branch(es) this issue affects.)
3.3.5

TC rev. hash/commit:
8fe8501

TDB version:
TDB 335.61

Operating system:
Debian, Windows 7

@ghost
Copy link

ghost commented Dec 27, 2016

 src/server/game/Spells/SpellMgr.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 02ff038..d9fccdc 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3496,6 +3496,10 @@ void SpellMgr::LoadSpellInfoCorrections()
         }
     }
 
+    // The Veiled Sea area in outlands (Draenei zone), client blocks casting flying mounts
+    if (AreaTableEntry* areaEntry = const_cast<AreaTableEntry*>(sAreaTableStore.LookupEntry(3479)))
+        areaEntry->flags |= AREA_FLAG_NO_FLY_ZONE;
+
     if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121)))
         properties->Type = SUMMON_TYPE_TOTEM;
     if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647))) // 52893
 

@ariel-
Copy link
Contributor

ariel- commented Dec 27, 2016

There are areas (e.g. 3479, The Veiled Sea on map 530) which don't have the AREA_FLAG_NO_FLY_ZONE flag but lie on the bc or northrend maps.

Can you fly with a regular flying mount in those zones? If not, then this script needs to replicate the check done in

// continent limitation (virtual continent)
(Btw this amount of code duplication is bad, the same spell_gen_mount script causes #16783)

@ghost
Copy link
Author

ghost commented Dec 27, 2016

No, you can't. regular flying mounts are blocked by the client.

@ariel-
Copy link
Contributor

ariel- commented Dec 29, 2016

On 2982785 does not fly, but mount doesn't appear either (spell cast fails due to not being in flyable zone).

I have checked and dbc correction is not necessary. I'll use proper spell functions for checking fly-ability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants