Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sql/updates/world/master/2026_01_06_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DELETE FROM `areatrigger_template` WHERE `Id`=29620 AND `IsCustom`=0;
INSERT INTO `areatrigger_template` (`Id`,`IsCustom`,`Flags`,`ActionSetId`,`ActionSetFlags`,`VerifiedBuild`) VALUES
(29620,0,0,0,0,64978);

DELETE FROM `areatrigger_create_properties` WHERE `Id`=25138 AND `IsCustom`=0;
INSERT INTO`areatrigger_create_properties` (`Id`,`IsCustom`,`AreaTriggerId`,`IsAreatriggerCustom`,`Flags`,`MoveCurveId`,`ScaleCurveId`,`MorphCurveId`,`FacingCurveId`,`AnimId`,`AnimKitId`,`DecalPropertiesId`,`SpellForVisuals`,`TimeToTargetScale`,`Speed`,`SpeedIsTime`,`Shape`,`ShapeData0`,`ShapeData1`,`ShapeData2`,`ShapeData3`,`ShapeData4`,`ShapeData5`,`ShapeData6`,`ShapeData7`,`ScriptName`,`VerifiedBuild`) VALUES
(25138,0,29620,0,0,0,0,0,0,-1,0,0,372784,15000,0,0,4,10,10,4,4,0.3,0.3,0,0,'',64978);

DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_pri_divine_word','spell_pri_divine_word_sanctuary','spell_pri_divine_word_sanctuary_heal');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(372760,'spell_pri_divine_word'),
(372784,'spell_pri_divine_word_sanctuary'),
(372787,'spell_pri_divine_word_sanctuary_heal');

DELETE FROM `spell_proc` WHERE `SpellId` IN (372760);
INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
(372760,0x00,6,0x10000400,0x00000000,0x00000020,0x00000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0,0,1); -- Divine Word
10 changes: 5 additions & 5 deletions src/server/game/DungeonFinding/LFGMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ void LFGMgr::LoadLFGDungeons()
continue;
}

dungeon.map = at->target_mapId;
dungeon.x = at->target_X;
dungeon.y = at->target_Y;
dungeon.z = at->target_Z;
dungeon.o = at->target_Orientation;
dungeon.map = at->Loc.GetMapId();
dungeon.x = at->Loc.GetPositionX();
dungeon.y = at->Loc.GetPositionY();
dungeon.z = at->Loc.GetPositionZ();
dungeon.o = at->Loc.GetOrientation();
}

if (dungeon.type != LFG_TYPE_RANDOM)
Expand Down
20 changes: 15 additions & 5 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18192,8 +18192,13 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol

// NOW player must have valid map
// load the player's map here if it's not already loaded
bool isNewMap = false;
if (!map)
{
map = sMapMgr->CreateMap(mapId, this);
isNewMap = true;
}

AreaTriggerTeleport const* areaTrigger = nullptr;
bool check = false;

Expand All @@ -18210,9 +18215,14 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
areaTrigger = sObjectMgr->GetGoBackTrigger(mapId);
check = true;
}
else if (instanceId && !sInstanceLockMgr.FindActiveInstanceLock(guid, { mapId, map->GetDifficultyID() })) // ... and instance is reseted then look for entrance.
else if (instanceId && isNewMap) // ... and instance is reseted then look for entrance.
{
areaTrigger = sObjectMgr->GetMapEntranceTrigger(mapId);
if (InstanceScript const* instanceScript = map->ToInstanceMap()->GetInstanceScript())
areaTrigger = sObjectMgr->GetWorldSafeLoc(instanceScript->GetEntranceLocation());

if (!areaTrigger)
areaTrigger = sObjectMgr->GetMapEntranceTrigger(mapId);

check = true;
}
}
Expand All @@ -18221,10 +18231,10 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const& hol
{
if (areaTrigger) // ... if we have an areatrigger, then relocate to new map/coordinates.
{
Relocate(areaTrigger->target_X, areaTrigger->target_Y, areaTrigger->target_Z, GetOrientation());
if (mapId != areaTrigger->target_mapId)
Relocate(areaTrigger->Loc);
if (mapId != areaTrigger->Loc.GetMapId())
{
mapId = areaTrigger->target_mapId;
mapId = areaTrigger->Loc.GetMapId();
map = sMapMgr->CreateMap(mapId, this);
}
}
Expand Down
24 changes: 7 additions & 17 deletions src/server/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7137,10 +7137,7 @@ Trinity::IteratorPair<std::unordered_map<uint32, WorldSafeLocsEntry>::const_iter

AreaTriggerTeleport const* ObjectMgr::GetAreaTrigger(uint32 trigger) const
{
AreaTriggerContainer::const_iterator itr = _areaTriggerStore.find(trigger);
if (itr != _areaTriggerStore.end())
return &itr->second;
return nullptr;
return Trinity::Containers::MapGetValuePtr(_areaTriggerStore, trigger);
}

AccessRequirement const* ObjectMgr::GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
Expand Down Expand Up @@ -7239,13 +7236,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
continue;
}

AreaTriggerTeleport& at = _areaTriggerStore[Trigger_ID];

at.target_mapId = portLoc->Loc.GetMapId();
at.target_X = portLoc->Loc.GetPositionX();
at.target_Y = portLoc->Loc.GetPositionY();
at.target_Z = portLoc->Loc.GetPositionZ();
at.target_Orientation = portLoc->Loc.GetOrientation();
_areaTriggerStore[Trigger_ID] = portLoc;

} while (result->NextRow());

Expand Down Expand Up @@ -7393,11 +7384,11 @@ AreaTriggerTeleport const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
uint32 entrance_map = parentId.value_or(mapEntry->CorpseMapID);
for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr)
{
if (itr->second.target_mapId == entrance_map)
if (itr->second->Loc.GetMapId() == entrance_map)
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
if (atEntry && atEntry->ContinentID == Map)
return &itr->second;
return itr->second;
}
}
return nullptr;
Expand All @@ -7410,11 +7401,10 @@ AreaTriggerTeleport const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
{
for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr)
{
if (itr->second.target_mapId == Map)
if (itr->second->Loc.GetMapId() == Map)
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
if (atEntry)
return &itr->second;
if (sAreaTriggerStore.HasRecord(itr->first))
return itr->second;
}
}
return nullptr;
Expand Down
11 changes: 2 additions & 9 deletions src/server/game/Globals/ObjectMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,7 @@ struct TC_GAME_API SpellClickInfo

typedef std::multimap<uint32, SpellClickInfo> SpellClickInfoContainer;

struct AreaTriggerTeleport
{
uint32 target_mapId;
float target_X;
float target_Y;
float target_Z;
float target_Orientation;
};
using AreaTriggerTeleport = WorldSafeLocsEntry;

struct AreaTriggerPolygon
{
Expand Down Expand Up @@ -986,7 +979,7 @@ class TC_GAME_API ObjectMgr
typedef std::unordered_map<uint32, Trinity::unique_trackable_ptr<Quest>> QuestContainer;
typedef std::unordered_map<uint32 /*questObjectiveId*/, QuestObjective const*> QuestObjectivesByIdContainer;

typedef std::unordered_map<uint32, AreaTriggerTeleport> AreaTriggerContainer;
typedef std::unordered_map<uint32, AreaTriggerTeleport const*> AreaTriggerContainer;

typedef std::unordered_map<uint32, uint32> AreaTriggerScriptContainer;

Expand Down
5 changes: 2 additions & 3 deletions src/server/game/Handlers/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder const& holder)

if (!pCurrChar->GetMap()->AddPlayerToMap(pCurrChar))
{
AreaTriggerTeleport const* at = sObjectMgr->GetGoBackTrigger(pCurrChar->GetMapId());
if (at)
pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation());
if (AreaTriggerTeleport const* at = sObjectMgr->GetGoBackTrigger(pCurrChar->GetMapId()))
pCurrChar->TeleportTo(at->Loc);
else
pCurrChar->TeleportTo(pCurrChar->m_homebind);
}
Expand Down
32 changes: 16 additions & 16 deletions src/server/game/Handlers/MiscHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::AreaTrigger::AreaTrigge
return;

bool teleported = false;
if (player->GetMapId() != at->target_mapId)
if (player->GetMapId() != at->Loc.GetMapId())
{
if (!player->IsAlive())
{
Expand All @@ -609,7 +609,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::AreaTrigger::AreaTrigge
uint32 corpseMap = player->GetCorpseLocation().GetMapId();
do
{
if (corpseMap == at->target_mapId)
if (corpseMap == at->Loc.GetMapId())
break;

InstanceTemplate const* corpseInstance = sObjectMgr->GetInstanceTemplate(corpseMap);
Expand All @@ -622,52 +622,52 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::AreaTrigger::AreaTrigge
return;
}

TC_LOG_DEBUG("maps", "MAP: Player '{}' has corpse in instance {} and can enter.", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' has corpse in instance {} and can enter.", player->GetName(), at->Loc.GetMapId());
}
else
TC_LOG_DEBUG("maps", "Map::CanPlayerEnter - player '{}' is dead but does not have a corpse!", player->GetName());
}

if (TransferAbortParams denyReason = Map::PlayerCannotEnter(at->target_mapId, player))
if (TransferAbortParams denyReason = Map::PlayerCannotEnter(at->Loc.GetMapId(), player))
{
switch (denyReason.Reason)
{
case TRANSFER_ABORT_MAP_NOT_ALLOWED:
TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter map with id {} which has no entry", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter map with id {} which has no entry", player->GetName(), at->Loc.GetMapId());
break;
case TRANSFER_ABORT_DIFFICULTY:
TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter instance map {} but the requested difficulty was not found", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter instance map {} but the requested difficulty was not found", player->GetName(), at->Loc.GetMapId());
break;
case TRANSFER_ABORT_NEED_GROUP:
TC_LOG_DEBUG("maps", "MAP: Player '{}' must be in a raid group to enter map {}", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' must be in a raid group to enter map {}", player->GetName(), at->Loc.GetMapId());
player->SendRaidGroupOnlyMessage(RAID_GROUP_ERR_ONLY, 0);
break;
case TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE:
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->Loc.GetMapId());
break;
case TRANSFER_ABORT_ALREADY_COMPLETED_ENCOUNTER:
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->Loc.GetMapId());
break;
case TRANSFER_ABORT_TOO_MANY_INSTANCES:
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because he has exceeded the maximum number of instances per hour.", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because he has exceeded the maximum number of instances per hour.", player->GetName(), at->Loc.GetMapId());
break;
case TRANSFER_ABORT_MAX_PLAYERS:
break;
case TRANSFER_ABORT_ZONE_IN_COMBAT:
break;
case TRANSFER_ABORT_NOT_FOUND:
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because instance is resetting.", player->GetName(), at->target_mapId);
TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because instance is resetting.", player->GetName(), at->Loc.GetMapId());
break;
default:
break;
}

if (denyReason.Reason != TRANSFER_ABORT_NEED_GROUP)
player->SendTransferAborted(at->target_mapId, denyReason.Reason, denyReason.Arg, denyReason.MapDifficultyXConditionId);
player->SendTransferAborted(at->Loc.GetMapId(), denyReason.Reason, denyReason.Arg, denyReason.MapDifficultyXConditionId);

if (!player->IsAlive() && player->HasCorpse())
{
if (player->GetCorpseLocation().GetMapId() == at->target_mapId)
if (player->GetCorpseLocation().GetMapId() == at->Loc.GetMapId())
{
player->ResurrectPlayer(0.5f);
player->SpawnCorpseBones();
Expand All @@ -684,11 +684,11 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPackets::AreaTrigger::AreaTrigge

if (!teleported)
{
WorldSafeLocsEntry const* entranceLocation = player->GetInstanceEntrance(at->target_mapId);
if (entranceLocation && player->GetMapId() != at->target_mapId)
WorldSafeLocsEntry const* entranceLocation = player->GetInstanceEntrance(at->Loc.GetMapId());
if (entranceLocation && player->GetMapId() != at->Loc.GetMapId())
player->TeleportTo(entranceLocation->Loc, TELE_TO_NOT_LEAVE_TRANSPORT);
else
player->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT);
player->TeleportTo(at->Loc, TELE_TO_NOT_LEAVE_TRANSPORT);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/server/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2907,6 +2907,10 @@ TransferAbortParams InstanceMap::CannotEnter(Player* player)
return lockError;
}

if (Group* owningGroup = GetOwningGroup())
if (!player->IsInGroup(owningGroup->GetGUID()))
return TRANSFER_ABORT_MAX_PLAYERS;

return Map::CannotEnter(player);
}

Expand Down
6 changes: 3 additions & 3 deletions src/server/scripts/Commands/cs_go.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,14 @@ class go_commandscript : public CommandScript
// try going to entrance
if (AreaTriggerTeleport const* exit = sObjectMgr->GetGoBackTrigger(mapId))
{
if (player->TeleportTo(exit->target_mapId, exit->target_X, exit->target_Y, exit->target_Z, exit->target_Orientation + M_PI))
if (player->TeleportTo(exit->Loc.GetMapId(), exit->Loc.GetPositionX(), exit->Loc.GetPositionY(), exit->Loc.GetPositionZ(), exit->Loc.GetOrientation() + M_PI))
{
handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_GATE, mapName, mapId);
return true;
}
else
{
uint32 const parentMapId = exit->target_mapId;
uint32 const parentMapId = exit->Loc.GetMapId();
char const* const parentMapName = ASSERT_NOTNULL(sMapStore.LookupEntry(parentMapId))->MapName[handler->GetSessionDbcLocale()];
handler->PSendSysMessage(LANG_COMMAND_GO_INSTANCE_GATE_FAILED, mapName, mapId, parentMapName, parentMapId);
}
Expand All @@ -501,7 +501,7 @@ class go_commandscript : public CommandScript
// try going to start
if (AreaTriggerTeleport const* entrance = sObjectMgr->GetMapEntranceTrigger(mapId))
{
if (player->TeleportTo(entrance->target_mapId, entrance->target_X, entrance->target_Y, entrance->target_Z, entrance->target_Orientation))
if (player->TeleportTo(entrance->Loc))
{
handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_START, mapName, mapId);
return true;
Expand Down
Loading
Loading