Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Add-On]REALLY Advanced monster spawn NPC

for(alive>0){makeMoney()}
Loyal Member
Joined
Aug 1, 2006
Messages
357
Reaction score
68
Sup here is my monster spawning NPC. Really easy to modify.

Add to Mobs array and it will spawn 15 of the chosen mob
Add to Boss array and it will spawn 1 of the chosen mob
Fetches monster name from wz so only need to change Id's

Code:
/* Marat
boss spawn npc
*/
var status = -1;
var x = 0
var mobs = Array(210100, 1110100, 2230101, 5130107, 9410010, 6130101, 9400205, 8190003);
var boss = Array(8500001, 9400014, 8820001, 6300005, 9420546, 9410014, 8800002, 8810026);

function action(mode, type, selection) {
    if (mode == 1) {
    status++;
    } else {
    if (status == 2) {
        cm.sendNext("test");
    }
    status--;
    }
    if (status == 0) {
        var talk = "Hello i am the Fornax training NPC! I can help you train by spawning varius different types of monsters and bosses.\r\n";
        var ttalk = "Please select a training monster:\r\n";
        for(var t = 0; t < mobs.length; t++){
        ttalk += "#L"+ t +"##o"+ mobs[t] +"# x15#l\r\n";
        }
        var btalk = "\r\n Please select a boss:\r\n";
        for(var b = mobs.length; b < mobs.length + boss.length; b++){
        btalk += "#L"+ b +"##o"+ boss[b - mobs.length] +"##l\r\n";
        }
        talk += ttalk;
        talk += btalk;
        cm.sendSimple(talk);

        

    
    } else if (status == 1) {

       if(selection >= mobs.length){

        cm.spawnMob(boss[selection - mobs.length], 1, 0);

        cm.dispose();

        }

        else {
        for(var a = 0; a <= 15; a++){
        cm.spawnMob(mobs[selection], 1, 0);
        }

        cm.dispose();

        }
    
}
}

Thanks rm zero for helping me out with the last check.

Enjoy.

Note: This is coded to work with v82 CelinoSEA source. You might have to change around the cm.spawnMob parameters a bit to have the spawner work for your source.

Note#2: Remove world checks if you don't have multi world.

Update -- Removed world check
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Apr 10, 2009
Messages
91
Reaction score
195
Re: [Release]REALLY Advanced monster spawn NPC

Code:
/* Marat
boss spawn npc
*/
var status = -1;
var x = 0
var mobs = Array(210100, 1110100, 2230101, 5130107, 9410010, 6130101, 9400205, 8190003);
var boss = Array(8500001, 9400014, 8820001, 6300005, 9420546, 9410014, 8800002, 8810026);

function action(mode, type, selection) {
    if (mode == 1) {
    status++;
    } else {
    if (status == 2) {
        cm.sendNext("test");
    }
    status--;
    }
    if (status == 0) {
        if (cm.getWorld() == 6) {
        cm.sendNext("Sorry but i only spawn bosses in the Fornax world.");
        cm.dispose();
        } else if (cm.getWorld() == 5) {
        var talk = "Hello i am the Fornax training NPC! I can help you train by spawning varius different types of monsters and bosses.\r\n";
        var ttalk = "Please select a training monster:\r\n";
        for(var t = 0; t < mobs.length; t++){
        ttalk += "#L"+ t +"##o"+ mobs[t] +"# x15#l\r\n";
        }
        var btalk = "\r\n Please select a boss:\r\n";
        for(var b = mobs.length; b < mobs.length + boss.length; b++){
        btalk += "#L"+ b +"##o"+ boss[b - mobs.length] +"##l\r\n";
        }
        talk += ttalk;
        talk += btalk;
        cm.sendSimple(talk);

        }

    
    } else if (status == 1) {

       if(selection >= mobs.length){

        cm.spawnMob(boss[selection - mobs.length], 1, 0);

        cm.dispose();

        }

        else {
        for(var a = 0; a <= 15; a++){
        cm.spawnMob(mobs[selection], 1, 0);
        }

        cm.dispose();

        }
    
}
}



It's so advanced... it doesn't have a start() function.
 
Last edited:
Skilled Illusionist
Loyal Member
Joined
Dec 18, 2009
Messages
300
Reaction score
32
Re: [Release]REALLY Advanced monster spawn NPC

How's this REALLY advanced?
 
for(alive>0){makeMoney()}
Loyal Member
Joined
Aug 1, 2006
Messages
357
Reaction score
68
Re: [Release]REALLY Advanced monster spawn NPC

How's this REALLY advanced?

IDK i remember i saw a thread Advanced monster spawner or w/e o i made Really advanced.

The other one had 2 arrays, one for id, and in the second one u wud have to type in the name of the boss etc.

Well not that any of you need this, it has multiworld support, so if u dont want spawner in your lowrate world, but want one in your highrate world it does that.

I'm happy with how it works jam ids in a array and it adds selections without having to add second array for name and etc.
 
Skilled Illusionist
Joined
Jul 12, 2008
Messages
303
Reaction score
3
Re: [Release]REALLY Advanced monster spawn NPC

