Jump to content
  • 0

Grape Juice Voucher/Voucher Redemption NPC


Question

Posted

Hello All! I looked through a lot of the forums and couldn't quite find what I was looking for in a script.

Would I be able to get help with:

-Making a script that will allow all mobs to drop an item at a low rate titled "Grape Juice Voucher". (I understand this would need to go into my itemdatabase -?-) 

-An NPC that will redeem 1 voucher for 1 Grape Juice.

 

This is something that I used to see on a very old server that I played on and really enjoyed the concept. I'm just at a complete loss of how to make it happen, as I am relatively new to scripting. Any help would be greatly appreciated. Please let me know if you have any questions. Thank you!

2 answers to this question

Recommended Posts

  • 0
Posted

This request is very simple on the scripting side of it as all a script will do is take/give the appropriate items.

The majority of the work will come from you adding your custom item (voucher) and adding the item to the mob's drop table (mob_db). Once you do this, let us know what your voucher item ID is and we can script the exchange NPC.

  • 0
Posted

//35000,Grape_Voucher,Grape Voucher,3,0,,10,,,,,,,,,,,,,{},{},{} //Add in import item_db.txt
Adding Custom Item

//adds global monster drop of grape voucher
-	script	Grape_Voucher	-1,{

OnNPCKillEvent:
	if( rand(100) < 10 ) //drops at 10%
		getitem  .item,1;
		end;
OnInit:
	set .item,35000; //item id here
	end;
	}

//Voucher Exchange
prontera,255,55,4	script	Voucher_Exchange	117,{
	if(countitem(.grapes) == 0){
	mes "[Grape Merchant]";
	mes "Good Day, I'm trading my grape juice for grape vouchers!";
	next;
	mes "[Grape Merchant]";
	mes "If you found vouchers feel free to trade it to me";
	close;
	} else {
	mes "[Grape Merchant]";
	mes "Seems like you have vouchers do you want to trade?!";
	next;
	if(select("Yes:Quit")==2) close;
	mes "[Grape Merchant]";
	mes "How many do you want to exchange?";
	input .@amount;
	if(countitem(.grapes) >= .@amount){
		mes "[Grape Merchant]";
		mes "Here you go!";
		delitem .grapes,.@amount;
		getitem .juice,.@amount;
		end;
		} else {
		mes "[Grape Merchant]";
		mes "You dont have this kind of amount";
		close;
		}
	}
OnInit:
set .grapes,35000; //voucher id here
set .juice,533; //grape juice id
end;
}

 

 

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...