Bien, empecemos por lo básico, me presento, soy Heisenberg, y ahora que nos conocemos voy a enseñarte todo lo que se acerca de este magnifico juego, y tambien sobre la creación de servidores de este maravilloso juego.
Antes de comenzar, si deseáis que haga algún tutorial sobre algo especifico sobre lo que tengáis dudas, escribidlo en los comentarios y lo prepararé lo antes posible.
Comencemos con la guía :
Está guía les ayudará a crear un servidor de lineage 2 basado en l2jserver, y les introducirá en la creación de servidores de Lineage 2.
NOTA: esta guia crea un servidor de l2 en la crónica que deseen (de entre las disponibles.)
1.Programas Necesarios:
Java: http://www.java.com/es/download/
Datapack (archivos del servidor) : http://www.l2jserver.com/forum/viewtopic.php?f=94&t=24625
Wampserver : http://www.wampserver.com/en/download.php
Después de la instalación de estos programas:
Una vez instalado java y wampserver, vamos a C:/ y creamos la carpeta Server, metemos dentro los archivos comprimidos del servidor, y descomprimimos
Iniciamos el wampserver, aparecera un icono de un medidor abajo a la izquierda, donde el reloj de windows, damos click izquierdo al medidor y hacemos click en la opción Put Online, cuando se inicie, volvemos a dar click izquierdo, pero esta vez hacemos click en phpmyadmin
cuando hagamos click a la opcion phpmyadmin, aparecerá una pagina que será nuestro servidor de Wampserver, donde crearemos la base de datos.
y en el recuadro que aparece escribimos el nombre de la base de datos (recomendable l2jdb)
le damos a crear y deberá salir La base de datos se creó.
ahora vamos a c:/server y entramos en la carpeta tools, hacemos click derecho en database_installer (.msdos , el que se puede ejecutar) y le damos a editar
buscamos la linea
set mysqlBinPath=%ProgramFiles%MySQLMySQL Server 5.1bin
y ahora vamos a C:wampbinmysqlmysql5.1.36bin
ya que ahi se encuentra algo que debemos editar para que salga todo bien, por lo que el tools debería quedar así:
set mysqlBinPath=C:wampbinmysqlmysql5.1.36bin
si hemos puesto otro nombre de database distinto a l2jdb, tendremos que editarlo aqui:
set lsdb=l2jdb lo de color azul se sustituiria por el nombre de la database
set gsdb=l2jdb lo de color azul se sustituiria por el nombre de la database
guardamos y salimos, ahora hacemos 2 click en database_installer.msdos y instalamos la database (FULL)
apretamos la tecla enter hasta que nos aparezca la opción para escribir "F" y le damos a enter:
cuando acabe de instalar las tablas veras un mensaje.
y ya para terminar instalariamos las tablas de el npc de bodas (opcional)
ya tenemos instalada la database de nuestro servidor.
2. Terminando el trabajo:
Ahora tenemos que hacer lo siguiente:
vamos a C:/ Server / Login / Config
y abrimos el archivo loginserver.properties (con block de notas)
y buscamos
# This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
# Common settings...
# 127.0.0.1 - If you are playing alone on a test server
# 192.168.x.x - This is if you are on a 192.168.x.x type network (behind a standard consumer router) and want other computers from JUST the internal network to be able to connect
# x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
# ---------------------------------------------------------------------------
# Default: 127.0.0.1
ExternalHostname = 127.0.0.1 (aqui se coloca tu ip externa, la puedes ver en www.see-my-ip.com (tambien se puede colocar un no-ip que te solucionara la vida si tienes ip dinamica, que cambia constantemente, pero eso es algo que explicare en mis otras guías)
# ---------------------------------------------------------------------------
# This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
# This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
# ---------------------------------------------------------------------------
# Default: 127.0.0.1
InternalHostname = 127.0.0.1 (cambiamos esto por tu ip interna, aparece en inicio/ejecutar, aparecera una ventana, escribes cmd y aparecera otra ventana llamada simbolo del sistema, entonces escribes ipconfig y ahi tienes tu ip interna) (Importante, fijate que entre el = y la ip o el no-ip hay un espacio, no lo quites, tiene que quedar igual que antes, pero con otra ip/dns)
_________________________________________________________________________________________________________________________
ahora vamos a C:/ Server / Gameserver / Config
y abrimos el archivo server.properties con block de notas, (igual que al abrir loginserver.properties)
# This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
# Common settings...
# 127.0.0.1 - If you are playing alone on a test server
# 192.168.x.x - This is if you are on a 192.168.x.x type network (behind a standard consumer router) and want other computers from JUST the internal network to be able to connect
# x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
# If this IP is resolvable by the Login Server, just leave *.
# ---------------------------------------------------------------------------
# Default: *
ExternalHostname = * (colocamos nuestra ip externa o dns)
# ---------------------------------------------------------------------------
# This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
# This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
# If this IP is resolvable by the Login Server, just leave *.
# ---------------------------------------------------------------------------
# Default: *
InternalHostname = * (colocamos la ip interna, que segun lo visto arriba, ya debes saber mirarla)
Ahora vamos a C:/ Server / Login
y abrimos Registergameserver.bat y le damos a registrar gameserver, elegimos 1.Bartz y confirmamos, nos dira que donde queremos crear el archivo, elegimos cualquier sitio que nos guste, y copiamos ese archivo y lo pegamos en :
C:/Server / Gameserver / Config
y en C:/ Server / Login / Config
con esto ya tendremos nuestro servidor creado, para iniciarlo solo tendremos que abrir el wampserver y abrir en :
C:/ Server / Login ---> abrimos el StartLoginserver.Bat C:/ Server / Gameserver ----> abrimos el StartGameServer.bat
y nos fijamos que no de ningun error al iniciar
y ya tendremos acabado nuestro servidor, ya solo falta entrar a jugar y arreglar los posibles bugs etc....
al iniciarse, podras ver que el servidor esta on, ( donde van los * al final de loginserver y la ip 127.0.0.1 serian la ip de tu servidor)
Nota: El Wampserver tiene que estar durante todos los pasos de la guía, tendra que estar ON
Actualización: para que la gente de fuera pueda conectarse a tu servidor es posible que tengas que abrir estos puertos en tu router:
Puertos IP de conexión TCP
80 (este seria el puerto de conexion web)
2106 (este seria el puerto de conexion al loginserver)
2009 (este seria el puerto de conexion al loginserver)
7777 (este seria el puerto de conexion al gameserver)
9014 (este seria el puerto de conexion al gameserver2)
3306 (este seria el puerto de conexion al gameserver3)
Puertos IP de conexión UDP
53 (este seria el puerto de conexiones externas)
todos estos puertos (según he leido por internet) son necesarios si tu router corta las conexiones, y si aun asi no pueden conectar, deberás comprobar elementos tales como el antivirus, firewall de windows...
FELICIDADES YA HAS CREADO TU SERVIDOR BASADO EN L2JSERVER!!
MUY IMPORTANTE, A PARTIR DE UNA DE LAS ULTIMAS CRONICAS, (NO ESTOY SEGURO DE CUAL , CREO QUE DE HIGH FIVE) LAS IP NO SE DEBEN CAMBIAR EN ESOS ARCHIVOS QUE PUSE MAS ARRIBA, SINO QUE SE DEBEN CAMBIAR EN OTRO ARCHIVO LLAMADO IPCONFIG.XML SI NO TENEIS ESTE ARCHIVO EN NINGUN SITIO, HACEDLO COMO PONE ARRIBA, SI LO TENEIS, DEBEIS CAMBIARLAS AHI COMO PONGO A CONTINUACION.
les dire que no deben cambiar ningun IP en los configs el unico ip q deben cambiar es en ipconfig.xml y seria algo asi como deberia quedarles:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Externalhost here (Internet IP) or Localhost IP for local test -->
<gameserver address="Tu ip External o 127.0.0.1 para jugar solo"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ipconfig.xsd">
<!-- Localhost here -->
<define subnet="127.0.0.0/8" address="127.0.0.1" />
<!-- Internalhosts here (LANs IPs) -->
<define subnet="10.0.0.0/8" address="10.0.0.0" />
<define subnet="172.16.0.0/19" address="172.16.0.0" />
<define subnet="192.168.0.0/16" address="192.168.0.0" />
</gameserver>
Mundo Lineage II
Blog acerca de la creación de servidores de lineage 2, soporte y guías para servidores de lineage 2.
domingo, 5 de octubre de 2014
martes, 1 de julio de 2014
Dar apariencia a los NPC de player.
Bien, comencemos a aprender como se le da apariencia de jugadores a los npc:
Este Addon da a los NPC apariencia de Players, aunque antes explicare algo bastante evidente pero que tal vez no conozcais, si os fijáis , el texto empieza con: índex: java/com...... dirás : ¿Pero esto que es? ¡no entiendo nada! no te preocupes, es muy fácil, eso solo quiere decir que es el directorio donde debes añadir ese código, hasta que encuentres el próximo índex si lo hubiera. para ello debes hacerlo con el source del datapack ( los archivos para compilar) y el eclipse. de todas formas revisa por si tuvieras esto en tu datapack ya compilado, para evitarte el trabajo de compilar.
Index: java/com/l2jserver/gameserver/datatables/FakePcsTable.java =================================================================== --- java/com/l2jserver/gameserver/datatables/FakePcsTable.java (revision 0) +++ java/com/l2jserver/gameserver/datatables/FakePcsTable.java (revision 0) @@ -0,0 +1,164 @@ +/* + * 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 com.l2jserver.gameserver.datatables; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javolution.util.FastMap; + +import com.l2jserver.L2DatabaseFactory; +import com.l2jserver.gameserver.model.actor.FakePc; + +/** + * Fake pc data table. + * + * @author BiTi + */ +public class FakePcsTable +{ + /** The logger<br> */ + private static Logger _log = Logger.getLogger(FakePcsTable.class.getName()); + + private FastMap<Integer, FakePc> _fakePcs = new FastMap<Integer, FakePc>(); + + private FakePcsTable() + { + loadData(); + } + + private void loadData() + { + _fakePcs.clear(); + + Connection con = null; + + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement stmt = con.prepareStatement("SELECT * FROM `fake_pcs`"); + ResultSet rset = stmt.executeQuery(); + + FakePc fpc = null; + + while (rset.next()) + { + fpc = new FakePc(); + + int npcId = rset.getInt("npc_id"); + fpc.race = rset.getInt("race"); + fpc.sex = rset.getInt("sex"); + fpc.clazz = rset.getInt("class"); + fpc.title = rset.getString("title"); + fpc.titleColor = Integer.decode("0x" + rset.getString("title_color")); + fpc.name = rset.getString("name"); + fpc.nameColor = Integer.decode("0x" + rset.getString("name_color")); + fpc.hairStyle = rset.getInt("hair_style"); + fpc.hairColor = rset.getInt("hair_color"); + fpc.face = rset.getInt("face"); + fpc.mount = rset.getByte("mount"); + fpc.team = rset.getByte("team"); + fpc.hero = rset.getByte("hero"); + fpc.pdUnder = rset.getInt("pd_under"); + fpc.pdUnderAug = rset.getInt("pd_under_aug"); + fpc.pdHead = rset.getInt("pd_head"); + fpc.pdHeadAug = rset.getInt("pd_head_aug"); + fpc.pdRHand = rset.getInt("pd_rhand"); + fpc.pdRHandAug = rset.getInt("pd_rhand_aug"); + fpc.pdLHand = rset.getInt("pd_lhand"); + fpc.pdLHandAug = rset.getInt("pd_lhand_aug"); + fpc.pdGloves = rset.getInt("pd_gloves"); + fpc.pdGlovesAug = rset.getInt("pd_gloves_aug"); + fpc.pdChest = rset.getInt("pd_chest"); + fpc.pdChestAug = rset.getInt("pd_chest_aug"); + fpc.pdLegs = rset.getInt("pd_legs"); + fpc.pdLegsAug = rset.getInt("pd_legs_aug"); + fpc.pdFeet = rset.getInt("pd_feet"); + fpc.pdFeetAug = rset.getInt("pd_feet_aug"); + fpc.pdBack = rset.getInt("pd_back"); + fpc.pdBackAug = rset.getInt("pd_back_aug"); + fpc.pdLRHand = rset.getInt("pd_lrhand"); + fpc.pdLRHandAug = rset.getInt("pd_lrhand_aug"); + fpc.pdHair = rset.getInt("pd_hair"); + fpc.pdHairAug = rset.getInt("pd_hair_aug"); + fpc.pdHair2 = rset.getInt("pd_hair2"); + fpc.pdHair2Aug = rset.getInt("pd_hair2_aug"); + fpc.pdRBracelet = rset.getInt("pd_rbracelet"); + fpc.pdRBraceletAug = rset.getInt("pd_rbracelet_aug"); + fpc.pdLBracelet = rset.getInt("pd_lbracelet"); + fpc.pdLBraceletAug = rset.getInt("pd_lbracelet_aug"); + fpc.pdDeco1 = rset.getInt("pd_deco1"); + fpc.pdDeco1Aug = rset.getInt("pd_deco1_aug"); + fpc.pdDeco2 = rset.getInt("pd_deco2"); + fpc.pdDeco2Aug = rset.getInt("pd_deco2_aug"); + fpc.pdDeco3 = rset.getInt("pd_deco3"); + fpc.pdDeco3Aug = rset.getInt("pd_deco3_aug"); + fpc.pdDeco4 = rset.getInt("pd_deco4"); + fpc.pdDeco4Aug = rset.getInt("pd_deco4_aug"); + fpc.pdDeco5 = rset.getInt("pd_deco5"); + fpc.pdDeco5Aug = rset.getInt("pd_deco5_aug"); + fpc.pdDeco6 = rset.getInt("pd_deco6"); + fpc.pdDeco6Aug = rset.getInt("pd_deco6_aug"); + fpc.enchantEffect = rset.getInt("enchant_effect"); + fpc.pvpFlag = rset.getInt("pvp_flag"); + fpc.karma = rset.getInt("karma"); + fpc.fishing = rset.getByte("fishing"); + fpc.fishingX = rset.getInt("fishing_x"); + fpc.fishingY = rset.getInt("fishing_y"); + fpc.fishingZ = rset.getInt("fishing_z"); + fpc.invisible = rset.getByte("invisible"); + _fakePcs.put(npcId, fpc); + } + + rset.close(); + stmt.close(); + } + catch (SQLException e) + { + _log.log(Level.SEVERE, "Error while creating fake pc table: " + e.getMessage(), e); + } + finally + { + L2DatabaseFactory.close(con); + } + } + + public void reloadData() + { + loadData(); + } + + public FakePc getFakePc(int npcId) + { + return _fakePcs.get(npcId); + } + + public static FakePcsTable getInstance() + { + return SingletonHolder._instance; + } + + @SuppressWarnings("synthetic-access") + private static class SingletonHolder + { + protected static final FakePcsTable _instance = new FakePcsTable(); + } +} \ No newline at end of file Index: java/com/l2jserver/gameserver/model/actor/FakePc.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/FakePc.java (revision 0) +++ java/com/l2jserver/gameserver/model/actor/FakePc.java (revision 0) @@ -0,0 +1,86 @@ +/* + * 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 com.l2jserver.gameserver.model.actor; + +/** + * Fake pc data model. + * + * @author BiTi + */ +public class FakePc +{ + public int race; + public int sex; + public int clazz; + public String title; + public int titleColor; + public String name; + public int nameColor; + public int hairStyle; + public int hairColor; + public int face; + public byte mount; + public byte team; + public byte hero; + public int pdUnder; + public int pdUnderAug; + public int pdHead; + public int pdHeadAug; + public int pdRHand; + public int pdRHandAug; + public int pdLHand; + public int pdLHandAug; + public int pdGloves; + public int pdGlovesAug; + public int pdChest; + public int pdChestAug; + public int pdLegs; + public int pdLegsAug; + public int pdFeet; + public int pdFeetAug; + public int pdBack; + public int pdBackAug; + public int pdLRHand; + public int pdLRHandAug; + public int pdHair; + public int pdHairAug; + public int pdHair2; + public int pdHair2Aug; + public int pdRBracelet; + public int pdRBraceletAug; + public int pdLBracelet; + public int pdLBraceletAug; + public int pdDeco1; + public int pdDeco1Aug; + public int pdDeco2; + public int pdDeco2Aug; + public int pdDeco3; + public int pdDeco3Aug; + public int pdDeco4; + public int pdDeco4Aug; + public int pdDeco5; + public int pdDeco5Aug; + public int pdDeco6; + public int pdDeco6Aug; + public int enchantEffect; + public int pvpFlag; + public int karma; + public byte fishing; + public int fishingX; + public int fishingY; + public int fishingZ; + public byte invisible; +} \ No newline at end of file Index: java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java (revision 4422) +++ java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java (working copy) @@ -15,9 +15,12 @@ package com.l2jserver.gameserver.network.serverpackets; import com.l2jserver.Config; +import com.l2jserver.gameserver.datatables.CharTemplateTable; import com.l2jserver.gameserver.datatables.ClanTable; +import com.l2jserver.gameserver.datatables.FakePcsTable; import com.l2jserver.gameserver.instancemanager.TownManager; import com.l2jserver.gameserver.model.L2Clan; +import com.l2jserver.gameserver.model.actor.FakePc; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Summon; @@ -26,6 +29,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.skills.AbnormalEffect; +import com.l2jserver.gameserver.templates.chars.L2PcTemplate; /** * This class ... @@ -105,14 +109,14 @@ _isAttackable = cha.isAutoAttackable(attacker); if (cha.getTemplate().serverSideName) _name = cha.getName();// On every subclass - + if (Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion()) _title = (Config.L2JMOD_CHAMP_TITLE); // On every subclass else if (cha.getTemplate().serverSideTitle) _title = cha.getTemplate().title; // On every subclass else _title = cha.getTitle(); // On every subclass - + if (Config.SHOW_NPC_LVL && _npc instanceof L2MonsterInstance) { String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : ""); @@ -142,61 +146,204 @@ @Override protected void writeImpl() { - writeC(0x0c); - writeD(_npc.getObjectId()); - writeD(_idTemplate + 1000000); // npctype id - writeD(_isAttackable ? 1 : 0); - writeD(_x); - writeD(_y); - writeD(_z); - writeD(_heading); - writeD(0x00); - writeD(_mAtkSpd); - writeD(_pAtkSpd); - writeD(_runSpd); - writeD(_walkSpd); - writeD(_runSpd); // swim run speed - writeD(_walkSpd); // swim walk speed - writeD(_runSpd); // swim run speed - writeD(_walkSpd); // swim walk speed - writeD(_runSpd); // fly run speed - writeD(_walkSpd); // fly run speed - writeF(_npc.getMovementSpeedMultiplier()); - writeF(_npc.getAttackSpeedMultiplier()); - writeF(_collisionRadius); - writeF(_collisionHeight); - writeD(_rhand); // right hand weapon - writeD(_chest); - writeD(_lhand); // left hand weapon - writeC(1); // name above char 1=true ... ?? - writeC(_npc.isRunning() ? 1 : 0); - writeC(_npc.isInCombat() ? 1 : 0); - writeC(_npc.isAlikeDead() ? 1 : 0); - writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned - writeS(_name); - writeS(_title); - writeD(0x00); // Title color 0=client default - writeD(0x00); //pvp flag - writeD(0x00); // karma - - writeD(_npc.getAbnormalEffect()); // C2 - writeD(_clanId); //clan id - writeD(_clanCrest); //crest id - writeD(_allyId); // ally id - writeD(_allyCrest); // all crest - writeC(_npc.isFlying() ? 2 : 0); // C2 - writeC(0x00); // title color 0=client - - writeF(_collisionRadius); - writeF(_collisionHeight); - writeD(_enchantEffect); // C4 - writeD(_npc.isFlying() ? 1 : 0); // C6 - writeD(0x00); - writeD(0x00);// CT1.5 Pet form and skills - writeC(_npc.isHideName() ? 0x00 : 0x01); - writeC(_npc.isHideName() ? 0x00 : 0x01); - writeD(_npc.getSpecialEffect()); - writeD(_displayEffect); + FakePc fpc = FakePcsTable.getInstance().getFakePc(_npc.getNpcId()); + if (fpc != null) + { + writeC(0x31); + writeD(_x); + writeD(_y); + writeD(_z); + writeD(0x00); // vehicle id + writeD(_npc.getObjectId()); + writeS(fpc.name); // visible name + writeD(fpc.race); + writeD(fpc.sex); + writeD(fpc.clazz); + + writeD(fpc.pdUnder); + writeD(fpc.pdHead); + writeD(fpc.pdRHand); + writeD(fpc.pdLHand); + writeD(fpc.pdGloves); + writeD(fpc.pdChest); + writeD(fpc.pdLegs); + writeD(fpc.pdFeet); + writeD(fpc.pdBack); + writeD(fpc.pdLRHand); + writeD(fpc.pdHair); + writeD(fpc.pdHair2); + writeD(fpc.pdRBracelet); + writeD(fpc.pdLBracelet); + writeD(fpc.pdDeco1); + writeD(fpc.pdDeco2); + writeD(fpc.pdDeco3); + writeD(fpc.pdDeco4); + writeD(fpc.pdDeco5); + writeD(fpc.pdDeco6); + writeD(0x00); // belt + + writeD(fpc.pdUnderAug); + writeD(fpc.pdHeadAug); + writeD(fpc.pdRHandAug); + writeD(fpc.pdLHandAug); + writeD(fpc.pdGlovesAug); + writeD(fpc.pdChestAug); + writeD(fpc.pdLegsAug); + writeD(fpc.pdFeetAug); + writeD(fpc.pdBackAug); + writeD(fpc.pdLRHandAug); + writeD(fpc.pdHairAug); + writeD(fpc.pdHair2Aug); + writeD(fpc.pdRBraceletAug); + writeD(fpc.pdLBraceletAug); + writeD(fpc.pdDeco1Aug); + writeD(fpc.pdDeco2Aug); + writeD(fpc.pdDeco3Aug); + writeD(fpc.pdDeco4Aug); + writeD(fpc.pdDeco5Aug); + writeD(fpc.pdDeco6Aug); + writeD(0x00); // belt aug + writeD(0x00); + writeD(0x01); + + writeD(fpc.pvpFlag); + writeD(fpc.karma); + + writeD(_mAtkSpd); + writeD(_pAtkSpd); + + writeD(0x00); + + writeD(_runSpd); + writeD(_walkSpd); + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // fly run speed + writeD(_walkSpd); // fly walk speed + writeD(_runSpd); + writeD(_walkSpd); + writeF(_npc.getMovementSpeedMultiplier()); // _activeChar.getProperMultiplier() + writeF(_npc.getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier() + + // TODO: add handling of mount collision + L2PcTemplate pctmpl = CharTemplateTable.getInstance().getTemplate(fpc.clazz); + writeF(fpc.sex == 0 ? pctmpl.fCollisionRadius : pctmpl.fCollisionRadius_female); + writeF(fpc.sex == 0 ? pctmpl.fCollisionHeight : pctmpl.fCollisionHeight_female); + + writeD(fpc.hairStyle); + writeD(fpc.hairColor); + writeD(fpc.face); + + writeS(fpc.title); // visible title + + writeD(0x00); // clan id + writeD(0x00); // clan crest id + writeD(0x00); // ally id + writeD(0x00); // ally crest id + + writeC(0x01); // standing = 1 sitting = 0 + writeC(_npc.isRunning() ? 1 : 0); // running = 1 walking = 0 + writeC(_npc.isInCombat() ? 1 : 0); + writeC(_npc.isAlikeDead() ? 1 : 0); + + writeC(fpc.invisible); // invisible = 1 visible =0 + + writeC(fpc.mount); // 1 on strider 2 on wyvern 3 on Great Wolf 0 no mount + writeC(0x00); // 1 - sellshop + writeH(0x00); // cubic count + //for (int id : allCubics) + // writeH(id); + writeC(0x00); // find party members + writeD(0x00); // abnormal effect + writeC(0x00); // isFlying() ? 2 : 0 + writeH(0x00); //getRecomHave(): Blue value for name (0 = white, 255 = pure blue) + writeD(1000000); // getMountNpcId() + 1000000 + writeD(fpc.clazz); + writeD(0x00); // ? + writeC(fpc.enchantEffect); + writeC(fpc.team); //team circle around feet 1= Blue, 2 = red + writeD(0x00); // getClanCrestLargeId() + writeC(0x00); // isNoble(): Symbol on char menu ctrl+I + writeC(fpc.hero); // Hero Aura + writeC(fpc.fishing); //0x01: Fishing Mode (Cant be undone by setting back to 0) + writeD(fpc.fishingX); + writeD(fpc.fishingY); + writeD(fpc.fishingZ); + + writeD(fpc.nameColor); + writeD(_heading); + writeD(0x00); // pledge class + writeD(0x00); // pledge type + writeD(fpc.titleColor); + + writeD(0x00); // cursed weapon level + writeD(0x00); // reputation score + writeD(0x00); // transformation id + writeD(0x00); // agathion id + writeD(0x01); // T2 ? + writeD(0x00); // special effect + /*writeD(0x00); // territory Id + writeD(0x00); // is Disguised + writeD(0x00); // territory Id*/ + } + else + { + writeC(0x0c); + writeD(_npc.getObjectId()); + writeD(_idTemplate + 1000000); // npctype id + writeD(_isAttackable ? 1 : 0); + writeD(_x); + writeD(_y); + writeD(_z); + writeD(_heading); + writeD(0x00); + writeD(_mAtkSpd); + writeD(_pAtkSpd); + writeD(_runSpd); + writeD(_walkSpd); + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // fly run speed + writeD(_walkSpd); // fly run speed + writeF(_npc.getMovementSpeedMultiplier()); + writeF(_npc.getAttackSpeedMultiplier()); + writeF(_collisionRadius); + writeF(_collisionHeight); + writeD(_rhand); // right hand weapon + writeD(_chest); + writeD(_lhand); // left hand weapon + writeC(1); // name above char 1=true ... ?? + writeC(_npc.isRunning() ? 1 : 0); + writeC(_npc.isInCombat() ? 1 : 0); + writeC(_npc.isAlikeDead() ? 1 : 0); + writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned + writeS(_name); + writeS(_title); + writeD(0x00); // Title color 0=client default + writeD(0x00); //pvp flag + writeD(0x00); // karma + + writeD(_npc.getAbnormalEffect()); // C2 + writeD(_clanId); //clan id + writeD(_clanCrest); //crest id + writeD(_allyId); // ally id + writeD(_allyCrest); // all crest + writeC(_npc.isFlying() ? 2 : 0); // C2 + writeC(0x00); // title color 0=client + + writeF(_collisionRadius); + writeF(_collisionHeight); + writeD(_enchantEffect); // C4 + writeD(_npc.isFlying() ? 1 : 0); // C6 + writeD(0x00); + writeD(0x00);// CT1.5 Pet form and skills + writeC(_npc.isHideName() ? 0x00 : 0x01); + writeC(_npc.isHideName() ? 0x00 : 0x01); + writeD(_npc.getSpecialEffect()); + writeD(_displayEffect); + } } } @@ -300,7 +447,7 @@ _val = val; if (_summon.isShowSummonAnimation()) _val = 2; //override for spawn - + int npcId = cha.getTemplate().npcId; if (npcId == 16041 || npcId == 16042)
Y esto en el datapack:
Y una vez que este todo terminado y agregado el SQL, copian el ID del NPC que quieren que se visualice como Player y lo pegan en el ID de la Tabla Fakepcs
Por defecto cuando pones el sql en la tabla Fakepcs ya viene creado un Npc Player, con el ID 60001
deberas de poner el Id de tu NPC en 60001.
Index: C:/Users/heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java
=================================================================== --- C:/Users/Heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java (revision 7667) +++ C:/Users/Heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java (working copy) @@ -27,6 +27,7 @@ import com.l2jserver.gameserver.datatables.DoorTable; import com.l2jserver.gameserver.datatables.ExtractableItemsData; import com.l2jserver.gameserver.datatables.ExtractableSkillsData; +import com.l2jserver.gameserver.datatables.FakePcsTable; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.datatables.NpcTable; @@ -289,6 +290,11 @@ QuestManager.getInstance().reloadAllQuests(); activeChar.sendMessage("All Quests have been reloaded"); } + else if (type.startsWith("fakenpc")) + { + FakePcsTable.getInstance().reloadData(); + activeChar.sendMessage("All Fake NPCs have been reloaded"); + } else if (type.startsWith("door")) { DoorTable.getInstance().reloadAll();
Este Addon da a los NPC apariencia de Players, aunque antes explicare algo bastante evidente pero que tal vez no conozcais, si os fijáis , el texto empieza con: índex: java/com...... dirás : ¿Pero esto que es? ¡no entiendo nada! no te preocupes, es muy fácil, eso solo quiere decir que es el directorio donde debes añadir ese código, hasta que encuentres el próximo índex si lo hubiera. para ello debes hacerlo con el source del datapack ( los archivos para compilar) y el eclipse. de todas formas revisa por si tuvieras esto en tu datapack ya compilado, para evitarte el trabajo de compilar.
Index: java/com/l2jserver/gameserver/datatables/FakePcsTable.java =================================================================== --- java/com/l2jserver/gameserver/datatables/FakePcsTable.java (revision 0) +++ java/com/l2jserver/gameserver/datatables/FakePcsTable.java (revision 0) @@ -0,0 +1,164 @@ +/* + * 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 com.l2jserver.gameserver.datatables; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; + +import javolution.util.FastMap; + +import com.l2jserver.L2DatabaseFactory; +import com.l2jserver.gameserver.model.actor.FakePc; + +/** + * Fake pc data table. + * + * @author BiTi + */ +public class FakePcsTable +{ + /** The logger<br> */ + private static Logger _log = Logger.getLogger(FakePcsTable.class.getName()); + + private FastMap<Integer, FakePc> _fakePcs = new FastMap<Integer, FakePc>(); + + private FakePcsTable() + { + loadData(); + } + + private void loadData() + { + _fakePcs.clear(); + + Connection con = null; + + try + { + con = L2DatabaseFactory.getInstance().getConnection(); + + PreparedStatement stmt = con.prepareStatement("SELECT * FROM `fake_pcs`"); + ResultSet rset = stmt.executeQuery(); + + FakePc fpc = null; + + while (rset.next()) + { + fpc = new FakePc(); + + int npcId = rset.getInt("npc_id"); + fpc.race = rset.getInt("race"); + fpc.sex = rset.getInt("sex"); + fpc.clazz = rset.getInt("class"); + fpc.title = rset.getString("title"); + fpc.titleColor = Integer.decode("0x" + rset.getString("title_color")); + fpc.name = rset.getString("name"); + fpc.nameColor = Integer.decode("0x" + rset.getString("name_color")); + fpc.hairStyle = rset.getInt("hair_style"); + fpc.hairColor = rset.getInt("hair_color"); + fpc.face = rset.getInt("face"); + fpc.mount = rset.getByte("mount"); + fpc.team = rset.getByte("team"); + fpc.hero = rset.getByte("hero"); + fpc.pdUnder = rset.getInt("pd_under"); + fpc.pdUnderAug = rset.getInt("pd_under_aug"); + fpc.pdHead = rset.getInt("pd_head"); + fpc.pdHeadAug = rset.getInt("pd_head_aug"); + fpc.pdRHand = rset.getInt("pd_rhand"); + fpc.pdRHandAug = rset.getInt("pd_rhand_aug"); + fpc.pdLHand = rset.getInt("pd_lhand"); + fpc.pdLHandAug = rset.getInt("pd_lhand_aug"); + fpc.pdGloves = rset.getInt("pd_gloves"); + fpc.pdGlovesAug = rset.getInt("pd_gloves_aug"); + fpc.pdChest = rset.getInt("pd_chest"); + fpc.pdChestAug = rset.getInt("pd_chest_aug"); + fpc.pdLegs = rset.getInt("pd_legs"); + fpc.pdLegsAug = rset.getInt("pd_legs_aug"); + fpc.pdFeet = rset.getInt("pd_feet"); + fpc.pdFeetAug = rset.getInt("pd_feet_aug"); + fpc.pdBack = rset.getInt("pd_back"); + fpc.pdBackAug = rset.getInt("pd_back_aug"); + fpc.pdLRHand = rset.getInt("pd_lrhand"); + fpc.pdLRHandAug = rset.getInt("pd_lrhand_aug"); + fpc.pdHair = rset.getInt("pd_hair"); + fpc.pdHairAug = rset.getInt("pd_hair_aug"); + fpc.pdHair2 = rset.getInt("pd_hair2"); + fpc.pdHair2Aug = rset.getInt("pd_hair2_aug"); + fpc.pdRBracelet = rset.getInt("pd_rbracelet"); + fpc.pdRBraceletAug = rset.getInt("pd_rbracelet_aug"); + fpc.pdLBracelet = rset.getInt("pd_lbracelet"); + fpc.pdLBraceletAug = rset.getInt("pd_lbracelet_aug"); + fpc.pdDeco1 = rset.getInt("pd_deco1"); + fpc.pdDeco1Aug = rset.getInt("pd_deco1_aug"); + fpc.pdDeco2 = rset.getInt("pd_deco2"); + fpc.pdDeco2Aug = rset.getInt("pd_deco2_aug"); + fpc.pdDeco3 = rset.getInt("pd_deco3"); + fpc.pdDeco3Aug = rset.getInt("pd_deco3_aug"); + fpc.pdDeco4 = rset.getInt("pd_deco4"); + fpc.pdDeco4Aug = rset.getInt("pd_deco4_aug"); + fpc.pdDeco5 = rset.getInt("pd_deco5"); + fpc.pdDeco5Aug = rset.getInt("pd_deco5_aug"); + fpc.pdDeco6 = rset.getInt("pd_deco6"); + fpc.pdDeco6Aug = rset.getInt("pd_deco6_aug"); + fpc.enchantEffect = rset.getInt("enchant_effect"); + fpc.pvpFlag = rset.getInt("pvp_flag"); + fpc.karma = rset.getInt("karma"); + fpc.fishing = rset.getByte("fishing"); + fpc.fishingX = rset.getInt("fishing_x"); + fpc.fishingY = rset.getInt("fishing_y"); + fpc.fishingZ = rset.getInt("fishing_z"); + fpc.invisible = rset.getByte("invisible"); + _fakePcs.put(npcId, fpc); + } + + rset.close(); + stmt.close(); + } + catch (SQLException e) + { + _log.log(Level.SEVERE, "Error while creating fake pc table: " + e.getMessage(), e); + } + finally + { + L2DatabaseFactory.close(con); + } + } + + public void reloadData() + { + loadData(); + } + + public FakePc getFakePc(int npcId) + { + return _fakePcs.get(npcId); + } + + public static FakePcsTable getInstance() + { + return SingletonHolder._instance; + } + + @SuppressWarnings("synthetic-access") + private static class SingletonHolder + { + protected static final FakePcsTable _instance = new FakePcsTable(); + } +} \ No newline at end of file Index: java/com/l2jserver/gameserver/model/actor/FakePc.java =================================================================== --- java/com/l2jserver/gameserver/model/actor/FakePc.java (revision 0) +++ java/com/l2jserver/gameserver/model/actor/FakePc.java (revision 0) @@ -0,0 +1,86 @@ +/* + * 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 com.l2jserver.gameserver.model.actor; + +/** + * Fake pc data model. + * + * @author BiTi + */ +public class FakePc +{ + public int race; + public int sex; + public int clazz; + public String title; + public int titleColor; + public String name; + public int nameColor; + public int hairStyle; + public int hairColor; + public int face; + public byte mount; + public byte team; + public byte hero; + public int pdUnder; + public int pdUnderAug; + public int pdHead; + public int pdHeadAug; + public int pdRHand; + public int pdRHandAug; + public int pdLHand; + public int pdLHandAug; + public int pdGloves; + public int pdGlovesAug; + public int pdChest; + public int pdChestAug; + public int pdLegs; + public int pdLegsAug; + public int pdFeet; + public int pdFeetAug; + public int pdBack; + public int pdBackAug; + public int pdLRHand; + public int pdLRHandAug; + public int pdHair; + public int pdHairAug; + public int pdHair2; + public int pdHair2Aug; + public int pdRBracelet; + public int pdRBraceletAug; + public int pdLBracelet; + public int pdLBraceletAug; + public int pdDeco1; + public int pdDeco1Aug; + public int pdDeco2; + public int pdDeco2Aug; + public int pdDeco3; + public int pdDeco3Aug; + public int pdDeco4; + public int pdDeco4Aug; + public int pdDeco5; + public int pdDeco5Aug; + public int pdDeco6; + public int pdDeco6Aug; + public int enchantEffect; + public int pvpFlag; + public int karma; + public byte fishing; + public int fishingX; + public int fishingY; + public int fishingZ; + public byte invisible; +} \ No newline at end of file Index: java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java =================================================================== --- java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java (revision 4422) +++ java/com/l2jserver/gameserver/network/serverpackets/AbstractNpcInfo.java (working copy) @@ -15,9 +15,12 @@ package com.l2jserver.gameserver.network.serverpackets; import com.l2jserver.Config; +import com.l2jserver.gameserver.datatables.CharTemplateTable; import com.l2jserver.gameserver.datatables.ClanTable; +import com.l2jserver.gameserver.datatables.FakePcsTable; import com.l2jserver.gameserver.instancemanager.TownManager; import com.l2jserver.gameserver.model.L2Clan; +import com.l2jserver.gameserver.model.actor.FakePc; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Summon; @@ -26,6 +29,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.skills.AbnormalEffect; +import com.l2jserver.gameserver.templates.chars.L2PcTemplate; /** * This class ... @@ -105,14 +109,14 @@ _isAttackable = cha.isAutoAttackable(attacker); if (cha.getTemplate().serverSideName) _name = cha.getName();// On every subclass - + if (Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion()) _title = (Config.L2JMOD_CHAMP_TITLE); // On every subclass else if (cha.getTemplate().serverSideTitle) _title = cha.getTemplate().title; // On every subclass else _title = cha.getTitle(); // On every subclass - + if (Config.SHOW_NPC_LVL && _npc instanceof L2MonsterInstance) { String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : ""); @@ -142,61 +146,204 @@ @Override protected void writeImpl() { - writeC(0x0c); - writeD(_npc.getObjectId()); - writeD(_idTemplate + 1000000); // npctype id - writeD(_isAttackable ? 1 : 0); - writeD(_x); - writeD(_y); - writeD(_z); - writeD(_heading); - writeD(0x00); - writeD(_mAtkSpd); - writeD(_pAtkSpd); - writeD(_runSpd); - writeD(_walkSpd); - writeD(_runSpd); // swim run speed - writeD(_walkSpd); // swim walk speed - writeD(_runSpd); // swim run speed - writeD(_walkSpd); // swim walk speed - writeD(_runSpd); // fly run speed - writeD(_walkSpd); // fly run speed - writeF(_npc.getMovementSpeedMultiplier()); - writeF(_npc.getAttackSpeedMultiplier()); - writeF(_collisionRadius); - writeF(_collisionHeight); - writeD(_rhand); // right hand weapon - writeD(_chest); - writeD(_lhand); // left hand weapon - writeC(1); // name above char 1=true ... ?? - writeC(_npc.isRunning() ? 1 : 0); - writeC(_npc.isInCombat() ? 1 : 0); - writeC(_npc.isAlikeDead() ? 1 : 0); - writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned - writeS(_name); - writeS(_title); - writeD(0x00); // Title color 0=client default - writeD(0x00); //pvp flag - writeD(0x00); // karma - - writeD(_npc.getAbnormalEffect()); // C2 - writeD(_clanId); //clan id - writeD(_clanCrest); //crest id - writeD(_allyId); // ally id - writeD(_allyCrest); // all crest - writeC(_npc.isFlying() ? 2 : 0); // C2 - writeC(0x00); // title color 0=client - - writeF(_collisionRadius); - writeF(_collisionHeight); - writeD(_enchantEffect); // C4 - writeD(_npc.isFlying() ? 1 : 0); // C6 - writeD(0x00); - writeD(0x00);// CT1.5 Pet form and skills - writeC(_npc.isHideName() ? 0x00 : 0x01); - writeC(_npc.isHideName() ? 0x00 : 0x01); - writeD(_npc.getSpecialEffect()); - writeD(_displayEffect); + FakePc fpc = FakePcsTable.getInstance().getFakePc(_npc.getNpcId()); + if (fpc != null) + { + writeC(0x31); + writeD(_x); + writeD(_y); + writeD(_z); + writeD(0x00); // vehicle id + writeD(_npc.getObjectId()); + writeS(fpc.name); // visible name + writeD(fpc.race); + writeD(fpc.sex); + writeD(fpc.clazz); + + writeD(fpc.pdUnder); + writeD(fpc.pdHead); + writeD(fpc.pdRHand); + writeD(fpc.pdLHand); + writeD(fpc.pdGloves); + writeD(fpc.pdChest); + writeD(fpc.pdLegs); + writeD(fpc.pdFeet); + writeD(fpc.pdBack); + writeD(fpc.pdLRHand); + writeD(fpc.pdHair); + writeD(fpc.pdHair2); + writeD(fpc.pdRBracelet); + writeD(fpc.pdLBracelet); + writeD(fpc.pdDeco1); + writeD(fpc.pdDeco2); + writeD(fpc.pdDeco3); + writeD(fpc.pdDeco4); + writeD(fpc.pdDeco5); + writeD(fpc.pdDeco6); + writeD(0x00); // belt + + writeD(fpc.pdUnderAug); + writeD(fpc.pdHeadAug); + writeD(fpc.pdRHandAug); + writeD(fpc.pdLHandAug); + writeD(fpc.pdGlovesAug); + writeD(fpc.pdChestAug); + writeD(fpc.pdLegsAug); + writeD(fpc.pdFeetAug); + writeD(fpc.pdBackAug); + writeD(fpc.pdLRHandAug); + writeD(fpc.pdHairAug); + writeD(fpc.pdHair2Aug); + writeD(fpc.pdRBraceletAug); + writeD(fpc.pdLBraceletAug); + writeD(fpc.pdDeco1Aug); + writeD(fpc.pdDeco2Aug); + writeD(fpc.pdDeco3Aug); + writeD(fpc.pdDeco4Aug); + writeD(fpc.pdDeco5Aug); + writeD(fpc.pdDeco6Aug); + writeD(0x00); // belt aug + writeD(0x00); + writeD(0x01); + + writeD(fpc.pvpFlag); + writeD(fpc.karma); + + writeD(_mAtkSpd); + writeD(_pAtkSpd); + + writeD(0x00); + + writeD(_runSpd); + writeD(_walkSpd); + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // fly run speed + writeD(_walkSpd); // fly walk speed + writeD(_runSpd); + writeD(_walkSpd); + writeF(_npc.getMovementSpeedMultiplier()); // _activeChar.getProperMultiplier() + writeF(_npc.getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier() + + // TODO: add handling of mount collision + L2PcTemplate pctmpl = CharTemplateTable.getInstance().getTemplate(fpc.clazz); + writeF(fpc.sex == 0 ? pctmpl.fCollisionRadius : pctmpl.fCollisionRadius_female); + writeF(fpc.sex == 0 ? pctmpl.fCollisionHeight : pctmpl.fCollisionHeight_female); + + writeD(fpc.hairStyle); + writeD(fpc.hairColor); + writeD(fpc.face); + + writeS(fpc.title); // visible title + + writeD(0x00); // clan id + writeD(0x00); // clan crest id + writeD(0x00); // ally id + writeD(0x00); // ally crest id + + writeC(0x01); // standing = 1 sitting = 0 + writeC(_npc.isRunning() ? 1 : 0); // running = 1 walking = 0 + writeC(_npc.isInCombat() ? 1 : 0); + writeC(_npc.isAlikeDead() ? 1 : 0); + + writeC(fpc.invisible); // invisible = 1 visible =0 + + writeC(fpc.mount); // 1 on strider 2 on wyvern 3 on Great Wolf 0 no mount + writeC(0x00); // 1 - sellshop + writeH(0x00); // cubic count + //for (int id : allCubics) + // writeH(id); + writeC(0x00); // find party members + writeD(0x00); // abnormal effect + writeC(0x00); // isFlying() ? 2 : 0 + writeH(0x00); //getRecomHave(): Blue value for name (0 = white, 255 = pure blue) + writeD(1000000); // getMountNpcId() + 1000000 + writeD(fpc.clazz); + writeD(0x00); // ? + writeC(fpc.enchantEffect); + writeC(fpc.team); //team circle around feet 1= Blue, 2 = red + writeD(0x00); // getClanCrestLargeId() + writeC(0x00); // isNoble(): Symbol on char menu ctrl+I + writeC(fpc.hero); // Hero Aura + writeC(fpc.fishing); //0x01: Fishing Mode (Cant be undone by setting back to 0) + writeD(fpc.fishingX); + writeD(fpc.fishingY); + writeD(fpc.fishingZ); + + writeD(fpc.nameColor); + writeD(_heading); + writeD(0x00); // pledge class + writeD(0x00); // pledge type + writeD(fpc.titleColor); + + writeD(0x00); // cursed weapon level + writeD(0x00); // reputation score + writeD(0x00); // transformation id + writeD(0x00); // agathion id + writeD(0x01); // T2 ? + writeD(0x00); // special effect + /*writeD(0x00); // territory Id + writeD(0x00); // is Disguised + writeD(0x00); // territory Id*/ + } + else + { + writeC(0x0c); + writeD(_npc.getObjectId()); + writeD(_idTemplate + 1000000); // npctype id + writeD(_isAttackable ? 1 : 0); + writeD(_x); + writeD(_y); + writeD(_z); + writeD(_heading); + writeD(0x00); + writeD(_mAtkSpd); + writeD(_pAtkSpd); + writeD(_runSpd); + writeD(_walkSpd); + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // swim run speed + writeD(_walkSpd); // swim walk speed + writeD(_runSpd); // fly run speed + writeD(_walkSpd); // fly run speed + writeF(_npc.getMovementSpeedMultiplier()); + writeF(_npc.getAttackSpeedMultiplier()); + writeF(_collisionRadius); + writeF(_collisionHeight); + writeD(_rhand); // right hand weapon + writeD(_chest); + writeD(_lhand); // left hand weapon + writeC(1); // name above char 1=true ... ?? + writeC(_npc.isRunning() ? 1 : 0); + writeC(_npc.isInCombat() ? 1 : 0); + writeC(_npc.isAlikeDead() ? 1 : 0); + writeC(_isSummoned ? 2 : 0); // 0=teleported 1=default 2=summoned + writeS(_name); + writeS(_title); + writeD(0x00); // Title color 0=client default + writeD(0x00); //pvp flag + writeD(0x00); // karma + + writeD(_npc.getAbnormalEffect()); // C2 + writeD(_clanId); //clan id + writeD(_clanCrest); //crest id + writeD(_allyId); // ally id + writeD(_allyCrest); // all crest + writeC(_npc.isFlying() ? 2 : 0); // C2 + writeC(0x00); // title color 0=client + + writeF(_collisionRadius); + writeF(_collisionHeight); + writeD(_enchantEffect); // C4 + writeD(_npc.isFlying() ? 1 : 0); // C6 + writeD(0x00); + writeD(0x00);// CT1.5 Pet form and skills + writeC(_npc.isHideName() ? 0x00 : 0x01); + writeC(_npc.isHideName() ? 0x00 : 0x01); + writeD(_npc.getSpecialEffect()); + writeD(_displayEffect); + } } } @@ -300,7 +447,7 @@ _val = val; if (_summon.isShowSummonAnimation()) _val = 2; //override for spawn - + int npcId = cha.getTemplate().npcId; if (npcId == 16041 || npcId == 16042)
Y esto en el datapack:
Y una vez que este todo terminado y agregado el SQL, copian el ID del NPC que quieren que se visualice como Player y lo pegan en el ID de la Tabla Fakepcs
Por defecto cuando pones el sql en la tabla Fakepcs ya viene creado un Npc Player, con el ID 60001
deberas de poner el Id de tu NPC en 60001.
Index: C:/Users/heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java
=================================================================== --- C:/Users/Heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java (revision 7667) +++ C:/Users/Heisenberg/Desktop/eclipse-SDK-3.5.2-win32/eclipse/workspace/datapack_development/data/scripts/handlers/admincommandhandlers/AdminAdmin.java (working copy) @@ -27,6 +27,7 @@ import com.l2jserver.gameserver.datatables.DoorTable; import com.l2jserver.gameserver.datatables.ExtractableItemsData; import com.l2jserver.gameserver.datatables.ExtractableSkillsData; +import com.l2jserver.gameserver.datatables.FakePcsTable; import com.l2jserver.gameserver.datatables.ItemTable; import com.l2jserver.gameserver.datatables.MultiSell; import com.l2jserver.gameserver.datatables.NpcTable; @@ -289,6 +290,11 @@ QuestManager.getInstance().reloadAllQuests(); activeChar.sendMessage("All Quests have been reloaded"); } + else if (type.startsWith("fakenpc")) + { + FakePcsTable.getInstance().reloadData(); + activeChar.sendMessage("All Fake NPCs have been reloaded"); + } else if (type.startsWith("door")) { DoorTable.getInstance().reloadAll();
Etiquetas:
aspecto player,
guia lineage 2,
l2,
l2 guía,
lineage 2,
lineage 2 guía,
mundo l2,
mundo lineage,
mundo lineage2,
mundo-lineage2,
npc aspecto,
npc l2,
npc lineage,
npc player,
npc player l2
Suscribirse a:
Entradas (Atom)