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

[svn] Fix 146_world.sql. Do not use default for text. (Ignore this if you have successfully applied 146_world.sql)
Fix HandleAuraModIncreaseHealth?, also increase current health.
Merge from Mangos:
2008-11-02 10:53:27 854e0d64e3410b2a1eff6d56705f8e42b4291534 Do not split self caused damage.
(PART) 2008-10-31 12:45:22 e56b671979623570acd358a9b99aa169be22ffba Move tamed pet creating code to new function.

Original author: megamage
Date: 2008-11-04 09:23:06-06:00

Files:
1 modified

Legend:

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

    r139 r161  
    1111 * This program is distributed in the hope that it will be useful, 
    1212 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414 * GNU General Public License for more details. 
    1515 * 
    1616 * You should have received a copy of the GNU General Public License 
    1717 * along with this program; if not, write to the Free Software 
    18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
     18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
    1919 */ 
    2020 
     
    29122912        if(m_target->GetTypeId() == TYPEID_PLAYER) 
    29132913            ((Player*)m_target)->setFactionForRace(m_target->getRace()); 
    2914  
    29152914        else if(m_target->GetTypeId() == TYPEID_UNIT) 
    29162915        { 
     
    46254624void Aura::HandleAuraModIncreaseHealth(bool apply, bool Real) 
    46264625{ 
    4627     // Special case with temporary increase max/current health 
    4628     switch(GetId()) 
    4629     { 
    4630         case 12976:                                         // Warrior Last Stand triggered spell 
    4631         case 28726:                                         // Nightmare Seed ( Nightmare Seed ) 
    4632         case 34511:                                         // Valor (Bulwark of Kings, Bulwark of the Ancient Kings) 
    4633         case 44055:                                         // Tremendous Fortitude (Battlemaster's Alacrity) 
    4634         { 
    4635             if(Real) 
    4636             { 
    4637                 if(apply) 
    4638                 { 
    4639                     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
    4640                     m_target->ModifyHealth(m_modifier.m_amount); 
    4641                 } 
    4642                 else 
    4643                 { 
    4644                     if (int32(m_target->GetHealth()) > m_modifier.m_amount) 
    4645                         m_target->ModifyHealth(-m_modifier.m_amount); 
    4646                     else 
    4647                         m_target->SetHealth(1); 
    4648                     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
    4649                 } 
    4650             } 
    4651             return; 
    4652         } 
    4653     } 
    4654  
    4655     // generic case 
    4656     m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4626    if(Real) 
     4627    { 
     4628        if(apply) 
     4629        { 
     4630            m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4631            m_target->ModifyHealth(m_modifier.m_amount); 
     4632        } 
     4633        else 
     4634        { 
     4635            if (int32(m_target->GetHealth()) > m_modifier.m_amount) 
     4636                m_target->ModifyHealth(-m_modifier.m_amount); 
     4637            else 
     4638                m_target->SetHealth(1); 
     4639            m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4640        } 
     4641    } 
    46574642} 
    46584643