Skip to content

Commit 22dff22

Browse files
committed
[2106] Replace uint64 GUIDs with ObjectGuid in kalimdor/ zone scripts
1 parent 769e73f commit 22dff22

6 files changed

Lines changed: 33 additions & 33 deletions

File tree

scripts/kalimdor/azuremyst_isle.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
5656
{
5757
npc_draenei_survivorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();}
5858

59-
uint64 m_uiCaster;
59+
ObjectGuid m_casterGuid;
6060

6161
uint32 m_uiSayThanksTimer;
6262
uint32 m_uiRunAwayTimer;
@@ -66,7 +66,7 @@ struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
6666

6767
void Reset()
6868
{
69-
m_uiCaster = 0;
69+
m_casterGuid.Clear();
7070

7171
m_uiSayThanksTimer = 0;
7272
m_uiRunAwayTimer = 0;
@@ -110,7 +110,7 @@ struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
110110

111111
m_creature->CastSpell(m_creature, SPELL_STUNNED, true);
112112

113-
m_uiCaster = pCaster->GetGUID();
113+
m_casterGuid = pCaster->GetObjectGuid();
114114

115115
m_uiSayThanksTimer = 5000;
116116
}
@@ -124,7 +124,7 @@ struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI
124124
{
125125
m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION);
126126

127-
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiCaster))
127+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_casterGuid))
128128
{
129129
if (pPlayer->GetTypeId() != TYPEID_PLAYER)
130130
return;

scripts/kalimdor/felwood.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ struct MANGOS_DLL_DECL npc_kroshiusAI : public ScriptedAI
355355
Reset();
356356
}
357357

358-
uint64 m_uiPlayerGUID;
358+
ObjectGuid m_playerGuid;
359359
uint32 m_uiKnockBackTimer;
360360
uint32 m_uiPhaseTimer;
361361

@@ -364,7 +364,7 @@ struct MANGOS_DLL_DECL npc_kroshiusAI : public ScriptedAI
364364
void Reset()
365365
{
366366
m_uiKnockBackTimer = urand(5000, 8000);
367-
m_uiPlayerGUID = 0;
367+
m_playerGuid.Clear();
368368

369369
if (!m_uiPhase)
370370
{
@@ -383,7 +383,7 @@ struct MANGOS_DLL_DECL npc_kroshiusAI : public ScriptedAI
383383

384384
m_uiPhase = 1;
385385
m_uiPhaseTimer = 2500;
386-
m_uiPlayerGUID = pSource->GetGUID();
386+
m_playerGuid = pSource->GetObjectGuid();
387387

388388
// TODO: A visual Flame Circle around the mob still missing
389389
}
@@ -417,7 +417,7 @@ struct MANGOS_DLL_DECL npc_kroshiusAI : public ScriptedAI
417417
// TODO workaround will better idea
418418
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
419419
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE);
420-
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID))
420+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid))
421421
{
422422
if (m_creature->IsWithinDistInMap(pPlayer, 30.0f))
423423
AttackStart(pPlayer);

scripts/kalimdor/mulgore.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ struct MANGOS_DLL_DECL npc_kyle_the_frenziedAI : public ScriptedAI
5050

5151
bool m_bEvent;
5252
bool m_bIsMovingToLunch;
53-
uint64 m_uiPlayerGUID;
53+
ObjectGuid m_playerGuid;
5454
uint32 m_uiEventTimer;
5555
uint8 m_uiEventPhase;
5656

5757
void Reset()
5858
{
5959
m_bEvent = false;
6060
m_bIsMovingToLunch = false;
61-
m_uiPlayerGUID = 0;
61+
m_playerGuid.Clear();
6262
m_uiEventTimer = 5000;
6363
m_uiEventPhase = 0;
6464

@@ -71,7 +71,7 @@ struct MANGOS_DLL_DECL npc_kyle_the_frenziedAI : public ScriptedAI
7171
if (!m_creature->getVictim() && !m_bEvent && pSpell->Id == SPELL_LUNCH)
7272
{
7373
if (pCaster->GetTypeId() == TYPEID_PLAYER)
74-
m_uiPlayerGUID = pCaster->GetGUID();
74+
m_playerGuid = pCaster->GetObjectGuid();
7575

7676
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
7777
{
@@ -110,7 +110,7 @@ struct MANGOS_DLL_DECL npc_kyle_the_frenziedAI : public ScriptedAI
110110
switch(m_uiEventPhase)
111111
{
112112
case 1:
113-
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID))
113+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid))
114114
{
115115
GameObject* pGo = pPlayer->GetGameObject(SPELL_LUNCH);
116116

@@ -140,7 +140,7 @@ struct MANGOS_DLL_DECL npc_kyle_the_frenziedAI : public ScriptedAI
140140
m_creature->HandleEmote(EMOTE_STATE_USESTANDING);
141141
break;
142142
case 3:
143-
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID))
143+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid))
144144
pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetObjectGuid());
145145

146146
m_creature->UpdateEntry(NPC_KYLE_FRIENDLY);

scripts/kalimdor/orgrimmar.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ struct MANGOS_DLL_DECL npc_shenthulAI : public ScriptedAI
8080
bool CanEmote;
8181
uint32 Salute_Timer;
8282
uint32 Reset_Timer;
83-
uint64 playerGUID;
83+
ObjectGuid m_playerGuid;
8484

8585
void Reset()
8686
{
8787
CanTalk = false;
8888
CanEmote = false;
8989
Salute_Timer = 6000;
9090
Reset_Timer = 0;
91-
playerGUID = 0;
91+
m_playerGuid.Clear();
9292
}
9393

