Jump to content
  • 0

Exchanger NPC Following Time & Amount


Question

Posted

hello guys 

Is it possible to make a script with the following conditions?

this script like skull exchanger
-poring coin to TCG
-its will give random amount 1k-4k poring coin to exchanger 1 TCG
-and this npc will only showup on 13:00,18:00,And 22:00, server time

8 answers to this question

Recommended Posts

Posted

Yes Its possible.

 

Are you requesting for it to be made or just asking if its possible ?



Havn't tested or checked, I also believe its poorly written but should work for now.
location,x,y,look	script	Exchanger	345,{

	// hello guys 
	// Is it possible to make a script with the following conditions?
	// this script like skull exchanger
	// -poring coin to TCG
	// -its will give random amount 1k-4k poring coin to exchanger 1 TCG
	// -and this npc will only showup on 13:00,18:00,And 22:00, server time
	///7539 (Poring_Coin)
	///7227 (TCG_Card)
	
OnClock1300: callsub createCoinRandom;	set .npcStart,1; end;
OnClock1400: set .npcStart,0; end;
OnClock1800: callsub createCoinRandom;	set .npcStart,1; end;
OnClock1900: set .npcStart,0; end;
OnClock2200: callsub createCoinRandom;	set .npcStart,1; end;
OnClock2300: set .npcStart,0; end;

	//=====================================================================
	createCoinRandom: 
		set .coinAmount, rand(1000,4000); //Set Random Coin Amount;
		return;
	//====================================================================
	
	if (.npcStart) //IF OPEN
	{		
		mes "[Exhanger]";
		mes "Hello " + strcharinfo(0)";
		mes "I am exchanging " + .coinAmount + " Right now for 1 TCG Card.";
		next;
		if(select("Make the trade:Walk away")==2)
			close;
		mes "[Exchanger]";
		if(countitem(7539)<.coinAmount)
		{
			mes "You need to bring me " + (.coinAmount - countitem(7538)) + " more Poring Coins before I complete this trade";
			close;
		}
		mes "Here you go, Enjoy";
		delitem 7538,.coinAmount;
		getitem 7227,1;
		close;
	}
	//IF CLOSED.
	mes "[Exchanger]";
	mes "Sorry, I am currently restocking items for opening later.";
	close;
}

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...