Jump to content
EL Dragon

rentitem Proble

Recommended Posts

Also mein Item

12186,Red_Box,Old Red Box,2,50000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ if(rand(1,4)==1) rentitem 2629,86400; else if(rand(1,4)==2) rentitem 2630,86400; else if(rand(1,4)==3) rentitem 2410,86400; else if(rand(1,4)==4) rentitem 1530,86400; },{},{}

Allerdings bekomme ich als keine item z.b bei einem Test mit 10 boxen, Alls alle offen waren hatte ich nur 6 items

Wäre cool wenn jemand ne Lösung hat :D

Link to comment
Share on other sites

Das Problem liegt hierbei an deiner Logik. Ich weiß nicht ob dir Wahrscheinlichkeitsrechnung was sagt, aber prinzipiell versuchst 4 Mal mit der selben Chance(25%) beim Öffnen des Items ein Rentitem zu erzeugen.

Ich habe das zwar noch nie probiert, aber versuchs mal hiermit:

switch(rand(1,4)){ case 1: rentitem 2629,86400; break; case 2: rentitem 2630,86400; break; case 3: rentitem 2410,86400; break; case 4; rentitem 1530,86400; break; }

Link to comment
Share on other sites

Ich habe es bei mir getestet und es funktioniert. (Allerdings veränder ich das ja immer bisschen) Kann es leider nicht zeigen, da der NPC noch für mein Server geheim ist...

Rynbef~

Edited by Rynbef
Link to comment
Share on other sites

Ich habe es bei mir getestet und es funktioniert. (Allerdings veränder ich das ja immer bisschen) Kann es leider nicht zeigen, da der NPC noch für mein Server geheim ist...

Rynbef~

Sowas ist natürlich in einem Support Topic sehr hilfreich. ;)

EL Dragon, habe gerade gesehen, dass ich mich anscheinend vertippt habe und statt einem Doppelpunkt einen Strichpunkt gesetzt habe. Versuchs nochmals damit und schau dieses mal bitte auch, ob der Mapserver eine Fehlermeldung schreibt.

switch(rand(1,4)){ case 1: rentitem 2629,86400; break; case 2: rentitem 2630,86400; break; case 3: rentitem 2410,86400; break; case 4: rentitem 1530,86400; break; }

Link to comment
Share on other sites

habe es jetzt mit einem npc gemacht aber trotzdem dancke für eure hilfe

prontera,150,170,5 script Roll Machine 899,{
set @npc$,"[ Roll Machine ]";


// Hours Delay for each Roll
set .Hours,1;

// Items Available to Gain through Roll Machine
setarray .Items[0],18102,18103,18104,18105,18106,18107,18108,18109,18110;


mes @npc$;
mes "Roll machine restarts everyday 12:00AM";
next;

if ( #Roll_Claimed > gettimetick(2) ){
mes "You already rolled for the day";
mes "see you tomorrow";
}else{
mes @npc$;
mes "Roll the machine?";
next;
if( select("Yes, let's roll it!:I change my mind") == 2 ) close;
mes @npc$;
mes "Random Item Flashing....";
mes "Rolling........";
next;
mes @npc$;
set [email protected],rand( getarraysize( .Items ) );
mes "A ^0000FF"+getitemname( .Items[[email protected]] )+"^000000 appear on the screen.";
mes "Thanks for using Roll Machine";
set #Roll_Claimed,gettimetick(2) + ( .Hours * 3600 );
rentitem .Items[[email protected]],60;
}
close;
}

ist aber noch nicht gantz fertig muss noch einige Einstellungen machen aber so wie er jetzt ist geht er auch :D

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
Reply to this topic...

×   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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.