Scripts/BoT: add instance script for Bastion of Twilight as preparation for implementation

* also added a base boss file for halfus wyrmbreaker
This commit is contained in:
Ovahlord
2018-04-16 11:11:05 +02:00
parent 2981f09e08
commit 8f9e46c6f1
5 changed files with 390 additions and 0 deletions

View File

@@ -0,0 +1 @@
UPDATE `instance_template` SET `script`= 'instance_bastion_of_twilight' WHERE `map`= 671;

View File

@@ -0,0 +1,91 @@
/*
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DEF_BASTION_OF_TWILIGHT_H
#define DEF_BASTION_OF_TWILIGHT_H
#define DataHeader "BoT"
#define BoTScriptName "instance_bastion_of_twilight"
uint32 const EncounterCountNormal = 4;
uint32 const EncounterCountHeroic = 5;
enum BoTDataTypes
{
// Encounter Types
DATA_HALFUS_WYRMBREAKER = 0,
DATA_THERALION_AND_VALIONA = 1,
DATA_ASCENDANT_COUNCIL = 2,
DATA_CHOGALL = 3,
DATA_SINESTRA = 4,
// Creature Types
DATA_PROTO_BEHEMOTH = 5,
DATA_THERALION = 6,
DATA_VALIONA = 7,
DATA_IGNACIOUS = 8,
DATA_FELUDIUS = 9,
DATA_TERRASTRA = 10,
DATA_ARION = 11,
DATA_ELEMENTIUM_MONSTROSITY = 12
};
enum BoTCreatures
{
// Bosses
BOSS_HALFUS_WYRMBREAKER = 44600,
BOSS_PROTO_BEHEMOTH = 44687,
BOSS_THERALION = 45993,
BOSS_VALIONA = 45992,
BOSS_IGNACIOUS = 43686,
BOSS_FELUDIUS = 43687,
BOSS_TERRASTRA = 43689,
BOSS_ARION = 43688,
BOSS_ELEMENTIUM_MONSTROSITY = 43735,
BOSS_CHOGALL = 43324,
BOSS_SINESTRA = 45213
};
enum BoTGameObjects
{
GO_HALFUS_ENTRANCE = 205222,
GO_HALFUS_EXIT = 205223,
GO_DRAGON_SIBLINGS_DOOR_ENTRANCE = 205224,
GO_DRAGON_SIBLINGS_DOOR_EXIT = 205225,
GO_ASCENDANT_COUNCIL_ENTRANCE = 205226,
GO_ASCENDANT_COUNCIL_EXIT = 205227,
GO_CHOGALL_ENTRANCE = 205228
};
enum UnresponsiveDragonCases
{
};
template<class AI>
AI* GetBastionOfTwilightAI(Creature* creature)
{
return GetInstanceAI<AI>(creature, BoTScriptName);
}
template<class AI>
AI* GetBastionOfTwilightAI(GameObject* go)
{
return GetInstanceAI<AI>(go, BoTScriptName);
}
#endif

View File

@@ -0,0 +1,117 @@
/*
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "Player.h"
#include "bastion_of_twilight.h"
enum Spells
{
};
enum Events
{
};
enum Actions
{
};
enum Texts
{
SAY_AGGRO = 0,
};
class boss_halfus_wyrmbreaker : public CreatureScript
{
public:
boss_halfus_wyrmbreaker() : CreatureScript("boss_halfus_wyrmbreaker") { }
struct boss_halfus_wyrmbreakerAI : public BossAI
{
boss_halfus_wyrmbreakerAI(Creature* creature) : BossAI(creature, DATA_HALFUS_WYRMBREAKER)
{
}
void Reset() override
{
_Reset();
}
void JustEngagedWith(Unit* /*who*/) override
{
_JustEngagedWith();
Talk(SAY_AGGRO);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
//Talk(SAY_DEATH);
}
void EnterEvadeMode(EvadeReason /*why*/) override
{
_EnterEvadeMode();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
_DespawnAtEvade();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case 0:
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature *creature) const override
{
return GetBastionOfTwilightAI<boss_halfus_wyrmbreakerAI>(creature);
}
};
void AddSC_boss_halfus_wyrmbreaker()
{
new boss_halfus_wyrmbreaker();
}

View File

@@ -0,0 +1,177 @@
/*
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "CreatureAI.h"
#include "bastion_of_twilight.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "MotionMaster.h"
#include "TemporarySummon.h"
#include "VehicleDefines.h"
#include "WorldPacket.h"
ObjectData const creatureData[] =
{
{ BOSS_HALFUS_WYRMBREAKER, DATA_HALFUS_WYRMBREAKER },
{ BOSS_PROTO_BEHEMOTH, DATA_PROTO_BEHEMOTH },
{ BOSS_THERALION, DATA_THERALION },
{ BOSS_VALIONA, DATA_VALIONA },
{ BOSS_IGNACIOUS, DATA_IGNACIOUS },
{ BOSS_FELUDIUS, DATA_FELUDIUS },
{ BOSS_TERRASTRA, DATA_TERRASTRA },
{ BOSS_ARION, DATA_ARION },
{ BOSS_ELEMENTIUM_MONSTROSITY, DATA_ELEMENTIUM_MONSTROSITY },
{ BOSS_CHOGALL, DATA_CHOGALL },
{ BOSS_SINESTRA, DATA_SINESTRA },
{ 0, 0 } // END
};
ObjectData const gameobjectData[] =
{
//{ GO_IRON_CLAD_DOOR, DATA_IRON_CLAD_DOOR },
{ 0, 0 } // END
};
DoorData const doorData[] =
{
{ GO_HALFUS_ENTRANCE, DATA_HALFUS_WYRMBREAKER, DOOR_TYPE_ROOM },
{ GO_HALFUS_EXIT, DATA_HALFUS_WYRMBREAKER, DOOR_TYPE_PASSAGE },
{ GO_DRAGON_SIBLINGS_DOOR_ENTRANCE, DATA_THERALION_AND_VALIONA, DOOR_TYPE_ROOM },
{ GO_DRAGON_SIBLINGS_DOOR_EXIT, DATA_THERALION_AND_VALIONA, DOOR_TYPE_PASSAGE },
{ GO_ASCENDANT_COUNCIL_ENTRANCE, DATA_ASCENDANT_COUNCIL, DOOR_TYPE_ROOM },
{ GO_ASCENDANT_COUNCIL_EXIT, DATA_ASCENDANT_COUNCIL, DOOR_TYPE_PASSAGE },
{ GO_CHOGALL_ENTRANCE, DATA_CHOGALL, DOOR_TYPE_ROOM },
{ 0, 0, DOOR_TYPE_ROOM } // END
};
class instance_bastion_of_twilight : public InstanceMapScript
{
public:
instance_bastion_of_twilight() : InstanceMapScript(BoTScriptName, 671) { }
struct instance_bastion_of_twilight_InstanceMapScript : public InstanceScript
{
instance_bastion_of_twilight_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
SetBossNumber(!map->IsHeroic() ? EncounterCountNormal : EncounterCountHeroic); // Sinestra only in heroic mode
LoadDoorData(doorData);
LoadObjectData(creatureData, gameobjectData);
if (!map->IsHeroic())
GenerateUnresponsiveDragonData();
}
void GenerateUnresponsiveDragonData()
{
}
/*
void OnPlayerEnter(Player* player) override
{
}
*/
void OnCreatureCreate(Creature* creature) override
{
InstanceScript::OnCreatureCreate(creature);
switch (creature->GetEntry())
{
case 0:
break;
default:
break;
}
}
void OnGameObjectCreate(GameObject* go) override
{
InstanceScript::OnGameObjectCreate(go);
}
bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
return false;
switch (type)
{
case 0:
break;
default:
break;
}
return true;
}
void OnUnitDeath(Unit* unit) override
{
}
void SetData(uint32 type, uint32 data) override
{
switch (type)
{
case 0:
break;
default:
break;
}
}
uint32 GetData(uint32 type) const override
{
return 0;
}
/*
void WriteSaveDataMore(std::ostringstream& data) override
{
data << _teamInInstance << ' '
<< _foeReaper5000Intro << ' '
<< _ironCladDoorState;
}
void ReadSaveDataMore(std::istringstream& data) override
{
data >> _teamInInstance;
data >> _foeReaper5000Intro;
data >> _ironCladDoorState;
}
*/
void Update(uint32 diff) override
{
}
protected:
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_bastion_of_twilight_InstanceMapScript(map);
}
};
void AddSC_instance_bastion_of_twilight()
{
new instance_bastion_of_twilight();
}

View File

@@ -25,6 +25,8 @@ void AddSC_boss_alizabal(); //Baradin Hold
void AddSC_boss_occuthar();
void AddSC_boss_pit_lord_argaloth();
void AddSC_instance_baradin_hold();
void AddSC_boss_halfus_wyrmbreaker(); //Bastion of Twilight
void AddSC_instance_bastion_of_twilight();
void AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
void AddSC_boss_corla();
void AddSC_boss_karsh_steelbender();
@@ -233,6 +235,8 @@ void AddEasternKingdomsScripts()
AddSC_boss_occuthar();
AddSC_boss_pit_lord_argaloth();
AddSC_instance_baradin_hold();
AddSC_boss_halfus_wyrmbreaker(); //Bastion of Twilight
AddSC_instance_bastion_of_twilight();
AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
AddSC_boss_corla();
AddSC_boss_karsh_steelbender();