L2JMobius
Public Development => Bug Reports => Topic started by: caioconc on October 26, 2024, 03:33:11 AM
-
I noticed that the kookaburra is being summoned together with other pets and I also didn't find it in the file (PetSkillData)
I haven't tested the other baby and Improved summons.
-
(https://i.ibb.co/kmsmpQP/image.png)
-
Alright, I would start by modifying the effect handler that summons them.
If other summon is active -> return.
-
Alright, I would start by modifying the effect handler that summons them.
If other summon is active -> return.
I understand, I've come to this, but I believe there's something more to it since pet items don't overlap each other, only skills with "pet items"
just treating these skills 2046 will resolve the duplication, my question is which element/XML controls the skill/level of pet items
if (caster.isPlayer() && !instantCast)
{
// Send a system message to the player.
if (!_skill.isHidingMessages())
{
caster.sendPacket(_skill.getId() != [color=red]2046 [/color]? new SystemMessage(SystemMessageId.YOU_USE_S1).addSkillName(_skill) : new SystemMessage(SystemMessageId.SUMMONING_YOUR_PET));
}
// Show the gauge bar for casting.
caster.sendPacket(new SetupGauge(caster.getObjectId(), SetupGauge.BLUE, displayedCastTime));
}
-
summon.java
Add this on the instant
if (!effector.isPlayer() || effector.hasSummon())
{
return;
}
if (player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_MULTIPLE_PETS_AT_THE_SAME_TIME);
return;
}
-
SummonPet already has this part.
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}
-
SummonPet already has this part.
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}
That's what I don't understand, I know that a summon and a pet have different invocations but the functions are the same, for example in the pet I can't use the heal of the summoner classes because there is this differentiation
-
Just add it on Summon.java effect handler.
-
summon.java
Add this on the instant
if (!effector.isPlayer() || effector.hasSummon())
{
return;
}
if (player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_MULTIPLE_PETS_AT_THE_SAME_TIME);
return;
}
where did you add this code? thanks for the help!
-
where did you add this code? thanks for the help!
@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
if (!effector.isPlayer() || effector.hasSummon())
{
return;
}
final Player player = effector.asPlayer();
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}
if (player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_MULTIPLE_PETS_AT_THE_SAME_TIME);
return;
}
final NpcTemplate template = NpcData.getInstance().getTemplate(_npcId);
final Servitor summon = new Servitor(template, player);
But keep in mind I don't allow to re-summon like classic
-
@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
if (!effector.isPlayer() || effector.hasSummon())
{
return;
}
final Player player = effector.asPlayer();
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}
if (player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_MULTIPLE_PETS_AT_THE_SAME_TIME);
return;
}
final NpcTemplate template = NpcData.getInstance().getTemplate(_npcId);
final Servitor summon = new Servitor(template, player);
But keep in mind I don't allow to re-summon like classic
Isn't that summon.java?
This thing is in summonpet.java:
public void instant (creature effector, affected creature, ability ability, item item)
-
Try this.
Index: dist/game/data/scripts/handlers/effecthandlers/Summon.java
===================================================================
--- dist/game/data/scripts/handlers/effecthandlers/Summon.java (revision 15385)
+++ dist/game/data/scripts/handlers/effecthandlers/Summon.java (working copy)
@@ -30,6 +30,7 @@
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
+import org.l2jmobius.gameserver.network.SystemMessageId;
/**
* Summon effect implementation.
@@ -78,6 +79,12 @@
}
final Player player = effected.getActingPlayer();
+ if (player.hasPet() || player.isMounted())
+ {
+ player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
+ return;
+ }
+
if (player.hasServitors())
{
player.getServitors().values().forEach(s -> s.unSummon(player));