Skip to content

Commit

Permalink
[lua, sql] Yhoator Jungle NM Audit
Browse files Browse the repository at this point in the history
  • Loading branch information
CriticalXI committed Jan 9, 2025
1 parent fd1983e commit 33ca5ff
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 23 deletions.
5 changes: 5 additions & 0 deletions scripts/specs/core/CBaseEntity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,11 @@ end
function CBaseEntity:setMP(value)
end

---@param value integer
---@return nil
function CBaseEntity:setMaxMP(value)
end

---@param amount integer
---@return integer
function CBaseEntity:restoreMP(amount)
Expand Down
13 changes: 13 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Acolnahuacatl.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-----------------------------------
-- Area: Yhoator Jungle
-- NM: Acolnahuacatl
-- WOTG Nov 2009 NM: Immune to Bind, Sleep, Gravity. Uses only 1 TP move.
-----------------------------------
---@type TMobEntity
local entity = {}
Expand All @@ -9,6 +10,14 @@ entity.onMobInitialize = function(mob)
mob:setMobMod(xi.mobMod.ADD_EFFECT, 1)
end

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

entity.onAdditionalEffect = function(mob, target, damage)
return xi.mob.onAddEffect(mob, target, damage, xi.mob.ae.STUN)
end
Expand All @@ -17,4 +26,8 @@ entity.onMobDeath = function(mob, player, optParams)
xi.hunts.checkHunt(mob, player, 367)
end

entity.onMobDespawn = function(mob)
UpdateNMSpawnPoint(mob:getID())
end

return entity
5 changes: 5 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Bisque-heeled_Sunberry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ mixins = { require('scripts/mixins/families/tonberry') }
---@type TMobEntity
local entity = {}

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

entity.onMobDeath = function(mob, player, optParams)
xi.regime.checkRegime(player, mob, 133, 1, xi.regime.type.FIELDS)
end
Expand Down
4 changes: 4 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Edacious_Opo-opo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ entity.onMobDeath = function(mob, player, optParams)
xi.hunts.checkHunt(mob, player, 366)
end

entity.onMobDespawn = function(mob)
mob:setLocalVar("cooldown", os.time() + 900)
end

return entity
8 changes: 8 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Hoar-knuckled_Rimberry.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
-----------------------------------
-- Area: Yhoator Jungle
-- NM: Hoar-knuckled Rimberry
-- WOTG Nov 2009 NM: Immune to Bind, Sleep, Gravity.
-----------------------------------
mixins = { require('scripts/mixins/families/tonberry') }
-----------------------------------
---@type TMobEntity
local entity = {}

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

entity.onMobDeath = function(mob, player, optParams)
xi.hunts.checkHunt(mob, player, 368)
xi.regime.checkRegime(player, mob, 133, 1, xi.regime.type.FIELDS)
Expand Down
9 changes: 9 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Powderer_Penny.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
-----------------------------------
-- Area: Yhoator Jungle (124)
-- NM: Powderer Penny
-- WOTG Nov 2009 NM: Immune to Bind, Sleep, Gravity. Uses only 1 TP move.
-----------------------------------
---@type TMobEntity
local entity = {}

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

entity.onMobDeath = function(mob, player, optParams)
xi.hunts.checkHunt(mob, player, 365)
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/zones/Yhoator_Jungle/mobs/Tonberry_Creeper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
xi.mob.phOnDespawn(mob, ID.mob.HOAR_KNUCKLED_RIMBERRY_PH, 10, math.random(5400, 7200)) -- 90 to 120 minutes
xi.mob.phOnDespawn(mob, ID.mob.HOAR_KNUCKLED_RIMBERRY_PH, 10, 5400) -- 90 minutes minimum
end

return entity
2 changes: 1 addition & 1 deletion scripts/zones/Yhoator_Jungle/mobs/Tonberry_Shadower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ entity.onMobDeath = function(mob, player, optParams)
end

entity.onMobDespawn = function(mob)
xi.mob.phOnDespawn(mob, ID.mob.HOAR_KNUCKLED_RIMBERRY_PH, 10, math.random(5400, 7200)) -- 90 to 120 minutes
xi.mob.phOnDespawn(mob, ID.mob.HOAR_KNUCKLED_RIMBERRY_PH, 10, 5400) -- 90 minute minimum
end

