function script Rnd_Item { setarray .@item_list, 35005, 35006, 35007, 35008, 35009, 35044, 35050, 35051, 35052, 35053, 35054, 35055, 35058, 35072, 35073, 35074, 35075, 35076, 35077, 35078, 35082, 35083, 35084, 35085, 35086, 35087, 35088, 35089, 35090, 35091, 35092, 35093, 35094, 35095, 35096, 35097, 35098, 35099, 35100, 35101, 35102, 35103, 35104, 35105, 35112, 35113, 35114, 35115, 35116, 35117, 35123, 35124, 35125, 35126, 35127, 35128, 35131, 35132, 35133, 35134, 35135, 35136, 35137, 35138, 35139, 35140, 35141, 35142, 35144, 35154, 35155, 35156, 35157, 35158, 35173, 35174, 35175, 35176, 35177, 35178, 35178, 35179, 35180, 35185, 35186, 35187, 35191, 35192, 35193, 35194, 35195, 35216, 35226, 35227, 35229, 35230, 35231, 35232, 35233, 35234, 35237, 35238, 35239, 35240, 35241, 35247, 35254, 35255, 35256, 35257, 35079, 35080, 35081, 35011, 35012, 35013, 35014, 35015, 35018, 35019, 35023, 35024, 35025, 35026, 35027, 35029, 35030, 35031, 35032, 35033, 35034, 35041, 35042, 35043, 35049, 35060, 35061, 35062, 35063, 35064, 35065, 35066, 35067, 35068, 35108, 35109, 35110, 35182, 35183, 35198, 35020, 35021, 35022, 35004, 35010, 35040, 35047, 35056, 35057, 35118, 35163, 35246; setarray .@item_rate, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 5, 5, 5, 1, 1, 1, 1, 1, 1, 1 1, 1; setarray .@item_announce, 35004, 35010, 35040, 35047, 35056, 35057, 35118, 35163, 35246; .@a = getarraysize(.@item_list); .@b = getarraysize(.@item_rate); .@c = getarraysize(.@item_announce); if (.@a != .@b) { message strcharinfo(0),"Error! Tell Administrator. Source: Rnd_Item"; end; } for (.@i = 0; .@i < .@b; .@i++) .@count_temp = .@count_temp + .@item_rate[.@i]; .@chance = rand(.@count_temp); for (.@x = 0; .@x < .@b; .@x++) { .@chance = .@chance - .@item_rate[.@x]; if (.@chance <= 0) break; } getitem .@item_list[.@x], 1; if (getarg(0)) delitem getarg(0), 1; for (.@d = 0; .@d < .@c; .@d++) if (.@item_list[.@x] == .@item_announce[.@d]) announce strcharinfo(0)+" Got a "+getitemname(.@item_list[.@i])+" from Random Box.",0; end; }