mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-17 01:04:34 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -147,7 +147,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -158,7 +158,8 @@ public:
|
||||
case DATA_DOOR_WHITEMANE:
|
||||
return DoorHighInquisitorGUID;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
@@ -168,9 +169,9 @@ public:
|
||||
return 0;
|
||||
}
|
||||
private:
|
||||
uint64 DoorHighInquisitorGUID;
|
||||
uint64 MograineGUID;
|
||||
uint64 WhitemaneGUID;
|
||||
ObjectGuid DoorHighInquisitorGUID;
|
||||
ObjectGuid MograineGUID;
|
||||
ObjectGuid WhitemaneGUID;
|
||||
uint32 encounter;
|
||||
};
|
||||
};
|
||||
@@ -395,7 +396,7 @@ public:
|
||||
return;
|
||||
|
||||
//On first death, fake death and open door, as well as initiate whitemane if exist
|
||||
if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_WHITEMANE)))
|
||||
if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE)))
|
||||
{
|
||||
instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
|
||||
Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
|
||||
@@ -413,7 +414,7 @@ public:
|
||||
hasDied = true;
|
||||
fakeDeath = true;
|
||||
damage = 0;
|
||||
ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_WHITEMANE))->SetInCombatWithZone();
|
||||
ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_WHITEMANE))->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +452,7 @@ public:
|
||||
if (hasDied && !heal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
|
||||
{
|
||||
//On resurrection, stop fake death and heal whitemane and resume fight
|
||||
if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_WHITEMANE)))
|
||||
if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE)))
|
||||
{
|
||||
//Incase wipe during phase that mograine fake death
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -563,7 +564,7 @@ public:
|
||||
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
|
||||
if (Wait_Timer <= diff)
|
||||
{
|
||||
if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
|
||||
if (ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE)))
|
||||
{
|
||||
DoCast(SPELL_SCARLET_RESURRECTION);
|
||||
Talk(SAY_WH_RESURRECT);
|
||||
@@ -597,7 +598,7 @@ public:
|
||||
if (!HealthAbovePct(75))
|
||||
target = me;
|
||||
|
||||
if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
|
||||
if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOGRAINE)))
|
||||
{
|
||||
// checking canResurrectCheck prevents her healing Mograine while he is "faking death"
|
||||
if (canResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
|
||||
|
||||
Reference in New Issue
Block a user