-
-
Notifications
You must be signed in to change notification settings - Fork 659
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: obtain phantasmal jade mount #3100
Conversation
Variable success on function SaveHirelings() always return nill, crashing the server at the time of /closeserver or when the character tries to log out.
Co-authored-by: Pedro Cruz <[email protected]>
# Description The check condition of required items is wrong. ## Behaviour To get the mount, you need to have exactly 1x spectral saddle and 1x spectral horse tack ### **Actual** Now, regardless of whether you have 1 or more items in your backpack, you will be able to receive the item.
Quality Gate passedIssues Measures |
@@ -37,7 +37,7 @@ function phantasmalJadeMount.onUse(player, item, fromPosition, target, toPositio | |||
end | |||
|
|||
if table.contains({ 34072, 34073, 34074 }, item.itemid) then | |||
if player:getItemCount(34072) >= 4 and player:getItemCount(34073) == 1 and player:getItemCount(34074) == 1 then | |||
if player:getItemCount(34072) >= 4 and player:getItemCount(34073) >= 1 and player:getItemCount(34074) >= 1 then |
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.
Isn't that better?
if player:removeItem(34072, 4) and player:removeItem(34073, 1) and player:removeItem(34074, 1) then
And remove all these lines
player:removeItem(34072, 4)
player:removeItem(34073, 1)
player:removeItem(34074, 1)
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 think that this is not a good idea, because with this code that you are suggesting it could lead to the removal of the first 4 items but if the others items did not fulfill the requirement of 1 item each, it will not deliver the mount and it will be removing the items that has the requirements fulfilled.
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.
Either way, the mechanics are completely wrong. Here is how it works correctly:
https://www.youtube.com/watch?v=qkZQiHLUvjA
This fixes the item usage mechanics for obtaining the Phantasmal Jade mount. It ensures that the correct number of items are used, and the mount is granted when all requirements are met. Additionally, it automates the registration of item IDs to simplify the code and reduce redundancy. Close #3100
Description
The check condition of required items is wrong.
Behaviour
To get the mount, you need to have exactly 1x spectral saddle and 1x spectral horse tack
Actual
Now, regardless of whether you have 1 or more items in your backpack, you will be able to receive the item.
Expected
Fixes
Type of change
Please delete options that are not relevant.
How Has This Been Tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist