mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-16 06:58:52 +01:00
Scripts/BoT: implement Cho'Gall encounter
This commit is contained in:
@@ -38,7 +38,63 @@ class at_theralion_and_valiona_intro : public AreaTriggerScript
|
||||
}
|
||||
};
|
||||
|
||||
class at_ascendant_council_intro_1 : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_ascendant_council_intro_1() : AreaTriggerScript("at_ascendant_council_intro_1") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(DATA_AT_ASCENDANT_COUNCIL_INTRO_1, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class at_ascendant_council_intro_2 : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_ascendant_council_intro_2() : AreaTriggerScript("at_ascendant_council_intro_2") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(DATA_AT_ASCENDANT_COUNCIL_INTRO_2, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class at_ascendant_council_intro_3 : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_ascendant_council_intro_3() : AreaTriggerScript("at_ascendant_council_intro_3") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(DATA_AT_ASCENDANT_COUNCIL_INTRO_3, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class at_chogall_intro : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_chogall_intro() : AreaTriggerScript("at_chogall_intro") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
instance->SetData(DATA_AT_CHOGALL_INTRO, IN_PROGRESS);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_bastion_of_twilight()
|
||||
{
|
||||
new at_theralion_and_valiona_intro();
|
||||
new at_ascendant_council_intro_1();
|
||||
new at_ascendant_council_intro_2();
|
||||
new at_ascendant_council_intro_3();
|
||||
new at_chogall_intro();
|
||||
}
|
||||
@@ -43,13 +43,19 @@ enum BoTDataTypes
|
||||
DATA_ARION = 11,
|
||||
DATA_ELEMENTIUM_MONSTROSITY = 12,
|
||||
DATA_ASCENDANT_COUNCIL_CONTROLLER = 13,
|
||||
DATA_CORRUPTION = 14,
|
||||
|
||||
// GameObject Types
|
||||
DATA_WHELP_CAGE = 14,
|
||||
DATA_WHELP_CAGE = 15,
|
||||
DATA_GRIM_BATOL_RAID_TRAP_DOOR = 16,
|
||||
|
||||
// Areatriggers
|
||||
DATA_AT_HALFUS_INTRO = 15,
|
||||
DATA_AT_THERALION_AND_VALIONA_INTRO = 16,
|
||||
DATA_AT_HALFUS_INTRO = 17,
|
||||
DATA_AT_THERALION_AND_VALIONA_INTRO = 18,
|
||||
DATA_AT_ASCENDANT_COUNCIL_INTRO_1 = 19,
|
||||
DATA_AT_ASCENDANT_COUNCIL_INTRO_2 = 20,
|
||||
DATA_AT_ASCENDANT_COUNCIL_INTRO_3 = 21,
|
||||
DATA_AT_CHOGALL_INTRO = 22,
|
||||
|
||||
// Encounter Related
|
||||
/*Halfus Wyrmbreaker*/
|
||||
@@ -61,7 +67,10 @@ enum BoTDataTypes
|
||||
/*Theralion and Valiona*/
|
||||
DATA_RANDOM_VALIONA_DUMMY,
|
||||
DATA_COLLAPSING_TWILIGHT_PORTAL_COUNT,
|
||||
DATA_VALIONA_AURA_DUMMY
|
||||
DATA_VALIONA_AURA_DUMMY,
|
||||
|
||||
/*Cho'Gall*/
|
||||
DATA_FULL_HEROIC_ID
|
||||
};
|
||||
|
||||
enum BoTDataStates
|
||||
@@ -72,8 +81,12 @@ enum BoTDataStates
|
||||
|
||||
enum BoTAreatriggerIndex
|
||||
{
|
||||
AT_INDEX_HALFUS_WYRMBREAKER_INTRO = 1,
|
||||
AT_INDEX_THERALION_AND_VALIONA_INTRO = 2
|
||||
AT_INDEX_HALFUS_WYRMBREAKER_INTRO = 1,
|
||||
AT_INDEX_THERALION_AND_VALIONA_INTRO = 2,
|
||||
AT_INDEX_ASCENDANT_COUNCIL_INTRO_1 = 3,
|
||||
AT_INDEX_ASCENDANT_COUNCIL_INTRO_2 = 4,
|
||||
AT_INDEX_ASCENDANT_COUNCIL_INTRO_3 = 5,
|
||||
AT_INDEX_CHOGALL_INTRO = 6,
|
||||
};
|
||||
|
||||
enum BoTCreatures
|
||||
@@ -120,6 +133,14 @@ enum BoTCreatures
|
||||
NPC_WATER_BOMB = 44201,
|
||||
NPC_INFERNO_RUSH = 47501,
|
||||
NPC_FROZEN_ORB = 49518,
|
||||
NPC_LIQUID_ICE = 45452,
|
||||
|
||||
/*Cho'Gall*/
|
||||
NPC_FIRE_PORTAL = 43393,
|
||||
NPC_FIRE_ELEMENTAL = 43406,
|
||||
NPC_CORRUPTION = 43999,
|
||||
NPC_MALFORMATION = 43888,
|
||||
NPC_SPIKED_TENTACLE_TRIGGER = 50265,
|
||||
|
||||
// Generic Creatures
|
||||
NPC_INVISIBLE_STALKER = 42098
|
||||
@@ -134,7 +155,8 @@ enum BoTGameObjects
|
||||
GO_ASCENDANT_COUNCIL_ENTRANCE = 205226,
|
||||
GO_ASCENDANT_COUNCIL_EXIT = 205227,
|
||||
GO_CHOGALL_ENTRANCE = 205228,
|
||||
GO_WHELP_CAGE = 205087
|
||||
GO_WHELP_CAGE = 205087,
|
||||
GO_GRIM_BATOL_RAID_TRAP_DOOR = 205898
|
||||
};
|
||||
|
||||
enum BoTActions
|
||||
@@ -155,12 +177,18 @@ enum BoTActions
|
||||
ACTION_TALK_INTRO_HALFUS_WYRMBREAKER = 1,
|
||||
|
||||
// Cho'Gall (Boss)
|
||||
ACTION_TALK_INTRO_THERALION_AND_VALIONA = 1
|
||||
ACTION_TALK_THERALION_AND_VALIONA_INTRO = 1,
|
||||
ACTION_TALK_THERALION_AND_VALIONA_DEAD = 2,
|
||||
ACTION_TALK_ASCENDANT_COUNCIL_INTRO_1 = 3,
|
||||
ACTION_TALK_ASCENDANT_COUNCIL_INTRO_2 = 4,
|
||||
ACTION_TALK_ASCENDANT_COUNCIL_INTRO_3 = 5,
|
||||
ACTION_TALK_CHOGALL_INTRO = 6,
|
||||
};
|
||||
|
||||
enum BoTEvents
|
||||
{
|
||||
EVENT_CAST_DANCING_FLAMES = 1
|
||||
EVENT_CAST_DANCING_FLAMES = 1,
|
||||
EVENT_CHOGALL_TALK_THERALION_AND_VALIONA_DEAD,
|
||||
};
|
||||
|
||||
enum BoTSpells
|
||||
@@ -174,6 +202,8 @@ AI* GetBastionOfTwilightAI(Creature* creature)
|
||||
return GetInstanceAI<AI>(creature, BoTScriptName);
|
||||
}
|
||||
|
||||
#define RegisterBastionOfTwilightCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBastionOfTwilightAI)
|
||||
|
||||
template<class AI>
|
||||
AI* GetBastionOfTwilightAI(GameObject* go)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,13 +40,15 @@ ObjectData const creatureData[] =
|
||||
{ BOSS_SINESTRA, DATA_SINESTRA },
|
||||
{ NPC_PROTO_BEHEMOTH, DATA_PROTO_BEHEMOTH },
|
||||
{ NPC_ASCENDANT_COUNCIL_CONTROLLER, DATA_ASCENDANT_COUNCIL_CONTROLLER },
|
||||
{ NPC_CORRUPTION, DATA_CORRUPTION },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
ObjectData const gameobjectData[] =
|
||||
{
|
||||
{ GO_WHELP_CAGE, DATA_WHELP_CAGE },
|
||||
{ 0, 0 } // END
|
||||
{ GO_WHELP_CAGE, DATA_WHELP_CAGE },
|
||||
{ GO_GRIM_BATOL_RAID_TRAP_DOOR, DATA_GRIM_BATOL_RAID_TRAP_DOOR },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
@@ -89,6 +91,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
_unresponsiveDragonEntrySecond = 0;
|
||||
_deadOrphanedEmeraldWhelps = 0;
|
||||
_lastAreatriggerIndex = 0;
|
||||
_fullHeroicId = instance->IsHeroic();
|
||||
_valionaAuraDummyGUID = ObjectGuid::Empty;
|
||||
GenerateHalfusDragonData();
|
||||
}
|
||||
@@ -162,6 +165,10 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
if (creature->isDead() && GetBossState(DATA_ASCENDANT_COUNCIL) != DONE)
|
||||
creature->Respawn();
|
||||
break;
|
||||
case NPC_SPIKED_TENTACLE_TRIGGER:
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->JustSummoned(creature);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -170,6 +177,9 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
InstanceScript::OnGameObjectCreate(go);
|
||||
|
||||
if (go->GetEntry() == GO_GRIM_BATOL_RAID_TRAP_DOOR && instance->IsHeroic() && _fullHeroicId && GetBossState(DATA_CHOGALL) == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state) override
|
||||
@@ -284,11 +294,16 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
for (ObjectGuid guid : _unstableTwilightGUIDs)
|
||||
if (Creature* creature = instance->GetCreature(guid))
|
||||
creature->DespawnOrUnsummon();
|
||||
|
||||
events.ScheduleEvent(EVENT_CHOGALL_TALK_THERALION_AND_VALIONA_DEAD, 6s);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (state == DONE && !instance->IsHeroic())
|
||||
_fullHeroicId = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -334,7 +349,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
if (entry == NPC_TIME_WARDEN)
|
||||
{
|
||||
protoBehemoth->AI()->DoAction(ACTION_ENABLE_FIREBALL_BARRAGE);
|
||||
events.RescheduleEvent(EVENT_CAST_DANCING_FLAMES, Milliseconds(500), Seconds(1));
|
||||
events.RescheduleEvent(EVENT_CAST_DANCING_FLAMES, 500ms, 1s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,7 +372,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
if (_lastAreatriggerIndex < AT_INDEX_THERALION_AND_VALIONA_INTRO)
|
||||
{
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_INTRO_THERALION_AND_VALIONA);
|
||||
chogall->AI()->DoAction(ACTION_TALK_THERALION_AND_VALIONA_INTRO);
|
||||
|
||||
if (Creature* theralion = GetCreature(DATA_THERALION))
|
||||
theralion->AI()->DoAction(ACTION_START_ARGUMENT_INTRO);
|
||||
@@ -369,6 +384,46 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AT_ASCENDANT_COUNCIL_INTRO_1:
|
||||
if (_lastAreatriggerIndex < AT_INDEX_ASCENDANT_COUNCIL_INTRO_1)
|
||||
{
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_ASCENDANT_COUNCIL_INTRO_1);
|
||||
|
||||
_lastAreatriggerIndex = AT_INDEX_ASCENDANT_COUNCIL_INTRO_1;
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AT_ASCENDANT_COUNCIL_INTRO_2:
|
||||
if (_lastAreatriggerIndex < AT_INDEX_ASCENDANT_COUNCIL_INTRO_2)
|
||||
{
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_ASCENDANT_COUNCIL_INTRO_2);
|
||||
|
||||
_lastAreatriggerIndex = AT_INDEX_ASCENDANT_COUNCIL_INTRO_2;
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AT_ASCENDANT_COUNCIL_INTRO_3:
|
||||
if (_lastAreatriggerIndex < AT_INDEX_ASCENDANT_COUNCIL_INTRO_3)
|
||||
{
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_ASCENDANT_COUNCIL_INTRO_3);
|
||||
|
||||
_lastAreatriggerIndex = AT_INDEX_ASCENDANT_COUNCIL_INTRO_3;
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
case DATA_AT_CHOGALL_INTRO:
|
||||
if (_lastAreatriggerIndex < AT_INDEX_CHOGALL_INTRO)
|
||||
{
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_CHOGALL_INTRO);
|
||||
|
||||
_lastAreatriggerIndex = AT_INDEX_CHOGALL_INTRO;
|
||||
SaveToDB();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -405,8 +460,10 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
portalCount++;
|
||||
return portalCount;
|
||||
}
|
||||
case DATA_FULL_HEROIC_ID:
|
||||
return _fullHeroicId;
|
||||
default:
|
||||
break;
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -424,7 +481,11 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
if (Creature* cataclysmStalker = instance->GetCreature(guid))
|
||||
cataclysmStalker->CastSpell(cataclysmStalker, SPELL_DANCING_FLAMES_VISUAL, true);
|
||||
|
||||
events.Repeat(Milliseconds(500), Seconds(1));
|
||||
events.Repeat(500ms, 1s);
|
||||
break;
|
||||
case EVENT_CHOGALL_TALK_THERALION_AND_VALIONA_DEAD:
|
||||
if (Creature* chogall = GetCreature(DATA_CHOGALL))
|
||||
chogall->AI()->DoAction(ACTION_TALK_THERALION_AND_VALIONA_DEAD);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -436,7 +497,8 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
{
|
||||
data << _unresponsiveDragonEntryFirst << ' '
|
||||
<< _unresponsiveDragonEntrySecond << ' '
|
||||
<< _lastAreatriggerIndex;
|
||||
<< _lastAreatriggerIndex << ' '
|
||||
<< _fullHeroicId;
|
||||
}
|
||||
|
||||
void ReadSaveDataMore(std::istringstream& data) override
|
||||
@@ -444,6 +506,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
data >> _unresponsiveDragonEntryFirst;
|
||||
data >> _unresponsiveDragonEntrySecond;
|
||||
data >> _lastAreatriggerIndex;
|
||||
data >> _fullHeroicId;
|
||||
|
||||
if (_unresponsiveDragonEntryFirst && _unresponsiveDragonEntrySecond)
|
||||
{
|
||||
@@ -476,6 +539,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
uint32 _unresponsiveDragonEntrySecond;
|
||||
uint8 _deadOrphanedEmeraldWhelps;
|
||||
uint8 _lastAreatriggerIndex;
|
||||
uint8 _fullHeroicId;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -29,6 +29,7 @@ void AddSC_bastion_of_twilight(); //Bastion of Twilight
|
||||
void AddSC_boss_halfus_wyrmbreaker();
|
||||
void AddSC_boss_theralion_and_valiona();
|
||||
void AddSC_boss_ascendant_council();
|
||||
void AddSC_boss_chogall();
|
||||
void AddSC_instance_bastion_of_twilight();
|
||||
void AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
|
||||
void AddSC_boss_corla();
|
||||
@@ -243,6 +244,7 @@ void AddEasternKingdomsScripts()
|
||||
AddSC_boss_halfus_wyrmbreaker();
|
||||
AddSC_boss_theralion_and_valiona();
|
||||
AddSC_boss_ascendant_council();
|
||||
AddSC_boss_chogall();
|
||||
AddSC_instance_bastion_of_twilight();
|
||||
AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
|
||||
AddSC_boss_corla();
|
||||
|
||||
Reference in New Issue
Block a user