aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2015-03-27 14:47:10 +0100
committerMitchesD <majklprofik@seznam.cz>2015-03-27 14:47:10 +0100
commit65275fd57df9f52f0e959b601be9aef4180a3ead (patch)
tree12000634479693a61363bdc0c7de6bf16d1e7a44 /src
parent58805427a319dbb9113e01de17c72e5d190a6d74 (diff)
Scripts/Misc: small changes after recent commits
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp53
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp6
2 files changed, 31 insertions, 28 deletions
diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
index 080cb18264b..3911021ec6b 100644
--- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
+++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp
@@ -238,11 +238,6 @@ class npc_sironas : public CreatureScript
public:
npc_sironas() : CreatureScript("npc_sironas") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_sironasAI(creature);
- }
-
struct npc_sironasAI : public ScriptedAI
{
npc_sironasAI(Creature* creature) : ScriptedAI(creature) { }
@@ -314,14 +309,11 @@ public:
{
DoCast(me, SPELL_SIRONAS_CHANNELING);
std::list<Creature*> BeamList;
- _beamGuidList.clear();
me->GetCreatureListWithEntryInGrid(BeamList, NPC_BLOODMYST_TESLA_COIL, SIZE_OF_GRIDS);
- for (std::list<Creature*>::iterator itr = BeamList.begin(); itr != BeamList.end(); ++itr)
- {
- _beamGuidList.push_back((*itr)->GetGUID());
- (*itr)->CastSpell(*itr, SPELL_BLOODMYST_TESLA);
- }
- break;
+ if (!BeamList.empty())
+ for (std::list<Creature*>::iterator itr = BeamList.begin(); itr != BeamList.end(); ++itr)
+ (*itr)->CastSpell(*itr, SPELL_BLOODMYST_TESLA);
+ break;
}
case ACTION_SIRONAS_CHANNEL_STOP:
{
@@ -338,9 +330,13 @@ public:
}
private:
- GuidList _beamGuidList;
EventMap _events;
};
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_sironasAI(creature);
+ }
};
/*######
@@ -352,14 +348,18 @@ class npc_demolitionist_legoso : public CreatureScript
public:
npc_demolitionist_legoso() : CreatureScript("npc_demolitionist_legoso") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_demolitionist_legosoAI(creature);
- }
-
struct npc_demolitionist_legosoAI : public npc_escortAI
{
- npc_demolitionist_legosoAI(Creature* creature) : npc_escortAI(creature) { }
+ npc_demolitionist_legosoAI(Creature* creature) : npc_escortAI(creature)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ _phase = PHASE_NONE;
+ _moveTimer = 0;
+ }
void sQuestAccept(Player* player, Quest const* quest) override
{
@@ -392,10 +392,8 @@ public:
void Reset() override
{
- _phase = PHASE_NONE;
- _moveTimer = 0;
me->SetCanDualWield(true);
-
+ Initialize();
_events.Reset();
_events.ScheduleEvent(EVENT_FROST_SHOCK, 1 * IN_MILLISECONDS);
_events.ScheduleEvent(EVENT_HEALING_SURGE, 5 * IN_MILLISECONDS);
@@ -624,7 +622,7 @@ public:
case PHASE_PLANT_SECOND_DETONATE: // second explosives detonate finish
for (GuidList::iterator itr = _explosivesGuids.begin(); itr != _explosivesGuids.end(); ++itr)
{
- if (GameObject* explosive = sObjectAccessor->GetGameObject(*me, *itr))
+ if (GameObject* explosive = sObjectAccessor->GetGameObject(*me, *itr))
me->RemoveGameObject(explosive, true);
}
_explosivesGuids.clear();
@@ -657,7 +655,7 @@ public:
break;
case PHASE_FIGHT_SIRONAS_START: // legoso exclamation at aggro
if (Creature* sironas = me->FindNearestCreature(NPC_SIRONAS, SIZE_OF_GRIDS))
- {
+ {
Unit* target = GetPlayerForEscort();
if (!target)
target = me;
@@ -730,7 +728,7 @@ public:
_moveTimer = 1 * IN_MILLISECONDS;
_phase = PHASE_PLANT_FIRST_TIMER_1;
break;
- case WP_DEBUG_1:
+ case WP_DEBUG_1:
SetEscortPaused(true);
_moveTimer = 0.5 * IN_MILLISECONDS;
_phase = PHASE_WP_26;
@@ -798,6 +796,11 @@ public:
GuidList _explosivesGuids;
EventMap _events;
};
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_demolitionist_legosoAI(creature);
+ }
};
void AddSC_bloodmyst_isle()
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index a9707be6a51..c6e643174e6 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -826,11 +826,11 @@ class spell_infected_worgen_bite : public SpellScriptLoader
{
public:
spell_infected_worgen_bite() : SpellScriptLoader("spell_infected_worgen_bite") { }
-
+
class spell_infected_worgen_bite_AuraScript : public AuraScript
{
PrepareAuraScript(spell_infected_worgen_bite_AuraScript);
-
+
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
@@ -841,7 +841,7 @@ class spell_infected_worgen_bite : public SpellScriptLoader
target->CastSpell(target, SPELL_WORGENS_CALL, true);
}
}
-
+
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_infected_worgen_bite_AuraScript::HandleAfterEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAPPLY);