Skip to content
La2Base
Home
DownloadsWikiForumFAQ
Search
ruen
Sign up Login
HomeFilesWikiLogin
  • Home
  • Downloads
  • Wiki
  • FAQ
  • Contact Us
  • About
  • Rules
  • Privacy
  • Terms of Service

© 2026 la2base.com · All rights reserved

ruen
Forum/Архив мануалов/[core]Модификации Java серверов
Search

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

24 replies10,568 viewsCurrently viewing: 1
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 01:14 AM

Это базовая и простая банковская система. Она очень простая:
Работает со следующими коммандами:
.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


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 01:17 AM

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

Меняем на строке
java/net/sf/l2j/gameserver/model/actor/instance/l2pcinstance.java

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;

sendSkillList();
}

To:

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;

sendSkillList();
}


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 01:20 AM

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

По адресу 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;

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;


/**
*
* @author  HanWik
*/
public class HeroItem implements IItemHandler
{
   private static final int[] ITEM_IDS = { YOUR ITEM ID - replace here };

   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;
   }
}

Открываем 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;


Код
_itemHandler.registerItemHandler(new BeastSpice());
    на  _itemHandler.registerItemHandler(new HeroItem());


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 01:25 AM

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

Код
f (item.isEquipable())
        {
            if (activeChar.isDisarmed())
                return;

            if (!((L2Equip) item.getItem()).allowEquip(activeChar))
            {
                activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
                return;
            }

            //Begining the script
+            if (activeChar.getClassId().getId() == 88)
+            {
+                if (item.getItemType() == L2ArmorType.MAGIC)
+                {
+                    activeChar.sendPacket(new +SystemMessage(SystemMessageId.NO_CONDITION_TO_EQUIP));
+                    return;
+                }    
+            }

К примеру Глад и Роба Армор.
Если вы хотите зделать это с каким то оружием то поменяйте эту строку
Код
if (item.getItemType() == L2ArmorType.MAGIC)

на
Код
if (item.getItemType() == L2WeaponType.DAGGER)

the available class-ids and item types are listed below.

Что бы избежать юзанья бага с саб классом я использую этот скрип что бы обезвредить всё оружие и доспехи с заменой класса.
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);
+            
+        }

Что бы вам было проще:
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

-- 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

-- 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

-- ORCS
-- 44=Orc Fighter | 45=Orc Raider | 46=Destroyer | 47=Monk | 48=Tyrant
-- 49=Orc Mystic | 50=Orc Shaman | 51=Overlord | 52=Warcryer

-- DWARVES
-- 53=Dwarven Fighter | 54=Scavenger | 55=Bounty Hunter | 56=Artisan | 57=Warsmith

-- 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

-- ELVES 3rd Professions
-- 99=Evas Templar | 100=Sword Muse | 101=Wind Rider | 102=Moonlight Sentinel
-- 103=Mystic Muse | 104=Elemental Master | 105=Evas Saint

-- 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

-- ORCS 3rd Professions
-- 113=Titan | 114=Grand Khavatari
-- 115=Dominator | 116=Doomcryer

-- DWARVES 3rd Professions
-- 117=Fortune Seeker | 118=Maestro

-- 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

-Armors-
HEAVY
LIGHT
MAGIC


Тестилось на L2JFree.

© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 10:46 AM

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

Код
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.");


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 11:22 AM

Фикс заточки через ВХ кстати в рт 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;


there after

Код
)
        
         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;
         )


or search

Код
/ / Alt game - Karma punishment
         if (! Config.ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE & & player.getKarma ()> 0) return;


© p1oner - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:27 PM

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

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

и после строки 178 добавляем это :

Код
if (!activeChar.isGM() && item.getEnchantLevel() > X)
                                                {
                                                       activeChar.setAccountAccesslevel(-999);                    
                                                       activeChar.sendMessage("You have been banned for using an item over +X!");
                                                       activeChar.closeNetConnection();
                                                       return;
                                                }


Где X - это максимальная заточка.

Код
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();
+            }
         }
     }


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:28 PM

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));
     }


©BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:34 PM

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

Награды за пвп.
Идем в gameserver.model.actor.instance.L2PcInstance.java

Идём на 4538 строку...И вы увидите что то вроде этого:

Код
// Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);


И теперь после этого добавляем:

Код
// Give x y for a pvp kill
        addItem("Loot", x, y, this, true);
        sendMessage("You won y x for a pvp kill!");


Note: X это ID вещи,Y количество.
Награды за пк:
На строке 4605 вы увидите:

Код
// Add karma to attacker and increase its PK counter
        setPkKills(getPkKills() + 1);
        setKarma(getKarma() + newKarma);


После этого добавляем такую же строчку как и было с ПВП итемами...И всё готово!

© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:41 PM

Как вставлять .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;

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;

/**
* @author Michiru
*
*/
public class VoiceInfo implements IVoicedCommandHandler
{
    private static String[]    VOICED_COMMANDS    =
                                            { "info" };

    /* (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;
    }

    public String[] getVoicedCommandList()
    {
        return VOICED_COMMANDS;
    }
}


Вы видите что бы ввести пусть к вашему файлу поменяйте строку htmFile = "data/html/custom/xx.htm"; Теперь идём в L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer \ Handler \
октрываем voicecommandhandlers.java и вставляем:

Код
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceInfo;


После

Код
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.CastleDoors;


Потом идём на 54 строчку и вставляем:

Код
registerVoicedCommandHandler(new VoiceInfo());


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:45 PM

Как поменять имя сервера при рестарте

В этом руководстве я буду учить вас, как изменить имя сервера при перезагрузке... при дефаулте говорится "<<The Server is restarting in "x" Seconds./ Minutes.>>"Начнём.
Идем внутрь папки с именем L2_GameServer_IL \ SRC \ Main \ Java \ Net \ SF \ l2j \ GameServer, и вы увидите внутри Shutdown.java
на строке 238&240 мы увидим эту

Код
Announcements.getInstance().announceToAll("Server is " + _shutdownMode.getText().toLowerCase() + " in "+seconds+ " seconds!");
       if(Config.IRC_ENABLED && !Config.IRC_ANNOUNCE)
            IrcManager.getInstance().getConnection().sendChan("Server is " + _shutdownMode.getText().toLowerCase() + " in "+seconds+ " seconds!");


Как вы видите "Server is" и вы можете менять это на ваше название сервера.Вы можете зделать к примеру название AllCheats. И в игре будет написано "Allcheats is restarting in "x" "
Так же вы можете изменить фразу "Attention Players!" на
cтроке 269 вы увидите:

Код
Announcements.getInstance().announceToAll("Attention players!");


Меняем "Attention players!" на ""Attention Allcheats' players!" и вы получите "Attention Allcheats' Players!" и так можно крутить как вы хотите.
строке 269 вы увидите это:

Код
Announcements.getInstance().announceToAll("Server aborts " + _shutdownMode.getText().toLowerCase() + " and continues normal operation!");


Вы можете поменять "Server Aborts" на "Allcheats server Aborts" или как угодно на строке между 368 и 372.

© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 01/23/2009, 12:49 PM

Геройское свечение за PVP

Примечание: Это не будет давать геройские скиллы или давать возможность покупать геройское оружие,только ауру(свечение).

Код
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 1901)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
@@ -488,6 +488,11 @@

    private boolean _noble = false;
    private boolean _hero = false;
+  
+   /** Special hero aura values */
+   private int heroConsecutiveKillCount = 0;
+   private boolean isPermaHero = false;
+   private boolean isPVPHero = false;

    /** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
    private L2FolkInstance _lastFolkNpc = null;
@@ -1971,6 +1976,13 @@
    public void setPvpKills(int pvpKills)
    {
       _pvpKills = pvpKills;
+      
+      // Set hero aura if pvp kills > 100
+      if (pvpKills > 100)
+      {
+         isPermaHero = true;
+         setHeroAura(true);
+      }
    }

    /**
@@ -4678,6 +4690,14 @@

       stopRentPet();
       stopWaterTask();
+      
+      // Remove kill count for special hero aura if total pvp < 100
+      heroConsecutiveKillCount = 0;
+      if (!isPermaHero)
+      {
+         setHeroAura(false);
+         sendPacket(new UserInfo(this));
+      }
       return true;
    }

@@ -4897,6 +4917,13 @@
     {
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
+        
+        // Increase the kill count for a special hero aura
+        heroConsecutiveKillCount++;
+        
+        // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
+        if(heroConsecutiveKillCount > 4)
+           setHeroAura(true);

         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
         sendPacket(new UserInfo(this));
@@ -8715,6 +8742,22 @@
    {
       return _blockList;
    }
+  
+   public void reloadPVPHeroAura()
+   {
+      sendPacket(new UserInfo(this));
+   }
+  
+   public void setHeroAura (boolean heroAura)
+   {
+      isPVPHero = heroAura;
+      return;
+   }
+  
+   public boolean getIsPVPHero()
+   {
+      return isPVPHero;
+   }

    public void setHero(boolean hero)
    {
Index: java/net/sf/l2j/gameserver/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/serverpackets/UserInfo.java   (revision 1901)
+++ java/net/sf/l2j/gameserver/serverpackets/UserInfo.java   (working copy)
@@ -337,7 +337,7 @@

         writeD(_activeChar.getClanCrestLargeId());
         writeC(_activeChar.isNoble() ? 1 : 0); //0x01: symbol on char menu ctrl+I
-        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); //0x01: Hero Aura
+        writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || _activeChar.getIsPVPHero()) ? 1 : 0); //0x01: Hero Aura

         writeC(_activeChar.isFishing() ? 1 : 0); //Fishing Mode
         writeD(_activeChar.getFishx()); //fishing x


© BrainFucker - Взято с АЧ

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 02/12/2009, 09:57 AM

Смена цвета ника клан лидера:

Код
Index: L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 1434)
+++ L2_GameServer_It/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
@@ -1659,6 +1659,21 @@
    {
        return !_recomChars.contains(target.getObjectId());
    }
+    
+    public int getNameColor()
+    {
+        if ((getAppearance().getNameColor() == 0xFFFFFF) && (getClan() != null))
+        {
+            if (getClan().getHasCastle() > 0)
+            {
+                if (isClanLeader())
+                    return 0xFFFF00;    //TODO: fill in Lord's Color
+                else
+                    return 0xFF33FF;    //TODO: fill in Member's Color
+            }
+        }
+        return getAppearance().getNameColor();
+    }

    /**
     * Set the exp of the L2PcInstance before a death
Index: L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java
===================================================================
--- L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java    (revision 1434)
+++ L2_GameServer_It/java/net/sf/l2j/gameserver/model/L2Clan.java    (working copy)
@@ -34,6 +34,7 @@
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.CastleManager;
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
+import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.serverpackets.ItemList;
@@ -580,6 +581,24 @@
    public void setHasCastle(int hasCastle)
    {
        _hasCastle = hasCastle;
+        // Force online clan members to re-broadcast their info
+        //    because castle status has changed.  This is due to
+        //    new custom name color changes related to a clan's
+        //    castle (if any).
+        // This is expected to be an expensive operation though
+        //    considering how often this is called it should not
+        //    be too bad (called rarely).
+        for (L2ClanMember clanMember: _members.values())
+        {
+            L2PcInstance player = null;
+            try
+            {
+                player = L2World.getInstance().getPlayer(clanMember.getName());
+            }
+            catch(Exception e) {}
+            if (player != null)
+                player.broadcastUserInfo();
+        }
    }
    /**
     * @param hasHideout The hasHideout to set.
Index: L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java
===================================================================
--- L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java    (revision 1434)
+++ L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/CharInfo.java    (working copy)
@@ -332,7 +332,7 @@
            writeD(_activeChar.GetFishy());
            writeD(_activeChar.GetFishz());

-            writeD(_activeChar.getAppearance().getNameColor());
+            writeD(_activeChar.getNameColor());

            writeD(0x00); // isRunning() as in UserInfo?

Index: L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java
===================================================================
--- L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java    (revision 1434)
+++ L2_GameServer_It/java/net/sf/l2j/gameserver/serverpackets/UserInfo.java    (working copy)
@@ -300,7 +300,7 @@
         writeD(_activeChar.GetFishx()); //fishing x
         writeD(_activeChar.GetFishy()); //fishing y
         writeD(_activeChar.GetFishz()); //fishing z
-        writeD(_activeChar.getAppearance().getNameColor());
+        writeD(_activeChar.getNameColor());

        //new c5
            writeC(_activeChar.isRunning() ? 0x01 : 0x00); //changes the Speed display on Status Window

— La2Psy.ru [ADM]Wh1tePower...

0
Wh1tePower
Wh1tePower

User

Ветеран

Posts: 846

На форуме с: 09/18/2007

Репутация: +623

Рейтинг: 0

· 02/27/2009, 11:11 AM

Мана для сборок L2J Server , не путаем с L2J Free.
Создать текстовый документ , скопировать в него следующее

Раскрывающийся текст

* 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;

import java.util.logging.Logger;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2Effect;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2SummonInstance;
import net.sf.l2j.gameserver.model.entity.TvTEvent;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
import net.sf.l2j.gameserver.templates.skills.L2EffectType;

/**
* This class ...
*
* @version $Revision: 1.2.4.4 $ $Date: 2005/03/27 15:30:07 $
*/

public class Potions implements IItemHandler
{
protected static final Logger _log = Logger.getLogger(Potions.class.getName());

private static final int[] ITEM_IDS =
{
65, 725, 726, 727, 728, 734, 735, 1060, 1061, 1073,
1374, 1375, 1539, 1540, 5591, 5592, 6035, 6036,
6652, 6553, 6554, 6555, 8193, 8194, 8195, 8196,
8197, 8198, 8199, 8200, 8201, 8202, 8600, 8601,
8602, 8603, 8604, 8605, 8606, 8607,
8608, 8609, 8610, 8611, 8612, 8613, 8614, 10155, 10157,
//Attribute Potion
9997, 9998, 9999, 10000, 10001, 10002,
//elixir of life
8622, 8623, 8624, 8625, 8626, 8627,
//elixir of Strength
8628, 8629, 8630, 8631, 8632, 8633,
//elixir of cp
8634, 8635, 8636, 8637, 8638, 8639,
// Endeavor Potion
733,
// Juices
10260, 10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270,
// CT2 herbs
10655, 10656, 10657
};

/**
*
* @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.a
ctor.instance.L2PlayableInstance, net.sf.l2j.gameserver.model.L2ItemInstance)
*/
public synchronized void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
L2PcInstance activeChar;
boolean res = false;
if (playable instanceof L2PcInstance)
activeChar = (L2PcInstance) playable;
else if (playable instanceof L2PetInstance)
activeChar = ((L2PetInstance) playable).getOwner();
else
return;

if (!TvTEvent.onPotionUse(playable.getObjectId()))
{
playable.sendPacket(ActionFailed.STATIC_PACKET);
return;
}

if (activeChar.isInOlympiadMode())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT)
);
return;
}

if (activeChar.isAllSkillsDisabled())
{
ActionFailed af = ActionFailed.STATIC_PACKET;
activeChar.sendPacket(af);
return;
}

int itemId = item.getItemId();

switch (itemId)
{
// HEALING AND SPEED POTIONS
case 65: // red_potion, xml: 2001
res = usePotion(activeChar, 2001, 1);
break;
case 725: // healing_drug, xml: 2002
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2002, 1);
break;
case 727: // _healing_potion, xml: 2032
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2032, 1);
break;
case 728: // Mana Potion by Wh1tePower
res = usePotion(activeChar, 2005, 1);
break;
case 733: // Endeavor Potion, xml: 2010
res = usePotion(activeChar, 2010, 1);
break;
case 734: // quick_step_potion, xml: 2011
res = usePotion(activeChar, 2011, 1);
break;
case 735: // swift_attack_potion, xml: 2012
res = usePotion(activeChar, 2012, 1);
break;
case 1060: // lesser_healing_potion,
case 1073: // beginner's potion, xml: 2031
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2031, 1);
break;
case 1061: // healing_potion, xml: 2032
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2032, 1);
break;
case 10157: // instant haste_potion, xml: 2398
res = usePotion(activeChar, 2398, 1);
break;
case 1374: // adv_quick_step_potion, xml: 2034
res = usePotion(activeChar, 2034, 1);
break;
case 1375: // adv_swift_attack_potion, xml: 2035
res = usePotion(activeChar, 2035, 1);
break;
case 1539: // greater_healing_potion, xml: 2037
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2037, 1);
break;
case 1540: // quick_healing_potion, xml: 2038
if (!isEffectReplaceable(activeChar, L2EffectType.HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2038, 1);
break;
case 5591:
case 5592: // CP and Greater CP
if (!isEffectReplaceable(activeChar, L2EffectType.COMBAT_POINT_HEAL_OVER_TIME, itemId))
return;
res = usePotion(activeChar, 2166, (itemId == 5591) ? 1 : 2);
break;
case 6035: // Magic Haste Potion, xml: 2169
res = usePotion(activeChar, 2169, 1);
break;
case 6036: // Greater Magic Haste Potion, xml: 2169
res = usePotion(activeChar, 2169, 2);
break;
case 10155: //Mental Potion XML:2396
res = usePotion(activeChar, 2396, 1);
break;

// ATTRIBUTE POTION
case 9997: // Fire Resist Potion, xml: 2335
res = usePotion(activeChar, 2335, 1);
break;
case 9998: // Water Resist Potion, xml: 2336
res = usePotion(activeChar, 2336, 1);
break;
case 9999: // Earth Resist Potion, xml: 2338
res = usePotion(activeChar, 2338, 1);
break;
case 10000: // Wind Resist Potion, xml: 2337
res = usePotion(activeChar, 2337, 1);
break;
case 10001: // Dark Resist Potion, xml: 2340
res = usePotion(activeChar, 2340, 1);
break;
case 10002: // Divine Resist Potion, xml: 2339
res = usePotion(activeChar, 2339, 1);
break;

// ELIXIR
case 8622:
case 8623:
case 8624:
case 8625:
case 8626:
case 8627:
{
// elixir of Life
byte expIndex = (byte) activeChar.getExpertiseIndex();
res = usePotion(activeChar, 2287, (expIndex > 5 ? expIndex : expIndex + 1));
}
case 8628:
case 8629:
case 8630:
case 8631:
case 8632:
case 8633:
{
byte expIndex = (byte) activeChar.getExpertiseIndex();
// elixir of Strength
res = usePotion(activeChar, 2288, (expIndex > 5 ? expIndex : expIndex + 1));
break;
}
case 8634:
case 8635:
case 8636:
case 8637:
case 8638:
case 8639:
{
byte expIndex = (byte) activeChar.getExpertiseIndex();
// elixir of cp
res = usePotion(activeChar, 2289, (expIndex > 5 ? expIndex : expIndex + 1));
break;
}
// VALAKAS AMULETS
case 6652: // Amulet Protection of Valakas
res = usePotion(activeChar, 2231, 1);
break;
case 6653: // Amulet Flames of Valakas
res = usePotion(activeChar, 2223, 1);
break;
case 6654: // Amulet Flames of Valakas
res = usePotion(activeChar, 2233, 1);
break;
case 6655: // Amulet Slay Valakas
res = usePotion(activeChar, 2232, 1);
break;

// HERBS
case 8600: // Herb of Life
res = usePotion(playable, 2278, 1);
break;
case 8601: // Greater Herb of Life
res = usePotion(playable, 2278, 2);
break;
case 8602: // Superior Herb of Life
res = usePotion(playable, 2278, 3);
break;
case 8603: // Herb of Mana
res = usePotion(playable, 2279, 1);
break;
case 8604: // Greater Herb of Mane
res = usePotion(playable, 2279, 2);
break;
case 8605: // Superior Herb of Mane
res = usePotion(playable, 2279, 3);
break;
case 8606: // Herb of Strength
res = usePotion(playable, 2280, 1);
break;
case 8607: // Herb of Magic
res = usePotion(playable, 2281, 1);
break;
case 8608: // Herb of Atk. Spd.
res = usePotion(playable, 2282, 1);
break;
case 8609: // Herb of Casting Spd.
res = usePotion(playable, 2283, 1);
break;
case 8610: // Herb of Critical Attack
res = usePotion(playable, 2284, 1);
break;
case 8611: // Herb of Speed
res = usePotion(playable, 2285, 1);
break;
case 8612: // Herb of Warrior
res = usePotion(playable, 2280, 1);// Herb of Strength
res = usePotion(playable, 2282, 1);// Herb of Atk. Spd
res = usePotion(playable, 2284, 1);// Herb of Critical Attack
break;
case 8613: // Herb of Mystic
res = usePotion(playable, 2281, 1);// Herb of Magic
res = usePotion(playable, 2283, 1);// Herb of Casting Spd.
break;
case 8614: // Herb of Warrior
res = usePotion(playable, 2278, 3);// Superior Herb of Life
res = usePotion(playable, 2279, 3);// Superior Herb of Mana
break;
case 10655:
res = usePotion(playable, 2512, 1);
break;
case 10656:
res = usePotion(playable, 2514, 1);
break;
case 10657:
res = usePotion(playable, 2513, 1);
break;

// FISHERMAN POTIONS
case 8193: // Fisherman's Potion - Green
if (activeChar.getSkillLevel(1315) <= 3)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 1);
break;
case 8194: // Fisherman's Potion - Jade
if (activeChar.getSkillLevel(1315) <= 6)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 2);
break;
case 8195: // Fisherman's Potion - Blue
if (activeChar.getSkillLevel(1315) <= 9)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 3);
break;
case 8196: // Fisherman's Potion - Yellow
if (activeChar.getSkillLevel(1315) <= 12)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 4);
break;
case 8197: // Fisherman's Potion - Orange
if (activeChar.getSkillLevel(1315) <= 15)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 5);
break;
case 8198: // Fisherman's Potion - Purple
if (activeChar.getSkillLevel(1315) <= 18)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 6);
break;
case 8199: // Fisherman's Potion - Red
if (activeChar.getSkillLevel(1315) <= 21)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 7);
break;
case 8200: // Fisherman's Potion - White
if (activeChar.getSkillLevel(1315) <= 24)
{
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
playable.sendPacket(new SystemMessage(SystemMessageId.NOTHING_HAPPENED));
return;
}
res = usePotion(activeChar, 2274, 8);
break;
case 8201: // Fisherman's Potion - Black
res = usePotion(activeChar, 2274, 9);
break;
case 8202: // Fishing Potion
res = usePotion(activeChar, 2275, 1);
break;

// Juices
// added by Z0mbie!
case 10260: // Haste Juice,xml:2429
res = usePotion(activeChar, 2429, 1);
break;
case 10261: // Accuracy Juice,xml:2430
res = usePotion(activeChar, 2430, 1);
break;
case 10262: // Critical Power Juice,xml:2431
res = usePotion(activeChar, 2431, 1);
break;
case 10263: // Critical Attack Juice,xml:2432
res = usePotion(activeChar, 2432, 1);
break;
case 10264: // Casting Speed Juice,xml:2433
res = usePotion(activeChar, 2433, 1);
break;
case 10265: // Evasion Juice,xml:2434
res = usePotion(activeChar, 2434, 1);
break;
case 10266: // Magic Power Juice,xml:2435
res = usePotion(activeChar, 2435, 1);
break;
case 10267: // Power Juice,xml:2436
res = usePotion(activeChar, 2436, 1);
break;
case 10268: // Speed Juice,xml:2437
res = usePotion(activeChar, 2437, 1);
break;
case 10269: // Defense Juice,xml:2438
res = usePotion(activeChar, 2438, 1);
break;
case 10270: // MP Consumption Juice,xml: 2439
res = usePotion(activeChar, 2439, 1);
break;
default:
}

if (res)
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
}

/**
*
* @param activeChar
* @param effectType
* @param itemId
* @return
*/
@SuppressWarnings("unchecked")
private boolean isEffectReplaceable(L2PcInstance activeChar, Enum effectType, int itemId)
{
L2Effect[] effects = activeChar.getAllEffects();

if (effects == null)
return true;

for (L2Effect e : effects)
{
if (e.getEffectType() == effectType)
{
// One can reuse pots after 2/3 of their duration is over.
// It would be faster to check if its > 10 but that would screw custom pot durations...
if (e.getTaskTime() > (e.getSkill().getBuffDuration() * 67) / 100000)
return true;
SystemMessage sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE);
sm.addItemName(itemId);
activeChar.sendPacket(sm);
return false;
}
}
return true;
}

/**
*
* @param activeChar
* @param magicId
* @param level
* @return
*/
public boolean usePotion(L2PlayableInstance activeChar, int magicId, int level)
{

L2Skill skill = SkillTable.getInstance().getInfo(magicId, level);

if (skill != null)
{
// Return false if potion is in reuse
// so is not destroyed from inventory
if (activeChar.isSkillDisabled(skill.getId()))
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE);
sm.addSkillName(skill);
activeChar.sendPacket(sm);

return false;
}

activeChar.doSimultaneousCast(skill);

if (activeChar instanceof L2PcInstance)
{
L2PcInstance player = (L2PcInstance)activeChar;
//only for Heal potions
if (magicId == 2031 || magicId == 2032 || magicId == 2037)
{
player.shortBuffStatusUpdate(magicId, level, 15);
}
// Summons should be affected by herbs too, self time effect is handled at L2Effect constructor
else if (((magicId > 2277 && magicId < 2286) || (magicId >= 2512 && magicId <= 2514))
&& (player.getPet() != null && player.getPet() instanceof L2SummonInstance))
{
player.getPet().doSimultaneousCast(skill);
}

if (!(player.isSitting() && !skill.isPotion()))
return true;
}
else if (activeChar instanceof L2PetInstance)
{
SystemMessage sm = new SystemMessage(SystemMessageId.PET_USES_S1);
sm.addString(skill.getName());
((L2PetInstance)(activeChar)).getOwner().sendPacket(sm);
}
}
return false;
}

/**
*
* @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds()
*/
public int[] getItemIds()
{
return ITEM_IDS;
}
}


Сохранить и переименовать в Potions.java , данный файл скопировать в

L2j_Server\L2_GameServer\java\net\sf\l2j\gameserver\handler\itemhandlers

С подтверждением замены файла. Для тех кто не умеет компилить - пишите в ПМ выложу скомпиленный.

— La2Psy.ru [ADM]Wh1tePower...

0
X
XOXOJI

User

Участник

Posts: 51

На форуме с: 06/29/2007

Репутация: +23

Рейтинг: 0

· 03/12/2009, 09:32 AM

в теории хватает записи только в юзеринфо, но иногда при одевании сэта аура появляется после любого последующего действия
в базе в таблице арморсетс в поле аурахеро ставьте 1 вместо 0 и ура! сэт светится
PS это личная разработка, подтолкнул меня на неё Wh1tePower с херо свечением за пвп


для начала sql
ALTER TABLE `armorsets` ADD COLUMN `aurahero` INTEGER NOT NULL DEFAULT 0;
у кого л2жфри меняйте com\l2jarchid на net\sf\l2j\

в com\l2jarchid\gameserver\datatables\ArmorSetsTable.java

private void loadData()
{
Connection con;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, shield, shield_skill_id, enchant6skill, aurahero FROM armorsets");
ResultSet rset = statement.executeQuery();

while(rset.next())
{
int chest = rset.getInt("chest");
int legs = rset.getInt("legs");
int head = rset.getInt("head");
int gloves = rset.getInt("gloves");
int feet = rset.getInt("feet");
int skill_id = rset.getInt("skill_id");
int shield = rset.getInt("shield");
int shield_skill_id = rset.getInt("shield_skill_id");
int enchant6skill = rset.getInt("enchant6skill");
_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet,skill_id, shield, shield_skill_id, enchant6skill));
}
_log.config("ArmorSetsTable: Loaded "+_armorSets.size()+" armor sets.");


меняем


private void loadData()
{
Connection con;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill_id, shield, shield_skill_id, enchant6skill, aurahero FROM armorsets");
ResultSet rset = statement.executeQuery();

while(rset.next())
{
int chest = rset.getInt("chest");
int legs = rset.getInt("legs");
int head = rset.getInt("head");
int gloves = rset.getInt("gloves");
int feet = rset.getInt("feet");
int skill_id = rset.getInt("skill_id");
int shield = rset.getInt("shield");
int shield_skill_id = rset.getInt("shield_skill_id");
int enchant6skill = rset.getInt("enchant6skill");
int aurahero = rset.getInt("aurahero");
_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet,skill_id, shield, shield_skill_id, enchant6skill, aurahero));
}
_log.config("ArmorSetsTable: Loaded "+_armorSets.size()+" armor sets.");


далее файл com\l2jarchid\gameserver\model\L2ArmoSet.java



public final class L2ArmorSet
{
private final int _chest;
private final int _legs;
private final int _head;
private final int _gloves;
private final int _feet;
private final int _skillId;

private final int _shield;
private final int _shieldSkillId;

private final int _enchant6Skill;

public L2ArmorSet(int chest, int legs, int head, int gloves, int feet, int skill_id, int shield, int shield_skill_id, int enchant6skill)
{
_chest = chest;
_legs = legs;
_head = head;
_gloves = gloves;
_feet = feet;
_skillId = skill_id;

_shield = shield;
_shieldSkillId = shield_skill_id;

_enchant6Skill = enchant6skill;
}

Меняем


public final class L2ArmorSet
{
private final int _chest;
private final int _legs;
private final int _head;
private final int _gloves;
private final int _feet;
private final int _skillId;

private final int _shield;
private final int _shieldSkillId;

private final int _enchant6Skill;
private final int _auraHero;

public L2ArmorSet(int chest, int legs, int head, int gloves, int feet, int skill_id, int shield, int shield_skill_id, int enchant6skill, int auraHero)
{
_chest = chest;
_legs = legs;
_head = head;
_gloves = gloves;
_feet = feet;
_skillId = skill_id;

_shield = shield;
_shieldSkillId = shield_skill_id;

_enchant6Skill = enchant6skill;
_auraHero = auraHero;
}

после



public int getEnchant6skillId()
{
return _enchant6Skill;
}

добавляем

public int getauraHero()
{
return _auraHero;
}

следующий файл com\l2jarchid\gameserver\model\L2ArmoSet.java



if(armorSet.containAll(player)) // просто найти через ctrl+F блокнотом
{
L2Skill skill = SkillTable.getInstance().getInfo(armorSet.getSkillId(),1);
if(skill != null)
{

player.addSkill(skill, false);
player.sendSkillList();

}
else



меняем


if(armorSet.containAll(player)) // просто найти через ctrl+F блокнотом
{
L2Skill skill = SkillTable.getInstance().getInfo(armorSet.getSkillId(),1);
if(skill != null)
{
int aura = armorSet.getauraHero();
if (aura != 0)
{
player.addSkill(skill, false);
player.sendSkillList();
player.setEpic(true);
}[/b]
player.addSkill(skill, false);
player.sendSkillList();
}
else


далее



if(slot == PAPERDOLL_CHEST)
{
L2ArmorSet armorSet = ArmorSetsTable.getInstance().getSet(item.getItemId());
if(armorSet == null)
return;

remove = true;
removeSkillId1 = armorSet.getSkillId();
removeSkillId2 = armorSet.getShieldSkillId();
removeSkillId3 = armorSet.getEnchant6skillId();
}
else
{
L2ItemInstance chestItem = getPaperdollItem(PAPERDOLL_CHEST);
if(chestItem == null)
return;

L2ArmorSet armorSet = ArmorSetsTable.getInstance().getSet(chestItem.getItemId());
if(armorSet == null)
return;

if(armorSet.containItem(slot, item.getItemId())) // removed part of set
{
remove = true;
removeSkillId1 = armorSet.getSkillId();
removeSkillId2 = armorSet.getShieldSkillId();
removeSkillId3 = armorSet.getEnchant6skillId();
}
else if(armorSet.containShield(item.getItemId())) // removed shield
{
remove = true;
removeSkillId2 = armorSet.getShieldSkillId();
}
}

if(remove)




меняем




if(slot == PAPERDOLL_CHEST)
{
L2ArmorSet armorSet = ArmorSetsTable.getInstance().getSet(item.getItemId());
if(armorSet == null)
return;

remove = true;
removeSkillId1 = armorSet.getSkillId();
removeSkillId2 = armorSet.getShieldSkillId();
removeSkillId3 = armorSet.getEnchant6skillId();
player.setEpic(false);
}
else
{
L2ItemInstance chestItem = getPaperdollItem(PAPERDOLL_CHEST);
if(chestItem == null)
return;

L2ArmorSet armorSet = ArmorSetsTable.getInstance().getSet(chestItem.getItemId());
if(armorSet == null)
return;

if(armorSet.containItem(slot, item.getItemId())) // removed part of set
{
remove = true;
removeSkillId1 = armorSet.getSkillId();
removeSkillId2 = armorSet.getShieldSkillId();
removeSkillId3 = armorSet.getEnchant6skillId();
player.setEpic(false);
}
else if(armorSet.containShield(item.getItemId())) // removed shield
{
remove = true;
removeSkillId2 = armorSet.getShieldSkillId();
}
}

if(remove)



далее файл com\l2jarchid\gameserver\model\actor\instance\L2PcInstance.java

ищем

private boolean _noble = false;
private boolean _hero = false;
добавляем
private boolean _epic = false;


далее ищем

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;

sendSkillList();
}


после него добавляем



public void setEpic(boolean epic)
{
if (epic)
{
sendMessage("Вы одели эпический сэт");
sendPacket(new UserInfo(this));
broadcastUserInfo();
}
else
{
sendPacket(new UserInfo(this));
broadcastUserInfo();
}
_epic = epic;

}


далее ищем



public boolean isHero()
{
return _hero;
}

добавляем

public boolean isEpic()
{
return _epic;
}



далее 2 файла пакетов

com\l2jarchid\gameserver\network\serverpackets\UserInfo.java
com\l2jarchid\gameserver\network\serverpackets\CharInfo.java

у обладателей других сборок файлы находятся

net\sf\l2j\gameserver\serverpackets\UserInfo.java
net\sf\l2j\gameserver\serverpackets\CharInfo.java

в обоих файлах ищем строку


writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); // Hero Aura

и заменяем на

writeC((_activeChar.isHero() || (_activeChar.isEpic()) || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); //0x01: Hero Aura

0
Антоха
Антоха

User

Бывалый

Posts: 289

На форуме с: 11/24/2008

Репутация: +333

Рейтинг: 0

· 04/10/2009, 02:31 AM

Многие возможно помнят сервер Infinity в котором убив определенное количество людей в пвп убийца получал свечение Героя,а когда его убивали оно пропадало.

Скрипт тестировался и работает 100%

Код
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1901)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -488,6 +488,11 @@

private boolean _noble = false;
private boolean _hero = false;
+
+ /** Special hero aura values */
+ private int heroConsecutiveKillCount = 0;
+ private boolean isPermaHero = false;
+ private boolean isPVPHero = false;

/** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
private L2FolkInstance _lastFolkNpc = null;
@@ -1971,6 +1976,13 @@
public void setPvpKills(int pvpKills)
{
_pvpKills = pvpKills;
+
+ // Set hero aura if pvp kills > 100
+ if (pvpKills > 100)
+ {
+ isPermaHero = true;
+ setHeroAura(true);
+ }
}

/**
@@ -4678,6 +4690,14 @@

stopRentPet();
stopWaterTask();
+
+ // Remove kill count for special hero aura if total pvp < 100
+ heroConsecutiveKillCount = 0;
+ if (!isPermaHero)
+ {
+ setHeroAura(false);
+ sendPacket(new UserInfo(this));
+ }
return true;
}

@@ -4897,6 +4917,13 @@
{
// Add karma to attacker and increase its PK counter
setPvpKills(getPvpKills() + 1);
+
+ // Increase the kill count for a special hero aura
+ heroConsecutiveKillCount++;
+
+ // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
+ if(heroConsecutiveKillCount > 4)
+ setHeroAura(true);

// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
sendPacket(new UserInfo(this));
@@ -8715,6 +8742,22 @@
{
return _blockList;
}
+
+ public void reloadPVPHeroAura()
+ {
+ sendPacket(new UserInfo(this));
+ }
+
+ public void setHeroAura (boolean heroAura)
+ {
+ isPVPHero = heroAura;
+ return;
+ }
+
+ public boolean getIsPVPHero()
+ {
+ return isPVPHero;
+ }

public void setHero(boolean hero)
{
Index: java/net/sf/l2j/gameserver/serverpackets/UserInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/serverpackets/UserInfo.java (revision 1901)
+++ java/net/sf/l2j/gameserver/serverpackets/UserInfo.java (working copy)
@@ -337,7 +337,7 @@

writeD(_activeChar.getClanCrestLargeId());
writeC(_activeChar.isNoble() ? 1 : 0); //0x01: symbol on char menu ctrl+I
- writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); //0x01: Hero Aura
+ writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA) || _activeChar.getIsPVPHero()) ? 1 : 0); //0x01: Hero Aura

writeC(_activeChar.isFishing() ? 1 : 0); //Fishing Mode
writeD(_activeChar.getFishx()); //fishing x

Дополнительная информация:

+ // Set hero aura if pvp kills > 100
+ if (pvpKills > 100)

Собрав 100 очков вы получите херо ауру,также как если бы вы зайдёте в игру и будете иметь 100 пвп,то после 101 пвп получите херо ауру

+ // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
+ if(heroConsecutiveKillCount > 4)


Тут даёт херо ауру только тогда если вы убили 4 раза подряд...Если умрёте,очки будут считатся занаво, а ваша аура пропадёт...Меняйте как хотите.

0
sterser
sterser

User

Бывалый

Posts: 181

На форуме с: 09/17/2008

Репутация: +58

Рейтинг: 0

· 05/12/2009, 04:56 PM

Бродил по форуму..
И увидел что много тем на Тему "Как сделать хиро при старте"

Ну есть вариант через ядро)

Идем сюда...

Цитата
L2Dot_IL_Source\java\net\sf\l2j\gameserver\network\serverpackets\CharInfo.java

Строчка примерно 327


Код
            writeD(_activeChar.getClanCrestLargeId());
             writeC(_activeChar.isNoble() ? 1 : 0); // Symbol on char menu ctrl+I
-             writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); // Hero Aura
+             writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA || (_activeChar.getAccessLevel()==0 && Config.HERO_AURA))) ? 1 : 0); // Hero Aura

              writeC(_activeChar.isFishing() ? 1 : 0); //0x01: Fishing Mode (Cant be undone by setting back to 0)


После
Идем сюда...
Цитата
L2Dot_IL_Source\java\net\sf\l2j\gameserver\network\serverpackets\UserInfo.java

Строчка примерно 296

Код
         writeC(_activeChar.isNoble() ? 1 : 0); //0x01: symbol on char menu ctrl+I
-     writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA)) ? 1 : 0); // Hero Aura
+       writeC((_activeChar.isHero() || (_activeChar.isGM() && Config.GM_HERO_AURA || (_activeChar.getAccessLevel()==0 && Config.HERO_AURA))) ? 1 : 0); // Hero Aura

        writeC(_activeChar.isFishing() ? 1 : 0); //Fishing Mode


Далее
Цитата
L2Dot_IL_Source\java\net\sf\l2j\Config.java

Строчка 1932

Код
    /** Place an aura around the GM ? */
    public static boolean GM_HERO_AURA;
+
+    /** Place an aura around the char ? */
+    public static boolean HERO_AURA;\
+
    /** Set the GM invulnerable at startup ? */
    public static boolean GM_STARTUP_INVULNERABLE;


Строчка 2560
Код
                GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(otherSettings.getProperty("GMStartupAutoList", "True"));
                GM_ADMIN_MENU_STYLE = otherSettings.getProperty("GMAdminMenuStyle", "modern");
+
+                HERO_AURA = Boolean.parseBoolean(otherSettings.getProperty("StartHeroAura", "True"));
+
                PETITIONING_ALLOWED =
Boolean.parseBoolean(otherSettings.getProperty("PetitioningAllowed", "True"));


Далее открываем конфинг other и добавляем..

Код
# Хиро при старте?Оо
StartHeroAura = True


Неважно где!

так же можно по експириментировать...
Вместо _activeChar.getAccessLevel()==0 можно поставить activeChar.isCastleLord(castleId)) и указать ид замка Адена, тогда при заходе в игру Лорд адена будет хиро..
Или например поставить activeChar.isNoble , т.е все нублы будут автоматом хиро)

