This NPC sells 3 rare NX item and the bowties.
Please refer to how to edit your bowtie in the other threads..
If you know how to code your own, meaning that you can change the item IDs, you need no follow my color and stats of the Bow-tie.
WARNING : To make the bowtie max stats , you gotta edit the stats of it.
Heres the code :
The only thing that i'll teach u is adding the cm.setLuk , cm.setDex , cm.setInt and cm.setStr.PHP Code:/*
Mum and Dad - Seller of things and Max stats(Bowtie only)
Proudly made by Samuel Lee from SamuelMS.
*/
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 <= 3) {
cm.sendOk("Do find me again if you need me. This is proudly coded by Samuel Lee from SamuelMS.");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple ("Do you want to xchange Black Charm #v4031059# with items?\r\n#k#L0##eNeh Neh Neh Boo Boo #v1012074# for 15BC.#n#l\r\n#k#L1##eSanta hat #v1002225# for 15BC.#n#l\r\n#k#L2##eMercury Cloak #v1102149# for 20BC.#n#l\r\n#k#L3##eBow-tie STR #v1122005# for people with STR as max stats#n#l\r\n#k#L4##eBow-tie DEX #v1122004# for people with DEX as max stats#n#l\r\n#k#L5##eBow-tie INT #v1122003# for people with INT as max stats#n#l\r\n#k#L6##eBow-tie LUK #v1122002# for people with LUK as max stats#n#l");
} else if (status == 1) {
if (selection == 0) {
if (cm.itemQuantity(4031059) >= 15) {
cm.gainItem(4031059,-15);
cm.gainItem(1012074,1);
cm.sendOk("You have gain a Neh Neh Neh Boo Boo for 15BC.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have the required BC.");
cm.dispose();
}
} else if (selection == 1) {
if (cm.itemQuantity(4031059) >= 15) {
cm.gainItem(4031059,-15);
cm.gainItem(1002225,1);
cm.sendOk("You have gained a Santa Hat for 15BC.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have the required BC.");
cm.dispose();
}
} else if (selection == 2) {
if (cm.itemQuantity(4031059) >= 20) {
cm.gainItem(4031059,-20);
cm.gainItem(1102149,1);
cm.sendOk("You have gained a Mercury Cloak for 20BC.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have the reuiqred BC.");
cm.dispose();
}
} else if (selection == 3) {
if (cm.c.getPlayer().getStr() >= 32767) {
cm.gainItem(1122005,1);
cm.getPlayer().setStr(4);
cm.sendOk("You have gained a Bowtie for STR with a exchange of your stats!,please change channel for the effect.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have max stats for STR!");
cm.dispose();
}
}else if (selection == 4) {
if (cm.c.getPlayer().getDex() >= 32767) {
cm.gainItem(1122004,1);
cm.getPlayer().setDex(4);
cm.sendOk("You have gained a Bowtie for DEX with a exchange of your stats!,please change channel for the effect.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have max stats for DEX!");
cm.dispose();
}
}else if (selection == 5) {
if (cm.c.getPlayer().getInt() >= 32767) {
cm.gainItem(1122003,1);
cm.getPlayer().setInt(4);
cm.sendOk("You have gained a Bowtie for INT with a exchange of your stats!,please change channel for the effect.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have max stats for INT!");
cm.dispose();
}
}else if (selection == 6) {
if (cm.c.getPlayer().getLuk() >= 32767) {
cm.gainItem(1122002,1);
cm.getPlayer().setLuk(4);
cm.sendOk("You have gained a Bowtie for LUK with a exchange of your stats!,please change channel for the effect.");
cm.dispose();
} else {
cm.sendOk("Sorry but you do not have max stats for LUK!");
cm.dispose();
}
}
}
}
}
GotoFind NPCConversationManager.javaCode:Your Repack/src/src/net/sf/odinms/scripting/npc
Open it up with whatever editor you use and find this line:
Now , after the last brackets of setFame, go down one line and type this:Code:public void setFame(int fame) { getPlayer().setFame(fame); getPlayer().updateSingleStat(MapleStat.FAME, Integer.valueOf(fame)); }
So it'll look like this:Code:public void setStr(int str) { getPlayer().setStr(str); getPlayer().updateSingleStat(MapleStat.STR, Integer.valueOf(str)); } public void setDex(int dex) { getPlayer().setDex(dex); getPlayer().updateSingleStat(MapleStat.DEX, Integer.valueOf(dex)); } public void setLuk(int luk) { getPlayer().setLuk(luk); getPlayer().updateSingleStat(MapleStat.LUK, Integer.valueOf(luk)); } public void setInt(int int1) { getPlayer().setInt(int1); getPlayer().updateSingleStat(MapleStat.INT, Integer.valueOf(int1)); }
Compile it.Code:public void setFame(int fame) { getPlayer().setFame(fame); getPlayer().updateSingleStat(MapleStat.FAME, Integer.valueOf(fame)); } public void setStr(int str) { getPlayer().setStr(str); getPlayer().updateSingleStat(MapleStat.STR, Integer.valueOf(str)); } public void setDex(int dex) { getPlayer().setDex(dex); getPlayer().updateSingleStat(MapleStat.DEX, Integer.valueOf(dex)); } public void setLuk(int luk) { getPlayer().setLuk(luk); getPlayer().updateSingleStat(MapleStat.LUK, Integer.valueOf(luk)); } public void setInt(int int1) { getPlayer().setInt(int1); getPlayer().updateSingleStat(MapleStat.INT, Integer.valueOf(int1)); }
Next is changing the currency , my currency is Black Charm , so if yours is different , you would like to change this line:
withCode:Do you want to xchange Black Charm #v4031059# with items?
And:Code:Do you want to xchange <Fill in currency name> #v<currency item code># with items?
withCode:cm.gainItem(4031059,-15);
And:Code:cm.gainItem(<currency item code>,<quantity taken or given>);
with:Code:cm.itemQuantity(4031059) >= 15
WARNING: For the cm.itemQuantity, theres 3 lines to edit, so look properly.Code:cm.itemQuantity(<currency item code>) >= <Item sold for how much in currency form>
WARNING: For the cm.gainItem , theres also 3 lines to edit , so look properly.
WARNING , Please do not remove the credits , anyone seen doing that is a noob trying to gain credits.
Heres the line of the credits:
And:Code:]/* Mum and Dad - Seller of things and Max stats(Bowtie only) Proudly made by Samuel Lee from SamuelMS. */
Addition Important Note:Code:cm.sendOk("Do find me again if you need me. This is proudly coded by Samuel Lee from SamuelMS.");
Bow-tie Yellow = INT (for this script)
Bow-tie Red = LUK (for this script)
Bow-tie Pink = DEX (for this script)
Bow-tie Black = STR (for this script)
Thats all , please tell me what to add in if it's needed.



Reply With Quote


