Jump to content

[7545] [fix] Exploration achievements


Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

There were some areas in the world map which did not give the exploration achievement after being discovered, or you'd have to discover a different area to get the achievement. That was because there are four columns in WorldMapOverlay.dbc which describe the potential area ids used to check the completion of the achievement, but the original code only compared the first one.

This generic patch fixes Splitertree Post, The Black Temple, Kirin'var Village, Ruins of the Scarlet Enclave, and (maybe) some of the Northrend areas. Note: Undercity is a different story, so it won't get fixed with this patch.

For which repository revision was the patch created?

7517

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

http://getmangos.eu/community/viewtopic.php?id=6761

diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 59e2c53..18db0ef 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -723,14 +723,24 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
                if(!worldOverlayEntry)
                    break;

-                int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID);
-                if(exploreFlag < 0)
-                    break;
+                bool matchFound = false;
+                for (int i = 0; i < 3; ++i)
+                {
+                    int32 exploreFlag = GetAreaFlagByAreaID(worldOverlayEntry->areatableID[i]);
+                    if(exploreFlag < 0)
+                        break;
+
+                    uint32 playerIndexOffset = uint32(exploreFlag) / 32;
+                    uint32 mask = 1<< (uint32(exploreFlag) % 32);

-                uint32 playerIndexOffset = uint32(exploreFlag) / 32;
-                uint32 mask = 1<< (uint32(exploreFlag) % 32);
+                    if(GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
+                    {
+                        matchFound = true;
+                        break;
+                    }
+                }

-                if(GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask)
+                if(matchFound)
                    SetCriteriaProgress(achievementCriteria, 1);
                break;
            }
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
index 2f1b0b1..9a78202 100644
--- a/src/shared/Database/DBCStructure.h
+++ b/src/shared/Database/DBCStructure.h
@@ -1609,7 +1609,7 @@ struct WorldSafeLocsEntry
struct WorldMapOverlayEntry
{
    uint32    ID;                                           // 0
-    uint32    areatableID;                                  // 2
+    uint32    areatableID[4];                               // 2
};

// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp
index 5049fcd..c46e861 100644
--- a/src/shared/Database/DBCfmt.cpp
+++ b/src/shared/Database/DBCfmt.cpp
@@ -96,4 +96,4 @@ const char VehicleEntryfmt[]="niffffiiiiiiiiffffiiiiiifffffffffffssssfifi";
const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiii";
const char WorldMapAreaEntryfmt[]="xinxffffix";
const char WorldSafeLocsEntryfmt[]="nifffxxxxxxxxxxxxxxxxx";
-const char WorldMapOverlayEntryfmt[]="nxixxxxxxxxxxxxxx";
+const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxxxx";

Edit:

A quick (and hacky) fix for Undercity (I know that this is not the proper way, but if someone want to fix this too...)

@@ -1645,10 +1645,15 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
        // Dalaran
        case 1593:
        case 2484:
        case 2492:
            if( (x < 6116 && x > 5568) && (y < 982 && y > 282) && z > 563.0f) areaflag = 2153; break;
+        // Undercity
+        case 607:                                           // Ruins of Lordaeron
+            if (((x < 1850) && (y > 6) && (y < 443)) ||
+                ((x < 1877.2f) && (y > 233) && (y < 242)) ||
+                ((x < 1866) && (y > 224) && (y < 252))) areaflag = 685; break;
    }

    return areaflag;
}

Link to comment
Share on other sites

  • 39 years later...

Hmm dunno if it's relevant, but there's a way atm to explore The Black Temple.

You've gotta try to fly over the wall behind the Doomwalker (just try to get over the edge of the wall) and you get the explore thingy :)

I don't think this is the right way to do it, and i doubt it's offi-like :P

Link to comment
Share on other sites

Some people are having Undercity, wich they've discovered long ago. Undercity was unexplorable since a year ago, more or less.

As far as I know Undercity is hacked, that's why it have a different behavior. Hoping get that fixed too anytime soon :)

Some poeople do have Undercity explored, because one revision (when switching to 2.3 patch or something like that) did mess player data blob and many areay players explored become unexplored and vice versa.

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