Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/DataStores/DBCEnums.h
	src/server/scripts/Commands/cs_wp.cpp
	src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
This commit is contained in:
Vincent_Michael
2013-12-11 20:34:44 +01:00
31 changed files with 3139 additions and 1933 deletions

View File

@@ -924,7 +924,7 @@ public:
if (!ve)
return false;
Creature* v = new Creature;
Creature* v = new Creature();
Map* map = handler->GetSession()->GetPlayer()->GetMap();

View File

@@ -693,8 +693,13 @@ public:
wpCreature->AddObjectToRemoveList();
}
// re-create
<<<<<<< HEAD
Creature* wpCreature2 = new Creature;
if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
=======
Creature* wpCreature2 = new Creature();
if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
>>>>>>> fb26e1852394a1aa6e7695030eabcf8e85b1c5c8
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -917,8 +922,13 @@ public:
Map* map = chr->GetMap();
float o = chr->GetOrientation();
<<<<<<< HEAD
Creature* wpCreature = new Creature;
if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
=======
Creature* wpCreature = new Creature();
if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
>>>>>>> fb26e1852394a1aa6e7695030eabcf8e85b1c5c8
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
@@ -981,8 +991,13 @@ public:
float o = chr->GetOrientation();
Map* map = chr->GetMap();
<<<<<<< HEAD
Creature* creature = new Creature;
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
=======
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
>>>>>>> fb26e1852394a1aa6e7695030eabcf8e85b1c5c8
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete creature;
@@ -1030,7 +1045,7 @@ public:
Player* chr = handler->GetSession()->GetPlayer();
Map* map = chr->GetMap();
Creature* creature = new Creature;
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);

View File

@@ -69,7 +69,7 @@ public:
DoCast(me, SPELL_ICEARMOR, true);
}
void EnterCombat(Unit* /*who*/)OVERRIDE { }
void EnterCombat(Unit* /*who*/) OVERRIDE { }
void UpdateAI(uint32 diff) OVERRIDE
{

View File

@@ -351,8 +351,7 @@ public:
break;
}
case 6:
me->SetOrientation(me->GetAngle(breathX, breathY));
me->StopMoving();
me->SetFacingTo(me->GetAngle(breathX, breathY));
//DoTextEmote("takes a deep breath.", NULL);
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000);
break;

View File

@@ -125,7 +125,7 @@ public:
break;
case 11:
Talk(SAY_PROGRESS2, player->GetGUID());
me->SetOrientation(4.762841f);
me->SetFacingTo(4.762841f);
break;
case 18:
{
@@ -150,11 +150,11 @@ public:
player->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetOrientation(2.978281f);
me->SetFacingTo(2.978281f);
Talk(SAY_END1, player->GetGUID());
break;
case 33:
me->SetOrientation(5.858011f);
me->SetFacingTo(5.858011f);
Talk(SAY_END2, player->GetGUID());
Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)

View File

@@ -308,18 +308,15 @@ public:
{
if (instance)
{
Unit* pKri = Unit::GetUnit(*me, instance->GetData64(DATA_KRI));
Unit* pVem = Unit::GetUnit(*me, instance->GetData64(DATA_VEM));
switch (urand(0, 2))
{
case 0:
if (pKri)
DoCast(pKri, SPELL_HEAL);
if (Creature* kri = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_KRI)))
DoCast(kri, SPELL_HEAL);
break;
case 1:
if (pVem)
DoCast(pVem, SPELL_HEAL);
if (Creature* vem = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VEM)))
DoCast(vem, SPELL_HEAL);
break;
case 2:
DoCast(me, SPELL_HEAL);

View File

@@ -45,6 +45,7 @@ set(scripts_STAT_SRCS
Northrend/ChamberOfAspects/ObsidianSanctum/instance_obsidian_sanctum.cpp
Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h
Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp
Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp

View File

@@ -19,8 +19,6 @@
#include "InstanceScript.h"
#include "obsidian_sanctum.h"
#define MAX_ENCOUNTER 1
/* Obsidian Sanctum encounters:
0 - Sartharion
*/
@@ -28,48 +26,18 @@
class instance_obsidian_sanctum : public InstanceMapScript
{
public:
instance_obsidian_sanctum() : InstanceMapScript("instance_obsidian_sanctum", 615) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
{
return new instance_obsidian_sanctum_InstanceMapScript(map);
}
instance_obsidian_sanctum() : InstanceMapScript(OSScriptName, 615) { }
struct instance_obsidian_sanctum_InstanceMapScript : public InstanceScript
{
instance_obsidian_sanctum_InstanceMapScript(Map* map) : InstanceScript(map) { }
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint64 m_uiSartharionGUID;
uint64 m_uiTenebronGUID;
uint64 m_uiShadronGUID;
uint64 m_uiVesperonGUID;
bool m_bTenebronKilled;
bool m_bShadronKilled;
bool m_bVesperonKilled;
void Initialize() OVERRIDE
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
m_uiSartharionGUID = 0;
m_uiTenebronGUID = 0;
m_uiShadronGUID = 0;
m_uiVesperonGUID = 0;
m_bTenebronKilled = false;
m_bShadronKilled = false;
m_bVesperonKilled = false;
}
bool IsEncounterInProgress() const OVERRIDE
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
sartharionGUID = 0;
tenebronGUID = 0;
shadronGUID = 0;
vesperonGUID = 0;
}
void OnCreatureCreate(Creature* creature) OVERRIDE
@@ -77,68 +45,113 @@ public:
switch (creature->GetEntry())
{
case NPC_SARTHARION:
m_uiSartharionGUID = creature->GetGUID();
sartharionGUID = creature->GetGUID();
break;
//three dragons below set to active state once created.
//we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
// Three dragons below set to active state once created.
// We must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
case NPC_TENEBRON:
m_uiTenebronGUID = creature->GetGUID();
tenebronGUID = creature->GetGUID();
creature->setActive(true);
break;
case NPC_SHADRON:
m_uiShadronGUID = creature->GetGUID();
shadronGUID = creature->GetGUID();
creature->setActive(true);
break;
case NPC_VESPERON:
m_uiVesperonGUID = creature->GetGUID();
vesperonGUID = creature->GetGUID();
creature->setActive(true);
break;
}
}
void SetData(uint32 uiType, uint32 uiData) OVERRIDE
bool SetBossState(uint32 type, EncounterState state) OVERRIDE
{
if (uiType == TYPE_SARTHARION_EVENT)
m_auiEncounter[0] = uiData;
else if (uiType == TYPE_TENEBRON_PREKILLED)
m_bTenebronKilled = true;
else if (uiType == TYPE_SHADRON_PREKILLED)
m_bShadronKilled = true;
else if (uiType == TYPE_VESPERON_PREKILLED)
m_bVesperonKilled = true;
}
if (!InstanceScript::SetBossState(type, state))
return false;
uint32 GetData(uint32 uiType) const OVERRIDE
{
if (uiType == TYPE_SARTHARION_EVENT)
return m_auiEncounter[0];
else if (uiType == TYPE_TENEBRON_PREKILLED)
return m_bTenebronKilled;
else if (uiType == TYPE_SHADRON_PREKILLED)
return m_bShadronKilled;
else if (uiType == TYPE_VESPERON_PREKILLED)
return m_bVesperonKilled;
return 0;
}
uint64 GetData64(uint32 uiData) const OVERRIDE
{
switch (uiData)
switch (type)
{
case DATA_SARTHARION:
return m_uiSartharionGUID;
case DATA_TENEBRON:
return m_uiTenebronGUID;
case DATA_SHADRON:
return m_uiShadronGUID;
case DATA_VESPERON:
return m_uiVesperonGUID;
break;
default:
break;
}
return true;
}
uint64 GetData64(uint32 Data) const OVERRIDE
{
switch (Data)
{
case DATA_SARTHARION:
return sartharionGUID;
case DATA_TENEBRON:
return tenebronGUID;
case DATA_SHADRON:
return shadronGUID;
case DATA_VESPERON:
return vesperonGUID;
}
return 0;
}
std::string GetSaveData() OVERRIDE
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "O S " << GetBossSaveData();
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
void Load(const char* str) OVERRIDE
{
if (!str)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(str);
char dataHead1, dataHead2;
std::istringstream loadStream(str);
loadStream >> dataHead1 >> dataHead2;
if (dataHead1 == 'O' && dataHead2 == 'S')
{
for (uint32 i = 0; i < EncounterCount; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
}
else
OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
protected:
uint64 sartharionGUID;
uint64 tenebronGUID;
uint64 shadronGUID;
uint64 vesperonGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
{
return new instance_obsidian_sanctum_InstanceMapScript(map);
}
};
void AddSC_instance_obsidian_sanctum()

View File

@@ -18,17 +18,18 @@
#ifndef DEF_OBSIDIAN_SANCTUM_H
#define DEF_OBSIDIAN_SANCTUM_H
#define OSScriptName "instance_obsidian_sanctum"
uint32 const EncounterCount = 5;
enum DataTypes
{
TYPE_SARTHARION_EVENT = 1,
TYPE_TENEBRON_PREKILLED = 2,
TYPE_SHADRON_PREKILLED = 3,
TYPE_VESPERON_PREKILLED = 4,
DATA_SARTHARION = 10,
DATA_TENEBRON = 11,
DATA_SHADRON = 12,
DATA_VESPERON = 13
DATA_SARTHARION = 0,
DATA_TENEBRON = 1,
DATA_SHADRON = 2,
DATA_VESPERON = 3,
DATA_PORTAL_OPEN = 4,
TWILIGHT_ACHIEVEMENTS = 5
};
enum CreaturesIds

View File

@@ -81,15 +81,40 @@ enum Creatures
NPC_SCOURGE_HULK = 26555
};
enum SvalaPhase
enum Phases
{
IDLE,
IDLE = 1,
INTRO,
NORMAL,
SACRIFICING,
SVALADEAD
};
enum Events
{
//INTRO
EVENT_INTRO_SVALA_TALK_0 = 1,
EVENT_INTRO_ARTHAS_TALK_0,
EVENT_INTRO_TRANSFORM_0,
EVENT_INTRO_TRANSFORM_1,
EVENT_INTRO_TRANSFORM_2,
EVENT_INTRO_SVALA_TALK_1,
EVENT_INTRO_ARTHAS_TALK_1,
EVENT_INTRO_SVALA_TALK_2,
EVENT_INTRO_RELOCATE_SVALA,
EVENT_INTRO_DESPAWN_ARTHAS,
//NORMAL
EVENT_SINISTER_STRIKE,
EVENT_CALL_FLAMES,
EVENT_RITUAL_PREPARATION,
//SACRIFICING
EVENT_SPAWN_RITUAL_CHANNELERS,
EVENT_RITUAL_STRIKE,
EVENT_RITUAL_DISARM
};
enum Misc
{
DATA_INCREDIBLE_HULK = 2043
@@ -112,38 +137,23 @@ class boss_svala : public CreatureScript
{
boss_svalaAI(Creature* creature) : BossAI(creature, DATA_SVALA_SORROWGRAVE)
{
Phase = IDLE;
_introCompleted = false;
}
SvalaPhase Phase;
uint32 introTimer;
uint8 introPhase;
uint8 sacrePhase;
uint64 arthasGUID;
uint32 sinsterStrikeTimer;
uint32 callFlamesTimer;
uint32 sacrificeTimer;
bool sacrificed;
void Reset() OVERRIDE
{
_Reset();
sacrificed = false;
_sacrificed = false;
SetCombatMovement(true);
if (Phase > NORMAL)
Phase = NORMAL;
if (_introCompleted)
events.SetPhase(NORMAL);
else
events.SetPhase(IDLE);
me->SetDisableGravity(Phase == NORMAL);
me->SetDisableGravity(events.IsInPhase(NORMAL));
introTimer = 1 * IN_MILLISECONDS;
introPhase = 0;
sacrePhase = 0;
arthasGUID = 0;
_arthasGUID = 0;
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
}
@@ -152,16 +162,12 @@ class boss_svala : public CreatureScript
{
_EnterCombat();
Talk(SAY_AGGRO);
sinsterStrikeTimer = 7 * IN_MILLISECONDS;
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
}
void JustSummoned(Creature* summon) OVERRIDE
{
if (summon->GetEntry() == NPC_RITUAL_CHANNELER)
summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
summons.Summon(summon);
}
@@ -170,9 +176,9 @@ class boss_svala : public CreatureScript
if (!who)
return;
if (Phase == IDLE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
if (events.IsInPhase(IDLE) && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
{
Phase = INTRO;
events.SetPhase(INTRO);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
@@ -181,8 +187,9 @@ class boss_svala : public CreatureScript
if (Creature* arthas = me->SummonCreature(NPC_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
{
arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
arthasGUID = arthas->GetGUID();
_arthasGUID = arthas->GetGUID();
}
events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_0, 1 * IN_MILLISECONDS, 0, INTRO);
}
}
@@ -194,20 +201,20 @@ class boss_svala : public CreatureScript
void JustDied(Unit* /*killer*/) OVERRIDE
{
if (Phase == SACRIFICING)
if (events.IsInPhase(SACRIFICING))
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
_JustDied();
Talk(SAY_DEATH);
}
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) OVERRIDE
{
if (spellInfo->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
if (spellInfo->Id == SPELL_RITUAL_STRIKE_EFF_1 && !events.IsInPhase(NORMAL) && !events.IsInPhase(SVALADEAD))
{
Phase = NORMAL;
events.SetPhase(NORMAL);
events.ScheduleEvent(EVENT_SINISTER_STRIKE, 7 * IN_MILLISECONDS, 0, NORMAL);
events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
SetCombatMovement(true);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
@@ -217,199 +224,163 @@ class boss_svala : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
if (Phase == IDLE)
if (events.IsInPhase(IDLE))
return;
if (Phase == INTRO)
if (events.IsInPhase(NORMAL) && !UpdateVictim())
return;
events.Update(diff);
if (!_sacrificed && HealthBelowPct(50))
{
if (introTimer <= diff)
{
Creature* arthas = ObjectAccessor::GetCreature(*me, arthasGUID);
if (!arthas)
return;
switch (introPhase)
{
case 0:
Talk(SAY_SVALA_INTRO_0);
++introPhase;
introTimer = 8100;
break;
case 1:
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
++introPhase;
introTimer = 10000;
break;
case 2:
{
arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
Position pos;
pos.Relocate(me);
pos.m_positionZ += 8.0f;
me->GetMotionMaster()->MoveTakeoff(0, pos);
// spectators flee event
std::list<Creature*> lspectatorList;
GetCreatureListWithEntryInGrid(lspectatorList, me, NPC_SPECTATOR, 100.0f);
for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
{
if ((*itr)->IsAlive())
{
(*itr)->SetStandState(UNIT_STAND_STATE_STAND);
(*itr)->SetWalk(false);
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0]);
}
}
++introPhase;
introTimer = 4200;
break;
}
case 3:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
++introPhase;
introTimer = 6200;
break;
case 4:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
arthas->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
me->SetFacingToObject(arthas);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
++introPhase;
introTimer = 3200;
break;
case 5:
Talk(SAY_SVALA_INTRO_1);
++introPhase;
introTimer = 10000;
break;
case 6:
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
++introPhase;
introTimer = 7200;
break;
case 7:
Talk(SAY_SVALA_INTRO_2);
me->SetFacingTo(1.58f);
arthas->SetVisible(false);
++introPhase;
introTimer = 13800;
break;
case 8:
{
Position pos;
pos.Relocate(me);
pos.m_positionX = me->GetHomePosition().GetPositionX();
pos.m_positionY = me->GetHomePosition().GetPositionY();
pos.m_positionZ = 90.6065f;
me->GetMotionMaster()->MoveLand(0, pos);
me->SetDisableGravity(false, true);
me->SetHover(true);
++introPhase;
introTimer = 3000;
break;
}
case 9:
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
mirror->SetGoState(GO_STATE_ACTIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
arthas->DespawnOrUnsummon();
arthasGUID = 0;
Phase = NORMAL;
break;
}
}
else
introTimer -= diff;
return;
_sacrificed = true;
events.SetPhase(SACRIFICING);
events.ScheduleEvent(EVENT_RITUAL_PREPARATION, 0, 0, SACRIFICING);
}
if (Phase == NORMAL)
if (events.IsInPhase(NORMAL))
DoMeleeAttackIfReady();
while (uint32 eventId = events.ExecuteEvent())
{
if (!UpdateVictim())
return;
if (sinsterStrikeTimer <= diff)
switch (eventId)
{
DoCastVictim(SPELL_SINSTER_STRIKE);
sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
}
else
sinsterStrikeTimer -= diff;
if (callFlamesTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
case EVENT_INTRO_SVALA_TALK_0:
Talk(SAY_SVALA_INTRO_0);
events.ScheduleEvent(EVENT_INTRO_ARTHAS_TALK_0, 8.1 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_ARTHAS_TALK_0:
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
events.ScheduleEvent(EVENT_INTRO_TRANSFORM_0, 10 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_TRANSFORM_0:
{
DoCast(target, SPELL_CALL_FLAMES);
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
Position pos;
pos.Relocate(me);
pos.m_positionZ += 8.0f;
me->GetMotionMaster()->MoveTakeoff(0, pos);
// spectators flee event
std::list<Creature*> lspectatorList;
GetCreatureListWithEntryInGrid(lspectatorList, me, NPC_SPECTATOR, 100.0f);
for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
{
if ((*itr)->IsAlive())
{
(*itr)->SetStandState(UNIT_STAND_STATE_STAND);
(*itr)->SetWalk(false);
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0]);
}
}
events.ScheduleEvent(EVENT_INTRO_TRANSFORM_1, 4.2 * IN_MILLISECONDS, 0, INTRO);
break;
}
}
else
callFlamesTimer -= diff;
if (!sacrificed)
{
if (HealthBelowPct(50))
case EVENT_INTRO_TRANSFORM_1:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
events.ScheduleEvent(EVENT_INTRO_TRANSFORM_2, 6.2 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_TRANSFORM_2:
me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
{
arthas->InterruptNonMeleeSpells(true);
me->SetFacingToObject(arthas);
}
me->RemoveAllAuras();
me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_1, 10 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_SVALA_TALK_1:
Talk(SAY_SVALA_INTRO_1);
events.ScheduleEvent(EVENT_INTRO_ARTHAS_TALK_1, 3.2 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_ARTHAS_TALK_1:
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
events.ScheduleEvent(EVENT_INTRO_SVALA_TALK_2, 7.2 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_SVALA_TALK_2:
Talk(SAY_SVALA_INTRO_2);
me->SetFacingTo(1.58f);
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->SetVisible(false);
events.ScheduleEvent(EVENT_INTRO_RELOCATE_SVALA, 13.8 * IN_MILLISECONDS, 0, INTRO);
break;
case EVENT_INTRO_RELOCATE_SVALA:
{
Position pos;
pos.Relocate(me);
pos.m_positionX = me->GetHomePosition().GetPositionX();
pos.m_positionY = me->GetHomePosition().GetPositionY();
pos.m_positionZ = 90.6065f;
me->GetMotionMaster()->MoveLand(0, pos);
me->SetDisableGravity(false, true);
me->SetHover(true);
events.ScheduleEvent(EVENT_INTRO_DESPAWN_ARTHAS, 3 * IN_MILLISECONDS, 0, INTRO);
break;
}
case EVENT_INTRO_DESPAWN_ARTHAS:
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
mirror->SetGoState(GO_STATE_ACTIVE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID))
arthas->DespawnOrUnsummon();
_arthasGUID = 0;
events.SetPhase(NORMAL);
_introCompleted = true;
events.ScheduleEvent(EVENT_SINISTER_STRIKE, 7 * IN_MILLISECONDS, 0, NORMAL);
events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
break;
case EVENT_SINISTER_STRIKE:
DoCastVictim(SPELL_SINSTER_STRIKE);
events.ScheduleEvent(EVENT_SINISTER_STRIKE, urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS), 0, NORMAL);
break;
case EVENT_CALL_FLAMES:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
DoCast(target, SPELL_CALL_FLAMES);
events.ScheduleEvent(EVENT_CALL_FLAMES, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS), 0, NORMAL);
break;
case EVENT_RITUAL_PREPARATION:
if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
{
instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
Talk(SAY_SACRIFICE_PLAYER);
DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
SetCombatMovement(false);
Phase = SACRIFICING;
sacrePhase = 0;
sacrificeTimer = 1 * IN_MILLISECONDS;
DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
sacrificed = true;
}
}
events.ScheduleEvent(EVENT_SPAWN_RITUAL_CHANNELERS, 1 * IN_MILLISECONDS, 0, SACRIFICING);
break;
case EVENT_SPAWN_RITUAL_CHANNELERS:
DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
events.ScheduleEvent(EVENT_RITUAL_STRIKE, 2 * IN_MILLISECONDS, 0, SACRIFICING);
break;
case EVENT_RITUAL_STRIKE:
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
events.ScheduleEvent(EVENT_RITUAL_DISARM, 200, 0, SACRIFICING);
break;
case EVENT_RITUAL_DISARM:
DoCast(me, SPELL_RITUAL_DISARM);
break;
default:
break;
}
DoMeleeAttackIfReady();
}
else // SACRIFICING
{
if (sacrificeTimer <= diff)
{
switch (sacrePhase)
{
case 0:
// spawn ritual channelers
DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
++sacrePhase;
sacrificeTimer = 2 * IN_MILLISECONDS;
break;
case 1:
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
++sacrePhase;
sacrificeTimer = 200;
break;
case 2:
DoCast(me, SPELL_RITUAL_DISARM);
++sacrePhase;
break;
case 3:
break;
}
}
else
sacrificeTimer -= diff;
}
}
private:
uint64 _arthasGUID;
bool _sacrificed;
bool _introCompleted;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE

View File

@@ -452,14 +452,14 @@ enum BrannBronzebeard
EVENT_SCRIPT_13 = 13
};
class npc_brann_bronzebeard : public CreatureScript
class npc_brann_bronzebeard_keystone : public CreatureScript
{
public:
npc_brann_bronzebeard() : CreatureScript("npc_brann_bronzebeard") { }
npc_brann_bronzebeard_keystone() : CreatureScript("npc_brann_bronzebeard_keystone") { }
struct npc_brann_bronzebeardAI : public ScriptedAI
struct npc_brann_bronzebeard_keystoneAI : public ScriptedAI
{
npc_brann_bronzebeardAI(Creature* creature) : ScriptedAI(creature) { }
npc_brann_bronzebeard_keystoneAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() OVERRIDE
{
@@ -583,7 +583,7 @@ public:
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_brann_bronzebeardAI(creature);
return new npc_brann_bronzebeard_keystoneAI(creature);
}
};
@@ -642,6 +642,10 @@ enum JokkumScriptcast
{
SPELL_JOKKUM_KILL_CREDIT = 56545,
SPELL_JOKKUM_SUMMON = 56541,
SPELL_RIDE_JOKKUM = 56606,
NPC_KINGJOKKUM = 30331,
SAY_HOLD_ON = 0,
PATH_JOKKUM = 2072200
};
class spell_jokkum_scriptcast : public SpellScriptLoader
@@ -665,6 +669,17 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
{
player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
if (Creature* kingjokkum = GetClosestCreatureWithEntry(player, NPC_KINGJOKKUM, 10.0f))
{
kingjokkum->setFaction(player->getFaction());
player->CastSpell(kingjokkum, SPELL_RIDE_JOKKUM, true);
player->SetUInt64Value(PLAYER_FARSIGHT, player->GetGUID());
kingjokkum->AI()->Talk(0, player->GetGUID());
kingjokkum->ToPlayer()->SetClientControl(kingjokkum, 1);
kingjokkum->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
kingjokkum->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
}
}
@@ -688,7 +703,7 @@ void AddSC_storm_peaks()
new npc_freed_protodrake();
new npc_icefang();
new npc_hyldsmeet_protodrake();
new npc_brann_bronzebeard();
new npc_brann_bronzebeard_keystone();
new spell_close_rift();
new spell_jokkum_scriptcast();
}

View File

@@ -400,7 +400,7 @@ public:
struct npc_commander_dawnforgeAI : public ScriptedAI
{
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { }
uint64 PlayerGUID;
uint64 ardonisGUID;
@@ -411,9 +411,6 @@ public:
uint32 Phase_Timer;
bool isEvent;
float angle_dawnforge;
float angle_ardonis;
void Reset() OVERRIDE
{
PlayerGUID = 0;
@@ -438,21 +435,15 @@ public:
{
Creature* ardonis = ObjectAccessor::GetCreature(*me, ardonisGUID);
Creature* pathaleon = ObjectAccessor::GetCreature(*me, pathaleonGUID);
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
if (!ardonis || !pathaleon || !player)
if (!ardonis || !pathaleon)
return;
//Calculate the angle to Pathaleon
angle_dawnforge = me->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
angle_ardonis = ardonis->GetAngle(pathaleon->GetPositionX(), pathaleon->GetPositionY());
// Turn Dawnforge
me->SetFacingToObject(pathaleon);
//Turn Dawnforge and update
me->SetOrientation(angle_dawnforge);
me->SendUpdateToPlayer(player);
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
ardonis->SendUpdateToPlayer(player);
// Turn Ardonis
ardonis->SetFacingToObject(pathaleon);
//Set them to kneel
me->SetStandState(UNIT_STAND_STATE_KNEEL);
@@ -464,20 +455,11 @@ public:
{
if (Unit* ardonis = ObjectAccessor::GetUnit(*me, ardonisGUID))
{
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
// Turn Dawnforge
me->SetFacingToObject(ardonis);
if (!player)
return;
angle_dawnforge = me->GetAngle(ardonis->GetPositionX(), ardonis->GetPositionY());
angle_ardonis = ardonis->GetAngle(me->GetPositionX(), me->GetPositionY());
//Turn Dawnforge and update
me->SetOrientation(angle_dawnforge);
me->SendUpdateToPlayer(player);
//Turn Ardonis and update
ardonis->SetOrientation(angle_ardonis);
ardonis->SendUpdateToPlayer(player);
// Turn Ardonis
ardonis->SetFacingToObject(me);
//Set state
me->SetStandState(UNIT_STAND_STATE_STAND);