Merge pull request #2908 from Drethek/TwinsValk

Scripts:
Twins Valk - Cleanup / Remove Hardcoded Bullet Spawn (Need DB Support - Stalkers Spawns)
Acidmaw - Use Correct Submerge Spell
Trial Of Crusader - Correct Coordinate Spawn
Trial Of Crusader - Correct Open/Close Main Door Timer
Trial Of Crusader - Open/Close On Boss EnterEvadeMode
This commit is contained in:
QAston
2011-09-21 00:27:20 -07:00
6 changed files with 262 additions and 169 deletions
@@ -0,0 +1,6 @@
UPDATE `creature_template` SET `scriptname`='mob_bullet_controller' WHERE `entry` = 34743;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `ConditionTypeOrReference` = 18 AND `SourceEntry` IN (66152,66153);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 0, 66152, 0, 18, 1, 34720, 1, 0, '', 'Light Bullets Stalker - Light Orb Spawn'),
(13, 0, 66153, 0, 18, 1, 34704, 1, 0, '', 'Dark Bullets Stalker - Dark Orb Spawn');
@@ -5623,6 +5623,13 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
case SPELLFAMILY_GENERIC: case SPELLFAMILY_GENERIC:
switch (GetId()) switch (GetId())
{ {
case 66149: // Bullet Controller Periodic - 10 Man
case 68396: // Bullet Controller Periodic - 25 Man
{
caster->CastCustomSpell(66152, SPELLVALUE_MAX_TARGETS, urand(1,6), target, true);
caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1,6), target, true);
break;
}
case 54798: // FLAMING Arrow Triggered Effect case 54798: // FLAMING Arrow Triggered Effect
{ {
if (!caster || !target || !target->ToCreature() || !caster->GetVehicle() || target->HasAura(54683)) if (!caster || !target || !target->ToCreature() || !caster->GetVehicle() || target->HasAura(54683))
@@ -95,7 +95,7 @@ enum BossSpells
SPELL_BURNING_SPRAY = 66902, SPELL_BURNING_SPRAY = 66902,
SPELL_SWEEP_1 = 67646, SPELL_SWEEP_1 = 67646,
SPELL_EMERGE_0 = 66947, SPELL_EMERGE_0 = 66947,
SPELL_SUBMERGE_0 = 53421, SPELL_SUBMERGE_0 = 66948,
SPELL_ENRAGE = 68335, SPELL_ENRAGE = 68335,
SPELL_SLIME_POOL_EFFECT = 66882, //In 60s it diameter grows from 10y to 40y (r=r+0.25 per second) SPELL_SLIME_POOL_EFFECT = 66882, //In 60s it diameter grows from 10y to 40y (r=r+0.25 per second)
@@ -149,6 +149,27 @@ public:
Summons.DespawnAll(); Summons.DespawnAll();
} }
void EnterEvadeMode()
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
ScriptedAI::EnterEvadeMode();
}
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
switch (uiId)
{
case 0:
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
}
}
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
{ {
if (m_pInstance) if (m_pInstance)
@@ -158,7 +179,10 @@ public:
void JustReachedHome() void JustReachedHome()
{ {
if (m_pInstance) if (m_pInstance)
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL); m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
}
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
@@ -265,6 +289,12 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
} }
void EnterEvadeMode()
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
ScriptedAI::EnterEvadeMode();
}
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
m_uiTargetGUID = who->GetGUID(); m_uiTargetGUID = who->GetGUID();
@@ -397,7 +427,9 @@ struct boss_jormungarAI : public ScriptedAI
void JustReachedHome() void JustReachedHome()
{ {
if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) != FAIL) if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) != FAIL)
{
instanceScript->SetData(TYPE_NORTHREND_BEASTS, FAIL); instanceScript->SetData(TYPE_NORTHREND_BEASTS, FAIL);
}
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
@@ -608,7 +640,12 @@ public:
struct boss_dreadscaleAI : public boss_jormungarAI struct boss_dreadscaleAI : public boss_jormungarAI
{ {
boss_dreadscaleAI(Creature* creature) : boss_jormungarAI(creature) { } boss_dreadscaleAI(Creature* creature) : boss_jormungarAI(creature)
{
instanceScript = creature->GetInstanceScript();
}
InstanceScript* instanceScript;
void Reset() void Reset()
{ {
@@ -624,6 +661,42 @@ public:
submergeTimer = 45 * IN_MILLISECONDS; submergeTimer = 45 * IN_MILLISECONDS;
stage = 0; stage = 0;
} }
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
switch (uiId)
{
case 0:
instanceScript->DoUseDoorOrButton(instanceScript->GetData64(GO_MAIN_GATE_DOOR));
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
if (Creature* otherWorm = Unit::GetCreature(*me, instanceScript->GetData64(otherWormEntry)))
{
otherWorm->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
otherWorm->SetReactState(REACT_AGGRESSIVE);
otherWorm->SetVisible(true);
otherWorm->SetInCombatWithZone();
}
break;
}
}
void EnterEvadeMode()
{
instanceScript->DoUseDoorOrButton(instanceScript->GetData64(GO_MAIN_GATE_DOOR));
boss_jormungarAI::EnterEvadeMode();
}
void JustReachedHome()
{
if (instanceScript)
instanceScript->DoUseDoorOrButton(instanceScript->GetData64(GO_MAIN_GATE_DOOR));
boss_jormungarAI::JustReachedHome();
}
}; };
CreatureAI* GetAI(Creature* creature) const CreatureAI* GetAI(Creature* creature) const
@@ -746,13 +819,28 @@ public:
case 1: // Finish trample case 1: // Finish trample
m_bMovementFinish = true; m_bMovementFinish = true;
break; break;
case 2:
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
break;
} }
} }
void EnterEvadeMode()
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
ScriptedAI::EnterEvadeMode();
}
void JustReachedHome() void JustReachedHome()
{ {
if (m_pInstance) if (m_pInstance)
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL); m_pInstance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
}
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
@@ -53,50 +53,39 @@ enum Equipment
enum Summons enum Summons
{ {
NPC_UNLEASHED_DARK = 34628, NPC_BULLET_CONTROLLER = 34743,
NPC_UNLEASHED_LIGHT = 34630,
// Future Development NPC_BULLET_DARK = 34628,
NPC_BULLET_CONTROLLER = 34743, // Npc controller for all bullets NPC_BULLET_LIGHT = 34630,
NPC_BULLET_STALKER_DARK = 34704, // Npc spawner for dark bullets
NPC_BULLET_STALKER_LIGHT = 34720, // Npc spawner for light bullets
}; };
enum BossSpells enum BossSpells
{ {
SPELL_CONTROLLER_PERIODIC = 66149, // Future Development
SPELL_LIGHT_TWIN_SPIKE = 66075, SPELL_LIGHT_TWIN_SPIKE = 66075,
SPELL_LIGHT_SURGE = 65766, SPELL_LIGHT_SURGE = 65766,
SPELL_LIGHT_SHIELD = 65858, SPELL_LIGHT_SHIELD = 65858,
SPELL_LIGHT_TWIN_PACT = 65876, SPELL_LIGHT_TWIN_PACT = 65876,
SPELL_LIGHT_VORTEX = 66046, SPELL_LIGHT_VORTEX = 66046,
SPELL_LIGHT_TOUCH = 67297, SPELL_LIGHT_TOUCH = 67297,
SPELL_LIGHT_ESSENCE = 65686,
SPELL_EMPOWERED_LIGHT = 65748,
SPELL_TWIN_EMPATHY_LIGHT = 66133,
SPELL_UNLEASHED_LIGHT = 65795,
SPELL_DARK_TWIN_SPIKE = 66069, SPELL_DARK_TWIN_SPIKE = 66069,
SPELL_DARK_SURGE = 65768, SPELL_DARK_SURGE = 65768,
SPELL_DARK_SHIELD = 65874, SPELL_DARK_SHIELD = 65874,
SPELL_DARK_TWIN_PACT = 65875, SPELL_DARK_TWIN_PACT = 65875,
SPELL_POWER_TWINS = 65879,
SPELL_DARK_VORTEX = 66058, SPELL_DARK_VORTEX = 66058,
SPELL_DARK_TOUCH = 67282, SPELL_DARK_TOUCH = 67282,
SPELL_TWIN_POWER = 65916,
SPELL_LIGHT_ESSENCE = 65686,
SPELL_DARK_ESSENCE = 65684, SPELL_DARK_ESSENCE = 65684,
SPELL_BERSERK = 64238,
SPELL_NONE = 0,
SPELL_EMPOWERED_DARK = 65724, SPELL_EMPOWERED_DARK = 65724,
SPELL_EMPOWERED_LIGHT = 65748, SPELL_TWIN_EMPATHY_DARK = 66132,
SPELL_UNLEASHED_DARK = 65808,
SPELL_UNLEASHED_DARK = 65808,
SPELL_UNLEASHED_LIGHT = 65795, SPELL_CONTROLLER_PERIODIC = 66149,
SPELL_POWER_TWINS = 65879,
SPELL_TWIN_EMPATHY_1 = 66132, SPELL_BERSERK = 64238,
SPELL_TWIN_EMPATHY_2 = 66133,
SPELL_POWERING_UP = 67590, SPELL_POWERING_UP = 67590,
SPELL_SURGE_OF_SPEED = 65828, SPELL_SURGE_OF_SPEED = 65828,
}; };
@@ -104,10 +93,10 @@ enum BossSpells
#define SPELL_DARK_ESSENCE_HELPER RAID_MODE<uint32>(65684, 67176, 67177, 67178) #define SPELL_DARK_ESSENCE_HELPER RAID_MODE<uint32>(65684, 67176, 67177, 67178)
#define SPELL_LIGHT_ESSENCE_HELPER RAID_MODE<uint32>(65686, 67222, 67223, 67224) #define SPELL_LIGHT_ESSENCE_HELPER RAID_MODE<uint32>(65686, 67222, 67223, 67224)
#define SPELL_POWERING_UP_HELPER RAID_MODE(67590, 67602, 67603, 67604) #define SPELL_POWERING_UP_HELPER RAID_MODE<uint32>(67590, 67602, 67603, 67604)
#define SPELL_EMPOWERED_DARK_HELPER RAID_MODE<uint32>(65724,67213,67214,67215) #define SPELL_UNLEASHED_DARK_HELPER RAID_MODE<uint32>(65808, 67172, 67173, 67174)
#define SPELL_EMPOWERED_LIGHT_HELPER RAID_MODE<uint32>(65748, 67216, 67217, 67218) #define SPELL_UNLEASHED_LIGHT_HELPER RAID_MODE<uint32>(65795, 67238, 67239, 67240)
enum Actions enum Actions
{ {
@@ -119,6 +108,37 @@ enum Actions
## boss_twin_base ## boss_twin_base
######*/ ######*/
class OrbsDespawner : public BasicEvent
{
public:
explicit OrbsDespawner(Creature* creature) : _creature(creature)
{
}
bool Execute(uint64 /*currTime*/, uint32 /*diff*/)
{
Trinity::CreatureWorker<OrbsDespawner> worker(_creature, *this);
_creature->VisitNearbyGridObject(5000.0f, worker);
return true;
}
void operator()(Creature* creature) const
{
switch (creature->GetEntry())
{
case NPC_BULLET_DARK:
case NPC_BULLET_LIGHT:
creature->DespawnOrUnsummon();
return;
default:
return;
}
}
private:
Creature* _creature;
};
struct boss_twin_baseAI : public ScriptedAI struct boss_twin_baseAI : public ScriptedAI
{ {
boss_twin_baseAI(Creature* creature) : ScriptedAI(creature), Summons(me) boss_twin_baseAI(Creature* creature) : ScriptedAI(creature), Summons(me)
@@ -133,9 +153,7 @@ struct boss_twin_baseAI : public ScriptedAI
uint8 m_uiStage; uint8 m_uiStage;
bool m_bIsBerserk; bool m_bIsBerserk;
uint8 m_uiWaveCount;
uint32 m_uiWeapon; uint32 m_uiWeapon;
uint32 m_uiColorballsTimer;
uint32 m_uiSpecialAbilityTimer; uint32 m_uiSpecialAbilityTimer;
uint32 m_uiSpikeTimer; uint32 m_uiSpikeTimer;
uint32 m_uiTouchTimer; uint32 m_uiTouchTimer;
@@ -144,12 +162,8 @@ struct boss_twin_baseAI : public ScriptedAI
int32 m_uiVortexSay; int32 m_uiVortexSay;
int32 m_uiVortexEmote; int32 m_uiVortexEmote;
uint32 m_uiSisterNpcId; uint32 m_uiSisterNpcId;
uint32 m_uiColorballNpcId;
uint32 m_uiMyEmphatySpellId; uint32 m_uiMyEmphatySpellId;
uint32 m_uiEssenceNpcId;
uint32 m_uiMyEssenceSpellId;
uint32 m_uiOtherEssenceSpellId; uint32 m_uiOtherEssenceSpellId;
uint32 m_uiEmpoweredWeaknessSpellId;
uint32 m_uiSurgeSpellId; uint32 m_uiSurgeSpellId;
uint32 m_uiVortexSpellId; uint32 m_uiVortexSpellId;
uint32 m_uiShieldSpellId; uint32 m_uiShieldSpellId;
@@ -157,9 +171,6 @@ struct boss_twin_baseAI : public ScriptedAI
uint32 m_uiSpikeSpellId; uint32 m_uiSpikeSpellId;
uint32 m_uiTouchSpellId; uint32 m_uiTouchSpellId;
Position HomeLocation;
Position EssenceLocation[2];
void Reset() { void Reset() {
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE); me->SetReactState(REACT_PASSIVE);
@@ -169,8 +180,6 @@ struct boss_twin_baseAI : public ScriptedAI
me->SetFlying(true); */ me->SetFlying(true); */
m_bIsBerserk = false; m_bIsBerserk = false;
m_uiWaveCount = 1;
m_uiColorballsTimer = 15*IN_MILLISECONDS;
m_uiSpecialAbilityTimer = MINUTE*IN_MILLISECONDS; m_uiSpecialAbilityTimer = MINUTE*IN_MILLISECONDS;
m_uiSpikeTimer = 20*IN_MILLISECONDS; m_uiSpikeTimer = 20*IN_MILLISECONDS;
m_uiTouchTimer = urand(10, 15)*IN_MILLISECONDS; m_uiTouchTimer = urand(10, 15)*IN_MILLISECONDS;
@@ -182,9 +191,9 @@ struct boss_twin_baseAI : public ScriptedAI
void JustReachedHome() void JustReachedHome()
{ {
if (m_pInstance) if (m_pInstance)
{
m_pInstance->SetData(TYPE_VALKIRIES, FAIL); m_pInstance->SetData(TYPE_VALKIRIES, FAIL);
}
Summons.DespawnAll();
me->DespawnOrUnsummon(); me->DespawnOrUnsummon();
} }
@@ -194,11 +203,8 @@ struct boss_twin_baseAI : public ScriptedAI
switch (uiId) switch (uiId)
{ {
case 0:
me->GetMotionMaster()->MovePoint(1, HomeLocation.GetPositionX(), HomeLocation.GetPositionY(), HomeLocation.GetPositionZ());
me->SetHomePosition(HomeLocation);
break;
case 1: case 1:
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
break; break;
@@ -217,13 +223,6 @@ struct boss_twin_baseAI : public ScriptedAI
void JustSummoned(Creature* summoned) void JustSummoned(Creature* summoned)
{ {
switch (summoned->GetEntry())
{
case NPC_UNLEASHED_DARK:
case NPC_UNLEASHED_LIGHT:
summoned->SetCorpseDelay(0);
break;
}
Summons.Summon(summoned); Summons.Summon(summoned);
} }
@@ -239,25 +238,13 @@ struct boss_twin_baseAI : public ScriptedAI
m_pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER); m_pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER);
m_pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); m_pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER);
break; break;
case NPC_BULLET_CONTROLLER:
me->m_Events.AddEvent(new OrbsDespawner(me), me->m_Events.CalculateTime(100));
break;
} }
Summons.Despawn(summoned); Summons.Despawn(summoned);
} }
void SummonColorballs(uint8 quantity)
{
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
float y = y0;
for (uint8 i = 0; i < quantity; i++)
{
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
if (urand(0, 1))
y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));
else
y = y0 - sqrt(pow(r, 2) - pow((x-x0), 2));
me->SummonCreature(m_uiColorballNpcId, x, y, me->GetPositionZ(), TEMPSUMMON_CORPSE_DESPAWN);
}
}
void JustDied(Unit* /*killer*/) void JustDied(Unit* /*killer*/)
{ {
DoScriptText(SAY_DEATH, me); DoScriptText(SAY_DEATH, me);
@@ -267,10 +254,17 @@ struct boss_twin_baseAI : public ScriptedAI
{ {
if (!pSister->isAlive()) if (!pSister->isAlive())
{ {
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pSister->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
m_pInstance->SetData(TYPE_VALKIRIES, DONE); m_pInstance->SetData(TYPE_VALKIRIES, DONE);
Summons.DespawnAll(); Summons.DespawnAll();
} }
else m_pInstance->SetData(TYPE_VALKIRIES, SPECIAL); else
{
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
m_pInstance->SetData(TYPE_VALKIRIES, SPECIAL);
}
} }
} }
Summons.DespawnAll(); Summons.DespawnAll();
@@ -288,15 +282,13 @@ struct boss_twin_baseAI : public ScriptedAI
if (m_pInstance) if (m_pInstance)
{ {
if (Creature* pSister = GetSister()) if (Creature* pSister = GetSister())
{
me->AddAura(m_uiMyEmphatySpellId, pSister); me->AddAura(m_uiMyEmphatySpellId, pSister);
pSister->SetInCombatWithZone();
}
m_pInstance->SetData(TYPE_VALKIRIES, IN_PROGRESS); m_pInstance->SetData(TYPE_VALKIRIES, IN_PROGRESS);
} }
if (me->isAlive())
{
me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[0].GetPositionX(), EssenceLocation[0].GetPositionY(), EssenceLocation[0].GetPositionZ());
me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[1].GetPositionX(), EssenceLocation[1].GetPositionY(), EssenceLocation[1].GetPositionZ());
}
DoScriptText(SAY_AGGRO, me); DoScriptText(SAY_AGGRO, me);
DoCast(me, m_uiSurgeSpellId); DoCast(me, m_uiSurgeSpellId);
} }
@@ -310,12 +302,11 @@ struct boss_twin_baseAI : public ScriptedAI
break; break;
case ACTION_PACT: case ACTION_PACT:
m_uiStage = me->GetEntry() == NPC_LIGHTBANE ? 1 : 2; m_uiStage = me->GetEntry() == NPC_LIGHTBANE ? 1 : 2;
DoCast(me, SPELL_TWIN_POWER);
break; break;
} }
} }
void EnableDualWield(bool mode) void EnableDualWield(bool mode = true)
{ {
SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : EQUIP_UNEQUIP, EQUIP_UNEQUIP); SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : EQUIP_UNEQUIP, EQUIP_UNEQUIP);
me->SetCanDualWield(mode); me->SetCanDualWield(mode);
@@ -384,23 +375,6 @@ struct boss_twin_baseAI : public ScriptedAI
else else
m_uiTouchTimer -= uiDiff; m_uiTouchTimer -= uiDiff;
if (m_uiColorballsTimer <= uiDiff)
{
if (m_uiWaveCount >= 2)
{
SummonColorballs(12);
m_uiWaveCount = 0;
}
else
{
SummonColorballs(2);
m_uiWaveCount++;
}
m_uiColorballsTimer = 15*IN_MILLISECONDS;
}
else
m_uiColorballsTimer -= uiDiff;
if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff) if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff)
{ {
DoCast(me, SPELL_BERSERK); DoCast(me, SPELL_BERSERK);
@@ -430,7 +404,12 @@ public:
struct boss_fjolaAI : public boss_twin_baseAI struct boss_fjolaAI : public boss_twin_baseAI
{ {
boss_fjolaAI(Creature* creature) : boss_twin_baseAI(creature) {} boss_fjolaAI(Creature* creature) : boss_twin_baseAI(creature)
{
m_pInstance = (InstanceScript*)creature->GetInstanceScript();
}
InstanceScript* m_pInstance;
void Reset() { void Reset() {
boss_twin_baseAI::Reset(); boss_twin_baseAI::Reset();
@@ -441,12 +420,8 @@ public:
m_uiVortexEmote = EMOTE_LIGHT_VORTEX; m_uiVortexEmote = EMOTE_LIGHT_VORTEX;
m_uiVortexSay = SAY_LIGHT_VORTEX; m_uiVortexSay = SAY_LIGHT_VORTEX;
m_uiSisterNpcId = NPC_DARKBANE; m_uiSisterNpcId = NPC_DARKBANE;
m_uiColorballNpcId = NPC_UNLEASHED_LIGHT; m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_DARK;
m_uiEssenceNpcId = NPC_LIGHT_ESSENCE;
m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_1;
m_uiMyEssenceSpellId = SPELL_LIGHT_ESSENCE_HELPER;
m_uiOtherEssenceSpellId = SPELL_DARK_ESSENCE_HELPER; m_uiOtherEssenceSpellId = SPELL_DARK_ESSENCE_HELPER;
m_uiEmpoweredWeaknessSpellId = SPELL_EMPOWERED_DARK_HELPER;
m_uiSurgeSpellId = SPELL_LIGHT_SURGE; m_uiSurgeSpellId = SPELL_LIGHT_SURGE;
m_uiVortexSpellId = SPELL_LIGHT_VORTEX; m_uiVortexSpellId = SPELL_LIGHT_VORTEX;
m_uiShieldSpellId = SPELL_LIGHT_SHIELD; m_uiShieldSpellId = SPELL_LIGHT_SHIELD;
@@ -454,10 +429,6 @@ public:
m_uiTouchSpellId = SPELL_LIGHT_TOUCH; m_uiTouchSpellId = SPELL_LIGHT_TOUCH;
m_uiSpikeSpellId = SPELL_LIGHT_TWIN_SPIKE; m_uiSpikeSpellId = SPELL_LIGHT_TWIN_SPIKE;
HomeLocation = ToCCommonLoc[8];
EssenceLocation[0] = TwinValkyrsLoc[2];
EssenceLocation[1] = TwinValkyrsLoc[3];
if (m_pInstance) if (m_pInstance)
{ {
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
@@ -466,11 +437,27 @@ public:
void EnterCombat(Unit* who) void EnterCombat(Unit* who)
{ {
boss_twin_baseAI::EnterCombat(who);
if (m_pInstance) if (m_pInstance)
{ {
m_pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); m_pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT);
} }
me->SummonCreature(NPC_BULLET_CONTROLLER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN);
boss_twin_baseAI::EnterCombat(who);
}
void EnterEvadeMode()
{
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
boss_twin_baseAI::EnterEvadeMode();
}
void JustReachedHome()
{
if (m_pInstance)
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
boss_twin_baseAI::JustReachedHome();
} }
}; };
@@ -503,22 +490,14 @@ public:
m_uiVortexEmote = EMOTE_DARK_VORTEX; m_uiVortexEmote = EMOTE_DARK_VORTEX;
m_uiVortexSay = SAY_DARK_VORTEX; m_uiVortexSay = SAY_DARK_VORTEX;
m_uiSisterNpcId = NPC_LIGHTBANE; m_uiSisterNpcId = NPC_LIGHTBANE;
m_uiColorballNpcId = NPC_UNLEASHED_DARK; m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_LIGHT;
m_uiEssenceNpcId = NPC_DARK_ESSENCE;
m_uiMyEmphatySpellId = SPELL_TWIN_EMPATHY_2;
m_uiMyEssenceSpellId = SPELL_DARK_ESSENCE_HELPER;
m_uiOtherEssenceSpellId = SPELL_LIGHT_ESSENCE_HELPER; m_uiOtherEssenceSpellId = SPELL_LIGHT_ESSENCE_HELPER;
m_uiEmpoweredWeaknessSpellId = SPELL_EMPOWERED_LIGHT_HELPER;
m_uiSurgeSpellId = SPELL_DARK_SURGE; m_uiSurgeSpellId = SPELL_DARK_SURGE;
m_uiVortexSpellId = SPELL_DARK_VORTEX; m_uiVortexSpellId = SPELL_DARK_VORTEX;
m_uiShieldSpellId = SPELL_DARK_SHIELD; m_uiShieldSpellId = SPELL_DARK_SHIELD;
m_uiTwinPactSpellId = SPELL_DARK_TWIN_PACT; m_uiTwinPactSpellId = SPELL_DARK_TWIN_PACT;
m_uiTouchSpellId = SPELL_DARK_TOUCH; m_uiTouchSpellId = SPELL_DARK_TOUCH;
m_uiSpikeSpellId = SPELL_DARK_TWIN_SPIKE; m_uiSpikeSpellId = SPELL_DARK_TWIN_SPIKE;
HomeLocation = ToCCommonLoc[9];
EssenceLocation[0] = TwinValkyrsLoc[0];
EssenceLocation[1] = TwinValkyrsLoc[1];
} }
}; };
@@ -650,8 +629,11 @@ public:
void SpellHitTarget(Unit* who, const SpellInfo* /*spell*/) void SpellHitTarget(Unit* who, const SpellInfo* /*spell*/)
{ {
if (who->HasAura(SPELL_DARK_ESSENCE_HELPER)) if(spell->Id == SPELL_UNLEASHED_DARK_HELPER)
who->CastSpell(who, SPELL_POWERING_UP, true); {
if (who->HasAura(SPELL_DARK_ESSENCE_HELPER))
who->CastSpell(who, SPELL_POWERING_UP, true);
}
} }
}; };
@@ -689,13 +671,45 @@ public:
void SpellHitTarget(Unit* who, const SpellInfo* /*spell*/) void SpellHitTarget(Unit* who, const SpellInfo* /*spell*/)
{ {
if (who->HasAura(SPELL_LIGHT_ESSENCE_HELPER)) if(spell->Id == SPELL_UNLEASHED_LIGHT_HELPER)
who->CastSpell(who, SPELL_POWERING_UP, true); {
if (who->HasAura(SPELL_LIGHT_ESSENCE_HELPER))
who->CastSpell(who, SPELL_POWERING_UP, true);
}
} }
}; };
}; };
class mob_bullet_controller : public CreatureScript
{
public:
mob_bullet_controller() : CreatureScript("mob_bullet_controller") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_bullet_controllerAI(creature);
}
struct mob_bullet_controllerAI : public Scripted_NoMovementAI
{
mob_bullet_controllerAI(Creature* creature) : Scripted_NoMovementAI(creature)
{
Reset();
}
void Reset()
{
DoCastAOE(SPELL_CONTROLLER_PERIODIC);
}
void UpdateAI(const uint32 /*uiDiff*/)
{
UpdateVictim();
}
};
};
class spell_powering_up : public SpellScriptLoader class spell_powering_up : public SpellScriptLoader
{ {
public: public:
@@ -860,6 +874,7 @@ void AddSC_boss_twin_valkyr()
new mob_unleashed_light(); new mob_unleashed_light();
new mob_unleashed_dark(); new mob_unleashed_dark();
new mob_essence_of_twin(); new mob_essence_of_twin();
new mob_bullet_controller();
new spell_powering_up(); new spell_powering_up();
new spell_valkyr_essences(); new spell_valkyr_essences();
new spell_power_of_the_twins(); new spell_power_of_the_twins();
@@ -553,17 +553,16 @@ class npc_tirion_toc : public CreatureScript
DoScriptText(SAY_STAGE_0_02, me); DoScriptText(SAY_STAGE_0_02, me);
m_uiUpdateTimer = 5000; m_uiUpdateTimer = 5000;
m_pInstance->SetData(TYPE_EVENT, 150); m_pInstance->SetData(TYPE_EVENT, 150);
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
break; break;
case 150: case 150:
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
if (m_pInstance->GetData(TYPE_BEASTS) != DONE) if (m_pInstance->GetData(TYPE_BEASTS) != DONE)
{ {
me->SummonCreature(NPC_GORMOK, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY(), ToCCommonLoc[10].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS); m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_GORMOK)))
if (Creature* pTemp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_PASSIVE); pTemp->SetReactState(REACT_PASSIVE);
} }
@@ -572,13 +571,6 @@ class npc_tirion_toc : public CreatureScript
m_pInstance->SetData(TYPE_EVENT, 155); m_pInstance->SetData(TYPE_EVENT, 155);
break; break;
case 155: case 155:
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_GORMOK)))
{
pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_AGGRESSIVE);
pTemp->SetInCombatWithZone();
}
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
m_pInstance->SetData(TYPE_BEASTS, IN_PROGRESS); m_pInstance->SetData(TYPE_BEASTS, IN_PROGRESS);
m_uiUpdateTimer = 5000; m_uiUpdateTimer = 5000;
m_pInstance->SetData(TYPE_EVENT, 160); m_pInstance->SetData(TYPE_EVENT, 160);
@@ -591,24 +583,20 @@ class npc_tirion_toc : public CreatureScript
case 205: case 205:
m_uiUpdateTimer = 3000; m_uiUpdateTimer = 3000;
m_pInstance->SetData(TYPE_EVENT, 210); m_pInstance->SetData(TYPE_EVENT, 210);
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
break; break;
case 210: case 210:
if (m_pInstance->GetData(TYPE_BEASTS) != DONE) if (m_pInstance->GetData(TYPE_BEASTS) != DONE)
{ {
me->SummonCreature(NPC_DREADSCALE, ToCCommonLoc[3].GetPositionX(), ToCCommonLoc[3].GetPositionY(), ToCCommonLoc[3].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN); m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[4].GetPositionX(), ToCCommonLoc[4].GetPositionY(), ToCCommonLoc[4].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN); if (Creature* pTemp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_DREADSCALE)))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_PASSIVE); pTemp->SetReactState(REACT_PASSIVE);
} }
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_ACIDMAW))) if (Creature* pTemp = me->SummonCreature(NPC_ACIDMAW, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ()); pTemp->SetVisible(true);
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_PASSIVE); pTemp->SetReactState(REACT_PASSIVE);
} }
@@ -617,20 +605,7 @@ class npc_tirion_toc : public CreatureScript
m_pInstance->SetData(TYPE_EVENT, 220); m_pInstance->SetData(TYPE_EVENT, 220);
break; break;
case 220: case 220:
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_DREADSCALE)))
{
pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_AGGRESSIVE);
pTemp->SetInCombatWithZone();
}
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_ACIDMAW)))
{
pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
pTemp->SetReactState(REACT_AGGRESSIVE);
pTemp->SetInCombatWithZone();
}
m_pInstance->SetData(TYPE_EVENT, 230); m_pInstance->SetData(TYPE_EVENT, 230);
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
break; break;
case 300: case 300:
DoScriptText(SAY_STAGE_0_05, me); DoScriptText(SAY_STAGE_0_05, me);
@@ -640,23 +615,23 @@ class npc_tirion_toc : public CreatureScript
case 305: case 305:
m_uiUpdateTimer = 3000; m_uiUpdateTimer = 3000;
m_pInstance->SetData(TYPE_EVENT, 310); m_pInstance->SetData(TYPE_EVENT, 310);
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
break; break;
case 310: case 310:
if (m_pInstance->GetData(TYPE_BEASTS) != DONE) if (m_pInstance->GetData(TYPE_BEASTS) != DONE)
{ {
me->SummonCreature(NPC_ICEHOWL, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY(), ToCCommonLoc[10].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN); m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_ICEHOWL))) if (Creature* pTemp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); pTemp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ());
pTemp->SetInCombatWithZone(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetReactState(REACT_PASSIVE);
} }
} }
m_uiUpdateTimer = 5000; m_uiUpdateTimer = 5000;
m_pInstance->SetData(TYPE_EVENT, 315); m_pInstance->SetData(TYPE_EVENT, 315);
break; break;
case 315: case 315:
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
m_pInstance->SetData(TYPE_EVENT, 320); m_pInstance->SetData(TYPE_EVENT, 320);
break; break;
case 400: case 400:
@@ -673,7 +648,7 @@ class npc_tirion_toc : public CreatureScript
DoScriptText(SAY_STAGE_1_01, me); DoScriptText(SAY_STAGE_1_01, me);
m_uiUpdateTimer = 7000; m_uiUpdateTimer = 7000;
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR)); m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
me->SummonCreature(NPC_FIZZLEBANG, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY(), ToCCommonLoc[10].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); me->SummonCreature(NPC_FIZZLEBANG, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
m_pInstance->SetData(TYPE_EVENT, 0); m_pInstance->SetData(TYPE_EVENT, 0);
break; break;
case 1180: case 1180:
@@ -713,16 +688,14 @@ class npc_tirion_toc : public CreatureScript
break; break;
//Summoning crusaders //Summoning crusaders
case 3091: case 3091:
me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]); if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]))
if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
pChampionController->AI()->SetData(0, HORDE); pChampionController->AI()->SetData(0, HORDE);
m_uiUpdateTimer = 3000; m_uiUpdateTimer = 3000;
m_pInstance->SetData(TYPE_EVENT, 3092); m_pInstance->SetData(TYPE_EVENT, 3092);
break; break;
//Summoning crusaders //Summoning crusaders
case 3090: case 3090:
me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]); if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1]))
if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
pChampionController->AI()->SetData(0, ALLIANCE); pChampionController->AI()->SetData(0, ALLIANCE);
m_uiUpdateTimer = 3000; m_uiUpdateTimer = 3000;
m_pInstance->SetData(TYPE_EVENT, 3092); m_pInstance->SetData(TYPE_EVENT, 3092);
@@ -745,14 +718,14 @@ class npc_tirion_toc : public CreatureScript
break; break;
case 4010: case 4010:
DoScriptText(SAY_STAGE_3_02, me); DoScriptText(SAY_STAGE_3_02, me);
if(Creature* pTemp = me->SummonCreature(NPC_LIGHTBANE, ToCCommonLoc[3].GetPositionX(), ToCCommonLoc[3].GetPositionY(), ToCCommonLoc[3].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) if(Creature* pTemp = me->SummonCreature(NPC_LIGHTBANE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{ {
pTemp->SetVisible(false); pTemp->SetVisible(false);
pTemp->SetReactState(REACT_PASSIVE); pTemp->SetReactState(REACT_PASSIVE);
pTemp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ()); pTemp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[0].GetPositionX(), TwinValkyrsLoc[0].GetPositionY(), TwinValkyrsLoc[0].GetPositionZ());
pTemp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ()); pTemp->SummonCreature(NPC_LIGHT_ESSENCE, TwinValkyrsLoc[1].GetPositionX(), TwinValkyrsLoc[1].GetPositionY(), TwinValkyrsLoc[1].GetPositionZ());
} }
if(Creature* pTemp = me->SummonCreature(NPC_DARKBANE, ToCCommonLoc[4].GetPositionX(), ToCCommonLoc[4].GetPositionY(), ToCCommonLoc[4].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME)) if(Creature* pTemp = me->SummonCreature(NPC_DARKBANE, ToCSpawnLoc[2].GetPositionX(), ToCSpawnLoc[2].GetPositionY(), ToCSpawnLoc[2].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME))
{ {
pTemp->SetVisible(false); pTemp->SetVisible(false);
pTemp->SetReactState(REACT_PASSIVE); pTemp->SetReactState(REACT_PASSIVE);
@@ -766,14 +739,12 @@ class npc_tirion_toc : public CreatureScript
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR)); m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_LIGHTBANE))) if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_LIGHTBANE)))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[6].GetPositionX(), ToCCommonLoc[6].GetPositionY(), ToCCommonLoc[6].GetPositionZ()); pTemp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pTemp->SetVisible(true); pTemp->SetVisible(true);
} }
if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_DARKBANE))) if (Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_DARKBANE)))
{ {
pTemp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[7].GetPositionX(), ToCCommonLoc[7].GetPositionY(), ToCCommonLoc[7].GetPositionZ()); pTemp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ());
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
pTemp->SetVisible(true); pTemp->SetVisible(true);
} }
m_uiUpdateTimer = 5000; m_uiUpdateTimer = 5000;
@@ -781,7 +752,6 @@ class npc_tirion_toc : public CreatureScript
break; break;
case 4016: case 4016:
m_pInstance->SetData(TYPE_EVENT, 4017); m_pInstance->SetData(TYPE_EVENT, 4017);
m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(GO_MAIN_GATE_DOOR));
break; break;
case 4040: case 4040:
m_uiUpdateTimer = 60000; m_uiUpdateTimer = 60000;
@@ -795,7 +765,7 @@ class npc_tirion_toc : public CreatureScript
case 5005: case 5005:
m_uiUpdateTimer = 8000; m_uiUpdateTimer = 8000;
m_pInstance->SetData(TYPE_EVENT, 5010); m_pInstance->SetData(TYPE_EVENT, 5010);
me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5); me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5);
break; break;
case 5020: case 5020:
DoScriptText(SAY_STAGE_4_03, me); DoScriptText(SAY_STAGE_4_03, me);
@@ -35,6 +35,13 @@ enum
DESPAWN_TIME = 300000, DESPAWN_TIME = 300000,
}; };
const Position ToCSpawnLoc[]=
{
{563.912f, 261.625f, 394.73f, 4.70437f}, // 0 Center
{575.451f, 261.496f, 394.73f, 4.6541f}, // 1 Left
{549.951f, 261.55f, 394.73f, 4.74835f}, // 2 Right
};
const Position ToCCommonLoc[]= const Position ToCCommonLoc[]=
{ {
{559.257996f, 90.266197f, 395.122986f, 0}, // 0 Barrent {559.257996f, 90.266197f, 395.122986f, 0}, // 0 Barrent