Dejavu Posted July 7, 2016 Group: Members Topic Count: 24 Topics Per Day: 0.01 Content Count: 44 Reputation: 3 Joined: 11/01/13 Last Seen: August 4, 2016 Share Posted July 7, 2016 (edited) can someone help fix this? i want this npc announce the name of the player who got reward with 1%-10% chance! thank you! setarray .P1[0],1,7179,1; //pods >>>>>>>> [0],1 = 1% setarray .P2[0],5,26224,1; //1>>>>>>>>>>>[0],5 = 5% prontera,141,181,5 script Lotti Girl 714,{ specialeffect 372; delitem .Cost[0], .Cost[1]; set .@i, rand(1,.Total); if (rand(1,100) > getd(".P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.Default); set .@j,.@j+2) { getitem .Default[.@j], .Default[.@j+1]; if (!.@k[0]) setarray .@k[0], .Default[.@j], .Default[.@j+1]; } } else { for(set .@j,1; .@j<getarraysize(getd(".P"+.@i)); set .@j,.@j+2) { getitem getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); if (!.@k[0]) setarray .@k[0], getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); } } specialeffect2 248; OnInit: // Format: <%>,<item ID>,<count>{,...}; setarray .P1[0],1,7179,1; //pods setarray .P2[0],5,26224,1; //1 setarray .P3[0],5,26225,1; //2 setarray .P4[0],5,26226,1; //3 setarray .P5[0],5,26227,1; //4 setarray .P6[0],5,26228,1; //5 setarray .P7[0],5,26229,1; //6 setarray .Default[0],607,1; //Berry setarray .Cost[0],26080,10; //Credit set .Total,7; end; } Edited July 7, 2016 by Radian please use codebox next time Quote Link to comment Share on other sites More sharing options...
0 Radian Posted July 7, 2016 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted July 7, 2016 Hi first of all you did create a similar title of the topic and I also moved this topic from request to support since you provide the script thank you! Quote Link to comment Share on other sites More sharing options...
0 Elsa Mist Posted July 7, 2016 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 387 Reputation: 60 Joined: 10/08/13 Last Seen: July 14, 2022 Share Posted July 7, 2016 1. getitem .Default[.@j], .Default[.@j+1]; announce "[ "+strcharinfo(0)+" ] just get blablabla....",0xFF6600; 2. getitem getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); announce "[ "+strcharinfo(0)+" ] just get blablabla.",0xFF6600; Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted July 8, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted July 8, 2016 if (rand(1,100) > getd(".P"+.@i+"[0]")) { change to .@rate = rand(1,100); if ( .@rate < 10 ) announce "[ "+strcharinfo(0)+" ] just get blablabla....",0xFF6600; if (.@rate > getd(".P"+.@i+"[0]")) { Quote Link to comment Share on other sites More sharing options...
Question
Dejavu
please use codebox next time
Link to comment
Share on other sites
3 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.