- Joined
- Feb 15, 2009
- Messages
- 45
- Reaction score
- 2
Ohai my first release. Multi fun NPC,includes 8ball,Lottery,Gamble..& Jukebox. Remove copyright and you die. I failed at the gamble part,but it works. The whole script sucks btw. Feel free to add stuff. Don't remove my copyright. If changing music doesn't work,add this to NPCConversationManager.java:
I think Moogra made this Music Change part..Found it in a script,and his name was added there including someone's name from my server. Copyright to Moogra then. Well,here is the script:
Screenshots:
Sorry,I'm a noob. If you find bugs report them. (btw sorry bout no-spacing
Totally forgot it)
kthxbai
PHP:
public void changeMusic(String songName) {
getPlayer().getMap().broadcastMessage(MaplePacketCreator.musicChange(songName));
}
I think Moogra made this Music Change part..Found it in a script,and his name was added there including someone's name from my server. Copyright to Moogra then. Well,here is the script:
PHP:
/*
Multi Fun NPC
By xTim
Remove copyright and you die.
Perry: 9110000
*/
var status = 0;
//Configurations From Here Onwards.
// basic config
var servername = new Array("server"); // enter your servername here.
var npcname = new Array("Perry"); // enter npc's name here.
// music,BGMs
var music = Array("Bgm00/SleepyWood", "Bgm00/FloralLife", "Bgm00/GoPicnic", "Bgm00/Nightmare", "Bgm00/RestNPeace",
"Bgm01/AncientMove", "Bgm01/MoonlightShadow", "Bgm01/WhereTheBarlogFrom", "Bgm01/CavaBien", "Bgm01/HighlandStar", "Bgm01/BadGuys",
"Bgm02/MissingYou", "Bgm02/WhenTheMorningComes", "Bgm02/EvilEyes", "Bgm02/JungleBook", "Bgm02/AboveTheTreetops",
"Bgm03/Subway", "Bgm03/Elfwood", "Bgm03/BlueSky", "Bgm03/Beachway", "Bgm03/SnowyVillage",
"Bgm04/PlayWithMe", "Bgm04/WhiteChristmas", "Bgm04/UponTheSky", "Bgm04/ArabPirate", "Bgm04/Shinin'Harbor", "Bgm04/WarmRegard",
"Bgm05/WolfWood", "Bgm05/DownToTheCave", "Bgm05/AbandonedMine", "Bgm05/MineQuest", "Bgm05/HellGate",
"Bgm06/FinalFight", "Bgm06/WelcomeToTheHell", "Bgm06/ComeWithMe", "Bgm06/FlyingInABlueDream", "Bgm06/FantasticThinking",
"Bgm07/WaltzForWork", "Bgm07/WhereverYouAre", "Bgm07/FunnyTimeMaker", "Bgm07/HighEnough", "Bgm07/Fantasia",
"Bgm08/LetsMarch", "Bgm08/ForTheGlory", "Bgm08/FindingForest", "Bgm08/LetsHuntAliens", "Bgm08/PlotOfPixie",
"Bgm09/DarkShadow", "Bgm09/TheyMenacingYou", "Bgm09/FairyTale", "Bgm09/FairyTalediffvers", "Bgm09/TimeAttack",
"Bgm10/Timeless", "Bgm10/TimelessB", "Bgm10/BizarreTales", "Bgm10/TheWayGrotesque", "Bgm10/Eregos",
"Bgm11/BlueWorld", "Bgm11/Aquarium", "Bgm11/ShiningSea", "Bgm11/DownTown", "Bgm11/DarkMountain",
"Bgm12/AquaCave", "Bgm12/DeepSee", "Bgm12/WaterWay", "Bgm12/AcientRemain", "Bgm12/RuinCastle", "Bgm12/Dispute",
"Bgm13/CokeTown", "Bgm13/Leafre", "Bgm13/Minar'sDream", "Bgm13/AcientForest", "Bgm13/TowerOfGoddess",
"Bgm14/DragonLoad", "Bgm14/HonTale", "Bgm14/CaveOfHontale", "Bgm14/DragonNest", "Bgm14/Ariant", "Bgm14/HotDesert",
"Bgm15/MureungHill", "Bgm15/MureungForest", "Bgm15/WhiteHerb", "Bgm15/Pirate", "Bgm15/SunsetDesert",
"BgmEvent/FunnyRabbit", "BgmEvent/FunnyRabbitFaster",
"BgmGL/amoria", "BgmGL/chapel", "BgmGL/cathedral", "BgmGL/Amorianchallenge",
"BgmJp/Feeling", "BgmJp/BizarreForest", "BgmJp/Hana", "BgmJp/Yume", "BgmJp/Bathroom", "BgmJp/BattleField", "BgmJp/FirstStepMaster");
var musiccost = 1000000; // Cost to change music
// Jokes,add them as you see
var jokes = new Array("How many letters are there in the alphabet?\r\n\r\nTwenty-four, because E.T. went home.",
"I went to a garage sale. 'How much for the garage?' 'It's not for sale.'",
"One time I went to a drive-in in a taxi cab. The movie cost me $95.",
"Marriage is very much like a violin; after the sweet music is over, the strings are attached.",
"Marriage certificate is just another word for a work permit.",
"Marriage is not just a having a wife, but also worries inherited forever.");
// 8Ball answers
var answer = new Array("Yes", "No", "Maybe", "Ask me again", "No result", "74 and a half.", "To be honest: Never!.", "One BigMac and a coke,coming through right now!", "*roundhouse kicks*"); // 8Ball answers. Edit them as done there.
// Gamble
var winlose = new Array(**** **** 110); // 100 = win, 105 = lose, 110 = draw
var winanswer = new Array("You won!");
var loseanswer = new Array("You lost!");
var drawanswer = new Array("Wow,a draw! Try again!");
var maxbet = new Array(500000000, "500 Mil"); // Max mesos to bet. 2nd Part is the text to say,1st the Amount.
// End of config.
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.");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("I am #b"+ npcname +"#k from #b"+ servername +"#k. What do you want to do?"
+"\r\n#L200##bTell me a joke!#l"
+"\r\n#L201#I got a question!#l"
+"\r\n\#L202#Gamble#l"
+"\r\n#L203#Jukebox (Change Music on Map)#l"
);
} else if (selection == 200) {
var randnum = Math.floor(Math.random()*jokes.length);
cm.sendOk("Joke:\r\n\r\n" + jokes[randnum]);
cm.dispose();
} else if (selection == 201) {
status = 30;
cm.sendGetText("What do you have on your mind? #e ");
} else if (status == 31) {
var question = cm.getText();
var randanswer = Math.floor(Math.random()*answer.length);
cm.sendOk("Your question was: #b" + question + "#k\r\n\#rAnswer:#k\r\n\r\n" + answer[randanswer]);
cm.dispose();
}
else if (selection == 202) {
status = 50;
cm.sendNext("#bGambling works like this#k:\r\n\r\nYou will set an amount of money. With a special chance you will either draw,win or lose. If you win,you will gain the amount of mesos you've set,if you lose,you'll lose your set money. If you draw,you get your money back.");
} else if (status == 51) {
cm.sendGetText("How much do you want to bet?\r\n#rMax Mesos you can bet is: #k#b"+ maxbet[1] + " !#k");
} else if (status == 52) {
var moneybet = cm.getText();
if (cm.getMeso() < moneybet) {
cm.sendOk("You don't have that much mesos!");
cm.dispose();
} else if (moneybet > maxbet[0]) {
cm.sendOk("Max mesos you can set is #r"+ maxbet[1] + " !!!");
cm.dispose();
} else if (cm.getMeso() >= moneybet || moneybet < maxbet[0]) {
var moneybet = cm.getText();
var gamble = Math.floor(Math.random()*winlose.length);
status = winlose[gamble];
cm.sendNext("We've gambled and we got a result...");
}
} else if (status == 101) {
var moneybet = cm.getText();
cm.gainMeso(moneybet);
cm.sendOk("You've won!\r\n");
cm.dispose();
} else if (status == 106) {
var moneybet = cm.getText();
cm.gainMeso(-moneybet);
cm.sendOk("Damn,you lost.Try again!\r\n");
cm.dispose();
} else if (status == 111) {
var moneybet = cm.getText();
cm.sendOk("Draw! Try again!");
cm.dispose();
} else if (selection == 203) {
status = 300;
var jukebox = "#b#eMaplestory Jukebox#k#n\r\nWhat song do you want to play?\r\n";
for (var i = 0; i < music.length; i++)
jukebox += "\r\n#L" + i + "# " +music[i]+ "#l";
cm.sendSimple(jukebox);
} else if (status == 301) {
if (cm.getMeso() < musiccost) {
cm.sendOk("You don't have enough Mesos. Come back when you have enough.");
} else {
cm.changeMusic(music[selection]);
cm.gainMeso(-musiccost);
cm.dispose();
}
}
}
}
Screenshots:
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple00002o7e.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple00018uqh.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple0002pr27.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple0003ao0v.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple0004jtqq.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple0005ywg2.jpg)
![Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums Lejgolacsz - [Add-on] Multi Fun NPC (Nooby) - RaGEZONE Forums](http://www.abload.de/img/maple0006opl3.jpg)
Sorry,I'm a noob. If you find bugs report them. (btw sorry bout no-spacing

kthxbai
Last edited: