Skip to content

Commit b725c0a

Browse files
authored
Merge pull request LandSandBoat#7306 from SlashingTangents/Chips
[lua] Add quest "Chips"
2 parents 35d967a + a7824bc commit b725c0a

File tree

3 files changed

+128
-1
lines changed

3 files changed

+128
-1
lines changed

scripts/enum/item.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,6 +2674,7 @@ xi.item =
26742674
BOTTLE_OF_TERROANIMA = 5263,
26752675
MISTMELT = 5265,
26762676
CHUNK_OF_SHUMEYO_SALT = 5267,
2677+
CCB_POLYMER = 5268,
26772678
OLD_BULLET_BOX = 5284,
26782679
TOOLBAG_UCHITAKE = 5308,
26792680
TOOLBAG_TSURARA = 5309,

scripts/globals/quests.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ xi.quest.id =
201201
TEAK_ME_TO_THE_STARS = 79, -- ± Converted
202202
HYPER_ACTIVE = 80,
203203
THE_NAMING_GAME = 81,
204-
CHIPS = 82,
204+
CHIPS = 82, -- ± Converted
205205
BAIT_AND_SWITCH = 83,
206206
LURE_OF_THE_WILDCAT = 84, -- + Converted
207207
ACHIEVING_TRUE_POWER = 85,

scripts/quests/bastok/Chips.lua

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
-----------------------------------
2+
-- Chips
3+
-----------------------------------
4+
-- Log ID: 1, Quest ID: 82
5+
-----------------------------------
6+
-- CoP 6-4 : !addmission 6 638
7+
-- CoP 7-1 : !addmission 6 648
8+
-- Ghebi Damomohe : !pos 15.535 -0.111 -7.603
9+
-- Cid : !pos -12 -12 1 237
10+
-----------------------------------
11+
local metalID = zones[xi.zone.METALWORKS]
12+
-----------------------------------
13+
14+
local quest = Quest:new(xi.questLog.BASTOK, xi.quest.id.bastok.CHIPS)
15+
16+
quest.reward =
17+
{
18+
item = xi.item.CCB_POLYMER,
19+
}
20+
21+
quest.sections =
22+
{
23+
{
24+
check = function(player, status, vars)
25+
return status == xi.questStatus.QUEST_AVAILABLE
26+
end,
27+
28+
[xi.zone.LOWER_JEUNO] =
29+
{
30+
['Ghebi_Damomohe'] =
31+
{
32+
onTrigger = function(player, npc)
33+
if
34+
not quest:getMustZone(player) and
35+
(player:hasCompletedMission(xi.mission.log_id.COP, xi.mission.id.cop.ONE_TO_BE_FEARED) or
36+
(player:getCurrentMission(xi.mission.log_id.COP) == xi.mission.id.cop.ONE_TO_BE_FEARED and
37+
xi.mission.getVar(player, xi.mission.log_id.COP, xi.mission.id.cop.ONE_TO_BE_FEARED, 'Status') >= 1))
38+
then
39+
return quest:progressEvent(169)
40+
end
41+
end,
42+
},
43+
44+
onEventFinish =
45+
{
46+
[169] = function(player, csid, option, npc)
47+
if option == 0 then
48+
quest:begin(player)
49+
elseif option == 1 then
50+
quest:setMustZone(player)
51+
end
52+
end,
53+
},
54+
},
55+
},
56+
57+
{
58+
check = function(player, status, vars)
59+
return status == xi.questStatus.QUEST_ACCEPTED
60+
end,
61+
62+
[xi.zone.METALWORKS] =
63+
{
64+
['Cid'] =
65+
{
66+
onTrade = function(player, npc, trade)
67+
if npcUtil.tradeHasExactly(trade, { xi.item.CARMINE_CHIP, xi.item.CYAN_CHIP, xi.item.GRAY_CHIP }) then
68+
if
69+
player:getFreeSlotsCount() == 0 or
70+
player:hasItem(xi.item.CCB_POLYMER)
71+
then
72+
return player:messageSpecial(metalID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.CCB_POLYMER)
73+
else
74+
return quest:progressEvent(883)
75+
end
76+
end
77+
end,
78+
},
79+
80+
onEventFinish =
81+
{
82+
[883] = function(player, csid, option, npc)
83+
if quest:complete(player) then
84+
player:confirmTrade()
85+
end
86+
end,
87+
},
88+
},
89+
},
90+
91+
{
92+
check = function(player, status, vars)
93+
return status == xi.questStatus.QUEST_COMPLETED
94+
end,
95+
96+
[xi.zone.METALWORKS] =
97+
{
98+
['Cid'] =
99+
{
100+
onTrade = function(player, npc, trade)
101+
if npcUtil.tradeHasExactly(trade, { xi.item.CARMINE_CHIP, xi.item.CYAN_CHIP, xi.item.GRAY_CHIP }) then
102+
if
103+
player:getFreeSlotsCount() == 0 or
104+
player:hasItem(xi.item.CCB_POLYMER)
105+
then
106+
return player:messageSpecial(metalID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.CCB_POLYMER)
107+
else
108+
return quest:progressEvent(884)
109+
end
110+
end
111+
end,
112+
},
113+
114+
onEventFinish =
115+
{
116+
[884] = function(player, csid, option, npc)
117+
if quest:complete(player) then
118+
player:confirmTrade()
119+
end
120+
end,
121+
},
122+
},
123+
},
124+
}
125+
126+
return quest

0 commit comments

Comments
 (0)