Enchant zone

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
Post Reply
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Enchant zone

Post 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;                }            }        }
Post Reply