*More updates to Rate.MoveSpeed, thanks megamage
--HG-- branch : trunk
This commit is contained in:
+13
-5
@@ -68,6 +68,17 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
|
|||||||
4.5f, // MOVE_FLIGHT_BACK
|
4.5f, // MOVE_FLIGHT_BACK
|
||||||
3.14f // MOVE_PITCH_RATE
|
3.14f // MOVE_PITCH_RATE
|
||||||
};
|
};
|
||||||
|
float playerBaseMoveSpeed[MAX_MOVE_TYPE] = {
|
||||||
|
2.5f, // MOVE_WALK
|
||||||
|
7.0f, // MOVE_RUN
|
||||||
|
3.0f, // MOVE_RUN_BACK
|
||||||
|
4.722222f, // MOVE_SWIM
|
||||||
|
4.5f, // MOVE_SWIM_BACK
|
||||||
|
3.141594f, // MOVE_TURN_RATE
|
||||||
|
7.0f, // MOVE_FLIGHT
|
||||||
|
4.5f, // MOVE_FLIGHT_BACK
|
||||||
|
3.14f // MOVE_PITCH_RATE
|
||||||
|
};
|
||||||
|
|
||||||
// Used for prepare can/can`t triggr aura
|
// Used for prepare can/can`t triggr aura
|
||||||
static bool InitTriggerAuraData();
|
static bool InitTriggerAuraData();
|
||||||
@@ -10860,7 +10871,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
|
|
||||||
non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
|
non_stack_bonus = (100.0 + GetMaxPositiveAuraModifier(SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK))/100.0f;
|
||||||
|
|
||||||
// Update speed for vehicle if avalible
|
// Update speed for vehicle if available
|
||||||
if (GetTypeId()==TYPEID_PLAYER && GetVehicle())
|
if (GetTypeId()==TYPEID_PLAYER && GetVehicle())
|
||||||
GetVehicleBase()->UpdateSpeed(MOVE_FLIGHT, true);
|
GetVehicleBase()->UpdateSpeed(MOVE_FLIGHT, true);
|
||||||
break;
|
break;
|
||||||
@@ -10890,7 +10901,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
if(int32 normalization = GetMaxPositiveAuraModifier(SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED))
|
if(int32 normalization = GetMaxPositiveAuraModifier(SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED))
|
||||||
{
|
{
|
||||||
// Use speed from aura
|
// Use speed from aura
|
||||||
float max_speed = normalization / baseMoveSpeed[mtype];
|
float max_speed = normalization / (IsControlledByPlayer() ? playerBaseMoveSpeed[mtype] : baseMoveSpeed[mtype]);
|
||||||
if (speed > max_speed)
|
if (speed > max_speed)
|
||||||
speed = max_speed;
|
speed = max_speed;
|
||||||
}
|
}
|
||||||
@@ -10900,9 +10911,6 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only players and pets should get speed increase from Rate.MoveSpeed
|
|
||||||
if(GetTypeId() != TYPEID_PLAYER && GetOwner()->GetTypeId() != TYPEID_PLAYER) speed /= sWorld.getRate(RATE_MOVESPEED);
|
|
||||||
|
|
||||||
// Apply strongest slow aura mod to speed
|
// Apply strongest slow aura mod to speed
|
||||||
int32 slow = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
|
int32 slow = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||||
if (slow)
|
if (slow)
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ enum UnitMoveType
|
|||||||
#define MAX_MOVE_TYPE 9
|
#define MAX_MOVE_TYPE 9
|
||||||
|
|
||||||
extern float baseMoveSpeed[MAX_MOVE_TYPE];
|
extern float baseMoveSpeed[MAX_MOVE_TYPE];
|
||||||
|
extern float playerBaseMoveSpeed[MAX_MOVE_TYPE];
|
||||||
|
|
||||||
enum WeaponAttackType
|
enum WeaponAttackType
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -524,7 +524,7 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
sLog.outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.",rate_values[RATE_MOVESPEED]);
|
sLog.outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.",rate_values[RATE_MOVESPEED]);
|
||||||
rate_values[RATE_MOVESPEED] = 1.0f;
|
rate_values[RATE_MOVESPEED] = 1.0f;
|
||||||
}
|
}
|
||||||
for(uint8 i = 0; i < MAX_MOVE_TYPE; ++i) baseMoveSpeed[i] *= rate_values[RATE_MOVESPEED];
|
for(uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED];
|
||||||
rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f);
|
rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f);
|
||||||
|
|
||||||
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f);
|
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f);
|
||||||
|
|||||||
@@ -1259,7 +1259,7 @@ Visibility.Distance.Grey.Object = 10
|
|||||||
# Default: 1
|
# Default: 1
|
||||||
#
|
#
|
||||||
# Rate.MoveSpeed
|
# Rate.MoveSpeed
|
||||||
# Multiply the default movement speed for players and their pets.
|
# Multiply the default movement speed for players, and whatever they're controlling.
|
||||||
# Default: 1 - no change
|
# Default: 1 - no change
|
||||||
# 1.4 - 40% increase
|
# 1.4 - 40% increase
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user