Jump to content

tz3

Legendary Member
  • Posts

    8,231
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by tz3

  1. Index: /Server/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- /Server/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 13) +++ /Server/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 15) @@ -4410,4 +4410,11 @@ // Check if it's pvp + String player1 = getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress(); + String player1target = targetPlayer.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress(); + if (player1.equals(player1target)) + return; if ( (
  2. In multisell you must add: <ingredient id="ITEM ID" count="COUNT" /> <production id="ARMOR UP" count="1" /> <production id="ARMOR DOWN" count="1" /> <production id="ARMOR HELM" count="1" /> <production id="ARMOR GLOVES" count="1" /> <production id="ARMOR BOOTS" count="1" /> Change them to your IDs/count save,exit and reload ;D Have fun
  3. you can add it in updatepvpflag so when the player flag the skill will dissapear
  4. omg ! amaizing work :) 10/10 Im wondering when you will create one for me ??? :D
  5. Seeeems realy coool server but what about the comunity ? how many are online >
  6. credits are not mine lol ;D they are to L2Dot (the old pack)
  7. Okay I will test and I will reply thanks for your help :) PS: Don't lock it :) EDIT: Ok its working thanks for your help :) Some one lock it xD
  8. I found that: http://www.maxcheaters.com/forum/index.php?topic=29670.0 But how can i find the ID if the players ? xD
  9. Hello. I have realy noob question ... But I'm new in gracia and I don't know how to do it. Ok lets start explane: How can I change the npc template to a player look ? Ive seen this in alot of servers but I don't know how to do it ... Can some one tell me ? PS: I'm sorry but I don't know in what section this topic must go :(
  10. 1. If you are with access bigger then 1 they will not attack you 2. Change the aggro to 1000 3. If the server is pvp you can delete the silent move the players dont need it in pvp server ;D
  11. Index: /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/loginserver/SelectorHelper.java =================================================================== --- /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/loginserver/SelectorHelper.java (revision 9) +++ /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/loginserver/SelectorHelper.java (revision 22) @@ -23,4 +23,5 @@ import java.util.concurrent.TimeUnit; +import net.sf.l2j.gameserver.util.IPv4Filter; import net.sf.l2j.loginserver.network.serverpackets.Init; @@ -38,8 +39,10 @@ { private ThreadPoolExecutor _generalPacketsThreadPool; + private IPv4Filter _ipv4filter; public SelectorHelper() { _generalPacketsThreadPool = new ThreadPoolExecutor(4, 6, 15L, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); + _ipv4filter = new IPv4Filter(); } @@ -67,5 +70,5 @@ public boolean accept(SocketChannel sc) { - return !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress()); + return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress()); } Index: /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java =================================================================== --- /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (revision 21) +++ /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/network/L2GamePacketHandler.java (revision 22) @@ -33,5 +33,4 @@ import net.sf.l2j.loginserver.SelectorHelper; import net.sf.l2j.loginserver.SelectorHelper.Flood; -import net.sf.l2j.util.Util; import com.l2jserver.mmocore.network.IAcceptFilter; @@ -77,5 +76,5 @@ else { - printDebug(opcode, buf, state, client); + System.out.println("The following IP adress is trying a flood action.Please Ban Him! ("+ client.toString() +")"); } break; @@ -105,5 +104,4 @@ break; default: - printDebug(opcode, buf, state, client); break; } @@ -805,5 +803,4 @@ break; default: - printDebugDoubleOpcode(opcode, id2, buf, state, client); break; } @@ -813,5 +810,4 @@ break;*/ default: - printDebug(opcode, buf, state, client); break; } @@ -820,20 +816,6 @@ return msg; } - - private void printDebug(int opcode, ByteBuffer buf, GameClientState state, L2GameClient client) - { - if (!Config.PACKET_HANDLER_DEBUG) - return; - - int size = buf.remaining(); - if (Config.LOG_PACKETS) - _log.warning("Unknown Packet: "+Integer.toHexString(opcode)+" on State: "+state.name()+" Client: "+client.toString()); - byte[] array = new byte[size]; - buf.get(array); - _log.warning(Util.printData(array, size)); - if (Config.ENABLE_PACKET_PROTECTION) - unknownPacketProtection(client); - } + @SuppressWarnings("unused") private void unknownPacketProtection(L2GameClient client) { @@ -875,17 +857,4 @@ break; } - } - - private void printDebugDoubleOpcode(int opcode, int id2, ByteBuffer buf, GameClientState state, L2GameClient client) - { - if (!Config.PACKET_HANDLER_DEBUG) - return; - - int size = buf.remaining(); - if (Config.LOG_PACKETS) - _log.warning("Unknown Packet: "+Integer.toHexString(opcode)+":" + Integer.toHexString(id2)+" on State: "+state.name()+" Client: "+client.toString()); - byte[] array = new byte[size]; - buf.get(array); - _log.warning(Util.printData(array, size)); } Index: /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/util/IPv4Filter.java =================================================================== --- /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/util/IPv4Filter.java (revision 22) +++ /trunk/L2J-Infinity_IL_GS/java/net/sf/l2j/gameserver/util/IPv4Filter.java (revision 22) @@ -0,0 +1,152 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html + */ + +package net.sf.l2j.gameserver.util; + +import java.net.InetAddress; +import java.nio.channels.SocketChannel; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map.Entry; + +import com.l2jserver.mmocore.network.IAcceptFilter; + +/** +* Formatted Forsaiken's IPv4 filter [DrHouse] +* +* @Reworked by Adryan +* +*/ +public class IPv4Filter implements IAcceptFilter, Runnable +{ + private HashMap<Integer, Flood> _ipFloodMap; + private static final long SLEEP_TIME = 5000; + + public IPv4Filter() + { + _ipFloodMap = new HashMap<Integer, Flood>(); + Thread t = new Thread(this); + t.setDaemon(true); + t.start(); + } + /** + * + * @param ip + * @return + */ + private static final int hash(byte[] ip) + { + return ip[0] & 0xFF | ip[1] << 8 & 0xFF00 | ip[2] << 16 & 0xFF0000 | ip[3] << 24 & 0xFF000000; + } + + protected static final class Flood + { + long lastAccess; + int trys; + + Flood() + { + lastAccess = System.currentTimeMillis(); + trys = 0; + } + } + + public boolean accept(SocketChannel sc) + { + InetAddress addr = sc.socket().getInetAddress(); + int h = hash(addr.getAddress()); + + long current = System.currentTimeMillis(); + Flood f; + synchronized (_ipFloodMap) + { + f = _ipFloodMap.get(h); + } + if (f != null) + { + if (f.trys == -1) + { + f.lastAccess = current; + return false; + } + + if (f.lastAccess + 1000 > current) + { + f.lastAccess = current; + + if (f.trys >= 3) + { + f.trys = -1; + return false; + } + + f.trys++; + } + else + { + f.lastAccess = current; + } + } + else + { + synchronized (_ipFloodMap) + { + _ipFloodMap.put(h, new Flood()); + } + } + + return true; + } + + public void run() + { + while (true) + { + long reference = System.currentTimeMillis() - (1000 * 300); + ArrayList<Integer> toRemove = new ArrayList<Integer>(50); + + synchronized (_ipFloodMap) + { + for (Entry<Integer, Flood> e : _ipFloodMap.entrySet()) + { + Flood f = e.getValue(); + if (f.lastAccess < reference) + toRemove.add(e.getKey()); + } + } + + synchronized (_ipFloodMap) + { + for (Integer i : toRemove) + { + _ipFloodMap.remove(i); + } + } + + try + { + Thread.sleep(SLEEP_TIME); + } + catch (InterruptedException e) + { + + } + } + } + +} that will help you too :)
  12. Index: /Server/GameServer/java/config/other.properties =================================================================== --- /Server/GameServer/java/config/other.properties (revision 2) +++ /Server/GameServer/java/config/other.properties (revision 10) @@ -45,8 +45,20 @@ EnchantChanceArmor = 52 EnchantChanceJewelry = 54 + +# Chance a Crystal Enchant Scroll will succeed after safe enchant. +EnchantChanceWeaponCrystal = 100 +EnchantChanceArmorCrystal = 100 +EnchantChanceJewelryCrystal = 100 + +# Chance a Blessed Enchant Scroll will succeed after safe enchant. +EnchantChanceWeaponBlessed = 85 +EnchantChanceArmorBlessed = 85 +EnchantChanceJewelryBlessed = 85 + # Enchant limit [default = 0 (unlimited)] EnchantMaxWeapon = 0 EnchantMaxArmor = 0 EnchantMaxJewelry = 0 + # if EnchantSafeMax is set to for ex '8' the item will be safly enchanted to '8' # regardless of enchant chance(default = 3 for EnchantSafeMax and default = 4 for EnchantSafeMaxFull) Index: /Server/GameServer/java/net/sf/l2j/Config.java =================================================================== --- /Server/GameServer/java/net/sf/l2j/Config.java (revision 8) +++ /Server/GameServer/java/net/sf/l2j/Config.java (revision 10) @@ -948,4 +948,12 @@ public static int ENCHANT_MAX_ARMOR; public static int ENCHANT_MAX_JEWELRY; + + public static int ENCHANT_CHANCE_WEAPON_CRYSTAL; + public static int ENCHANT_CHANCE_ARMOR_CRYSTAL; + public static int ENCHANT_CHANCE_JEWELRY_CRYSTAL; + public static int ENCHANT_CHANCE_WEAPON_BLESSED; + public static int ENCHANT_CHANCE_ARMOR_BLESSED; + public static int ENCHANT_CHANCE_JEWELRY_BLESSED; + /** maximum level of safe enchantment for normal items*/ public static int ENCHANT_SAFE_MAX; @@ -1490,4 +1498,10 @@ ENCHANT_MAX_ARMOR = Integer.parseInt(otherSettings.getProperty("EnchantMaxArmor", "255")); ENCHANT_MAX_JEWELRY = Integer.parseInt(otherSettings.getProperty("EnchantMaxJewelry", "255")); + ENCHANT_CHANCE_WEAPON_CRYSTAL = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeaponCrystal", "100")); + ENCHANT_CHANCE_ARMOR_CRYSTAL = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmorCrystal", "100")); + ENCHANT_CHANCE_JEWELRY_CRYSTAL = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelryCrystal", "100")); + ENCHANT_CHANCE_WEAPON_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceWeaponBlessed", "85")); + ENCHANT_CHANCE_ARMOR_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmorBlessed", "85")); + ENCHANT_CHANCE_JEWELRY_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelryBlessed", "85")); /*limit of safe enchant normal */ ENCHANT_SAFE_MAX = Integer.parseInt(otherSettings.getProperty("EnchantSafeMax", "3")); Index: /Server/GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java =================================================================== --- /Server/GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java (revision 2) +++ /Server/GameServer/java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java (revision 10) @@ -41,6 +41,9 @@ protected static final Logger _log = Logger.getLogger(Inventory.class.getName()); private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem"; - private static final int[] CRYSTAL_SCROLLS = { 731, 732, 949, 950, 953, 954, 957, 958, 961, 962 }; - + private static final int[] ENCHANT_SCROLLS = { 729, 730, 947, 948, 951, 952, 955, 956, 959, 960 }; + private static final int[] CRYSTAL_SCROLLS = { 731, 732, 949, 950, 953, 954, 957, 958, 961, 962 }; + private static final int[] BLESSED_SCROLLS = { 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578 }; + + private int _objectId; @@ -57,4 +60,12 @@ if (activeChar == null || _objectId == 0) return; + if (activeChar.isProcessingTransaction()) + { + activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION)); + activeChar.setActiveEnchantItem(null); + return; + } + + L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId); L2ItemInstance scroll = activeChar.getActiveEnchantItem(); @@ -179,27 +190,93 @@ } - // SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANT_SCROLL_CANCELLED); - // activeChar.sendPacket(sm); - - SystemMessage sm; - - int chance = 0; - int maxEnchantLevel = 0; - - if (item.getItem().getType2() == L2Item.TYPE2_WEAPON) - { - chance = Config.ENCHANT_CHANCE_WEAPON; - maxEnchantLevel = Config.ENCHANT_MAX_WEAPON; - } - else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR) - { - chance = Config.ENCHANT_CHANCE_ARMOR; - maxEnchantLevel = Config.ENCHANT_MAX_ARMOR; - } - else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY) - { - chance = Config.ENCHANT_CHANCE_JEWELRY; - maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY; - } + // SystemMessage sm = new + // SystemMessage(SystemMessageId.ENCHANT_SCROLL_CANCELLED); + // activeChar.sendPacket(sm); + SystemMessage sm; + int chance = 0; + int maxEnchantLevel = 0; + if (item.getItem().getType2() == L2Item.TYPE2_WEAPON) + { + maxEnchantLevel = Config.ENCHANT_MAX_WEAPON; + for (int scrollId : ENCHANT_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_WEAPON; + break; + } + } + for (int scrollId : CRYSTAL_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL; + ; + break; + } + } + for (int scrollId : BLESSED_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED; + break; + } + } + } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR) + { + maxEnchantLevel = Config.ENCHANT_MAX_ARMOR; + for (int scrollId : ENCHANT_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_ARMOR; + break; + } + } + for (int scrollId : CRYSTAL_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL; + break; + } + } + for (int scrollId : BLESSED_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED; + break; + } + } + } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY) + { + maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY; + for (int scrollId : ENCHANT_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_JEWELRY; + break; + } + } + for (int scrollId : CRYSTAL_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL; + break; + } + } + for (int scrollId : BLESSED_SCROLLS) + { + if (scroll.getItemId() == scrollId) + { + chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED; + break; + } + } + } if (item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX
  13. great guide dude :) but in gracia epiloque there are new skills ;D if you can explane them it will be great :D
  14. I like the bow :) great work ^^ thanks
  15. lool they are realy cool xD but how the mens looking ? :) thanks
  16. amaizing :-X just awesome weapons :) Thanks for the share
  17. Amaaaaaaaaaaaaaaaaaaaaizing !!! LOOOOOL GREAT WORK ! Damn they are :-X Just AWESOME ! Thanks alot :)
  18. you have an error private static final String[] VOICED_COMMANDS = { "stats" }; it must be like: private static final String[] VOICED_COMMANDS = { "aio" }; Its awesome :)
  19. what do you mean ? and do you compile the mmocore ?! Im 100% that you did not couse i test the ddos and it not worked dude ! for the funny lag when i come back I will fix it :)
  20. sure that archid is the best IL for now but its paid ... that one is free :) and archid is under development more then year our project is under development more then ~1 month
  21. for now i did not get a report for it I thing it works
  22. yes Blessing Of Protection btw why dont you take a look in the time line next time ;D
  23. damn thats realy nice ! thanks
  24. Thanks :) I will not quit. The reason is that I love interlude ;D and there are no so many free projects with so much customs added and bugs fixed :) I whanna reach the top like L2J-Archid but mine project will be free :)
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..