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

Fix Event Scheduler #471

Merged
merged 4 commits into from
May 27, 2022
Merged

Fix Event Scheduler #471

merged 4 commits into from
May 27, 2022

Conversation

beats-dh
Copy link
Collaborator

@beats-dh beats-dh commented Feb 27, 2022

Behaviour

Actual

This PR works directly with: opentibiabr/canary#239

Fix:

On login you have one "XP Gain Rate", when you get experience this value changed.
Event schedule only display info, but doesn't work.

Expected

Formulae Tibia Wiki

  • Display correctely "XP Gain Rate".
  • Event Schedule server-side.
  • Exercise Training get bonus of events.

Fixes

global.lua & statup.lua

  • moved form global.lua -> globalevents\others\startup.lua all events rates variables.
    getEventSSkill, getEventSExp and getEventSLoot now load after events module.
  • set GlobalStorage.XpDisplayMode -> 1

player.lua

  • Fixed onGainExperience; Added preyBonus & staminaBoost variable.
    now use simple rule of 3...
    Rat: if 5 exp --- 100% | ? exp --- 150% so... 5 / 100 * 150 = 7(BaseXpGain + etc) see Rat

lib\core\functions.lua

  • getLootRandom approximate to real tibia.
  • getRateFromTable when doesn't have stages, return default.

configmanager.cpp & configmanager.h

  • added RATE_USE_STAGES boolean config rateUseStages = true.
    -fixed RATE_EXPERIENCE.
  • set base rates to 1.

creaturescript\others\login.lua

  • fixed setBaseXpGain, now work with events too.

spawn.cpp & spawn.h

  • fixed interval spawn time.
  • when the spawn time is less than MINSPAWN_INTERVAL, addMonster with min value.
  • now interval to 30000, less check time.

game.cpp, scripts\luascript.cpp & protocolstatus.cpp

  • some fixes

otserv.cpp & config.lua.dist

  • On/Off stagesExp(def: true).
  • set rates to 1

events.xml

  • changed date for test.
  • can use exprate="0", with any argument (this reduce the rate to 0, but not the exp).
    NOTE: exprate, lootrate, spawnrate or skillrate in 100, it's default value.

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)

How Has This Been Tested

Rat Test 1: without event, rateExp x1 + stamina : 150% = 7.5
Rat Test 2: with event +100%, rateExp 100% + prey 40% + store 50% + stamina x1.5 : 435% = 21,75

Test Configuration:

Server Version:
Client: Client 12.85
Operating System: Windows 11

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 don't see)
  • I have added tests that prove my fix is effective or that my feature works

@garaflaks
Copy link

the monsters have double exp is correct.

Inside the skills tab it's still 100% exp, not 200%

data/scripts/globalevents/others/startup.lua

local lootRate = Game.getEventSLoot()
if lootRate ~= 100 then
	SCHEDULE_LOOT_RATE = lootRate
end

local expRate = Game.getEventSExp()
if expRate ~= 100 then
	SCHEDULE_EXP_RATE = expRate
end

local skillRate = Game.getEventSSkill()
if skillRate ~= 100 then
	SCHEDULE_SKILL_RATE = skillRate
end

@beats-dh
Copy link
Collaborator Author

image

@beats-dh beats-dh mentioned this pull request Feb 28, 2022
13 tasks
@majestyotbr majestyotbr changed the title scheduler fix exp Fix Event Scheduler Feb 28, 2022
@majestyotbr majestyotbr added Status: Pending Review This PR or Issue requires a review Status: Pending Test This PR or Issue requires more testing labels Mar 9, 2022
@beats-dh beats-dh marked this pull request as draft March 21, 2022 11:42
@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity.

@majestyotbr majestyotbr merged commit 19dccbb into main May 27, 2022
majestyotbr pushed a commit to opentibiabr/canary that referenced this pull request May 27, 2022
@majestyotbr majestyotbr deleted the fix-scheduler branch May 27, 2022 18:56
JoaoCRDias pushed a commit to JoaoCRDias/otservbr-global that referenced this pull request Jul 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Datapack Stale No activity Status: Pending Review This PR or Issue requires a review Status: Pending Test This PR or Issue requires more testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Bug event scheduler CONTENT: notification about events in the game of the event schedule
5 participants