Skip to content

Commit

Permalink
[Quest]For the Birds Conv
Browse files Browse the repository at this point in the history
  • Loading branch information
hooksta4 committed May 31, 2024
1 parent 3a93950 commit da59e63
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ xi.item =
CORAL_CREST_KEY = 1659,
BRONZE_KEY = 1660,
CATHEDRAL_TAPESTRY = 1662,
ARNICA_ROOT = 1663,
CHAMELEON_DIAMOND = 1666,
CLUSTER_CORE = 1667,
CLEAN_SNAP_ROD = 1668,
Expand Down Expand Up @@ -4460,6 +4461,7 @@ xi.item =
VARIABLE_CAPE = 13681,
ETHER_TANK = 13682,
INVISIBLE_MANTLE = 13685,
JAGUAR_MANTLE = 13686,
SAPIENT_CAPE = 13687,
HI_POTION_TANK = 13688,
HI_ETHER_TANK = 13689,
Expand Down
172 changes: 172 additions & 0 deletions scripts/quests/otherAreas/For_the_Birds.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
-----------------------------------
-- For the Birds
-----------------------------------
-- Log ID: 4, Quest ID: 104
-- Koblakiq !pos -64 21 -117 11
-- Daa Bola the Seer !pos -157 -17 193 151
-- GeFhu Yagudoeye !pos -91 -3 -127 147
-----------------------------------
local beadeauxID = require('scripts/zones/Beadeaux/IDs')
-----------------------------------
local quest = Quest:new(xi.questLog.OTHER_AREAS, xi.quest.id.otherAreas.FOR_THE_BIRDS)
local quadavOffset = beadeauxID.mob.FOR_THE_BIRDS_MOBS

quest.reward =
{
item = xi.item.JAGUAR_MANTLE,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
player:hasCompletedQuest(xi.questLog.OTHER_AREAS, xi.quest.id.otherAreas.MISSIONARY_MOBLIN) and
not quest:getMustZone(player)
end,

[xi.zone.OLDTON_MOVALPOLOS] =
{
['Koblakiq'] = quest:progressEvent(14, 0, xi.item.ARNICA_ROOT ),

onEventFinish =
{
[14] = 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.OLDTON_MOVALPOLOS] =
{
['Koblakiq'] =
{
onTrigger = function(player, npc)
local prog = quest:getVar(player, 'Prog')

if prog == 0 then
return quest:event(15, 0, xi.item.ARNICA_ROOT )
elseif prog == 1 and not player:hasKeyItem(xi.ki.GLITTERING_FRAGMENT) then
return quest:progressEvent(16, 0, xi.ki.GLITTERING_FRAGMENT )
elseif prog == 2 then
return quest:event(17)
elseif prog == 3 then
return quest:progressEvent(18)

end
end,
},

onEventFinish =
{
[16] = function(player, csid, option, npc)
npcUtil.giveKeyItem(player, xi.ki.GLITTERING_FRAGMENT)
quest:setVar(player, 'Prog', 2)
end,

[18] = function(player, csid, option, npc)
if quest:complete(player) then
player:delKeyItem(xi.ki.GLITTERING_FRAGMENT)
xi.quest.setMustZone(player, xi.questLog.OTHER_AREAS, xi.quest.id.otherAreas.BETTER_THE_DEMON_YOU_KNOW)
end
end,
},
},

[xi.zone.CASTLE_OZTROJA] =
{
['Daa_Bola_the_Seer'] =
{
onTrigger = function(player, npc)
if quest:getVar(player, 'Prog') == 0 then
return quest:event(86)
end
end,

onTrade = function(player, npc, trade)
if
quest:getVar(player, 'Prog') == 0 and
npcUtil.tradeHasExactly(trade, xi.item.ARNICA_ROOT )
then
return quest:progressEvent(87, 0, xi.item.ARNICA_ROOT )
end
end,
},

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

[xi.zone.BEADEAUX] =
{
['GeFhu_Yagudoeye'] =
{
onTrigger = function(player, npc)
if
quest:getVar(player, 'Prog') == 2 and
not quest:getVar(player, 'magnes_nmKilled') == 1 and
not quest:getVar(player, 'nickel_nmKilled') == 1 and
npcUtil.popFromQM(player, npc, {quadavOffset, quadavOffset +1, quadavOffset + 2, quadavOffset +3 }, { claim = true, hide = 0})
then
return quest:messageSpecial(beadeauxID.text.TAKEN_FROM_YOU, 0, xi.ki.GLITTERING_FRAGMENT)
elseif
quest:getVar(player, 'Prog') == 2 and
quest:getVar(player, 'magnes_nmKilled') == 1 and
quest:getVar(player, 'nickel_nmKilled') == 1
then
return quest:progressEvent(124)
end
end,
},

['Magnes_Quadav'] =
{
onMobDeath = function(mob, player, optParams)
if
quest:getVar(player, 'Prog') == 2 and
GetMobByID(quadavOffset):isDead() and
GetMobByID(quadavOffset + 2):isDead()
then
quest:setVar(player, 'magnes_nmKilled', 1)
end
end,
},

['Nickel_Quadav'] =
{
onMobDeath = function(mob, player, optParams)
if
quest:getVar(player, 'Prog') == 2 and
GetMobByID(quadavOffset + 1):isDead() and
GetMobByID(quadavOffset + 3):isDead()
then
quest:setVar(player, 'nickel_nmKilled', 1)
end
end,
},

onEventFinish =
{
[124] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 3)
quest:setVar(player, 'magnes_nmKilled', 0)
quest:setVar(player, 'nickel_nmKilled', 0)
end,
},
},
},
}

return quest
1 change: 1 addition & 0 deletions scripts/quests/otherAreas/Missionary_Moblin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ quest.sections =
{
[9] = function(player, csid, option, npc)
quest:complete(player)
xi.quest.setMustZone(player, xi.questLog.OTHER_AREAS, xi.quest.id.otherAreas.FOR_THE_BIRDS)
end,
},
},
Expand Down
5 changes: 3 additions & 2 deletions scripts/zones/Beadeaux/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local ID = zones[xi.zone.BEADEAUX]

return {
['_43b'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm1'] = { messageSpecial = ID.text.FOUL_SMELLING_SOIL_IS_SPILLING_OUT },
['_43b'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm1'] = { messageSpecial = ID.text.FOUL_SMELLING_SOIL_IS_SPILLING_OUT },
['GeFhu_Yagudoeye'] = { messageSpecial = ID.text.HU_URR}
}
4 changes: 4 additions & 0 deletions scripts/zones/Beadeaux/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ zones[xi.zone.BEADEAUX] =
YOU_CAN_NOW_BECOME_A_DARK_KNIGHT = 7364, -- You can now become a dark knight!
FOUL_SMELLING_SOIL_IS_SPILLING_OUT = 7365, -- Foul-smelling soil is spilling out.
CHEST_UNLOCKED = 7375, -- You unlock the chest!
HU_URR = 7771, -- Hu-urr...
TAKEN_FROM_YOU = 7773, -- The <KI> is taken from you!
THE_QUADAV_ARE_ATTACKING = 7774, -- The Quadav are attacking!
LEARNS_SPELL = 7793, -- <name> learns <spell>!
UNCANNY_SENSATION = 7795, -- You are assaulted by an uncanny sensation.
COMMON_SENSE_SURVIVAL = 7802, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
Expand All @@ -41,6 +44,7 @@ zones[xi.zone.BEADEAUX] =
GE_DHA_EVILEYE = GetFirstID('GeDha_Evileye'),
MIMIC = GetFirstID('Mimic'),
ZO_KHU_BLACKCLOUD = GetFirstID('ZoKhu_Blackcloud'),
FOR_THE_BIRDS_MOBS = GetFirstID('Magnes_Quadav'),
},
npc =
{
Expand Down
1 change: 0 additions & 1 deletion scripts/zones/Beadeaux/npcs/GeFhu_Yagudoeye.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
player:startEvent(124)
end

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

0 comments on commit da59e63

Please sign in to comment.