Jump to content
  • 0

Help about this script!


Dejavu

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  44
  • Reputation:   3
  • Joined:  11/01/13
  • Last Seen:  

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
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

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!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

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;
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

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]")) {
Link to comment
Share on other sites

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.

×
×
  • Create New...