Advertisement
-JRGames-

Voiced Banking RusAcis 3.5

Dec 23rd, 2022
1,539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.50 KB | None | 0 0
  1. diff --git a/aCis_gameserver/config/en/rus_acis.properties b/aCis_gameserver/config/en/rus_acis.properties
  2. index f09715d..717ff7d 100644
  3. --- a/aCis_gameserver/config/en/rus_acis.properties
  4. +++ b/aCis_gameserver/config/en/rus_acis.properties
  5. @@ -5,6 +5,14 @@
  6.  InfinitySS = False
  7.  InfinityArrows = False
  8.  
  9. +#=============================================================
  10. +#                    Banking(Goldbar/Adena)
  11. +#=============================================================
  12. +BankingEnabled = true
  13. +BankingGoldbar_Id = 3470
  14. +BankingGoldbarCount = 1
  15. +BankingAdenaCount = 500000000
  16. +
  17.  # Enable/disable custom period settings.
  18.  OlyUseCustomPeriodSettings = False
  19.  
  20. diff --git a/aCis_gameserver/config/rus_acis.properties b/aCis_gameserver/config/rus_acis.properties
  21. index e7aee2c..84547c3 100644
  22. --- a/aCis_gameserver/config/rus_acis.properties
  23. +++ b/aCis_gameserver/config/rus_acis.properties
  24. @@ -5,6 +5,14 @@
  25.  InfinitySS = False
  26.  InfinityArrows = False
  27.  
  28. +#=============================================================
  29. +#                    Banking(Goldbar/Adena)
  30. +#=============================================================
  31. +BankingEnabled = true
  32. +BankingGoldbar_Id = 3470
  33. +BankingGoldbarCount = 1
  34. +BankingAdenaCount = 500000000
  35. +
  36.  # Включить/выключить пользовательские настройки периода.
  37.  OlyUseCustomPeriodSettings = False
  38.  
  39. diff --git a/aCis_gameserver/java/net/sf/l2j/Config.java b/aCis_gameserver/java/net/sf/l2j/Config.java
  40. index aef57b0..0c96628 100644
  41. --- a/aCis_gameserver/java/net/sf/l2j/Config.java
  42. +++ b/aCis_gameserver/java/net/sf/l2j/Config.java
  43. @@ -49,6 +49,13 @@
  44.     public static final String SERVER_FILE = "./config/server.properties";
  45.     public static final String SIEGE_FILE = "./config/siege.properties";
  46.    
  47. +  
  48. +    /** Bank system golg bar */
  49. +    public static boolean BANKING_SYSTEM_ENABLED;
  50. +    public static int BANKING_SYSTEM_GOLDBAR_ID;
  51. +    public static int BANKING_SYSTEM_GOLDBARS;
  52. +    public static int BANKING_SYSTEM_ADENA;
  53. +
  54.     // --------------------------------------------------
  55.     // Clans settings
  56.     // --------------------------------------------------
  57. @@ -2566,6 +2573,11 @@
  58.         INFINITY_SS = rusacis.getProperty("InfinitySS", false);
  59.         INFINITY_ARROWS = rusacis.getProperty("InfinityArrows", false);
  60.        
  61. +        BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(rusacis.getProperty("BankingEnabled", "false"));
  62. +        BANKING_SYSTEM_GOLDBAR_ID = Integer.parseInt(rusacis.getProperty("BankingGoldbar_Id", "1"));
  63. +        BANKING_SYSTEM_GOLDBARS = Integer.parseInt(rusacis.getProperty("BankingGoldbarCount", "1"));
  64. +        BANKING_SYSTEM_ADENA = Integer.parseInt(rusacis.getProperty("BankingAdenaCount", "500000000"));
  65. +
  66.         OLY_USE_CUSTOM_PERIOD_SETTINGS = rusacis.getProperty("OlyUseCustomPeriodSettings", false);
  67.         OLY_PERIOD = OlympiadPeriod.valueOf(rusacis.getProperty("OlyPeriod", "MONTH"));
  68.         OLY_PERIOD_MULTIPLIER = rusacis.getProperty("OlyPeriodMultiplier", 1);
  69. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  70. index e77f468..fff1e95 100644
  71. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  72. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
  73. @@ -8,6 +8,7 @@
  74.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.OfflinePlayer;
  75.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Online;
  76.  import net.sf.l2j.gameserver.handler.voicedcommandhandlers.PremiumStatus;
  77. +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoicedBanking;
  78.  
  79.  public class VoicedCommandHandler
  80.  {
  81. @@ -20,6 +21,7 @@
  82.         registerHandler(new OfflinePlayer());
  83.         registerHandler(new PremiumStatus());
  84.         registerHandler(new EventCommand());
  85. +       registerHandler(new VoicedBanking());
  86.     }
  87.    
  88.     public void registerHandler(IVoicedCommandHandler handler)
  89. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedBanking.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedBanking.java
  90. new file mode 100644
  91. index 0000000..89bb229
  92. --- /dev/null
  93. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/VoicedBanking.java
  94. @@ -0,0 +1,81 @@
  95. +package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
  96. +
  97. +import net.sf.l2j.Config;
  98. +import net.sf.l2j.gameserver.enums.SayType;
  99. +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
  100. +import net.sf.l2j.gameserver.model.actor.Player;
  101. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  102. +import net.sf.l2j.gameserver.network.serverpackets.ItemList;
  103. +
  104. +/**
  105. + * @author TioPatinhaS
  106. + *
  107. + */
  108. +public class VoicedBanking implements IVoicedCommandHandler
  109. +{
  110. +   private static String[] VOICED_COMMANDS =
  111. +   {
  112. +       "bank",
  113. +       "adena",
  114. +       "goldbar"
  115. +   };
  116. +  
  117. +   @Override
  118. +   public boolean useVoicedCommand(String command, Player activeChar, String target)
  119. +   {
  120. +       if (!Config.BANKING_SYSTEM_ENABLED)
  121. +       {
  122. +           CreatureSay cs = new CreatureSay(activeChar.getObjectId(), SayType.ALL, activeChar.getName(), ("." + command));
  123. +           activeChar.sendPacket(cs);
  124. +           return false;
  125. +       }
  126. +       else if (command.equalsIgnoreCase("bank"))
  127. +       {
  128. +           activeChar.sendMessage(".goldbar (" + Config.BANKING_SYSTEM_ADENA + " Adena = " + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar) / .adena (" + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar = " + Config.BANKING_SYSTEM_ADENA + " Adena)");
  129. +       }
  130. +       else if (command.equalsIgnoreCase("goldbar"))
  131. +       {
  132. +           if (activeChar.getInventory().getItemCount(57, 0) >= Config.BANKING_SYSTEM_ADENA)
  133. +           {
  134. +               activeChar.getInventory().reduceAdena("Goldbar", Config.BANKING_SYSTEM_ADENA, activeChar, null);
  135. +               activeChar.getInventory().addItem("Goldbar", Config.BANKING_SYSTEM_GOLDBAR_ID, Config.BANKING_SYSTEM_GOLDBARS, activeChar, null);
  136. +               activeChar.getInventory().updateDatabase();
  137. +               activeChar.sendPacket(new ItemList(activeChar, true));
  138. +               activeChar.sendMessage("Now you have " + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar(s), and " + Config.BANKING_SYSTEM_ADENA + " less adena.");
  139. +           }
  140. +           else
  141. +           {
  142. +               activeChar.sendMessage("You do not have enough Adena to convert to Goldbar(s), you need " + Config.BANKING_SYSTEM_ADENA + " Adena.");
  143. +           }
  144. +       }
  145. +       else if (command.equalsIgnoreCase("adena"))
  146. +       {
  147. +           long a = activeChar.getInventory().getItemCount(57, 0);
  148. +           long b = Config.BANKING_SYSTEM_ADENA;
  149. +           if (a + b > 2147483647L)
  150. +           {
  151. +               activeChar.sendMessage("You do not have enough space for all the adena in inventory!");
  152. +               return false;
  153. +           }
  154. +           if (activeChar.getInventory().getItemCount(Config.BANKING_SYSTEM_GOLDBAR_ID, 0) >= Config.BANKING_SYSTEM_GOLDBARS)
  155. +           {
  156. +               activeChar.getInventory().destroyItemByItemId("Adena", Config.BANKING_SYSTEM_GOLDBAR_ID, Config.BANKING_SYSTEM_GOLDBARS, activeChar, null);
  157. +               activeChar.getInventory().addAdena("Adena", Config.BANKING_SYSTEM_ADENA, activeChar, null);
  158. +               activeChar.getInventory().updateDatabase();
  159. +               activeChar.sendPacket(new ItemList(activeChar, true));
  160. +               activeChar.sendMessage("Now you have " + Config.BANKING_SYSTEM_ADENA + " Adena, and " + Config.BANKING_SYSTEM_GOLDBARS + " less Goldbar(s).");
  161. +           }
  162. +           else
  163. +           {
  164. +               activeChar.sendMessage("You do not have any Goldbars to turn into " + Config.BANKING_SYSTEM_ADENA + " Adena.");
  165. +           }
  166. +       }
  167. +       return true;
  168. +   }
  169. +  
  170. +   @Override
  171. +   public String[] getVoicedCommandList()
  172. +   {
  173. +       return VOICED_COMMANDS;
  174. +   }
  175. +}
  176. \ No newline at end of file
  177.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement