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

[svn] * Raise modify scale limit from 3 to 10 for players
* Implement immunity totems from periodic damage spell effects. Source: Mangos
* Implemented second choice aggro targets for creatures. Source: Mangos

Original author: KingPin?
Date: 2008-10-19 16:52:50-05:00

Files:
1 modified

Legend:

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

    r44 r72  
    268268    HostilReference* currentRef = NULL; 
    269269    bool found = false; 
     270     
     271    std::list<HostilReference*>::iterator lastRef = iThreatList.end(); 
     272    lastRef--; 
     273     
    270274    for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter) 
    271275    { 
     
    274278        Unit* target = currentRef->getTarget(); 
    275279        assert(target);                                     // if the ref has status online the target must be there ! 
     280         
     281        // some units are prefered in comparison to others 
     282        if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) || 
     283                target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING) 
     284                ) ) 
     285        { 
     286            // current victim is a second choice target, so don't compare threat with it below 
     287            if(currentRef == pCurrentVictim) 
     288                pCurrentVictim = NULL; 
     289            continue; 
     290        } 
    276291 
    277292        if(!pAttacker->IsOutOfThreatArea(target))           // skip non attackable currently targets