diff options
| -rw-r--r-- | sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql | 3 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp | 179 |
2 files changed, 85 insertions, 97 deletions
diff --git a/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql b/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql new file mode 100644 index 00000000000..56764385765 --- /dev/null +++ b/sql/updates/world/2013_07_29_01_world_spelldifficulty_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spelldifficulty_dbc` WHERE `id` = 48849; +INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES +(48849, 48849, 59422); diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp index de3ee0f2bea..f8f0752184e 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp @@ -27,11 +27,10 @@ enum Spells { SPELL_BELLOWING_ROAR = 22686, // fears the group, can be resisted/dispelled SPELL_GRIEVOUS_BITE = 48920, - SPELL_MANGLING_SLASH = 48873, //casted on the current tank, adds debuf + SPELL_MANGLING_SLASH = 48873, // casted on the current tank, adds debuf SPELL_FEARSOME_ROAR = 48849, - H_SPELL_FEARSOME_ROAR = 59422, //Not stacking, debuff - SPELL_PIERCING_SLASH = 48878, //debuff -->Armor reduced by 75% - SPELL_RAPTOR_CALL = 59416, //dummy + SPELL_PIERCING_SLASH = 48878, // debuff --> Armor reduced by 75% + SPELL_RAPTOR_CALL = 59416, // dummy SPELL_GUT_RIP = 49710, SPELL_REND = 13738 }; @@ -42,107 +41,40 @@ enum Misc DATA_RAPTORS_KILLED = 2 }; +enum Events +{ + EVENT_BELLOWING_ROAR = 1, + EVENT_GRIEVOUS_BITE, + EVENT_MANGLING_SLASH, + EVENT_FEARSOME_ROAR, + EVENT_PIERCING_SLASH, + EVENT_RAPTOR_CALL +}; + class boss_king_dred : public CreatureScript { public: boss_king_dred() : CreatureScript("boss_king_dred") { } - struct boss_king_dredAI : public ScriptedAI + struct boss_king_dredAI : public BossAI { - boss_king_dredAI(Creature* creature) : ScriptedAI(creature) - { - instance = me->GetInstanceScript(); - } - - uint32 uiBellowingRoarTimer; - uint32 uiGrievousBiteTimer; - uint32 uiManglingSlashTimer; - uint32 uiFearsomeRoarTimer; - uint32 uiPiercingSlashTimer; - uint32 uiRaptorCallTimer; - uint8 raptorsKilled; - - InstanceScript* instance; + boss_king_dredAI(Creature* creature) : BossAI(creature, DATA_KING_DRED) { } void Reset() OVERRIDE { - if (instance) - instance->SetData(DATA_KING_DRED, NOT_STARTED); - - uiBellowingRoarTimer = 33000; - uiGrievousBiteTimer = 20000; - uiManglingSlashTimer = 18500; - uiFearsomeRoarTimer = urand(10000, 20000); - uiPiercingSlashTimer = 17000; - uiRaptorCallTimer = urand(20000, 25000); + _Reset(); } void EnterCombat(Unit* /*who*/) OVERRIDE { - if (instance) - instance->SetData(DATA_KING_DRED, IN_PROGRESS); - } - - void UpdateAI(uint32 diff) OVERRIDE - { - if (!UpdateVictim()) - return; - - if (uiBellowingRoarTimer <= diff) - { - DoCastAOE(SPELL_BELLOWING_ROAR, false); - uiBellowingRoarTimer = 40000; - } - else - uiBellowingRoarTimer -=diff; - - if (uiGrievousBiteTimer <= diff) - { - DoCastVictim(SPELL_GRIEVOUS_BITE, false); - uiGrievousBiteTimer = 20000; - } - else - uiGrievousBiteTimer -= diff; - - if (uiManglingSlashTimer <= diff) - { - DoCastVictim(SPELL_MANGLING_SLASH, false); - uiManglingSlashTimer = 20000; - } - else - uiManglingSlashTimer -= diff; - - if (uiFearsomeRoarTimer <= diff) - { - DoCastAOE(SPELL_FEARSOME_ROAR, false); - uiFearsomeRoarTimer = urand(16000, 18000); - } - else - uiFearsomeRoarTimer -= diff; - - if (uiPiercingSlashTimer <= diff) - { - DoCastVictim(SPELL_PIERCING_SLASH, false); - uiPiercingSlashTimer = 20000; - } - else - uiPiercingSlashTimer -= diff; - - if (uiRaptorCallTimer <= diff) - { - DoCastVictim(SPELL_RAPTOR_CALL, false); - - float x, y, z; - - me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 10.0f); - me->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000); - - uiRaptorCallTimer = urand(20000, 25000); - } - else - uiRaptorCallTimer -= diff; - - DoMeleeAttackIfReady(); + _EnterCombat(); + + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 33000); + events.ScheduleEvent(EVENT_GRIEVOUS_BITE, 20000); + events.ScheduleEvent(EVENT_MANGLING_SLASH, 18500); + events.ScheduleEvent(EVENT_FEARSOME_ROAR, urand(10000, 20000)); + events.ScheduleEvent(EVENT_PIERCING_SLASH, 17000); + events.ScheduleEvent(EVENT_RAPTOR_CALL, urand(20000, 25000)); } void DoAction(int32 action) OVERRIDE @@ -161,9 +93,62 @@ class boss_king_dred : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - if (instance) - instance->SetData(DATA_KING_DRED, DONE); + _JustDied(); + } + + void UpdateAI(uint32 diff) OVERRIDE + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BELLOWING_ROAR: + DoCastAOE(SPELL_BELLOWING_ROAR); + events.ScheduleEvent(EVENT_BELLOWING_ROAR, 33000); + break; + case EVENT_GRIEVOUS_BITE: + DoCastVictim(SPELL_GRIEVOUS_BITE); + events.ScheduleEvent(EVENT_GRIEVOUS_BITE, 20000); + break; + case EVENT_MANGLING_SLASH: + DoCastVictim(SPELL_MANGLING_SLASH); + events.ScheduleEvent(EVENT_MANGLING_SLASH, 18500); + break; + case EVENT_FEARSOME_ROAR: + DoCastAOE(SPELL_FEARSOME_ROAR); + events.ScheduleEvent(EVENT_FEARSOME_ROAR, urand(10000, 20000)); + break; + case EVENT_PIERCING_SLASH: + DoCastVictim(SPELL_PIERCING_SLASH); + events.ScheduleEvent(EVENT_PIERCING_SLASH, 17000); + break; + case EVENT_RAPTOR_CALL: + DoCastVictim(SPELL_RAPTOR_CALL); + + float x, y, z; + + me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 10.0f); + me->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000); + events.ScheduleEvent(EVENT_RAPTOR_CALL, urand(20000, 25000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); } + + private: + uint8 raptorsKilled; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -294,8 +279,8 @@ class achievement_king_dred : public AchievementCriteriaScript void AddSC_boss_king_dred() { - new boss_king_dred; - new npc_drakkari_gutripper; - new npc_drakkari_scytheclaw; + new boss_king_dred(); + new npc_drakkari_gutripper(); + new npc_drakkari_scytheclaw(); new achievement_king_dred(); } |
