Elfocrash

Kino Game for Frozen by Elfocrash

Apr 13th, 2012
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 25.16 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P CodingTime
  3. Index: gameserver/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java
  4. ===================================================================
  5. --- gameserver/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java   (revision 931)
  6. +++ gameserver/head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestBypassToServer.java   (working copy)
  7. @@ -37,6 +37,7 @@
  8.  import com.l2jfrozen.gameserver.model.actor.position.L2CharPosition;
  9.  import com.l2jfrozen.gameserver.model.entity.event.CTF;
  10.  import com.l2jfrozen.gameserver.model.entity.event.DM;
  11. +import com.l2jfrozen.gameserver.model.entity.event.Kino;
  12.  import com.l2jfrozen.gameserver.model.entity.event.L2Event;
  13.  import com.l2jfrozen.gameserver.model.entity.event.TvT;
  14.  import com.l2jfrozen.gameserver.model.entity.event.VIP;
  15. @@ -127,6 +128,11 @@
  16.             {
  17.                 playerHelp(activeChar, _command.substring(12));
  18.             }
  19. +           else if (_command.startsWith("kino"))
  20. +           {
  21. +               Kino newKino = new Kino();
  22. +               newKino.addNumbersByCommand(activeChar,_command.substring(5));
  23. +           }
  24.             else if(_command.startsWith("npc_"))
  25.             {
  26.                 if(!activeChar.validateBypass(_command))
  27. Index: gameserver/config/functions/l2jfrozen.properties
  28. ===================================================================
  29. --- gameserver/config/functions/l2jfrozen.properties    (revision 931)
  30. +++ gameserver/config/functions/l2jfrozen.properties    (working copy)
  31. @@ -280,4 +280,38 @@
  32.  ProtectorSkillLevel = 13
  33.  ProtectorSkillTime = 600
  34.  # Npc Protector Message
  35. -ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  36. \ No newline at end of file
  37. +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  38. +
  39. +# ---------------------------------------------------------------------------
  40. +# Kino
  41. +# ---------------------------------------------------------------------------
  42. +# Do you want to allow Kino games?
  43. +# Default: False
  44. +KinoAllowed = True
  45. +
  46. +# Time of each period in minutes.
  47. +# Default: 30
  48. +KinoTime = 5
  49. +
  50. +# Id of item that players need to pay for a ticket.
  51. +# Default: 57
  52. +KinoItemId = 57
  53. +
  54. +# How much of this items are needed to buy a ticket.
  55. +# Default: 1000000
  56. + KinoItemAmmount = 1000000
  57. + Whats the max number that players can choose.
  58. + Default: 80
  59. + KinoMaxNumber = 80
  60. +
  61. +# How much numbers players have to choose.
  62. +# Default: 4
  63. +KinoNumbersAmmount = 4
  64. +
  65. +# Prices for each Number. First number mean how much good numbers player had
  66. +# Second number is Id of item, third is ammount of this item. write \ after
  67. +# making new line, dont write ; at the end
  68. +# Example:
  69. +KinoPrice = 2,57,2500;2,1467,5000;2,1468,200;\
  70. +                       3,57,5000;3,1467,11;\
  71. +                       4,57,33333333;4,1468,444
  72. \ No newline at end of file
  73. Index: gameserver/head-src/com/l2jfrozen/Config.java
  74. ===================================================================
  75. --- gameserver/head-src/com/l2jfrozen/Config.java   (revision 931)
  76. +++ gameserver/head-src/com/l2jfrozen/Config.java   (working copy)
  77. @@ -33,6 +33,7 @@
  78.  import java.net.UnknownHostException;
  79.  import java.util.ArrayList;
  80.  import java.util.HashMap;
  81. +import java.util.LinkedList;
  82.  import java.util.List;
  83.  import java.util.Map;
  84.  import java.util.Properties;
  85. @@ -2378,6 +2379,14 @@
  86.     public static String FARM2_CUSTOM_MESSAGE;
  87.     public static String PVP1_CUSTOM_MESSAGE;
  88.     public static String PVP2_CUSTOM_MESSAGE;
  89. +  
  90. +    public static boolean KINO_ALLOWED;
  91. +    public static int KINO_TIME;
  92. +    public static int KINO_ITEM_ID;
  93. +    public static int KINO_ITEM_AMMOUNT;
  94. +    public static int KINO_MAX_NUMBER;
  95. +    public static int KINO_NUMBERS_AMMOUNT;
  96. +    public static List<Integer[]> KINO_PRICE;
  97.  
  98.     //============================================================
  99.     public static void loadL2JFrozenConfig()
  100. @@ -2497,6 +2506,36 @@
  101.             FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
  102.             PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
  103.             PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  104. +          
  105. +            KINO_ALLOWED = Boolean.parseBoolean(L2JFrozenSettings.getProperty("KinoAllowed", "True"));
  106. +            KINO_TIME = Integer.parseInt(L2JFrozenSettings.getProperty("KinoTime", "30"));
  107. +            KINO_ITEM_ID = Integer.parseInt(L2JFrozenSettings.getProperty("KinoItemId", "57"));
  108. +            KINO_ITEM_AMMOUNT = Integer.parseInt(L2JFrozenSettings.getProperty("KinoItemAmmount", "1000000"));
  109. +            KINO_MAX_NUMBER = Integer.parseInt(L2JFrozenSettings.getProperty("KinoMaxNumber", "80"));
  110. +            KINO_NUMBERS_AMMOUNT = Integer.parseInt(L2JFrozenSettings.getProperty("KinoNumbersAmmount", "4"));
  111. +            if(KINO_ALLOWED){
  112. +                    String[] kinoPriceSplit = L2JFrozenSettings.getProperty("KinoPrice", "").split(";");
  113. +                    KINO_PRICE = new LinkedList<Integer[]>();
  114. +                    for (String number : kinoPriceSplit)
  115. +                    {
  116. +                            String[] numbersSplit = number.split(",");
  117. +                            try
  118. +                            {
  119. +                                    Integer[] numbersTable = new Integer[3];
  120. +                                    numbersTable[0] = Integer.parseInt(numbersSplit[0]);
  121. +                                    numbersTable[1] = Integer.parseInt(numbersSplit[1]);
  122. +                                    numbersTable[2] = Integer.parseInt(numbersSplit[2]);
  123. +                                    KINO_PRICE.add(numbersTable);
  124. +                            }
  125. +                            catch (NumberFormatException nfe)
  126. +                            {
  127. +                                    if (!number.isEmpty())
  128. +                                    {
  129. +                                            _log.warning(StringUtil.concat("[KinoPriceList]: invalid config property -> Price List \"", numbersSplit[0], "\"", numbersSplit[1], "\"", numbersSplit[3]));
  130. +                                    }
  131. +                            }
  132. +                    }
  133. +           }
  134.         }
  135.         catch(Exception e)
  136.         {
  137. Index: gameserver/head-src/com/l2jfrozen/gameserver/model/entity/event/Kino.java
  138. ===================================================================
  139. --- gameserver/head-src/com/l2jfrozen/gameserver/model/entity/event/Kino.java   (revision 0)
  140. +++ gameserver/head-src/com/l2jfrozen/gameserver/model/entity/event/Kino.java   (revision 0)
  141. @@ -0,0 +1,274 @@
  142. +/*
  143. + * This program is free software: you can redistribute it and/or modify it under
  144. + * the terms of the GNU General Public License as published by the Free Software
  145. + * Foundation, either version 3 of the License, or (at your option) any later
  146. + * version.
  147. + *
  148. + * This program is distributed in the hope that it will be useful, but WITHOUT
  149. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  150. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  151. + * details.
  152. + *
  153. + * You should have received a copy of the GNU General Public License along with
  154. + * this program. If not, see <http://www.gnu.org/licenses/>.
  155. + */
  156. +package com.l2jfrozen.gameserver.model.entity.event;
  157. +
  158. +import java.sql.Connection;
  159. +import java.sql.PreparedStatement;
  160. +import java.sql.ResultSet;
  161. +import java.util.LinkedList;
  162. +import java.util.List;
  163. +
  164. +import com.l2jfrozen.Config;
  165. +import com.l2jfrozen.util.database.L2DatabaseFactory;
  166. +import com.l2jfrozen.gameserver.model.entity.Announcements;
  167. +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  168. +import com.l2jfrozen.gameserver.model.PcInventory;
  169. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  170. +import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
  171. +import com.l2jfrozen.util.StringUtil;
  172. +
  173. +public class Kino
  174. +{
  175. +       private static boolean canChoose = false;
  176. +       private static List<Integer[]> choosenNumbers = new LinkedList<Integer[]>();
  177. +       private static List<Integer[]> itemsAlreadyWon = new LinkedList<Integer[]>();
  178. +      
  179. +      private class mainCounter implements Runnable
  180. +       {
  181. +               @Override
  182. +               public void run()
  183. +              {
  184. +                      canChoose = false;
  185. +                       Integer randomNumbers[] = new Integer[Config.KINO_NUMBERS_AMMOUNT];
  186. +                       for(int i=0;i<Config.KINO_NUMBERS_AMMOUNT;i++){
  187. +                               boolean check = true;
  188. +                              while(check){
  189. +                                       int liczba = (int) Math.round((Math.random()*(Config.KINO_MAX_NUMBER-1)+1));
  190. +                                       for(int y = 0;y<i;y++)
  191. +                                               if(liczba == randomNumbers[y])
  192. +                                                       check = false;;
  193. +                                       if(check){
  194. +                                               randomNumbers[i] = liczba;
  195. +                                               check = false;
  196. +                                       }else
  197. +                                              check = true;
  198. +                               }
  199. +                       };
  200. +                      announceNumbers(randomNumbers);
  201. +                       try{Thread.sleep(Config.KINO_TIME*1000*2);}catch (InterruptedException e){}
  202. +                       getWinners(randomNumbers);
  203. +                       announceBestWinners(randomNumbers);
  204. +                       try{Thread.sleep(Config.KINO_TIME*1000*2);}catch (InterruptedException e){}
  205. +                       choosenNumbers.clear();
  206. +                       canChoose = true;
  207. +                      Announcements.getInstance().announceToAll("Next period of kino game just Started!");
  208. +                       ThreadPoolManager.getInstance().scheduleGeneral(new mainCounter(), (Config.KINO_TIME-2)*1000*60);
  209. +               }
  210. +       }
  211. +      
  212. +      public void goodHtml(L2PcInstance activeChar){
  213. +                       NpcHtmlMessage adminReply = new NpcHtmlMessage(10);
  214. +                       String qboxes = "";
  215. +                       String action = "";
  216. +                      for(int i = 0;i<Config.KINO_NUMBERS_AMMOUNT;i++){
  217. +                               qboxes += "Number "+ (i+1) +":<edit var=\"number"+ i +"\" width=120 height=15><br>";
  218. +                               action += "$number"+ i + " ";
  219. +                       }
  220. +                       giveItem(activeChar);
  221. +                      final StringBuilder replyMSG = StringUtil.startAppend(
  222. +                                       1000,
  223. +                                       "<html><head><title>Kino</title></head><body>",
  224. +                                      "<br><center>Choose your numbers:</center><br>",
  225. +                                       qboxes,
  226. +                                       "<button value=\"Buy Ticket\" action=\"bypass -h kino "+ action +"\" width=65 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">",
  227. +                                      "<br>P.S. Remember that only numbers from 1 to "+ Config.KINO_MAX_NUMBER +" are allowed to be chosen.",
  228. +                                       "<br>P.S.S One ticket Cost "+ Config.KINO_ITEM_AMMOUNT + " "+ activeChar.getInventory().getItemByItemId(Config.KINO_ITEM_ID).getName(),
  229. +                                       "</html></body>"
  230. +                       );
  231. +                       adminReply.setHtml(replyMSG.toString());
  232. +                       activeChar.sendPacket(adminReply);
  233. +       }
  234. +      
  235. +       public void otherHtmls(L2PcInstance activeChar, String msg){
  236. +               giveItem(activeChar);
  237. +               NpcHtmlMessage adminReply = new NpcHtmlMessage(10);
  238. +               final StringBuilder replyMSG = StringUtil.startAppend(
  239. +                               1000,
  240. +                               "<html><head><title>Kino</title></head><body>",
  241. +                               "<br><center>"+ msg +"</center><br>",
  242. +                               "</html></body>"
  243. +               );
  244. +               adminReply.setHtml(replyMSG.toString());
  245. +               activeChar.sendPacket(adminReply);
  246. +       }
  247. +      
  248. +       public boolean alreadyVoted(Integer objectId){
  249. +               for(Integer[] numbers : choosenNumbers)
  250. +                       if(numbers[0].equals(objectId))
  251. +                               return true;
  252. +               return false;
  253. +       }
  254. +      
  255. +       public void addNumbersByCommand(L2PcInstance activeChar, String command)
  256. +       {
  257. +               Integer[] table = new Integer[Config.KINO_NUMBERS_AMMOUNT];
  258. +               int spaces = 0;
  259. +               int number = 0;
  260. +               int max = 9;
  261. +               if(Config.KINO_MAX_NUMBER<9)
  262. +                       max = Config.KINO_MAX_NUMBER;
  263. +               boolean wrong = false;
  264. +               for(int i = 0;i<command.length();i++){
  265. +                       try{
  266. +                       if(command.substring(i, i+1).equals(" ")){
  267. +                               if(command.length()-1 == i || command.substring(i+1, i+2).equals(" "))
  268. +                                       wrong = true;
  269. +                               spaces ++;
  270. +                       }else{
  271. +                                       if(command.length()-1 == i ||command.substring(i+1, i+2).equals(" ")){
  272. +                                               for(int x = 1;x<=max;x++)
  273. +                                                       if(command.substring(i, i+1).equals(x+""))
  274. +                                                               table[number] = Integer.parseInt(command.substring(i, i+1));
  275. +                                       }else{
  276. +                                               for(int x = 10;x<=Config.KINO_MAX_NUMBER;x++){
  277. +                                                       if(command.length()-1 != i+1 && !command.substring(i+2, i+3).equals(" "))
  278. +                                                               wrong = true;
  279. +                                                       if(command.substring(i, i+2).equals(x+""))
  280. +                                                               table[number] = Integer.parseInt(command.substring(i, i+2));
  281. +                                               }
  282. +                                               i ++;
  283. +                                       }
  284. +                                       if(table[number] != null)
  285. +                                               number ++;
  286. +                                       else
  287. +                                               wrong = true;
  288. +                               }
  289. +                       }catch(IndexOutOfBoundsException e){
  290. +                               wrong = true;
  291. +                       }
  292. +               }
  293. +               for(int i = 1;i<table.length;i++)
  294. +                       for(int x = 0;x<i;x++)
  295. +                               if(table[i] == table[x])
  296. +                                       wrong = true;
  297. +               if(spaces<=Config.KINO_NUMBERS_AMMOUNT-1 && !wrong)
  298. +               {
  299. +                       activeChar.getInventory().destroyItem("Ticket",Config.KINO_ITEM_ID, Config.KINO_ITEM_AMMOUNT, activeChar, null);
  300. +                       activeChar.sendMessage("You bought ticket.");
  301. +                       addNumbers(activeChar.getObjectId(),table);    
  302. +               }
  303. +               else
  304. +                       otherHtmls(activeChar, "You gave wrong Numbers!");
  305. +       }
  306. +      
  307. +       private void giveItem(L2PcInstance activeChar){
  308. +               List<Integer[]> tablesToDelete = new LinkedList<Integer[]>();
  309. +               for(Integer[] table : itemsAlreadyWon)
  310. +                       if(table[0].equals(activeChar.getObjectId())){
  311. +                               activeChar.getInventory().addItem("Winning Item", table[1], table[2], activeChar, null);
  312. +                               activeChar.sendMessage("You won: "+ activeChar.getInventory().getItemByItemId(table[1]).getItemName());
  313. +                               tablesToDelete.add(table);
  314. +                       }
  315. +               for(Integer[] table :tablesToDelete)
  316. +                       itemsAlreadyWon.remove(table);
  317. +       }
  318. +      
  319. +       private void addNumbers(Integer objectId, Integer[] numbers){
  320. +               Integer[] tableNumbers = new Integer[Config.KINO_NUMBERS_AMMOUNT+1];
  321. +               tableNumbers[0] = objectId;
  322. +               for(int i = 1;i<=Config.KINO_NUMBERS_AMMOUNT;i++)
  323. +                       tableNumbers[i] = numbers[(i-1)];
  324. +               choosenNumbers.add(tableNumbers);
  325. +       }
  326. +      
  327. +       private void announceBestWinners(Integer[] randomNumbers)
  328. +       {
  329. +               String winText = "Winners are: ";
  330. +               int firstTextNumber = winText.length();
  331. +               for(Integer[] numbers : choosenNumbers){
  332. +                       int goodNumbers = 0;
  333. +                       for(Integer number: numbers)
  334. +                               if(numbers[0] != number)
  335. +                                       for(Integer randomNumber : randomNumbers)
  336. +                                               if(number == randomNumber)
  337. +                                                       goodNumbers++;
  338. +                       if(goodNumbers == Config.KINO_MAX_NUMBER)
  339. +                               winText += getWinner(numbers[0]) + ", ";
  340. +               }
  341. +               if(winText.length() > firstTextNumber)
  342. +                       Announcements.getInstance().announceToAll(winText.substring(0, winText.length()-1));
  343. +               else
  344. +                       Announcements.getInstance().announceToAll("There are no Winners!");
  345. +       }
  346. +
  347. +       private String getWinner(Integer charId)
  348. +       {
  349. +               String winText = "";
  350. +               Connection con = null;
  351. +               try
  352. +               {
  353. +                       con = L2DatabaseFactory.getInstance().getConnection();
  354. +                       PreparedStatement statement = con.prepareStatement("SELECT char_name FROM characters WHERE charId="+charId);
  355. +                       ResultSet rset = statement.executeQuery();
  356. +                       if(rset.next())
  357. +                   {
  358. +                       winText = rset.getString("char_name");
  359. +                   }
  360. +                   rset.close();
  361. +                   statement.close();
  362. +               }
  363. +               catch (Exception e)
  364. +               {
  365. +                       System.out.println("Error at getWinner in Kino.java " +e);
  366. +               }
  367. +               finally
  368. +               {
  369. +                       L2DatabaseFactory.close(con);
  370. +               }
  371. +               return winText;
  372. +       }
  373. +
  374. +       private void announceNumbers(Integer[] randomNumbers)
  375. +       {
  376. +               String message = "Lucky Numbers are: ";
  377. +               for(Integer number: randomNumbers)
  378. +                       message += number + ", ";
  379. +               Announcements.getInstance().announceToAll(message);
  380. +       }
  381. +
  382. +       private void getWinners(Integer[] numbers){
  383. +               for(Integer[] people : choosenNumbers){
  384. +                       int goodNumbers = 0;
  385. +                       for(int i = 1;i<people.length;i++)
  386. +                               for(int y = 0;y<numbers.length;y++)
  387. +                                       if(people[i] == numbers[y])
  388. +                                               goodNumbers ++;
  389. +                       for(Integer[] items : Config.KINO_PRICE)
  390. +                               if(goodNumbers == items[0]){
  391. +                                       Integer[] table = new Integer[3];
  392. +                                       table[0] = people[0];
  393. +                                       table[1] = items[1];
  394. +                                       table[2] = items[2];
  395. +                                       itemsAlreadyWon.add(table);
  396. +                               }
  397. +               }
  398. +       }
  399. +
  400. +       public void startKino()
  401. +       {
  402. +               if(Config.KINO_ALLOWED){
  403. +                       ThreadPoolManager.getInstance().scheduleGeneral(new mainCounter(), (Config.KINO_TIME-2)*1000*60);
  404. +                       canChoose = true;
  405. +               }
  406. +       }
  407. +      
  408. +       public boolean canChoose(){
  409. +               return canChoose;
  410. +       }
  411. +}
  412. \ No newline at end of file
  413. Index: gameserver/head-src/com/l2jfrozen/gameserver/GameServer.java
  414. ===================================================================
  415. --- gameserver/head-src/com/l2jfrozen/gameserver/GameServer.java    (revision 931)
  416. +++ gameserver/head-src/com/l2jfrozen/gameserver/GameServer.java    (working copy)
  417. @@ -117,6 +117,7 @@
  418.  import com.l2jfrozen.gameserver.model.PartyMatchWaitingList;
  419.  import com.l2jfrozen.gameserver.model.entity.Announcements;
  420.  import com.l2jfrozen.gameserver.model.entity.Hero;
  421. +import com.l2jfrozen.gameserver.model.entity.event.Kino;
  422.  import com.l2jfrozen.gameserver.model.entity.MonsterRace;
  423.  import com.l2jfrozen.gameserver.model.entity.event.manager.EventManager;
  424.  import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
  425. @@ -534,6 +535,10 @@
  426.         Util.printSection("EventManager");
  427.         EventManager.getInstance().startEventRegistration();
  428.        
  429. +       Kino newKino = new Kino();
  430. +       newKino.startKino();
  431. +       _log.info("Kino event is currently running");
  432. +      
  433.         if(EventManager.TVT_EVENT_ENABLED || EventManager.CTF_EVENT_ENABLED || EventManager.DM_EVENT_ENABLED)
  434.         {
  435.             if(EventManager.TVT_EVENT_ENABLED)
  436. Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoicedKino.java
  437. ===================================================================
  438. --- gameserver/head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoicedKino.java  (revision 0)
  439. +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/voicedcommandhandlers/VoicedKino.java  (revision 0)
  440. @@ -0,0 +1,52 @@
  441. +/**
  442. + *
  443. + */
  444. +package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
  445. +
  446. +import com.l2jfrozen.Config;
  447. +import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
  448. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  449. +import com.l2jfrozen.gameserver.model.entity.event.Kino;
  450. +
  451. +
  452. +
  453. +public class VoicedKino implements IVoicedCommandHandler
  454. +{
  455. +               private final String[] _voicedCommands =
  456. +               {
  457. +                       "kino"
  458. +               };
  459. +              
  460. +               /**
  461. +                *
  462. +                * @see com.l2jfrozen.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
  463. +                */
  464. +               public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
  465. +               {
  466. +                       if (command.equalsIgnoreCase("kino")){
  467. +                               Kino x = new Kino();
  468. +                               if(x.canChoose())
  469. +                                       if(!x.alreadyVoted(activeChar.getObjectId()))
  470. +                                               if(activeChar.getInventory().getItemByItemId(Config.KINO_ITEM_ID) != null && activeChar.getInventory().getItemByItemId(Config.KINO_ITEM_ID).getCount()>= Config.KINO_ITEM_AMMOUNT)
  471. +                                                       x.goodHtml(activeChar);
  472. +                                               else
  473. +                                                       x.otherHtmls(activeChar,"You do not have enough items to buy ticket.");
  474. +                                       else
  475. +                                               x.otherHtmls(activeChar,"You already bought a ticket!");
  476. +                               else
  477. +                                       x.otherHtmls(activeChar,"You can not buy ticket right now!");
  478. +                       }
  479. +                       return true;
  480. +               }
  481. +              
  482. +               /**
  483. +                *
  484. +                * @see com.l2jfrozen.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
  485. +                */
  486. +               public String[] getVoicedCommandList()
  487. +               {
  488. +                       return _voicedCommands;
  489. +               }
  490. +}
  491. \ No newline at end of file
  492. Index: gameserver/head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java
  493. ===================================================================
  494. --- gameserver/head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java  (revision 931)
  495. +++ gameserver/head-src/com/l2jfrozen/gameserver/handler/VoicedCommandHandler.java  (working copy)
  496. @@ -34,6 +34,7 @@
  497.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.StatsCmd;
  498.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.TvTCmd;
  499.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VersionCmd;
  500. +import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.VoicedKino;
  501.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Voting;
  502.  import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
  503.  
  504. @@ -65,6 +66,7 @@
  505.         _datatable = new FastMap<String, IVoicedCommandHandler>();
  506.        
  507.         registerVoicedCommandHandler( new Voting());
  508. +       registerVoicedCommandHandler( new VoicedKino());
  509.        
  510.         if(Config.BANKING_SYSTEM_ENABLED)
  511.         {
Advertisement
Add Comment
Please, Sign In to add comment