fix(Scripts/ZulAman): scout drum and hard CC interaction (#21281)
This commit is contained in:
@@ -710,7 +710,6 @@ private:
|
|||||||
enum AmanishiScout
|
enum AmanishiScout
|
||||||
{
|
{
|
||||||
NPC_WORLD_TRIGGER = 22515,
|
NPC_WORLD_TRIGGER = 22515,
|
||||||
POINT_DRUM = 0,
|
|
||||||
SAY_AGGRO = 0,
|
SAY_AGGRO = 0,
|
||||||
SPELL_ALERT_DRUMS = 42177,
|
SPELL_ALERT_DRUMS = 42177,
|
||||||
SPELL_MULTI_SHOT = 43205,
|
SPELL_MULTI_SHOT = 43205,
|
||||||
@@ -737,6 +736,8 @@ struct npc_amanishi_scout : public ScriptedAI
|
|||||||
{
|
{
|
||||||
scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
me->SetCombatMovement(false);
|
me->SetCombatMovement(false);
|
||||||
|
me->SetReactState(REACT_AGGRESSIVE);
|
||||||
|
_drumGUID.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
@@ -748,30 +749,38 @@ struct npc_amanishi_scout : public ScriptedAI
|
|||||||
GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 50.0f);
|
GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 50.0f);
|
||||||
triggers.remove_if([](Creature* trigger) {return !IsDrum(trigger);});
|
triggers.remove_if([](Creature* trigger) {return !IsDrum(trigger);});
|
||||||
triggers.sort(Acore::ObjectDistanceOrderPred(me));
|
triggers.sort(Acore::ObjectDistanceOrderPred(me));
|
||||||
if (!triggers.empty())
|
if (triggers.empty())
|
||||||
{
|
|
||||||
me->ClearTarget();
|
|
||||||
Creature* closestDrum = triggers.front();
|
|
||||||
me->GetMotionMaster()->MovePoint(POINT_DRUM, closestDrum->GetPositionX(), closestDrum->GetPositionY(), closestDrum->GetPositionZ());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ScheduleCombat();
|
ScheduleCombat();
|
||||||
}
|
Creature* closestDrum = triggers.front();
|
||||||
|
me->GetMotionMaster()->MoveFollow(closestDrum, 0.0f, 0.0f);
|
||||||
void MovementInform(uint32 type, uint32 id) override
|
_drumGUID = closestDrum->GetGUID();
|
||||||
{
|
me->ClearTarget();
|
||||||
if (type == POINT_MOTION_TYPE && id == POINT_DRUM)
|
me->SetReactState(REACT_PASSIVE);
|
||||||
|
scheduler.Schedule(1s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_ALERT_DRUMS);
|
if (_drumGUID)
|
||||||
scheduler.Schedule(5s, [this](TaskContext /*context*/)
|
if (Creature* drum = ObjectAccessor::GetCreature(*me, _drumGUID))
|
||||||
{
|
{
|
||||||
ScheduleCombat();
|
if (me->IsWithinRange(drum, INTERACTION_DISTANCE))
|
||||||
});
|
{
|
||||||
}
|
me->SetFacingToObject(drum);
|
||||||
|
DoCastSelf(SPELL_ALERT_DRUMS);
|
||||||
|
scheduler.Schedule(5s, [this](TaskContext /*context*/)
|
||||||
|
{
|
||||||
|
ScheduleCombat();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.Repeat(1s);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ScheduleCombat();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScheduleCombat()
|
void ScheduleCombat()
|
||||||
{
|
{
|
||||||
|
me->SetReactState(REACT_AGGRESSIVE);
|
||||||
me->SetCombatMovement(true);
|
me->SetCombatMovement(true);
|
||||||
if (Unit* victim = me->GetVictim())
|
if (Unit* victim = me->GetVictim())
|
||||||
me->GetMotionMaster()->MoveChase(victim);
|
me->GetMotionMaster()->MoveChase(victim);
|
||||||
@@ -790,11 +799,13 @@ struct npc_amanishi_scout : public ScriptedAI
|
|||||||
{
|
{
|
||||||
scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
|
|
||||||
if (!UpdateVictim())
|
if (!me->IsCombatMovementAllowed() || !UpdateVictim())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
|
private:
|
||||||
|
ObjectGuid _drumGUID;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SpellAlertDrums
|
enum SpellAlertDrums
|
||||||
|
|||||||
Reference in New Issue
Block a user