mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[6813] Allow have team dependent graveyards at entrance map for instances.
Entrance map graveyards selected by same way as local (by distance from entrance) Until DB support will work in old way base at current DB data.
This commit is contained in:
parent
1346f394be
commit
755717e8ac
7 changed files with 66 additions and 42 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
DROP TABLE IF EXISTS `db_version`;
|
DROP TABLE IF EXISTS `db_version`;
|
||||||
CREATE TABLE `db_version` (
|
CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`required_2008_11_09_02_mangos_command` bit(1) default NULL
|
`required_2008_11_09_03_mangos_mangos_string` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -2474,7 +2474,6 @@ INSERT INTO `mangos_string` VALUES
|
||||||
(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(450,'Graveyard #%u already linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(451,'Graveyard #%u linked to zone #%u (current).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(452,'Graveyard #%u can\'t be linked to subzone or not existed zone #%u (internal error).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(453,'Graveyard can be linked to zone at another map only for all factions (no faction value).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
|
||||||
(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(454,'No faction in Graveyard with id= #%u , fix your DB',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(455,'invalid team, please fix database',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(456,'any',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
|
|
||||||
|
|
@ -388,7 +388,7 @@ enum MangosStrings
|
||||||
LANG_COMMAND_GRAVEYARDALRLINKED = 450,
|
LANG_COMMAND_GRAVEYARDALRLINKED = 450,
|
||||||
LANG_COMMAND_GRAVEYARDLINKED = 451,
|
LANG_COMMAND_GRAVEYARDLINKED = 451,
|
||||||
LANG_COMMAND_GRAVEYARDWRONGZONE = 452,
|
LANG_COMMAND_GRAVEYARDWRONGZONE = 452,
|
||||||
LANG_COMMAND_GRAVEYARDWRONGTEAM = 453,
|
// = 453,
|
||||||
LANG_COMMAND_GRAVEYARDERROR = 454,
|
LANG_COMMAND_GRAVEYARDERROR = 454,
|
||||||
LANG_COMMAND_GRAVEYARD_NOTEAM = 455,
|
LANG_COMMAND_GRAVEYARD_NOTEAM = 455,
|
||||||
LANG_COMMAND_GRAVEYARD_ANY = 456,
|
LANG_COMMAND_GRAVEYARD_ANY = 456,
|
||||||
|
|
|
||||||
|
|
@ -3527,13 +3527,6 @@ bool ChatHandler::HandleLinkGraveCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(graveyard->map_id != areaEntry->mapid && g_team != 0)
|
|
||||||
{
|
|
||||||
SendSysMessage(LANG_COMMAND_GRAVEYARDWRONGTEAM);
|
|
||||||
SetSentErrorMessage(true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(objmgr.AddGraveYardLink(g_id,player->GetZoneId(),g_team))
|
if(objmgr.AddGraveYardLink(g_id,player->GetZoneId(),g_team))
|
||||||
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
|
PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -4732,12 +4732,6 @@ void ObjectMgr::LoadGraveyardZones()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entry->map_id != areaEntry->mapid && team != 0)
|
|
||||||
{
|
|
||||||
sLog.outErrorDb("Table `game_graveyard_zone` has record for ghost zone (%u) at map %u and graveyard (%u) at map %u for team %u, but in case maps are different, player faction setting is ignored. Use faction 0 instead.",zoneId,areaEntry->mapid, safeLocId, entry->map_id, team);
|
|
||||||
team = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!AddGraveYardLink(safeLocId,zoneId,team,false))
|
if(!AddGraveYardLink(safeLocId,zoneId,team,false))
|
||||||
sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId);
|
sLog.outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId);
|
||||||
} while( result->NextRow() );
|
} while( result->NextRow() );
|
||||||
|
|
@ -4759,7 +4753,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||||
// if mapId == graveyard.mapId (ghost in plain zone or city or battleground) and search graveyard at same map
|
// if mapId == graveyard.mapId (ghost in plain zone or city or battleground) and search graveyard at same map
|
||||||
// then check faction
|
// then check faction
|
||||||
// if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated
|
// if mapId != graveyard.mapId (ghost in instance) and search any graveyard associated
|
||||||
// then skip check faction
|
// then check faction
|
||||||
GraveYardMap::const_iterator graveLow = mGraveYardMap.lower_bound(zoneId);
|
GraveYardMap::const_iterator graveLow = mGraveYardMap.lower_bound(zoneId);
|
||||||
GraveYardMap::const_iterator graveUp = mGraveYardMap.upper_bound(zoneId);
|
GraveYardMap::const_iterator graveUp = mGraveYardMap.upper_bound(zoneId);
|
||||||
if(graveLow==graveUp)
|
if(graveLow==graveUp)
|
||||||
|
|
@ -4768,11 +4762,21 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// at corpse map
|
||||||
bool foundNear = false;
|
bool foundNear = false;
|
||||||
float distNear;
|
float distNear;
|
||||||
WorldSafeLocsEntry const* entryNear = NULL;
|
WorldSafeLocsEntry const* entryNear = NULL;
|
||||||
|
|
||||||
|
// at entrance map for corpse map
|
||||||
|
bool foundEntr = false;
|
||||||
|
float distEntr;
|
||||||
|
WorldSafeLocsEntry const* entryEntr = NULL;
|
||||||
|
|
||||||
|
// some where other
|
||||||
WorldSafeLocsEntry const* entryFar = NULL;
|
WorldSafeLocsEntry const* entryFar = NULL;
|
||||||
|
|
||||||
|
MapEntry const* mapEntry = sMapStore.LookupEntry(MapId);
|
||||||
|
|
||||||
for(GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
for(GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||||
{
|
{
|
||||||
GraveYardData const& data = itr->second;
|
GraveYardData const& data = itr->second;
|
||||||
|
|
@ -4784,40 +4788,68 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remember first graveyard at another map and ignore other
|
// skip enemy faction graveyard
|
||||||
if(MapId != entry->map_id)
|
|
||||||
{
|
|
||||||
if(!entryFar)
|
|
||||||
entryFar = entry;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// skip enemy faction graveyard at same map (normal area, city, or battleground)
|
|
||||||
// team == 0 case can be at call from .neargrave
|
// team == 0 case can be at call from .neargrave
|
||||||
if(data.team != 0 && team != 0 && data.team != team)
|
if(data.team != 0 && team != 0 && data.team != team)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// find now nearest graveyard at same map
|
// find now nearest graveyard at other map
|
||||||
float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z);
|
if(MapId != entry->map_id)
|
||||||
if(foundNear)
|
|
||||||
{
|
{
|
||||||
if(dist2 < distNear)
|
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
|
||||||
|
if (!mapEntry || mapEntry->entrance_map < 0 || mapEntry->entrance_map != entry->map_id ||
|
||||||
|
mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)
|
||||||
{
|
{
|
||||||
|
// not have any corrdinates for check distance anyway
|
||||||
|
entryFar = entry;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// at entrance map calculate distance (2D);
|
||||||
|
float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x)
|
||||||
|
+(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y);
|
||||||
|
if(foundEntr)
|
||||||
|
{
|
||||||
|
if(dist2 < distEntr)
|
||||||
|
{
|
||||||
|
distEntr = dist2;
|
||||||
|
entryEntr = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foundEntr = true;
|
||||||
|
distEntr = dist2;
|
||||||
|
entryEntr = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// find now nearest graveyard at same map
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z);
|
||||||
|
if(foundNear)
|
||||||
|
{
|
||||||
|
if(dist2 < distNear)
|
||||||
|
{
|
||||||
|
distNear = dist2;
|
||||||
|
entryNear = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foundNear = true;
|
||||||
distNear = dist2;
|
distNear = dist2;
|
||||||
entryNear = entry;
|
entryNear = entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
foundNear = true;
|
|
||||||
distNear = dist2;
|
|
||||||
entryNear = entry;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entryNear)
|
if(entryNear)
|
||||||
return entryNear;
|
return entryNear;
|
||||||
|
|
||||||
|
if(entryEntr)
|
||||||
|
return entryEntr;
|
||||||
|
|
||||||
return entryFar;
|
return entryFar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4988,7 +5020,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||||
if(!mapEntry) return NULL;
|
if(!mapEntry) return NULL;
|
||||||
for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); itr++)
|
for (AreaTriggerMap::const_iterator itr = mAreaTriggers.begin(); itr != mAreaTriggers.end(); itr++)
|
||||||
{
|
{
|
||||||
if(itr->second.target_mapId == mapEntry->parent_map)
|
if(itr->second.target_mapId == mapEntry->entrance_map)
|
||||||
{
|
{
|
||||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
|
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
|
||||||
if(atEntry && atEntry->mapid == Map)
|
if(atEntry && atEntry->mapid == Map)
|
||||||
|
|
|
||||||
|
|
@ -408,9 +408,9 @@ struct MapEntry
|
||||||
// 99 text flags
|
// 99 text flags
|
||||||
//chat* unknownText2 // 100-115 unknown empty text fields
|
//chat* unknownText2 // 100-115 unknown empty text fields
|
||||||
// 116 text flags
|
// 116 text flags
|
||||||
int32 parent_map; // 117 map_id of parent map
|
int32 entrance_map; // 117 map_id of entrance map
|
||||||
//float start_x // 118 enter x coordinate (if exist single entry)
|
float entrance_x; // 118 entrance x coordinate (if exist single entry)
|
||||||
//float start_y // 119 enter y coordinate (if exist single entry)
|
float entrance_y; // 119 entrance y coordinate (if exist single entry)
|
||||||
uint32 resetTimeRaid; // 120
|
uint32 resetTimeRaid; // 120
|
||||||
uint32 resetTimeHeroic; // 121
|
uint32 resetTimeHeroic; // 121
|
||||||
// 122-123
|
// 122-123
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ const char ItemRandomSuffixfmt[]="nxxxxxxxxxxxxxxxxxxiiiiii";
|
||||||
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
const char ItemSetEntryfmt[]="dssssssssssssssssxxxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiiiii";
|
||||||
const char LockEntryfmt[]="niiiiixxxiiiiixxxiixxxxxxxxxxxxxx";
|
const char LockEntryfmt[]="niiiiixxxiiiiixxxiixxxxxxxxxxxxxx";
|
||||||
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||||
const char MapEntryfmt[]="nxixssssssssssssssssxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxiixxi";
|
const char MapEntryfmt[]="nxixssssssssssssssssxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiffiixxi";
|
||||||
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
|
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||||
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
|
const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii";
|
||||||
const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
const char SkillLinefmt[]="nixssssssssssssssssxxxxxxxxxxxxxxxxxxi";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6812"
|
#define REVISION_NR "6813"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue