Advertisement
Guest User

Untitled

a guest
May 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. private void setAffixes() {
  2. int numberAffixes = 5;
  3. int x1 = rand.nextInt(numberAffixes) + 1;
  4. int x2 = rand.nextInt(numberAffixes) + 1;
  5. int x3 = rand.nextInt(numberAffixes) + 1;
  6.  
  7. if (quality == 1) {
  8. setItemAttributes(type, x1);
  9. }
  10. if (quality == 2) {
  11. while (x1 == x2) {
  12. x2 = rand.nextInt(numberAffixes) + 1;
  13. }
  14. setItemAttributes(type, x1);
  15. setItemAttributes(type, x2);
  16. }
  17. if (quality == 3) {
  18.  
  19. while (x1 == x2) {
  20. x2 = rand.nextInt(numberAffixes) + 1;
  21. }
  22.  
  23. while (x3 == x1 || x3 == x2) {
  24. x3 = rand.nextInt(numberAffixes) + 1;
  25. }
  26. setItemAttributes(type, x1);
  27. setItemAttributes(type, x2);
  28. setItemAttributes(type, x3);
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement