aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp59
-rw-r--r--src/server/scripts/Northrend/zone_crystalsong_forest.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp19
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp14
-rw-r--r--src/server/scripts/Northrend/zone_howling_fjord.cpp8
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp15
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp12
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp22
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp9
9 files changed, 78 insertions, 84 deletions
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index cddcdce8c2d..7824fe86c87 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -71,13 +71,13 @@ public:
uint32 phaseTimer;
uint8 phase;
- uint64 casterGuid;
+ ObjectGuid casterGuid;
void Reset() override
{
phaseTimer = 500;
phase = 0;
- casterGuid = 0;
+ casterGuid.Clear();
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
@@ -391,7 +391,7 @@ public:
if (uiRand < 25)
{
player->CastSpell(me, SPELL_FREED_WARSONG_PEON, true);
- player->KilledMonsterCredit(NPC_WARSONG_PEON, 0);
+ player->KilledMonsterCredit(NPC_WARSONG_PEON);
}
else if (uiRand < 75)
player->CastSpell(me, nerubarVictims[urand(0, 2)], true);
@@ -449,7 +449,7 @@ public:
{
npc_nesingwary_trapperAI(Creature* creature) : ScriptedAI(creature) { creature->SetVisible(false); }
- uint64 go_caribouGUID;
+ ObjectGuid go_caribouGUID;
uint8 phase;
uint32 phaseTimer;
@@ -458,7 +458,7 @@ public:
me->SetVisible(false);
phaseTimer = 2500;
phase = 1;
- go_caribouGUID = 0;
+ go_caribouGUID.Clear();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -474,7 +474,7 @@ public:
if (summon->IsSummon())
if (Unit* temp = summon->GetSummoner())
if (Player* player = temp->ToPlayer())
- player->KilledMonsterCredit(me->GetEntry(), 0);
+ player->KilledMonsterCredit(me->GetEntry());
if (GameObject* go_caribou = me->GetMap()->GetGameObject(go_caribouGUID))
go_caribou->SetGoState(GO_STATE_READY);
@@ -723,10 +723,9 @@ public:
{
npc_nexus_drake_hatchlingAI(Creature* creature) : FollowerAI(creature)
{
- HarpoonerGUID = 0;
}
- uint64 HarpoonerGUID;
+ ObjectGuid HarpoonerGUID;
bool WithRedDragonBlood;
void Reset() override
@@ -764,10 +763,10 @@ public:
{
if (Player* pHarpooner = ObjectAccessor::GetPlayer(*me, HarpoonerGUID))
{
- pHarpooner->KilledMonsterCredit(26175, 0);
+ pHarpooner->KilledMonsterCredit(26175);
pHarpooner->RemoveAura(SPELL_DRAKE_HATCHLING_SUBDUED);
SetFollowComplete();
- HarpoonerGUID = 0;
+ HarpoonerGUID.Clear();
me->DisappearAndDie();
}
}
@@ -793,7 +792,7 @@ public:
if ((me->getFaction() == 35) && (!me->HasAura(SPELL_SUBDUED)))
{
- HarpoonerGUID = 0;
+ HarpoonerGUID.Clear();
me->DisappearAndDie();
}
@@ -865,10 +864,10 @@ public:
{
npc_thassarianAI(Creature* creature) : npc_escortAI(creature) { }
- uint64 arthasGUID;
- uint64 talbotGUID;
- uint64 leryssaGUID;
- uint64 arlosGUID;
+ ObjectGuid arthasGUID;
+ ObjectGuid talbotGUID;
+ ObjectGuid leryssaGUID;
+ ObjectGuid arlosGUID;
bool arthasInPosition;
bool arlosInPosition;
@@ -883,10 +882,10 @@ public:
me->RestoreFaction();
me->RemoveStandFlags(UNIT_STAND_STATE_SIT);
- arthasGUID = 0;
- talbotGUID = 0;
- leryssaGUID = 0;
- arlosGUID = 0;
+ arthasGUID.Clear();
+ talbotGUID.Clear();
+ leryssaGUID.Clear();
+ arlosGUID.Clear();
arthasInPosition = false;
arlosInPosition = false;
@@ -1242,8 +1241,8 @@ public:
{
npc_counselor_talbotAI(Creature* creature) : ScriptedAI(creature) { }
- uint64 leryssaGUID;
- uint64 arlosGUID;
+ ObjectGuid leryssaGUID;
+ ObjectGuid arlosGUID;
bool bCheck;
@@ -1253,8 +1252,8 @@ public:
void Reset() override
{
- leryssaGUID = 0;
- arlosGUID = 0;
+ leryssaGUID.Clear();
+ arlosGUID.Clear();
bCheck = false;
shadowBoltTimer = urand(5000, 12000);
deflectionTimer = urand(20000, 25000);
@@ -1609,15 +1608,11 @@ public:
void SpellHit(Unit* unit, const SpellInfo* spell) override
{
if (spell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
- {
if (Player* player = unit->ToPlayer())
- {
GotStinged(player->GetGUID());
- }
- }
}
- void GotStinged(uint64 casterGUID)
+ void GotStinged(ObjectGuid casterGUID)
{
if (Player* caster = ObjectAccessor::GetPlayer(*me, casterGUID))
{
@@ -1644,7 +1639,7 @@ public:
break;
case 7:
Talk(SAY_IMPRISIONED_BERYL_7);
- caster->KilledMonsterCredit(NPC_IMPRISONED_BERYL_SORCERER, 0);
+ caster->KilledMonsterCredit(NPC_IMPRISONED_BERYL_SORCERER);
break;
}
}
@@ -1980,7 +1975,7 @@ public:
{
Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW);
if (qInfo)
- player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
+ player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0]);
}
}
};
@@ -2195,7 +2190,7 @@ public:
uint32 uiEventTimer;
uint8 uiEventPhase;
- uint64 uiPlayerGUID;
+ ObjectGuid uiPlayerGUID;
void Reset() override
{
@@ -2208,7 +2203,7 @@ public:
uiEventTimer = 0;
uiEventPhase = 0;
- uiPlayerGUID = 0;
+ uiPlayerGUID.Clear();
DoCast(SPELL_SHROUD_OF_THE_DEATH_CULTIST);
diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
index 7d680ecd071..9cad60f8766 100644
--- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
+++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp
@@ -56,11 +56,11 @@ public:
SetCombatMovement(false);
}
- uint64 targetGUID;
+ ObjectGuid targetGUID;
void Reset() override
{
- targetGUID = 0;
+ targetGUID.Clear();
}
void UpdateAI(uint32 /*diff*/) override
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index 80e496a6e13..68c0ce3acc4 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -158,8 +158,12 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
void Reset() override
{
talkWing = 0;
- memset(audienceList, 0, sizeof(audienceList));
- memset(imageList, 0, sizeof(imageList));
+ for (ObjectGuid& guid : audienceList)
+ guid.Clear();
+
+ for (ObjectGuid& guid : imageList)
+ guid.Clear();
+
_events.ScheduleEvent(EVENT_GET_TARGETS, 5000);
_events.ScheduleEvent(EVENT_START_RANDOM, 20000);
}
@@ -351,8 +355,8 @@ class npc_commander_eligor_dawnbringer : public CreatureScript
}
private:
EventMap _events;
- uint64 audienceList[10];
- uint64 imageList[5];
+ ObjectGuid audienceList[10];
+ ObjectGuid imageList[5];
uint8 talkWing;
};
@@ -652,13 +656,12 @@ class npc_torturer_lecraft : public CreatureScript
npc_torturer_lecraftAI(Creature* creature) : ScriptedAI(creature)
{
_textCounter = 1;
- _playerGUID = 0;
}
void Reset() override
{
_textCounter = 1;
- _playerGUID = 0;
+ _playerGUID.Clear();
}
void EnterCombat(Unit* who) override
@@ -686,7 +689,7 @@ class npc_torturer_lecraft : public CreatureScript
Talk(_textCounter, player);
if (_textCounter == 5)
- player->KilledMonsterCredit(NPC_TORTURER_LECRAFT, 0);
+ player->KilledMonsterCredit(NPC_TORTURER_LECRAFT);
++_textCounter;
@@ -723,7 +726,7 @@ class npc_torturer_lecraft : public CreatureScript
private:
EventMap _events;
uint8 _textCounter;
- uint64 _playerGUID;
+ ObjectGuid _playerGUID;
};
CreatureAI* GetAI(Creature* creature) const
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 6d41a2e9b21..e06bf32d7d8 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -116,7 +116,7 @@ public:
case 19:
if (Creature* Mrfloppy = ObjectAccessor::GetCreature(*me, _mrfloppyGUID))
{
- if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
+ if (Mrfloppy->HasAura(SPELL_MRFLOPPY))
{
if (Creature* RWORG = ObjectAccessor::GetCreature(*me, _RavenousworgGUID))
Mrfloppy->EnterVehicle(RWORG);
@@ -180,13 +180,13 @@ public:
void Reset() override
{
- _mrfloppyGUID = 0;
- _RavenousworgGUID = 0;
+ _mrfloppyGUID.Clear();
+ _RavenousworgGUID.Clear();
}
private:
- uint64 _RavenousworgGUID;
- uint64 _mrfloppyGUID;
+ ObjectGuid _RavenousworgGUID;
+ ObjectGuid _mrfloppyGUID;
};
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
@@ -542,7 +542,7 @@ public:
void Reset() override
{
- _playerGUID = 0;
+ _playerGUID.Clear();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
me->SetReactState(REACT_AGGRESSIVE);
@@ -604,7 +604,7 @@ public:
private:
EventMap _events;
- uint64 _playerGUID;
+ ObjectGuid _playerGUID;
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp
index 96fdcbfe990..53dc2a62f90 100644
--- a/src/server/scripts/Northrend/zone_howling_fjord.cpp
+++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp
@@ -179,7 +179,7 @@ public:
void Reset() override
{
- uint64 summonerGUID = 0;
+ ObjectGuid summonerGUID;
if (me->IsSummon())
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
@@ -321,15 +321,15 @@ public:
npc_daegarnAI(Creature* creature) : ScriptedAI(creature) { }
bool bEventInProgress;
- uint64 uiPlayerGUID;
+ ObjectGuid uiPlayerGUID;
void Reset() override
{
bEventInProgress = false;
- uiPlayerGUID = 0;
+ uiPlayerGUID.Clear();
}
- void StartEvent(uint64 uiGUID)
+ void StartEvent(ObjectGuid uiGUID)
{
if (bEventInProgress)
return;
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index 32b9805470e..a43df0dc3f0 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -234,7 +234,7 @@ public:
{
if (who->HasAura(SPELL_SUBDUED_LITHE_STALKER))
{
- owner->ToPlayer()->KilledMonsterCredit(NPC_GEIST_RETURN_BUNNY_KC, 0);
+ owner->ToPlayer()->KilledMonsterCredit(NPC_GEIST_RETURN_BUNNY_KC);
who->ToCreature()->DisappearAndDie();
}
@@ -505,7 +505,6 @@ public:
{
HalofSpawned = false;
PhaseCount = 0;
- Summons.DespawnAll();
SetCombatMovement(false);
}
@@ -518,10 +517,10 @@ public:
SummonList Summons;
- uint64 guidDalfors;
- uint64 guidPriest[3];
- uint64 guidMason[3];
- uint64 guidHalof;
+ ObjectGuid guidDalfors;
+ ObjectGuid guidPriest[3];
+ ObjectGuid guidMason[3];
+ ObjectGuid guidHalof;
void Reset() override
{
@@ -912,7 +911,7 @@ class npc_margrave_dhakar : public CreatureScript
struct npc_margrave_dhakarAI : public ScriptedAI
{
- npc_margrave_dhakarAI(Creature* creature) : ScriptedAI(creature) , _summons(me), _lichKingGuid(0) { }
+ npc_margrave_dhakarAI(Creature* creature) : ScriptedAI(creature) , _summons(me) { }
void Reset() override
{
@@ -1026,7 +1025,7 @@ class npc_margrave_dhakar : public CreatureScript
private:
EventMap _events;
SummonList _summons;
- uint64 _lichKingGuid;
+ ObjectGuid _lichKingGuid;
};
CreatureAI* GetAI(Creature* creature) const override
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index a4d6ab31846..203bf6f1be6 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -374,8 +374,8 @@ public:
sayStep = 0;
timer = 0;
phase = 0;
- playerGUID = 0;
- orphanGUID = 0;
+ playerGUID.Clear();
+ orphanGUID.Clear();
}
void MoveInLineOfSight(Unit* who) override
@@ -489,7 +489,7 @@ public:
if (itr->second.CreatureOrGOCount[i] != 0)
continue;
- player->KilledMonsterCredit(me->GetEntry(), 0);
+ player->KilledMonsterCredit(me->GetEntry());
player->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 1;
break;
@@ -501,8 +501,8 @@ public:
uint8 sayStep;
uint32 timer;
int8 phase;
- uint64 playerGUID;
- uint64 orphanGUID;
+ ObjectGuid playerGUID;
+ ObjectGuid orphanGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -783,7 +783,7 @@ public:
apple->CastSpell(apple, SPELL_APPLE_FALL);
wilhelm->AI()->Talk(SAY_WILHELM_HIT);
if (Player* player = shooter->ToPlayer())
- player->KilledMonsterCredit(NPC_APPLE, 0);
+ player->KilledMonsterCredit(NPC_APPLE);
apple->DespawnOrUnsummon();
break;
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index cfee2e0f187..a183d0997d4 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -454,17 +454,16 @@ public:
{
npc_brann_bronzebeard_keystoneAI(Creature* creature) : ScriptedAI(creature)
{
- memset(&objectGUID, 0, sizeof(objectGUID));
- playerGUID = 0;
- voiceGUID = 0;
objectCounter = 0;
}
void Reset() override
{
- memset(&objectGUID, 0, sizeof(objectGUID));
- playerGUID = 0;
- voiceGUID = 0;
+ for (ObjectGuid& guid : objectGUID)
+ guid.Clear();
+
+ playerGUID.Clear();
+ voiceGUID.Clear();
objectCounter = 0;
}
@@ -583,9 +582,9 @@ public:
private:
EventMap events;
- uint64 playerGUID;
- uint64 objectGUID[5];
- uint64 voiceGUID;
+ ObjectGuid playerGUID;
+ ObjectGuid objectGUID[5];
+ ObjectGuid voiceGUID;
uint8 objectCounter;
};
@@ -643,13 +642,12 @@ public:
{
npc_king_jokkum_vehicleAI(Creature* creature) : VehicleAI(creature)
{
- playerGUID = 0;
pathEnd = false;
}
void Reset() override
{
- playerGUID = 0;
+ playerGUID.Clear();
pathEnd = false;
}
@@ -715,7 +713,7 @@ public:
private:
EventMap events;
- uint64 playerGUID;
+ ObjectGuid playerGUID;
bool pathEnd;
};
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index 2e75b10c0e8..44f559bfa79 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -51,7 +51,7 @@ public:
void Reset() override
{
- _rageclawGUID = 0;
+ _rageclawGUID.Clear();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
float x, y, z;
@@ -104,7 +104,7 @@ public:
}
private:
- uint64 _rageclawGUID;
+ ObjectGuid _rageclawGUID;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -455,13 +455,12 @@ public:
{
npc_alchemist_finklesteinAI(Creature* creature) : ScriptedAI(creature)
{
- _playerGUID = 0;
_getingredienttry = 0;
}
void Reset() override
{
- _playerGUID = 0;
+ _playerGUID.Clear();
_getingredienttry = 0;
_events.ScheduleEvent(EVENT_TURN_TO_POT, urand(15000, 26000));
}
@@ -556,7 +555,7 @@ public:
private:
EventMap _events;
- uint64 _playerGUID;
+ ObjectGuid _playerGUID;
uint8 _getingredienttry;
};