Jump to content

Recommended Posts

  • Active Member

Hi,

I have extended the Anti EXP 'System' for party scenarios.
When sharing EXP as a party, members with Anti EXP enabled will be excluded from the share and the experience points that player misses will be shared across the other party members.

Parties have the feature of a set experience bonus which, by default, ranges from 12% - 100% based on the count of members in range of the party leader.
Players will be excluded from the member count when Anti EXP is enabled, this way you can't just create a full-house party and funnel all the EXP + the 100% bonus to one player.

I am scripting on top of this piece of work.

Spoiler
CommonDefines/Service.h (whatever you use)
  #define ANTIEXP_GROUP_EX
  
char_battle.cpp
    struct FPartyTotaler
    {
        int        total;
        int        member_count;
        int        x, y;
        FPartyTotaler(LPCHARACTER center)
            : total(0), member_count(0), x(center->GetX()), y(center->GetY())
        {};
        void operator () (LPCHARACTER ch)
        {
            if (DISTANCE_APPROX(ch->GetX() - x, ch->GetY() - y) <= PARTY_DEFAULT_RANGE)
            {
#ifdef ANTIEXP_GROUP_EX
                if (!ch->block_exp)
                {
                    total += __GetPartyExpNP(ch->GetLevel());
                    ++member_count;
                }
#else
                total += __GetPartyExpNP(ch->GetLevel());
                ++member_count;
#endif
            }
        }
    };

party.cpp
  int CParty::ComputePartyBonusExpPercent()
  {
    if (GetNearMemberCount() <= 1)
        return 0;
    LPCHARACTER leader = GetLeaderCharacter();
    int iBonusPartyExpFromItem = 0;
    // UPGRADE_PARTY_BONUS
    int iMemberCount=MIN(8, GetNearMemberCount());
#ifdef ANTIEXP_GROUP_EX
    //reduce member count for exp bonus when members have anti-exp enabled and are in range
    for (TMemberMap::iterator it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
    {
        TMember& rMember = it->second;
        if (rMember.pCharacter && rMember.pCharacter->block_exp && rMember.bNear)
            iMemberCount -= 1;
    }
#endif
    if (leader && (leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP) || leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP_MALL)
        || leader->IsEquipUniqueItem(UNIQUE_ITEM_PARTY_BONUS_EXP_GIFT) || leader->IsEquipUniqueGroup(10010)))
    {
        
        iBonusPartyExpFromItem = 30;
    }
    return iBonusPartyExpFromItem + CHN_aiPartyBonusExpPercentByMemberCount[iMemberCount];
    // END_OF_UPGRADE_PARTY_BONUS
  }

 

 

  • Metin2 Dev 2
  • Good 7
Link to comment
https://metin2.dev/topic/30208-canti-exp-party-extension/
Share on other sites

9 hours ago, Sogma said:

 

  Hide contents
#ifdef ANTIEXP_GROUP_EX
                if (!ch->block_exp)
                {
                    total += __GetPartyExpNP(ch->GetLevel());
                    ++member_count;
                }
#else
                total += __GetPartyExpNP(ch->GetLevel());
                ++member_count;
#endif

 

 

care to explain? the if condition seems rather redundant.

Edited by covfefe
  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/30208-canti-exp-party-extension/#findComment-154521
Share on other sites

  • Active Member
2 hours ago, covfefe said:

care to explain? the if condition seems rather redundant.

You want to reduce the virtual count of party members which share the experience. 

By checking the block_exp you only add members to the calculation which actually can receive exp. 

Link to comment
https://metin2.dev/topic/30208-canti-exp-party-extension/#findComment-154522
Share on other sites

  • Honorable Member

 

On 1/18/2023 at 8:21 AM, covid said:

care to explain?

So now you can boost your friends even faster.

Edited by martysama0134
Link to comment
https://metin2.dev/topic/30208-canti-exp-party-extension/#findComment-154565
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.