9494
void ReceiveEmote(Player* pPlayer, uint32 emote)
@@ -109,7 +109,7 @@ struct MANGOS_DLL_DECL npc_shenthulAI : public ScriptedAI
109109
{
110110
if (Reset_Timer < diff)
111111
{
112-
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(playerGUID))
112+
if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid))
113113
{
114114
if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE)
115115
pPlayer->FailQuest(QUEST_SHATTERED_SALUTE);
@@ -147,7 +147,7 @@ bool QuestAccept_npc_shenthul(Player* pPlayer, Creature* pCreature, const Quest*
147147
if (npc_shenthulAI* pShenAI = dynamic_cast<npc_shenthulAI*>(pCreature->AI()))
148148
{
149149
pShenAI->CanTalk = true;
150-
pShenAI->playerGUID = pPlayer->GetGUID();
150+
pShenAI->m_playerGuid = pPlayer->GetObjectGuid();
151151
}
152152
}
153153
return true;

scripts/kalimdor/the_barrens.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
317317
uint32 Challenger_Count;
318318
uint32 ChallengerDeath_Timer;
319319

320-
uint64 PlayerGUID;
321-
uint64 BigWillGUID;
322-
uint64 AffrayChallenger[6];
320+
ObjectGuid m_playerGuid;
321+
ObjectGuid m_bigWillGuid;
322+
ObjectGuid m_aAffrayChallengerGuids[6];
323323

324324
void Reset()
325325
{
@@ -330,19 +330,19 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
330330
Challenger_Count = 0;
331331
ChallengerDeath_Timer = 0;
332332

333-
PlayerGUID = 0;
334-
BigWillGUID = 0;
333+
m_playerGuid.Clear();
334+
m_bigWillGuid.Clear();
335335

336336
for(uint8 i = 0; i < 6; ++i)
337-
AffrayChallenger[i] = 0;
337+
m_aAffrayChallengerGuids[i].Clear();
338338
}
339339

340340
bool CanStartEvent(Player* pPlayer)
341341
{
342342
if (!EventInProgress)
343343
{
344344
EventInProgress = true;
345-
PlayerGUID = pPlayer->GetGUID();
345+
m_playerGuid = pPlayer->GetObjectGuid();
346346
DoScriptText(SAY_TWIGGY_BEGIN, m_creature, pPlayer);
347347
return true;
348348
}
@@ -365,7 +365,7 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
365365
pCreature->setFaction(35);
366366
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
367367
pCreature->HandleEmote(EMOTE_ONESHOT_ROAR);
368-
AffrayChallenger[i] = pCreature->GetGUID();
368+
m_aAffrayChallengerGuids[i] = pCreature->GetObjectGuid();
369369
}
370370
}
371371

@@ -388,12 +388,12 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
388388
{
389389
for(uint8 i = 0; i < 6; ++i)
390390
{
391-
Creature *challenger = m_creature->GetMap()->GetCreature(AffrayChallenger[i]);
391+
Creature *challenger = m_creature->GetMap()->GetCreature(m_aAffrayChallengerGuids[i]);
392392
if (challenger && !challenger->isAlive() && challenger->isDead())
393393
{
394394
DoScriptText(SAY_TWIGGY_DOWN, m_creature);
395395
challenger->RemoveCorpse();
396-
AffrayChallenger[i] = 0;
396+
m_aAffrayChallengerGuids[i].Clear();
397397
continue;
398398
}
399399
}
@@ -403,7 +403,7 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
403403

404404
if (Event_Timer < diff)
405405
{
406-
Player* pPlayer = m_creature->GetMap()->GetPlayer(PlayerGUID);
406+
Player* pPlayer = m_creature->GetMap()->GetPlayer(m_playerGuid);
407407

408408
if (!pPlayer || pPlayer->isDead())
409409
Reset();
@@ -418,7 +418,7 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
418418
break;
419419
case 1:
420420
DoScriptText(SAY_TWIGGY_FRAY, m_creature);
421-
if (Creature *challenger = m_creature->GetMap()->GetCreature(AffrayChallenger[Challenger_Count]))
421+
if (Creature *challenger = m_creature->GetMap()->GetCreature(m_aAffrayChallengerGuids[Challenger_Count]))
422422
SetChallengerReady(challenger);
423423
else Reset();
424424
++Challenger_Count;
@@ -429,15 +429,15 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
429429
case 2:
430430
if (Unit *temp = m_creature->SummonCreature(NPC_BIG_WILL, -1713.79f, -4342.09f, 6.05f, 6.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,300000))
431431
{
432-
BigWillGUID = temp->GetGUID();
432+
m_bigWillGuid = temp->GetObjectGuid();
433433
temp->setFaction(35);
434434
temp->GetMotionMaster()->MovePoint(0, -1682.31f, -4329.68f, 2.78f);
435435
}
436436
Event_Timer = 15000;
437437
++Step;
438438
break;
439439
case 3:
440-
if (Creature *will = m_creature->GetMap()->GetCreature(BigWillGUID))
440+
if (Creature *will = m_creature->GetMap()->GetCreature(m_bigWillGuid))
441441
{
442442
will->setFaction(32);
443443
DoScriptText(SAY_BIG_WILL_READY, will, pPlayer);
@@ -446,7 +446,7 @@ struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
446446
++Step;
447447
break;
448448
case 4:
449-
Creature *will = m_creature->GetMap()->GetCreature(BigWillGUID);
449+
Creature *will = m_creature->GetMap()->GetCreature(m_bigWillGuid);
450450
if (will && will->isDead())
451451
{
452452
DoScriptText(SAY_TWIGGY_OVER, m_creature);

sd2_revision_nr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "2105"
3+
#define SD2_REVISION_NR "2106"
44
#endif // __SD2_REVISION_NR_H__

0 commit comments

Comments
 (0)