Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

[Guía] Crear Transformacion

Iniciado por Swarlog, Ago 05, 2022, 12:46 AM

Tema anterior - Siguiente tema

Swarlog

Se trata de un script de ejemplo para que podais crear vuestras propias tranformaciones, con sus efectos y skills customs que querrais añadirle. Espero que sea de gran utilidad para la comunidad.

package transformations;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.TransformationManager;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.L2Transformation;

/**
 * Description: <br>
 * This will handle the transformation, giving the skills, and removing them, when the player logs out and is transformed these skills
 * do not save.
 * When the player logs back in, there will be a call from the enterworld packet that will add all their skills.
 * The enterworld packet will transform a player.
 *
 * @author durgus
 *
 */

public class THE NAME OF THE TRANSFORMATION extends L2Transformation
{
public THE NAME OF THE TRANSFORMATION()
{
// id, duration (secs), colRadius, colHeight
// Retail Like 30 min - Skatershi
super(THE TEMPLATE ID OF THE TRANSFORMATION, 1800, COLISION RADIUS, COLISION HIGHT);
}

public void onTransform()
{
// Disable all character skills.
for (L2Skill sk : this.getPlayer().getAllSkills())
{
if (sk != null && !sk.isPassive())
this.getPlayer().removeSkill(sk, false);
}
if (this.getPlayer().transformId() > 0 && !this.getPlayer().isCursedWeaponEquipped())
{
// give transformation skills
transformedSkills();
return;
}
// give transformation skills
transformedSkills();
// Update Transformation ID
this.getPlayer().transformInsertInfo();
}

public void transformedSkills()
{
HERE YOU PUT THE SKILLS THAT YOUR PLAYER WILL GET ON TRANSFORM
// Transfrom Dispel
this.getPlayer().addSkill(SkillTable.getInstance().getInfo(619, 1), false);
// Decrease Bow/Crossbow Attack Speed
this.getPlayer().addSkill(SkillTable.getInstance().getInfo(5491, 1), false);
// Send a Server->Client packet StatusUpdate to the L2PcInstance.
this.getPlayer().sendSkillList();
}

public void onUntransform()
{
// Enable all character skills
for (L2Skill sk : this.getPlayer().getAllSkills())
{
if (sk != null && !sk.isPassive())
this.getPlayer().addSkill(sk, false);
}
// Only remove transformation skills. Keeps transformation id for restoration after CW is no longer equipped.
if (this.getPlayer().isCursedWeaponEquipped())
{
removeSkills();
return;
}
// Remove transformation skills
removeSkills();
// Update Transformation ID
this.getPlayer().transformUpdateInfo();
}

public void removeSkills()
{
HERE YOU NEED TO COPY THE SKILLS THAT YOU PUT UPER SO THEY WILL BE REMOVED FROM THE PLAYER ON UNTRANSFORM
// Transfrom Dispel
this.getPlayer().removeSkill(SkillTable.getInstance().getInfo(619, 1), false);
// Decrease Bow/Crossbow Attack Speed
this.getPlayer().removeSkill(SkillTable.getInstance().getInfo(5491, 1), false);
// Send a Server->Client packet StatusUpdate to the L2PcInstance.
this.getPlayer().sendSkillList();
}

public static void main(String[] args)
{
TransformationManager.getInstance().registerTransformation(new Buffalo());
}
}

Gracias Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate por publicar la plantilla de tranformaciones creada por durgus, pero si quieres crear una transformación nueva debes de editar tambien el cliente para añadir/especificar la ID del mob de la transformación.

En resumen, tendrias que crear una skill para la transformación; por ejemplo:

222333 0 22736   
;0 LineageEffect.s_u833_transform
LineageEffect.s_u833_transform 0 0
0 0
222333 1 22736   
;0 LineageEffect.s_u833_transform
LineageEffect.s_u833_transform 0 0
0 0

En este caso es la ID "22736" la del "Mutant Overlord", para transformase en dicho mob.

La ID "222333" es la id de la transformación, podemos cambiarla por la deseada al igual que la del mob.

Con todo esto especificado si tendriamos nuestra transformación lista para utilizarse :P

PD: Algunos emuladores tienen las transformaciones en archivos *.xml y no en *.java.