Advertisement
tensador125

Random Craft System Interlude v3 update

Jun 22nd, 2023
909
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.89 KB | Gaming | 1 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P Orionwins
  3. diff --git src/l2jwins/game/model/actor/instance/L2RandomCraftInstance.java src/l2jwins/game/model/actor/instance/L2RandomCraftInstance.java
  4. index 8be6aff..a5d3d1b 100644
  5. --- src/l2jwins/game/model/actor/instance/L2RandomCraftInstance.java
  6. +++ src/l2jwins/game/model/actor/instance/L2RandomCraftInstance.java
  7. @@ -88,9 +88,11 @@
  8.                 player.getInventory().destroyItemByItemId("Random Craft", Config.RANDOM_CRAFT_ITEM_ID_CONSUME, Config.RANDOM_CRAFT_ITEM_CONSUME_REFRESH, player, this);
  9.                
  10.                 generateItems(player);
  11. -               showHtmlWindow(player);
  12. +              
  13.                 player.sendPacket(new ItemList(player, true));
  14.                
  15. +               showHtmlWindow(player);
  16. +              
  17.                 // Almacene los elementos generados en la base de datos para el jugador
  18.                 saveGeneratedItems(player);
  19.             }
  20. @@ -105,8 +107,16 @@
  21.             deleteGeneratedItems(player);
  22.            
  23.             createItem(player);
  24. +          
  25. +           // showHtmlWindow(player);
  26. +       }
  27. +      
  28. +       else if (command.startsWith("back"))
  29. +       {
  30. +          
  31. +           showHtmlWindow(player);
  32. +       }
  33. +      
  34.     }
  35.    
  36.     private void generateItems(L2PcInstance player)
  37. @@ -380,6 +390,10 @@
  38.                 // Borra la lista de elementos para el jugador
  39.                 player.clearGeneratedCraftItems();
  40.                 setHasGeneratedItems(false);
  41. +              
  42. +               // Muestra la ventana de felicitaciones con el item ganador
  43. +               showCongratulationsWindow(player, craftItem);
  44. +              
  45.                 return;
  46.             }
  47.         }
  48. @@ -456,6 +470,42 @@
  49.         player.sendPacket(html);
  50.     }
  51.    
  52. +   private void showCongratulationsWindow(L2PcInstance player, RandomCraftItem craftItem)
  53. +   {
  54. +       StringBuilder html = new StringBuilder();
  55. +      
  56. +       html.append("<html><body>");
  57. +       html.append("<center>Felicidades, has ganado un item</center>");
  58. +       html.append("<br>");
  59. +       html.append("<center>ยกHas recibido</center>");
  60. +       html.append("<br>");
  61. +       html.append("<br>");
  62. +       html.append("<img src=\"L2UI.SquareGray\" width=295 height=1>");
  63. +       html.append("<center>");
  64. +       html.append("<table>");
  65. +       html.append("<tr>");
  66. +       html.append("<td>");
  67. +       html.append("<img src=").append(craftItem.getIcon()).append(" width=32 height=32>");
  68. +       html.append("</td>");
  69. +       html.append("<td width=260>");
  70. +       html.append("<font color=LEVEL>").append(craftItem.getItem().getName()).append("</font>");
  71. +       html.append("</td>");
  72. +       html.append("</tr>");
  73. +       html.append("</table>");
  74. +       html.append("</center>");
  75. +       html.append("<img src=\"L2UI.SquareGray\" width=295 height=1>");
  76. +       html.append("<br>");
  77. +       html.append("<br>");
  78. +       html.append("<br>");
  79. +       html.append("<br>");
  80. +       html.append("<center>");
  81. +       html.append("<button value=\"Back\" action=\"bypass -h npc_").append(getObjectId()).append("_back\" width=75 height=21 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\">");
  82. +       html.append("</center>");
  83. +       html.append("</body></html>");
  84. +      
  85. +       showHtmlWindow(player, html.toString());
  86. +   }
  87. +  
  88.     /**
  89.      * @return the hasGeneratedItems
  90.      */
  91.  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement