Deleted User Posted December 2, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Share Posted December 2, 2011 (edited) REMOVED Edited March 3, 2019 by Kaze Quote Link to comment Share on other sites More sharing options...
1 Toshiro Posted December 2, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 8 hours ago Share Posted December 2, 2011 (edited) I don't know either if there's already such script (but it probably is on the other forums), but I just wrote a basic script. Since I'm not at home I'm unable to test if it actually works. What the script does: - checks if the player is less then 5 cells away (checkdistance(...)<5) - check if player has required item (countitem(607), Ygg Berry in this case) - 60% chance (rand(0,100) < 60) to get the materials (getitem 501,1;) - basic protection to prevent massive farming (the npc will be disable for 30-60 seconds) map,x,y,0 script Name::identifier 111,{ getmapxy(.@dummy$, .@px, .@py, 0); // get Player coordinates getmapxy(.@dummy$, .@nx, .@ny, 1, strnpcinfo(3)); // get NPC coordinates // Check if player is near enough (distance < 5) if (distance(.@px, .@py, .@nx, .@ny) < 5) { // Check if user has required item [in this case: Ygg Berry#607] if (countitem(607)) { progressbar "0x00ff00", 2000; // 60% chance to obtain item if (rand(0,100) < 60) { getitem 501,1; // Red Potion#501 specialeffect2 154; donpcevent strnpcinfo(3)+"::OnDisable"; end; } specialeffect2 155; dispbottom "You didn't get anything this time."; end; } dispbottom "You don't have the necessary tools.."; end; } dispbottom "You're too far away."; end; OnDisable: disablenpc strnpcinfo(3); initnpctimer end; // 10% chance to reactivate after 30, 40 or 50 seconds. otherwise reactive after 60 seconds OnTimer30000: OnTimer40000: OnTimer50000: if (rand(0,100) < 90) end; OnTimer60000: OnEnable: stopnpctimer; enablenpc strnpcinfo(3); end; } Edited December 2, 2011 by Toshiro Quote Link to comment Share on other sites More sharing options...
0 gfxmrmark Posted December 2, 2011 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 148 Reputation: 8 Joined: 11/20/11 Last Seen: September 12, 2013 Share Posted December 2, 2011 can you post the script? Quote Link to comment Share on other sites More sharing options...
0 Deleted User Posted December 2, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Author Share Posted December 2, 2011 (edited) REMOVED Edited September 13, 2016 by Kaze Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted December 2, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 8 hours ago Share Posted December 2, 2011 Thanks for the Fast Reply, well..seems i got 'ERROR' line '10'? http://i42.tinypic.com/awyng8.png - Keenan Oh sorry, should have been "countitem" instead of "checkitem". Updated the script in the first post. Quote Link to comment Share on other sites More sharing options...
0 Deleted User Posted December 2, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Author Share Posted December 2, 2011 (edited) Thanks for the Fast Reply, well..seems i got 'ERROR' line '10'?http://i42.tinypic.com/awyng8.png- Keenan Oh sorry, should have been "countitem" instead of "checkitem". Updated the script in the first post. Removed Edited September 13, 2016 by Kaze Quote Link to comment Share on other sites More sharing options...
0 Panallox Posted December 2, 2011 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 117 Reputation: 169 Joined: 11/10/11 Last Seen: April 10, 2024 Share Posted December 2, 2011 @Keenan: You need to learn to start debugging scripts instead of relying on everyone to post up the fixes. It was a simple typo: if (distance(.@px, .@py, .@nx, .@xy) < 5) { Should be: if (distance(.@px, .@py, .@nx, .@ny) < 5) { Quote Link to comment Share on other sites More sharing options...
0 Deleted User Posted December 2, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 235 Reputation: 55 Joined: 12/02/11 Last Seen: February 26, 2021 Author Share Posted December 2, 2011 (edited) Removed. Edited September 13, 2016 by Kaze Quote Link to comment Share on other sites More sharing options...
0 Z3R0 Posted December 2, 2011 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 618 Reputation: 201 Joined: 11/09/11 Last Seen: June 14, 2024 Share Posted December 2, 2011 @Epoque or the person giving it to him should've tested it... You can't blame someone "requesting" a script, (meaning they can't obviously script it themselves) to debug a script... Quote Link to comment Share on other sites More sharing options...
0 Toshiro Posted December 2, 2011 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 8 hours ago Share Posted December 2, 2011 (edited) @Epoque or the person giving it to him should've tested it... You can't blame someone "requesting" a script, (meaning they can't obviously script it themselves) to debug a script... As I already wrote when posting the script, I have not been at home, so I was unable to test it.Also if I still would have been online when Keenan posted that it was still not working, I'd checked it again and would have fixed it anyways. Edited December 2, 2011 by Toshiro Quote Link to comment Share on other sites More sharing options...
0 Z3R0 Posted December 2, 2011 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 618 Reputation: 201 Joined: 11/09/11 Last Seen: June 14, 2024 Share Posted December 2, 2011 @Toshiro I understand that you weren't @ home, it's just, he quickly attacked the OP, when it was obvious he didn't really know how to script something like this in the first place... Quote Link to comment Share on other sites More sharing options...
Question
Deleted User
REMOVED
Link to comment
Share on other sites
10 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.