[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

--HG--
branch : trunk
This commit is contained in:
KingPin
2008-10-19 16:52:50 -05:00
parent 76adf24586
commit 0d8d686d81
4 changed files with 34 additions and 1 deletions
+15
View File
@@ -267,12 +267,27 @@ HostilReference* ThreatContainer::selectNextVictim(Creature* pAttacker, HostilRe
{
HostilReference* currentRef = NULL;
bool found = false;
std::list<HostilReference*>::iterator lastRef = iThreatList.end();
lastRef--;
for(std::list<HostilReference*>::iterator iter = iThreatList.begin(); iter != iThreatList.end() && !found; ++iter)
{
currentRef = (*iter);
Unit* target = currentRef->getTarget();
assert(target); // if the ref has status online the target must be there !
// some units are prefered in comparison to others
if(iter != lastRef && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask(), false) ||
target->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING)
) )
{
// current victim is a second choice target, so don't compare threat with it below
if(currentRef == pCurrentVictim)
pCurrentVictim = NULL;
continue;
}
if(!pAttacker->IsOutOfThreatArea(target)) // skip non attackable currently targets
{