Scripts/TSC: fixed respawn location of Corborus and Slabhide and resetting flags uppon respawn

This commit is contained in:
Ovahlord
2018-07-01 23:53:35 +02:00
parent e4128b22b2
commit 976ce5b85b
3 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1 @@
UPDATE `creature_template` SET `unit_flags`= `unit_flags` & ~33554688 WHERE `entry` IN (43214, 49538, 43438, 49642);

View File

@@ -110,6 +110,9 @@ class boss_corborus : public CreatureScript
{
_Reset();
_countTrashingCharge = 0;
if (stateIntro != DONE)
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -126,6 +129,7 @@ class boss_corborus : public CreatureScript
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
_EnterEvadeMode();
_DespawnAtEvade();
me->SetPosition(CorborusHomePos);
}
void JustDied(Unit* /*killer*/) override
@@ -194,7 +198,7 @@ class boss_corborus : public CreatureScript
// Make Corborus charge
DoCast(me, SPELL_RING_WYRM_CHARGE, true);
events.ScheduleEvent(EVENT_CORBORUS_KNOCKBACK, 1000);
events.ScheduleEvent(EVENT_CORBORUS_KNOCKBACK, Seconds(1));
break;
case EVENT_CORBORUS_KNOCKBACK:
// Spawn Twilight Documents (quest gameobject)
@@ -210,7 +214,7 @@ class boss_corborus : public CreatureScript
// Face Corborus to players and set new home position
me->SetFacingTo(3.176499f);
me->SetHomePosition(CorborusHomePos);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);
// Despawn Millhouse and all trash
instance->SetData(DATA_MILLHOUSE_EVENT_DESPAWN, 0);

View File

@@ -129,6 +129,9 @@ class boss_slabhide : public CreatureScript
void Reset() override
{
if (instance->GetData(DATA_SLABHIDE_INTRO) != DONE)
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (instance->GetData(DATA_SLABHIDE_INTRO) == NOT_STARTED)
return;
@@ -136,6 +139,7 @@ class boss_slabhide : public CreatureScript
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
_isFlying = false;
}
@@ -164,6 +168,7 @@ class boss_slabhide : public CreatureScript
DespawnAll();
summons.DespawnAll();
_DespawnAtEvade();
me->SetPosition(SlabhideIntroLandPos);
}
void JustDied(Unit* /*killer*/) override