-
Notifications
You must be signed in to change notification settings - Fork 799
[lua] Converts quest "Community Service" to IF #9028
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
base: base
Are you sure you want to change the base?
Conversation
303a7b8 to
3849c24
Compare
scripts/zones/Lower_Jeuno/Zone.lua
Outdated
| zoneObject.onGameHour = function(zone) | ||
| local vanadielHour = VanadielHour() | ||
| local playerOnQuestId = GetServerVariable('[JEUNO]CommService') | ||
| local zaukoId = GetNPCByID(ID.npc.ZAUKO) |
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.
zauko
zaukoId implies its the ID of the "zauko" entity
| end, | ||
|
|
||
| [131] = function(player, csid, option, npc) | ||
| local zoneId = player:getZone() |
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.
zone
zoneId implies a zone ID not the whole zone object
| if option == 1 then | ||
| lightLamp(npc, player, quest, zoneId) | ||
| end | ||
| 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.
You could also just the remaining logic to lightLamp() function and remove quite a lot of repeated code.
| } | ||
|
|
||
| -- Lights the lamps | ||
| local lightLamp = function(npc, player, q, zone) |
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.
q Are we charging by character used again?
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 function lightLamp(player, npc, quest, option)
Then first thing: check if option is NOT 1 and return immediately if it is.
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.
q because I can't use quest due to I think it is ghosting? I can't recall the exact vocab word for it at the moment. q just made sense as a shortened version of quest.
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.
questObject
communityQuest
thisQuest
There were many options to make clear what q is.
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 didn't have enough money banked to buy more letters, Ryan. I didn't want to spin the wheel again and land on bankrupt.
|
|
||
| if lampVar ~= 0 then | ||
| return quest:progressEvent(123, lampVar, 3) | ||
| 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.
Why is lampCs not reurning a value directly? Why set the values in a var to then fetch the var?
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're right I should just use localvars. I've been working on this dumb quest for days and my brain is fried.
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, you dont need to set a single variable.
local function lampStatus(player, npc, questObject)
local hour = VanadielHour()
local date = VanadielUniqueDay()
local timer = questObject:getVar(player, 'Timer')
local npcAnimation = npc:getAnimation()
if questObject:getVar(player, 'Prog', 1) then
if
(timer == date and hour >= 18) or -- Same day flagged
(timer == date + 1 and hour < 1) -- Day after it was flagged
then
if npcAnimation == xi.anim.OPEN_DOOR then
return 2
elseif npcAnimation == xi.anim.CLOSE_DOOR then
return 1
end
elseif
(timer > date + 1) or
(timer == date + 1 and hour >= 1)
then
return 3
end
elseif npcAnimation == xi.anim.OPEN_DOOR then
return 5
end
end| q:setVar(player, 'Option', 5) -- The lamp is lit. | ||
| return | ||
| end | ||
| 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.
Actually, arent there like 10 lamps? Are we really storing values for all of them in the same quest variable?
|
I'm gonna be honest: This doesnt read like you wrote it, at all. |
|
The bitpacking functions were written by @0x05010705 thus why he's co-authored on the pr. I'm too dumb to write anything like that. |
3849c24 to
29f8be1
Compare
Co-Authored-By: 0x05010705 <47504230+0x05010705@users.noreply.github.com>
29f8be1 to
9541058
Compare
I affirm:
What does this pull request do?
Converts the quest "Community Service" to IF.
Makes the quest retail accurate.
Updates Vhana Ehgaklywha's path to be retail accurate.
Notes
There is a lot going on here so I'll try and explain the best I can.
The quest is flaggable between 1800 and 2300 once per day.
Only 1 player per night can flag the quest.
If a player flags the quest literally no other player can flag the quest.
If the player completes the quest more than once after the 2nd time they are offered a KI.
If they turn down the KI they can only get offered it again by completing the quest again.
The player can talk to Zauko once per day during the day to get rid of the KI.
After the quest player has TURNED IN the quest it will then display that player's name to any other player who talks to Zauko that night. This is passed as a string. Shoutout to @0x05010705 for that logic.
This will not display to the player who completed the quest they will only get cs 113 para 0.
If a player has the KI and is in LJ when 1800 hits they get a message in chat that Zauko is recruiting a player.
If the player has the KI and talks to Zauko once per day (during the time you can't flag the quest) Zauko will ask if they want to remove the KI.
Steps to test these changes
Wait until 1800 in game and talk to Zauko.
Light all the lamps.
Talk to Zauko to complete the quest.
Captures
https://drive.google.com/drive/folders/1R-_DEIlUuyRX7D-1-Vpa2IrgZsuNCwh6?usp=sharing