Как настраивать рецепты и нужные игридиенты.

Путь:
gameserver\data\recipe.xml

Пример рецепта - формат ясен из без детального описания:
<recipe id="1" name="Recipe: Wooden Arrow" level="1" mp_consume="30" success_rate="100" item_id="1666" is_common="false">
<!--Description: For Dwarves only. The recipe for a Wooden Arrow. Requires Create Item Level 1. The success rate is 100%-->
<materials>
<item id="1864" name="Stem" count="4"/>
<item id="1869" name="Iron Ore" count="2"/>
</materials>
<products>
<item id="17" name="Wooden Arrow" count="500"/>
</products>
<npc_fee>
<item id="1666" name="Recipe: Wooden Arrow" count="1"/>
<item id="57" name="Adena" count="200"/>
</npc_fee>
</recipe>

1.Единственное можете вообще удалять, или не указывать если создаете свой уникальный рецепт
<npc_fee>
<item id="1666" name="Recipe: Wooden Arrow" count="1"/>
<item id="57" name="Adena" count="200"/>
</npc_fee>

2. Рецы так же делятся для всех или гномов - за это отвечает is_common="false" только гномы. Вообще все is_common="true"
Финальный пример:
<recipe id="1" name="Recipe: Wooden Arrow" level="1" mp_consume="30" success_rate="100" item_id="1666" is_common="false">
<!--Description: For Dwarves only. The recipe for a Wooden Arrow. Requires Create Item Level 1. The success rate is 100%-->
<materials>
<item id="1864" name="Stem" count="4"/>
<item id="1869" name="Iron Ore" count="2"/>
</materials>
<products>
<item id="17" name="Wooden Arrow" count="500"/>
</products>
</recipe>
 
Last edited:
Нид хелп.
Классик клиент.
Рецепт добавил item_name, etcItem, recipe (естественно все файлы с припиской classic)
Куски в item_name, etcItem
Оружие в item_name и weapon gr
Добавил на сервер рецепт, куски как предметы
Добавил в recipe.xml рецепт
Code:
item
item_name_begin    id=19353    name=[Recipe:  Apocalypse Thrower (60%)]    additionalname=[]    description=[For Dwarves only. Recipe for making an Apocalypse Thrower. Requires level 9 of the create item skill. Success rate is 60%.]    popup=-1    default_action=[action_recipe]    use_order=0    name_class=-1    color=1    Tooltip_Texture=[None]    is_trade=1    is_drop=1    is_destruct=1    is_private_store=1    keep_type=7    is_npctrade=1    is_commission_store=1    item_name_end

etc
item_begin    tag=2    object_id=19353    drop_type=0    drop_anim_type=3    drop_radius=6    drop_height=3    drop_texture={{[dropitems.drop_scroll_m00];{[dropitemstex.drop_scroll_t00]}}}    icon={[icon.etc_recipe_gold_i00];[None];[None];[None];[None]}    durability=-1    weight=30    material_type=53    crystallizable=0    related_quest_id={}    color=1    is_attribution=0    property_params=0    icon_panel=[None]    complete_item_dropsound_type=[None]    inventory_type=3    mesh={[None]}    texture={[None]}    drop_sound=[ItemSound.itemdrop_scroll]    equip_sound=[None]    consume_type=2    etcitem_type=5    crystal_type=0    item_end

rec
recipe_begin    name=[mk_R2_bow]    id=1038    recipe_id=19353    level=9    product_id=17330    product_num=1    is_showtree=1    is_multiple_product=0    mp_consume=264    success_rate=60    material={{19353;1;0};{19209;22;0};{5554;8;612};{1890;675;38};{1888;300;36};{5550;450;608};{4042;150;0};{1462;422;0};{2134;86;0}}    recipe_end


Code:
</recipe>  
            <recipe id="878" name="Recipe: Apocalypse Thrower (60%)" level="9" mp_consume="225" success_rate="60" item_id="19353" is_common="false">
            <materials>
            <item id="19353" name="Recipe: Apocalypse Thrower (60%)" count="1"/>
            <item id="19209" name="Apocalypse Thrower Fragment" count="22"/>
            <item id="5554" name="Warsmith's Holder" count="8"/>
            <item id="1890" name="Mithril Alloy" count="675"/>
            <item id="1888" name="Synthetic Cokes" count="300"/>
            <item id="5550" name="Durable Metal Plate" count="450"/>
            <item id="4042" name="Enria" count="150"/>
            <item id="1462" name="Crystal (S-Grade)" count="422"/>
            <item id="2134" name="Gemstone S" count="86"/>
        </materials>
        <products>
            <item id="17330" name="Apocalypse Thrower" count="1"/>
        </products>
    </recipe>



Что получил:
Рецепт существует - спавню, могу записать
Куски существуют - спавнятся без проблем
Оружие готовое есть - можно юзать
Рецепт можно записать в книгу рецептов

НО
При открытие книги рецептов мой рецепт без иконки, и не кликабелен, не имеет имени. Причем рецепты что были до этого записываются, и кликабельны. Сервер загружается без ошибок



UPD:
Проблему нашел. В rec dat файле ID должен совпадать с XML
 

Attachments

  • Безымянный.webp
    Безымянный.webp
    32 KB · Views: 23
Last edited:
Всем привет так же всё добавил по местам ну нет реакции на рецепт не какой
 
хелп добавил рецепты в клиент

Code:
etcitemgrp.dat : 2    54554    0    3    6    3    0    dropitems.drop_scroll_m00            dropitemstex.drop_scroll_t00            icon.etc_recipe_blue_i00                    0    30    53    0    0    1        1        ItemSound.itemdrop_scroll        2    5    0
itemname-e.dat : 54554    Recipe: Mithril Alloy        For Dwarves only. The recipe for Mithril Alloy. Requires Create Item - Skill Level 4. The success rate is 100%.    -1                    0    0    0  
recipe-c.dat : mk_mithirl_alloy    914    54554    4    1890    1    40    100    3    1887    1    1880    2    1876    1

также добавил в сервер

Code:
    <recipe id="914" name="Recipe: Mithril Alloy" level="4" mp_consume="40" success_rate="100" item_id="54554" is_common="false">
        <!--Description: For Dwarves only. The recipe for Mithril Alloy. Requires Create Item - Skill Level 4. The success rate is 100%-->
        <materials>
            <item id="1887" name="Varnish of Purity" count="100"/>
            <item id="1880" name="Steel" count="200"/>
            <item id="1876" name="Mithril Ore" count="100"/>
        </materials>
        <products>
            <item id="1890" name="Mithril Alloy" count="100"/>
        </products>
    </recipe>

поменял везде ID, попытался заспавнить в игре, пишет что итем несуществует


Code:
[01:58:04]  WARN ItemHolder: Not defined item id : 54554, or out of range!
java.lang.Exception: null
        at l2.gameserver.data.xml.holder.ItemHolder.getTemplate(Unknown Source)
        at l2.gameserver.model.items.ItemInstance.setItemId(Unknown Source)
        at l2.gameserver.model.items.ItemInstance.<init>(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.a(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.useAdminCommand(Unknown Source)
        at l2.gameserver.handler.admincommands.AdminCommandHandler.useAdminCommandHandler(Unknown Source)
        at l2.gameserver.network.l2.c2s.RequestBypassToServer.runImpl(Unknown Source)
        at l2.gameserver.network.l2.c2s.L2GameClientPacket.run(Unknown Source)
        at l2.commons.net.nio.impl.MMOExecutableQueue.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)
[01:58:04] ERROR AdminCommandHandler:
java.lang.NullPointerException: Cannot invoke "l2.gameserver.templates.item.ItemTemplate.getDurability()" because the return value of "l2.gameserver.model.items.ItemInstance.getTemplate()" is null
        at l2.gameserver.model.items.ItemInstance.<init>(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.a(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.useAdminCommand(Unknown Source)
        at l2.gameserver.handler.admincommands.AdminCommandHandler.useAdminCommandHandler(Unknown Source)
        at l2.gameserver.network.l2.c2s.RequestBypassToServer.runImpl(Unknown Source)
        at l2.gameserver.network.l2.c2s.L2GameClientPacket.run(Unknown Source)
        at l2.commons.net.nio.impl.MMOExecutableQueue.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)

немогу понять где я ошибся, если не трудно ткните носом
 
Last edited:
хелп добавил рецепты в клиент

Code:
etcitemgrp.dat : 2    54554    0    3    6    3    0    dropitems.drop_scroll_m00            dropitemstex.drop_scroll_t00            icon.etc_recipe_blue_i00                    0    30    53    0    0    1        1        ItemSound.itemdrop_scroll        2    5    0
itemname-e.dat : 54554    Recipe: Mithril Alloy        For Dwarves only. The recipe for Mithril Alloy. Requires Create Item - Skill Level 4. The success rate is 100%.    -1                    0    0    0
recipe-c.dat : mk_mithirl_alloy    914    54554    4    1890    1    40    100    3    1887    1    1880    2    1876    1

также добавил в сервер

Code:
    <recipe id="914" name="Recipe: Mithril Alloy" level="4" mp_consume="40" success_rate="100" item_id="54554" is_common="false">
        <!--Description: For Dwarves only. The recipe for Mithril Alloy. Requires Create Item - Skill Level 4. The success rate is 100%-->
        <materials>
            <item id="1887" name="Varnish of Purity" count="100"/>
            <item id="1880" name="Steel" count="200"/>
            <item id="1876" name="Mithril Ore" count="100"/>
        </materials>
        <products>
            <item id="1890" name="Mithril Alloy" count="100"/>
        </products>
    </recipe>

поменял везде ID, попытался заспавнить в игре, пишет что итем несуществует


Code:
[01:58:04]  WARN ItemHolder: Not defined item id : 54554, or out of range!
java.lang.Exception: null
        at l2.gameserver.data.xml.holder.ItemHolder.getTemplate(Unknown Source)
        at l2.gameserver.model.items.ItemInstance.setItemId(Unknown Source)
        at l2.gameserver.model.items.ItemInstance.<init>(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.a(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.useAdminCommand(Unknown Source)
        at l2.gameserver.handler.admincommands.AdminCommandHandler.useAdminCommandHandler(Unknown Source)
        at l2.gameserver.network.l2.c2s.RequestBypassToServer.runImpl(Unknown Source)
        at l2.gameserver.network.l2.c2s.L2GameClientPacket.run(Unknown Source)
        at l2.commons.net.nio.impl.MMOExecutableQueue.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)
[01:58:04] ERROR AdminCommandHandler:
java.lang.NullPointerException: Cannot invoke "l2.gameserver.templates.item.ItemTemplate.getDurability()" because the return value of "l2.gameserver.model.items.ItemInstance.getTemplate()" is null
        at l2.gameserver.model.items.ItemInstance.<init>(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.utils.ItemFunctions.createItem(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.a(Unknown Source)
        at l2.gameserver.handler.admincommands.impl.AdminCreateItem.useAdminCommand(Unknown Source)
        at l2.gameserver.handler.admincommands.AdminCommandHandler.useAdminCommandHandler(Unknown Source)
        at l2.gameserver.network.l2.c2s.RequestBypassToServer.runImpl(Unknown Source)
        at l2.gameserver.network.l2.c2s.L2GameClientPacket.run(Unknown Source)
        at l2.commons.net.nio.impl.MMOExecutableQueue.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:842)

немогу понять где я ошибся, если не трудно ткните носом
А ты итем рецепта сделал? в data/items?
Судя по ошибке - нет
 
Back
Top