mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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
|
|
@ -135,7 +135,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||
Map *map = owner->GetMap();
|
||||
uint32 guid = objmgr.GenerateLowGuid(HIGHGUID_PET);
|
||||
uint32 pet_number = fields[0].GetUInt32();
|
||||
if(!Create(guid, map, petentry, pet_number))
|
||||
if(!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
|
||||
{
|
||||
delete result;
|
||||
return false;
|
||||
|
|
@ -716,7 +716,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
|||
|
||||
sLog.outBasic("Create pet");
|
||||
uint32 pet_number = objmgr.GeneratePetNumber();
|
||||
if(!Create(guid, creature->GetMap(), creature->GetEntry(), pet_number))
|
||||
if(!Create(guid, creature->GetMap(), creature->GetPhaseMask(), creature->GetEntry(), pet_number))
|
||||
return false;
|
||||
|
||||
Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation());
|
||||
|
|
@ -1667,10 +1667,11 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
|||
}
|
||||
}
|
||||
|
||||
bool Pet::Create(uint32 guidlow, Map *map, uint32 Entry, uint32 pet_number)
|
||||
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
|
||||
{
|
||||
SetMapId(map->GetId());
|
||||
SetInstanceId(map->GetInstanceId());
|
||||
SetPhaseMask(phaseMask,false);
|
||||
|
||||
Object::_Create(guidlow, pet_number, HIGHGUID_PET);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue