angelingh Posted September 9, 2016 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 61 Reputation: 0 Joined: 05/24/16 Last Seen: October 27, 2016 Share 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 Link to comment Share on other sites More sharing options...
0 Emistry Posted September 10, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 15 hours ago Share 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 Link to comment Share on other sites More sharing options...
0 angelingh Posted September 10, 2016 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 61 Reputation: 0 Joined: 05/24/16 Last Seen: October 27, 2016 Author Share Posted September 10, 2016 pls someone can help me i found some walk npc but no one work:( Quote Link to comment Share on other sites More sharing options...
0 Paroxysm Posted September 10, 2016 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 199 Reputation: 113 Joined: 12/24/11 Last Seen: October 29, 2020 Share 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 Link to comment Share on other sites More sharing options...
0 Start_ Posted September 10, 2016 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 950 Reputation: 180 Joined: 04/05/13 Last Seen: 5 hours ago Share 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 Link to comment Share on other sites More sharing options...
0 angelingh Posted September 10, 2016 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 61 Reputation: 0 Joined: 05/24/16 Last Seen: October 27, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
0 Start_ Posted September 10, 2016 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 950 Reputation: 180 Joined: 04/05/13 Last Seen: 5 hours ago Share 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 Link to comment Share on other sites More sharing options...
0 angelingh Posted September 10, 2016 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 61 Reputation: 0 Joined: 05/24/16 Last Seen: October 27, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
0 Start_ Posted September 10, 2016 Group: Members Topic Count: 26 Topics Per Day: 0.01 Content Count: 950 Reputation: 180 Joined: 04/05/13 Last Seen: 5 hours ago Share Posted September 10, 2016 (edited) Any error sir? Are you using lastest rAthena? Edited September 10, 2016 by TARTs Quote Link to comment Share on other sites More sharing options...
0 angelingh Posted September 11, 2016 Group: Members Topic Count: 25 Topics Per Day: 0.01 Content Count: 61 Reputation: 0 Joined: 05/24/16 Last Seen: October 27, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
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 angelinghLink to comment
Share on other sites
9 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.