Skip to content

Commit 481ed7f

Browse files
committed
Merge branch 'hunt-system' into release
2 parents 54df50e + 4fd8af8 commit 481ed7f

File tree

427 files changed

+4460
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

427 files changed

+4460
-403
lines changed

documentation/Regime_IDs.csv

+848
Large diffs are not rendered by default.

documentation/Regime_IDs.txt

-388
This file was deleted.

scripts/globals/hunts.lua

+1,352
Large diffs are not rendered by default.

scripts/globals/regimes.lua

+13-5
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,8 @@ local function getFinishOpts(regimeType)
975975
end
976976
return out
977977
end
978-
979-
local function clearPlayerVars(player)
978+
-- function made global to be called by hunts.lua
979+
tpz.regime.clearRegimeVars = function(player)
980980
player:setCharVar("[regime]type", 0)
981981
player:setCharVar("[regime]zone", 0)
982982
player:setCharVar("[regime]id", 0)
@@ -990,7 +990,11 @@ local function clearPlayerVars(player)
990990
end
991991

992992
tpz.regime.bookOnTrigger = function(player, regimeType)
993-
if (regimeType == tpz.regime.type.FIELDS and ENABLE_FIELD_MANUALS == 1) or (regimeType == tpz.regime.type.GROUNDS and ENABLE_GROUNDS_TOMES == 1) then
993+
-- checks if hunt is active, if so prompts player to cancel
994+
if player:getCharVar("[hunt]status") >= 1 then
995+
player:startEvent(info.event,0,0,3,1,0,0,player:getCurrency("valor_point"),player:getCharVar("[hunt]page"))
996+
997+
elseif (regimeType == tpz.regime.type.FIELDS and ENABLE_FIELD_MANUALS == 1) or (regimeType == tpz.regime.type.GROUNDS and ENABLE_GROUNDS_TOMES == 1) then
994998
local info = regimeInfo[regimeType].zone[player:getZoneID()]
995999

9961000
-- arg2 is a bitmask that controls which pages appear for examination
@@ -1061,6 +1065,10 @@ tpz.regime.bookOnEventFinish = function(player, option, regimeType)
10611065
return
10621066
end
10631067

1068+
if option == 7 then
1069+
tpz.hunts.clearHuntVars(player)
1070+
end
1071+
10641072
-- check player has enough tabs
10651073
if opt.cost and opt.cost > tabs then
10661074
player:showText(player, msgOffset + 1032) -- You do not have enough tabs.
@@ -1079,7 +1087,7 @@ tpz.regime.bookOnEventFinish = function(player, option, regimeType)
10791087
player:delCurrency("valor_point", opt.cost)
10801088

10811089
if act == "CANCEL_REGIME" then
1082-
clearPlayerVars(player)
1090+
tpz.regime.clearRegimeVars(player)
10831091
player:showText(player, msgOffset + 2) -- Training regime canceled.
10841092

10851093
elseif act == "REPATRIATION" then
@@ -1355,6 +1363,6 @@ tpz.regime.checkRegime = function(player, mob, regimeId, index, regimeType)
13551363

13561364
player:messageBasic(tpz.msg.basic.FOV_REGIME_BEGINS_ANEW)
13571365
else
1358-
clearPlayerVars(player)
1366+
tpz.regime.clearRegimeVars(player)
13591367
end
13601368
end

scripts/zones/Aht_Urhgan_Whitegate/IDs.lua

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ zones[tpz.zone.AHT_URHGAN_WHITEGATE] =
2121
HOMEPOINT_SET = 1366, -- Home point set!
2222
IMAGE_SUPPORT_ACTIVE = 1405, -- You have to wait a bit longer before asking for synthesis image support again.
2323
IMAGE_SUPPORT = 1407, -- Your [fishing/woodworking/smithing/goldsmithing/clothcraft/leatherworking/bonecraft/alchemy/cooking] skills went up [a little/ever so slightly/ever so slightly].
24+
REGIME_CANCELED = 1466, -- Current training regime canceled.
25+
HUNT_ACCEPTED = 1484, -- Hunt accepted!
26+
USE_SCYLDS = 1485, -- You use <fee> scylds. Scyld balance: <scylds>.
27+
HUNT_RECORDED = 1496, -- You record your hunt.
28+
OBTAIN_SCYLDS = 1498, -- You obtain <scylds>! Current Balance: <scylds>.
29+
HUNT_CANCELED = 1502, -- Hunt canceled.
2430
ITEM_OBTAINEDX = 1497, -- You obtain <item>!
2531
RUNIC_PORTAL = 4584, -- You cannot use the runic portal without the Empire's authorization.
2632
UGRIHD_PURCHASE_DIALOGUE = 4645, -- Salaheem's Sentinels values your contribution to the success of the company. Please come again!
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require("scripts/globals/hunts")
2+
3+
function onTrade(player, npc, trade)
4+
end
5+
6+
function onTrigger(player,npc,event)
7+
tpz.hunts.onTrigger(player,npc,event)
8+
end
9+
10+
function onEventUpdate(player,csid,option)
11+
tpz.hunts.onEventUpdate(player,csid,option)
12+
end
13+
14+
function onEventFinish(player, csid, option)
15+
tpz.hunts.onEventFinish(player, csid, option)
16+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
------------------------------
2+
-- Area: Alzadaal Undersea Ruins
3+
-- NM: Boompadu
4+
------------------------------
5+
require("scripts/globals/hunts")
6+
------------------------------
7+
8+
function onMobDeath(mob, player, isKiller)
9+
tpz.hunts.checkHunt(mob, player, 476)
10+
end

scripts/zones/Alzadaal_Undersea_Ruins/mobs/Cookieduster_Lipiroon.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Alzadaal Undersea Ruins (72)
33
-- NM: Cookieduster Lipiroon
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/status")
67
-----------------------------------
78

@@ -14,4 +15,5 @@ function onAdditionalEffect(mob, target, damage)
1415
end
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 477)
1719
end

scripts/zones/Alzadaal_Undersea_Ruins/mobs/Oupire.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Alzadaal Undersea Ruins
33
-- NM: Oupire
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/titles")
67
require("scripts/globals/mobs")
78
-----------------------------------
@@ -15,6 +16,7 @@ function onAdditionalEffect(mob, target, damage)
1516
end
1617

1718
function onMobDeath(mob, player, isKiller)
19+
tpz.hunts.checkHunt(mob, player, 478)
1820
player:addTitle(tpz.title.OUPIRE_IMPALER)
1921
end
2022

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
------------------------------
2+
-- Area: Arrapago Reef
3+
-- NM: Bloody Bones
4+
------------------------------
5+
require("scripts/globals/hunts")
6+
------------------------------
7+
8+
function onMobDeath(mob, player, isKiller)
9+
tpz.hunts.checkHunt(mob, player, 472)
10+
end

scripts/zones/Arrapago_Reef/mobs/Euryale.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Arrapago Reef
33
-- NM: Euryale
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -14,4 +15,5 @@ function onAdditionalEffect(mob, target, damage)
1415
end
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 474)
1719
end

scripts/zones/Attohwa_Chasm/mobs/Ambusher_Antlion.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
-- Area: Attohwa Chasm
33
-- Mob: Ambusher Antlion
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
mixins = {require("scripts/mixins/families/antlion_ambush")}
67
-----------------------------------
78

89
function onMobDeath(mob, player, isKiller)
10+
tpz.hunts.checkHunt(mob, player, 277)
911
end;

scripts/zones/Attohwa_Chasm/mobs/Citipati.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
-- Area: Attohwa Chasm
33
-- Mob: Citipati
44
-----------------------------------
5+
require("scripts/globals/hunts")
56

67
function onMobDeath(mob, player, isKiller)
8+
tpz.hunts.checkHunt(mob, player, 278)
79
end;

scripts/zones/Attohwa_Chasm/mobs/Sargas.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Attohwa Chasm
33
-- NM: Sargas
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -40,6 +41,7 @@ function onSpikesDamage(mob, target, damage)
4041
end
4142

4243
function onMobDeath(mob, player, isKiller)
44+
tpz.hunts.checkHunt(mob, player, 279)
4345
end
4446

4547
function onMobDespawn(mob)

scripts/zones/Attohwa_Chasm/mobs/Sekhmet.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Attohwa Chasm
33
-- NM: Sekhmet
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -16,6 +17,7 @@ function onAdditionalEffect(mob, target, damage)
1617
end
1718

1819
function onMobDeath(mob, player, isKiller)
20+
tpz.hunts.checkHunt(mob, player, 276)
1921
end;
2022

2123
function onMobDespawn(mob)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
------------------------------
2+
-- Area: Aydeewa Subterrane
3+
-- NM: Bluestreak Gyugyuroon
4+
------------------------------
5+
require("scripts/globals/hunts")
6+
------------------------------
7+
8+
function onMobDeath(mob, player, isKiller)
9+
tpz.hunts.checkHunt(mob, player, 464)
10+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
------------------------------
2+
-- Area: Aydeewa Subterrane
3+
-- NM: Crystal Eater
4+
------------------------------
5+
require("scripts/globals/hunts")
6+
------------------------------
7+
8+
function onMobDeath(mob, player, isKiller)
9+
tpz.hunts.checkHunt(mob, player, 463)
10+
end

scripts/zones/Aydeewa_Subterrane/mobs/Lizardtrap.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Aydeewa Subterrane
33
-- NM: Lizardtrap
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -14,6 +15,7 @@ function onAdditionalEffect(mob, target, damage)
1415
end
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 462)
1719
end
1820

1921
function onMobDespawn(mob)

scripts/zones/Bastok_Markets_[S]/IDs.lua

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ zones[tpz.zone.BASTOK_MARKETS_S] =
1717
FISHING_MESSAGE_OFFSET = 7049, -- You can't fish here.
1818
BLINGBRIX_SHOP_DIALOG = 7199, -- Blingbrix good Gobbie from Boodlix's! Boodlix's Emporium help fighting fighters and maging mages. Gil okay, okay?
1919
MOG_LOCKER_OFFSET = 7460, -- Your Mog Locker lease is valid until <timestamp>, kupo.
20+
REGIME_CANCELED = 7698, -- Current training regime canceled.
21+
HUNT_ACCEPTED = 7716, -- Hunt accepted!
22+
USE_SCYLDS = 7717, -- You use <fee> scylds. Scyld balance: <scylds>.
23+
HUNT_RECORDED = 7728, -- You record your hunt.
24+
OBTAIN_SCYLDS = 7730, -- You obtain <scylds>! Current Balance: <scylds>.
25+
HUNT_CANCELED = 7734, -- Hunt canceled.
2026
HOMEPOINT_SET = 10827, -- Home point set!
2127
KARLOTTE_DELIVERY_DIALOG = 10861, -- I am here to help with all your parcel delivery needs.
2228
WELDON_DELIVERY_DIALOG = 10862, -- Do you have something you wish to send?
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require("scripts/globals/hunts")
2+
3+
function onTrade(player, npc, trade)
4+
end
5+
6+
function onTrigger(player,npc,event)
7+
tpz.hunts.onTrigger(player,npc,event)
8+
end
9+
10+
function onEventUpdate(player,csid,option)
11+
tpz.hunts.onEventUpdate(player,csid,option)
12+
end
13+
14+
function onEventFinish(player, csid, option)
15+
tpz.hunts.onEventFinish(player, csid, option)
16+
end

scripts/zones/Bastok_Mines/IDs.lua

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ zones[tpz.zone.BASTOK_MINES] =
3030
NO_MORE_GP_ELIGIBLE = 7082, -- You are not eligible to receive guild points at this time.
3131
GP_OBTAINED = 7087, -- Obtained: <number> guild points.
3232
NOT_HAVE_ENOUGH_GP = 7088, -- You do not have enough guild points.
33+
REGIME_CANCELED = 7269, -- Current training regime canceled.
34+
HUNT_ACCEPTED = 7287, -- Hunt accepted!
35+
USE_SCYLDS = 7288, -- You use <fee> scylds. Scyld balance: <scylds>.
36+
HUNT_RECORDED = 7299, -- You record your hunt.
37+
OBTAIN_SCYLDS = 7301, -- You obtain <scylds>! Current Balance: <scylds>.
38+
HUNT_CANCELED = 7305, -- Hunt canceled.
3339
ITEM_DELIVERY_DIALOG = 10435, -- Need something sent to a friend's house? Sending items to your own house? You've come to the right place!
3440
DETZO_RIVALS_DIALOG = 10586, -- Can I borrow it for just a few seconds? I'll give it back, promise! I'll even give you a reward!
3541
FAUSTIN_CLOSED_DIALOG = 10779, -- Sorry, I don't have anything to sell you. I'm trying to start a business selling goods from Ronfaure, but it's not easy getting stuff from areas that aren't under Bastokan control.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
require("scripts/globals/hunts")
2+
3+
function onTrade(player, npc, trade)
4+
end
5+
6+
function onTrigger(player,npc,event)
7+
tpz.hunts.onTrigger(player,npc,event)
8+
end
9+
10+
function onEventUpdate(player,csid,option)
11+
tpz.hunts.onEventUpdate(player,csid,option)
12+
end
13+
14+
function onEventFinish(player, csid, option)
15+
tpz.hunts.onEventFinish(player, csid, option)
16+
end

scripts/zones/Batallia_Downs/mobs/Eyegouger.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs
33
-- NM: Eyegouger
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -14,4 +15,5 @@ function onAdditionalEffect(mob, target, damage)
1415
end
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 163)
1719
end

scripts/zones/Batallia_Downs/mobs/Prankster_Maverix.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs
33
-- NM: Prankster Maverix
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/status")
67
-----------------------------------
78

@@ -10,4 +11,5 @@ function onMobInitialize(mob)
1011
end
1112

1213
function onMobDeath(mob, player, isKiller)
14+
tpz.hunts.checkHunt(mob, player, 164)
1315
end

scripts/zones/Batallia_Downs/mobs/Skirling_Liger.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs (105)
33
-- Mob: Skirling Liger
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/status");
67
-----------------------------------
78

@@ -14,6 +15,7 @@ function onMobDisengage(mob)
1415
end;
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 162)
1719
end;
1820

1921
function onMobDespawn(mob)

scripts/zones/Batallia_Downs/mobs/Tottering_Toby.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
-- Area: Batallia Downs (105)
33
-- Mob: Tottering Toby
44
-----------------------------------
5+
require("scripts/globals/hunts")
56

67
function onMobDeath(mob, player, isKiller)
8+
tpz.hunts.checkHunt(mob, player, 161)
79
end;

scripts/zones/Batallia_Downs_[S]/mobs/Burlibix_Brawnback.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs [S]
33
-- NM: Burlibix Brawnback
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/status")
67
-----------------------------------
78

@@ -10,4 +11,5 @@ function onMobSpawn(mob)
1011
end
1112

1213
function onMobDeath(mob, player, isKiller)
14+
tpz.hunts.checkHunt(mob, player, 494)
1315
end

scripts/zones/Batallia_Downs_[S]/mobs/Chaneque.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs [S]
33
-- NM: Chaneque
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/mobs")
67
-----------------------------------
78

@@ -14,6 +15,7 @@ function onAdditionalEffect(mob, target, damage)
1415
end
1516

1617
function onMobDeath(mob, player, isKiller)
18+
tpz.hunts.checkHunt(mob, player, 492)
1719
end;
1820

1921
function onMobDespawn(mob)

scripts/zones/Batallia_Downs_[S]/mobs/Habergoass.lua

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
-- Area: Batallia Downs [S]
33
-- NM: Habergoass
44
-----------------------------------
5+
require("scripts/globals/hunts")
56
require("scripts/globals/status")
67
-----------------------------------
78

@@ -10,4 +11,5 @@ function onMobInitialize(mob)
1011
end
1112

1213
function onMobDeath(mob, player, isKiller)
14+
tpz.hunts.checkHunt(mob, player, 493)
1315
end

0 commit comments

Comments
 (0)