-
Notifications
You must be signed in to change notification settings - Fork 552
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
base: base
Are you sure you want to change the base?
Conversation
['Stray_Cloud'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
if quest:getVar(player, 'Prog') == 0 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.
This charvar should be read into a variable and then used in the condition.
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.
What do you mean by this?
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.
you mean like local prog = quest:getVar(Blah blah_
if prog == 0 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.
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.
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.
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 }, |
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 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] |
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 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 |
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.
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 thethen
751834e
to
2254a77
Compare
item = xi.item.LIGHT_BUCKLER, | ||
fameArea = xi.fameArea.NORG, | ||
fame = 50, | ||
} |
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.
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
I affirm:
What does this pull request do?
- Capture
Steps to test these changes