[10977] Add ghost speed rate in config: Death.Ghost.RunSpeed.

Also clarify context for remove ghost auras place after set alive state.
This let get more expected results at remove ghost speed aura.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Pat S 2011-01-07 05:28:27 +03:00 committed by VladimirMangos
parent 7aab4eecdf
commit af50b352b2
6 changed files with 17 additions and 3 deletions

View file

@ -4497,12 +4497,13 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
// remove death flag + set aura
SetByteValue(UNIT_FIELD_BYTES_1, 3, 0x00);
SetDeathState(ALIVE);
if(getRace() == RACE_NIGHTELF)
RemoveAurasDueToSpell(20584); // speed bonuses
RemoveAurasDueToSpell(8326); // SPELL_AURA_GHOST
SetDeathState(ALIVE);
SetMovement(MOVE_LAND_WALK);
SetMovement(MOVE_UNROOT);

View file

@ -8267,6 +8267,12 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio)
if (((Creature*)this)->HasSearchedAssistance())
speed *= 0.66f; // best guessed value, so this will be 33% reduction. Based off initial speed, mob can then "run", "walk fast" or "walk".
}
// for player case, we look for some custom rates
else
{
if (getDeathState() == CORPSE)
speed *= sWorld.getConfig(CONFIG_FLOAT_GHOST_RUN_SPEED);
}
// Apply strongest slow aura mod to speed
int32 slow = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);

View file

@ -708,6 +708,7 @@ void World::LoadConfigSettings(bool reload)
setConfig(CONFIG_BOOL_DEATH_CORPSE_RECLAIM_DELAY_PVE, "Death.CorpseReclaimDelay.PvE", true);
setConfig(CONFIG_BOOL_DEATH_BONES_WORLD, "Death.Bones.World", true);
setConfig(CONFIG_BOOL_DEATH_BONES_BG_OR_ARENA, "Death.Bones.BattlegroundOrArena", true);
setConfigMinMax(CONFIG_FLOAT_GHOST_RUN_SPEED, "Death.Ghost.RunSpeed", 1.0f, 0.1f, 10.0f);
setConfig(CONFIG_FLOAT_THREAT_RADIUS, "ThreatRadius", 100.0f);

View file

@ -269,6 +269,7 @@ enum eConfigFloatValues
CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS,
CONFIG_FLOAT_GROUP_XP_DISTANCE,
CONFIG_FLOAT_THREAT_RADIUS,
CONFIG_FLOAT_GHOST_RUN_SPEED,
CONFIG_FLOAT_VALUE_COUNT
};

View file

@ -1267,6 +1267,10 @@ Visibility.Distance.Grey.Object = 10
# Default: 1 (enabled)
# 0 (disabled)
#
# Death.Ghost.RunSpeed
# Modifies the speed of player's ghosts, removed upon reviving, not permanent/saved
# Default: 1.0 (normal speed)
#
###################################################################################################################
Rate.Health = 1
@ -1325,6 +1329,7 @@ Death.CorpseReclaimDelay.PvP = 1
Death.CorpseReclaimDelay.PvE = 1
Death.Bones.World = 1
Death.Bones.BattlegroundOrArena = 1
Death.Ghost.RunSpeed = 1.0
###################################################################################################################
# BATTLEGROUND CONFIG

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10976"
#define REVISION_NR "10977"
#endif // __REVISION_NR_H__