diff options
author | megamage <none@none> | 2008-10-31 21:42:00 -0500 |
---|---|---|
committer | megamage <none@none> | 2008-10-31 21:42:00 -0500 |
commit | e2eb694c57885e49f37c328b899d802e1ff4ea90 (patch) | |
tree | 7259333552fadf2bd67414c70e85b3cf3bd797c0 /src/game/TargetedMovementGenerator.cpp | |
parent | 1c3d4c40c3fef1eec9d1c8438254e97cdcef063a (diff) |
[svn] Improve TargetedMovement (TODO: let mob find "near angle" rather than "random angle").
Delete a repeated check in instance canenter().
Fix some spell targets.
Add some sunwell spell sql.
Fix Magtheridons earthquake. (TODO: need to find out why soul transfer has no effect when casted by mobs)
Let Brutallus dual wield. Enable burn (still no script effect).
Quick fix for shadowmoon valley illidan quest crash (wait for author's fix).
--HG--
branch : trunk
Diffstat (limited to 'src/game/TargetedMovementGenerator.cpp')
-rw-r--r-- | src/game/TargetedMovementGenerator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index 125335455d4..283fcfa8343 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -60,7 +60,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) if(!i_offset) { // to nearest random contact position - i_target->GetRandomContactPoint( &owner, x, y, z,0.5f,4.5f ); + i_target->GetRandomContactPoint( &owner, x, y, z, 0.5f, ATTACK_DISTANCE - 0.5f ); } else { @@ -164,7 +164,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) if (owner.GetObjectSize()) i_destinationHolder.ResetUpdate(50); - float dist = i_target->GetObjectSize() + owner.GetObjectSize() + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); + float dist = owner.GetFloatValue(UNIT_FIELD_COMBATREACH) + i_target.getTarget()->GetFloatValue(UNIT_FIELD_COMBATREACH) + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); //More distance let have better performance, less distance let have more sensitive reaction at target move. @@ -185,7 +185,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) owner.SetInFront(i_target.getTarget()); owner.StopMoving(); - if(owner.canReachWithAttack(i_target.getTarget()) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) + if(owner.IsWithinCombatDist(i_target.getTarget(), ATTACK_DISTANCE) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) owner.Attack(i_target.getTarget(),true); } } |