Page 1 of 3

Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 9:42 am
by kotkot90
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4410:
L2JDP Revision 7664:

The default protocol revision was 152, I also set 146 because I have the old client.
My problem is that not all aggressive monsters attack players, I set PlayerSpawnProtection = 0

EDIT: I also use geodata.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 9:55 am
by jurchiks
update your client while you still can and don't change protocols! (WHY THE HELL are they even in config? Nobody should change them anyway, they should be hardcoded and only those that REALLY need it would change it there.)

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 10:34 am
by kotkot90
ok im updating...

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 11:07 am
by Stake
kotkot90 wrote:If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4410:
L2JDP Revision 7664:

The default protocol revision was 152, I also set 146 because I have the old client.
My problem is that not all aggressive monsters attack players, I set PlayerSpawnProtection = 0

EDIT: I also use geodata.
Since mobs with aggro should be active, but if there is no player in their knownlist, they change to idle state, and somehow they never want to change back to active even if I'm removed from the knownlist, then added again.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 11:10 am
by jurchiks
I don't think that helps him much...

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 12:58 pm
by kotkot90
I updated the client but its still the same. Some of the aggressive monsters won't attack. I tried that at anthara's lair entrance. I pass near 2 bloody queens but only 1 attacks, the other remains idle. I also tried that in many other places and the result is the same. What's wrong? My installation is good and clean, got no errors and everything else is running perfectly.

EDIT: Well I think I found something, maybe that helps. I shift click on aggressive monsters and some of them have IDLE INTENTION AI_INTENTION_IDLE , these never attack and never change their intention,, but the ones that are active AI_INTENTION_ACTIVE, moving around will immediatelly attack when I pass near them...

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 2:13 pm
by Stake
kotkot90 wrote:I updated the client but its still the same. Some of the aggressive monsters won't attack. I tried that at anthara's lair entrance. I pass near 2 bloody queens but only 1 attacks, the other remains idle. I also tried that in many other places and the result is the same. What's wrong? My installation is good and clean, got no errors and everything else is running perfectly.

EDIT: Well I think I found something, maybe that helps. I shift click on aggressive monsters and some of them have IDLE INTENTION AI_INTENTION_IDLE , these never attack and never change their intention,, but the ones that are active AI_INTENTION_ACTIVE, moving around will immediatelly attack when I pass near them...
That is what I said. :) Maybe the problem is with the hasAI() function, that is basically null, until the npc's getAI() function is called. When you go away from a mob, then go back, and you shift+click on it, you see, that it doesn't show the AI type. So, it doesn't show, because it also checks if there is AI, so it is surely the problem. I do a test with checking getAI() != null instead of checking hasAI(), then I make a little patch, if everything is okay. :)

EDITED:
So, I checked, and it worked for me with this little modification:

Code: Select all

Index: java/com/l2jserver/gameserver/model/actor/knownlist/MonsterKnownList.java===================================================================--- java/com/l2jserver/gameserver/model/actor/knownlist/MonsterKnownList.java	(revision 4407)+++ java/com/l2jserver/gameserver/model/actor/knownlist/MonsterKnownList.java	(working copy)@@ -36,7 +36,6 @@  		// Set the L2MonsterInstance Intention to AI_INTENTION_ACTIVE if the state was AI_INTENTION_IDLE 		if (object instanceof L2PcInstance-				&& getActiveChar().hasAI() 				&& getActiveChar().getAI().getIntention() == CtrlIntention.AI_INTENTION_IDLE) 			getActiveChar().getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE, null);  
We don't need to check if a mob has AI, because that often returns false, and why check the AI, when getAI() creates a new if it's null... So, this was very annoying.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 2:15 pm
by kotkot90
so there is a problem in the code?

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 2:35 pm
by babyjason
nop

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 3:24 pm
by Phantom2005
Server starts, monsters spawn.
They all are working fine mobs are set to IDLE if no players in region, else ACTIVE.
After a certain amount of time a mob with IDLE intention their AI will be removed.

Once it's removed, the mob won't be aggro anymore.
You can find these mobs by shift+click on the mob.

When a mob is attacked, AI will return and mob will attack back.

Once a killed aggro mob respawns it will stay ACTIVE again, until players leave region and then the same story happens like I said above.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 4:13 pm
by Stake
Phantom2005 wrote:Server starts, monsters spawn.
They all are working fine mobs are set to IDLE if no players in region, else ACTIVE.
After a certain amount of time a mob with IDLE intention their AI will be removed.

Once it's removed, the mob won't be aggro anymore.
You can find these mobs by shift+click on the mob.

When a mob is attacked, AI will return and mob will attack back.

Once a killed aggro mob respawns it will stay ACTIVE again, until players leave region and then the same story happens like I said above.
That "certain amount of time" is when you exit the region. It is triggered by setXYZ() that calls updateWorldRegion(), and if the region becomes inactive, it stops all the mobs' AI's, then sets them into idle state, then sets the AI null (detachAI()). However, I don't know, why need to set the AI null, since it turns IDLE, that does nothing. It should be only stopped, and set to idle. It would be a little performance improvement, if it didn't set the _ai variable null every time for nothing.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 4:34 pm
by kotkot90
wow thanks, I will try that. That fix will be on next revision? I searched too, but I get lost in this code, don't know where to look most time.. thanks anyway

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 4:43 pm
by kotkot90
Phantom2005 wrote:Server starts, monsters spawn.
They all are working fine mobs are set to IDLE if no players in region, else ACTIVE.
After a certain amount of time a mob with IDLE intention their AI will be removed.

Once it's removed, the mob won't be aggro anymore.
You can find these mobs by shift+click on the mob.

When a mob is attacked, AI will return and mob will attack back.

Once a killed aggro mob respawns it will stay ACTIVE again, until players leave region and then the same story happens like I said above.
So, you want to say that monsters that have IDLE intention won't be aggro anymore until someone attacks them? Is that retail like?

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 5:35 pm
by Phantom2005
Mobs that got their AI removed because of the IDLE intention AI remove are not aggro any more.
Like Stake said, I guess removing the part where it sets _ai to null will do the job.

If I have time left today I'll try it.

Re: Aggressive monsters problem..:?:

Posted: Thu Aug 12, 2010 6:34 pm
by Stake
Phantom2005 wrote:Mobs that got their AI removed because of the IDLE intention AI remove are not aggro any more.
Like Stake said, I guess removing the part where it sets _ai to null will do the job.

If I have time left today I'll try it.
The whole AI system should be rewritten, and concentrated for performance improvement.