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

[Quest]An Undying Pledge Conv #5863

Open
wants to merge 1 commit into
base: base
Choose a base branch
from

Conversation

hooksta4
Copy link
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

  • Converts Quest An Undying Pledge to IF.
  • Adds Light Buckler to item.lua
  • Removes npc lua logic.
  • Adds defaultAction for qm5 and Stray Cloud
  • Adds dialog for after quest completion
  • Removes trigger area from zone.lua and into IF file
  • Removes logic from NM
    - Capture

Steps to test these changes

['Stray_Cloud'] =
{
onTrigger = function(player, npc)
if quest:getVar(player, 'Prog') == 0 then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This charvar should be read into a variable and then used in the condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean like local prog = quest:getVar(Blah blah_

if prog == 0 then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of what goes on behind the scenes, I'll present the following analogy:

Let's say you're doing a research project on whales, and you need to look up the average length of a newborn humpbacked whale. You have an encyclopedia to look it up, but every time you do, you have to flip through and find the right page.

Instead, what is being suggested is do the research once and write it down. Xaver beat me to the punch, but I wanted to explain why things like these are important, because its less overhead and a better practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok typically in the past if its been more than 2 id do the do that but now will make it for 2 or more. thanks.

@@ -2,6 +2,7 @@ local ID = zones[xi.zone.SEA_SERPENT_GROTTO]

return {
['qm1'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm5'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please align all of those ='s in each line here? Not sure how this got out of control

-- Stray Cloud : !pos -18 1 -20 252
-- qm5 : !pos 133 -9 221 176
-----------------------------------
local ssgID = zones[xi.zone.SEA_SERPENT_GROTTO]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nitpick here, but can you style that similar to other formats? (with --- block under the local)

quest:getVar(player, 'Prog') == 2
then
return quest:progressEvent(18)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                    local questProgress = quest:getVar(player, 'Prog')
                    if
                        questProgress == 1 and
                        npcUtil.popFromQM(player, npc, ssgID.mob.GLYRYVILU, { claim = true, hide = 0 })
                    then
                        return quest:messageSpecial(ssgID.text.BODY_NUMB_DREAD)
                    elseif questProgress == 2 then
                        return quest:progressEvent(18)
                    end

To expand:

  • As claywar said, whenever you have to check the same thing more than once, store it on a variable first so we dont repeat operations.
  • When there is only one condition, theres no need to align the if/elseif separate from the condition or the then
@hooksta4 hooksta4 force-pushed the Undying-Pledge branch 2 times, most recently from 751834e to 2254a77 Compare May 31, 2024 21:24
item = xi.item.LIGHT_BUCKLER,
fameArea = xi.fameArea.NORG,
fame = 50,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general rule, please have this aligned like so (applicable to all PRs)

quest.reward =
{
    item     = xi.item.LIGHT_BUCKLER,
    fameArea = xi.fameArea.NORG,
    fame     = 50,
}
[Quest]An Undying Pledge Conv

[Quest]An Undying Pledge Conv

[Quest]An Undying Pledge Conv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants