[Release] Gambling NPC-Better~

Status
Not open for further replies.
Experienced Elementalist
Joined
Jul 18, 2008
Messages
232
Reaction score
0
This is my own gambling NPC!
1/4 chance of winnning
Added checks for below 0 and if you can't gamble 1.05 billion mesos or higher
Credits to Luke of CookieMs for base script
Credits to MeGoesRawr for editing
Code:
/*
Base Script by Luke(Roamer in RaGEZONE) and GanstaX(StraightX in RaGEZONE) in CookieMS
Gambling NPC by MeGoesRawr of SpinMs
Please leave credits! If not.... You are a crazy mofo leecher and deserve to die!
*/

importPackage(net.sf.odinms.client);

var status = 0;
var fee;
var chance = Math.floor(Math.random()*4+1);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("Okay... See ya later... if this is still here ur server ownere is a leecher from ragezone!");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendNext("Hello #h #! I am the Gambler NPC of #bSpinMs#k! If you would like to gamble... Please proceed! if this is still here ur server ownere is a leecher from ragezone! if this is still here ur server ownere is a leecher from ragezone! if this is still here ur server ownere is a leecher from ragezone!1 if this is still here ur server ownere is a leecher from ragezone!! if this is still here ur server ownere is a leecher from ragezone!! if this is still here ur server ownere is a leecher from ragezone!!! if this is still here ur server ownere is a leecher from ragezone!!!!!");
		} else if (status == 1) {
			cm.sendGetText("How much money would you like to gamble? if this is still here ur server ownere is a leecher from ragezone!");
		} else if (status == 2) {
			fee = cm.getText();
			cm.sendYesNo("Are you sure you want to gamble #r" + fee + "#k mesos?... if this is still here ur server ownere is a leecher from ragezone!");
		} else if (status == 3) {
			if (cm.getMeso() < fee) {
				cm.sendOk("You don't have enough mesos! if this is still here ur server ownere is a leecher from ragezone!");
				cm.dispose();
			} else if (cm.getMeso() >= 1050000000) {
				cm.sendOk("I'm sorry but... You can't gamble when you have 1,050,000,000 mesos or higher... if this is still here ur server ownere is a leecher from ragezone!");
				cm.dispose();
			} else if (cm.getText() < 0) {
				cm.sendOk("You can't gamble less than 0 mesos... if this is still here ur server ownere is a leecher from ragezone!");
				cm.dispose();
			} else {
				if (chance <= 1) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! if this is still here ur server ownere is a leecher from ragezone!");
					cm.dispose();
				}
				else if (chance == 2) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! if this is still here ur server ownere is a leecher from ragezone!");
					cm.dispose();
				}
				else if (chance == 3) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! if this is still here ur server ownere is a leecher from ragezone!");
					cm.dispose();
				}
				else if (chance >= 4) {
					cm.gainMeso(fee * 2);
					cm.sendNext("#rCONGRATUMAGALATIONS#k! You have won! if this is still here ur server ownere is a leecher from ragezone!");
					cm.dispose();
				}
			}
		}
	}
}
Have fun!
EDIT : If someone could... Could they make like so when you have 1.05 billion mesos they can still gamble but they can't gamble 1.05 billion mesos?
 
Lol, nice release. Slightly higher rates than I put in mine.
Might I also suggest adding in an @lottery for anyone that doesn't wanna have to find the npc? XP
 
As you said in the end, you wanted people to be able to gamble when they had high amounts of mesos. I made my NPC give out the bronze, silver, and gold bags. Which can be traded in for 1m, 5m, and 10m. Which then, you can easily stop people from losing money by betting when they already have high amounts. The only sad part is that you have to set the amounts to bet for that.
 
hmm... i made bronze,silver, and gold bags working in my server and i made them droppable from monsters :/
Anyways I have a currency exchanger as well :P
 
Lol, you could do it with any undropped item.
Like I also have a higher npc which gives out either 0, 1, 2, or 5 red envelopes, that are traded in for 100m each. XP
Anyways, you get the idea.
 
Lol, I just got bored and coded it yesterday. XP
Anyways, I wish I could help, but I'm just beginning in Java, so I don't know all the commands
 
EDIT : If someone could... Could they make like so when you have 1.05 billion mesos they can still gamble but they can't gamble 1.05 billion mesos?

Use This

EDITTED 3 TIMES SORRY LAST TIME I COPIED WRONG SCRIPT

Code:
/*
Base Script by Luke(Roamer in RaGEZONE) and GanstaX(StraightX in RaGEZONE) in CookieMS
Gambling NPC by MeGoesRawr of SpinMs
Please leave credits! If not.... You are a crazy mofo leecher and deserve to die!
*/
// creditz to fusion for fixing the above failed slightly


importPackage(net.sf.odinms.client);

var status = 0;
var fee;
var chance = Math.floor(Math.random()*4+1);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("Okay... See ya later...");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendYesNo("Hello #h #! I am the Gambler NPC of #bENTER SERVER NAME HERE#k! Press Yes İf you would like to gamble mesos and try your chance to win x2 in return ");
		} else if (status == 1) {
			cm.sendGetText("How much money would you like to gamble? Please Type İt İn !");

		} else if (status == 2) {

			fee = cm.getText();
			cm.sendYesNo("Are you sure you want to gamble #r" + fee + "#k mesos?");

			} else if (cm.getMeso() < fee) {
				cm.sendOk("You don't have enough mesos! ");
				cm.dispose();

			} else if (cm.GetText() >= 1050000000) {
				cm.sendOk("Stupid noob, wtfux i tell you about betting 1.05bill mesos? You just dont fucking listen do you");
				cm.dispose();

			} else if (cm.getMeso() >= 1050000000) {
				cm.sendOk("Just letting you know you got over 1.05bill mesos. Please remember not to try bet over that.");
				

			} else if (cm.getText() < 0) {
				cm.sendOk("You can't gamble less than 0 mesos... ");
				cm.dispose();

		} else {
				if (chance <= 1) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! ");
					cm.dispose();
				}
				else if (chance == 2) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! ");
					cm.dispose();
				}
				else if (chance == 3) {
					cm.gainMeso(-fee);
					cm.sendNext("Tough luck... Maybe next time you will win! ");
					cm.dispose();
				}
				else if (chance >= 4) {
					cm.gainMeso(fee * 2);
					cm.sendNext("#rCONGRATUMAGALATIONS#k! You have won! You Will now recieve x2 the mesos you first bet ");
					cm.dispose();
				}
			}
		}
	}
}
 
Last edited:
Status
Not open for further replies.
Back