Index: trunk/src/game/Formulas.h
===================================================================
--- trunk/src/game/Formulas.h (revision 102)
+++ trunk/src/game/Formulas.h (revision 111)
@@ -30,5 +30,5 @@
         inline uint32 hk_honor_at_level(uint32 level, uint32 count=1)
         {
-            return ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f )));
+            return (uint32) ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f )));
         }
     }
Index: trunk/src/game/Totem.cpp
===================================================================
--- trunk/src/game/Totem.cpp (revision 102)
+++ trunk/src/game/Totem.cpp (revision 111)
Index: trunk/src/game/Group.h
===================================================================
--- trunk/src/game/Group.h (revision 102)
+++ trunk/src/game/Group.h (revision 111)
@@ -218,5 +218,5 @@
         GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
         uint32 GetMembersCount() const { return m_memberSlots.size(); }
-        void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level);
+        void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level);
         uint8  GetMemberGroup(uint64 guid) const
         {
Index: trunk/src/game/OutdoorPvPHP.cpp
===================================================================
--- trunk/src/game/OutdoorPvPHP.cpp (revision 102)
+++ trunk/src/game/OutdoorPvPHP.cpp (revision 111)
@@ -122,5 +122,5 @@
             BuffTeam(HORDE);
         else
-            BuffTeam(NULL);
+            BuffTeam(0);
         SendUpdateWorldState(HP_UI_TOWER_COUNT_A, m_AllianceTowersControlled);
         SendUpdateWorldState(HP_UI_TOWER_COUNT_H, m_HordeTowersControlled);
Index: trunk/src/game/GameEvent.cpp
===================================================================
--- trunk/src/game/GameEvent.cpp (revision 102)
+++ trunk/src/game/GameEvent.cpp (revision 111)
@@ -1528,7 +1528,7 @@
     {
         if(itr->second.done_world_state)
-            plr->SendUpdateWorldState(itr->second.done_world_state, itr->second.done);
+            plr->SendUpdateWorldState(itr->second.done_world_state, (uint32)(itr->second.done));
         if(itr->second.max_world_state)
-            plr->SendUpdateWorldState(itr->second.max_world_state, itr->second.reqNum);
-    }
-}
+            plr->SendUpdateWorldState(itr->second.max_world_state, (uint32)(itr->second.reqNum));
+    }
+}
Index: trunk/src/game/ArenaTeam.cpp
===================================================================
--- trunk/src/game/ArenaTeam.cpp (revision 102)
+++ trunk/src/game/ArenaTeam.cpp (revision 111)
@@ -721,5 +721,5 @@
         return;
     // to get points, a player has to participate in at least 30% of the matches
-    uint32 min_plays = ceil(stats.games * 0.3);
+    uint32 min_plays = (uint32)ceil(stats.games * 0.3);
     for(MemberList::iterator itr = members.begin(); itr !=  members.end(); ++itr)
     {
Index: trunk/src/game/Unit.cpp
===================================================================
--- trunk/src/game/Unit.cpp (revision 110)
+++ trunk/src/game/Unit.cpp (revision 111)
@@ -2828,5 +2828,6 @@
     // All positive spells can`t miss
     // TODO: client not show miss log for this spells - so need find info for this in dbc and use it!
-    if (IsPositiveSpell(spell->Id))
+    if (IsPositiveSpell(spell->Id)
+        &&(!IsHostileTo(pVictim)))  //prevent from affecting enemy by "positive" spell
         return SPELL_MISS_NONE;
 
Index: trunk/src/game/World.cpp
===================================================================
--- trunk/src/game/World.cpp (revision 110)
+++ trunk/src/game/World.cpp (revision 111)
@@ -767,5 +767,5 @@
     m_configs[CONFIG_THREAT_RADIUS] = sConfig.GetIntDefault("ThreatRadius", 100);
 
-    // always use declined names in the russian client
+    // always use declined names in the Russian client
     m_configs[CONFIG_DECLINED_NAMES_USED] = 
         (m_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfig.GetBoolDefault("DeclinedNames", false);
@@ -775,7 +775,5 @@
     m_configs[CONFIG_LISTEN_RANGE_YELL]      = sConfig.GetIntDefault("ListenRange.Yell", 300);
 
-    m_configs[CONFIG_PLAYER_START_GOLD] = sConfig.GetFloatDefault("PlayerStart.Gold", 0);
-    if(m_configs[CONFIG_PLAYER_START_GOLD] < 0)
-        m_configs[CONFIG_PLAYER_START_GOLD] = 0;
+    m_configs[CONFIG_PLAYER_START_GOLD] = (uint32)(sConfig.GetFloatDefault("PlayerStart.Gold", 0.0f) * 10000.0f);
 
     if(m_configs[CONFIG_PLAYER_START_GOLD] > MAX_MONEY_AMOUNT)
Index: trunk/src/game/Group.cpp
===================================================================
--- trunk/src/game/Group.cpp (revision 102)
+++ trunk/src/game/Group.cpp (revision 111)
@@ -27,4 +27,5 @@
 #include "ObjectMgr.h"
 #include "Group.h"
+#include "Formulas.h"
 #include "ObjectAccessor.h"
 #include "BattleGround.h"
@@ -786,5 +787,5 @@
 }
 
-void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level)
+void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level)
 {
     for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
@@ -799,6 +800,14 @@
         ++count;
         sum_level += member->getLevel();
+        // store maximum member level
         if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel())
             member_with_max_level = member;
+
+        uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel());
+        // if the victim is higher level than the gray level of the currently examined group member,
+        // then set not_gray_member_with_max_level if needed.
+        if( victim->getLevel() > gray_level && (!not_gray_member_with_max_level
+           || not_gray_member_with_max_level->getLevel() < member->getLevel()))
+            not_gray_member_with_max_level = member;
     }
 }
Index: trunk/src/game/Player.cpp
===================================================================
--- trunk/src/game/Player.cpp (revision 102)
+++ trunk/src/game/Player.cpp (revision 111)
@@ -589,5 +589,5 @@
         SetUInt32Value( UNIT_FIELD_LEVEL, sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) );
     // set starting gold
-    SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD)*10000 );
+    SetUInt32Value( PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_PLAYER_START_GOLD) );
 
     // set starting honor
@@ -18188,10 +18188,14 @@
         uint32 sum_level = 0;
         Player* member_with_max_level = NULL;
-
-        pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level);
+        Player* not_gray_member_with_max_level = NULL;
+
+        // gets the max member level of the group, and the max member level that still gets XP
+        pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level);
 
         if(member_with_max_level)
         {
-            xp = PvP ? 0 : Trinity::XP::Gain(member_with_max_level, pVictim);
+            // PvP kills doesn't yield experience
+            // also no XP gained if there is no member below gray level
+            xp = (PvP || !not_gray_member_with_max_level) ? 0 : Trinity::XP::Gain(not_gray_member_with_max_level, pVictim);
 
             // skip in check PvP case (for speed, not used)
@@ -18223,7 +18227,8 @@
 
                     // XP updated only for alive group member
-                    if(pGroupGuy->isAlive())
+                    if(pGroupGuy->isAlive() && not_gray_member_with_max_level &&
+                       pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel())
                     {
-                        uint32 itr_xp = uint32(xp*rate);
+                        uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1);
 
                         pGroupGuy->GiveXP(itr_xp, pVictim);
