All pastes #110988 Raw Edit

Mine

public text v1 · immutable
·published 2006-08-02 01:59 UTC
rendered paste body
        // Check if the actor is a L2GuardInstance
        if (_actor instanceof L2GuardInstance && target instanceof L2PcInstance)
        {
            
            int mobid = ((L2NpcInstance)_actor).getNpcId();

            if (target instanceof L2PcInstance && Config.GOODFACTION_GUARDS_LIST.contains(mobid)) return ((L2PcInstance) target).getPlayerFaction() == 2;
            if (target instanceof L2PcInstance && Config.EVILFACTION_GUARDS_LIST.contains(mobid)) return ((L2PcInstance) target).getPlayerFaction() == 1;

            // Check if the L2MonsterInstance target is aggressive
            if (target instanceof L2MonsterInstance) return ((L2MonsterInstance) target).isAggressive();
            
            return false;
            
        }