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

Impliment Ziphus spawn #571

Merged
merged 5 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions scripts/zones/Misareaux_Coast/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ zones[tpz.zone.MISAREAUX_COAST] =
CONQUEST_BASE = 7171, -- Tallying conquest results...
DOOR_CLOSED = 7347, -- The door is locked tight.
LOGGING_IS_POSSIBLE_HERE = 7601, -- Logging is possible here if you have <item>.
NOTHING_HERE_YET = 7660; -- There is nothing here yet. Check again in the morning.
APPEARS_TO_BE_TRAP = 7662; -- There appears to be some kind of trap here. Bits of fish are lying around the area.
DID_NOT_CATCH_ANYTHING = 7663; -- You did not catch anything.
PUT_IN_TRAP = 7664; -- You put <item> in the trap.
COMMON_SENSE_SURVIVAL = 8635, -- 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.
HOMEPOINT_SET = 8858, -- Home point set!
},
Expand All @@ -32,6 +36,8 @@ zones[tpz.zone.MISAREAUX_COAST] =
PM6_2_MOB_OFFSET = 16879893,
BOGGELMANN = 16879897,
GRATION = 16879899,
ZIPHIUS = 16879900,

},
npc =
{
Expand All @@ -44,6 +50,7 @@ zones[tpz.zone.MISAREAUX_COAST] =
16879976,
16879977,
},
ZIPHIUS_QM_BASE = 16879919,
},
}

Expand Down
40 changes: 30 additions & 10 deletions scripts/zones/Misareaux_Coast/Zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,52 @@
-- Zone: Misareaux_Coast (25)
--
-----------------------------------
local ID = require("scripts/zones/Misareaux_Coast/IDs")
require("scripts/globals/conquest")
require("scripts/globals/helm")
require("scripts/zones/Misareaux_Coast/IDs")
-----------------------------------

function onInitialize(zone)
tpz.helm.initZone(zone, tpz.helm.type.LOGGING)
end;
end

function onConquestUpdate(zone, updatetype)
tpz.conq.onConquestUpdate(zone, updatetype)
end;
end

function onZoneIn(player,prevZone)
local cs = -1;
local cs = -1
if (player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0) then
player:setPos(567.624,-20,280.775,120);
player:setPos(567.624,-20,280.775,120)
end
return cs;
end;
return cs
end

function onRegionEnter(player,region)
end;
end

function onGameHour(zone)
local ZIPHIUS_QM_BASE = 16879919
cocosolos marked this conversation as resolved.
Show resolved Hide resolved
if (VanadielHour() == 22) then -- Spawn traps for Ziphius
cocosolos marked this conversation as resolved.
Show resolved Hide resolved
for i = ZIPHIUS_QM_BASE, ZIPHIUS_QM_BASE+5, 1 do
GetNPCByID(i):setStatus(tpz.status.NORMAL)
end
elseif (VanadielHour() == 7) then -- Despawn traps for Ziphius
for i = ZIPHIUS_QM_BASE, ZIPHIUS_QM_BASE+5, 1 do
GetNPCByID(i):setStatus(tpz.status.DISAPPEAR)
GetNPCByID(i):setLocalVar("[Ziphius]Bait Trap", 0)
end
elseif (VanadielHour() == 4) then -- Despawn non-baited traps
for i = ZIPHIUS_QM_BASE, ZIPHIUS_QM_BASE+5, 1 do
if (GetNPCByID(i):getLocalVar("[Ziphius]Bait Trap") == 0) then
GetNPCByID(i):setStatus(tpz.status.DISAPPEAR)
end
end
end
end

function onEventUpdate(player,csid,option)
end;
end

function onEventFinish(player,csid,option)
end;
end
53 changes: 53 additions & 0 deletions scripts/zones/Misareaux_Coast/npcs/qm2.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------
-- Area: Misareaux_Coast
-- NPC: ??? (Spawn Ziphius)
-- !pos 76 -16 534 25
-----------------------------------

require("scripts/globals/npc_util")
local ID = require("scripts/zones/Misareaux_Coast/IDs")

function onTrade(player,npc,trade)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

-- Trade Slice of Carp
if (npcUtil.tradeHas(trade, 16994) and baited == 0) then
npc:setLocalVar("[Ziphius]Bait Trap", 1)
cocosolos marked this conversation as resolved.
Show resolved Hide resolved
player:confirmTrade()
player:messageSpecial(ID.text.PUT_IN_TRAP, 16994)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
end
function onTrigger(player,npc)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

if (VanadielHour() >= 22 or VanadielHour() < 4) then
if (baited == 0) then
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
elseif (VanadielHour() >= 4 and VanadielHour() < 7) then
if (baited == 1) then
cocosolos marked this conversation as resolved.
Show resolved Hide resolved
if (math.random(1,1000) <= 1000) then
cocosolos marked this conversation as resolved.
Show resolved Hide resolved
SpawnMob(ID.mob.ZIPHIUS):updateClaim(player)
GetMobByID(ID.mob.ZIPHIUS):setPos(npc:getXPos(),npc:getYPos(),npc:getZPos()-1)
npc:setStatus(tpz.status.DISAPPEAR)
else
player:messageSpecial(ID.text.DID_NOT_CATCH_ANYTHING)
end
npc:setLocalVar("[Ziphius]Bait Trap", 0)
else
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
end
end
end

function onEventUpdate(player,csid,option)

end

function onEventFinish(player,csid,option)

end
53 changes: 53 additions & 0 deletions scripts/zones/Misareaux_Coast/npcs/qm3.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------
-- Area: Misareaux_Coast
-- NPC: ??? (Spawn Ziphius)
-- !pos 102.5 -16 525 25
-----------------------------------

require("scripts/globals/npc_util")
local ID = require("scripts/zones/Misareaux_Coast/IDs")

function onTrade(player,npc,trade)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

-- Trade Slice of Carp
if (npcUtil.tradeHas(trade, 16994) and baited == 0) then
npc:setLocalVar("[Ziphius]Bait Trap", 1)
player:confirmTrade()
player:messageSpecial(ID.text.PUT_IN_TRAP, 16994)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
end
function onTrigger(player,npc)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

if (VanadielHour() >= 22 or VanadielHour() < 4) then
if (baited == 0) then
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
elseif (VanadielHour() >= 4 and VanadielHour() < 7) then
if (baited == 1) then
if (math.random(1,1000) <= 176) then
SpawnMob(ID.mob.ZIPHIUS):updateClaim(player)
GetMobByID(ID.mob.ZIPHIUS):setPos(npc:getXPos(),npc:getYPos(),npc:getZPos()-1)
npc:setStatus(tpz.status.DISAPPEAR)
else
player:messageSpecial(ID.text.DID_NOT_CATCH_ANYTHING)
end
npc:setLocalVar("[Ziphius]Bait Trap", 0)
else
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
end
end
end

function onEventUpdate(player,csid,option)

end

function onEventFinish(player,csid,option)

end
53 changes: 53 additions & 0 deletions scripts/zones/Misareaux_Coast/npcs/qm4.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------
-- Area: Misareaux_Coast
-- NPC: ??? (Spawn Ziphius)
-- !pos 144.5 -16 520 25
-----------------------------------

require("scripts/globals/npc_util")
local ID = require("scripts/zones/Misareaux_Coast/IDs")

function onTrade(player,npc,trade)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

-- Trade Slice of Carp
if (npcUtil.tradeHas(trade, 16994) and baited == 0) then
npc:setLocalVar("[Ziphius]Bait Trap", 1)
player:confirmTrade()
player:messageSpecial(ID.text.PUT_IN_TRAP, 16994)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
end
function onTrigger(player,npc)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

if (VanadielHour() >= 22 or VanadielHour() < 4) then
if (baited == 0) then
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
elseif (VanadielHour() >= 4 and VanadielHour() < 7) then
if (baited == 1) then
if (math.random(1,1000) <= 176) then
SpawnMob(ID.mob.ZIPHIUS):updateClaim(player)
GetMobByID(ID.mob.ZIPHIUS):setPos(npc:getXPos(),npc:getYPos(),npc:getZPos()-1)
npc:setStatus(tpz.status.DISAPPEAR)
else
player:messageSpecial(ID.text.DID_NOT_CATCH_ANYTHING)
end
npc:setLocalVar("[Ziphius]Bait Trap", 0)
else
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
end
end
end

function onEventUpdate(player,csid,option)

end

function onEventFinish(player,csid,option)

end
53 changes: 53 additions & 0 deletions scripts/zones/Misareaux_Coast/npcs/qm5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------
-- Area: Misareaux_Coast
-- NPC: ??? (Spawn Ziphius)
-- !pos 184.5 -16 517.5 25
-----------------------------------

require("scripts/globals/npc_util")
local ID = require("scripts/zones/Misareaux_Coast/IDs")

function onTrade(player,npc,trade)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

-- Trade Slice of Carp
if (npcUtil.tradeHas(trade, 16994) and baited == 0) then
npc:setLocalVar("[Ziphius]Bait Trap", 1)
player:confirmTrade()
player:messageSpecial(ID.text.PUT_IN_TRAP, 16994)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
end
function onTrigger(player,npc)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

if (VanadielHour() >= 22 or VanadielHour() < 4) then
if (baited == 0) then
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
elseif (VanadielHour() >= 4 and VanadielHour() < 7) then
if (baited == 1) then
if (math.random(1,1000) <= 176) then
SpawnMob(ID.mob.ZIPHIUS):updateClaim(player)
GetMobByID(ID.mob.ZIPHIUS):setPos(npc:getXPos(),npc:getYPos(),npc:getZPos()-1)
npc:setStatus(tpz.status.DISAPPEAR)
else
player:messageSpecial(ID.text.DID_NOT_CATCH_ANYTHING)
end
npc:setLocalVar("[Ziphius]Bait Trap", 0)
else
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
end
end
end

function onEventUpdate(player,csid,option)

end

function onEventFinish(player,csid,option)

end
53 changes: 53 additions & 0 deletions scripts/zones/Misareaux_Coast/npcs/qm6.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-----------------------------------
-- Area: Misareaux_Coast
-- NPC: ??? (Spawn Ziphius)
-- !pos 207 -16 479 25
-----------------------------------

require("scripts/globals/npc_util")
local ID = require("scripts/zones/Misareaux_Coast/IDs")

function onTrade(player,npc,trade)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

-- Trade Slice of Carp
if (npcUtil.tradeHas(trade, 16994) and baited == 0) then
npc:setLocalVar("[Ziphius]Bait Trap", 1)
player:confirmTrade()
player:messageSpecial(ID.text.PUT_IN_TRAP, 16994)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
end
function onTrigger(player,npc)
local baited = npc:getLocalVar("[Ziphius]Bait Trap")

if (VanadielHour() >= 22 or VanadielHour() < 4) then
if (baited == 0) then
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
else
player:messageSpecial(ID.text.NOTHING_HERE_YET)
end
elseif (VanadielHour() >= 4 and VanadielHour() < 7) then
if (baited == 1) then
if (math.random(1,1000) <= 176) then
SpawnMob(ID.mob.ZIPHIUS):updateClaim(player)
GetMobByID(ID.mob.ZIPHIUS):setPos(npc:getXPos(),npc:getYPos(),npc:getZPos()-1)
npc:setStatus(tpz.status.DISAPPEAR)
else
player:messageSpecial(ID.text.DID_NOT_CATCH_ANYTHING)
end
npc:setLocalVar("[Ziphius]Bait Trap", 0)
else
player:messageSpecial(ID.text.APPEARS_TO_BE_TRAP)
end
end
end

function onEventUpdate(player,csid,option)

end

function onEventFinish(player,csid,option)

end
Loading