Skip to content

Commit

Permalink
[Quest]WHM AF1 SG'r From Beyond
Browse files Browse the repository at this point in the history
  • Loading branch information
hooksta4 committed May 29, 2024
1 parent a9dd8f4 commit 30fa43c
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 45 deletions.
92 changes: 92 additions & 0 deletions scripts/quests/sandoria/WHM_AF1_Messenger_From_Beyond.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
-----------------------------------
-- Messenger from Beyond
-- !addquest: 0 87
-- Narcheral: !pos 128 -11 128 231
-- qm2 : !pos -714 -9 68 103
-----------------------------------
local valkID = zones[xi.zone.VALKURM_DUNES]
-----------------------------------

local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND)

quest.reward =
{
item = xi.item.BLESSED_HAMMER,
fame = 20,
fameArea = xi.fameArea.SANDORIA,
}

quest.sections =
{
-- Section: Quest available.
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
player:getMainJob() == xi.job.WHM and
player:getMainLvl() >= xi.settings.main.AF1_QUEST_LEVEL
end,

[xi.zone.NORTHERN_SAN_DORIA] =
{
['Narcheral'] = quest:progressEvent(689),

onEventFinish =
{
[689] = function(player, csid, option, npc)
quest:begin(player)
end,
},
},
},

-- Section: Quest accepted
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED
end,

[xi.zone.VALKURM_DUNES] =
{
['qm2'] =
{
onTrigger = function(player, npc)
if
not player:hasItem(xi.item.TAVNAZIA_PASS) and
npcUtil.popFromQM(player, npc, valkID.mob.MARCHELUTE, { claim = true, hide = 0 })
then
return quest:messageSpecial(valkID.text.FOUL_PRESENSE)
else
return quest:messageSpecial(valkID.text.NOTHING_OUT_OF_ORDINARY)
end
end,
},
},

[xi.zone.NORTHERN_SAN_DORIA] =
{
['Narcheral'] =
{
onTrade = function(player, npc, trade)
if npcUtil.tradeHasExactly(trade, xi.item.TAVNAZIA_PASS) then
return quest:progressEvent(690) -- Finish quest.
end
end,

onTrigger = function(player, npc)
return quest:event(688)
end,
},

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

return quest
38 changes: 2 additions & 36 deletions scripts/zones/Northern_San_dOria/npcs/Narcheral.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ local ID = zones[xi.zone.NORTHERN_SAN_DORIA]
local entity = {}

entity.onTrade = function(player, npc, trade)
if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND) == xi.questStatus.QUEST_ACCEPTED then
if
trade:hasItemQty(xi.item.TAVNAZIA_PASS, 1) and
trade:getItemCount() == 1
then
player:startEvent(690) -- Finish quest "Messenger from Beyond"
end
elseif player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.PRELUDE_OF_BLACK_AND_WHITE) == xi.questStatus.QUEST_ACCEPTED then
if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.PRELUDE_OF_BLACK_AND_WHITE) == xi.questStatus.QUEST_ACCEPTED then
if
trade:hasItemQty(xi.item.CANTEEN_OF_YAGUDO_HOLY_WATER, 1) and
trade:hasItemQty(xi.item.MOCCASINS, 1) and
Expand All @@ -36,40 +29,13 @@ entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
local messengerFromBeyond = player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND)

-- Checking levels and jobs for af quest
local mLvl = player:getMainLvl()
local mJob = player:getMainJob()

if
messengerFromBeyond == xi.questStatus.QUEST_AVAILABLE and
mJob == xi.job.WHM and
mLvl >= xi.settings.main.AF1_QUEST_LEVEL
then
player:startEvent(689) -- Start quest "Messenger from Beyond"
else
player:startEvent(688) -- Standard dialog
end
end

entity.onEventUpdate = function(player, csid, option, npc)
end

entity.onEventFinish = function(player, csid, option, npc)
if csid == 689 then
player:addQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND)
elseif csid == 690 then
if player:getFreeSlotsCount() == 0 then
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.BLESSED_HAMMER)
else
player:addItem(xi.item.BLESSED_HAMMER)
player:messageSpecial(ID.text.ITEM_OBTAINED, xi.item.BLESSED_HAMMER) -- Blessed Hammer
player:tradeComplete()
player:addFame(xi.fameArea.SANDORIA, 20)
player:completeQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND)
end
elseif csid == 691 then
if csid == 691 then
if player:getFreeSlotsCount() == 0 then
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.HEALERS_DUCKBILLS) -- Healer's Duckbills
else
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/Valkurm_Dunes/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ zones[xi.zone.VALKURM_DUNES] =
SIGNPOST2 = 7374, -- Northeast: La Theine Plateau Southeast: Konschtat Highlands West: Selbina
SIGNPOST1 = 7375, -- Northeast: La Theine Plateau Southeast: Konschtat Highlands Southwest: Selbina
CONQUEST = 7385, -- You've earned conquest points!
FOUL_PRESENSE = 7719, -- You sense a foul presence.
YOU_SENSE_AN_EVIL_PRESENCE = 7729, -- You sense an evil presence...
WHAT_DO_YOU_THINK = 7731, -- What do you think you are doing!?
AN_EMPTY_LIGHT_SWIRLS = 7763, -- An empty light swirls about the cave, eating away at the surroundings...
Expand Down
9 changes: 0 additions & 9 deletions scripts/zones/Valkurm_Dunes/npcs/qm2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
if
not GetMobByID(ID.mob.MARCHELUTE):isSpawned() and
player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.MESSENGER_FROM_BEYOND) == xi.questStatus.QUEST_ACCEPTED and
not player:hasItem(xi.item.TAVNAZIA_PASS)
then
SpawnMob(ID.mob.MARCHELUTE):updateClaim(player)
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end
end

entity.onEventUpdate = function(player, csid, option, npc)
Expand Down

0 comments on commit 30fa43c

Please sign in to comment.