Request NPC Script

ThyroDree

New member
Messages
556
Points
0
Location
Philippines
Github
bosxkate23
Emulator
Can i request npc script that the npc requires/checks an item to go inside the map to start hunting. Like NPC Requires : Old Pick(Inventory Etc,.) and Alice Doll(Wearing) to Go Inside the map.

Please Help.

THANKS in ADVANCE
default_smile.png


 
Code:
if ( countitem(7318) && getequipid(1) == 5137 ) {    // allow them to go to the map}
 
Last edited by a moderator:
if ( countitem(7318) && getequipid(1) == 5137 ) {    // allow them to go to the map}
can you make example npc script allows to go inside guild_vs3 but need to wear a Alice Doll and Needs an Old Pick. 

Sorry. Newbie
default_sad.png


 
prontera,150,150,0 script Sample 100,{ if ( countitem(7318) && getequipid(1) == 5137 ) { // allow them to go to the map warp "guild_vs3",0,0; end; }}

Code:
-	script	Sample	-1,{	OnPCLoadMapEvent:		getmapxy(.@map$,.@x,.@y,0);		if ( .@map$ == "guild_vs3" ) {			if ( !countitem(7318) || getequipid(1) != 5137 ) {				message strcharinfo(0),"You need to have alice doll and old pick";				sleep2 2000;				warp "SavePoint",0,0;			}		}		end;}guild_vs3	mapflag	loadevent
1st script is for warper

2nd script is a checker

 
Last edited by a moderator:
prontera,150,150,0 script Sample 100,{ if ( countitem(7318) && getequipid(1) == 5137 ) { // allow them to go to the map warp "guild_vs3",0,0; end; }}
THANKS!
default_smile.png
I'll try this. but how can i add if a player talks to npc and don't have the required items, the npc says: You Need Alice Doll and Old Pick to Go inside. 1x Old Pick Item will removed by the npc, because used it to go into guild_vs3. but Alice Doll remains.
 
Last edited by a moderator:
Can you make the 1x Old Pick item will removed because it will be used like for digging to go to guild_vs3

 
Last edited by a moderator:
Add this line before warping them to the map:

Code:
delitem 7318, 1;
 
Last edited by a moderator:
Code:
prontera,150,150,0    script    Sample    100,{    if ( countitem(7318) && getequipid(1) == 5137 ) {		// allow them to go to the map		delitem 7318, 1;		warp "guild_vs3",0,0;		end;    }}
 
prontera,150,150,0    script    Sample    100,{    if ( countitem(7318) && getequipid(1) == 5137 ) { // allow them to go to the map delitem 7318, 1; warp "guild_vs3",0,0; end;    }}
then what is this sir?

- script Sample -1,{

OnPCLoadMapEvent:

getmapxy(.@map$,.@x,.@y,0);

if ( .@map$ == "guild_vs3" ) {

if ( !countitem(7318) || getequipid(1) != 5137 ) {

message strcharinfo(0),"You need to have alice doll and old pick";

sleep2 2000;

warp "SavePoint",0,0;

}

}

end;

}

guild_vs3 mapflag loadevent

 
That kicks you out of the map "guild_vs3" and sends you to your save point if you don't have item 7318 in your inventory or item 5137 equipped. I recommend you use the other script; don't use both.

 
That kicks you out of the map "guild_vs3" and sends you to your save point if you don't have item 7318 in your inventory or item 5137 equipped. I recommend you use the other script; don't use both.
how can i make the script checker work?

 
It works fine, but won't delete your pick. Here's a version that does:

Code:
-	script	Sample	-1,{	 OnPCLoadMapEvent:        getmapxy(.@map$, .@x, .@y, 0);		        if (.@map$ == "guild_vs3") {            if (!countitem(7318) || getequipid(1) != 5137) {                message strcharinfo(0),"You need to have an Alice Doll equipped and 1 Old Pick to proceed!";				                sleep2 1000;                warp "SavePoint", 0, 0;            }						delitem 7318, 1;			message strcharinfo(0), "1 Old Pick has been deleted from your inventory.";        }		        end;} guild_vs3	mapflag	loadevent
 
It works fine, but won't delete your pick. Here's a version that does:

- script Sample -1,{  OnPCLoadMapEvent:        getmapxy(.@map$, .@x, .@y, 0);         if (.@map$ == "guild_vs3") {            if (!countitem(7318) || getequipid(1) != 5137) {                message strcharinfo(0),"You need to have an Alice Doll equipped and 1 Old Pick to proceed!";                 sleep2 1000;                warp "SavePoint", 0, 0;            } delitem 7318, 1; message strcharinfo(0), "1 Old Pick has been deleted from your inventory.";        }         end;} guild_vs3 mapflag loadevent
Done! THANKS! Can you teach me how to add timer? like you can only stay inside  for 10mins
 
Change :

sleep2 1000; 
to :

sleep2 600000;
If you want them to stay for 10 minutes

 
Last edited by a moderator:
Back
Top