Page 1 of 1

What is L2Playable?

Posted: Sun Aug 20, 2017 8:53 am
by ShinichiYao
I'm a little confused. Someone please explain this kind of Type, Mob? NPC? door? Guard? Attackable? moveable?...

Re: What is L2Playable?

Posted: Sun Aug 20, 2017 1:07 pm
by LasTravel
"This class represents all Playable characters in the world" L2PcInstance and L2Summon

Re: What is L2Playable?

Posted: Mon Aug 21, 2017 3:02 am
by ShinichiYao
So its anything that can be controlled by player, including also pet and airship?

Re: What is L2Playable?

Posted: Mon Aug 21, 2017 5:33 am
by Zoey76
L2Playable is the parent class for L2PcInstance, the player, and L2Summon which is the parent class for L2Pet and L2Servitor.

There shouldn't be any L2Playable class in L2J, and L2Summon class should extend L2Npc, but this is how it was designed several years ago and even when we plan to change it in the future, is not a top priority.

Regards.

Re: What is L2Playable?

Posted: Mon Aug 21, 2017 6:43 am
by ShinichiYao
Thanks for your explain :clap:

I have some difficulty reading this before, now its clear.

Code: Select all

// Even though there's no path found (remember geonodes aren't perfect),
// the mob is attacking and right now we set it so that the mob will go
// after target anyway, is dz is small enough.
// With cellpathfinding this approach could be changed but would require taking
// off the geonodes and some more checks.
// Summons will follow their masters no matter what.
// Currently minions also must move freely since L2AttackableAI commands them to move along with their leader
if (isPlayer() || (!isPlayable() && !isMinion() && (Math.abs(z - curZ) > 140)) || (isSummon() && !((L2Summon) this).getFollowStatus()))
{
	getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
	return;
}