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

Fixed potion mana amount heals, remove wrong parameter from doTargetCombatMana on potions.lua #523

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Fixed potion mana amount heals, remove wrong parameter from doTargetCombatMana on potions.lua #523

merged 1 commit into from
Oct 6, 2022

Conversation

Brunoquindeler
Copy link
Contributor

@Brunoquindeler Brunoquindeler commented Sep 18, 2022

Description

was being passed an extra parameter in the "doTargetCombatMana" function, this function randomizes the amount of mana a potion heals. With this parameter, the minimum "6" was always passed, which is the value of the constant "COMBAT_MANADRAIN", thus making an "ultimate mana potion", for example, heal 80, 100, 130... however, it should cure between 425 and 575.

here the function that is called and where the parameter is used

int GlobalFunctions::luaDoTargetCombatMana(lua_State* L) {

See on Line 413. The minimum and maximum parameters are in order 3 and 4.

damage.primary.value = normal_random(getNumber<int32_t>(L, 3), getNumber<int32_t>(L, 4));

and the effect type is already applied on line 412.

damage.primary.type = COMBAT_MANADRAIN;

Behaviour

Actual

an "ultimate mana potion", for example, heal 80, 100, 130...

Expected

an "ultimate mana potion", for example, heal between 425 - 575

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

Tests were done in-game

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

@sonarcloud
Copy link

sonarcloud bot commented Sep 18, 2022

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 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dudantas dudantas changed the title feat: remove unnecessary parameter Fixed potion mana amount heals, remove wrong parameter from doTargetCombatMana on potions.lua Sep 18, 2022
@dudantas dudantas merged commit addbbb7 into opentibiabr:main Oct 6, 2022
@dudantas
Copy link
Contributor

dudantas commented Oct 6, 2022

Merged, thanks for your contribution!

luan pushed a commit that referenced this pull request Jul 11, 2023
…ombatMana on potions.lua (#523)

Was being passed an extra parameter in the "doTargetCombatMana" function, this function randomizes the amount of mana a potion heals. With this parameter, the minimum "6" was always passed, which is the value of the constant "COMBAT_MANADRAIN", thus making an "ultimate mana potion", for example, heal 80, 100, 130... however, it should cure between 425 and 575.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: PRs Done
Development

Successfully merging this pull request may close these issues.

3 participants