Jump to content
  • 0

two walking npc


angelingh

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  05/24/16
  • Last Seen:  

hi i need two walking npc i hope someone can help me

 

 

1 npc walk and he ask for trade items just for test do trade id 512(apple) to 515(Carrost)

and the npc say in chat "T>your Apples to my Carrost"

and the npc ask how much you want trade put number and he trade for some number like i put 50apple and trade so the npc give me 50 Carrost

 

 

and one npc ask for buy items

just for test

the npc want buy apple for Carrot

for 1m zeny(just test)

and the npc say in chat "B>Apple 1m"

and the npc ask how much you want to sell

just put number and its sold to npc(1m per each just for test)

 

the npc move randomly in the map

 

note pls make easy to change the item id and the price :)

 

ty :meow:

Edited by angelingh
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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

npc 1

prontera,155,175,5	script	Sample#npc1	4_F_KAFRA9,{
	
	mes "Do you want Carrot?";
	if ( select( "Trade my Apple to Carrots","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			getitem 515,.@count;
			delitem 512,.@count;
		}
		mes "Exchanged "+.@count+"x Apple to Carrot";
	}
	close;
	
	OnInit:
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}

npc 2

prontera,155,175,5	script	Sample#npc2	4_F_KAFRA9,{
	
	mes "Do you have apple?";
	if ( select( "Sell Apple to NPC","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			delitem 512,.@count;
			Zeny += ( .@count * 1000000 );
		}
		mes "Sold "+.@count+"x Apple to NPC";
	}
	close;
	
	OnInit:
		waitingroom "B>Apple for 1M",0;
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  05/24/16
  • Last Seen:  

pls someone can help me i found some walk npc but no one work:(

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  199
  • Reputation:   113
  • Joined:  12/24/11
  • Last Seen:  

try this

OnInit:
while( 1 ){
    npcwalkto <x>,<y>;
    sleep 1000;
    npcwalkto <x>,<y>;
    sleep 1000;
    npcwalkto <x>,<y>;
    sleep 1000;
}
end;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  928
  • Reputation:   170
  • Joined:  04/05/13
  • Last Seen:  

prontera,156,184,0 script YOUR_NPC_NAME 899,{


set .@STOPWALK,"1";


//YOUR SCRIPT HERE


//
//
//


//YOUR SCRIPT END HERE


set .@STOPWALK,"0";


close;


OnInit:
if(.@STOPWALK == 0){
addrid(0);
while(1){
npcspeed 300;
if (getmapxy(@mapname$, @mapx, @mapy, UNITTYPE_NPC, "YOUR_NPC_NAME") !=0) {
end;
}
set .@X_RANDOM,rand(-5,5);
set .@Y_RANDOM,rand(-5,5);
npcwalkto @mapx+.@X_RANDOM,@mapy+.@Y_RANDOM;
sleep2 5000;
}
}
end;
}
Edited by TARTs
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  05/24/16
  • Last Seen:  

 

prontera,156,184,0 script YOUR_NPC_NAME 899,{


set .@STOPWALK,"1";


//YOUR SCRIPT HERE


//
//
//


//YOUR SCRIPT END HERE


set .@STOPWALK,"0";


close;


OnInit:
if(.@STOPWALK == 0){
addrid(0);
while(1){
npcspeed 300;
if (getmapxy(@mapname$, @mapx, @mapy, UNITTYPE_NPC, "YOUR_NPC_NAME") !=0) {
end;
}
set .@X_RANDOM,rand(-5,5);
set .@Y_RANDOM,rand(-5,5);
npcwalkto @mapx+.@X_RANDOM,@mapy+.@Y_RANDOM;
sleep2 5000;
}
}
end;
}

ty!!

but i have problem with that too maybe you know how fix its?

the npc not load

PAoPHMT.png

 

edit i try change the name its no load too

Edited by angelingh
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  928
  • Reputation:   170
  • Joined:  04/05/13
  • Last Seen:  

using TAB

 

not Spacebar in first line of scripts.

 

prontera,156,184,0>>TAB HERE<<script>>TAB HERE<<YOUR_NPC_NAME>>TAB HERE<<899,{

Edited by TARTs
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  05/24/16
  • Last Seen:  

using TAB

 

not Spacebar in first line of scripts.

 

prontera,156,184,0>>TAB HERE<<script>>TAB HERE<<YOUR_NPC_NAME>>TAB HERE<<899,{

ty now its load the npc

i need do someting for make its walk? its no moveing

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  928
  • Reputation:   170
  • Joined:  04/05/13
  • Last Seen:  

Any error sir?

 

Are you using lastest rAthena?

Edited by TARTs
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  61
  • Reputation:   0
  • Joined:  05/24/16
  • Last Seen:  

 

npc 1

prontera,155,175,5	script	Sample#npc1	4_F_KAFRA9,{
	
	mes "Do you want Carrot?";
	if ( select( "Trade my Apple to Carrots","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			getitem 515,.@count;
			delitem 512,.@count;
		}
		mes "Exchanged "+.@count+"x Apple to Carrot";
	}
	close;
	
	OnInit:
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}

npc 2

prontera,155,175,5	script	Sample#npc2	4_F_KAFRA9,{
	
	mes "Do you have apple?";
	if ( select( "Sell Apple to NPC","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			delitem 512,.@count;
			Zeny += ( .@count * 1000000 );
		}
		mes "Sold "+.@count+"x Apple to NPC";
	}
	close;
	
	OnInit:
		waitingroom "B>Apple for 1M",0;
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}

 

ty !!! :)

 

just question i test the first one and its move only one time? its have timer for moveing?

 

npc 1

prontera,155,175,5	script	Sample#npc1	4_F_KAFRA9,{
	
	mes "Do you want Carrot?";
	if ( select( "Trade my Apple to Carrots","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			getitem 515,.@count;
			delitem 512,.@count;
		}
		mes "Exchanged "+.@count+"x Apple to Carrot";
	}
	close;
	
	OnInit:
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}

npc 2

prontera,155,175,5	script	Sample#npc2	4_F_KAFRA9,{
	
	mes "Do you have apple?";
	if ( select( "Sell Apple to NPC","Cancel" ) == 1 ) {
		input .@count,0,countitem( 512 );
		if ( .@count ) {
			delitem 512,.@count;
			Zeny += ( .@count * 1000000 );
		}
		mes "Sold "+.@count+"x Apple to NPC";
	}
	close;
	
	OnInit:
		waitingroom "B>Apple for 1M",0;
		npcspeed 200;
		getmapxy( .npc_map$, .npc_x, .npc_y,1 );
		initnpctimer;
		end;
		
	OnTimer10000:
		.@x = .npc_x + rand( -10,10 );
		.@y = .npc_y + rand( -10,10 );
		npcwalkto .@x,.@y;
		setnpctimer 0;
		end;
}

 

 

using TAB

 

not Spacebar in first line of scripts.

 

prontera,156,184,0>>TAB HERE<<script>>TAB HERE<<YOUR_NPC_NAME>>TAB HERE<<899,{

 

 

ty its work good now !! :)

 

someone know where i can get all jobs walk npc id? i mean Sprite

  Edited by angelingh
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...