return entity
8 changes: 8 additions & 0 deletions scripts/zones/Yhoator_Jungle/mobs/Woodland_Sage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ mixins = { require('scripts/mixins/job_special') }
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
mob:addImmunity(xi.immunity.LIGHT_SLEEP)
mob:addImmunity(xi.immunity.DARK_SLEEP)
mob:addImmunity(xi.immunity.SILENCE)
mob:setMobMod(xi.mobMod.ALWAYS_AGGRO, 1)
mob:setMaxMP(0) -- WHM but has no MP
end

entity.onMobDeath = function(mob, player, optParams)
end

Expand Down
6 changes: 5 additions & 1 deletion scripts/zones/Yhoator_Jungle/npcs/qm1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ local entity = {}

entity.onTrade = function(player, npc, trade)
local spawnChance = 0
local timer = GetMobByID(ID.mob.EDACIOUS_OPO_OPO):getLocalVar("cooldown")

if npcUtil.tradeHas(trade, xi.item.BUNCH_OF_PAMAMAS) then
spawnChance = 5
elseif npcUtil.tradeHas(trade, xi.item.BUNCH_OF_WILD_PAMAMAS) then
spawnChance = 50
end

if spawnChance > 0 then
if os.time() < timer then
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
elseif spawnChance > 0 then
player:confirmTrade()
if
math.random(1, 100) <= spawnChance and
Expand Down
4 changes: 4 additions & 0 deletions sql/item_latents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,10 @@ INSERT INTO `item_latents` VALUES (14448,10,6,1,71); -- VIT+6 when HP >71%

-- Unicorn Harness +1
INSERT INTO `item_latents` VALUES (14449,10,7,1,71); -- VIT+7 when HP >71%

-- Nanban Kariginu
INSERT INTO `item_latents` VALUES (14465,68,10,49,4468); -- EVA +10 with Pamama food active

INSERT INTO `item_latents` VALUES (14500,68,10,13,58); -- WAR AF2 +1 Body Reduces evasion penalty by 10 if Aggressor Active
INSERT INTO `item_latents` VALUES (14509,8,8,10,0);
INSERT INTO `item_latents` VALUES (14509,9,8,10,0);
Expand Down
27 changes: 14 additions & 13 deletions sql/mob_droplist.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3320,7 +3320,7 @@ INSERT INTO `mob_droplist` VALUES (357,0,0,1000,1441,200); -- Libation Abjur
INSERT INTO `mob_droplist` VALUES (357,2,0,1000,17622,0); -- Buccaneers Knife (Steal)

-- ZoneID: 124 - Bright-Handed Kunberry
INSERT INTO `mob_droplist` VALUES (358,0,0,1000,15468,440); -- Resentment Cape (44.0%)
INSERT INTO `mob_droplist` VALUES (358,0,0,1000,15468,@VCOMMON); -- Resentment Cape (Very Common, 24%)

-- ZoneID: 5 - Brontotaur
-- ZoneID: 5 - Tyrannotaur
Expand Down Expand Up @@ -6186,7 +6186,7 @@ INSERT INTO `mob_droplist` VALUES (743,0,0,1000,642,70); -- Chunk Of Zinc
INSERT INTO `mob_droplist` VALUES (743,0,0,1000,736,30); -- Chunk Of Silver Ore (3.0%)

