Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Enable gamestore to offers services/items for tournament coins #743

Merged
merged 16 commits into from
Aug 10, 2022

Conversation

bosmak
Copy link
Contributor

@bosmak bosmak commented Aug 4, 2022

Description

Allows offers tagged with coinType = GameStore.CointType.Tournament to correctly charge Tournament Coins.
Added correct history for the store transactions following the coin type.
Removed duplicate charge and history when changing the Name or Sex of a Hireling.

Behaviour

Actual

Buying something tagged with Tournament Coins will be charged on Tibia Coins.

Buying Hireling Sex Change or Hireling Name Change charges twice the amount and add two purchases to the history.

Expected

Buying something tagged with Tournament Coins will be charged using Tournament Coins.

Buying Hireling Sex Change or Hireling Name Change charges the displayed amount and adds a single purchase to the history.

Fixes

# (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested

On data/modules/scripts/gamestore/gamestore.lua change the line 4492 from offer.coinType = GameStore.CointType.Coin to offer.coinType = GameStore.CointType.Tournament to change all offers to use Tournament Coins.

Go inside the game and buy one of each OfferType; check history.

Test Configuration:

  • Server Version: Canary@5a6da6c1436be0d4a0a9b06a7a9d2fb98325eb3f
  • Client: 12.86.11871
  • Operating System: Ubuntu:21.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

@majestyotbr majestyotbr changed the title enable gamestore to offers services/items for tournament coins Enable gamestore to offers services/items for tournament coins Aug 5, 2022
Copy link
Collaborator

@dudantas dudantas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions related to indentation. The code itself seems to be ok.

data/migrations/19.lua Outdated Show resolved Hide resolved
data/migrations/20.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
data/modules/scripts/gamestore/init.lua Outdated Show resolved Hide resolved
schema.sql Outdated Show resolved Hide resolved
schema.sql Outdated Show resolved Hide resolved
bosmak and others added 12 commits August 8, 2022 13:15
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
…and sendUpdateCoinBalance to sendUpdatedStoreBalances
Co-authored-by: Eduardo Dantas <eduardo.dantas@hotmail.com.br>
@bosmak bosmak requested a review from dudantas August 8, 2022 17:00
Copy link
Contributor

@QuebradaZN QuebradaZN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing and apparently everything is ok!

@majestyotbr majestyotbr merged commit 758f136 into opentibiabr:main Aug 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants