mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -1453,7 +1453,7 @@ public:
|
||||
else if (target->GetDBPhase() < 0)
|
||||
handler->PSendSysMessage("Target creature's PhaseGroup in DB: %d", abs(target->GetDBPhase()));
|
||||
|
||||
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
|
||||
PhasingHandler::PrintToChat(handler, target);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
return false;
|
||||
|
||||
/// @todo is it really necessary to add both the real and DB table guid here ?
|
||||
sObjectMgr->AddGameobjectToGrid(spawnId, ASSERT_NOTNULL(sObjectMgr->GetGameObjectData(spawnId)));
|
||||
sObjectMgr->AddGameobjectToGrid(ASSERT_NOTNULL(sObjectMgr->GetGameObjectData(spawnId)));
|
||||
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), std::to_string(spawnId).c_str(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
return true;
|
||||
@@ -487,9 +487,9 @@ public:
|
||||
object->Relocate(x, y, z, object->GetOrientation());
|
||||
|
||||
// update which cell has this gameobject registered for loading
|
||||
sObjectMgr->RemoveGameobjectFromGrid(guidLow, object->GetGameObjectData());
|
||||
sObjectMgr->RemoveGameobjectFromGrid(object->GetGameObjectData());
|
||||
object->SaveToDB();
|
||||
sObjectMgr->AddGameobjectToGrid(guidLow, object->GetGameObjectData());
|
||||
sObjectMgr->AddGameobjectToGrid(object->GetGameObjectData());
|
||||
|
||||
// Generate a completely new spawn with new guid
|
||||
// 3.3.5a client caches recently deleted objects and brings them back to life
|
||||
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
if (status)
|
||||
handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, uint32(liquidStatus.type_flags.AsUnderlyingType()), status);
|
||||
|
||||
PhasingHandler::PrintToChat(handler, object->GetPhaseShift());
|
||||
PhasingHandler::PrintToChat(handler, object);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1905,7 +1905,7 @@ public:
|
||||
|
||||
// Output XIII. phases
|
||||
if (target)
|
||||
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
|
||||
PhasingHandler::PrintToChat(handler, target);
|
||||
|
||||
// Output XIV. LANG_PINFO_CHR_MONEY
|
||||
uint32 gold = money / GOLD;
|
||||
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
if (Creature* creature = trans->CreateNPCPassenger(guid, &data))
|
||||
{
|
||||
creature->SaveToDB(trans->GetGOInfo()->moTransport.SpawnMap, { map->GetDifficultyID() });
|
||||
sObjectMgr->AddCreatureToGrid(guid, &data);
|
||||
sObjectMgr->AddCreatureToGrid(&data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
if (!creature)
|
||||
return false;
|
||||
|
||||
sObjectMgr->AddCreatureToGrid(db_guid, sObjectMgr->GetCreatureData(db_guid));
|
||||
sObjectMgr->AddCreatureToGrid(sObjectMgr->GetCreatureData(db_guid));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -697,7 +697,7 @@ public:
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(target->GetSpawnId()))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseId, data->phaseGroup);
|
||||
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
|
||||
PhasingHandler::PrintToChat(handler, target);
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
|
||||
@@ -812,9 +812,9 @@ public:
|
||||
}
|
||||
|
||||
// update position in memory
|
||||
sObjectMgr->RemoveCreatureFromGrid(lowguid, data);
|
||||
sObjectMgr->RemoveCreatureFromGrid(data);
|
||||
const_cast<CreatureData*>(data)->spawnPoint.Relocate(*player);
|
||||
sObjectMgr->AddCreatureToGrid(lowguid, data);
|
||||
sObjectMgr->AddCreatureToGrid(data);
|
||||
|
||||
// update position in DB
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
|
||||
Reference in New Issue
Block a user