Jump to content
  • 0

R> usable item multifunction


nirwannirwan

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/25/14
  • Last Seen:  

I want to create a usable item that can use the NPC script, and it's unlimited usable items
The NPC is an example can sell items and can also teleport

 

sorry for my bad english /oops

 

example picture in attach file

post-24875-0-26393400-1425042034_thumb.jpg

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

an example

Item_db.txt

512,Apple,Apple,11,15,,20,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "Cell-Phone"; },{},{}

npc

function	script	Cell-Phone	{
	message strcharinfo(0),"[Cell-Phone]: What would you like?";
	swithc(select("Warp:Call Pawn Shop")){
		case 2:
			close2;
			callshop "Tool Dealer#alb",<option>;
			//callshop "<name>",<option>;
			//The options are:
			//	0 = The normal window (buy, sell and cancel)
			//	1 = The buy window
			//	2 = The sell window
		break;
		case 1:
                        warp "Random",0,0;
		break;

	}
end;
}
Edited by Stolao
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/25/14
  • Last Seen:  

 

an example

Item_db.txt

512,Apple,Apple,11,15,,20,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "Cell-Phone"; },{},{}

npc

function	script	Cell-Phone	{
	message strcharinfo(0),"[Cell-Phone]: What would you like?";
	swithc(select("Warp:Call Pawn Shop")){
		case 2:
			close2;
			callshop "Tool Dealer#alb",<option>;
			//callshop "<name>",<option>;
			//The options are:
			//	0 = The normal window (buy, sell and cancel)
			//	1 = The buy window
			//	2 = The sell window
		break;
		case 1:
                        warp "Random",0,0;
		break;

	}
end;
}

I've saved npc script on the server, i try to click the item but it does not work.

I keep in npc/prime/kota/Cell-Phone.txt

bump

Edited by nirwannirwan
Link to comment
Share on other sites

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.

×
×
  • Create New...