This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 551
/
Rakoh_Buuma.lua
62 lines (57 loc) · 2.68 KB
/
Rakoh_Buuma.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-----------------------------------
-- Area: Windurst Woods
-- NPC: Rakoh Buuma
-- Starts Windurst Missions
-- !pos 106 -5 -23 241
-----------------------------------
local ID = require("scripts/zones/Windurst_Woods/IDs")
require("scripts/globals/keyitems")
require("scripts/globals/missions")
require("scripts/globals/titles")
require("scripts/globals/zone")
-----------------------------------
function onTrigger(player,npc)
if player:getNation() ~= dsp.nation.WINDURST then
player:startEvent(105) -- for other nation
else
local CurrentMission = player:getCurrentMission(WINDURST)
local MissionStatus = player:getCharVar("MissionStatus")
local pRank = player:getRank()
local cs, p, offset = getMissionOffset(player,1,CurrentMission,MissionStatus)
if (CurrentMission <= dsp.mission.id.windurst.THE_SHADOW_AWAITS and (cs ~= 0 or offset ~= 0 or (CurrentMission == dsp.mission.id.windurst.THE_HORUTOTO_RUINS_EXPERIMENT and offset == 0))) then
if cs == 0 then
player:showText(npc,ORIGINAL_MISSION_OFFSET + offset) -- dialog after accepting mission
else
player:startEvent(cs,p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8])
end
elseif (CurrentMission ~= dsp.mission.id.windurst.NONE) then
player:startEvent(112)
elseif not player:hasCompletedMission(WINDURST,dsp.mission.id.windurst.THE_HORUTOTO_RUINS_EXPERIMENT) then
player:startEvent(121)
elseif not player:hasCompletedMission(WINDURST,dsp.mission.id.windurst.THE_HEART_OF_THE_MATTER) then
player:startEvent(132)
elseif not player:hasCompletedMission(WINDURST,dsp.mission.id.windurst.THE_PRICE_OF_PEACE) then
player:startEvent(149)
elseif player:hasKeyItem(dsp.ki.MESSAGE_TO_JEUNO_WINDURST) then
player:startEvent(197)
elseif player:hasCompletedMission(WINDURST,dsp.mission.id.windurst.MOON_READING) then
player:startEvent(632)
else
local flagMission, repeatMission = getMissionMask(player)
player:startEvent(114,flagMission,0,0,0,dsp.ki.STAR_CRESTED_SUMMONS,repeatMission)
end
end
end
function onEventUpdate(player,csid,option)
end
function onEventFinish(player,csid,option)
finishMissionTimeline(player,1,csid,option)
if csid == 121 and option == 1 then
player:addTitle(dsp.title.NEW_BUUMAS_BOOMERS_RECRUIT)
elseif csid == 114 and (option == 12 or option == 15) then
player:addKeyItem(dsp.ki.STAR_CRESTED_SUMMONS)
player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.STAR_CRESTED_SUMMONS)
elseif csid == 632 then
player:setCharVar("WWoodsRTenText", 1)
end
end