Does anyone know how to do this?

Started by greenmagic469, Aug 18, 2015, 10:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

greenmagic469

Hey guys,

I have a problem I'm trying to solve.

I want to make it so that on certain maps, random monsters from dead branch/poring box will be spawned, so I used this line of code:

prt_fild08,0,0,0,0,   monster -1,3,7200000,3600000,0

This SHOULD make 3 random monsters from the Dead Branch database spawn randomly in pront field 8. I see nothing wrong with this script. I've also tried it using a monster name, but it doesn't seem to make a difference.

I'm racking my brain trying to figure this out- PLEASE, does anyone know how to make this work? All I'm trying to do is make it so that certain monsters I put into the DB database will spawn randomly, and there doesn't seem to be any reason this shouldn't work, but it won't. Is there a setting or file I'm overlooking? Any help is greatly appreciated, thank you.

Terpsichore

#1
-1 ID value is used in actual scripts, not the spawn files.

You need to add a spawn script for this to work and there are many ways to handle it, if you want to take a look at some existing ones, you can check lhz_dun, nifelheim spawn files or any instance script.

Here's something extremely simple I just made for you;


prt_fild08,0,0,0 script prt_fild08_rspawn -1,{
OnInit:
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead";
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead2";
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead3";
end;
OnMyMobDead:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead";
end;
OnMyMobDead2:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead2";
end;
OnMyMobDead3:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead3";
end;
}


Just add this at the bottom of prontera.txt spawn file, change "sleep 5000;" to any amount you want in milisecond, this is the time it takes for mob to respawn after being killed.
"--en--" in name field will give the mob its iRO name from mob_db, this is the second name after Aegis one, for example; "1002,PORING,Poring,Poring," so you might want to correct some names as not all of them are correct by default.

greenmagic469

Quote from: Terpsichore on Aug 18, 2015, 01:26 PM
-1 ID value is used in actual scripts, not the spawn files.

You need a add a spawn script for this to work and there are many ways to handle it, if you want to take a look at some existing ones, you can check lhz_dun, nifelheim spawn files or any instance script.

Here's something extremely simple I just made for you;


prt_fild08,0,0,0 script prt_fild08_rspawn -1,{
OnInit:
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead";
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead2";
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead3";
end;
OnMyMobDead:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead";
end;
OnMyMobDead2:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead2";
end;
OnMyMobDead3:
sleep 5000;
monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead3";
end;
}


Just add this at the bottom of prontera.txt spawn file, change "sleep 5000;" to any amount you want in milisecond, this is the time it takes for mob to respawn after being killed.
"--en--" in name field will give the mob its iRO name from mob_db, this is the second name after Aegis one, for example; "1002,PORING,Poring,Poring," so you might want to correct some names as not all of them are correct by default.

THANK YOU!

I've been searching high and low for this information and couldn't find it anywhere. This makes a lot more sense now. I really appreciate the help and the time you took for the script.

One question, is there a way to specify an event label with this? I'm trying to get my mobs to attack other mobs, which is normally possible using the standard spawn script but I'm not saying a way to specify the event label with this script. Either way, this is a huge help, thank you.

Terpsichore

You just need to add the AI tag:


monster "prt_fild08",0,0,"--en--",.-1,1,"prt_fild08_rspawn"+"::OnMyMobDead",0,1;


Note that they won't attack other mobs summoned through this script but will run around around popping Porings. They also won't retalliate against players.

Triper

I know that this is already resolved but in the future remember that this isn't a section to post questions related to coding, it's just a place to share work already done.

In the future use the proper forums [eathena, rathena, hercules, etc] for that because users there can you give better, faster and proper help with stuff like this.