Skip to content

Commit 07a435e

Browse files
MitchesDShauren
authored andcommitted
Scripts/Misc: small changes after recent commits
(cherry picked from commit 65275fd)
1 parent 5e6cb99 commit 07a435e

1 file changed

Lines changed: 20 additions & 31 deletions

File tree

‎src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp‎

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class npc_sironas : public CreatureScript
205205

206206
if (killer->GetGUID() == legoso->GetGUID() ||
207207
(group && group->IsMember(killer->GetGUID())) ||
208-
killer->GetGUID().GetCounter() == legoso->AI()->GetData(DATA_EVENT_STARTER_GUID))
208+
killer->GetGUID() == legoso->AI()->GetGUID(DATA_EVENT_STARTER_GUID))
209209
legoso->AI()->DoAction(ACTION_LEGOSO_SIRONAS_KILLED);
210210
}
211211
}
@@ -249,25 +249,18 @@ class npc_sironas : public CreatureScript
249249
{
250250
DoCast(me, SPELL_SIRONAS_CHANNELING);
251251
std::list<Creature*> BeamList;
252-
_beamGuidList.clear();
253252
me->GetCreatureListWithEntryInGrid(BeamList, NPC_BLOODMYST_TESLA_COIL, SIZE_OF_GRIDS);
254253
for (std::list<Creature*>::iterator itr = BeamList.begin(); itr != BeamList.end(); ++itr)
255-
{
256-
_beamGuidList.push_back((*itr)->GetGUID());
257254
(*itr)->CastSpell(*itr, SPELL_BLOODMYST_TESLA);
258-
}
259255
break;
260256
}
261257
case ACTION_SIRONAS_CHANNEL_STOP:
262258
{
263259
me->InterruptNonMeleeSpells(true, SPELL_SIRONAS_CHANNELING);
264260
std::list<Creature*> creatureList;
265261
GetCreatureListWithEntryInGrid(creatureList, me, NPC_BLOODMYST_TESLA_COIL, 500.0f);
266-
if (!creatureList.empty())
267-
{
268-
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
269-
(*itr)->InterruptNonMeleeSpells(true, SPELL_BLOODMYST_TESLA);
270-
}
262+
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
263+
(*itr)->InterruptNonMeleeSpells(true, SPELL_BLOODMYST_TESLA);
271264
break;
272265
}
273266
default:
@@ -276,7 +269,6 @@ class npc_sironas : public CreatureScript
276269
}
277270

278271
private:
279-
GuidList _beamGuidList;
280272
EventMap _events;
281273
};
282274

@@ -304,46 +296,43 @@ class npc_demolitionist_legoso : public CreatureScript
304296
Initialize();
305297
}
306298

299+
void Initialize()
300+
{
301+
_phase = PHASE_NONE;
302+
_moveTimer = 0;
303+
_eventStarterGuid.Clear();
304+
}
305+
307306
void OnQuestAccept(Player* player, Quest const* quest) override
308307
{
309308
if (quest->GetQuestId() == QUEST_ENDING_THEIR_WORLD)
310309
{
311-
SetData(DATA_EVENT_STARTER_GUID, player->GetGUID().GetCounter());
310+
SetGUID(player->GetGUID(), DATA_EVENT_STARTER_GUID);
312311
LoadPath(PATH_ESCORT_LEGOSO);
313312
Start(true, player->GetGUID(), quest);
314313
}
315314
}
316315

317-
uint32 GetData(uint32 id) const override
316+
ObjectGuid GetGUID(int32 type) const override
318317
{
319-
switch (id)
320-
{
321-
case DATA_EVENT_STARTER_GUID:
322-
return _eventStarterGuidLow;
323-
default:
324-
return 0;
325-
}
318+
if (type == DATA_EVENT_STARTER_GUID)
319+
return _eventStarterGuid;
320+
321+
return ObjectGuid::Empty;
326322
}
327323

328-
void SetData(uint32 data, uint32 value) override
324+
void SetGUID(ObjectGuid const& guid, int32 type) override
329325
{
330-
switch (data)
326+
switch (type)
331327
{
332328
case DATA_EVENT_STARTER_GUID:
333-
_eventStarterGuidLow = value;
329+
_eventStarterGuid = guid;
334330
break;
335331
default:
336332
break;
337333
}
338334
}
339335

340-
void Initialize()
341-
{
342-
_phase = PHASE_NONE;
343-
_moveTimer = 0;
344-
_eventStarterGuidLow = 0;
345-
}
346-
347336
void Reset() override
348337
{
349338
Initialize();
@@ -750,7 +739,7 @@ class npc_demolitionist_legoso : public CreatureScript
750739
private:
751740
int8 _phase;
752741
uint32 _moveTimer;
753-
ObjectGuid::LowType _eventStarterGuidLow;
742+
ObjectGuid _eventStarterGuid;
754743
GuidList _explosivesGuids;
755744
EventMap _events;
756745
};

0 commit comments

Comments
 (0)