Would you like to react to this message? Create an account in a few clicks or log in to continue.

NO SQL ALL in one shops

Go down

NO SQL ALL in one shops Empty NO SQL ALL in one shops

投稿 by 構築さん 2014-05-31, 17:53

NPCSCRIPT

Code:
var status = 0;

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status ==0){
cm.sendSimple("ALL in one shopへようこそ \r\n\
\r\n\
#L0#Weapons\r\n\
#L1051#Overalls\r\n\
#L1082#Gloves\r\n\
#L1002#Hats\r\n\
#L1092#Shields\r\n\
#L1041#Tops\r\n\
#L1061#Bottoms\r\n\
#L1012#Face Accessories\r\n\
#L1032#Earrings\r\n\
#L1#Scrolls\r\n\
#L2002#Potions (Page 1)\r\n\
#L2050#Potions (Page 2)\r\n\
#L2060#Bow Arrows\r\n\
#L2061#CrossBow Arrows\r\n\
#L2070#Stars");
} else if (status == 1){
if (selection == 0){
cm.sendSimple("#L1302#One Handed Sword\r\n\
#L1312#One Handed Axe\r\n\
#L1322#One Handed Blunt Weapon\r\n\
#L1402#Two Handed Sword\r\n\
#L1412#Two Handed Axe\r\n\
#L1422#Two handed Blunt Weapon\r\n\
#L1432#Spear\r\n\
#L1442#Polearm\r\n\
#L1332#Dagger\r\n\
#L1372#Wand\r\n\
#L1382#Staff\r\n\
#L1452#Bow\r\n\
#L1462#CrossBow\r\n\
#L1472#Claw\r\n\
#L1482#Knuckle\r\n\
#L1492#Gun")
}else if (selection == 1){
cm.sendSimple("#L2040#Scrolls for Clothing (Page 1)\r\n\
#L2041#Scrolls for Clothing (Page 2)\r\n\
#L2043#Scrolls for Weapons (Page 1)\r\n\
#L2044#Scrolls for Weapons (Page 2)\r\n\
#L2048#Scrolls for Pet items\r\n\
#L2049#Other Scrolls");
}else{
cm.openShopById(selection);
cm.dispose();
}
}else if (status == 2){
cm.openShopById(selection);
cm.dispose();
}
}
}

NPCConversationManager.java

Code:
public void openShopById(int id){
int[] dummy = {};
MapleShopFactory.getInstance().getShopById(id, dummy ).sendShop(getClient());
}

MapleShopFactory.java

Code:
public MapleShop getShopById(int id, int[] Exceptions){
if (shops.containsKey(id)){
return shops.get(id);
}
return loadShopById(id, true, Exceptions);
}
public void loadAIOShops(int[] Exceptions){
int j = 0;
int shopList[] = {1051,1082,1001,1092,1041,1061,1012,1032,2002,2050,2060,2061,2070,1302,1312,1322,1402,1412,1422,1702,1442,1332,1372,1382,1452,1462,1472,1482,1492,2040,2041,2043,2044,2048,2049,1432};
for (int i = 0; i<shopList.length; i++){
j++;
loadShopById(shopList, true, Exceptions);
System.out.print((char) 178);
}
System.out.println(" ::" + j + " AIO Shops Loaded");
}

MapleShop.java

Code:
public MapleShop getShopById(int id, int[] Exceptions){
if (shops.containsKey(id)){
return shops.get(id);
}
return loadShopById(id, true, Exceptions);
}

Code:
public static MapleShop createById(int id, int[] Exceptions){
MapleShop ret = new MapleShop(id, 9030000);
try{
for (Pair<Integer> itemPair: MapleItemInformationProvider.getInstance().getAllItems()){
if (itemPair.getLeft() / 1000 == id){
boolean isException = false;
for (int i = 0; i<Exceptions.length; i++){
if (itemPair.getLeft() == Exceptions)
isException = true;
}
if (!isException){
if (!MapleItemInformationProvider.getInstance().isCash(itemPair.getLeft())){
try{
ret.addItem(new MapleShopItem((short) 10000, itemPair.getLeft(), 1, 0));
}catch (Exception e){
http://System.out.print("Error Loading Shop item : " + itemPair.getLeft() + "\r\n");
}
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
return ret;
}

ServerConstants.java

Code:
public static int[] AIO_EXCEPTIONS = {};

ChannelServer.java

Code:
MapleShopFactory.getInstance().loadAIOShops(ServerConstants.AIO_EXCEPTIONS);
構築さん
構築さん
Admin

Posts : 193
Join date : 2014/05/29

https://maplescience.forumjap.com

トップに戻る Go down

トップに戻る


 
Permissions in this forum:
返信投稿: 不可