Show
Ignore:
Timestamp:
11/19/08 13:39:50 (17 years ago)
Author:
yumileroy
Message:

[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).

Original author: megamage
Date: 2008-10-31 21:42:00-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Unit.cpp

    r140 r141  
    421421    float distsq = dx*dx + dy*dy + dz*dz; 
    422422    //not sure here, or combatreach + combatreach? 
    423     float sizefactor = GetObjectSize() + obj->GetFloatValue(UNIT_FIELD_COMBATREACH); 
     423    float sizefactor = GetFloatValue(UNIT_FIELD_COMBATREACH) + obj->GetFloatValue(UNIT_FIELD_COMBATREACH); 
    424424    float maxdist = dist2compare + sizefactor; 
    425425 
    426426    return distsq < maxdist * maxdist; 
     427} 
     428 
     429void Unit::GetRandomContactPoint( const Unit* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax ) const 
     430{ 
     431        uint32 attacker_number = getAttackers().size(); 
     432    if(attacker_number > 0) --attacker_number; 
     433        GetNearPoint(obj,x,y,z,obj->GetFloatValue(UNIT_FIELD_COMBATREACH),distance2dMin+(distance2dMax-distance2dMin)*rand_norm() 
     434        , GetAngle(obj) + (attacker_number ? (M_PI/2 - M_PI * rand_norm()) * (float)attacker_number / GetFloatValue(UNIT_FIELD_COMBATREACH) / 3 : 0)); 
    427435} 
    428436