mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Stratholme: Baron Rivendare rewrite (#22572)
* Adding last state of rivendare rewrite
* Fix aura beeing removed on reset, fix death pact
* Not needed
* SQL: Changed remove/inset into update, fixed delete at conditions part
* Typo
* Remove link spell, fix blank lines, change magic numbers to enum
* Test changes with SpellScript and DoCastSelf
* Revert SpellScript and moved DoCastSelf for the aura into UpdateAI part
* Damn, copyright.
* Fix Unholy Aura
* Fix again (does attack now / does cast if encounter resets)
* Adding handling of the aura to the db
* Rename 2018_99_99_99_world_335.sql to 2019_05_31_02_world_335.sql
(cherry picked from commit ee5101fbf7)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
-- Baron Rivendare (Stratholme) - Set position for each Raise Dead spell (1-6)
|
||||
DELETE FROM `spell_target_position` WHERE `ID` IN (17475, 17476, 17477, 17478, 17479, 17480);
|
||||
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
|
||||
(17475, 0, 329, 4017.403809, -3339.703369, 115.057655, 0),
|
||||
(17476, 0, 329, 4013.189209, -3351.808350, 115.052254, 0),
|
||||
(17477, 0, 329, 4017.738037, -3363.478016, 115.057274, 0),
|
||||
(17478, 0, 329, 4048.877197, -3363.223633, 115.054253, 0),
|
||||
(17479, 0, 329, 4051.777588, -3350.893311, 115.055351, 0),
|
||||
(17480, 0, 329, 4048.375977, -3339.966309, 115.055222, 0);
|
||||
|
||||
-- Baron Rivendare (Stratholme) - Add missing emotes
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` IN (10440);
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(10440, 0, 0, '%s raises an undead servant back to life!' , 16, 0, 0, 0, 0, 0, 6511, 0, 'Baron Rivendare (Stratholme) - EMOTE_RAISE_DEAD'),
|
||||
(10440, 1, 0, '%s attempts to cast Death Pact on his servants!', 16, 0, 0, 0, 0, 0, 6512, 0, 'Baron Rivendare (Stratholme) - EMOTE_DEATH_PACT');
|
||||
|
||||
-- Baron Rivendare (Stratholme) - Use skeletons as target
|
||||
DELETE FROM `conditions` WHERE `SourceEntry` IN (17698, 17471);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `Comment`) VALUES
|
||||
(13, 1, 17698, 0, 0, 31, 0, 3, 11197, 0, 0, 0, 0, 'Baron Rivendare (Stratholme) - Death Pact (Heal)'),
|
||||
(13, 1, 17471, 0, 0, 31, 0, 3, 11197, 0, 0, 0, 0, 'Baron Rivendare (Stratholme) - Death Pact (Periodic aura)');
|
||||
|
||||
-- Baron Rivendare (Stratholme) - Skeletons should die after beeing affected by Death Pact
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_summoned_skeleton' WHERE `entry` = 11197;
|
||||
|
||||
-- Baron Rivendare (Stratholme) - Adding Unholy Aura
|
||||
DELETE FROM `creature_addon` WHERE `guid` IN (54241);
|
||||
UPDATE `creature_template_addon` SET `auras`= 17467 WHERE `entry` IN (10440);
|
||||
@@ -4576,6 +4576,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->ProcChance = 10;
|
||||
});
|
||||
|
||||
// Baron Rivendare (Stratholme) - Unholy Aura
|
||||
ApplySpellFix({ 17466, 17467 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO;
|
||||
});
|
||||
|
||||
//
|
||||
// FIRELANDS SPELLS
|
||||
//
|
||||
|
||||
@@ -15,170 +15,156 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Baron_Rivendare
|
||||
SD%Complete: 70
|
||||
SDComment: aura applied/defined in database
|
||||
SDCategory: Stratholme
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "stratholme.h"
|
||||
|
||||
enum Says
|
||||
enum Texts
|
||||
{
|
||||
SAY_BARON_RUN_START = 0,
|
||||
SAY_BARON_RUN_BOSS_KILL = 1,
|
||||
SAY_BARON_RUN_FAIL = 2,
|
||||
SAY_EVENT_RAMSTEIN = 3,
|
||||
SAY_EVENT_BARON = 4
|
||||
EMOTE_RAISE_DEAD = 0, // %s raises an undead servant back to life!
|
||||
EMOTE_DEATH_PACT = 1 // %s attempts to cast Death Pact on his servants!
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOWBOLT = 17393,
|
||||
SPELL_CLEAVE = 15284,
|
||||
SPELL_MORTALSTRIKE = 15708,
|
||||
|
||||
SPELL_UNHOLY_AURA = 15284,
|
||||
SPELL_RAISEDEAD = 15708, //triggers death pact (17471)
|
||||
|
||||
SPELL_RAISE_DEAD1 = 17475,
|
||||
SPELL_RAISE_DEAD2 = 17476,
|
||||
SPELL_RAISE_DEAD3 = 17477,
|
||||
SPELL_RAISE_DEAD4 = 17478,
|
||||
SPELL_RAISE_DEAD5 = 17479,
|
||||
SPELL_RAISE_DEAD6 = 17480,
|
||||
SPELL_SHADOWBOLT = 17393,
|
||||
SPELL_CLEAVE = 15284,
|
||||
SPELL_MORTALSTRIKE = 15708,
|
||||
SPELL_DEATH_PACT_1 = 17698, // Heal Rivendare and damage skeleton
|
||||
SPELL_DEATH_PACT_2 = 17471, // Visual effect
|
||||
SPELL_DEATH_PACT_3 = 17472, // Instant kill self only
|
||||
SPELL_RAISE_DEAD = 17473, // Inits. 17698 and 17471
|
||||
SPELL_RAISE_DEAD_1 = 17475,
|
||||
SPELL_RAISE_DEAD_2 = 17476,
|
||||
SPELL_RAISE_DEAD_3 = 17477,
|
||||
SPELL_RAISE_DEAD_4 = 17478,
|
||||
SPELL_RAISE_DEAD_5 = 17479,
|
||||
SPELL_RAISE_DEAD_6 = 17480,
|
||||
SPELL_UNHOLY_AURA = 17467
|
||||
};
|
||||
|
||||
// Define Add positions
|
||||
Position const ADD_POS_1 = {4017.403809f, -3339.703369f, 115.057655f, 5.487860f};
|
||||
Position const ADD_POS_2 = {4013.189209f, -3351.808350f, 115.052254f, 0.134280f};
|
||||
Position const ADD_POS_3 = {4017.738037f, -3363.478016f, 115.057274f, 0.723313f};
|
||||
Position const ADD_POS_4 = {4048.877197f, -3363.223633f, 115.054253f, 3.627735f};
|
||||
Position const ADD_POS_5 = {4051.777588f, -3350.893311f, 115.055351f, 3.066176f};
|
||||
Position const ADD_POS_6 = {4048.375977f, -3339.966309f, 115.055222f, 2.457497f};
|
||||
enum BaronRivendareEvents
|
||||
{
|
||||
EVENT_SHADOWBOLT = 1,
|
||||
EVENT_CLEAVE = 2,
|
||||
EVENT_MORTALSTRIKE = 3,
|
||||
EVENT_RAISE_DEAD = 4
|
||||
};
|
||||
|
||||
class boss_baron_rivendare : public CreatureScript
|
||||
uint32 const RaiseDeadSpells[6] =
|
||||
{
|
||||
SPELL_RAISE_DEAD_1, SPELL_RAISE_DEAD_2, SPELL_RAISE_DEAD_3,
|
||||
SPELL_RAISE_DEAD_4, SPELL_RAISE_DEAD_5, SPELL_RAISE_DEAD_6
|
||||
};
|
||||
|
||||
struct boss_baron_rivendare : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_baron_rivendare() : CreatureScript("boss_baron_rivendare") { }
|
||||
boss_baron_rivendare(Creature* creature) : BossAI(creature, TYPE_BARON), RaiseDead(false) { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
void Reset() override
|
||||
{
|
||||
return GetStratholmeAI<boss_baron_rivendareAI>(creature);
|
||||
// needed until re-write of instance scripts is done
|
||||
if (instance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
instance->SetData(TYPE_BARON, NOT_STARTED);
|
||||
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
struct boss_baron_rivendareAI : public ScriptedAI
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
boss_baron_rivendareAI(Creature* creature) : ScriptedAI(creature)
|
||||
// needed until re-write of instance scripts is done
|
||||
if (instance->GetData(TYPE_BARON) == NOT_STARTED)
|
||||
instance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_SHADOWBOLT, 5s);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 8s);
|
||||
events.ScheduleEvent(EVENT_MORTALSTRIKE, 12s);
|
||||
events.ScheduleEvent(EVENT_RAISE_DEAD, 15s);
|
||||
|
||||
BossAI::JustEngagedWith(who);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
// needed until re-write of instance scripts is done
|
||||
instance->SetData(TYPE_BARON, DONE);
|
||||
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
Initialize();
|
||||
instance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
ShadowBolt_Timer = 5000;
|
||||
Cleave_Timer = 8000;
|
||||
MortalStrike_Timer = 12000;
|
||||
// RaiseDead_Timer = 30000;
|
||||
SummonSkeletons_Timer = 34000;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 Cleave_Timer;
|
||||
uint32 MortalStrike_Timer;
|
||||
// uint32 RaiseDead_Timer;
|
||||
uint32 SummonSkeletons_Timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
if (instance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
instance->SetData(TYPE_BARON, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door
|
||||
if (instance->GetData(TYPE_BARON) == NOT_STARTED)
|
||||
instance->SetData(TYPE_BARON, IN_PROGRESS);
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
summoned->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
instance->SetData(TYPE_BARON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SHADOWBOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_SHADOWBOLT);
|
||||
events.Repeat(10s);
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
events.Repeat(7s, 17s);
|
||||
break;
|
||||
case EVENT_MORTALSTRIKE:
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
events.Repeat(10s, 25s);
|
||||
break;
|
||||
case EVENT_RAISE_DEAD:
|
||||
if (!RaiseDead)
|
||||
{
|
||||
DoCastSelf(SPELL_RAISE_DEAD);
|
||||
for (uint32 const& summonSkeletons : RaiseDeadSpells)
|
||||
DoCastSelf(summonSkeletons, true);
|
||||
RaiseDead = true;
|
||||
Talk(EMOTE_RAISE_DEAD);
|
||||
}
|
||||
else
|
||||
{
|
||||
RaiseDead = false;
|
||||
Talk(EMOTE_DEATH_PACT);
|
||||
}
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
//ShadowBolt
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
if (SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
|
||||
ShadowBolt_Timer = 10000;
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
|
||||
//Cleave
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
//13 seconds until we should cast this again
|
||||
Cleave_Timer = 7000 + (rand32() % 10000);
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
//MortalStrike
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MORTALSTRIKE);
|
||||
MortalStrike_Timer = 10000 + (rand32() % 15000);
|
||||
} else MortalStrike_Timer -= diff;
|
||||
|
||||
//RaiseDead
|
||||
// if (RaiseDead_Timer <= diff)
|
||||
// {
|
||||
// DoCast(me, SPELL_RAISEDEAD);
|
||||
// RaiseDead_Timer = 45000;
|
||||
// } else RaiseDead_Timer -= diff;
|
||||
|
||||
//SummonSkeletons
|
||||
if (SummonSkeletons_Timer <= diff)
|
||||
{
|
||||
me->SummonCreature(11197, ADD_POS_1, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
me->SummonCreature(11197, ADD_POS_2, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
me->SummonCreature(11197, ADD_POS_3, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
me->SummonCreature(11197, ADD_POS_4, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
me->SummonCreature(11197, ADD_POS_5, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
me->SummonCreature(11197, ADD_POS_6, TEMPSUMMON_TIMED_DESPAWN, 29000);
|
||||
|
||||
//34 seconds until we should cast this again
|
||||
SummonSkeletons_Timer = 40000;
|
||||
} else SummonSkeletons_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool RaiseDead;
|
||||
};
|
||||
|
||||
// Death Pact 3 (17472) needs to be casted by the skeletons
|
||||
struct npc_summoned_skeleton : public ScriptedAI
|
||||
{
|
||||
npc_summoned_skeleton(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_DEATH_PACT_2)
|
||||
DoCastSelf(SPELL_DEATH_PACT_3, true);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_baron_rivendare()
|
||||
{
|
||||
new boss_baron_rivendare();
|
||||
RegisterStratholmeCreatureAI(boss_baron_rivendare);
|
||||
RegisterStratholmeCreatureAI(npc_summoned_skeleton);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user