fix(Scripts/Karazhan): Replace Big Bad Wolf chase mechanic with prope… (#17458)

fix(Scripts/Karazhan): Replace Big Bad Wolf chase mechanic with proper taunt spell
This commit is contained in:
Andrew
2023-10-08 17:19:48 -03:00
committed by GitHub
parent e644dd949f
commit 7f36c5f059

View File

@@ -688,6 +688,7 @@ enum RedRidingHood
SPELL_LITTLE_RED_RIDING_HOOD = 30768,
SPELL_TERRIFYING_HOWL = 30752,
SPELL_WIDE_SWIPE = 30761,
SPELL_PICNIC_BASKET_SMELL = 30755,
CREATURE_BIG_BAD_WOLF = 17521,
@@ -751,16 +752,6 @@ struct boss_bigbadwolf : public ScriptedAI
InstanceScript* instance;
ObjectGuid HoodGUID;
void Reset() override
{
HoodGUID.Clear();
_tempThreat = 0;
_isChasing = false;
}
void JustEngagedWith(Unit* /*who*/) override
{
instance->DoUseDoorOrButton(instance->GetGuidData(DATA_GO_STAGEDOORLEFT));
@@ -769,40 +760,14 @@ struct boss_bigbadwolf : public ScriptedAI
_scheduler.Schedule(30s, [this](TaskContext context)
{
if (!_isChasing)
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
Talk(SAY_WOLF_HOOD);
DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
_tempThreat = DoGetThreat(target);
if (_tempThreat)
{
DoModifyThreatByPercent(target, -100);
}
HoodGUID = target->GetGUID();
me->AddThreat(target, 1000000.0f);
_isChasing = true;
context.Repeat(20s);
}
Talk(SAY_WOLF_HOOD);
DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true);
target->CastSpell(me, SPELL_PICNIC_BASKET_SMELL, true);
}
else
{
_isChasing = false;
if (Unit* target = ObjectAccessor::GetUnit(*me, HoodGUID))
{
HoodGUID.Clear();
if (DoGetThreat(target))
{
DoModifyThreatByPercent(target, -100);
}
me->AddThreat(target, _tempThreat);
_tempThreat = 0;
}
context.Repeat(40s);
}
context.Repeat(40s);
}).Schedule(25s, 35s, [this](TaskContext context)
{
DoCastAOE(SPELL_TERRIFYING_HOWL);
@@ -845,15 +810,10 @@ struct boss_bigbadwolf : public ScriptedAI
DoMeleeAttackIfReady();
if (_isChasing)
return;
_scheduler.Update(diff);
}
private:
TaskScheduler _scheduler;
bool _isChasing;
float _tempThreat;
};
/**********************************************/