Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1


/**
* 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();
}
}


___________________________________________________________________________________
______________________________________________________________________________________





[Release] [NPC] All In One Shop

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 Code:
/**
* 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.

Spoiler:


[Release] [NPC] All In One Shop

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 Code:
/**
* 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.

Spoiler:

[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




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 )

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 Code:
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 -_-



Credits GO TO Shawn

View user profile

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum