Need help fix skills

asdfycacaa

Путник
Пользователь
Сообщения
10
Розыгрыши
0
Репутация
1
Реакции
1
Баллы
0
Хроники
  1. Prelude
Исходники
Присутствуют
Сборка
26360
Hello experts, i'm using l2scripts zaken and all duelist/GK skills who need charges to use are bugged, because you can use without charges so how i fix it?

So the skill can be used with 0 charges, if you have 3 charges it consumes 3 charges.

Skill example: Break Duress (grand khavatari)
Код:
    <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>
 
Here is Charge.java

 
You wanna add condition numCharhes for player then it work
 
Try to use this condition in your skill:
Код:
<cond>
    <player chargesMin="3" />
</cond>

Код:
package l2s.gameserver.stats.conditions;

import l2s.gameserver.stats.Env;

public class ConditionPlayerChargesMin extends Condition
{
    private final int _minCharges;

    public ConditionPlayerChargesMin(int minCharges)
    {
        _minCharges = minCharges;
    }

    @Override
    protected boolean testImpl(Env env)
    {
        if(env.character == null || !env.character.isPlayer())
            return false;

        return env.character.getIncreasedForce() >= _minCharges;
    }
}
 
Реакции: kick
this condition aren't in my skill.dtd how can i add it? because if i add manual i get error.

 
hmm skill.dtd in source = skills.java? player.java? my java knowledge is begginer

-added the ConditionPlayerCharges.java shared by Lorn to my core.
-added the condition in the skill.
<set name="charge_skill_id" value="50"/>
<set name="useSS" value="true"/>
<cond>
<player chargesMin="1" />
</cond>

<cond msgId="113">
-added the condition to skill.dtd.
is_chaotic CDATA #IMPLIED
chargesMin CDATA #IMPLIED>

No errors/warnings, but the skill still can be used without charges, if you have 1 charge it get consumed.

i can pay via paypal if someone helps me =)
 
You should add this else-if block in parsePlayerCondition method in gameserver/data/xml/parser/StatParser.java
Код:
else if("chargesMin".equalsIgnoreCase(name)) {
    int val = parseNumber(value).intValue();
    cond = joinAnd(cond, new ConditionPlayerChargesMin(val));
}
 
Реакции: kick
Lorn,

it works!!! ty so much
 

Похожие темы

Ответы
0
Просмотры
502