Skip to content

Commit

Permalink
Scripts/Icecrown Citadel: Corrected flying animations for frostwyrms …
Browse files Browse the repository at this point in the history
…in Sindragosa's Lair and prevent reentering combat with Deathbringer Saurfang after encounter is won
  • Loading branch information
Shauren committed Mar 15, 2012
1 parent 7d60290 commit 4a96ae2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions sql/updates/world/2012_03_14_00_world_creature_addon.sql
@@ -0,0 +1,2 @@
UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207210;
UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207211;

This comment has been minimized.

Copy link
@Vincent-Michael

Vincent-Michael Mar 15, 2012

Contributor

what is bytes1 0x3000000?

This comment has been minimized.

Copy link
@Shauren

Shauren Mar 15, 2012

Author Member

this: SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);

This comment has been minimized.

Copy link
@Vincent-Michael

Vincent-Michael Mar 15, 2012

Contributor

okay, ty

Expand Up @@ -269,6 +269,9 @@ class boss_deathbringer_saurfang : public CreatureScript

void EnterCombat(Unit* who)
{
if (_dead)
return;

if (!instance->CheckRequiredBosses(DATA_DEATHBRINGER_SAURFANG, who->ToPlayer()))
{
EnterEvadeMode();
Expand Down Expand Up @@ -336,8 +339,11 @@ class boss_deathbringer_saurfang : public CreatureScript
Talk(SAY_KILL);
}

void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/)
void DamageTaken(Unit* /*attacker*/, uint32& damage)
{
if (damage >= me->GetHealth())
damage = me->GetHealth() - 1;

if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below
{
_frenzied = true;
Expand All @@ -350,6 +356,7 @@ class boss_deathbringer_saurfang : public CreatureScript
_dead = true;
_JustDied();
_EnterEvadeMode();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE);

DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION);
DoCast(me, SPELL_ACHIEVEMENT, true);
Expand Down
Expand Up @@ -250,6 +250,9 @@ class boss_sindragosa : public CreatureScript
return;

me->setActive(true);
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetSpeed(MOVE_FLIGHT, 4.0f);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float moveTime = me->GetExactDist(&SindragosaFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f);
Expand Down Expand Up @@ -277,9 +280,10 @@ class boss_sindragosa : public CreatureScript
me->setActive(false);
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(SindragosaLandPos);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetSpeed(MOVE_FLIGHT, 2.0f);
me->SetSpeed(MOVE_FLIGHT, 2.5f);

// Sindragosa enters combat as soon as she lands
DoZoneInCombat();
Expand All @@ -294,6 +298,7 @@ class boss_sindragosa : public CreatureScript
case POINT_LAND:
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetReactState(REACT_DEFENSIVE);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
Expand Down Expand Up @@ -427,6 +432,7 @@ class boss_sindragosa : public CreatureScript
Talk(SAY_AIR_PHASE);
me->SetCanFly(true);
me->SetDisableGravity(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetReactState(REACT_PASSIVE);
Position pos;
pos.Relocate(me);
Expand Down Expand Up @@ -662,6 +668,7 @@ class npc_spinestalker : public CreatureScript
me->setActive(false);
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(SpinestalkerLandPos);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
Expand Down Expand Up @@ -787,6 +794,7 @@ class npc_rimefang : public CreatureScript
me->setActive(false);
me->SetCanFly(false);
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->SetHomePosition(RimefangLandPos);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
Expand Down

0 comments on commit 4a96ae2

Please sign in to comment.