L2JMobius

Public Development => Solved/Invalid Bug Reports => Topic started by: ver on January 22, 2022, 12:31:24 PM

Title: Best Farm
Post by: ver on January 22, 2022, 12:31:24 PM
Hello guys,

I might be wrong but as far as I know and remember from retail single char was able to train just one mob at the moment. Right now I'm having 3 trained and following me birds...

(https://snipboard.io/Dv8UgJ.jpg)

Players were reporting dozens of trained pets in same time.
Title: Re: Best Farm
Post by: gugukin on January 25, 2022, 05:22:58 PM
hello, I tried it with a normal pj and I don't have that problem only with pj admin.
Title: Re: Best Farm
Post by: ver on January 25, 2022, 07:58:48 PM
By "pj" you mean player?;)
If yes, well, my players did not have admins rights and still they noticed that issue.
The thing is it's not happening all the time... after each mob. However I didn't find any pattern, errors, whatsoever...
Title: Re: Best Farm
Post by: Mobius on January 25, 2022, 08:07:44 PM
What code makes pets summoned?
Title: Re: Best Farm
Post by: gugukin on January 25, 2022, 11:31:13 PM
By "pj" you mean player?;)
If yes, well, my players did not have admins rights and still they noticed that issue.
The thing is it's not happening all the time... after each mob. However I didn't find any pattern, errors, whatsoever...

True, it doesn't always happen.
Title: Re: Best Farm
Post by: Mobius on January 26, 2022, 08:28:06 AM
Try this.
Code: (diff) [Select]
Index: dist/game/data/scripts/ai/others/FeedableBeasts.java
===================================================================
--- dist/game/data/scripts/ai/others/FeedableBeasts.java (revision 9774)
+++ dist/game/data/scripts/ai/others/FeedableBeasts.java (working copy)
@@ -342,6 +342,17 @@
 
  private void spawnNext(Npc npc, int growthLevel, PlayerInstance player, int food)
  {
+ if (npc.isScriptValue(1))
+ {
+ return;
+ }
+ npc.setScriptValue(1);
+
+ if (!npc.isSpawned())
+ {
+ return;
+ }
+
  final int npcId = npc.getNpcId();
  int nextNpcId = 0;
 
Title: Re: Best Farm
Post by: ver on January 26, 2022, 02:43:40 PM
Nice, it works. Thanks.
Title: Re: Best Farm
Post by: Strelook66 on January 26, 2022, 04:38:16 PM
Hi,

I don't know if anyone noticed, but the deleteMe() doesn't work correctly sometimes. After you successfully leveled up a beast (growthLevel doesn't matter) and killed it afterwards, for the player that killed it it will despawn and will be removed from the world. But there is a small chance that for the other party members the mob will stay there un-targetable, just a hollow mob. Like it didn't clear it for them visually.

Picture 1: Killed it with the spoiler: https://imgur.com/a/hktUcFU (https://imgur.com/a/hktUcFU)
Picture 2: 2nd member from party: https://imgur.com/a/WWNOmZT (https://imgur.com/a/WWNOmZT)

Both characters are in the same area and as you can in one client the mobs are not there, and on the other they are yet cannot target them.
Title: Re: Best Farm
Post by: Mobius on January 26, 2022, 05:19:38 PM
Hi,

I don't know if anyone noticed, but the deleteMe() doesn't work correctly sometimes. After you successfully leveled up a beast (growthLevel doesn't matter) and killed it afterwards, for the player that killed it it will despawn and will be removed from the world. But there is a small chance that for the other party members the mob will stay there un-targetable, just a hollow mob. Like it didn't clear it for them visually.

Picture 1: Killed it with the spoiler: https://imgur.com/a/hktUcFU (https://imgur.com/a/hktUcFU)
Picture 2: 2nd member from party: https://imgur.com/a/WWNOmZT (https://imgur.com/a/WWNOmZT)

Both characters are in the same area and as you can in one client the mobs are not there, and on the other they are yet cannot target them.
Make another post for that.

Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/179106172f08234d1f4a594ab2afc9a0cb7d9250