Skip to content

Commit

Permalink
Merge pull request #7043 from CriticalXI/nm_audit_vollbow
Browse files Browse the repository at this point in the history
[lua, sql] Cape Terrigan and Gustav Tunnel NM Audit
  • Loading branch information
zach2good authored Feb 20, 2025
2 parents fc6d15f + 4bf35a1 commit 1bef754
Show file tree
Hide file tree
Showing 24 changed files with 691 additions and 522 deletions.
35 changes: 14 additions & 21 deletions scripts/zones/Cape_Teriggan/Zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ require('scripts/quests/i_can_hear_a_rainbow')
local zoneObject = {}

zoneObject.onInitialize = function(zone)
local zmeyGorynych = GetMobByID(ID.mob.ZMEY_GORYNYCH)
if zmeyGorynych then
zmeyGorynych:setRespawnTime(math.random(3600, 7200)) -- 1 to 2 hours
end

local kreutzet = GetMobByID(ID.mob.KREUTZET)
if kreutzet then
UpdateNMSpawnPoint(ID.mob.KREUTZET)
kreutzet:setRespawnTime(math.random(32400, 43200)) -- 9 to 12 hours
kreutzet:setLocalVar('cooldown', os.time() + kreutzet:getRespawnTime() / 1000)
DisallowRespawn(kreutzet:getID(), true) -- prevents accidental 'pop' during no wind weather and immediate despawn
end

xi.conquest.setRegionalConquestOverseers(zone:getRegionID())
end

Expand Down Expand Up @@ -62,14 +49,20 @@ end
zoneObject.onZoneWeatherChange = function(weather)
local kreutzet = GetMobByID(ID.mob.KREUTZET)

if
kreutzet and
not kreutzet:isSpawned() and
os.time() > kreutzet:getLocalVar('cooldown') and
(weather == xi.weather.WIND or weather == xi.weather.GALES)
then
DisallowRespawn(kreutzet:getID(), false)
kreutzet:setRespawnTime(math.random(30, 150)) -- pop 30-150 sec after wind weather starts
if kreutzet then
if weather == xi.weather.WIND or weather == xi.weather.GALES then
DisallowRespawn(ID.mob.KREUTZET, false)

-- Check for respawn.
if
not kreutzet:isSpawned() and
kreutzet:getRespawnTime() == 0
then
kreutzet:setRespawnTime(math.random(30, 150)) -- pop 30-150 sec after wind weather starts
end
else
DisallowRespawn(ID.mob.KREUTZET, true) -- Disallow respawn.
end
end
end

Expand Down
56 changes: 55 additions & 1 deletion scripts/zones/Cape_Teriggan/mobs/Greater_Manticore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,60 @@ local ID = zones[xi.zone.CAPE_TERIGGAN]
---@type TMobEntity
local entity = {}

local frostmaneSpawnPoints =
{
{ x = -283.874, y = -0.660, z = 485.504 },
{ x = -272.224, y = -0.942, z = 461.321 },
{ x = -268.000, y = -0.558, z = 440.000 },
{ x = -262.000, y = -0.700, z = 442.000 },
{ x = -285.691, y = -0.295, z = 451.181 },
{ x = -284.157, y = 0.106, z = 457.050 },
{ x = -272.658, y = 0.432, z = 454.353 },
{ x = -278.557, y = 0.000, z = 441.306 },
{ x = -274.809, y = 0.784, z = 458.535 },
{ x = -277.748, y = 0.000, z = 438.305 },
{ x = -289.520, y = -1.163, z = 447.541 },
{ x = -272.850, y = -0.308, z = 473.888 },
{ x = -273.254, y = -0.220, z = 473.986 },
{ x = -282.771, y = -0.226, z = 486.986 },
{ x = -280.848, y = 0.176, z = 449.800 },
{ x = -283.549, y = 0.000, z = 477.576 },
{ x = -274.844, y = -0.089, z = 479.648 },
{ x = -285.299, y = -0.176, z = 477.741 },
{ x = -275.116, y = 0.257, z = 465.708 },
{ x = -267.361, y = 0.414, z = 444.021 },
{ x = -287.124, y = -0.279, z = 441.426 },
{ x = -276.502, y = 0.817, z = 462.031 },
{ x = -282.218, y = 0.001, z = 446.841 },
{ x = -278.855, y = 0.931, z = 461.357 },
{ x = -287.790, y = -0.301, z = 440.277 },
{ x = -278.524, y = 0.000, z = 483.608 },
{ x = -283.355, y = 0.000, z = 439.428 },
{ x = -282.145, y = 0.085, z = 445.727 },
{ x = -284.311, y = -0.219, z = 484.836 },
{ x = -256.485, y = 0.823, z = 442.872 },
{ x = -274.652, y = -0.015, z = 474.214 },
{ x = -281.216, y = 0.193, z = 472.118 },
{ x = -284.302, y = -0.047, z = 476.397 },
{ x = -280.234, y = 0.000, z = 483.199 },
{ x = -269.027, y = 0.374, z = 445.056 },
{ x = -277.316, y = 0.741, z = 463.192 },
{ x = -274.623, y = 0.068, z = 437.165 },
{ x = -280.987, y = 0.789, z = 461.301 },
{ x = -281.878, y = 0.000, z = 482.166 },
{ x = -282.064, y = 0.458, z = 453.960 },
{ x = -286.213, y = -0.168, z = 480.342 },
{ x = -279.835, y = 0.081, z = 445.640 },
{ x = -275.693, y = -0.025, z = 479.656 },
{ x = -271.681, y = -0.615, z = 469.612 },
{ x = -269.868, y = -0.769, z = 464.734 },
{ x = -271.194, y = -0.440, z = 481.698 },
{ x = -273.024, y = -0.253, z = 467.150 },
{ x = -277.366, y = 0.497, z = 453.016 },
{ x = -275.945, y = 0.257, z = 449.155 },
{ x = -272.622, y = -0.450, z = 469.839 },
}

local frostmanePHTable =
{
[ID.mob.FROSTMANE - 5] = ID.mob.FROSTMANE, -- -262.000 -0.700 442.000
Expand All @@ -21,7 +75,7 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
xi.mob.phOnDespawn(mob, frostmanePHTable, 5, math.random(3600, 21600)) -- 1 to 6 hours
xi.mob.phOnDespawn(mob, frostmanePHTable, 5, 3600, { spawnPoints = frostmaneSpawnPoints }) -- 1 hour
end

return entity
22 changes: 22 additions & 0 deletions scripts/zones/Cape_Teriggan/mobs/Killer_Jonny.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
-----------------------------------
-- Area: Cape Teriggan
-- NM: Killer Jonny
-- WOTG Nov 2009 NM: Immune to Bind, Sleep, Gravity. Uses only 1 TP move.
-----------------------------------
---@type TMobEntity
local entity = {}

local spawnPoints =
{
{ x = -90.636, y = -8.859, z = 152.899 },
{ x = -80.809, y = -7.032, z = 147.464 },
{ x = -77.167, y = -8.000, z = 156.316 },
{ x = -61.131, y = -7.005, z = 151.069 },
{ x = -54.285, y = -8.151, z = 165.535 },
{ x = -35.874, y = -8.162, z = 166.132 },
}

entity.onMobInitialize = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(28800, 86400)) -- 8 to 24 hours
mob:setMobMod(xi.mobMod.ADD_EFFECT, 1)
mob:setMod(xi.mod.DOUBLE_ATTACK, 100)
end

entity.onMobSpawn = function(mob)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.GRAVITY)
mob:addImmunity(xi.immunity.BIND)
mob:setMod(xi.mod.STORETP, 80)
end

entity.onAdditionalEffect = function(mob, target, damage)
return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.POISON, { power = 120 })
end
Expand All @@ -19,6 +40,7 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(28800, 86400)) -- 8 to 24 hours
end

Expand Down
100 changes: 88 additions & 12 deletions scripts/zones/Cape_Teriggan/mobs/Kreutzet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,71 @@
---@type TMobEntity
local entity = {}

