Search the Community

Showing results for tags 'Code'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Lineage II Server Packs [Java]
  • Lineage II Server Packs [PTS]
  • Lineage II Server Scripts
  • Lineage II Client Scripts
  • Lineage II Items & Chars
  • Website Templates

Categories

  • Articles

Forums

  • General Zone
    • Announcements and News
    • Newbies Introduce Urself
    • Maxcheaters Competitions & Events
    • Votes/Polls Area
    • Report Section
    • Downloads Section
  • Lineage II General Section
    • General Discussion [English]
    • Request Support [English]
  • Lineage II Hacks,Cheats and Bots
    • Hacks & Cheats [English]
    • Request Hacks & Cheats [English]
    • Botting [English]
    • Request Botting [English]
  • Lineage II Private Servers
    • E-Global - Modern Interlude x7
    • Private Servers
    • L2Mordor.com - Interlude [x27] - Grand Opening 4 May!
    • [Previews] L2 Private Servers
    • Clans and Alliances
  • Lineage II Marketplace
    • Marketplace [Items & Chars]
    • Marketplace [L2Packs & Files]
    • Marketplace [Powerlvl & Support]
  • Lineage II OFF Server Development
    • Server Development Discussion [L2OFF]
    • Request Server Development Help [L2OFF]
    • Server Shares & Files [L2OFF]
  • Lineage II Java Server Development
    • Server Development Discussion [L2J]
    • Request Server Development Help [L2J]
    • Server Shares & Files [L2J]
    • Private Projects [L2J]
  • Lineage II Client Development
    • Client Development Discussion
  • MMO Games
    • League of Legends
    • World Of Warcraft Area
    • Other Multiplayer Games
  • General Section
    • General Marketplace
    • Consoles/Mobiles/PDA Gaming Zone
    • Webmasters Zone
    • Hacking/Coding Zone
  • Graphics/GFX Zone
    • Graphics/GFX General Discussion
    • Graphics/GFX Showcase
    • Graphics/GFX Resources/Tools
  • VIP/SVIP/Donators Zone
    • VIPs/Donators Discussion
    • VIPs Lineage II
    • VIPs [GFX] Zone
    • VIPs Download Area
  • MaxCheaters Corner
    • Tech/World News
    • Off-Topics
    • Spam Topics
  • TEST's Topics

Found 27 results

  1. Hello, this event I was creating, but I do not know what else to do, I took a lot of it out and there is a lot to be removed, I can not finish it any more, so anyone who wants to finish is a good event... https://pastebin.com/raw/x9GwZugx
  2. Hello guys, Long time ago, i had to create zone using NPoly and due to fact that is pain in the ass, i've decided to make this code. It's not unique, it's just slightly helpful thing which is going to make your life easier and save a bit time. To understand how the zones work take a look @SweeTs topic. You will understand many things. What is it? You have to select the zone type (NPoly,Cuboid,Cylinder) Set the coordinates (//saveLoc will store the current loc) Once you set all the locs you can save it in xml via the button Store or //storeLocs The Z distance can be found zDifference ( i made it 1000 as default but its up to you and the zone). P.S Im so lazy to make the htmls good. (even the first one , its not my job :P) coded for aCis 374
  3. package net.sf.l2j.gameserver.handler.itemhandlers; Pvpitem.java package net.sf.l2j.gameserver.handler.itemhandlers; import net.sf.l2j.gameserver.handler.IItemHandler; import net.sf.l2j.gameserver.model.actor.Playable; import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.item.instance.ItemInstance; import net.sf.l2j.gameserver.model.olympiad.OlympiadManager; import net.sf.l2j.gameserver.network.SystemMessageId; public class Pvpitem implements IItemHandler { @Override public void useItem(Playable playable, ItemInstance item, boolean forceUse) { if (!(playable instanceof Player)) return; Player player = (Player) playable; if (player.isInCombat()) { player.sendMessage("You can't use this item because you are in combat"); return; } if (player.getKarma() > 0) { player.sendMessage("You can't use this item if you have karma."); return; } if (player.isCursedWeaponEquipped()) { player.sendMessage("You can't use this item with a cursed weapon."); return; } if (player.isDead()) { player.sendMessage("You can't use this item while you are dead."); return; } if (player.getActiveTradeList() != null || player.getActiveEnchantItem() != null) { player.sendMessage("Cannot use while trading/enchanting"); return; } else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegisteredInComp(player)) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); return; } final int pvps = player.getPvpKills() + 1000; player.setPvpKills(pvps); player.broadcastUserInfo(); player.sendMessage("Your PVP count is now " + pvps); playable.destroyItem("Consume", item.getObjectId(), 1, null, false); } } package net.sf.l2j.gameserver.handler; ItemHandler.java registerItemHandler(new ClanItem()); registerItemHandler(new ExpAndSpItem()); registerItemHandler(new CleanKarma()); + registerItemHandler(new Pvpitem()); } public void registerItemHandler(IItemHandler handler) { _datatable.put(handler.getClass().getSimpleName().intern().hashCode(), handler); }
  4. When 2 or more cardinals or other healers in one party the heal gets nerfed net.sf.l2j.gameserver.handler.skillhandlers.heal.java public void useSkill(Creature activeChar, L2Skill skill, WorldObject[] targets) { +int healers = 0; +int minus = 2; + + if (activeChar.getParty() != null) +{ + for (Player player : activeChar.getParty().getMembers()) + { + if (player != null && player.getClassId().getId() == 97) + { + healers++; + + if (minus != 2 && (player.getPvpFlag() != 0 || player.getKarma() > 0)) + minus = 2; + } + } +} //go here hp = power; hp *= target.calcStat(Stats.HEAL_EFFECTIVNESS, 100, null, null) / 100; } //and paste this too +if (healers >= 2) // 2 or more healers in party +{ + int nerfValue = (2 + (healers - minus)); + hp /= nerfValue; + } // If you have full HP and you get HP buff, u will receive 0HP restored message
  5. ### Eclipse Workspace Patch 1.0 #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 573) +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -648,6 +648,10 @@ public String _teamNameTvT, _originalTitleTvT; public int _originalNameColorTvT = 0, _countTvTkills, _countTvTdies, _originalKarmaTvT; public boolean _inEventTvT = false; /** CTF Engine parameters */ public String _teamNameCTF, @@ -666,7 +670,6 @@ _countDMkills, _originalKarmaDM; public boolean _inEventDM = false; public int _correctWord = -1; public boolean _stopKickBotTask = false; @@ -900,7 +903,18 @@ private final BlockList _blockList = new BlockList(); private int _team = 0; /** * lvl of alliance with ketra orcs or varka silenos, used in quests and aggro checks [-5,-1] varka, 0 neutral, [1,5] * ketra @@ -5632,6 +5646,8 @@ // Kill the L2PcInstance if(!super.doDie(killer)) return false; + + spreeKills = 0; Castle castle = null; if(getClan() != null) @@ -5834,6 +5850,22 @@ boolean isKillerPc = killer instanceof L2PcInstance; if(isKillerPc && ((L2PcInstance) killer).getClan() != null && getClan() != null && !isAcademyMember() && !((L2PcInstance) killer).isAcademyMember() && _clan.isAtWarWith(((L2PcInstance) killer).getClanId()) && ((L2PcInstance) killer).getClan().isAtWarWith(_clan.getClanId())) { + PlaySound _snd = new PlaySound(1, "enemydown", 0, 0, 0, 0, 0); + + Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); + for (L2PcInstance onlinePlayer : pls) + if (onlinePlayer.isOnline() == 1) + { + if (onlinePlayer.getClan() != null) + { + if (onlinePlayer.getClan() == pk.getClan() && onlinePlayer != pk) + { + onlinePlayer.sendPacket(_snd); + } + } + } + + if(getClan().getReputationScore() > 0) { ((L2PcInstance) killer).getClan().setReputationScore(((L2PcInstance) killer).getClan().getReputationScore() + 2, true); @@ -6109,11 +6141,12 @@ { // check about wars if(targetPlayer.getClan() != null && getClan() != null) - { + { if(getClan().isAtWarWith(targetPlayer.getClanId())) { if(targetPlayer.getClan().isAtWarWith(getClanId())) - { + { + // 'Both way war' -> 'PvP Kill' increasePvpKills(); if(target instanceof L2PcInstance && Config.ANNOUNCE_PVP_KILL) @@ -6296,8 +6329,51 @@ /** * Increase the pvp kills count and send the info to the player */ + private int spreeKills = 0; public void increasePvpKills() { + spreeKills++; + + switch(spreeKills){ + + case 1: + PlaySound _snd1 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0); + sendPacket(_snd1); + break; + + case 2: + PlaySound _snd2 = new PlaySound(1, "doublekill", 0, 0, 0, 0, 0); + sendPacket(_snd2); + break; + + case 3: + PlaySound _snd3 = new PlaySound(1, "triplekill", 0, 0, 0, 0, 0); + sendPacket(_snd3); + break; + + case 4: + PlaySound _snd4 = new PlaySound(1, "megakill", 0, 0, 0, 0, 0); + sendPacket(_snd4); + break; + + case 5: + PlaySound _snd5 = new PlaySound(1, "ultrakill", 0, 0, 0, 0, 0); + sendPacket(_snd5); + break; + + case 10: + PlaySound _snd10 = new PlaySound(1, "monsterkill", 0, 0, 0, 0, 0); + sendPacket(_snd10); + break; + + case 15: + PlaySound _snd15 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0); + sendPacket(_snd15); + break; + default: + ; + } + int x,y,z; x = getX(); y = getY(); @@ -6658,6 +6734,10 @@ { newKarma = Integer.MAX_VALUE - getKarma(); } + PlaySound _snd = new PlaySound(1, "knife", 0, 0, 0, 0, 0); + sendPacket(_snd); + broadcastPacket(_snd); + // Add karma to attacker and increase its PK counter int x,y,
  6. https://pastebin.com/epSa6FQw credits : Williams
  7. Hello guys! I adapted the code about "Cannot Enchant near Warehouse" I found the code by Prince* I adapted this code for Frozen... Try it and tell me if it's working good because i didn't check it. Thank you :) "I know it wasn't hard to adapt it but i wanted to share it for frozen because some guys don't know how to do it... Peace :)" --- head-src/com/l2jfrozen/gameserver/clientpackets/RequestEnchantItem.java +++ head-src/com/l2jfrozen/gameserver/clientpackets/RequestEnchantItem.java @@ 20,1 @@ import com.l2jfrozen.Collection; import com.l2jfrozen.Logger; import com.l2jfrozen.gameserver.model.Inventory; +import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2WarehouseInstance; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.model.L2ItemInstance; +import com.l2jfrozen.gameserver.model.L2Object; import com.l2jfrozen.gameserver.model.L2World; @@ -61,7 +61,15 @@ { L2PcInstance activeChar = getClient().getActiveChar(); + Collection<L2Character> knowns = activeChar.getKnownList().getKnownCharactersInRadius(400); if (activeChar == null || _objectId == 0) return; + + for (L2Object wh : knowns) + { + if (wh instanceof L2WarehouseInstance) + { + activeChar.sendMessage("You cannot enchant near warehouse."); + return; + } + } L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId); L2ItemInstance scroll = activeChar.getActiveEnchantItem();
  8. You know the drill. Free time, coded something simple. Many servers have featured streamers so why not reward people for watching them. This is an auto reward system which rewards all players for watching the stream if there are more than a specific view count watching. You will need a client id key from twitch here https://dev.twitch.tv/dashboard/apps/create (You don't need a valid oauth url so fake one) All the configs are at the top of the file because i cba creating an actual config. You will need the gson library. You can download it here https://github.com/Elfocrash/L2ACP-api/raw/master/lib/gson-2.6.2.jar Pastebin line: https://pastebin.com/ff4ka830 That's all folks.
  9. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -62,6 +63,12 @@ return; } + if (player.isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.store_zone) + { + player.sendMessage("You cannot craft while inside Multifunction zone."); + return; + } + if (!player.isInsideZone(ZoneId.NO_STORE)) { player.sendPacket(SystemMessageId.NO_PRIVATE_WORKSHOP_HERE); +++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -56,6 +57,13 @@ return; } + if (player.isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.logout_zone) + { + player.sendMessage("You cannot Logout while inside a Multifunction zone."); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + if (player.isInsideZone(ZoneId.NO_RESTART)) { player.sendPacket(SystemMessageId.NO_LOGOUT_HERE); +++java/net/sf/l2j/gameserver/model/zone/ZoneId.java DANGER_AREA(15), CAST_ON_ARTIFACT(16), NO_RESTART(17), - SCRIPT(18); + SCRIPT(18), + MULTI_FUNCTION(19); private final int _id; +++java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -83,6 +84,13 @@ return; } + if (player.isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.store_zone) + { + player.sendPacket(new PrivateStoreManageListBuy(player)); + player.sendMessage("You cannot start store while inside Multifunction zone."); + return; + } + if (!player.isInsideZone(ZoneId.NO_STORE)) { player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE); +++java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -71,6 +72,13 @@ return; } + if (player.isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.store_zone) + { + player.sendPacket(new PrivateStoreManageListSell(player, _packageSale)); + player.sendMessage("You cannot start store while inside Multifunction zone."); + return; + } + if (!player.getAccessLevel().allowTransaction()) { player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT); +++java/net/sf/l2j/gameserver/network/serverpackets/Die.java. +import net.sf.l2j.gameserver.model.zone.ZoneId; +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; public class Die extends L2GameServerPacket { private final int _charObjId; private final boolean _fake; private boolean _sweepable; + private boolean _canTeleport; private L2AccessLevel _access = AccessLevels._userAccessLevel; @@ -47,6 +50,7 @@ Player player = (Player) cha; _access = player.getAccessLevel(); _clan = player.getClan(); + _canTeleport = !(player.isInsideZone(ZoneId.MULTI_FUNCTION) && L2MultiFunctionZone.revive); @@ -86,7 +90,7 @@ } else { - writeD(0x01); // to nearest village + writeD(_canTeleport ? 0x01 : 0); // to nearest village @@ -96,7 +100,7 @@ - if (_clan != null) + if (_canTeleport && _clan != null) { ++++java/net/sf/l2j/gameserver/model/actor/instance/Player.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -4384,6 +4385,8 @@ // Add PvP point to attacker. setPvpKills(getPvpKills() + 1); + L2MultiFunctionZone.givereward(this); + // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter sendPacket(new UserInfo(this)); } ++++java/net/sf/l2j/gameserver/model/itemcontainer/ItemContainer.java { protected static final Logger _log = Logger.getLogger(ItemContainer.class.getName()); - protected final List<ItemInstance> _items; + public final List<ItemInstance> _items; protected ItemContainer() { +++java/net/sf/l2j/gameserver/model/zone/type/L2MultiFunctionZone.java CREATE NEW THIS FILE DOES NOT EXIST! package net.sf.l2j.gameserver.model.zone.type; import java.io.File; import java.io.FileInputStream; import java.util.ArrayList; import java.util.List; import java.util.Properties; import net.sf.l2j.commons.concurrent.ThreadPool; import net.sf.l2j.commons.random.Rnd; import net.sf.l2j.gameserver.datatables.SkillTable; import net.sf.l2j.gameserver.model.L2Skill; import net.sf.l2j.gameserver.model.actor.Creature; import net.sf.l2j.gameserver.model.actor.Summon; import net.sf.l2j.gameserver.model.actor.instance.Player; import net.sf.l2j.gameserver.model.item.instance.ItemInstance; import net.sf.l2j.gameserver.model.itemcontainer.PcInventory; import net.sf.l2j.gameserver.model.zone.L2ZoneType; import net.sf.l2j.gameserver.model.zone.ZoneId; public class L2MultiFunctionZone extends L2ZoneType { public L2MultiFunctionZone(int id) { super(id); loadConfigs(); } public static boolean pvp_enabled, restart_zone, store_zone, logout_zone, revive_noblesse, revive_heal, revive, remove_buffs, remove_pets, give_noblesse; static int radius, enchant, revive_delay; static int[][] spawn_loc; L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1); private static List<String> items = new ArrayList<>(), classes = new ArrayList<>(), grades = new ArrayList<>(); public static List<int[]> rewards = new ArrayList<>(); static String[] gradeNames = { "", "D", "C", "B", "A", "S" }; @Override protected void onEnter(Creature character) { character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true); character.setInsideZone(ZoneId.MULTI_FUNCTION, true); if (character instanceof Player) { Player activeChar = ((Player) character); if (classes != null && classes.contains("" + activeChar.getClassId().getId())) { activeChar.teleToLocation(83597, 147888, -3405, 0); activeChar.sendMessage("Your class is not allowed in the MultiFunction zone."); return; } for (ItemInstance o : activeChar.getInventory()._items) { if (o.isEquipable() && o.isEquipped() && !checkItem(o)) { int slot = activeChar.getInventory().getSlotFromItem(o); activeChar.getInventory().unEquipItemInBodySlotAndRecord(slot); activeChar.sendMessage(o.getItemName() + " unequiped because is not allowed inside this zone."); } } if (give_noblesse) noblesse.getEffects(activeChar, activeChar); if (pvp_enabled) activeChar.updatePvPFlag(1); activeChar.sendMessage("You entered in a MultiFunction zone."); clear(activeChar); } } @Override protected void onExit(Creature character) { character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false); character.setInsideZone(ZoneId.MULTI_FUNCTION, false); if (character instanceof Player) { Player activeChar = ((Player) character); activeChar.sendMessage("You left from a MultiFunction zone."); if (pvp_enabled) activeChar.updatePvPFlag(0); } } @Override public void onDieInside(final Creature character) { if (character instanceof Player) { final Player activeChar = ((Player) character); if (revive) { ThreadPool.schedule(new Runnable() { @Override public void run() { activeChar.doRevive(); heal(activeChar); int[] loc = spawn_loc[Rnd.get(spawn_loc.length)]; activeChar.teleToLocation(loc[0] + Rnd.get(-radius, radius), loc[1] + Rnd.get(-radius, radius), loc[2], 0); } }, revive_delay * 1000); } } } @Override public void onReviveInside(Creature character) { if (character instanceof Player) { Player activeChar = ((Player) character); if (revive_noblesse) noblesse.getEffects(activeChar, activeChar); if (revive_heal) heal(activeChar); } } static void heal(Player activeChar) { activeChar.setCurrentHp(activeChar.getMaxHp()); activeChar.setCurrentCp(activeChar.getMaxCp()); activeChar.setCurrentMp(activeChar.getMaxMp()); } private static void clear(Player player) { if (remove_buffs) { player.stopAllEffects(); if (remove_pets) { Summon pet = player.getPet(); if (pet != null) { pet.stopAllEffects(); pet.unSummon(player); } } } else { if (remove_pets) { Summon pet = player.getPet(); if (pet != null) pet.unSummon(player); } } } public static void givereward(Player player) { if (player.isInsideZone(ZoneId.MULTI_FUNCTION)) { for (int[] reward : rewards) { PcInventory inv = player.getInventory(); inv.addItem("Custom Reward", reward[0], reward[1], player, player); } } } public static boolean checkItem(ItemInstance item) { int o = item.getItem().getCrystalType().ordinal(); int e = item.getEnchantLevel(); if (enchant != 0 && e >= enchant) return false; if (grades.contains(gradeNames[o])) return false; if (items != null && items.contains("" + item.getItemId())) return false; return true; } private static void loadConfigs() { try { Properties prop = new Properties(); prop.load(new FileInputStream(new File("./config/MultiFunctionZone.properties"))); pvp_enabled = Boolean.parseBoolean(prop.getProperty("EnablePvP", "False")); spawn_loc = parseItemsList(prop.getProperty("SpawnLoc", "150111,144740,-12248")); revive_delay = Integer.parseInt(prop.getProperty("ReviveDelay", "10")); if (revive_delay != 0) revive = true; give_noblesse = Boolean.parseBoolean(prop.getProperty("GiveNoblesse", "False")); String[] propertySplit = prop.getProperty("Items", "").split(","); if (propertySplit.length != 0) for (String i : propertySplit) items.add(i); propertySplit = prop.getProperty("Grades", "").split(","); if (propertySplit.length != 0) for (String i : propertySplit) if (i.equals("D") || i.equals("C") || i.equals("B") || i.equals("A") || i.equals("S")) grades.add(i); propertySplit = prop.getProperty("Classes", "").split(","); if (propertySplit.length != 0) for (String i : propertySplit) classes.add(i); radius = Integer.parseInt(prop.getProperty("RespawnRadius", "500")); enchant = Integer.parseInt(prop.getProperty("Enchant", "0")); remove_buffs = Boolean.parseBoolean(prop.getProperty("RemoveBuffs", "False")); remove_pets = Boolean.parseBoolean(prop.getProperty("RemovePets", "False")); restart_zone = Boolean.parseBoolean(prop.getProperty("NoRestartZone", "False")); store_zone = Boolean.parseBoolean(prop.getProperty("NoStoreZone", "False")); logout_zone = Boolean.parseBoolean(prop.getProperty("NoLogoutZone", "False")); revive_noblesse = Boolean.parseBoolean(prop.getProperty("ReviveNoblesse", "False")); revive_heal = Boolean.parseBoolean(prop.getProperty("ReviveHeal", "False")); propertySplit = prop.getProperty("Rewards", "57,100000").split(";"); for (String reward : propertySplit) { String[] rewardSplit = reward.split(","); if (rewardSplit.length == 2) { try { rewards.add(new int[] { Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1]) }); } catch (NumberFormatException nfe) { } } } } catch (Exception e) { e.printStackTrace(); } } private static int[][] parseItemsList(String line) { final String[] propertySplit = line.split(";"); if (propertySplit.length == 0) return null; int i = 0; String[] valueSplit; final int[][] result = new int[propertySplit.length][]; for (String value : propertySplit) { valueSplit = value.split(","); if (valueSplit.length != 3) return null; result[i] = new int[3]; try { result[i][0] = Integer.parseInt(valueSplit[0]); } catch (NumberFormatException e) { return null; } try { result[i][1] = Integer.parseInt(valueSplit[1]); } catch (NumberFormatException e) { return null; } try { result[i][2] = Integer.parseInt(valueSplit[2]); } catch (NumberFormatException e) { return null; } i++; } return result; } } ++++java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java +import net.sf.l2j.gameserver.model.zone.ZoneId; +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -96,6 +98,12 @@ if (item == null) return; + if (getClient().getActiveChar().isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.checkItem(item)) + { + getClient().getActiveChar().sendMessage("You cannot use " +item.getName()+ " inside this zone."); + return; + } + +++java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java +import net.sf.l2j.gameserver.model.zone.type.L2MultiFunctionZone; @@ -54,6 +55,13 @@ return; } + if (player.isInsideZone(ZoneId.MULTI_FUNCTION) && !L2MultiFunctionZone.restart_zone) + { + player.sendMessage("You cannot restart while inside a Multifunction zone."); + sendPacket(RestartResponse.valueOf(false)); + return; + } + if (player.isInsideZone(ZoneId.NO_RESTART)) { player.sendPacket(SystemMessageId.NO_RESTART_HERE); +++config/MultiFunctionZone.properties # --------------------------------------------------------------------------- # MultiFunctionZone # --------------------------------------------------------------------------- # This option will turn on PvP flag to all people when entering to the zone EnablePvP = True # If set to false, zone will be no-restart zone NoRestartZone = False # If set to false, zone will be no-logout zone NoLogoutZone = False # If set to false, zone will be no-store zone NoStoreZone = False # Give noblesse after revive? ReviveNoblesse = False # Heal after revive? ReviveHeal = False # Delay, in seconds, to wait before revive # 0 to disable ReviveDelay = 10 # Set the spawn points where players will be teleported on revive, if enabled # example:150111,144740,-12248;143665,144418,-12022;144443,147685,-12139 SpawnLoc = 150111,144740,-12248;143665,144418,-12022;144443,147685,-12139 # Random respawn radius RespawnRadius = 500 # If set to true, players will take noblesse blessing when entering GiveNoblesse = True # Remove buffs when entering to the zone RemoveBuffs = False # Remove pets when entering to the zone RemovePets = False # Special rewards when hunting inside this zone # example: 57,100000;14720,1 Rewards = 57,100000;14720,1 # List of Items(id's) that won't be usable inside this area and also will be unequiped when entering # (armor, weapons, scrolls, potions, etc), example: 728,7575, 6383, 1538 Items = 728,7575,6383,1538 # List of Grades that won't be usable inside this area and also will be unequiped when entering # example: D,C,B,A,S Grades = C,B,A # Items with this enchant or more won't be usable inside this area and also will be unequiped when entering # 0 to disable Enchant = 0 # Players with one of that classes won't be able to enter to the zone # example: 93,85,12 Classes = 92 \ No newline at end of file +++ data/xml/zones/MultiFunctionZone.xml <?xml version="1.0" encoding="UTF-8"?> <list> <zone type="MultiFunctionZone" shape="Cuboid" minZ="-3752" maxZ="-352"><!-- gludin_pvp --> <node X="-88411" Y="141732" /> <node X="-87429" Y="142708" /> <spawn X="-86979" Y="142402" Z="-3643" /> </zone> </list> CREDITS: ^Wyatt
  10. Hello..read the code and you will understand what is it go to net.sf.l2j.gameserver.model.actor.instance.Player.java find this find final boolean hadHero and put this private int spreeKill = 0; private int spreeKills = 0; private int KILL_STEAK = 0; it will look like that find final boolean hadHero private int spreeKill = 0; private int spreeKills = 0; private int KILL_STEAK = 0; now find this setPvpKills(getPvpKills() + 1); and put this KILL_STEAK++; switch (KILL_STEAK) { case 20: sendMessage("You are almost on a killing spree 5 more kills"); break; case 25: Broadcast.announceToOnlinePlayers(getName() + " is on a killing spree!!"); startAbnormalEffect(AbnormalEffect.SLEEP); //SLEEP = VITALITY EFFECT setHero(true); PlaySound _snd25 = new PlaySound(1, "killing spree"); sendPacket(_snd25); break; } spreeKill++; switch (spreeKill) { case 1: sendPacket(new CreatureSay(0, 0, "PvP", getName() + " just got a First Blood!!")); break; case 2: sendPacket(new CreatureSay(0, 2, "PvP", getName() + " just got a Double Kill!!")); break; case 3: sendPacket(new CreatureSay(0, 3, "PvP", getName() + " just got a Triple Kill!!")); break; case 4: sendPacket(new CreatureSay(0, 4, "PvP", getName() + " has a Quadra kill!!!")); break; case 5: sendPacket(new CreatureSay(0, 0, "PvP", getName() + " has a Penta Kill!!")); break; case 6: sendPacket(new CreatureSay(0, 2, "PvP", getName() + " just got a Legendary!!")); break; } spreeKills++; switch (spreeKills) { case 1: PlaySound _snd1 = new PlaySound(1, "firstblood"); sendPacket(_snd1); break; case 2: PlaySound _snd2 = new PlaySound(1, "doublekill"); sendPacket(_snd2); break; case 3: PlaySound _snd3 = new PlaySound(1, "triplekill"); sendPacket(_snd3); break; case 4: PlaySound _snd4 = new PlaySound(1, "quadrakill"); sendPacket(_snd4); break; case 5: PlaySound _snd5 = new PlaySound(1, "pentakill"); sendPacket(_snd5); break; case 6: PlaySound _snd6 = new PlaySound(1, "legendary"); sendPacket(_snd6); break; default: } find this public boolean doDie(Creature killer) and put this if (KILL_STEAK > 0) { if (KILL_STEAK > 24) Broadcast.announceToOnlinePlayers(killer.getName() + " has stopped " + getName() + "'s killing spree of " + KILL_STEAK + " kills!!"); if (!hadHero) setHero(false); stopAbnormalEffect(AbnormalEffect.SLEEP); spreeKill = 0; spreeKills = 0; KILL_STEAK = 0; } Download this file Vitality Effect Interlude Download this file League of Legends Sounds (PUT THEM IN THE Music folder in you Lineage II) And you are done.
  11. Hello here is a pvp auto enchant code for acis when you kill some you have a chance to get a random item from yours by +1 http://prntscr.com/i451wk go to net/sf/l2j/gameserver/model/actor/instance/player.java find this protected int _classIndex; and put this /** Pvp enchant System **/ private int rewardConsecutiveKillCount = 0; like that protected int _classIndex; /** Pvp enchant System **/ private int rewardConsecutiveKillCount = 0; next find this // Add PvP point to attacker. setPvpKills(getPvpKills() + 1); and paste this rewardConsecutiveKillCount++; like that // Add PvP point to attacker. setPvpKills(getPvpKills() + 1); rewardConsecutiveKillCount++; and under this rewardConsecutiveKillCount++; paste all this final ItemInstance pvpwep = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); final ItemInstance pvphead = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD); final ItemInstance pvpgloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES); final ItemInstance pvpchest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); final ItemInstance pvplegs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS); final ItemInstance pvpfeet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET); final ItemInstance pvpneck = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK); final ItemInstance pvplf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER); final ItemInstance pvprf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER); if (rewardConsecutiveKillCount >= Config.PVP_COUNT_TILL_ENCHANTMENT && Config.ENABLE_PVP_ENCHANTMENT) { switch (Rnd.get(9)) { case 0: { pvpwep.setEnchantLevel(pvpwep.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 1: { pvphead.setEnchantLevel(pvphead.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 2: { pvpgloves.setEnchantLevel(pvpgloves.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 3: { pvpchest.setEnchantLevel(pvpchest.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 4: { pvplegs.setEnchantLevel(pvplegs.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 5: { pvpfeet.setEnchantLevel(pvpfeet.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 6: { pvpneck.setEnchantLevel(pvpneck.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 7: { pvplf.setEnchantLevel(pvplf.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } case 8: { pvprf.setEnchantLevel(pvprf.getEnchantLevel() + 1); sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) + "has been enchanted by +1 due to your pvp kills"); rewardConsecutiveKillCount = 0; break; } } } go to net/sf/l2j find this public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS; and paste this like that public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS; /** PvP auto enchant system */ public static boolean ENABLE_PVP_ENCHANTMENT; public static int PVP_COUNT_TILL_ENCHANTMENT; find this ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false); and put this like that ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false); ENABLE_PVP_ENCHANTMENT = players.getProperty("EnablePvpEnchantSystem", false); PVP_COUNT_TILL_ENCHANTMENT = players.getProperty("PvpCountTillEnchanment", 20); go to config/players.properties #=================================# #== by thelwhelprepaidia ==# #== Pvp Enchant System ==# #=================================# #By enabling this then every X pvp #in a row the player will get randomly #a part of his armor,weapon or jewel that #is currently equiped automatically enchanted #To enable the system set True below EnablePvpEnchantSystem = True #Every how many kills you want the chars to be #awared with +1? PvpCountTillEnchanment = 20 And you are done. credits Elfocrash
  12. ### Eclipse Workspace Patch 1.0 #P aCis_Gameserver Index: java/net/sf/l2j/gameserver/model/multisell/Ingredient.java =================================================================== --- java/net/sf/l2j/gameserver/model/multisell/Ingredient.java (revision 15) +++ java/net/sf/l2j/gameserver/model/multisell/Ingredient.java (working copy) @@ -22,14 +22,14 @@ public Ingredient(StatsSet set) { + this(set.getInteger("id"), set.getInteger("count"), set.getInteger("enchantmentLevel", 0), set.getBool("isTaxIngredient", false), set.getBool("maintainIngredient", false)); - this(set.getInteger("id"), set.getInteger("count"), set.getBool("isTaxIngredient", false), set.getBool("maintainIngredient", false)); } + public Ingredient(int itemId, int itemCount, int enchantmentLevel, boolean isTaxIngredient, boolean maintainIngredient) - public Ingredient(int itemId, int itemCount, boolean isTaxIngredient, boolean maintainIngredient) { _itemId = itemId; _itemCount = itemCount; + _enchantmentLevel = enchantmentLevel; - _isTaxIngredient = isTaxIngredient; _maintainIngredient = maintainIngredient; @@ -42,7 +42,7 @@ */ public Ingredient getCopy() { + return new Ingredient(_itemId, _itemCount, _enchantmentLevel, _isTaxIngredient, _maintainIngredient); - return new Ingredient(_itemId, _itemCount, _isTaxIngredient, _maintainIngredient); } public final int getItemId() Index: java/net/sf/l2j/gameserver/model/multisell/PreparedEntry.java =================================================================== --- java/net/sf/l2j/gameserver/model/multisell/PreparedEntry.java (revision 15) +++ java/net/sf/l2j/gameserver/model/multisell/PreparedEntry.java (working copy) @@ -48,7 +48,7 @@ // now add the adena, if any. adenaAmount += _taxAmount; // do not forget tax if (adenaAmount > 0) + _ingredients.add(new Ingredient(57, adenaAmount, 0, false, false)); - _ingredients.add(new Ingredient(57, adenaAmount, false, false)); // now copy products _products = new ArrayList<>(template.getProducts().size());
  13. I once worked on my project and stopped it. Yesterday i was browsing through the backup of my old project and found this buffer. I think it could be useful for someone. Thanks to @Trance for coding. I modified abit and adapted to l2jfrozen. Unfortunately i can't find the HTML anymore, so you have to create your own. Here you go. What it does? Watch here. Create a file in gameserver/model/actor/instance called L2NpcBufferInstance.java Code: https://pastebin.com/Wca90uMC
  14. Hello members, I made an event because Christmas is coming I made it with xml version ( i like it more..) Here's the video: Source Files Npc's Credits for the awesome htmls : @Sinister Smile What is this event? When a mob dies there is a chance to spawn santa boy/girl and get some rewards. I do not think you need more explainations... Check the xml and set it as you wish! (Rewards are unlimited but one of them will be chosen) Edit: Coded in acis 372 Updates: ConcurrentHashMap replace by ArrayList ty @Tryskell Override onSpawn method removed in SantaClaus instance ty @Tryskell Xml reworked (removed id) Fixed html path Fixed 1 bug while storing rewards. Added npc's link
  15. ExGuard team this is one patch for you see how work hwid , open url , Exception ip system ( for internet cafe ) i have change only protocol version so is very easy to bypass it ( is only for test servers ) Interlude Client java code and dll virustotal if don't work with your system can you download this
  16. ============================================================= dist\game\data\scripts\ai\npc\LuckyPig\LuckyPig.java /* * Copyright (C) 2004-2014 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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 3 of the License, or * (at your option) any later version. * * L2J DataPack 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, see <http://www.gnu.org/licenses/>. */ package ai.npc.LuckyPig; import java.util.ArrayList; import java.util.List; import ai.npc.AbstractNpcAI; import com.l2jserver.Config; import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.holders.SkillHolder; import com.l2jserver.gameserver.model.itemcontainer.Inventory; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.clientpackets.Say2; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.util.Util; import com.l2jserver.util.Rnd; /** * Lucky Pig AI. * @author St3eT */ public final class LuckyPig extends AbstractNpcAI { // NPC private static final int LUCKY_PIG_WINGLESS = 2502; private static final int LUCKY_PIG_WINGLESS_GOLD = 2503; private static final int LUCKY_PIG_LOW = 18664; private static final int LUCKY_PIG_MEDIUM = 18665; private static final int LUCKY_PIG_TOP = 18666; //@formatter:off private static final int[] TRIGGER_MOBS_LOW = { // Enchanted Valley 20589, 20590, 20591, 20592, 20593, 20594, 20595, 20596, 20597, 20598, 20599, }; private static final int[] TRIGGER_MOBS_MEDIUM = { // Forest of the Dead, Valley of Saints 21520, 21521, 21522, 21523, 21524, 21525, 21526, 21527, 21528, 21529, 21530, 21531, 21532, 21533, 21534, 21535, 21536, 21537, 21538, 21539, 21540, 21541, 21542, 21543, 21544, 21545, 21546, 21547, 21548, 21549, 21550, 21551, 21552, 21553, 21554, 21555, 21556, 21557, 21558, 21559, 21560, 21561, 21562, 21563, 21564, 21565, 21566, 21567, 21568, 21569, 21570, 21571, 21572, 21573, 21574, 21575, 21576, 21577, 21578, 21579, 21580, 21581, 21582, 21583, 21584, 21585, 21586, 21587, 21588, 21589, 21590, 21591, 21592, 21593, 21594, 21595, 21596, 21597, 21598, 21599, 21600, 21601, }; private static final int[] TRIGGER_MOBS_TOP = { // Beast Farm, Plains of the Lizardmen, Sel Mahum Training Grounds, Field of Silence, Field of Whispers, Crypts of Disgrace, Den of Evil, Primeval Isle, Dragon Valley 18873, 18874, 18875, 18876, 18877, 18878, 18879, 18880, 18881, 18882, 18883, 18884, 18885, 18886, 18887, 18888, 18889, 18890, 18891, 18892, 18893, 18894, 18895, 18896, 18897, 18898, 18899, 18900, 18901, 18902, 18903, 18904, 18905, 18906, 18907, 22196, 22197, 22198, 22199, 22200, 22201, 22202, 22203, 22204, 22205, 22206, 22207, 22208, 22209, 22210, 22211, 22212, 22213, 22214, 22215, 22216, 22217, 22218, 22219, 22220, 22221, 22222, 22223, 22224, 22225, 22226, 22227, 22650, 22651, 22652, 22653, 22654, 22655, 22656, 22657, 22658, 22659, 22691, 22692, 22693, 22694, 22695, 22696, 22697, 22698, 22699, 22700, 22701, 22702, 22703, 22704, 22705, 22706, 22707, 22742, 22743, 22744, 22745, 22768, 22769, 22770, 22771, 22772, 22773, 22774, 22775, 22776, 22777, 22778, 22779, 22780, 22781, 22782, 22783, 22784, 22785, 22786, 22787, 22788, 22815, 22818, 22819, 22820, 22821, 22858, }; // Items private static final int[][] DROPLIST = { {LUCKY_PIG_LOW, 8755, 1, 100}, {LUCKY_PIG_LOW, 8755, 2, 25}, {LUCKY_PIG_MEDIUM, 5577, 1, 33}, {LUCKY_PIG_MEDIUM, 5578, 1, 33}, {LUCKY_PIG_MEDIUM, 5579, 1, 100}, {LUCKY_PIG_TOP, 9552, 1, 20}, {LUCKY_PIG_TOP, 9553, 1, 20}, {LUCKY_PIG_TOP, 9554, 1, 20}, {LUCKY_PIG_TOP, 9555, 1, 20}, {LUCKY_PIG_TOP, 9556, 1, 20}, {LUCKY_PIG_TOP, 9557, 1, 100}, {LUCKY_PIG_TOP, 9552, 2, 20}, {LUCKY_PIG_TOP, 9553, 2, 20}, {LUCKY_PIG_TOP, 9554, 2, 20}, {LUCKY_PIG_TOP, 9555, 2, 20}, {LUCKY_PIG_TOP, 9556, 2, 20}, {LUCKY_PIG_TOP, 9557, 2, 100}, }; private static final int[][] DROPLIST_GOLD = { {LUCKY_PIG_LOW, 14678, 1, 100}, {LUCKY_PIG_MEDIUM, 14679, 1, 100}, {LUCKY_PIG_TOP, 14680, 1, 100}, }; //@formatter:on // Skills public static final SkillHolder ENLARGE = new SkillHolder(23325, 1); // NpcStrings private static final NpcStringId[] SPAM_TEXTS = { NpcStringId.LUCKY_IF_I_EAT_TOO_MUCH_ADENA_MY_WINGS_DISAPPEAR, NpcStringId.LUCKY_IM_LUCKY_THE_SPIRIT_THAT_LOVES_ADENA, NpcStringId.LUCKY_I_WANT_TO_EAT_ADENA_GIVE_IT_TO_ME, }; private static final NpcStringId[] EATING_TEXTS = { NpcStringId.GRRRR_YUCK, NpcStringId.LUCKY_IT_WASNT_ENOUGH_ADENA_ITS_GOTTA_BE_AT_LEAST_S, NpcStringId.YUMMY_THANKS_LUCKY, NpcStringId.LUCKY_THE_ADENA_IS_SO_YUMMY_IM_GETTING_BIGGER, NpcStringId.LUCKY_NO_MORE_ADENA_OH_IM_SO_HEAVY, }; private static final NpcStringId[] TRANSFORM_TEXTS = { NpcStringId.OH_MY_WINGS_DISAPPEARED_ARE_YOU_GONNA_HIT_ME_IF_YOU_HIT_ME_ILL_THROW_UP_EVERYTHING_THAT_I_ATE, NpcStringId.OH_MY_WINGS_ACK_ARE_YOU_GONNA_HIT_ME_SCARY_SCARY_IF_YOU_HIT_ME_SOMETHING_BAD_WILL_HAPPEN }; // Misc //FIX DOUBLE private static final int LUCKY_PIG_CHANCE = Config.L2JMOD_LUCKY_PID_CHANCE; //@formatter:off private static final int[] LUCKY_PIG_GOLD_BASE_CHANCE = { 0, 0, 0, 0, 3, 6, 9, 12, 15, 18, 20 }; //@formatter:on @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { switch (event) { case "DESPAWN_TIME": { if (npc != null) { cancelQuestTimer("TEXT_SPAM", npc, null); cancelQuestTimer("CHECK_FOOD", npc, null); npc.deleteMe(); } break; } case "TEXT_SPAM": { final long lastEat = npc.getVariables().getLong("LUCKY_PIG_LAST_EAT", 0); if (System.currentTimeMillis() > (lastEat + 30000)) { broadcastNpcSay(npc, Say2.ALL, SPAM_TEXTS[getRandom(SPAM_TEXTS.length)]); startQuestTimer(event, (getRandom(20, 40) * 1000), npc, null); } else { startQuestTimer(event, (getRandom(10, 20) * 1000), npc, null); } break; } case "CHECK_FOOD": { final int foodState = npc.getVariables().getInt("LUCKY_PIG_FEED_STATE", 0); final L2ItemInstance foodItem = npc.getVariables().getObject("LUCKY_PIG_FOOD_ITEM", L2ItemInstance.class); switch (foodState) { case 0: // Looking for item { if (foodItem != null) { _log.warning(LuckyPig.class.getSimpleName() + ": Lucky pig trying to find another food while currently isn't eaten yet!"); break; } //@formatter:off final L2ItemInstance food = (L2ItemInstance) L2World.getInstance().getVisibleObjects(npc, 300) .stream() .filter(L2Object::isItem).filter(obj -> (obj.getId() == Inventory.ADENA_ID)) .sorted((object1, object2) -> (int) Util.calculateDistance(object1, object2, false, false)) .findFirst() .orElse(null); //@formatter:on if (food != null) { npc.getVariables().set("LUCKY_PIG_FEED_STATE", 1); npc.getVariables().set("LUCKY_PIG_FOOD_ITEM", food); } break; } case 1: // Move to item loc { if (foodItem != null) { npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, foodItem.getLocation()); npc.getVariables().set("LUCKY_PIG_FEED_STATE", 2); } else { // Maybe someone else pickup it? :P npc.getVariables().set("LUCKY_PIG_FEED_STATE", 0); } break; } case 2: { if (foodItem != null) { final int eatCount = npc.getVariables().getInt("LUCKY_PIG_EAT_COUNT", 0) + 1; final int targetAdena = npc.getVariables().getInt("LUCKY_PIG_TARGET_ADENA", 0); final long countAdena = npc.getVariables().getInt("LUCKY_PIG_EAT_ADENA", 0) + foodItem.getCount(); foodItem.decayMe(); npc.getVariables().set("LUCKY_PIG_LAST_EAT", System.currentTimeMillis()); npc.getVariables().set("LUCKY_PIG_EAT_ADENA", countAdena); npc.getVariables().set("LUCKY_PIG_FEED_COUNT", 0); npc.getVariables().set("LUCKY_PIG_EAT_COUNT", eatCount); npc.getVariables().set("LUCKY_PIG_FEED_STATE", 0); npc.getVariables().remove("LUCKY_PIG_FOOD_ITEM"); if (countAdena >= targetAdena) { broadcastNpcSay(npc, Say2.ALL, (getRandomBoolean() ? NpcStringId.LUCKY_IM_FULL_THANKS_FOR_THE_YUMMY_ADENA_OH_IM_SO_HEAVY : EATING_TEXTS[getRandom(EATING_TEXTS.length)])); } else { broadcastNpcSay(npc, Say2.ALL, EATING_TEXTS[getRandom(EATING_TEXTS.length)], Util.formatAdena(targetAdena)); } npc.broadcastPacket(new MagicSkillUse(npc, npc, ENLARGE.getSkillId(), 1, 1000, 1000)); if (eatCount >= 10) { npc.getVariables().set("LUCKY_PIG_FEED_STATE", 3); } } else { npc.getVariables().set("LUCKY_PIG_FEED_STATE", 0); } break; } case 3: { transformLuckyPig(npc); break; } } break; } } return super.onAdvEvent(event, npc, player); } private void transformLuckyPig(L2Npc luckyPig) { cancelQuestTimer("CHECK_FOOD", luckyPig, null); cancelQuestTimer("TEXT_SPAM", luckyPig, null); final L2Npc pig = addSpawn(calculateGoldChance(luckyPig) ? LUCKY_PIG_WINGLESS_GOLD : LUCKY_PIG_WINGLESS, luckyPig, true, 600000, true); broadcastNpcSay(pig, Say2.ALL, TRANSFORM_TEXTS[getRandom(TRANSFORM_TEXTS.length)]); pig.getVariables().set("LUCKY_PIG_SPAWN_ID", luckyPig.getId()); luckyPig.deleteMe(); } @Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { if (npc.getId() == LUCKY_PIG_WINGLESS) { manageDrop(npc, killer, false); } else if (npc.getId() == LUCKY_PIG_WINGLESS_GOLD) { manageDrop(npc, killer, true); } else { final boolean LuckyPidChance = Rnd.get(100) > (100 - LUCKY_PIG_CHANCE); if (Config.L2JMOD_LUCKY_PID_SPAWN_ENABLED && LuckyPidChance/* || killer.isGM()*/) { final int minAdena; final int luckyPigId; if (Util.contains(TRIGGER_MOBS_LOW, npc.getId())) { minAdena = Config.L2JMOD_LUCKY_PID_LOW_ADENA; luckyPigId = LUCKY_PIG_LOW; } else if (Util.contains(TRIGGER_MOBS_MEDIUM, npc.getId())) { minAdena = Config.L2JMOD_LUCKY_PID_MEDIUM_ADENA; luckyPigId = LUCKY_PIG_MEDIUM; } else { minAdena = Config.L2JMOD_LUCKY_PID_TOP_ADENA; luckyPigId = LUCKY_PIG_TOP; } final int targetAdena = (int) (getRandom(minAdena, (minAdena * 10)) * Config.RATE_DROP_AMOUNT_MULTIPLIER.get(Inventory.ADENA_ID)); final L2Npc luckyPig = addSpawn(luckyPigId, npc, true, 0, true); startQuestTimer("DESPAWN_TIME", 600000, luckyPig, null); startQuestTimer("TEXT_SPAM", 5000, luckyPig, null); startQuestTimer("CHECK_FOOD", 2000, luckyPig, null, true); luckyPig.getVariables().set("LUCKY_PIG_TARGET_ADENA", targetAdena); } } return super.onKill(npc, killer, isSummon); } private void manageDrop(L2Npc luckyPig, L2PcInstance player, boolean isGold) { final int npcId = luckyPig.getVariables().getInt("LUCKY_PIG_SPAWN_ID", 0); if (npcId > 0) { final List<Integer> catData = new ArrayList<>(); for (int[] data : (isGold ? DROPLIST_GOLD : DROPLIST)) { if ((data[0] == npcId) && (getRandom(100) < data[3]) && !catData.contains(data[2])) { luckyPig.dropItem(player, data[1], data[2]); catData.add(data[2]); } } } } private boolean calculateGoldChance(L2Npc luckyPig) { final int eatCount = luckyPig.getVariables().getInt("LUCKY_PIG_EAT_COUNT", 0); final int targetAdena = luckyPig.getVariables().getInt("LUCKY_PIG_TARGET_ADENA", 0); final long countAdena = luckyPig.getVariables().getInt("LUCKY_PIG_EAT_ADENA", -1); //FIX double finalChance = LUCKY_PIG_GOLD_BASE_CHANCE[eatCount]; if (countAdena >= targetAdena) { finalChance *= 1.46; } return getRandom(100) < finalChance; } private LuckyPig() { super(LuckyPig.class.getSimpleName(), "ai/npc"); addStartNpc(LUCKY_PIG_LOW, LUCKY_PIG_MEDIUM, LUCKY_PIG_TOP); addTalkId(LUCKY_PIG_LOW, LUCKY_PIG_MEDIUM, LUCKY_PIG_TOP); addKillId(LUCKY_PIG_WINGLESS, LUCKY_PIG_WINGLESS_GOLD); addKillId(TRIGGER_MOBS_LOW); addKillId(TRIGGER_MOBS_MEDIUM); addKillId(TRIGGER_MOBS_TOP); } public static void main(String[] args) { new LuckyPig(); } } ==================================================================================================================== ==================================================================================================================== server\src\main\java\com\l2jserver\Config.java public static boolean L2JMOD_LUCKY_PID_SPAWN_ENABLED; public static int L2JMOD_LUCKY_PID_LOW_ADENA; public static int L2JMOD_LUCKY_PID_MEDIUM_ADENA; public static int L2JMOD_LUCKY_PID_TOP_ADENA; public static int L2JMOD_LUCKY_PID_CHANCE; L2JMOD_LUCKY_PID_SPAWN_ENABLED = L2JModSettings.getBoolean("EventLuckyPigEnabled", false); L2JMOD_LUCKY_PID_LOW_ADENA = L2JModSettings.getInt("LuckyPigLowAdena", 500); L2JMOD_LUCKY_PID_MEDIUM_ADENA = L2JModSettings.getInt("LuckyPigMediumAdena", 1000); L2JMOD_LUCKY_PID_TOP_ADENA = L2JModSettings.getInt("LuckyPigTopAdena", 2000); L2JMOD_LUCKY_PID_CHANCE = L2JModSettings.getInt("LuckyPigChance", 3); ==================================================================================================================== ==================================================================================================================== datapack\dist\game\data\stats\npcs\02500-02599.xml <?xml version="1.0" encoding="UTF-8"?> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/npcs.xsd"> <npc id="2501" level="80" type="L2Npc" name="Lucky Pig" title="The Spirit of Fortune"> <sex>MALE</sex> <stats str="10" int="10" dex="10" wit="10" con="10" men="10"> <vitals hp="2444" mp="2444.0" /> <attack physical="500" magical="500" attackSpeed="278" range="40" /> <defence physical="500" magical="500" /> <attribute> <defence fire="20" water="20" wind="20" earth="20" holy="20" dark="20" /> </attribute> <speed> <walk ground="60" /> <run ground="160" /> </speed> </stats> <skillList> <skill id="4416" level="3" /> <!--Beasts --> <skill id="23325" level="1" /> <!--Enlarge - Luckpy --> <skill id="23326" level="1" /> <!--Reduce - Luckpy --> </skillList> <collision> <radius normal="25" /> <height normal="35" /> </collision> </npc> <npc id="2502" level="80" type="L2Monster" name="Wingless Lucky Pig"> <sex>MALE</sex> <stats str="10" int="10" dex="10" wit="10" con="10" men="10"> <vitals hp="2444" mp="2444.0" /> <attack physical="500" magical="500" attackSpeed="278" range="40" /> <defence physical="500" magical="500" /> <attribute> <defence fire="20" water="20" wind="20" earth="20" holy="20" dark="20" /> </attribute> <speed> <walk ground="60" /> <run ground="160" /> </speed> </stats> <collision> <radius normal="25" /> <height normal="35" /> </collision> </npc> <npc id="2503" level="80" type="L2Monster" name="Wingless Lucky Pig"> <sex>MALE</sex> <stats str="10" int="10" dex="10" wit="10" con="10" men="10"> <vitals hp="2444" mp="2444.0" /> <attack physical="500" magical="500" attackSpeed="278" range="40" /> <defence physical="500" magical="500" /> <attribute> <defence fire="20" water="20" wind="20" earth="20" holy="20" dark="20" /> </attribute> <speed> <walk ground="60" /> <run ground="160" /> </speed> </stats> <collision> <radius normal="25" /> <height normal="35" /> </collision> </npc> </list> ================================================================================================== ================================================================================================== dist\game\data\scripts.cfg ai/npc/Kier/Kier.java + ai/npc/LuckyPig/LuckyPig.java ================================================================================================== ================================================================================================== dist\game\config\L2JMods.properties # Enable/disable spawning EventLuckyPigEnabled = True LuckyPigLowAdena = 500 LuckyPigMediumAdena = 1000 LuckyPigTopAdena = 2000 # Random Defaul: 1 = Spawn 1% LuckyPigChance = 1
  17. hello guys i share a good panel for low rate or pvp server is working in all project Update Link: https://pastebin.com/kpQ3rT7k Sql icons + code : here Update 28/11/2017 Some Photo Update link for any problem send me PM tnx!
  18. Hello. I made this instances system because I will be using it on a server and I decided to share it since it's very simple. You just call setInstanceId(id). 0 is the default instance id. Doors and fences are visible to all instances. I tested it and it seemed to work fine with drops/aoe skills etc. If you find any bugs report them and I will fix. http://pastebin.com/R00zF8DP
  19. Since i see many people request some npcs etc and noone gives the required info or help,i would like to make this guide for them so they can develop and improve their skills on creating these by themselves.It's a very usefull guide for people to learn how to make them. In this guide/tutorial we will learn how to do the Teleporter(gk),Gmshop,Buffer and you can start with opening the scripts.I wish my guide to be understandable to you and wish you the best results following it Teleporter/Gatekeeper: AI.obj, You must look for class teleporter_multi_list. class 1 clavier : teleporter_multi_list property_define_begin telposlist_begin Position1 {"Aden"; 146705; 25840; -2000; 1500; 5 } {"Coliseum"; 146440; 46723; -3400; 1500; 0 } {"Dark Elven Village"; 9716; 15502; -4500; 1500; 0 } {"Dion"; 15744; 142928; -2704; 1500; 2 } {"Dwarven Village"; 115120; -178112; -916; 1500; 0 } {"Elven Village"; 46890; 51531; -2976; 1500; 0 } {"Floran Village"; 17953; 170234; -3504; 1500; 2 } {"Giran"; 83458; 148012; -3400; 1500; 3 } {"Giran Harbor"; 47935; 186810; -3420; 1500; 0 } {"Gludin"; -80826; 149775; -3043; 1500; 0 } {"Gludio"; -12694; 122776; -3114; 1500; 1 } {"Goddard"; 148024; -55281; -2728; 1500; 7 } {"Hardins Academy"; 105846; 109762; -3170; 1500; 3 } {"Heine"; 111333; 219345; -3546; 1500; 6 } {"Hunter Village"; 117156; 76878; -2670; 1500; 0 } {"Ivory Tower"; 85343; 16267; -3640; 1500; 4 } {"Orc Village"; -45186; -112459; -236; 1500; 0 } {"Oren"; 82956; 53162; -1470; 1500; 4 } {"Rune Town"; 43835; -47749; -792; 1500; 0 } {"Talking Island"; -84141; 244623; -3729; 1500; 0 } telposlist_end telposlist_begin Position2 {"Elven Fortress (10-25)"; 29280; 74942; -3776; 1500; 0 } {"Elven Ruins (10-20)"; -112802; 234963; -3688; 1500; 0 } {"Ruins of Despair (20-25)"; -20152; 137254; -3896; 1500; 0 } {"Wastelands (25-35)"; -16510; 209226; -3664; 1500; 0 } {"Execution Grounds (30-40)"; 44691; 148454; -3696; 1500; 0 } {"Cruma Tower (40-52)"; 16580; 114178; -3480; 1500; 0 } {"Death Pass (35-52)"; 71521; 118056; -3672; 1500; 0 } {"Dragon Valley (55-62)"; 122589; 111117; -3760; 1500; 0 } {"Dragon Valley Caves (60-78)"; 130816; 114429; -3720; 1500; 0 } {"Enchanted Valley (45-55)"; 124798; 61741; -3992; 1500; 0 } {"Cemetery (45-58)"; 166612; 20315; -3328; 1500; 0 } {"Forbidden GateWay (58-67)"; 185326; 20299; -3272; 1500; 0 } {"The Front of Anghel Waterfall (50-60)"; 163341; 91374; -3320; 1500; 0 } {"Giants Cave (55-67)"; 174465; 52672; -4368; 1500; 0 } {"Forsaken Plains (55-65)"; 167285; 37109; -4008; 1500; 0 } {"Toi Enterance (58-78)"; 114645; 21491; -5128; 1500; 0 } {"Blazing Swamp (65-77)"; 159546; -13085; -2872; 1500; 0 } {"Rune Town Hunting Grounds (58-74)"; 59106; -67593; -3384; 1500; 0 } {"Hot Springs (70-78)"; 153889; -101027; -2936; 1500; 0 } {"Ketra Orc Outpost (76-87)"; 146600; -68003; -3688; 1500; 0 } {"Imperial Tomb (76-82+)"; 186896; -75557; -2832; 1500; 0 } {"Forge Of God (78-82+)"; 169453; -116244; -2360; 1500; 0 } {"Varka Silenos Outpost (76-87)"; 125809; -40781; -3744; 1500; 0 } {"Patriots Necropolis"; -25472; 77728; -3446; 15500; 0 } {"Ascetics Necropolis"; -56064; 78720; -3011; 18600; 0 } {"Saints Necropolis"; 79296; 209584; -3709; 9800; 0 } {"Catacomb of Dark Omens"; -22480; 13872; -3174; 20400; 0 } telposlist_end telposlist_begin PositionNoblessNeedItemTown {"Talking Island Village"; -84141; 244623; -3729; 1; 0 } {"The Elven Village"; 46951; 51550; -2976; 1; 0 } {"The Dark Elven Village"; 9709; 15566; -4500; 1; 0 } {"Orc Village"; -45158; -112583; -236; 1; 0 } {"Dwarven Village"; 115120; -178224; -917; 1; 0 } {"The Village of Gludin"; -80826; 149775; -3043; 1; 0 } {"The Town of Gludio"; -12694; 122776; -3114; 1; 0 } {"The Town of Dion"; 15671; 142994; -2704; 1; 0 } {"Heine"; 111455; 219400; -3546; 1; 0 } {"Town of Oren"; 83011; 53207; -1470; 1; 0 } {"Hunters Village"; 117088; 76931; -2670; 1; 0 } {"Town of Aden"; 146783; 25808; -2000; 1; 0 } {"Rune Castle Town"; 43826; -47688; -792; 1; 0 } {"Goddard Castle Town"; 147978; -55408; -2728; 1; 0 } {"Hardin's Academy"; 105918; 109759; -3170; 1; 0 } {"Giran Harbor"; 47935; 186810; -3420; 1; 0 } {"Arena (Gludin Harbor)"; -87328; 142266; -3640; 1; 0 } {"Arena (Giran Castle Town)"; 73579; 142709; -3768; 1; 0 } {"Coliseum"; 146440; 46723; -3400; 1; 0 } telposlist_end telposlist_begin PositionNoblessNeedItemField {"Dragon Valley"; 122824; 110836; -3727; 1; 0 } {"Dragon Valley Death Pass"; 73024; 118485; -3720; 1; 0 } {"Brekas Stronghold"; 85389; 131366; -3707; 1; 0 } {"Gorgons Flower Garden"; 113553; 134813; -3668; 1; 0 } {"Tanor Canyon"; 69373; 155208; -3746; 1; 0 } {"Devils Isle Entrance"; 43408; 206881; -3752; 1; 0 } {"Lairs of Antharas Entrance"; 131131; 114597; -3720; 1; 0 } {"Lairs of Antharas 1"; 147071; 120156; -4520; 1; 0 } {"Lairs of Antharas 2"; 151689; 112615; -5520; 1; 0 } {"Lairs of Antharas Bridge"; 146425; 109898; -3424; 1; 0 } {"Lairs of Antharas Heart"; 154396; 121235; -3808; 1; 0 } telposlist_end telposlist_begin PositionNoblessNeedItemSSQ {"Necropolis Of Sacrifice"; -41184; 206752; -3357; 1; 0 } {"Heretics Catacomb"; 39232; 143568; -3651; 1; 0 } {"Pilgrims Necropolis"; 45600; 126944; -3686; 1; 0 } {"Catacomb Of The Branded"; 43200; 170688; -3251; 1; 0 } {"Worshipers Necropolis"; 107514; 174329; -3704; 1; 0 } {"Catacomb Of The Apostate"; 74672; 78032; -3398; 1; 0 } {"Patriots Necropolis"; -25472; 77728; -3446; 1; 0 } {"Catacomb Of The Witch"; 136672; 79328; -3702; 1; 0 } {"Ascetics Necropolis"; -56064; 78720; -3011; 1; 0 } {"Martyr's Necropolis"; 114496; 132416; -3101; 1; 0 } {"Disciples Necropolis"; 168560; -17968; -3174; 1; 0 } {"Saints Necropolis"; 79296; 209584; -3709; 1; 0 } {"Catacomb of Dark Omens"; -22480; 13872; -3174; 1; 0 } {"Catacomb of the Forbidden Path"; 110912; 84912; -4816; 1; 0 } telposlist_end telposlist_begin PositionNoblessNoItemTown {"Talking Island Village"; -84141; 244623; -3729; 1000; 0 } {"The Elven Village"; 46951; 51550; -2976; 1000; 0 } {"The Dark Elven Village"; 9709; 15566; -4500; 1000; 0 } {"Orc Village"; -45158; -112583; -236; 1000; 0 } {"Dwarven Village"; 115120; -178224; -917; 1000; 0 } {"The Village of Gludin"; -80826; 149775; -3043; 1000; 0 } {"The Town of Gludio"; -12694; 122776; -3114; 1000; 0 } {"The Town of Dion"; 15671; 142994; -2704; 1000; 0 } {"Heine"; 111455; 219400; -3546; 1000; 0 } {"Town of Oren"; 83011; 53207; -1470; 1000; 0 } {"Hunters Village"; 117088; 76931; -2670; 1000; 0 } {"Town of Aden"; 146783; 25808; -2000; 1000; 0 } {"Rune Castle Town"; 43826; -47688; -792; 1000; 0 } {"Goddard Castle Town"; 147978; -55408; -2728; 1000; 0 } {"Hardin's Academy"; 105918; 109759; -3170; 1000; 0 } {"Giran Harbor"; 47935; 186810; -3420; 1000; 0 } {"Arena (Gludin Harbor)"; -87328; 142266; -3640; 1000; 0 } {"Arena (Giran Castle Town)"; 73579; 142709; -3768; 1000; 0 } {"Coliseum"; 146440; 46723; -3400; 1000; 0 } telposlist_end telposlist_begin PositionNoblessNoItemField {"Dragon Valley"; 122824; 110836; -3727; 1000; 0 } {"Dragon Valley Death Pass"; 73024; 118485; -3720; 1000; 0 } {"Brekas Stronghold"; 85389; 131366; -3707; 1000; 0 } {"Gorgons Flower Garden"; 113553; 134813; -3668; 1000; 0 } {"Tanor Canyon"; 69373; 155208; -3746; 1000; 0 } {"Devils Isle Entrance"; 43408; 206881; -3752; 1000; 0 } {"Lairs of Antharas Entrance"; 131131; 114597; -3720; 1000; 0 } {"Lairs of Antharas 1"; 147071; 120156; -4520; 1000; 0 } {"Lairs of Antharas 2"; 151689; 112615; -5520; 1000; 0 } {"Lairs of Antharas Bridge"; 146425; 109898; -3424; 1000; 0 } {"Lairs of Antharas Heart"; 154396; 121235; -3808; 1000; 0 } telposlist_end telposlist_begin PositionNoblessNoItemSSQ {"Necropolis Of Sacrifice"; -41184; 206752; -3357; 1000; 0 } {"Heretics Catacomb"; 39232; 143568; -3651; 1000; 0 } {"Pilgrims Necropolis"; 45600; 126944; -3686; 1000; 0 } {"Catacomb Of The Branded"; 43200; 170688; -3251; 1000; 0 } {"Worshipers Necropolis"; 107514; 174329; -3704; 1000; 0 } {"Catacomb Of The Apostate"; 74672; 78032; -3398; 1000; 0 } {"Patriots Necropolis"; -25472; 77728; -3446; 1000; 0 } {"Catacomb Of The Witch"; 136672; 79328; -3702; 1000; 0 } {"Ascetics Necropolis"; -56064; 78720; -3011; 1000; 0 } {"Martyr's Necropolis"; 114496; 132416; -3101; 1000; 0 } {"Disciples Necropolis"; 168560; -17968; -3174; 1000; 0 } {"Saints Necropolis"; 79296; 209584; -3709; 1000; 0 } {"Catacomb of Dark Omens"; -22480; 13872; -3174; 1000; 0 } {"Catacomb of the Forbidden Path"; 110912; 84912; -4816; 1000; 0 } telposlist_end property_define_end class_end Where {"Catacomb of Dark Omens"; -22480; 13872; -3174; 1000; 0 } {"name positioning"; X; Y; Z; value; 0 (Tax)} Html Gatekeeper: <html> <head> <body> Gatekeeper Clarissa: <br> We Gatekeepers use the will of the Gods to open the doors to time and space and teleport others. Which door would you like to open? <br><a action="bypass -h menu_select?ask=-8&reply=1"> Teleport </a> <br><a action="bypass -h menu_select?ask=-8&reply=2"> Hunting Grounds </a> <br><a action="bypass -h menu_select?ask=-303&reply=518"> Exchange with the Dimension Diamond</a> <br><a action="bypass -h menu_select?ask=-19&reply=0"> [Noblesse Only] teleport</a> <br><a action="bypass -h menu_select?ask=255&reply=4" msg="811;Monster Derby Track"> Move to Monster Derby Track (Free of Charge)</a> <br><a action="bypass -h talk_select">Quest </a> </body> </html> Where the reply=1 - this sheet mod contains in AI, which will show you the HK. In this case telposlist_begin Position1, that is: {"Aden"; 146705; 25840; -2000; 1500; 5 } {"Coliseum"; 146440; 46723; -3400; 1500; 0 } {"Dark Elven Village"; 9716; 15502; -4500; 1500; 0 } {"Dion"; 15744; 142928; -2704; 1500; 2 } {"Dwarven Village"; 115120; -178112; -916; 1500; 0 } {"Elven Village"; 46890; 51531; -2976; 1500; 0 } {"Floran Village"; 17953; 170234; -3504; 1500; 2 } {"Giran"; 83458; 148012; -3400; 1500; 3 } {"Giran Harbor"; 47935; 186810; -3420; 1500; 0 } {"Gludin"; -80826; 149775; -3043; 1500; 0 } {"Gludio"; -12694; 122776; -3114; 1500; 1 } {"Goddard"; 148024; -55281; -2728; 1500; 7 } {"Hardins Academy"; 105846; 109762; -3170; 1500; 3 } {"Heine"; 111333; 219345; -3546; 1500; 6 } {"Hunter Village"; 117156; 76878; -2670; 1500; 0 } {"Ivory Tower"; 85343; 16267; -3640; 1500; 4 } {"Orc Village"; -45186; -112459; -236; 1500; 0 } {"Oren"; 82956; 53162; -1470; 1500; 4 } {"Rune Town"; 43835; -47749; -792; 1500; 0 } {"Talking Island"; -84141; 244623; -3729; 1500; 0 } That's it,in any field you can add the desired location,with patience and time you can make a completegk in just a few hours. Gm-Shop: Open multisell.txt (folder scripts), see the following: MultiSell_begin [blackmerchant_weapon] 1is_dutyfree = 1 selllist={ {{{[flamberge];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[stormbringer];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[sword_of_delusion];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[war_pick];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[war_axe];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[crystal_staff];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[sage's_staff];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[cursed_dagger];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[dark_screamer];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[chakram];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[fist_blade];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[crystallized_ice_bow];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[akat_long_bow];1}};{{[crystal_c];1075};{[crystal_d];5375}}}; {{{[orcish_glaive];1}};{{[crystal_c];573};{[crystal_d];2865}}}; {{{[poleaxe];1}};{{[crystal_c];1075};{[crystal_d];5375}}} } MultiSell_end Open the end of multisell, skip 2 lines and write the following: MultiSell_begin [Пишем тут любое не использованное название] 575 (любое чило, главное, что бы второго такого не было в мультиселле)is_dutyfree = 1 is_show_all = 1 selllist={ {{{[ring_of_aurakyria];1}};{{[coin_of_luck];5325000}}}; {{{[ring_of_baium];1}};{{[coin_of_luck];6450000}}}; {{{[sanddragon's_earing];1}};{{[coin_of_luck];5950000}}}; {{{[earring_of_antaras];1}};{{[coin_of_luck];8200000}}}; {{{[earring_of_zaken];1}};{{[coin_of_luck];7520000}}}; {{{[dragon_necklace];1}};{{[coin_of_luck];8150000}}}; {{{[necklace_of_valakas];1}};{{[coin_of_luck];12600000}}} } MultiSell_end Where instead of the ring_of_aurakyria any object, the full prescribed in the itemdata.txt, after the name of the item is the number of,then we see the coin_of_luck. Instead of coin may again be the same any objects from the itemdata.txt, adena, for example. It is the number of things to which communicates our item. I would like to caution against the common error: after the last line should not be ;. That is, all lines we look like this: {{{[dragon_necklace];1}};{{[coin_of_luck];8150000}}};Последняя должна быть такой: {{{[dragon_necklace];1}};{{[coin_of_luck];8150000}}} <a action="bypass -h menu_select?ask=-303&reply=1">Buy weapon</a> Buffer: Ai.Obj class 1 buffer_npc : default_npcparameter_define_begin string fnHi "buffer_npc001.htm" string fnYouAreChaotic "buffer_npc002.htm" string fnNotEnoughAdena "buffer_npc003.htm" string fnWait "buffer_npc004.htm" int ItemBuff 57 int Amount 1000 int Delay 500 parameter_define_end handler 13 11 // CREATED variable_begin "myself" "_choiceN" "_code" "_from_choice" variable_end push_event // myself push_const 704 add fetch_i // i_ai0 push_const 308 add push_reg_sp fetch_i push_const 0 assign4 shift_sp -1 handler_end handler 3 38 // TALKED variable_begin "talker" "myself" "_choiceN" "_code" "_from_choice" variable_end push_event // talker push_const 40 add fetch_i // karma push_const 468 add fetch_i4 push_const 0 greater branch_false L2 L1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter fnYouAreChaotic func_call 184680516 // func[ShowPage] shift_sp -2 shift_sp -1 jump L3 L2 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter fnHi func_call 184680516 // func[ShowPage] shift_sp -2 shift_sp -1 L3 handler_end handler 32 134 // MENU_SELECTED variable_begin "talker" "ask" "reply" "myself" "_choiceN" "_code" "_from_choice" variable_end push_event // ask push_const 160 add fetch_i4 push_const 201 negate equal push_reg_sp fetch_i branch_false L4 shift_sp 1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter ItemBuff func_call 184680579 // func[OwnItemCount] shift_sp -2 push_parameter Amount greater_equal and L4 branch_false L5 L6 push_event // myself push_const 704 add fetch_i // i_ai0 push_const 308 add fetch_i4 push_const 0 equal branch_false L8 L7 push_event // myself push_const 704 add fetch_i // i_ai0 push_const 308 add push_reg_sp fetch_i push_const 1 assign4 shift_sp -1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter ItemBuff push_parameter Amount func_call 184746114 // func[DeleteItem1] shift_sp -3 shift_sp -1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_event // reply push_const 164 add fetch_i push_const 1 push_const 1 push_const 1000000 func_call 184877074 // func[AddUseSkillDesire] shift_sp -5 shift_sp -1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter fnHi func_call 184680516 // func[ShowPage] shift_sp -2 shift_sp -1 push_event // myself push_const 704 add fetch_i push_const 1 push_parameter Delay func_call 184680487 // func[AddTimerEx] shift_sp -2 shift_sp -1 jump L9 L8 shift_sp 1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter fnWait func_call 184680516 // func[ShowPage] shift_sp -2 shift_sp -1 L9 jump L10 L5 shift_sp 1 push_event // myself push_const 704 add fetch_i push_event // talker push_const 40 add fetch_i push_parameter fnNotEnoughAdena func_call 184680516 // func[ShowPage] shift_sp -2 shift_sp -1 L10 handler_end handler 12 20 // TIMER_FIRED_EX variable_begin "timer_id" "myself" "_choiceN" "_code" "_from_choice" variable_end push_event // timer_id push_const 236 add fetch_i4 push_const 1 equal branch_false L12 L11 push_event // myself push_const 704 add fetch_i // i_ai0 push_const 308 add push_reg_sp fetch_i push_const 0 assign4 shift_sp -1 L12 handler_end class_end Further opening npcdata, there straight npc_begin citizen 14003 [buffer_npc] level=70 acquire_exp_rate=0 acquire_sp=0 unsowing=1 clan={} ignore_clan_list={} clan_help_range=300 slot_chest=[] slot_rhand=[] slot_lhand=[] shield_defense_rate=0 shield_defense=0 skill_list={@s_race_undead;@s_npc_weakness_holy3;@ s_evil_attack;@s_npc_weakness_fire1} npc_ai={[buffer_npc];{[fnHi]=[buffer_npc001.htm]}} category={} race=human sex=female undying=1 can_be_attacked=0 corpse_time=1 no_sleep_mode=0 agro_range=0 ground_high={120;0;0} ground_low={50;0;0} exp=429634528 org_hp=2444.5 org_hp_regen=7.5 org_mp=10000 org_mp_regen=200 collision_radius={8;8} collision_height={24;24} str=60 int=90 dex=50 wit=90 con=60 men=40 base_attack_type=sword base_attack_range=40 base_damage_range={0;0;80;120} base_rand_dam=30 base_physical_attack=688.86373 base_critical=4 physical_hit_modify=4.75 base_attack_speed=253 base_reuse_delay=0 base_magic_attack=470.4 base_defend=295.91 base_magic_defend=216.53 physical_avoid_modify=0 soulshot_count=0 spiritshot_count=0 hit_time_factor=0.6 item_make_list={} corpse_make_list={} additional_make_list={} additional_make_multi_list={} hp_increase=0 mp_increase=0 safe_height=100 npc_end NPC_PCH: [buffer_npc] = 1014003 Html: <html><body>Buffer NPC:<br> Por solo <font color="LEVEL">1000 adenas</font> te podemos dar auras! Elije aquellas que prefieras!<br> <table><tr><td width=80> <a action="bypass -h menu_select?ask=-201&reply=273411">[Might]</a><br> <a action="bypass -h menu_select?ask=-201&reply=266243">[Shield]</a><br> <a action="bypass -h menu_select?ask=-201&reply=275715">[Focus]</a><br> <a action="bypass -h menu_select?ask=-201&reply=308226">[Windwalk]</a><br> <a action="bypass -h menu_select?ask=-201&reply=317443">[Guidance]</a><br> <a action="bypass -h menu_select?ask=-201&reply=278275">[Agility]</a><br> <a action="bypass -h menu_select?ask=-201&reply=265218">[Magic Barrier]</a> </td><td width=100> <a action="bypass -h menu_select?ask=-201&reply=277763">[Acumen]</a><br> <a action="bypass -h menu_select?ask=-201&reply=271107">[Empower]</a><br> <a action="bypass -h menu_select?ask=-201&reply=268294">[Bless the Soul]</a><br> <a action="bypass -h menu_select?ask=-201&reply=271874">[Berserker Spirit]</a><br> <a action="bypass -h menu_select?ask=-201&reply=267009">[Holy Weapon]</a><br> <a action="bypass -h menu_select?ask=-201&reply=264964">[Mental Shield]</a><br> <a action="bypass -h menu_select?ask=-201&reply=275974">[Concrentrarion]</a> </td><td width=100> <a action="bypass -h menu_select?ask=-201&reply=267267">[Regeneration]</a><br> <a action="bypass -h menu_select?ask=-201&reply=316931">[Freezing Skin]</a><br> <a action="bypass -h menu_select?ask=-201&reply=267526">[Bless the Body]</a><br> <a action="bypass -h menu_select?ask=-201&reply=318214">[Bless the Shield]</a><br> <a action="bypass -h menu_select?ask=-201&reply=278018">[Haste]</a><br> <a action="bypass -h menu_select?ask=-201&reply=317955">[Death Wisper]</a><br> <a action="bypass -h menu_select?ask=-201&reply=274690">[Kiss Of Eva]</a> </td></tr></table> </body></html> You will write only hml for functions and add the NPC in to the client. string fnYouAreChaotic "buffer_npc002.htm" string fnNotEnoughAdena "buffer_npc003.htm" Be carefull,be patient and spend some time on it so you can alone develop and imrove your personal skills on the issue.Wish you the best possible results.Best Of Luck! Do not forget to leave me your feedback.
  20. Den 3erw ean uparxi to sigkekrimeno share. ala mias kai to exw as to kanw share gia merikous pou to xriazonte. :) 1 Ikona apo to command Evala Spoilers gia na min ine olokliro katevato. :) Code: Pigenoume com.l2jfrozen.gameserver.handler.AdminCommandHandler Vazoume import import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminWho; import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminZone; +import com.l2jfrozen.gameserver.handler.admincommandhandlers.AdminAugment; Kanoume add sta commands registerAdminCommandHandler(new AdminAugment()); twra pigenoume com.l2jfrozen.gameserver.model.entity ftiaxnoume AugmentDatabase kai vazoume Meta pigenoume sto com.l2jfrozen.gameserver.handler.admincommandhandlers ftiaxnoume AdminAugment Kai vazoume Kai twra kanoume build to command ine //augment CREDITS: fofas
  21. Updates:Removed all shit messages... (ConfigAdded)Npc:Enable/disable (ConfigAdded)Vote Time To Vote (ConfigAdded)Reward Id for vote reward (ConfigAdded)Reward Count For Vote Reward Reworked the GetVote Method And Connections Updated Too Added Who Is Voting Now method(that show you who is voting now And Your Chars Name When You Click The npc) Html Added And One Shit Logo :P Coded On Acis Latest Rev.. Screen: PASS:Reborn12 DOWNLOAD L2JaCis : DOWNLOAD DOWNLOAD L2JFrozen : DOWNLOAD
  22. Hello i Create one Easy code for your server's this is code for Fake player real time is have items and clan crest. He got the idea from the L2mafia, L2reality Soory for bad English Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 4) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -99,6 +99,7 @@ import net.sf.l2j.gameserver.instancemanager.games.MonsterRace; import net.sf.l2j.gameserver.model.L2Manor; import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.model.entity.FakeOnline; import net.sf.l2j.gameserver.model.entity.Hero; import net.sf.l2j.gameserver.model.olympiad.Olympiad; import net.sf.l2j.gameserver.model.olympiad.OlympiadGameManager; @@ -300,7 +301,7 @@ if (Config.ALT_FISH_CHAMPIONSHIP_ENABLED) FishingChampionshipManager.getInstance(); - + FakeOnline.restoreFakePlayers(); Util.printSection("System"); TaskManager.getInstance(); Runtime.getRuntime().addShutdownHook(Shutdown.getInstance()); Index: java/net/sf/l2j/gameserver/model/L2Clan.java =================================================================== --- java/net/sf/l2j/gameserver/model/L2Clan.java (revision 4) +++ java/net/sf/l2j/gameserver/model/L2Clan.java (working copy) @@ -2186,7 +2186,7 @@ member.broadcastUserInfo(); } - private void checkCrests() + public void checkCrests() { if (_crestId != 0) { Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 4) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -3118,7 +3118,7 @@ L2GameClient client = _client; if (client != null) { - if (client.isDetached()) + if (client.isDetached()|| client.isFakePlayer()) client.cleanMe(true); else { @@ -8890,6 +8890,17 @@ _validBypass2.add(bypass); } + public boolean fakeplayer = false; + + public boolean getfakeplayer() + { + return fakeplayer; + } + public void setfakeplayer(boolean fake) + { + fakeplayer = fake; + } + public synchronized boolean validateBypass(String cmd) { for (String bp : _validBypass) Index: java/net/sf/l2j/gameserver/model/entity/FakeOnline.java =================================================================== --- java/net/sf/l2j/gameserver/model/entity/FakeOnline.java (revision 0) +++ java/net/sf/l2j/gameserver/model/entity/FakeOnline.java (revision 0) @@ -0,0 +1,92 @@ +package net.sf.l2j.gameserver.model.entity; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.logging.Level; +import java.util.logging.Logger; + +import net.sf.l2j.L2DatabaseFactory; +import net.sf.l2j.gameserver.LoginServerThread; +import net.sf.l2j.gameserver.model.L2Clan; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.itemcontainer.ItemContainer; +import net.sf.l2j.gameserver.network.L2GameClient; +import net.sf.l2j.gameserver.network.L2GameClient.GameClientState; + +/** + * @author FOFAS + * + */ +public class FakeOnline +{ + private static Logger _log = Logger.getLogger(FakeOnline.class.getName()); + //select fake player + private static final String LOAD_OFFLINE_STATUS = "SELECT * FROM fakeplayer"; + //insert fake player + private static final String SET_OFFLINE_STATUS = "INSERT INTO fakeplayer (charId) VALUES (?)"; + + public static void restoreFakePlayers() + { + int nfakeplayer = 0; + try (Connection con = L2DatabaseFactory.getInstance().getConnection()) + { + PreparedStatement stm = con.prepareStatement(LOAD_OFFLINE_STATUS); + ResultSet rs = stm.executeQuery(); + while (rs.next()) + { + L2PcInstance player = null; + try + { + L2GameClient client = new L2GameClient(null); + client.setFakePlayer(true); + player = L2PcInstance.restore(rs.getInt("charId")); + client.setActiveChar(player); + player.setOnlineStatus(true, false); + client.setAccountName(player.getAccountName()); + client.setState(GameClientState.IN_GAME); + player.setClient(client); + player.spawnMe(player.getX(), player.getY(), player.getZ()); + LoginServerThread.getInstance().addGameServerLogin(player.getAccountName(), client); + ItemContainer items = player.getInventory(); + items.restore(); + L2Clan clan = player.getClan(); + clan.checkCrests(); + player.setfakeplayer(true); + player.setOnlineStatus(true, true); + player.restoreEffects(); + player.broadcastUserInfo(); + nfakeplayer++; + } + catch (Exception e) + { + _log.log(Level.WARNING, "FakePlayer: Error loading trader: "+player,e); + if (player != null) + { + player.deleteMe(); + } + } + } + rs.close(); + stm.close(); + _log.info("Loaded: " +nfakeplayer+ " Fake player(s)"); + } + catch (Exception e) + { + _log.log(Level.WARNING, "FakePlayer: Error while loading FakePlayer: ",e); + } + } + + public static void setfakeplayers(L2PcInstance player) + { + try (Connection con = L2DatabaseFactory.getInstance().getConnection()) + { + PreparedStatement statement = con.prepareStatement(SET_OFFLINE_STATUS); + statement.setInt(1, player.getObjectId()); + statement.execute(); + statement.close(); + } + catch (Exception e) + {} + } +} Index: java/net/sf/l2j/gameserver/network/L2GameClient.java =================================================================== --- java/net/sf/l2j/gameserver/network/L2GameClient.java (revision 4) +++ java/net/sf/l2j/gameserver/network/L2GameClient.java (working copy) @@ -194,7 +194,7 @@ public void sendPacket(L2GameServerPacket gsp) { - if (_isDetached) + if (_isDetached || _isfakeplayer) return; getConnection().sendPacket(gsp); @@ -291,6 +291,18 @@ } } + private boolean _isfakeplayer = false; + + public boolean isFakePlayer() + { + return _isfakeplayer; + } + + public void setFakePlayer(boolean b) + { + _isfakeplayer = b; + } + public static void deleteCharByObjId(int objid) { if (objid < 0) @@ -489,6 +501,9 @@ public void closeNow() { _isDetached = true; // prevents more packets execution + + _isfakeplayer = true; + close(ServerClose.STATIC_PACKET); synchronized (this) { @@ -538,7 +553,7 @@ try { - if (getActiveChar() != null && !isDetached()) + if (getActiveChar() != null && !isDetached() || !isFakePlayer()) { setDetached(true); fast = !getActiveChar().isInCombat() && !getActiveChar().isLocked(); @@ -633,7 +648,7 @@ */ public boolean dropPacket() { - if (_isDetached) // detached clients can't receive any packets + if (_isDetached || _isfakeplayer) // detached clients can't receive any packets return true; // flood protection @@ -756,7 +771,7 @@ if (packet == null) // queue is empty return; - if (_isDetached) // clear queue immediately after detach + if (_isDetached || _isfakeplayer) // clear queue immediately after detach { _packetQueue.clear(); return; Index: Roar_gameserver/java/com/l2jfresh/gameserver/handler/VoicedCommandHandler.java =================================================================== --- Roar_gameserver/java/com/l2jfresh/gameserver/handler/VoicedCommandHandler.java (revision 62) +++ Roar_gameserver/java/com/l2jfresh/gameserver/handler/VoicedCommandHandler.java (working copy) @@ -22,6 +22,7 @@ import com.l2jfresh.gameserver.handler.voicedcommandhandlers.BankingCmd; import com.l2jfresh.gameserver.handler.voicedcommandhandlers.DMVoicedInfo; import com.l2jfresh.gameserver.handler.voicedcommandhandlers.Donator; +import com.l2jfresh.gameserver.handler.voicedcommandhandlers.FakePlayerOnline; import com.l2jfresh.gameserver.handler.voicedcommandhandlers.Leave; import com.l2jfresh.gameserver.handler.voicedcommandhandlers.OnlinePlayers; import com.l2jfresh.gameserver.handler.voicedcommandhandlers.Pin; @@ -67,6 +68,7 @@ + registerHandler(new FakePlayerOnline()); } public void registerHandler(IVoicedCommandHandler handler) Index: Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java =================================================================== --- Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java (revision 0) +++ Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java (revision 0) @@ -0,0 +1,35 @@ +package com.l2jfresh.gameserver.handler.voicedcommandhandlers; + +import com.l2jfresh.gameserver.handler.IVoicedCommandHandler; +import com.l2jfresh.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfresh.gameserver.model.custom.FakeOnline; + +/** + * @author FOFAS + * + */ +public class FakePlayerOnline implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = {"fakeplayer"}; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance player, String target) + { + if (command.equalsIgnoreCase("fakeplayer")) + { + if (player != null) + { + FakeOnline.setfakeplayers(player); + player.setfakeplayer(true); + player.deleteMe(); + player.logout(); + } + } + return true; + } + @Override + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } +} Index: Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java =================================================================== --- Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java (revision 0) +++ Roar_gameserver/java/com/l2jfresh/gameserver/handler/voicedcommandhandlers/FakePlayerOnline.java (revision 0) @@ -0,0 +1,35 @@ +package com.l2jfresh.gameserver.handler.voicedcommandhandlers; + +import com.l2jfresh.gameserver.handler.IVoicedCommandHandler; +import com.l2jfresh.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfresh.gameserver.model.custom.FakeOnline; + +/** + * @author FOFAS + * + */ +public class FakePlayerOnline implements IVoicedCommandHandler +{ + private static final String[] VOICED_COMMANDS = {"fakeplayer"}; + + @Override + public boolean useVoicedCommand(String command, L2PcInstance player, String target) + { + if (command.equalsIgnoreCase("fakeplayer")) + { + if (player != null) + { + FakeOnline.setfakeplayers(player); + player.setfakeplayer(true); + player.deleteMe(); + player.logout(); + } + } + return true; + } + @Override + public String[] getVoicedCommandList() + { + return VOICED_COMMANDS; + } +}
  23. How does it works? our system automatically pop-up validation window to characters oscillating around specified number of killed monsters, in order to verify possible bots use. player have to match randomly generated colours within <also> randomly chosen patterns (time is limited). forgive me guys, but since now any instant changes or system updates will be available only for acis customers. authors: credits: @Agent @Rootware @Caparso @Hasha @SweeTs @Tryskell our main provisions: does not require to be fluent in a foreign language, as simple as possible. insurmountable by nowadays programs used to inject bots. does not affecting existing source (just few necessary lines), no external libs are needed. punishment selection (move to nearest town, kick from the server, put to the jail or ban character). configurable validation time. code preview? check it out on pastebin. bots_prevention_v1.1.diff html/mods/necessary images How does software see content? <html><title>Bots prevention</title><body><center><br><br><img src="L2UI_CH3.herotower_deco" width="256" height="32"><br><br><font color="a2a0a2">in order to prove you are a human being<br1>you've to</font> <font color="b09979">match colours within generated pattern:</font><br><br><img src="Crest.crest_1_9903795" width="32" height="32"></td></tr><br><br><font color=b09979>click-on pattern of your choice beneath:</font><table><tr><td><button action="bypass -h report_0" width=32 height=32 back="Crest.crest_1_1978" fore="Crest.crest_1_1978"></td><td><button action="bypass -h report_1" width=32 height=32 back="Crest.crest_1_1970" fore="Crest.crest_1_1970"></td><td><button action="bypass -h report_2" width=32 height=32 back="Crest.crest_1_1975" fore="Crest.crest_1_1975"></td><td><button action="bypass -h report_3" width=32 height=32 back="Crest.crest_1_1971" fore="Crest.crest_1_1971"></td></tr></table></center></body></html>
  24. Hello here is a gode for this http://postimg.org/image/gk2nw63l3/ #P L2jFrozen_GameServer Index: head-src/com/l2jfrozen/Config.java =================================================================== --- head-src/com/l2jfrozen/Config.java (revision 986) +++ head-src/com/l2jfrozen/Config.java (working copy) @@ -2891,6 +2891,8 @@ public static int GM_OVER_ENCHANT; public static int MAX_ITEM_ENCHANT_KICK; + public static boolean ENABLE_ENCHANT_ANNOUNCE; + public static int ENCHANT_ANNOUNCE_LEVEL; //============================================================ public static void loadEnchantConfig() @@ -3196,6 +3198,8 @@ MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0")); GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0")); + ENABLE_ENCHANT_ANNOUNCE = Boolean.parseBoolean(ENCHANTSetting.getProperty("EnableEnchantAnnounce", "False")); + ENCHANT_ANNOUNCE_LEVEL = Integer.parseInt(ENCHANTSetting.getProperty("EnchantAnnounceLevel", "16")); } catch(Exception e) { Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 986) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy) @@ -25,6 +25,7 @@ import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.base.Race; +import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.EnchantResult; import com.l2jfrozen.gameserver.network.serverpackets.InventoryUpdate; @@ -301,6 +302,7 @@ int chance = 0; int maxEnchantLevel = 0; int minEnchantLevel = 0; + int nextEnchantLevel = item.getEnchantLevel() + 1; if(item.getItem().getType2() == L2Item.TYPE2_WEAPON) { @@ -565,6 +567,9 @@ sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL == 0) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } else { @@ -572,6 +577,9 @@ sm.addNumber(item.getEnchantLevel()); sm.addItemName(item.getItemId()); activeChar.sendPacket(sm); + + if(Config.ENABLE_ENCHANT_ANNOUNCE && Config.ENCHANT_ANNOUNCE_LEVEL <= item.getEnchantLevel()) + Announcements.getInstance().gameAnnounceToAll("Congratulations to " + activeChar.getName() + "! Your " + item.getItem() + " has been successfully enchanted to +" + nextEnchantLevel); } item.setEnchantLevel(item.getEnchantLevel() + Config.CUSTOM_ENCHANT_VALUE); Index: config/head/enchant.properties =================================================================== --- config/head/enchant.properties (revision 986) +++ config/head/enchant.properties (working copy) @@ -131,4 +131,14 @@ # HOW WORKS: if you set it to 20, and player have an item > 20 # he will be kicked and the item will disappear! # Enchant amount at which a player gets punished (0 disabled) -EnchantKick = 0 \ No newline at end of file +EnchantKick = 0 + +# ---------------------- +# Enchant Announce - +# ---------------------- +# Announce when a player successfully enchant an item to x +# Default: False +EnableEnchantAnnounce = False + +# The value of x is... set it here (No have default value) +EnchantAnnounceLevel = 16 credits: RedHot
  25. Hello mates i whant to make my first share in maxcheaters , i will share with you my fixed MultifuctionZone, and bug that was allowing same account to be logged in twice. I hope to Help some newbies that cant addapt the codes here it is have fun soon i will share more codes ;) Fixed Pach. by me have fun...! Update: 2:42 Am 23/5/2014 i fix some Bugs now are all fine.! ### Eclipse Workspace Patch 1.0 #P L2jFrozen_GameServer Index: config/functions/PvPZone.properties =================================================================== --- config/functions/PvPZone.properties (revision 0) +++ config/functions/PvPZone.properties (revision 0) @@ -0,0 +1,60 @@ +# --------------------------------------------------------------------------- +# MultiFunctionZone - custom addon for your server +# --------------------------------------------------------------------------- +# This option will turn on PvP flag to all people when entering to the zone +EnablePvP = True + +# If set to false, zone will be no-restart zone +NoRestartZone = False + +# If set to false, zone will be no-logout zone +NoLogoutZone = False + +# If set to false, zone will be no-store zone +NoStoreZone = False + +# Give noblesse after revive? +ReviveNoblesse = False + +# Heal after revive? +ReviveHeal = False + +# Delay, in seconds, to wait before revive +# 0 to disable +ReviveDelay = 10 + +# Set the spawn points where players will be teleported on revive, if enabled +# example:150111,144740,-12248;143665,144418,-12022;144443,147685,-12139 +SpawnLoc = 150111,144740,-12248;143665,144418,-12022;144443,147685,-12139 + +# Random respawn radius +RespawnRadius = 500 + +# If set to true, players will take noblesse blessing when entering +GiveNoblesse = True + +# Remove buffs when entering to the zone +RemoveBuffs = False + +# Remove pets when entering to the zone +RemovePets = False + +# Special rewards when hunting inside this zone +# example: 57,100000;14720,1 +Rewards = 57,100000;14720,1 + +# List of Items(id's) that won't be usable inside this area and also will be unequiped when entering +# (armor, weapons, scrolls, potions, etc), example: 728,7575, 6383, 1538 +Items = 728,7575, 6383, 1538 + +# List of Grades that won't be usable inside this area and also will be unequiped when entering +# example: D,C,B,A,S,S80,S84 +Grades = C,B,A + +# Items with this enchant or more won't be usable inside this area and also will be unequiped when entering +# 0 to disable +Enchant = 0 + +# Players with one of that classes won't be able to enter to the zone +# example: 93,85,12 +Classes = 92 \ No newline at end of file Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/L2Character.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java (working copy) @@ -340,6 +340,9 @@ /** The Constant ZONE_DANGERAREA. */ public static final int ZONE_DANGERAREA = 16384; + + /** The Constant ZONE_MULTIFUNCTION. */ + public static final int ZONE_MULTIFUNCTION = 32; /** The Constant ZONE_NOSTORE. */ public static final int ZONE_NOSTORE = 32768; Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java (working copy) @@ -19,10 +19,12 @@ package com.l2jfrozen.gameserver.network.clientpackets; import com.l2jfrozen.Config; + import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.L2ManufactureItem; import com.l2jfrozen.gameserver.model.L2ManufactureList; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.RecipeShopMsg; @@ -67,7 +69,14 @@ player.sendPacket(ActionFailed.STATIC_PACKET); return; } - + + + if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.store_zone) + { + player.sendMessage("You cannot craft while inside Multifunction zone."); + return; + } + if(player.isTradeDisabled()) { player.sendMessage("Private manufacture are disable here. Try in another place."); Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (working copy) @@ -20,15 +20,18 @@ import java.util.logging.Logger; + import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.GameServer; import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jfrozen.gameserver.datatables.SkillTable; import com.l2jfrozen.gameserver.model.Inventory; +import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.L2Party; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad; import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.L2GameClient; import com.l2jfrozen.gameserver.network.L2GameClient.GameClientState; import com.l2jfrozen.gameserver.network.SystemMessageId; @@ -103,6 +106,13 @@ sendPacket(RestartResponse.valueOf(false)); return; } + + if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.restart_zone) + { + player.sendMessage("You cannot restart while inside a Multifunction zone."); + sendPacket(RestartResponse.valueOf(false)); + return; + } // Check if player is in away mode if(player.isAway()) Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (working copy) @@ -16,6 +16,7 @@ import java.util.logging.Logger; + import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jfrozen.gameserver.datatables.SkillTable; @@ -24,6 +25,7 @@ import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad; import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; @@ -53,7 +55,13 @@ player.sendPacket(ActionFailed.STATIC_PACKET); return; } - + + if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.logout_zone) + { + player.sendMessage("You cannot Logout while inside a Multifunction zone."); + player.sendPacket(ActionFailed.STATIC_PACKET); + return; + } if (player.isAway()) { player.sendMessage("You can't restart in Away mode."); Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java (working copy) @@ -19,6 +19,7 @@ package com.l2jfrozen.gameserver.network.clientpackets; import java.util.Arrays; + import java.util.logging.Logger; import com.l2jfrozen.Config; @@ -29,10 +30,12 @@ import com.l2jfrozen.gameserver.managers.CastleManager; import com.l2jfrozen.gameserver.managers.ClanHallManager; import com.l2jfrozen.gameserver.model.Inventory; +import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.L2Clan; import com.l2jfrozen.gameserver.model.L2Object; import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate; @@ -101,7 +104,11 @@ // NOTE: disabled due to deadlocks // synchronized (activeChar.getInventory()) // { - + if(getClient().getActiveChar().isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.checkItem(item)) + { + getClient().getActiveChar().sendMessage("You cannot use "+item.getName()+" inside this zone."); + return; + } if (item.isWear()) // No unequipping wear-items return; Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java =================================================================== --- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java (working copy) @@ -18,6 +18,7 @@ package com.l2jfrozen.gameserver.datatables.xml; import java.io.File; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -58,6 +59,7 @@ import com.l2jfrozen.gameserver.model.zone.type.L2FortZone; import com.l2jfrozen.gameserver.model.zone.type.L2JailZone; import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.model.zone.type.L2NoHqZone; import com.l2jfrozen.gameserver.model.zone.type.L2NoLandingZone; import com.l2jfrozen.gameserver.model.zone.type.L2NoStoreZone; @@ -245,6 +247,10 @@ { temp = new L2NoHqZone(zoneId); } + else if(zoneType.equals("PvPZone")) + { + temp = new L2PvPZone(zoneId); + } else if(zoneType.equals("BossZone")) { int boss_id = -1; Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java (working copy) @@ -19,9 +19,11 @@ package com.l2jfrozen.gameserver.network.clientpackets; import com.l2jfrozen.Config; + import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.TradeList; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListSell; @@ -106,7 +108,14 @@ player.sendPacket(ActionFailed.STATIC_PACKET); return; } - + + if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.store_zone) + { + player.sendPacket(new PrivateStoreManageListSell(player)); + player.sendMessage("You cannot start store while inside Multifunction zone."); + return; + } + TradeList tradeList = player.getSellList(); tradeList.clear(); tradeList.setPackaged(_packageSale); Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -20,6 +20,7 @@ import static com.l2jfrozen.gameserver.ai.CtrlIntention.AI_INTENTION_MOVE_TO; + import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -156,6 +157,7 @@ import com.l2jfrozen.gameserver.model.extender.BaseExtender.EventType; import com.l2jfrozen.gameserver.model.quest.Quest; import com.l2jfrozen.gameserver.model.quest.QuestState; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.model.zone.type.L2TownZone; import com.l2jfrozen.gameserver.network.L2GameClient; import com.l2jfrozen.gameserver.network.SystemMessageId; @@ -281,6 +283,9 @@ /** The _vote timestamp. */ private long _voteTimestamp = 0; + + + public int counter = 0; /** The _posticipate sit. */ private boolean _posticipateSit; @@ -8297,6 +8302,9 @@ // Add karma to attacker and increase its PK counter setPvpKills(getPvpKills() + 1); + + L2PvPZone.givereward(this); + // Increase the kill count for a special hero aura heroConsecutiveKillCount++; Index: head-src/com/l2jfrozen/gameserver/model/ItemContainer.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/ItemContainer.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/model/ItemContainer.java (working copy) @@ -44,7 +44,7 @@ { protected static final Logger _log = Logger.getLogger(ItemContainer.class.getName()); - protected final List<L2ItemInstance> _items; + public final List<L2ItemInstance> _items; protected ItemContainer() { Index: head-src/com/l2jfrozen/gameserver/thread/LoginServerThread.java =================================================================== --- head-src/com/l2jfrozen/gameserver/thread/LoginServerThread.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/thread/LoginServerThread.java (working copy) @@ -507,9 +507,19 @@ pl = null; } - public void addGameServerLogin(String account, L2GameClient client) - { - _accountsInGameServer.put(account, client); + /* + + * @return {@code true} if account was not already logged in, {@code false} + + * otherwise + + */ + + public boolean addGameServerLogin(String account, L2GameClient client) { + + return ((FastMap<String, L2GameClient>) _accountsInGameServer).putIfAbsent(account, client) == null; + + } public void sendAccessLevel(String account, int level) Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java (working copy) @@ -19,6 +19,7 @@ package com.l2jfrozen.gameserver.network.serverpackets; import com.l2jfrozen.gameserver.datatables.AccessLevel; + import com.l2jfrozen.gameserver.datatables.sql.AccessLevels; import com.l2jfrozen.gameserver.managers.CastleManager; import com.l2jfrozen.gameserver.managers.FortManager; @@ -31,6 +32,7 @@ import com.l2jfrozen.gameserver.model.entity.event.TvT; import com.l2jfrozen.gameserver.model.entity.siege.Castle; import com.l2jfrozen.gameserver.model.entity.siege.Fort; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; /** * sample 0b 952a1048 objectId 00000000 00000000 00000000 00000000 00000000 00000000 format dddddd rev 377 format @@ -64,7 +66,8 @@ || (DM.is_started() && player._inEventDM) || (CTF.is_started() && player._inEventCTF) || player.isInFunEvent() - || player.isPendingRevive()); + || player.isPendingRevive() + || (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && L2PvPZone.revive)); } _charObjId = cha.getObjectId(); _fake = !cha.isDead(); Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/AuthLogin.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/AuthLogin.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/AuthLogin.java (working copy) @@ -16,8 +16,10 @@ import java.util.logging.Logger; + import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.network.L2GameClient; +import com.l2jfrozen.gameserver.network.serverpackets.L2GameServerPacket; import com.l2jfrozen.gameserver.thread.LoginServerThread; import com.l2jfrozen.gameserver.thread.LoginServerThread.SessionKey; @@ -55,9 +57,26 @@ // avoid potential exploits if (client.getAccountName() == null) { - client.setAccountName(_loginName); - LoginServerThread.getInstance().addGameServerLogin(_loginName, client); - LoginServerThread.getInstance().addWaitingClientAndSendRequest(_loginName, client, key); + // Preventing duplicate login in case client login server socket was + + // disconnected or this packet was not sent yet + + if (LoginServerThread.getInstance().addGameServerLogin(_loginName,client)) { + + client.setAccountName(_loginName); + + LoginServerThread.getInstance().addWaitingClientAndSendRequest( + + _loginName, client, key); + + } else { + + client.close((L2GameServerPacket) null); + + } + + + } } Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvPZone.java =================================================================== --- head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvPZone.java (revision 0) +++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2PvPZone.java (revision 0) @@ -0,0 +1,342 @@ +/* + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ +/* + * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. + */ +package com.l2jfrozen.gameserver.model.zone.type; + +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import com.l2jfrozen.gameserver.datatables.SkillTable; +import com.l2jfrozen.gameserver.model.L2Character; +import com.l2jfrozen.gameserver.model.L2Skill; +import com.l2jfrozen.gameserver.model.L2Summon; +import com.l2jfrozen.gameserver.model.PcInventory; +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance; +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.zone.L2ZoneType; +import com.l2jfrozen.gameserver.thread.ThreadPoolManager; +import com.l2jfrozen.util.random.Rnd; +import javolution.util.FastList; + +/** + * + * @author Wyatt + * @version 1.2 + * + */ + +public class L2PvPZone extends L2ZoneType +{ + + public L2PvPZone(int id) + { + super(id); + loadConfigs(); + } + + public static boolean pvp_enabled, restart_zone, store_zone, logout_zone, revive_noblesse, revive_heal, revive, remove_buffs, remove_pets, give_noblesse; + static int radius, enchant, revive_delay; + static int[][] spawn_loc; + L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1); + private static List<String> items = new FastList<String>(); + private static List<String> classes = new FastList<String>(); + private static List<String> grades = new FastList<String>(); + public static List<int[]> rewards = new ArrayList<int[]>(); + static String[] gradeNames = {"","D","C","B","A","S"}; + + + @Override + protected void onEnter(L2Character character) + { + character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true); + character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, true); + + if (character instanceof L2PcInstance) + { + L2PcInstance activeChar = ((L2PcInstance) character); + if(classes != null && classes.contains(""+activeChar.getClassId().getId())) + { + activeChar.teleToLocation(83597,147888,-3405); + activeChar.sendMessage("Your class is not allowed in the Special PvP zone."); + return; + } + + for(L2ItemInstance o : activeChar.getInventory()._items) + { + if(o.isEquipable() && o.isEquipped() && !checkItem(o)) + { + int slot = activeChar.getInventory().getSlotFromItem(o); + activeChar.getInventory().unEquipItemInBodySlotAndRecord(slot); + activeChar.sendMessage(o.getItemName()+" unequiped because is not allowed inside this zone."); + } + } + activeChar.sendMessage("You entered in a Special PvP zone."); + clear(activeChar); + if(give_noblesse) + noblesse.getEffects(activeChar, activeChar); + if(pvp_enabled && activeChar.getPvpFlag() == 0) + activeChar.updatePvPFlag(1); + } + } + + @Override + protected void onExit(L2Character character) + { + character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false); + character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, false); + + if (character instanceof L2PcInstance) + { + L2PcInstance activeChar = ((L2PcInstance) character); + activeChar.sendMessage("You left from a Special PvP zone bay baby..!"); + + if(pvp_enabled) + activeChar.stopPvPFlag(); + } + } + + @Override + public void onDieInside(final L2Character character) + { + if (character instanceof L2PcInstance) + { + final L2PcInstance activeChar = ((L2PcInstance) character); + if(revive) + { + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() + { + @Override + public void run() + { + activeChar.doRevive(); + heal(activeChar); + int[] loc = spawn_loc[Rnd.get(spawn_loc.length)]; + activeChar.teleToLocation(loc[0]+Rnd.get(-radius,radius), loc[1]+Rnd.get(-radius,radius), loc[2]); + } + },revive_delay*1000); + } + } + } + + @Override + public void onReviveInside(L2Character character) + { + if (character instanceof L2PcInstance) + { + L2PcInstance activeChar = ((L2PcInstance) character); + if(revive_noblesse) + noblesse.getEffects(activeChar, activeChar); + if(revive_heal) + heal(activeChar); + } + } + + static void heal(L2PcInstance activeChar) + { + activeChar.setCurrentHp(activeChar.getMaxHp()); + activeChar.setCurrentCp(activeChar.getMaxCp()); + activeChar.setCurrentMp(activeChar.getMaxMp()); + } + + private void clear (L2PcInstance player) + { + if(remove_buffs) + { + player.stopAllEffects(); + if(remove_pets) + { + L2Summon pet = player.getPet(); + if(pet!= null) + { + pet.stopAllEffects(); + pet.unSummon(player); + } + } + } + else + { + if(remove_pets) + { + L2Summon pet = player.getPet(); + if(pet!= null) + { + pet.unSummon(player); + } + } + } + } + + public static void givereward(L2PcInstance player) + { + if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION)) + { + for (int[] reward : rewards) + { + PcInventory inv = player.getInventory(); + inv.addItem("Custom Reward", reward[0], reward[1], player, player); + } + } + } + + public static boolean checkItem (L2ItemInstance item) + { + int o = item.getItem().getCrystalType(); + int e = item.getEnchantLevel(); + + if(enchant != 0 && e >= enchant) + { + return false; + } + + if(grades.contains(gradeNames[o])) + return false; + + if(items != null && items.contains(""+item.getItemId())) + return false; + return true; + } + + private static void loadConfigs() + { + try + { + Properties prop = new Properties(); + prop.load(new FileInputStream(new File("./config/functions/PvPZone.properties"))); + pvp_enabled = Boolean.parseBoolean(prop.getProperty("EnablePvP", "False")); + spawn_loc = parseItemsList(prop.getProperty("SpawnLoc", "150111,144740,-12248")); + revive_delay = Integer.parseInt(prop.getProperty("ReviveDelay", "10")); + if(revive_delay != 0) + { + revive = true; + } + give_noblesse = Boolean.parseBoolean(prop.getProperty("GiveNoblesse", "False")); + String[] propertySplit = prop.getProperty("Items", "").split(","); + if (propertySplit.length != 0) + { + for(String i : propertySplit) + { + items.add(i); + } + } + propertySplit = prop.getProperty("Grades", "").split(","); + if (propertySplit.length != 0) + { + for(String i : propertySplit) + { + if(i.equals("D") || i.equals("C") || i.equals("B") || i.equals("A") || i.equals("S")) + grades.add(i); + } + } + propertySplit = prop.getProperty("Classes", "").split(","); + if (propertySplit.length != 0) + { + for(String i : propertySplit) + { + classes.add(i); + } + } + radius = Integer.parseInt(prop.getProperty("RespawnRadius", "500")); + enchant = Integer.parseInt(prop.getProperty("Enchant", "0")); + remove_buffs = Boolean.parseBoolean(prop.getProperty("RemoveBuffs", "False")); + remove_pets = Boolean.parseBoolean(prop.getProperty("RemovePets", "False")); + restart_zone = Boolean.parseBoolean(prop.getProperty("NoRestartZone", "False")); + store_zone = Boolean.parseBoolean(prop.getProperty("NoStoreZone", "False")); + logout_zone = Boolean.parseBoolean(prop.getProperty("NoLogoutZone", "False")); + revive_noblesse = Boolean.parseBoolean(prop.getProperty("ReviveNoblesse", "False")); + revive_heal = Boolean.parseBoolean(prop.getProperty("ReviveHeal", "False")); + propertySplit = prop.getProperty("Rewards", "57,100000").split(";"); + for (String reward : propertySplit) + { + String[] rewardSplit = reward.split(","); + if (rewardSplit.length == 2) + { + try + { + rewards.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])}); + } + catch (NumberFormatException nfe) + { + } + } + } + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + private static int[][] parseItemsList(String line) + { + final String[] propertySplit = line.split(";"); + if (propertySplit.length == 0) + return null; + + int i = 0; + String[] valueSplit; + final int[][] result = new int[propertySplit.length][]; + for (String value : propertySplit) + { + valueSplit = value.split(","); + if (valueSplit.length != 3) + { + return null; + } + + result[i] = new int[3]; + try + { + result[i][0] = Integer.parseInt(valueSplit[0]); + } + catch (NumberFormatException e) + { + return null; + } + try + { + result[i][1] = Integer.parseInt(valueSplit[1]); + } + catch (NumberFormatException e) + { + return null; + } + try + { + result[i][2] = Integer.parseInt(valueSplit[2]); + } + catch (NumberFormatException e) + { + return null; + } + i++; + } + return result; + } +} \ No newline at end of file Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java =================================================================== --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 1004) +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy) @@ -19,9 +19,11 @@ package com.l2jfrozen.gameserver.network.clientpackets; import com.l2jfrozen.Config; + import com.l2jfrozen.gameserver.model.L2Character; import com.l2jfrozen.gameserver.model.TradeList; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; +import com.l2jfrozen.gameserver.model.zone.type.L2PvPZone; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListBuy; @@ -106,7 +108,13 @@ player.sendPacket(ActionFailed.STATIC_PACKET); return; } - + + if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2PvPZone.store_zone) + { + player.sendPacket(new PrivateStoreManageListBuy(player)); + player.sendMessage("You cannot start store while inside Special PvP zone."); + return; + } TradeList tradeList = player.getBuyList(); tradeList.clear(); ----------------------------------------- Zone.xml ----------------------------------------- <zone id="61000" type="PvPZone" shape="NPoly" minZ="-4000" maxZ="-3000"> <stat name='noPeace' val='true'/> <spawn X='11468' Y='-24749' Z='-3646'/> <spawn X='9904' Y='-22846' Z='-3697'/> <spawn X='7889' Y='-22686' Z='-3684'/> <spawn X='5380' Y='-23475' Z='-3717'/> </zone> -------------------------------------------- ZoneDaTa.Sql Primeval Isle wharf ------------------------------------------- INSERT INTO `zone_vertices` VALUES ('61000', '0', '11880', '-25221'); INSERT INTO `zone_vertices` VALUES ('61000', '1', '10000', '-25073'); INSERT INTO `zone_vertices` VALUES ('61000', '2', '9319', '-24224'); INSERT INTO `zone_vertices` VALUES ('61000', '3', '5153', '-24258'); INSERT INTO `zone_vertices` VALUES ('61000', '4', '5125', '-22591'); INSERT INTO `zone_vertices` VALUES ('61000', '5', '9618', '-21319'); INSERT INTO `zone_vertices` VALUES ('61000', '6', '10993', '-22303'); INSERT INTO `zone_vertices` VALUES ('61000', '7', '12323', '-24775');