aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-23 13:53:52 -0800
committermaximius <none@none>2009-11-23 13:53:52 -0800
commit75a500218dda8156db7a7a8262f06fe21d936def (patch)
treeddc6b91daf6db40c4ada456c13a02f9389b3d0ec /src
parent54d341b0c92608772e9fdd6e6acb5874e1280b53 (diff)
*Should fix a crash, and some weird behavior in boss_razorscale.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
index 8136ae708da..535fb275d3c 100644
--- a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
+++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp
@@ -107,17 +107,7 @@ struct TRINITY_DLL_DECL boss_razorscaleAI : public BossAI
void UpdateAI(const uint32 diff)
{
- if (!me->isInCombat())
- return;
-
- if (me->getThreatManager().isThreatListEmpty())
- {
- EnterEvadeMode();
- return;
- }
-
- Unit *victim = me->SelectVictim();
- if (victim == NULL)
+ if (!UpdateVictim())
return;
if(m_creature->GetPositionY() > -60 || m_creature->GetPositionX() < 450) // Not Blizzlike, anti-exploit to prevent players from pulling bosses to vehicles.
@@ -129,11 +119,8 @@ struct TRINITY_DLL_DECL boss_razorscaleAI : public BossAI
}
// Victim is not controlled by a player (should never happen)
- if(m_creature->getVictim() && !m_creature->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- m_creature->getVictim()->CombatStop(false); // Force the unit to exit combat..
- m_creature->getVictim()->GetMotionMaster()->MoveTargetedHome(); // and return home, so they don't just stand there.
- }
+ if (m_creature->getVictim() && !m_creature->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
+ m_creature->Kill(m_creature->getVictim());
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
{
@@ -217,8 +204,6 @@ struct TRINITY_DLL_DECL boss_razorscaleAI : public BossAI
} else FlameBuffetTimer -= diff;
}
- if (me->getVictim() != victim && (Phase != 3 || FlameBuffetTimer <= 15000)) // Not sure about this.
- AttackStart(victim);
DoMeleeAttackIfReady();
}
else if (Phase == 1) //Flying Phase
@@ -293,10 +278,10 @@ struct TRINITY_DLL_DECL boss_razorscaleAI : public BossAI
if (Phase == 1) // Flying Phase
{
if (m_creature->GetPositionZ() > FlightHeight) // Correct height, stop moving
- m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
else // Incorrect height
{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
m_creature->GetMotionMaster()->MovePoint(0, x, y, FlightHeight + 0.5f); // Fly to slightly above (x, y, FlightHeight)
}
}
@@ -305,7 +290,7 @@ struct TRINITY_DLL_DECL boss_razorscaleAI : public BossAI
const float CurrentGroundLevel = m_creature->GetBaseMap()->GetHeight(m_creature->GetPositionX(), m_creature->GetPositionY(), MAX_HEIGHT);
//if (StunTimer == 30000) // Only fly around if not stunned.
//{
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
if (IsFlying && m_creature->GetPositionZ() > CurrentGroundLevel) // Fly towards the ground
m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), CurrentGroundLevel);
// TODO: Swoop up just before landing