NoobieGuy Moderator
Posts : 54 Join date : 2010-06-24 Age : 28 Location : California
| Subject: Golden maple leaf item trader Mon Jun 28, 2010 3:49 pm | |
| Ok this trades Golden maple leaves for items, if you know simple java coding, you can change how much the item cost, if not, ill do it, just tell me what the prices should be. - Code:
-
var status = 0;
function start() { cm.sendNext("Hello! I am #eNana (L)#n, the #b#eGolden Maple Leaf Merchant#k#n. \r\nI'll give you items if
you give me #d#eGolden Maple Leaves#k#n! \r\nThey look like this: \r\n#v4000313#"); }
function action(mode, type, selection) { if (mode < 0) { cm.dispose(); } else if (mode < 1) { cm.sendOk("Okay, see you then."); cm.dispose(); } else { status++; if (status == 1) cm.sendSimple("What would you like to buy? \r\n#L0##eDragon Stone - 5 Leaves #v2041200##l
\r\n#L1##bHorntail Necklace - 10 Leaves #v1122000##l \r\n#L2##gStormcaster Gloves - 50 leaves #v1082223##l
\r\n#L3##dBalanced Fury Stars - 100 Leaves #v2070018##l#n"); else if (status == 2){ if (selection == 0){ cm.sendYesNo("Are you sure you want to buy a #eDragon Stone#n for 5 Gold Maple Leaves?"); status = 99; } else if (selection == 1){ cm.sendYesNo("Are you sure you want to buy a #b#eHorntail Necklace#k#n for 10 Gold Maple
Leaves?"); status = 199; } else if (selection == 2){ cm.sendYesNo("Are you sure you want to buy #b#eStormcaster Gloves#k#n for 50 Gold Maple
Leaves?"); status = 299; } else if (selection == 3){ cm.sendYesNo("Are you sure you want to buy #b#eBalanced Fury Stars#k#n for 100 Gold Maple
Leaves?"); status = 399; } } else if (status == 100) { if (cm.haveItem(4000313, 5)){ cm.sendOk("All right, here you go."); cm.gainItem(2041200, 1); cm.gainItem(4000313, -5); cm.dispose(); }else{ cm.sendOk("You don't have enough leaves!"); cm.dispose(); } } else if (status == 200) { if (cm.haveItem(4000313, 10)){ cm.sendOk("All right, here you go."); cm.gainItem(1122000, 1); cm.gainItem(4000313, -10); cm.dispose(); }else{ cm.sendOk("You don't have enough leaves!"); cm.dispose(); } } else if (status == 300) { if (cm.haveItem(4000313, 50)){ cm.sendOk("All right, here you go."); cm.gainItem(1082223, 1); cm.gainItem(4000313, -50); cm.dispose(); } else{ cm.sendOk("You don't have enough leaves!"); cm.dispose(); } } else if (status == 400) { if (cm.haveItem(4000313, 100)){ cm.sendOk("All right, here you go."); cm.gainItem(2070018, 1); cm.gainItem(4000313, -100); cm.dispose(); } else{ cm.sendOk("You don't have enough leaves!"); cm.dispose(); } } } } | |
|