@@ -13,13 +13,50 @@ mission.reward =
1313 nextMission = { xi .mission .log_id .TOAU , xi .mission .id .toau .EASTERLY_WINDS },
1414}
1515
16+ local function canEnterChateau (player )
17+ local pNation = player :getNation ()
18+ local pRank = player :getRank (pNation )
19+
20+ -- Everyone can enter at rank 3.
21+ if pRank >= 3 then
22+ return true
23+ end
24+
25+ -- Sandoria citizens gain access at rank 2.
26+ if
27+ pNation == xi .nation .SANDORIA and
28+ pRank >= 2
29+ then
30+ return true
31+ end
32+
33+ -- Other citizens gain access during "The emisary"/"The three Kingdoms"
34+ if
35+ pNation ~= xi .nation .SANDORIA and
36+ player :getCurrentMission (pNation ) >= 5
37+ then
38+ return true
39+ end
40+
41+ return false
42+ end
43+
1644mission .sections =
1745{
1846 {
1947 check = function (player , currentMission , missionStatus , vars )
2048 return currentMission == mission .missionId
2149 end ,
2250
51+ [xi .zone .AHT_URHGAN_WHITEGATE ] =
52+ {
53+ [' Cacaroon' ] = mission :event (3023 , { text_table = 0 }),
54+
55+ [' Nadeey' ] = mission :event (3025 , { text_table = 0 }),
56+
57+ [' Naja_Salaheem' ] = mission :event (3021 , { text_table = 0 }),
58+ },
59+
2360 [xi .zone .CHATEAU_DORAGUILLE ] =
2461 {
2562 [' Halver' ] =
@@ -31,8 +68,22 @@ mission.sections =
3168 end ,
3269 },
3370
71+ -- Forces the player into the CS if they don't normall have access to the Chateau.
72+ onZoneIn = function (player , prevZone )
73+ if mission :getVar (player , ' Option' ) == 1 then
74+ return 563
75+ end
76+ end ,
77+
3478 onEventFinish =
3579 {
80+ -- Force zones the player out of the Chateau if they don't have access.
81+ [563 ] = function (player , csid , option , npc )
82+ player :delKeyItem (xi .ki .RAILLEFALS_LETTER )
83+ mission :complete (player )
84+ player :setPos (0 , 0 , 100 , 64 , xi .zone .NORTHERN_SAN_DORIA )
85+ end ,
86+
3687 [564 ] = function (player , csid , option , npc )
3788 if option == 1 then
3889 player :delKeyItem (xi .ki .RAILLEFALS_LETTER )
@@ -41,6 +92,33 @@ mission.sections =
4192 end ,
4293 },
4394 },
95+
96+ -- Unique interaction IF the player does not have access to the Chateau to gain access to continue the mission.
97+ [xi .zone .NORTHERN_SAN_DORIA ] =
98+ {
99+ [' Guilerme' ] =
100+ {
101+ onTrigger = function (player , npc )
102+ if
103+ player :hasKeyItem (xi .ki .RAILLEFALS_LETTER ) and
104+ not canEnterChateau (player )
105+ then
106+ return mission :progressEvent (810 )
107+ end
108+ end ,
109+ },
110+
111+ onEventFinish =
112+ {
113+ [810 ] = function (player , csid , option , npc )
114+ -- Force zones the player into the Chateau
115+ if option == 1 then
116+ mission :setVar (player , ' Option' , 1 )
117+ player :setPos (0 , 0 , - 13 , 192 , xi .zone .CHATEAU_DORAGUILLE )
118+ end
119+ end ,
120+ },
121+ },
44122 },
45123}
46124
0 commit comments