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 Development [L2J]
    • Sources
    • Addons & Mods
    • Tools
  • Lineage II Development [L2OFF]
    • Package Files
    • Mods & Extenders
    • Tools
  • Lineage II Client Development
    • Equipments
    • Npcs
    • Maps
    • Tools
  • Lineage II Bots & Tools
    • Bot Systems
    • Bot Scripts
    • Tools
  • Website Templates
  • DenArt Designs's Demo Updater

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
    • Buy Advertising Link #1
    • Private Servers
    • Buy Advertising Link #2
    • [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
  • Graphics/GFX Zone
  • VIP/SVIP/Donators Zone
  • MaxCheaters Corner
  • TEST's Topics
  • L2Classic Club's Just trying this thing out
  • Lineage 2 Revolution Club's Discussions
  • Lineage 2 Revolution Club's Tutorials
  • Lineage 2 Revolution Club's Request Help
  • DenArt Designs's Hello and welcome to my club!
  • DenArt Designs's News
  • `Kara for staff's Topics
  • `Kara for staff's Kara`

Product Groups

  • Advertisements
  • Special Groups

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 358 results

  1. Hello there.. Here is my buffer from my old server.. (Main html made by prwtoftw) What's inside? Mage | Fighter set [config] Buffs/Dance/Song/Extra etc one by one Special buffs + Malaria Vote buff [If you want it, you can enable it, config] Scheme Buffer Code Preview > [Hidden Content] Code/HTML/XML > [Hidden Content]
  2. Well, one friend asked to me to help him coding a simple "pvp zone" and then asked to me to add an item checker... etc So I coded a "MultiFunction", "AIO"... whatever... zone. Easy to modify, with configs... and I wanted to share it with you. Simply if you don't like it or you don't like me, don't spam here. We know that some of this features could be already shared over the net... blabla... But here are all together, are configurable and I think that it's 90% without bugs. Note: Default zone: Crystal Caverns Quickly enumeration of which configs it has: -Enable/Disable pvp flag on enter -Enable/Disable revive delay & set the time -Specify (unlimited) random respawns if revive enabled -Specify random respawn radius -Enable/Disable noblesse blessing on enter -Enable/Disable remove buffs on enter -Enable/Disable remove pets on enter -Specify special reward when hunting inside -Specify items that will be unequiped & blocked to use inside the zone -Specify items by grades that will be unequiped & blocked to use inside the zone -Specify an enchant level. Items with that level or more, will be unequiped & blocked to use inside the zone -Specify classes id's that won't be able to enter to this zone V.1.3 - 14/02/2013 Coded for l2jserver Freya. - Wyatt L2jServer Freya patch Addapted to l2jfrozen Interlude. - Wyatt L2jFrozen Interlude patch. Addapted to l2jserver H5 Beta, rev core:5639 datapack:9185. - Valanths L2jServer H5 Beta patch Addapted to l2jserver H5 Beta, rev core:6165 datapack:9909. - Valanths L2jServer H5 Beta patch Addapted to Acis, Changeset 309. - Tяαnce Acis patch Addapted to Acis, rev:299. - Dεbian Acis patch Credits: Wyatt
  3. Hi guys. I have just one question regarding core side and using the SQL statements to update/insert datas into the database. How could i implement the following query when a new character is created? ("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=login") I want that the new character that's created on the same account to have the botprev_fail_account value taken from the ACCOUNTS table and inserted into botprev_fail_account from CHARACTERS table. The account_name and login have the same value. The following code that i tried doesn't work: try (Connection con2 = DatabaseFactory.getConnection()) { PreparedStatement statement2 = con2.prepareStatement("UPDATE characters SET botprev_fail_account = (SELECT botprev_fail_account FROM accounts WHERE account_name=?"); statement2.setString(1, _accountName); statement2.executeUpdate(); statement2.close(); }
  4. Hello again Cheaters, nothing special again. I don't know why peoples asking for this kind of balancing but somebody ask me for it and i make it for him free so i decide to share it with all. (Coded/Tested in 20 minutes) Coded for aCis 385 but its easy to be adapted to any source. XML looks like : <?xml version='1.0' encoding='utf-8'?> <list> <!-- Type List : NORMAL, MAGIC, CRITICAL, M_CRITICAL, BLOW, PHYSICAL_SKILL_DAMAGE, PHYSICAL_SKILL_CRITICAL --> <balance type="NORMAL" class="SHILLIEN_TEMPLAR" target="CARDINAL" value="1.3"/> </list> Result: value="1.0" -> You hit for 875 damage. value="1.3" -> You hit for 1138 damage. Code : [Hidden Content]
  5. So here is the thing. There is a check for private sell stores that verifies if each of listed items has a corresponding item template. I checked most of projects out there and all had the same issue. Here is the code I refer to, nested in TradeList privateStoreBuy() method: // Check if requested item is available for manipulation L2ItemInstance oldItem = _owner.checkItemManipulation(item.getObjectId(), item.getCount(), "sell"); if (oldItem == null || !oldItem.isTradeable()) { // Private store sell invalid item - disable it lock(); return false; } final L2Item template = ItemTable.getInstance().getTemplate(item.getItemId()); if (template == null) { continue; } weight += item.getCount() * template.getWeight(); if (!template.isStackable()) { slots += item.getCount(); } else if (player.getInventory().getItemByItemId(item.getItemId()) == null) { slots++; } Object 'item', which happens to be an instance of ItemRequest class, is used for retrieving item template and checking whether there are items of the corresponding ID inside buyer's inventory, in the case of stackable items. What's really interesting is that this object has no Item ID. Private store sell listed items are usually distinct by Object ID instead. Here is another code I refer to, nested in RequestPrivateStoreBuy class: @Override protected void readImpl() { _storePlayerId = readD(); _count = readD(); if (_count < 0 || (_count * 12) > _buf.remaining() || _count > Config.MAX_ITEM_IN_PACKET) { _count = 0; } _items = new ItemRequest[_count]; for (int i = 0; i < _count; i++) { int objectId = readD(); long count = readD(); int price = readD(); if (objectId < 1 || count < 1 || count > Integer.MAX_VALUE || price < 0) { _items = null; return; } _items[i] = new ItemRequest(objectId, (int) count, price); } } And here is the conclusion. Private store sell never performs slot and weight checks at this point, since privateStoreBuy is searching for an item template using 0 as Item ID, therefore skipping rest of code inside loop. Finally, using L2ItemInstance oldItem object for doing those checks, instead of ItemRequest item would probably be enough to solve this issue. // Check if requested item is available for manipulation L2ItemInstance oldItem = _owner.checkItemManipulation(item.getObjectId(), item.getCount(), "sell"); if (oldItem == null || !oldItem.isTradeable()) { // Private store sell invalid item - disable it lock(); return false; } weight += item.getCount() * oldItem.getItem().getWeight(); if (!oldItem.isStackable()) { slots += item.getCount(); } else if (player.getInventory().getItemByItemId(oldItem.getItemId()) == null) { slots++; } Best regards, DnR
  6. Hello members, I made a useful search action only for gms in order to save some of your time while you want to search items (ids,actual names etc). (Its 15 min code since i copied Bookmarks code and edited it) write //search to open the html or //search {word} for directly search Coded in aCis 370 rev Video Code Html P.s Dont forget to add the commands in adminCommands.xml ps2. i didnt design the html cause im lazy. Edit: Updated by @StinkyMadness
  7. Hello again Cheaters i rework and redesign an already shared code of my friend @melron (Official code : HERE) - Using multi-word search. - Cleanup parts of the code. - Code not include part of "item.getIcon()" you can find many shared ways to get icon for each item. Updates: - Add idea/part of the code of @Creamy G Colin - Add check of empty seach (was throwing error on GS console) - Add info if its Quest Item Coded for aCis 385 revision Code : [Hidden Content]
  8. Color name - title system + Skill Reward coded on 374 acis . cheers package net.sf.l2j.gameserver.datatables; import net.sf.l2j.gameserver.templates.L2Pvp; import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import net.sf.l2j.gameserver.model.holder.IntIntHolder; import net.sf.l2j.gameserver.templates.StatsSet; import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory; import org.w3c.dom.*; public class PvpTable { public PvpTable() { } public static void load() { try { File f = new File("./data/xml/pvp.xml"); Document doc = XMLDocumentFactory.getInstance().loadDocument(f); Node n = doc.getFirstChild(); for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) if(d.getNodeName().equalsIgnoreCase("template")) { NamedNodeMap attrs = d.getAttributes(); int pvpAmount = Integer.valueOf(attrs.getNamedItem("pvp_amount").getNodeValue()).intValue(); int nameColor = Integer.decode((new StringBuilder()).append("0x").append(attrs.getNamedItem("name_color").getNodeValue()).toString()).intValue(); int titleColor = Integer.decode((new StringBuilder()).append("0x").append(attrs.getNamedItem("title_color").getNodeValue()).toString()).intValue(); String learnSkill = attrs.getNamedItem("learn_skill").getNodeValue().trim(); StatsSet set = new StatsSet(); set.set("pvp_amount", pvpAmount); set.set("name_color", nameColor); set.set("title_color", titleColor); L2Pvp template = new L2Pvp(set); if(learnSkill != null) { String property[] = learnSkill.split(";"); String as[] = property; int i = as.length; for(int j = 0; j < i; j++) { String data = as[j]; String holder[] = data.split(","); template.addLearnSkill(new IntIntHolder(Integer.parseInt(holder[0]), Integer.parseInt(holder[1]))); } } _templates.add(template); } } catch(Exception e) { _log.severe((new StringBuilder()).append("Exception: PvpTable load: ").append(e).toString()); } _log.info((new StringBuilder()).append("PvpTable: Loaded ").append(_templates.size()).append(" template(s).").toString()); } public static List<L2Pvp> getTemplate() { return _templates; } private static final Logger _log = Logger.getLogger(PvpTable.class.getName()); private static final List<L2Pvp> _templates = new ArrayList<>(); } package net.sf.l2j.gameserver.templates; import java.util.ArrayList; import java.util.List; import net.sf.l2j.gameserver.model.holder.IntIntHolder; import net.sf.l2j.gameserver.templates.StatsSet; public class L2Pvp { public L2Pvp(StatsSet set) { _pvpAmount = set.getInteger("pvp_amount"); _nameColor = set.getInteger("name_color"); _titleColor = set.getInteger("title_color"); } public int getPvpAmount() { return _pvpAmount; } public int getNameColor() { return _nameColor; } public int getTitleColor() { return _titleColor; } public List<IntIntHolder> getLearnSkills() { return _learnSkill; } public void addLearnSkill(IntIntHolder holder) { _learnSkill.add(holder); } private final int _pvpAmount; private final int _nameColor; private final int _titleColor; private final List<IntIntHolder> _learnSkill = new ArrayList<>(); } Open : Gameserver.java add somewhere this : PvpTable.load(); Open : Player.java add somewhere this : public static void updatePvp(Player player) { for(Iterator<L2Pvp> iterator = PvpTable.getTemplate().iterator(); iterator.hasNext();) { L2Pvp template = iterator.next(); if(template.getPvpAmount() <= player.getPvpKills()) { player.getAppearance().setNameColor(template.getNameColor()); player.getAppearance().setTitleColor(template.getTitleColor()); Iterator<IntIntHolder> iterator1 = template.getLearnSkills().iterator(); while(iterator1.hasNext()) { IntIntHolder holder = iterator1.next(); net.sf.l2j.gameserver.model.L2Skill skill = SkillTable.getInstance().getInfo(holder.getId(), holder.getValue()); if(skill != null) player.addSkill(skill, false); } } } player.broadcastUserInfo(); } find in Player.java below this line setPvpKills(getPvpKills() + 1); add -> updatePvp(this); find : public boolean setActiveClass(int classIndex) under this line restoreSkills(); add - > updatePvp(this); find : public void onPlayerEnter() add somewhere under : updatePvp(this); XML : loc : data/xml/pvp.xml <?xml version='1.0' encoding='utf-8'?> <list> <!-- <template pvp_amount="100" name_color="FFAA00" title_color="FFFF77" learn_skill="0,0;" /> --> <template pvp_amount="5" name_color="FFAA00" title_color="FFFF77" learn_skill="0,0;" /> </list>
  9. Hello, cheaters. - Nothing really new or unique, an simple panel that create list with pages for the droplist of Monster/Raidboss. - Simple addon : Player can choose to avoid specific item from the droplist. - Code not include part of "item.getIcon()" you can find many shared ways to get icon for each item. Preview : Code : [Hidden Content]
  10. I come to share something I did for my server. improvements please can comment, please remove the part of Event code : https://pastebin.com/raw/Xa9dU7zd
  11. Hello folks. I have a really simple client patch for an interactive raid boss map demo which I decided to share. Map includes zoom, panning, and search control. It can also be adapted in a website using any size. Raid bosses are displayed as markers (blue for alive, red for dead) and users can hover those markers to see boss status and respawn time. It also uses gameserver-equivalent world dimensions, so there is no need for trying to set markers on map manually. I have included a small PHP script for local test purposes in order to retrieve data from database using an ajax request. Few screenshots Link 1 Link 2 Default functionality is for C4, but I have included map overlays for C5 and Interlude. Have fun, DnR
  12. Hello young people, Here is a simple protection. In -> l2jserver/gameserver/model/zone/type/L2SiegeZone.java method -> onExit(L2Character character) Add: + //If you leave the siege zone, ward returns to the castle. + if (character instanceof L2PcInstance && ((L2PcInstance)character).isCombatFlagEquipped() + && TerritoryWarManager.getInstance().isTWInProgress()) +
  13. Hello young people, Here is a simple protection. Block skill use equipped ward during territory war. In -> l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java method -> runImpl() search for: // Check the validity of the skill if (skill != null) { Add: + if (activeChar.isInSiege()) + { + //Block Shadow Step, Blink and Warp with Ward + if (skill.getId() == 628 || skill.getId() == 1448 || skill.getId() == 821) + { + //check player equiped ward + if (activeChar.isCombatFlagEquipped()) + { + activeChar.sendMessage("not use skill with a ward!"); + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + } + }
  14. Hello young people, Here is a simple protection. in -> l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java method -> runImpl() search for: // Check the validity of the skill if (skill != null) { Add: + if (activeChar.isInSiege()) + { + //Proibe Ress em Sieges + if (skill.getId() == 1016 || skill.getId() == 1254) + { + activeChar.sendMessage("Não é possivel utilizar " + skill.getName() + " durante a Siege!"); + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + return; + } + }
  15. Hello Friends, well here I come to share the event of PC Bang Point Interlude DP: L2JaCis REV: 354 Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 9) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy) @@ -164,6 +164,7 @@ import net.sf.l2j.gameserver.network.serverpackets.ExFishingEnd; import net.sf.l2j.gameserver.network.serverpackets.ExFishingStart; import net.sf.l2j.gameserver.network.serverpackets.ExOlympiadMode; +import net.sf.l2j.gameserver.network.serverpackets.ExPCCafePointInfo; import net.sf.l2j.gameserver.network.serverpackets.ExSetCompassZoneCode; import net.sf.l2j.gameserver.network.serverpackets.ExStorageMaxCount; import net.sf.l2j.gameserver.network.serverpackets.FriendList; @@ -311,8 +312,8 @@ private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?"; private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,nobless,power_grade,last_recom_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; - private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?"; - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?"; + private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,pc_point=? WHERE obj_id=?"; + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,pc_point FROM characters WHERE obj_id=?"; private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC"; private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)"; @@ -376,6 +377,8 @@ private PcAppearance _appearance; + private int pcBangPoint = 0; + private long _expBeforeDeath; private int _karma; private int _pvpKills; @@ -5324,6 +5327,8 @@ player.setOnlineTime(rset.getLong("onlinetime")); player.setNoble(rset.getInt("nobless") == 1, false); + player.pcBangPoint = rset.getInt("pc_point"); + player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time")); if (player.getClanJoinExpiryTime() < System.currentTimeMillis()) player.setClanJoinExpiryTime(0); @@ -5747,7 +5752,8 @@ statement.setLong(47, getClanCreateExpiryTime()); statement.setString(48, getName()); statement.setLong(49, getDeathPenaltyBuffLevel()); - statement.setInt(50, getObjectId()); + statement.setInt(50, getPcBangScore()); + statement.setInt(51, getObjectId()); statement.execute(); statement.close(); @@ -10564,4 +10570,33 @@ teleToLocation(0, 0, 0, 0); sendMessage("Error with your coords, Please ask a GM for help!"); } + + public int getPcBangScore() + { + return pcBangPoint; + } + + public void reducePcBangScore(int to) + { + pcBangPoint -= to; + updatePcBangWnd(to, false, false); + } + + public void addPcBangScore(int to) + { + pcBangPoint += to; + } + + public void updatePcBangWnd(int score, boolean add, boolean duble) + { + ExPCCafePointInfo wnd = new ExPCCafePointInfo(this, score, add, 24, duble); + sendPacket(wnd); + } + + public void showPcBangWindow() + { + ExPCCafePointInfo wnd = new ExPCCafePointInfo(this, 0, false, 24, false); + sendPacket(wnd); + } + } \ No newline at end of file Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 9) +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -227,6 +227,8 @@ activeChar.onPlayerEnter(); + activeChar.showPcBangWindow(); + sendPacket(new SkillCoolTime(activeChar)); // If player logs back in a stadium, port him in nearest town. Index: java/net/sf/l2j/gameserver/network/serverpackets/ExPCCafePointInfo.java =================================================================== --- java/net/sf/l2j/gameserver/network/serverpackets/ExPCCafePointInfo.java (revision 9) +++ java/net/sf/l2j/gameserver/network/serverpackets/ExPCCafePointInfo.java (working copy) @@ -1,46 +1,75 @@ -/* - * 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 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * http://www.gnu.org/copyleft/gpl.html */ package net.sf.l2j.gameserver.network.serverpackets; -/** - * Format: ch ddcdc - * @author KenM - */ +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; + public class ExPCCafePointInfo extends L2GameServerPacket { - private final int _score, _modify, _periodType, _remainingTime; - private int _pointType = 0; + private static final String _S__FE_31_EXPCCAFEPOINTINFO = "[S] FE:31 ExPCCafePointInfo"; + private L2PcInstance _character; + private int m_AddPoint; + private int m_PeriodType; + private int RemainTime; + private int PointType; - public ExPCCafePointInfo(int score, int modify, boolean addPoint, boolean pointType, int remainingTime) + public ExPCCafePointInfo(L2PcInstance user, int modify, boolean add, int hour, boolean _double) { - _score = score; - _modify = addPoint ? modify : modify * -1; - _remainingTime = remainingTime; - _pointType = addPoint ? (pointType ? 0 : 1) : 2; - _periodType = 1; // get point time + _character = user; + m_AddPoint = modify; + + if (add) + { + m_PeriodType = 1; + PointType = 1; + } + else + { + if (add && _double) + { + m_PeriodType = 1; + PointType = 0; + } + else + { + m_PeriodType = 2; + PointType = 2; + } + } + + RemainTime = hour; } - + @Override protected void writeImpl() { writeC(0xFE); writeH(0x31); - writeD(_score); - writeD(_modify); - writeC(_periodType); - writeD(_remainingTime); - writeC(_pointType); + writeD(_character.getPcBangScore()); + writeD(m_AddPoint); + writeC(m_PeriodType); + writeD(RemainTime); + writeC(PointType); + } + + @Override + public String getType() + { + return _S__FE_31_EXPCCAFEPOINTINFO; } } \ No newline at end of file Index: java/net/sf/l2j/gameserver/scripting/scripts/custom/PcPoint.java =================================================================== --- java/net/sf/l2j/gameserver/scripting/scripts/custom/PcPoint.java (revision 0) +++ java/net/sf/l2j/gameserver/scripting/scripts/custom/PcPoint.java (revision 0) @@ -0,0 +1,58 @@ +/* + * 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 net.sf.l2j.gameserver.scripting.scripts.custom; + +import net.sf.l2j.commons.random.Rnd; +import net.sf.l2j.gameserver.datatables.NpcTable; +import net.sf.l2j.gameserver.model.actor.L2Npc; +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; +import net.sf.l2j.gameserver.scripting.Quest; + +public class PcPoint extends Quest +{ + public PcPoint() + { + super(-1, "custom"); + for (NpcTemplate t : NpcTable.getInstance().getTemplates(t -> t.isType("L2Monster"))) + { + addKillId(t.getIdTemplate()); + } + } + + @Override + public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) + { + if ((killer.getLevel() >= 75) && (npc.getLevel() < 60)) + { + return ""; + } + int score = 0; + score = Rnd.get(100, 250); + killer.addPcBangScore(score); + killer.updatePcBangWnd(score, true, false); + return super.onKill(npc, killer, isPet); + } + + public static void main(String[] arg) + { + new PcPoint(); + } + +} \ No newline at end of file Index: data/xml/scripts.xml =================================================================== --- data/xml/scripts.xml (revision 9) +++ data/xml/scripts.xml (working copy) @@ -361,7 +361,8 @@ <script path="scripts.custom.NpcLocationInfo"/> <script path="scripts.custom.HeroCirclet"/> <script path="scripts.custom.HeroWeapon"/> - + <script path="scripts.custom.PcPoint"/> + <!-- Events --> <!-- <script path="scripts.events.GiftOfVitality"/> --> Index: sql/characters.sql =================================================================== --- sql/characters.sql (revision 9) +++ sql/characters.sql (working copy) @@ -54,6 +54,7 @@ `clan_join_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0, `clan_create_expiry_time` BIGINT UNSIGNED NOT NULL DEFAULT 0, `death_penalty_level` SMALLINT UNSIGNED NOT NULL DEFAULT 0, + `pc_point` int (1) NOT NULL DEFAULT 0, PRIMARY KEY (obj_Id), KEY `clanid` (`clanid`) ); \ No newline at end of file
  16. Auto pvp Announce http://pastebin.com/prCgqNHU otan kapios pari kapia kill sinexomena xoris na pe8ani tote o server bgazi anakinosi gia ton paixti poy pire ta sinexomena pvp + to posa pvp pire
  17. Good night, I come to share a code that I made for my project, I will give a simple tutorial how to use the music part of it. Code: https://pastebin.com/raw/ezfEX1kJ Well I made the code simple and very easy to edit, you only need to edit in one place to add messages, music, PVP amount !! The format is PVP, Message and Music quantity. PVP amount = 2 Generated Message = Double Kill Music = "" here the music. DOUBLE_KILL (2, "Double Kill", "YOUR MUSIC"), The song is on you, I hope you like it and don't forget to like it. here is version 2 in xml and totally redone by Tryskell's tips thanks to @StinkyMadness for the idea of creating in xml Version 2 : https://pastebin.com/raw/5cwXuTTc Credits for the idea @Kara` Unfinished credits @Williams ATTENTION : I'm sorry for some BR messages
  18. As the title say i will share with you one password manager for Acis 370. Credits: Sweets( Ive just made the imports right and the necessary changes in case that someone didnt know and have problem). Go to : net.sf.l2j.gameserver.model.actor.instance and create a new class with name: L2PasswordInstance /* * 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 net.sf.l2j.gameserver.model.actor.instance; import java.security.MessageDigest; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Base64; import java.util.StringTokenizer; import net.sf.l2j.commons.concurrent.ThreadPool; import net.sf.l2j.L2DatabaseFactory; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; import net.sf.l2j.gameserver.network.serverpackets.SystemMessage; /** * @author SweeTs */ public class L2PasswordInstance extends Folk { public L2PasswordInstance(int objectId, NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(Player player, String command) { if (command.startsWith("change_password")) { StringTokenizer st = new StringTokenizer(command); st.nextToken(); String newPass = ""; String repeatNewPass = ""; try { if (st.hasMoreTokens()) { newPass = st.nextToken(); repeatNewPass = st.nextToken(); } } catch (Exception e) { player.sendMessage("Please fill all the blanks before requesting for a password change."); return; } if (!conditions(newPass, repeatNewPass, player)) return; changePassword(newPass, repeatNewPass, player); } } private static boolean conditions(String newPass, String repeatNewPass, Player player) { if (newPass.length() < 3) { player.sendMessage("The new password is too short!"); return false; } else if (newPass.length() > 45) { player.sendMessage("The new password is too long!"); return false; } else if (!newPass.equals(repeatNewPass)) { player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PASSWORD_ENTERED_INCORRECT2)); return false; } return true; } @Override public void showChatWindow(Player activeChar) { final NpcHtmlMessage html = new NpcHtmlMessage(0); final StringBuilder sb = new StringBuilder(); sb.append("<html><title>Account Manager</title>"); sb.append("<body><center>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>"); sb.append("New password: <edit var=\"new\" width=100 height=15><br>"); sb.append("Repeat: <edit var=\"repeatnew\" width=100 height=15><br>"); sb.append("<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><br>"); sb.append("<a action=\"bypass -h npc_%objectId%_change_password $new $repeatnew\">Change password</a>"); sb.append("</center></body></html>"); html.setHtml(sb.toString()); html.replace("%objectId%", getObjectId()); activeChar.sendPacket(html); } private static void changePassword(String newPass, String repeatNewPass, Player activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?")) { byte[] newPassword = MessageDigest.getInstance("SHA").digest(newPass.getBytes("UTF-8")); ps.setString(1, Base64.getEncoder().encodeToString(newPassword)); ps.setString(2, activeChar.getAccountName()); ps.executeUpdate(); activeChar.sendMessage("Congratulations! Your password has been changed. You will now be disconnected for security reasons. Please login again."); ThreadPool.schedule(() -> activeChar.logout(false), 3000); } catch (Exception e) { _log.warning("There was an error while updating account:" + e); } } } After you are passing this the only thing that you have to do is create a new npc with type: L2Password. HAVE A NICE DAY GUYS :)
  19. Good evening, I come to share a code that I made for my project. Code : https://pastebin.com/raw/sWbUMqiG Good as I do not like to use these ready made codes I made this, as aCis is clean and light, I will explain how to use my code. I took Draconic as an example. <item id="7575" type="Weapon" name="Draconic Bow"> <set name="icon" val="icon.weapon_draconic_bow_i00" /> <set name="default_action" val="equip" /> <set name="weapon_type" val="BOW" /> <set name="bodypart" val="lrhand" /> <set name="random_damage" val="5" /> <set name="attack_range" val="500" /> <set name="damage_range" val="0;0;10;0" /> <set name="crystal_count" val="2440" /> <set name="crystal_type" val="S" /> <set name="material" val="ADAMANTAITE" /> <set name="weight" val="1650" /> <set name="price" val="48800000" /> <set name="soulshots" val="1" /> <set name="spiritshots" val="1" /> <set name="mp_consume" val="11" /> <set name="reuse_delay" val="1500" /> <cond msgId="1518"> <and> <player classId="SAGGITARIUS" /> </and> </cond> <for> <set order="0x08" stat="pAtk" val="581" /> <set order="0x08" stat="mAtk" val="132" /> <set order="0x08" stat="rCrit" val="12" /> <sub order="0x10" stat="accCombat" val="3" /> <set order="0x08" stat="pAtkSpd" val="293" /> <enchant val="0" order="0x0C" stat="pAtk" /> <enchant val="0" order="0x0C" stat="mAtk" /> </for> </item> Here you block to other classes, so only a certain class can use. <cond msgId="1518"> <and> <player classId="DUELIST" /> </and> </cond> when another class tries to use the bow !!
  20. I come to share a code that I made. It is intended for clan leaders to leave a message for their members. código : https://pastebin.com/raw/YACt3bjn Add this to your system in commandname-e.dat 115 114 notice htm message by clan owner message if a member tries to create a news story
  21. Event Demo Procure por commandname-e em seu sistema e adicione no final dele 115 114 register 116 115 unregister /** restrictions for event */ * Cannot Potion in Event. * Cannot Summon in Event. * Cannot Restart in Event. * Cannot Logout in Event. * Cannot attack same team. code v1 : https://pastebin.com/YRaCbU9T code v2 : * added event prize name announcement. Thank you @StinkyMadness * CopyOnWriteArrayList moved to ConcurrentHashMap.newKeySet, for better performance. Thank you @Tryskell * TVT_DOOR_LIST moved to getProperty and removed arrays. Thank you @Tryskell * Removed useless calls * added weather message for next event when coming into play. Thank you @ edusz93 for the idea Código v2 : https://pastebin.com/raw/59jyZa14 Autor do novo evento Williams Autor do código original DnR
  22. 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>
  23. +++ 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
  24. Hello again cheaters. - An simple limit zone for the raidbosses. (Works as "Anti-Take-Away" the Raidbosses) - You can use the @melron code to create easy that zones (Code Here ). - I know can be done with just the boss spawn location and threadpool but i prefer use zone for it. Code : [Hidden Content]
  25. Hello, i was searching for this command but i didnt found it in our forum so i decided to share it, below you can preview the html's How to install it? EASY: 1. GameServer\data\html\mods (add here the repair FOLDER not only the files) 2. GameServer\data\scripts\handlers\voicedcommandhandlers (only the file Repair.java) (dont forget to edit your masterhandler.java script) [Hidden Content] Credits: Szponiasty