Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
This commit is contained in:
commit
2ded11354d
20 files changed
+1287
-95
No files matched your search
@@ -37,6 +37,331 @@ EndContentData */
|
||||
#include "CombatAI.h"
|
||||
#include "Player.h"
|
||||
|
||||
/*#####
|
||||
# npc_commander_eligor_dawnbringer
|
||||
#####*/
|
||||
|
||||
enum CommanderEligorDawnbringer
|
||||
{
|
||||
MODEL_IMAGE_OF_KELTHUZAD = 24787, // Image of Kel'Thuzad
|
||||
MODEL_IMAGE_OF_SAPPHIRON = 24788, // Image of Sapphiron
|
||||
MODEL_IMAGE_OF_RAZUVIOUS = 24799, // Image of Razuvious
|
||||
MODEL_IMAGE_OF_GOTHIK = 24804, // Image of Gothik
|
||||
MODEL_IMAGE_OF_THANE = 24802, // Image of Thane Korth'azz
|
||||
MODEL_IMAGE_OF_BLAUMEUX = 24794, // Image of Lady Blaumeux
|
||||
MODEL_IMAGE_OF_ZELIEK = 24800, // Image of Sir Zeliek
|
||||
MODEL_IMAGE_OF_PATCHWERK = 24798, // Image of Patchwerk
|
||||
MODEL_IMAGE_OF_GROBBULUS = 24792, // Image of Grobbulus
|
||||
MODEL_IMAGE_OF_THADDIUS = 24801, // Image of Thaddius
|
||||
MODEL_IMAGE_OF_GLUTH = 24803, // Image of Gluth
|
||||
MODEL_IMAGE_OF_ANUBREKHAN = 24789, // Image of Anub'rekhan
|
||||
MODEL_IMAGE_OF_FAERLINA = 24790, // Image of Faerlina
|
||||
MODEL_IMAGE_OF_MAEXXNA = 24796, // Image of Maexxna
|
||||
MODEL_IMAGE_OF_NOTH = 24797, // Image of Noth
|
||||
MODEL_IMAGE_OF_HEIGAN = 24793, // Image of Heigan
|
||||
MODEL_IMAGE_OF_LOATHEB = 24795, // Image of Loatheb
|
||||
|
||||
NPC_IMAGE_OF_KELTHUZAD = 27766, // Image of Kel'Thuzad
|
||||
NPC_IMAGE_OF_SAPPHIRON = 27767, // Image of Sapphiron
|
||||
NPC_IMAGE_OF_RAZUVIOUS = 27768, // Image of Razuvious
|
||||
NPC_IMAGE_OF_GOTHIK = 27769, // Image of Gothik
|
||||
NPC_IMAGE_OF_THANE = 27770, // Image of Thane Korth'azz
|
||||
NPC_IMAGE_OF_BLAUMEUX = 27771, // Image of Lady Blaumeux
|
||||
NPC_IMAGE_OF_ZELIEK = 27772, // Image of Sir Zeliek
|
||||
NPC_IMAGE_OF_PATCHWERK = 27773, // Image of Patchwerk
|
||||
NPC_IMAGE_OF_GROBBULUS = 27774, // Image of Grobbulus
|
||||
NPC_IMAGE_OF_THADDIUS = 27775, // Image of Thaddius
|
||||
NPC_IMAGE_OF_GLUTH = 27782, // Image of Gluth
|
||||
NPC_IMAGE_OF_ANUBREKHAN = 27776, // Image of Anub'rekhan
|
||||
NPC_IMAGE_OF_FAERLINA = 27777, // Image of Faerlina
|
||||
NPC_IMAGE_OF_MAEXXNA = 27778, // Image of Maexxna
|
||||
NPC_IMAGE_OF_NOTH = 27779, // Image of Noth
|
||||
NPC_IMAGE_OF_HEIGAN = 27780, // Image of Heigan
|
||||
NPC_IMAGE_OF_LOATHEB = 27781, // Image of Loatheb
|
||||
|
||||
NPC_INFANTRYMAN = 27160, // Add in case I randomize the spawning
|
||||
NPC_SENTINAL = 27162,
|
||||
NPC_BATTLE_MAGE = 27164,
|
||||
|
||||
// Five platforms to choose from
|
||||
SAY_PINNACLE = 0,
|
||||
SAY_DEATH_KNIGHT_WING = 1,
|
||||
SAY_ABOMINATION_WING = 2,
|
||||
SAY_SPIDER_WING = 3,
|
||||
SAY_PLAGUE_WING = 4,
|
||||
// Used in all talks
|
||||
SAY_TALK_COMPLETE = 5,
|
||||
// Pinnacle of Naxxramas
|
||||
SAY_SAPPHIRON = 6,
|
||||
SAY_KELTHUZAD_1 = 7,
|
||||
SAY_KELTHUZAD_2 = 8,
|
||||
SAY_KELTHUZAD_3 = 9,
|
||||
// Death knight wing of Naxxramas
|
||||
SAY_RAZUVIOUS = 10,
|
||||
SAY_GOTHIK = 11,
|
||||
SAY_DEATH_KNIGHTS_1 = 12,
|
||||
SAY_DEATH_KNIGHTS_2 = 13,
|
||||
SAY_DEATH_KNIGHTS_3 = 14,
|
||||
SAY_DEATH_KNIGHTS_4 = 15,
|
||||
// Blighted abomination wing of Naxxramas
|
||||
SAY_PATCHWERK = 16,
|
||||
SAY_GROBBULUS = 17,
|
||||
SAY_GLUTH = 18,
|
||||
SAY_THADDIUS = 19,
|
||||
// Accursed spider wing of Naxxramas
|
||||
SAY_ANUBREKHAN = 20,
|
||||
SAY_FAERLINA = 21,
|
||||
SAY_MAEXXNA = 22,
|
||||
// Dread plague wing of Naxxramas
|
||||
SAY_NOTH = 23,
|
||||
SAY_HEIGAN_1 = 24,
|
||||
SAY_HEIGAN_2 = 25,
|
||||
SAY_LOATHEB = 26,
|
||||
|
||||
SPELL_HEROIC_IMAGE_CHANNEL = 49519,
|
||||
|
||||
EVENT_START_RANDOM = 1,
|
||||
EVENT_MOVE_TO_POINT = 2,
|
||||
EVENT_TALK_COMPLETE = 3,
|
||||
EVENT_GET_TARGETS = 4,
|
||||
EVENT_KELTHUZAD_2 = 5,
|
||||
EVENT_KELTHUZAD_3 = 6,
|
||||
EVENT_DEATH_KNIGHTS_2 = 7,
|
||||
EVENT_DEATH_KNIGHTS_3 = 8,
|
||||
EVENT_DEATH_KNIGHTS_4 = 9,
|
||||
EVENT_HEIGAN_2 = 10
|
||||
};
|
||||
|
||||
uint32 const AudienceMobs[3] = { NPC_INFANTRYMAN, NPC_SENTINAL, NPC_BATTLE_MAGE };
|
||||
|
||||
Position const PosTalkLocations[6] =
|
||||
{
|
||||
{ 3805.453f, -682.9075f, 222.2917f, 2.793398f }, // Pinnacle of Naxxramas
|
||||
{ 3807.508f, -691.0882f, 221.9688f, 2.094395f }, // Death knight wing of Naxxramas
|
||||
{ 3797.228f, -690.3555f, 222.5019f, 1.134464f }, // Blighted abomination wing of Naxxramas
|
||||
{ 3804.038f, -672.3098f, 222.5019f, 4.578917f }, // Accursed spider wing of Naxxramas
|
||||
{ 3815.097f, -680.2596f, 221.9777f, 2.86234f }, // Dread plague wing of Naxxramas
|
||||
{ 3798.05f, -680.611f, 222.9825f, 6.038839f }, // Home
|
||||
};
|
||||
|
||||
class npc_commander_eligor_dawnbringer : public CreatureScript
|
||||
{
|
||||
public: npc_commander_eligor_dawnbringer() : CreatureScript("npc_commander_eligor_dawnbringer") {}
|
||||
|
||||
struct npc_commander_eligor_dawnbringerAI : public ScriptedAI
|
||||
{
|
||||
npc_commander_eligor_dawnbringerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
talkWing = 0;
|
||||
memset(audienceList, 0, sizeof(audienceList));
|
||||
memset(imageList, 0, sizeof(imageList));
|
||||
_events.ScheduleEvent(EVENT_GET_TARGETS, 5000);
|
||||
_events.ScheduleEvent(EVENT_START_RANDOM, 20000);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) OVERRIDE
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE)
|
||||
{
|
||||
if (id == 1)
|
||||
{
|
||||
me->SetFacingTo(PosTalkLocations[talkWing].m_orientation);
|
||||
TurnAudience();
|
||||
|
||||
switch (talkWing)
|
||||
{
|
||||
case 0: // Pinnacle of Naxxramas
|
||||
{
|
||||
switch (urand (0, 1))
|
||||
{
|
||||
case 0: ChangeImage(NPC_IMAGE_OF_KELTHUZAD, MODEL_IMAGE_OF_KELTHUZAD, SAY_KELTHUZAD_1);
|
||||
_events.ScheduleEvent(EVENT_KELTHUZAD_2, 8000); break;
|
||||
case 1: ChangeImage(NPC_IMAGE_OF_SAPPHIRON, MODEL_IMAGE_OF_SAPPHIRON, SAY_SAPPHIRON); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1: // Death knight wing of Naxxramas
|
||||
{
|
||||
switch (urand (0, 2))
|
||||
{
|
||||
case 0: ChangeImage(NPC_IMAGE_OF_RAZUVIOUS, MODEL_IMAGE_OF_RAZUVIOUS, SAY_RAZUVIOUS); break;
|
||||
case 1: ChangeImage(NPC_IMAGE_OF_GOTHIK, MODEL_IMAGE_OF_GOTHIK, SAY_GOTHIK); break;
|
||||
case 2: ChangeImage(NPC_IMAGE_OF_THANE, MODEL_IMAGE_OF_THANE, SAY_DEATH_KNIGHTS_1);
|
||||
_events.ScheduleEvent(EVENT_DEATH_KNIGHTS_2, 10000); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2: // Blighted abomination wing of Naxxramas
|
||||
{
|
||||
switch (urand (0, 3))
|
||||
{
|
||||
case 0: ChangeImage(NPC_IMAGE_OF_PATCHWERK, MODEL_IMAGE_OF_PATCHWERK, SAY_PATCHWERK); break;
|
||||
case 1: ChangeImage(NPC_IMAGE_OF_GROBBULUS, MODEL_IMAGE_OF_GROBBULUS, SAY_GROBBULUS); break;
|
||||
case 2: ChangeImage(NPC_IMAGE_OF_THADDIUS, MODEL_IMAGE_OF_THADDIUS, SAY_THADDIUS); break;
|
||||
case 3: ChangeImage(NPC_IMAGE_OF_GLUTH, MODEL_IMAGE_OF_GLUTH, SAY_GLUTH); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3: // Accursed spider wing of Naxxramas
|
||||
{
|
||||
switch (urand (0, 2))
|
||||
{
|
||||
case 0: ChangeImage(NPC_IMAGE_OF_ANUBREKHAN, MODEL_IMAGE_OF_ANUBREKHAN, SAY_ANUBREKHAN); break;
|
||||
case 1: ChangeImage(NPC_IMAGE_OF_FAERLINA, MODEL_IMAGE_OF_FAERLINA, SAY_FAERLINA); break;
|
||||
case 2: ChangeImage(NPC_IMAGE_OF_MAEXXNA, MODEL_IMAGE_OF_MAEXXNA, SAY_MAEXXNA); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4: // Dread plague wing of Naxxramas
|
||||
{
|
||||
switch (urand (0, 2))
|
||||
{
|
||||
case 0: ChangeImage(NPC_IMAGE_OF_NOTH, MODEL_IMAGE_OF_NOTH, SAY_NOTH); break;
|
||||
case 1: ChangeImage(NPC_IMAGE_OF_HEIGAN, MODEL_IMAGE_OF_HEIGAN, SAY_HEIGAN_1);
|
||||
_events.ScheduleEvent(EVENT_HEIGAN_2, 8000); break;
|
||||
case 2: ChangeImage(NPC_IMAGE_OF_LOATHEB, MODEL_IMAGE_OF_LOATHEB, SAY_LOATHEB); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5: // Home
|
||||
_events.ScheduleEvent(EVENT_START_RANDOM, 30000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StoreTargets()
|
||||
{
|
||||
uint8 creaturecount;
|
||||
|
||||
creaturecount = 0;
|
||||
|
||||
for (uint8 ii = 0; ii < 3; ++ii)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetCreatureListWithEntryInGrid(creatureList, me, AudienceMobs[ii], 15.0f);
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
if (Creature* creatureList = *itr)
|
||||
{
|
||||
audienceList[creaturecount] = creatureList->GetGUID();
|
||||
++creaturecount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_KELTHUZAD, 20.0f, true))
|
||||
imageList[0] = creature->GetGUID();
|
||||
if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_RAZUVIOUS, 20.0f, true))
|
||||
imageList[1] = creature->GetGUID();
|
||||
if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_PATCHWERK, 20.0f, true))
|
||||
imageList[2] = creature->GetGUID();
|
||||
if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_ANUBREKHAN, 20.0f, true))
|
||||
imageList[3] = creature->GetGUID();
|
||||
if (Creature* creature = me->FindNearestCreature(NPC_IMAGE_OF_NOTH, 20.0f, true))
|
||||
imageList[4] = creature->GetGUID();
|
||||
}
|
||||
|
||||
void ChangeImage(uint32 entry, uint32 model, uint8 text)
|
||||
{
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
|
||||
{
|
||||
Talk(text);
|
||||
creature->SetEntry(entry);
|
||||
creature->SetDisplayId(model);
|
||||
creature->CastSpell(creature, SPELL_HEROIC_IMAGE_CHANNEL);
|
||||
_events.ScheduleEvent(EVENT_TALK_COMPLETE, 40000);
|
||||
}
|
||||
}
|
||||
|
||||
void TurnAudience()
|
||||
{
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
{
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, audienceList[i]))
|
||||
creature->SetFacingToObject(me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_START_RANDOM:
|
||||
talkWing = urand (0, 4);
|
||||
Talk(talkWing);
|
||||
_events.ScheduleEvent(EVENT_MOVE_TO_POINT, 8000);
|
||||
break;
|
||||
case EVENT_MOVE_TO_POINT:
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1, PosTalkLocations[talkWing].m_positionX, PosTalkLocations[talkWing].m_positionY, PosTalkLocations[talkWing].m_positionZ);
|
||||
break;
|
||||
case EVENT_TALK_COMPLETE:
|
||||
talkWing = 5;
|
||||
Talk(talkWing);
|
||||
_events.ScheduleEvent(EVENT_MOVE_TO_POINT, 5000);
|
||||
break;
|
||||
case EVENT_GET_TARGETS:
|
||||
StoreTargets();
|
||||
break;
|
||||
case EVENT_KELTHUZAD_2:
|
||||
Talk(SAY_KELTHUZAD_2);
|
||||
_events.ScheduleEvent(EVENT_KELTHUZAD_3, 8000);
|
||||
break;
|
||||
case EVENT_KELTHUZAD_3:
|
||||
Talk(SAY_KELTHUZAD_3);
|
||||
break;
|
||||
case EVENT_DEATH_KNIGHTS_2:
|
||||
Talk(SAY_DEATH_KNIGHTS_2);
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
|
||||
{
|
||||
creature->SetEntry(NPC_IMAGE_OF_BLAUMEUX);
|
||||
creature->SetDisplayId(MODEL_IMAGE_OF_BLAUMEUX);
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_DEATH_KNIGHTS_3, 10000);
|
||||
break;
|
||||
case EVENT_DEATH_KNIGHTS_3:
|
||||
Talk(SAY_DEATH_KNIGHTS_3);
|
||||
if (Creature* creature = ObjectAccessor::GetCreature(*me, imageList[talkWing]))
|
||||
{
|
||||
creature->SetEntry(NPC_IMAGE_OF_ZELIEK);
|
||||
creature->SetDisplayId(MODEL_IMAGE_OF_ZELIEK);
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_DEATH_KNIGHTS_4, 10000);
|
||||
break;
|
||||
case EVENT_DEATH_KNIGHTS_4:
|
||||
Talk(SAY_DEATH_KNIGHTS_4);
|
||||
break;
|
||||
case EVENT_HEIGAN_2:
|
||||
Talk(SAY_HEIGAN_2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
EventMap _events;
|
||||
uint64 audienceList[10];
|
||||
uint64 imageList[5];
|
||||
uint8 talkWing;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_commander_eligor_dawnbringerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum AlexstraszaWrGate
|
||||
{
|
||||
// Quest
|
||||
@@ -405,9 +730,10 @@ class npc_torturer_lecraft : public CreatureScript
|
||||
|
||||
void AddSC_dragonblight()
|
||||
{
|
||||
new npc_alexstrasza_wr_gate;
|
||||
new spell_q12096_q12092_dummy;
|
||||
new spell_q12096_q12092_bark;
|
||||
new npc_wyrmrest_defender;
|
||||
new npc_torturer_lecraft;
|
||||
new npc_commander_eligor_dawnbringer();
|
||||
new npc_alexstrasza_wr_gate();
|
||||
new spell_q12096_q12092_dummy();
|
||||
new spell_q12096_q12092_bark();
|
||||
new npc_wyrmrest_defender();
|
||||
new npc_torturer_lecraft();
|
||||
}
|
||||
Reference in new issue
Block a user