mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -210,7 +210,7 @@ public:
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
bool summoned;
|
||||
uint64 MemoryGUID;
|
||||
ObjectGuid MemoryGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
{
|
||||
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
|
||||
memory->DespawnOrUnsummon();
|
||||
MemoryGUID = 0;
|
||||
MemoryGUID.Clear();
|
||||
}
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if( pInstance )
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
{
|
||||
if( param == 1 )
|
||||
{
|
||||
MemoryGUID = 0;
|
||||
MemoryGUID.Clear();
|
||||
me->RemoveAura(SPELL_SHIELD);
|
||||
Talk(TEXT_PALETRESS_MEMORY_DEFEATED);
|
||||
}
|
||||
@@ -269,7 +269,7 @@ public:
|
||||
if( Creature* memory = ObjectAccessor::GetCreature(*me, MemoryGUID) )
|
||||
{
|
||||
memory->DespawnOrUnsummon();
|
||||
MemoryGUID = 0;
|
||||
MemoryGUID.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public:
|
||||
{
|
||||
me->DespawnOrUnsummon(20000);
|
||||
if( pInstance )
|
||||
if( Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_PALETRESS)) )
|
||||
if( Creature* paletress = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(DATA_PALETRESS)) )
|
||||
paletress->AI()->DoAction(1);
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
Start(false, true, 0);
|
||||
Start(false, true);
|
||||
uiWaypoint = uiType;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
pInstance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
|
||||
Talk(TEXT_BK_AGGRO);
|
||||
me->CastSpell((Unit*)nullptr, (pInstance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? SPELL_RAISE_DEAD_JAEREN : SPELL_RAISE_DEAD_ARELAS), false);
|
||||
if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetData64(DATA_ANNOUNCER)) )
|
||||
if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_ANNOUNCER)) )
|
||||
announcer->DespawnOrUnsummon();
|
||||
|
||||
events.Reset();
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Start(false, true, 0, nullptr);
|
||||
Start(false, true, ObjectGuid::Empty, nullptr);
|
||||
SetDespawnAtEnd(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
break;
|
||||
case EVENT_MOUNT_CHARGE:
|
||||
{
|
||||
std::vector<uint64> LIST;
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
@@ -294,7 +294,7 @@ public:
|
||||
break;
|
||||
case EVENT_SHIELD_BREAKER:
|
||||
{
|
||||
std::vector<uint64> LIST;
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
SetDespawnAtEnd(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
BossOrder = 0;
|
||||
NewMountGUID = 0;
|
||||
NewMountGUID.Clear();
|
||||
me->CastSpell(me, SPELL_BOSS_DEFEND_PERIODIC, true);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
|
||||
@@ -379,8 +379,8 @@ public:
|
||||
EventMap events;
|
||||
uint32 BossOrder;
|
||||
bool MountPhase;
|
||||
uint64 NewMountGUID;
|
||||
uint64 UnitTargetGUID;
|
||||
ObjectGuid NewMountGUID;
|
||||
ObjectGuid UnitTargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -471,7 +471,7 @@ public:
|
||||
if( param == 1 )
|
||||
{
|
||||
MountPhase = false;
|
||||
NewMountGUID = 0;
|
||||
NewMountGUID.Clear();
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetRegeneratingHealth(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED);
|
||||
@@ -522,7 +522,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
Start(false, true, 0, nullptr);
|
||||
Start(false, true);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
@@ -621,7 +621,7 @@ public:
|
||||
me->CastSpell(me, SPELL_TRAMPLE_AURA, true);
|
||||
if( pInstance )
|
||||
pInstance->SetData(DATA_REACHED_NEW_MOUNT, 0);
|
||||
NewMountGUID = 0;
|
||||
NewMountGUID.Clear();
|
||||
}
|
||||
}
|
||||
else if( id == 9 )
|
||||
@@ -716,7 +716,7 @@ public:
|
||||
break;
|
||||
case EVENT_MOUNT_CHARGE:
|
||||
{
|
||||
std::vector<uint64> LIST;
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
@@ -747,7 +747,7 @@ public:
|
||||
break;
|
||||
case EVENT_SHIELD_BREAKER:
|
||||
{
|
||||
std::vector<uint64> LIST;
|
||||
GuidVector LIST;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
@@ -865,7 +865,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
UnitTargetGUID = 0;
|
||||
UnitTargetGUID.Clear();
|
||||
}
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
}
|
||||
|
||||
@@ -34,24 +34,24 @@ public:
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
std::list<uint64> VehicleList;
|
||||
GuidList VehicleList;
|
||||
EventMap events;
|
||||
uint8 Counter;
|
||||
uint8 temp1, temp2;
|
||||
bool shortver;
|
||||
bool bAchievIveHadWorse;
|
||||
|
||||
uint64 NPC_AnnouncerGUID;
|
||||
uint64 NPC_TirionGUID;
|
||||
uint64 NPC_GrandChampionGUID[3];
|
||||
uint64 NPC_GrandChampionMinionsGUID[3][3];
|
||||
uint64 NPC_ArgentChampionGUID;
|
||||
uint64 NPC_ArgentSoldierGUID[3][3];
|
||||
uint64 NPC_MemoryEntry;
|
||||
uint64 NPC_BlackKnightVehicleGUID;
|
||||
uint64 NPC_BlackKnightGUID;
|
||||
uint64 GO_MainGateGUID;
|
||||
uint64 GO_EnterGateGUID;
|
||||
ObjectGuid NPC_AnnouncerGUID;
|
||||
ObjectGuid NPC_TirionGUID;
|
||||
ObjectGuid NPC_GrandChampionGUID[3];
|
||||
ObjectGuid NPC_GrandChampionMinionsGUID[3][3];
|
||||
ObjectGuid NPC_ArgentChampionGUID;
|
||||
ObjectGuid NPC_ArgentSoldierGUID[3][3];
|
||||
uint32 NPC_MemoryEntry;
|
||||
ObjectGuid NPC_BlackKnightVehicleGUID;
|
||||
ObjectGuid NPC_BlackKnightGUID;
|
||||
ObjectGuid GO_MainGateGUID;
|
||||
ObjectGuid GO_EnterGateGUID;
|
||||
|
||||
void Initialize() override
|
||||
{
|
||||
@@ -68,18 +68,6 @@ public:
|
||||
temp2 = 0;
|
||||
shortver = false;
|
||||
bAchievIveHadWorse = true;
|
||||
|
||||
NPC_AnnouncerGUID = 0;
|
||||
NPC_TirionGUID = 0;
|
||||
memset(&NPC_GrandChampionGUID, 0, sizeof(NPC_GrandChampionGUID));
|
||||
memset(&NPC_GrandChampionMinionsGUID, 0, sizeof(NPC_GrandChampionMinionsGUID));
|
||||
memset(&NPC_ArgentSoldierGUID, 0, sizeof(NPC_ArgentSoldierGUID));
|
||||
NPC_ArgentChampionGUID = 0;
|
||||
NPC_MemoryEntry = 0;
|
||||
NPC_BlackKnightVehicleGUID = 0;
|
||||
NPC_BlackKnightGUID = 0;
|
||||
GO_MainGateGUID = 0;
|
||||
GO_EnterGateGUID = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const override
|
||||
@@ -291,8 +279,8 @@ public:
|
||||
case INSTANCE_PROGRESS_CHAMPION_GROUP_DIED_3:
|
||||
// revert to INSTANCE_PROGRESS_INITIAL
|
||||
{
|
||||
for( std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr )
|
||||
if( Creature* veh = instance->GetCreature(*itr) )
|
||||
for (ObjectGuid const guid : VehicleList)
|
||||
if (Creature* veh = instance->GetCreature(guid))
|
||||
{
|
||||
veh->DespawnOrUnsummon();
|
||||
veh->SetRespawnTime(3);
|
||||
@@ -303,11 +291,11 @@ public:
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionMinionsGUID[i][j]) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_GrandChampionMinionsGUID[i][j] = 0;
|
||||
NPC_GrandChampionMinionsGUID[i][j].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_GrandChampionGUID[i]) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_GrandChampionGUID[i] = 0;
|
||||
NPC_GrandChampionGUID[i].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
{
|
||||
@@ -372,14 +360,14 @@ public:
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_ArgentSoldierGUID[i][j]) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_ArgentSoldierGUID[i][j] = 0;
|
||||
NPC_ArgentSoldierGUID[i][j].Clear();
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_ArgentChampionGUID) )
|
||||
{
|
||||
c->AI()->DoAction(-1); // paletress despawn memory
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_ArgentChampionGUID = 0;
|
||||
NPC_ArgentChampionGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
{
|
||||
c->DespawnOrUnsummon();
|
||||
@@ -397,13 +385,13 @@ public:
|
||||
{
|
||||
if( Creature* c = instance->GetCreature(NPC_BlackKnightVehicleGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_BlackKnightVehicleGUID = 0;
|
||||
NPC_BlackKnightVehicleGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_BlackKnightGUID) )
|
||||
{
|
||||
c->AI()->DoAction(-1);
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_BlackKnightGUID = 0;
|
||||
NPC_BlackKnightGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_AnnouncerGUID) )
|
||||
{
|
||||
c->DespawnOrUnsummon();
|
||||
@@ -444,7 +432,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiData) const override
|
||||
ObjectGuid GetGuidData(uint32 uiData) const override
|
||||
{
|
||||
switch( uiData )
|
||||
{
|
||||
@@ -454,7 +442,7 @@ public:
|
||||
return NPC_ArgentChampionGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData) override
|
||||
@@ -579,8 +567,8 @@ public:
|
||||
{
|
||||
Counter = 0;
|
||||
InstanceProgress = INSTANCE_PROGRESS_CHAMPIONS_UNMOUNTED;
|
||||
for( std::list<uint64>::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr )
|
||||
if( Creature* veh = instance->GetCreature(*itr) )
|
||||
for (ObjectGuid const guid : VehicleList)
|
||||
if (Creature* veh = instance->GetCreature(guid))
|
||||
veh->DespawnOrUnsummon();
|
||||
events.ScheduleEvent(EVENT_GRAND_CHAMPIONS_MOVE_SIDE, 0);
|
||||
}
|
||||
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
EventMap events;
|
||||
bool bIntro;
|
||||
bool bPhase3;
|
||||
uint64 SphereGUID[6];
|
||||
uint64 BurrowGUID[4];
|
||||
ObjectGuid SphereGUID[6];
|
||||
ObjectGuid BurrowGUID[4];
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -200,9 +200,9 @@ public:
|
||||
if( !IsHeroic() )
|
||||
events.RescheduleEvent(EVENT_RESPAWN_SPHERE, 4000);
|
||||
|
||||
for( std::list<uint64>::iterator itr = summons.begin(); itr != summons.end(); ++itr )
|
||||
for (ObjectGuid guid : summons)
|
||||
if (pInstance)
|
||||
if(Creature* c = pInstance->instance->GetCreature(*itr) )
|
||||
if (Creature* c = pInstance->instance->GetCreature(guid))
|
||||
{
|
||||
c->GetMotionMaster()->MoveIdle();
|
||||
c->StopMoving();
|
||||
@@ -621,7 +621,7 @@ public:
|
||||
{
|
||||
// I am summoned by another npc (SPELL_EFFECT_FORCE_CAST), inform Anub'arak
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (uint64 guid = pInstance->GetData64(TYPE_ANUBARAK))
|
||||
if (ObjectGuid guid = pInstance->GetGuidData(TYPE_ANUBARAK))
|
||||
if (Creature* anub = pInstance->instance->GetCreature(guid))
|
||||
CAST_AI(boss_anubarak_trial::boss_anubarak_trialAI, anub->AI())->JustSummoned(me);
|
||||
}
|
||||
@@ -743,7 +743,7 @@ public:
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
uint64 TargetGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
|
||||
void DoAction(int32 param) override
|
||||
{
|
||||
@@ -751,7 +751,7 @@ public:
|
||||
{
|
||||
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
|
||||
target->RemoveAura(SPELL_MARK);
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
me->RemoveAllAuras();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
events.Reset();
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
if (TargetGUID)
|
||||
if( Unit* target = ObjectAccessor::GetPlayer(*me, TargetGUID) )
|
||||
target->RemoveAura(SPELL_MARK);
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
if (!next)
|
||||
{
|
||||
events.Reset();
|
||||
|
||||
@@ -76,13 +76,13 @@ public:
|
||||
npc_snobold_vassalAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
uint64 TargetGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
me->CombatStop(true);
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
if( pInstance )
|
||||
if( Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetData64(TYPE_GORMOK)) )
|
||||
if( Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK)) )
|
||||
if( gormok->IsAlive() )
|
||||
if( Vehicle* vk = gormok->GetVehicleKit() )
|
||||
for( uint8 i = 0; i < 4; ++i )
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
Reset();
|
||||
break;
|
||||
}
|
||||
TargetGUID = 0;
|
||||
TargetGUID.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -161,9 +161,9 @@ public:
|
||||
{
|
||||
if( t->GetTypeId() != TYPEID_PLAYER && pInstance )
|
||||
{
|
||||
std::vector<uint64> validPlayers;
|
||||
GuidVector validPlayers;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetData64(TYPE_GORMOK));
|
||||
Creature* gormok = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(TYPE_GORMOK));
|
||||
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
@@ -234,13 +234,13 @@ public:
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
uint64 PlayerGUID;
|
||||
ObjectGuid PlayerGUID;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
PlayerGUID = 0;
|
||||
PlayerGUID.Clear();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
for( uint8 i = 0; i < 4; ++i )
|
||||
if( Unit* snobold = vk->GetPassenger(i) )
|
||||
{
|
||||
std::vector<uint64> validPlayers;
|
||||
GuidVector validPlayers;
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
{
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
snobold->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
PlayerGUID = 0;
|
||||
PlayerGUID.Clear();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -561,7 +561,7 @@ struct boss_jormungarAI : public ScriptedAI
|
||||
|
||||
// second one submerge 1.5sec after the first one, used also for synchronizing
|
||||
if( pInstance )
|
||||
if( Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetData64(_TYPE_OTHER)) )
|
||||
if( Creature* c = ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(_TYPE_OTHER)) )
|
||||
c->AI()->DoAction(-1);
|
||||
|
||||
events.Reset();
|
||||
@@ -647,7 +647,7 @@ struct boss_jormungarAI : public ScriptedAI
|
||||
{
|
||||
if( pInstance )
|
||||
{
|
||||
if( Creature* c = pInstance->instance->GetCreature(pInstance->GetData64(_TYPE_OTHER)) )
|
||||
if( Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(_TYPE_OTHER)) )
|
||||
if( c->IsAlive() )
|
||||
c->AI()->DoAction(-2);
|
||||
pInstance->SetData(TYPE_JORMUNGAR, DONE);
|
||||
@@ -776,7 +776,7 @@ public:
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
uint64 TargetGUID;
|
||||
ObjectGuid TargetGUID;
|
||||
float destX, destY, destZ;
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
@@ -882,7 +882,7 @@ public:
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->AttackStop();
|
||||
me->GetMotionMaster()->MoveJump(Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY(), Locs[LOC_CENTER].GetPositionZ(), 40.0f, 12.0f);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
me->SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
|
||||
events.Reset();
|
||||
events.RescheduleEvent(EVENT_SPELL_MASSIVE_CRASH, 2000);
|
||||
break;
|
||||
@@ -893,10 +893,10 @@ public:
|
||||
events.RescheduleEvent(EVENT_GAZE, 2000);
|
||||
break;
|
||||
case EVENT_GAZE:
|
||||
if( Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 500.0f, true) )
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 500.0f, true) )
|
||||
{
|
||||
TargetGUID = target->GetGUID();
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID);
|
||||
me->SetGuidValue(UNIT_FIELD_TARGET, TargetGUID);
|
||||
me->SetFacingToObject(target);
|
||||
Talk(EMOTE_TRAMPLE_STARE, target);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
@@ -958,7 +958,7 @@ public:
|
||||
me->DisableSpline();
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveCharge(destX, destY, destZ + 1.0f, 65.0f);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
me->SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty);
|
||||
events.RescheduleEvent(EVENT_CHECK_TRAMPLE_PLAYERS, 100);
|
||||
|
||||
break;
|
||||
|
||||
@@ -187,7 +187,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
|
||||
|
||||
Creature* GetSister()
|
||||
{
|
||||
return ObjectAccessor::GetCreature(*me, pInstance->GetData64(me->GetEntry() == NPC_DARKBANE ? NPC_LIGHTBANE : NPC_DARKBANE));
|
||||
return ObjectAccessor::GetCreature(*me, pInstance->GetGuidData(me->GetEntry() == NPC_DARKBANE ? NPC_LIGHTBANE : NPC_DARKBANE));
|
||||
}
|
||||
|
||||
/*void AttackStart(Unit* victim)
|
||||
@@ -371,7 +371,7 @@ struct boss_twin_valkyrAI : public ScriptedAI
|
||||
events.RepeatEvent(urand(45000,50000));
|
||||
*/
|
||||
|
||||
std::vector<uint64> tList;
|
||||
GuidVector tList;
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
if (pList.getSize())
|
||||
{
|
||||
|
||||
@@ -34,30 +34,30 @@ public:
|
||||
std::string str_data;
|
||||
EventMap events;
|
||||
|
||||
uint64 NPC_BarrettGUID;
|
||||
uint64 NPC_TirionGUID;
|
||||
uint64 NPC_FizzlebangGUID;
|
||||
uint64 NPC_GarroshGUID;
|
||||
uint64 NPC_VarianGUID;
|
||||
ObjectGuid NPC_BarrettGUID;
|
||||
ObjectGuid NPC_TirionGUID;
|
||||
ObjectGuid NPC_FizzlebangGUID;
|
||||
ObjectGuid NPC_GarroshGUID;
|
||||
ObjectGuid NPC_VarianGUID;
|
||||
|
||||
uint64 NPC_GormokGUID;
|
||||
uint64 NPC_DreadscaleGUID;
|
||||
uint64 NPC_AcidmawGUID;
|
||||
uint64 NPC_IcehowlGUID;
|
||||
uint64 NPC_JaraxxusGUID;
|
||||
std::vector<uint64> NPC_ChampionGUIDs;
|
||||
uint64 NPC_LightbaneGUID;
|
||||
uint64 NPC_DarkbaneGUID;
|
||||
uint64 NPC_LichKingGUID;
|
||||
uint64 NPC_AnubarakGUID;
|
||||
ObjectGuid NPC_GormokGUID;
|
||||
ObjectGuid NPC_DreadscaleGUID;
|
||||
ObjectGuid NPC_AcidmawGUID;
|
||||
ObjectGuid NPC_IcehowlGUID;
|
||||
ObjectGuid NPC_JaraxxusGUID;
|
||||
GuidVector NPC_ChampionGUIDs;
|
||||
ObjectGuid NPC_LightbaneGUID;
|
||||
ObjectGuid NPC_DarkbaneGUID;
|
||||
ObjectGuid NPC_LichKingGUID;
|
||||
ObjectGuid NPC_AnubarakGUID;
|
||||
|
||||
uint64 NPC_PurpleGroundGUID;
|
||||
uint64 NPC_PortalGUID;
|
||||
ObjectGuid NPC_PurpleGroundGUID;
|
||||
ObjectGuid NPC_PortalGUID;
|
||||
|
||||
uint64 GO_MainGateGUID;
|
||||
uint64 GO_EnterGateGUID;
|
||||
uint64 GO_WebDoorGUID;
|
||||
uint64 GO_FloorGUID;
|
||||
ObjectGuid GO_MainGateGUID;
|
||||
ObjectGuid GO_EnterGateGUID;
|
||||
ObjectGuid GO_WebDoorGUID;
|
||||
ObjectGuid GO_FloorGUID;
|
||||
|
||||
void SpawnAnubArak()
|
||||
{
|
||||
@@ -72,8 +72,8 @@ public:
|
||||
}
|
||||
|
||||
// move corpses
|
||||
const uint64 npcs[4] = { NPC_IcehowlGUID, NPC_JaraxxusGUID, NPC_LightbaneGUID, NPC_DarkbaneGUID };
|
||||
for (const uint64 i : npcs)
|
||||
const ObjectGuid npcs[4] = { NPC_IcehowlGUID, NPC_JaraxxusGUID, NPC_LightbaneGUID, NPC_DarkbaneGUID };
|
||||
for (const ObjectGuid i : npcs)
|
||||
{
|
||||
if (Creature* c = instance->GetCreature(i))
|
||||
{
|
||||
@@ -161,30 +161,7 @@ public:
|
||||
events.Reset();
|
||||
events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0);
|
||||
|
||||
NPC_BarrettGUID = 0;
|
||||
NPC_TirionGUID = 0;
|
||||
NPC_FizzlebangGUID = 0;
|
||||
NPC_GarroshGUID = 0;
|
||||
NPC_VarianGUID = 0;
|
||||
|
||||
NPC_GormokGUID = 0;
|
||||
NPC_DreadscaleGUID = 0;
|
||||
NPC_AcidmawGUID = 0;
|
||||
NPC_IcehowlGUID = 0;
|
||||
NPC_JaraxxusGUID = 0;
|
||||
NPC_ChampionGUIDs.clear();
|
||||
NPC_LightbaneGUID = 0;
|
||||
NPC_DarkbaneGUID = 0;
|
||||
NPC_LichKingGUID = 0;
|
||||
NPC_AnubarakGUID = 0;
|
||||
|
||||
NPC_PurpleGroundGUID = 0;
|
||||
NPC_PortalGUID = 0;
|
||||
|
||||
GO_MainGateGUID = 0;
|
||||
GO_EnterGateGUID = 0;
|
||||
GO_WebDoorGUID = 0;
|
||||
GO_FloorGUID = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const override
|
||||
@@ -425,8 +402,8 @@ public:
|
||||
InstanceProgress = INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD;
|
||||
events.RescheduleEvent(EVENT_SCENE_FACTION_CHAMPIONS_DEAD, 2500);
|
||||
|
||||
for( std::vector<uint64>::iterator itr = NPC_ChampionGUIDs.begin(); itr != NPC_ChampionGUIDs.end(); ++itr )
|
||||
if( Creature* c = instance->GetCreature(*itr) )
|
||||
for (ObjectGuid guid : NPC_ChampionGUIDs)
|
||||
if (Creature* c = instance->GetCreature(guid))
|
||||
c->DespawnOrUnsummon(15000);
|
||||
NPC_ChampionGUIDs.clear();
|
||||
|
||||
@@ -478,10 +455,10 @@ public:
|
||||
{
|
||||
EncounterStatus = IN_PROGRESS;
|
||||
AchievementTimer = 0;
|
||||
for( std::vector<uint64>::iterator itr = NPC_ChampionGUIDs.begin(); itr != NPC_ChampionGUIDs.end(); ++itr )
|
||||
if( Creature* c = instance->GetCreature(*itr) )
|
||||
if( !c->IsInCombat() )
|
||||
if( Unit* target = c->SelectNearestTarget(200.0f) )
|
||||
for (ObjectGuid guid : NPC_ChampionGUIDs)
|
||||
if (Creature* c = instance->GetCreature(guid))
|
||||
if (!c->IsInCombat())
|
||||
if (Unit* target = c->SelectNearestTarget(200.0f))
|
||||
c->AI()->AttackStart(target);
|
||||
}
|
||||
break;
|
||||
@@ -549,7 +526,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch( type )
|
||||
{
|
||||
@@ -566,7 +543,8 @@ public:
|
||||
case TYPE_ANUBARAK:
|
||||
return NPC_AnubarakGUID;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
@@ -866,10 +844,10 @@ public:
|
||||
c->SetFacingTo(M_PI / 2);
|
||||
if( Creature* c = instance->GetCreature(NPC_PurpleGroundGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_PurpleGroundGUID = 0;
|
||||
NPC_PurpleGroundGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_PortalGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_PortalGUID = 0;
|
||||
NPC_PortalGUID.Clear();
|
||||
|
||||
events.RescheduleEvent(EVENT_SCENE_106, 10000);
|
||||
break;
|
||||
@@ -1115,8 +1093,8 @@ public:
|
||||
}
|
||||
case EVENT_CHAMPIONS_ATTACK:
|
||||
{
|
||||
for( std::vector<uint64>::iterator itr = NPC_ChampionGUIDs.begin(); itr != NPC_ChampionGUIDs.end(); ++itr )
|
||||
if( Creature* c = instance->GetCreature(*itr) )
|
||||
for (ObjectGuid guid : NPC_ChampionGUIDs)
|
||||
if (Creature* c = instance->GetCreature(guid))
|
||||
{
|
||||
c->SetReactState(REACT_AGGRESSIVE);
|
||||
c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -1469,16 +1447,16 @@ public:
|
||||
c->AI()->DoAction(-1); // despawn summons
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_GormokGUID = 0;
|
||||
NPC_GormokGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_AcidmawGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_AcidmawGUID = 0;
|
||||
NPC_AcidmawGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_DreadscaleGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_DreadscaleGUID = 0;
|
||||
NPC_DreadscaleGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_IcehowlGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_IcehowlGUID = 0;
|
||||
NPC_IcehowlGUID.Clear();
|
||||
northrendBeastsMask = 0;
|
||||
break;
|
||||
case INSTANCE_PROGRESS_BEASTS_DEAD:
|
||||
@@ -1486,16 +1464,16 @@ public:
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
if( Creature* c = instance->GetCreature(NPC_FizzlebangGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_FizzlebangGUID = 0;
|
||||
NPC_FizzlebangGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_JaraxxusGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_JaraxxusGUID = 0;
|
||||
NPC_JaraxxusGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_PurpleGroundGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_PurpleGroundGUID = 0;
|
||||
NPC_PurpleGroundGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_PortalGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_PortalGUID = 0;
|
||||
NPC_PortalGUID.Clear();
|
||||
break;
|
||||
case INSTANCE_PROGRESS_JARAXXUS_INTRO_DONE:
|
||||
if( Creature* c = instance->GetCreature(NPC_JaraxxusGUID) )
|
||||
@@ -1515,8 +1493,8 @@ public:
|
||||
case INSTANCE_PROGRESS_JARAXXUS_DEAD:
|
||||
if( Creature* c = instance->GetCreature(NPC_BarrettGUID) )
|
||||
c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
for( std::vector<uint64>::iterator itr = NPC_ChampionGUIDs.begin(); itr != NPC_ChampionGUIDs.end(); ++itr )
|
||||
if( Creature* c = instance->GetCreature(*itr) )
|
||||
for (ObjectGuid guid : NPC_ChampionGUIDs)
|
||||
if (Creature* c = instance->GetCreature(guid))
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_ChampionGUIDs.clear();
|
||||
break;
|
||||
@@ -1528,13 +1506,13 @@ public:
|
||||
c->AI()->DoAction(-1);
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_DarkbaneGUID = 0;
|
||||
NPC_DarkbaneGUID.Clear();
|
||||
if( Creature* c = instance->GetCreature(NPC_LightbaneGUID) )
|
||||
{
|
||||
c->AI()->DoAction(-1);
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_LightbaneGUID = 0;
|
||||
NPC_LightbaneGUID.Clear();
|
||||
break;
|
||||
case INSTANCE_PROGRESS_VALKYR_DEAD:
|
||||
case INSTANCE_PROGRESS_ANUB_ARAK:
|
||||
@@ -1558,14 +1536,14 @@ public:
|
||||
}
|
||||
if( Creature* c = instance->GetCreature(NPC_LichKingGUID) )
|
||||
c->DespawnOrUnsummon();
|
||||
NPC_LichKingGUID = 0;
|
||||
NPC_LichKingGUID.Clear();
|
||||
|
||||
if( Creature* c = instance->GetCreature(NPC_AnubarakGUID) )
|
||||
{
|
||||
c->AI()->DoAction(-1);
|
||||
c->DespawnOrUnsummon();
|
||||
}
|
||||
NPC_AnubarakGUID = 0;
|
||||
NPC_AnubarakGUID.Clear();
|
||||
|
||||
break;
|
||||
case INSTANCE_PROGRESS_DONE:
|
||||
|
||||
Reference in New Issue
Block a user