Skip to content

Commit

Permalink
[Quest]RDM AF3 Peace Spirit Conv
Browse files Browse the repository at this point in the history
[Quest]RDM AF3 Peace Spirit Conv

[Quest]RDM AF3 Peace Spirit Conv
  • Loading branch information
hooksta4 committed May 30, 2024
1 parent a9dd8f4 commit 07a1cc7
Show file tree
Hide file tree
Showing 11 changed files with 253 additions and 125 deletions.
236 changes: 236 additions & 0 deletions scripts/quests/sandoria/RDM_AF3_Peace_for_the_Spirit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
-----------------------------------
-- Peace for the Spirit
-----------------------------------
-- Log ID: 0, Quest ID: 86
-- Curilla !pos 27 0.1 0.1 233
-- Sharzalion !pos 95 0 111 230
-- Daggo !pos 89 1 119 230
-- Miser Murphy !pos -14 -16 70 204
-- Dry Fountain !pos -14 -16 70 204
-- Oaken Box !pos -164 0 224 200
-----------------------------------
local feiyinID = zones[xi.zone.FEIYIN]
local gcID = zones[xi.zone.GARLAIGE_CITADEL]
-----------------------------------

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

quest.reward =
{
item = xi.item.WARLOCKS_CHAPEAU,
fame = 60,
fameArea = xi.fameArea.SANDORIA,
title = xi.title.PARAGON_OF_RED_MAGE_EXCELLENCE,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
player:hasCompletedQuest(xi.questLog.SANDORIA, xi.quest.id.sandoria.ENVELOPED_IN_DARKNESS) and
player:getMainJob() == xi.job.RDM and
player:getMainLvl() >= 50
end,

[xi.zone.CHATEAU_DORAGUILLE] =
{
['Curilla'] = quest:progressEvent(109),

onEventFinish =
{
[109] = function(player, csid, option, npc)
if option == 1 then
quest:begin(player)
end
end,
},
},
},

{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED
end,

[xi.zone.CHATEAU_DORAGUILLE] =
{
['Curilla'] =
{
onTrigger = function(player, npc)
local progress = quest:getVar(player, 'Prog')

if progress >= 1 then
return quest:event(113)
else
return quest:event(108)
end
end,
},
},

[xi.zone.SOUTHERN_SAN_DORIA] =
{
['Sharzalion'] =
{
onTrigger = function(player, npc)
local progress = quest:getVar(player, 'Prog')

if progress == 0 then
return quest:progressEvent(64)
elseif progress == 1 then
return quest:event(65)
elseif progress == 2 then
return quest:progressEvent(66)
elseif progress == 5 then
return quest:event(68)
end
end,
},

['Daggao'] =
{
onTrigger = function(player, npc)
local progress = quest:getVar(player, 'Prog')

if progress == 3 then
return quest:progressEvent(72)
elseif progress == 5 then
return quest:event(73)
end
end,
},

onEventFinish =
{
[64] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 1)
end,

[66] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 3)
end,

[72] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 4)
end,
},
},

[xi.zone.FEIYIN] =
{
onZoneIn =
{
function(player, prevZone)
if
quest:getVar(player, 'Prog') == 1 and
not player:hasItem(xi.item.ANTIQUE_COIN)
then
SpawnMob(feiyinID.mob.MISER_MURPHY)
end
end,
},

['Dry_Fountain'] =
{
onTrade = function(player, npc, trade)
if npcUtil.tradeHasExactly(trade, xi.item.ANTIQUE_COIN) then
return quest:progressEvent(17)
end
end,
},

onEventFinish =
{
[17] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 2)
player:confirmTrade()
end,
},
},

[xi.zone.GARLAIGE_CITADEL] =
{
['Oaken_Box'] =
{
onTrigger = function(player, npc)
if quest:getVar(player, 'Prog') == 4 then
if
quest:getLocalVar(player, 'nmPopped') == 0 and -- players can kill NM, get nail puller zone and repop until they trade to box!
npcUtil.popFromQM(player, npc, gcID.mob.GUARDIAN_STATUE, { claim = true, hide = 0 })
then
quest:setLocalVar(player, 'nmPopped', 1) -- players can only pop once/zone
return quest:noAction()
elseif GetMobByID(gcID.mob.GUARDIAN_STATUE):isAlive() then
return quest:messageSpecial(gcID.text.SOMETHING_WRONG)
elseif
quest:getLocalVar(player, 'nmPopped') == 1 and
not GetMobByID(gcID.mob.GUARDIAN_STATUE):isAlive()
then
return quest:messageSpecial(gcID.text.BOX_SCATTERED, xi.item.NAIL_PULLER)
end
elseif quest:getVar(player, 'Prog') == 5 then
return quest:messageSpecial(gcID.text.BOX_DEFAULT)
end
end,

onTrade = function(player, npc, trade)
local progress = quest:getVar(player, 'Prog')

if
npcUtil.tradeHasExactly(trade, xi.item.NAIL_PULLER) and
progress == 4
then
return quest:progressEvent(14)
end
end,
},

onEventFinish =
{
[14] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 5)
player:confirmTrade()
end,
},
},

[xi.zone.NORTHERN_SAN_DORIA] =
{
onZoneIn =
{
function(player, prevZone)
if quest:getVar(player, 'Prog') == 5 then
return 49
end
end,
},

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

{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_COMPLETED
end,

[xi.zone.CHATEAU_DORAGUILLE] =
{
['Curilla'] = quest:event(52):replaceDefault(),
},

[xi.zone.SOUTHERN_SAN_DORIA] =
{
['Sharzalion'] = quest:event(69):replaceDefault(),
['Daggao'] = quest:event(60):replaceDefault(),
},
},
}

return quest
1 change: 1 addition & 0 deletions scripts/zones/Chateau_dOraguille/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ return {
['Arsha'] = { event = 513 },
['Chaphoire'] = { event = 512 },
['Chupaile'] = { event = 514 },
['Curilla'] = { event = 530 },
['Ferdechiond'] = { event = 511 },
['Halver'] = { text = ID.text.HALVER_OFFSET + 1092 },
}
41 changes: 1 addition & 40 deletions scripts/zones/Chateau_dOraguille/npcs/Curilla.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
local mLvl = player:getMainLvl()
local mJob = player:getMainJob()
local envelopedInDarkness = player:getQuestStatus(xi.questLog.SANDORIA, sandyQuests.ENVELOPED_IN_DARKNESS)
local peaceForTheSpirit = player:getQuestStatus(xi.questLog.SANDORIA, sandyQuests.PEACE_FOR_THE_SPIRIT)
local rank3 = player:getRank(player:getNation()) >= 3 and 1 or 0

-- Trust: San d'Oria (Curilla)
Expand All @@ -65,46 +61,11 @@ entity.onTrigger = function(player, npc)
not utils.mask.getBit(player:getCharVar('WildcatSandy'), 15)
then
player:startEvent(562)

-- "Peace for the Spirit" (RDM AF Body)
elseif peaceForTheSpirit == xi.questStatus.QUEST_ACCEPTED then
local questStatus = player:getCharVar('peaceForTheSpiritCS')
if questStatus == 5 then
player:startEvent(51)
elseif questStatus > 1 then
player:startEvent(113)
else
player:startEvent(108)
end
elseif
mJob == xi.job.RDM and
mLvl >= xi.settings.main.AF2_QUEST_LEVEL and
envelopedInDarkness == xi.questStatus.QUEST_COMPLETED and
peaceForTheSpirit == xi.questStatus.QUEST_AVAILABLE
then
player:startEvent(109) -- Start

-- Default dialogue after "Peace for the Spirit"
elseif peaceForTheSpirit == xi.questStatus.QUEST_COMPLETED then
player:startEvent(52)

-- Default dialogue after "Enveloped in Darkness"
elseif
envelopedInDarkness == xi.questStatus.QUEST_COMPLETED and
peaceForTheSpirit == xi.questStatus.QUEST_AVAILABLE
then
player:startEvent(114)

-- Default dialogue
else
player:startEvent(530)
end
end

entity.onEventFinish = function(player, csid, option, npc)
if csid == 109 and option == 1 then
player:addQuest(xi.questLog.SANDORIA, sandyQuests.PEACE_FOR_THE_SPIRIT)
elseif csid == 562 then
if csid == 562 then
player:setCharVar('WildcatSandy', utils.mask.setBit(player:getCharVar('WildcatSandy'), 15, true))
elseif csid == 573 and option == 2 then
player:addSpell(xi.magic.spell.CURILLA, true, true)
Expand Down
1 change: 1 addition & 0 deletions scripts/zones/FeiYin/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ local ID = zones[xi.zone.FEIYIN]
return {
['_no4'] = { event = 15 },
['qm1'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['Dry_Fountain'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
}
15 changes: 0 additions & 15 deletions scripts/zones/FeiYin/npcs/Dry_Fountain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,18 @@
-- Involved In Quest: Peace for the Spirit
-- !pos -17 -16 71 204
-----------------------------------
local ID = zones[xi.zone.FEIYIN]
-----------------------------------
local entity = {}

entity.onTrade = function(player, npc, trade)
if player:getQuestStatus(xi.questLog.SANDORIA, xi.quest.id.sandoria.PEACE_FOR_THE_SPIRIT) == xi.questStatus.QUEST_ACCEPTED then
if
trade:hasItemQty(xi.item.ANTIQUE_COIN, 1) and
trade:getItemCount() == 1
then
player:startEvent(17)
end
end
end

entity.onTrigger = function(player, npc)
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end

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

entity.onEventFinish = function(player, csid, option, npc)
if csid == 17 then
player:tradeComplete()
player:setCharVar('peaceForTheSpiritCS', 2)
end
end

return entity
17 changes: 9 additions & 8 deletions scripts/zones/Garlaige_Citadel/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
local ID = zones[xi.zone.GARLAIGE_CITADEL]

return {
['qm1'] = { messageSpecial = ID.text.YOU_FIND_NOTHING },
['qm5'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm6'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm9'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm10'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm12'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm13'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm15'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm1'] = { messageSpecial = ID.text.YOU_FIND_NOTHING },
['qm5'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm6'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm9'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm10'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm12'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm13'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['qm15'] = { messageSpecial = ID.text.HOLE_IN_THE_CEILING },
['Oaken_Box'] = { messageSpecial = ID.text.YOU_FIND_NOTHING },
}
3 changes: 3 additions & 0 deletions scripts/zones/Garlaige_Citadel/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ zones[xi.zone.GARLAIGE_CITADEL] =
HEAT_FROM_CEILING = 7311, -- You feel a terrible heat from the ceiling.
THE_PRESENCE_MOVES = 7315, -- The presence in the ceiling seems to have moved to the east.
CHEST_UNLOCKED = 7341, -- You unlock the chest!
BOX_DEFAULT = 7351, -- Boxes are carelessly scattered here.
BOX_SCATTERED = 7352, -- Boxes are carelessly scattered here. Perhaps you could open them with Nail Puller
SOMETHING_WRONG = 7356, -- Something feels wrong, but nothing happens.
ITEMS_ITEMS_LA_LA = 7468, -- You can hear a strange voice... Items, items, la la la la la
GOBLIN_SLIPPED_AWAY = 7474, -- The Goblin slipped away when you were not looking...
YOU_COULD_OPEN_THE_GATE = 7526, -- If only you had %, you could open the banishing gate...
Expand Down
Loading

0 comments on commit 07a1cc7

Please sign in to comment.