[Add-on] All In One Shop

Status
Not open for further replies.
Joined
Oct 15, 2008
Messages
2,898
Reaction score
1,130
So, I've completely redone this again -_- Made it a tad easier to edit (provided you actually know how to read NPCs at least. The SQL is also shorter, by about 300kb, so that means faster executing rather than sitting there for 5-10 minutes. Uhmmm... yea... anyways... here is the script.

PHP:
/**
 * Created by : Shawn of RaGEZONE
 **/
var name = "#b#eTesting#k#n";
var talk = "What would you like to browse?\r\n\r\n";
var menu = ["Common","Warrior","Magician","Archer","Thief","Pirate","NX Items","ETC"];
var options = [
/*Common*/    ["Hats","Earrings","Necklaces and Face Accessories","Capes","Overalls","Gloves","Shields","Shoes","Maple Weapons","Level 0 Weapons"], 
/*Warrior*/    ["Hats","Tops","Bottoms","Overalls","Gloves","Shields","Shoes","1H Axes","2H Axes","1H BWs","2H BWs","1H Swords","2H Swords","Spears","Pole Arms"], 
/*Mage*/    ["Hats","Overalls","Gloves","Shields","Shoes","Wands","Staffs"], 
/*Archer*/    ["Hats","Overalls","Gloves","Shoes","Bows","CrossBows","Arrows"], 
/*Thief*/    ["Hats","Tops","Bottoms","Overalls","Gloves","Shields","Shoes","Daggers","Claws","Throwing Stars"], 
/*Pirate*/    ["Hats","Overalls","Gloves","Shoes","Weapons","Bullets and Capsules"], 
/*NX*/        ["Hats","Earrings","Face","Tops","Bottoms","Capes","Overalls","Rings","Gloves","Shields","Shoes","Weapons","Throwing Stars","Pets","Pet Misc","Emotion","Effects","Accessories","Player FM Stores"], 
/*ETC*/        ["Messengers","Super Megaphones, Gachapon Tickets, Rocks, and Morphs","Boss Pieces","Buffs and Potions","Scrolls","Summoning Sacks","Chairs","Mounts"]];
var colors = ["#g","#r","#d","#b"];
var rand = Math.floor(Math.random()*4);
var rand2 = Math.ceil(Math.floor(Math.random()*4));
var c;
npc = 0;
function start() {
    var text = "Hello #e#d#h ##k#n. I am the All in One seller of "+name+". "+talk+"";
    for (var z = 0; z < menu.length; z++)
        text+= "#L"+z+"##e"+colors[rand]+""+menu[z]+"#l\r\n";
    cm.sendSimple(text);
}
function action(m,t,s) {
    if (m != 1) {
        cm.dispose();
        return;
    }else{
        npc++;
    }
    if (npc == 1) {
        c = s;
        for (var i = 0; i < options[c].length; i++)
            talk+="#L"+i+"##e"+colors[rand2]+""+options[c][i]+"#k#l\r\n";
        cm.sendSimple(talk);
    } else if (npc == 2) {
        cm.openShop(6000+((c*100)+s));
        cm.dispose();
    }
}

And here are the downloads with the full SQLs, fixed.






I will not include pictures because I'm just that lazy -_- Anyways, this will work. If it doesn't, it's because you either have a fugged up openShop method or you don't have it at all... but wait!!! *da da da daaaaaaaaaa* (sorry... had a Superman moment :closedeyes:)

Open up your source/repack and open the src folder. Go to scripting, then open npc. Once there, open NPCConversationManager.java. Place this little snippet inside anywhere.
PHP:
public void openShop(int id) {
	MapleShopFactory.getInstance().getShop(id).sendShop(getClient());
}

Then save, open Netbeans (or w/e compiler you use), compile and replace your dist file. Start the server and you're ready to go... If you are still confused, I suggest you read the "READ ME!!!" that comes in the folder.

EDIT: Updated as of 9/8/10. Tested and working fully and look!!! Pretty random colors for each time you talk to it!!! Yay!!! -_-

EDIT2: Updated again with a fixed SQL, and uploaded to multiple sites for downloading... I don't want to hear anyone complain about not being able to download it -_-
 
Last edited:
Re: [Release] All In One Shop

i get this error when i run the sql file

Code:
Script line: 1	You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= 5081' at line 1
 
Re: [Release] All In One Shop

i get this error when i run the sql file

Code:
Script line: 1	You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= 5081' at line 1

i am not sure this will help but try this :
Code:
DELETE FROM `shops` WHERE `shopid` >= 5000 AND `shopid` <= 5081;
 
Last edited:
Re: [Release] All In One Shop

i got it to work but the npc just tells me that he is the all in one seller and when you click next nothing happens
 
Re: [Release] All In One Shop

i get this error when i run the sql file

Code:
Script line: 1	You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= 5081' at line 1

Error in MySQL.

i got it to work but the npc just tells me that he is the all in one seller and when you click next nothing happens

Same here ):

It's fixed now. For some reason with the SQL, even though the command was correct, it wouldn't execute. So I had to copy/paste from a previous one and edit the shop id's. Still makes no sense why it wasn't working though since it's the same exact sql command lol. It is working 100% now though. I even ran the sql 10 times to be sure it works.
 
Re: [Release] All In One Shop

It's fixed now. For some reason with the SQL, even though the command was correct, it wouldn't execute. So I had to copy/paste from a previous one and edit the shop id's. Still makes no sense why it wasn't working though since it's the same exact sql command lol. It is working 100% now though. I even ran the sql 10 times to be sure it works.

What if it doesn't work for me?
 
Re: [Release] All In One Shop

What if it doesn't work for me?

If it don't... which I highly doubt it won't since it worked 10 times in a row for me.... take out the
Code:
/* Deletes shops in that range */
DELETE FROM `shops` WHERE `shopid` >= 5000 AND `shopid` <= 5081;

/* Deletes shop items in those shops */
DELETE FROM `shopitems` WHERE `shopid` >= 5000 AND `shopid` <= 5081;

and execute them one at a time. Then execute the all in one.sql

If the NPC doesn't work, it's your source/repack that's making it not work because it works 100%.
 
Re: [Release] All In One Shop

Hey it dont work for me i dont know if i did something wrong
look
I put the script in a npc
I Executed the sql
i started my server, clicked the npc and works good but when i go to the store, like theif shop or any shop its empty... i just see the chineese guy storekeeper that sells nothing... help?
 
Re: [Release] All In One Shop

Hey it dont work for me i dont know if i did something wrong
look
I put the script in a npc
I Executed the sql
i started my server, clicked the npc and works good but when i go to the store, like theif shop or any shop its empty... i just see the chineese guy storekeeper that sells nothing... help?

run the sql script again and make sure it gets no errors
 
Status
Not open for further replies.
Back