PDA

Просмотр полной версии : Делаем трансформ


FFForever
17.03.2009, 20:08
Скопируйте текст в блокнот и назовите файл transform.txt:
package transformations;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.instancemanager.Transformati onManager;
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.getInstanc e().getInfo(619, 1), false);
// Decrease Bow/Crossbow Attack Speed
this.getPlayer().removeSkill(SkillTable.getInstanc e().getInfo(5491, 1), false);
// Send a Server->Client packet StatusUpdate to the L2PcInstance.
this.getPlayer().sendSkillList();
}

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


-.txt переименуйте в .java

Откройте его :

- THE NAME OF THE TRANSFORMATION = название трасформа
-THE TEMPLATE ID OF THE TRANSFORMATION =
здесь id которое вы должны будете вписать в transformdata.dat
-COLLISION RADIUS & COLLISION HEIGHT =этот параметр просто возьмите из таблицы npc .
- Для скилов :
this.getPlayer().addSkill(SkillTable.getInstance() .getInfo(skillid, level), false);

Не удаляйте эти 3 скила!
Сохраните и копируйте в gameserver-data-scripts-transformations

Перейдите в gameserver-data-stats-skills и откройте 0500-0599.xml и добвате скилл как этот :
<skill id="YOUR SKILL ID" levels="1" name="Transform THE MOB NAME">
<set name="mpConsume" val="31"/>
<set name="target" val="TARGET_SELF"/>
<set name="skillType" val="BUFF"/>
<set name="isMagic" val="true"/>
<set name="operateType" val="OP_ACTIVE"/>
<set name="hitTime" val="1500"/>
<set name="reuseDelay" val="3600000"/>
<set name="transformId" val="HERE YOU ADD THE ID YOU WILL HAVE TO ADD IN TRANSFORMDATA.DAT LIKE IN JAVA FILE"/>
<set name="castRange" val="-1"/>
<set name="effectRange" val="-1"/>
<for>
<effect count="1" name="Transformation" time="1800" val="0"/>
</for>
</skill>

-Теперь просто добавте скилл игроку.
Теперь клиентская часть , откройте skillgrp.dat и добавте скилл типа такого :

541 1 1 31 -1 1 1.5000000 1 D icon.skilltransform1 0 0 0 0 -1 -1

замените 541 своим ID.

Откройте skillname-e.dat и добавте:
541 1 a,Transform Grail Apostle\0 a,Transform into a Grail Apostle.\0 a,none\0 a,none\0

замените 541 своим ID.
Замените “Transform Grail Apostle” своим трасформом( Именем моба)
Откройте skillsoundgrp.dat и добавте:

541 1 SkillSound8.transform_cast 250.0000000 40.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 250.0000000 50.0000000

замените 541 своим ID.
откройте transformdata.dat
541 0 13091 0 LineageEffect.s_u833_transform LineageEffect.s_u833_transform
замените 541 с npc id и 13091 замените mob template id