Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.84 KB | None | 0 0
  1. /*protected final static int [][] ITEMS_DATA = new int[][]
  2. {
  3.     //итемИд,кол-во,уровень точки
  4.     {6673,  Rng.get(1,100), 0},
  5.     {9889,  1,              0},
  6.     {24601, 1,              30},
  7.     {24600, 1,              30},
  8.     {24716, 1,              Rnd.get(1,20)}
  9. };*/
  10.  
  11. private static int[] ITEM_IDS =
  12. {
  13.     6673,   //0
  14.     9889,   //1
  15.     24601//2
  16.     24600//3
  17.     24716   //4
  18.             // ...
  19. };
  20.  
  21. if(Rnd.get(100) <= 90)
  22. {
  23.     //String html = "<html><title>Hellsing Loto</title><body><br>";
  24.    html += "Вы проиграли! Выпало неудачное число: <font color=LEVEL>" + Rnd.get(1,1000) + "</font><br>";
  25.    html += "<a action=\"bypass -h Quest gmshop loto_game\">Сыграть ещё</a>";
  26.    return html;
  27. }
  28. else
  29. {
  30.     int reward_item = ITEM_IDS[Rnd.get(ITEM_IDS.length)]; // достаем случайный ID
  31.  
  32.     boolean isEnchanted = false;
  33.     int enc = 0;
  34.    
  35.     if(reward_item == ITEM_IDS[0] || reward_item == ITEM_IDS[1]){
  36.     }else if(reward_item == ITEM_IDS[2] || reward_item == ITEM_IDS[3]){
  37.         enc = 30;
  38.         isEnchanted = true;
  39.     }else if(reward_item == ITEM_IDS[4]){
  40.         enc = Rnd.get(1,20);
  41.         isEnchanted = true;
  42.     }
  43.    
  44.     // itemId, amount, enchant
  45.     String reward = String.valueOf(reward_item) + ","
  46.     + String.valueOf(reward_item == 6673 ? Rnd.get(1,100) : 1) + ","
  47.     +  String.valueOf(enc);
  48.    
  49.     String[] sep = reward.split(",");
  50.     sep[2] = "+" + sep[2];
  51.    
  52.     //html+="Поздравляем,вы выиграли: <font color=LEVEL>"+ItemTable.getInstance().getTemplate(ITEMS_DATA[i][i]).getName()+"</font><br>";
  53.    
  54.     html += "Поздравляем,вы выиграли: <font color=LEVEL>"
  55.     + (Integer.parseInt(sep[1]) > 1 ? sep[1] : "")
  56.     + ItemTable.getInstance().getTemplate(Integer.parseInt(sep[0])).getName()
  57.     + (isEnchanted ? sep[2] : "")
  58.     + "</font><br>";
  59.  
  60.     html+="<a action=\"bypass -h Quest gmshop loto_game\">Сыграть ещё</a>";
  61.     return html;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement