mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36:23 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -76,17 +76,19 @@ public:
|
||||
{
|
||||
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZONEVENT)
|
||||
{
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
|
||||
TargetGUID = 0;
|
||||
CloudGUID = 0;
|
||||
CycloneGUID = 0;
|
||||
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
|
||||
TargetGUID.Clear();
|
||||
CloudGUID.Clear();
|
||||
CycloneGUID.Clear();
|
||||
|
||||
for (uint8 i = 0; i < 8; ++i)
|
||||
BirdGUIDs[i].Clear();
|
||||
|
||||
StormCount = 0;
|
||||
isRaining = false;
|
||||
|
||||
@@ -200,7 +202,7 @@ public:
|
||||
StormCount = 0; // finish
|
||||
events.ScheduleEvent(EVENT_SUMMON_EAGLES, 5000);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
CloudGUID = 0;
|
||||
CloudGUID.Clear();
|
||||
if (Cloud)
|
||||
Unit::DealDamage(Cloud, Cloud, Cloud->GetHealth(), nullptr, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
|
||||
SetWeather(WEATHER_STATE_FINE, 0.0f);
|
||||
@@ -353,10 +355,10 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 BirdGUIDs[8];
|
||||
uint64 TargetGUID;
|
||||
uint64 CycloneGUID;
|
||||
uint64 CloudGUID;
|
||||
ObjectGuid BirdGUIDs[8];
|
||||
ObjectGuid TargetGUID;
|
||||
ObjectGuid CycloneGUID;
|
||||
ObjectGuid CloudGUID;
|
||||
uint8 StormCount;
|
||||
bool isRaining;
|
||||
};
|
||||
@@ -378,13 +380,13 @@ public:
|
||||
|
||||
uint32 EagleSwoop_Timer;
|
||||
bool arrived;
|
||||
uint64 TargetGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
arrived = true;
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
me->SetDisableGravity(true);
|
||||
}
|
||||
|
||||
@@ -402,7 +404,7 @@ public:
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
|
||||
DoCast(target, SPELL_EAGLE_SWOOP, true);
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
me->SetSpeed(MOVE_RUN, 1.2f);
|
||||
EagleSwoop_Timer = urand(5000, 10000);
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ public:
|
||||
uint32 BerserkTimer;
|
||||
uint32 TransformCount;
|
||||
|
||||
uint64 LynxGUID;
|
||||
ObjectGuid LynxGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
|
||||
summons.DespawnAll();
|
||||
|
||||
LynxGUID = 0;
|
||||
LynxGUID.Clear();
|
||||
TransformCount = 0;
|
||||
BerserkTimer = 600000;
|
||||
CheckTimer = 1000;
|
||||
|
||||
@@ -247,16 +247,14 @@ public:
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
SelectAddEntry();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
AddGUID[i] = 0;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 AddGUID[4];
|
||||
ObjectGuid AddGUID[4];
|
||||
uint32 AddEntry[4];
|
||||
|
||||
uint64 PlayerGUID;
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
uint32 SpiritBolts_Timer;
|
||||
uint32 DrainPower_Timer;
|
||||
@@ -433,7 +431,7 @@ public:
|
||||
trigger->GetMotionMaster()->MoveChase(me);
|
||||
|
||||
//DoCast(target, SPELL_SIPHON_SOUL, true);
|
||||
//me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
|
||||
//me->SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID());
|
||||
//me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL);
|
||||
|
||||
PlayerGUID = target->GetGUID();
|
||||
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
bool isFlameBreathing;
|
||||
|
||||
uint64 FireBombGUIDs[40];
|
||||
ObjectGuid FireBombGUIDs[40];
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
isFlameBreathing = false;
|
||||
|
||||
for (uint8 i = 0; i < 40; ++i)
|
||||
FireBombGUIDs[i] = 0;
|
||||
FireBombGUIDs[i].Clear();
|
||||
|
||||
HatchAllEggs(1);
|
||||
}
|
||||
|
||||
@@ -127,9 +127,9 @@ public:
|
||||
}
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 SpiritGUID[4];
|
||||
uint64 ClawTargetGUID;
|
||||
uint64 TankGUID;
|
||||
ObjectGuid SpiritGUID[4];
|
||||
ObjectGuid ClawTargetGUID;
|
||||
ObjectGuid TankGUID;
|
||||
|
||||
uint32 Phase;
|
||||
uint32 health_20;
|
||||
@@ -180,8 +180,8 @@ public:
|
||||
Flame_Breath_Timer = 6000;
|
||||
Pillar_Of_Fire_Timer = 7000;
|
||||
|
||||
ClawTargetGUID = 0;
|
||||
TankGUID = 0;
|
||||
ClawTargetGUID.Clear();
|
||||
TankGUID.Clear();
|
||||
|
||||
Summons.DespawnAll();
|
||||
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
temp->setDeathState(DEAD);
|
||||
}
|
||||
}
|
||||
SpiritGUID[i] = 0;
|
||||
SpiritGUID[i].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
Claw_Rage_Timer = urand(15000, 20000);
|
||||
me->SetSpeed(MOVE_RUN, 1.2f);
|
||||
AttackStart(ObjectAccessor::GetUnit(*me, TankGUID));
|
||||
TankGUID = 0;
|
||||
TankGUID.Clear();
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -499,7 +499,7 @@ public:
|
||||
Lynx_Rush_Timer = urand(15000, 20000);
|
||||
me->SetSpeed(MOVE_RUN, 1.2f);
|
||||
AttackStart(ObjectAccessor::GetUnit(*me, TankGUID));
|
||||
TankGUID = 0;
|
||||
TankGUID.Clear();
|
||||
}
|
||||
else
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0));
|
||||
|
||||
@@ -56,19 +56,19 @@ public:
|
||||
{
|
||||
instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 HarkorsSatchelGUID;
|
||||
uint64 TanzarsTrunkGUID;
|
||||
uint64 AshlisBagGUID;
|
||||
uint64 KrazsPackageGUID;
|
||||
uint64 StrangeGongGUID;
|
||||
uint64 HarrisonJonesGUID;
|
||||
ObjectGuid HarkorsSatchelGUID;
|
||||
ObjectGuid TanzarsTrunkGUID;
|
||||
ObjectGuid AshlisBagGUID;
|
||||
ObjectGuid KrazsPackageGUID;
|
||||
ObjectGuid StrangeGongGUID;
|
||||
ObjectGuid HarrisonJonesGUID;
|
||||
|
||||
uint64 HexLordGateGUID;
|
||||
uint64 ZulJinGateGUID;
|
||||
uint64 MassiveGateGUID;
|
||||
uint64 AkilzonDoorGUID;
|
||||
uint64 ZulJinDoorGUID;
|
||||
uint64 HalazziDoorGUID;
|
||||
ObjectGuid HexLordGateGUID;
|
||||
ObjectGuid ZulJinGateGUID;
|
||||
ObjectGuid MassiveGateGUID;
|
||||
ObjectGuid AkilzonDoorGUID;
|
||||
ObjectGuid ZulJinDoorGUID;
|
||||
ObjectGuid HalazziDoorGUID;
|
||||
|
||||
uint32 QuestTimer;
|
||||
uint16 BossKilled;
|
||||
@@ -82,20 +82,6 @@ public:
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
HarkorsSatchelGUID = 0;
|
||||
TanzarsTrunkGUID = 0;
|
||||
AshlisBagGUID = 0;
|
||||
KrazsPackageGUID = 0;
|
||||
StrangeGongGUID = 0;
|
||||
HexLordGateGUID = 0;
|
||||
ZulJinGateGUID = 0;
|
||||
MassiveGateGUID = 0;
|
||||
AkilzonDoorGUID = 0;
|
||||
HalazziDoorGUID = 0;
|
||||
ZulJinDoorGUID = 0;
|
||||
|
||||
HarrisonJonesGUID = 0;
|
||||
|
||||
QuestTimer = 0;
|
||||
QuestMinute = 0;
|
||||
BossKilled = 0;
|
||||
@@ -380,7 +366,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -390,7 +376,7 @@ public:
|
||||
return MassiveGateGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
uint8 eventTimer;
|
||||
uint64 PlayerGUID;
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
@@ -146,7 +146,7 @@ public:
|
||||
events.Update(diff);
|
||||
if (eventTimer)
|
||||
{
|
||||
Player* player = me->GetMap()->GetPlayer(PlayerGUID);
|
||||
Player* player = ObjectAccessor::GetPlayer(me->GetMap(), PlayerGUID);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case 1:
|
||||
@@ -454,7 +454,7 @@ public:
|
||||
}
|
||||
|
||||
bool IsLoot;
|
||||
uint64 PlayerGUID;
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
void Reset() override { }
|
||||
|
||||
@@ -598,13 +598,13 @@ public:
|
||||
|
||||
uint8 _gongEvent;
|
||||
uint32 _gongTimer;
|
||||
uint64 uiTargetGUID;
|
||||
ObjectGuid uiTargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_gongEvent = 0;
|
||||
_gongTimer = 0;
|
||||
uiTargetGUID = 0;
|
||||
uiTargetGUID.Clear();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override { }
|
||||
@@ -629,7 +629,7 @@ public:
|
||||
me->RemoveAllAuras();
|
||||
me->SetEntry(NPC_HARRISON_JONES_2);
|
||||
me->SetDisplayId(MODEL_HARRISON_JONES_2);
|
||||
me->SetTarget(0);
|
||||
me->SetTarget();
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, UNIT_BYTES_1_OFFSET_STAND_STATE, UNIT_STAND_STATE_DEAD);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
instance->SetData(DATA_GONGEVENT, DONE);
|
||||
@@ -659,14 +659,14 @@ public:
|
||||
_gongTimer = 4000;
|
||||
break;
|
||||
case GONG_EVENT_3:
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG)))
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetGuidData(GO_STRANGE_GONG)))
|
||||
gong->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
_gongEvent = GONG_EVENT_4;
|
||||
_gongTimer = 105000;
|
||||
break;
|
||||
case GONG_EVENT_4:
|
||||
me->RemoveAura(SPELL_BANGING_THE_GONG);
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG)))
|
||||
if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetGuidData(GO_STRANGE_GONG)))
|
||||
gong->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
// trigger or gong will need to be scripted to set IN_PROGRESS after enough hits.
|
||||
@@ -728,7 +728,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE)))
|
||||
if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetGuidData(GO_MASSIVE_GATE)))
|
||||
gate->SetGoState(GO_STATE_ACTIVE);
|
||||
_gongTimer = 2000;
|
||||
_gongEvent = GONG_EVENT_8;
|
||||
|
||||
Reference in New Issue
Block a user