Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: concoctions system #1223

Merged
merged 11 commits into from
Jul 12, 2023
Merged

feat: concoctions system #1223

merged 11 commits into from
Jul 12, 2023

Conversation

luan
Copy link
Contributor

@luan luan commented Jul 8, 2023

Description

Implements a system to handle concoctions (aka tibiadrome potions): https://tibia.fandom.com/wiki/Tibiadrome#Rewards

The system is somewhat complex and there's a small need for the concoction duration to be available in C++ so we can send the bytes back.

Most of the logic is in the new concoctions_lib.lua which provides a registry to create concoction configurations and later introspect the state/duration of them for a player.

I have also added a new config key partyShareLootBoosts that allows one (any) party member to give the party a loot boost via either prey or wealth duplex. This is not how Tibia works, but the way Tibia works for these is really annoying to I made it an option to enable this.

Note that this only includes 4 of the concoctions, the other ones can be implemented after.

Stamina Extension

Kapture.2023-07-08.at.12.09.36.mp4

Kooldown-Aid

Kapture.2023-07-08.at.12.13.31.mp4

Concoctions in cyclopedia

None
image

One

image

Two

image

Cooldown

image

Login notification

image

Wealth Duplex

image

Bestiary Betterment

Kapture.2023-07-08.at.12.21.51.mp4

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

See all the screenshots/videos above

Test Configuration:

  • Server Version: main + this PR
  • Client: 13.16
  • Operating System: Ubuntu 22.04

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@luan luan marked this pull request as draft July 8, 2023 19:30
@luan luan marked this pull request as ready for review July 8, 2023 20:01
@luan
Copy link
Contributor Author

luan commented Jul 8, 2023

image esses potions não estão funcionando.

image

@luan
Copy link
Contributor Author

luan commented Jul 11, 2023

2023-07-11 09:06:16 - [2023-11-07 09:06:16.224] [error] Lua script error:
2023-07-11 09:06:16 - scriptInterface: [Scripts Interface]
2023-07-11 09:06:16 - scriptId: [/home/ubuntu/canary/data-otservbr-global/scripts/actions/tibiadrome/concoctions.lua:callback]
2023-07-11 09:06:16 - timerEvent: []
2023-07-11 09:06:16 - callbackId:[]
2023-07-11 09:06:16 - function: []
2023-07-11 09:06:16 - error [data/libs/concoctions_lib.lua:103: attempt to call method 'updateConcoction' (a nil value)
2023-07-11 09:06:16 - stack traceback:
2023-07-11 09:06:16 - [C]: in function 'updateConcoction'
2023-07-11 09:06:16 - data/libs/concoctions_lib.lua:103: in function 'update'
2023-07-11 09:06:16 - data/libs/concoctions_lib.lua:124: in function 'init'
2023-07-11 09:06:16 - data/libs/concoctions_lib.lua:58: in function 'initAll'
2023-07-11 09:06:16 - ...servbr-global/scripts/actions/tibiadrome/concoctions.lua:38: in function <...servbr-global/scripts/actions/tibiadrome/concoctions.lua:37>]

acho que já vi o bug ali vou arrumar jaja

@luan
Copy link
Contributor Author

luan commented Jul 12, 2023

@thunerm pode testar o ultimo commit?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
1.5% 1.5% Duplication

@dudantas dudantas merged commit fc452dd into opentibiabr:main Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants