Skip to content

Commit 19bd56e

Browse files
committed
Converted Knot Quite There
1 parent ea96647 commit 19bd56e

8 files changed

Lines changed: 128 additions & 67 deletions

File tree

scripts/globals/quests.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ xi.quest.id =
733733
BOY_AND_THE_BEAST = 24, -- + Converted
734734
WRATH_OF_THE_GRIFFON = 25, -- + Converted
735735
THE_LOST_BOOK = 26, -- + Converted
736-
KNOT_QUITE_THERE = 27,
736+
KNOT_QUITE_THERE = 27, -- + Converted
737737
A_MANIFEST_PROBLEM = 28,
738738
BEANS_AHOY = 29, -- +
739739
BEAST_FROM_THE_EAST = 30,
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
-----------------------------------
2+
-- Knot Quite There
3+
-----------------------------------
4+
-- !addquest 7 27
5+
-- Door Acolyte Hostel : !pos 124.000 -3.000 222.215 94
6+
-- Bulwark Gate : !pos -445 0 342 98
7+
-- Door:House : !pos 148 0 27 80
8+
-----------------------------------
9+
10+
local quest = Quest:new(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE)
11+
12+
quest.reward =
13+
{
14+
item = xi.item.PLATINUM_BEASTCOIN,
15+
}
16+
17+
quest.sections =
18+
{
19+
-- Talk to the Door Acolyte Hostel in Windurst Waters [S].
20+
{
21+
check = function(player, status, vars)
22+
return status == xi.questStatus.QUEST_AVAILABLE and
23+
player:hasCompletedMission(xi.mission.log_id.WOTG, xi.mission.id.wotg.BACK_TO_THE_BEGINNING) and
24+
player:hasCompletedQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES)
25+
end,
26+
27+
[xi.zone.WINDURST_WATERS_S] =
28+
{
29+
['Door_Acolyte_Hostel_down'] =
30+
{
31+
onTrigger = function(player, npc)
32+
return quest:progressEvent(151)
33+
end,
34+
},
35+
36+
onEventFinish =
37+
{
38+
[151] = function(player, csid, option, npc)
39+
if option == 1 then
40+
quest:begin(player)
41+
end
42+
end,
43+
},
44+
},
45+
},
46+
47+
-- Speak with the Bulwark Gate, trade a One Hundred Eight Knot Quipu,
48+
-- enter Southern San d'Oria [S] from East Ronfaure [S], then check the door.
49+
{
50+
check = function(player, status, vars)
51+
return status == xi.questStatus.QUEST_ACCEPTED
52+
end,
53+
54+
[xi.zone.SAUROMUGUE_CHAMPAIGN_S] =
55+
{
56+
['Bulwark_Gate'] =
57+
{
58+
onTrigger = function(player, npc)
59+
if quest:getVar(player, 'Prog') == 0 then
60+
return quest:progressEvent(105)
61+
elseif quest:getVar(player, 'Prog') == 1 then
62+
return quest:event(107)
63+
elseif quest:getVar(player, 'Prog') == 2 then
64+
return quest:event(108)
65+
end
66+
end,
67+
68+
onTrade = function(player, npc, trade)
69+
if
70+
quest:getVar(player, 'Prog') == 1 and
71+
npcUtil.tradeHasExactly(trade, { xi.item.ONE_HUNDRED_EIGHT_KNOT_QUIPU })
72+
then
73+
return quest:progressEvent(106)
74+
end
75+
end,
76+
},
77+
78+
onEventFinish =
79+
{
80+
[105] = function(player, csid, option, npc)
81+
quest:setVar(player, 'Prog', 1)
82+
end,
83+
84+
[106] = function(player, csid, option, npc)
85+
player:confirmTrade()
86+
quest:setVar(player, 'Prog', 2)
87+
end,
88+
},
89+
},
90+
91+
[xi.zone.SOUTHERN_SAN_DORIA_S] =
92+
{
93+
onZoneIn = function(player, prevZone)
94+
if
95+
prevZone == xi.zone.EAST_RONFAURE_S and
96+
quest:getVar(player, 'Prog') == 2
97+
then
98+
return 62
99+
end
100+
end,
101+
102+
['_6eo'] =
103+
{
104+
onTrigger = function(player, npc)
105+
if quest:getVar(player, 'Prog') == 3 then
106+
return quest:progressEvent(63)
107+
end
108+
end,
109+
},
110+
111+
onEventFinish =
112+
{
113+
[62] = function(player, csid, option, npc)
114+
quest:setVar(player, 'Prog', 3)
115+
end,
116+
117+
[63] = function(player, csid, option, npc)
118+
quest:complete(player)
119+
end,
120+
},
121+
},
122+
},
123+
}
124+
125+
return quest

scripts/zones/Sauromugue_Champaign_[S]/npcs/Bulwark_Gate.lua

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,12 @@
77
local entity = {}
88

99
entity.onTrade = function(player, npc, trade)
10-
if
11-
player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and
12-
player:getCharVar('KnotQuiteThere') == 1
13-
then
14-
if
15-
trade:hasItemQty(xi.item.ONE_HUNDRED_EIGHT_KNOT_QUIPU, 1) and
16-
trade:getGil() == 0 and
17-
trade:getItemCount() == 1
18-
then
19-
player:startEvent(106)
20-
end
21-
end
2210
end
2311

2412
entity.onTrigger = function(player, npc)
25-
if player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED then
26-
if player:getCharVar('KnotQuiteThere') == 0 then
27-
player:startEvent(105)
28-
end
29-
end
3013
end
3114

