• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Party shared experience issue

Joined
Sep 24, 2023
Messages
36
Solutions
1
Reaction score
18
GitHub
RodrigoTolomeotti
Hello everyone,

First of all, I have some programming experience and familiarity with it. However, this is my first encounter with Tibia's code, and it's also a different programming language than the one I'm used to.

I'm facing an issue in my C++ code related to calculating shared experience in an online game. I have a party system where players can hunt together and share the experience gained from creature kills. However, I'm having difficulties ensuring that the experience is evenly distributed among all party members when one player deals the majority of the damage.

Here's a summary of my problem:

  • When a party is hunting, and only one of the players can deal around 80% to 90% of the creature's damage, while the other party members deal the remaining damage, the experience is being distributed based on the damage dealt by the attacker, rather than evenly among all party members.
  • If only the party leader deals 100% of the damage, the experience is incorrectly share.
    1695515234563.png

  • If only one party member deals 100% of the damage, the experience is share incorrectly.1695514933273.png

  • Here, the player "Teste02" dealt approximately 80% to 90% of the creature's health, while the player "Teste01" dealt the remaining damage.
    1695515095004.png

  • If each member, including the party leader, deals around 50% of the creature's health, the experience is divided correctly.
    1695515184814.png

  • I need the experience to be shared equally among all party members, regardless of who dealt the most damage. Since my server version is 7.2 to 7.6, and the vocations deal higher damage than usual, not all players will be able to deal a high percentage of damage to the creatures they are hunting when they are in a party.
I've made some modifications to my code, but I haven't been able to find the correct solution. Could someone help me understand how I can adjust the logic for shared experience calculation so that it's evenly distributed among all party members?
Here's the relevant code snippet where I'm facing this issue.

With my experience, I've managed to identify some relevant functions, but I must admit that I'm confused. Here they are:

getDamageRatio Function
C++:
double Creature::getDamageRatio(Creature* attacker) const
{
    uint32_t totalDamage = 0;
    uint32_t attackerDamage = 0;

    for (const auto& it : damageMap) {
        const CountBlock_t& cb = it.second;
        totalDamage += cb.total;
        if (it.first == attacker->getID()) {
            attackerDamage += cb.total;
        }
    }

    if (totalDamage == 0) {
        return 0;
    }

    return (static_cast<double>(attackerDamage) / totalDamage);
}


onDeath Function
C++:
void Creature::onDeath()
{
    bool lastHitUnjustified = false;
    bool mostDamageUnjustified = false;
    Creature* lastHitCreature = g_game.getCreatureByID(lastHitCreatureId);
    Creature* lastHitCreatureMaster;
    if (lastHitCreature) {
        lastHitUnjustified = lastHitCreature->onKilledCreature(this);
        lastHitCreatureMaster = lastHitCreature->getMaster();
    } else {
        lastHitCreatureMaster = nullptr;
    }

    Creature* mostDamageCreature = nullptr;

    const int64_t timeNow = OTSYS_TIME();
    const uint32_t inFightTicks = g_config.getNumber(ConfigManager::PZ_LOCKED);
    int32_t mostDamage = 0;
    std::map<Creature*, uint64_t> experienceMap;
    for (const auto& it : damageMap) {
        if (Creature* attacker = g_game.getCreatureByID(it.first)) {
            CountBlock_t cb = it.second;
            if ((cb.total > mostDamage && (timeNow - cb.ticks <= inFightTicks))) {
                mostDamage = cb.total;
                mostDamageCreature = attacker;
            }

            if (attacker != this) {
                uint64_t gainExp = getGainedExperience(attacker);
                if (Player* attackerPlayer = attacker->getPlayer()) {
                    attackerPlayer->removeAttacked(getPlayer());

                    Party* party = attackerPlayer->getParty();
                    if (party && party->getLeader() && party->isSharedExperienceActive() &&
                        party->isSharedExperienceEnabled()) {
                        attacker = party->getLeader();
                    }
                }

                auto tmpIt = experienceMap.find(attacker);
                if (tmpIt == experienceMap.end()) {
                    experienceMap[attacker] = gainExp;
                } else {
                    tmpIt->second += gainExp;
                }
            }
        }
    }

    for (const auto& it : experienceMap) {
        it.first->onGainExperience(it.second, this);
    }

    if (mostDamageCreature) {
        if (mostDamageCreature != lastHitCreature && mostDamageCreature != lastHitCreatureMaster) {
            Creature* mostDamageCreatureMaster = mostDamageCreature->getMaster();
            if (lastHitCreature != mostDamageCreatureMaster &&
                (!lastHitCreatureMaster || mostDamageCreatureMaster != lastHitCreatureMaster)) {
                mostDamageUnjustified = mostDamageCreature->onKilledCreature(this, false);
            }
        }
    }

    bool droppedCorpse = dropCorpse(lastHitCreature, mostDamageCreature, lastHitUnjustified, mostDamageUnjustified);
    death(lastHitCreature);

    if (master) {
        setMaster(nullptr);
    }

    if (droppedCorpse) {
        g_game.removeCreature(this, false);
    }
}

