Sylfeyn Posted March 21 Posted March 21 (edited) I'm trying to make the summoned Marine Sphere immediately cast Self Destruction upon spawning. What's the simplest way to achieve this, without affecting naturally spawned Marine Spheres? Edited March 21 by Sylfeyn additional info Quote
0 Sylfeyn Posted March 21 Author Posted March 21 Okay the simplest form was to create a separate mob based on Marine Sphere and edit the relevant source files to use its mob id instead of the original marine sphere, then configure the skill in mob_skill_db.txt with condition onspawn Quote
0 Frost Diver Posted March 22 Posted March 22 22 hours ago, Sylfeyn said: Okay the simplest form was to create a separate mob based on Marine Sphere and edit the relevant source files to use its mob id instead of the original marine sphere, then configure the skill in mob_skill_db.txt with condition onspawn which source files to edit to use different mob id? Quote
0 Sylfeyn Posted March 22 Author Posted March 22 (edited) 1 hour ago, Frost Diver said: which source files to edit to use different mob id? I created a mob with id 30000 and AegieName G_MARINE_SPHERE in db/import/mob_db.yml all other stats copied from the original Then I added this to db/import/mob_avail.yml to assign it a sprite: Body: - Mob: G_MARINE_SPHERE Sprite: MARINE_SPHERE In db/import/mob_skill_db.txt I added: 30000,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,3500,0,yes,self,onspawn,,,,,,,, In skill.cpp: case AM_SPHEREMINE: case AM_CANNIBALIZE: { int32 summons[5] = { MOBID_G_MANDRAGORA, MOBID_G_HYDRA, MOBID_G_FLORA, MOBID_G_PARASITE, MOBID_G_GEOGRAPHER }; int32 class_ = skill_id==AM_SPHEREMINE?MOBID_MARINE_SPHERE:summons[skill_lv-1]; enum mob_ai ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA; struct mob_data *md; I changed MOBID_MARINE_SPHERE to MOBID_G_MARINE_SPHERE. Finally in mob.hpp: enum MOBID { MOBID_PORING = 1002, MOBID_RED_PLANT = 1078, MOBID_BLUE_PLANT, MOBID_GREEN_PLANT, MOBID_YELLOW_PLANT, MOBID_WHITE_PLANT, MOBID_SHINING_PLANT, MOBID_BLACK_MUSHROOM = 1084, MOBID_MARINE_SPHERE = 1142, MOBID_EMPERIUM = 1288, MOBID_G_PARASITE = 1555, MOBID_G_FLORA = 1575, MOBID_G_HYDRA = 1579, MOBID_G_MANDRAGORA = 1589, MOBID_G_GEOGRAPHER = 1590, MOBID_GUARDIAN_STONE1 = 1907, MOBID_GUARDIAN_STONE2, MOBID_SILVERSNIPER = 2042, MOBID_MAGICDECOY_FIRE, MOBID_MAGICDECOY_WATER, MOBID_MAGICDECOY_EARTH, MOBID_MAGICDECOY_WIND, MOBID_ZANZOU = 2308, MOBID_S_HORNET = 2158, MOBID_S_GIANT_HORNET, MOBID_S_LUCIOLA_VESPA, MOBID_GUILD_SKILL_FLAG = 20269, MOBID_ABR_BATTLE_WARIOR = 20834, MOBID_ABR_DUAL_CANNON, MOBID_ABR_MOTHER_NET, MOBID_ABR_INFINITY, MOBID_BIONIC_WOODENWARRIOR = 20848, MOBID_BIONIC_WOODEN_FAIRY, MOBID_BIONIC_CREEPER, MOBID_BIONIC_HELLTREE, }; I added MOBID_G_MARINE_SPHERE = 30000, into this enum I think that's it. Edited March 22 by Sylfeyn mob.hpp instead of skill.hpp 1 Quote
0 Frost Diver Posted March 23 Posted March 23 7 hours ago, Sylfeyn said: I created a mob with id 30000 and AegieName G_MARINE_SPHERE in db/import/mob_db.yml all other stats copied from the original Then I added this to db/import/mob_avail.yml to assign it a sprite: Body: - Mob: G_MARINE_SPHERE Sprite: MARINE_SPHERE In db/import/mob_skill_db.txt I added: 30000,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,3500,0,yes,self,onspawn,,,,,,,, In skill.cpp: case AM_SPHEREMINE: case AM_CANNIBALIZE: { int32 summons[5] = { MOBID_G_MANDRAGORA, MOBID_G_HYDRA, MOBID_G_FLORA, MOBID_G_PARASITE, MOBID_G_GEOGRAPHER }; int32 class_ = skill_id==AM_SPHEREMINE?MOBID_MARINE_SPHERE:summons[skill_lv-1]; enum mob_ai ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA; struct mob_data *md; I changed MOBID_MARINE_SPHERE to MOBID_G_MARINE_SPHERE. Finally in mob.hpp: enum MOBID { MOBID_PORING = 1002, MOBID_RED_PLANT = 1078, MOBID_BLUE_PLANT, MOBID_GREEN_PLANT, MOBID_YELLOW_PLANT, MOBID_WHITE_PLANT, MOBID_SHINING_PLANT, MOBID_BLACK_MUSHROOM = 1084, MOBID_MARINE_SPHERE = 1142, MOBID_EMPERIUM = 1288, MOBID_G_PARASITE = 1555, MOBID_G_FLORA = 1575, MOBID_G_HYDRA = 1579, MOBID_G_MANDRAGORA = 1589, MOBID_G_GEOGRAPHER = 1590, MOBID_GUARDIAN_STONE1 = 1907, MOBID_GUARDIAN_STONE2, MOBID_SILVERSNIPER = 2042, MOBID_MAGICDECOY_FIRE, MOBID_MAGICDECOY_WATER, MOBID_MAGICDECOY_EARTH, MOBID_MAGICDECOY_WIND, MOBID_ZANZOU = 2308, MOBID_S_HORNET = 2158, MOBID_S_GIANT_HORNET, MOBID_S_LUCIOLA_VESPA, MOBID_GUILD_SKILL_FLAG = 20269, MOBID_ABR_BATTLE_WARIOR = 20834, MOBID_ABR_DUAL_CANNON, MOBID_ABR_MOTHER_NET, MOBID_ABR_INFINITY, MOBID_BIONIC_WOODENWARRIOR = 20848, MOBID_BIONIC_WOODEN_FAIRY, MOBID_BIONIC_CREEPER, MOBID_BIONIC_HELLTREE, }; I added MOBID_G_MARINE_SPHERE = 30000, into this enum I think that's it. ahh no wonder i got error. i didn't modify the mob.hpp file. thanks mate. but, 1 problem is, onspawn seems not working. when i spawned, it didn't cast the self destruction immediately. when i hit then only it will cast the skill. did yours working? Quote
0 Sylfeyn Posted March 23 Author Posted March 23 Yeah, mine is working. Check your db/import/mob_skill_db.txt though and make sure you have a blank newline after the 30000,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,3500,0,yes,self,onspawn,,,,,,,, line I remember the first time I saw an error in one of the servers when loading that file because it didn't count the correct number of arguments. Adding a new line made it work correctly. Quote
0 Frost Diver Posted March 24 Posted March 24 On 3/23/2025 at 6:50 PM, Sylfeyn said: Yeah, mine is working. Check your db/import/mob_skill_db.txt though and make sure you have a blank newline after the 30000,Marine Sphere@NPC_SELFDESTRUCTION,idle,173,1,10000,3500,0,yes,self,onspawn,,,,,,,, line I remember the first time I saw an error in one of the servers when loading that file because it didn't count the correct number of arguments. Adding a new line made it work correctly. yup, i did create a blank newline in the mob_skill_db.txt. no errors in the emulator. but somehow, i managed to make it work after recompile it again. weird, but got mine working now. thanks mate for the guide ^_^ Quote
Question
Sylfeyn
I'm trying to make the summoned Marine Sphere immediately cast Self Destruction upon spawning. What's the simplest way to achieve this, without affecting naturally spawned Marine Spheres?
Edited by Sylfeynadditional info
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.