From 40ebd82319ca822b46e527f00827fb24539cec0d Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Sat, 3 Sep 2022 01:27:50 +0000
Subject: [PATCH] CallPc effect with ENEMY target type now uses FlyToLocation.
Thanks to kamikadzz.
---
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 5 +
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 5 +
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 5 +
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
.../scripts/ai/areas/CrumaTower/SummonPc.java | 100 ------------------
.../handlers/effecthandlers/CallPc.java | 20 +++-
.../game/data/stats/skills/04100-04199.xml | 3 +-
61 files changed, 444 insertions(+), 1414 deletions(-)
delete mode 100644 L2J_Mobius_Classic_1.0/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Classic_Interlude/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
delete mode 100644 L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml
index 2fdd112552..b26de06573 100644
--- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/04100-04199.xml
@@ -2810,8 +2810,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/04100-04199.xml
index 8e0dd20cc1..e268020a9e 100644
--- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/04100-04199.xml
@@ -2810,8 +2810,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/04100-04199.xml
index 3780b16dc9..e349e45a2d 100644
--- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/04100-04199.xml
@@ -2811,8 +2811,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml
index a002bca4c4..4070509077 100644
--- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/04100-04199.xml
@@ -2811,8 +2811,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/04100-04199.xml
index ffb36ac617..5827e027e5 100644
--- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/04100-04199.xml
@@ -2811,8 +2811,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/04100-04199.xml
index 887c84cfae..ea81667f7a 100644
--- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/04100-04199.xml
@@ -2811,8 +2811,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/04100-04199.xml
index bbd2543322..98bc40e87c 100644
--- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/04100-04199.xml
@@ -2782,8 +2782,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/04100-04199.xml
index 5d52d25fda..4bb7b4deab 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/04100-04199.xml
@@ -2782,8 +2782,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/04100-04199.xml
index 1a6c36957b..77cbeaad2d 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/04100-04199.xml
@@ -2783,10 +2783,15 @@
1100
2000
1
+ 1
+ 20000
A1
-5
ENEMY
SINGLE
+
+
+
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/04100-04199.xml
index 9643ed75b7..f3f257a283 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/04100-04199.xml
@@ -2783,10 +2783,15 @@
1100
2000
1
+ 1
+ 20000
A1
-5
ENEMY
SINGLE
+
+
+
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/04100-04199.xml
index cda413b297..36837c8989 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/04100-04199.xml
@@ -2783,10 +2783,15 @@
1100
2000
1
+ 1
+ 20000
A1
-5
ENEMY
SINGLE
+
+
+
diff --git a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_1.0/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_1.0/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_1.0/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_1.0/dist/game/data/stats/skills/04100-04199.xml
index 84427113e2..9937960d30 100644
--- a/L2J_Mobius_Classic_1.0/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_1.0/dist/game/data/stats/skills/04100-04199.xml
@@ -2765,8 +2765,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/stats/skills/04100-04199.xml
index 43c5f39bf7..a611cce602 100644
--- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/data/stats/skills/04100-04199.xml
@@ -2765,8 +2765,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml
index 7af0ea4f79..f634f5142f 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/04100-04199.xml
@@ -2765,8 +2765,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/stats/skills/04100-04199.xml
index 9121fca7c4..20d99b8cce 100644
--- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/data/stats/skills/04100-04199.xml
@@ -2765,8 +2765,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/stats/skills/04100-04199.xml
index aa4c1d982f..fac44cb74a 100644
--- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/stats/skills/04100-04199.xml
index bb96ab8883..157be6358f 100644
--- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/stats/skills/04100-04199.xml
index 130c8071dd..33b4d9d90c 100644
--- a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/stats/skills/04100-04199.xml
index 130c8071dd..33b4d9d90c 100644
--- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/04100-04199.xml
index 19a1c7d8be..443cbdb298 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 52f5dabefa..f0b428cf5b 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/04100-04199.xml
index a002bca4c4..4070509077 100644
--- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/04100-04199.xml
@@ -2811,8 +2811,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/04100-04199.xml
index f9ec809d72..516270f53d 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/04100-04199.xml
@@ -2778,8 +2778,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/04100-04199.xml
index bec43b7913..bd5c7a2f08 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/04100-04199.xml
@@ -2795,8 +2795,7 @@
ENEMY
SINGLE
-
-
+
diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
deleted file mode 100644
index 0e2121f99c..0000000000
--- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/ai/areas/CrumaTower/SummonPc.java
+++ /dev/null
@@ -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 .
- */
-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.
- * 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();
- }
-}
diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/CallPc.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
index 0613a58859..5291fe4311 100644
--- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
+++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/CallPc.java
@@ -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);
+ }
}
}
diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/04100-04199.xml b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/04100-04199.xml
index b22048a887..c60e18da9a 100644
--- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/04100-04199.xml
+++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/04100-04199.xml
@@ -2795,8 +2795,7 @@
ENEMY
SINGLE
-
-
+