-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Quest] Convert Distant Loyalties to IF
* Converted Distant Loyalties to IF * Added Default Action for Rouva * Added Default Action for Femitte * Removed Quest code from Rouva, Michea, and Femitte NPC lua Co-Authored-By: hookstar <16403542+hookstar@users.noreply.github.com>
- Loading branch information
1 parent
1bd4fc5
commit 2890969
Showing
6 changed files
with
177 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
----------------------------------- | ||
-- Distant Loyalties | ||
----------------------------------- | ||
-- !addquest 0 74 | ||
-- Southern San 'dOria !zone 230 | ||
-- Femitte: !pos -17.7129 2.1000 10.1636 | ||
-- Bastok Markets !zone 235 | ||
-- Michea: !pos -299.2114 -15.9717 -156.0629 | ||
-- Mythril Ingot !giveitem 653 | ||
----------------------------------- | ||
|
||
local quest = Quest:new(xi.questLog.SANDORIA, xi.quest.id.sandoria.DISTANT_LOYALTIES) | ||
|
||
quest.reward = | ||
{ | ||
fame = 30, | ||
fameArea = xi.fameArea.SANDORIA, | ||
item = xi.item.WHITE_CAPE, | ||
} | ||
|
||
quest.sections = | ||
{ | ||
{ | ||
check = function(player, status, vars) | ||
return status == xi.questStatus.QUEST_AVAILABLE and | ||
player:getFameLevel(xi.fameArea.SANDORIA) >= 4 | ||
end, | ||
|
||
[xi.zone.SOUTHERN_SAN_DORIA] = | ||
{ | ||
['Femitte'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
return quest:progressEvent(663) | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[663] = function(player, csid, option, npc) | ||
if option == 0 then | ||
quest:begin(player) | ||
npcUtil.giveKeyItem(player, xi.ki.GOLDSMITHING_ORDER) | ||
quest:setVar(player, 'Prog', 1) | ||
end | ||
end, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
check = function(player, status, vars) | ||
return status == xi.questStatus.QUEST_ACCEPTED | ||
end, | ||
|
||
[xi.zone.SOUTHERN_SAN_DORIA] = | ||
{ | ||
['Femitte'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
local questProgress = quest:getVar(player, 'Prog') | ||
if | ||
questProgress == 4 and | ||
player:hasKeyItem(xi.ki.MYTHRIL_HEARTS) | ||
then | ||
return quest:progressEvent(665) | ||
end | ||
end, | ||
}, | ||
|
||
-- Dialogue will repeat until the quest is completed. | ||
['Rouva'] = quest:event(664), | ||
|
||
onEventFinish = | ||
{ | ||
[665] = function(player, csid, option, npc) | ||
if quest:complete(player) then | ||
quest:setVar(player, 'finalCS', 1) | ||
player:delKeyItem(xi.ki.MYTHRIL_HEARTS) | ||
end | ||
end, | ||
}, | ||
}, | ||
|
||
[xi.zone.BASTOK_MARKETS] = | ||
{ | ||
['Michea'] = | ||
{ | ||
onTrade = function(player, npc, trade) | ||
if | ||
npcUtil.tradeHasExactly(trade, { { xi.item.MYTHRIL_INGOT, 1 } }) and | ||
quest:getVar(player, 'Prog') == 2 | ||
then | ||
return quest:progressEvent(317) | ||
end | ||
end, | ||
|
||
onTrigger = function(player, npc) | ||
local questProgress = quest:getVar(player, 'Prog') | ||
|
||
if | ||
questProgress == 1 and | ||
player:hasKeyItem(xi.ki.GOLDSMITHING_ORDER) | ||
then | ||
return quest:progressEvent(315) | ||
elseif questProgress == 2 then | ||
return quest:event(316) -- Will repeat until the player trades the Myrthil Ingot | ||
elseif | ||
questProgress == 3 and | ||
player:needToZone() | ||
then | ||
return quest:event(320) -- Will repeat until the player zones | ||
elseif | ||
questProgress == 3 and | ||
not player:needToZone() | ||
then | ||
return quest:progressEvent(318) | ||
else | ||
return -- Default action | ||
end | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[315] = function(player, csid, option, npc) | ||
player:delKeyItem(xi.ki.GOLDSMITHING_ORDER) | ||
quest:setVar(player, 'Prog', 2) | ||
end, | ||
|
||
[317] = function(player, csid, option, npc) | ||
player:confirmTrade() | ||
quest:setVar(player, 'Prog', 3) | ||
player:needToZone(true) | ||
end, | ||
|
||
[318] = function(player, csid, option, npc) | ||
quest:setVar(player, 'Prog', 4) | ||
npcUtil.giveKeyItem(player, xi.ki.MYTHRIL_HEARTS) | ||
end, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
check = function(player, status, vars) | ||
return status == xi.questStatus.QUEST_COMPLETED | ||
end, | ||
|
||
[xi.zone.BASTOK_MARKETS] = | ||
{ | ||
['Michea'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
if quest:getVar(player, 'finalCS') == 1 then | ||
return quest:progressEvent(319) | ||
end | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[319] = function(player, csid, option, npc) | ||
player:delKeyItem(xi.ki.GOLDSMITHING_ORDER) | ||
quest:setVar(player, 'finalCS', 0) | ||
end, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
return quest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters