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/Object.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/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 5a4d5d126f4..d7ec1c110cc 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1531,14 +1531,4 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, z = GetPositionZ(); UpdateGroundPositionZ(x,y,z); -} - -void WorldObject::GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const -{ - float object_size = obj->GetObjectSize();//here we use object_size to determine the angle offset, the bigger object the smaller angle offset, then this makes mob move naturally in visual. - //let assume 12.0f is the max size for object to have 0 angle offset. - float angle_offset_ratio = 1 - object_size/12.0f; - if (angle_offset_ratio < 0.05) angle_offset_ratio = 0.05; - // angle to face `obj` to `this`plus a random angle offset(from -90 degree to 90 degree)*angle_offset_ratio using distance from distance2dMin to distance2dMax includes size of `obj` - GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI/2 - M_PI * rand_norm()) * angle_offset_ratio); -} +}
\ No newline at end of file |