local spawnPoints =
{
{ x = 207.000, y = 8.000, z = 1.000 },
{ x = 206.815, y = 7.997, z = 30.988 },
{ x = 239.461, y = 8.000, z = 36.764 },
{ x = 244.884, y = 7.931, z = 40.973 },
{ x = 244.047, y = 8.146, z = 26.193 },
{ x = 221.894, y = 8.711, z = 5.048 },
{ x = 222.966, y = 8.720, z = 41.007 },
{ x = 240.480, y = 8.654, z = 25.099 },
{ x = 219.439, y = 8.564, z = 33.017 },
{ x = 240.067, y = 8.000, z = 1.721 },
{ x = 236.722, y = 8.000, z = -0.087 },
{ x = 195.826, y = 8.928, z = 20.979 },
{ x = 195.346, y = 7.927, z = -3.773 },
{ x = 220.577, y = 8.427, z = 30.107 },
{ x = 218.173, y = 8.100, z = 26.092 },
{ x = 199.508, y = 7.895, z = -5.253 },
{ x = 196.715, y = 7.828, z = -5.807 },
{ x = 194.765, y = 8.846, z = 20.230 },
{ x = 220.090, y = 8.126, z = 9.681 },
{ x = 227.246, y = 8.471, z = 2.083 },
{ x = 246.034, y = 7.608, z = 45.278 },
{ x = 232.415, y = 8.100, z = 19.069 },
{ x = 201.074, y = 8.871, z = 22.568 },
{ x = 210.586, y = 8.328, z = 0.311 },
{ x = 199.051, y = 7.937, z = 6.562 },
{ x = 200.441, y = 8.781, z = 15.856 },
{ x = 229.327, y = 8.764, z = 28.575 },
{ x = 211.166, y = 7.988, z = 25.686 },
{ x = 210.313, y = 8.263, z = 34.996 },
{ x = 231.180, y = 8.240, z = 43.909 },
{ x = 193.963, y = 8.621, z = 23.393 },
{ x = 237.159, y = 8.000, z = 43.954 },
{ x = 217.593, y = 8.030, z = 23.653 },
{ x = 204.687, y = 8.550, z = 25.036 },
{ x = 193.197, y = 8.309, z = 25.924 },
{ x = 243.570, y = 8.340, z = 19.768 },
{ x = 210.190, y = 8.359, z = 18.490 },
{ x = 200.336, y = 8.888, z = 22.221 },
{ x = 199.780, y = 8.765, z = 16.027 },
{ x = 229.661, y = 7.827, z = 15.166 },
{ x = 244.466, y = 8.016, z = 28.147 },
{ x = 204.147, y = 7.817, z = 32.244 },
{ x = 202.704, y = 8.092, z = 28.186 },
{ x = 201.210, y = 7.759, z = -6.282 },
{ x = 193.966, y = 7.581, z = 1.438 },
{ x = 216.624, y = 8.830, z = 38.086 },
{ x = 196.589, y = 8.958, z = 19.674 },
{ x = 234.765, y = 8.136, z = 10.814 },
{ x = 200.606, y = 8.867, z = 22.649 },
{ x = 222.503, y = 8.874, z = 3.716 },
}

entity.onMobInitialize = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(32400, 43200)) -- 9 to 12 hours
DisallowRespawn(mob:getID(), true) -- prevents accidental 'pop' during no wind weather and immediate despawn
end

entity.onMobSpawn = function(mob)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
end

entity.onMobRoam = function(mob)
local weather = mob:getWeather()
if
Expand All @@ -15,27 +80,38 @@ entity.onMobRoam = function(mob)
end
end

entity.onMobWeaponSkill = function(target, mob, skill)
if skill:getID() == 926 then
local stormwindCounter = mob:getLocalVar('stormwindCounter')

stormwindCounter = stormwindCounter + 1
mob:setLocalVar('stormwindCounter', stormwindCounter)
mob:setLocalVar('stormwindDamage', stormwindCounter) -- extra var for dmg calculation (in stormwind.lua)

if stormwindCounter > 2 then
entity.onMobFight = function(mob, target)
local stormwindCounter = mob:getLocalVar('stormwindCounter')
if mob:canUseAbilities() then
if stormwindCounter == 3 then
mob:setLocalVar('stormwindCounter', 0)
else
elseif
stormwindCounter >= 1 and
mob:checkDistance(target) <= 15
then
stormwindCounter = stormwindCounter + 1
mob:setLocalVar('stormwindCounter', stormwindCounter)
mob:setLocalVar('stormwindDamage', stormwindCounter) -- extra var for dmg calculation (in stormwind.lua)
mob:useMobAbility(926)
end
end
end

entity.onMobWeaponSkill = function(target, mob, skill)
local stormwindCounter = mob:getLocalVar('stormwindCounter')
if
skill:getID() == 926 and
stormwindCounter == 0
then
mob:setLocalVar('stormwindCounter', 1)
mob:setLocalVar('stormwindDamage', 1)
end
end

entity.onMobDespawn = function(mob)
-- Set Kruetzet's spawnpoint and respawn time (9-12 hours)
UpdateNMSpawnPoint(mob:getID())
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(32400, 43200))
mob:setLocalVar('cooldown', os.time() + mob:getRespawnTime() / 1000)
DisallowRespawn(mob:getID(), true) -- prevents accidental 'pop' during no wind weather and immediate despawn
end

Expand Down
24 changes: 22 additions & 2 deletions scripts/zones/Cape_Teriggan/mobs/Tegmine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,33 @@
---@type TMobEntity
local entity = {}

local spawnPoints =
{
{ x = -11.082, y = -1.124, z = -109.332 },
{ x = -1.728, y = 0.295, z = -110.063 },
{ x = 4.875, y = 0.042, z = -119.958 },
{ x = 2.422, y = -0.614, z = -129.876 },
{ x = -5.618, y = -0.341, z = -124.383 },
{ x = -11.142, y = -2.023, z = -123.280 },
}

entity.onMobInitialize = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(7200, 7800)) -- 120 to 130 min
mob:setMobMod(xi.mobMod.ADD_EFFECT, 1)
end

entity.onMobSpawn = function(mob)
mob:addMod(xi.mod.ATT, 50)
mob:setMod(xi.mod.DOUBLE_ATTACK, 40)
mob:addImmunity(xi.immunity.BIND)
mob:addImmunity(xi.immunity.BLIND)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.GRAVITY)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.PARALYZE)
mob:addImmunity(xi.immunity.POISON)
mob:addImmunity(xi.immunity.STUN)
end

entity.onAdditionalEffect = function(mob, target, damage)
Expand All @@ -23,8 +43,8 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
-- UpdateNMSpawnPoint(mob:getID())
mob:setRespawnTime(math.random((7200), (7800))) -- 120 to 130 min
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(7200, 7800)) -- 120 to 130 min
end

return entity
14 changes: 14 additions & 0 deletions scripts/zones/Cape_Teriggan/mobs/Zmey_Gorynych.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@
---@type TMobEntity
local entity = {}

local spawnPoints =
{
{ x = -205.146, y = -1.047, z = 231.432 },
{ x = -194.067, y = -1.303, z = 231.401 },
{ x = -188.373, y = -1.907, z = 243.628 },
{ x = -196.377, y = -0.566, z = 248.861 },
{ x = -204.580, y = -0.045, z = 243.228 },
{ x = -211.208, y = -2.665, z = 251.127 },
{ x = -212.197, y = -1.902, z = 239.375 },
}

entity.onMobInitialize = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(3600, 7200)) -- 1 to 2 hours
mob:setMod(xi.mod.TRIPLE_ATTACK, 45)
mob:addMod(xi.mod.ATTP, 100)
mob:addMod(xi.mod.ACC, 100)
Expand All @@ -16,6 +29,7 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
xi.mob.updateNMSpawnPoint(mob, spawnPoints)
mob:setRespawnTime(math.random(3600, 7200)) -- 1-2 hours
end

Expand Down
4 changes: 0 additions & 4 deletions scripts/zones/Gustav_Tunnel/Zone.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
-----------------------------------
-- Zone: Gustav Tunnel (212)
-----------------------------------
local ID = zones[xi.zone.GUSTAV_TUNNEL]
-----------------------------------
---@type TZone
local zoneObject = {}

zoneObject.onInitialize = function(zone)
UpdateNMSpawnPoint(ID.mob.BUNE)
GetMobByID(ID.mob.BUNE):setRespawnTime(math.random(900, 10800))
end

zoneObject.onConquestUpdate = function(zone, updatetype, influence, owner, ranking, isConquestAlliance)
Expand Down
16 changes: 16 additions & 0 deletions scripts/zones/Gustav_Tunnel/mobs/Amikiri.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@
---@type TMobEntity
local entity = {}

entity.onMobInitialize = function(mob)
mob:setMobMod(xi.mobMod.ADD_EFFECT, 1)
mob:setMobMod(xi.mobMod.GIL_MIN, 12000)
mob:setMobMod(xi.mobMod.GIL_MAX, 12000)
end

entity.onMobSpawn = function(mob)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.POISON)
end

entity.onAdditionalEffect = function(mob, target, damage)
return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.POISON, { power = 50 })
end

entity.onMobDeath = function(mob, player, optParams)
xi.hunts.checkHunt(mob, player, 473)
end
Expand Down
Loading

0 comments on commit 1bef754

Please sign in to comment.