Skip to content

Commit

Permalink
feat: move multiple raids to new system (#2002)
Browse files Browse the repository at this point in the history
New config: `disableLegacyRaids` to disable the old XML based system.
New command: `/simraid` you can "simulate" raid parameters to see how
often your raid would run:
```
18:13 Raid triggered 10 times in 31931 rolls (23.138405797101 days or once every 2.3138405797101 days)
```

Raids added can be seen in `scripts/raids`:
![CleanShot 2023-12-09 at 18 45
34@2x](https://github.com/opentibiabr/canary/assets/223760/fe43b632-da3b-4ed5-8bac-37cbce8bd38f)
  • Loading branch information
luan authored Dec 29, 2023
1 parent 9609368 commit 458eb99
Show file tree
Hide file tree
Showing 26 changed files with 733 additions and 91 deletions.
1 change: 1 addition & 0 deletions config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ experienceDisplayRates = true
toggleAttackSpeedOnFist = false
multiplierSpeedOnFist = 5
maxSpeedOnFist = 500
disableLegacyRaids = false -- disable legacy XML raids
disableMonsterArmor = false
combatChainDelay = 50 -- minimum: 50 miliseconds
minElementalResistance = -200
Expand Down
34 changes: 2 additions & 32 deletions data-otservbr-global/raids/raids.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,41 @@
<raid name="Terramite" file="ankrahmun/terramite.xml" interval2="500" margin="70" />
<!-- Carlin -->
<raid name="OrcWoods" file="carlin/orc.xml" interval2="500" margin="80" />
<raid name="Yeti" file="carlin/yeti.xml" interval2="500" margin="70" />
<!-- Chayenne -->
<raid name="Chayenne" file="chayenne/chayenne.xml" interval2="1440" margin="170" />
<!-- Darashia -->
<raid name="Arachir the Ancient One" file="darashia/arachir_the_ancient_one.xml" interval2="1440" margin="80" />
<raid name="Lions" file="darashia/lions.xml" interval2="500" margin="70" />
<raid name="Minos" file="darashia/minotaurs.xml" interval2="500" margin="100" />
<raid name="Necropharus" file="darashia/necropharus.xml" interval2="1440" margin="110" />
<raid name="Pirates" file="darashia/pirates.xml" interval2="500" margin="90" />
<raid name="Priestesses" file="darashia/priestesses.xml" interval2="500" margin="70" />
<raid name="The Pale Count" file="darashia/the_pale_count.xml" interval2="490" margin="60" />
<raid name="Tyrn" file="darashia/tyrn.xml" interval2="1440" margin="50" />
<raid name="Undead Darashia" file="darashia/undead_darashia.xml" interval2="500" margin="70" />
<raid name="White Pale" file="darashia/white_pale.xml" interval2="440" margin="60"/>
<!-- Edron -->
<raid name="Feroxa" file="edron/feroxa.xml" interval2="430" margin="81" />
<raid name="GoEdron" file="edron/goblins.xml" interval2="500" margin="90" />
<raid name="Mad Mage" file="edron/mad_mage.xml" interval2="360" margin="30"/>
<raid name="Orcss" file="edron/orc.xml" interval2="500" margin="100" />
<raid name="Orshabaal" file="edron/orshabaal.xml" interval2="1440" margin="100" />
<raid name="Sir Valorcrest" file="edron/sir_valorcrest.xml" interval2="1440" margin="120" />
<raid name="Warlock" file="edron/warlock.xml" interval2="500" margin="100" />
<raid name="Weakened Shlorg" file="edron/weakened_shlorg.xml" interval2="430" margin="50" />
<!-- Farmine -->
<raid name="Beetles" file="farmine/beetles.xml" interval2="500" margin="70" />
<raid name="Draptor" file="farmine/draptor.xml" interval2="270" margin="10"/>
<raid name="Gnarlhounds" file="farmine/gnarlhounds.xml" interval2="500" margin="20" />
<raid name="Zevelon Duskbringer" file="farmine/zevelon_duskbringer.xml" interval2="1440" margin="90" />
<raid name="Zulazza the Corruptor" file="farmine/zulazza_the_corruptor.xml" interval2="1440" margin="60" />
<!-- Furygate -->
<raid name="Furyosa" file="fury_gate/furyosa.xml" interval2="440" margin="60"/>
<!-- Kazordoon -->
<raid name="GoFemor" file="kazordoon/goblins.xml" interval2="500" margin="70" />
<raid name="Horned Fox" file="kazordoon/horned.xml" interval2="1440" margin="180" />
<!-- Liberty Bay -->
<!-- Under Treasure Island -->
<raid name="Crustacea Gigantica treasure" file="liberty_bay/crustacea_gigantica_1.xml" interval2="240" margin="20"/>
<!-- Calassa South -->
<raid name="Crustacea Gigantica calassa1" file="liberty_bay/crustacea_gigantica_2.xml" interval2="240" margin="20"/>
<!-- Calassa North -->
<raid name="Crustacea Gigantica calassa2" file="liberty_bay/crustacea_gigantica_3.xml" interval2="300" margin="20"/>
<raid name="Diblis The Fair" file="liberty_bay/diblis_the_fair.xml" interval2="1440" margin="180" />
<raid name="Ferumbras" file="liberty_bay/ferumbras.xml" interval2="1440" margin="120" />
<!-- <raid name="Ferumbras" file="liberty_bay/ferumbras.xml" interval2="1440" margin="120" /> -->
<raid name="Morgaroth" file="liberty_bay/morgaroth.xml" interval2="1440" margin="90" />
<raid name="Quaras" file="liberty_bay/quaras.xml" interval2="500" margin="50" />
<raid name="Tigers" file="liberty_bay/tigers.xml" interval2="500" margin="100" />
<raid name="Tortoise" file="liberty_bay/tortoises.xml" interval2="500" margin="80" />
<raid name="Undead Cavebear" file="liberty_bay/undead_cavebear.xml" interval2="230" margin="20"/>
<!-- Oramond -->
<!-- Seacrest Grounds South -->
<raid name="Crustacea Gigantica seacrest1" file="oramond/crustacea_gigantica_4.xml" interval2="240" margin="60"/>
<!-- Seacrest Grounds North -->
<raid name="Crustacea Gigantica seacrest2" file="oramond/crustacea_gigantica_5.xml" interval2="300" margin="60"/>
<!-- Port Hope -->
<raid name="Kongras" file="port_hope/kongras.xml" interval2="500" margin="60" />
<raid name="Lizards" file="port_hope/lizards.xml" interval2="500" margin="95" />
<raid name="Midnight Panther One" file="port_hope/midnight_panther_1.xml" interval2="280" margin="20"/>
<raid name="Midnight Panther Two" file="port_hope/midnight_panther_2.xml" interval2="280" margin="20"/>
<raid name="Midnight Panther Three" file="port_hope/midnight_panther_3.xml" interval2="280" margin="20"/>
<raid name="Sspawn" file="port_hope/serpent_spawn.xml" interval2="500" margin="60" />
<raid name="Terror" file="port_hope/terrorbirds.xml" interval2="500" margin="100" />
<raid name="The Welter" file="port_hope/the_welter.xml" interval2="440" margin="60"/>
<!-- Rookgaard -->
<raid name="Munster" file="rookgaard/munster.xml" interval2="500" margin="40" />
<raid name="Rats" file="rookgaard/rats.xml" interval2="500" margin="70" />
Expand All @@ -85,14 +58,12 @@
<raid name="Teleskor" file="rookgaard/teleskor.xml" interval2="500" margin="50" />
<!-- Roshamuul -->
<raid name="Gaz" file="roshamuul/gaz_haragoth.xml" interval2="1440" margin="160" />
<raid name="Mawhawk" file="roshamuul/mawhawk.xml" interval2="410" margin="20" />
<raid name="Omrafir" file="roshamuul/omrafir.xml" interval2="1440" margin="80" />
<!-- Svargrond -->
<raid name="BarbaBitter" file="svargrond/barba_bittermor.xml" interval2="500" margin="40" />
<raid name="BarbaSvar" file="svargrond/barba_svar.xml" interval2="500" margin="80" />
<raid name="Barbarian" file="svargrond/barbarian.xml" interval2="500" margin="70" />
<raid name="Ghazbaran" file="svargrond/ghazbaran.xml" interval2="1440" margin="100" />
<raid name="Hirintror" file="svargrond/hirintror.xml" interval2="440" margin="60"/>
<raid name="IceGolems" file="svargrond/ice_golems.xml" interval2="500" margin="70" />
<raid name="Ocyakao" file="svargrond/ocyakao.xml" interval2="1440" margin="50" />
<raid name="Zushuka" file="svargrond/zushuka.xml" interval2="6000" margin="60"/>
Expand All @@ -103,10 +74,9 @@
<raid name="Dharalion" file="venore/dharalion.xml" interval2="500" margin="70" />
<raid name="Elves" file="venore/elves.xml" interval2="500" margin="80" />
<raid name="Fernfang" file="venore/fernfang.xml" interval2="1440" margin="80" />
<raid name="Citizen" file="venore/feverish_citizen.xml" interval2="500" margin="40" />
<!-- <raid name="Citizen" file="venore/feverish_citizen.xml" interval2="500" margin="40" /> -->
<raid name="Hunters" file="venore/hunter.xml" interval2="500" margin="65" />
<raid name="Orc Backpack" file="venore/orc_backpack.xml" interval2="300" margin="110" />
<raid name="The Old Widow" file="venore/the_old_widow.xml" interval2="1440" margin="60" />
<raid name="Undead Army" file="venore/undead.xml" interval2="500" margin="100" />
<raid name="Water Buffalo" file="venore/water_buffalo.xml" interval2="500" margin="100" />
</raids>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("drefia.arachir")
zone:addArea(Position(32963, 32399, 12), Position(32965, 32401, 12))

local raid = Raid("drefia.arachir", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid
:addSpawnMonsters({
{
name = "Arachir the Ancient One",
amount = 1,
position = Position(32964, 32400, 12),
},
})
:autoAdvance("24h")

raid:register()
23 changes: 23 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/diblis_the_fair.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("nargor.diblis")
zone:addArea(Position(32008, 32794, 10), Position(32010, 32797, 10))

local raid = Raid("nargor.diblis", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid
:addSpawnMonsters({
{
name = "Diblis The Fair",
amount = 1,
position = Position(32009, 32795, 10),
},
})
:autoAdvance("24h")

raid:register()
32 changes: 32 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/furyosa.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local zone = Zone("fury-gates.furiosa")
zone:addArea(Position(33257, 32659, 14), Position(33342, 31867, 15))

local raid = Raid("fury-gates.furiosa", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.01,
targetChancePerDay = 0.01,
maxChancePerCheck = 0.6,
})

raid
:addSpawnMonsters({
{
name = "Demon",
amount = 80,
},
})
:autoAdvance("1m")

raid
:addSpawnMonsters({
{
name = "Furyosa",
amount = 1,
position = Position(33281, 31804, 15),
},
})
:autoAdvance("24h")

raid:register()
23 changes: 23 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/hirintror.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("svargrond.hirintror")
zone:addArea(Position(32100, 31166, 9), Position(32102, 31168, 9))

local raid = Raid("svargrond.hirintror", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid
:addSpawnMonsters({
{
name = "Hirintror",
amount = 1,
position = Position(32101, 31167, 9),
},
})
:autoAdvance("24h")

raid:register()
22 changes: 22 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/mawhawk.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local zone = Zone("roshamuul.mawhawk")
zone:addArea(Position(33702, 32460, 7), Position(33704, 32462, 7))

local raid = Raid("roshamuul.mawhawk", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 2,
initialChance = 0.04,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.4,
})

raid
:addSpawnMonsters({
{
name = "Mawhawk",
amount = 1,
},
})
:autoAdvance("24h")

raid:register()
23 changes: 23 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/sir_valorcrest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("edron.valorcrest")
zone:addArea(Position(33263, 31767, 10), Position(33265, 31769, 10))

local raid = Raid("edron.valorcrest", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid
:addSpawnMonsters({
{
name = "Sir Valorcrest",
amount = 1,
position = Position(33264, 31768, 10),
},
})
:autoAdvance("24h")

raid:register()
38 changes: 38 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/the_old_widow.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local zone = Zone("venore.the-old-widow")
zone:addArea(Position(32292, 32292, 12), Position(32796, 32306, 12))

local raid = Raid("venore.the-old-widow", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid:addBroadcast("The mating season of the giant spiders is at hand. Leave the plains of havoc as fast as you can."):autoAdvance("30s")

raid:addBroadcast("Giant spiders have gathered on the plains of havoc for their mating season. Beware!"):autoAdvance("3m")

for _ = 1, 4 do
raid
:addSpawnMonsters({
{
name = "Giant Spider",
amount = 8,
},
})
:autoAdvance("10s")
end

raid
:addSpawnMonsters({
{
name = "The Old Widow",
amount = 1,
position = Position(32776, 32296, 7),
},
})
:autoAdvance("24h")

raid:register()
23 changes: 23 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/the_pale_count.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("drefia.the-pale-count")
zone:addArea(Position(32968, 32419, 15), Position(32970, 32421, 15))

local raid = Raid("drefia.the-pale-count", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.01,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.7,
})

raid
:addSpawnMonsters({
{
name = "The Pale Count",
amount = 1,
position = Position(32969, 32420, 15),
},
})
:autoAdvance("24h")

raid:register()
22 changes: 22 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/the_welter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local zone = Zone("ankrahmun.the-welter")
zone:addArea(Position(33025, 32659, 5), Position(33027, 32661, 5))

local raid = Raid("ankrahmun.the-welter", {
zone = zone,
allowedDays = { "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.01,
targetChancePerDay = 0.01,
maxChancePerCheck = 0.6,
})

raid
:addSpawnMonsters({
{
name = "The Welter",
amount = 1,
},
})
:autoAdvance("24h")

raid:register()
22 changes: 22 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/tyrn.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local zone = Zone("darashia.tyrn")
zone:addArea(Position(33055, 32392, 14), Position(33057, 32394, 14))

local raid = Raid("darashia.tyrn", {
zone = zone,
allowedDays = { "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 2,
initialChance = 0.04,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.4,
})

raid
:addSpawnMonsters({
{
name = "Tyrn",
amount = 1,
},
})
:autoAdvance("24h")

raid:register()
23 changes: 23 additions & 0 deletions data-otservbr-global/scripts/raids/bosses/weakened_shlorg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local zone = Zone("edron.weakened-shlorg")
zone:addArea(Position(33163, 31715, 9), Position(33165, 31717, 9))

local raid = Raid("edron.weakened-shlorg", {
zone = zone,
allowedDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" },
minActivePlayers = 3,
initialChance = 0.02,
targetChancePerDay = 0.02,
maxChancePerCheck = 0.8,
})

raid
:addSpawnMonsters({
{
name = "Weakened Shlorg",
amount = 1,
position = Position(33164, 31716, 9),
},
})
:autoAdvance("24h")

raid:register()
Loading

0 comments on commit 458eb99

Please sign in to comment.