Aggressive monsters problem..:?:

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Aggressive monsters problem..:?:

Post 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.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Aggressive monsters problem..:?:

Post 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.)
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: Aggressive monsters problem..:?:

Post by kotkot90 »

ok im updating...
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: Aggressive monsters problem..:?:

Post 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.
Image
Image
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Aggressive monsters problem..:?:

Post by jurchiks »

I don't think that helps him much...
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: Aggressive monsters problem..:?:

Post 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...
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: Aggressive monsters problem..:?:

Post 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.
Last edited by Stake on Thu Aug 12, 2010 2:44 pm, edited 3 times in total.
Image
Image
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: Aggressive monsters problem..:?:

Post by kotkot90 »

so there is a problem in the code?
babyjason
Posts: 575
Joined: Wed Dec 02, 2009 7:59 pm

Re: Aggressive monsters problem..:?:

Post by babyjason »

nop
Last edited by babyjason on Thu Aug 12, 2010 6:17 pm, edited 1 time in total.
Phantom2005
Posts: 72
Joined: Wed Jul 06, 2005 4:27 pm
Location: Netherlands

Re: Aggressive monsters problem..:?:

Post 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.
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: Aggressive monsters problem..:?:

Post 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.
Image
Image
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: Aggressive monsters problem..:?:

Post 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
User avatar
kotkot90
Posts: 30
Joined: Sat Jun 19, 2010 2:01 pm

Re: Aggressive monsters problem..:?:

Post 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?
Phantom2005
Posts: 72
Joined: Wed Jul 06, 2005 4:27 pm
Location: Netherlands

Re: Aggressive monsters problem..:?:

Post 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.
"If 64 bits isn't enough, the next logical step is 128 bits. That's enough to survive Moore's Law until I'm dead, and after that, it's not my problem."
©Jeff Bonwick
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: Aggressive monsters problem..:?:

Post 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.
Image
Image
Post Reply