*Update Naxx scripts.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-06 00:08:19 -05:00
parent 4045c881ab
commit a3447b294d
10 changed files with 373 additions and 181 deletions

View File

@@ -388,6 +388,7 @@ extern void AddSC_boss_gluth();
extern void AddSC_boss_sapphiron();
extern void AddSC_boss_four_horsemen();
extern void AddSC_boss_faerlina();
extern void AddSC_boss_heigan();
extern void AddSC_instance_naxxramas();
//Netherstorm
@@ -613,6 +614,11 @@ extern void AddSC_boss_zuljin();
extern void AddSC_instance_zulaman();
extern void AddSC_zulaman();
//Northrend
//Dungeon
//Vault of Archavon
extern void AddSC_boss_archavon();
// -------------------
void LoadDatabase()
{
@@ -1074,7 +1080,6 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
AddSC_boss_najentus();
AddSC_boss_illidari_council();
AddSC_instance_black_temple();
AddSC_instance_naxxramas();
//Blackfathom Depths
//Blackrock Depths
@@ -1321,6 +1326,8 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
AddSC_boss_gluth();
AddSC_boss_sapphiron();
AddSC_boss_four_horsemen();
AddSC_boss_heigan();
AddSC_instance_naxxramas();
//Netherstorm
AddSC_netherstorm();
@@ -1545,6 +1552,11 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
AddSC_instance_zulaman();
AddSC_zulaman();
//Northrend
//Dungeon
//Vault of Archavon
AddSC_boss_archavon();
// -------------------
outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts);

View File

@@ -23,14 +23,8 @@ EndScriptData */
#include "precompiled.h"
#define SAY_GREET -1533000
#define SAY_AGGRO1 -1533001
#define SAY_AGGRO2 -1533002
#define SAY_AGGRO3 -1533003
#define SAY_TAUNT1 -1533004
#define SAY_TAUNT2 -1533005
#define SAY_TAUNT3 -1533006
#define SAY_TAUNT4 -1533007
#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007)
#define SAY_AGGRO RAND(-1533001,-1533002,-1533003)
#define SAY_SLAY -1533008
#define SPELL_IMPALE HEROIC(28783,56090)
@@ -52,16 +46,23 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
EventMap events;
SummonList summons;
void Reset()
void Prepare()
{
events.Reset();
summons.DespawnAll();
HasTaunted = false;
DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
if(HeroicMode)
DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000);
}
void InitializeAI() { Prepare(); }
void JustReachedHome() { Prepare(); }
void Reset()
{
events.Reset();
summons.DespawnAll();
}
void JustSummoned(Creature *summon)
{
summons.Summon(summon);
@@ -81,13 +82,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
void EnterCombat(Unit *who)
{
switch(rand()%3)
{
case 0: DoScriptText(SAY_AGGRO1, m_creature); break;
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
}
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_IMPALE, 15000, 1);
@@ -96,16 +91,9 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
if(!HasTaunted && me->IsWithinDistInMap(who, 60.0f))
{
switch(rand()%5)
{
case 0: DoScriptText(SAY_GREET, m_creature); break;
case 1: DoScriptText(SAY_TAUNT1, m_creature); break;
case 2: DoScriptText(SAY_TAUNT2, m_creature); break;
case 3: DoScriptText(SAY_TAUNT3, m_creature); break;
case 4: DoScriptText(SAY_TAUNT4, m_creature); break;
}
DoScriptText(SAY_GREET, me);
HasTaunted = true;
}
ScriptedAI::MoveInLineOfSight(who);

View File

@@ -22,25 +22,115 @@ SDCategory: Naxxramas
EndScriptData */
#include "precompiled.h"
#include "def_naxxramas.h"
#define SAY_AGGRO1 -1533109
#define SAY_AGGRO2 -1533110
#define SAY_AGGRO3 -1533111
#define SAY_AGGRO RAND(-1533109,-1533110,-1533111)
#define SAY_SLAY -1533112
#define SAY_TAUNT1 -1533113
#define SAY_TAUNT2 -1533114
#define SAY_TAUNT3 -1533115
#define SAY_TAUNT4 -1533116
#define SAY_TAUNT5 -1533117
#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117)
#define SAY_DEATH -1533118
//Spell used by floor peices to cause damage to players
#define SPELL_ERUPTION 29371
//Spells by boss
#define SPELL_WILT 23772
#define SPELL_FEAVER 29998
#define SPELL_SPELL_DISRUPTION 29310
#define SPELL_DECREPIT_FEVER HEROIC(29998,55011)
#define SPELL_PLAGUE_CLOUD 30122
enum Events
{
EVENT_DISRUPT = 1,
EVENT_FEVER,
EVENT_CLOUD,
EVENT_ERUPT,
};
//Spell by eye stalks
#define SPELL_MIND_FLAY 26143
struct TRINITY_DLL_DECL boss_heiganAI : public ScriptedAI
{
boss_heiganAI(Creature *c) : ScriptedAI(c)
{
instance = ((ScriptedInstance*)c->GetInstanceData());
}
EventMap events;
ScriptedInstance *instance;
void Reset()
{
events.Reset();
instance->SetBossState(BOSS_HEIGAN, NOT_STARTED);
}
void KilledUnit(Unit* Victim)
{
if(!(rand()%5))
DoScriptText(SAY_SLAY, me);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, me);
instance->SetBossState(BOSS_HEIGAN, DONE);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_FEVER, 1200);
events.ScheduleEvent(EVENT_CLOUD, 360000);
events.ScheduleEvent(EVENT_ERUPT, 3000);
instance->SetBossState(BOSS_HEIGAN, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if(!UpdateVictim())
return;
events.Update(diff);
while(uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_DISRUPT:
events.ScheduleEvent(EVENT_DISRUPT, 1200);
return;
case EVENT_FEVER:
events.ScheduleEvent(EVENT_FEVER, 2000);
return;
case EVENT_CLOUD:
events.ScheduleEvent(EVENT_CLOUD, 2000);
return;
case EVENT_ERUPT:
if(instance)
{
uint32 section = rand()%4;
instance->SetData(DATA_HEIGAN_ERUPT, section);
}
events.ScheduleEvent(EVENT_ERUPT, 2000);
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_heigan(Creature *_Creature)
{
return new boss_heiganAI (_Creature);
}
void AddSC_boss_heigan()
{
Script *newscript;
newscript = new Script;
newscript->Name="boss_heigan";
newscript->GetAI = &GetAI_boss_heigan;
newscript->RegisterSelf();
}

View File

@@ -79,25 +79,20 @@ I also don't know the emotes
#define NAXXRAMAS_MAP 533
//Positional defines
//spells to be casted
#define SPELL_FROST_BOLT 28478
#define H_SPELL_FROST_BOLT 55802
#define SPELL_FROST_BOLT_NOVA 28479
#define H_SPELL_FROST_BOLT_NOVA 55807
#define SPELL_CHAINS_OF_KELTHUZAD 28410
#define SPELL_MANA_DETONATION 27819
#define SPELL_FROST_BOLT HEROIC(28478,55802)
#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807)
#define SPELL_SHADOW_FISURE 27810
#define SPELL_VOID_BLAST 27812
#define SPELL_MANA_DETONATION 27819
#define SPELL_FROST_BLAST 27808
#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect
#define SPELL_BERSERK 28498
#define NORMAL_RAID 10
//creature needed summoned
#define MOB_SUMMON_WASTE 16427 //Soldiers of the Frozen Wastes
#define MOB_SUMMON_ABOMINATION 16428 //Unstoppable Abominations
#define MOB_SUMMON_WEAVER 16429//Soul Weavers
#define MOB_SUMMON_FISSURE 16129 // Shadow Fissure
#define MOB_SUMMON_ICECROWN 16441// Guardians of Icecrown
#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes
#define MOB_ABOMINATION 16428 // Unstoppable Abominations
#define MOB_WEAVER 16429 // Soul Weavers
#define MOB_FISSURE 16129 // Shadow Fissure
#define MOB_ICECROWN 16441 // Guardians of Icecrown
float Pos[12][4] =
{
@@ -188,7 +183,12 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void SummonedCreatureDespawn(Creature *summon)
{
if(summon->GetEntry() == MOB_FISSURE)
summon->CastSpell(summon, SPELL_VOID_BLAST, true);
}
void EnterCombat(Unit* who)
@@ -222,10 +222,10 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
Creature *Waster = NULL;
switch(rand()%4)
{
case 0: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Waster = m_creature->SummonCreature(MOB_SUMMON_WASTE,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 0: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Waster = m_creature->SummonCreature(MOB_WASTE,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
}
if(Waster)
@@ -238,17 +238,17 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
SummonWasters_Timer=3000;
}else SummonWasters_Timer-=diff;
//MOB_SUMMON_ABOMINATION at middle positon
//MOB_ABOMINATION at middle positon
if ( SummonAbominations_Timer< diff)
{
Creature *Abominations = NULL;
switch(rand()%4)
{
case 0: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[1][0], Pos[1][1], Pos[1][2], Pos[1][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[4][0], Pos[4][1], Pos[4][2], Pos[4][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[7][0], Pos[7][1], Pos[7][2], Pos[7][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Abominations = m_creature->SummonCreature(MOB_SUMMON_ABOMINATION,Pos[10][0], Pos[10][1], Pos[10][2], Pos[10][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 0: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[1][0], Pos[1][1], Pos[1][2], Pos[1][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[4][0], Pos[4][1], Pos[4][2], Pos[4][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[7][0], Pos[7][1], Pos[7][2], Pos[7][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Abominations = m_creature->SummonCreature(MOB_ABOMINATION,Pos[10][0], Pos[10][1], Pos[10][2], Pos[10][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
}
if(Abominations)
@@ -268,10 +268,10 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
Creature *Weavers = NULL;
switch(rand()%4)
{
case 0: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Weavers = m_creature->SummonCreature(MOB_SUMMON_WEAVER,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 0: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[0][0], Pos[0][1], Pos[0][2], Pos[0][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 1: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[3][0], Pos[3][1], Pos[3][2], Pos[3][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 2: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[6][0], Pos[6][1], Pos[6][2], Pos[6][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
case 3: Weavers = m_creature->SummonCreature(MOB_WEAVER,Pos[9][0], Pos[9][1], Pos[9][2], Pos[9][3], TEMPSUMMON_CORPSE_DESPAWN, 0); break;
}
if(Weavers)
@@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
//Check for Frost Bolt Nova
if(FrostBoltNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_NOVA);
DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_AOE);
FrostBoltNova_Timer = 15000;
}else FrostBoltNova_Timer -= diff;
@@ -322,23 +322,24 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
//Check for Mana Detonation
if(ManaDetonation_Timer < diff)
{
Unit* target;
//select a manaplayer during 10 raid ,how to make sure we can succed in finding a manaplayer or it's safty if there is no manaplayer in raid
for(uint8 i = 0; i <NORMAL_RAID; i++)
std::list<HostilReference*> *threatList = &me->getThreatManager().getThreatList();
std::list<HostilReference*>::iterator itr = threatList->begin();
std::vector<Unit*> unitList;
for(;itr != threatList->end(); ++itr)
{
if (target = SelectUnit(SELECT_TARGET_RANDOM,0))
{
//check if the target is a manaplayer
if ( ((Player*)target)->getPowerType()==POWER_MANA )
{
// if yes cast the SPELL_MANA_DETONATION
DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
//Obviously the damage of this spell would be invalidation
break;
//exit the circle
}
}
if((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER
&& (*itr)->getTarget()->getPowerType() == POWER_MANA
&& (*itr)->getTarget()->GetPower(POWER_MANA))
unitList.push_back((*itr)->getTarget());
}
if(!unitList.empty())
{
std::vector<Unit*>::iterator itr = unitList.begin();
advance(itr, rand()%unitList.size());
DoCast(*itr, SPELL_MANA_DETONATION);
}
if (rand()%2)
DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature);
ManaDetonation_Timer = 20000;
@@ -350,22 +351,8 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
if(ShadowFisure_Timer < diff)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
{
//get the position of the target x,y,z,ang.
float x,y,z,ang;
x=target->GetPositionX();
y=target->GetPositionY();
z=target->GetPositionZ();
ang=target->GetOrientation();
//summon the MOB_SUMMON_FISSURE at this positon
Creature *Fissure= m_creature->SummonCreature(MOB_SUMMON_FISSURE,x,y,z,ang, TEMPSUMMON_CORPSE_DESPAWN, 0);
if(Fissure)
{
DoCast(target,SPELL_SHADOW_FISURE);
Fissure->AI()->AttackStart(target);
}
}
if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target, SPELL_SHADOW_FISURE);
if (rand()%2)
DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature);
@@ -404,13 +391,13 @@ struct TRINITY_DLL_DECL boss_kelthuzadAI : public ScriptedAI
switch(rand()%3)
{
case 0:
pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[2][0],Pos[2][1],Pos[2][2],Pos[2][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[2][0],Pos[2][1],Pos[2][2],Pos[2][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
break;
case 1:
pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[5][0],Pos[5][1],Pos[5][2],Pos[5][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[5][0],Pos[5][1],Pos[5][2],Pos[5][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
break;
case 2:
pUnit = m_creature->SummonCreature(MOB_SUMMON_ICECROWN,Pos[8][0],Pos[8][1],Pos[8][2],Pos[8][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
pUnit = m_creature->SummonCreature(MOB_ICECROWN,Pos[8][0],Pos[8][1],Pos[8][2],Pos[8][3],TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
break;
}

View File

@@ -22,23 +22,22 @@ SDCategory: Naxxramas
EndScriptData */
#include "precompiled.h"
#include "def_naxxramas.h"
#define SAY_AGGRO1 -1533075
#define SAY_AGGRO2 -1533076
#define SAY_AGGRO3 -1533077
#define SAY_AGGRO RAND(-1533075,-1533076,-1533077)
#define SAY_SUMMON -1533078
#define SAY_SLAY1 -1533079
#define SAY_SLAY2 -1533080
#define SAY_SLAY RAND(-1533079,-1533080)
#define SAY_DEATH -1533081
#define SPELL_BLINK 29211 //29208, 29209 and 29210 too
#define SPELL_CRIPPLE 29212
#define H_SPELL_CRIPPLE 54814
#define SPELL_CURSE_PLAGUEBRINGER 28213
#define H_SPELL_CURSE_PLAGUEBRINGER 54835
#define SOUND_DEATH 8848
#define C_PLAGUED_WARRIOR 16984
#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835)
#define SPELL_BLINK RAND(29208,29209,29210,29211)
#define SPELL_CRIPPLE HEROIC(29212,54814)
#define MOB_WARRIOR 16984
#define MOB_CHAMPION 16983
#define MOB_GUARDIAN 16981
// Teleport position of Noth on his balcony
#define TELE_X 2631.370
@@ -49,86 +48,98 @@ EndScriptData */
// IMPORTANT: BALCONY TELEPORT NOT ADDED YET! WILL BE ADDED SOON!
// Dev note 26.12.2008: When is soon? :)
enum Events
{
EVENT_BERSERK = 1,
EVENT_CURSE,
EVENT_BLINK,
EVENT_WARRIOR,
};
struct TRINITY_DLL_DECL boss_nothAI : public ScriptedAI
{
boss_nothAI(Creature *c) : ScriptedAI(c) {}
boss_nothAI(Creature *c) : ScriptedAI(c), summons(me)
{
instance = ((ScriptedInstance*)c->GetInstanceData());
}
uint32 Blink_Timer;
uint32 Curse_Timer;
uint32 Summon_Timer;
EventMap events;
SummonList summons;
ScriptedInstance *instance;
void Reset()
{
Blink_Timer = 25000;
Curse_Timer = 4000;
Summon_Timer = 12000;
events.Reset();
summons.DespawnAll();
instance->SetBossState(BOSS_NOTH, NOT_STARTED);
}
void EnterCombat(Unit *who)
{
switch (rand()%3)
{
case 0: DoScriptText(SAY_AGGRO1, m_creature); break;
case 1: DoScriptText(SAY_AGGRO2, m_creature); break;
case 2: DoScriptText(SAY_AGGRO3, m_creature); break;
}
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000);
events.ScheduleEvent(EVENT_WARRIOR, 30000);
if(HeroicMode)
events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
instance->SetBossState(BOSS_NOTH, IN_PROGRESS);
}
void KilledUnit(Unit* victim)
{
switch (rand()%2)
{
case 0: DoScriptText(SAY_SLAY1, m_creature); break;
case 1: DoScriptText(SAY_SLAY2, m_creature); break;
}
DoScriptText(SAY_SLAY, me);
}
void JustSummoned(Creature* summoned)
void JustSummoned(Creature *summon)
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
summoned->AddThreat(target,0.0f);
summons.Summon(summon);
DoZoneInCombat(summon);
}
void SummonedCreatureDespawn(Creature *summon) { summons.Despawn(summon); }
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
instance->SetBossState(BOSS_NOTH, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
if(!UpdateVictim())
return;
//Blink_Timer
if (Blink_Timer < diff)
events.Update(diff);
while(uint32 eventId = events.ExecuteEvent())
{
DoCast(m_creature->getVictim(),SPELL_CRIPPLE);
DoCast(m_creature,SPELL_BLINK);
Blink_Timer = 25000;
}else Blink_Timer -= diff;
//Curse_Timer
if (Curse_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_CURSE_PLAGUEBRINGER);
Curse_Timer = 28000;
}else Curse_Timer -= diff;
//Summon_Timer
if (Summon_Timer < diff)
{
DoScriptText(SAY_SUMMON, m_creature);
for(uint8 i = 0; i < 6; i++)
m_creature->SummonCreature(C_PLAGUED_WARRIOR,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
Summon_Timer = 30500;
} else Summon_Timer -= diff;
switch(eventId)
{
case EVENT_CURSE:
DoCastAOE(SPELL_CURSE_PLAGUEBRINGER);
events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000);
return;
case EVENT_WARRIOR:
DoScriptText(SAY_SUMMON, me);
for(uint8 i = 0; i < 6; i++)
m_creature->SummonCreature(MOB_WARRIOR,2684.804,-3502.517,261.313,0,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,80000);
events.ScheduleEvent(EVENT_WARRIOR, 30000);
return;
case EVENT_BLINK:
DoCastAOE(SPELL_CRIPPLE, true);
DoCastAOE(SPELL_BLINK);
DoResetThreat();
events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000);
return;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_noth(Creature *_Creature)
{
return new boss_nothAI (_Creature);
@@ -142,4 +153,3 @@ void AddSC_boss_noth()
newscript->GetAI = &GetAI_boss_noth;
newscript->RegisterSelf();
}

View File

@@ -23,8 +23,7 @@ EndScriptData */
#include "precompiled.h"
#define SAY_AGGRO1 -1533017
#define SAY_AGGRO2 -1533018
#define SAY_AGGRO RAND(-1533017,-1533018)
#define SAY_SLAY -1533019
#define SAY_DEATH -1533020
@@ -66,7 +65,7 @@ struct TRINITY_DLL_DECL boss_patchwerkAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(rand()%2 ? SAY_AGGRO1 : SAY_AGGRO2, me);
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
events.ScheduleEvent(EVENT_HATEFUL, 1200);
events.ScheduleEvent(EVENT_BERSERK, 360000);
@@ -144,4 +143,3 @@ void AddSC_boss_patchwerk()
newscript->GetAI = &GetAI_boss_patchwerk;
newscript->RegisterSelf();
}

View File

@@ -18,5 +18,18 @@
#ifndef DEF_NAXXRAMAS_H
#define DEF_NAXXRAMAS_H
enum Encounter
{
BOSS_NOTH,
BOSS_HEIGAN,
BOSS_LOATHEB,
};
enum Data
{
DATA_HEIGAN_ERUPT,
};
#endif

View File

@@ -24,9 +24,92 @@ EndScriptData */
#include "precompiled.h"
#include "def_naxxramas.h"
#define SPELL_ERUPTION 29371
const float HeiganPos[2] = {2796, -3707};
const float HeiganEruptionSlope[3] =
{
(-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]),
(-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]),
(-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]),
};
// 0 H O-->x
// 1 |
// 2 V
// 3 y
inline uint32 GetEruptionSection(float x, float y)
{
y -= HeiganPos[1];
if(y < 1.0f)
return 0;
x -= HeiganPos[0];
if(x > -1.0f)
return 3;
float slope = y/x;
for(uint32 i = 0; i < 3; ++i)
if(slope > HeiganEruptionSlope[i])
return i;
return 3;
}
struct TRINITY_DLL_DECL instance_naxxramas : public ScriptedInstance
{
instance_naxxramas(Map *Map) : ScriptedInstance(Map) {Initialize();};
instance_naxxramas(Map *map) : ScriptedInstance(map)
{
SetBossNumber(15);
}
std::set<GameObject*> HeiganEruption[4];
void OnObjectCreate(GameObject* go, bool add)
{
if(go->GetGOInfo()->displayId == 6785 || go->GetGOInfo()->displayId == 1287)
{
uint32 section = GetEruptionSection(go->GetPositionX(), go->GetPositionY());
if(add)
HeiganEruption[section].insert(go);
else
HeiganEruption[section].erase(go);
return;
}
switch(go->GetEntry())
{
case 181200: SetBossRoomDoor(BOSS_NOTH, go, add); break;
case 181201: SetBossPassageDoor(BOSS_NOTH, go, add); break;
case 181202: SetBossRoomDoor(BOSS_HEIGAN, go, add); break;
case 181203: SetBossPassageDoor(BOSS_HEIGAN, go, add); break;
case 181241: SetBossRoomDoor(BOSS_LOATHEB, go, add); break;
}
}
void SetData(uint32 id, uint32 value)
{
switch(id)
{
case DATA_HEIGAN_ERUPT:
HeiganErupt(value);
break;
}
}
void HeiganErupt(uint32 section)
{
for(uint32 i = 0; i < 4; ++i)
{
if(i == section)
continue;
for(std::set<GameObject*>::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr)
{
(*itr)->SendCustomAnim();
(*itr)->CastSpell(NULL, SPELL_ERUPTION);
}
}
}
};
InstanceData* GetInstanceData_instance_naxxramas(Map* map)
@@ -42,4 +125,3 @@ void AddSC_instance_naxxramas()
newscript->GetInstanceData = GetInstanceData_instance_naxxramas;
newscript->RegisterSelf();
}

View File

@@ -1677,13 +1677,19 @@ void AuraEffect::TriggerSpell()
// case 27747: break;
// Frost Blast
case 27808:
{
int32 bpDamage = target->GetMaxHealth()*26/100;
caster->CastCustomSpell(target,29879,&bpDamage,NULL,NULL,true,NULL,this);
caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, target->GetMaxHealth()*0.26f, m_target, true, NULL, this);
return;
}
// // Detonate Mana
// case 27819: break;
// Detonate Mana
case 27819:
{
int32 mana = (uint32)m_target->GetMaxPower(POWER_MANA)*0.25f;
if(mana)
{
mana = m_target->ModifyPower(POWER_MANA, -mana);
m_target->CastCustomSpell(27820, SPELLVALUE_BASE_POINT0, -mana*4, NULL, true, NULL, this, caster->GetGUID());
}
return;
}
// // Controller Timer
// case 28095: break;
// // Stalagg Chain
@@ -2205,6 +2211,9 @@ void AuraEffect::TriggerSpell()
// Mind Sear (target 76/16) if let m_target cast, will damage caster
case 48045:
case 53023:
// Curse of the Plaguebringer (22/15)
case 29213:
case 54835:
caster->CastSpell(m_target, trigger_spell_id, true);
return;
}

View File

@@ -2420,6 +2420,9 @@ void SpellMgr::LoadSpellCustomAttr()
case 45150: // Meteor Slash
mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE;
break;
case 27820:
mSpellCustomAttr[i] |= SPELL_ATTR_CU_EXCLUDE_SELF;
break;
case 44978: case 45001: case 45002: // Wild Magic
case 45004: case 45006: case 45010: // Wild Magic
case 31347: // Doom
@@ -2429,8 +2432,6 @@ void SpellMgr::LoadSpellCustomAttr()
case 45976: // Muru Portal Channel
case 39365: // Thundering Storm
case 41071: // Raise Dead (HACK)
spellInfo->MaxAffectedTargets = 1;
break;
case 28542: // Life Drain - Sapphiron
spellInfo->MaxAffectedTargets = 1;
break;
@@ -2443,6 +2444,7 @@ void SpellMgr::LoadSpellCustomAttr()
case 45248: //Shadow Blades
case 41303: // Soul Drain
case 54172: // Divine Storm (heal)
case 29213: // Curse of the Plaguebringer
spellInfo->MaxAffectedTargets = 3;
break;
case 38310: //Multi-Shot
@@ -2457,11 +2459,12 @@ void SpellMgr::LoadSpellCustomAttr()
case 55665: // Life Drain - Sapphiron
spellInfo->MaxAffectedTargets = 5;
break;
case 40827: //Sinful Beam
case 40859: //Sinister Beam
case 40860: //Vile Beam
case 40861: //Wicked Beam
case 40827: // Sinful Beam
case 40859: // Sinister Beam
case 40860: // Vile Beam
case 40861: // Wicked Beam
case 57669: // Replenishment
case 54835: // Curse of the Plaguebringer
spellInfo->MaxAffectedTargets = 10;
break;
case 8122: case 8124: case 10888: case 10890: // Psychic Scream