L2JMobius

Public Development => Bug Reports => Topic started by: caioconc on October 26, 2024, 03:33:11 AM

Title: Kookaburra - Isn't it a pet?
Post 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.
Title: Re: Kookaburra - Isn't it a pet?
Post by: caioconc on October 26, 2024, 07:10:26 PM
(https://i.ibb.co/kmsmpQP/image.png)
Title: Re: Kookaburra - Isn't it a pet?
Post by: Mobius on October 26, 2024, 07:25:45 PM
Alright, I would start by modifying the effect handler that summons them.

If other summon is active -> return.
Title: Re: Kookaburra - Isn't it a pet?
Post by: caioconc on October 26, 2024, 07:48:06 PM
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
Code: [Select]
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));
}
Title: Re: Kookaburra - Isn't it a pet?
Post by: Naker on October 27, 2024, 11:16:34 AM
summon.java
Add this on the instant
Code: [Select]
if (!effector.isPlayer() || effector.hasSummon())
{
return;
}
if (player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_MULTIPLE_PETS_AT_THE_SAME_TIME);
return;
}
Title: Re: Kookaburra - Isn't it a pet?
Post by: Mobius on October 27, 2024, 01:58:11 PM
SummonPet already has this part.
Code: [Select]
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}
Title: Re: Kookaburra - Isn't it a pet?
Post by: caioconc on October 27, 2024, 03:35:09 PM
SummonPet already has this part.
Code: [Select]
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
Title: Re: Kookaburra - Isn't it a pet?
Post by: Mobius on October 27, 2024, 04:01:38 PM
Just add it on Summon.java effect handler.
Title: Re: Kookaburra - Isn't it a pet?
Post by: caioconc on October 28, 2024, 01:32:52 AM
summon.java
Add this on the instant
Code: [Select]
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!
Title: Re: Kookaburra - Isn't it a pet?
Post by: Naker on October 28, 2024, 01:44:59 AM
where did you add this code? thanks for the help!
Code: [Select]
@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
Title: Re: Kookaburra - Isn't it a pet?
Post by: caioconc on October 28, 2024, 02:15:04 AM
Code: [Select]
@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)
Title: Re: Kookaburra - Isn't it a pet?
Post by: Mobius on October 28, 2024, 02:29:21 AM
Try this.
Code: (diff) [Select]
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));