All pastes #32828 Raw Edit

Anonymous

public text v1 · immutable
#32828 ·published 2005-12-07 19:48 UTC
rendered paste body
	public void removeKnownObject(L2Object object)
	{
		if (object == null)
		    return;
		// Remove a L2Object from _knownObjects, _knownPlayer, _aggroList of the L2Attackable then cancel Attak or Cast if it was targeted
		super.removeKnownObject(object);
		
		// Check if the object is a L2Character
		if (!(object instanceof L2Character))
			return;
		
		if (hasAI()) 
		{	
			// Notify the L2MonsterInstance AI with EVT_FORGET_OBJECT
			getAI().notifyEvent(CtrlEvent.EVT_FORGET_OBJECT, object);
			
			//TODO Remove this function because it's already done in L2Character.removeKnownObject 
			// Set the current target to null if the forgotten L2Object was the targeted L2Object
			// L2Character temp = (L2Character)object;
			
			//if (getTarget() == temp)
			//	setTarget(null);
		}	
	
		if (isVisible() && getKnownPlayers().isEmpty())
		{
			// Clear the _aggroList of the L2MonsterInstance
			clearAggroList();
			
			// Remove all L2Object from _knownObjects and _knownPlayer of the L2MonsterInstance then cancel Attak or Cast and notify AI
			//removeAllKnownObjects();
			
			//TODO Remove this function because it's already done in L2Attackable.removeKnownObject 
			// Set the L2MonsterInstance AI to AI_INTENTION_IDLE
			// if (hasAI())
			// getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
			
			return;
		}
	}