|
| 1 | +----------------------------------- |
| 2 | +-- Chips |
| 3 | +----------------------------------- |
| 4 | +-- Log ID: 1, Quest ID: 82 |
| 5 | +----------------------------------- |
| 6 | +-- CoP 6-4 : !addmission 6 638 |
| 7 | +-- CoP 7-1 : !addmission 6 648 |
| 8 | +-- Ghebi Damomohe : !pos 15.535 -0.111 -7.603 |
| 9 | +-- Cid : !pos -12 -12 1 237 |
| 10 | +----------------------------------- |
| 11 | +local metalID = zones[xi.zone.METALWORKS] |
| 12 | +----------------------------------- |
| 13 | + |
| 14 | +local quest = Quest:new(xi.questLog.BASTOK, xi.quest.id.bastok.CHIPS) |
| 15 | + |
| 16 | +quest.reward = |
| 17 | +{ |
| 18 | + item = xi.item.CCB_POLYMER, |
| 19 | +} |
| 20 | + |
| 21 | +quest.sections = |
| 22 | +{ |
| 23 | + { |
| 24 | + check = function(player, status, vars) |
| 25 | + return status == xi.questStatus.QUEST_AVAILABLE |
| 26 | + end, |
| 27 | + |
| 28 | + [xi.zone.LOWER_JEUNO] = |
| 29 | + { |
| 30 | + ['Ghebi_Damomohe'] = |
| 31 | + { |
| 32 | + onTrigger = function(player, npc) |
| 33 | + if |
| 34 | + not quest:getMustZone(player) and |
| 35 | + (player:hasCompletedMission(xi.mission.log_id.COP, xi.mission.id.cop.ONE_TO_BE_FEARED) or |
| 36 | + (player:getCurrentMission(xi.mission.log_id.COP) == xi.mission.id.cop.ONE_TO_BE_FEARED and |
| 37 | + xi.mission.getVar(player, xi.mission.log_id.COP, xi.mission.id.cop.ONE_TO_BE_FEARED, 'Status') >= 1)) |
| 38 | + then |
| 39 | + return quest:progressEvent(169) |
| 40 | + end |
| 41 | + end, |
| 42 | + }, |
| 43 | + |
| 44 | + onEventFinish = |
| 45 | + { |
| 46 | + [169] = function(player, csid, option, npc) |
| 47 | + if option == 0 then |
| 48 | + quest:begin(player) |
| 49 | + elseif option == 1 then |
| 50 | + quest:setMustZone(player) |
| 51 | + end |
| 52 | + end, |
| 53 | + }, |
| 54 | + }, |
| 55 | + }, |
| 56 | + |
| 57 | + { |
| 58 | + check = function(player, status, vars) |
| 59 | + return status == xi.questStatus.QUEST_ACCEPTED |
| 60 | + end, |
| 61 | + |
| 62 | + [xi.zone.METALWORKS] = |
| 63 | + { |
| 64 | + ['Cid'] = |
| 65 | + { |
| 66 | + onTrade = function(player, npc, trade) |
| 67 | + if npcUtil.tradeHasExactly(trade, { xi.item.CARMINE_CHIP, xi.item.CYAN_CHIP, xi.item.GRAY_CHIP }) then |
| 68 | + if |
| 69 | + player:getFreeSlotsCount() == 0 or |
| 70 | + player:hasItem(xi.item.CCB_POLYMER) |
| 71 | + then |
| 72 | + return player:messageSpecial(metalID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.CCB_POLYMER) |
| 73 | + else |
| 74 | + return quest:progressEvent(883) |
| 75 | + end |
| 76 | + end |
| 77 | + end, |
| 78 | + }, |
| 79 | + |
| 80 | + onEventFinish = |
| 81 | + { |
| 82 | + [883] = function(player, csid, option, npc) |
| 83 | + if quest:complete(player) then |
| 84 | + player:confirmTrade() |
| 85 | + end |
| 86 | + end, |
| 87 | + }, |
| 88 | + }, |
| 89 | + }, |
| 90 | + |
| 91 | + { |
| 92 | + check = function(player, status, vars) |
| 93 | + return status == xi.questStatus.QUEST_COMPLETED |
| 94 | + end, |
| 95 | + |
| 96 | + [xi.zone.METALWORKS] = |
| 97 | + { |
| 98 | + ['Cid'] = |
| 99 | + { |
| 100 | + onTrade = function(player, npc, trade) |
| 101 | + if npcUtil.tradeHasExactly(trade, { xi.item.CARMINE_CHIP, xi.item.CYAN_CHIP, xi.item.GRAY_CHIP }) then |
| 102 | + if |
| 103 | + player:getFreeSlotsCount() == 0 or |
| 104 | + player:hasItem(xi.item.CCB_POLYMER) |
| 105 | + then |
| 106 | + return player:messageSpecial(metalID.text.ITEM_CANNOT_BE_OBTAINED, xi.item.CCB_POLYMER) |
| 107 | + else |
| 108 | + return quest:progressEvent(884) |
| 109 | + end |
| 110 | + end |
| 111 | + end, |
| 112 | + }, |
| 113 | + |
| 114 | + onEventFinish = |
| 115 | + { |
| 116 | + [884] = function(player, csid, option, npc) |
| 117 | + if quest:complete(player) then |
| 118 | + player:confirmTrade() |
| 119 | + end |
| 120 | + end, |
| 121 | + }, |
| 122 | + }, |
| 123 | + }, |
| 124 | +} |
| 125 | + |
| 126 | +return quest |
0 commit comments