Skip to content

Commit f0c3ee5

Browse files
committed
Merge branch 'main' into scheduler-stats
2 parents 1efc6dd + d25e414 commit f0c3ee5

File tree

19 files changed

+922
-669
lines changed

19 files changed

+922
-669
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ at [this link](https://github.com/zimbadev/crystalserver/blob/main/CODE_OF_CONDU
2828
You can use your own tool to generate Monster Loot and Monster Elements at [this link](https://crystalsever.vercel.app).
2929

3030
### Official Discord
31-
Enjoy our [Discord](https://discord.gg/7AYJEHTghQ)
31+
Enjoy our [Discord](https://discord.gg/zm4MTKtQQh)
3232

3333
### Thanks
3434
- [Open Tibia](https://github.com/opentibia/server) and their [contributors](https://github.com/opentibia/server/graphs/contributors).
@@ -96,4 +96,4 @@ A guided Bash script is available for most modern distributions (Debian/Ubuntu,
9696
```bash
9797
./linux_installer.sh
9898
```
99-
5. The script will guide you through the process and will only ask for your password (via `sudo`) when it needs to install system packages.
99+
5. The script will guide you through the process and will only ask for your password (via `sudo`) when it needs to install system packages.

data/events/scripts/party.lua

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,23 @@ function Party:onDisband()
7070
return true
7171
end
7272

73+
local partyVocationBonus = {
74+
[1] = 1.20, -- same vocation: +20%
75+
[2] = 1.30, -- 2 different vocations: +30%
76+
[3] = 1.60, -- 3 different vocations: +60%
77+
[4] = 2.00, -- 4 different vocations: +100%
78+
}
79+
7380
function Party:onShareExperience(exp)
7481
local uniqueVocationsCount = self:getUniqueVocationsCount()
7582
local partySize = self:getMemberCount() + 1
7683

77-
-- Formula to calculate the % based on the vocations amount
78-
local sharedExperienceMultiplier = ((0.1 * (uniqueVocationsCount ^ 2)) - (0.2 * uniqueVocationsCount) + 1.3)
79-
-- Since the formula its non linear, we need to subtract 0.1 if all vocations are present,
80-
-- because on all vocations the multiplier is 2.1 and it should be 2.0
81-
sharedExperienceMultiplier = partySize < 4 and sharedExperienceMultiplier or sharedExperienceMultiplier - 0.1
84+
if uniqueVocationsCount > 4 then
85+
uniqueVocationsCount = 4
86+
end
87+
88+
local sharedExperienceMultiplier = partyVocationBonus[uniqueVocationsCount] or 1
89+
local sharedExp = (exp * sharedExperienceMultiplier) / partySize
8290

83-
return math.ceil((exp * sharedExperienceMultiplier) / partySize)
91+
return math.ceil(sharedExp)
8492
end

0 commit comments

Comments
 (0)