CallPc effect with ENEMY target type now uses FlyToLocation.
Thanks to kamikadzz.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2810,8 +2810,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2810,8 +2810,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2811,8 +2811,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2811,8 +2811,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2811,8 +2811,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2811,8 +2811,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2782,8 +2782,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2782,8 +2782,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2783,10 +2783,15 @@
|
||||
<effectRange>1100</effectRange>
|
||||
<hitTime>2000</hitTime>
|
||||
<magicLevel>1</magicLevel>
|
||||
<isMagic>1</isMagic> <!-- Magic Skill -->
|
||||
<reuseDelay>20000</reuseDelay>
|
||||
<operateType>A1</operateType>
|
||||
<magicCriticalRate>-5</magicCriticalRate>
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
<!-- Atk. Spd. decreases momentarily. Effect $s1. -->
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2783,10 +2783,15 @@
|
||||
<effectRange>1100</effectRange>
|
||||
<hitTime>2000</hitTime>
|
||||
<magicLevel>1</magicLevel>
|
||||
<isMagic>1</isMagic> <!-- Magic Skill -->
|
||||
<reuseDelay>20000</reuseDelay>
|
||||
<operateType>A1</operateType>
|
||||
<magicCriticalRate>-5</magicCriticalRate>
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
<!-- Atk. Spd. decreases momentarily. Effect $s1. -->
|
||||
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2783,10 +2783,15 @@
|
||||
<effectRange>1100</effectRange>
|
||||
<hitTime>2000</hitTime>
|
||||
<magicLevel>1</magicLevel>
|
||||
<isMagic>1</isMagic> <!-- Magic Skill -->
|
||||
<reuseDelay>20000</reuseDelay>
|
||||
<operateType>A1</operateType>
|
||||
<magicCriticalRate>-5</magicCriticalRate>
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
<!-- Atk. Spd. decreases momentarily. Effect $s1. -->
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2765,8 +2765,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2765,8 +2765,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2765,8 +2765,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2765,8 +2765,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2811,8 +2811,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2778,8 +2778,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2795,8 +2795,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ai.areas.CrumaTower;
|
||||
|
||||
import org.l2jmobius.gameserver.model.actor.Attackable;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Summon Pc AI.<br>
|
||||
* Summon the player to the NPC on attack.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class SummonPc extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int PERUM = 20221;
|
||||
// Skill
|
||||
private static final SkillHolder SUMMON_PC = new SkillHolder(4161, 1);
|
||||
|
||||
private SummonPc()
|
||||
{
|
||||
addAttackId(PERUM);
|
||||
addSpellFinishedId(PERUM);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
final boolean attacked = npc.getVariables().getBoolean("attacked", false);
|
||||
if ((npc.calculateDistance3D(attacker) > 300) && !attacked)
|
||||
{
|
||||
if (chance < 50)
|
||||
{
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
}
|
||||
|
||||
if ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill()))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((npc.calculateDistance3D(attacker) > 100) && !attacked)
|
||||
{
|
||||
final Attackable monster = (Attackable) npc;
|
||||
if (monster.getMostHated() != null)
|
||||
{
|
||||
if ((((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10)) //
|
||||
&& ((SUMMON_PC.getSkill().getMpConsume() < npc.getCurrentMp()) && (SUMMON_PC.getSkill().getHpConsume() < npc.getCurrentHp()) && !npc.isSkillDisabled(SUMMON_PC.getSkill())))
|
||||
{
|
||||
npc.setTarget(attacker);
|
||||
npc.doCast(SUMMON_PC.getSkill());
|
||||
npc.getVariables().set("attacked", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpellFinished(Npc npc, Player player, Skill skill)
|
||||
{
|
||||
if ((skill.getId() == SUMMON_PC.getSkillId()) && !npc.isDead() && npc.getVariables().getBoolean("attacked", false))
|
||||
{
|
||||
player.teleToLocation(npc);
|
||||
npc.getVariables().set("attacked", false);
|
||||
}
|
||||
return super.onSpellFinished(npc, player, skill);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SummonPc();
|
||||
}
|
||||
}
|
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.FlyType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -26,9 +27,11 @@ import org.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
import org.l2jmobius.gameserver.model.item.instance.Item;
|
||||
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.skill.targets.TargetType;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.FlyToLocation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
@@ -92,9 +95,20 @@ public class CallPc extends AbstractEffect
|
||||
}
|
||||
else if (target != null)
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
if (skill.getTargetType() == TargetType.ENEMY)
|
||||
{
|
||||
effected.abortCast();
|
||||
effected.abortAttack();
|
||||
effected.stopMove(null);
|
||||
effected.sendPacket(new FlyToLocation(effected, effector, FlyType.DUMMY, 0, 0, 0));
|
||||
effected.setLocation(effector.getLocation());
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject previousTarget = target.getTarget();
|
||||
target.teleToLocation(effector);
|
||||
target.setTarget(previousTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2795,8 +2795,7 @@
|
||||
<targetType>ENEMY</targetType>
|
||||
<affectScope>SINGLE</affectScope>
|
||||
<effects>
|
||||
<effect name="CallPc">
|
||||
</effect>
|
||||
<effect name="CallPc" />
|
||||
</effects>
|
||||
</skill>
|
||||
<skill id="4162" toLevel="3" name="Decrease Atk. Spd.">
|
||||
|
Reference in New Issue
Block a user