diff options
Diffstat (limited to 'src')
4 files changed, 86 insertions, 150 deletions
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 08b939f136b..1334d587464 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -39,7 +39,7 @@ enum Spells SPELL_SHADOW_WORD_PAIN = 23952, SPELL_GOUGE = 24698, SPELL_MARK = 24210, - SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... + SPELL_CLEAVE = 26350, // Perhaps not right. Not a red aura... SPELL_PANTHER_TRANSFORM = 24190 }; @@ -51,7 +51,13 @@ enum Events EVENT_CLEAVE = 3, EVENT_VANISH = 4, EVENT_VISIBLE = 5, - EVENT_SUMMON = 6, + EVENT_SUMMON = 6 +}; + +enum Phases +{ + PHASE_ONE = 1, + PHASE_TWO = 2 }; enum ModelIds @@ -61,6 +67,12 @@ enum ModelIds MODEL_ID_BLANK = 11686 }; +Position const PosSummonProwlers[2] = +{ + { -11532.7998f, -1649.6734f, 41.4800f, 0.0f }, + { -11532.9970f, -1606.4840f, 41.2979f, 0.0f } +}; + class boss_arlokk : public CreatureScript { public: boss_arlokk() : CreatureScript("boss_arlokk") {} @@ -69,40 +81,14 @@ class boss_arlokk : public CreatureScript { boss_arlokkAI(Creature* creature) : BossAI(creature, DATA_ARLOKK) {} - uint32 m_uiShadowWordPain_Timer; - uint32 m_uiGouge_Timer; - uint32 m_uiMark_Timer; - uint32 m_uiCleave_Timer; - uint32 m_uiVanish_Timer; - uint32 m_uiVisible_Timer; - - uint32 m_uiSummon_Timer; - uint32 m_uiSummonCount; - - Unit* m_pMarkedTarget; - uint64 MarkedTargetGUID; - - bool m_bIsPhaseTwo; - bool m_bIsVanished; + uint32 summonCount; + // Unit* markedTarget; + uint64 markedTargetGUID; void Reset() { - _Reset(); - m_uiShadowWordPain_Timer = 8000; - m_uiGouge_Timer = 14000; - m_uiMark_Timer = 35000; - m_uiCleave_Timer = 4000; - m_uiVanish_Timer = 60000; - m_uiVisible_Timer = 6000; - - m_uiSummon_Timer = 5000; - m_uiSummonCount = 0; - - m_bIsPhaseTwo = false; - m_bIsVanished = false; - - MarkedTargetGUID = 0; - + summonCount = 0; + markedTargetGUID = 0; me->SetDisplayId(MODEL_ID_NORMAL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -118,6 +104,10 @@ class boss_arlokk : public CreatureScript void EnterCombat(Unit* /*who*/) { _EnterCombat(); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 8000, 0, PHASE_ONE); + events.ScheduleEvent(EVENT_MARK, 35000, 0, PHASE_ONE); + events.ScheduleEvent(EVENT_SUMMON, 5000); + events.ScheduleEvent(EVENT_VANISH, 60000); Talk(SAY_AGGRO); } @@ -125,135 +115,88 @@ class boss_arlokk : public CreatureScript { if (instance) instance->SetData(DATA_ARLOKK, NOT_STARTED); - //we should be summoned, so despawn me->DespawnOrUnsummon(); } void DoSummonPhanters() { - if (MarkedTargetGUID) - Talk(SAY_FEAST_PANTHER, MarkedTargetGUID); - - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (markedTargetGUID) + Talk(SAY_FEAST_PANTHER, markedTargetGUID); + me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); } void JustSummoned(Creature* summoned) { - if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - summoned->AI()->AttackStart(pMarkedTarget); - - ++m_uiSummonCount; + if (Unit* markedTarget = Unit::GetUnit(*me, markedTargetGUID)) + summoned->AI()->AttackStart(markedTarget); + ++summonCount; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - if (!m_bIsPhaseTwo) - { - if (m_uiShadowWordPain_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_SHADOW_WORD_PAIN); - m_uiShadowWordPain_Timer = 15000; - } - else - m_uiShadowWordPain_Timer -= uiDiff; - - if (m_uiMark_Timer <= uiDiff) - { - Unit* pMarkedTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); - - if (pMarkedTarget) - { - DoCast(pMarkedTarget, SPELL_MARK); - MarkedTargetGUID = pMarkedTarget->GetGUID(); - } - else - sLog->outError(LOG_FILTER_TSCR, "boss_arlokk could not accuire pMarkedTarget."); + events.Update(diff); - m_uiMark_Timer = 15000; - } - else - m_uiMark_Timer -= uiDiff; - } - else - { - //Cleave_Timer - if (m_uiCleave_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 16000; - } - else - m_uiCleave_Timer -= uiDiff; - - //Gouge_Timer - if (m_uiGouge_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - DoModifyThreatPercent(me->getVictim(), -80); - - m_uiGouge_Timer = 17000+rand()%10000; - } - else - m_uiGouge_Timer -= uiDiff; - } + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - if (m_uiSummonCount <= 30) + while (uint32 eventId = events.ExecuteEvent()) { - if (m_uiSummon_Timer <= uiDiff) + switch (eventId) { - DoSummonPhanters(); - m_uiSummon_Timer = 5000; + case EVENT_SHADOW_WORD_PAIN: + DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 15000, 0, PHASE_ONE); + break; + case EVENT_MARK: + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_MARK); + events.ScheduleEvent(EVENT_MARK, 15000, 0, PHASE_ONE); + break; + case EVENT_CLEAVE: + DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); + events.ScheduleEvent(EVENT_CLEAVE, 16000, 0, PHASE_TWO); + break; + case EVENT_GOUGE: + DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); + events.ScheduleEvent(EVENT_GOUGE, urand(17000, 27000), 0, PHASE_TWO); + break; + case EVENT_SUMMON: + if (summonCount <= 30) + DoSummonPhanters(); + events.ScheduleEvent(EVENT_SUMMON, 5000); + break; + case EVENT_VANISH: + me->SetDisplayId(MODEL_ID_BLANK); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AttackStop(); + DoResetThreat(); + events.ScheduleEvent(EVENT_VISIBLE, 6000); + break; + case EVENT_VISIBLE: + { + me->SetDisplayId(MODEL_ID_PANTHER); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + me->UpdateDamagePhysical(BASE_ATTACK); + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + AttackStart(target); + events.ScheduleEvent(EVENT_VANISH, 39000); + events.ScheduleEvent(EVENT_CLEAVE, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_GOUGE, 14000, 0, PHASE_TWO); + events.SetPhase(PHASE_TWO); + break; + } + default: + break; } - else - m_uiSummon_Timer -= uiDiff; } - if (m_uiVanish_Timer <= uiDiff) - { - //Invisble Model - me->SetDisplayId(MODEL_ID_BLANK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - me->AttackStop(); - DoResetThreat(); - - m_bIsVanished = true; - - m_uiVanish_Timer = 45000; - m_uiVisible_Timer = 6000; - } - else - m_uiVanish_Timer -= uiDiff; - - if (m_bIsVanished) - { - if (m_uiVisible_Timer <= uiDiff) - { - //The Panther Model - me->SetDisplayId(MODEL_ID_PANTHER); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - m_bIsPhaseTwo = true; - m_bIsVanished = false; - } - else - m_uiVisible_Timer -= uiDiff; - } - else - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); } }; @@ -273,7 +216,6 @@ class go_gong_of_bethekk : public GameObjectScript { if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) return true; - instance->SetData(DATA_ARLOKK, IN_PROGRESS); return true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 0fba1c51ad7..8003f4a1ed7 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -72,8 +72,6 @@ class boss_hakkar : public CreatureScript { boss_hakkarAI(Creature* creature) : BossAI(creature, DATA_HAKKAR) {} - bool Enraged; - void Reset() { _Reset(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 5f7498880ca..005609e88db 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -55,12 +55,6 @@ enum Events EVENT_TELEPORT = 4 }; -enum CreatureId -{ - NPC_SHADE_OF_JINDO = 14986, - NPC_SACRIFICED_TROLL = 14826 -}; - Position const TeleportLoc = {-11583.7783f, -1249.4278f, 77.5471f, 4.745f}; class boss_jindo : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 5948a191c19..2544e4f4d5f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -45,7 +45,9 @@ enum CreatureIds NPC_JINDO_THE_HEXXER = 11380, NPC_NIGHTMARE_ILLUSION = 15163, NPC_ZULIAN_PROWLER = 15101, - NPC_SPEAKER = 11391 + NPC_SPEAKER = 11391, + NPC_SHADE_OF_JINDO = 14986, + NPC_SACRIFICED_TROLL = 14826 }; #endif |