Skip to content

Commit

Permalink
Implement Shadows of the Mind ISNM
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcmorris committed Aug 30, 2024
1 parent 3a463d6 commit bbbc4c6
Show file tree
Hide file tree
Showing 12 changed files with 252 additions and 22 deletions.
48 changes: 48 additions & 0 deletions scripts/actions/mobskills/boreas_mantle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-----------------------------------
-- Boreas Mantle
-- Description: Spawns 4 clones of itself that disappear after 30 seconds
-- Used only by Phantom Puk
-----------------------------------
---@type TMobSkill
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local mobID = mob:getID()
local player = mob:getTarget()
local clonehp = 500
local hpp = mob:getHPP() / 100.0
local maxhp = math.ceil(clonehp / hpp)
for cloneID = mobID + 1, mobID + 4 do
local clone = SpawnMob(cloneID)
if clone then
clone:setMaxHP(maxhp)
clone:setHP(clonehp)
if player then
clone:updateEnmity(player)
end

clone:setPos(mob:getXPos(), mob:getYPos(), mob:getZPos())
end
end

mob:timer(30000, function(mobArg)
for cloneID = mobID + 1, mobID + 4 do
local clone = GetMobByID(cloneID)
if clone then
local action = clone:getCurrentAction()
if action ~= xi.act.NONE and action ~= xi.act.DEATH then
DespawnMob(cloneID)
end
end
end
end)

skill:setMsg(xi.msg.basic.NONE)
return 0
end

return mobskillObject
100 changes: 100 additions & 0 deletions scripts/battlefields/Jade_Sepulcher/Shadows_of_the_Mind.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
-----------------------------------
-- Shadows of the Mind
-- Jade Sepulcher, Confidential Imperial Order
-- !addkeyitem SECRET_IMPERIAL_ORDER
-----------------------------------
local ID = zones[xi.zone.JADE_SEPULCHER]
-----------------------------------

local content = Battlefield:new({
zoneId = xi.zone.JADE_SEPULCHER,
battlefieldId = xi.battlefield.id.SHADOWS_OF_THE_MIND,
maxPlayers = 6,
levelCap = 75,
timeLimit = utils.minutes(30),
index = 1,
entryNpc = '_1v0',
exitNpcs = { '_1v1', '_1v2', '_1v3' },
requiredKeyItems = { xi.ki.SECRET_IMPERIAL_ORDER, message = ID.text.IMPERIAL_ORDER_BREAKS },
})

content.groups = {
{
mobs = { 'Phantom_Puk' },
allDeath = utils.bind(content.handleAllMonstersDefeated, content),
},

{
mobs = { 'Phantom_Puk_Clone' },
spawned = false,
},
}

