Advertisement
LIONN

[GS] Teleport Item Id

Feb 19th, 2013
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.27 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/gameserver/powerpak/globalGK/GKHandler.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/gameserver/powerpak/globalGK/GKHandler.java  (revision 986)
  6. +++ head-src/com/l2jfrozen/gameserver/powerpak/globalGK/GKHandler.java  (working copy)
  7. @@ -166,12 +166,12 @@
  8.                 {
  9.                     if(PowerPakConfig.GLOBALGK_PRICE==-1)
  10.                     {
  11. -                       if(player.getAdena()< tpPoint.getPrice())
  12. +                       if(player.getAdena()< tpPoint.getPriceCount())
  13.                         {
  14.                             player.sendMessage("You do not have enough adena to pay for services");
  15.                             return;
  16.                         }
  17. -                       player.reduceAdena("teleport", tpPoint.getPrice(), null, true);
  18. +                       player.reduceAdena("teleport", tpPoint.getPriceCount(), null, true);
  19.                     }
  20.                     int unstuckTimer = PowerPakConfig.GLOBALGK_TIMEOUT*1000;
  21.                     player.setTarget(player);
  22. Index: head-src/com/l2jfrozen/gameserver/datatables/sql/TeleportLocationTable.java
  23. ===================================================================
  24. --- head-src/com/l2jfrozen/gameserver/datatables/sql/TeleportLocationTable.java (revision 986)
  25. +++ head-src/com/l2jfrozen/gameserver/datatables/sql/TeleportLocationTable.java (working copy)
  26. @@ -67,7 +67,7 @@
  27.         try
  28.         {
  29.             con = L2DatabaseFactory.getInstance().getConnection(false);
  30. -           final PreparedStatement statement = con.prepareStatement("SELECT Description, id, loc_x, loc_y, loc_z, price, fornoble FROM teleport");
  31. +           final PreparedStatement statement = con.prepareStatement("SELECT Description, id, loc_x, loc_y, loc_z, price_id, price_count, fornoble FROM teleport");
  32.             final ResultSet rset = statement.executeQuery();
  33.             L2TeleportLocation teleport;
  34.  
  35. @@ -79,7 +79,8 @@
  36.                 teleport.setLocX(rset.getInt("loc_x"));
  37.                 teleport.setLocY(rset.getInt("loc_y"));
  38.                 teleport.setLocZ(rset.getInt("loc_z"));
  39. -               teleport.setPrice(rset.getInt("price"));
  40. +               teleport.setPriceId(rset.getInt("price_id"));
  41. +               teleport.setPriceCount(rset.getInt("price_count"));
  42.                 teleport.setIsForNoble(rset.getInt("fornoble") == 1);
  43.  
  44.                 _teleports.put(teleport.getTeleId(), teleport);
  45. @@ -103,7 +104,7 @@
  46.             try
  47.             {
  48.                 con = L2DatabaseFactory.getInstance().getConnection(false);
  49. -               PreparedStatement statement = con.prepareStatement("SELECT Description, id, loc_x, loc_y, loc_z, price, fornoble FROM custom_teleport");
  50. +               PreparedStatement statement = con.prepareStatement("SELECT Description, id, loc_x, loc_y, loc_z, price_id, price_count, fornoble FROM custom_teleport");
  51.                 ResultSet rset = statement.executeQuery();
  52.                 L2TeleportLocation teleport;
  53.  
  54. @@ -116,7 +117,8 @@
  55.                     teleport.setLocX(rset.getInt("loc_x"));
  56.                     teleport.setLocY(rset.getInt("loc_y"));
  57.                     teleport.setLocZ(rset.getInt("loc_z"));
  58. -                   teleport.setPrice(rset.getInt("price"));
  59. +                   teleport.setPriceId(rset.getInt("price_id"));
  60. +                   teleport.setPriceCount(rset.getInt("price_count"));
  61.                     teleport.setIsForNoble(rset.getInt("fornoble") == 1);
  62.                     _teleports.put(teleport.getTeleId(), teleport);
  63.                 }
  64. Index: head-src/com/l2jfrozen/gameserver/model/L2TeleportLocation.java
  65. ===================================================================
  66. --- head-src/com/l2jfrozen/gameserver/model/L2TeleportLocation.java (revision 986)
  67. +++ head-src/com/l2jfrozen/gameserver/model/L2TeleportLocation.java (working copy)
  68. @@ -29,7 +29,8 @@
  69.     private int _locX;
  70.     private int _locY;
  71.     private int _locZ;
  72. -   private int _price;
  73. +   private int _priceId;
  74. +   private int _priceCount;
  75.     private boolean _forNoble;
  76.  
  77.     /**
  78. @@ -65,14 +66,22 @@
  79.     }
  80.  
  81.     /**
  82. -    * @param price
  83. +    * @param priceId
  84.      */
  85. -   public void setPrice(int price)
  86. +   public void setPriceId(int priceId)
  87.     {
  88. -       _price = price;
  89. +       _priceId = priceId;
  90.     }
  91.  
  92.     /**
  93. +    * @param priceCount
  94. +    */
  95. +   public void setPriceCount(int priceCount)
  96. +   {
  97. +       _priceCount = priceCount;
  98. +   }
  99. +
  100. +   /**
  101.      * @param val
  102.      */
  103.     public void setIsForNoble(boolean val)
  104. @@ -115,14 +124,22 @@
  105.     /**
  106.      * @return
  107.      */
  108. -   public int getPrice()
  109. +   public int getPriceId()
  110.     {
  111. -       return _price;
  112. +       return _priceId;
  113.     }
  114.  
  115.     /**
  116.      * @return
  117.      */
  118. +   public int getPriceCount()
  119. +   {
  120. +       return _priceCount;
  121. +   }
  122. +
  123. +   /**
  124. +    * @return
  125. +    */
  126.     public boolean getIsForNoble()
  127.     {
  128.         return _forNoble;
  129. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ClanHallManagerInstance.java
  130. ===================================================================
  131. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ClanHallManagerInstance.java   (revision 986)
  132. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2ClanHallManagerInstance.java   (working copy)
  133. @@ -1039,7 +1039,7 @@
  134.                 player.sendPacket(new SystemMessage(SystemMessageId.NO_PORT_THAT_IS_IN_SIGE));
  135.                 return;
  136.             }
  137. -           else if(player.reduceAdena("Teleport", list.getPrice(), this, true))
  138. +           else if(player.reduceAdena("Teleport", list.getPriceCount(), this, true))
  139.             {
  140.                 if(Config.DEBUG)
  141.                 {
  142. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java
  143. ===================================================================
  144. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java    (revision 986)
  145. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2TeleporterInstance.java    (working copy)
  146. @@ -312,7 +312,7 @@
  147.                 _zone.allowPlayerEntry(player, 300);
  148.                 player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
  149.             }
  150. -           else if(!list.getIsForNoble() && (Config.ALT_GAME_FREE_TELEPORT || player.reduceAdena("Teleport", list.getPrice(), this, true)))
  151. +           else if(!list.getIsForNoble() && (Config.ALT_GAME_FREE_TELEPORT || player.destroyItemByItemId("Teleport", list.getPriceId(), list.getPriceCount(), this, true)))
  152.             {
  153.                 if(Config.DEBUG)
  154.                 {
  155. @@ -320,7 +320,7 @@
  156.                 }
  157.                 player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ(), true);
  158.             }
  159. -           else if(list.getIsForNoble() && (Config.ALT_GAME_FREE_TELEPORT || player.destroyItemByItemId("Noble Teleport", 6651, list.getPrice(), this, true)))
  160. +           else if(list.getIsForNoble() && (Config.ALT_GAME_FREE_TELEPORT || player.destroyItemByItemId("Noble Teleport", 6651, list.getPriceCount(), this, true)))
  161.             {
  162.                 if(Config.DEBUG)
  163.                 {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement