Core/Scripting: Updates to Dark Portal Instance Scripting
This commit is contained in:
1 parent
385cb3e116
commit
7e76ab97f8
6 files changed
+257
-245
No files matched your search
@@ -16,18 +16,18 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Aeonus
|
||||
SD%Complete: 80
|
||||
SDComment: Some spells not implemented
|
||||
SDCategory: Caverns of Time, The Dark Portal
|
||||
EndScriptData */
|
||||
/*
|
||||
Name: Boss_Aeonus
|
||||
%Complete: 80
|
||||
Comment: Some spells not implemented
|
||||
Category: Caverns of Time, The Dark Portal
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "dark_portal.h"
|
||||
|
||||
enum eEnums
|
||||
enum Enums
|
||||
{
|
||||
SAY_ENTER = 0,
|
||||
SAY_AGGRO = 1,
|
||||
@@ -43,45 +43,37 @@ enum eEnums
|
||||
H_SPELL_SAND_BREATH = 39049
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SANDBREATH = 1,
|
||||
EVENT_TIMESTOP = 2,
|
||||
EVENT_FRENZY = 3
|
||||
};
|
||||
|
||||
class boss_aeonus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_aeonus() : CreatureScript("boss_aeonus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
struct boss_aeonusAI : public BossAI
|
||||
{
|
||||
return new boss_aeonusAI (creature);
|
||||
}
|
||||
boss_aeonusAI(Creature* creature) : BossAI(creature, TYPE_AEONUS) { }
|
||||
|
||||
struct boss_aeonusAI : public ScriptedAI
|
||||
{
|
||||
boss_aeonusAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 SandBreath_Timer;
|
||||
uint32 TimeStop_Timer;
|
||||
uint32 Frenzy_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SandBreath_Timer = 15000+rand()%15000;
|
||||
TimeStop_Timer = 10000+rand()%5000;
|
||||
Frenzy_Timer = 30000+rand()%15000;
|
||||
}
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SANDBREATH, urand(15000, 30000));
|
||||
events.ScheduleEvent(EVENT_TIMESTOP, urand(10000, 15000));
|
||||
events.ScheduleEvent(EVENT_FRENZY, urand(30000, 45000));
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
//Despawn Time Keeper
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, 20.0f))
|
||||
{
|
||||
@@ -100,7 +92,7 @@ public:
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_RIFT, DONE);
|
||||
instance->SetData(TYPE_MEDIVH, DONE);//FIXME: later should be removed
|
||||
instance->SetData(TYPE_MEDIVH, DONE); // FIXME: later should be removed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,32 +107,40 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Sand Breath
|
||||
if (SandBreath_Timer <= diff)
|
||||
{
|
||||
DoCast(me->GetVictim(), SPELL_SAND_BREATH);
|
||||
SandBreath_Timer = 15000+rand()%10000;
|
||||
} else SandBreath_Timer -= diff;
|
||||
events.Update(diff);
|
||||
|
||||
//Time Stop
|
||||
if (TimeStop_Timer <= diff)
|
||||
{
|
||||
DoCast(me->GetVictim(), SPELL_TIME_STOP);
|
||||
TimeStop_Timer = 20000+rand()%15000;
|
||||
} else TimeStop_Timer -= diff;
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
//Frenzy
|
||||
if (Frenzy_Timer <= diff)
|
||||
{
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
Frenzy_Timer = 20000+rand()%15000;
|
||||
} else Frenzy_Timer -= diff;
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SANDBREATH:
|
||||
DoCast(me->GetVictim(), SPELL_SAND_BREATH);
|
||||
events.ScheduleEvent(EVENT_SANDBREATH, urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_TIMESTOP:
|
||||
DoCast(me->GetVictim(), SPELL_TIME_STOP);
|
||||
events.ScheduleEvent(EVENT_TIMESTOP, urand(20000, 35000));
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
events.ScheduleEvent(EVENT_FRENZY, urand(20000, 35000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_aeonusAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_aeonus()
|
||||
|
||||
@@ -27,7 +27,7 @@ EndScriptData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "dark_portal.h"
|
||||
|
||||
enum eEnums
|
||||
enum Enums
|
||||
{
|
||||
SAY_ENTER = 0,
|
||||
SAY_AGGRO = 1,
|
||||
@@ -43,47 +43,40 @@ enum eEnums
|
||||
SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode)
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_ARCANE_BLAST = 1,
|
||||
EVENT_TIME_LAPSE = 2,
|
||||
EVENT_ARCANE_DISCHARGE = 3,
|
||||
EVENT_ATTRACTION = 4
|
||||
};
|
||||
|
||||
class boss_chrono_lord_deja : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_chrono_lord_deja() : CreatureScript("boss_chrono_lord_deja") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
struct boss_chrono_lord_dejaAI : public BossAI
|
||||
{
|
||||
return new boss_chrono_lord_dejaAI (creature);
|
||||
}
|
||||
boss_chrono_lord_dejaAI(Creature* creature) : BossAI(creature, TYPE_CRONO_LORD_DEJA) { }
|
||||
|
||||
struct boss_chrono_lord_dejaAI : public ScriptedAI
|
||||
{
|
||||
boss_chrono_lord_dejaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ArcaneBlast_Timer;
|
||||
uint32 TimeLapse_Timer;
|
||||
uint32 Attraction_Timer;
|
||||
uint32 ArcaneDischarge_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ArcaneBlast_Timer = 18000+rand()%5000;
|
||||
TimeLapse_Timer = 10000+rand()%5000;
|
||||
ArcaneDischarge_Timer = 20000+rand()%10000;
|
||||
Attraction_Timer = 25000+rand()%10000;
|
||||
}
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, urand(18000, 23000));
|
||||
events.ScheduleEvent(EVENT_TIME_LAPSE, urand(10000, 15000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_DISCHARGE, urand(20000, 30000));
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_ATTRACTION, urand(25000, 35000));
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
//Despawn Time Keeper
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, 20.0f))
|
||||
{
|
||||
@@ -114,42 +107,43 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Arcane Blast
|
||||
if (ArcaneBlast_Timer <= diff)
|
||||
{
|
||||
DoCast(me->GetVictim(), SPELL_ARCANE_BLAST);
|
||||
ArcaneBlast_Timer = 15000+rand()%10000;
|
||||
} else ArcaneBlast_Timer -= diff;
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
//Arcane Discharge
|
||||
if (ArcaneDischarge_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_DISCHARGE);
|
||||
ArcaneDischarge_Timer = 20000+rand()%10000;
|
||||
} else ArcaneDischarge_Timer -= diff;
|
||||
|
||||
//Time Lapse
|
||||
if (TimeLapse_Timer <= diff)
|
||||
{
|
||||
Talk(SAY_BANISH);
|
||||
DoCast(me, SPELL_TIME_LAPSE);
|
||||
TimeLapse_Timer = 15000+rand()%10000;
|
||||
} else TimeLapse_Timer -= diff;
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (Attraction_Timer <= diff)
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
DoCast(me, SPELL_ATTRACTION);
|
||||
Attraction_Timer = 25000+rand()%10000;
|
||||
} else Attraction_Timer -= diff;
|
||||
}
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_BLAST:
|
||||
DoCast(me->GetVictim(), SPELL_ARCANE_BLAST);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_TIME_LAPSE:
|
||||
Talk(SAY_BANISH);
|
||||
DoCast(me, SPELL_TIME_LAPSE);
|
||||
events.ScheduleEvent(EVENT_TIME_LAPSE, urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_ARCANE_DISCHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_ARCANE_DISCHARGE);
|
||||
events.ScheduleEvent(EVENT_ARCANE_DISCHARGE, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_ATTRACTION: // Only in Heroic
|
||||
DoCast(me, SPELL_ATTRACTION);
|
||||
events.ScheduleEvent(EVENT_ATTRACTION, urand(25000, 35000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_chrono_lord_dejaAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_chrono_lord_deja()
|
||||
|
||||
@@ -27,7 +27,7 @@ EndScriptData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "dark_portal.h"
|
||||
|
||||
enum eEnums
|
||||
enum Enums
|
||||
{
|
||||
SAY_ENTER = 0,
|
||||
SAY_AGGRO = 1,
|
||||
@@ -42,40 +42,33 @@ enum eEnums
|
||||
SPELL_REFLECT = 38592 //Not Implemented (Heroic mod)
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_HASTE = 1,
|
||||
EVENT_MORTAL_WOUND = 2,
|
||||
EVENT_WING_BUFFET = 3,
|
||||
EVENT_SPELL_REFLECTION = 4
|
||||
};
|
||||
|
||||
class boss_temporus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_temporus() : CreatureScript("boss_temporus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
struct boss_temporusAI : public BossAI
|
||||
{
|
||||
return new boss_temporusAI (creature);
|
||||
}
|
||||
boss_temporusAI(Creature* creature) : BossAI(creature, TYPE_TEMPORUS) { }
|
||||
|
||||
struct boss_temporusAI : public ScriptedAI
|
||||
{
|
||||
boss_temporusAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Haste_Timer;
|
||||
uint32 SpellReflection_Timer;
|
||||
uint32 MortalWound_Timer;
|
||||
uint32 WingBuffet_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Haste_Timer = 15000+rand()%8000;
|
||||
SpellReflection_Timer = 30000;
|
||||
MortalWound_Timer = 8000;
|
||||
WingBuffet_Timer = 25000+rand()%10000;
|
||||
}
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_HASTE, urand(15000, 23000));
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
events.ScheduleEvent(EVENT_WING_BUFFET, urand(25000, 35000));
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_REFLECTION, 30000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -95,7 +88,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
//Despawn Time Keeper
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
|
||||
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER)
|
||||
{
|
||||
if (me->IsWithinDistInMap(who, 20.0f))
|
||||
{
|
||||
@@ -114,37 +107,41 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Attack Haste
|
||||
if (Haste_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HASTE);
|
||||
Haste_Timer = 20000+rand()%5000;
|
||||
} else Haste_Timer -= diff;
|
||||
events.Update(diff);
|
||||
|
||||
//MortalWound_Timer
|
||||
if (MortalWound_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_MORTAL_WOUND);
|
||||
MortalWound_Timer = 10000+rand()%10000;
|
||||
} else MortalWound_Timer -= diff;
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
//Wing ruffet
|
||||
if (WingBuffet_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_WING_BUFFET);
|
||||
WingBuffet_Timer = 20000+rand()%10000;
|
||||
} else WingBuffet_Timer -= diff;
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (SpellReflection_Timer <= diff)
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
DoCast(me, SPELL_REFLECT);
|
||||
SpellReflection_Timer = 25000+rand()%10000;
|
||||
} else SpellReflection_Timer -= diff;
|
||||
}
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_HASTE:
|
||||
DoCast(me, SPELL_HASTE);
|
||||
events.ScheduleEvent(EVENT_HASTE, urand(20000, 25000));
|
||||
break;
|
||||
case EVENT_MORTAL_WOUND:
|
||||
DoCast(me, SPELL_MORTAL_WOUND);
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 20000));
|
||||
break;
|
||||
case EVENT_WING_BUFFET:
|
||||
DoCast(me, SPELL_WING_BUFFET);
|
||||
events.ScheduleEvent(EVENT_WING_BUFFET, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_SPELL_REFLECTION: // Only in Heroic
|
||||
DoCast(me, SPELL_REFLECT);
|
||||
events.ScheduleEvent(EVENT_SPELL_REFLECTION, urand(25000, 35000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_temporusAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -125,12 +125,12 @@ public:
|
||||
return;
|
||||
|
||||
uint32 entry = who->GetEntry();
|
||||
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
|
||||
if (entry == NPC_INFINITE_ASSASIN || entry == NPC_INFINITE_WHELP || entry == NPC_INFINITE_CRONOMANCER || entry == NPC_INFINITE_EXECUTIONER || entry == NPC_INFINITE_VANQUISHER)
|
||||
{
|
||||
who->StopMoving();
|
||||
who->CastSpell(me, SPELL_CORRUPT, false);
|
||||
}
|
||||
else if (entry == C_AEONUS)
|
||||
else if (entry == NPC_AEONUS)
|
||||
{
|
||||
who->StopMoving();
|
||||
who->CastSpell(me, SPELL_CORRUPT_AEONUS, false);
|
||||
@@ -251,9 +251,9 @@ struct Wave
|
||||
|
||||
static Wave PortalWaves[]=
|
||||
{
|
||||
{ {C_ASSAS, C_WHELP, C_CHRON, 0} },
|
||||
{ {C_EXECU, C_CHRON, C_WHELP, C_ASSAS} },
|
||||
{ {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} }
|
||||
{ {NPC_INFINITE_ASSASIN, NPC_INFINITE_WHELP, NPC_INFINITE_CRONOMANCER, 0} },
|
||||
{ {NPC_INFINITE_EXECUTIONER, NPC_INFINITE_CRONOMANCER, NPC_INFINITE_WHELP, NPC_INFINITE_ASSASIN} },
|
||||
{ {NPC_INFINITE_EXECUTIONER, NPC_INFINITE_VANQUISHER, NPC_INFINITE_CRONOMANCER, NPC_INFINITE_ASSASIN} }
|
||||
};
|
||||
|
||||
class npc_time_rift : public CreatureScript
|
||||
@@ -335,7 +335,7 @@ public:
|
||||
|
||||
++mRiftWaveCount;
|
||||
|
||||
if (entry == C_WHELP)
|
||||
if (entry == NPC_INFINITE_WHELP)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
DoSummonAtRift(entry);
|
||||
|
||||
@@ -19,31 +19,49 @@
|
||||
#ifndef DEF_DARKPORTAL_H
|
||||
#define DEF_DARKPORTAL_H
|
||||
|
||||
#define TYPE_MEDIVH 1
|
||||
#define TYPE_RIFT 2
|
||||
uint32 const EncounterCount = 2;
|
||||
|
||||
#define DATA_MEDIVH 10
|
||||
#define DATA_PORTAL_COUNT 11
|
||||
#define DATA_SHIELD 12
|
||||
enum DataTypes
|
||||
{
|
||||
TYPE_MEDIVH = 1,
|
||||
TYPE_RIFT = 2,
|
||||
TYPE_AEONUS = 3,
|
||||
TYPE_TEMPORUS = 4,
|
||||
TYPE_CRONO_LORD_DEJA = 5,
|
||||
DATA_MEDIVH = 10,
|
||||
DATA_PORTAL_COUNT = 11,
|
||||
DATA_SHIELD = 12
|
||||
};
|
||||
|
||||
#define WORLD_STATE_BM 2541
|
||||
#define WORLD_STATE_BM_SHIELD 2540
|
||||
#define WORLD_STATE_BM_RIFT 2784
|
||||
enum WorldStateIds
|
||||
{
|
||||
WORLD_STATE_BM = 2541,
|
||||
WORLD_STATE_BM_SHIELD = 2540,
|
||||
WORLD_STATE_BM_RIFT = 2784
|
||||
};
|
||||
|
||||
#define QUEST_OPENING_PORTAL 10297
|
||||
#define QUEST_MASTER_TOUCH 9836
|
||||
enum QuestIds
|
||||
{
|
||||
QUEST_OPENING_PORTAL = 10297,
|
||||
QUEST_MASTER_TOUCH = 9836
|
||||
};
|
||||
|
||||
#define C_TIME_KEEPER 17918
|
||||
#define C_RKEEP 21104
|
||||
#define C_RLORD 17839
|
||||
#define C_DEJA 17879
|
||||
#define C_TEMPO 17880
|
||||
#define C_AEONUS 17881
|
||||
#define C_ASSAS 17835
|
||||
#define C_WHELP 21818
|
||||
#define C_CHRON 17892
|
||||
#define C_EXECU 18994
|
||||
#define C_VANQU 18995
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_MEDIVH = 15608,
|
||||
NPC_TIME_RIFT = 17838,
|
||||
NPC_TIME_KEEPER = 17918,
|
||||
NPC_RIFT_KEEPER = 21104,
|
||||
NPC_RIFT_LORD = 17839,
|
||||
NPC_CRONO_LORD_DEJA = 17879,
|
||||
NPC_TEMPORUS = 17880,
|
||||
NPC_AEONUS = 17881,
|
||||
NPC_INFINITE_ASSASIN = 17835,
|
||||
NPC_INFINITE_WHELP = 21818,
|
||||
NPC_INFINITE_CRONOMANCER = 17892,
|
||||
NPC_INFINITE_EXECUTIONER = 18994,
|
||||
NPC_INFINITE_VANQUISHER = 18995
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,16 +30,13 @@ EndScriptData */
|
||||
#include "TemporarySummon.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
#define MAX_ENCOUNTER 2
|
||||
enum Misc
|
||||
{
|
||||
SPELL_RIFT_CHANNEL = 31387,
|
||||
RIFT_BOSS = 1
|
||||
};
|
||||
|
||||
#define C_MEDIVH 15608
|
||||
#define C_TIME_RIFT 17838
|
||||
|
||||
#define SPELL_RIFT_CHANNEL 31387
|
||||
|
||||
#define RIFT_BOSS 1
|
||||
|
||||
inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); }
|
||||
inline uint32 RandRiftBoss() { return ((rand()%2) ? NPC_RIFT_KEEPER : NPC_RIFT_LORD); }
|
||||
|
||||
float PortalLocation[4][4]=
|
||||
{
|
||||
@@ -57,12 +54,17 @@ struct Wave
|
||||
|
||||
static Wave RiftWaves[]=
|
||||
{
|
||||
{RIFT_BOSS, 0},
|
||||
{C_DEJA, 0},
|
||||
{RIFT_BOSS, 120000},
|
||||
{C_TEMPO, 140000},
|
||||
{RIFT_BOSS, 120000},
|
||||
{C_AEONUS, 0}
|
||||
{ RIFT_BOSS, 0 },
|
||||
{ NPC_CRONO_LORD_DEJA, 0 },
|
||||
{ RIFT_BOSS, 120000 },
|
||||
{ NPC_TEMPORUS, 140000 },
|
||||
{ RIFT_BOSS, 120000 },
|
||||
{ NPC_AEONUS, 0 }
|
||||
};
|
||||
|
||||
enum EventIds
|
||||
{
|
||||
EVENT_NEXT_PORTAL = 1
|
||||
};
|
||||
|
||||
class instance_dark_portal : public InstanceMapScript
|
||||
@@ -77,25 +79,21 @@ public:
|
||||
|
||||
struct instance_dark_portal_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_dark_portal_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
instance_dark_portal_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 m_auiEncounter[EncounterCount];
|
||||
|
||||
uint32 mRiftPortalCount;
|
||||
uint32 mShieldPercent;
|
||||
uint8 mRiftWaveCount;
|
||||
uint8 mRiftWaveId;
|
||||
uint8 mRiftWaveCount;
|
||||
uint8 mRiftWaveId;
|
||||
|
||||
uint32 NextPortal_Timer;
|
||||
|
||||
uint64 MedivhGUID;
|
||||
uint8 CurrentRiftId;
|
||||
uint64 _medivhGUID;
|
||||
uint8 _currentRiftId;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
MedivhGUID = 0;
|
||||
_medivhGUID = 0;
|
||||
Clear();
|
||||
}
|
||||
|
||||
@@ -108,9 +106,7 @@ public:
|
||||
mRiftWaveCount = 0;
|
||||
mRiftWaveId = 0;
|
||||
|
||||
CurrentRiftId = 0;
|
||||
|
||||
NextPortal_Timer = 0;
|
||||
_currentRiftId = 0;
|
||||
}
|
||||
|
||||
void InitWorldState(bool Enable = true)
|
||||
@@ -138,8 +134,8 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
if (creature->GetEntry() == C_MEDIVH)
|
||||
MedivhGUID = creature->GetGUID();
|
||||
if (creature->GetEntry() == NPC_MEDIVH)
|
||||
_medivhGUID = creature->GetGUID();
|
||||
}
|
||||
|
||||
//what other conditions to check?
|
||||
@@ -181,11 +177,11 @@ public:
|
||||
|
||||
if (!mShieldPercent)
|
||||
{
|
||||
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
|
||||
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
||||
{
|
||||
if (pMedivh->IsAlive())
|
||||
if (medivh->IsAlive())
|
||||
{
|
||||
pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
m_auiEncounter[0] = FAIL;
|
||||
m_auiEncounter[1] = NOT_STARTED;
|
||||
}
|
||||
@@ -199,7 +195,7 @@ public:
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Dark Portal: Starting event.");
|
||||
InitWorldState();
|
||||
m_auiEncounter[1] = IN_PROGRESS;
|
||||
NextPortal_Timer = 15000;
|
||||
_events.ScheduleEvent(EVENT_NEXT_PORTAL, 15000);
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
@@ -231,7 +227,7 @@ public:
|
||||
if (data == SPECIAL)
|
||||
{
|
||||
if (mRiftPortalCount < 7)
|
||||
NextPortal_Timer = 5000;
|
||||
_events.ScheduleEvent(EVENT_NEXT_PORTAL, 5000);
|
||||
}
|
||||
else
|
||||
m_auiEncounter[1] = data;
|
||||
@@ -258,7 +254,7 @@ public:
|
||||
uint64 GetData64(uint32 data) const
|
||||
{
|
||||
if (data == DATA_MEDIVH)
|
||||
return MedivhGUID;
|
||||
return _medivhGUID;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -287,18 +283,18 @@ public:
|
||||
|
||||
void DoSpawnPortal()
|
||||
{
|
||||
if (Creature* pMedivh = instance->GetCreature(MedivhGUID))
|
||||
if (Creature* medivh = instance->GetCreature(_medivhGUID))
|
||||
{
|
||||
uint8 tmp = urand(0, 2);
|
||||
|
||||
if (tmp >= CurrentRiftId)
|
||||
if (tmp >= _currentRiftId)
|
||||
++tmp;
|
||||
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).", tmp, CurrentRiftId);
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).", tmp, _currentRiftId);
|
||||
|
||||
CurrentRiftId = tmp;
|
||||
_currentRiftId = tmp;
|
||||
|
||||
Creature* temp = pMedivh->SummonCreature(C_TIME_RIFT,
|
||||
Creature* temp = medivh->SummonCreature(NPC_TIME_RIFT,
|
||||
PortalLocation[tmp][0], PortalLocation[tmp][1], PortalLocation[tmp][2], PortalLocation[tmp][3],
|
||||
TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
if (temp)
|
||||
@@ -306,14 +302,14 @@ public:
|
||||
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if (Creature* pBoss = SummonedPortalBoss(temp))
|
||||
if (Creature* boss = SummonedPortalBoss(temp))
|
||||
{
|
||||
if (pBoss->GetEntry() == C_AEONUS)
|
||||
pBoss->AddThreat(pMedivh, 0.0f);
|
||||
if (boss->GetEntry() == NPC_AEONUS)
|
||||
boss->AddThreat(medivh, 0.0f);
|
||||
else
|
||||
{
|
||||
pBoss->AddThreat(temp, 0.0f);
|
||||
temp->CastSpell(pBoss, SPELL_RIFT_CHANNEL, false);
|
||||
boss->AddThreat(temp, 0.0f);
|
||||
temp->CastSpell(boss, SPELL_RIFT_CHANNEL, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,19 +328,26 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (NextPortal_Timer)
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
if (NextPortal_Timer <= diff)
|
||||
switch (eventId)
|
||||
{
|
||||
++mRiftPortalCount;
|
||||
|
||||
DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount);
|
||||
|
||||
DoSpawnPortal();
|
||||
NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime;
|
||||
} else NextPortal_Timer -= diff;
|
||||
case EVENT_NEXT_PORTAL:
|
||||
++mRiftPortalCount;
|
||||
DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount);
|
||||
DoSpawnPortal();
|
||||
_events.ScheduleEvent(EVENT_NEXT_PORTAL, RiftWaves[GetRiftWaveId()].NextPortalTime);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user