Casino NPC #2

Newbie Spellweaver
Joined
Aug 22, 2008
Messages
6
Reaction score
0
Location
In a Box.
Place into whatever NPC you want to use it for:
Code:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> 
                       Matthias Butz <matze@odinms.de>
                       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


Casino NPC
Coded by Survival for Weedstory

*/

var status = 0;
var price = 5000000;
var scammed = 5000000;
var prize1 = 25000000;
var prize2 = 50000000;
var prize3 = 100000000;
var prize4 = 150000000;
                             

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

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
        } else {
		if (cm.getMeso() <= price) {
			cm.sendOk("You don't have enough mesos to gamble!");
			cm.dispose();
			return;
		}
		if (mode == 0) {
			cm.sendOk("Whatever!");
			cm.dispose();
			return;
		}
		status++;
		if (status == 0) {
			cm.sendNext("Hello #d#h ##k!\r\nWould you like to gamble some of your mesos?");
		} else if (status == 1) {
			cm.sendSimple("Alright, here we go! \r\n#L0##dGamble Mesos ("+ price +" mesos)#k#l\r\n#L1##dNevermind...#k#l")
		} else if (status == 2) {
                     if (selection == 0) {
                                cm.gainMeso(-price);
                                var playernumber = Math.floor(Math.random()*1000+1); //Random number from 1 to 1000
				if (playernumber >= 0 && playernumber <= 100) {
                                    
                                    cm.sendOk("Congrats, #d#h ##k! You won "+ scammed +" mesos!\r\n\r\nOh, wait. Nevermind, I just scammed you for "+ scammed +" mesos, haha!~");
                                    cm.gainMeso(-scammed);
                                    winningplayer = cm.getChar().getName();
                                    cm.mapMessage(5, "[CASINO] "+ winningplayer +" just got scammed "+ scammed +" mesos! See, gambling is bad for you!~");
                                    cm.dispose();
				} else if(playernumber >= 200 && playernumber <= 210) {
                                    
                                    cm.sendOk("Congrats, #d#h ##k! You won "+ prize1 +" mesos!");
                                    cm.gainMeso(prize1);
                                    winningplayer = cm.getChar().getName();
                                    cm.mapMessage(5, "[CASINO] "+ winningplayer +" hit the jackpot ("+ prize1 +" mesos)! Don't spend it all in one place!~");
                                    cm.dispose();
				} else if(playernumber >= 400 && playernumber <= 410) {
                                    
                                    cm.sendOk("Congrats, #d#h ##k! You won "+ prize2 +" mesos!");
                                    cm.gainMeso(prize2);
                                    winningplayer = cm.getChar().getName();
                                    cm.mapMessage(5, "[CASINO] "+ winningplayer +" hit the jackpot ("+ prize2 +" mesos)! Don't spend it all in one place!~");
                                    cm.dispose();
				} else if(playernumber >= 600 && playernumber <= 610) {
                                    
                                    cm.sendOk("Congrats, #d#h ##k! You won "+ prize3 +" mesos!");
                                    cm.gainMeso(prize3);
                                    winningplayer = cm.getChar().getName();
                                    cm.mapMessage(5, "[CASINO] "+ winningplayer +" hit the jackpot ("+ prize3 +" mesos)! Don't spend it all in one place!~");
                                    cm.dispose();
				} else if(playernumber >= 800 && playernumber <= 810) {
                                    
                                    cm.sendOk("Congrats, #d#h ##k! You won "+ prize4 +" mesos!");
                                    cm.gainMeso(prize4);
                                    winningplayer = cm.getChar().getName();
                                    cm.mapMessage(5, "[CASINO] "+ winningplayer +" hit the jackpot ("+ prize4 +" mesos)! Don't spend it all in one place!~");
                                    cm.dispose();
				} else {
                                    cm.sendOk("Sorry, you didn't win anything this time. Please try again.")
                                    cm.dispose();
				}
                        } else if (selection == 1) {
                                cm.sendOk("I guess you have better things to spend your mesos on, hope to see you around these parts again!!");
				cm.dispose();
                        }
                }
        }
}

Features:
- Relatively low chance of winning.
- Better chance of getting scammed than winning, but still not a high chance.
- Displays map message for winners/scammed players.
*pokes screenshots*

Credits to Weaxer & OmgItsParm for the basis of why this was coded (aka they asked me to code it for them.) Released as Weaxer's original (which didn't work) was released, basically to give to those who wanted.
 

Attachments

  • Maple0003.webp
    72.7 KB · Views: 1,383
  • Maple0004.webp
    71.8 KB · Views: 1,113
  • Maple0005.webp
    72.2 KB · Views: 999
  • Maple0006.webp
    75.5 KB · Views: 920
  • Maple0007.webp
    75.9 KB · Views: 944
Re: [Release] Casino NPC v.2

You should change the V To Rev maybe because im a idiot and hard time, Kinda i just glance at things.
 
Last edited:
Re: [Release] Casino NPC v.2

Dude stop putting V Whatever... That only applies for programs and applications not scripts or shit like this.

1) Not a dude.
2) One and only time I have ever released anything on RageZone.
3) Changed because let's nitpick!~ Whee.
 
Re: [Release] Casino NPC #2

This npc is useful, it's fun to have and only a complete idiot would get confused by this.
 
Re: [Release] Casino NPC #2

Giro what is it with and you and the V's just let it be lol and someone else released this in weaxer section they posted it there

That was me. And then a mod deleted the whole thread for w/e reason. So Parm suggested I just release it outright. So here you are.
 
Re: [Release] Casino NPC #2

This npc is useful, it's fun to have and only a complete idiot would get confused by this.

Thats exactly why im adding it.
And who ever actully does it more than once..
It'll send a notice example. my ign is Admin and i did it twice the notice will say
[GAMBLE] I Admin am a complete dumass who lost 1b for being a dumass.
 
Re: [Release] Casino NPC #2

This NPC is fucking addicting.....

When kenna/weaxer added it on WeedStory, I was like playin around with it for like an hour.

This NPC's EPIC!
 
Re: [Release] Casino NPC #2

Suggestions:
Make it more player friendly

So solution:
Use icons like meso icon instead of mesos

E.g.\r\n#f[REWARD ICON DIRECTORY]#\r\n #f[MESO ICON DIRECTORY]# xxxx
where xxx is mesos earned
(I forgot where reward or meso icon was located, look it up wz)

plus add colours like #b #r #g and etc.
 
Re: [Release] Casino NPC #2


If you want to add that, then add it. And it does use colors. If you want it to use more or different colors, then change it. lol.
 
Re: [Release] Casino NPC #2

Nice release lol btw can we make the message boardcast to the whole world instead of map ? and i dont think the scamming message appears when i have been scam o.o