-
Notifications
You must be signed in to change notification settings - Fork 656
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
[lua&sql] Alterations to Trust: Monberaux logic and spells. Added trade for Elixir and Gil. #6950
base: base
Are you sure you want to change the base?
Conversation
Add Slow, Elegy, Requim and Helix' to erasable table, as per bgwiki. https://www.bg-wiki.com/ffxi/Erase
Please don't use Tab when making new lines, would need to convert them to spaces. |
Understood thank you, I've converted to draft - because even though all is working server side, I need to clean up the errors, going through them currently. |
7841646
to
d2d8aca
Compare
sql/mob_skills.sql
Outdated
INSERT INTO `mob_skills` VALUES (4259,2610,'mix_dragon_shield',1,0.0,7.0,2000,100,3,4,0,0,0,0,0); -- verified, but no effect messaging is probably wrong | ||
INSERT INTO `mob_skills` VALUES (4260,2611,'mix_dark_potion',0,0.0,7.0,2000,100,3,4,0,0,0,0,0); -- verified, but check if correct messaging. | ||
INSERT INTO `mob_skills` VALUES (4261,2612,'mix_samsons_strength',1,0.0,7.0,2000,100,3,4,0,0,0,0,0); -- verified, but check no effect messaging | ||
INSERT INTO `mob_skills` VALUES (4231, 2613, 'mix_final_elixir', 0, 0.0, 14.0, 2000, 1000, 3, 4, 0, 0, 0, 0, 0); -- Trust: Monberaux Final Elixir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No spaces
INSERT INTO `mob_skills` VALUES (4231, 2613, 'mix_final_elixir', 0, 0.0, 14.0, 2000, 1000, 3, 4, 0, 0, 0, 0, 0); -- Trust: Monberaux Final Elixir
Should look like this
INSERT INTO `mob_skills` VALUES (4231,2613,'mix_final_elixir',0,0.0,14.0,2000,1000,3,4,0,0,0,0,0); -- Trust: Monberaux Final Elixir
That is how the other mob_skills
is setup
Changes made to Trust: Monberaux and Monberaux in Upper Jeuno for the follow; Added Elixir/Hi-Elixir and Gil trading to his NPC in Upper Jeuno to allow the function of his AoE status removal and his Final Elixir mechanics. Changed his Trusts mJob and sJob to PLD/RUN to reflect his status as shown on BGWiki. Edited his spells so that if they don't remove the effect they show a "No effect on player" message, mainly only matters for AoE potions. Changed SQL for mob_skills to correct some animations and make one list of the status removal AoE and the other not. Renamed most of his skills in mobskills to have mix_ in front to hopefully avoid confusion with other potential applications. All spells range changed from 7 to 14 to accommodate his "NO_MOVE" trust behaviour, he would previous stand out of random and continuously loop some spells because he couldn't reach. No his spells are more in like with White Magic range.
then | ||
if finalElixir < elixirTotal then | ||
player:setCharVar('finalElixir', finalElixir + 1) | ||
player:printToPlayer(string.format('Thank you for that medicine. You currently have %d vials remaining.', finalElixir + 1), 0, 'Monberaux') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually how SE does this? it's not a cutscene but message packets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure myself of the exacts of it - I've not unlocked him yet cause of the high deed requirement, I'm at like 360, so added it in that way, so it was in place for future improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, I forgot to start the capture
Here are captures I made last year for this process: Monberaux gil and Elixer trading - Trust Monberaux fighting and Lhe Lhangavo fighting |
If I'm understanding correctly, the IDs for the event are 'No gil donation' = 10237, 'Performing gil donation' = 10238, 'has gil donation' = 10239 || and in same order for elixir, 10241, 10243, 10244? |
Do you think you're able to handle adding the events? If not we could punt it for later. We don't really want to add printToPlayer messaging because it's not accurate |
I'm not confident I could accurately add all the startEvents and get the params correct to be honest. Haven't touched on those yet at all. EDIT: I may have figured it out, I will test full later and let you know. |
Swapped out the printToPlayer aspects and adding the start events. Will accept the item, and correctly say thank you for the correct itemID. If trying to trade when his max cvars are reached, will play appropriate csid. Max Elixirs and Minimum Gil entered as variables so they can be changed per server needs.
I have updated the NPC file for Monberaux now, working on my local server with events rather than prints, for both items and the gil. Does the CVar used matter, or are the ones I've chosen okay? |
if | ||
player:getCharVar('monbAoe') == 0 | ||
then | ||
player:startEvent(10237, 100000, 1, 2964, 3300, 58195966, 3881063, 4480, 128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you leave a comment here saying the 2nd param of 100k is how much gil he asks for and is hardcoded on retail? see Coco's comment blelow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~can you leave a comment here saying the 2nd param of 100k is how much gil he asks for and is hardcoded on retail?
~ see Coco's comment blelow
Have altered the coding for Coco's comment, but PR is failing on squash at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The squash is a reminder to us before we merge the rest of the CI will run without it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:22: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:23: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:24: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:25: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:62: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:63: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:64: Found tab character(s) in file, please replace these with 4x spaces.
scripts/zones/Upper_Jeuno/npcs/Monberaux.lua:65: Found tab character(s) in file, please replace these with 4x spaces.
Just gotta replace some tabs with spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah going back to do them now, apologies.
local minimumGil = 100000 | ||
local elixirTotal = 2 | ||
|
||
local finalElixir = player:getCharVar('finalElixir') | ||
local monbAoe = player:getCharVar('monbAoe') | ||
local gilAmount = trade:getGil() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Monberaux wants 10% of your gil, with a minimum of 10,000 and a maximum of 100,000, not a set amount.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, so you can game the system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I always trade most of my gil to my alt and leave 100k. Wiki mentions using the Mog Gardens chest for storage too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently testing on my local;
local minimumGil = player:getGil() * 0.1
if minimumGil > 100000 then
minimumGil = 100000
elseif minimumGil < 10000 then
minimumGil = 10000
end
Seems to work so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, this could be simplified as:
local minimumGil = utils.clamp(player:getGil() * 0.1, 10000, 100000)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, there's a lot of new if
statements in his script that will both be firing startEvent, is that right? Like consider the onTrade
function. It will start event 10243 or 10246 AND 10238 or 10240. There's similar things in onTrigger and onEventFinish.
if
player:getCharVar('monbAoe') == 0
then
player:startEvent(10237, minimumGil, 1, 2964, 3300, 58195966, 3881063, 4480, 128)
else
player:startEvent(10239)
end
if
player:getCharVar('finalElixir') <= elixirTotal
then
player:startEvent(10241)
else
player:startEvent(10244)
end
What happens when you trigger him? This looks like it's always trying to do the gil and the elixir events. It looks like he's supposed to cycle through his dialog each time you trigger him, which I think calls for interaction framework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On first interaction, he plays his default !cs 28, then on second interaction with him, he plays 2 lines in one chat, 1 for each event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you check Zach's capture above, he does 1 event each time he's clicked. 10237, 8, 10241, 169, 10237... This should probably be set up as a hidden quest so these lines get cycled with the rest of his quest lines. Is any of this applicable if you don't have him as a trust? The quest check function could handle that and I think the interaction framework handles the dialog cycling. If you do the quest Save the Clock Tower or The Lost Cardian, is he asking for gil and elixirs after unrelated quest lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you check Zach's capture above, he does 1 event each time he's clicked. 10237, 8, 10241, 169, 10237... This should probably be set up as a hidden quest so these lines get cycled with the rest of his quest lines. Is any of this applicable if you don't have him as a trust? The quest check function could handle that and I think the interaction framework handles the dialog cycling. If you do the quest Save the Clock Tower or The Lost Cardian, is he asking for gil and elixirs after unrelated quest lines?
I'll check about the questlines but as a fresh character with no trusts, his dialog is the same as it is with my character that has him as a trust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triggered the requirements for the following, and he played out all 3 events at the same time, the one from the lua, and the 2 for his trust logic.
elseif
theLostCardien == xi.questStatus.QUEST_COMPLETED and
player:getQuestStatus(xi.questLog.JEUNO, xi.quest.id.jeuno.THE_KIND_CARDIAN) == xi.questStatus.QUEST_ACCEPTED
then
player:startEvent(32)
end
Changed how much gil he asks the player for to be 10% of their current gil, with a threshold of 10,000 min and 100,000 max.
I affirm:
What does this pull request do?
Changes made to Trust: Monberaux and Monberaux in Upper Jeuno for the follow;
Added Elixir/Hi-Elixir and Gil trading to his NPC in Upper Jeuno to allow the function of his AoE status removal and his Final Elixir mechanics.
Changed his Trusts mJob and sJob to PLD/RUN to reflect his status as shown on BGWiki.
Edited his spells so that if they don't remove the effect they show a "No effect on player" message, mainly only matters for AoE potions.
Changed SQL for mob_skills to correct some animations and make one group of the status removal spells AoE and the other not.
Added 2 new spell timers into his logic, he's meant to cast Mix I potions on a 3-4 second intervals, the Mix II on 60 second intervals, and Mix III at 90 seconds. Currently he is doing all spells on 3 second intervals, this should correct and bring him closer to retail timing.
Renamed most of his skills in mobskills to have mix_ in front to hopefully avoid confusion with other potential applications. All spells range changed from 7 to 14 to accommodate his "NO_MOVE" trust behaviour, he would previous stand out of random and continuously loop some spells because he couldn't reach. No his spells are more in like with White Magic range.
Steps to test these changes
To test his NPC to see how it handles the trading of Gil and Elixirs: I have tried many different trade combinations to confirm the correct ones I was aiming for worked for each CVar. Using !checkvar Player "monbAoe" and !checkvar Player "finalElixir" I was able to confirm the trades for each section were working correctly.
To test his Trust: To test his on spawn text logic, I used !setplayervar to try the combinations required to get all the text outputs, ensuring each one was given when needed.
Tested all of his status removal spells by having an effect added onto my character and see how he responds, with both AoE setting on and off.