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

[svn] * Fixed xp calculation for low level characters when grouped with a higher level player. Patch provided by Reiner030.
* Fixed positive spells being not resistable when cast on hostile units. Patch provided by QAston.
* Fixed compile warnings in gcc. Patch provided by WarHead?.

Original author: w12x
Date: 2008-10-26 11:50:07-05:00

Files:
1 modified

Legend:

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

    r102 r111  
    589589        SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 
    590590    // set starting gold 
    591     SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD)*10000 ); 
     591    SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD) ); 
    592592 
    593593    // set starting honor 
     
    1818818188        uint32 sum_level = 0; 
    1818918189        Player* member_with_max_level = NULL; 
    18190  
    18191         pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level); 
     18190        Player* not_gray_member_with_max_level = NULL; 
     18191 
     18192        // gets the max member level of the group, and the max member level that still gets XP 
     18193        pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level); 
    1819218194 
    1819318195        if(member_with_max_level) 
    1819418196        { 
    18195             xp = PvP ? 0 : Trinity::XP::Gain(member_with_max_level, pVictim); 
     18197            // PvP kills doesn't yield experience 
     18198            // also no XP gained if there is no member below gray level 
     18199            xp = (PvP || !not_gray_member_with_max_level) ? 0 : Trinity::XP::Gain(not_gray_member_with_max_level, pVictim); 
    1819618200 
    1819718201            // skip in check PvP case (for speed, not used) 
     
    1822318227 
    1822418228                    // XP updated only for alive group member 
    18225                     if(pGroupGuy->isAlive()) 
     18229                    if(pGroupGuy->isAlive() && not_gray_member_with_max_level && 
     18230                       pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel()) 
    1822618231                    { 
    18227                         uint32 itr_xp = uint32(xp*rate); 
     18232                        uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1); 
    1822818233 
    1822918234                        pGroupGuy->GiveXP(itr_xp, pVictim);