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!

[NPC] Mob Spawner, shortened

bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,898
Reaction score
1,129
Because I want to increase my e-penis I guess...

PHP:
menu = ["Papulatus Clock","Headless Horseman","Black Crow","Anego","Rooster","BigFoot","MushMom"];
mob = [8500001,9400549,9400014,9400121,9600001,9400575,9500124];
hp = [23000000,3500000,35000000,75000000,340,32000000,20000];
exp = [596000,300000,1780000,3900000,33,2660000,1200];
pServ = "WRITE SERVER NAME HERE";
status = 0;

function start() {
    if (cm.getPlayer().getMap().getMonsterCount() > 0)
        cm.sendOk("Sorry, there are some mobs already spawned. Kill them first.");
        cm.dispose();
    else{
        cm.sendNext("I summon Bosses for #b"+pServ+"#k. I summon 10 monsters at a time for free.");
    }
}

function action(m,t,s) {
    if (m > 0)
        status++;
    else{
        cm.dispose();
        return;
    }
    if (status == 1) {
        talk = "Please remember I will summon 10.\r\n\r\n";
        for (var i = 0; i < menu.length; i++)
            talk += "#L"+i+"#"+menu[i]+"#l\r\n";
        cm.sendSimple(talk + "#L7#Cleardrops#l\r\n#L8#Kill All Monsters#l");
    } else if (status == 2) {
        if (s == 7) {
            cm.cleardrops();
        } else if (s == 8) {
            cm.killAllMonsters(true);
        }else{
            cm.summonMob(mob[s],hp[s],exp[s],10);
        }
        cm.dispose();
    }
}

PHP:
public int getMonsterCount() {
                List<MapleMapObject> monsters = getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
                return monsters.size();
        }
PHP:
public void summonMob(int mobid, int customHP, int customEXP, int amount) {
        MapleMonsterStats newStats = new MapleMonsterStats();
        if (customHP > 0) {
            newStats.setHp(customHP);
        }
        if (customEXP >= 0) {
            newStats.setExp(customEXP);
        }
        if (amount <= 1) {
            MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
            npcmob.setOverrideStats(newStats);
            npcmob.setHp(npcmob.getMaxHp());
            getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, getPlayer().getPosition());
        } else {
            for (int i = 0; i < amount; i++) {
                MapleMonster npcmob = MapleLifeFactory.getMonster(mobid);
                npcmob.setOverrideStats(newStats);
                npcmob.setHp(npcmob.getMaxHp());
                getPlayer().getMap().spawnMonsterOnGroudBelow(npcmob, getPlayer().getPosition());
            }
        }
    }
PHP:
public void cleardrops() {
    MapleMonsterInformationProvider.getInstance().clearDrops();
    }
PHP:
public void killAllMonsters(int mapid) {
           MapleMap map = c.getChannelServer().getMapFactory().getMap(mapid);
           map.killAllMonsters(false); // No drop.
       }

If you are missing something, or would like to see the "original", go to this thread: http://forum.ragezone.com/f427/boss-spawner-monster-spawner-631062/

Off Topic: I am fully prepared for the countless posts saying "OMGZ WEZ ALRE4DEY HAVE DIZ."... Flame away, I'm bored :(


EDIT: To make it more "noob" friendly, let me explain how to edit it.

PHP:
menu = ["Papulatus Clock","Headless Horseman","Black Crow","Anego","Rooster","BigFoot","MushMom"];
mob = [8500001,9400549,9400014,9400121,9600001,9400575,9500124];
hp = [23000000,3500000,35000000,75000000,340,32000000,20000];
exp = [596000,300000,1780000,3900000,33,2660000,1200];

In a short explanation, the first selection in the menu that shows up would be Papulatus. 8500001 in the mob array is Papulatus' ID. 23000000 in the hp array is how much HP he'll have when spawned. 5960000 in the exp array is how much exp he will give. NOTE: You multiple the exp number by your exp rate to find the actual amount.

Another example. The 3rd selection is Black Crow. 9400014 in the mob array is Black Crows' ID. 35000000 in the hp array is the amount of HP he will have when spawned. 1780000 in the exp array is how much exp he will have.

So to sum it up, basically put them in the order they will appear. First choice goes first, second goes second, etc etc. It's very easy to understand...
 
Last edited:
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Re: Mob Spawner, shortened

nice i was looking for the method of mobcount xD
 
bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,898
Reaction score
1,129
Re: Mob Spawner, shortened

I was bored and helped someone with their NPC with this exact one, so figured hey... why not... I've seen worse. :)
 
Supreme Arcanarch
Loyal Member
Joined
Oct 18, 2009
Messages
914
Reaction score
335
Re: Mob Spawner, shortened

I loled at this, "MapleBreakMS". Anyways Good Job Shawn (right?)
 
Supreme Arcanarch
Loyal Member
Joined
Oct 18, 2009
Messages
914
Reaction score
335
Re: Mob Spawner, shortened

Looks 242354347543563564456 times better then mine, good job again.
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Re: Mob Spawner, shortened

Wait, are you telling us you can't even make that. ow wow :(
well i never played with mobs before and i haven't been in development for awhile now i just started again, lawl
 
Newbie Spellweaver
Joined
Jul 23, 2008
Messages
31
Reaction score
0
Re: Mob Spawner, shortened

Not to be noob but, it's divided into 5 codes, where do all of them go?
Also, bookmarked for later :)
 
Experienced Elementalist
Joined
Dec 12, 2009
Messages
248
Reaction score
18
Re: Mob Spawner, shortened

well i never played with mobs before and i haven't been in development for awhile now i just started again, lawl

You can get it from the !killall command.
you know how it shows
"xxx mobs has been killed"
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Re: Mob Spawner, shortened

You can get it from the !killall command.
you know how it shows
"xxx mobs has been killed"
lool o-o didn't know that Lawl I've been into web developing more then coding stuff o-o
 
Newbie Spellweaver
Joined
Jul 23, 2008
Messages
31
Reaction score
0
Re: Mob Spawner, shortened

Where would I add

PHP:
public int getMonsterCount() {
                List<MapleMapObject> monsters = getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
                return monsters.size();
        }

Thanks for you help!
 
Back
Top