mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Scripts/Trial of Crusader: Fixed issue with Snobold Vassal and some achiev criteria resets
* Fixed snobold behavior when gormok dies * Fixed UPPER_BACK_PAIN Archiev reset * Fixed THREE_SIXTY_PAIN_SPIKE Archiev reset
This commit is contained in:
@@ -396,7 +396,7 @@ struct boss_gormok : public boss_northrend_beastsAI
|
||||
|
||||
struct npc_snobold_vassal : public ScriptedAI
|
||||
{
|
||||
npc_snobold_vassal(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _mountedOnPlayer(false)
|
||||
npc_snobold_vassal(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _mountedOnPlayer(false), _gormokDead(false)
|
||||
{
|
||||
_instance->SetData(DATA_SNOBOLD_COUNT, INCREASE);
|
||||
SetCombatMovement(false);
|
||||
@@ -486,10 +486,17 @@ struct npc_snobold_vassal : public ScriptedAI
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
_events.CancelEvent(EVENT_CHECK_MOUNT);
|
||||
_events.CancelEvent(EVENT_FIRE_BOMB);
|
||||
me->AttackStop();
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
AttackStart(target);
|
||||
SetCombatMovement(true);
|
||||
_gormokDead = true;
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
AttackStart(target);
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
_events.ScheduleEvent(EVENT_BATTER, 5s);
|
||||
_events.ScheduleEvent(EVENT_HEAD_CRACK, 1s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,11 +522,15 @@ struct npc_snobold_vassal : public ScriptedAI
|
||||
case EVENT_HEAD_CRACK:
|
||||
if (Unit* target = me->GetVehicleBase())
|
||||
DoCast(target, SPELL_HEAD_CRACK);
|
||||
else
|
||||
DoCastVictim(SPELL_HEAD_CRACK);
|
||||
_events.Repeat(30s);
|
||||
break;
|
||||
case EVENT_BATTER:
|
||||
if (Unit* target = me->GetVehicleBase())
|
||||
DoCast(target, SPELL_BATTER);
|
||||
else
|
||||
DoCastVictim(SPELL_BATTER);
|
||||
_events.Repeat(10s, 15s);
|
||||
break;
|
||||
case EVENT_SNOBOLLED:
|
||||
@@ -538,8 +549,8 @@ struct npc_snobold_vassal : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
// do melee attack only if is in player back.
|
||||
if (_mountedOnPlayer)
|
||||
// do melee attack only if is in player back or if gormok is dead.
|
||||
if (_mountedOnPlayer || _gormokDead)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -548,6 +559,7 @@ private:
|
||||
InstanceScript* _instance;
|
||||
ObjectGuid _targetGUID;
|
||||
bool _mountedOnPlayer;
|
||||
bool _gormokDead;
|
||||
};
|
||||
|
||||
struct npc_fire_bomb : public ScriptedAI
|
||||
|
||||
@@ -184,6 +184,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
{
|
||||
if (Creature* fordring = GetCreature(DATA_FORDRING))
|
||||
fordring->AI()->DoAction(ACTION_JARAXXUS_WIPE);
|
||||
MistressOfPainCount = 0;
|
||||
}
|
||||
else if (state == DONE)
|
||||
{
|
||||
@@ -408,6 +409,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
SetBossState(DATA_NORTHREND_BEASTS, FAIL);
|
||||
if (Creature* tirion = GetCreature(DATA_FORDRING))
|
||||
tirion->AI()->DoAction(ACTION_NORTHREND_BEASTS_WIPE);
|
||||
SnoboldCount = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user