Jump to content
  • 0

Live Inventory item Detector


Nerks

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

Hi to all,

 

Guys can you help me give me some example of script that the live npc detect if the player holding some specific item....

How the NPC detect the specific item on the specific MAP.

Thank you for your help in advance.

God Bless

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

-	script	ItemCheck 	-1,{
OnPCLoadMapEvent:
	getmapxy(.@map$,.@mapx,.@mapy,0);
		if(.@map$!="prt_fild01") end;
			if(countitem(501) > 0){ //501 change to your item number
			warp "prontera",156,191; //warp to map when you have the item
			end;
			}
		}

prt_fild01	mapflag	loadevent

 

Edited by crazyarashi
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

It seems it load on first land on the map?

it can check if i drop the item and i pick again and i drop again?

ex.

i pick candy = true then <condition>

i drop candy = true then <condition>

i pick again candy = true then <condition>

i drop again candy = true then <condition>

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

-	script	ItemCheck 	-1,{

OnPCLoadMapEvent:
	getmapxy(.@map$,.@mapx,.@mapy,0);
		if(.@map$!="prt_fild01") end;
			if(strcharinfo(3) == .@map$){
				if(countitem(.item)){
					mes "You have "+getitemname(.item)+" in your inventory.";
					next;
					mes "This is not allowed in this map";
					warp "prontera",255,55;
			} else {
					addtimer(1000 * .time), ("ItemCheck")+"::OnPCLoadMapEvent";
					}
				}
OnInit:
	.item = 12345;
	.time = 3;
end;
}		

prt_fild01	mapflag	loadevent

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   4
  • Joined:  07/29/17
  • Last Seen:  

13 hours ago, crazyarashi said:

-	script	ItemCheck 	-1,{

OnPCLoadMapEvent:
	getmapxy(.@map$,.@mapx,.@mapy,0);
		if(.@map$!="prt_fild01") end;
			if(strcharinfo(3) == .@map$){
				if(countitem(.item)){
					mes "You have "+getitemname(.item)+" in your inventory.";
					next;
					mes "This is not allowed in this map";
					warp "prontera",255,55;
			} else {
					addtimer(1000 * .time), ("ItemCheck")+"::OnPCLoadMapEvent";
					}
				}
OnInit:
	.item = 12345;
	.time = 3;
end;
}		

prt_fild01	mapflag	loadevent

 

Thanks i'll try this one later

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