Skip to content

Item Enchantment

Featured Replies

Can help me somebody with enchant items to Npc? i am using l2jaCis

maybe you need that:

<?xml version='1.0' encoding='utf-8'?>
<list maintainEnchantment="true">
    <item id="1">
        <ingredient id="57" count="200000000"/>
        <production id="8191" count="1" enchant="26"/>
    </item>
    </list>

  • Author

Look..

http://ODv2mZu.jpg

LoveLess it's me. and i want to enchant npc bow. (it is guard)

 

Edited by FactorX

You only need to use npc.setEnchant(int) on npc spawn. If you want it updated instantly (let's say the NPC was already spawned and you edit the enchant value), you have to broadcast NpcInfo packet every time you edit the color (in order players see it, otherwise they can teleport back to the zone and it will correctly show).

If you want it for every instance of a particular NPC, you can add/edit "enchant" tag on its template directly, which will automatically setEnchant() on NPC instance creation. Then you don't have to care about anything else, since it's hardwritten.

Edited by Tryskell

  • Author

Thank you...you complicated my life :))

Edited by FactorX

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.