fix(Scripts/BlackTemple): Flames should not charge players within 25y… (#20182)
* fix(Scripts/BlackTemple): Flames should not charge players within 25y of blade * Update boss_illidan.cpp --------- Co-authored-by: Keader <keader.android@gmail.com>
This commit is contained in:
@@ -175,6 +175,25 @@ Position illidanTakeoffPoint = { 727.6356f, 305.62753, 359.1486f };
|
|||||||
Position illidanLand = { 676.648f, 304.76074f, 354.18906f, 6.230825424194335937f };
|
Position illidanLand = { 676.648f, 304.76074f, 354.18906f, 6.230825424194335937f };
|
||||||
Position roomCenter = { 676.021f, 305.455f, 353.582f, 3.82227f };
|
Position roomCenter = { 676.021f, 305.455f, 353.582f, 3.82227f };
|
||||||
|
|
||||||
|
Position const BladesPositions[2] =
|
||||||
|
{
|
||||||
|
{ 676.226013f, 325.230988f },
|
||||||
|
{ 678.059998f, 285.220001f }
|
||||||
|
};
|
||||||
|
|
||||||
|
class ChargeTargetSelector
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ChargeTargetSelector() { }
|
||||||
|
|
||||||
|
bool operator()(Unit* unit) const
|
||||||
|
{
|
||||||
|
return unit->IsPlayer()
|
||||||
|
&& unit->GetDistance2d(BladesPositions[0].GetPositionX(), BladesPositions[0].GetPositionY()) > 25.0f
|
||||||
|
&& unit->GetDistance2d(BladesPositions[1].GetPositionX(), BladesPositions[1].GetPositionY()) > 25.0f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
struct boss_illidan_stormrage : public BossAI
|
struct boss_illidan_stormrage : public BossAI
|
||||||
{
|
{
|
||||||
boss_illidan_stormrage(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE), _canTalk(true), _dying(false), _inCutscene(false), beamPosId(0) { }
|
boss_illidan_stormrage(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE), _canTalk(true), _dying(false), _inCutscene(false), beamPosId(0) { }
|
||||||
@@ -1316,19 +1335,8 @@ struct npc_flame_of_azzinoth : public ScriptedAI
|
|||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
{
|
{
|
||||||
ScheduleTimedEvent(10s, [&] {
|
ScheduleTimedEvent(10s, [&] {
|
||||||
if (Creature* _blade = ObjectAccessor::GetCreature(*me, _bladeGUID))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ChargeTargetSelector()))
|
||||||
{
|
|
||||||
Unit* offTank = nullptr;
|
|
||||||
|
|
||||||
if (Creature* secondBlaze = me->FindNearestCreature(NPC_BLAZE, 100.0f, true))
|
|
||||||
offTank = secondBlaze->GetVictim();
|
|
||||||
|
|
||||||
if (Unit* target = _blade->AI()->SelectTarget(SelectTargetMethod::Random, 0, -40.0f, true))
|
|
||||||
{
|
|
||||||
if (!offTank || offTank != target)
|
|
||||||
DoCast(target, SPELL_CHARGE);
|
DoCast(target, SPELL_CHARGE);
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 5s, 20s);
|
}, 5s, 20s);
|
||||||
|
|
||||||
ScheduleTimedEvent(10s, 20s, [&] {
|
ScheduleTimedEvent(10s, 20s, [&] {
|
||||||
|
|||||||
Reference in New Issue
Block a user