Changeset 111 for trunk/src/game
- Timestamp:
- 11/19/08 13:37:03 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 9 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ArenaTeam.cpp
r102 r111 721 721 return; 722 722 // to get points, a player has to participate in at least 30% of the matches 723 uint32 min_plays = ceil(stats.games * 0.3);723 uint32 min_plays = (uint32)ceil(stats.games * 0.3); 724 724 for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr) 725 725 { -
trunk/src/game/Formulas.h
r102 r111 30 30 inline uint32 hk_honor_at_level(uint32 level, uint32 count=1) 31 31 { 32 return ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f )));32 return (uint32) ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f ))); 33 33 } 34 34 } -
trunk/src/game/GameEvent.cpp
r102 r111 1528 1528 { 1529 1529 if(itr->second.done_world_state) 1530 plr->SendUpdateWorldState(itr->second.done_world_state, itr->second.done);1530 plr->SendUpdateWorldState(itr->second.done_world_state, (uint32)(itr->second.done)); 1531 1531 if(itr->second.max_world_state) 1532 plr->SendUpdateWorldState(itr->second.max_world_state, itr->second.reqNum);1533 } 1534 } 1532 plr->SendUpdateWorldState(itr->second.max_world_state, (uint32)(itr->second.reqNum)); 1533 } 1534 } -
trunk/src/game/Group.cpp
r102 r111 27 27 #include "ObjectMgr.h" 28 28 #include "Group.h" 29 #include "Formulas.h" 29 30 #include "ObjectAccessor.h" 30 31 #include "BattleGround.h" … … 786 787 } 787 788 788 void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level )789 void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level) 789 790 { 790 791 for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) … … 799 800 ++count; 800 801 sum_level += member->getLevel(); 802 // store maximum member level 801 803 if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel()) 802 804 member_with_max_level = member; 805 806 uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel()); 807 // if the victim is higher level than the gray level of the currently examined group member, 808 // then set not_gray_member_with_max_level if needed. 809 if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level 810 || not_gray_member_with_max_level->getLevel() < member->getLevel())) 811 not_gray_member_with_max_level = member; 803 812 } 804 813 } -
trunk/src/game/Group.h
r102 r111 218 218 GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); } 219 219 uint32 GetMembersCount() const { return m_memberSlots.size(); } 220 void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level );220 void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level); 221 221 uint8 GetMemberGroup(uint64 guid) const 222 222 { -
trunk/src/game/OutdoorPvPHP.cpp
r102 r111 122 122 BuffTeam(HORDE); 123 123 else 124 BuffTeam( NULL);124 BuffTeam(0); 125 125 SendUpdateWorldState(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); 126 126 SendUpdateWorldState(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled); -
trunk/src/game/Player.cpp
r102 r111 589 589 SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) ); 590 590 // 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) ); 592 592 593 593 // set starting honor … … 18188 18188 uint32 sum_level = 0; 18189 18189 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); 18192 18194 18193 18195 if(member_with_max_level) 18194 18196 { 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); 18196 18200 18197 18201 // skip in check PvP case (for speed, not used) … … 18223 18227 18224 18228 // 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()) 18226 18231 { 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); 18228 18233 18229 18234 pGroupGuy->GiveXP(itr_xp, pVictim); -
trunk/src/game/Unit.cpp
r110 r111 2828 2828 // All positive spells can`t miss 2829 2829 // TODO: client not show miss log for this spells - so need find info for this in dbc and use it! 2830 if (IsPositiveSpell(spell->Id)) 2830 if (IsPositiveSpell(spell->Id) 2831 &&(!IsHostileTo(pVictim))) //prevent from affecting enemy by "positive" spell 2831 2832 return SPELL_MISS_NONE; 2832 2833 -
trunk/src/game/World.cpp
r110 r111 767 767 m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 100); 768 768 769 // always use declined names in the russian client769 // always use declined names in the Russian client 770 770 m_configs[CONFIG_DECLINED_NAMES_USED] = 771 771 (m_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfig.GetBoolDefault("DeclinedNames", false); … … 775 775 m_configs[CONFIG_LISTEN_RANGE_YELL] = sConfig.GetIntDefault("ListenRange.Yell", 300); 776 776 777 m_configs[CONFIG_PLAYER_START_GOLD] = sConfig.GetFloatDefault("PlayerStart.Gold", 0); 778 if(m_configs[CONFIG_PLAYER_START_GOLD] < 0) 779 m_configs[CONFIG_PLAYER_START_GOLD] = 0; 777 m_configs[CONFIG_PLAYER_START_GOLD] = (uint32)(sConfig.GetFloatDefault("PlayerStart.Gold", 0.0f) * 10000.0f); 780 778 781 779 if(m_configs[CONFIG_PLAYER_START_GOLD] > MAX_MONEY_AMOUNT)