mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7207] Phase system development continue for DB/in_game objects
* Store phase mask for creatures/gameobjects/corpse in DB * Propertly set phase for summoned creatures/gameobjects/pets/corpses/spell related dynobjects * Select proper phase for spawned creature/gameobjects and save it in DB TODO: in game commands.
This commit is contained in:
parent
b5da610388
commit
aa24bd836e
29 changed files with 204 additions and 82 deletions
|
|
@ -530,10 +530,11 @@ bool Creature::AIM_Initialize()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Creature::Create (uint32 guidlow, Map *map, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
bool Creature::Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
{
|
||||
SetMapId(map->GetId());
|
||||
SetInstanceId(map->GetInstanceId());
|
||||
SetPhaseMask(phaseMask,false);
|
||||
|
||||
//oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0;
|
||||
const bool bResult = CreateFromProto(guidlow, Entry, team, data);
|
||||
|
|
@ -1063,10 +1064,10 @@ void Creature::SaveToDB()
|
|||
return;
|
||||
}
|
||||
|
||||
SaveToDB(GetMapId(), data->spawnMask);
|
||||
SaveToDB(GetMapId(), data->spawnMask,GetPhaseMask());
|
||||
}
|
||||
|
||||
void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
|
||||
void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
{
|
||||
// update in loaded data
|
||||
if (!m_DBTableGuid)
|
||||
|
|
@ -1098,6 +1099,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask)
|
|||
// data->guid = guid don't must be update at save
|
||||
data.id = GetEntry();
|
||||
data.mapid = mapid;
|
||||
data.phaseMask = phaseMask;
|
||||
data.displayid = displayId;
|
||||
data.equipmentId = GetEquipmentId();
|
||||
data.posX = GetPositionX();
|
||||
|
|
@ -1291,7 +1293,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
|||
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
|
||||
uint16 team = 0;
|
||||
if(!Create(guid,map,data->id,team,data))
|
||||
if(!Create(guid,map,data->phaseMask,data->id,team,data))
|
||||
return false;
|
||||
|
||||
Relocate(data->posX,data->posY,data->posZ,data->orientation);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue