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!

[Help] Adding other selections to this srb npc (gmitem)

Initiate Mage
Joined
Jan 9, 2013
Messages
28
Reaction score
0
It goes all the way up until the status 4, when you select the equip nothing happens. What have i done wrong? Thanks
Code:
/**
By JarrYD
**/
var status = 0;
var selected = 1;


function start() {
    status = -1;
    action(1, 0, 0);
}
function action(mode, type, selection) {
    selected = selection;
    if (mode < 1)
        cm.dispose();
    else {
        if (mode == 1)
            status++;
        else
            status--;
        
        if (status == 0) {
cm.sendYesNo("Welcome to the SRB NPC. You need 30K of each stat (STR, DEX, INT, LUK) to do an SRB. Would you like a description of the SRB System?");
} else if (status == 1) {
cm.sendNext("#kThere are 4 SRB Types and each SRB will reduce all your stats by 30K and give you 1 SRB Point:\r\n#bSRB 1: The most basic SRB. You can choose an item to set to 10K of a chosen stat (STR, INT, DEX, LUK). This will take 1 Vote Points to do. You loose no SRB Points for this.\r\n#gSRB 2: The next level of SRB. This lets you set a chosen stat to 20K. This will take 2 Vote Points to do. You will need at least 4 SRB Points to do this and this will consume 2 SRB Points.\r\n#dSRB 3: The 3rd level of SRB. This lets you set a chosen stat to 30K. This will take 2 Vote Points to do. You will need at least 16 SRB Points to do this, and it will consume 8 SRB Points.\r\n#rSRB 4: The last and best level of SRB. This lets you set all stats (STR, INT, DEX, LUK) of an item to 30K This will take 4 Vote Points to do. You will need at least 64 SRB Points to do this, and this will consume 32 SRB Points.");
} else if (status == 2) {
cm.sendSimple("What SRB do you want to choose?#k\r\n#bSRB 1:#L0#STR Item#l\r\n#L1#DEX Item#l\r\n#L2#INT Item#l\r\n#L3#LUK Item#l\r\n#gSRB 2:#L4#STR Item#l\r\n#L5#DEX Item#l\r\n#L6#INT Item#l\r\n#L7#LUK Item#l\r\n#dSRB 3:#L8#STR Item#l\r\n#L9#DEX Item#l\r\n#L10#INT Item#l\r\n#L11#LUK Item#l\r\n#rSRB 4:#L12#STR Item#l\r\n#L13#DEX Item#l\r\n#L14#INT Item#l\r\n#L15#LUK Item#l");
} else if (status == 3) {
if (selection == 0) {
if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
            cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
} else {
cm.sendOk("You do not have the required stats or items.");
cm.dispose();
} 
}
else if (selection == 1) {
if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
            cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
} else {
cm.sendOk("You do not have the required stats or items.");
cm.dispose();
} 
} 
        } else if (status == 4) {
if (selection == 0) { 
            cm.MakeSRB1STR(selected);
            cm.getPlayer().setStr(4);
            cm.getPlayer().setDex(4);
            cm.getPlayer().setInt(4);
            cm.getPlayer().setLuk(4);
            cm.reloadChar();
            cm.dispose();
            
        
} 
        else if (selection == 1) { 
            cm.MakeSRB1DEX(selected);
            cm.getPlayer().setStr(4);
            cm.getPlayer().setDex(4);
            cm.getPlayer().setInt(4);
            cm.getPlayer().setLuk(4);
            cm.reloadChar();
            cm.dispose();     
        
}  
}


    }
}
 
Last edited:
Back
Top