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/TargetedMovementGenerator.cpp

    r118 r141  
    6161    { 
    6262        // to nearest random contact position  
    63         i_target->GetRandomContactPoint( &owner, x, y, z,0.5f,4.5f ); 
     63        i_target->GetRandomContactPoint( &owner, x, y, z, 0.5f, ATTACK_DISTANCE - 0.5f ); 
    6464    } 
    6565    else 
     
    165165            i_destinationHolder.ResetUpdate(50); 
    166166 
    167         float dist = i_target->GetObjectSize() + owner.GetObjectSize() + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); 
     167        float dist = owner.GetFloatValue(UNIT_FIELD_COMBATREACH) + i_target.getTarget()->GetFloatValue(UNIT_FIELD_COMBATREACH) + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); 
    168168 
    169169        //More distance let have better performance, less distance let have more sensitive reaction at target move. 
     
    186186 
    187187            owner.StopMoving(); 
    188             if(owner.canReachWithAttack(i_target.getTarget()) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) 
     188            if(owner.IsWithinCombatDist(i_target.getTarget(), ATTACK_DISTANCE) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) 
    189189                owner.Attack(i_target.getTarget(),true); 
    190190        }