Jump to content

group xp when Highlevel char supports Lowlevel char


Guest Reiner030

Recommended Posts

Hi,

as described under http://www.wowwiki.com/Formulas:Mob_XP#Two_Character_Groups

  • * Amendment by Xist on 07/20/2008

I have leveled one hunter from 35 to 41 (so far) with a level 70 hunter. The best that I can tell the formula is pretty much the same as with any group, only halved, although I consistently receive one single experience point more than I would expect, so that a level thirty-five alone against a same-level elite would receive:

2 * ((5 * 35) + 45)

or 440 experience. However, when grouped with a seventy, it gets divided:

((2 * (5 * 35) + 45) * 35 / (35 + 70))/2 + 1

  • * end of amendment

a friend has got the same XP when leveling as lowchar with a highchar on the offi...

I've tested a little and this works / calculated the XP as expected.

Perhaps it make sense to modify the code a little to look only for the "member_with_max_level" which is the highest member with XP and set a highlevel flag when a higher char exists in the rewarded group. Then it could be compared as below, too.

Index: mangos/src/game/Group.h
===================================================================
--- mangos/src/game/Group.h     (Revision 6766)
+++ mangos/src/game/Group.h     (Arbeitskopie)
@@ -215,7 +215,7 @@
        MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
        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
        {
            member_citerator mslot = _getMemberCSlot(guid);
Index: mangos/src/game/Group.cpp
===================================================================
--- mangos/src/game/Group.cpp   (Revision 6766)
+++ mangos/src/game/Group.cpp   (Arbeitskopie)
@@ -24,6 +24,7 @@
#include "World.h"
#include "ObjectMgr.h"
#include "Group.h"
+#include "Formulas.h"
#include "ObjectAccessor.h"
#include "BattleGround.h"
#include "MapManager.h"
@@ -783,7 +784,7 @@
    BroadcastPacket(&data);
}

-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())
    {
@@ -798,6 +799,11 @@
        sum_level += member->getLevel();
        if(!member_with_max_level || member_with_max_level->getLevel() < member->getLevel())
            member_with_max_level = member;
+
+        uint32 gray_level = MaNGOS::XP::GetGrayLevel(member->getLevel());
+        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: mangos/src/game/Player.cpp
===================================================================
--- mangos/src/game/Player.cpp  (Revision 6766)
+++ mangos/src/game/Player.cpp  (Arbeitskopie)
@@ -17815,12 +17815,13 @@
        uint32 count = 0;
        uint32 sum_level = 0;
        Player* member_with_max_level = NULL;
+        Player* not_gray_member_with_max_level = NULL;

-        pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level);
+        

pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level);

        if(member_with_max_level)
        {
-            xp = PvP ? 0 : MaNGOS::XP::Gain(member_with_max_level, pVictim);
+            xp = PvP ? 0 : MaNGOS::XP::Gain(not_gray_member_with_max_level, pVictim);

            // skip in check PvP case (for speed, not used)
            bool is_raid = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsRaid() && pGroup->isRaidGroup();
@@ -17850,9 +17851,10 @@
                    pGroupGuy->RewardReputation(pVictim,is_dungeon ? 1.0f : rate);

                    // 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);
                        if(Pet* pet = pGroupGuy->GetPet())

Link to comment
Share on other sites

I think this crash come from this patch:

Revision: Unknown
Date 23:10:2008. Time 13:24 
//=====================================================
*** Hardware ***
Processor: Dual Core AMD Opteron(tm) Processor 165
Number Of Processors: 2
Physical Memory: 2096592 KB (Available: 1413176 KB)
Commit Charge Limit: 3991712 KB

*** Operation System ***
Microsoft Windows Server 2003 Standard Edition Service Pack 2 (Version 5.2, Build 3790)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  00493CFC 01:00092CFC D:\\Lordearon\\Server\\mangos\\mangosd.exe

Registers:
EAX:0824B54E
EBX:0BAC8D00
ECX:00000000
EDX:00000001
ESI:0C0D6238
EDI:00000000
CS:EIP:001B:00493CFC
SS:ESP:0023:0F0DFB64  EBP:0C0D6238
DS:0023  ES:0023  FS:003B  GS:0000
Flags:00010246

Call stack:
Address   Frame     Function      SourceFile
00493CFC  00000000  MaNGOS::XP::Gain+3C
004C079D  00000000  Player::RewardPlayerAndGroupAtKill+8D
00456FE5  00000000  Unit::DealDamage+575
006A3045  00000000  Spell::EffectWeaponDmg+5F5
005C858F  00000000  Spell::HandleEffects+AF
005C99AD  00000000  Spell::DoSpellHitOnUnit+2ED
005CA567  00000000  Spell::DoAllEffectOnTarget+87
005CC835  00000000  Spell::handle_immediate+65
005D214A  00000000  Spell::cast+27A
0045A15C  00000000  Unit::AttackerStateUpdate+8C
004C392A  00000000  Player::Update+2AA
004F0C81  00000000  ObjectAccessor::Update+91
004D1729  00000000  Map::Update+89
0074A6C8  00000000  GetFileAttributesA+890A
12000000  00000000  00

Is this the problem?

Link to comment
Share on other sites

I think this crash come from this patch:

Revision: Unknown
Date 23:10:2008. Time 13:24 
//=====================================================
*** Hardware ***
Processor: Dual Core AMD Opteron(tm) Processor 165
Number Of Processors: 2
Physical Memory: 2096592 KB (Available: 1413176 KB)
Commit Charge Limit: 3991712 KB

*** Operation System ***
Microsoft Windows Server 2003 Standard Edition Service Pack 2 (Version 5.2, Build 3790)

//=====================================================
Exception code: C0000005 ACCESS_VIOLATION
Fault address:  00493CFC 01:00092CFC D:\\Lordearon\\Server\\mangos\\mangosd.exe

Registers:
EAX:0824B54E
EBX:0BAC8D00
ECX:00000000
EDX:00000001
ESI:0C0D6238
EDI:00000000
CS:EIP:001B:00493CFC
SS:ESP:0023:0F0DFB64  EBP:0C0D6238
DS:0023  ES:0023  FS:003B  GS:0000
Flags:00010246

Call stack:
Address   Frame     Function      SourceFile
00493CFC  00000000  MaNGOS::XP::Gain+3C
004C079D  00000000  Player::RewardPlayerAndGroupAtKill+8D
00456FE5  00000000  Unit::DealDamage+575
006A3045  00000000  Spell::EffectWeaponDmg+5F5
005C858F  00000000  Spell::HandleEffects+AF
005C99AD  00000000  Spell::DoSpellHitOnUnit+2ED
005CA567  00000000  Spell::DoAllEffectOnTarget+87
005CC835  00000000  Spell::handle_immediate+65
005D214A  00000000  Spell::cast+27A
0045A15C  00000000  Unit::AttackerStateUpdate+8C
004C392A  00000000  Player::Update+2AA
004F0C81  00000000  ObjectAccessor::Update+91
004D1729  00000000  Map::Update+89
0074A6C8  00000000  GetFileAttributesA+890A
12000000  00000000  00

Is this the problem?

Confirmed, i have it too

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use