Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] White Scroll Maker NPC (OdinMS)

Newbie Spellweaver
Joined
Jun 24, 2008
Messages
63
Reaction score
7
Hey, I decided to make this for my server and I'll release it to you guys to.
You can Make the Piece of Scroll (4001136) drop from anything you want.

Code:
// White Scroll Maker By Sawyer of LynnStory
//High Preist John (9201002)
importPackage(net.sf.odinms.client);
var status = 0;



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("Rawr!?");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
				cm.sendNext("I am John and if you have all of the materials I will make you a White Jesus Scroll!!! You will need #b5 Pieces of Scroll#k, #bHoly Water#k, and #b10 Mill Mesos#k.  ");
			}
		else if (status == 1) {
			if ((cm.haveItem(4001136, 5)) && (cm.haveItem(2050003)) && (cm.getMeso() >= 10000000)) {
			cm.sendYesNo("It seems like you have the required materials, do you want me to make a #bWhite Scroll#k for you?");
			}
			else if (!cm.haveItem(4001136, 5)) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}
			else if (!cm.haveItem(2050003)) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}
			else if (!cm.getMeso() <= 10000000) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}
			
		}
		else if (status == 2) {
			cm.gainMeso(-10000000);
			cm.gainItem(4001136, -5);
			cm.gainItem(2050003, -1);
			cm.gainItem(2340000, 1);
                        cm.dispose();
			
}
}
}
 
Last edited:
Initiate Mage
Joined
Jun 2, 2008
Messages
3
Reaction score
0
how to but this into my database?
sorry for being so noob
 
Newbie Spellweaver
Joined
Jun 28, 2008
Messages
46
Reaction score
0
You need to get a NPC id, and put that script into a notepad document(also change the "John" to the name of NPC) same it, with the title of the document as the number of the NPC. Now, go to your source folder(for me its on my desktop, seans) then go to scrips, NPC, and put the document there.
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Question...how do u put the scrolls or w/e into the monster
 
Newbie Spellweaver
Joined
Nov 7, 2007
Messages
53
Reaction score
0
I have a quick question, Why is it that I have to re-login to speak with him again? If I click on him again, he dosen't say anything just sits there. I re-login, and click, he works perfectly.

This happens to Duey The skill maxer as well.

~Blaze
 
Supreme Arcanarch
Loyal Member
Joined
May 24, 2005
Messages
907
Reaction score
0
I have a quick question, Why is it that I have to re-login to speak with him again? If I click on him again, he dosen't say anything just sits there. I re-login, and click, he works perfectly.

This happens to Duey The skill maxer as well.

~Blaze
Because it's not dispose properly

just add
PHP:
cm.dispose();

After
PHP:
		else if (status == 2) {
			cm.gainMeso(-10000000);
			cm.gainItem(4001136, -5);
			cm.gainItem(2050003, -1);
			cm.gainItem(2340000, 1);
 
Newbie Spellweaver
Joined
Aug 15, 2008
Messages
66
Reaction score
0
Hey could u tell me a bit more about changing the white scoller seller NPC

Coz i dont want John to sell i want Wonky the fairy to sell it

Could u help me on this 1 i would rlly appreciate it
 
Newbie Spellweaver
Joined
Aug 1, 2008
Messages
66
Reaction score
0
wasnet this like posted so much times already?
 
Legendary Battlemage
Loyal Member
Joined
Dec 7, 2007
Messages
622
Reaction score
11
Thx =P but i just sell the white scrools for 1bil but ill try this out
 
Newbie Spellweaver
Joined
Aug 8, 2008
Messages
47
Reaction score
0
Hey could u tell me a bit more about changing the white scoller seller NPC

Coz i dont want John to sell i want Wonky the fairy to sell it

Could u help me on this 1 i would rlly appreciate it

just change the NPC id that you are using to wonky's which is (2013000.js)

and this is released alot of times, don't go claiming that you did it!
 
Newbie Spellweaver
Joined
May 31, 2008
Messages
28
Reaction score
5
This is an awfully great idea in my opinion, great job! I'd like to ask though, isn't this bit of code rather inefficient?

Code:
			else if (!cm.haveItem(4001136, 5)) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}
			else if (!cm.haveItem(2050003)) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}
			else if (!cm.getMeso() <= 10000000) {
			cm.sendOk("You dont have the required items.");
			cm.dispose();
			}

I've had some experience with VB.NET and Visual C++, and to my understanding, there's usually an "OR" function separating various conditions in an if else statement. For example in Visual Visual Basic, the coding syntax goes something like

Code:
elseif cm.haveitem(item1) = false or cm.haveitem(item2) = false or cm.haveitem(item3) = false
		outputstring.text = "You dont have the required items."
else
	...

Just asking, because I have almost no experience with Javascript ^^
 
Back
Top