Jump to content
  • 0

Help about this script!


Question

Posted (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 by Radian
please use codebox next time

3 answers to this question

Recommended Posts

  • 0
Posted

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!

  • 0
Posted

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;
  • 0
Posted
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]")) {

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...