I've tried to change it and reformulate the logic a bit to what I need, but without any success.

I'd be grateful if anyone could help!
 
Last edited:
Dragon gives 700 hp.

Shared (Knight + Druid)
Everyone got: 498
Post automatically merged:

Knight deal ~14 dmg (less than 1%)
Paladin deal ~99% dmg

both: 03:39 You gained 1048 experience points

I don't know why exp increased so much. I try different combinations and still +1048 exp for both of them


in a Knight + Druid build they dealt similar damage

edit: when dealing similar damage, they get the same amount of exp. I check with the druid again
edit2: With druid it also gives 1048 (I don't know why it was less the first time. The only thing that changed was about +200 lvl for both of them)
Post automatically merged:

it turns out that by getting 1048 exp from 700 (dragon), they get 700 (100%) + 350 (50% bonus)
Post automatically merged:

I do different damage/class combinations but they still both get 1048 🤔
 

Attachments

Last edited:
Dragon gives 700 hp.

Shared (Knight + Druid)
Everyone got: 498
Post automatically merged:

Knight deal ~14 dmg (less than 1%)
Paladin deal ~99% dmg

both: 03:39 You gained 1048 experience points

I don't know why exp increased so much. I try different combinations and still +1048 exp for both of them


in a Knight + Druid build they dealt similar damage

edit: when dealing similar damage, they get the same amount of exp. I check with the druid again
edit2: With druid it also gives 1048 (I don't know why it was less the first time. The only thing that changed was about +200 lvl for both of them)
Post automatically merged:

it turns out that by getting 1048 exp from 700 (dragon), they get 700 (100%) + 350 (50% bonus)

Try below for party.lua, I'm sure that their is a calculation that we could use, but my brain isn't working correctly and this makes it much more simple, the only issue is with more than 4 in party it will still decrease, are we looking to make it stay the same if the party member count is above 4 and you have 4 different vocations?

The current party.lua you have looks to be adding 15% for 2 members if my calculations are correct.

LUA:
function Party:onJoin(player)
    if hasEventCallback(EVENT_CALLBACK_ONJOIN) then
        return EventCallback(EVENT_CALLBACK_ONJOIN, self, player)
    else
        return true
    end
end

function Party:onLeave(player)
    if hasEventCallback(EVENT_CALLBACK_ONLEAVE) then
        return EventCallback(EVENT_CALLBACK_ONLEAVE, self, player)
    else
        return true
    end
end

function Party:onDisband()
    if hasEventCallback(EVENT_CALLBACK_ONDISBAND) then
        return EventCallback(EVENT_CALLBACK_ONDISBAND, self)
    else
        return true
    end
end

function Party:onShareExperience(exp)
    local sharedExperienceMultiplier = 1.20 --20%
    local vocationsIds = {}
    local rawExp = exp

    local vocationId = self:getLeader():getVocation():getBase():getId()
    if vocationId ~= VOCATION_NONE then
        table.insert(vocationsIds, vocationId)
    end

    for _, member in ipairs(self:getMembers()) do
        vocationId = member:getVocation():getBase():getId()
        if not table.contains(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then
            table.insert(vocationsIds, vocationId)
        end
    end

    local size = #vocationsIds
    if size > 1 then
        sharedExperienceMultiplier = 1.0 + (size * 10 / 100) -- 10 should represent 10%
    elseif size == 2 then
        sharedExperienceMultiplier = 1.0 + (size * 15 / 100) -- 10 should represent 10%
    elseif size == 3 then
        sharedExperienceMultiplier = 1.0 + (size * 30 / 100) -- 10 should represent 10%
    elseif size >= 4 then -- in case you add more vocations this wont cause issues.
        sharedExperienceMultiplier = 1.0 + (size * 50 / 100) -- 10 should represent 10%
    end

    exp = math.ceil((exp * sharedExperienceMultiplier) / (#self:getMembers() + 1))
    return hasEventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE, self, exp, rawExp) or exp
end
 
Something is wrong.
rateExp = 1

<monster name="Dragon" nameDescription="a dragon" race="blood" experience="700" speed="185" manacost="0">

i killed solo dragon -
03:58 You gained 1050 experience points.
Post automatically merged:

+50% all mobs give when you kill them solo
 
Something is wrong.
rateExp = 1

<monster name="Dragon" nameDescription="a dragon" race="blood" experience="700" speed="185" manacost="0">

i killed solo dragon -
03:58 You gained 1050 experience points.
Post automatically merged:

+50% all mobs give when you kill them solo

I think this may be the cause:

Does your code somewhere give a bonus for premium? are you premium player? player.lua has a code for stamina premium players with more than 24 hours left. +50%,

This is exactly 1050
 
Try below for party.lua, I'm sure that their is a calculation that we could use, but my brain isn't working correctly and this makes it much more simple, the only issue is with more than 4 in party it will still decrease, are we looking to make it stay the same if the party member count is above 4 and you have 4 different vocations?

The current party.lua you have looks to be adding 15% for 2 members if my calculations are correct.

LUA:
function Party:onJoin(player)
    if hasEventCallback(EVENT_CALLBACK_ONJOIN) then
        return EventCallback(EVENT_CALLBACK_ONJOIN, self, player)
    else
        return true
    end
end

function Party:onLeave(player)
    if hasEventCallback(EVENT_CALLBACK_ONLEAVE) then
        return EventCallback(EVENT_CALLBACK_ONLEAVE, self, player)
    else
        return true
    end
end

function Party:onDisband()
    if hasEventCallback(EVENT_CALLBACK_ONDISBAND) then
        return EventCallback(EVENT_CALLBACK_ONDISBAND, self)
    else
        return true
    end
end

function Party:onShareExperience(exp)
    local sharedExperienceMultiplier = 1.20 --20%
    local vocationsIds = {}
    local rawExp = exp

    local vocationId = self:getLeader():getVocation():getBase():getId()
    if vocationId ~= VOCATION_NONE then
        table.insert(vocationsIds, vocationId)
    end

    for _, member in ipairs(self:getMembers()) do
        vocationId = member:getVocation():getBase():getId()
        if not table.contains(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then
            table.insert(vocationsIds, vocationId)
        end
    end

    local size = #vocationsIds
    if size > 1 then
        sharedExperienceMultiplier = 1.0 + (size * 10 / 100) -- 10 should represent 10%
    elseif size == 2 then
        sharedExperienceMultiplier = 1.0 + (size * 15 / 100) -- 10 should represent 10%
    elseif size == 3 then
        sharedExperienceMultiplier = 1.0 + (size * 30 / 100) -- 10 should represent 10%
    elseif size >= 4 then -- in case you add more vocations this wont cause issues.
        sharedExperienceMultiplier = 1.0 + (size * 50 / 100) -- 10 should represent 10%
    end

    exp = math.ceil((exp * sharedExperienceMultiplier) / (#self:getMembers() + 1))
    return hasEventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE, self, exp, rawExp) or exp
end
That's okay. If there are 5 players, e.g.
Sorc, Druid, Knight, Paladin (and second sorc), then the bonus for 4 professions is activated, but the mob exp is divided by 5 (number of players) + gives a bonus for 4 professions
Post automatically merged:

Does your code somewhere give a bonus for premium? are you premium player? player.lua has a code for stamina premium players with more than 24 hours left. +50%,

This is exactly 1050
Ahh right! Stamina for a premium player! :D My brain isn't working today either. I forgot about it 😂

I think it would be a good idea to go to sleep, what do you think?

You helped me a lot, thank you boss.

I will test it tomorrow with different professions and write the results :)
 
That's okay. If there are 5 players, e.g.
Sorc, Druid, Knight, Paladin (and second sorc), then the bonus for 4 professions is activated, but the mob exp is divided by 5 (number of players) + gives a bonus for 4 professions
Post automatically merged:


Ahh right! Stamina for a premium player! :D My brain isn't working today either. I forgot about it 😂

I think it would be a good idea to go to sleep, what do you think?

You helped me a lot, thank you boss.

I will test it tomorrow with different professions and write the results :)

Well, for the sake of testing, just set your exp in player.lua to 1.0 instead of 1.5 for now.
 
Well, for the sake of testing, just set your exp in player.lua to 1.0 instead of 1.5 for now.
Okay, I did some tests (I don't have the stamina bonus turned off in party.lua. I saw it somewhere but I can't find it now) 🤔 all are free acc :D
Dragon: 700 XP no-stamina bonus
Test 1:

Sorc +(L) Pal (~50% dmg both) = both they both got 700 exp
Sorc + Pal (Sorc ~2-5% dmg, (L) Pal 95-98% dmg) = both they both got 700 exp
Sorc + Pal (Sorc - 0 dmg, (L) Pal - 100% dmg) = both they both got 700 exp
party 1.webp

Test 2
Sorc + Pal + Druid (~33% dmg both) = they got 698 exp
Sorc + Pal + Druid (Sorc ~1% dmg, Druid ~1% dmg, (L) Pal ~98% dmg) = they got 698 exp
Sorc + Pal + Druid (Sorc ~50% ddmg, Druid ~50% dmg, (L) Paladin - 0% dmg ) = they got 699 exp
party 3.webp


Test 3
Sorc +(L) Pal + Druid + Knight (~33% dmg both) = they got 698 exp
Sorc + Pal + Druid + Knight (Sorc - 0% dmg, Druid 0% dmg, Knight - 0% dmg (L) Pal - 100% dmg) = they got 700 exp
Sorc + Pal + Druid + Knight (Sorc - 25% dmg, Druid 25% dmg, Knight - 50% dmg (L) Pal - 0% dmg) = they got 700 exp

party 4.webp

Test 4
3x 588 lvl, 1x 390 lvl (different damage - if shared didn't work then and exp depending on the amount of damage)
party x.webp
 
Last edited:
Okay, I did some tests (I don't have the stamina bonus turned off in party.lua. I saw it somewhere but I can't find it now) 🤔 all are free acc :D
Dragon: 700 XP no-stamina bonus
Test 1:

Sorc +(L) Pal (~50% dmg both) = both they both got 700 exp
Sorc + Pal (Sorc ~2-5% dmg, (L) Pal 95-98% dmg) = both they both got 700 exp
Sorc + Pal (Sorc - 0 dmg, (L) Pal - 100% dmg) = both they both got 700 exp
View attachment 88427

Test 2
Sorc + Pal + Druid (~33% dmg both) = they got 698 exp
Sorc + Pal + Druid (Sorc ~1% dmg, Druid ~1% dmg, (L) Pal ~98% dmg) = they got 698 exp
Sorc + Pal + Druid (Sorc ~50% ddmg, Druid ~50% dmg, (L) Paladin - 0% dmg ) = they got 699 exp
View attachment 88428


Test 3
Sorc +(L) Pal + Druid + Knight (~33% dmg both) = they got 698 exp
Sorc + Pal + Druid + Knight (Sorc - 0% dmg, Druid 0% dmg, Knight - 0% dmg (L) Pal - 100% dmg) = they got 700 exp
Sorc + Pal + Druid + Knight (Sorc - 25% dmg, Druid 25% dmg, Knight - 50% dmg (L) Pal - 0% dmg) = they got 700 exp

View attachment 88429

Test 4
3x 588 lvl, 1x 390 lvl (different damage - if shared wgl didn't work then and exp depending on the amount of damage)
View attachment 88430
What do you mean if share wgl?

Also did you update the party.lua script I sent?

The stamina bonus is in player.lua
 
What do you mean if share wgl?

Also did you update the party.lua script I sent?
Oh Sorry! I added an abbreviation from Polish :D


"In general shared does not work"


data\creaturescripts\scripts i have partyUpdate.lua (I don't know if it will do anything)
LUA:
local OPCODE_PARTY = 160

function onThink(creature, interval)
    local _data = {name = creature:getName(), pos = creature:getPosition()}
    local leader = creature:getParty():getLeader()
    local party = creature:getParty()

    if (#party:getMembers() > 0) then
        for _, member in ipairs(party:getMembers()) do
            member:sendExtendedOpcode(OPCODE_PARTY, json.encode({type = "update", player = _data}))
        end
    end

    if (creature ~= leader) then
        leader:sendExtendedOpcode(OPCODE_PARTY, json.encode({type = "update", player = _data}))
    end

    return true
end
 
That looks to be some sort of information update, maybe for party activity. I'm not positive I haven't gotten that far. It does not affect experience though. Was the party.lua updated before this test?
 
That looks to be some sort of information update, maybe for party activity. I'm not positive I haven't gotten that far. It does not affect experience though. Was the party.lua updated before this test?
Yes, I have it updated

LUA:
function Party:onJoin(player)
    if hasEventCallback(EVENT_CALLBACK_ONJOIN) then
        return EventCallback(EVENT_CALLBACK_ONJOIN, self, player)
    else
        return true
    end
end

function Party:onLeave(player)
    if hasEventCallback(EVENT_CALLBACK_ONLEAVE) then
        return EventCallback(EVENT_CALLBACK_ONLEAVE, self, player)
    else
        return true
    end
end

function Party:onDisband()
    if hasEventCallback(EVENT_CALLBACK_ONDISBAND) then
        return EventCallback(EVENT_CALLBACK_ONDISBAND, self)
    else
        return true
    end
end

function Party:onShareExperience(exp)
    local sharedExperienceMultiplier = 1.20 --20%
    local vocationsIds = {}
    local rawExp = exp

    local vocationId = self:getLeader():getVocation():getBase():getId()
    if vocationId ~= VOCATION_NONE then
        table.insert(vocationsIds, vocationId)
    end

    for _, member in ipairs(self:getMembers()) do
        vocationId = member:getVocation():getBase():getId()
        if not table.contains(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then
            table.insert(vocationsIds, vocationId)
        end
    end

    local size = #vocationsIds
    if size > 1 then
        sharedExperienceMultiplier = 1.0 + (size * 10 / 100) -- 10 should represent 10%
    elseif size == 2 then
        sharedExperienceMultiplier = 1.0 + (size * 15 / 100) -- 10 should represent 10%
    elseif size == 3 then
        sharedExperienceMultiplier = 1.0 + (size * 30 / 100) -- 10 should represent 10%
    elseif size >= 4 then -- in case you add more vocations this wont cause issues.
        sharedExperienceMultiplier = 1.0 + (size * 50 / 100) -- 10 should represent 10%
    end

    exp = math.ceil((exp * sharedExperienceMultiplier) / (#self:getMembers() + 1))
    return hasEventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE, self, exp, rawExp) or exp
end


Even with comments :D
 
Oops, that's the problem, wrong calculations haha! jeez.

LUA:
function Party:onJoin(player)
    if hasEventCallback(EVENT_CALLBACK_ONJOIN) then
        return EventCallback(EVENT_CALLBACK_ONJOIN, self, player)
    else
        return true
    end
end

function Party:onLeave(player)
    if hasEventCallback(EVENT_CALLBACK_ONLEAVE) then
        return EventCallback(EVENT_CALLBACK_ONLEAVE, self, player)
    else
        return true
    end
end

function Party:onDisband()
    if hasEventCallback(EVENT_CALLBACK_ONDISBAND) then
        return EventCallback(EVENT_CALLBACK_ONDISBAND, self)
    else
        return true
    end
end

function Party:onShareExperience(exp)
    local sharedExperienceMultiplier = 1.20 --20%
    local vocationsIds = {}
    local rawExp = exp

    local vocationId = self:getLeader():getVocation():getBase():getId()
    if vocationId ~= VOCATION_NONE then
        table.insert(vocationsIds, vocationId)
    end

    for _, member in ipairs(self:getMembers()) do
        vocationId = member:getVocation():getBase():getId()
        if not table.contains(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then
            table.insert(vocationsIds, vocationId)
        end
    end

    local size = #vocationsIds
    
    if size == 2 then
        sharedExperienceMultiplier = 1.0 + (15 / 100) -- 10 should represent 10%
    elseif size == 3 then
        sharedExperienceMultiplier = 1.0 + (30 / 100) -- 10 should represent 10%
    elseif size >= 4 then -- in case you add more vocations this wont cause issues.
        sharedExperienceMultiplier = 1.0 + (50 / 100) -- 10 should represent 10%
    end

    exp = math.ceil((exp * sharedExperienceMultiplier) / (#self:getMembers() + 1))
    return hasEventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE, self, exp, rawExp) or exp
end

I had it multiplying the size of the party to the percentage when the code was already basing the percentage off of the party size.
 
Oops, that's the problem, wrong calculations haha! jeez.

LUA:
function Party:onJoin(player)
    if hasEventCallback(EVENT_CALLBACK_ONJOIN) then
        return EventCallback(EVENT_CALLBACK_ONJOIN, self, player)
    else
        return true
    end
end

function Party:onLeave(player)
    if hasEventCallback(EVENT_CALLBACK_ONLEAVE) then
        return EventCallback(EVENT_CALLBACK_ONLEAVE, self, player)
    else
        return true
    end
end

function Party:onDisband()
    if hasEventCallback(EVENT_CALLBACK_ONDISBAND) then
        return EventCallback(EVENT_CALLBACK_ONDISBAND, self)
    else
        return true
    end
end

function Party:onShareExperience(exp)
    local sharedExperienceMultiplier = 1.20 --20%
    local vocationsIds = {}
    local rawExp = exp

    local vocationId = self:getLeader():getVocation():getBase():getId()
    if vocationId ~= VOCATION_NONE then
        table.insert(vocationsIds, vocationId)
    end

    for _, member in ipairs(self:getMembers()) do
        vocationId = member:getVocation():getBase():getId()
        if not table.contains(vocationsIds, vocationId) and vocationId ~= VOCATION_NONE then
            table.insert(vocationsIds, vocationId)
        end
    end

    local size = #vocationsIds
    if size > 1 then
        sharedExperienceMultiplier = 1.0 + (10 / 100) -- 10 should represent 10%
    elseif size == 2 then
        sharedExperienceMultiplier = 1.0 + (15 / 100) -- 10 should represent 10%
    elseif size == 3 then
        sharedExperienceMultiplier = 1.0 + (30 / 100) -- 10 should represent 10%
    elseif size >= 4 then -- in case you add more vocations this wont cause issues.
        sharedExperienceMultiplier = 1.0 + (50 / 100) -- 10 should represent 10%
    end

    exp = math.ceil((exp * sharedExperienceMultiplier) / (#self:getMembers() + 1))
    return hasEventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE) and EventCallback(EVENT_CALLBACK_ONSHAREEXPERIENCE, self, exp, rawExp) or exp
end

I had it multiplying the size of the party to the percentage when the code was already basing the percentage off of the party size.

I think the reason was it's already an hour :D I'm entering, I'll run some quick tests and come back with the results ;) Thanks Boss
Post automatically merged:

Fast test:
Pal + Sorc (both deals ~50% dmg) = both +700 exp
Pal + Sorc (sorc deals 0 dmg, Pal 100% dmg) = both +700 exp
1732313718394.webp

2 fast test:
Pal + Sorc + Druid + Knight:

Pal - 100% dmg / other 0% dmg - all +700 exp
Post automatically merged:

As if it didn't read the shared bonus all the time. It doesn't matter whether someone deals damage or not, whether there are 4 different classes or not - everyone gets a fixed 100% EXP for the mob 🤔
 
Last edited:
Try removing the +1 from exp =math.ceil, sorry I’m on my phone.
Post automatically merged:

I won’t have computer access for a few hours. I’ll have to look in the code, maybe there is something with the return at the end we will know soon after you remove the +1 also, I updated party.lua again, I accidentally added an unnecessary if statement.
 
Try removing the +1 from exp =math.ceil, sorry I’m on my phone.
Post automatically merged:

I won’t have computer access for a few hours. I’ll have to look in the code, maybe there is something with the return at the end we will know soon after you remove the +1 also, I updated party.lua again, I accidentally added an unnecessary if statement.
After updating party.lua and removing +1 from exp =math.ceil and a few tests, everyone still gets +700 exp.


Don't worry, no problem :D Don't worry, if you have time, I'll be grateful if you check it out, Boss :)
 
After updating party.lua and removing +1 from exp =math.ceil and a few tests, everyone still gets +700 exp.


Don't worry, no problem :D Don't worry, if you have time, I'll be grateful if you check it out, Boss :)
Yeah, I can easily do it with C++ but that makes it a lot harder to edit and add, this looks to have all of the functions we need it’s just not working the way that it should, so we need to find the break. I’m new to this version. I have an old version just came back a couple of months ago, been stabilizing my server and adding content before migration. I attempted 1.5 and am having an issue with connection
 
Yeah, I can easily do it with C++ but that makes it a lot harder to edit and add, this looks to have all of the functions we need it’s just not working the way that it should, so we need to find the break. I’m new to this version. I have an old version just came back a couple of months ago, been stabilizing my server and adding content before migration. I attempted 1.5 and am having an issue with connection
I've done a lot with my own (little) knowledge and with the help of gpt chat, but I totally don't know how to deal with this party :/
 
Back
Top