-
Notifications
You must be signed in to change notification settings - Fork 612
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
[Quest] Implement Fisherman's Heart Quest and supporting tools #6230
base: base
Are you sure you want to change the base?
Conversation
a8ae270
to
139af14
Compare
139af14
to
432a726
Compare
@@ -482,7 +482,7 @@ xi.quest.id = | |||
THE_SAND_CHARM = 8, -- + | |||
A_POTTER_S_PREFERENCE = 9, -- + | |||
THE_OLD_LADY = 10, -- + | |||
FISHERMAN_S_HEART = 11, | |||
FISHERMAN_S_HEART = 11, -- + Converted |
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.
Just for my own sake, can you please rename this enum to FISHERMANS_HEART
?
-- (NOTE: Fishing Rank 0 is handled as default action) | ||
{ | ||
check = function(player, status, vars) | ||
return |
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.
Formatting-wise, return <and/or> newline, then following ones with 4-space indent
{ | ||
['Katsunaga'] = | ||
{ | ||
onTrigger = function(player, npc) |
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.
simplified: onTrigger = quest:progressEvent(192, xi.item.GUGRU_TUNA),
{ | ||
['Katsunaga'] = | ||
{ | ||
onTrigger = function(player, npc) |
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.
See above
[197] = function(player, csid, option, npc) | ||
if option == 33554432 then | ||
-- 'Catching Fish' | ||
local fishingStats = player:getFishingStats() or {} |
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.
Haven't gotten there yet, but I'd rather break out if fishing stats are non-existent. updateEvent can take 0 params, so no need to pass an empty table. Also, is this data returned always the same, and could we consolidate it to always return what we need in the format needed?
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.
Good to go on the first part, but I'm not sure I understand the second question? the code for getFishingStats()
checks the contents of PChar->m_fishHistory, which is a fixed struct. If the C++ function fails, it returns a table of 0s instead with the same labels.
local fishingStats = player:getFishingStats()
if fishingStats ~= nil then
player:updateEvent({
[0] = player:getFishingCatchCount() or 0,
[1] = fishingStats['fishLinesCast'] or 0,
[2] = fishingStats['fishReeled'] or 0,
[3] = fishingStats['fishLongestLength'] or 0,
[4] = fishingStats['fishLongestId'] or 0,
[5] = fishingStats['fishHeaviestWeight'] or 0,
[6] = fishingStats['fishHeaviestId'] or 0,
})
else
player:updateEvent(0, 0, 0, 0, 0, 0, 0)
end
}) | ||
elseif option == 0 then | ||
-- 'Types of Fish Caught' | ||
local fishingCatches = player:getFishingCatches() or {} |
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.
Need to check this datatype to see if it can be simplified, similar to above
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 24-byte bitset (for 196 bits) uses 163 of those bits to build a set of 6 32-bit integers as flags for which fish have been caught. I'm not sure if that's actually the easiest method, but it is how the client receives the data to show "which fish should I put a star next to?"
"FROM char_fishing_history " | ||
"WHERE charid = (?);"; | ||
|
||
auto ret = db::preparedStmt(Query, PChar->id); |
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 new db system returns rset
(result set), the old system returns ret
(return code)
I affirm:
What does this pull request do?
Steps to test these changes
!exec target:setFishCaught(1234, true)
(replacing 1234 with the fish ID)Sources