Но скилов это не дает!!!

0
DeadAdsl
DeadAdsl

User

Ветеран

Posts: 1208

На форуме с: 12/21/2007

Репутация: +592

Рейтинг: 0

· 10/28/2009, 08:13 PM

Темку почистил - вдруг кто-нибудь захочет поделится своими наработками. Вопросы запрещены

— Заболел

0
F
Freesty1e

Author

Новичок

Posts: 1

На форуме с: 11/09/2009

Рейтинг: 0

· 11/10/2009, 10:00 AM

Сейчас я хочу вам рассказать, как создать команду .stat на уровне ядра:)
Если у вас нету stat.java тут, то создайте:
java\net\sf\l2j\gameserver\handler\voicedcommandhandlers\stat.java и сюда вписывамем следующее:
=================================================
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.L2Clan;
import net.sf.l2j.gameserver.model.PcInventory;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import javolution.text.TextBuilder;


public class stat
implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "stat" };

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if (command.equalsIgnoreCase("stat"))
{
if (activeChar.getTarget() == null)
{
activeChar.sendMessage("You have no one targeted.");
return false;
}

if (!(activeChar.getTarget() instanceof L2PcInstance))
{
activeChar.sendMessage("You can only get the info of a player.");
return false;
}

NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
L2PcInstance targetp = (L2PcInstance)activeChar.getTarget();

TextBuilder replyMSG = new TextBuilder("<html><body><center>");
replyMSG.append("<br><br><font color=\"00FF00\">=========>>" + targetp.getName() + "<<=========</font><br>");
replyMSG.append("<font color=\"FF0000\">Level: " + targetp.getLevel() + "</font><br>");

if (targetp.getClan() != null)
{
replyMSG.append("<font color=\"FF0000\">Clan: " + targetp.getClan().getName() + "</font><br>");
replyMSG.append("<font color=\"FF0000\">Alliance: " + targetp.getClan().getAllyName() + "</font><br>");
}
else
{
replyMSG.append("<font color=\"FF0000\">Alliance: None</font><br>");
replyMSG.append("<font color=\"FF0000\">Clan: None</font><br>");
}

replyMSG.append("<font color=\"FF0000\">Adena: " + targetp.getAdena() + "</font><br>");

if (activeChar.getInventory().getItemByItemId(6393) == null)
{
replyMSG.append("<font color=\"FF0000\">Medals : 0</font><br>");
}
else
{
replyMSG.append("<font color=\"FF0000\">Medals : " + targetp.getInventory().getItemByItemId(6393).getCount() + "</font><br>");
}

if (activeChar.getInventory().getItemByItemId(3470) == null)
{
replyMSG.append("<font color=\"FF0000\">Gold Bars : 0</font><br>");
}
else
{
replyMSG.append("<font color=\"FF0000\">Gold Bars : " + targetp.getInventory().getItemByItemId(3470).getCount() + "</font><br>");
}

replyMSG.append("<font color=\"FF0000\">PvP Kills: " + targetp.getPvpKills() + "</font><br>");
replyMSG.append("<font color=\"FF0000\">PvP Flags: " + targetp.getPvpFlag() + "</font><br>");
replyMSG.append("<font color=\"FF0000\">PK Kills: " + targetp.getPkKills() + "</font><br>");
replyMSG.append("<font color=\"FF0000\">HP, CP, MP: " + targetp.getMaxHp() + ", " + targetp.getMaxCp() + ", " + targetp.getMaxMp() + "</font><br>");
replyMSG.append("<font color=\"FF0000\">Wep Enchant: " + targetp.getActiveWeaponInstance().getEnchantLevel() + "</font><br>");
replyMSG.append("<font color=\"00FF00\">=========>>" + targetp.getName() + "<<=========" + "</font><br>");
replyMSG.append("</center></body></html>");

adminReply.setHtml(replyMSG.toString());
activeChar.sendPacket(adminReply);

adminReply = null;
targetp = null;
replyMSG = null;
}

return true;
}

public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}

=================================================
После чего, мы задаемся вопросом, а как же его вывести в конфиг, чтоб можно было вкл.\выкл.?
Делаем следующее:
\net\sf\l2j\gameserver\gameserver.java

import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Banking;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stat;

import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.GrandBosses.AntharasManager;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
добавили импорт, дальше катимся в низ и добавляем следующее:
................................................................................
.............

_voicedCommandHandler = VoicedCommandHandler.getInstance();
if(Config.L2JMOD_ALLOW_WEDDING)
//лог в консоле при загрузке
_log.config("VoicedCommand: " + _voicedCommandHandler.size() + " loaded... ok");
if(Config.BANKING_SYSTEM_ENABLED)
_voicedCommandHandler.registerVoicedCommandHandler(new Banking());
if(Config.ALLOW_STAT_VIEW)
_voicedCommandHandler.registerVoicedCommandHandler(new stat());

if(Config.PMOFF_SYSTEM_ENABLE)
_voicedCommandHandler.registerVoicedCommandHandler(new pmoff());
if(Config.Donate_SYSTEM_ENABLE)
_voicedCommandHandler.registerVoicedCommandHandler(new Donate());
if(Config.Online_SYSTEM_ENABLE)
=======================================================
Далее идем в net\sf\l2j\Config.java добавляем следующее:
public static boolean ALLOW_STAT_VIEW;
ниже:
ALLOW_STAT_VIEW = Boolean.valueOf(l2jmodsSettings.getProperty("AllowStatView", "False"));
Хочу напомнить, что не обязательно "l2jmodsSettings", это всего название конфигу где будет выведенно.
Ну и конешно в сам конфиг L2jmods пишем это:
AllowStatView = false :)

d94fefdbba8d.gif

0
Дима
Дима

User

Бывалый

Posts: 485

На форуме с: 02/23/2009

Репутация: +140

Рейтинг: 0

· 11/10/2009, 10:34 AM

сейчас я вам расскажу как сделать Хиро(правда без скилов) при старте и нублес при старте по проще:
идем сюда:

Код
java\net\sf\l2j\gameserver\model\actor\instance\

Открываем файл L2PcInstance
ищем строки 407, 408
Код
    private boolean _noble = false;
    private boolean _hero = false;

меняем на вот это:
Код
    private boolean _noble = net.sf.l2j.Config.Noble_is_Start;
    private boolean _hero = net.sf.l2j.Config.Hero_is_Start;

сразу для конфига

потом в файле
Код
java\net\sf\l2j\Config.java
конфига
добавляем это:
Код
    public static boolean           Noble_is_Start;
    public static boolean           Hero_is_Start;

и это:
Код
                Noble_is_Start = Boolean.valueOf(ForPvPSettings.getProperty("NobleisStart", "False"));
                Hero_is_Start = Boolean.valueOf(ForPvPSettings.getProperty("HeroisStart", "False"));

а потом уже настраиваем конфиг на True запускаем серв и смотрим:)

0
Войдите или зарегистрируйтесь чтобы ответить