-- ZoneID: 124 - Edacious Opo-Opo
INSERT INTO `mob_droplist` VALUES (744,0,0,1000,4468,110); -- Bunch Of Pamamas (11.0%)
INSERT INTO `mob_droplist` VALUES (744,0,0,1000,4468,@UNCOMMON); -- Bunch Of Pamamas (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (744,0,0,1000,14465,@UNCOMMON); -- Nanban Kariginu (Uncommon, 10%)

-- ZoneID: 39 - Adamantking Effigy
Expand Down Expand Up @@ -21856,14 +21856,15 @@ INSERT INTO `mob_droplist` VALUES (2665,0,0,1000,2427,@COMMON); -- Wivre Maul (C
INSERT INTO `mob_droplist` VALUES (2665,0,0,1000,2426,@RARE); -- Wivre Horn (Rare, 5%)

-- ZoneID: 124 - Woodland Sage
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,701,530); -- Rosewood Log (53.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,280); -- Mahogany Log (28.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,701,270); -- Rosewood Log (27.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,702,260); -- Ebony Log (26.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,703,170); -- Petrified Log (17.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,140); -- Mahogany Log (14.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,90); -- Mahogany Log (9.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,17529,30); -- Sunlight Pole (3.0%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,701,@COMMON); -- Rosewood Log (Common, 15%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,701,@COMMON); -- Rosewood Log (Common, 15%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,702,@UNCOMMON); -- Ebony Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,702,@UNCOMMON); -- Ebony Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,703,@UNCOMMON); -- Petrified Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,@UNCOMMON); -- Mahogany Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,@UNCOMMON); -- Mahogany Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,700,@UNCOMMON); -- Mahogany Log (Uncommon, 10%)
INSERT INTO `mob_droplist` VALUES (2666,0,0,1000,17529,@UNCOMMON); -- Sunlight Pole (Uncommon, 10%)

-- ZoneID: 40 - Woodnix Shrillwhistle
INSERT INTO `mob_droplist` VALUES (2667,0,0,1000,1449,200); -- Tukuku Whiteshell (20.0%)
Expand Down Expand Up @@ -24535,13 +24536,13 @@ INSERT INTO `mob_droplist` VALUES (3066,0,0,1000,11342,156); -- Restorer Cloak (
INSERT INTO `mob_droplist` VALUES (3067,0,0,1000,16025,250); -- Rathe Earring (25.0%)

-- ZoneID: 124 - Powderer Penny
INSERT INTO `mob_droplist` VALUES (3068,0,0,1000,16016,200); -- Chary Earring (20.0%)
INSERT INTO `mob_droplist` VALUES (3068,0,0,1000,16016,@COMMON); -- Chary Earring (Common, 15%)

-- ZoneID: 124 - Hoar-Knuckled Rimberry
INSERT INTO `mob_droplist` VALUES (3069,0,0,1000,16034,81); -- Sarabande Earring (8.1%)
INSERT INTO `mob_droplist` VALUES (3069,0,0,1000,16034,@RARE); -- Sarabande Earring (Rare, 5%)

-- ZoneID: 124 - Acolnahuacatl
INSERT INTO `mob_droplist` VALUES (3070,0,0,1000,11534,81); -- Echo Cape (8.1%)
INSERT INTO `mob_droplist` VALUES (3070,0,0,1000,11534,@RARE); -- Echo Cape (Rare, 5%)

-- ZoneID: 169 - Canal Moocher
INSERT INTO `mob_droplist` VALUES (3071,0,0,1000,2817,@VCOMMON); -- Aptant Of Pera (Very Common, 24%)
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8886,7 +8886,7 @@ INSERT INTO `mob_groups` VALUES (59,3951,124,'Tonberry_Creeper_G',0,128,3226,0,0
INSERT INTO `mob_groups` VALUES (60,3958,124,'Tonberry_Hexer_G',0,128,3226,0,0,50,55,0);
INSERT INTO `mob_groups` VALUES (61,3954,124,'Tonberry_Decimator',0,128,3226,0,0,55,55,0);

INSERT INTO `mob_groups` VALUES (62,1174,124,'Edacious_Opo-opo',0,128,744,0,0,60,60,0);
INSERT INTO `mob_groups` VALUES (62,1174,124,'Edacious_Opo-opo',0,128,744,5800,0,60,60,0);
INSERT INTO `mob_groups` VALUES (63,2201,124,'Kedgebelly_Kate',0,128,0,0,0,1,1,0);
INSERT INTO `mob_groups` VALUES (64,0,124,'Woodland_Mender',0,128,0,0,0,0,0,0);

Expand Down
10 changes: 5 additions & 5 deletions sql/mob_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ INSERT INTO `mob_pools` VALUES (419,'Bilopdop','Bilopdop',334,0x0000700200000000
INSERT INTO `mob_pools` VALUES (420,'Binding_Tube_GS','Binding_Tube',247,0x0000000700000000000000000000000000000000,1,1,7,240,100,0,1,1,0,0,0,0,7,129,8,0,0,0,0,247,247);
INSERT INTO `mob_pools` VALUES (421,'Birdtrap','Birdtrap',114,0x0000410500000000000000000000000000000000,1,1,8,200,100,0,0,0,0,0,0,0,396,131,8,0,0,0,0,114,114);
INSERT INTO `mob_pools` VALUES (422,'Bisan','Bisan',49,0x0000980100000000000000000000000000000000,8,8,7,240,100,0,1,0,1,18,0,32,971,157,0,0,0,0,0,49,49);
INSERT INTO `mob_pools` VALUES (423,'Bisque-heeled_Sunberry','Bisque-heeled_Sunberry',243,0x0000A70400000000000000000000000000000000,6,6,2,240,100,0,1,0,1,2,6144,32,338,157,0,0,0,0,0,243,243);
INSERT INTO `mob_pools` VALUES (423,'Bisque-heeled_Sunberry','Bisque-heeled_Sunberry',243,0x0000A70400000000000000000000000000000000,6,6,2,240,100,0,1,0,1,2,0,32,338,157,0,0,0,0,0,243,243);
INSERT INTO `mob_pools` VALUES (424,'Bistre-hearted_Malberry','Bistre-hearted_Malberry',243,0x0000C60400000000000000000000000000000000,4,4,6,240,100,0,1,0,1,2,6160,32,0,157,0,0,2,0,0,243,243);
INSERT INTO `mob_pools` VALUES (425,'Bitoso','Bitoso',79,0x00008D0100000000000000000000000000000000,3,3,11,240,100,0,1,0,1,18,16,32,6,159,0,0,62,0,0,79,79);
INSERT INTO `mob_pools` VALUES (426,'BiFho_Jestergrin','BiFho_Jestergrin',202,0x00008A0200000000000000000000000000000000,6,6,2,265,100,0,1,0,1,16,0,0,0,0,0,0,0,0,0,202,202);
Expand Down Expand Up @@ -4415,7 +4415,7 @@ INSERT INTO `mob_pools` VALUES (4357,'Wolf_Bat','Wolf_Bat',46,0x0000000100000000
INSERT INTO `mob_pools` VALUES (4358,'Wolf_Clan_Warmachine','Wolf_Clan_Warmachine',190,0x0000AC0100000000000000000000000000000000,1,1,7,240,100,0,1,0,1,18,0,0,0,645,8,0,0,0,0,190,190);
INSERT INTO `mob_pools` VALUES (4359,'Wolf_Zombie','Wolf_Zombie',143,0x00006C0100000000000000000000000000000000,1,1,3,240,100,0,1,0,0,0,0,0,665,131,0,0,0,0,0,143,143);
INSERT INTO `mob_pools` VALUES (4360,'Woodland_Runner','Woodland_Runner',210,0x00003D0100000000000000000000000000000000,6,6,7,220,100,0,1,0,0,0,0,0,237,131,0,0,0,0,0,210,210);
INSERT INTO `mob_pools` VALUES (4361,'Woodland_Sage','Woodland_Sage',245,0x0000840100000000000000000000000000000000,3,3,7,240,100,0,1,0,0,2,6144,0,2017,133,0,0,0,0,0,245,245);
INSERT INTO `mob_pools` VALUES (4361,'Woodland_Sage','Woodland_Sage',245,0x0000840100000000000000000000000000000000,3,1,7,240,100,0,1,0,0,2,0,0,2017,133,0,0,0,0,0,245,245);
INSERT INTO `mob_pools` VALUES (4362,'Woodnix_Shrillwhistle','Woodnix_Shrillwhistle',373,0x0000400400000000000000000000000000000000,9,9,3,240,100,0,1,0,1,2,0,32,0,159,0,0,0,0,0,373,373);
INSERT INTO `mob_pools` VALUES (4363,'Woodnixs_Slime','Woodnixs_Slime',229,0x0000800100000000000000000000000000000000,5,5,3,240,100,0,1,0,1,8,0,32,0,155,0,0,54,0,0,229,229);
INSERT INTO `mob_pools` VALUES (4364,'Woodtroll_Dark_Knight','Woodtroll_Dark_Knight',246,0x0600940600000000000000000000000000000000,8,8,5,280,100,0,1,0,1,0,0,0,0,131,0,0,5,0,0,247,246);
Expand Down Expand Up @@ -5911,9 +5911,9 @@ INSERT INTO `mob_pools` VALUES (5852,'Eyegouger','Eyegouger',55,0x0000BC01000000
INSERT INTO `mob_pools` VALUES (5853,'Humbaba','Humbaba',126,0x0000C40200000000000000000000000000000000,1,1,11,240,100,0,1,0,1,2,6150,32,0,155,0,0,0,0,0,126,126);
INSERT INTO `mob_pools` VALUES (5854,'Dynast_Beetle','Dynast_Beetle',49,0x0000980100000000000000000000000000000000,7,7,8,240,100,0,1,0,1,2,6278,0,0,131,0,0,0,0,0,49,49);
INSERT INTO `mob_pools` VALUES (5855,'Nandi','Nandi',80,0x00004C0100000000000000000000000000000000,1,1,12,240,100,0,0,0,1,2,6150,32,0,155,0,0,0,0,0,96,80);
INSERT INTO `mob_pools` VALUES (5856,'Powderer_Penny','Powderer_Penny',48,0x0000110100000000000000000000000000000000,1,1,2,240,100,0,0,0,1,2,6150,32,0,667,8,0,0,0,0,814,48);
INSERT INTO `mob_pools` VALUES (5857,'Hoar-knuckled_Rimberry','Hoar-knuckled_Rimberry',243,0x0000B50400000000000000000000000000000000,13,13,1,240,100,0,1,0,1,2,6150,32,0,0,0,0,238,0,0,0,243);
INSERT INTO `mob_pools` VALUES (5858,'Acolnahuacatl','Acolnahuacatl',71,0x00006F0100000000000000000000000000000000,1,6,2,240,100,0,1,0,0,2,6150,32,0,1179,0,0,0,0,0,32,71);
INSERT INTO `mob_pools` VALUES (5856,'Powderer_Penny','Powderer_Penny',48,0x0000110100000000000000000000000000000000,1,1,2,240,100,0,0,0,1,2,0,32,0,667,8,0,0,0,0,311,48);
INSERT INTO `mob_pools` VALUES (5857,'Hoar-knuckled_Rimberry','Hoar-knuckled_Rimberry',243,0x0000B50400000000000000000000000000000000,13,13,1,240,100,0,1,0,1,2,0,32,0,0,0,0,238,0,0,0,243);
INSERT INTO `mob_pools` VALUES (5858,'Acolnahuacatl','Acolnahuacatl',71,0x00006F0100000000000000000000000000000000,1,6,2,240,100,0,1,0,0,2,0,32,0,1179,0,0,0,0,0,32,71);
INSERT INTO `mob_pools` VALUES (5859,'Canal_Moocher','Canal_Moocher',172,0x0000140100000000000000000000000000000000,1,1,7,240,100,0,1,0,1,2,6150,0,0,3,0,0,0,0,0,172,172);
INSERT INTO `mob_pools` VALUES (5860,'Skvader','Skvader',404,0x00000E0100000000000000000000000000000000,3,3,7,240,100,0,0,0,0,2,6158,0,0,133,0,0,1,0,0,0,404);
INSERT INTO `mob_pools` VALUES (5861,'Magnotaur','Magnotaur',240,0x00004F0500000000000000000000000000000000,1,1,7,240,100,0,1,1,1,2,6150,0,0,133,0,0,0,0,0,119,240);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_skill_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ INSERT INTO `mob_skill_lists` VALUES ('Nosferatu',309,2111);
-- INSERT INTO `mob_skill_lists` VALUES ('Nosferatu',309,2112);
INSERT INTO `mob_skill_lists` VALUES ('ExperimentalLa',310,1753);
INSERT INTO `mob_skill_lists` VALUES ('ExperimentalLa',310,1758);
-- 311: free
INSERT INTO `mob_skill_lists` VALUES ('Powderer_Penny',311,335); -- pollen
-- INSERT INTO `mob_skill_lists` VALUES ('Nuhn',312,1977);
-- INSERT INTO `mob_skill_lists` VALUES ('Nuhn',312,1978);
-- INSERT INTO `mob_skill_lists` VALUES ('Nuhn',312,1693);
Expand Down
10 changes: 10 additions & 0 deletions sql/nm_spawn_points.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3138,8 +3138,18 @@ INSERT INTO `nm_spawn_points` VALUES (17285220,47,196.674,0.000,79.612);
INSERT INTO `nm_spawn_points` VALUES (17285220,48,245.816,0.000,41.834);
INSERT INTO `nm_spawn_points` VALUES (17285220,49,239.785,0.000,43.552);
INSERT INTO `nm_spawn_points` VALUES (17285248,0,-11.700,-2.531,-123.250); -- Powderer Penny
INSERT INTO `nm_spawn_points` VALUES (17285248,1,-3.466,-0.500,-65.710);
INSERT INTO `nm_spawn_points` VALUES (17285248,2,5.283,-3.164,-95.762);
INSERT INTO `nm_spawn_points` VALUES (17285248,3,-15.146,-0.698,-145.681);
INSERT INTO `nm_spawn_points` VALUES (17285248,4,-15.742,8.204,-102.386);
INSERT INTO `nm_spawn_points` VALUES (17285248,5,-46.099,-0.144,-65.964);
INSERT INTO `nm_spawn_points` VALUES (17285248,6,-37.681,-3.300,-124.244);
INSERT INTO `nm_spawn_points` VALUES (17285394,0,24.922,-5.023,-423.784); -- Hoar-knuckled Rimberry
INSERT INTO `nm_spawn_points` VALUES (17285394,1,31.930,0.201,-407.700);
INSERT INTO `nm_spawn_points` VALUES (17285341,0,-242.500,0.000,-400.400); -- Acolnahuacatl
INSERT INTO `nm_spawn_points` VALUES (17285341,1,-275.045,0.069,-441.843);
INSERT INTO `nm_spawn_points` VALUES (17285341,2,-278.034,0.000,-359.746);
INSERT INTO `nm_spawn_points` VALUES (17285341,3,-201.329,0.057,-444.798);
INSERT INTO `nm_spawn_points` VALUES (17285460,0,296.401,-18.499,-505.720);
INSERT INTO `nm_spawn_points` VALUES (17285460,1,301.844,-18.000,-526.287);
INSERT INTO `nm_spawn_points` VALUES (17285460,2,297.768,-18.000,-509.508);
Expand Down
22 changes: 22 additions & 0 deletions src/map/lua/lua_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9751,6 +9751,27 @@ void CLuaBaseEntity::setMP(int32 value)
PBattle->addMP(value);
}

/************************************************************************
* Function: setMaxMP()
* Purpose : Sets the Maximum Mana Points of an Entity
* Example : player:setMaxMP(100)
* Notes :
************************************************************************/

void CLuaBaseEntity::setMaxMP(int32 value)
{
if (m_PBaseEntity->objtype == TYPE_NPC)
{
ShowWarning("Invalid Entity (NPC: %s) calling function.", m_PBaseEntity->getName());
return;
}

auto* PBattle = static_cast<CBattleEntity*>(m_PBaseEntity);

PBattle->health.maxmp = std::max(0, value);
PBattle->UpdateHealth();
}

/************************************************************************
* Function: restoreMP()
* Purpose : Restores Mana Points to a player
Expand Down Expand Up @@ -18790,6 +18811,7 @@ void CLuaBaseEntity::Register()
SOL_REGISTER("getBaseMP", CLuaBaseEntity::getBaseMP);
SOL_REGISTER("addMP", CLuaBaseEntity::addMP);
SOL_REGISTER("setMP", CLuaBaseEntity::setMP);
SOL_REGISTER("setMaxMP", CLuaBaseEntity::setMaxMP);
SOL_REGISTER("restoreMP", CLuaBaseEntity::restoreMP);
SOL_REGISTER("delMP", CLuaBaseEntity::delMP);

Expand Down
1 change: 1 addition & 0 deletions src/map/lua/lua_baseentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ class CLuaBaseEntity
int32 getBaseMP(); // Returns Entity base Mana Points (before modifiers)
int32 addMP(int32 amount); // Increase mp of Entity
void setMP(int32 value); // Set mp of Entity to value
void setMaxMP(int32 value); // Set max mp of Entity to value
int32 restoreMP(int32 amount); // Modify mp of Entity, but check if alive first
int32 delMP(int32 amount); // Decrease mp of Entity

Expand Down

0 comments on commit 33ca5ff

Please sign in to comment.