Core/Scripts: Fixed build of misc scripts, only zone_* and instance_* remain

This commit is contained in:
Shauren committed 2014-09-15 22:52:09 +02:00
1 parent a3d8f1d879
commit 48deb443f9
44 files changed
+263 -289

No files matched your search

@@ -104,7 +104,7 @@ public:
{
// We need to use a copy of SummonList here, otherwise original SummonList would be modified
StorageType listCopy = storage_;
Trinity::Containers::RandomResizeList<uint64, Predicate>(listCopy, predicate, max);
Trinity::Containers::RandomResizeList<ObjectGuid, Predicate>(listCopy, predicate, max);
for (StorageType::iterator i = listCopy.begin(); i != listCopy.end(); )
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
@@ -167,9 +167,9 @@ public:
case GO_TOMB_EXIT:
GoTombExitGUID = go->GetGUID();
if (GhostKillCount >= 7)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
else
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break;
case GO_SF_S: GoSFSGUID = go->GetGUID(); break;
@@ -122,97 +122,97 @@ public:
case GO_EMBERSEER_IN:
go_emberseerin = go->GetGUID();
if (GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_DOORS:
go_doors = go->GetGUID();
if (GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_EMBERSEER_OUT:
go_emberseerout = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_HALL_RUNE_1:
go_roomrunes[0] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_1) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_2:
go_roomrunes[1] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_2) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_3:
go_roomrunes[2] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_3) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_4:
go_roomrunes[3] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_4) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_5:
go_roomrunes[4] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_5) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_6:
go_roomrunes[5] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_6) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_HALL_RUNE_7:
go_roomrunes[6] = go->GetGUID();
if (GetBossState(DATA_HALL_RUNE_7) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_1:
go_emberseerrunes[0] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_2:
go_emberseerrunes[1] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_3:
go_emberseerrunes[2] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_4:
go_emberseerrunes[3] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_5:
go_emberseerrunes[4] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_6:
go_emberseerrunes[5] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_EMBERSEER_RUNE_7:
go_emberseerrunes[6] = go->GetGUID();
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_PORTCULLIS_ACTIVE:
go_portcullis_active = go->GetGUID();
if (GetBossState(DATA_GYTH) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_PORTCULLIS_TOBOSSROOMS:
go_portcullis_tobossrooms = go->GetGUID();
if (GetBossState(DATA_GYTH) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
default:
break;
@@ -436,7 +436,7 @@ public:
if (!_mobAlive && rune->GetGoState() == GO_STATE_ACTIVE)
{
HandleGameObject(0, false, rune);
HandleGameObject(ObjectGuid::Empty, false, rune);
switch (rune->GetEntry())
{
@@ -473,9 +473,9 @@ public:
{
SetBossState(DATA_DRAGONSPIRE_ROOM, DONE);
if (GameObject* door1 = instance->GetGameObject(go_emberseerin))
HandleGameObject(0, true, door1);
HandleGameObject(ObjectGuid::Empty, true, door1);
if (GameObject* door2 = instance->GetGameObject(go_doors))
HandleGameObject(0, true, door2);
HandleGameObject(ObjectGuid::Empty, true, door2);
}
}
@@ -123,23 +123,23 @@ public:
break;
case 175946: // Door
RazorgoreDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(BOSS_RAZORGORE) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(BOSS_RAZORGORE) == DONE, go);
break;
case 175185: // Door
VaelastraszDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(BOSS_VAELASTRAZ) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(BOSS_VAELASTRAZ) == DONE, go);
break;
case 180424: // Door
BroodlordDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(BOSS_BROODLORD) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(BOSS_BROODLORD) == DONE, go);
break;
case 185483: // Door
ChrommagusDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(BOSS_FIREMAW) == DONE && GetBossState(BOSS_EBONROC) == DONE && GetBossState(BOSS_FLAMEGOR) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(BOSS_FIREMAW) == DONE && GetBossState(BOSS_EBONROC) == DONE && GetBossState(BOSS_FLAMEGOR) == DONE, go);
break;
case 181125: // Door
NefarianDoorGUID = go->GetGUID();
HandleGameObject(0, GetBossState(BOSS_CHROMAGGUS) == DONE, go);
HandleGameObject(ObjectGuid::Empty, GetBossState(BOSS_CHROMAGGUS) == DONE, go);
break;
}
}
@@ -103,8 +103,8 @@ public:
uint8 uiPhase;
uint32 uiTimer;
std::list<uint64> SummonList;
std::list<uint64> GoSummonList;
GuidList SummonList;
GuidList GoSummonList;
void Reset() override
{
@@ -147,7 +147,7 @@ public:
if (GoSummonList.empty())
return;
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
for (GuidList::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, *itr))
{
@@ -163,7 +163,7 @@ public:
}
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT)))
instance->HandleGameObject(0, false, go);
instance->HandleGameObject(ObjectGuid::Empty, false, go);
}
void SetInFace(bool isRight)
@@ -175,20 +175,20 @@ public:
void RestoreAll()
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_RIGHT)))
instance->HandleGameObject(0, false, go);
instance->HandleGameObject(ObjectGuid::Empty, false, go);
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_LEFT)))
instance->HandleGameObject(0, false, go);
instance->HandleGameObject(ObjectGuid::Empty, false, go);
if (!GoSummonList.empty())
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
for (GuidList::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, *itr))
go->RemoveFromWorld();
}
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
for (GuidList::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
{
@@ -399,7 +399,7 @@ public:
Talk(SAY_BLASTMASTER_5);
Summon(1);
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_RIGHT)))
instance->HandleGameObject(0, true, go);
instance->HandleGameObject(ObjectGuid::Empty, true, go);
NextStep(3000, true);
break;
case 7:
@@ -445,7 +445,7 @@ public:
Talk(SAY_BLASTMASTER_14);
SetInFace(false);
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_LEFT)))
instance->HandleGameObject(0, true, go);
instance->HandleGameObject(ObjectGuid::Empty, true, go);
NextStep(2000, true);
break;
case 17:
@@ -88,12 +88,12 @@ public:
case GO_CAVE_IN_LEFT:
uiCaveInLeftGUID = go->GetGUID();
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_CAVE_IN_RIGHT:
uiCaveInRightGUID = go->GetGUID();
if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED)
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
}
}
@@ -139,7 +139,7 @@ public:
void Initialize()
{
m_uiSpotlightGUID = 0;
m_uiSpotlightGUID.Clear();
TalkCount = 0;
TalkTimer = 2000;
@@ -150,7 +150,7 @@ public:
InstanceScript* instance;
uint64 m_uiSpotlightGUID;
ObjectGuid m_uiSpotlightGUID;
uint32 TalkCount;
uint32 TalkTimer;
@@ -491,14 +491,14 @@ public:
void Initialize()
{
ArcanagosGUID = 0;
ArcanagosGUID.Clear();
EventStarted = false;
YellTimer = 0;
}
InstanceScript* instance;
uint64 ArcanagosGUID;
ObjectGuid ArcanagosGUID;
uint32 YellTimer;
uint32 Step;
@@ -107,7 +107,6 @@ public:
if (!me->GetCurrentEquipmentId())
me->SetCurrentEquipmentId(me->GetOriginalEquipmentId());
playerGUID = 0;
wait_timer = 0;
anchorX = 0.f;
anchorY = 0.f;
@@ -115,15 +114,15 @@ public:
void Initialize()
{
anchorGUID = 0;
anchorGUID.Clear();
phase = PHASE_CHAINED;
}
uint64 playerGUID;
ObjectGuid playerGUID;
UnworthyInitiatePhase phase;
uint32 wait_timer;
float anchorX, anchorY;
uint64 anchorGUID;
ObjectGuid anchorGUID;
EventMap events;
@@ -325,7 +324,7 @@ public:
bool OnGossipHello(Player* player, GameObject* go) override
{
if (Creature* anchor = go->FindNearestCreature(29521, 15))
if (uint64 prisonerGUID = anchor->AI()->GetGUID())
if (ObjectGuid prisonerGUID = anchor->AI()->GetGUID())
if (Creature* prisoner = ObjectAccessor::GetCreature(*player, prisonerGUID))
ENSURE_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, player);
@@ -532,14 +531,14 @@ public:
void Initialize()
{
m_uiDuelerGUID = 0;
m_uiDuelerGUID.Clear();
m_uiDuelTimer = 5000;
m_bIsDuelInProgress = false;
lose = false;
}
bool lose;
uint64 m_uiDuelerGUID;
ObjectGuid m_uiDuelerGUID;
uint32 m_uiDuelTimer;
bool m_bIsDuelInProgress;
@@ -655,7 +654,7 @@ class npc_dark_rider_of_acherus : public CreatureScript
PhaseTimer = 4000;
Phase = 0;
Intro = false;
TargetGUID = 0;
TargetGUID.Clear();
}
void Reset() override
@@ -716,7 +715,7 @@ class npc_dark_rider_of_acherus : public CreatureScript
uint32 PhaseTimer;
uint32 Phase;
bool Intro;
uint64 TargetGUID;
ObjectGuid TargetGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1010,7 +1009,7 @@ class npc_scarlet_miner_cart : public CreatureScript
struct npc_scarlet_miner_cartAI : public PassiveAI
{
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature), _minerGUID(0), _playerGUID(0)
npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse.
@@ -1028,7 +1027,7 @@ class npc_scarlet_miner_cart : public CreatureScript
void SummonedCreatureDespawn(Creature* summon) override
{
if (summon->GetEntry() == NPC_MINER)
_minerGUID = 0;
_minerGUID.Clear();
}
void DoAction(int32 /*param*/) override
@@ -1054,15 +1053,15 @@ class npc_scarlet_miner_cart : public CreatureScript
}
else
{
_playerGUID = 0;
_playerGUID.Clear();
if (Creature* miner = ObjectAccessor::GetCreature(*me, _minerGUID))
miner->DespawnOrUnsummon();
}
}
private:
uint64 _minerGUID;
uint64 _playerGUID;
ObjectGuid _minerGUID;
ObjectGuid _playerGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -1096,14 +1095,14 @@ class npc_scarlet_miner : public CreatureScript
void Initialize()
{
carGUID = 0;
carGUID.Clear();
IntroTimer = 0;
IntroPhase = 0;
}
uint32 IntroTimer;
uint32 IntroPhase;
uint64 carGUID;
ObjectGuid carGUID;
void Reset() override
{
@@ -533,18 +533,18 @@ public:
//Unit* pTirion = ObjectAccessor::GetCreature(*me, uiTirionGUID);
Talk(EMOTE_LIGHT_OF_DAWN05);
if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0))
if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN))
me->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiKoltiraGUID))
{
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0))
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z);
}
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiThassarianGUID))
{
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0))
if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN))
temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN);
temp->SetWalk(true);
temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z);
@@ -1124,7 +1124,7 @@ public:
me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896f, -5287.914f, 83.066f, 0, 0, 0, 0, 0, 30);
if (Creature* temp = ObjectAccessor::GetCreature(*me, uiTirionGUID))
{
if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, 0))
if (temp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER))
temp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER);
temp->CastSpell(temp, 41542, false); // workarounds, light expoded, makes it cool
temp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
@@ -1414,7 +1414,7 @@ public:
bIsBattle = false;
uiFight_duration = 300000;
if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE, 0))
if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE))
me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE);
me->RemoveAllAuras();
me->DeleteThreatList();
@@ -1513,7 +1513,7 @@ public:
++uiStep;
}
void NPCChangeTarget(uint64 ui_GUID)
void NPCChangeTarget(ObjectGuid ui_GUID)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, ui_GUID))
if (temp->IsAlive())
@@ -1632,7 +1632,7 @@ public:
}
}
void DespawnNPC(uint64 pGUID)
void DespawnNPC(ObjectGuid pGUID)
{
if (Creature* temp = ObjectAccessor::GetCreature(*me, pGUID))
if (temp->IsAlive())
@@ -120,17 +120,17 @@ public:
case GO_COURTYARD_DOOR:
DoorCourtyardGUID = go->GetGUID();
if (m_auiEncounter[0] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_SORCERER_DOOR:
DoorSorcererGUID = go->GetGUID();
if (m_auiEncounter[2] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ARUGAL_DOOR:
DoorArugalGUID = go->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
}
}
@@ -163,37 +163,37 @@ class instance_stratholme : public InstanceMapScript
case GO_ZIGGURAT1:
ziggurat1GUID = go->GetGUID();
if (GetData(TYPE_BARONESS) == IN_PROGRESS)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ZIGGURAT2:
ziggurat2GUID = go->GetGUID();
if (GetData(TYPE_NERUB) == IN_PROGRESS)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ZIGGURAT3:
ziggurat3GUID = go->GetGUID();
if (GetData(TYPE_PALLID) == IN_PROGRESS)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ZIGGURAT4:
ziggurat4GUID = go->GetGUID();
if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ZIGGURAT5:
ziggurat5GUID = go->GetGUID();
if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_PORT_GAUNTLET:
portGauntletGUID = go->GetGUID();
if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_PORT_SLAUGTHER:
portSlaugtherGUID = go->GetGUID();
if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_PORT_ELDERS:
portElderGUID = go->GetGUID();
@@ -96,14 +96,14 @@ class instance_uldaman : public InstanceMapScript
altarOfTheKeeperTempleDoor = go->GetGUID();
if (m_auiEncounter[0] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ARCHAEDAS_TEMPLE_DOOR:
archaedasTempleDoor = go->GetGUID();
if (m_auiEncounter[0] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ANCIENT_VAULT_DOOR:
@@ -112,14 +112,14 @@ class instance_uldaman : public InstanceMapScript
ancientVaultDoor = go->GetGUID();
if (m_auiEncounter[1] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_IRONAYA_SEAL_DOOR:
ironayaSealDoor = go->GetGUID();
if (m_auiEncounter[2] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_KEYSTONE:
@@ -127,7 +127,7 @@ class instance_uldaman : public InstanceMapScript
if (m_auiEncounter[2] == DONE)
{
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
go->SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND);
}
break;
@@ -288,7 +288,7 @@ class npc_harrison_jones : public CreatureScript
me->RemoveAllAuras();
me->SetEntry(NPC_HARRISON_JONES_2);
me->SetDisplayId(MODEL_HARRISON_JONES_2);
me->SetTarget(0);
me->SetTarget(ObjectGuid::Empty);
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_DEAD);
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
instance->SetData(DATA_GONGEVENT, DONE);
+30 -30
View File
@@ -131,13 +131,13 @@ enum Misc
DISPLAY_INVISIBLE = 11686
};
uint64 getOrphanGUID(Player* player, uint32 orphan)
ObjectGuid getOrphanGUID(Player* player, uint32 orphan)
{
if (Aura* orphanOut = player->GetAura(SPELL_ORPHAN_OUT))
if (orphanOut->GetCaster() && orphanOut->GetCaster()->GetEntry() == orphan)
return orphanOut->GetCaster()->GetGUID();
return 0;
return ObjectGuid::Empty;
}
/*######
@@ -159,8 +159,8 @@ class npc_winterfin_playmate : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -235,8 +235,8 @@ class npc_winterfin_playmate : public CreatureScript
private:
uint32 timer;
int8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -265,8 +265,8 @@ class npc_snowfall_glade_playmate : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -342,8 +342,8 @@ class npc_snowfall_glade_playmate : public CreatureScript
private:
uint32 timer;
int8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
CreatureAI* GetAI(Creature* pCreature) const override
@@ -372,8 +372,8 @@ class npc_the_biggest_tree : public CreatureScript
{
timer = 1000;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -436,8 +436,8 @@ class npc_the_biggest_tree : public CreatureScript
private:
uint32 timer;
uint8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -466,8 +466,8 @@ class npc_high_oracle_soo_roo : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -533,8 +533,8 @@ class npc_high_oracle_soo_roo : public CreatureScript
private:
uint32 timer;
int8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -563,8 +563,8 @@ class npc_elder_kekek : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -628,8 +628,8 @@ class npc_elder_kekek : public CreatureScript
private:
uint32 timer;
int8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -659,8 +659,8 @@ class npc_the_etymidian : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -732,8 +732,8 @@ class npc_the_etymidian : public CreatureScript
private:
uint32 timer;
int8 phase;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -762,8 +762,8 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
{
timer = 0;
phase = 0;
playerGUID = 0;
orphanGUID = 0;
playerGUID.Clear();
orphanGUID.Clear();
}
void Reset() override
@@ -900,8 +900,8 @@ class npc_alexstraza_the_lifebinder : public CreatureScript
private:
int8 phase;
uint32 timer;
uint64 playerGUID;
uint64 orphanGUID;
ObjectGuid playerGUID;
ObjectGuid orphanGUID;
};
@@ -137,7 +137,7 @@ public:
break;
case GO_AKU_MAI_DOOR:
if (encounter[2] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
mainDoorGUID = go->GetGUID();
break;
}
@@ -321,8 +321,6 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me)
instance = creature->GetInstanceScript();
VeinsSpawned[0] = false;
VeinsSpawned[1] = false;
for (uint8 i=0; i<14; ++i)
VeinGUID[i] = 0;
InfernalCount = 0;
TeleportTimer = 1000;
Overrun = false;
@@ -335,7 +333,6 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me)
DoRespawn = false;
MassTeleportTimer = 0;
DoMassTeleport = false;
DummyGuid = 0;
}
void hyjalAI::Initialize()
@@ -343,9 +340,9 @@ void hyjalAI::Initialize()
IsDummy = false;
// GUIDs
PlayerGUID = 0;
BossGUID[0] = 0;
BossGUID[1] = 0;
PlayerGUID.Clear();
BossGUID[0].Clear();
BossGUID[1].Clear();
// Timers
NextWaveTimer = 10000;
@@ -651,21 +648,23 @@ void hyjalAI::SpawnVeins()
{
if (VeinsSpawned[0])//prevent any buggers
return;
for (uint8 i = 0; i<7; ++i)
for (uint8 i = 0; i < 7; ++i)
{
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
VeinsSpawned[0] = true;
}else{
}
else
{
if (VeinsSpawned[1])
return;
for (uint8 i = 7; i<14; ++i)
for (uint8 i = 7; i < 14; ++i)
{
GameObject* gem = me->SummonGameObject(GO_ANCIENT_VEIN, VeinPos[i][0], VeinPos[i][1], VeinPos[i][2], VeinPos[i][3], VeinPos[i][4], VeinPos[i][5], VeinPos[i][6], VeinPos[i][7], 0);
if (gem)
VeinGUID[i]=gem->GetGUID();
VeinGUID[i] = gem->GetGUID();
}
VeinsSpawned[1] = true;
}
@@ -679,18 +678,21 @@ void hyjalAI::DeSpawnVeins()
if (!unit)return;
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
if (!ai)return;
for (uint8 i = 0; i<7; ++i)
for (uint8 i = 0; i < 7; ++i)
{
if (GameObject* gem = instance->instance->GetGameObject(ai->VeinGUID[i]))
gem->Delete();
}
} else if (Faction)
}
else if (Faction)
{
Creature* unit=ObjectAccessor::GetCreature((*me), instance->GetGuidData(DATA_THRALL));
if (!unit)return;
if (!unit)
return;
hyjalAI* ai = CAST_AI(hyjalAI, unit->AI());
if (!ai)return;
for (uint8 i = 7; i<14; ++i)
if (!ai)
return;
for (uint8 i = 7; i < 14; ++i)
{
if (GameObject* gem = instance->instance->GetGameObject(ai->VeinGUID[i]))
gem->Delete();
@@ -706,7 +708,9 @@ void hyjalAI::UpdateAI(uint32 diff)
{
DoCast(me, SPELL_MASS_TELEPORT, false);
DoMassTeleport = false;
} else MassTeleportTimer -= diff;
}
else
MassTeleportTimer -= diff;
return;
}
if (DoHide)
@@ -830,7 +834,7 @@ void hyjalAI::UpdateAI(uint32 diff)
EventBegun = false;
CheckTimer = 0;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
BossGUID[i] = 0;
BossGUID[i].Clear();
instance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
}
}
@@ -160,9 +160,9 @@ struct hyjalAI : public npc_escortAI
public:
InstanceScript* instance;
uint64 PlayerGUID;
uint64 BossGUID[2];
uint64 VeinGUID[14];
ObjectGuid PlayerGUID;
ObjectGuid BossGUID[2];
ObjectGuid VeinGUID[14];
uint32 NextWaveTimer;
uint32 WaveCount;
@@ -193,7 +193,7 @@ struct hyjalAI : public npc_escortAI
bool IsDummy;
uint32 MassTeleportTimer;
bool DoMassTeleport;
uint64 DummyGuid;
ObjectGuid DummyGuid;
struct Spell
{
@@ -98,16 +98,16 @@ public:
case GO_HORDE_ENCAMPMENT_PORTAL:
HordeGate = go->GetGUID();
if (allianceRetreat)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
else
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_NIGHT_ELF_VILLAGE_PORTAL:
ElfGate = go->GetGUID();
if (hordeRetreat)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
else
HandleGameObject(0, false, go);
HandleGameObject(ObjectGuid::Empty, false, go);
break;
case GO_ANCIENT_GEM:
m_uiAncientGemGUID.push_back(go->GetGUID());
@@ -360,23 +360,23 @@ public:
void Initialize()
{
utherGUID = 0;
jainaGUID = 0;
utherGUID.Clear();
jainaGUID.Clear();
for (uint8 i = 0; i < 2; ++i)
citymenGUID[i] = 0;
citymenGUID[i].Clear();
for (uint8 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
waveGUID[i] = 0;
waveGUID[i].Clear();
for (uint8 i = 0; i < ENCOUNTER_DRACONIAN_NUMBER; ++i)
infiniteDraconianGUID[i] = 0;
infiniteDraconianGUID[i].Clear();
stalkerGUID = 0;
bossGUID = 0;
epochGUID = 0;
malganisGUID = 0;
infiniteGUID = 0;
stalkerGUID.Clear();
bossGUID.Clear();
epochGUID.Clear();
malganisGUID.Clear();
infiniteGUID.Clear();
phaseTimer = 1000;
exorcismTimer = 7300;
@@ -393,17 +393,17 @@ public:
uint32 wave;
uint32 WavesCounter;
uint64 utherGUID;
uint64 jainaGUID;
uint64 citymenGUID[2];
uint64 waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS];
uint64 infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER];
uint64 stalkerGUID;
ObjectGuid utherGUID;
ObjectGuid jainaGUID;
ObjectGuid citymenGUID[2];
ObjectGuid waveGUID[ENCOUNTER_WAVES_MAX_SPAWNS];
ObjectGuid infiniteDraconianGUID[ENCOUNTER_DRACONIAN_NUMBER];
ObjectGuid stalkerGUID;
uint64 bossGUID;
uint64 epochGUID;
uint64 malganisGUID;
uint64 infiniteGUID;
ObjectGuid bossGUID;
ObjectGuid epochGUID;
ObjectGuid malganisGUID;
ObjectGuid infiniteGUID;
uint32 exorcismTimer;
@@ -436,7 +436,7 @@ public:
instance->SetBossState(DATA_ARTHAS, FAIL);
}
void SpawnTimeRift(uint32 timeRiftID, uint64* guidVector)
void SpawnTimeRift(uint32 timeRiftID, ObjectGuid* guidVector)
{
me->SummonCreature((uint32)RiftAndSpawnsLocations[timeRiftID][0], RiftAndSpawnsLocations[timeRiftID][1], RiftAndSpawnsLocations[timeRiftID][2], RiftAndSpawnsLocations[timeRiftID][3], RiftAndSpawnsLocations[timeRiftID][4], TEMPSUMMON_TIMED_DESPAWN, 11000);
@@ -455,7 +455,7 @@ public:
}
}
void SpawnWaveGroup(uint32 waveID, uint64* guidVector)
void SpawnWaveGroup(uint32 waveID, ObjectGuid* guidVector)
{
for (uint32 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
{
@@ -736,7 +736,7 @@ public:
case 21:
SetEscortPaused(false);
bStepping = false;
me->SetTarget(0);
me->SetTarget(ObjectGuid::Empty);
JumpToNextStep(0);
break;
//After waypoint 3
@@ -756,7 +756,7 @@ public:
if (Creature* uther = ObjectAccessor::GetCreature(*me, utherGUID))
uther->DisappearAndDie();
me->SetTarget(0);
me->SetTarget(ObjectGuid::Empty);
JumpToNextStep(0);
break;
//After Gossip 1 (waypoint 8)
@@ -779,7 +779,7 @@ public:
SetEscortPaused(false);
bStepping = false;
SetRun(false);
me->SetTarget(0);
me->SetTarget(ObjectGuid::Empty);
JumpToNextStep(0);
break;
//After waypoint 9
@@ -938,7 +938,7 @@ public:
uint32 deadCounter = 0;
for (uint8 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
{
if (waveGUID[i] == 0)
if (waveGUID[i].IsEmpty())
break;
++mobCounter;
Unit* temp = ObjectAccessor::GetCreature(*me, waveGUID[i]);
@@ -440,7 +440,7 @@ public:
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource())
player->KilledMonsterCredit(20156, 0);
player->KilledMonsterCredit(20156);
}
}
@@ -588,7 +588,7 @@ public:
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
{
instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
if (instance->GetGuidData(DATA_EPOCH) == 0)
if (instance->GetGuidData(DATA_EPOCH))
creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (Creature* thrall = (ObjectAccessor::GetCreature(*creature, instance->GetGuidData(DATA_THRALL))))
@@ -159,13 +159,12 @@ public:
npc_snufflenose_gopherAI(Creature* creature) : PetAI(creature)
{
IsMovementActive = false;
TargetTubberGUID = 0;
}
void Reset() override
{
IsMovementActive = false;
TargetTubberGUID = 0;
TargetTubberGUID.Clear();
}
void MovementInform(uint32 type, uint32 id) override
@@ -227,7 +226,7 @@ public:
bool IsMovementActive;
uint64 TargetTubberGUID;
ObjectGuid TargetTubberGUID;
};
};
@@ -103,14 +103,16 @@ public:
gatherOthersWhenAggro = true;
}
uint64 NearbyGUID[3];
ObjectGuid NearbyGUID[3];
void ClearBuddyList()
{
NearbyGUID[0] = NearbyGUID[1] = NearbyGUID[2] = 0;
NearbyGUID[0].Clear();
NearbyGUID[1].Clear();
NearbyGUID[2].Clear();
}
void AddBuddyToList(uint64 CreatureGUID)
void AddBuddyToList(ObjectGuid CreatureGUID)
{
if (CreatureGUID == me->GetGUID())
return;
@@ -130,7 +132,7 @@ public:
void GiveBuddyMyList(Creature* c)
{
aqsentinelAI* cai = ENSURE_AI(aqsentinelAI, (c)->AI());
for (int i=0; i<3; ++i)
for (int32 i = 0; i < 3; ++i)
if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID())
cai->AddBuddyToList(NearbyGUID[i]);
cai->AddBuddyToList(me->GetGUID());
@@ -138,14 +140,14 @@ public:
void SendMyListToBuddies()
{
for (int i=0; i<3; ++i)
for (int32 i = 0; i < 3; ++i)
if (Creature* pNearby = ObjectAccessor::GetCreature(*me, NearbyGUID[i]))
GiveBuddyMyList(pNearby);
}
void CallBuddiesToAttack(Unit* who)
{
for (int i=0; i<3; ++i)
for (int32 i = 0; i < 3; ++i)
{
Creature* c = ObjectAccessor::GetCreature(*me, NearbyGUID[i]);
if (c)
@@ -222,7 +224,7 @@ public:
{
if (!me->isDead())
{
for (int i=0; i<3; ++i)
for (int i = 0; i < 3; ++i)
{
if (!NearbyGUID[i])
continue;
@@ -252,7 +254,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
for (int ni=0; ni<3; ++ni)
for (int ni = 0; ni < 3; ++ni)
{
Creature* sent = ObjectAccessor::GetCreature(*me, NearbyGUID[ni]);
if (!sent)
@@ -108,7 +108,6 @@ public:
instance = creature->GetInstanceScript();
postGossipStep = 0;
Text_Timer = 0;
PlayerGUID = 0;
}
void Initialize()
@@ -123,7 +122,7 @@ public:
uint32 Text_Timer;
uint32 ShieldBash_Timer;
uint32 Revenge_Timer; //this is wrong, spell should never be used unless me->GetVictim() dodge, parry or block attack. Trinity support required.
uint64 PlayerGUID;
ObjectGuid PlayerGUID;
void Reset() override
{
@@ -90,7 +90,7 @@ class instance_ahnkahet : public InstanceMapScript
case GO_PRINCE_TALDARAM_PLATFORM:
PrinceTaldaramPlatformGUID = go->GetGUID();
if (GetBossState(DATA_PRINCE_TALDARAM) == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_SPHERE_1:
if (SpheresState[0])
@@ -662,7 +662,7 @@ class npc_acolyte_of_shadron : public CreatureScript
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT) && !i->GetSource()->GetVictim())
{
i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
@@ -750,14 +750,14 @@ class npc_acolyte_of_vesperon : public CreatureScript
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT, 0) && !i->GetSource()->GetVictim())
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_SHIFT) && !i->GetSource()->GetVictim())
{
i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_SHIFT_REMOVAL_ALL, true);
i->GetSource()->CastSpell(i->GetSource(), SPELL_TWILIGHT_RESIDUE, true);
i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT);
i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER);
}
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_TORMENT_VESP, 0) && !i->GetSource()->GetVictim())
if (i->GetSource()->IsAlive() && i->GetSource()->HasAura(SPELL_TWILIGHT_TORMENT_VESP) && !i->GetSource()->GetVictim())
i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
}
}
@@ -80,14 +80,6 @@ public:
uiPhase = 0;
uiTimer = 0;
uiVehicle1GUID = 0;
uiVehicle2GUID = 0;
uiVehicle3GUID = 0;
Champion1List.clear();
Champion2List.clear();
Champion3List.clear();
me->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -111,13 +103,13 @@ public:
uint32 uiPhase;
uint32 uiTimer;
uint64 uiVehicle1GUID;
uint64 uiVehicle2GUID;
uint64 uiVehicle3GUID;
ObjectGuid uiVehicle1GUID;
ObjectGuid uiVehicle2GUID;
ObjectGuid uiVehicle3GUID;
std::list<uint64> Champion1List;
std::list<uint64> Champion2List;
std::list<uint64> Champion3List;
GuidList Champion1List;
GuidList Champion2List;
GuidList Champion3List;
void NextStep(uint32 uiTimerStep, bool bNextStep = true, uint8 uiPhaseStep = 0)
{
@@ -145,7 +137,7 @@ public:
case DATA_LESSER_CHAMPIONS_DEFEATED:
{
++uiLesserChampions;
std::list<uint64> TempList;
GuidList TempList;
if (uiLesserChampions == 3 || uiLesserChampions == 6)
{
switch (uiLesserChampions)
@@ -158,7 +150,7 @@ public:
break;
}
for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
for (GuidList::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
AggroAllPlayers(summon);
}else if (uiLesserChampions == 9)
@@ -230,7 +222,7 @@ public:
case 1:
{
uiVehicle1GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss1 = 0;
ObjectGuid uiGrandChampionBoss1;
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss1 = unit->GetGUID();
@@ -242,7 +234,7 @@ public:
case 2:
{
uiVehicle2GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss2 = 0;
ObjectGuid uiGrandChampionBoss2;
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss2 = unit->GetGUID();
@@ -254,7 +246,7 @@ public:
case 3:
{
uiVehicle3GUID = pBoss->GetGUID();
uint64 uiGrandChampionBoss3 = 0;
ObjectGuid uiGrandChampionBoss3;
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
if (Unit* unit = pVehicle->GetPassenger(0))
uiGrandChampionBoss3 = unit->GetGUID();
@@ -414,7 +406,7 @@ public:
case 3:
if (!Champion1List.empty())
{
for (std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
for (GuidList::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
AggroAllPlayers(summon);
NextStep(0, false);
@@ -368,14 +368,7 @@ class npc_fizzlebang_toc : public CreatureScript
{
npc_fizzlebang_tocAI(Creature* creature) : ScriptedAI(creature), _summons(me)
{
Initialize();
_instance = me->GetInstanceScript();
_triggerGUID = 0;
}
void Initialize()
{
_portalGUID = 0;
}
void JustDied(Unit* killer) override
@@ -392,8 +385,8 @@ class npc_fizzlebang_toc : public CreatureScript
void Reset() override
{
_portalGUID.Clear();
me->SetWalk(true);
Initialize();
me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ());
}
@@ -526,8 +519,8 @@ class npc_fizzlebang_toc : public CreatureScript
private:
InstanceScript* _instance;
SummonList _summons;
uint64 _portalGUID;
uint64 _triggerGUID;
ObjectGuid _portalGUID;
ObjectGuid _triggerGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -347,8 +347,6 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
npc_jaina_or_sylvanas_intro_horAI(Creature* creature) : ScriptedAI(creature)
{
_instance = me->GetInstanceScript();
_utherGUID = 0;
_lichkingGUID = 0;
}
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
@@ -376,8 +374,8 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
{
_events.Reset();
_utherGUID = 0;
_lichkingGUID = 0;
_utherGUID.Clear();
_lichkingGUID.Clear();
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
me->SetStandState(UNIT_STAND_STATE_STAND);
@@ -627,7 +625,7 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
{
uther->CastSpell(uther, SPELL_UTHER_DESPAWN, true);
uther->DespawnOrUnsummon(5000);
_utherGUID = 0;
_utherGUID.Clear();
}
_events.ScheduleEvent(EVENT_INTRO_LK_4, 9000);
break;
@@ -719,7 +717,7 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID))
{
lichking->DespawnOrUnsummon(5000);
_lichkingGUID = 0;
_lichkingGUID.Clear();
}
me->DespawnOrUnsummon(10000);
_events.ScheduleEvent(EVENT_CLOSE_IMPENETRABLE_DOOR, 7000);
@@ -762,8 +760,8 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
private:
InstanceScript* _instance;
EventMap _events;
uint64 _utherGUID;
uint64 _lichkingGUID;
ObjectGuid _utherGUID;
ObjectGuid _lichkingGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -933,7 +931,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
}
}
void DeleteAllFromThreatList(Unit* target, uint64 except)
void DeleteAllFromThreatList(Unit* target, ObjectGuid except)
{
ThreatContainer::StorageType threatlist = target->getThreatManager().getThreatList();
for (auto i : threatlist)
@@ -230,7 +230,7 @@ class spell_trash_npc_glacial_strike : public SpellScriptLoader
{
if (GetTarget()->IsFullHealth())
{
GetTarget()->RemoveAura(GetId(), 0, 0, AURA_REMOVE_BY_ENEMY_SPELL);
GetTarget()->RemoveAura(GetId(), ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL);
PreventDefaultAction();
}
}
@@ -239,22 +239,22 @@ public:
case GO_ECK_THE_FEROCIOUS_DOOR:
eckTheFerociousDoorGUID = go->GetGUID();
if (isHeroic && m_auiEncounter[1] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_ECK_THE_FEROCIOUS_DOOR_BEHIND:
eckTheFerociousDoorBehindGUID = go->GetGUID();
if (isHeroic && m_auiEncounter[4] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_GALDARAH_DOOR1:
galDarahDoor1GUID = go->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_GALDARAH_DOOR2:
galDarahDoor2GUID = go->GetGUID();
if (m_auiEncounter[3] == DONE)
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
break;
case GO_BRIDGE:
bridgeGUID = go->GetGUID();
@@ -390,9 +390,9 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
void Initialize()
{
_theLichKing = 0;
_bolvarFordragon = 0;
_factionNPC = 0;
_theLichKing.Clear();
_bolvarFordragon.Clear();
_factionNPC.Clear();
_damnedKills = 0;
}
@@ -581,9 +581,9 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript
private:
EventMap _events;
InstanceScript* const _instance;
uint64 _theLichKing;
uint64 _bolvarFordragon;
uint64 _factionNPC;
ObjectGuid _theLichKing;
ObjectGuid _bolvarFordragon;
ObjectGuid _factionNPC;
uint16 _damnedKills;
};
@@ -1206,7 +1206,7 @@ class npc_crok_scourgebane : public CreatureScript
private:
EventMap _events;
std::set<uint64> _aliveTrash;
GuidSet _aliveTrash;
InstanceScript* _instance;
uint32 _currentWPid;
uint32 _wipeCheckTimer;
@@ -152,7 +152,7 @@ public:
bool bMarnakActivated;
bool bAbedneumActivated;
std::list<uint64> KaddrakGUIDList;
GuidList KaddrakGUIDList;
void Reset() override
{
@@ -206,7 +206,7 @@ public:
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (!KaddrakGUIDList.empty())
for (std::list<uint64>::const_iterator itr = KaddrakGUIDList.begin(); itr != KaddrakGUIDList.end(); ++itr)
for (GuidList::const_iterator itr = KaddrakGUIDList.begin(); itr != KaddrakGUIDList.end(); ++itr)
{
if (Creature* pKaddrak = ObjectAccessor::GetCreature(*me, *itr))
{
@@ -296,8 +296,8 @@ public:
uint32 uiStep;
uint32 uiPhaseTimer;
uint64 uiControllerGUID;
std::list<uint64> lDwarfGUIDList;
ObjectGuid uiControllerGUID;
GuidList lDwarfGUIDList;
InstanceScript* instance;
@@ -313,7 +313,7 @@ public:
bIsBattle = false;
uiStep = 0;
uiPhaseTimer = 0;
uiControllerGUID = 0;
uiControllerGUID.Clear();
brannSparklinNews = true;
DespawnDwarf();
@@ -326,9 +326,9 @@ public:
{
if (lDwarfGUIDList.empty())
return;
for (std::list<uint64>::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
for (GuidList::const_iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
{
Creature* temp = ObjectAccessor::GetCreature(*me, instance ? (*itr) : 0);
Creature* temp = ObjectAccessor::GetCreature(*me, instance ? (*itr) : ObjectGuid::Empty);
if (temp && temp->IsAlive())
temp->DespawnOrUnsummon();
}
@@ -489,7 +489,7 @@ class instance_ulduar : public InstanceMapScript
case GO_KOLOGARN_BRIDGE:
KologarnBridgeGUID = gameObject->GetGUID();
if (GetBossState(BOSS_KOLOGARN) == DONE)
HandleGameObject(0, false, gameObject);
HandleGameObject(ObjectGuid::Empty, false, gameObject);
break;
case GO_THORIM_CHEST_HERO:
case GO_THORIM_CHEST:
@@ -94,39 +94,39 @@ class instance_utgarde_keep : public InstanceMapScript
{
case GO_BELLOW_1:
Forges[0].BellowGUID = go->GetGUID();
HandleGameObject(0, Forges[0].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[0].Event != NOT_STARTED, go);
break;
case GO_BELLOW_2:
Forges[1].BellowGUID = go->GetGUID();
HandleGameObject(0, Forges[1].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[1].Event != NOT_STARTED, go);
break;
case GO_BELLOW_3:
Forges[2].BellowGUID = go->GetGUID();
HandleGameObject(0, Forges[2].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[2].Event != NOT_STARTED, go);
break;
case GO_FORGEFIRE_1:
Forges[0].FireGUID = go->GetGUID();
HandleGameObject(0, Forges[0].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[0].Event != NOT_STARTED, go);
break;
case GO_FORGEFIRE_2:
Forges[1].FireGUID = go->GetGUID();
HandleGameObject(0, Forges[1].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[1].Event != NOT_STARTED, go);
break;
case GO_FORGEFIRE_3:
Forges[2].FireGUID = go->GetGUID();
HandleGameObject(0, Forges[2].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[2].Event != NOT_STARTED, go);
break;
case GO_GLOWING_ANVIL_1:
Forges[0].AnvilGUID = go->GetGUID();
HandleGameObject(0, Forges[0].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[0].Event != NOT_STARTED, go);
break;
case GO_GLOWING_ANVIL_2:
Forges[1].AnvilGUID = go->GetGUID();
HandleGameObject(0, Forges[1].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[1].Event != NOT_STARTED, go);
break;
case GO_GLOWING_ANVIL_3:
Forges[2].AnvilGUID = go->GetGUID();
HandleGameObject(0, Forges[2].Event != NOT_STARTED, go);
HandleGameObject(ObjectGuid::Empty, Forges[2].Event != NOT_STARTED, go);
break;
case GO_GIANT_PORTCULLIS_1:
case GO_GIANT_PORTCULLIS_2:
@@ -107,7 +107,7 @@ class instance_utgarde_pinnacle : public InstanceMapScript
GortokPalehoofSphereGUID = go->GetGUID();
if (GetBossState(DATA_GORTOK_PALEHOOF) == DONE)
{
HandleGameObject(0, true, go);
HandleGameObject(ObjectGuid::Empty, true, go);
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
}
break;
@@ -32,7 +32,7 @@ void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
{
if (killed->GetTypeId() == TYPEID_PLAYER && player->GetTeam() != killed->ToPlayer()->GetTeam())
{
player->KilledMonsterCredit(NA_CREDIT_MARKER, 0); // 0 guid, btw it isn't even used in killedmonster function :S
player->KilledMonsterCredit(NA_CREDIT_MARKER); // 0 guid, btw it isn't even used in killedmonster function :S
if (player->GetTeam() == ALLIANCE)
player->CastSpell(player, NA_KILL_TOKEN_ALLIANCE, true);
else
@@ -109,7 +109,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
// add 20 cenarion circle repu
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
// complete quest
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A, 0);
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_A);
}
return true;
case SI_AREATRIGGER_H:
@@ -135,7 +135,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player* player, uint32 trigger)
// add 20 cenarion circle repu
player->GetReputationMgr().ModifyReputation(sFactionStore.LookupEntry(609), 20);
// complete quest
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H, 0);
player->KilledMonsterCredit(SI_TURNIN_QUEST_CM_H);
}
return true;
}
@@ -297,8 +297,8 @@ void OPvPCapturePointZM_GraveYard::SetBeaconState(uint32 controlling_faction)
bool OPvPCapturePointZM_GraveYard::CanTalkTo(Player* player, Creature* c, GossipMenuItems const& /*gso*/)
{
uint64 guid = c->GetGUID();
std::map<uint64, uint32>::iterator itr = m_CreatureTypes.find(guid);
ObjectGuid guid = c->GetGUID();
std::map<ObjectGuid, uint32>::iterator itr = m_CreatureTypes.find(guid);
if (itr != m_CreatureTypes.end())
{
if (itr->second == ZM_ALLIANCE_FIELD_SCOUT && player->GetTeam() == ALLIANCE && m_BothControllingFaction == ALLIANCE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_A)
@@ -129,11 +129,9 @@ public:
{
npc_blood_elf_council_voice_triggerAI(Creature* creature) : ScriptedAI(creature)
{
for (uint8 i = 0; i < 4; ++i)
Council[i] = 0;
}
uint64 Council[4];
ObjectGuid Council[4];
uint32 EnrageTimer;
uint32 AggroYellTimer;
@@ -226,13 +224,11 @@ public:
npc_illidari_councilAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
for (uint8 i = 0; i < 4; ++i)
Council[i] = 0;
}
InstanceScript* instance;
uint64 Council[4];
ObjectGuid Council[4];
uint32 CheckTimer;
uint32 EndEventTimer;
@@ -379,12 +375,10 @@ struct boss_illidari_councilAI : public ScriptedAI
boss_illidari_councilAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
for (uint8 i = 0; i < 4; ++i)
Council[i] = 0;
LoadedGUIDs = false;
}
uint64 Council[4];
ObjectGuid Council[4];
InstanceScript* instance;
+2 -2
View File
@@ -59,7 +59,7 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
Initialize();
CasterAI::InitializeAI();
uint64 ownerGuid = me->GetOwnerGUID();
ObjectGuid ownerGuid = me->GetOwnerGUID();
if (!ownerGuid)
return;
@@ -69,7 +69,7 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check);
me->VisitNearbyObject(30.0f, searcher);
for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
if ((*iter)->GetAura(SPELL_DK_SUMMON_GARGOYLE_1, ownerGuid))
if ((*iter)->HasAura(SPELL_DK_SUMMON_GARGOYLE_1, ownerGuid))
{
me->Attack((*iter), false);
break;
+2 -8
View File
@@ -41,17 +41,11 @@ class npc_pet_gen_mojo : public CreatureScript
{
npc_pet_gen_mojoAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
_victimGUID = 0;
}
void Reset() override
{
Initialize();
_victimGUID.Clear();
if (Unit* owner = me->GetOwner())
me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
@@ -84,7 +78,7 @@ class npc_pet_gen_mojo : public CreatureScript
}
private:
uint64 _victimGUID;
ObjectGuid _victimGUID;
};
CreatureAI* GetAI(Creature* creature) const override
+4 -4
View File
@@ -770,7 +770,7 @@ public:
return false;
pPrisoner->DisappearAndDie();
player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN);
switch (pPrisoner->GetEntry())
{
case NPC_EBON_BLADE_PRISONER_HUMAN:
@@ -988,7 +988,7 @@ public:
if (qInfo)
{
/// @todo prisoner should help player for a short period of time
player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0]);
pPrisoner->DisappearAndDie();
}
return true;
@@ -1020,7 +1020,7 @@ public:
if (pTadpole)
{
pTadpole->DisappearAndDie();
player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0);
player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE);
//FIX: Summon minion tadpole
}
}
@@ -1154,7 +1154,7 @@ class go_gjalerbron_cage : public GameObjectScript
{
if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f))
{
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0);
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER);
prisoner->AI()->Talk(SAY_FREE);
prisoner->DespawnOrUnsummon(6000);
+1 -1
View File
@@ -351,7 +351,7 @@ public:
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
player->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF, 0);
player->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF);
return true;
}
}
+5 -5
View File
@@ -196,11 +196,11 @@ public:
if (!playerTarget)
return;
Creature* lastSpawnedGuard = SpawnedGUID == 0 ? NULL : GetSummonedGuard();
Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? NULL : GetSummonedGuard();
// prevent calling Unit::GetUnit at next MoveInLineOfSight call - speedup
if (!lastSpawnedGuard)
SpawnedGUID = 0;
SpawnedGUID.Clear();
switch (SpawnAssoc->spawnType)
{
@@ -1106,7 +1106,7 @@ public:
break;
}
Start(false, true, true);
Start(false, true);
}
else
EnterEvadeMode(); //something went wrong
@@ -1478,7 +1478,7 @@ public:
}
EventMap _events;
std::unordered_map<uint64, time_t> _damageTimes;
std::unordered_map<ObjectGuid, time_t> _damageTimes;
void Reset() override
{
@@ -1525,7 +1525,7 @@ public:
case EVENT_TD_CHECK_COMBAT:
{
time_t now = time(NULL);
for (std::unordered_map<uint64, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();)
for (std::unordered_map<ObjectGuid, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();)
{
// If unit has not dealt damage to training dummy for 5 seconds, remove him from combat
if (itr->second < now - 5)