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
@@ -101,7 +101,7 @@ public:
DoScriptText(SAY_INTRO, me);
}
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
float attackRadius = me->GetAttackDistance(who);
@@ -798,7 +798,7 @@ public:
{
case 1: // lift off
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
me->StopMoving();
me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_TAKEOFF);
@@ -867,7 +867,7 @@ public:
Timer[EVENT_FLIGHT_SEQUENCE] = 2000;
break;
case 9: // land
me->SetLevitate(false);
me->SetDisableGravity(false);
me->StopMoving();
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
for (uint8 i = 0; i < 2; ++i)
@@ -1869,7 +1869,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset()
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
me->SetLevitate(false);
me->SetDisableGravity(false);
me->setActive(false);
Summons.DespawnAll();
}
@@ -731,7 +731,7 @@ public:
void Reset()
{
me->SetLevitate(true);
me->SetDisableGravity(true);
me->setFaction(14);
MovementTimer = 0;
ToxicSporeTimer = 5000;
@@ -109,7 +109,7 @@ public:
}
void Reset()
{
me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY);
SpoutAnimTimer = 1000;
RotTimer = 0;
WaterboltTimer = 15000; // give time to get in range when fight starts
@@ -153,7 +153,7 @@ class instance_serpent_shrine : public InstanceMapScript
if (Creature* frenzy = player->SummonCreature(MOB_COILFANG_FRENZY, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2000))
{
frenzy->Attack(player, false);
frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY);
}
DoSpawnFrenzy = false;
}
@@ -145,7 +145,7 @@ class boss_nazan : public CreatureScript
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
me->SetLevitate(false);
me->SetDisableGravity(false);
me->SetWalk(true);
me->GetMotionMaster()->Clear();
if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0))
@@ -374,7 +374,7 @@ class boss_vazruden_the_herald : public CreatureScript
if (summoned->GetEntry() == ENTRY_NAZAN)
{
CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID;
summoned->SetLevitate(true);
summoned->SetDisableGravity(true);
summoned->SetSpeed(MOVE_FLIGHT, 2.5f);
if (victim)
AttackStartNoMove(victim);
@@ -87,7 +87,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript
{
if (!me->getVictim() && me->canCreatureAttack(who))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
float attackRadius = me->GetAttackDistance(who);
@@ -130,7 +130,7 @@ class boss_alar : public CreatureScript
//me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
//me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setActive(false);
}
@@ -140,7 +140,7 @@ class boss_alar : public CreatureScript
if (instance)
instance->SetData(DATA_ALAREVENT, IN_PROGRESS);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); // after enterevademode will be set walk movement
DoZoneInCombat();
me->setActive(true);
}
@@ -470,7 +470,7 @@ class mob_ember_of_alar : public CreatureScript
mob_ember_of_alarAI(Creature* creature) : ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
creature->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY);
creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
@@ -399,7 +399,7 @@ class boss_kaelthas : public CreatureScript
{
if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
float attackRadius = me->GetAttackDistance(who);
@@ -316,7 +316,7 @@ class npc_warden_mellichar : public CreatureScript
if (!me->getVictim() && me->canCreatureAttack(who))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
if (who->GetTypeId() != TYPEID_PLAYER)
return;
@@ -751,7 +751,7 @@ class npc_simon_bunny : public CreatureScript
// Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node
void SetGUID(uint64 guid, int32 id)
{
me->SetFlying(true);
me->SetCanFly(true);
large = (bool)id;
playerGUID = guid;
@@ -223,7 +223,7 @@ public:
me->setFaction(FACTION_DEFAULT);
FlyTimer = 10000;
me->SetLevitate(false);
me->SetDisableGravity(false);
me->SetVisible(true);
}
@@ -270,7 +270,7 @@ public:
PlayerGUID = 0;
}
me->SetVisible(false);
me->SetLevitate(false);
me->SetDisableGravity(false);
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
}
@@ -308,7 +308,7 @@ public:
pos.m_positionZ += 25;
}
me->SetLevitate(true);
me->SetDisableGravity(true);
me->GetMotionMaster()->MovePoint(1, pos);
}
}
@@ -808,7 +808,7 @@ public:
case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break;
case 20:
Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
Illi->SetLevitate(true);
Illi->SetDisableGravity(true);
return 500; break;
case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break;
case 22: