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
+1 -1
View File
@@ -54,7 +54,7 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj)
void GuardAI::MoveInLineOfSight(Unit* unit)
{
// Ignore Z for flying creatures
if (!me->canFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE)
return;
if (!me->getVictim() && me->IsValidAttackTarget(unit) &&
@@ -95,7 +95,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* who)
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
return;
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(who))
@@ -93,7 +93,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who)
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (me->IsHostileTo(who))
+1 -11
View File
@@ -729,17 +729,7 @@ void SmartAI::SetRun(bool run)
void SmartAI::SetFly(bool fly)
{
if (fly)
{
me->SetLevitate(true);
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01);
}
else
{
me->SetLevitate(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01);
}
me->SetFlying(fly);
me->SetDisableGravity(fly);
me->SendMovementFlagUpdate();
}