fix(Scripts/SethekkHalls): Script Anzu Bird Spirit Adds (#16490)
* init * Create rev_1686100430153174900.sql * 2 * codestyle * for loop * for loop * Update boss_anzu.cpp * use vector instead of array Co-Authored-By: Angelo Venturini <nefertum.dev@protonmail.com> * leftover * Revert "leftover" This reverts commit ccd6db746d364d6cc513b1c7ee7db79be024cc92. * Update rev_1686100430153174900.sql * codestyle? * Revert "codestyle?" This reverts commit bdf445c056e5b86fa054f299b17b32ec343ce53d. * Update boss_anzu.cpp * kill me * pls * Update sethekk_halls.h * Update boss_anzu.cpp * position codestyle * Update boss_anzu.cpp --------- Co-authored-by: Angelo Venturini <nefertum.dev@protonmail.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_anzu_spirit' WHERE (`entry` IN (23134, 23135, 23136));
|
||||||
|
|
||||||
|
DELETE FROM `creature_template_addon` WHERE (`entry` IN (23134, 23135, 23136));
|
||||||
|
INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES
|
||||||
|
(23134, '40250'),
|
||||||
|
(23135, '40250'),
|
||||||
|
(23136, '40250');
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 23136) AND (`source_type` = 0);
|
||||||
|
|
||||||
|
DELETE FROM `creature_text` WHERE `CreatureID` IN (23134, 23135, 23136);
|
||||||
|
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||||
|
(23134, 0, 0, '%s returns to stone.', 16, 0, 100, 0, 0, 0, 20980, 0, 'Hawk Spirit'),
|
||||||
|
(23135, 0, 0, '%s returns to stone.', 16, 0, 100, 0, 0, 0, 20980, 0, 'Falcon Spirit'),
|
||||||
|
(23136, 0, 0, '%s returns to stone.', 16, 0, 100, 0, 0, 0, 20980, 0, 'Eagle Spirit');
|
||||||
|
|
||||||
|
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` IN (40240, 40237, 40241));
|
||||||
|
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||||
|
(13, 3, 40240, 0, 0, 31, 0, 3, 23035, 0, 0, 0, 0, '', 'Spite of the Eagle (40240) only targets Anzu (23035)'),
|
||||||
|
(13, 1, 40237, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Protection of the Hawk (40237) only targets Players'),
|
||||||
|
(13, 1, 40241, 0, 0, 31, 0, 4, 0, 0, 0, 0, 0, '', 'Speed of the Falcon (40241) only targets Players');
|
||||||
|
|
||||||
|
-- Hack: Add PLAYER_CONTROLLED to allow for players to heal them. Flag 64 is sniffed, though
|
||||||
|
UPDATE `creature_template` SET `unit_flags` = `unit_flags`|64|8 WHERE (`entry` IN (23134, 23135, 23136));
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
#include "SpellScript.h"
|
#include "SpellScript.h"
|
||||||
|
#include "Unit.h"
|
||||||
#include "sethekk_halls.h"
|
#include "sethekk_halls.h"
|
||||||
|
|
||||||
enum Text
|
enum Text
|
||||||
@@ -38,7 +39,26 @@ enum Spells
|
|||||||
|
|
||||||
enum Npc
|
enum Npc
|
||||||
{
|
{
|
||||||
NPC_BROOD_OF_ANZU = 23132
|
NPC_BROOD_OF_ANZU = 23132,
|
||||||
|
NPC_HAWK_SPIRIT = 23134,
|
||||||
|
NPC_FALCON_SPIRIT = 23135,
|
||||||
|
NPC_EAGLE_SPIRIT = 23136
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Spirits
|
||||||
|
{
|
||||||
|
SPELL_HAWK = 40237,
|
||||||
|
SPELL_FALCON = 40241,
|
||||||
|
SPELL_EAGLE = 40240,
|
||||||
|
|
||||||
|
SPELL_DURATION = 40250,
|
||||||
|
|
||||||
|
SPELL_FREEZE_ANIM = 16245,
|
||||||
|
SPELL_STONEFORM = 40308,
|
||||||
|
|
||||||
|
SAY_STONED = 0,
|
||||||
|
|
||||||
|
MAX_DRUID_SPELLS = 27
|
||||||
};
|
};
|
||||||
|
|
||||||
struct boss_anzu : public BossAI
|
struct boss_anzu : public BossAI
|
||||||
@@ -54,15 +74,25 @@ struct boss_anzu : public BossAI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Position AnzuSpiritPos[3] =
|
||||||
|
{
|
||||||
|
{-96.4816f, 304.236f, 26.5135f, 5.23599f}, // Hawk Spirit
|
||||||
|
{-72.3434f, 290.861f, 26.4851f, 3.29867f}, // Falcon Spirit
|
||||||
|
{-99.5906f, 276.661f, 26.8467f, 0.750492f}, // Eagle Spirit
|
||||||
|
};
|
||||||
|
|
||||||
uint32 talkTimer;
|
uint32 talkTimer;
|
||||||
|
|
||||||
void SummonedCreatureDies(Creature* summon, Unit*) override
|
void SummonedCreatureDies(Creature* summon, Unit*) override
|
||||||
{
|
{
|
||||||
summons.Despawn(summon);
|
if (summon->GetEntry() == NPC_BROOD_OF_ANZU)
|
||||||
summons.RemoveNotExisting();
|
|
||||||
if (summons.empty())
|
|
||||||
{
|
{
|
||||||
me->RemoveAurasDueToSpell(SPELL_BANISH_SELF);
|
summons.Despawn(summon);
|
||||||
|
summons.RemoveNotExisting();
|
||||||
|
if (summons.empty())
|
||||||
|
{
|
||||||
|
me->RemoveAurasDueToSpell(SPELL_BANISH_SELF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,6 +108,7 @@ struct boss_anzu : public BossAI
|
|||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
_JustEngagedWith();
|
_JustEngagedWith();
|
||||||
|
SummonSpirits();
|
||||||
scheduler.Schedule(14s, [this](TaskContext context)
|
scheduler.Schedule(14s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_PARALYZING_SCREECH);
|
DoCastSelf(SPELL_PARALYZING_SCREECH);
|
||||||
@@ -112,6 +143,13 @@ struct boss_anzu : public BossAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SummonSpirits()
|
||||||
|
{
|
||||||
|
me->SummonCreature(NPC_HAWK_SPIRIT, AnzuSpiritPos[0], TEMPSUMMON_MANUAL_DESPAWN);
|
||||||
|
me->SummonCreature(NPC_FALCON_SPIRIT, AnzuSpiritPos[1], TEMPSUMMON_MANUAL_DESPAWN);
|
||||||
|
me->SummonCreature(NPC_EAGLE_SPIRIT, AnzuSpiritPos[2], TEMPSUMMON_MANUAL_DESPAWN);
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (talkTimer)
|
if (talkTimer)
|
||||||
@@ -119,6 +157,7 @@ struct boss_anzu : public BossAI
|
|||||||
talkTimer += diff;
|
talkTimer += diff;
|
||||||
if (talkTimer >= 1000 && talkTimer < 10000)
|
if (talkTimer >= 1000 && talkTimer < 10000)
|
||||||
{
|
{
|
||||||
|
me->SetImmuneToAll(true);
|
||||||
Talk(SAY_ANZU_INTRO1);
|
Talk(SAY_ANZU_INTRO1);
|
||||||
talkTimer = 10000;
|
talkTimer = 10000;
|
||||||
}
|
}
|
||||||
@@ -128,6 +167,7 @@ struct boss_anzu : public BossAI
|
|||||||
me->RemoveAurasDueToSpell(SPELL_SHADOWFORM);
|
me->RemoveAurasDueToSpell(SPELL_SHADOWFORM);
|
||||||
Talk(SAY_ANZU_INTRO2);
|
Talk(SAY_ANZU_INTRO2);
|
||||||
talkTimer = 0;
|
talkTimer = 0;
|
||||||
|
me->SetInCombatWithZone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +182,62 @@ struct boss_anzu : public BossAI
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct npc_anzu_spirit : public ScriptedAI
|
||||||
|
{
|
||||||
|
npc_anzu_spirit(Creature* creature) : ScriptedAI(creature) { }
|
||||||
|
|
||||||
|
void IsSummonedBy(WorldObject* /*summoner*/) override
|
||||||
|
{
|
||||||
|
_scheduler.Schedule(1ms, [this](TaskContext task)
|
||||||
|
{
|
||||||
|
// Check for Druid HoTs every 2400ms
|
||||||
|
if (me->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 64, 0))
|
||||||
|
{
|
||||||
|
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
|
||||||
|
me->RemoveAurasDueToSpell(SPELL_STONEFORM);
|
||||||
|
|
||||||
|
switch (me->GetEntry())
|
||||||
|
{
|
||||||
|
case NPC_HAWK_SPIRIT:
|
||||||
|
DoCastSelf(SPELL_HAWK);
|
||||||
|
break;
|
||||||
|
case NPC_FALCON_SPIRIT:
|
||||||
|
DoCastSelf(SPELL_FALCON);
|
||||||
|
break;
|
||||||
|
case NPC_EAGLE_SPIRIT:
|
||||||
|
DoCastSelf(SPELL_EAGLE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!me->HasAura(SPELL_STONEFORM))
|
||||||
|
{
|
||||||
|
Talk(SAY_STONED);
|
||||||
|
DoCastSelf(SPELL_FREEZE_ANIM, true);
|
||||||
|
DoCastSelf(SPELL_STONEFORM, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
task.Repeat(2400ms);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset() override
|
||||||
|
{
|
||||||
|
_scheduler.CancelAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAI(uint32 diff) override
|
||||||
|
{
|
||||||
|
_scheduler.Update(diff);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
TaskScheduler _scheduler;
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_boss_anzu()
|
void AddSC_boss_anzu()
|
||||||
{
|
{
|
||||||
RegisterSethekkHallsCreatureAI(boss_anzu);
|
RegisterSethekkHallsCreatureAI(boss_anzu);
|
||||||
|
RegisterSethekkHallsCreatureAI(npc_anzu_spirit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user