Changeset 72

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

Location:
trunk/src/game
Files:
4 modified

Legend:

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

    r44 r72  
    12421242 
    12431243    float Scale = (float)atof((char*)args); 
    1244     if (Scale > 3.0f || Scale <= 0.0f) 
     1244    if (Scale > 10.0f || Scale <= 0.0f) 
    12451245    { 
    12461246        SendSysMessage(LANG_BAD_VALUE); 
  • 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 
  • trunk/src/game/Totem.cpp

    r44 r72  
    162162        m_type = TOTEM_STATUE;                              //Jewelery statue 
    163163} 
     164 
     165bool Totem::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges) 
     166{ 
     167    for (int i=0;i<3;i++) 
     168    { 
     169        switch(spellInfo->EffectApplyAuraName[i]) 
     170        { 
     171            case SPELL_AURA_PERIODIC_DAMAGE: 
     172            case SPELL_AURA_PERIODIC_LEECH: 
     173                return true; 
     174            default: 
     175                continue; 
     176        } 
     177    } 
     178    return Creature::IsImmunedToSpell(spellInfo, useCharges); 
     179} 
  • trunk/src/game/Totem.h

    r44 r72  
    5555        void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {} 
    5656        void UpdateDamagePhysical(WeaponAttackType /*attType*/) {} 
     57         
     58        bool IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges = false); 
    5759 
    5860    protected: