Skip to content

Commit

Permalink
[Quest]An Undying Pledge Conv
Browse files Browse the repository at this point in the history
  • Loading branch information
hooksta4 committed May 31, 2024
1 parent f29495f commit dae90f8
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 90 deletions.
1 change: 1 addition & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3930,6 +3930,7 @@ xi.item =
NYMPH_SHIELD = 12364,
PICAROONS_SHIELD = 12370,
CLIPEUS = 12371,
LIGHT_BUCKLER = 12375,
ASTRAL_ASPIS = 12382,
ACHERON_SHIELD = 12385,
MERCENARYS_TARGE = 12389,
Expand Down
132 changes: 132 additions & 0 deletions scripts/quests/outlands/An_Undying_Pledge.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
-----------------------------------
-- An Undying Pledge
-----------------------------------
-- Log ID: 5, Quest ID: 149
-- Stray Cloud : !pos -18 1 -20 252
-- qm5 : !pos 133 -9 221 176
-----------------------------------
local ssgID = zones[xi.zone.SEA_SERPENT_GROTTO]

local quest = Quest:new(xi.questLog.OUTLANDS, xi.quest.id.outlands.AN_UNDYING_PLEDGE)

quest.reward =
{
item = xi.item.LIGHT_BUCKLER,
fameArea = xi.fameArea.NORG,
fame = 50,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
player:getFameLevel(xi.fameArea.NORG) >= 4
end,

[xi.zone.NORG] =
{
['Stray_Cloud'] = quest:progressEvent(225),

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

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

[xi.zone.NORG] =
{
['Stray_Cloud'] =
{
onTrigger = function(player, npc)
if quest:getVar(player, 'Prog') == 0 then
return quest:event(228)
elseif quest:getVar(player, 'Prog') == 1 then
return quest:event(229)
elseif quest:getVar(player, 'Prog') == 3 then
return quest:progressEvent(227)
end
end,
},

onTriggerAreaEnter =
{
[1] = function(player, triggerArea)
if quest:getVar(player, 'Prog') == 0 then
return quest:progressEvent(226)
end
end,
},

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

[227] = function(player, csid, option, npc)
if quest:complete(player) then
player:delKeyItem(xi.ki.CALIGINOUS_BLADE)
end
end,
},
},

[xi.zone.SEA_SERPENT_GROTTO] =
{
['qm5'] =
{
onTrigger = function(player, npc)
if
quest:getVar(player, 'Prog') == 1 and
npcUtil.popFromQM(player, npc, ssgID.mob.GLYRYVILU, { claim = true, hide = 0 })
then
return quest:messageSpecial(ssgID.text.BODY_NUMB_DREAD)
elseif
quest:getVar(player, 'Prog') == 2
then
return quest:progressEvent(18)
end
end,
},

onEventFinish =
{
[18] = function(player, csid, option, npc)
npcUtil.giveKeyItem(player, xi.ki.CALIGINOUS_BLADE)
quest:setVar(player, 'Prog', 3)
end,
},

['Glyryvilu'] =
{
onMobDeath = function(mob, player, optParams)
if quest:getVar(player, 'Prog') == 1 then
quest:setVar(player, 'Prog', 2)
end
end,
},
},
},

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

[xi.zone.NORG] =
{
['Stray_Cloud'] = quest:event(230):replaceDefault(),
},
},
}

return quest
29 changes: 15 additions & 14 deletions scripts/zones/Norg/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
local ID = zones[xi.zone.NORG]

return {
['_700'] = { messageSpecial = ID.text.DOOR_IS_LOCKED },
['Aeka'] = { event = 120 },
['Andrause'] = { event = 239 },
['Comitiolus'] = { event = 72 },
['Heillal'] = { event = 64 },
['Jaucribaix'] = { event = 71 },
['Kamui'] = { event = 61 },
['Keal'] = { event = 89 },
['Laisrean'] = { event = 83 },
['Ranemaud'] = { event = 68 },
['Ryoma'] = { event = 94 },
['Shivivi'] = { event = 85 },
['Verctissa'] = { event = 114 },
['Washu'] = { event = 80 },
['_700'] = { messageSpecial = ID.text.DOOR_IS_LOCKED },
['Aeka'] = { event = 120 },
['Andrause'] = { event = 239 },
['Comitiolus'] = { event = 72 },
['Heillal'] = { event = 64 },
['Jaucribaix'] = { event = 71 },
['Kamui'] = { event = 61 },
['Keal'] = { event = 89 },
['Laisrean'] = { event = 83 },
['Ranemaud'] = { event = 68 },
['Ryoma'] = { event = 94 },
['Shivivi'] = { event = 85 },
['Stray_Cloud'] = { event = 231 },
['Verctissa'] = { event = 114 },
['Washu'] = { event = 80 },
}
11 changes: 0 additions & 11 deletions scripts/zones/Norg/Zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,12 @@ zoneObject.onZoneIn = function(player, prevZone)
end

zoneObject.onTriggerAreaEnter = function(player, triggerArea)
switch (triggerArea:GetTriggerAreaID()): caseof
{
[1] = function() -- An Undying Pledge cs trigger
if player:getCharVar('anUndyingPledgeCS') == 1 then
player:startEvent(226)
end
end,
}
end

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

zoneObject.onEventFinish = function(player, csid, option, npc)
if csid == 226 then
player:setCharVar('anUndyingPledgeCS', 2)
end
end

return zoneObject
41 changes: 0 additions & 41 deletions scripts/zones/Norg/npcs/Stray_Cloud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,12 @@ entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
local anUndyingPledge = player:getQuestStatus(xi.questLog.OUTLANDS, xi.quest.id.outlands.AN_UNDYING_PLEDGE)

if
anUndyingPledge == xi.questStatus.QUEST_AVAILABLE and
player:getFameLevel(xi.fameArea.NORG) >= 4
then
player:startEvent(225) -- Start quest
elseif
anUndyingPledge == xi.questStatus.QUEST_ACCEPTED and
player:hasKeyItem(xi.ki.CALIGINOUS_BLADE)
then
player:startEvent(227) -- Quest Finish
elseif
anUndyingPledge == xi.questStatus.QUEST_ACCEPTED and
player:getCharVar('anUndyingPledgeCS') == 1
then
player:startEvent(228) -- Extra Dialogue
elseif
anUndyingPledge == xi.questStatus.QUEST_ACCEPTED and
player:getCharVar('anUndyingPledgeCS') == 2
then
player:startEvent(229) -- Extra Dialogue
elseif anUndyingPledge == xi.questStatus.QUEST_COMPLETED then
player:startEvent(230)
else
player:startEvent(231) -- Standard Conversation
end
end

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

entity.onEventFinish = function(player, csid, option, npc)
if csid == 225 then
player:addQuest(xi.questLog.OUTLANDS, xi.quest.id.outlands.AN_UNDYING_PLEDGE)
player:setCharVar('anUndyingPledgeCS', 1)
elseif
csid == 227 and
npcUtil.completeQuest(player, xi.questLog.OUTLANDS, xi.quest.id.outlands.AN_UNDYING_PLEDGE, {
item = 12375,
fameArea = xi.fameArea.NORG,
fame = 50,
var = 'anUndyingPledgeCS',
})
then
player:delKeyItem(xi.ki.CALIGINOUS_BLADE)
end
end

return entity
1 change: 1 addition & 0 deletions scripts/zones/Sea_Serpent_Grotto/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local ID = zones[xi.zone.SEA_SERPENT_GROTTO]

return {
['qm1'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm5'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['Shady_Sconce'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['Waterfall_Basin'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY_2 },
}
3 changes: 0 additions & 3 deletions scripts/zones/Sea_Serpent_Grotto/mobs/Glyryvilu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
local entity = {}

entity.onMobDeath = function(mob, player, optParams)
if player:getCharVar('anUndyingPledgeCS') == 2 then
player:setCharVar('anUndyingPledgeNM_killed', 1)
end
end

return entity
21 changes: 0 additions & 21 deletions scripts/zones/Sea_Serpent_Grotto/npcs/qm5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,12 @@
-- Quests: An Undying Pledge
-- !pos 135 -9 220
-----------------------------------
local ID = zones[xi.zone.SEA_SERPENT_GROTTO]
-----------------------------------
local entity = {}

entity.onTrigger = function(player, npc)
if
player:getCharVar('anUndyingPledgeCS') == 2 and
player:getCharVar('anUndyingPledgeNM_killed') == 1
then
player:startEvent(18)
elseif
player:getCharVar('anUndyingPledgeCS') == 2 and
player:getCharVar('anUndyingPledgeNM_killed') == 0 and
npcUtil.popFromQM(player, npc, ID.mob.GLYRYVILU, { hide = 0 })
then
player:messageSpecial(ID.text.BODY_NUMB_DREAD)
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end
end

entity.onEventFinish = function(player, csid, option, npc)
if csid == 18 then
npcUtil.giveKeyItem(player, xi.ki.CALIGINOUS_BLADE)
player:setCharVar('anUndyingPledgeCS', 3)
player:setCharVar('anUndyingPledgeNM_killed', 0)
end
end

return entity

0 comments on commit dae90f8

Please sign in to comment.