angelingh Posted September 9, 2016 Posted September 9, 2016 (edited) 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 Edited September 9, 2016 by angelingh Quote
0 Emistry Posted September 10, 2016 Posted September 10, 2016 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; } 1 Quote
0 angelingh Posted September 10, 2016 Author Posted September 10, 2016 pls someone can help me i found some walk npc but no one work:( Quote
0 Paroxysm Posted September 10, 2016 Posted September 10, 2016 try this OnInit: while( 1 ){ npcwalkto <x>,<y>; sleep 1000; npcwalkto <x>,<y>; sleep 1000; npcwalkto <x>,<y>; sleep 1000; } end; Quote
0 Start_ Posted September 10, 2016 Posted September 10, 2016 (edited) 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 September 10, 2016 by TARTs Quote
0 angelingh Posted September 10, 2016 Author Posted September 10, 2016 (edited) 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 edit i try change the name its no load too Edited September 10, 2016 by angelingh Quote
0 Start_ Posted September 10, 2016 Posted September 10, 2016 (edited) 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 September 10, 2016 by TARTs Quote
0 angelingh Posted September 10, 2016 Author Posted September 10, 2016 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 Quote
0 Start_ Posted September 10, 2016 Posted September 10, 2016 (edited) Any error sir? Are you using lastest rAthena? Edited September 10, 2016 by TARTs Quote
0 angelingh Posted September 11, 2016 Author Posted September 11, 2016 (edited) 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 September 11, 2016 by angelingh Quote
Question
angelingh
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
Edited by angelingh9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.