Page 1 of 1

Enchant zone

Posted: Mon Jul 25, 2011 11:29 am
by sahar
can anyone help me making enchant zone?

im trying to make a zone which will be used as the only place to enchant stuff

i got the following code, it works but it has 1 problem, if u are in an empty area u still can enchant, any1 got any ideas?

Code: Select all

        Collection<L2Character> knownNPC = activeChar.getKnownList().getKnownCharactersInRadius(80);        if(knownNPC == null)        {            activeChar.setActiveEnchantItem(null);            activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");            return;        }        else        {            for(L2Character obj : knownNPC)            {                if(!(obj instanceof L2NpcInstance))                {                    activeChar.setActiveEnchantItem(null);                    activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");                    return;                }                else if(((L2NpcInstance) obj).getNpcId() != 32027)                {                    activeChar.setActiveEnchantItem(null);                    activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");                    return;                }            }        }