Its advance, lets just all believe him, at least he's trying unlike leechers and poop.
 
Junior Spellweaver
Joined
Sep 19, 2009
Messages
138
Reaction score
92
Re: [Release]REALLY Advanced monster spawn NPC


It's so advanced... it doesn't have a start() function.

start is unnecessary anyway, I got those removed in my source.
People using start are usually for those NPC with only 2 states.
 
Newbie Spellweaver
Joined
Jan 22, 2010
Messages
69
Reaction score
6
Re: [Release]REALLY Advanced monster spawn NPC

haters gun hate :p thanks for actually releasing something semi-useful unlike alot of the repeat offenders of hate comments :)
 
Custom Title Activated
Loyal Member
Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
Re: [Release]REALLY Advanced monster spawn NPC

It'd be awesome if the script was neater though.
 
bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,896
Reaction score
1,129
Re: [Release]REALLY Advanced monster spawn NPC

start is unnecessary anyway, I got those removed in my source.
People using start are usually for those NPC with only 2 states.

And here I was under the impression you knew about these kinds of things o_0

OnTopic: Nice job. Code could be cleaner but otherwise, good job.
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [Release]REALLY Advanced monster spawn NPC

*looks in CelinoSEA source*
Code:
    public final void spawnMob(final int id, final int x, final int y) {

*looks at your release*
Code:
cm.spawnMob(mobs[selection], 1, 0);

...nope, not advanced. Won't work for most maps. Your best bet is to use something relative to the NPC's position, or the player's if you want to be cruel.


...let's poke at your code even more.
Code:
var x = 0
useless variable
Code:
    if (mode == 1) {
    status++;
    } else {
    if (status == 2) {
        cm.sendNext("test");
    }
    status--;
    }
un-needed checks since you don't have any sendPrevNext/sendYesNo or anything like that, all you really need is a check for -1 mode (unless using Celino)
so you could just do:
Code:
if (mode == -1) {
     cm.dispose();
     return;
}
status++;
with 4 of those lines un-needed in Celino source.

Other than that, it could use much more cleaning up. Variables "btalk" and "ttalk" are useless when you already have a variable for talk. Lots of spacing is really unnecessary.

Mostly just someone happy they don't have to use a name array or pull it from WZ after I told them what #o[MOBID]# does...
 
Last edited:
for(alive>0){makeMoney()}
Loyal Member
Joined
Aug 1, 2006
Messages
357
Reaction score
68
Re: [Release]REALLY Advanced monster spawn NPC

*looks in CelinoSEA source*
Code:
    public final void spawnMob(final int id, final int x, final int y) {

*looks at your release*
Code:
cm.spawnMob(mobs[selection], 1, 0);

...nope, not advanced. Won't work for most maps. Your best bet is to use something relative to the NPC's position, or the player's if you want to be cruel.


...let's poke at your code even more.
Code:
var x = 0
useless variable
Code:
    if (mode == 1) {
    status++;
    } else {
    if (status == 2) {
        cm.sendNext("test");
    }
    status--;
    }
un-needed checks since you don't have any sendPrevNext/sendYesNo or anything like that, all you really need is a check for -1 mode (unless using Celino)
so you could just do:
Code:
if (mode == -1) {
     cm.dispose();
     return;
}
status++;
with 4 of those lines un-needed in Celino source.

Other than that, it could use much more cleaning up. Variables "btalk" and "ttalk" are useless when you already have a variable for talk. Lots of spacing is really unnecessary.

Mostly just someone happy they don't have to use a name array or pull it from WZ after I told them what #o[MOBID]# does...

Lol well the 1 for spawn place is made for free market, works in most maps, not hard to change.

The useless variable was supposed to be the position check but forgot about it rofl.
 
Newbie Spellweaver
Joined
Jun 7, 2010
Messages
8
Reaction score
0
Re: [Release]REALLY Advanced monster spawn NPC

great job man, i'm using it right now any its really good thanx for release, keep up the good work =d
 
Newbie Spellweaver
Joined
Oct 6, 2010
Messages
26
Reaction score
10
Re: [Release]REALLY Advanced monster spawn NPC

I'm sorry, but this doesn't qualify as 'REALLY advanced'.

Nice job with the script, but there were a couple (what I feel to be) unnecessary variables. Could do with some cleaning up. Although, if it serves it's purpose, the script isn't a huge deal. Good job
 
Last edited:
Newbie Spellweaver
Joined
Sep 25, 2010
Messages
98
Reaction score
8
Re: [Release]REALLY Advanced monster spawn NPC

Great Job but i dont understand how is this " ADVANCED " but yaa great release i guess
 
Supreme Arcanarch
Loyal Member
Joined
Oct 18, 2009
Messages
914
Reaction score
335
Re: [Release]REALLY Advanced monster spawn NPC

And here I was under the impression you knew about these kinds of things o_0

OnTopic: Nice job. Code could be cleaner but otherwise, good job.

Hmm arnt you going to make it shorter or something? Like you always do? :p
 
Back
Top