Scripts/AQ40: modernize instance script and nuke Ouro's script and scripted spawning sequence for him. This will make him at least attackable killable

This commit is contained in:
Ovahlord
2020-07-25 18:10:16 +02:00
parent b4ecbe3154
commit 6961041d34
7 changed files with 157 additions and 241 deletions

View File

@@ -0,0 +1,10 @@
-- High Prophet Skeram
UPDATE `creature_template` SET `unit_flags`= 64 WHERE `entry`= 15263;
-- Ouro
UPDATE `creature` SET `spawndist`= 0 WHERE `guid`= 88073;
UPDATE `creature_template` SET `ScriptName`= 'npc_ouro_spawner' WHERE `entry`= 15957;
DELETE FROM `creature_template_movement` WHERE `CreatureId`= 15517;
INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Flight`, `Rooted`) VALUES
(15517, 0, 1, 1);

View File

@@ -22,6 +22,7 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "temple_of_ahnqiraj.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"

View File

@@ -15,139 +15,90 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Ouro
SD%Complete: 85
SDComment: No model for submerging. Currently just invisible.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "temple_of_ahnqiraj.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "temple_of_ahnqiraj.h"
#include "GameObject.h"
enum Spells
{
SPELL_SWEEP = 26103,
SPELL_SANDBLAST = 26102,
SPELL_GROUND_RUPTURE = 26100,
SPELL_BIRTH = 26262, // The Birth Animation
SPELL_DIRTMOUND_PASSIVE = 26092
// Ouro
SPELL_BIRTH = 26586,
SPELL_GROUND_RUPTURE = 26100,
};
class boss_ouro : public CreatureScript
enum Misc
{
public:
boss_ouro() : CreatureScript("boss_ouro") { }
CUSTOM_ANIM_CREATE = 0
};
CreatureAI* GetAI(Creature* creature) const override
QuaternionData sandwormBaseRotation = { 0.f, 0.f, -0.3987484f, 0.9170604f };
struct boss_ouro : public BossAI
{
boss_ouro(Creature* creature) : BossAI(creature, DATA_OURO) { }
void JustAppeared() override
{
return new boss_ouroAI(creature);
if (GameObject* sandwormBase = me->SummonGameObject(GO_SANDWORM_BASE, me->GetPosition(), sandwormBaseRotation, 0, GO_SUMMON_TIMED_OR_CORPSE_DESPAWN))
sandwormBase->SendCustomAnim(CUSTOM_ANIM_CREATE);
DoCastSelf(SPELL_BIRTH);
DoZoneInCombat();
}
struct boss_ouroAI : public BossAI
void JustEngagedWith(Unit* who) override
{
boss_ouroAI(Creature* creature) : BossAI(creature, DATA_OURO)
BossAI::JustEngagedWith(who);
}
void EnterEvadeMode(EvadeReason why) override
{
BossAI::EnterEvadeMode(why);
summons.DespawnAll();
_DespawnAtEvade();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
/*
while (uint32 eventId = events.ExecuteEvent())
{
Initialize();
}
void Initialize()
{
Sweep_Timer = urand(5000, 10000);
SandBlast_Timer = urand(20000, 35000);
Submerge_Timer = urand(90000, 150000);
Back_Timer = urand(30000, 45000);
ChangeTarget_Timer = urand(5000, 8000);
Spawn_Timer = urand(10000, 20000);
Enrage = false;
Submerged = false;
}
uint32 Sweep_Timer;
uint32 SandBlast_Timer;
uint32 Submerge_Timer;
uint32 Back_Timer;
uint32 ChangeTarget_Timer;
uint32 Spawn_Timer;
bool Enrage;
bool Submerged;
void Reset() override
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* /*who*/) override
{
DoCastVictim(SPELL_BIRTH);
_JustEngagedWith();
}
void UpdateAI(uint32 diff) override
{
//Return since we have no target
if (!UpdateVictim())
return;
//Sweep_Timer
if (!Submerged && Sweep_Timer <= diff)
switch (eventId)
{
DoCastVictim(SPELL_SWEEP);
Sweep_Timer = urand(15000, 30000);
} else Sweep_Timer -= diff;
//SandBlast_Timer
if (!Submerged && SandBlast_Timer <= diff)
{
DoCastVictim(SPELL_SANDBLAST);
SandBlast_Timer = urand(20000, 35000);
} else SandBlast_Timer -= diff;
//Submerge_Timer
if (!Submerged && Submerge_Timer <= diff)
{
//Cast
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFaction(FACTION_FRIENDLY);
DoCast(me, SPELL_DIRTMOUND_PASSIVE);
Submerged = true;
Back_Timer = urand(30000, 45000);
} else Submerge_Timer -= diff;
//ChangeTarget_Timer
if (Submerged && ChangeTarget_Timer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
ChangeTarget_Timer = urand(10000, 20000);
} else ChangeTarget_Timer -= diff;
//Back_Timer
if (Submerged && Back_Timer <= diff)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFaction(FACTION_MONSTER);
DoCastVictim(SPELL_GROUND_RUPTURE);
Submerged = false;
Submerge_Timer = urand(60000, 120000);
} else Back_Timer -= diff;
DoMeleeAttackIfReady();
default:
break;
}
}
};
*/
DoMeleeAttackIfReady();
}
};
struct npc_ouro_spawner : public ScriptedAI
{
npc_ouro_spawner(Creature* creature) : ScriptedAI(creature) { }
void JustEngagedWith(Unit* /*who*/) override
{
DoSummon(BOSS_OURO, me->GetPosition());
me->DespawnOrUnsummon();
}
void AttackStart(Unit* /*victim*/) override { }
void UpdateAI(uint32 diff) override { }
};
void AddSC_boss_ouro()
{
new boss_ouro();
RegisterTempleOfAhnqirajhCreatureAI(boss_ouro);
RegisterTempleOfAhnqirajhCreatureAI(npc_ouro_spawner);
}

View File

@@ -22,6 +22,7 @@ SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "temple_of_ahnqiraj.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -35,7 +36,7 @@ enum Sartura
SPELL_ENRAGE = 28747, //Not sure if right ID.
SPELL_ENRAGEHARD = 28798,
//Guard Spell
//Guard Spell
SPELL_WHIRLWINDADD = 26038,
SPELL_KNOCKBACK = 26027
};
@@ -90,10 +91,10 @@ public:
_Reset();
}
void JustEngagedWith(Unit* /*who*/) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
_JustEngagedWith();
_JustEngagedWith(who);
}
void JustDied(Unit* /*killer*/) override

View File

@@ -148,7 +148,7 @@ struct boss_twinemperorsAI : public BossAI
void JustEngagedWith(Unit* who) override
{
_JustEngagedWith();
_JustEngagedWith(who);
Creature* pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{

View File

@@ -15,18 +15,24 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Instance_Temple_of_Ahnqiraj
SD%Complete: 80
SDComment:
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
#include "Creature.h"
#include "InstanceScript.h"
#include "temple_of_ahnqiraj.h"
#include <array>
ObjectData const creatureData[] =
{
{ BOSS_VEM, DATA_VEM },
{ BOSS_KRI, DATA_KRI },
{ BOSS_VEKLOR, DATA_VEKLOR },
{ BOSS_VEKNILASH, DATA_VEKNILASH },
{ BOSS_VISCIDUS, DATA_VISCIDUS },
{ BOSS_SARTURA, DATA_SARTURA },
{ BOSS_OURO, DATA_OURO },
{ 0, 0 } // END
};
DoorData const doorData[] =
{
@@ -37,6 +43,8 @@ DoorData const doorData[] =
{ 0, 0, DOOR_TYPE_ROOM } // END
};
constexpr uint8 const BUG_TRIO_COUNT = 3;
class instance_temple_of_ahnqiraj : public InstanceMapScript
{
public:
@@ -44,58 +52,16 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript
{
instance_temple_of_ahnqiraj_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
{
SetHeaders(DataHeader);
LoadObjectData(creatureData, nullptr);
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
IsBossDied[0] = false;
IsBossDied[1] = false;
IsBossDied[2] = false;
BugTrioDeathCount = 0;
CthunPhase = 0;
}
//If Vem is dead...
bool IsBossDied[3];
//Storing Skeram, Vem and Kri.
ObjectGuid SkeramGUID;
ObjectGuid VemGUID;
ObjectGuid KriGUID;
ObjectGuid VeklorGUID;
ObjectGuid VeknilashGUID;
ObjectGuid ViscidusGUID;
uint32 BugTrioDeathCount;
uint32 CthunPhase;
void OnCreatureCreate(Creature* creature) override
{
switch (creature->GetEntry())
{
case NPC_SKERAM:
SkeramGUID = creature->GetGUID();
break;
case NPC_VEM:
VemGUID = creature->GetGUID();
break;
case NPC_KRI:
KriGUID = creature->GetGUID();
break;
case NPC_VEKLOR:
VeklorGUID = creature->GetGUID();
break;
case NPC_VEKNILASH:
VeknilashGUID = creature->GetGUID();
break;
case NPC_VISCIDUS:
ViscidusGUID = creature->GetGUID();
break;
}
_bugTrioMemberDead.fill(false);
_bugTrioDeathCount = 0;
_cthunPhase = 0;
}
bool IsEncounterInProgress() const override
@@ -108,75 +74,51 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
{
switch (type)
{
case DATA_VEMISDEAD:
if (IsBossDied[0])
return 1;
break;
case DATA_VEKLORISDEAD:
if (IsBossDied[1])
return 1;
break;
case DATA_VEKNILASHISDEAD:
if (IsBossDied[2])
return 1;
break;
case DATA_BUG_TRIO_DEATH:
return BugTrioDeathCount;
case DATA_CTHUN_PHASE:
return CthunPhase;
case DATA_VEMISDEAD:
return uint8(_bugTrioMemberDead[0]);
case DATA_VEKLORISDEAD:
return uint8(_bugTrioMemberDead[1]);
case DATA_VEKNILASHISDEAD:
return uint8(_bugTrioMemberDead[2]);
case DATA_BUG_TRIO_DEATH:
return _bugTrioDeathCount;
case DATA_CTHUN_PHASE:
return _cthunPhase;
default:
return 0;
}
return 0;
}
ObjectGuid GetGuidData(uint32 identifier) const override
{
switch (identifier)
{
case DATA_SKERAM:
return SkeramGUID;
case DATA_VEM:
return VemGUID;
case DATA_KRI:
return KriGUID;
case DATA_VEKLOR:
return VeklorGUID;
case DATA_VEKNILASH:
return VeknilashGUID;
case DATA_VISCIDUS:
return ViscidusGUID;
}
return ObjectGuid::Empty;
} // end GetGuidData
void SetData(uint32 type, uint32 data) override
{
switch (type)
{
case DATA_VEM_DEATH:
IsBossDied[0] = true;
break;
case DATA_BUG_TRIO_DEATH:
++BugTrioDeathCount;
break;
case DATA_VEKLOR_DEATH:
IsBossDied[1] = true;
break;
case DATA_VEKNILASH_DEATH:
IsBossDied[2] = true;
break;
case DATA_CTHUN_PHASE:
CthunPhase = data;
break;
case DATA_VEM_DEATH:
_bugTrioMemberDead[0] = true;
break;
case DATA_BUG_TRIO_DEATH:
++_bugTrioDeathCount;
break;
case DATA_VEKLOR_DEATH:
_bugTrioMemberDead[1] = true;
break;
case DATA_VEKNILASH_DEATH:
_bugTrioMemberDead[2] = true;
break;
case DATA_CTHUN_PHASE:
_cthunPhase = data;
break;
default:
break;
}
}
private:
//If Vem is dead...
std::array<bool, BUG_TRIO_COUNT> _bugTrioMemberDead;
uint8 _bugTrioDeathCount;
uint8 _cthunPhase;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override

View File

@@ -27,6 +27,7 @@ uint32 const EncounterCount = 9;
enum AQTDataTypes
{
// Boss States
DATA_SKERAM = 0,
DATA_SARTURA = 1,
DATA_FRANKRIS = 2,
@@ -54,7 +55,19 @@ enum AQTDataTypes
enum AQTCreatures
{
// Bosses
BOSS_EYE_OF_CTHUN = 15589,
BOSS_SKERAM = 15263,
BOSS_VEM = 15544,
BOSS_KRI = 15511,
BOSS_VEKLOR = 15276,
BOSS_VEKNILASH = 15275,
BOSS_SARTURA = 15516,
BOSS_OURO = 15517,
BOSS_VISCIDUS = 15299,
// Encounter Related Creatures
/*C'Thun*/
NPC_CTHUN_PORTAL = 15896,
NPC_CLAW_TENTACLE = 15725,
NPC_EYE_TENTACLE = 15726,
@@ -65,21 +78,17 @@ enum AQTCreatures
NPC_FLESH_TENTACLE = 15802,
NPC_GIANT_PORTAL = 15910,
NPC_VISCIDUS = 15299,
NPC_GLOB_OF_VISCIDUS = 15667,
NPC_SKERAM = 15263,
NPC_VEM = 15544,
NPC_KRI = 15511,
NPC_VEKLOR = 15276,
NPC_VEKNILASH = 15275
/*Viscidus*/
NPC_GLOB_OF_VISCIDUS = 15667
};
enum ObjectsAQ40
enum AQ40GameObjects
{
AQ40_DOOR_1 = 180634,
AQ40_DOOR_2 = 180635,
AQ40_DOOR_3 = 180636
AQ40_DOOR_1 = 180634,
AQ40_DOOR_2 = 180635,
AQ40_DOOR_3 = 180636,
GO_SANDWORM_BASE = 180795
};
template <class AI, class T>
@@ -88,4 +97,6 @@ inline AI* GetAQ40AI(T* obj)
return GetInstanceAI<AI>(obj, AQ40ScriptName);
}
#define RegisterTempleOfAhnqirajhCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetAQ40AI)
#endif