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!

Ragnarok NPC Script Converting Eluniums or Rough to Enriched.

Newbie Spellweaver
Joined
Jul 2, 2010
Messages
5
Reaction score
0
An NPC script which would allow a player to have an Enriched Elunium by converting his/her Rough Eluniums/Eluniums and by paying 100k zeny for each Enriched Elunium made.

This is a combination of Novice Trade and Milk Trader script.
Code:
[SPOILER]
geffen_in,112,169,3	script	Enricher Blacksmith	813,{
	set .@now_weight,MaxWeight-Weight;
	if (.@now_weight < 6301 || checkweight(1201,1) == 0) {
		mes "[Enricher Blacksmith]";
		mes "Haha!";
		mes "What are you, superhuman?";
		mes "You're carrying so much stuff!";
		mes "You better put some of that";
		mes "into Kafra Storage~";
		close;
	}
	mes "[Enricher Blacksmith]";
	mes "Good day!";
	mes "Have you collected any";
	mes "Rough Eluniums or Eluniums?";
	mes "If you do, I can make a";
	mes "Enriched Elunium for you!";
	next;
	mes "[Enricher Blacksmith]";
	mes "Oh, and another thing,";
	mes "Having an ability to make an Enriched Elunium is a rare talent.";
	mes "So I require you to pay me 100000 zeny for each Enriched Elunium you want me to make.";
	next;
	mes "So just give me 50 Rough Eluniums or 10 Eluniums, then I'll create 1 Enriched Elunium for you?";
	next;
	mes "So what's your decision?";
	next;
	switch(select("Sure!:Are there no other ways?:No, thanks.")) {
	case 1:
		mes "[Enricher Blacksmith]";
		mes "So which item do";
		mes "you want to give me?";
		mes "50 Rough Eluniums or 10 Eluniums?";
		next;
		switch(select("Rough Eluniums:Eluniums:Cancel")) {
		case 1: callfunc "F_PotExchange",757,50;
		case 2: callfunc "F_PotExchange",985,10;
		case 3:
			mes "[Enricher Blacksmith]";
			mes "Sure~";
			mes "No problem.";
			close;
		}
	case 2:
		mes "[Enricher Blacksmith]";
		mes "Other ways...?";
		mes "Well, you can contact a GM,";
		mes "to purchased an Enriched Elunium";
		mes "^FF0000in REAL CASH!^000000,";
		close;
	case 3:
		mes "[Enricher Blacksmith]";
		mes "Alright,";
		mes "no problem.";
		mes "But come back to me";
		mes "if you change your mind.";
		close;
	}
}


function	script	F_PotExchange	{
	if (countitem(getarg(0)) < getarg(1)) {
		mes "[Enricher Blacksmith]";
		mes "Hey, where are";
		mes "all those "+getitemname(getarg(0))+"";
		mes "that you promised?";
		mes "Give me "+getitemname(getarg(0))+"!";
		close;
	}
	else {
		mes "[Enricher Blacksmith]";
		mes "Okay, let me check";
		mes "how many "+getitemname(getarg(0))+" you";
		mes "have on you. Hmm...";
		next;
		mes "[Enricher Blacksmith]";
		mes "You have";
		mes "a total of " + countitem(getarg(0)) + " "+getitemname(getarg(0))+".";
		mes "I can give you a total";
		mes "of " + (countitem(getarg(0))/getarg(1)) + " Enriched Eluniums for those.";
		next;
		mes "[Enricher Blacksmith]";
		mes "What do you say?";
		mes "Do we have a deal?";
		next;
		if (select("Deal.:No deal.") == 1) {
			mes "[Enricher Blacksmith]";
			mes "You know the exact";
			mes "number of Enriched Eluniums";
			mes "you want to receive for";
			mes "those "+getitemname(getarg(0))+", don't you?";
			next;
			mes "[Enricher Blacksmith]";
			mes "Now, I can trade you";
			mes "a minimum of 1 Enriched Elunium";
			mes "and a maximum of 100 Enriched Eluniums";
			mes "at one time. If you change your";
			mes "mind, just enter '0' to cancel.";
			next;
			while(1) {
				input .@input,0,101;
				if (.@input == 0) {
					mes "[Enricher Blacksmith]";
					mes "What...?";
					mes "Why the hell do you";
					mes "even bother to talk to me?";
					mes "Pretty indecisive, aren't you?";
					close;
				}
				else if (.@input > 100) {
					mes "[Enricher Blacksmith]";
					mes "I can't give you more";
					mes "than 100 Enriched Eluniums";
					mes "at once. Let's try";
					mes "this again.";
					next;
				}
				else {
					break;
				}
			}

			set .@put_out_item,.@input * getarg(1);
			if (countitem(getarg(0)) < .@put_out_item) {
				mes "[Enricher Blacksmith]";
				mes "Uh oh, the number you entered doesn't seem right. You better check the number of Enriched Eluniums that you can trade for again.";
				close;
			}
			set .@total_cost,.@put_out_item * 10000;
			if (Zeny < .@Total_cost) {
				mes "[Enricher Blacksmith]";
				mes "Oh, whoa~!";
				mes "You don't have enough";
				mes "zeny to complete this transaction";
				mes "You need to have";
				mes "at least " + .@total_cost + " zeny.";
				close;
			}
			mes "[Enricher Blacksmith]";
			mes "There you go!";
			mes "Check how many Enriched Eluniums";
			mes "I've given you, it should be good. Thanks, that was a good deal~";

			set Zeny,Zeny-.@total_cost;
			delitem getarg(0),.@put_out_item; //Rough or Elu
			getitem 7619,.@input; //Enriched Eluniums
			close;
		}
		mes "[Enricher Blacksmith]";
		mes "Huh~";
		mes "Alright.";
		mes "Though aren't";
		mes "Enriched Eluniums more useful";
		mes "to an adventurer like you?";
		close;
	}
}
[/SPOILER]
 
Back
Top