- Хроники
- Interlude
- Исходники
- Отсутствуют
- Сборка
- Lucera
Хочу сделать возможность для Биша юзать трансформу Инквизитора з ХФ на Интерлюде.
Подозреваю что основная проблема в проверке ID Transform.
Подскажьіте как убрать "пакет" которьій крашьіт клиент при трансформацьіи и оставить возможность создавать новий пул скилов. Или что имено крашьіт клиент.
Видео с тем что у меня вьішло, но нехватает убирания активньіхскилов.
Код ransformation.java
Код EffectTransformation.java
Подозреваю что основная проблема в проверке ID Transform.
Подскажьіте как убрать "пакет" которьій крашьіт клиент при трансформацьіи и оставить возможность создавать новий пул скилов. Или что имено крашьіт клиент.
Видео с тем что у меня вьішло, но нехватает убирания активньіхскилов.
Код ransformation.java
Java:
Transformation
package l2.gameserver.skills.skillclasses;
import java.util.Iterator;
import java.util.List;
import l2.gameserver.Config;
import l2.gameserver.cache.Msg;
import l2.gameserver.instancemanager.ReflectionManager;
import l2.gameserver.model.Creature;
import l2.gameserver.model.Player;
import l2.gameserver.model.Skill;
import l2.gameserver.model.Skill.SkillType;
import l2.gameserver.network.l2.s2c.SystemMessage;
import l2.gameserver.templates.StatsSet;
public class Transformation extends Skill {
public final boolean useSummon;
public final boolean isDisguise;
public final String transformationName;
public Transformation(StatsSet set) {
super(set);
this.useSummon = set.getBool("useSummon", false);
this.isDisguise = set.getBool("isDisguise", false);
this.transformationName = set.getString("transformationName", (String)null);
}
public boolean checkCondition(Creature activeChar, Creature target, boolean forceUse, boolean dontMove, boolean first) {
Player player = target.getPlayer();
if (player != null && player.getActiveWeaponFlagAttachment() == null) {
if (player.getTransformation() != 0 && this.getId() != 619) {
activeChar.sendPacket(Msg.YOU_ALREADY_POLYMORPHED_AND_CANNOT_POLYMORPH_AGAIN);
return false;
} else if ((this.getId() == 840 || this.getId() == 841 || this.getId() == 842) && (player.getX() > -166168 || player.getZ() <= 0 || player.getZ() >= 6000 || player.getPet() != null || player.getReflection() != ReflectionManager.DEFAULT)) {
activeChar.sendPacket((new SystemMessage(113)).addSkillName(this._id, this._level));
return false;
} else if (player.isInFlyingTransform() && this.getId() == 619 && Math.abs(player.getZ() - player.getLoc().correctGeoZ().z) > 333) {
activeChar.sendPacket((new SystemMessage(113)).addSkillName(this._id, this._level));
return false;
} else if (player.isInWater()) {
activeChar.sendPacket(Msg.YOU_CANNOT_POLYMORPH_INTO_THE_DESIRED_FORM_IN_WATER);
return false;
} else if (!player.isRiding() && player.getMountType() != 2) {
if (player.getEffectList().getEffectsBySkillId(1411) != null) {
activeChar.sendPacket(Msg.YOU_CANNOT_POLYMORPH_WHILE_UNDER_THE_EFFECT_OF_A_SPECIAL_SKILL);
return false;
} else if (player.isInBoat()) {
activeChar.sendPacket(Msg.YOU_CANNOT_POLYMORPH_WHILE_RIDING_A_BOAT);
return false;
} else {
if (this.useSummon) {
if (player.getPet() == null || !player.getPet().isSummon() || player.getPet().isDead()) {
activeChar.sendPacket(Msg.PETS_AND_SERVITORS_ARE_NOT_AVAILABLE_AT_THIS_TIME);
return false;
}
} else if (player.getPet() != null && player.getPet().isPet() && this.getId() != 619 && !this.isBaseTransformation()) {
activeChar.sendPacket(Msg.YOU_CANNOT_POLYMORPH_WHEN_YOU_HAVE_SUMMONED_A_SERVITOR_PET);
return false;
}
return super.checkCondition(activeChar, target, forceUse, dontMove, first);
}
} else {
activeChar.sendPacket(Msg.YOU_CANNOT_POLYMORPH_WHILE_RIDING_A_PET);
return false;
}
} else {
return false;
}
}
public void useSkill(Creature activeChar, List<Creature> targets) {
if (this.useSummon) {
if (activeChar.getPet() == null || !activeChar.getPet().isSummon() || activeChar.getPet().isDead()) {
activeChar.sendPacket(Msg.PETS_AND_SERVITORS_ARE_NOT_AVAILABLE_AT_THIS_TIME);
return;
}
activeChar.getPet().unSummon();
}
if (this.isSummonerTransformation() && activeChar.getPet() != null && activeChar.getPet().isSummon()) {
activeChar.getPet().unSummon();
}
Iterator var3 = targets.iterator();
while(var3.hasNext()) {
Creature target = (Creature)var3.next();
if (target != null && target.isPlayer()) {
this.getEffects(activeChar, target, false, false);
}
}
if (this.isSSPossible() && (!Config.SAVING_SPS || this._skillType != SkillType.BUFF)) {
activeChar.unChargeShots(this.isMagic());
}
}
}
Код EffectTransformation.java
Java:
package l2.gameserver.skills.effects;
import l2.gameserver.model.Effect;
import l2.gameserver.model.Player;
import l2.gameserver.skills.skillclasses.Transformation;
import l2.gameserver.stats.Env;
public final class EffectTransformation extends Effect {
private final boolean isFlyingTransform;
public EffectTransformation(Env env, EffectTemplate template) {
super(env, template);
int id = (int)template._value;
this.isFlyingTransform = template.getParam().getBool("isFlyingTransform", id == 8 || id == 9 || id == 260);
}
public boolean checkCondition() {
if (!this._effected.isPlayer()) {
return false;
} else {
return this.isFlyingTransform && this._effected.getX() > -166168 ? false : super.checkCondition();
}
}
public void onStart() {
super.onStart();
Player player = (Player)this._effected;
player.setTransformationTemplate(this.getSkill().getNpcId());
if (this.getSkill() instanceof Transformation) {
player.setTransformationName(((Transformation)this.getSkill()).transformationName);
}
int id = (int)this.calc();
if (this.isFlyingTransform) {
boolean isVisible = player.isVisible();
if (player.getPet() != null) {
player.getPet().unSummon();
}
player.decayMe();
player.setFlying(true);
player.setLoc(player.getLoc().changeZ(300));
player.setTransformation(id);
if (isVisible) {
player.spawnMe();
}
} else {
player.setTransformation(id);
}
}
public void onExit() {
super.onExit();
if (this._effected.isPlayer()) {
Player player = (Player)this._effected;
if (this.getSkill() instanceof Transformation) {
player.setTransformationName((String)null);
}
if (this.isFlyingTransform) {
boolean isVisible = player.isVisible();
player.decayMe();
player.setFlying(false);
player.setLoc(player.getLoc().correctGeoZ());
player.setTransformation(0);
if (isVisible) {
player.spawnMe();
}
} else {
player.setTransformation(0);
}
}
}
public boolean onActionTime() {
return false;
}
}