Jump to content
  • 0

require item


VladimirCastro

Question


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

how can i require an item before using the npc?

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// eAmod Project - Scripts
// --------------------------------------------------------------------------
// Script Name : Headgear to Costume converter
// --------------------------------------------------------------------------
// Description :
// Allows a user to convert the equipped headgear (on Top, Mid or Low) into a
// costume item. It will remove any card and refine of the Item.
// --------------------------------------------------------------------------

-	script	Costume-IT	-1,{
	mes "[Costume-IT]";
	mes "Hello and welcome to the Costume-IT service.";
	mes "Here you can convert your headgears into a Costume Headgear.";
	next;
	mes "[Costume-IT]";
	mes "Please, select what to convert.";
	mes "Remember, cards and refine will be removed.";
	next;

	setarray .@Position$[1],"Top","Mid","Low";
	setarray .@Position[1],     1,    9,   10;

	set .@Menu$,"";
	for( set .@i, 1; .@i < 4; set .@i, .@i + 1 )
	{
		if( getequipisequiped(.@Position[.@i]) )
			set .@Menu$, .@Menu$ + .@Position$[.@i] + "-" + "[" + getequipname(.@Position[.@i]) + "]";

		set .@Menu$, .@Menu$ + ":";
	}

	set .@Part, .@Position[ select(.@Menu$) ];
	if( !getequipisequiped(.@Part) )
	{
		mes "[Costume-IT]";
		mes "Your not wearing anything there...";
		close;
	}

	mes "[Costume-IT]";
	mes "You want to Costume your " + getitemname(getequipid(.@Part)) + "?";
	next;
	if( select("Yes, proceed:No, I am sorry.") == 2 )
	{
		mes "[Costume-IT]";
		mes "Need some time to think about it, huh?";
		mes "Alright, I can understand.";
		close;
	}
	
	costume .@Part; // Convert the Headgear

	mes "[Costume-IT]";
	mes "Done, enjoy your costume headgear.";
	close;
}

// --------------------------------------------------------------------------
// Use duplicates to put your npc on different cities
// --------------------------------------------------------------------------

prontera,140,168,4	duplicate(Costume-IT)	Costume-IT#1	864
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  

If you want to have to use the item and delete it, you have to do:

mes "[Costume-IT]";
	if( !countitem(<item_id>) < 20) {
		mes "I'm sorry but you need at least one "+getitemname(<item_id>)+" before you may use my services!";
		close;
	}
        delitem <item_id>, 20;
	mes "Hello and welcome to the Costume-IT service.";
	mes "Here you can convert your headgears into a Costume Headgear.";
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


mes "[Costume-IT]";

if( !countitem(<item_id>) ) {

mes "I'm sorry but you need at least one "+getitemname(<item_id>)+" before you may use my services!";

close;

}

mes "Hello and welcome to the Costume-IT service.";

mes "Here you can convert your headgears into a Costume Headgear.";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

the items is like 20pcs tcg how to add the count of item

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


if( countitem(<item_id>) < 20 ) {

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  114
  • Topics Per Day:  0.03
  • Content Count:  298
  • Reputation:   4
  • Joined:  03/13/12
  • Last Seen:  

he didnt get my tcg :( its not working

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@GM Kinko

at least learn to show some more details /swt

 

map server error ?

what your current script look like ?

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