L2JMobius

Classic Interlude Kookaburra - Isn't it a pet?

caioconc · 12 · 3676

Offline caioconc

  • Heir
  • **
    • Posts: 44
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.



Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
Alright, I would start by modifying the effect handler that summons them.

If other summon is active -> return.


Offline caioconc

  • Heir
  • **
    • Posts: 44
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));
}


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
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;
}


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
SummonPet already has this part.
Code: [Select]
if (player.hasPet() || player.isMounted())
{
player.sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return;
}


Offline caioconc

  • Heir
  • **
    • Posts: 44
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


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655

Offline caioconc

  • Heir
  • **
    • Posts: 44
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!


Online Naker

  • Count
  • *****
    • Posts: 450
  • Coding Dreams
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


Offline caioconc

  • Heir
  • **
    • Posts: 44
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)


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19655
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));