Scripts/AQ: Implement Ossirian the Unscarred

Fix yell on kurinaxx death

Warning fix

Closes #8254

Signed-off-by: Nay <dnpd.dd@gmail.com>
This commit is contained in:
krofna
2012-11-19 00:37:43 +00:00
committed by Nay
parent 45b07f0931
commit aea5fec30d
8 changed files with 320 additions and 39 deletions

View File

@@ -0,0 +1,15 @@
-- Ossirian the Unscarred
DELETE FROM `script_texts` WHERE `entry` BETWEEN -1509027 AND -1509018;
DELETE FROM `creature_text` WHERE `entry`=15339;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(15339, 0, 0, 'I am rejuvinated!', 14, 0, 100, 0, 0, 8593, 'SAY_SUPREME_1'),
(15339, 0, 1, 'My powers are renewed!', 14, 0, 100, 0, 0, 8595, 'SAY_SUPREME_2'),
(15339, 0, 2, 'My powers return!', 14, 0, 100, 0, 0, 8596, 'SAY_SUPREME_3'),
(15339, 1, 0, 'Protect the city at all costs!', 14, 0, 100, 0, 0, 8597, 'SAY_INTRO_1'),
(15339, 1, 1, 'To your posts. Defend the city.', 14, 0, 100, 0, 0, 8600, 'SAY_INTRO_2'),
(15339, 1, 2, 'Tresspassers will be terminated.', 14, 0, 100, 0, 0, 8601, 'SAY_INTRO_3'),
(15339, 2, 0, 'Sands of the desert rise and block out the sun!', 14, 0, 100, 0, 0, 8598, 'SAY_AGGRO'),
(15339, 3, 0, 'You are terminated.', 14, 0, 100, 0, 0, 8602, 'SAY_SLAY'),
(15339, 4, 0, 'I...have...failed.', 14, 0, 100, 0, 0, 8594, 'SAY_DEATH'),
(15339, 5, 0, 'The walls have been breached!', 14, 0, 100, 0, 0, 8599, 'SAY_KURINAXX_DEATH');

View File

@@ -0,0 +1,3 @@
-- Ossirian Crystal
UPDATE `gameobject_template` SET `ScriptName`='go_ossirian_crystal' WHERE `entry`=180619;

View File

