mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 00:06:11 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -328,7 +328,7 @@ public:
|
||||
|
||||
if (me->GetVictim() && me->GetVictim()->GetGUID() == victim->GetGUID() && !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED))
|
||||
{
|
||||
if (!me->GetUInt64Value(UNIT_FIELD_TARGET))
|
||||
if (!me->GetGuidValue(UNIT_FIELD_TARGET))
|
||||
me->SetTarget(victim->GetGUID());
|
||||
}
|
||||
else if (me->Attack(victim, true))
|
||||
@@ -336,7 +336,7 @@ public:
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED))
|
||||
me->GetMotionMaster()->MoveChase(victim);
|
||||
else
|
||||
me->SetTarget(0);
|
||||
me->SetTarget();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
|
||||
me->SendMeleeAttackStop(me->GetVictim());
|
||||
me->SetTarget((uint64)0);
|
||||
me->SetTarget();
|
||||
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->StopMoving();
|
||||
@@ -518,10 +518,10 @@ public:
|
||||
pPlayer->SetUnitMovementFlags(MOVEMENTFLAG_NONE);
|
||||
pPlayer->SetDisableGravity(true, true);
|
||||
WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8);
|
||||
data.append(pPlayer->GetPackGUID());
|
||||
data << pPlayer->GetPackGUID();
|
||||
pPlayer->SendMessageToSet(&data, true);
|
||||
|
||||
pPlayer->SetUInt64Value(PLAYER_FARSIGHT, vp->GetGUID());
|
||||
pPlayer->SetGuidValue(PLAYER_FARSIGHT, vp->GetGUID());
|
||||
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
@@ -553,7 +553,7 @@ public:
|
||||
Talk(SAY_END_P1);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
me->SendMeleeAttackStop();
|
||||
me->SetTarget((uint64)0);
|
||||
me->SetTarget();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->DisableSpline();
|
||||
me->GetMotionMaster()->MovePoint(MI_POINT_CENTER_GROUND_PH_2, CenterPos);
|
||||
@@ -655,7 +655,7 @@ public:
|
||||
break;
|
||||
case EVENT_CLEAR_TARGET:
|
||||
me->SendMeleeAttackStop();
|
||||
me->SetTarget(0);
|
||||
me->SetTarget();
|
||||
break;
|
||||
case EVENT_CHECK_TRASH_DEAD:
|
||||
{
|
||||
@@ -664,7 +664,7 @@ public:
|
||||
else
|
||||
{
|
||||
me->SendMeleeAttackStop();
|
||||
me->SetTarget(0);
|
||||
me->SetTarget();
|
||||
events.CancelEventGroup(1);
|
||||
summons.DespawnAll();
|
||||
// start phase 3
|
||||
@@ -883,7 +883,7 @@ public:
|
||||
plr->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
|
||||
plr->RemoveAura(SPELL_FREEZE_ANIM);
|
||||
plr->SetDisableGravity(false, true);
|
||||
plr->SetUInt64Value(PLAYER_FARSIGHT, 0);;
|
||||
plr->SetGuidValue(PLAYER_FARSIGHT, ObjectGuid::Empty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,7 +1007,7 @@ public:
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
if (pInstance)
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetData64(DATA_MALYGOS_GUID)))
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MALYGOS_GUID)))
|
||||
if (me->IsWithinDist3d(c, 12.0f))
|
||||
{
|
||||
me->CastSpell(c, SPELL_POWER_SPARK_MALYGOS_BUFF, true);
|
||||
@@ -1024,7 +1024,7 @@ public:
|
||||
if (MoveTimer <= diff)
|
||||
{
|
||||
if (pInstance)
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetData64(DATA_MALYGOS_GUID)))
|
||||
if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MALYGOS_GUID)))
|
||||
me->GetMotionMaster()->MovePoint(0, *c);
|
||||
MoveTimer = 2000;
|
||||
}
|
||||
@@ -1168,7 +1168,7 @@ public:
|
||||
break;
|
||||
case EVENT_SCION_OF_ETERNITY_ARCANE_BARRAGE:
|
||||
{
|
||||
std::vector<uint64> guids;
|
||||
GuidVector guids;
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
@@ -1462,11 +1462,10 @@ public:
|
||||
{
|
||||
PrepareSpellScript(spell_eoe_ph3_surge_of_power_SpellScript);
|
||||
|
||||
uint64 DrakeGUID[3];
|
||||
ObjectGuid DrakeGUID[3];
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
memset(&DrakeGUID, 0, sizeof(DrakeGUID));
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* c = caster->ToCreature())
|
||||
{
|
||||
|
||||
@@ -96,11 +96,11 @@ const uint32 MalygosIntroIntervals[] = {18000, 19000, 21000, 18000, 15000};
|
||||
class EoEDrakeEnterVehicleEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
EoEDrakeEnterVehicleEvent(Creature& owner, uint64 playerGUID) : _owner(owner), _playerGUID(playerGUID) { }
|
||||
EoEDrakeEnterVehicleEvent(Creature& owner, ObjectGuid playerGUID) : _owner(owner), _playerGUID(playerGUID) { }
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) override;
|
||||
private:
|
||||
Creature& _owner;
|
||||
uint64 _playerGUID;
|
||||
ObjectGuid _playerGUID;
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
|
||||
@@ -37,20 +37,16 @@ public:
|
||||
uint32 EncounterStatus;
|
||||
std::string str_data;
|
||||
|
||||
uint64 NPC_MalygosGUID;
|
||||
uint64 GO_IrisGUID;
|
||||
uint64 GO_ExitPortalGUID;
|
||||
uint64 GO_PlatformGUID;
|
||||
ObjectGuid NPC_MalygosGUID;
|
||||
ObjectGuid GO_IrisGUID;
|
||||
ObjectGuid GO_ExitPortalGUID;
|
||||
ObjectGuid GO_PlatformGUID;
|
||||
bool bPokeAchiev;
|
||||
|
||||
void Initialize() override
|
||||
{
|
||||
EncounterStatus = NOT_STARTED;
|
||||
|
||||
NPC_MalygosGUID = 0;
|
||||
GO_IrisGUID = 0;
|
||||
GO_ExitPortalGUID = 0;
|
||||
GO_PlatformGUID = 0;
|
||||
bPokeAchiev = false;
|
||||
}
|
||||
|
||||
@@ -173,14 +169,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_MALYGOS_GUID:
|
||||
return NPC_MalygosGUID;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void ProcessEvent(WorldObject* /*unit*/, uint32 eventId) override
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
if (Aura* aur = itr->GetSource()->GetAura(SPELL_INTENSE_COLD_TRIGGER))
|
||||
if (aur->GetStackAmount() > 2)
|
||||
aGuids.insert(itr->GetSource()->GetGUIDLow());
|
||||
aGuids.insert(itr->GetSource()->GetGUID().GetCounter());
|
||||
events.ScheduleEvent(EVENT_ACHIEVEMENT_CHECK, 500);
|
||||
break;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
return target->GetAI()->GetData(player->GetGUIDLow());
|
||||
return target->GetAI()->GetData(player->GetGUID().GetCounter());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
}
|
||||
|
||||
int32 _damageTimer;
|
||||
uint64 _gameObjectGUID;
|
||||
ObjectGuid _gameObjectGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
{
|
||||
pInstance->SetData(DATA_DRAKOS, DONE);
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( uint64 guid = pInstance->GetData64(DATA_DCD_1 + i) )
|
||||
if( ObjectGuid guid = pInstance->GetGuidData(DATA_DCD_1 + i) )
|
||||
if( GameObject* pGo = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( pGo->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
|
||||
@@ -24,14 +24,14 @@ public:
|
||||
instance_oculus_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { Initialize(); }
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 DragonCageDoorGUID[3];
|
||||
uint64 EregosCacheGUID;
|
||||
ObjectGuid DragonCageDoorGUID[3];
|
||||
ObjectGuid EregosCacheGUID;
|
||||
uint32 CentrifugeCount;
|
||||
|
||||
uint64 uiDrakosGUID;
|
||||
uint64 uiVarosGUID;
|
||||
uint64 uiUromGUID;
|
||||
uint64 uiEregosGUID;
|
||||
ObjectGuid uiDrakosGUID;
|
||||
ObjectGuid uiVarosGUID;
|
||||
ObjectGuid uiUromGUID;
|
||||
ObjectGuid uiEregosGUID;
|
||||
|
||||
bool bAmberVoid;
|
||||
bool bEmeraldVoid;
|
||||
@@ -39,18 +39,12 @@ public:
|
||||
|
||||
void Initialize() override
|
||||
{
|
||||
EregosCacheGUID = 0;
|
||||
uiDrakosGUID = 0;
|
||||
uiVarosGUID = 0;
|
||||
uiUromGUID = 0;
|
||||
uiEregosGUID = 0;
|
||||
CentrifugeCount = 0;
|
||||
bAmberVoid = false;
|
||||
bEmeraldVoid = false;
|
||||
bRubyVoid = false;
|
||||
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
memset(&DragonCageDoorGUID, 0, sizeof(DragonCageDoorGUID));
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature) override
|
||||
@@ -200,7 +194,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier) const override
|
||||
ObjectGuid GetGuidData(uint32 identifier) const override
|
||||
{
|
||||
switch( identifier )
|
||||
{
|
||||
@@ -218,7 +212,7 @@ public:
|
||||
return DragonCageDoorGUID[identifier - 100];
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
std::string GetSaveData() override
|
||||
|
||||
@@ -62,7 +62,7 @@ enum DrakeGiverTexts
|
||||
class npc_oculus_drakegiver : public CreatureScript
|
||||
{
|
||||
public:
|
||||
std::unordered_map<uint32, bool>openedMenu;
|
||||
std::unordered_map<ObjectGuid, bool>openedMenu;
|
||||
|
||||
npc_oculus_drakegiver() : CreatureScript("npc_oculus_drakegiver") { }
|
||||
|
||||
@@ -887,7 +887,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_rider_auraAuraScript);
|
||||
|
||||
uint64 _drakeGUID;
|
||||
ObjectGuid _drakeGUID;
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user