24.10.2020 | 21:20
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум L2edit.Ru » Lineage 2 » Мануалы » [manual] Ядро
[manual] Ядро
FAQДата: Понедельник, 03.01.2011, 21:51 | Сообщение # 1
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
1.Как Вставлять .info Команду

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

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

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

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




загрузка наград ...

Сообщение отредактировал k911 - Понедельник, 03.01.2011, 21:54
 
FAQДата: Понедельник, 03.01.2011, 21:52 | Сообщение # 2
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
3. Как сделать скилл Block Buff
Для начала добавим в какой-либо конфиг-файл такие строчки:
Quote
# ID скилла, который блокирует наложение баффов - Block Buff
IDBlockBuff=9999

Далее добавим этот же конфиг в ядро - Config.java:
*объявляем
Quote
public static int ID_BLOCK_BUFF;

*инициализируем
Quote
ID_BLOCK_BUFF = Integer.parseInt(Имя_конфига.getProperty("IDBlockBuff", "9999"));

Далее, переходим в net\sf\l2j\gameserver\model\L2Character.java (net\sf\l2j может отличаться в зависимости от сборки). Находим кусок кода:
Quote
public final void addEffect(L2Effect newEffect)
{
if(newEffect == null) return;

и преобразовываем его так:
Quote
public final void addEffect(L2Effect newEffect)
{
if(newEffect == null) return;

if (this.getFirstEffect(Config.ID_BLOCK_BUFF) != null)
{
if (newEffect.getSkill().getSkillType() == L2Skill.SkillType.BUFF)
{
return;
}
}


Сохраняем, компилируем. Осталось прикрутить скилл в датапаке. Как вариант, вместо скилла Lucky:
Quote
<skill id="194" levels="1" name="BlockBuff">
<table name="#mpConsume_Init"> 0 </table>
<set name="mpInitialConsume" val="#mpConsume_Init"/>
<set name="power" val="0.0"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="CONT"/>
<set name="operateType" val="OP_TOGGLE"/>
<set name="castRange" val="-1"/>
<set name="effectRange" val="-1"/>
<for>
<effect count="0x7fffffff" name="ManaDamOverTime" time="1" val="#mpConsume_Init">
</effect>
</for>
</skill>

P.S:
Не забудьте только в конфиге поставить число 194 и изменить в клиенте сам скилл Lucky (сделать его аурой).

Вот вроде бы и все. Хочу сказать, что это только один из способов создания блок баффа: можно его также реализовать непосредственно написав отдельный эффект, но это уже другая история

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

Quote

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.



загрузка наград ...

Сообщение отредактировал k911 - Понедельник, 03.01.2011, 21:53
 
FAQДата: Понедельник, 03.01.2011, 21:52 | Сообщение # 3
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
5.Банковская Система

Это базовая и простая банковская система. Она очень простая:
Работает со следующими коммандами:
.bank
.deposit
.withdraw
.bank - Даёт инфу о банковской системе
.deposit - Будет менять Х адены на У голд бар
.withdraw - Будет делать обратное действие

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

Quote
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

Администрация может Сменить Ник на F.A.Q плз

Открывать Ядро Мона в Програмке "jd-gui"



загрузка наград ...

Сообщение отредактировал k911 - Понедельник, 03.01.2011, 22:00
 
FAQДата: Вторник, 04.01.2011, 16:03 | Сообщение # 4
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
6.Банки для невидимости

При выпивании банки становитесь невидимыми. При этом можно атаковать. Эффект длится 30 минут. Требуются исходники:

Quote (Код для ядра)
Index: /java/lt/equal/gameserver/network/clientpackets/AttackRequest.java

--- /java/lt/equal/gameserver/network/clientpackets/AttackRequest.java (revision 1)
+++ /java/lt/equal/gameserver/network/clientpackets/AttackRequest.java (revision 64)
@@ -68,4 +68,7 @@
target.onAction(activeChar);
}
+ //Invisible Character can't attack
+ if (activeChar.getAppearance().getInvisible() && !activeChar.isGM())
+ return;
else
{

Index: /java/lt/equal/gameserver/handler/itemhandlers/InvisiblePotion.java

--- /java/lt/equal/gameserver/handler/itemhandlers/InvisiblePotion.java (revision 64)
+++ /java/lt/equal/gameserver/handler/itemhandlers/InvisiblePotion.java (revision 64)
@@ -0,0 +1,140 @@
+/*
+ * 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 lt.equal.gameserver.handler.itemhandlers;
+
+import lt.equal.Config;
+import lt.equal.gameserver.ThreadPoolManager;
+import lt.equal.gameserver.handler.IItemHandler;
+import lt.equal.gameserver.model.L2ItemInstance;
+import lt.equal.gameserver.model.entity.CTF;
+import lt.equal.gameserver.model.actor.instance.L2PcInstance;
+import lt.equal.gameserver.model.actor.instance.L2PlayableInstance;
+import lt.equal.gameserver.network.serverpackets.ActionFailed;
+import lt.equal.gameserver.network.serverpackets.MagicSkillUser;
+
+/**
+ * @author `Аллигаторы®™
+ *
+ */
+
+public class InvisiblePotion implements IItemHandler
+{
+ private static final int[] ITEM_IDS =
+ { 9996 };
+
+ private static final int INVISIBLE_POTION_SKILL = 3267;
+
+ private static final int EFFECT_DURATION = 1200000; // 20 mins
+
+ public void useItem(L2PlayableInstance playable, L2ItemInstance item)
+ {
+ if (!(playable instanceof L2PcInstance))
+ return;
+ L2PcInstance activeChar = (L2PcInstance) playable;
+ if (activeChar.isHero())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isConfused())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isSilentMoving())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isDead())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isAlikeDead())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isFestivalParticipant())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isInFunEvent())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.inObserverMode())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isInOlympiadMode())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.getPvpFlag() != 0)
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if (activeChar.isCastingNow())
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+ if ((activeChar._inEventCTF && CTF._started && !Config.CTF_ALLOW_POTIONS))
+ {
+ activeChar.sendPacket(new ActionFailed());
+ }
+
+ MagicSkillUser MSU = new MagicSkillUser(playable, playable, 3267, 1, 0, 0);
+ activeChar.sendPacket(MSU);
+ activeChar.broadcastPacket(MSU);
+
+ activeChar.getAppearance().setInvisible();
+ activeChar.broadcastUserInfo();
+ activeChar.decayMe();
+ activeChar.spawnMe();
+ activeChar.sendMessage("You Are Now Invisible");
+ activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
+
+ InvisiblePotionStop mp = new InvisiblePotionStop(playable);
+ ThreadPoolManager.getInstance().scheduleEffect(mp, EFFECT_DURATION);
+ }
+
+ public class InvisiblePotionStop implements Runnable
+ {
+ private L2PlayableInstance _playable;
+
+ public InvisiblePotionStop(L2PlayableInstance playable)
+ {
+ _playable = playable;
+ }
+
+ public void run()
+ {
+ try
+ {
+ if (!(_playable instanceof L2PcInstance))
+ return;
+
+ ((L2PcInstance) _playable).getAppearance().setVisible();
+ ((L2PcInstance) _playable).sendMessage("You Are Now Visable!");
+ ((L2PcInstance) _playable).broadcastUserInfo();
+ }
+ catch (Throwable t)
+ {
+ }
+ }
+ }
+
+ public int[] getItemIds()
+ {
+ return ITEM_IDS;
+ }
+}

Index: /java/lt/equal/gameserver/handler/ItemHandler.java

--- /java/lt/equal/gameserver/handler/ItemHandler.java (revision 59)
+++ /java/lt/equal/gameserver/handler/ItemHandler.java (revision 64)
@@ -54,4 +54,5 @@
import lt.equal.gameserver.handler.itemhandlers.SpiritShot;
import lt.equal.gameserver.handler.itemhandlers.SummonItems;
+import lt.equal.gameserver.handler.itemhandlers.InvisiblePotion;


@@ -134,4 +135,5 @@
registerItemHandler(new HeroCustomItem());
registerItemHandler(new ByLeki());
+ registerItemHandler(new InvisiblePotion());

_log.config("ItemHandler: Loaded " + _datatable.size() + " handlers.");

Quote (Датапак)
Index: 3200-3299.xml

--- 3200-3299.xml (revision 15)
+++ 3200-3299.xml (working copy)
@@ -719,4 +719,12 @@
<for>
</for>
</skill>
+<skill id="3267" levels="1" name="Invisible Potion">
+ <set name="target" val="TARGET_NONE"/>
+ <set name="skillType" val="NOTDONE"/>
+ <set name="operateType" val="OP_ACTIVE"/>
+ <set name="castRange" val="-1"/>
+ <for>
+ </for>
+</skill>
</list>




загрузка наград ...
 
FAQДата: Вторник, 04.01.2011, 16:06 | Сообщение # 5
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
7. Отображаем онлайн в Гейм Сервере

мануал о том, как сделать отображение онлайна на гс сервере (требуются исходники)

Index: \java\net\sf\l2j\gameserver

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

import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.model.L2World;

public class OnlinePlayers
{
private static OnlinePlayers _instance;
class AnnounceOnline implements Runnable
{
public void run()
{
System.out.println(L2World.getInstance().getAllPlayers().size()+ " online players");
ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 300000); //Delay between system.out.printin 300000=5min
}
}
private OnlinePlayers()
{
ThreadPoolManager.getInstance().scheduleGeneral(new AnnounceOnline(), 180000); //Schedule load
}
public static OnlinePlayers getInstance()
{
if (_instance == null)
_instance = new OnlinePlayers();
return _instance;
}
}




загрузка наград ...
 
FAQДата: Вторник, 04.01.2011, 16:08 | Сообщение # 6
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
8.Удаление копирайтов, номера ревизии и пр. в сборка основанных на L2JServer

1) Открываем java\com\gameserver\network\clientpackets\enterworld.java
2) Открываем Enterworld.Java
Находим:
Quote
activeChar.sendMessage(getText("VGhpcyBzZXJ2ZXIgdXNlcyBMMkosIGEgcHJvamVjdCBmb3VuZGVkIGJ5IEwyQ2hlZg==\n"));
activeChar.sendMessage(getText("YW5kIGRldmVsb3BlZCBieSB0aGUgTDJKIERldiBUZWFtIGF0IGwyanNlcnZlci5jb20=\n"));

if (Config.DISPLAY_SERVER_VERSION)
{
if (Config.SERVER_VERSION != null)
activeChar.sendMessage(getText("TDJKIFNlcnZlciBWZXJzaW9uOg==")+" "+Config.SERVER_VERSION);

if (Config.DATAPACK_VERSION != null)
activeChar.sendMessage(getText("TDJKIERhdGFwYWNrIFZlcnNpb246")+" "+Config.DATAPACK_VERSION);

Ищем:

Quote

activeChar.sendMessage(getText("VGhpcyBzZXJ2ZXIgdXNlcyBMMkosIGEgcHJvamVjdCBmb3VuZGVkIGJ5IEwyQ2hlZg==\n"));
activeChar.sendMessage(getText("YW5kIGRldmVsb3BlZCBieSB0aGUgTDJKIERldiBUZWFtIGF0IGwyanNlcnZlci5jb20=\n"));

Заменяем на:

Quote
activeChar.sendMessage("Your Text");
activeChar.sendMessage("Your Text ");

Ищем:

Quote
if (Config.SERVER_VERSION != null)
activeChar.sendMessage(getText("TDJKIFNlcnZlciBWZXJzaW9uOg==")+" "+Config.SERVER_VERSION);

if (Config.DATAPACK_VERSION != null)
activeChar.sendMessage(getText("TDJKIERhdGFwYWNrIFZlcnNpb246")+" "+Config.DATAPACK_VERSION);

Заменяем на:

Quote
if (Config.SERVER_VERSION != null)
activeChar.sendMessage("Your Text);

if (Config.DATAPACK_VERSION != null)
activeChar.sendMessage("Your Texti ");




загрузка наград ...

Сообщение отредактировал k911 - Вторник, 04.01.2011, 16:09
 
FAQДата: Среда, 05.01.2011, 13:38 | Сообщение # 7
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
9.Голосование за рестарт сервера / Vote For The Server Restart (Требуются исходники)

С помощью этой команды игроки с вашего сервера смогут проголосовать за рестарт сервера.
Если есть 25 (настраивается в конфиге) голосов, то сервер будет перезагружен

Quote
Index: D:/Games/Server/WorkSpace/GameServer/java/config/Mods.properties
===================================================================
--- D:/Games/Server/WorkSpace/GameServer/java/config/Mods.properties (revision 194)
+++ D:/Games/Server/WorkSpace/GameServer/java/config/Mods.properties (working copy)
@@ -227,3 +227,12 @@
# Announce Level Settings
MinLevelToAnnounce = 1
MaxLevelToAnnounce = 80
+
+# ========================== #
+# Server Restart Voting #
+# ========================== #
+# Enable Server Restart Command
+AllowServerRestartCommand = False
+
+# Votes For Restart
+VotesNeededForRestart = 20
Index: D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/Config.java
===================================================================
--- D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/Config.java (revision 194)
+++ D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/Config.java (working copy)
@@ -960,6 +960,10 @@
public static int NPC_ANNOUNCER_MIN_LVL_TO_ANNOUNCE;
public static int NPC_ANNOUNCER_MAX_LVL_TO_ANNOUNCE;
public static boolean NPC_ANNOUNCER_DONATOR_ONLY;
+
+ /** Server Restart */
+ public static boolean ALLOW_SERVER_RESTART_COMMAND;
+ public static int VOTES_NEEDED_FOR_RESTART;

/** Event Automation */
public static int TIME_BETWEEN_EVENTS;
@@ -2091,6 +2095,9 @@
NPC_ANNOUNCER_MAX_ANNOUNCES_PER_DAY = Integer.parseInt(Mods.getProperty("AnnouncesPerDay", "20"));
NPC_ANNOUNCER_MIN_LVL_TO_ANNOUNCE = Integer.parseInt(Mods.getProperty("MinLevelToAnnounce", "0"));
NPC_ANNOUNCER_MAX_LVL_TO_ANNOUNCE = Integer.parseInt(Mods.getProperty("MaxLevelToAnnounce", "80"));
+
+ ALLOW_SERVER_RESTART_COMMAND = Boolean.parseBoolean(Mods.getProperty("AllowServerRestartCommand", "False"));
+ VOTES_NEEDED_FOR_RESTART = Integer.parseInt(Mods.getProperty("VotesNeededForRestart", "20"));
}
catch (Exception e)
{
Index: D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 196)
+++ D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -617,6 +617,9 @@
public boolean _inEventVIP = false;
public boolean _isNotVIP = false, _isTheVIP = false;
public int _originalNameColourVIP, _originalKarmaVIP;
+
+ /** Server Restart Vote Parameters */
+ public boolean _voteRestart = false;

/** new loto ticket **/
private int _loto[] = new int[5];
Index: D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/GameServer.java (revision 189)
+++ D:/Games/Server/WorkSpace/GameServer/java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -204,6 +204,7 @@
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.JoinVIP;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.OnlinePlayers;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.PmOff;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.ServerRestartVote;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TradeOff;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceInfo;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
@@ -620,6 +621,9 @@
_voicedCommandHandler.registerVoicedCommandHandler(new BuyRec());

_voicedCommandHandler.registerVoicedCommandHandler(new JoinVIP());
+
+ if(Config.ALLOW_SERVER_RESTART_COMMAND)
+ _voicedCommandHandler.registerVoicedCommandHandler(new ServerRestartVote());

_log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");

Создайте новый файл с названием ServerRestartVote.java в net.sf.l2j.gameserver.commandhandler.voicedcommands и вставьте:

Quote
/*
* 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.gameserver.Announcements;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.RestartVoteVariable;

/**
* @author SkyLanceR
*/

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

/**
*
* @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)
{
RestartVoteVariable e = new RestartVoteVariable();

if(command.startsWith("vote_restart"))
{
if (activeChar._voteRestart == false)
{
e.increaseVoteCount("restart");
activeChar._voteRestart = true;
activeChar.sendMessage("You succesfully voted for the server restart. Votes For The Moment: " + e.getVoteCount("tvt") + ".");
Announcements.getInstance().announceToAll("Player: "+activeChar.getName()+" has voted for server restart. If you whant to support him type .vote_restart !");
}
else
{
activeChar.sendMessage("You have already voted for an server restart.");
}
}
return false;
}

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

Создайте новый файл VoteVariable.java в net.sf.l2j.gameserver.model.actor.entity и вставьте:

Quote
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

package net.sf.l2j.gameserver.model.entity;

/**
*@author SkyLanceR
*/

public class RestartVoteVariable
{
public int _voteCountRestart = 0;
private int _voteCount = 0;

public int getVoteCount(String name)
{
if (name == "restart")
{
_voteCount = _voteCountRestart;
}
return _voteCount;
}

public void increaseVoteCount(String name)
{
if (name == "restart")
{
_voteCountRestart = _voteCountRestart+1;
}
}
}

Создайте файл RestartTheServer.java в net.sf.l2j.gameserver.model.actor.entity и вставьте:

Quote
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.model.entity;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.Shutdown;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

/**
* @author SkyLanceR
*/

public class RestartTheServer
{

public static void playerRestart(L2PcInstance activeChar, boolean restart)
{
RestartVoteVariable e = new RestartVoteVariable();

if (e.getVoteCount("restart") > Config.VOTES_NEEDED_FOR_RESTART)
{
Shutdown.getInstance().startShutdown(activeChar, 60, restart);
}
}
}




загрузка наград ...
 
Steep_0Дата: Воскресенье, 09.01.2011, 23:00 | Сообщение # 8
Steep_0
Группа: Постоянный
Сообщений: 127
Награды: 12
Репутация: 8
Статус: Offline
Сам писал или половину скопипастил?


загрузка наград ...
 
FAQДата: Понедельник, 10.01.2011, 00:19 | Сообщение # 9
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
tongue


загрузка наград ...

Сообщение отредактировал FAQ - Понедельник, 10.01.2011, 13:24
 
shownДата: Понедельник, 10.01.2011, 18:41 | Сообщение # 10
shown
Группа: Постоянный
Сообщений: 560
Награды: 43
Репутация: 167
Статус: Offline
Quote (FAQ)
tongue

А что это означает? smile



------------------------------
Если помог подари пожалуйста награду
------------------------------

загрузка наград ...
 
FAQДата: Понедельник, 10.01.2011, 18:50 | Сообщение # 11
FAQ
Группа: Заблокированные
Сообщений: 105
Награды: 4
Репутация: 9
Статус: Offline
Название Смайла ,у тя фигово страница загрузилась у мя такое било!!!


загрузка наград ...
 
Форум L2edit.Ru » Lineage 2 » Мануалы » [manual] Ядро
  • Страница 1 из 1
  • 1
Поиск: