diff options
| author | n0n4m3 <none@none> | 2010-01-16 19:35:30 +0300 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2010-01-16 19:35:30 +0300 |
| commit | c9a3698a1130fc4b150ff0574da043e38f61bc99 (patch) | |
| tree | 0d657a11d9c41387f413c330d7c5127bdf7a11f0 /src/game/Unit.cpp | |
| parent | ec10853f22694f322a62cc530d82d446e206b5ac (diff) | |
Implement speed reduction at creatures DoFleeToGetAssistance, by NoFantasy.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 268de0d0f05..04de0f4840a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8927,7 +8927,12 @@ bool Unit::AttackStop() if (GetTypeId() == TYPEID_UNIT) { ((Creature*)this)->SetNoCallAssistance(false); - ((Creature*)this)->SetNoSearchAssistance(false); + + if (((Creature*)this)->HasSearchedAssistance()) + { + ((Creature*)this)->SetNoSearchAssistance(false); + UpdateSpeed(MOVE_RUN, false); + } } SendMeleeAttackStop(victim); @@ -11714,6 +11719,13 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) break; } + // for creature case, we check explicit if mob searched for assistance + if (GetTypeId() == TYPEID_UNIT) + { + 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". + } + // Apply strongest slow aura mod to speed int32 slow = GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED); if (slow) |
