הינה הסקריפט של הNPC והאידי שלו הוא 9120100
קוד:
// Stat Changer for Points =) @auother UnholyMS
var status = 1;
var price = 5; //Unholy Point(s) per item
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;
} else if (mode == 1) {
status++;
} else {
status--;
} if (status == 0) {
cm.sendYesNo("Hello #b#h ##k!\r\n I am Unholy Point Exchanger in #gUnholyMs#k!\r\nYou currently have " + cm.getUnholyPoints() + " Unholy points.\r\nDo you wish to upgrade an item that you want for only \r\n#b"+ price +" Unholy Point#k?");
} else if (status == 1) {
cm.sendGetText("#bPlease enter the item id that you want below.#k");
} else if (status == 2) {
itemid = cm.getText();
if (itemid.length() < 7 || itemid.length() > 7) {
cm.sendOk("Either the item id that you entered is too long or too short.");
cm.dispose();
} else if (cm.getUnholyPoints() < price) {
cm.sendOk("You do not have enough Unholy points. Come back to me again after you have got"+ price +"Unholy Point.");
cm.dispose();
} else {
cm.sendYesNo("Please Remember that you will need to Change Channels after this!\r\nAre you sure that you want to upgade #i"+ itemid +"? Please double check if its the one that you wanted.");
}
} else if (status == 3) {
if (cm.getUnholyPoints() < price) {
cm.sendOk("You do not have enough Unholy points. Come back to me again after you have got"+ price +"Unholy Point.");
cm.dispose();
} else {
var itemId = parseInt(itemid);
var currItem;
var chr = cm.getPlayer();
currItem = chr.getInventory(net.sf.odinms.client.MapleInventoryType.EQUIP).findById(itemId);
if (currItem == null) {
currItem = chr.getInventory(net.sf.odinms.client.MapleInventoryType.EQUIPPED).findById(itemId);
}
if (currItem == null) {// Check if item exists (they have it)
cm.sendOk("You has no item, you little nub.");
cm.dispose();
return;
}
editStats(currItem, "str", 5); // Change the stats you want added here
editStats(currItem, "dex", 5);
editStats(currItem, "luk", 5);
editStats(currItem, "int", 5);
editStats(currItem, "watk", 5);
cm.gainUnholyPoints(-price);
cm.dispose();
}
}
}
}
function editStats(currItem, toEdit, toAdd) {
var currStats = 0;
if (toEdit == "str") {
currStats = currItem.getStr();
} else if (toEdit == "luk") {
currStats = currItem.getLuk();
} else if (toEdit == "dex") {
currStats = currItem.getDex();
} else if (toEdit == "int") {
currStats = currItem.getInt();
} else if (toEdit == "watk") {
currStats = currItem.getWatk();
} else {
cm.dropMessage("An error occured");
cm.dispose();
return;
}
currStats += toAdd;
if (currStats > 32767) {
currStats = 32767;
}
net.sf.odinms.server.MapleInventoryManipulator.editEquipById(cm.getPlayer(), 1, currItem.getItemId(), toEdit, currStats);
}
שמשהו יעזור בבקשה...