@@ -19,6 +19,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ruins_of_ahnqiraj.h"
#include "CreatureTextMgr.h"
enum Spells
{
@@ -38,6 +39,11 @@ enum Events
EVENT_WIDE_SLASH = 4
};
enum Texts
{
SAY_KURINAXX_DEATH = 5, // Yelled by Ossirian the Unscarred
};
class boss_kurinnaxx : public CreatureScript
{
public:
@@ -45,7 +51,7 @@ class boss_kurinnaxx : public CreatureScript
struct boss_kurinnaxxAI : public BossAI
{
boss_kurinnaxxAI(Creature* creature) : BossAI(creature, BOSS_KURINNAXX)
boss_kurinnaxxAI(Creature* creature) : BossAI(creature, DATA_KURINNAXX)
{
}
@@ -67,6 +73,13 @@ class boss_kurinnaxx : public CreatureScript
_enraged = true;
}
}
void JustDied(Unit* /*killer*/)
{
_JustDied();
if (Creature* Ossirian = me->GetMap()->GetCreature(instance->GetData64(DATA_OSSIRIAN)))
sCreatureTextMgr->SendChat(Ossirian, SAY_KURINAXX_DEATH, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_ZONE);
}
void UpdateAI(const uint32 diff)
{

View File

@@ -58,7 +58,7 @@ class boss_moam : public CreatureScript
struct boss_moamAI : public BossAI
{
boss_moamAI(Creature* creature) : BossAI(creature, BOSS_MOAM)
boss_moamAI(Creature* creature) : BossAI(creature, DATA_MOAM)
{
}

View File

@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* 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
@@ -16,39 +15,258 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Ossirian
SD%Complete: 0
SDComment: Place holder
SDCategory: Ruins of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ruins_of_ahnqiraj.h"
enum Yells
enum Texts
{
SAY_SURPREME2 = -1509019,
SAY_SURPREME3 = -1509020,
SAY_RAND_INTRO1 = -1509021,
SAY_RAND_INTRO2 = -1509022,
SAY_RAND_INTRO3 = -1509023,
SAY_RAND_INTRO4 = -1509024, //possibly old?
SAY_AGGRO = -1509025,
SAY_SLAY = -1509026,
SAY_DEATH = -1509027
SAY_SUPREME = 0,
SAY_INTRO = 1,
SAY_AGGRO = 2,
SAY_SLAY = 3,
SAY_DEATH = 4,
};
enum Spells
{
SPELL_SILENCE = 25195,
SPELL_CYCLONE = 25189,
SPELL_STOMP = 25188,
SPELL_SUPREME = 25176,
SPELL_SUMMON = 20477,
SPELL_SAND_STORM = 25160,
SPELL_SUMMON_CRYSTAL = 25192,
};
enum Actions
{
ACTION_TRIGGER_WEAKNESS = 1,
};
enum Events
{
EVENT_SILENCE = 1,
EVENT_CYCLONE = 2,
EVENT_STOMP = 3
};
const uint8 NUM_CRYSTALS = 9;
// You spin me right round, baby
// right round like a record, baby
// right round round round
Position CrystalCoordinates[NUM_CRYSTALS] =
{
{ -9394.230469, 1951.808594, 85.97733, 0.0 },
{ -9357.931641, 1930.596802, 85.556198, 0.0 },
{ -9383.113281, 2011.042725, 85.556389, 0.0 },
{ -9243.36, 1979.04, 85.556, 0.0 },
{ -9281.68, 1886.66, 85.5558, 0.0 },
{ -9241.8, 1806.39, 85.5557, 0.0 },
{ -9366.78, 1781.76, 85.5561, 0.0 },
{ -9430.37, 1786.86, 85.557, 0.0 },
{ -9406.73, 1863.13, 85.5558, 0.0 }
};
float RoomRadius = 165.0f;
const uint8 NUM_TORNADOS = 5; // TODO: This number is completly random!
const uint8 NUM_WEAKNESS = 5;
const uint32 SpellWeakness[NUM_WEAKNESS] = { 25177, 25178, 25180, 25181, 25183 };
const Position RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 };
class boss_ossirian : public CreatureScript
{
public:
boss_ossirian() : CreatureScript("boss_ossirian") { }
struct boss_ossirianAI : public ScriptedAI
struct boss_ossirianAI : public BossAI
{
boss_ossirianAI(Creature* creature) : ScriptedAI(creature)
boss_ossirianAI(Creature* creature) : BossAI(creature, DATA_OSSIRIAN)
{
SaidIntro = false;
Reset();
}
uint64 TriggerGUID;
uint64 CrystalGUID;
uint8 CrystalIterator;
bool SaidIntro;
void Reset()
{
_Reset();
CrystalIterator = 0;
TriggerGUID = 0;
CrystalGUID = 0;
}
void SpellHit(Unit* caster, SpellInfo const* spell)
{
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
{
if (spell->Id == SpellWeakness[i])
{
me->RemoveAurasDueToSpell(SPELL_SUPREME);
((TempSummon*)caster)->UnSummon();
SpawnNextCrystal();
}
}
}
void DoAction(const int32 action)
{
if (action == ACTION_TRIGGER_WEAKNESS)
{
if (Creature* Trigger = me->GetMap()->GetCreature(TriggerGUID))
{
if (!Trigger->HasUnitState(UNIT_STATE_CASTING))
Trigger->CastSpell(Trigger, SpellWeakness[urand(0, 4)], false);
}
}
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
events.Reset();
events.ScheduleEvent(EVENT_SILENCE, 30000);
events.ScheduleEvent(EVENT_CYCLONE, 20000);
events.ScheduleEvent(EVENT_STOMP, 30000);
DoCast(me, SPELL_SUPREME);
Talk(SAY_AGGRO);
if (instance)
{
Map* map = me->GetMap();
if (!map->IsDungeon())
return;
WorldPacket data(SMSG_WEATHER, (4+4+4));
data << uint32(WEATHER_STATE_HEAVY_SANDSTORM) << float(1) << uint8(0);
map->SendToPlayers(&data);
for (uint8 i = 0; i < NUM_TORNADOS; ++i)
{
Position Point;
me->GetRandomPoint(RoomCenter, RoomRadius, Point);
if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point))
Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true);
}
SpawnNextCrystal();
}
}
void KilledUnit(Unit* /*victim*/)
{
Talk(SAY_SLAY);
}
void EnterEvadeMode()
{
Cleanup();
summons.DespawnAll();
ScriptedAI::EnterEvadeMode();
}
void JustDied(Unit* /*killer*/)
{
Cleanup();
_JustDied();
}
void Cleanup()
{
if (GameObject* Crystal = me->GetMap()->GetGameObject(CrystalGUID))
Crystal->Use(me);
}
void SpawnNextCrystal()
{
if (CrystalIterator == NUM_CRYSTALS)
CrystalIterator = 0;
if (Creature* Trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[CrystalIterator]))
{
TriggerGUID = Trigger->GetGUID();
if (GameObject* Crystal = Trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL,
CrystalCoordinates[CrystalIterator].GetPositionX(),
CrystalCoordinates[CrystalIterator].GetPositionY(),
CrystalCoordinates[CrystalIterator].GetPositionZ(),
0, 0, 0, 0, 0, -1))
{
CrystalGUID = Crystal->GetGUID();
++CrystalIterator;
}
}
}
void MoveInLineOfSight(Unit* /*who*/)
{
if (!SaidIntro)
{
Talk(SAY_INTRO);
SaidIntro = true;
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
// No kiting!
if (me->GetDistance(me->getVictim()) > 60.00f && me->GetDistance(me->getVictim()) < 120.00f)
DoCast(me->getVictim(), SPELL_SUMMON);
bool ApplySupreme = true;
if (me->HasAura(SPELL_SUPREME))
{
ApplySupreme = false;
}
else
{
for (uint8 i = 0; i < NUM_WEAKNESS; ++i)
{
if (me->HasAura(SpellWeakness[i]))
{
ApplySupreme = false;
break;
}
}
}
if (ApplySupreme)
{
DoCast(me, SPELL_SUPREME);
Talk(SAY_SUPREME);
}
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SILENCE:
DoCast(me, SPELL_SILENCE);
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 30000));
break;
case EVENT_CYCLONE:
DoCast(me->getVictim(), SPELL_CYCLONE);
events.ScheduleEvent(EVENT_CYCLONE, 20000);
break;
case EVENT_STOMP:
DoCast(me, SPELL_STOMP);
events.ScheduleEvent(EVENT_STOMP, 30000);
break;
}
}
DoMeleeAttackIfReady();
}
};
@@ -58,7 +276,32 @@ class boss_ossirian : public CreatureScript
}
};
class go_ossirian_crystal : public GameObjectScript
{
public:
go_ossirian_crystal() : GameObjectScript("go_ossirian_crystal")
{
}
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
InstanceScript* Instance = player->GetInstanceScript();
if (!Instance)
return false;
Creature* Ossirian = player->FindNearestCreature(NPC_OSSIRIAN, 30.0f);
if (!Ossirian || Instance->GetBossState(DATA_OSSIRIAN) != IN_PROGRESS)
return false;
Ossirian->AI()->DoAction(ACTION_TRIGGER_WEAKNESS);
return true;
}
};
void AddSC_boss_ossirian()
{
new boss_ossirian();
new go_ossirian_crystal();
}

View File

@@ -63,7 +63,7 @@ class boss_rajaxx : public CreatureScript
struct boss_rajaxxAI : public BossAI
{
boss_rajaxxAI(Creature* creature) : BossAI(creature, BOSS_RAJAXX)
boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX)
{
}

View File

@@ -28,7 +28,7 @@ class instance_ruins_of_ahnqiraj : public InstanceMapScript
{
instance_ruins_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map)
{
SetBossNumber(MAX_ENCOUNTER);
SetBossNumber(NUM_ENCOUNTER);
_kurinaxxGUID = 0;
_rajaxxGUID = 0;
@@ -75,17 +75,17 @@ class instance_ruins_of_ahnqiraj : public InstanceMapScript
{
switch (type)
{
case BOSS_KURINNAXX:
case DATA_KURINNAXX:
return _kurinaxxGUID;
case BOSS_RAJAXX:
case DATA_RAJAXX:
return _rajaxxGUID;
case BOSS_MOAM:
case DATA_MOAM:
return _moamGUID;
case BOSS_BURU:
case DATA_BURU:
return _buruGUID;
case BOSS_AYAMISS:
case DATA_AYAMISS:
return _ayamissGUID;
case BOSS_OSSIRIAN:
case DATA_OSSIRIAN:
return _ossirianGUID;
}
@@ -120,7 +120,7 @@ class instance_ruins_of_ahnqiraj : public InstanceMapScript
if (dataHead1 == 'R' && dataHead2 == 'A')
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
for (uint8 i = 0; i < NUM_ENCOUNTER; ++i)
{
uint32 tmpState;
loadStream >> tmpState;

View File

@@ -18,15 +18,15 @@
#ifndef DEF_RUINS_OF_AHNQIRAJ_H
#define DEF_RUINS_OF_AHNQIRAJ_H
enum Encounters
enum DataTypes
{
BOSS_KURINNAXX = 0,
BOSS_RAJAXX = 1,
BOSS_MOAM = 2,
BOSS_BURU = 3,
BOSS_AYAMISS = 4,
BOSS_OSSIRIAN = 5,
MAX_ENCOUNTER,
DATA_KURINNAXX = 0,
DATA_RAJAXX = 1,
DATA_MOAM = 2,
DATA_BURU = 3,
DATA_AYAMISS = 4,
DATA_OSSIRIAN = 5,
NUM_ENCOUNTER = 6
};
enum Creatures
@@ -40,6 +40,13 @@ enum Creatures
NPC_HIVEZARA_HORNET = 15934,
NPC_HIVEZARA_SWARMER = 15546,
NPC_HIVEZARA_LARVA = 15555,
NPC_SAND_VORTEX = 15428,
NPC_OSSIRIAN_TRIGGER = 15590,
};
enum GameObjects
{
GO_OSSIRIAN_CRYSTAL = 180619,
};
#endif