Merge branch 'master' into Playerbot
This commit is contained in:
@@ -362,7 +362,7 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
questItems.push_back(std::pair(id, count));
|
||||
questItems.emplace_back(id, count);
|
||||
}
|
||||
|
||||
if (!questItems.empty())
|
||||
@@ -585,7 +585,7 @@ public:
|
||||
for (uint32 const& itemId : quest->RewardChoiceItemId)
|
||||
{
|
||||
uint8 index = 0;
|
||||
questRewardItems.push_back(std::pair(itemId, quest->RewardChoiceItemCount[index++]));
|
||||
questRewardItems.emplace_back(itemId, quest->RewardChoiceItemCount[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -594,7 +594,7 @@ public:
|
||||
for (uint32 const& itemId : quest->RewardItemId)
|
||||
{
|
||||
uint8 index = 0;
|
||||
questRewardItems.push_back(std::pair(itemId, quest->RewardItemIdCount[index++]));
|
||||
questRewardItems.emplace_back(itemId, quest->RewardItemIdCount[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,22 @@ public:
|
||||
{
|
||||
npc_crusade_persuadedAI(Creature* creature) : CombatAI(creature) { }
|
||||
|
||||
const uint32 SAY_AGGRO_CHANCE = 33;
|
||||
const uint32 PERSUADE_SUCCESS_CHANCE = 3; // 30% chance
|
||||
const uint32 SPEECH_TIMER_DEFAULT = 1000;
|
||||
const uint32 SPEECH_TIMER_FOR_ROLEPLAY = 8000;
|
||||
const uint32 SPEECH_COUNTER_PREVENT_SUCCESS_ROLEPLAY = 0;
|
||||
const uint32 SPEECH_COUNTER_START_SUCCESS_ROLEPLAY = 1;
|
||||
|
||||
uint32 speechTimer;
|
||||
uint32 speechCounter;
|
||||
ObjectGuid playerGUID;
|
||||
bool persuaded;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
speechTimer = 0;
|
||||
speechCounter = 0;
|
||||
speechCounter = SPEECH_COUNTER_PREVENT_SUCCESS_ROLEPLAY;
|
||||
playerGUID.Clear();
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RestoreFaction();
|
||||
@@ -71,7 +79,7 @@ public:
|
||||
|
||||
void JustEngagedWith(Unit*) override
|
||||
{
|
||||
if (roll_chance_i(33))
|
||||
if (roll_chance_i(SAY_AGGRO_CHANCE))
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -81,20 +89,23 @@ public:
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE)
|
||||
playerGUID = player->GetGUID();
|
||||
speechTimer = SPEECH_TIMER_DEFAULT;
|
||||
speechCounter = SPEECH_COUNTER_START_SUCCESS_ROLEPLAY;
|
||||
uint32 persuadeRoll = urand(1, 10);
|
||||
|
||||
sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, nullptr, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, player);
|
||||
|
||||
if (persuadeRoll <= PERSUADE_SUCCESS_CHANCE && player->GetQuestStatus(QUEST_HOW_TO_WIN_FRIENDS) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
playerGUID = player->GetGUID();
|
||||
speechTimer = 1000;
|
||||
speechCounter = 1;
|
||||
persuaded = true;
|
||||
me->SetFaction(player->GetFaction());
|
||||
me->CombatStop(true);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoCastAOE(SPELL_THREAT_PULSE, true);
|
||||
|
||||
sCreatureTextMgr->SendChat(me, SAY_PERSUADE_RAND, nullptr, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, player);
|
||||
Talk(SAY_CRUSADER);
|
||||
}
|
||||
else
|
||||
persuaded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,46 +123,53 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
switch (speechCounter)
|
||||
if (persuaded)
|
||||
{
|
||||
switch (speechCounter)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_PERSUADED1);
|
||||
speechTimer = 8000;
|
||||
speechTimer = SPEECH_TIMER_FOR_ROLEPLAY;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Talk(SAY_PERSUADED2);
|
||||
speechTimer = 8000;
|
||||
speechTimer = SPEECH_TIMER_FOR_ROLEPLAY;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Talk(SAY_PERSUADED3);
|
||||
speechTimer = 8000;
|
||||
speechTimer = SPEECH_TIMER_FOR_ROLEPLAY;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
Talk(SAY_PERSUADED4);
|
||||
speechTimer = 8000;
|
||||
speechTimer = SPEECH_TIMER_FOR_ROLEPLAY;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
sCreatureTextMgr->SendChat(me, SAY_PERSUADED5, nullptr, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, player);
|
||||
speechTimer = 8000;
|
||||
speechTimer = SPEECH_TIMER_FOR_ROLEPLAY;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
Talk(SAY_PERSUADED6);
|
||||
Unit::Kill(player, me);
|
||||
speechCounter = 0;
|
||||
speechCounter = SPEECH_COUNTER_PREVENT_SUCCESS_ROLEPLAY;
|
||||
player->GroupEventHappens(QUEST_HOW_TO_WIN_FRIENDS, me);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
++speechCounter;
|
||||
DoCastAOE(SPELL_THREAT_PULSE, true);
|
||||
++speechCounter;
|
||||
}
|
||||
else
|
||||
{
|
||||
Talk(SAY_CRUSADER);
|
||||
speechCounter = SPEECH_COUNTER_PREVENT_SUCCESS_ROLEPLAY;
|
||||
}
|
||||
}
|
||||
else
|
||||
speechTimer -= diff;
|
||||
speechTimer = (speechTimer > diff) ? (speechTimer - diff) : 0;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -623,7 +641,8 @@ public:
|
||||
ExecuteSpeech_Counter = 0;
|
||||
PlayerGUID.Clear();
|
||||
|
||||
me->SetImmuneToPC(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetImmuneToPC(true);
|
||||
}
|
||||
|
||||
bool MeetQuestCondition(Player* player)
|
||||
@@ -734,6 +753,7 @@ public:
|
||||
case 9:
|
||||
Talk(SAY_EXEC_TIME, player);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetImmuneToPC(false);
|
||||
break;
|
||||
case 10:
|
||||
|
||||
@@ -509,63 +509,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class boss_thurg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_thurg()
|
||||
: CreatureScript("boss_thurg")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_thurgAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_thurgAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 bloodlust_timer;
|
||||
uint32 cleave_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
bloodlust_timer = 15000;
|
||||
cleave_timer = 10000;
|
||||
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bloodlust_timer <= diff)
|
||||
{
|
||||
std::list<Creature*> templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST);
|
||||
if (!templist.empty())
|
||||
{
|
||||
if (Unit* target = *(templist.begin()))
|
||||
DoCast(target, SPELL_BLOODLUST, false);
|
||||
}
|
||||
bloodlust_timer = 12000;
|
||||
}
|
||||
else bloodlust_timer -= diff;
|
||||
|
||||
if (cleave_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CLEAVE, false);
|
||||
cleave_timer = 12000; //3 sec cast
|
||||
}
|
||||
else cleave_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_thurgAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_alyson_antille : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -668,331 +611,30 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_gazakrothAI : public boss_hexlord_addAI
|
||||
class spell_hexlord_unstable_affliction : public AuraScript
|
||||
{
|
||||
boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
PrepareAuraScript(spell_hexlord_unstable_affliction);
|
||||
|
||||
uint32 firebolt_timer;
|
||||
|
||||
void Reset() override
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
firebolt_timer = 2000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
return ValidateSpellInfo({ SPELL_WL_UNSTABLE_AFFL_DISPEL });
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack())
|
||||
{
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, 20);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
void Register() override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (firebolt_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FIREBOLT, false);
|
||||
firebolt_timer = 700;
|
||||
}
|
||||
else firebolt_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_lord_raadan : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lord_raadan()
|
||||
: CreatureScript("boss_lord_raadan")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_lord_raadanAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_lord_raadanAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 flamebreath_timer;
|
||||
uint32 thunderclap_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
flamebreath_timer = 8000;
|
||||
thunderclap_timer = 13000;
|
||||
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (thunderclap_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_THUNDERCLAP, false);
|
||||
thunderclap_timer = 12000;
|
||||
}
|
||||
else thunderclap_timer -= diff;
|
||||
|
||||
if (flamebreath_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FLAME_BREATH, false);
|
||||
flamebreath_timer = 12000;
|
||||
}
|
||||
else flamebreath_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_lord_raadanAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_darkheart : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_darkheart()
|
||||
: CreatureScript("boss_darkheart")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_darkheartAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_darkheartAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 psychicwail_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
psychicwail_timer = 8000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (psychicwail_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_PSYCHIC_WAIL, false);
|
||||
psychicwail_timer = 12000;
|
||||
}
|
||||
else psychicwail_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_darkheartAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_slither : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_slither()
|
||||
: CreatureScript("boss_slither")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_slitherAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_slitherAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 venomspit_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
venomspit_timer = 5000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) override
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack())
|
||||
{
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, 20);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (venomspit_timer <= diff)
|
||||
{
|
||||
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
DoCast(victim, SPELL_VENOM_SPIT, false);
|
||||
venomspit_timer = 2500;
|
||||
}
|
||||
else venomspit_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_slitherAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_fenstalker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_fenstalker()
|
||||
: CreatureScript("boss_fenstalker")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_fenstalkerAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_fenstalkerAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 volatileinf_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
volatileinf_timer = 15000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (volatileinf_timer <= diff)
|
||||
{
|
||||
// core bug
|
||||
me->GetVictim()->CastSpell(me->GetVictim(), SPELL_VOLATILE_INFECTION, false);
|
||||
volatileinf_timer = 12000;
|
||||
}
|
||||
else volatileinf_timer -= diff;
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_fenstalkerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_koragg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_koragg()
|
||||
: CreatureScript("boss_koragg")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_koraggAI : public boss_hexlord_addAI
|
||||
{
|
||||
boss_koraggAI(Creature* creature) : boss_hexlord_addAI(creature) { }
|
||||
|
||||
uint32 coldstare_timer;
|
||||
uint32 mightyblow_timer;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
coldstare_timer = 15000;
|
||||
mightyblow_timer = 10000;
|
||||
boss_hexlord_addAI::Reset();
|
||||
}
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (mightyblow_timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MIGHTY_BLOW, false);
|
||||
mightyblow_timer = 12000;
|
||||
}
|
||||
if (coldstare_timer <= diff)
|
||||
{
|
||||
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
|
||||
DoCast(victim, SPELL_COLD_STARE, false);
|
||||
coldstare_timer = 12000;
|
||||
}
|
||||
|
||||
boss_hexlord_addAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetZulAmanAI<boss_koraggAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hexlord_unstable_affliction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { }
|
||||
|
||||
class spell_hexlord_unstable_affliction_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WL_UNSTABLE_AFFL_DISPEL });
|
||||
}
|
||||
|
||||
void HandleDispel(DispelInfo* dispelInfo)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, nullptr, GetEffect(EFFECT_0));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hexlord_unstable_affliction_AuraScript();
|
||||
AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction::HandleDispel);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_hex_lord_malacrass()
|
||||
{
|
||||
new boss_hexlord_malacrass();
|
||||
new boss_thurg();
|
||||
// new boss_gazakroth();
|
||||
new boss_lord_raadan();
|
||||
new boss_darkheart();
|
||||
new boss_slither();
|
||||
new boss_fenstalker();
|
||||
new boss_koragg();
|
||||
new boss_alyson_antille();
|
||||
new spell_hexlord_unstable_affliction();
|
||||
RegisterSpellScript(spell_hexlord_unstable_affliction);
|
||||
}
|
||||
|
||||
@@ -346,6 +346,14 @@ struct boss_nalorakk : public BossAI
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
instance->SetData(DATA_NALORAKKEVENT, DONE);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _phase;
|
||||
bool _ranIntro;
|
||||
|
||||
@@ -70,17 +70,17 @@ struct boss_murmur : public BossAI
|
||||
_Reset();
|
||||
me->SetHealth(me->CountPctFromMaxHealth(40));
|
||||
me->ResetPlayerDamageReq();
|
||||
CastSupressionOOC();
|
||||
CastSuppressionOOC();
|
||||
}
|
||||
|
||||
void CastSupressionOOC()
|
||||
void CastSuppressionOOC()
|
||||
{
|
||||
me->m_Events.CancelEventGroup(GROUP_OOC_CAST);
|
||||
me->m_Events.AddEventAtOffset([this] {
|
||||
if (me->FindNearestCreature(NPC_CABAL_SPELLBINDER, 35.0f))
|
||||
{
|
||||
me->CastCustomSpell(SPELL_SUPPRESSION, SPELLVALUE_MAX_TARGETS, 5, (Unit*)nullptr, false);
|
||||
CastSupressionOOC();
|
||||
CastSuppressionOOC();
|
||||
}
|
||||
}, 3600ms, 10900ms, GROUP_OOC_CAST);
|
||||
}
|
||||
|
||||
@@ -175,6 +175,25 @@ Position illidanTakeoffPoint = { 727.6356f, 305.62753, 359.1486f };
|
||||
Position illidanLand = { 676.648f, 304.76074f, 354.18906f, 6.230825424194335937f };
|
||||
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
|
||||
{
|
||||
boss_illidan_stormrage(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE), _canTalk(true), _dying(false), _inCutscene(false), beamPosId(0) { }
|
||||
@@ -196,6 +215,7 @@ struct boss_illidan_stormrage : public BossAI
|
||||
me->LoadEquipment(EQUIPMENT_GLAIVES, true);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
me->SetSheath(SHEATH_STATE_UNARMED);
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
|
||||
ScheduleHealthCheckEvent(90, [&] {
|
||||
// Call for minions
|
||||
@@ -604,6 +624,10 @@ struct boss_illidan_stormrage : public BossAI
|
||||
|
||||
BossAI::EnterEvadeMode(why);
|
||||
me->DespawnOnEvade();
|
||||
|
||||
me->m_Events.CancelEventGroup(GROUP_BERSERK);
|
||||
me->m_Events.CancelEventGroup(GROUP_PHASE_FLYING);
|
||||
me->m_Events.CancelEventGroup(GROUP_DEMON_FORM);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
@@ -733,7 +757,7 @@ struct npc_akama_illidan : public ScriptedAI
|
||||
void Reset() override
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
me->m_Events.KillAllEvents(true);
|
||||
me->m_Events.KillAllEvents(false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
if (instance->GetBossState(DATA_ILLIDAN_STORMRAGE) == DONE)
|
||||
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
|
||||
@@ -1316,26 +1340,16 @@ struct npc_flame_of_azzinoth : public ScriptedAI
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
ScheduleTimedEvent(10s, [&] {
|
||||
if (Creature* _blade = ObjectAccessor::GetCreature(*me, _bladeGUID))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, ChargeTargetSelector()))
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
}, 5s, 20s);
|
||||
|
||||
ScheduleTimedEvent(10s, 20s, [&] {
|
||||
DoCastVictim(SPELL_FLAME_BLAST);
|
||||
|
||||
me->m_Events.AddEventAtOffset([&] {
|
||||
DoCastVictim(SPELL_BLAZE);
|
||||
if (Unit* victim = me->GetVictim())
|
||||
victim->CastSpell(victim, SPELL_BLAZE, true);
|
||||
}, 1s);
|
||||
}, 15s, 20s);
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ struct boss_illidari_council : public BossAI
|
||||
else if (param == ACTION_END_ENCOUNTER)
|
||||
{
|
||||
me->setActive(false);
|
||||
me->GetMap()->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me);
|
||||
for (uint8 i = DATA_GATHIOS_THE_SHATTERER; i <= DATA_VERAS_DARKSHADOW; ++i)
|
||||
if (Creature* member = instance->GetCreature(i))
|
||||
if (member->IsAlive())
|
||||
@@ -339,7 +340,7 @@ struct boss_gathios_the_shatterer : public boss_illidari_council_memberAI
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_COUNCIL_SPECIAL);
|
||||
DoCastSelf(SPELL_CONSECRATION);
|
||||
events.ScheduleEvent(EVENT_SPELL_AURA, 30s);
|
||||
events.ScheduleEvent(EVENT_SPELL_CONSECRATION, 30s);
|
||||
break;
|
||||
case EVENT_SPELL_HAMMER_OF_JUSTICE:
|
||||
if (Unit* target = me->GetVictim())
|
||||
|
||||
@@ -127,6 +127,7 @@ struct boss_mother_shahraz : public BossAI
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
me->m_Events.CancelEventGroup(GROUP_ENRAGE);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ struct boss_supremus : public BossAI
|
||||
DoResetThreatList();
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
Talk(EMOTE_NEW_TARGET);
|
||||
DoCastVictim(SPELL_CHARGE);
|
||||
if (target->IsWithinDist(me, 40))
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
}
|
||||
|
||||
context.Repeat(10s);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScriptLoader.h"
|
||||
#include "black_temple.h"
|
||||
#include "Player.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Yells
|
||||
@@ -39,7 +40,8 @@ enum Spells
|
||||
SPELL_TIDAL_SHIELD = 39872,
|
||||
SPELL_IMPALING_SPINE = 39837,
|
||||
SPELL_SUMMON_IMPALING_SPINE = 39929,
|
||||
SPELL_BERSERK = 26662
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_REMOVE_SPINES = 40354
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -48,6 +50,11 @@ enum Events
|
||||
EVENT_ENRAGE = 2
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ITEM_NAJENTUS_SPINE = 32408
|
||||
};
|
||||
|
||||
struct boss_najentus : public BossAI
|
||||
{
|
||||
boss_najentus(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS), _canTalk(true) { }
|
||||
@@ -56,6 +63,7 @@ struct boss_najentus : public BossAI
|
||||
{
|
||||
_Reset();
|
||||
me->m_Events.CancelEventGroup(EVENT_ENRAGE);
|
||||
DoCastSelf(SPELL_REMOVE_SPINES);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
@@ -64,6 +72,7 @@ struct boss_najentus : public BossAI
|
||||
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCastSelf(SPELL_REMOVE_SPINES);
|
||||
|
||||
me->m_Events.AddEventAtOffset([this] {
|
||||
Talk(SAY_ENRAGE);
|
||||
@@ -113,6 +122,7 @@ struct boss_najentus : public BossAI
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
me->m_Events.CancelEventGroup(EVENT_ENRAGE);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
@@ -156,9 +166,31 @@ class spell_najentus_hurl_spine : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_najentus_remove_spines : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_najentus_remove_spines);
|
||||
|
||||
void RemoveSpines()
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->GetMap()->DoForAllPlayers([&](Player* player)
|
||||
{
|
||||
player->DestroyItemCount(ITEM_NAJENTUS_SPINE, 5, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCast += SpellCastFn(spell_najentus_remove_spines::RemoveSpines);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_najentus()
|
||||
{
|
||||
RegisterBlackTempleCreatureAI(boss_najentus);
|
||||
RegisterSpellScript(spell_najentus_needle_spine);
|
||||
RegisterSpellScript(spell_najentus_hurl_spine);
|
||||
RegisterSpellScript(spell_najentus_remove_spines);
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ class spell_dru_starfall_dummy : public SpellScript
|
||||
return;
|
||||
}
|
||||
|
||||
// Any effect which causes you to lose control of your character will supress the starfall effect.
|
||||
// Any effect which causes you to lose control of your character will suppress the starfall effect.
|
||||
if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user