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

fix: familiar nil storage and others familiar bugs #947

Merged
merged 6 commits into from
Mar 23, 2023

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Mar 22, 2023

Description

• Fixed pointing to invalid storages, which makes the familiar tense completely wrong.
• It was also fixed the creation of several summons when dying, because the list of cooldowns of the spells was cleared, allowing to summon a new one. (Which was also true for other spells)
• Created a tag in config.lua for the duration of the familiar/spell
Where the total value will be divided by two
Example, familiarTime = 30 (will be divided by two, familiar time will be 15 minutes and spell cooldown 30)
• Summon familiar spell is not more agressive spell (can be used in protection zone)

Behaviour

Actual

Time appear buged on look and familiar not disappear.

Expected

Time is normal and familiar disappear.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@dudantas dudantas changed the title fix: familiar nil storage fix: familiar nil storage and others familiar bugs Mar 23, 2023
@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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dudantas dudantas merged commit f6543dd into main Mar 23, 2023
@dudantas dudantas deleted the fix-familiar-storage branch March 23, 2023 16:50
@dudantas
Copy link
Member Author

Lua script error: 2023-03-28 21:40:52 - scriptInterface: [Scripts Interface] 2023-03-28 21:40:52 - scriptId: [/home/canary/data-canary/scripts/spells/familiar/sorcerer_familiar.lua:callback] 2023-03-28 21:40:52 - timerEvent: [] 2023-03-28 21:40:52 - callbackId:[] 2023-03-28 21:40:52 - function: [] 2023-03-28 21:40:52 - error [data/libs/functions/player.lua:420: attempt to index global 'Global' (a nil value) 2023-03-28 21:40:52 - stack traceback: 2023-03-28 21:40:52 - [C]: in function '__index' 2023-03-28 21:40:52 - data/libs/functions/player.lua:420: in function 'CreateFamiliarSpell'

-- Divide by 2 to get half the time (the default total time is 30 / 2 = 15)
local summonDuration = configManager.getNumber(configKeys.FAMILIAR_TIME) / 2
self:setStorageValue(Global.Storage.FamiliarSummon, os.time() + summonDuration * 60)
addEvent(RemoveFamiliar, summonDuration * 60 * 1000, myFamiliar:getId(), self:getId())	for sendMessage = 1, #FAMILIAR_TIMER do

This is happening because of your mistake, apparently your datapack is missing some previous commit, just remove the "Global."

luan pushed a commit that referenced this pull request Jul 11, 2023
• Fixed pointing to invalid storages, which makes the familiar tense completely wrong.
• It was also fixed the creation of several summons when dying, because the list of cooldowns of the spells was cleared, allowing to summon a new one. (Which was also true for other spells)
• Created a tag in config.lua for the duration of the familiar/spell
Where the total value will be divided by two
Example, familiarTime = 30 (will be divided by two, familiar time will be 15 minutes and spell cooldown 30)
• Summon familiar spell is not more agressive spell (can be used in protection zone)
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