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]Chips Implementation #5830

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,7 @@ xi.item =
BOTTLE_OF_TERROANIMA = 5263,
MISTMELT = 5265,
CHUNK_OF_SHUMEYO_SALT = 5267,
CCB_POLYMER_PUMP = 5268,
OLD_BULLET_BOX = 5284,
TOOLBAG_UCHITAKE = 5308,
TOOLBAG_TSURARA = 5309,
Expand Down
123 changes: 123 additions & 0 deletions scripts/quests/bastok/Chips.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
-----------------------------------
-- Chips
-----------------------------------
-- Log ID: 1, Quest ID: 82
-- NPC: Ghebi Damomohe !pos 17.05 -0.11 -5.53 245
-- NPC: Cid !pos -12.53 -10.98 1.09 237
-----------------------------------
local metalworksID = zones[xi.zone.METALWORKS]
-----------------------------------

local quest = Quest:new(xi.questLog.BASTOK, xi.quest.id.bastok.CHIPS)

local chips =
{
xi.item.CARMINE_CHIP,
xi.item.CYAN_CHIP,
xi.item.GRAY_CHIP,
}

quest.reward =
{
item = xi.item.CCB_POLYMER_PUMP,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
(player:getCurrentMission(xi.mission.log_id.COP) >= xi.mission.id.cop.ONE_TO_BE_FEARED or
xi.mission.getVar(player, xi.mission.log_id.COP, xi.mission.id.cop.ONE_TO_BE_FEARED, 'Status') == 1) and
not quest:getMustZone(player)
end,

[xi.zone.LOWER_JEUNO] =
{
['Ghebi_Damomohe'] = quest:progressEvent(169),

onEventFinish =
{
[169] = function(player, csid, option, npc)
if option == 0 then
quest:begin(player)
else
quest:setMustZone(player)
end
end,
},
},
},

{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED
end,

[xi.zone.METALWORKS] =
{
['Cid'] =
{
onTrade = function(player, npc, trade)
if
npcUtil.tradeHasExactly(trade, chips) and
not player:hasItem(xi.item.CCB_POLYMER_PUMP)
then
return quest:progressEvent(883)
elseif
player:hasItem(xi.item.CCB_POLYMER_PUMP) or
player:getFreeSlotsCount() == 0
then
return quest:messageSpecial(metalworksID.text.FULL_INVENTORY_AFTER_TRADE, xi.item.CCB_POLYMER_PUMP)
end
end,
},

onEventFinish =
{
[883] = function(player, csid, option, npc)
if quest:complete(player) then
player:confirmTrade()
end
end,
},
},
},

{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_COMPLETED
end,

[xi.zone.METALWORKS] =
{
['Cid'] =
{
onTrade = function(player, npc, trade)
if
npcUtil.tradeHasExactly(trade, chips) and
not player:hasItem(xi.item.CCB_POLYMER_PUMP)
then
return quest:progressEvent(884)
elseif
player:hasItem(xi.item.CCB_POLYMER_PUMP) or
player:getFreeSlotsCount() == 0
then
return quest:messageSpecial(metalworksID.text.FULL_INVENTORY_AFTER_TRADE, xi.item.CCB_POLYMER_PUMP)
end
end,
},

onEventFinish =
{
[884] = function(player, csid, option, npc)
if npcUtil.giveItem(player, xi.item.CCB_POLYMER_PUMP) then
player:confirmTrade()
end
end,
},
},
},
}

return quest
Loading