Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Fixed some map quests #558

Merged
merged 3 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/zones/Northern_San_dOria/npcs/Aurege.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function onEventFinish(player, csid, option)
if csid == 521 and player:getQuestStatus(SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER) == QUEST_AVAILABLE then
player:addQuest(SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER)
elseif csid == 516 then
npcUtil.completeQuest(player, SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER, {ki = tpz.ki.MAP_OF_KING_RANPERRES_TOMB, title = tpz.title.DAYBREAK_GAMBLER, xp = 2000})
npcUtil.completeQuest(player, SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER, {ki = tpz.ki.MAP_OF_KING_RANPERRES_TOMB, title = tpz.title.DAYBREAK_GAMBLER, xp = 2000 * EXP_RATE})
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.MAP_OF_KING_RANPERRES_TOMB) -- Map of King Ranperre's Tomb
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@Xephera looks like npcUtil.completeQuests() already has exp rate baked in:

player:addExp(params["xp"] * EXP_RATE)

Copy link
Contributor

@ibm2431 ibm2431 May 3, 2020

Choose a reason for hiding this comment

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

The enums are equivalent, but the table that npcUtil.completeQuest takes is not~

    if params["keyItem"] ~= nil then
        npcUtil.giveKeyItem(player, params["keyItem"])
    end

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I misunderstood table, thinking ki is a table (because our "enums" are tables) and totally missed that the argument input here is its own table.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's confusing. Wondering if npcUtil functions should be tweaked to accept both "ki" and "keyItem" as field names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed the exp_rate thing but it doesn't give a key item notification regardless for whatever reason so I'm leaving that part in until we know why.

Copy link
Contributor

Choose a reason for hiding this comment

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

npcUtil.completeQuest(player, SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER, {keyItem = tpz.ki.MAP_OF_KING_RANPERRES_TOMB, title = tpz.title.DAYBREAK_GAMBLER, xp = 2000 * EXP_RATE}) didn't work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just gonna second that

player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.MAP_OF_KING_RANPERRES_TOMB) -- Map of King Ranperre's Tomb

shouldn't be needed if you change

npcUtil.completeQuest(player, SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER, {ki = tpz.ki.MAP_OF_KING_RANPERRES_TOMB, title = tpz.title.DAYBREAK_GAMBLER, xp = 2000})

to

npcUtil.completeQuest(player, SANDORIA, tpz.quest.id.sandoria.EXIT_THE_GAMBLER, {keyItem = tpz.ki.MAP_OF_KING_RANPERRES_TOMB, title = tpz.title.DAYBREAK_GAMBLER, xp = 2000})

notice the change from ki = tpz.ki.MAP_OF_KING_RANPERRES_TOMB to keyItem = tpz.ki.MAP_OF_KING_RANPERRES_TOMB

end
end
1 change: 1 addition & 0 deletions scripts/zones/Port_Bastok/npcs/Gudav.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function onEventFinish(player,csid,option)
player:addKeyItem(tpz.ki.MAP_OF_THE_GUSGEN_MINES);
player:messageSpecial(ID.text.KEYITEM_OBTAINED,tpz.ki.MAP_OF_THE_GUSGEN_MINES);
end
player:addExp(2000 * EXP_RATE)
player:addFame(BASTOK,60);
player:completeQuest(BASTOK,tpz.quest.id.bastok.A_FOREMAN_S_BEST_FRIEND);
end
Expand Down
2 changes: 2 additions & 0 deletions scripts/zones/Tavnazian_Safehold/npcs/Pradiulot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ function onEventFinish(player,csid,option)
player:setCharVar("UnforgivenVar", 2)
player:addKeyItem(tpz.ki.MAP_OF_TAVNAZIA)
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.MAP_OF_TAVNAZIA) -- Map of Tavnazia
player:addExp(2000 * EXP_RATE)
player:addGil(2000 * GIL_RATE)
player:completeQuest(OTHER_AREAS_LOG, tpz.quest.id.otherAreas.UNFORGIVEN)
elseif csid == 206 then
player:setCharVar("UnforgivenVar", 0)
Expand Down