Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge branch 'feature/thick-thieves' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Sep 26, 2020
2 parents f20edbd + a1399fd commit 6e88e17
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 167 deletions.
8 changes: 8 additions & 0 deletions scripts/zones/Sauromugue_Champaign/Zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ end
function onInitialize(zone)
UpdateNMSpawnPoint(ID.mob.ROC)
GetMobByID(ID.mob.ROC):setRespawnTime(math.random(900, 10800))
GetNPCByID(ID.npc.QM2 + math.random(0, 5)):setLocalVar("[QM]Select", 1) -- Determine which QM is active today for THF AF2
end

function onZoneIn( player, prevZone)
Expand All @@ -43,6 +44,13 @@ end
function onRegionEnter(player, region)
end

function onGameDay(zone)
for i = ID.npc.QM2, ID.npc.QM2+5 do
GetNPCByID(i):resetLocalVars()
end
GetNPCByID(ID.npc.QM2 + math.random(0, 5)):setLocalVar("[QM]Select", 1) -- Determine which QM is active today for THF AF2
end

function onEventUpdate(player, csid, option)
if csid == 3 then
quests.rainbow.onEventUpdate(player)
Expand Down
22 changes: 5 additions & 17 deletions scripts/zones/Sauromugue_Champaign/npcs/qm2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ local function isNaked(player)
end

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) and npcUtil.tradeHas(trade, 17474) then
if isNaked(player) then
player:startEvent(2) -- complete grappling part of the quest
else
Expand All @@ -31,35 +29,25 @@ function onTrade(player, npc, trade)
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 2 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(193, 32, 211)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
elseif grapplingCS == 8 then
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end

end

function onEventUpdate(player, csid, option)
end

function onEventFinish(player, csid, option)
if csid == 2 then
player:setCharVar("thickAsThievesGrapplingCS", 8)
player:delKeyItem(tpz.ki.FIRST_FORGED_ENVELOPE)
npcUtil.giveKeyItem(player, tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE)
player:confirmTrade()
Expand Down
22 changes: 7 additions & 15 deletions scripts/zones/Sauromugue_Champaign/npcs/qm3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 17474) then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 3, 0, 17474) -- You cannot get a decent grip on the wall using the [Grapnel].
end
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 3 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(414, 16, -131)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET)
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
Expand Down
22 changes: 7 additions & 15 deletions scripts/zones/Sauromugue_Champaign/npcs/qm4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 17474) then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 3, 0, 17474) -- You cannot get a decent grip on the wall using the [Grapnel].
end
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 4 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(122, 0, -230)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET)
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
Expand Down
22 changes: 7 additions & 15 deletions scripts/zones/Sauromugue_Champaign/npcs/qm5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 17474) then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 3, 0, 17474) -- You cannot get a decent grip on the wall using the [Grapnel].
end
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 5 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(-114, 16, 51)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET)
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
Expand Down
22 changes: 7 additions & 15 deletions scripts/zones/Sauromugue_Champaign/npcs/qm6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 17474) then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 3, 0, 17474) -- You cannot get a decent grip on the wall using the [Grapnel].
end
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 6 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(371, 24, 8)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET)
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
Expand Down
22 changes: 7 additions & 15 deletions scripts/zones/Sauromugue_Champaign/npcs/qm7.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if grapplingCS >= 2 and grapplingCS <= 7 and npcUtil.tradeHas(trade, 17474) then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED and npcUtil.tradeHas(trade, 17474) then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 3, 0, 17474) -- You cannot get a decent grip on the wall using the [Grapnel].
end
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local grapplingCS = player:getCharVar("thickAsThievesGrapplingCS")

if thickAsThieves == QUEST_ACCEPTED then
if grapplingCS == 7 then
local gob = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)

if not gob:isSpawned() then
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
player:messageSpecial(ID.text.THF_AF_MOB)
gob:setSpawn(-194, 15, 269)
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
end
elseif grapplingCS >= 0 or grapplingCS <= 7 then
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET)
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
else
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
Expand Down
21 changes: 4 additions & 17 deletions scripts/zones/Windurst_Woods/npcs/Bopa_Greso.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
-----------------------------------
-- Area: Windurst Woods
-- NPC: Bopa Greso
-- NPC: Bopa Greso
-- Type: Standard NPC
-- !pos 59.773 -6.249 216.766 241
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
require("scripts/globals/quests")
-----------------------------------
Expand All @@ -13,21 +11,10 @@ function onTrade(player, npc, trade)
end

function onTrigger(player, npc)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local thickAsThievesCS = player:getCharVar("thickAsThievesCS")

if thickAsThieves == QUEST_ACCEPTED then
player:startEvent(506)
if thickAsThievesCS == 1 then
player:setCharVar("thickAsThievesCS", 2)
elseif thickAsThievesCS == 3 then
player:setCharVar("thickAsThievesCS", 4)
local rand1 = math.random(2, 7)
player:setCharVar("thickAsThievesGrapplingCS", rand1)
player:setCharVar("thickAsThievesGamblingCS", 1)
end
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
player:startEvent(506) -- Gambling hint
else
player:startEvent(77) -- standard cs
player:startEvent(77) -- Standard dialogue
end
end

Expand Down
35 changes: 11 additions & 24 deletions scripts/zones/Windurst_Woods/npcs/Cha_Lebagta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,25 @@
-- NPC: Cha Lebagta
-- Type: Standard NPC
-- !pos 58.385 -6.249 216.670 241
-- Involved in Quests: As Thick as Thieves, Mihgo's Amigo
-- Involved in Quests: As Thick as Thieves, Mihgo's Amigo
-----------------------------------
require("scripts/globals/quests")
-----------------------------------

function onTrade(player, npc, trade)
end

function onTrigger(player, npc)
local MihgosAmigo = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.MIHGO_S_AMIGO)
local thickAsThieves = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES)
local thickAsThievesCS = player:getCharVar("thickAsThievesCS")

-- As Thick As Thieves (THF AF)
if thickAsThieves == QUEST_ACCEPTED then
player:startEvent(507, 0, 17474)
if thickAsThievesCS == 1 then
player:setCharVar("thickAsThievesCS", 3)
elseif thickAsThievesCS == 2 then
player:setCharVar("thickAsThievesCS", 4)
local rand1 = math.random(2, 7)
player:setCharVar("thickAsThievesGrapplingCS", rand1)
player:setCharVar("thickAsThievesGamblingCS", 1)
end

-- Mihgo's Amigo
elseif MihgosAmigo == QUEST_ACCEPTED then
player:startEvent(85, 0, 498) -- hint dialog
local mihgosAmigo = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.MIHGO_S_AMIGO)

-- standard dialog
elseif MihgosAmigo == QUEST_COMPLETED then
player:startEvent(91, 0, 498) -- new standard dialog after Mihgo's Amigo
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
player:startEvent(507, 0, 17474) -- Grappling hint
elseif mihgosAmigo == QUEST_ACCEPTED then
player:startEvent(85, 0, 498) -- Migho's Amigo hint dialog
elseif mihgosAmigo == QUEST_COMPLETED then
player:startEvent(91, 0, 498) -- New standard dialog after Mihgo's Amigo completion
else
player:startEvent(78) -- normal dialog
player:startEvent(78) -- Standard dialog
end
end

Expand Down
Loading

0 comments on commit 6e88e17

Please sign in to comment.