fix(Core/TempleOfAhnQiraj): Rewrite Fankriss (#12652)

* fix(Core/TempleOfAhnQiraj): Rewrite Fankriss

* sneaky line

* linked respawn
This commit is contained in:
Angelo Venturini
2022-08-09 23:27:06 -03:00
committed by GitHub
parent 1455be34ba
commit fb785f6ae2
3 changed files with 96 additions and 96 deletions
@@ -0,0 +1,30 @@
--
DELETE FROM `spell_target_position` WHERE `ID` IN (720, 731, 1121, 518, 25831, 25832);
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`) VALUES
(720, 0, 531, -8043.6, 1254.1, -84.3, 0),
(731, 0, 531, -8003, 1222.9, -82.1, 0),
(1121, 0, 531, -8022.3, 1149, -89.1, 0),
(518, 0, 531, -8028.5, 1050.9, -54, 0),
(25831, 0, 531, -8158.03, 1139.3, -83.95, 0),
(25832, 0, 531, -8029.25, 1237.78, -85.2285, 0);
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15630) AND (`source_type` = 0) AND (`id` IN (0));
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
(15630, 0, 0, 0, 0, 0, 100, 3, 10000, 20000, 0, 0, 0, 11, 26662, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spawn of Fankriss - In Combat - Cast \'Berserk\' (No Repeat) (Normal Dungeon)');
DELETE FROM `creature_formations` WHERE `memberGUID` IN (87911, 87773, 87775, 87796, 87806, 87792);
INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
(87911, 87911, 0, 0, 3, 0, 0),
(87911, 87773, 0, 0, 3, 0, 0),
(87911, 87775, 0, 0, 3, 0, 0),
(87911, 87796, 0, 0, 3, 0, 0),
(87911, 87806, 0, 0, 3, 0, 0),
(87911, 87792, 0, 0, 3, 0, 0);
DELETE FROM `linked_respawn` WHERE `guid` IN (87773, 87775, 87796, 87806, 87792);
INSERT INTO `linked_respawn` (`guid`, `linkedGuid`, `linkType`) VALUES
(87773, 87911, 0),
(87775, 87911, 0),
(87796, 87911, 0),
(87806, 87911, 0),
(87792, 87911, 0);
@@ -15,128 +15,99 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Fankriss
SD%Complete: 100
SDComment: sound not implemented
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "TaskScheduler.h"
#include "temple_of_ahnqiraj.h"
#define SOUND_SENTENCE_YOU 8588
#define SOUND_SERVE_TO 8589
#define SOUND_LAWS 8590
#define SOUND_TRESPASS 8591
#define SOUND_WILL_BE 8592
enum Spells
{
SPELL_MORTAL_WOUND = 25646,
SPELL_ROOT = 28858,
SPELL_ENTANGLE_RIGHT = 720,
SPELL_ENTANGLE_CENTER = 731,
SPELL_ENTANGLE_LEFT = 1121,
// Enrage for his spawns
SPELL_ENRAGE = 28798
SPELL_SUMMON_WORM_1 = 518,
SPELL_SUMMON_WORM_2 = 25831,
SPELL_SUMMON_WORM_3 = 25832
};
struct boss_fankriss : public ScriptedAI
enum Misc
{
boss_fankriss(Creature* creature) : ScriptedAI(creature) { }
MAX_HATCHLING_SPAWN = 4,
NPC_VEKNISS_HATCHLING = 15962
};
void SummonSpawn()
const std::array<Position, 3> hatchlingsSpawnPoints
{
{
Rand = 10 + (rand() % 10);
switch (rand() % 2)
{
case 0:
RandX = 0.0f - Rand;
break;
case 1:
RandX = 0.0f + Rand;
break;
}
Rand = 10 + (rand() % 10);
switch (rand() % 2)
{
case 0:
RandY = 0.0f - Rand;
break;
case 1:
RandY = 0.0f + Rand;
break;
}
Rand = 0;
DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
{ -8043.6f, 1254.1f, -84.3f }, // Right
{ -8003.0f, 1222.9f, -82.1f }, // Center
{ -8022.3f, 1149.0f, -89.1f } // Left
}
};
void EnterCombat(Unit* /*who*/) override
const std::array<uint32, 3> entangleSpells = { SPELL_ENTANGLE_RIGHT, SPELL_ENTANGLE_CENTER, SPELL_ENTANGLE_LEFT };
struct boss_fankriss : public BossAI
{
boss_fankriss(Creature* creature) : BossAI(creature, DATA_FANKRISS) { }
void Reset() override
{
_scheduler.CancelAll();
summonWormSpells = { SPELL_SUMMON_WORM_1, SPELL_SUMMON_WORM_2, SPELL_SUMMON_WORM_3};
BossAI::Reset();
}
void SummonWorms()
{
uint32 amount = urand(1, 3);
Acore::Containers::RandomResize(summonWormSpells, amount);
for (uint32 summonSpell : summonWormSpells)
DoCastAOE(summonSpell, true);
summonWormSpells = { SPELL_SUMMON_WORM_1, SPELL_SUMMON_WORM_2, SPELL_SUMMON_WORM_3 };
}
void SummonHatchlingWaves()
{
for (Position spawnPos : hatchlingsSpawnPoints)
{
for (uint8 i = 0; i < MAX_HATCHLING_SPAWN; i++)
{
Position randSpawn = me->GetRandomPoint(spawnPos, 10.f);
me->SummonCreature(NPC_VEKNISS_HATCHLING, randSpawn, TEMPSUMMON_CORPSE_DESPAWN);
}
}
}
void EnterCombat(Unit* who) override
{
_scheduler.CancelAll();
BossAI::EnterCombat(who);
_scheduler
.Schedule(4s, 8s, [this](TaskContext context)
.Schedule(7s, 14s, [this](TaskContext context)
{
DoCastVictim(SPELL_MORTAL_WOUND);
context.Repeat();
})
.Schedule(15s, 45s, [this](TaskContext context)
.Schedule(30s, 50s, [this](TaskContext context)
{
switch (urand(0, 2))
{
case 0:
SummonSpawn();
break;
case 1:
SummonSpawn();
SummonSpawn();
break;
case 2:
SummonSpawn();
SummonSpawn();
SummonSpawn();
break;
}
context.Repeat(30s, 60s);
SummonWorms();
context.Repeat(22s, 70s);
})
.Schedule(15s, 45s, [this](TaskContext context)
.Schedule(15s, 20s, [this](TaskContext context)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
{
DoCast(target, SPELL_ROOT);
if (DoGetThreat(target))
DoModifyThreatPercent(target, -100);
switch (urand(0, 2))
{
case 0:
DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
break;
case 1:
DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
break;
case 2:
DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
break;
}
uint32 spellId = Acore::Containers::SelectRandomContainerElement(entangleSpells);
DoCast(target, spellId);
}
context.Repeat(45s, 60s);
SummonHatchlingWaves();
context.Repeat(25s, 55s);
});
}
@@ -152,9 +123,7 @@ struct boss_fankriss : public ScriptedAI
private:
TaskScheduler _scheduler;
int Rand;
float RandX;
float RandY;
std::vector<uint32> summonWormSpells;
};
void AddSC_boss_fankriss()
@@ -35,6 +35,7 @@ enum DataTypes
DATA_VEKNILASH = 9,
DATA_VEKNILASHISDEAD = 10,
DATA_VEKNILASH_DEATH = 11,
DATA_FANKRISS = 12,
DATA_BUG_TRIO_DEATH = 14,
DATA_CTHUN_PHASE = 20,
DATA_VISCIDUS = 21,