someone help with script

jocker23

Единомышленник
Участник
Сообщения
70
Розыгрыши
0
Репутация
29
Реакции
3
Баллы
160
Хроники
  1. Prelude
Исходники
Присутствуют
Сборка
L2jmobius Essence
I have a skill to configure, after dealing damage it gathers all the mobs around...

I'm partial to the "PullBack" code

But pullback pulls mobs in front of your character.

How do I make the pullback not pull the mobs in front of the character, but rather bring them together?

skill "Spiral Shot"

What should I change in this handler for this to happen?

/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see < >.
*/
package handlers.effecthandlers;

import org.l2jmobius.gameserver.enums.FlyType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;

/**
* An effect that pulls effected target back to the effector.
* @author Nik
*/
public class Pull extends AbstractEffect
{
private final int _speed;
private final int _delay;
private final int _animationSpeed;
private final FlyType _type;

public Pull(StatSet params)
{
_speed = params.getInt("speed", 0);
_delay = params.getInt("delay", _speed);
_animationSpeed = params.getInt("animationSpeed", 0);
_type = params.getEnum("type", FlyType.class, FlyType.WARP_FORWARD); // type 9
}

@Override
public boolean calcSuccess(Creature effector, Creature effected, Skill skill)
{
return Formulas.calcProbability(100, effector, effected, skill);
}

@Override
public boolean isInstant()
{
return true;
}

@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}
// Prevent pulling debuff blocked characters.
if ((effected.isDebuffBlocked()))
{
return;
}

// In retail, you get debuff, but you are not even moved if there is obstacle. You are still disabled from using skills and moving though.
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
effected.broadcastPacket(new ValidateLocation(effected), false);
effected.revalidateZone(true);
}
}
}
 
You need to get the aiming target on which the skill is cast and replace all uses of the effector in the effect with this target.

P.S. I just don’t know if it’s possible to get aiming target from the effect in Mobius.
 
  • Мне нравится
Реакции: Rolo
Like that?Or like that
1704352726209.png 1704352726209.png
1704352733632.png 1704352733632.png
1704352742588.png 1704352787922.png

First variant:

XML:
    <skill id="47608" toLevel="8" name="Spiral Shot">
        <!-- <<font color="FF8000">Pull/ effect combo skill</font>>\n\nShoots an arrow imbued with strong wind energy.\nAttacks the target with $s1 power.\n\nIgnores $s2 of the target's defense.\nCritical.\n\nPulls nearby enemies to the target.\n\nApplies <font color="EFFF04">Gust</font> to the target.\n\n<If <font color="EFFF04">Fire (Flame Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Flame Gust (damage over time)</font>\n\n<If <font color="EFFF04">Moisture (Water Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Water Dust (damage over time)</font>\n\nIf <font color="EFFF04">Flurry (Storm Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Storm (damage over time)</font> -->
        <icon>icon.s_spiral_shot</icon>
        <operateType>A1</operateType>
        <isDebuff>true</isDebuff>
        <castRange>700</castRange>
        <hitTime>3000</hitTime>
        <reuseDelay>20000</reuseDelay>
        <effectPoint>
            <value level="1">-1600</value>
            <value level="2">-1640</value>
            <value level="3">-1700</value>
            <value level="4">-1760</value>
            <value level="5">-1800</value>
            <value level="6">-1820</value>
            <value level="7">-1840</value>
            <value level="8">-1860</value>
        </effectPoint>
        <mpConsume>
            <value level="1">224</value>
            <value level="2">229</value>
            <value level="3">238</value>
            <value level="4">246</value>
            <value level="5">252</value>
            <value level="6">254</value>
            <value level="7">257</value>
            <value level="8">260</value>
        </mpConsume>
        <targetType>TARGET</targetType>
        <affectObject>NOT_FRIEND</affectObject>
        <affectScope>SINGLE</affectScope>
        <effectPoint>-1</effectPoint>
        <effects>
            <effect name="CallSkill" fromLevel="1" toLevel="1">
                <skillId>47609</skillId>
                <skillLevel>1</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="2" toLevel="2">
                <skillId>47609</skillId>
                <skillLevel>2</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="3" toLevel="3">
                <skillId>47609</skillId>
                <skillLevel>3</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="4" toLevel="4">
                <skillId>47609</skillId>
                <skillLevel>4</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="5" toLevel="5">
                <skillId>47609</skillId>
                <skillLevel>5</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="6" toLevel="6">
                <skillId>47609</skillId>
                <skillLevel>6</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="7" toLevel="7">
                <skillId>47609</skillId>
                <skillLevel>7</skillLevel>
                <chance>100</chance>
            </effect>
            <effect name="CallSkill" fromLevel="8" toLevel="8">
                <skillId>47609</skillId>
                <skillLevel>8</skillLevel>
                <chance>100</chance>
            </effect>
        </effects>
    </skill>
    <skill id="47609" toLevel="8" name="Spiral Shot">
        <icon>icon.s_spiral_shot</icon>
        <operateType>A1</operateType>
        <isDebuff>true</isDebuff>
        <castRange>700</castRange>
<!--        <hitTime>3000</hitTime>-->
<!--        <reuseDelay>20000</reuseDelay>-->
        <affectScope>POINT_BLANK</affectScope>
        <affectRange>600</affectRange>
        <effectPoint>-1</effectPoint>
        <effectPoint>
            <value level="1">-1600</value>
            <value level="2">-1640</value>
            <value level="3">-1700</value>
            <value level="4">-1760</value>
            <value level="5">-1800</value>
            <value level="6">-1820</value>
            <value level="7">-1840</value>
            <value level="8">-1860</value>
        </effectPoint>
        <effects>
            <effect name="PullBack">
                <speed>90</speed>
                <delay>600</delay>
            </effect>
        </effects>
    </skill>

The second:

XML:
    <skill id="47608" toLevel="8" name="Spiral Shot">
        <!-- <<font color="FF8000">Pull/ effect combo skill</font>>\n\nShoots an arrow imbued with strong wind energy.\nAttacks the target with $s1 power.\n\nIgnores $s2 of the target's defense.\nCritical.\n\nPulls nearby enemies to the target.\n\nApplies <font color="EFFF04">Gust</font> to the target.\n\n<If <font color="EFFF04">Fire (Flame Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Flame Gust (damage over time)</font>\n\n<If <font color="EFFF04">Moisture (Water Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Water Dust (damage over time)</font>\n\nIf <font color="EFFF04">Flurry (Storm Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Storm (damage over time)</font> -->
        <icon>icon.s_spiral_shot</icon>
        <operateType>A1</operateType>
        <isDebuff>true</isDebuff>
        <castRange>700</castRange>
        <hitTime>3000</hitTime>
        <reuseDelay>20000</reuseDelay>
        <effectPoint>
            <value level="1">-1600</value>
            <value level="2">-1640</value>
            <value level="3">-1700</value>
            <value level="4">-1760</value>
            <value level="5">-1800</value>
            <value level="6">-1820</value>
            <value level="7">-1840</value>
            <value level="8">-1860</value>
        </effectPoint>
        <mpConsume>
            <value level="1">224</value>
            <value level="2">229</value>
            <value level="3">238</value>
            <value level="4">246</value>
            <value level="5">252</value>
            <value level="6">254</value>
            <value level="7">257</value>
            <value level="8">260</value>
        </mpConsume>
        <targetType>TARGET</targetType>
        <affectObject>NOT_FRIEND</affectObject>
        <affectScope>POINT_BLANK</affectScope>
        <affectRange>600</affectRange>
        <effectPoint>-1</effectPoint>
        <effects>
            <effect name="PullBack">
                <speed>90</speed>
                <delay>600</delay>
            </effect>
        </effects>
    </skill>
 
I tried to copy and paste what you said, but it remains the same, pulling in front of the character as your second example .

I know there is no person more qualified than you to teach this!

Am I doing something wrong that went unnoticed?

it looked like this:

My XML :

<skill id="47608" toLevel="8" name="Spiral Shot">
<!-- <<font color="FF8000">Pull/ effect combo skill</font>>\n\nShoots an arrow imbued with strong wind energy.\nAttacks the target with $s1 power.\n\nIgnores $s2 of the target's defense.\nCritical.\n\nPulls nearby enemies to the target.\n\nApplies <font color="EFFF04">Gust</font> to the target.\n\n<If <font color="EFFF04">Fire (Flame Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Flame Gust (damage over time)</font>\n\n<If <font color="EFFF04">Moisture (Water Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Water Dust (damage over time)</font>\n\nIf <font color="EFFF04">Flurry (Storm Arrow Rain)</font> is active>\nThe following effect is applied:\n<font color="EFFF04">Storm (damage over time)</font> -->
<icon>icon.s_spiral_shot</icon>
<operateType>A1</operateType>
<isDebuff>true</isDebuff>
<castRange>700</castRange>
<hitTime>3000</hitTime>
<reuseDelay>1000</reuseDelay>
<effectPoint>
<value level="1">-1600</value>
<value level="2">-1640</value>
<value level="3">-1700</value>
<value level="4">-1760</value>
<value level="5">-1800</value>
<value level="6">-1820</value>
<value level="7">-1840</value>
<value level="8">-1860</value>
</effectPoint>
<mpConsume>
<value level="1">224</value>
<value level="2">229</value>
<value level="3">238</value>
<value level="4">246</value>
<value level="5">252</value>
<value level="6">254</value>
<value level="7">257</value>
<value level="8">260</value>
</mpConsume>
<targetType>TARGET</targetType>
<affectObject>NOT_FRIEND</affectObject>
<affectScope>SINGLE</affectScope>
<effectPoint>-1</effectPoint>
<conditions>
<condition name="EquipWeapon">
<weaponType>
<item>BOW</item>
</weaponType>
</condition>
</conditions>
<effects>
<effect name="PhysicalAttack">
<power>
<value level="1">6600</value>
<value level="2">6800</value>
<value level="3">7000</value>
<value level="4">7200</value>
<value level="5">7400</value>
<value level="6">7600</value>
<value level="5">7800</value>
<value level="6">8000</value>
</power>
<ignoreShieldDefence>true</ignoreShieldDefence>
<pDefMod>0.5</pDefMod>
<criticalChance>15</criticalChance>
</effect>
<effect name="CallSkill" fromLevel="1" toLevel="1">
<skillId>47609</skillId>
<skillLevel>1</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="2" toLevel="2">
<skillId>47609</skillId>
<skillLevel>2</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="3" toLevel="3">
<skillId>47609</skillId>
<skillLevel>3</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="4" toLevel="4">
<skillId>47609</skillId>
<skillLevel>4</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="5" toLevel="5">
<skillId>47609</skillId>
<skillLevel>5</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="6" toLevel="6">
<skillId>47609</skillId>
<skillLevel>6</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="7" toLevel="7">
<skillId>47609</skillId>
<skillLevel>7</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill" fromLevel="8" toLevel="8">
<skillId>47609</skillId>
<skillLevel>8</skillLevel>
<chance>100</chance>
</effect>
<effect name="CallSkill">
<skillId>47631</skillId> <!-- GUST -->
<skillLevel>1</skillLevel>
<chance>90</chance>
</effect>
</effects>
</skill>
<skill id="47609" toLevel="8" name="Spiral Shot">
<icon>icon.s_spiral_shot</icon>
<operateType>A1</operateType>
<isDebuff>true</isDebuff>
<castRange>700</castRange>
<!-- <hitTime>3000</hitTime>-->
<!-- <reuseDelay>20000</reuseDelay>-->
<affectScope>POINT_BLANK</affectScope>
<affectRange>600</affectRange>
<effectPoint>-1</effectPoint>
<effectPoint>
<value level="1">-1600</value>
<value level="2">-1640</value>
<value level="3">-1700</value>
<value level="4">-1760</value>
<value level="5">-1800</value>
<value level="6">-1820</value>
<value level="7">-1840</value>
<value level="8">-1860</value>
</effectPoint>
<effects>
<effect name="PullBack">
<speed>90</speed>
<delay>600</delay>
</effect>
</effects>
 
If it's mobius source, go to mobius forum and ask him about it. After all, you're paying a monthly subscription, so be sure to get help. Good luck.


Там надо, чтобы мобы притягивались к тому мобу, в которого выстрелили.

нужен новый хендлер скорее всего, т.к. PullBack притягивает effected (моба) к effector(чару).
 
If it's mobius source, go to mobius forum and ask him about it. After all, you're paying a monthly subscription, so be sure to get help. Good luck.



Там надо, чтобы мобы притягивались к тому мобу, в которого выстрелили.

нужен новый хендлер скорее всего, т.к. PullBack притягивает effected (моба) к effector(чару).
Yes, I started from that premise, I replicated the PullBack on the handle but I can't change the target positions.

/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see < >.
*/
package handlers.effecthandlers;

import org.l2jmobius.gameserver.enums.FlyType;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;

/**
* An effect that pulls effected target back to the effector.
* @author Nik
*/
public class Pull extends AbstractEffect
{
private final int _speed;
private final int _delay;
private final int _animationSpeed;
private final FlyType _type;

public Pull(StatSet params)
{
_speed = params.getInt("speed", 0);
_delay = params.getInt("delay", _speed);
_animationSpeed = params.getInt("animationSpeed", 0);
_type = params.getEnum("type", FlyType.class, FlyType.WARP_FORWARD); // type 9
}

@Override
public boolean calcSuccess(Creature effector, Creature effected, Skill skill)
{
return Formulas.calcProbability(100, effector, effected, skill);
}

@Override
public boolean isInstant()
{
return true;
}

@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
// Prevent pulling raids and town NPCs.
if ((effected == null) || effected.isRaid() || (effected.isNpc() && !effected.isAttackable()))
{
return;
}
// Prevent pulling debuff blocked characters.
if ((effected.isDebuffBlocked()))
{
return;
}

// In retail, you get debuff, but you are not even moved if there is obstacle. You are still disabled from using skills and moving though.
if (GeoEngine.getInstance().canMoveToTarget(effected.getX(), effected.getY(), effected.getZ(), effector.getX(), effector.getY(), effector.getZ(), effected.getInstanceWorld()))
{
effected.broadcastPacket(new FlyToLocation(effected, effector, _type, _speed, _delay, _animationSpeed));
effected.setXYZ(effector.getX(), effector.getY(), GeoEngine.getInstance().getHeight(effector.getX(), effector.getY(), effector.getZ()) + 10);
effected.broadcastPacket(new ValidateLocation(effected), false);
effected.revalidateZone(true);
}
}
}
 
Назад
Сверху Снизу