1. Гость, мы просим Вас ознакомиться с Правилами Форума и Отказом от ответственности!

[core]Модификации Java серверов

Тема в разделе 'LineAge 2', создана пользователем MrPassion, 4 янв 2013.

  1. TopicStarter Overlay

    MrPassion Пользователи

    Сообщения:
    30
    Лайки:
    6
    Пол:
    Мужской
    Репутация:
    0
    Команда:
    Passion Ea
    тапком по голове не бить но всё же база имеет куда больше мануалов и вот я снова их немного ограбил
    Это базовая и простая банковская система. Она очень простая:
    Работает со следующими коммандами:
    .bank
    .deposit
    .withdraw
    .bank - Даёт инфу о банковской системе
    .deposit - Будет менять Х адены на У голд бар
    .withdraw - Будет делать обратное действие

    Вы можете расширить её, как вам нравится, или полностью игнорировать ее, либо использовать ее в качестве справочного материала для чего-то большего.

    Код:
    Index: java/config/l2jmods.properties
    ===================================================================
    --- java/config/l2jmods.properties	  (revision 1791)
    +++ java/config/l2jmods.properties	  (working copy)
    @@ -138,3 +138,13 @@
    # ex.: 1;2;3;4;5;6
    # no ";" at the start or end
    TvTEventDoorsCloseOpenonstartEnd =
    +
    +#---------------------------------------------------------------
    +# L2J Banking System																			  -
    +#---------------------------------------------------------------
    +# To enable banking system set this value to true, default is false.
    +BankingEnabled = false
    +# This is the amount of Goldbars someone will get when they do the .deposit command, and also the same amount they will lose when they do .withdraw
    +BankingGoldbarCount = 1
    +# This is the amount of Adena someone will get when they do the .withdraw command, and also the same amount they will lose when they do .deposit
    +BankingAdenaCount = 500000000
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java (revision 1791)
    +++ java/net/sf/l2j/Config.java (working copy)
    @@ -529,6 +529,9 @@
    public static boolean  L2JMOD_WEDDING_SAMESEX;
    public static boolean  L2JMOD_WEDDING_FORMALWEAR;
    public static int			  L2JMOD_WEDDING_DIVORCE_COSTS;
    +	   public static boolean   BANKING_SYSTEM_ENABLED;
    +	   public static int			   BANKING_SYSTEM_GOLDBARS;
    +	   public static int			   BANKING_SYSTEM_ADENA;
    
    /** ************************************************** **/
    /** L2JMods Settings -End														 **/
    @@ -1676,6 +1679,10 @@
    }
    }
    }
    +							  
    +							   BANKING_SYSTEM_ENABLED  = Boolean.parseBoolean(L2JModSettings.getProperty("BankingEnabled", "false"));
    +							   BANKING_SYSTEM_GOLDBARS = Integer.parseInt(L2JModSettings.getProperty("BankingGoldbarCount", "1"));
    +							   BANKING_SYSTEM_ADENA    = Integer.parseInt(L2JModSettings.getProperty("BankingAdenaCount", "500000000"));
    
    }
    catch (Exception e)
    Index: java/net/sf/l2j/gameserver/GameServer.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/GameServer.java  (revision 1791)
    +++ java/net/sf/l2j/gameserver/GameServer.java  (working copy)
    @@ -197,6 +197,7 @@
    import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat;
    import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
    import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
    +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking;
    import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
    import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
    import net.sf.l2j.gameserver.idfactory.IdFactory;
    @@ -618,9 +619,10 @@
    if(Config.L2JMOD_ALLOW_WEDDING)
    _voicedCommandHandler.registerVoicedCommandHandler(new Wedding());
    
    +			   if(Config.BANKING_SYSTEM_ENABLED)
    +					   _voicedCommandHandler.registerVoicedCommandHandler(new Banking());
    +			  
    _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
    -
    -			  
    
    if(Config.L2JMOD_ALLOW_WEDDING)
    CoupleManager.getInstance();
    Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java	   (revision 0)
    +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Banking.java	   (revision 0)
    @@ -0,0 +1,73 @@
    +/*
    + * 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.handler.voicedcommandhandlers;
    +
    +import net.sf.l2j.Config;
    +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    +import net.sf.l2j.gameserver.serverpackets.InventoryUpdate;
    +
    +/**
    + * This class trades Gold Bars for Adena and vice versa.
    + *
    + * @author Ahmed
    + */
    +public class Banking implements IVoicedCommandHandler
    +{
    +	   private static String[] _voicedCommands = { "bank", "withdraw", "deposit" };
    +
    +	   public boolean useVoicedCommand(String command, L2PcInstance activeChar,
    +					   String target)
    +	   {
    +			   if (command.equalsIgnoreCase("bank"))
    +			   {
    +					   activeChar.sendMessage(".deposit (" + Config.BANKING_SYSTEM_ADENA + " Adena = " + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar) / .withdraw (" + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar = " + Config.BANKING_SYSTEM_ADENA + " Adena)");
    +			   } else if (command.equalsIgnoreCase("deposit"))
    +			   {
    +					   if (activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.BANKING_SYSTEM_ADENA)
    +					   {
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   activeChar.getInventory().reduceAdena("Goldbar", Config.BANKING_SYSTEM_ADENA, activeChar, null);
    +							   activeChar.getInventory().addItem("Goldbar", 3470, Config.BANKING_SYSTEM_GOLDBARS, activeChar, null);
    +							   activeChar.getInventory().updateDatabase();
    +							   activeChar.sendPacket(iu);
    +							   activeChar.sendMessage("Thank you, you now have " + Config.BANKING_SYSTEM_GOLDBARS + " Goldbar(s), and " + Config.BANKING_SYSTEM_ADENA + " less adena.");
    +					   } else
    +					   {
    +							   activeChar.sendMessage("You do not have enough Adena to convert to Goldbar(s), you need " + Config.BANKING_SYSTEM_ADENA + " Adena.");
    +					   }
    +			   } else if (command.equalsIgnoreCase("withdraw"))
    +			   {
    +					   if (activeChar.getInventory().getInventoryItemCount(3470, 0) >= Config.BANKING_SYSTEM_GOLDBARS)
    +					   {
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   activeChar.getInventory().destroyItemByItemId("Adena", 3470, Config.BANKING_SYSTEM_GOLDBARS, activeChar, null);
    +							   activeChar.getInventory().addAdena("Adena", Config.BANKING_SYSTEM_ADENA, activeChar, null);
    +							   activeChar.getInventory().updateDatabase();
    +							   activeChar.sendPacket(iu);
    +							   activeChar.sendMessage("Thank you, you now have " + Config.BANKING_SYSTEM_ADENA + " Adena, and " + Config.BANKING_SYSTEM_GOLDBARS + " less Goldbar(s).");
    +					   } else
    +					   {
    +							   activeChar.sendMessage("You do not have any Goldbars to turn into " + Config.BANKING_SYSTEM_ADENA + " Adena.");
    +					   }
    +			   }
    +			   return true;
    +	   }
    +
    +	   public String[] getVoicedCommandList()
    +	   {
    +			   return _voicedCommands;
    +	   }
    +}
    \ No newline at end of file[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Hero skills для всех сабов

    Код:
    java/net/sf/l2j/gameserver/model/actor/instance/l2pcinstance.java[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]8901.
    public void setHero(boolean hero)
    {
    if (hero && _baseClass == _activeClass)
    {
    for (L2Skill s : HeroSkillTable.getHeroSkills())
    addSkill(s, false); //Dont Save Hero skills to database
    }
    else
    {
    for (L2Skill s : HeroSkillTable.getHeroSkills())
    super.removeSkill(s); //Just Remove skills from nonHero characters
    }
    _hero = hero;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]sendSkillList();
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]To:[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]public void setHero(boolean hero)
    {
    if (hero)
    {
    for (L2Skill s : HeroSkillTable.getHeroSkills())
    addSkill(s, false); //Dont Save Hero skills to database
    }
    else
    {
    for (L2Skill s : HeroSkillTable.getHeroSkills())
    super.removeSkill(s); //Just Remove skills from nonHero characters
    }
    _hero = hero;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]sendSkillList();
    }
    


    Вещь для получения геройства после рестарта

    Код:
    По адресу net.sf.l2j.gameserver.handler.itemhandlers создаем новый файл под названием HeroItem.java
    /*
    * 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.handler.itemhandlers;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]import net.sf.l2j.gameserver.handler.IItemHandler;
    import net.sf.l2j.gameserver.model.L2ItemInstance;
    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]/**
    *
    * @author  HanWik
    */
    public class HeroItem implements IItemHandler
    {
    private static final int[] ITEM_IDS = { YOUR ITEM ID - replace here };[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]   public void useItem(L2PlayableInstance playable, L2ItemInstance item)
    {
    if (!(playable instanceof L2PcInstance))
    return;
    L2PcInstance activeChar = (L2PcInstance)playable;
    int itemId = item.getItemId();
    
    if (itemId = Айди вашей вещи здесь!) // Вещь что бы стать героем
    {
    activeChar.setHero(true);
    activeChar.broadcastUserInfo();
    }
    }
    
    /**
    * @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds()
    */
    public int[] getItemIds()
    {
    return ITEM_IDS;
    }
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]Открываем GameServer.java и добавляем это :
    import net.sf.l2j.gameserver.handler.itemhandlers.Harvester;
    на
    import net.sf.l2j.gameserver.handler.itemhandlers.HeroItem;
    import net.sf.l2j.gameserver.handler.itemhandlers.Maps;[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]_itemHandler.registerItemHandler(new BeastSpice());
    на  _itemHandler.registerItemHandler(new HeroItem());[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Если вы хотите поставить запрет на ношение оружия или предметов (к примеру Дестр с луком) Вы можете юзать этот скрипт.
    Вы должны вставить в network/clientpackets/UseItem.java следующие строки:

    Код:
    f (item.isEquipable())
    {
    if (activeChar.isDisarmed())
    return;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]					    if (!((L2Equip) item.getItem()).allowEquip(activeChar))
    {
    activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
    return;
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]					    //Begining the script
    +					   if (activeChar.getClassId().getId() == 88)
    +					   {
    +							   if (item.getItemType() == L2ArmorType.MAGIC)
    +							   {
    +									   activeChar.sendPacket(new +SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
    +									   return;
    +							   }	  
    +					   }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]К примеру Глад и Роба Армор.
    Если вы хотите зделать это с каким то оружием то поменяйте эту строку
    if (item.getItemType() == L2ArmorType.MAGIC)[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]на
    if (item.getItemType() == L2WeaponType.DAGGER)[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]the available class-ids and item types are listed below.[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]Что бы избежать юзанья бага с саб классом я использую этот скрип что бы обезвредить всё оружие и доспехи с заменой класса.
    model/actor/instance/L2PcInstance.java
    /**
    * Changes the character's class based on the given class index.
    * <BR><BR>
    * An index of zero specifies the character's original (base) class,
    * while indexes 1-3 specifies the character's sub-classes respectively.
    * 
    * @param classIndex
    */
    public boolean setActiveClass(int classIndex)
    {
    +			   L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
    +			   if (chest != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance head = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
    +			   if (head != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(head.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance gloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
    +			   if (gloves != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(gloves.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance feet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
    +			   if (feet != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(feet.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance legs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
    +			   if (legs != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(legs.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance rhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
    +			   if (rhand != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(rhand.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }
    +			  
    +			   L2ItemInstance lhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
    +			   if (lhand != null)
    +			   {
    +					  
    +							   L2ItemInstance[] unequipped = +getInventory().unEquipItemInBodySlotAndRecord(lhand.getItem().getBodyPart());
    +							   InventoryUpdate iu = new InventoryUpdate();
    +							   for (L2ItemInstance element : unequipped)
    +									   iu.addModifiedItem(element);
    +							   sendPacket(iu);
    +					  
    +			   }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]Что бы вам было проще:
    Class ID-s: Item types
    HUMANS
    -- 0=Human Fighter | 1=Warrior | 2=Gladiator | 3=Warlord | 4=Human Knight
    -- 5=Paladin | 6=Dark Avenger | 7=Rogue | 8=Treasure Hunter | 9=Hawkeye
    -- 10=Human Mystic | 11=Wizard | 12=Sorcerer/ss | 13=Necromancer | 14=Warlock
    -- 15=Cleric | 16=Bishop | 17=Prophet[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- ELVES
    -- 18=Elven Fighter | 19=Elven Knight | 20=Temple Knight | 21=Swordsinger | 22=Elven Scout
    -- 23=Plainswalker | 24=Silver Ranger | 25=Elven Mystic | 26=Elven Wizard | 27=Spellsinger
    -- 28=Elemental Summoner | 29=Elven Oracle | 30=Elven Elder[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- DARK ELVES
    -- 31=Dark Fighter | 32=Palus Knight | 33=Shillien Knight | 34=Bladedancer | 35=Assassin
    -- 36=Abyss Walker | 37=Phantom Ranger | 38=Dark Mystic | 39=Dark Wizard | 40=Spellhowler
    -- 41=Phantom Summoner | 42=Shillien Oracle | 43=Shillien Elder[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- ORCS
    -- 44=Orc Fighter | 45=Orc Raider | 46=Destroyer | 47=Monk | 48=Tyrant
    -- 49=Orc Mystic | 50=Orc Shaman | 51=Overlord | 52=Warcryer[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- DWARVES
    -- 53=Dwarven Fighter | 54=Scavenger | 55=Bounty Hunter | 56=Artisan | 57=Warsmith[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- HUMANS 3rd Professions
    -- 88=Duelist | 89=Dreadnought | 90=Phoenix Knight | 91=Hell Knight | 92=Sagittarius
    -- 93=Adventurer | 94=Archmage | 95=Soultaker | 96=Arcana Lord | 97=Cardinal
    -- 98=Hierophant[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- ELVES 3rd Professions
    -- 99=Evas Templar | 100=Sword Muse | 101=Wind Rider | 102=Moonlight Sentinel
    -- 103=Mystic Muse | 104=Elemental Master | 105=Evas Saint[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- DARK ELVES 3rd Professions
    -- 106=Shillien Templar | 107=Spectral Dancer | 108=Ghost Hunter | 109=Ghost Sentinel
    -- 110=Storm Screamer | 111=Spectral Master | 112=Shillien Saint[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- ORCS 3rd Professions
    -- 113=Titan | 114=Grand Khavatari
    -- 115=Dominator | 116=Doomcryer[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- DWARVES 3rd Professions
    -- 117=Fortune Seeker | 118=Maestro[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-- KAMAELS
    -- 123=Male Soldier | 124=Female Soldier | 125=Trooper | 126=Warder
    -- 127=Berserker | 128=Male Soul Breaker | 129=Female Soul Breaker | 130=Arbalester
    -- 131=Doombringer | 132=Male Soul Hound | 133=Female Soul Hound | 134=Trickster
    -- 135=Inspector | 136=Judicator -Weapons-
    NONE (Shield)
    SWORD
    BLUNT
    DAGGER
    BOW
    POLE
    ETC
    FIST
    DUAL
    DUALFIST
    BIGSWORD (Two Handed Swords)
    PET
    ROD
    BIGBLUNT (Two handed blunt)
    ANCIENT_SWORD
    CROSSBOW
    RAPIER[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]-Armors-
    HEAVY
    LIGHT
    MAGIC[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Решение со Лже Гмами.
    Этот патч позволит вам банить гма если он будет пытаться дать права тому кто не гм.

    Код:
    Index: D:/Workspace/GameServer_Clean/java/config/options.properties
    ===================================================================
    --- D:/Workspace/GameServer_Clean/java/config/options.properties	    (revision 708)
    +++ D:/Workspace/GameServer_Clean/java/config/options.properties	    (working copy)
    @@ -168,6 +168,8 @@
    L2WalkerRevision   = 552
    # Ban account if account using l2walker and is not GM, AllowL2Walker = False
    AutobanL2WalkerAcc = False
    +# Ban Edited Player and Corrupt GM if a GM edits a NON GM character.
    +GMEdit = False
    
    
    # =================================================================
    Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java
    ===================================================================
    --- D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java   (revision 708)
    +++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/Config.java   (working copy)
    @@ -520,6 +520,9 @@
    public static boolean		   AUTOBAN_L2WALKER_ACC;
    /** Revision of L2Walker */
    public static int					   L2WALKER_REVISION;
    +	  
    +	   /** GM Edit allowed on Non Gm players? */
    +	   public static boolean			 GM_EDIT;
    
    /** Allow Discard item ?*/
    public static boolean		   ALLOW_DISCARDITEM;
    @@ -1127,6 +1130,7 @@
    ALLOW_L2WALKER_CLIENT			 = L2WalkerAllowed.valueOf(optionsSettings.getProperty("AllowL2Walker", "False"));
    L2WALKER_REVISION						 = Integer.parseInt(optionsSettings.getProperty("L2WalkerRevision", "537"));
    AUTOBAN_L2WALKER_ACC				   = Boolean.valueOf(optionsSettings.getProperty("AutobanL2WalkerAcc", "False"));
    +							   GM_EDIT												 = Boolean.valueOf(optionsSettings.getProperty("GMEdit", "False"));
    
    ACTIVATE_POSITION_RECORDER	   = Boolean.valueOf(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
    
    Index: D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java
    ===================================================================
    --- D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java	   (revision 708)
    +++ D:/Workspace/GameServer_Clean/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminExpSp.java	   (working copy)
    @@ -29,6 +29,8 @@
    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
    import net.sf.l2j.gameserver.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.util.IllegalPlayerAction;
    +import net.sf.l2j.gameserver.util.Util;
    
    /**
    * This class handles following admin commands:
    @@ -222,8 +224,24 @@
    smA.addString("Wrong Number Format");
    activeChar.sendPacket(smA);
    }
    -					   if(expval != 0 || spval != 0)
    +					   /**
    +					    * Anti-Corrupt GMs Protection.
    +					    * If GMEdit enabled, a GM won't be able to Add Exp or SP to any other
    +					    * player that's NOT  a GM character. And in addition.. both player and
    +					    * GM WILL be banned.
    +					    */
    +					   if(Config.GM_EDIT && (expval != 0 || spval != 0)&& !player.isGM())
    {
    +							   //Warn the player about his inmediate ban.
    +							   player.sendMessage("A GM tried to edit you in "+expval+" exp points and in "+spval+" sp points.You will both be banned.");
    +							   Util.handleIllegalPlayerAction(player,"The player "+player.getName()+" has been edited. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
    +							   //Warn the GM about his inmediate ban.
    +							   player.sendMessage("You tried to edit "+player.getName()+" by "+expval+" exp points and "+spval+". You both be banned now.");
    +							   Util.handleIllegalPlayerAction(activeChar,"El GM "+activeChar.getName()+" ha editado a alguien. BAN!!", IllegalPlayerAction.PUNISH_KICKBAN);
    +							   _log.severe("GM "+activeChar.getName()+" tried to edit "+player.getName()+". They both have been Banned.");
    +					   }
    +					   else if(expval != 0 || spval != 0)
    +						 {
    //Common character information
    SystemMessage sm = new SystemMessage(614);
    sm.addString("Admin is adding you "+expval+" xp and "+spval+" sp.");[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Фикс заточки через ВХ кстати в рт 1.4.1.6 данный баг не пофикшен

    Фикс заточки через Вх:

    Код:
    в "net/sf/l2j/gameserver/clientpackets" находим "SendWareHouseDepositList.java" вставляем :
    import net.sf.l2j.gameserver.util.IllegalPlayerAction;
    import net.sf.l2j.gameserver.util.Util;[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]there after[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3])
    
    if (player.getActiveEnchantItem ()! = null)
    (
    Util.handleIllegalPlayerAction (player, "Mofo" + player.getName () + "tried to use phx and got BANED! Peace:-h", IllegalPlayerAction.PUNISH_KICKBAN);
    return;
    )
    
    
    
    
    if ((warehouse instanceof ClanWarehouse) & & Config.GM_DISABLE_TRANSACTION & & player.getAccessLevel ()> = Config.GM_TRANSACTION_MIN & & player.getAccessLevel () <= Config.GM_TRANSACTION_MAX)
    (
    player.sendMessage ( "Transactions are disable for your Access Level");
    return;
    )[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]or search [/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Фикс на заточку итема игрокам,коррупт гмом.

    Не совсем фикс,а также ещё одна вещь которая рассчитана на коррупт Гмов.Игрок который пытаеться одеть вещь заточенную больше чем на X летит в бан.
    Идём в gameserver.clientpackets.UseItem.java

    Код:
    if (!activeChar.isGM() && item.getEnchantLevel() > X)
    {
    activeChar.setAccountAccesslevel(-999);									 
    activeChar.sendMessage("You have been banned for using an item over +X!");
    activeChar.closeNetConnection();
    return;
    }[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]Где X - это максимальная заточка.[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]Index: E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java
    ===================================================================
    --- E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java	    (revision 2252)
    +++ E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/skills/funcs/FuncEnchant.java	    (working copy)
    @@ -19,6 +19,7 @@
    package net.sf.l2j.gameserver.skills.funcs;
    
    import net.sf.l2j.gameserver.model.L2ItemInstance;
    +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.skills.Env;
    import net.sf.l2j.gameserver.skills.Stats;
    import net.sf.l2j.gameserver.templates.L2Item;
    @@ -38,11 +39,18 @@
    {
    if (cond != null && !cond.test(env)) return;
    L2ItemInstance item = (L2ItemInstance) funcOwner;
    +			  
    int cristall = item.getItem().getCrystalType();
    Enum itemType = item.getItemType();
    
    if (cristall == L2Item.CRYSTAL_NONE) return;
    int enchant = item.getEnchantLevel();
    +			  
    +			   if (env.player != null && env.player instanceof L2PcInstance)
    +			   {
    +						  if (!((L2PcInstance)env.player).isGM() && enchant > x)
    +										 enchant = x;
    +			   }
    
    int overenchant = 0;
    if (enchant > 3)
    Index: E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java
    ===================================================================
    --- E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java	  (revision 2252)
    +++ E:/workspace/L2_GameServer_It/java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminEnchant.java	  (working copy)
    @@ -18,6 +18,8 @@
    */
    package net.sf.l2j.gameserver.handler.admincommandhandlers;
    
    +import java.util.logging.Logger;
    +
    import net.sf.l2j.Config;
    import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
    import net.sf.l2j.gameserver.model.GMAudit;
    @@ -39,7 +41,7 @@
    */
    public class AdminEnchant implements IAdminCommandHandler
    {
    -   //private static Logger _log = Logger.getLogger(AdminEnchant.class.getName());
    +		  private static Logger _log = Logger.getLogger(AdminEnchant.class.getName());
    private static final String[] ADMIN_COMMANDS = {"admin_seteh",//6
    "admin_setec",//10
    "admin_seteg",//9
    @@ -187,6 +189,15 @@
    
    // log
    GMAudit.auditGMAction(activeChar.getName(), "enchant", player.getName(), itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench);
    +					  
    +					   if (!player.isGM() && ench > x)
    +					   {
    +						  _log.warning("GM: " + activeChar.getName() + " enchanted " + player.getName() + " item over the Limit.");
    +						  activeChar.setAccountAccesslevel(-100);
    +						  player.setAccountAccesslevel(-100);
    +						  player.closeNetConnection();
    +						  activeChar.closeNetConnection();
    +					   }
    }
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    PvP Color system

    C этим патчем цвет ника будет меняться в зависимости от количества PVP очков,а титул от количества PK

    Код:
    Index: /java/config/l2jmods.properties
    ===================================================================
    --- /java/config/l2jmods.properties	 (revision 174)
    +++ /java/config/l2jmods.properties	 (working copy)
    @@ -161,4 +161,62 @@
    #----------------------------------
    EnableWarehouseSortingClan = False
    EnableWarehouseSortingPrivate = False
    -EnableWarehouseSortingFreight = False
    \ No newline at end of file
    +EnableWarehouseSortingFreight = False
    +
    +# ---------------------------------------
    +# Section: PvP Title Color Change System by Level
    +# ---------------------------------------
    +# Each Amount will change the name color to the values defined here.
    +# Example: PvpAmmount1 = 500, when a character's PvP counter reaches 500, their name color will change
    +# according to the ColorForAmount value.
    +# Note: Colors Must Use RBG format
    +EnablePvPColorSystem = false
    +
    +# Pvp Amount & Name color level 1.
    +PvpAmount1 = 500
    +ColorForAmount1 = CCFF00
    +
    +# Pvp Amount & Name color level 2.
    +PvpAmount2 = 1000
    +ColorForAmount2 = 00FF00
    +
    +# Pvp Amount & Name color level 3.
    +PvpAmount3 = 1500
    +ColorForAmount3 = 00FF00
    +
    +# Pvp Amount & Name color level 4.
    +PvpAmount4 = 2500
    +ColorForAmount4 = 00FF00
    +
    +# Pvp Amount & Name color level 5.
    +PvpAmount5 = 5000
    +ColorForAmount5 = 00FF00
    +
    +# ---------------------------------------
    +# Section: PvP Nick Color System by Level
    +# ---------------------------------------
    +# Same as above, with the difference that the PK counter changes the title color.
    +# Example:  PkAmmount1 = 500, when a character's PK counter reaches 500, their title color will change
    +# according to the Title For Amount
    +# WAN: Colors Must Use RBG format
    +EnablePkColorSystem = false
    +
    +# Pk Amount & Title color level 1.
    +PkAmount1 = 500
    +TitleForAmount1 = 00FF00
    +
    +# Pk Amount & Title color level 2.
    +PkAmount2 = 1000
    +TitleForAmount2 = 00FF00
    +
    +# Pk Amount & Title color level 3.
    +PkAmount3 = 1500
    +TitleForAmount3 = 00FF00
    +
    +# Pk Amount & Title color level 4.
    +PkAmount4 = 2500
    +TitleForAmount4 = 00FF00
    +
    +# Pk Amount & Title color level 5.
    +PkAmount5 = 5000
    +TitleForAmount5 = 00FF00
    \ No newline at end of file
    Index: /java/net/sf/l2j/Config.java
    ===================================================================
    --- /java/net/sf/l2j/Config.java	    (revision 174)
    +++ /java/net/sf/l2j/Config.java	    (working copy)
    @@ -544,6 +546,28 @@
    public static boolean  L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
    public static boolean  L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
    public static boolean  L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
    +	   public static boolean		   PVP_COLOR_SYSTEM_ENABLED;
    +	   public static int					   PVP_AMOUNT1;
    +	   public static int					   PVP_AMOUNT2;
    +	   public static int					   PVP_AMOUNT3;
    +	   public static int					   PVP_AMOUNT4;
    +	   public static int					   PVP_AMOUNT5;
    +	   public static int					   NAME_COLOR_FOR_PVP_AMOUNT1;
    +	   public static int					   NAME_COLOR_FOR_PVP_AMOUNT2;
    +	   public static int					   NAME_COLOR_FOR_PVP_AMOUNT3;
    +	   public static int					   NAME_COLOR_FOR_PVP_AMOUNT4;
    +	   public static int					   NAME_COLOR_FOR_PVP_AMOUNT5;
    +	   public static boolean		   PK_COLOR_SYSTEM_ENABLED;
    +	   public static int					   PK_AMOUNT1;
    +	   public static int					   PK_AMOUNT2;
    +	   public static int					   PK_AMOUNT3;
    +	   public static int					   PK_AMOUNT4;
    +	   public static int					   PK_AMOUNT5;
    +	   public static int					   TITLE_COLOR_FOR_PK_AMOUNT1;
    +	   public static int					   TITLE_COLOR_FOR_PK_AMOUNT2;
    +	   public static int					   TITLE_COLOR_FOR_PK_AMOUNT3;
    +	   public static int					   TITLE_COLOR_FOR_PK_AMOUNT4;
    +	   public static int					   TITLE_COLOR_FOR_PK_AMOUNT5;
    
    /** ************************************************** **/
    /** L2JMods Settings -End														 **/
    @@ -1654,6 +1678,34 @@
    L2JMOD_ENABLE_WAREHOUSESORTING_CLAN	 = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));
    L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
    L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));
    +							  
    +							   // PVP Name Color System configs - Start
    +							   PVP_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));
    +							   PVP_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "500"));
    +							   PVP_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "1000"));
    +							   PVP_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "1500"));
    +							   PVP_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "2500"));
    +							   PVP_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "5000"));
    +							   NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount1", "00FF00"));
    +							   NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount2", "00FF00"));
    +							   NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount3", "00FF00"));
    +							   NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
    +							   NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));
    +							   // PvP Name Color System configs - End
    +							  
    +							   // PK Title Color System configs - Start
    +							   PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePkColorSystem", "false"));
    +							   PK_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PkAmount1", "500"));
    +							   PK_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PkAmount2", "1000"));
    +							   PK_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PkAmount3", "1500"));
    +							   PK_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PkAmount4", "2500"));
    +							   PK_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PkAmount5", "5000"));
    +							   TITLE_COLOR_FOR_PK_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "00FF00"));
    +							   TITLE_COLOR_FOR_PK_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "00FF00"));
    +							   TITLE_COLOR_FOR_PK_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "00FF00"));
    +							   TITLE_COLOR_FOR_PK_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "00FF00"));
    +							   TITLE_COLOR_FOR_PK_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "00FF00"));
    +							   //PK Title Color System configs - End
    
    if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
    {
    Index: /java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
    ===================================================================
    --- /java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (revision 174)
    +++ /java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (working copy)
    @@ -177,6 +177,16 @@
    Quest.playerEnter(activeChar);
    activeChar.sendPacket(new QuestList());
    loadTutorial(activeChar);
    +
    +			   // ================================================================================
    =
    +			   // Color System checks - Start =====================================================
    +			   // Check if the custom PvP and PK color systems are enabled and if so ==============
    +			   // check the character's counters and apply any color changes that must be done. ===
    +			   if (activeChar.getPvpKills()>=(Config.PVP_AMOUNT1) && (Config.PVP_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPColor(activeChar.getPvpKills());
    +			   if (activeChar.getPkKills()>=(Config.PK_AMOUNT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkColor(activeChar.getPkKills());
    +			   // Color System checks - End =======================================================
    +			   // ================================================================================
    =
    +			  
    
    if (Config.PLAYER_SPAWN_PROTECTION > 0)
    activeChar.setProtection(true);
    @@ -3660,7 +3661,75 @@
    DuelManager.getInstance().broadcastToOppositTeam(this, update);
    }
    }
    -	  
    +
    +	   // Custom PVP Color System - Start
    +	   public void updatePvPColor(int pvpKillAmount)
    +	   {
    +			   if (Config.PVP_COLOR_SYSTEM_ENABLED)
    +			   {
    +					   //Check if the character has GM access and if so, let them be.
    +					   if (isGM())
    +							   return;
    +					   {
    +							   if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount <= (Config.PVP_AMOUNT2)))
    +							   {
    +									   getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);
    +							   }
    +							   else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount <= (Config.PVP_AMOUNT3)))
    +							   {
    +									   getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);
    +							   }
    +							   else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount <= (Config.PVP_AMOUNT4)))
    +							   {
    +									   getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);
    +							   }
    +							   else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount <= (Config.PVP_AMOUNT5)))
    +							   {
    +									   getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);
    +							   }
    +							   else if (pvpKillAmount >= (Config.PVP_AMOUNT5))
    +							   {
    +									   getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);
    +							   }
    +					   }
    +			   }
    +	   }
    +	   //Custom PVP Color System - End
    +	  
    +	   // Custom Pk Color System - Start
    +	   public void updatePkColor(int pkKillAmount)
    +	   {
    +			   if (Config.PK_COLOR_SYSTEM_ENABLED)
    +			   {
    +					   //Check if the character has GM access and if so, let them be, like above.
    +					   if (isGM())
    +							   return;
    +					   {
    +							   if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount <= (Config.PVP_AMOUNT2)))
    +							   {
    +									   getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT1);
    +							   }
    +							   else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount <= (Config.PVP_AMOUNT3)))
    +							   {
    +									   getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT2);
    +							   }
    +							   else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount <= (Config.PVP_AMOUNT4)))
    +							   {
    +									   getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT3);
    +							   }
    +							   else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount <= (Config.PVP_AMOUNT5)))
    +							   {
    +									   getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT4);
    +							   }
    +							   else if (pkKillAmount >= (Config.PK_AMOUNT5))
    +							   {
    +									   getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT5);
    +							   }
    +					   }
    +			   }
    +	   }
    +	   //Custom Pk Color System - End
    +	  
    @Override
    public final void updateEffectIcons(boolean partyOnly)
    {
    @@ -4996,6 +5065,10 @@
    // Add karma to attacker and increase its PK counter
    setPvpKills(getPvpKills() + 1);
    
    +		 //Update the character's name color if they reached any of the 5 PvP levels.
    +			   updatePvPColor(getPvpKills());
    +			   broadcastUserInfo();
    +
    // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
    sendPacket(new UserInfo(this));
    }
    @@ -5047,6 +5120,10 @@
    setPkKills(getPkKills() + 1);
    setKarma(getKarma() + newKarma);
    
    +			   //Update the character's title color if they reached any of the 5 PK levels.
    +			   updatePkColor(getPkKills());
    +			   broadcastUserInfo();
    +			  
    // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
    sendPacket(new UserInfo(this));
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]


    Получение вещей за PVP/PK

    Код:
    Награды за пвп.
    Идем в gameserver.model.actor.instance.L2PcInstance.java[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]Идём на 4538 строку...И вы увидите что то вроде этого:
    // Add karma to attacker and increase its PK counter
    setPvpKills(getPvpKills() + 1);[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]И теперь после этого добавляем:[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]// Give x y for a pvp kill
    addItem("Loot", x, y, this, true);
    sendMessage("You won y x for a pvp kill!");[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]Note: X это ID вещи,Y количество.
    Награды за пк:
    На строке 4605 вы увидите:[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]// Add karma to attacker and increase its PK counter
    setPkKills(getPkKills() + 1);
    setKarma(getKarma() + newKarma);[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]

    Как вставлять .info Команду.

    Сейчас я расскажу вам как зделать что бы при вводе команды .info показывался Htm файл в котором вы можете написать всё что пожелаете.Начнём!
    1.Идём в L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer \ Handler \ voicedcommandhandlers
    И создаём новый файл VoiceInfo.java

    Код:
    /*
    * 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.handler.voicedcommandhandlers;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]import net.sf.l2j.Config;
    import net.sf.l2j.gameserver.GameServer;
    import net.sf.l2j.gameserver.cache.HtmCache;
    import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]/**
    * @author Michiru
    *
    */
    public class VoiceInfo implements IVoicedCommandHandler
    {
    private static String[] VOICED_COMMANDS =
    { "info" };[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]	    /* (non-Javadoc)
    * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
    */
    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
    {
    String htmFile = "data/html/custom/xx.htm";
    String htmContent = HtmCache.getInstance().getHtm(htmFile);
    if (htmContent != null)
    {
    NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
    infoHtml.setHtml(htmContent);
    activeChar.sendPacket(infoHtml);
    }
    else
    {
    activeChar.sendMessage("omg lame error! where is " + htmFile + " ! blame the Server Admin");
    }
    return true;
    }[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]	    public String[] getVoicedCommandList()
    {
    return VOICED_COMMANDS;
    }
    }[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]Вы видите что бы ввести пусть к вашему файлу поменяйте строку htmFile = "data/html/custom/xx.htm"; Теперь идём в L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer \ Handler \
    октрываем voicecommandhandlers.java и вставляем:[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceInfo;[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]После[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CastleDoors;[/size][/font][/color]
    
    [color=#4B565E][font=Verdana][size=3]Потом идём на 54 строчку и вставляем:[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]registerVoicedCommandHandler(new VoiceInfo());[/size][/font][/color]
    [color=#4B565E][font=Verdana][size=3]
  2. doloto777 Пользователи

    Сообщения:
    5
    Лайки:
    0
    Пол:
    Мужской
    Репутация:
    0
    Страна:
    Russian Federation Russian Federation
    У меня L2jserver
Черновик сохранён Черновик удалён
Similar Threads
  1. LemanRass1234
    Ответов:
    1
    Просмотров:
    1.005
  2. 6apik

    1.2.6 (1.3.4) Java

    Ответов:
    5
    Просмотров:
    1.253
  3. Tinkee

    1.2.6 (1.3.4) java

    Ответов:
    1
    Просмотров:
    889
Загрузка...

Поделиться этой страницей