content.loot =
{
{
{ item = xi.item.GIL, weight = xi.loot.weight.NORMAL, amount = 12000 },
},

{
{ item = xi.item.CHARISMA_POTION, weight = xi.loot.weight.NORMAL },
{ item = xi.item.ICARUS_WING, weight = xi.loot.weight.NORMAL },
{ item = xi.item.INTELLIGENCE_POTION, weight = xi.loot.weight.NORMAL },
{ item = xi.item.MIND_POTION, weight = xi.loot.weight.NORMAL },
},

{
{ item = xi.item.BOTTLE_OF_SIEGLINDE_PUTTY, weight = xi.loot.weight.NORMAL },
{ item = xi.item.BRASS_TANK, weight = xi.loot.weight.NORMAL },
{ item = xi.item.MERROW_SCALE, weight = xi.loot.weight.NORMAL },
{ item = xi.item.AHRIMAN_WING, weight = xi.loot.weight.NORMAL },
},

{
{ item = xi.item.SCROLL_OF_ERASE, weight = xi.loot.weight.HIGH },
{ item = xi.item.SCROLL_OF_PROTECTRA_IV, weight = xi.loot.weight.HIGH },
{ item = xi.item.SCROLL_OF_BLIZZARD_IV, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SCROLL_OF_DISPEL, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SCROLL_OF_PROTECT_IV, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SCROLL_OF_QUAKE, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SCROLL_OF_RERAISE_III, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SCROLL_OF_WATER_IV, weight = xi.loot.weight.NORMAL },
},

{
{ item = xi.item.CHOCOBO_EGG_SOMEWHAT_WARM, weight = xi.loot.weight.NORMAL },
},

{
{ item = xi.item.PUK_WING, weight = xi.loot.weight.NORMAL },
},

{
{ item = xi.item.NONE, weight = xi.loot.weight.EXTREMELY_HIGH },
{ item = xi.item.COMPANY_FLEURET, weight = xi.loot.weight.LOW },
{ item = xi.item.MAGNET_KNIFE, weight = xi.loot.weight.LOW },
{ item = xi.item.SACRIFICE_TORQUE, weight = xi.loot.weight.LOW },
{ item = xi.item.TOURNAMENT_LANCE, weight = xi.loot.weight.LOW },
},

{
{ item = xi.item.NONE, weight = xi.loot.weight.EXTREMELY_HIGH },
{ item = xi.item.PIECE_OF_HABU_SKIN, weight = xi.loot.weight.NORMAL },
{ item = xi.item.SQUARE_OF_RAINBOW_CLOTH, weight = xi.loot.weight.NORMAL },
{ item = xi.item.BUFFALO_HORN, weight = xi.loot.weight.LOW },
{ item = xi.item.SQUARE_OF_WAMOURA_CLOTH, weight = xi.loot.weight.LOW },
{ item = xi.item.SQUARE_OF_RED_GRASS_CLOTH, weight = xi.loot.weight.VERY_LOW },
{ item = xi.item.SQUARE_OF_KARAKUL_CLOTH, weight = xi.loot.weight.VERY_LOW },
{ item = xi.item.SQUARE_OF_RAXA, weight = xi.loot.weight.VERY_LOW },
{ item = xi.item.POT_OF_URUSHI, weight = xi.loot.weight.VERY_LOW },
},

{
{ item = xi.item.BEHEMOTH_HORN, weight = xi.loot.weight.NORMAL },
{ item = xi.item.DRAGON_TALON, weight = xi.loot.weight.NORMAL },
{ item = xi.item.CHUNK_OF_KHROMA_ORE, weight = xi.loot.weight.NORMAL },
{ item = xi.item.CHUNK_OF_LUMINIUM_ORE, weight = xi.loot.weight.NORMAL },
},
}

return content:register()
13 changes: 13 additions & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ xi.item =
CHICKEN_BONE = 898,
VENOMOUS_CLAW = 901,
DEMON_HORN = 902,
DRAGON_TALON = 903,
SET_OF_GIANT_FISH_BONES = 904,
WYVERN_SKULL = 905,
STARMITE_SHELL = 906,
Expand Down Expand Up @@ -885,6 +886,7 @@ xi.item =
CHUNK_OF_KOPPARNICKEL_ORE = 1650,
BOTTLE_OF_RICE_VINEGAR = 1652,
IGNEOUS_ROCK = 1654,
BRASS_TANK = 1656,
SPOOL_OF_BUNDLING_TWINE = 1657,
SEALION_CREST_KEY = 1658,
CORAL_CREST_KEY = 1659,
Expand Down Expand Up @@ -936,6 +938,7 @@ xi.item =
PIECE_OF_CASSIA_LUMBER = 1762,
POT_OF_VIRIDIAN_URUSHI = 1763,
SQUARE_OF_KEJUSU_SATIN = 1764,
PIECE_OF_HABU_SKIN = 1765,
SQUARE_OF_ELTORO_LEATHER = 1767,
SQUARE_OF_GALATEIA = 1769,
DRAGON_BONE = 1771,
Expand Down Expand Up @@ -976,6 +979,7 @@ xi.item =
AIR_TANK = 1878,
POT_OF_CLUSTERED_TAR = 1880,
PONZE_OF_SHELL_POWDER = 1883,
BOTTLE_OF_SIEGLINDE_PUTTY = 1886,
GLASS_SHEET = 1887,
SACK_OF_SILICA = 1888,
VIAL_OF_FRESH_BLOOD = 1898,
Expand Down Expand Up @@ -2302,6 +2306,7 @@ xi.item =
SCROLL_OF_DIAGA = 4641,
SCROLL_OF_BANISHGA = 4646,
SCROLL_OF_PROTECT = 4651,
SCROLL_OF_PROTECT_IV = 4654,
SCROLL_OF_PROTECT_V = 4655,
SCROLL_OF_SHELL = 4656,
SCROLL_OF_SHELL_IV = 4659,
Expand All @@ -2324,16 +2329,19 @@ xi.item =
SCROLL_OF_TELEPORT_HOLLA = 4730,
SCROLL_OF_TELEPORT_DEM = 4731,
SCROLL_OF_TELEPORT_MEA = 4732,
SCROLL_OF_PROTECTRA_IV = 4736,
SCROLL_OF_INVISIBLE = 4744,
SCROLL_OF_SNEAK = 4745,
SCROLL_OF_DEODORIZE = 4746,
SCROLL_OF_TELEPORT_VAHZL = 4747,
SCROLL_OF_RAISE_III = 4748,
SCROLL_OF_RERAISE_II = 4749,
SCROLL_OF_RERAISE_III = 4750,
SCROLL_OF_ERASE = 4751,
SCROLL_OF_FIRE = 4752,
SCROLL_OF_FIRE_II = 4753,
SCROLL_OF_BLIZZARD = 4757,
SCROLL_OF_BLIZZARD_IV = 4760,
SCROLL_OF_AERO = 4762,
SCROLL_OF_AERO_IV = 4765,
SCROLL_OF_AERO_V = 4766,
Expand All @@ -2343,6 +2351,7 @@ xi.item =
SCROLL_OF_THUNDER = 4772,
SCROLL_OF_THUNDER_III = 4774,
SCROLL_OF_WATER = 4777,
SCROLL_OF_WATER_IV = 4780,
SCROLL_OF_WATER_V = 4781,
SCROLL_OF_FLARE = 4812,
SCROLL_OF_FREEZE = 4814,
Expand Down Expand Up @@ -5247,6 +5256,7 @@ xi.item =
FORTIFIED_CHAIN = 15524,
GRANDIOSE_CHAIN = 15525,
REGEN_COLLAR = 15526,
SACRIFICE_TORQUE = 15528,
CHOCOBO_WHISTLE = 15533,
OROCHI_NODOWA = 15539,
RAJAS_RING = 15543,
Expand Down Expand Up @@ -5983,6 +5993,7 @@ xi.item =
MACUAHUITL_M1 = 17716,
IMMORTALS_SCIMITAR = 17717,
LEECH_SCIMITAR = 17718,
COMPANY_FLEURET = 17720,
SANGUINE_SWORD = 17721,
HAUTECLAIRE = 17738,
PERDU_HANGER = 17741,
Expand Down Expand Up @@ -6073,6 +6084,7 @@ xi.item =
BLAU_DOLCH = 18015,
ODOROUS_KNIFE_P1 = 18016,
KHANJAR = 18025,
MAGNET_KNIFE = 18026,
DANCING_DAGGER = 18034,
WEBCUTTER = 18040,
A_LOUTRANCE = 18041,
Expand Down Expand Up @@ -6100,6 +6112,7 @@ xi.item =
PITCHFORK_P1 = 18103,
PUK_LANCE = 18112,
IMPERIAL_NEZA = 18113,
TOURNAMENT_LANCE = 18114,
RADIANT_LANCE = 18120,
VALKYRIES_FORK = 18121,
SKYSTRIDER = 18128,
Expand Down
1 change: 1 addition & 0 deletions scripts/enum/mob_skills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ xi.mobSkill =
RANGED_ATTACK_15 = 1949,

ECLOSION = 1970,
BOREAS_MANTLE = 1980,

ROAR_3 = 2406,

Expand Down
46 changes: 46 additions & 0 deletions scripts/zones/Jade_Sepulcher/mobs/Phantom_Puk.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-----------------------------------
-- Area: Jade Sepulcher
-- NM: Phantom Puk
-----------------------------------
mixins = { require('scripts/mixins/families/puk') }
-----------------------------------
local entity = {}

entity.onMobInitialize = function(mob)
end

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

entity.onMobEngage = function(mob, target)
mob:setLocalVar('boreas_mantle', os.time() + math.random(15, 45))
end

entity.onMobFight = function(mob, target)
local now = os.time()
if mob:getLocalVar('boreas_mantle') <= now then
mob:useMobAbility(xi.mobSkill.BOREAS_MANTLE, mob)
mob:setLocalVar('boreas_mantle', now + math.random(60, 90))
end
end

entity.onMobDeath = function(mob, player, optParams)
local mobID = mob:getID()
for cloneID = mobID + 1, mobID + 4 do
local clone = GetMobByID(cloneID)
if clone then
local action = clone:getCurrentAction()
if action ~= xi.act.NONE and action ~= xi.act.DEATH then
DespawnMob(cloneID)
end
end
end
end

return entity
18 changes: 18 additions & 0 deletions scripts/zones/Jade_Sepulcher/mobs/Phantom_Puk_Clone.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----------------------------------
-- Area: Jade Sepulcher
-- NM: Phantom Puk (Clone)
-----------------------------------
mixins = { require('scripts/mixins/families/puk') }
-----------------------------------
local entity = {}

entity.onMobSpawn = function(mob)
mob:addStatusEffect(xi.effect.BLINK, 3, 0, 180)
mob:setMod(xi.mod.DMG, 20000)
mob:setMod(xi.mod.HP, 0)
end

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

return entity
2 changes: 1 addition & 1 deletion sql/mob_groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3256,7 +3256,7 @@ INSERT INTO `mob_groups` VALUES (39,3060,66,'Orochi',0,128,0,25000,0,80,82,0);
-- ------------------------------------------------------------

INSERT INTO `mob_groups` VALUES (1,2712,67,'Mocking_Colibri',0,128,0,8000,0,66,66,0);
INSERT INTO `mob_groups` VALUES (2,3128,67,'Phantom_Puk',0,128,0,0,0,75,75,0);
INSERT INTO `mob_groups` VALUES (2,3128,67,'Phantom_Puk',0,128,0,14000,0,76,76,0);
INSERT INTO `mob_groups` VALUES (3,3327,67,'Raubahn',0,128,0,0,0,75,75,0);
INSERT INTO `mob_groups` VALUES (4,3567,67,'Shadowhand_Kajeel_Ja',0,128,0,0,0,75,75,0);
INSERT INTO `mob_groups` VALUES (5,430,67,'Blacktattoo_Vedool_Ja',0,128,0,0,0,75,75,0);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,7 @@ INSERT INTO `mob_pools` VALUES (3124,'Pey','Pey',227,0x00003C0200000000000000000
INSERT INTO `mob_pools` VALUES (3125,'Phanduron_the_Condemned','Phanduron_the_Condemned',221,0x00001A0200000000000000000000000000000000,4,1,3,360,100,0,1,0,1,2,24,32,0,157,0,0,2,0,0,221,221);
INSERT INTO `mob_pools` VALUES (3126,'Phantasmal_Puk','Phantasmal_Puk',198,0x0000D00600000000000000000000000000000000,1,1,7,200,100,0,1,0,1,0,0,0,7,131,0,0,0,0,0,198,198);
INSERT INTO `mob_pools` VALUES (3127,'Phantom','Phantom',121,0x0000700100000000000000000000000000000000,4,4,12,240,100,0,1,0,0,0,0,0,298,131,16,0,28,0,0,121,121);
INSERT INTO `mob_pools` VALUES (3128,'Phantom_Puk','Phantom_Puk',198,0x0000D00600000000000000000000000000000000,1,1,7,200,100,0,1,0,1,16,0,0,482,135,0,0,0,0,0,198,198);
INSERT INTO `mob_pools` VALUES (3128,'Phantom_Puk','Phantom_Puk',198,0x0000D00600000000000000000000000000000000,1,1,7,200,100,0,1,0,1,16,0,0,482,135,0,0,0,0,0,413,198);
INSERT INTO `mob_pools` VALUES (3129,'Phantom_Worm','Phantom_Worm',258,0x0000AA0100000000000000000000000000000000,4,5,7,240,100,0,1,0,1,2,16,0,4937,135,0,0,9,0,64,258,258);
INSERT INTO `mob_pools` VALUES (3130,'Phasma','Phasma',121,0x0000700100000000000000000000000000000000,4,4,12,240,100,0,1,0,0,0,0,0,502,643,0,0,28,0,0,121,121);
INSERT INTO `mob_pools` VALUES (3131,'Phlebotomic_Slug','Phlebotomic_Slug',172,0x0000140100000000000000000000000000000000,1,1,7,240,100,0,0,0,1,0,0,0,191,643,0,0,0,0,0,172,172);
Expand Down
6 changes: 5 additions & 1 deletion sql/mob_skill_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,11 @@ INSERT INTO `mob_skill_lists` VALUES ('Mocking_Colibri',412,1699);
INSERT INTO `mob_skill_lists` VALUES ('Mocking_Colibri',412,1700);
INSERT INTO `mob_skill_lists` VALUES ('Mocking_Colibri',412,1701);
INSERT INTO `mob_skill_lists` VALUES ('Mocking_Colibri',412,1702);
-- 413 to 435: free
INSERT INTO `mob_skill_lists` VALUES ('Phantom_Puk',413,1720);
INSERT INTO `mob_skill_lists` VALUES ('Phantom_Puk',413,1721);
INSERT INTO `mob_skill_lists` VALUES ('Phantom_Puk',413,1723);
INSERT INTO `mob_skill_lists` VALUES ('Phantom_Puk',413,1724);
-- 414 to 435: free
INSERT INTO `mob_skill_lists` VALUES ('Bloodlapper',436,2162);
INSERT INTO `mob_skill_lists` VALUES ('Ghillie_Dhu',437,685);
INSERT INTO `mob_skill_lists` VALUES ('Highlander_Lizard',438,371);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_skills.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ INSERT INTO `mob_skills` VALUES (1970,1344,'eclosion',0,7.0,4000,0,1,0,0,0,0,0,0
INSERT INTO `mob_skills` VALUES (1977,1164,'deathgnash',0,7.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (1978,1165,'abominable_belch',1,16.0,2000,1500,4,0,0,0,0,0,0);
-- INSERT INTO `mob_skills` VALUES (1979,1723,'.',0,7.0,2000,1500,4,0,0,0,0,0,0);
-- INSERT INTO `mob_skills` VALUES (1980,1724,'boreas_mantle',0,7.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (1980,1197,'boreas_mantle',0,7.0,2000,1500,1,0,0,0,0,0,0);
-- INSERT INTO `mob_skills` VALUES (1981,1725,'.',0,7.0,2000,1500,4,0,0,0,0,0,0);
-- INSERT INTO `mob_skills` VALUES (1982,1726,'nullifying_dropkick',0,7.0,2000,1500,4,0,0,0,0,0,0);
-- INSERT INTO `mob_skills` VALUES (1983,1727,'auroral_uppercut',0,7.0,2000,1500,4,0,0,0,0,0,0);
Expand Down
Loading

0 comments on commit bbbc4c6

Please sign in to comment.