Jump to content
  • 0

N> Easy NPC scripts please


Rocky Road

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

Guys hi!!

Just wanna ask if some of you can give me some of this kind of npc..

1.) An NpC that can warp you to a certain map but it will ask for an item(Key) before warping you.

2.) An NpC that will ask for a certain item to trade its just like trading item with the npc? like npc will ask for 10 jellopy 10 apple for his 1 key..

hope you have it guys thanks

Link to comment
Share on other sites

15 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
 
 
//Item trader
prontera,124,124,4 script Trader#Key 123,{
 
//Item ID for key
.@key_id = 512;
 
mes "[^0000FFKey Trader^000000]";
mes "I can give you a "+ getitemname(.@key_id)+" for ^FF0000 jellopy^000000 and ^FF000010 apples^000000!";
select("Trade items for a key");
if(countitem(909) >= 10 && countitem(512) >= 10) {
mes "Here you go!";
delitem 909,10;
delitem 512,10;
getitem .@key_id,1;
} else mes "You don't have enough of the items I need!";
close;
}
Edit: Aww beat to it :P

Cool! thank you all guys!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

1.) An NpC that can warp you to a certain map but it will ask for an item(Key) before warping you.

 

I tested this one and it works.

prontera,150,150,4	script	Secret Agent	85,{

set .@required, 501; // item Required
set .@amount, 10; // item amount
if(countitem(.@required) <= .@amount) { mes "I'm sorry, you are missing the "+ .@required +" for payment"; close; }

if(countitem(.@required) >= .@amount) { mes "Good, then let's move one. shall we?";
next;
warp "prontera",150,150;
delitem .@required, .@amount;
	}
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

1.) An NpC that can warp you to a certain map but it will ask for an item(Key) before warping you.

I tested this one and it works.

prontera,150,150,4	script	Secret Agent	85,{

set .@required, 501; // item Required
set .@amount, 10; // item amount
if(countitem(.@required) <= .@amount) { mes "I'm sorry, you are missing the "+ .@required +" for payment"; close; }

if(countitem(.@required) >= .@amount) { mes "Good, then let's move one. shall we?";
next;
warp "prontera",150,150;
delitem .@required, .@amount;
	}
}

Cool! Thanks i will try this later...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id)) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
 
 
//Item trader
prontera,124,124,4 script Trader#Key 123,{
 
//Item ID for key
.@key_id = 512;
 
mes "[^0000FFKey Trader^000000]";
mes "I can give you a "+ getitemname(.@key_id)+" for ^FF000010 jellopy^000000 and ^FF000010 apples^000000!";
select("Trade items for a key");
if(countitem(909) >= 10 && countitem(512) >= 10) {
mes "Here you go!";
delitem 909,10;
delitem 512,10;
getitem .@key_id,1;
} else mes "You don't have enough of the items I need!";
close;
}

Edit: Aww beat to it :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
 
 
//Item trader
prontera,124,124,4 script Trader#Key 123,{
 
//Item ID for key
.@key_id = 512;
 
mes "[^0000FFKey Trader^000000]";
mes "I can give you a "+ getitemname(.@key_id)+" for ^FF000010 jellopy^000000 and ^FF000010 apples^000000!";
select("Trade items for a key");
if(countitem(909) >= 10 && countitem(512) >= 10) {
mes "Here you go!";
delitem 909,10;
delitem 512,10;
getitem .@key_id,1;
} else mes "You don't have enough of the items I need!";
close;
}
Edit: Aww beat to it :P

Sir on warper how can i make like you just to bring a key to the npc but the npc will not get your key? its just like he will check if you have the key so you can be warped?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id)) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
 

That will only check if the player has the key, it won't take it away.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id)) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
That will only check if the player has the key, it won't take it away.

Oh thanks!!!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id)) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
That will only check if the player has the key, it won't take it away.

sory wrong quote

//Warper for key item. 
prontera,123,123,4 script Warper#Key 123,{
 
//Item ID for key.
.@key_id = 512;
 
if(countitem(.@key_id)) warp "prontera",123,123;
else message strcharinfo(0),"You need a "+ getitemname(.@key_id) +" to be warped!";
end;
}
That will only check if the player has the key, it won't take it away.

Sir for your warper.. why the npc is taking away the required items? and the amount was 1 but i need to bring 2pcs to be warped and if i bring 2 only 1 item will be deleted.. but if i bring only 1 he wont warped me help please

Edited by chromus24
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

That portion of the script does not take away any items. I've tested it on my own server and it works. I'm not sure why you're having difficulty.

You exchange 10 Jellopy and 10 Apples for the key item (That will remove the 20 jellopy/apples)

The warper itself only checks if the player has the key in his or her inventory... it will never remove an item.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

That portion of the script does not take away any items. I've tested it on my own server and it works. I'm not sure why you're having difficulty.

You exchange 10 Jellopy and 10 Apples for the key item (That will remove the 20 jellopy/apples)

The warper itself only checks if the player has the key in his or her inventory... it will never remove an item.

really? :( why it is removing item on me :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  263
  • Reputation:   1
  • Joined:  04/25/13
  • Last Seen:  

That portion of the script does not take away any items. I've tested it on my own server and it works. I'm not sure why you're having difficulty.

You exchange 10 Jellopy and 10 Apples for the key item (That will remove the 20 jellopy/apples)

The warper itself only checks if the player has the key in his or her inventory... it will never remove an item.

//-----Warper key trader
payon,190,223,4	script	Orc's Keeper	431,{

set .@required, 23003; // item Required
set .@amount, 1; // item amount
if(countitem(.@required) <= .@amount) { mes "Please bring Orc's Keeper Key("+ .@required +") for payment"; close; }

if(countitem(.@required) >= .@amount) { mes "Good, then let's move one. shall we?";
next;
warp "bossnia_04",203,203;
delitem .@required, .@amount;
	}
}
 
 
//Item trader
prontera,130,198,6	script	Orc's Key Holder#Key	443,{
 
//Item ID for key
.@key_id = 23003;
 
mes "[^0000FFOrc's Key Holder^000000]";
mes "Do you want the Key to enter on Orc's Memory? BEWARE!! Weak shall not be in that dungeon Only those have a Powerful Equipment can fight and deal with the orc's!! Or else you will be doomed!!";
next;
mes "[^0000FFOrc's Key Holder^000000]";
mes "I can give you a "+ getitemname(.@key_id)+" for ^FF0000 25x Mother's Nightmare^000000 and ^FF000010 Yellow Key^000000!";
select("Trade items for a key");
if(countitem(7020) >= 25 && countitem(7422) >= 10) {
mes "Here you go!";
delitem 7020,25;
delitem 7422,10;
getitem .@key_id,1;
} else mes "You don't have enough of the items I need";
close;

here is the script sir

 

and btw sir this part i have a problem

 

"Please bring Orc's Keeper Key("+ .@required +") for payment"

 

it shows like "Please bring Orc's Keeper Key(ID NUMBER) for the payment

itried also the first one who told me without () and its like

 

Please bring IDNUM for payment    

it didnt show the name of the item bu the id number instead

Edited by chromus28
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

 

That portion of the script does not take away any items. I've tested it on my own server and it works. I'm not sure why you're having difficulty.

You exchange 10 Jellopy and 10 Apples for the key item (That will remove the 20 jellopy/apples)

The warper itself only checks if the player has the key in his or her inventory... it will never remove an item.

//-----Warper key trader
payon,190,223,4	script	Orc's Keeper	431,{

set .@required, 23003; // item Required
set .@amount, 1; // item amount
if(countitem(.@required) <= .@amount) { mes "Please bring Orc's Keeper Key("+ .@required +") for payment"; close; }

if(countitem(.@required) >= .@amount) { mes "Good, then let's move one. shall we?";
next;
warp "bossnia_04",203,203;
delitem .@required, .@amount;
	}
}
 
 
//Item trader
prontera,130,198,6	script	Orc's Key Holder#Key	443,{
 
//Item ID for key
.@key_id = 23003;
 
mes "[^0000FFOrc's Key Holder^000000]";
mes "Do you want the Key to enter on Orc's Memory? BEWARE!! Weak shall not be in that dungeon Only those have a Powerful Equipment can fight and deal with the orc's!! Or else you will be doomed!!";
next;
mes "[^0000FFOrc's Key Holder^000000]";
mes "I can give you a "+ getitemname(.@key_id)+" for ^FF0000 25x Mother's Nightmare^000000 and ^FF000010 Yellow Key^000000!";
select("Trade items for a key");
if(countitem(7020) >= 25 && countitem(7422) >= 10) {
mes "Here you go!";
delitem 7020,25;
delitem 7422,10;
getitem .@key_id,1;
} else mes "You don't have enough of the items I need";
close;

here is the script sir

 

and btw sir this part i have a problem

 

"Please bring Orc's Keeper Key("+ .@required +") for payment"

 

it shows like "Please bring Orc's Keeper Key(ID NUMBER) for the payment

itried also the first one who told me without () and its like

 

Please bring IDNUM for payment    

it didnt show the name of the item bu the id number instead

 

 

Here please test this one.

//-----Warper key trader
payon,190,223,4	script	Orc's Keeper	431,{

set .@npc$,"[^FF0000Orc's Keeper^000000]";
set .@required, 501; // item Required
set .@amount,1; // item amount

mes .@npc$;
mes "Welcome Stranger";
menu "Warp, Me Please!",-,"Nothing...",No;

if(countitem(.@required) < .@amount)
{

mes "I am sorry, you are missing " + .@amount + "x of " + getitemname(.@required) + ", please come back when you got the item..";
end;
}
if(countitem(.@required))
{

mes "Lets Go!";
warp "bossnia_04",203,203;
delitem .@required, .@amount;
end;
}
No:
mes "Come Again sometime";
close;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

...The original script does not remove an item and functions 100% on rAthena. There is no possible way that the script I posted is removing any item when using the warper.

 

You can feel free to try out the other two scripts that were posted here, but I would be more worried about figuring out why you're getting unexpected results from NPCs. 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  72
  • Reputation:   0
  • Joined:  11/08/14
  • Last Seen:  

...The original script does not remove an item and functions 100% on rAthena. There is no possible way that the script I posted is removing any item when using the warper.

I dunno why i have some difficulty on that script :( let me try the last you gave me

...The original script does not remove an item and functions 100% on rAthena. There is no possible way that the script I posted is removing any item when using the warper.

You can feel free to try out the other two scripts that were posted here, but I would be more worried about figuring out why you're getting unexpected results from NPCs.

It still removing the item :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

I'm not going to keep going back and forth with you about this issue, the script provided in no way will ever remove the key from the players inventory when warped.

You'll have to come up with your own script or use another one that has been provided in this thread.

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