-
2 Attachment(s)
GachaponEXP NPC
This is only me second post so if there is a mistake please let me know so I can change it. I'm very sure there are no careless mistakes though.
PLEASE tell me if you've used this :]
Credits for the idea go to Jordan
Code:
//GachaphonEXP 9100190
/*
-- Odin JavaScript --------------------------------------------------------------------------------
-- By ---------------------------------------------------------------------------------------------
NeverCodeNever
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by NeverCodeNever
----------------------------------------------------------------------------
*/
importPackage(net.sf.odinms.client);
var status = 0;
var chance1 = Math.floor(Math.random()*200+1);
var chance2 = Math.floor(Math.random()*50);
var chance3 = (Math.floor(Math.random()*20)+1);
var chance4 = Math.floor(Math.random()*2+1);
var itemchance = chance1 + chance2 + chance3 * chance4;
var itemamount = Math.floor(Math.random()*50+1);
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (status >= 2 && mode == 0) {
cm.sendOk("See you next time, when you try your luck here~!");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendNext("I am gachaponEXP, and you get exp instead of items here.\r\nI'll give EXP if you hand over your Gachapon Tickets.\r\nThe tickets look like this: #v5220000#");
}
else if (status == 1) {
if (cm.haveItem(5220000)) {
cm.sendYesNo("I see you have a ticket, do you wish to use it?");
}
else if (!cm.haveItem(5220000)) {
cm.sendOk("You dont have any #bgachapon tickets#k.");
cm.dispose();
}
}
else if (status == 2) {
cm.gainItem(5220000, -1);
if ((itemchance >= 1) && (itemchance <= 20)) {
cm.gainExp(1000000);
}
else if ((itemchance >= 21) && (itemchance <= 40)) {
cm.gainExp(-10000);
}
else if ((itemchance >= 41) && (itemchance <= 50)) {
cm.gainExp(50000);
}
else if ((itemchance >= 51) && (itemchance <= 60)) {
cm.gainExp(5000);
}
else if ((itemchance >= 61) && (itemchance <= 70)) {
cm.gainExp(50);
}
else if (itemchance == 71) {
cm.gainExp(4000);
}
else if (itemchance == 72) {
cm.gainExp(500000);
}
else if (itemchance == 73) {
cm.gainExp(10000);
}
else if (itemchance == 74) {
cm.gainExp(242356);
}
else if (itemchance == 75) {
cm.gainExp(24546);
}
else if (itemchance == 76) {
cm.gainExp(60755);
}
else if (itemchance == 77) {
cm.gainExp(3467);
}
else if (itemchance == 78) {
cm.gainExp(35775);
}
else if (itemchance == 79) {
cm.gainExp(86589);
}
else if (itemchance == 80) {
cm.gainExp(56985453);
}
else if (itemchance == 81) {
cm.gainExp(357);
}
else if (itemchance == 82) {
cm.gainExp(245244);
}
else if (itemchance == 83) {
cm.gainExp(35778);
}
else if (itemchance == 84) {
cm.gainExp(1337);
}
else if (itemchance == 85) {
cm.gainExp(547458);
}
else if (itemchance == 86) {
cm.gainExp(48487);
}
else if (itemchance == 87) {
cm.gainExp(45843);
}
else if (itemchance == 88) {
cm.gainExp(3773);
}
else if (itemchance == 89) {
cm.gainExp(5473);
}
else if (itemchance == 90) {
cm.gainExp(244);
}
else if (itemchance == 91) {
cm.gainExp(3588);
}
else if (itemchance == 92) {
cm.gainExp(4583);
}
else if (itemchance == 93) {
cm.gainExp(247);
}
else if ((itemchance >= 209) && (itemchance <= 215)) {
cm.gainExp(3);
}
else if ((itemchance >= 216) && (itemchance <= 221)) {
cm.gainExp(4588);
}
else if ((itemchance >= 222) && (itemchance <= 228)) {
cm.gainExp(69569);
}
else if ((itemchance >= 228) && (itemchance <= 240)) {
cm.gainExp(35788);
}
else if (itemchance >= 228) {
cm.gainExp(1);
}
cm.dispose();
}
}
}
-
Re: GachaponEXP NPC
Not much of a point in it. Released by Jordan already.
-
Re: GachaponEXP NPC
I know... but it was coded in C++ (titan) and most people don't use C++ (Titian) So I translated it for people.
-
Re: GachaponEXP NPC
Theres already a translated one in the same exact thread.
/fail
-
Re: GachaponEXP NPC
PHP Code:
cm.gainExp([1000000]);
[] shouldn't be there .
-
Re: GachaponEXP NPC
You should do real random numbers rather than punching in definite numbers.. using math random at the top again you can try something different ;S
-
Re: GachaponEXP NPC
Haha ok I'll keep that in mind P:
-
Re: GachaponEXP NPC
-
Re: GachaponEXP NPC
-
Re: GachaponEXP NPC
just wanted to say, i use this and it works fine :thumbup: the newer players love it, haha :tongue:
-
Re: GachaponEXP NPC
Haha you're welcome I'm glad they like it ^^
-
Re: GachaponEXP NPC
nice idea but you can do it better u can do this script in about 20lines
-
Re: GachaponEXP NPC
You can do this in like 5-10 lines with an array. This isn't totally useless though. Jordan's was for Titanms
-
Re: GachaponEXP NPC
is this for all levels or just for 1-50?
-
Re: GachaponEXP NPC
nice release. but you still have to code the item right?