Показать сообщение отдельно
Непрочитано 20.06.2010, 18:42   #1
Изгнанные

Автор темы (Топик Стартер) Делаем NPC обычными игроками! Из NPCs в PCs

Вступление:
Мы знаем что серверов Lineage 2 уже очень много и почти не чем они друг от друга не отличаются, но теперь у вас есть шанс это изменить!
Как именно? Превратив обычных, всем надоевших NPC на своем сервере, в игроков!

Старт:
Качаем данный архив-Скачать
Для начала вводим SQL "npc_to_pc_polymorph" и остальные в базу.

Что он сделает?

К примеру:
строка 1: Изменит всех "patrols" с внешним видом под ID template=31674 в людей (humans) одетых в аппела и держащих рендомное оружие.
строка 2: Изменит всех "patrols" из template 31673 в людей (humans) одетых в Аппела и держачих в руках луки.(Лук стандартный от обычных NPC)
строка 3: Превратит одного заспауненого (рендомного гуарда) в чара рассы kamael, чар будет одет в draconic, а в руке у него будет "Infinity dagger" Пол чара - random)
строка 4: Изменит всех гремленов в PC "Evil dwarves" с кармой и рендомным оружием, вещами и разным внешним видом!
строка 5-7: Превратит всех Goddard Siege NPCs в рендомных игроков файтеров.

Java code :

Мануал по инсталяции:


Первым делом скопируйте куда то эти три файла:

/gameserver/network/serverpackets/CustomNpcInfo.java
/gameserver/model/actor/instance/L2CustomNpcInstance.java
/gameserver/instancemanager/CustomNpcInstanceManager.java

В L2NpcInstance добавте это:

Код:
import net.sf.l2j.gameserver.instancemanager.CustomNpcIns tanceManager;

variable
+ /** The Polymorph object that manage this L2NpcInstance's morph to a PcInstance... I wrote this line too =P Darki699 */
+ private L2CustomNpcInstance _customNpcInstance;
+
В функцию onRandomAnimation() нужно вставить код чтоб PCs имели больше детальную анимацию чем NPCs

- // Send a packet SocialAction to all L2PcInstance in the _KnownPlayers of the L2NpcInstance
- SocialAction sa = new SocialAction(getObjectId(), Rnd.get(2, 3));
+ int min = (_customNpcInstance != null) ? 1 : 2;
+ int max = (_customNpcInstance != null) ? 13 : 3;
+ // Send a packet SocialAction to all L2PcInstance in the _KnownPlayers of the L2NpcInstance
+ SocialAction sa = new SocialAction(getObjectId(), Rnd.get(min, max));

В функцию setSpawn(L2Spawn spawn) добавляем данный код:
+ // Does this Npc morph into a PcInstance?
+ if (_spawn != null)
+ {
+ if (CustomNpcInstanceManager.getInstance().isThisL2Cu stomNpcInstance(_spawn.getId() , getNpcId()))
+ {
+ new L2CustomNpcInstance(this);
+ }
+ }

Ну и в конце L2NpcInstance.java добавте две строчки:

+ public L2CustomNpcInstance getCustomNpcInstance()
+ {
+ return _customNpcInstance;
+ }
+
+ public void setCustomNpcInstance(L2CustomNpcInstance arg)
+ {
+ _customNpcInstance = arg;
+ }

Теперь в NpcInfo.java (serverpackets) это поверх измененных NPCs, в коде NpcInfo(L2NpcInstance cha, L2Character attacker) добавте:

+ if (cha.getCustomNpcInstance() != null)
+ {
+ attacker.sendPacket(new CustomNpcInfo(cha));
+ if (_activeChar == null)
+ return;
+ }
Всё готово

Взято с AllCheats.
Ramzessuss вне форума Отправить сообщение для Ramzessuss с помощью ICQ Ответить с цитированием
Сказали спасибо: