[Help] Boss Spawner

Results 1 to 4 of 4
  1. #1
    Apprentice iSmite is offline
    MemberRank
    Dec 2012 Join Date
    8Posts

    [Help] Boss Spawner

    i found this boss spawner and it is supposed to take 100m every time someone spawns a boss but it will still spawn a boss if they dont have money...

    Code:
    /* Marat
    boss spawn npc
    */
    var status = -1;
    var x = 0
    var mobs = Array();
    var boss = Array(8800000, 8800100, 9400900, 8810026, 8810130, 8500002, 8820000, 8180001, 8180000, 8840000, 9420547, 9420542, 8850011, 9420067);
    
    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 BOSS SPWNER NPC! I can help you train by spawning varius different types of bosses.\r\n";
            var ttalk = "Dont forget to kill the bosses!\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. It will cost 100m to spawn, so choose carefully.:\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);
    	    cm.gainMeso(-100000000);
    		
    	
    
            
    
        
        } 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();
    
            }
        
    }
    }
    Last edited by iSmite; 22-01-13 at 04:36 PM.


  2. #2
    Moongran Saii is offline
    MemberRank
    Jan 2012 Join Date
    510Posts

    Re: [Help] Boss Spawner

    your code is really messy, you should arrange it because its hard to read.
    anyways you should check if the player has the mesos before using gainMeso.
    if not, dispose or something.

    something like this
    if(cm.getMeso() < 100000000) {
    cm.sendOk("You don't have enough mesos");
    cm.dispose();
    }
    else {
    cm.gainMeso(-100000000);
    spawn mob
    }
    Last edited by Saii; 22-01-13 at 05:15 PM.

  3. #3
    Apprentice iSmite is offline
    MemberRank
    Dec 2012 Join Date
    8Posts

    Re: [Help] Boss Spawner

    i tryed that .... itll say imnot coded

    its fixed now, ty
    Last edited by iSmite; 22-01-13 at 05:22 PM.

  4. #4
    Ass > Tits Lapje is offline
    MemberRank
    Feb 2009 Join Date
    nullLocation
    1,879Posts

    Re: [Help] Boss Spawner

    Here, took out all the useless crap. This should spawn 15 bosses for 100m and take 100m from their inventory. They won't be able to spawn mobs without that 100m. Like n Rep please.

    PHP Code:
    /* Marat
    boss spawn npc
    */
    var status = -1;
    var 
    boss = Array(88000008800100940090088100268810130850000288200008180001818000088400009420547942054288500119420067);

    function 
    start()
    {
        
    action(100);
    }

    function 
    action(modetypeselection) {
        
    status++;
        if (
    mode != 1) {
            
    cm.dispose();
            return;
        }
        if (
    status == 0) {
            if (
    cm.haveMeso(100000000)) {
                var 
    text "Hello i am the BOSS SPWNER NPC! I can help you train by spawning varius different types of bosses.\r\n Please select a boss. It will cost 100m to spawn, so choose carefully.\r\n";
                
                for (var 
    0boss.Lenghti++)
                {
                    
    text += "\r\n#L" "##o" boss[i] + "##l";
                }
                
    text += "\r\n\r\nBe sure to kill any mobs still alive first.";
            } else {
                
    cm.sendOk("You don't have enough Mesos to use the Boss Spawner.");
                
    cm.dispose();
            }
        } else if (
    status == 1) {
            
    cm.spawnMob(boss[selection], 15);
            
    cm.dispose();
        }




Advertisement