Changeset 119
- Timestamp:
- 11/19/08 13:37:56 (17 years ago)
- Location:
- trunk/src
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bindings/scripts/sql/Updates/r125_trinity.sql
r117 r119 1 update creature_template set speed='0.01' 1 update creature_template set speed='0.01',scriptname='mob_toxic_sporebat' WHERE entry=22140; 2 2 update creature_template SET scriptname='npc_overlord_morghor' WHERE entry=23139; 3 3 update creature_template SET scriptname='npc_lord_illidan_stormrage' WHERE entry=22083; -
trunk/src/game/Object.cpp
r102 r119 1489 1489 GetNearPoint2D(x,y,distance2d+searcher_size,absAngle); 1490 1490 1491 z = GetPositionZ(); 1492 1493 UpdateGroundPositionZ(x,y,z); 1494 } 1491 z = GetPositionZ(); 1492 1493 UpdateGroundPositionZ(x,y,z); 1494 } 1495 1496 void WorldObject::GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const 1497 { 1498 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. 1499 //let assume 12.0f is the max size for object to have 0 angle offset. 1500 float angle_offset_ratio = 1 - object_size/12.0f; 1501 if (angle_offset_ratio < 0.05) angle_offset_ratio = 0.05; 1502 // 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` 1503 GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI_2 - M_PI * rand_norm()) * angle_offset_ratio); 1504 } -
trunk/src/game/Object.h
r118 r119 373 373 GetNearPoint(obj,x,y,z,obj->GetObjectSize(),distance2d,GetAngle( obj )); 374 374 } 375 void GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const 376 { 377 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. 378 //let assume 12.0f is the max size for object to have 0 angle offset. 379 float angle_offset_ratio = 1 - object_size/12.0f; 380 if (angle_offset_ratio < 0.05) angle_offset_ratio = 0.05; 381 // 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` 382 GetNearPoint(obj,x,y,z,object_size,distance2dMin+(distance2dMax-distance2dMin)*rand_norm(), GetAngle( obj ) + (M_PI_2 - M_PI * rand_norm()) * angle_offset_ratio); 383 } 375 void GetRandomContactPoint( const WorldObject* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const; 384 376 385 377 float GetObjectSize() const