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

Commit 4954d5b

Browse files
committed
Adds NPC Utils function for spawning Climbpix
1 parent 7344096 commit 4954d5b

File tree

6 files changed

+18
-60
lines changed

6 files changed

+18
-60
lines changed

scripts/zones/Sauromugue_Champaign/npcs/qm2.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,10 @@ end
3131
function onTrigger(player, npc)
3232
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
3333
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
34-
if npc:getLocalVar("[QM]Select") == 1 then
35-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
36-
37-
if not climbpix:isSpawned() then
38-
player:messageSpecial(ID.text.THF_AF_MOB)
39-
climbpix:setSpawn(193, 32, 211)
40-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
41-
end
42-
else
43-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
34+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
35+
player:messageSpecial(ID.text.THF_AF_MOB)
4436
end
37+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
4538
else
4639
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
4740
end

scripts/zones/Sauromugue_Champaign/npcs/qm3.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@ end
1818
function onTrigger(player, npc)
1919
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
2020
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
21-
if npc:getLocalVar("[QM]Select") == 1 then
22-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
23-
24-
if not climbpix:isSpawned() then
25-
player:messageSpecial(ID.text.THF_AF_MOB)
26-
climbpix:setSpawn(414, 16, -131)
27-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
28-
end
29-
else
30-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
21+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
22+
player:messageSpecial(ID.text.THF_AF_MOB)
3123
end
24+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
3225
else
3326
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
3427
end

scripts/zones/Sauromugue_Champaign/npcs/qm4.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@ end
1818
function onTrigger(player, npc)
1919
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
2020
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
21-
if npc:getLocalVar("[QM]Select") == 1 then
22-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
23-
24-
if not climbpix:isSpawned() then
25-
player:messageSpecial(ID.text.THF_AF_MOB)
26-
climbpix:setSpawn(122, 0, -230)
27-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
28-
end
29-
else
30-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
21+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
22+
player:messageSpecial(ID.text.THF_AF_MOB)
3123
end
24+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
3225
else
3326
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
3427
end

scripts/zones/Sauromugue_Champaign/npcs/qm5.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@ end
1818
function onTrigger(player, npc)
1919
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
2020
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
21-
if npc:getLocalVar("[QM]Select") == 1 then
22-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
23-
24-
if not climbpix:isSpawned() then
25-
player:messageSpecial(ID.text.THF_AF_MOB)
26-
climbpix:setSpawn(-114, 16, 51)
27-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
28-
end
29-
else
30-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
21+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
22+
player:messageSpecial(ID.text.THF_AF_MOB)
3123
end
24+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
3225
else
3326
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
3427
end

scripts/zones/Sauromugue_Champaign/npcs/qm6.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@ end
1818
function onTrigger(player, npc)
1919
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
2020
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
21-
if npc:getLocalVar("[QM]Select") == 1 then
22-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
23-
24-
if not climbpix:isSpawned() then
25-
player:messageSpecial(ID.text.THF_AF_MOB)
26-
climbpix:setSpawn(371, 24, 8)
27-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
28-
end
29-
else
30-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
21+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
22+
player:messageSpecial(ID.text.THF_AF_MOB)
3123
end
24+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
3225
else
3326
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
3427
end

scripts/zones/Sauromugue_Champaign/npcs/qm7.lua

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,10 @@ end
1818
function onTrigger(player, npc)
1919
if player:getQuestStatus(WINDURST, tpz.quest.id.windurst.AS_THICK_AS_THIEVES) == QUEST_ACCEPTED then
2020
if not player:hasKeyItem(tpz.ki.FIRST_SIGNED_FORGED_ENVELOPE) then
21-
if npc:getLocalVar("[QM]Select") == 1 then
22-
local climbpix = GetMobByID(ID.mob.CLIMBPIX_HIGHRISE)
23-
24-
if not climbpix:isSpawned() then
25-
player:messageSpecial(ID.text.THF_AF_MOB)
26-
climbpix:setSpawn(-194, 15, 269)
27-
SpawnMob(ID.mob.CLIMBPIX_HIGHRISE):updateClaim(player)
28-
end
29-
else
30-
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
21+
if npc:getLocalVar("[QM]Select") == 1 and npcUtil.popFromQM(player, npc, ID.mob.CLIMBPIX_HIGHRISE, {radius = 1, hide = 0}) then
22+
player:messageSpecial(ID.text.THF_AF_MOB)
3123
end
24+
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET) -- It is impossible to climb this wall with your bare hands.
3225
else
3326
player:messageSpecial(ID.text.THF_AF_WALL_OFFSET + 1) -- There is no longer any need to climb the tower.
3427
end

0 commit comments

Comments
 (0)