3215
entity.onEventFinish = function(player, csid, option, npc)
33-
if csid == 105 then
34-
player:setCharVar('KnotQuiteThere', 1)
35-
elseif csid == 106 then
36-
player:tradeComplete()
37-
player:setCharVar('KnotQuiteThere', 2)
38-
end
3916
end
4017

4118
return entity

scripts/zones/Southern_San_dOria_[S]/Zone.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ zoneObject.onInitialize = function(zone)
1212
end
1313

1414
zoneObject.onZoneIn = function(player, prevZone)
15-
if prevZone == xi.zone.EAST_RONFAURE_S then
16-
if
17-
player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and
18-
player:getCharVar('KnotQuiteThere') == 2
19-
then
20-
return 62
21-
end
22-
end
23-
2415
return xi.moghouse.onMoghouseZoneEvent(player, prevZone)
2516
end
2617

@@ -31,9 +22,6 @@ zoneObject.onEventUpdate = function(player, csid, option, npc)
3122
end
3223

3324
zoneObject.onEventFinish = function(player, csid, option, npc)
34-
if csid == 62 then
35-
player:setCharVar('KnotQuiteThere', 3)
36-
end
3725
end
3826

3927
return zoneObject

scripts/zones/Southern_San_dOria_[S]/npcs/_6eo.lua

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,13 @@
44
-- !pos 148 0 27 80
55
-- Involved in Knot Quite There
66
-----------------------------------
7-
local ID = zones[xi.zone.SOUTHERN_SAN_DORIA_S]
8-
-----------------------------------
97
---@type TNpcEntity
108
local entity = {}
119

1210
entity.onTrigger = function(player, npc)
13-
if
14-
player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and
15-
player:getCharVar('KnotQuiteThere') == 3
16-
then
17-
player:startEvent(63)
18-
end
1911
end
2012

2113
entity.onEventFinish = function(player, csid, option, npc)
22-
if csid == 63 then
23-
if player:getFreeSlotsCount() == 0 then
24-
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.PLATINUM_BEASTCOIN)
25-
else
26-
player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE)
27-
player:addItem(xi.item.PLATINUM_BEASTCOIN)
28-
player:messageSpecial(ID.text.ITEM_OBTAINED, xi.item.PLATINUM_BEASTCOIN)
29-
player:setCharVar('KnotQuiteThere', 0)
30-
end
31-
end
3214
end
3315

3416
return entity

scripts/zones/Windurst_Waters_[S]/DefaultActions.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ return {
1111
['Churacoco'] = { event = 434 },
1212
['Corbrere'] = { event = 414 },
1313
['Dallus-Mallus'] = { event = 323 },
14+
['Door_Acolyte_Hostel_down'] = { text = ID.text.DOOR_ACOLYTE_HOSTEL_LOCKED },
1415
['Eih_Lhogotan'] = { event = 407 },
1516
['Ekki-Mokki'] = { event = 409 },
1617
['Emhi_Tchaoryo'] = { event = 307 },

scripts/zones/Windurst_Waters_[S]/IDs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ zones[xi.zone.WINDURST_WATERS_S] =
3232
HOMEPOINT_SET = 10886, -- Home point set!
3333
YASSI_POSSI_DIALOG = 10906, -- Swifty-wifty and safey-wafey parcel delivery! Is there something you need to send?
3434
EZURAROMAZURA_SHOP_DIALOG = 10907, -- A potent spelly-well or two can be the key to survival in this time of war. But can you mastaru my magic, or will it master you?
35-
DOOR_ACOLYTE_HOSTEL_LOCKED = 11349, -- The door appears to be locked...
35+
DOOR_ACOLYTE_HOSTEL_LOCKED = 11350, -- The door appears to be locked...
3636
MIKHE_ARYOHCHA_DIALOG = 12486, -- Do you like the headpiece? I made it from my firrrst victim. I wear it to let everrryone know what happens when they cross Mikhe Aryohcha!
3737
LUTETE_DIALOG = 12488, -- <Yaaawn>... Mastering these Near Eastern magics can be quite taxing. If I had a choice, I'd rather be back in bed, relaxing...
3838
CAMPAIGN_RESULTS_TALLIED = 12574, -- Campaign results tallied.

scripts/zones/Windurst_Waters_[S]/npcs/Door_Acolyte_Hostel_down.lua

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ entity.onTrigger = function(player, npc)
1414
player:hasKeyItem(xi.ki.SMALL_STARFRUIT)
1515
then
1616
player:startEvent(129)
17-
elseif
18-
player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STRIKES) == xi.questStatus.QUEST_COMPLETED and
19-
player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_AVAILABLE and
20-
player:hasCompletedMission(xi.mission.log_id.WOTG, xi.mission.id.wotg.BACK_TO_THE_BEGINNING)
21-
then
22-
player:startEvent(151)
23-
elseif player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED then
24-
player:startEvent(152)
25-
else
26-
player:messageSpecial(ID.text.DOOR_ACOLYTE_HOSTEL_LOCKED)
2717
end
2818
end
2919

@@ -33,8 +23,6 @@ entity.onEventFinish = function(player, csid, option, npc)
3323
player:messageSpecial(ID.text.ITEM_OBTAINED, 4144)
3424
player:delKeyItem(xi.ki.SMALL_STARFRUIT)
3525
player:completeQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.THE_TIGRESS_STIRS)
36-
elseif csid == 151 then
37-
player:addQuest(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE)
3826
end
3927
end
4028

0 commit comments

Comments
 (0)