[Patch] Graveyards Returned

Before when you die you would appear at westfall if your alliance or the barrens if your horde, this fixes that and adds some missing graveyards.

Extract these to TrinityCoresrcservergameGlobals: http://filebeam.com/…55fe167ca751253

Files: ObjectMgr.cpp & ObjectMgr.h

Apply to World - SQL:


INSERT INTO `game_graveyard_zone` (`id`, `ghost_zone`, `faction`) VALUES

(1, 12, 0),

(2, 44, 0),

(5, 1, 0),

(33, 14, 0),

(102, 1, 0),

(589, 876, 0),

(853, 1497, 0),

(1476, 406, 0),

(1477, 65, 0),

(1493, 17, 0),

(1681, 15, 0),

(1720, 495, 0);

SQL Updates:


-- Adds missing spirit healer in Desolace

INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES

(217993, 6491, 1, 1, 1, 0, 0, -452.182, 2513.69, 92.8852, 6.1809, 300, 0, 0, 4120, 0, 0, 0, 0, 0);

Areas: Stormwind, Redridge Mountains, Dun Morogh, Durotar (Orgrimmar), Dun Morogh (Ironforge), GM Island, Tirisfal Glades (Undercity), Stonetalon Mountains, Dragonblight, The Barrens, Dustwallow Marsh, Howling Fjord - All in order from 1 to 1720

ObjectMgr.cpp:

[CODE]@@ -5738,6 +5738,21 @@ void ObjectMgr::LoadGraveyardZones()

sLog->outString();

}

-WorldSafeLocsEntry const *ObjectMgr::GetDefaultGraveYard(uint32 team)

-{

  • enum DefaultGraveyard

  • {

  • HORDE_GRAVEYARD = 10, // Crossroads

  • ALLIANCE_GRAVEYARD = 4, // Westfall

  • };

  • if (team == HORDE)

  • return sWorldSafeLocsStore.LookupEntry(HORDE_GRAVEYARD);

  • else if (team == ALLIANCE)

  • return sWorldSafeLocsStore.LookupEntry(ALLIANCE_GRAVEYARD);

  • else return NULL;

-}

WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)

{

// search for zone associated closest graveyard

@@ -5746,8 +5761,10 @@ void ObjectMgr::LoadGraveyardZones()

if (!zoneId)

{

if (z > -500)

  • {

sLog->outError(“ZoneId not found for map %u coords (%f, %f, %f)”, MapId, x, y, z);

  • return NULL;
  • return GetDefaultGraveYard(team);

  • }

}

// Simulate std. algorithm:

@@ -5765,7 +5782,7 @@ void ObjectMgr::LoadGraveyardZones()

if (graveLow == graveUp && !map->IsBattleArena())

{

sLog->outErrorDb(“Table game_graveyard_zone incomplete: Zone %u Team %u does not have a linked graveyard.”,

  • return NULL;
  • return GetDefaultGraveYard(team);

}

// at corpse map[/CODE]

ObjectMgr.h:


@@ -704,6 +704,7 @@ class ObjectMgr


		 GossipText const* GetGossipText(uint32 Text_ID) const;


-		WorldSafeLocsEntry const *GetDefaultGraveYard(uint32 team);

		 WorldSafeLocsEntry const *GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);

		 bool AddGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = true);

		 void RemoveGraveYardLink(uint32 id, uint32 zone, uint32 team, bool inDB = false);

Reply if you find any missing graveyards with the zone name. (You will spawn over your body if there is no graveyard)

Could you add some comments on the code so we know which areas are those?

And use a single insert query to insert everything.

And why is it in “Custom Code”?

didnt know where else to put it

nice work, btw have this been pushed?

No because c++ is hack, if you die on retail on a place without graveyard, and belive me, there are some, you are send to those default graveyards.