aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitchesD <majklprofik@seznam.cz>2013-08-08 00:25:53 +0200
committerjoschiwald <joschiwald@online.de>2013-08-08 00:25:53 +0200
commit8f50e3090459ca36c8da59b5d13cc8b36e901015 (patch)
tree6e8968854792212e7c48f6cf4669c7eea580fcfa /src
parentfa9144fa399d372c602a86ac19b72c42b459e07f (diff)
Scripts/DrakTharonKeep: update Trollgore
Closes #10453 Signed-off-by: joschiwald <joschiwald@online.de>
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp245
1 files changed, 129 insertions, 116 deletions
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
index 225fa79b1fd..d0cec8a4f43 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp
@@ -15,10 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/*
- * Comment: @todo spawn troll waves
- */
-
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
@@ -37,10 +33,9 @@ enum Spells
SPELL_SUMMON_INVADER_A = 49456,
SPELL_SUMMON_INVADER_B = 49457,
- //SPELL_SUMMON_INVADER_C = 49458, // can't find any sniffs
+ SPELL_SUMMON_INVADER_C = 49458, // can't find any sniffs
- H_SPELL_CORPSE_EXPLODE = 59807,
- H_SPELL_CONSUME = 59803,
+ SPELL_INVADER_TAUNT = 49405
};
#define SPELL_CONSUME_BUFF_HELPER DUNGEON_MODE<uint32>(SPELL_CONSUME_BUFF, SPELL_CONSUME_BUFF_H)
@@ -56,147 +51,164 @@ enum Yells
enum Misc
{
- DATA_CONSUMPTION_JUNCTION = 1
+ DATA_CONSUMPTION_JUNCTION = 1,
+ POINT_LANDING = 1
};
-Position AddSpawnPoint = { -260.493011f, -622.968018f, 26.605301f, 3.036870f };
-
-class boss_trollgore : public CreatureScript
+enum Events
{
-public:
- boss_trollgore() : CreatureScript("boss_trollgore") { }
-
- struct boss_trollgoreAI : public ScriptedAI
- {
- boss_trollgoreAI(Creature* creature) : ScriptedAI(creature), lSummons(me)
- {
- instance = creature->GetInstanceScript();
- }
-
- uint32 uiConsumeTimer;
- uint32 uiAuraCountTimer;
- uint32 uiCrushTimer;
- uint32 uiInfectedWoundTimer;
- uint32 uiExplodeCorpseTimer;
- uint32 uiSpawnTimer;
-
- bool consumptionJunction;
-
- SummonList lSummons;
-
- InstanceScript* instance;
-
- void Reset() OVERRIDE
- {
- uiConsumeTimer = 15*IN_MILLISECONDS;
- uiAuraCountTimer = 15500;
- uiCrushTimer = urand(1*IN_MILLISECONDS, 5*IN_MILLISECONDS);
- uiInfectedWoundTimer = urand(10*IN_MILLISECONDS, 60*IN_MILLISECONDS);
- uiExplodeCorpseTimer = 3*IN_MILLISECONDS;
- uiSpawnTimer = urand(30*IN_MILLISECONDS, 40*IN_MILLISECONDS);
-
- consumptionJunction = true;
-
- lSummons.DespawnAll();
-
- me->RemoveAura(SPELL_CONSUME_BUFF_HELPER);
+ EVENT_CONSUME = 1,
+ EVENT_CRUSH,
+ EVENT_INFECTED_WOUND,
+ EVENT_CORPSE_EXPLODE,
+ EVENT_SPAWN
+};
- instance->SetBossState(DATA_TROLLGORE, NOT_STARTED);
- }
+Position const Landing = { -263.0534f, -660.8658f, 26.50903f, 0.0f };
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- Talk(SAY_AGGRO);
- instance->SetBossState(DATA_TROLLGORE, IN_PROGRESS);
- }
+class boss_trollgore : public CreatureScript
+{
+ public:
+ boss_trollgore() : CreatureScript("boss_trollgore") { }
- void UpdateAI(uint32 diff) OVERRIDE
+ struct boss_trollgoreAI : public BossAI
{
- //Return since we have no target
- if (!UpdateVictim())
- return;
+ boss_trollgoreAI(Creature* creature) : BossAI(creature, DATA_TROLLGORE) { }
- if (uiSpawnTimer <= diff)
+ void Reset() OVERRIDE
{
- uint32 spawnNumber = urand(2, DUNGEON_MODE(3, 5));
- for (uint8 i = 0; i < spawnNumber; ++i)
- DoSummon(RAND(NPC_DRAKKARI_INVADER_A, NPC_DRAKKARI_INVADER_B), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
- uiSpawnTimer = urand(30*IN_MILLISECONDS, 40*IN_MILLISECONDS);
- } else uiSpawnTimer -= diff;
+ _Reset();
+ _consumptionJunction = true;
+ }
- if (uiConsumeTimer <= diff)
+ void EnterCombat(Unit* /*who*/) OVERRIDE
{
- Talk(SAY_CONSUME);
- DoCast(SPELL_CONSUME);
- uiConsumeTimer = 15*IN_MILLISECONDS;
- } else uiConsumeTimer -= diff;
+ _EnterCombat();
+ Talk(SAY_AGGRO);
+
+ events.ScheduleEvent(EVENT_CONSUME, 15000);
+ events.ScheduleEvent(EVENT_CRUSH, urand(1000, 5000));
+ events.ScheduleEvent(EVENT_INFECTED_WOUND, urand(10000, 60000));
+ events.ScheduleEvent(EVENT_CORPSE_EXPLODE, 3000);
+ events.ScheduleEvent(EVENT_SPAWN, urand(30000, 40000));
+ }
- if (consumptionJunction)
+ void UpdateAI(uint32 diff) OVERRIDE
{
- Aura* ConsumeAura = me->GetAura(SPELL_CONSUME_BUFF_HELPER);
- if (ConsumeAura && ConsumeAura->GetStackAmount() > 9)
- consumptionJunction = false;
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_CONSUME:
+ Talk(SAY_CONSUME);
+ DoCastAOE(SPELL_CONSUME);
+ events.ScheduleEvent(EVENT_CONSUME, 15000);
+ break;
+ case EVENT_CRUSH:
+ DoCastVictim(SPELL_CRUSH);
+ events.ScheduleEvent(EVENT_CRUSH, urand(10000, 15000));
+ break;
+ case EVENT_INFECTED_WOUND:
+ DoCastVictim(SPELL_INFECTED_WOUND);
+ events.ScheduleEvent(EVENT_INFECTED_WOUND, urand(25000, 35000));
+ break;
+ case EVENT_CORPSE_EXPLODE:
+ Talk(SAY_EXPLODE);
+ DoCastAOE(SPELL_CORPSE_EXPLODE);
+ events.ScheduleEvent(EVENT_CORPSE_EXPLODE, urand(15000, 19000));
+ break;
+ case EVENT_SPAWN:
+ for (uint8 i = 0; i < 3; ++i)
+ if (Creature* trigger = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TROLLGORE_INVADER_SUMMONER_1 + i)))
+ trigger->CastSpell(trigger, RAND(SPELL_SUMMON_INVADER_A, SPELL_SUMMON_INVADER_B, SPELL_SUMMON_INVADER_C), true, NULL, NULL, me->GetGUID());
+
+ events.ScheduleEvent(EVENT_SPAWN, urand(30000, 40000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (_consumptionJunction)
+ {
+ Aura* ConsumeAura = me->GetAura(SPELL_CONSUME_BUFF_HELPER);
+ if (ConsumeAura && ConsumeAura->GetStackAmount() > 9)
+ _consumptionJunction = false;
+ }
+
+ DoMeleeAttackIfReady();
}
- if (uiCrushTimer <= diff)
+ void JustDied(Unit* /*killer*/) OVERRIDE
{
- DoCastVictim(SPELL_CRUSH);
- uiCrushTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS);
- } else uiCrushTimer -= diff;
+ _JustDied();
+ Talk(SAY_DEATH);
+ }
- if (uiInfectedWoundTimer <= diff)
+ uint32 GetData(uint32 type) const OVERRIDE
{
- DoCastVictim(SPELL_INFECTED_WOUND);
- uiInfectedWoundTimer = urand(25*IN_MILLISECONDS, 35*IN_MILLISECONDS);
- } else uiInfectedWoundTimer -= diff;
+ if (type == DATA_CONSUMPTION_JUNCTION)
+ return _consumptionJunction ? 1 : 0;
- if (uiExplodeCorpseTimer <= diff)
- {
- DoCast(SPELL_CORPSE_EXPLODE);
- Talk(SAY_EXPLODE);
- uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS, 19*IN_MILLISECONDS);
- } else uiExplodeCorpseTimer -= diff;
+ return 0;
+ }
- DoMeleeAttackIfReady();
- }
+ void KilledUnit(Unit* victim) OVERRIDE
+ {
+ if (victim->GetTypeId() != TYPEID_PLAYER)
+ return;
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- Talk(SAY_DEATH);
+ Talk(SAY_KILL);
+ }
- lSummons.DespawnAll();
+ void JustSummoned(Creature* summon) OVERRIDE
+ {
+ summon->GetMotionMaster()->MovePoint(POINT_LANDING, Landing);
+ summons.Summon(summon);
+ }
- instance->SetBossState(DATA_TROLLGORE, DONE);
- }
+ private:
+ bool _consumptionJunction;
+ };
- uint32 GetData(uint32 type) const OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- if (type == DATA_CONSUMPTION_JUNCTION)
- return consumptionJunction ? 1 : 0;
-
- return 0;
+ return GetDrakTharonKeepAI<boss_trollgoreAI>(creature);
}
+};
+
+class npc_drakkari_invader : public CreatureScript
+{
+ public:
+ npc_drakkari_invader() : CreatureScript("npc_drakkari_invader") { }
- void KilledUnit(Unit* victim) OVERRIDE
+ struct npc_drakkari_invaderAI : public ScriptedAI
{
- if (victim->GetTypeId() != TYPEID_PLAYER)
- return;
+ npc_drakkari_invaderAI(Creature* creature) : ScriptedAI(creature) { }
- Talk(SAY_KILL);
- }
+ void MovementInform(uint32 type, uint32 pointId) OVERRIDE
+ {
+ if (type == POINT_MOTION_TYPE && pointId == POINT_LANDING)
+ {
+ me->Dismount();
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
+ DoCastAOE(SPELL_INVADER_TAUNT);
+ }
+ }
+ };
- void JustSummoned(Creature* summon) OVERRIDE
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
- lSummons.Summon(summon);
- if (summon->AI())
- summon->AI()->AttackStart(me);
+ return GetDrakTharonKeepAI<npc_drakkari_invaderAI>(creature);
}
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return GetDrakTharonKeepAI<boss_trollgoreAI>(creature);
- }
};
// 49380, 59803 - Consume
@@ -335,6 +347,7 @@ class achievement_consumption_junction : public AchievementCriteriaScript
void AddSC_boss_trollgore()
{
new boss_trollgore();
+ new npc_drakkari_invader();
new spell_trollgore_consume();
new spell_trollgore_corpse_explode();
new spell_trollgore_invader_taunt();