Jump to content

B1ggBoss

Legendary Member
  • Posts

    494
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by B1ggBoss

  1. if the npcs spawn automatically, add it into the site where they are spawned, and basing on npc id, you can schedule the task if needed. If is spawned manually, create a new admin command which one after spawn the mob, the task is scheduled automatically
  2. class UnSpawn implements Runnable { private final L2Npc npc; public UnSpawn(final L2Npc npc) { this.npc = npc; } @Override public void run() { if(npc != null) { SpawnTable.getInstance().deleteSpawn(npc.getLastSpawn(), false); npc.deleteMe(); } } } Where you wanna use it: long delay = YOUR TIME IN SECS * 1000; L2Npc yourNpc; ThreadPoolManager.getInstance().scheduleGeneral(new UnSpawn(yourNpc), delay);
  3. You must think that, each core from your server will use a thread at the same time, so increase the pools size wont increase the performance if you machine remains the same. The minimun configuration would be 4 in each parameter. (Example: If the general executor has 6 pending task, it wont be able to execute more than 4 at the same time). I would put 5 or 6. About heap space, you may use all the ram you need w/o exceeding your hardware specification. However is useless to give a lot of ram to something that isnt use it. So, give it a initial value of 4 gb as Xmx (max heap size). If your server grows, just add more ram
  4. Edit the topic title to any other which makes more sense or thread will be locked
  5. to make an item to be dropped just by spoil, in database -> droplist -> add the item and, in category column, put -1
  6. To find existent pieces of code (like this) you should follow a logic way instead try to search in a place whero you think they are. So lets follow that way: 1) When players wanna equip an item, they use the item , so the server must recive information about what item wanna player equip: Lets look in UseItem from clientpackets 2) Looking at the runImpl method of that packet, and after all restrictions checked, we will find activeChar.useEquippableItem(item, true) where item = the l2iteminstance to equip true = representing a boolean variable, true = stop attacking on equip So, now lets go to L2PcInstance class -> useEquippableItem method 3) If we read what that method does, it equip the item if isnt equiped and unequip it if is equiped. What we want is to always equip it so, lets jump to the conditions checks where the item is equiped and we will find this getInventory().equipItemAndRecord(item); getInventory() will return the PcInventory from the L2PcInstance object using the L2ItemInstance as argument, with equipItemAndRecord we will equip the item in the player
  7. isnt the method you need is to stop the current pc action whenever you need it. For that, you need to know how the server core works, where the actions performing by players starts and where they end. To prevent them from attack, you may edit AttackRequest packet (client -> server packet), a packet the server recives from clients where a player try to attack something.
  8. 1) Edit your topic title to any which makes more sense 2) If you mean to restrict attack any player with a spcified state (in this case, isCoyote == true) just edit the server core to forbid them in the right places (i'd recommend in the clientpackets where this actions comes from, so you avoid all kind of operations from the begin)
  9. read the rules and edit your topic title with the appropiate tag or thread will be locked
  10. hmm, my desktop look so bad when i made the guide :/ anyway, back on topic. Why didnt you respect my credits =) ? http://forum.ragezone.com/f328/guide-addapt-stuff-betwen-different-chronicles-475622/
  11. The category is a number used to determine the drop groups into the mob droplist. Is used to determine which drops must compete for a drop position. Eg: Lets say a mob has 4 drops; Adena with category 1 Ancient with category 1 Stem with category 1 Steel with category 2 That mob will drop 2 items, 1 from random between adena, ancient adena and stem, and 1 from steel 0 does not have any special effect and as SkyNet says, -1 is used to add spoiled drops
  12. created it few days ago for l2jserver, GE. You can edit the currency of private store buy and private store sell (separately) in config (l2jmod.properties) 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 = 57
  13. seems he has the files in his own computer, and they are unavaliable to download while his pc is off. Please, upload it to any free upload site
  14. if you use a clean l2j epilogue core and datapack that wont happen. Tell us what custom stuff you added to the server
  15. link isnt working. PM ME when you get a working link to post, locked
×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock