Core/Movement:

- Lower movement radius and speed when confused/disoriented.
- Force attackstop when confused or feared. Should fix issue with creatures "teleporting" after fear.

Close #2689
Close #466
Close #3743
This commit is contained in:
kaelima
2011-11-13 02:36:51 +01:00
parent 79903f31ce
commit 9b7e9a1ee3
3 changed files with 28 additions and 26 deletions
+14 -7
View File
@@ -2220,22 +2220,23 @@ void Unit::SendMeleeAttackStart(Unit* victim)
WorldPacket data(SMSG_ATTACKSTART, 8 + 8);
data << uint64(GetGUID());
data << uint64(victim->GetGUID());
SendMessageToSet(&data, true);
sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
}
void Unit::SendMeleeAttackStop(Unit* victim)
{
if (!victim)
return;
WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); // we guess size
data.append(GetPackGUID());
data.append(victim->GetPackGUID()); // can be 0x00...
data << uint32(0); // can be 0x1
data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00...
data << uint32(0); // can be 0x1
SendMessageToSet(&data, true);
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
if (victim)
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
else
sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());
}
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
@@ -15635,6 +15636,9 @@ void Unit::SetControlled(bool apply, UnitState state)
case UNIT_STAT_CONFUSED:
if (!HasUnitState(UNIT_STAT_STUNNED))
{
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
SendMeleeAttackStop();
// SendAutoRepeatCancel ?
SetConfused(true);
CastStop();
}
@@ -15642,6 +15646,9 @@ void Unit::SetControlled(bool apply, UnitState state)
case UNIT_STAT_FLEEING:
if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED))
{
ClearUnitState(UNIT_STAT_MELEE_ATTACKING);
SendMeleeAttackStop();
// SendAutoRepeatCancel ?
SetFeared(true);
CastStop();
}
+1 -1
View File
@@ -1310,7 +1310,7 @@ class Unit : public WorldObject
void CombatStopWithPets(bool includingCast = false);
void StopAttackFaction(uint32 faction_id);
Unit* SelectNearbyTarget(float dist = NOMINAL_MELEE_RANGE) const;
void SendMeleeAttackStop(Unit* victim);
void SendMeleeAttackStop(Unit* victim = NULL);
void SendMeleeAttackStart(Unit* pVictim);
void AddUnitState(uint32 f) { m_state |= f; }