Scripts/Misc: some small changes after recent commits

This commit is contained in:
MitchesD
2014-09-11 15:12:28 +02:00
parent 137c8a7de9
commit 1e3aa97098
8 changed files with 15 additions and 19 deletions

View File

@@ -72,7 +72,7 @@ public:
void Reset() override
{
Initialize();
events.Reset();
summons.DespawnAll();
}

View File

@@ -21,7 +21,7 @@
enum Spells
{
SPELL_CURSE_OF_BLOOD = 24673,
SPELL_ILLUSION = 17773,
SPELL_ILLUSION = 17773
};
enum Events
@@ -113,7 +113,7 @@ public:
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_jandicebarovAI(creature);
return GetInstanceAI<boss_jandicebarovAI>(creature);
}
};

View File

@@ -81,7 +81,7 @@ public:
events.ScheduleEvent(EVENT_ICE_ARMOR, 180000);
break;
case EVENT_FROSTBOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
DoCast(target, SPELL_FROSTBOLT);
events.ScheduleEvent(EVENT_FROSTBOLT, 8000);
break;

View File

@@ -106,7 +106,6 @@ public:
EventMap events;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_vectusAI(creature);

View File

@@ -44,6 +44,11 @@ public:
struct boss_eckAI : public BossAI
{
boss_eckAI(Creature* creature) : BossAI(creature, DATA_ECK_THE_FEROCIOUS_EVENT)
{
Initialize();
}
void Initialize()
{
Berserk = false;
}
@@ -51,7 +56,7 @@ public:
void Reset() override
{
_Reset();
Berserk = false;
Initialize();
}
void EnterCombat(Unit* /*who*/) override
@@ -85,9 +90,8 @@ public:
events.ScheduleEvent(EVENT_SPIT, urand(6 * IN_MILLISECONDS, 14 * IN_MILLISECONDS));
break;
case EVENT_SPRING:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
if (target->GetTypeId() == TYPEID_PLAYER)
DoCast(target, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2));
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 35.0f, true))
DoCast(target, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2));
events.ScheduleEvent(EVENT_SPRING, urand(5 * IN_MILLISECONDS, 10 * IN_MILLISECONDS));
break;
case EVENT_BERSERK:
@@ -99,11 +103,6 @@ public:
}
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
}
private:
bool Berserk;
};

View File

@@ -31,7 +31,7 @@
4 - Eck the Ferocious
*/
static Position EckSpawnPoint = {1643.877930f, 936.278015f, 107.204948f, 0.668432f};
Position const EckSpawnPoint = { 1643.877930f, 936.278015f, 107.204948f, 0.668432f };
class instance_gundrak : public InstanceMapScript
{
@@ -136,7 +136,7 @@ public:
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
}
bool IsEncounterInProgress() const override
bool IsEncounterInProgress() const override
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)

View File

@@ -39,7 +39,6 @@ enum Events
EVENT_DARK_SHELL
};
class boss_pandemonius : public CreatureScript
{
public:
@@ -81,7 +80,7 @@ public:
switch (eventId)
{
case EVENT_VOID_BLAST:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
{
DoCast(target, SPELL_VOID_BLAST);
++VoidBlastCounter;

View File

@@ -114,7 +114,6 @@ class boss_broggok : public CreatureScript
break;
}
}
};
CreatureAI* GetAI(Creature* creature) const override