Core/Units:

- Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side.
- Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis.
- Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply.
- Send correct packet contents for movement update in Unit::SetSpeed.
- Misc. cleanup in affected scripts.
This commit is contained in:
Machiavelli
2012-03-12 00:53:45 +01:00
parent 5ca27f40cc
commit 03a24a84e4
74 changed files with 489 additions and 384 deletions
@@ -121,7 +121,7 @@ public:
MovePhase = 0;
me->SetSpeed(MOVE_RUN, 2.0f);
me->SetLevitate(true);
me->SetDisableGravity(true);
me->SetWalk(false);
me->setActive(true);
@@ -240,7 +240,7 @@ public:
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetLevitate(true);
me->SetDisableGravity(true);
(*me).GetMotionMaster()->Clear(false);
(*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]);
@@ -527,7 +527,7 @@ public:
if (!Arcanagos)
return;
ArcanagosGUID = Arcanagos->GetGUID();
Arcanagos->SetLevitate(true);
Arcanagos->SetDisableGravity(true);
(*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]);
Arcanagos->SetOrientation(ArcanagosPos[3]);
me->SetOrientation(MedivPos[3]);
@@ -497,7 +497,7 @@ public:
void Reset()
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->SetLevitate(true);
me->SetDisableGravity(true);
DoCast(me, SPELL_PHOENIX_BURN, true);
BurnTimer = 2000;
Death_Timer = 3000;
@@ -651,7 +651,7 @@ public:
ChangeTargetTimer = urand(6000, 12000);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetLevitate(true);
me->SetDisableGravity(true);
me->setFaction(14);
DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
@@ -46,7 +46,7 @@ public:
me->setActive(true);
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlying(true);
me->SetCanFly(true);
FlyBackTimer = 500;
phase = 0;
@@ -429,7 +429,7 @@ public:
{
me->SetVisible(false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetSpeed(MOVE_WALK, 5.0f, true);
wp_reached = false;
count = 0;
@@ -462,7 +462,7 @@ public:
instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
break;
case 20:
{
@@ -216,7 +216,7 @@ public:
break;
case 3:
DoCast(me, SPELL_INTRO_FROST_BLAST);
Madrigosa->SetLevitate(true);
Madrigosa->SetDisableGravity(true);
me->AttackStop();
Madrigosa->AttackStop();
IntroFrostBoltTimer = 3000;
@@ -137,7 +137,7 @@ public:
uiFlightCount = 0;
me->SetLevitate(true);
me->SetDisableGravity(true);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
@@ -254,7 +254,7 @@ public:
events.ScheduleEvent(EVENT_FLIGHT, 60000);
break;
case PHASE_FLIGHT:
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000);
uiFlightCount = 0;
uiBreathCount = 0;
@@ -391,7 +391,7 @@ public:
}
break;
case 10:
me->SetLevitate(false);
me->SetDisableGravity(false);
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
EnterPhase(PHASE_GROUND);
AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO));
@@ -159,7 +159,7 @@ public:
if (!bJustReset) //first reset at create
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
me->SetLevitate(false);
me->SetDisableGravity(false);
me->SetVisible(true);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
}
@@ -231,7 +231,7 @@ public:
if (ResetTimer <= diff)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
me->SetLevitate(false);
me->SetDisableGravity(false);
me->SetVisible(true);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
ResetTimer = 10000;
@@ -400,7 +400,7 @@ public:
TalkTimer = 10000;
break;
case 3:
me->SetLevitate(true);
me->SetDisableGravity(true);
me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z);
TalkTimer = 600000;
break;
@@ -418,7 +418,7 @@ public:
TalkTimer = 3000;
break;
case 2:
me->SetLevitate(true);
me->SetDisableGravity(true);
me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z);
TalkTimer = 15000;
break;
@@ -264,7 +264,7 @@ public:
{
OrbsEmpowered = 0;
EmpowerCount = 0;
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setActive(true);
@@ -451,7 +451,7 @@ public:
summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
break;
case CREATURE_ANVEENA:
summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY);
summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
@@ -1188,7 +1188,7 @@ public:
void Reset()
{
me->SetLevitate(true);
me->SetDisableGravity(true);
bPointReached = true;
uiTimer = urand(500, 1000);
uiCheckTimer = 1000;
@@ -324,14 +324,14 @@ class boss_akilzon : public CreatureScript
target->GetPosition(x, y, z);
if (target)
{
target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
target->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0);
}
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
Cloud->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
Cloud->StopMoving();
Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f);
Cloud->setFaction(35);
@@ -409,7 +409,7 @@ class mob_akilzon_eagle : public CreatureScript
EagleSwoop_Timer = urand(5000, 10000);
arrived = true;
TargetGUID = 0;
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
}
void EnterCombat(Unit* /*who*/) {DoZoneInCombat();}
@@ -632,7 +632,7 @@ class mob_janalai_hatchling : public CreatureScript
else
me->GetMotionMaster()->MovePoint(0, hatcherway[1][3][0]+rand()%4-2, 1150.0f+rand()%4-2, hatcherway[1][3][2]);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
}
void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/}
@@ -114,7 +114,7 @@ public:
summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
}
summoned->SetLevitate(true);
summoned->SetDisableGravity(true);
targetGUID = summoned->GetGUID();
}
}
@@ -184,7 +184,7 @@ public:
{
if (EventMove_Timer <= diff)
{
me->SetLevitate(true);
me->SetDisableGravity(true);
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f));
me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation());
EventMove = false;
@@ -355,7 +355,7 @@ public:
break;
case 23:
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
Ughost->SetLevitate(true);
Ughost->SetDisableGravity(true);
DoScriptText(SAY_WP_4, Ughost, me);
m_uiChatTimer = 4000;
break;