aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2013-12-26 01:14:19 +0100
committerMitchesD <majklprofik@seznam.cz>2013-12-27 19:56:01 +0100
commit3921f20c18c3cfa9e92c31aac0f786f0e13fd3b2 (patch)
tree745b69e34dcf10316f14b3ae15b0d30e2720671f
parente255d1d37667f21612f9fcf0c14a23b2bb2f0e9b (diff)
Scripts/ObsidianSanctum: added creature_formations for surrounding creatures and some clean up
-rw-r--r--sql/updates/world/2013_12_27_01_world_creature_formations.sql25
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_noth.cpp68
2 files changed, 62 insertions, 31 deletions
diff --git a/sql/updates/world/2013_12_27_01_world_creature_formations.sql b/sql/updates/world/2013_12_27_01_world_creature_formations.sql
new file mode 100644
index 00000000000..08b22a544b9
--- /dev/null
+++ b/sql/updates/world/2013_12_27_01_world_creature_formations.sql
@@ -0,0 +1,25 @@
+DELETE FROM `creature_formations` WHERE `leaderGUID` = 126396;
+INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
+(126396, 126396, 0, 0, 1, 0, 0),
+(126396, 126399, 0, 0, 1, 0, 0),
+(126396, 126403, 0, 0, 1, 0, 0),
+(126396, 126411, 0, 0, 1, 0, 0),
+(126396, 126404, 0, 0, 1, 0, 0),
+(126396, 126410, 0, 0, 1, 0, 0),
+(126396, 126398, 0, 0, 1, 0, 0),
+(126396, 126409, 0, 0, 1, 0, 0),
+(126396, 126402, 0, 0, 1, 0, 0),
+(126396, 126418, 0, 0, 1, 0, 0),
+(126396, 126419, 0, 0, 1, 0, 0),
+(126396, 126397, 0, 0, 1, 0, 0),
+(126396, 126401, 0, 0, 1, 0, 0),
+(126396, 126407, 0, 0, 1, 0, 0),
+(126396, 126408, 0, 0, 1, 0, 0),
+(126396, 126420, 0, 0, 1, 0, 0),
+(126396, 126421, 0, 0, 1, 0, 0),
+(126396, 126412, 0, 0, 1, 0, 0),
+(126396, 126406, 0, 0, 1, 0, 0),
+(126396, 126400, 0, 0, 1, 0, 0),
+(126396, 126405, 0, 0, 1, 0, 0),
+(126396, 126416, 0, 0, 1, 0, 0),
+(126396, 126417, 0, 0, 1, 0, 0);
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
index d90db5e077e..b56ecdd8b53 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp
@@ -37,23 +37,20 @@ enum Noth
NPC_GUARDIAN = 16981
};
-#define SPELL_BLINK RAND(29208, 29209, 29210, 29211)
+#define SPELL_BLINK RAND(29208, 29209, 29210, 29211)
// Teleport position of Noth on his balcony
-#define TELE_X 2631.370f
-#define TELE_Y -3529.680f
-#define TELE_Z 274.040f
-#define TELE_O 6.277f
+Position const Teleport = { 2631.370f, -3529.680f, 274.040f, 6.277f };
#define MAX_SUMMON_POS 5
-const float SummonPos[MAX_SUMMON_POS][4] =
+Position const SummonPos[MAX_SUMMON_POS] =
{
- {2728.12f, -3544.43f, 261.91f, 6.04f},
- {2729.05f, -3544.47f, 261.91f, 5.58f},
- {2728.24f, -3465.08f, 264.20f, 3.56f},
- {2704.11f, -3456.81f, 265.53f, 4.51f},
- {2663.56f, -3464.43f, 262.66f, 5.20f},
+ { 2728.12f, -3544.43f, 261.91f, 6.04f },
+ { 2729.05f, -3544.47f, 261.91f, 5.58f },
+ { 2728.24f, -3465.08f, 264.20f, 3.56f },
+ { 2704.11f, -3456.81f, 265.53f, 4.51f },
+ { 2663.56f, -3464.43f, 262.66f, 5.20f }
};
enum Events
@@ -65,7 +62,7 @@ enum Events
EVENT_WARRIOR,
EVENT_BALCONY,
EVENT_WAVE,
- EVENT_GROUND,
+ EVENT_GROUND
};
class boss_noth : public CreatureScript
@@ -73,17 +70,10 @@ class boss_noth : public CreatureScript
public:
boss_noth() : CreatureScript("boss_noth") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new boss_nothAI(creature);
- }
-
struct boss_nothAI : public BossAI
{
boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) { }
- uint32 waveCount, balconyCount;
-
void Reset() OVERRIDE
{
me->SetReactState(REACT_AGGRESSIVE);
@@ -104,6 +94,7 @@ public:
me->SetReactState(REACT_AGGRESSIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoZoneInCombat();
+
if (me->getThreatManager().isThreatListEmpty())
EnterEvadeMode();
else
@@ -138,11 +129,7 @@ public:
void SummonUndead(uint32 entry, uint32 num)
{
for (uint32 i = 0; i < num; ++i)
- {
- uint32 pos = rand()%MAX_SUMMON_POS;
- me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2],
- SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000);
- }
+ me->SummonCreature(entry, SummonPos[rand()%MAX_SUMMON_POS], TEMPSUMMON_CORPSE_DESPAWN, 60000);
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -152,6 +139,9 @@ public:
events.Update(diff);
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
@@ -176,7 +166,7 @@ public:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AttackStop();
me->RemoveAllAuras();
- me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
+ me->NearTeleportTo(Teleport.GetPositionX(), Teleport.GetPositionY(), Teleport.GetPositionZ(), Teleport.GetOrientation());
events.Reset();
events.ScheduleEvent(EVENT_WAVE, urand(2000, 5000));
waveCount = 0;
@@ -185,12 +175,20 @@ public:
Talk(SAY_SUMMON);
switch (balconyCount)
{
- case 0: SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4)); break;
- case 1: SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
- SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2)); break;
- case 2: SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4)); break;
- default:SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
- SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));break;
+ case 0:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4));
+ break;
+ case 1:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2));
+ break;
+ case 2:
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4));
+ break;
+ default:
+ SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
+ SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));
+ break;
}
++waveCount;
events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, urand(30000, 45000));
@@ -211,8 +209,16 @@ public:
if (me->HasReactState(REACT_AGGRESSIVE))
DoMeleeAttackIfReady();
}
+
+ private:
+ uint32 waveCount;
+ uint32 balconyCount;
};
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new boss_nothAI(creature);
+ }
};
void AddSC_boss_noth()