Jump to content

TEOGR_hItMaKeR

Members
  • Posts

    1,794
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by TEOGR_hItMaKeR

  1. you have a point on this but I don't have experience to know if something I am going to do will be right... and maybe for you 5 minutes or 2 hours meaning nothing for me it matters I don't want to spend my time for a final wrong code... Also in this section there is a Request prefix for a reason right?
  2. I would but it's different structure player is owner and owner is player... so can you do this for me :p
  3. hello guys I want to have more options for private store currency except adena I want my coin also... I found this code Index: java/com/l2jserver/Config.java =================================================================== --- java/com/l2jserver/Config.java (revision 4410) +++ java/com/l2jserver/Config.java (working copy) @@ -676,6 +676,8 @@ public static String L2JMOD_MULTILANG_DEFAULT; public static boolean L2JMOD_MULTILANG_VOICED_ALLOW; public static boolean L2WALKER_PROTECTION; + public static int STORE_BUY_CURRENCY; + public static int STORE_SELL_CURRENCY; //-------------------------------------------------- // NPC Settings @@ -2285,6 +2287,8 @@ L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty("MultiLangVoiceCommand", "True")); L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty("L2WalkerProtection", "False")); + STORE_BUY_CURRENCY = Integer.parseInt(L2JModSettings.getProperty("PrivateStoreBuyMoneda", "57")); + STORE_SELL_CURRENCY = Integer.parseInt(L2JModSettings.getProperty("PrivateStoreSellMoneda", "57")); } catch (Exception e) { Index: java/com/l2jserver/gameserver/model/TradeList.java =================================================================== --- java/com/l2jserver/gameserver/model/TradeList.java (revision 4410) +++ java/com/l2jserver/gameserver/model/TradeList.java (working copy) @@ -802,9 +802,10 @@ slots++; } - if (totalPrice > playerInventory.getAdena()) + if (totalPrice > player.getBuyStoreCurrency()) { - player.sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA)); + final String name = ItemTable.getInstance().getTemplate(Config.STORE_BUY_CURRENCY).getName(); + player.sendMessage("You dont have enough "+name); return 1; } @@ -823,12 +824,12 @@ // Prepare inventory update packets final InventoryUpdate ownerIU = new InventoryUpdate(); final InventoryUpdate playerIU = new InventoryUpdate(); - - final L2ItemInstance adenaItem = playerInventory.getAdenaInstance(); - playerInventory.reduceAdena("PrivateStore", totalPrice, player, _owner); + final int moneda = Config.STORE_BUY_CURRENCY; + final L2ItemInstance adenaItem = playerInventory.getItemByItemId(moneda); + player.destroyItemByItemId("PrivateStore", moneda, totalPrice, _owner, true); playerIU.addItem(adenaItem); - ownerInventory.addAdena("PrivateStore", totalPrice, _owner, player); - ownerIU.addItem(ownerInventory.getAdenaInstance()); + ownerInventory.addItem("PrivateStore", moneda, totalPrice, _owner, player); + ownerIU.addItem(ownerInventory.getItemByItemId(moneda)); boolean ok = true; @@ -965,7 +966,7 @@ break; } - if (ownerInventory.getAdena() < _totalPrice) + if (_owner.getSellStoreCurrency() < _totalPrice) continue; // Check if requested item is available for manipulation @@ -1043,11 +1044,12 @@ if (totalPrice > ownerInventory.getAdena()) // should not happens, just a precaution return false; - final L2ItemInstance adenaItem = ownerInventory.getAdenaInstance(); - ownerInventory.reduceAdena("PrivateStore", totalPrice, _owner, player); + final int moneda = Config.STORE_SELL_CURRENCY; + final L2ItemInstance adenaItem = ownerInventory.getItemByItemId(moneda); + ownerInventory.destroyItemByItemId("PrivateStore", moneda, totalPrice, _owner, player); ownerIU.addItem(adenaItem); - playerInventory.addAdena("PrivateStore", totalPrice, player, _owner); - playerIU.addItem(playerInventory.getAdenaInstance()); + playerInventory.addItem("PrivateStore", moneda, totalPrice, player, _owner); + playerIU.addItem(playerInventory.getItemByItemId(moneda)); } if (ok) Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 4410) +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -14889,4 +14889,18 @@ addSkill(SkillTable.getInstance().getInfo(id, nextLevel), true); } } + + public synchronized long getBuyStoreCurrency() + { + L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_BUY_CURRENCY); + + return item == null? 0 : item.getCount(); + } + + public synchronized long getSellStoreCurrency() + { + L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_SELL_CURRENCY); + + return item == null? 0 : item.getCount(); + } } Index: java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java =================================================================== --- java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java (revision 4410) +++ java/com/l2jserver/gameserver/model/itemcontainer/PcInventory.java (working copy) @@ -85,11 +85,14 @@ FastList<L2ItemInstance> list = FastList.newInstance(); for (L2ItemInstance item : _items) { - if ((!allowAdena && item.getItemId() == 57)) + final int itemId = item.getItemId(); + if ((!allowAdena && itemId == 57)) continue; - if ((!allowAncientAdena && item.getItemId() == 5575)) + if ((!allowAncientAdena && itemId == 5575)) continue; - + if(itemId == Config.STORE_BUY_CURRENCY) + continue; + boolean isDuplicate = false; for (L2ItemInstance litem : list) { Index: java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java =================================================================== --- java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 4410) +++ java/com/l2jserver/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy) @@ -140,7 +140,7 @@ } // Check for available funds - if (totalCost > player.getAdena()) + if (totalCost > player.getBuyStoreCurrency()) { player.sendPacket(new PrivateStoreManageListBuy(player)); player.sendPacket(new SystemMessage(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_MONEY)); Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java (revision 4410) +++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListBuy.java (working copy) @@ -33,7 +33,7 @@ public PrivateStoreListBuy(L2PcInstance player, L2PcInstance storePlayer) { _objId = storePlayer.getObjectId(); - _playerAdena = player.getAdena(); + _playerAdena = player.getBuyStoreCurrency(); storePlayer.getSellList().updateItems(); // Update SellList for case inventory content has changed _items = storePlayer.getBuyList().getAvailableItems(player.getInventory()); } Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java (revision 4410) +++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreListSell.java (working copy) @@ -34,7 +34,7 @@ public PrivateStoreListSell(L2PcInstance player, L2PcInstance storePlayer) { _objId = storePlayer.getObjectId(); - _playerAdena = player.getAdena(); + _playerAdena = player.getSellStoreCurrency(); _items = storePlayer.getSellList().getItems(); _packageSale = storePlayer.getSellList().isPackaged(); } Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java (revision 4410) +++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListBuy.java (working copy) @@ -34,7 +34,7 @@ public PrivateStoreManageListBuy(L2PcInstance player) { _objId = player.getObjectId(); - _playerAdena = player.getAdena(); + _playerAdena = player.getBuyStoreCurrency(); _itemList = player.getInventory().getUniqueItems(false, true); _buyList = player.getBuyList().getItems(); } Index: java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java (revision 4410) +++ java/com/l2jserver/gameserver/network/serverpackets/PrivateStoreManageListSell.java (working copy) @@ -42,7 +42,7 @@ public PrivateStoreManageListSell(L2PcInstance player, boolean isPackageSale) { _objId = player.getObjectId(); - _playerAdena = player.getAdena(); + _playerAdena = player.getSellStoreCurrency(); player.getSellList().updateItems(); _packageSale = isPackageSale; _itemList = player.getInventory().getAvailableItems(player.getSellList()); Index: java/config/l2jmods.properties =================================================================== --- java/config/l2jmods.properties (revision 4410) +++ java/config/l2jmods.properties (working copy) @@ -379,3 +379,14 @@ # Basic protection against L2Walker. # Default: False L2WalkerProtection = False + +# --------------------------------------------------------------------------- +# Private Store Buy/Sell - Moneda de cambio +# --------------------------------------------------------------------------- +# Elige que moneda quieres que se use como pago en los Private Store Buy (amarillos) +# Retail: 57, Por Defecto: 57 +PrivateStoreBuyMoneda = 57 + +# Elige que moneda quieres que se use como pago en los Private Store Sell (morados) +# Retail: 57, Por Defecto: 57 +PrivateStoreSellMoneda = 57but its structure it's a little bit different for acis and i don't know if it's going to work! Can someone adapt it for acis or give me another? Thanks!
  4. @Tryskell about making fun with some people i will agree with this guy sometimes you expect from someone who doesnt know java and its at the stage of learning to know everything ... And yes i am talking about me -_- i dont know maybe i am wrong but i felt sometimes like this Other than that you do a great work ... and nobody can disagree ...
  5. извини, я думал ты мужик ! где находится это ?
  6. hmm you are right how I can do this to apply only in my custom zone? or what penalty give to one that dies? here is how is now at my player.java if (calculatePvpPk(targetPlayer)) { // Give x y for a pvp kill addItem("Loot", 57, 1000000, this, true); } how i can do this work only in my zone ? zone name = L2CustomZone
  7. Yes i fixed it now i think :P hmm thats not bad idea but botting will exist they will just wait 1 minute in 1 hour they can take 60 coins ... the idea of the another code is if TEO kill Solomun 4 times in a row without 10 seconds passing it will not get reward and also they will not get reward for the next 15 minutes Another idea i am thinking is to set maximunt per day amount which one will work better ?
  8. I already posted in acis forum for this one but since mxc is bigger community i am posting here also ! Hello !I want request something for something i already have ... Its very crusial for me and i need your help / opinions Well this is how i have it now ... at every pvp/pk you get 1 item (coin) I've added hwid protection to prevent dualbox boting Then i thought this aint protect from boting (simply you from 2 different pcs the botting will continue) So i found this code http://www.maxcheaters.com/topic/212044-pvp-protection/ but because i already have the hwid/ip options and dont want to mess with adding again i want to take the part of this code about "If a player kills someone 4 consecutive times in a row without 10 seconds passing between each kill, a protection from the killer to the victim is added which means for the next 15 minutes, the killer will not get any rewards from killing the victim (rewards like pvp point and maybe other customs addons you have like on-kill reward)." and integrate it to mine ... Mine code in player.java is this (you can take it as share if you want but to work you need client files... ) public boolean calculatePvpPk(Player targetPlayer) { if ((getClient() != null) && (targetPlayer.getClient() != null)) { String HwId1 = getClient().getHWid(); String HwId2 = targetPlayer.getClient().getHWid(); String ip1 = getClient().getConnection().getInetAddress().getHostAddress(); String ip2 = targetPlayer.getClient().getConnection().getInetAddress().getHostAddress(); if ((Config.GET_PVPWITH_HWID&&HwId1.equals(HwId2)) || (Config.GET_PVPWITH_IP&&ip1.equals(ip2))) return false; } return true; } Please help me with this ! Or any other idea how i can prevent botting ? Thank you
  9. μμ ναι ... λεπτομέρειες το θέμα είναι να γίνει αυτό ουσιαστικά ... Τι κάνω εκεί ακριβώς ;
  10. ναι ... ουσιαστικά αυτό ... απλά τώρα έτσι όπως είναι όταν πατάω to village με βγάζει στο zone :P και θέλω να έχω σαν δεύτερο πχ to town ωστε να μπορεί να φύγει απο το zone
  11. ναι κάτι είχα καταλάβει ... απλά υποθέτω ότι το client κομμάτι θα είναι η αλλαγή του ονόματος "To village" "To diko mou meros" αλλά εγώ θέλω να χρησιμοποιήσω ήδη υπάρχων λχ το 1 να είναι "To village" το άλλο "To Town" δεν ξέρω σίγουρα βέβαια υποθέτω οτι είναι έτσι
  12. http://www.maxcheaters.com/topic/70522-πως-θα-ανοίξετε-έναν-l2j-gracia-final-serverκαι-πως-κάνουμε-compile/ Ορίστε δεν έχει σημασία που λέει gracia εσύ απλά θα βάλεις ένα interlude source ... τα υπόλοιπα είναι ίδια
  13. ahh ! Lucky guy :D I wanted this one ! Hope first of all be next time and if its going to be hope i will win then ! Thank you Xtrinky for this hope you will make again :D !
  14. Γειά σας ! Έχει εδώ και λίγες ημέρες που έβαλα έναν κώδικα για custom zone (προσφορά του Baggos) με λίγες τροποποιήσεις κατάφερα να το κάνω να δουλέψει εκεί που θέλω ! Έπειτα σκέφτηκα να βάλω 2 επιλογή όταν πεθαίνει ο παίκτης δηλαδή εκτός του "To village" να έχει για παράδειγμα "To town" ή κάτι δικό μου ... έψαξα να βρώ πως το κάνω αλλά δεν βρήκα σαν 2 επιλογή πως μπορείς να το κάνεις ... Υποθέτω ότι είναι κάπως στο requestrestartpoint.java αλλά δεν μπορώ να καταλάβω πως ακριβώς ... Αν μπορείτε να με βοηθήσετε :p Ευχαριστώ!
  15. ну где ты видел для 365? может тогда сам попробоваю переделать на 368
  16. Γειά σας παιδιά :) Βρήκα αυτόν εδώ τον κώδικα εδώ http://www.maxcheaters.com/topic/213230-ant-dual-box-acis/ και προσπαθώ να το κάνω σε hwid (χρησιμοποιώ catsguard ) οπότε το κομμάτι αυτό + +/** The _active_boxes. */ +public int _active_boxes = -1; + +/** The active_boxes_characters. */ +public List<String> active_boxes_characters = new ArrayList<>(); + +/** +* check if local player can make multibox and also refresh local boxes instances number. +* @return true, if successful +*/ +public boolean checkMultiBox() +{ + +boolean output = false; + +int boxes_number = 0; // this one +final List<String> active_boxes = new ArrayList<>(); + +if (getClient() != null && getClient().getConnection() != null && !getClient().getConnection().isClosed() && getClient().getConnection().getInetAddress() != null) +{ +final String thisip = getClient().getConnection().getInetAddress().getHostAddress(); +final Collection<L2PcInstance> allPlayers = World.getInstance().getPlayers(); +for (final L2PcInstance player : allPlayers) +{ +if (player != null) +{ +if (player.isOnline() && player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && player.getClient().getConnection().getInetAddress() != null && !player.getName().equals(this.getName())) +{ +final String ip = player.getClient().getConnection().getInetAddress().getHostAddress(); +if (thisip.equals(ip) && this != player) +{ +if (!Config.ALLOW_DUALBOX) +{ +output = false; +break; +} +if (boxes_number + 1 > Config.ALLOWED_BOXES) +{ +// actual count+actual player one +output = true; +break; +} +boxes_number++; ++active_boxes.add(player.getName()); +} +} +} +} +} + +if (output) +{ +_active_boxes = boxes_number + 1; // current number of boxes+this one +if (!active_boxes.contains(this.getName())) +{ +active_boxes.add(this.getName()); + +this.active_boxes_characters = active_boxes; +} +refreshOtherBoxes(); +} +/** +_log.info("Player "+getName()+" has this boxes"); for(String name:active_boxes_characters){ _log.info("*** "+name+" ***"); } +*/ +return output; +} + +/** +* increase active boxes number for local player and other boxer for same ip. +*/ +public void refreshOtherBoxes() +{ +if (getClient() != null && getClient().getConnection() != null && !getClient().getConnection().isClosed() && getClient().getConnection().getInetAddress() != null) +{ +final String thisip = getClient().getConnection().getInetAddress().getHostAddress(); +final Collection<L2PcInstance> allPlayers = World.getInstance().getPlayers(); ++final L2PcInstance[] players = allPlayers.toArray(new L2PcInstance[allPlayers.size()]); +for (final L2PcInstance player : players) +{ +if (player != null && player.isOnline()) +{ +if (player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && +!player.getName().equals(this.getName())) +{ + +final String ip = player.getClient().getConnection().getInetAddress().getHostAddress(); +if (thisip.equals(ip) && this != player) +{ +player._active_boxes = _active_boxes; +player.active_boxes_characters = active_boxes_characters; +/** +_log.info("Player "+player.getName()+" has this boxes"); for(String name:player.active_boxes_characters){ _log.info("*** "+name+" ***"); } +*/ +} +} +} +} +} +} + +/** +* descrease active boxes number for local player and other boxer for same ip. +*/ +public void decreaseBoxes() +{ +_active_boxes = _active_boxes - 1; +active_boxes_characters.remove(this.getName()); + +refreshOtherBoxes(); +} το έχω κάνει έτσι /** The _active_boxes. */ public int _active_boxes = -1; /** The active_boxes_characters. */ public List<String> active_boxes_characters = new ArrayList<>(); /** * check if local player can make multibox and also refresh local boxes instances number. * @return true, if successful */ public boolean checkMultiBox() { boolean output = false; int boxes_number = 0; // this one final List<String> active_boxes = new ArrayList<>(); if (getClient() != null && getClient().getHWid() != null) { final String thisip = getClient().getHWid(); final Collection<Player> allPlayers = World.getInstance().getPlayers(); for (final Player player : allPlayers) { if (player != null) { if (player.isOnline() && player.getClient() != null && player.getClient().getHWid() != null && !player.getName().equals(this.getName())) { final String ip = player.getClient().getHWid(); if (thisip.equals(ip) && this != player) { if (!Config.ALLOW_DUALBOX) { output = false; break; } if (boxes_number + 1 > Config.ALLOWED_BOXES) { // actual count+actual player one output = true; break; } boxes_number++; active_boxes.add(player.getName()); } } } } } if (output) { _active_boxes = boxes_number + 1; // current number of boxes+this one if (!active_boxes.contains(this.getName())) { active_boxes.add(this.getName()); this.active_boxes_characters = active_boxes; } refreshOtherBoxes(); } /** _log.info("Player "+getName()+" has this boxes"); for(String name:active_boxes_characters){ _log.info("*** "+name+" ***"); } */ return output; } /** * increase active boxes number for local player and other boxer for same ip. */ public void refreshOtherBoxes() { if (getClient() != null && getClient().getHWid() != null ) { final String thisip = getClient().getHWid(); final Collection<Player> allPlayers = World.getInstance().getPlayers(); final Player[] players = allPlayers.toArray(new Player[allPlayers.size()]); for (final Player player : players) { if (player != null && player.isOnline()) { if (player.getClient() != null && player.getClient().getHWid() != null && !player.getName().equals(this.getName())) { final String ip = player.getClient().getHWid(); if (thisip.equals(ip) && this != player) { player._active_boxes = _active_boxes; player.active_boxes_characters = active_boxes_characters; /** _log.info("Player "+player.getName()+" has this boxes"); for(String name:player.active_boxes_characters){ _log.info("*** "+name+" ***"); } */ } } } } } } /** * descrease active boxes number for local player and other boxer for same ip. */ public void decreaseBoxes() { _active_boxes = _active_boxes - 1; active_boxes_characters.remove(this.getName()); refreshOtherBoxes(); } αλλά έβαλα πχ στο config max boxes 2 και μπορούσα να μπω με 3 παράθυρα ... για την Ολυμπιάδα δεν το δοκίμασα καν αλλά για να μην δουλεύει εκεί ούτε στην ολυμπιάδα θα δουλεύει ... Τι έχω κάνει λάθος ; Ευχαριστώ
  17. I mean that the adaption is not correct as it shared
  18. Ρε παιδιά έλεος καμία βοήθεια; να ποστάρω τον κώδικα; (δε νομίζω να έχει λάθος) ...
  19. again i dont understand so how is going to point to my server ? I tried with l2 server ip doesnt load at all then with cpanel ip it saying unable to connecto to the db Thanks ...
  20. Well nice try with the guide but i didnt understand some things ... like Which ip do you mean ? Select all Cans what do you mean here ? if i press add privelleges it showing me the databases and etc and then i can sellect and add priveleges to each database i should select all privelleges?
  21. Ευχαριστώ πάλι! Για να το βάλω σε κονφιγκ σου είναι εύκολο να το βάλεις εδώ; Γιατί πολλές φορές λόγω αυτού καταλήγω να μην δουλεύουν κάποιοι κώδικες
×
×
  • Create New...