Jump to content
  • 0

Momentum skills (duelist/gk)


asdfycacaa
 Share

Question

Hello i have a problem, i'm using L2Script 2.5 Zaken and all skills who use charges to use it aren't using so you can use with 0 charges. So where is the formula of "num_charges" ???

 

PD: SKILLS WORKS GOOD, BUT CAN BE USED WITHOUT CHARGES.

	<skill id="461" levels="3" name="Break Duress">
		<!--
			Description:
			Lvl 1 - Use your spirit to escape from an immobile state. Level 2 Focused Force charge required.
			Lvl 2 - Use your spirit to escape from a slow or immobile state. Level 3 Focused Force charge required.
		-->
		<table name="#num_charges">2 3</table>
		<table name="#magicLevel">60 66</table>
		<table name="#dispel_sd_max_abnormal_lvl">0 3</table>
		<table name="#mp_consume">29 33 37</table>
		<table name="#reuseDelay">600000 420000 300000</table>
		<set name="icon" value="icon.skill0461"/>
		<set name="reuseDelay" value="#reuseDelay"/>
		<set name="hitTime" value="3000"/>
		<set name="mp_consume" value="#mp_consume"/>
		<set name="ride_state" value="NONE"/>
		<set name="magicLevel" value="#magicLevel"/>
		<set name="hitCancelTime" value="500"/>
		<set name="target" value="TARGET_SELF"/>
		<set name="operate_type" value="A2"/>
		<set name="num_charges" value="#num_charges"/>
		<set name="skillType" value="BUFF"/>
		<for>
			<effect name="i_dispel_by_slot">
				<def name="abnormal_type" value="speed_down"/>
				<def name="max_abnormal_level" value="#dispel_sd_max_abnormal_lvl"/>
			</effect>
			<effect name="i_dispel_by_slot">
				<def name="abnormal_type" value="root_magically"/>
				<def name="max_abnormal_level" value="3"/>
			</effect>
			<effect name="i_dispel_by_slot">
				<def name="abnormal_type" value="root_physically"/>
				<def name="max_abnormal_level" value="3"/>
			</effect>
		</for>
	</skill>

 

Edited by asdfycacaa
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Here is Charge.java

 

package l2s.gameserver.skills.skillclasses;

import java.util.List;

import l2s.gameserver.model.Creature;
import l2s.gameserver.model.Player;
import l2s.gameserver.model.Skill;
import l2s.gameserver.network.l2.components.SystemMsg;
import l2s.gameserver.network.l2.s2c.MagicSkillUse;
import l2s.gameserver.stats.Formulas;
import l2s.gameserver.stats.Formulas.AttackInfo;
import l2s.gameserver.templates.StatsSet;

public class Charge extends Skill
{
	public static final int MAX_CHARGE = 10;

	private int _charges;
	private boolean _fullCharge;

	public Charge(StatsSet set)
	{
		super(set);
		_charges = set.getInteger("charges", getLevel());
		_fullCharge = set.getBool("fullCharge", false);
	}

	@Override
	public boolean checkCondition(final Creature activeChar, final Creature target, boolean forceUse, boolean dontMove, boolean first)
	{
		if(!super.checkCondition(activeChar, target, forceUse, dontMove, first))
			return false;

		if(!activeChar.isPlayer())
			return false;

		Player player = (Player) activeChar;

		int charges = _charges == -1 ? player.getMaxIncreasedForce() : _charges;

		//Камушки можно юзать даже е�ли зар�д > 7, о�тальное только е�ли зар�д < уровень �кила
		if(getPower() <= 0 && getId() != 2165 && player.getIncreasedForce() >= charges)
		{
			activeChar.sendPacket(SystemMsg.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY_);
			return false;
		}
		else if(getId() == 2165)
			player.sendPacket(new MagicSkillUse(player, player, 2165, 1, 0, 0));

		return true;
	}

	@Override
	public void onEndCast(Creature activeChar, List<Creature> targets)
	{
		super.onEndCast(activeChar, targets);

		if(activeChar.isPlayer())
			chargePlayer((Player) activeChar, getId());
	}

	@Override
	protected void useSkill(Creature activeChar, Creature target, boolean reflected)
	{
		if(!activeChar.isPlayer())
			return;

		if(target.isDead())
			return;

		if(target == activeChar)
			return;

		if(getPower() <= 0)
			return;

		final Creature realTarget = reflected ? activeChar : target;
		final AttackInfo info = Formulas.calcPhysDam(activeChar, realTarget, this, false, false, isSSPossible(), false);
		if(info == null)
			return;

		realTarget.reduceCurrentHp(info.damage, activeChar, this, true, true, false, true, false, false, true, true, info.crit || info.blow, false, false);
		if(!info.miss || info.damage >= 1)
		{
			double lethalDmg = Formulas.calcLethalDamage(activeChar, realTarget, this);
			if(lethalDmg > 0)
				realTarget.reduceCurrentHp(lethalDmg, activeChar, this, true, true, false, false, false, false, false);
			else if(!reflected)
				realTarget.doCounterAttack(this, activeChar, false);
		}
	}

	public void chargePlayer(Player player, Integer skillId)
	{
		int charges = _charges == -1 ? player.getMaxIncreasedForce() : _charges;
		if(player.getIncreasedForce() >= charges)
		{
			player.sendPacket(SystemMsg.YOUR_FORCE_HAS_REACHED_MAXIMUM_CAPACITY_);
			return;
		}
		if(_fullCharge)
			player.setIncreasedForce(charges);
		else
			player.setIncreasedForce(player.getIncreasedForce() + 1);
	}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock