mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Oculus: Update Drakos the Interrogator (#28053)
(cherry picked from commit 2d348b6d8b)
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
-- Copied from 35153 by them
|
||||
UPDATE `serverside_spell` SET `ProcChance` = 101 WHERE `Id` = 50754;
|
||||
DELETE FROM `serverside_spell_effect` WHERE `SpellID`=50754;
|
||||
INSERT INTO `serverside_spell_effect` (`SpellID`, `Effect`, `EffectBonusCoefficient`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `ImplicitTarget1`) VALUES
|
||||
(50754, 28, 1, 28166, 64, 37, 73);
|
||||
|
||||
-- Same, from 35148
|
||||
UPDATE `serverside_spell` SET `ProcChance` = 101 WHERE `Id` = 50755;
|
||||
DELETE FROM `serverside_spell_effect` WHERE `SpellID`=50755;
|
||||
INSERT INTO `serverside_spell_effect` (`SpellID`, `Effect`, `EffectAura`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectTriggerSpell`, `ImplicitTarget1`) VALUES
|
||||
(50755, 6, 23, 2000, 1, 50757, 1);
|
||||
|
||||
-- While at it, update both of them
|
||||
UPDATE `creature_template` SET `flags_extra` = `flags_extra` &~ 0x00002000 WHERE `entry` IN (20405,21534);
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 28166;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (20405,28166) AND `source_type` = 0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2040500,2816600) AND `source_type` = 9;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
|
||||
(20405,0,0,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On AI Initialize - Set Reactstate Passive"),
|
||||
(20405,0,1,0,11,0,100,0,0,0,0,0,0,80,2040500,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Spawn - Run Script"),
|
||||
|
||||
(2040500,9,0,0,0,0,100,0,0,0,0,0,0,11,35150,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Cast 'Nether Charge Passive'"),
|
||||
(2040500,9,1,0,0,0,100,0,0,0,0,0,0,11,37670,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Cast 'Nether Charge Timer'"),
|
||||
(2040500,9,2,0,0,0,100,0,0,0,0,0,0,89,20,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Start Random Movement"),
|
||||
(2040500,9,3,0,0,0,100,0,8500,8500,0,0,0,89,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Stop Random Movement"),
|
||||
(2040500,9,4,0,0,0,100,0,0,0,0,0,0,11,35148,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Cast 'Nether Charge Countdown'"),
|
||||
(2040500,9,5,0,0,0,100,0,9500,9500,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nether Charge - On Script - Despawn"),
|
||||
|
||||
(28166,0,0,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On AI Initialize - Set Reactstate Passive"),
|
||||
(28166,0,1,0,11,0,100,0,0,0,0,0,0,80,2816600,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Spawn - Run Script"),
|
||||
|
||||
(2816600,9,0,0,0,0,100,0,1000,1000,0,0,0,11,51347,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Cast 'Teleport Visual Only'"),
|
||||
(2816600,9,1,0,0,0,100,0,0,0,0,0,0,11,50756,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Cast 'Unstable Sphere Passive'"),
|
||||
(2816600,9,2,0,0,0,100,0,0,0,0,0,0,11,50758,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Cast 'Unstable Sphere Timer'"),
|
||||
(2816600,9,3,0,0,0,100,0,0,0,0,0,0,89,40,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Start Random Movement"),
|
||||
(2816600,9,4,0,0,0,100,0,8000,8000,0,0,0,89,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Stop Random Movement"),
|
||||
(2816600,9,5,0,0,0,100,0,0,0,0,0,0,11,50755,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Cast 'Unstable Sphere Countdown'"),
|
||||
(2816600,9,6,0,0,0,100,0,10000,10000,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Unstable Sphere - On Script - Despawn");
|
||||
|
||||
DELETE FROM `spell_scripts` WHERE `id` = 51336;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_drakos_magic_pull';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(51336,'spell_drakos_magic_pull');
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 27654 AND `GroupID` = 5;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(27654,5,0,"%s begins to cast Magic Pull!",41,0,100,0,0,0,27550,0,"drakos EMOTE_PULL");
|
||||
@@ -15,70 +15,87 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "oculus.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "oculus.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_DEATH = 2,
|
||||
SAY_PULL = 3,
|
||||
SAY_STOMP = 4,
|
||||
EMOTE_PULL = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MAGIC_PULL = 51336,
|
||||
SPELL_THUNDERING_STOMP = 50774,
|
||||
SPELL_UNSTABLE_SPHERE_PASSIVE = 50756,
|
||||
SPELL_UNSTABLE_SPHERE_PULSE = 50757,
|
||||
SPELL_UNSTABLE_SPHERE_TIMER = 50758,
|
||||
NPC_UNSTABLE_SPHERE = 28166,
|
||||
SPELL_SUMMON_UNSTABLE_SPHERE = 50754,
|
||||
SPELL_MAGIC_PULL = 51336,
|
||||
|
||||
SPELL_MAGIC_PULL_EFFECT = 50770
|
||||
};
|
||||
|
||||
enum Yells
|
||||
#define SPELL_THUNDERING_STOMP DUNGEON_MODE<uint32>(50774, 59370)
|
||||
|
||||
enum Events
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_DEATH = 2,
|
||||
SAY_PULL = 3,
|
||||
SAY_STOMP = 4
|
||||
EVENT_BOMB_SUMMON = 1,
|
||||
EVENT_MAGIC_PULL,
|
||||
EVENT_STOMP
|
||||
};
|
||||
|
||||
enum DrakosAchievement
|
||||
enum Misc
|
||||
{
|
||||
ACHIEV_TIMED_START_EVENT = 18153,
|
||||
};
|
||||
|
||||
enum DrakosEvents
|
||||
{
|
||||
EVENT_MAGIC_PULL = 1,
|
||||
EVENT_STOMP,
|
||||
EVENT_BOMB_SUMMON
|
||||
ACHIEV_TIMED_START_EVENT = 18153
|
||||
};
|
||||
|
||||
struct boss_drakos : public BossAI
|
||||
{
|
||||
boss_drakos(Creature* creature) : BossAI(creature, DATA_DRAKOS)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
postPull = false;
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
|
||||
events.ScheduleEvent(EVENT_MAGIC_PULL, 15s);
|
||||
events.ScheduleEvent(EVENT_STOMP, 15s);
|
||||
events.ScheduleEvent(EVENT_BOMB_SUMMON, 2s);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
boss_drakos(Creature* creature) : BossAI(creature, DATA_DRAKOS) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_BOMB_SUMMON, 2s);
|
||||
events.ScheduleEvent(EVENT_MAGIC_PULL, 10s, 18s);
|
||||
events.ScheduleEvent(EVENT_STOMP, 10s, 18s);
|
||||
}
|
||||
|
||||
void OnSpellStart(SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_MAGIC_PULL)
|
||||
{
|
||||
Talk(SAY_PULL);
|
||||
Talk(EMOTE_PULL);
|
||||
}
|
||||
}
|
||||
|
||||
void OnSpellCast(SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_THUNDERING_STOMP)
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_STOMP);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
// start achievement timer (kill Eregos within 20 min)
|
||||
instance->TriggerGameEvent(ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -96,24 +113,16 @@ struct boss_drakos : public BossAI
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_BOMB_SUMMON:
|
||||
{
|
||||
for (uint8 i = 0; i <= (postPull ? 3 : 0); i++)
|
||||
{
|
||||
Position position = me->GetRandomNearPosition(frand(0.0f, 10.0f));
|
||||
me->SummonCreature(NPC_UNSTABLE_SPHERE, position);
|
||||
}
|
||||
}
|
||||
events.ScheduleEvent(EVENT_BOMB_SUMMON, 2s);
|
||||
DoCastSelf(SPELL_SUMMON_UNSTABLE_SPHERE);
|
||||
events.Repeat(2s);
|
||||
break;
|
||||
case EVENT_MAGIC_PULL:
|
||||
DoCast(SPELL_MAGIC_PULL);
|
||||
postPull = true;
|
||||
events.ScheduleEvent(EVENT_MAGIC_PULL, 15s);
|
||||
DoCastSelf(SPELL_MAGIC_PULL);
|
||||
events.Repeat(6s, 14s);
|
||||
break;
|
||||
case EVENT_STOMP:
|
||||
Talk(SAY_STOMP);
|
||||
DoCast(SPELL_THUNDERING_STOMP);
|
||||
events.ScheduleEvent(EVENT_STOMP, 15s);
|
||||
DoCastSelf(SPELL_THUNDERING_STOMP);
|
||||
events.Repeat(10s, 20s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -125,68 +134,39 @@ struct boss_drakos : public BossAI
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
// start achievement timer (kill Eregos within 20 min)
|
||||
instance->TriggerGameEvent(ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
private:
|
||||
bool postPull;
|
||||
};
|
||||
|
||||
struct npc_unstable_sphere : public ScriptedAI
|
||||
// 51336 - Magic Pull
|
||||
class spell_drakos_magic_pull : public SpellScript
|
||||
{
|
||||
npc_unstable_sphere(Creature* creature) : ScriptedAI(creature)
|
||||
PrepareSpellScript(spell_drakos_magic_pull);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
Initialize();
|
||||
return ValidateSpellInfo({ SPELL_MAGIC_PULL_EFFECT, SPELL_SUMMON_UNSTABLE_SPHERE });
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
pulseTimer = 3000;
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_MAGIC_PULL_EFFECT, true);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
void HandleAfterCast()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MoveRandom(40.0f);
|
||||
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, me);
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, me);
|
||||
|
||||
Initialize();
|
||||
|
||||
me->DespawnOrUnsummon(19s);
|
||||
Unit* caster = GetCaster();
|
||||
for (uint8 i = 0; i < 5; i++)
|
||||
caster->CastSpell(caster, SPELL_SUMMON_UNSTABLE_SPHERE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void Register() override
|
||||
{
|
||||
if (pulseTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_UNSTABLE_SPHERE_PULSE);
|
||||
pulseTimer = 3 * IN_MILLISECONDS;
|
||||
}
|
||||
else
|
||||
pulseTimer -= diff;
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakos_magic_pull::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
AfterCast += SpellCastFn(spell_drakos_magic_pull::HandleAfterCast);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 pulseTimer;
|
||||
};
|
||||
|
||||
void AddSC_boss_drakos()
|
||||
{
|
||||
RegisterOculusCreatureAI(boss_drakos);
|
||||
RegisterOculusCreatureAI(npc_unstable_sphere);
|
||||
RegisterSpellScript(spell_drakos_magic_pull);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user