KongXiang Admin
Posts : 34 BeEvil Point : 90 BeEvil Reputation : 0 Join date : 2009-12-10 Location : WHERE DO I LIVE? I DUN KNOW WHERE DO I LIVE?
| Subject: [Release]Exp Seller Thu Dec 10, 2009 9:12 am | |
| This Is The Code Of Exp Seller.Save This Npc Code As 9010011.js- Spoiler:
} function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (mode == 0 && URMS == 0) { cm.dispose(); return; } if (mode == 1) chickenms++; else chickenms--; if (chickenms == 0) { if (cm.itemQuantity(4001026) >= 50) { cm.sendOk("#fUI/UIWindow.img/QuestIcon/4/0#\r\nYou got 50 #i4001026#!\r\nI will give you some #fUI/UIWindow.img/QuestIcon/8/0#"); cm.gainItem(4001026, -50); cm.gainExp(75000); cm.dispose(); } else { cm.sendSimple("Hello #h #, Welcome to #rURMS!#k\r\nYou have this much Keys #B" + (cm.itemQuantity(4001026) * 2) + "#\r\nWhat do you want to do?\r\n#L1##bTrade 10k #fUI/UIWindow.img/QuestIcon/7/0# for 9k #fUI/UIWindow.img/QuestIcon/8/0#!#k#l\r\n\r\n#L2##bTrade 10k #fUI/UIWindow.img/QuestIcon/8/0# for 9k #fUI/UIWindow.img/QuestIcon/7/0#!#k#l\r\n\r\n#L3##bI want to choose how much Exp i get!#k#l\r\n#L4##eNothing really..#n#l"); } } else if (chickenms == 1) { if (selection == 1) { if (cm.getMeso() >= 10000 ) { cm.gainMeso(-10000); cm.gainExp(9000); cm.gainItem(4001026, 1); cm.dispose(); } else { cm.sendOk("You don't have enough #bMesos#k\r\nDon't scam me or I will use this on you! #s5001001#"); cm.dispose(); } } else if (selection == 2) { if (cm.getExp() >= 10000 ) { cm.gainMeso(9000); cm.gainExp(-10000); cm.gainItem(4001026, 1); cm.dispose(); } else { cm.sendOk("You don't have enough #bExp#k\r\nDon't scam me or I will use this on you! #s5001001#"); cm.dispose(); } } else if (selection == 3) { var prompt = "How much exp do you want?\r\n#rI'm fixed, there's no limit anymore!#k"; cm.sendGetText(prompt); } else { cm.sendOk("Oh. i see... Well then, have fun in #rURMS!#k"); cm.dispose(); } } else if (chickenms == 2) { qty = cm.getText(); cost = (qty * 2); cm.sendYesNo("Do you really want to pay " + cost + " mesos for " + qty + " Exp?"); } else if (chickenms == 3) { if(cm.getChar().isGM() == 1) { cm.gainExp(qty); cm.dispose(); } else { if (cm.getMeso() >= cost) { cm.gainMeso(-cost); cm.gainExp(qty); cm.dispose(); } else { cm.sendOk("You don't have enough #bMesos#k\r\nDon't scam me or I will use this on you! #s5001001#"); cm.dispose(); } } } else { cm.dispose(); } } }
Next, Please Put This Into NPCConversationManager.java- Spoiler:
public int getExp() { return getPlayer().getExp(); } public int itemQuantity(int itemid) { MapleInventoryType type = MapleItemInformationProvider.getInstance().getInventoryType(itemid); MapleInventory iv = getPlayer().getInventory(type); int possesed = iv.countById(itemid); return possesed; }
| |
|