L2JMobius

Interlude GmShop Store

BazookaRpm · 1 · 2401

Online BazookaRpm

  • Count
  • *****
    • Posts: 449
  • Lineage II - lover - Heirophant
Hello, good afternoon. Here's how to create a simple GMSHOP so you can deploy it on your local servers. Looking at the structure, you can add more features to your liking. We'll use the game's original IDs and create an HTML for the store.

This doesn't require editing the source code; we just need to create the NPC XML, the multisell XML, and the HTML.

Route : git\master\L2J_Mobius_CT_0_Interlude\dist\game\data\stats\npcs\custom

Now we'll create our NPC Custom. For this, we'll use an original texture from the game, using only the NPC's display ID.
Whenever we use an NPC's structure in Display ID, we must respect all of its data.

We'll create our NPC XML within the npc/Custom path.
Create a new XML file inside NPC Custom, You can give it whatever name you want, for example gmshoparquimedes.xml
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/npcs.xsd">
<npc id="45600" displayId="30849" name="Arquimedes" usingServerSideName="true" title="Shop Manager" usingServerSideTitle="true" type="Merchant">
<collision>
<radius normal="7" />
<height normal="24" />
</collision>
</npc>
</list>

We already have the NPC created, now we must create the HTML that will show us our NPC.As an example, here we will create our HTML, we can copy and paste, but this will require you to finalize it according to your needs.

The files we are going to create are HTML and go in the following path.
Route : git\master\L2J_Mobius_CT_0_Interlude\dist\game\data\html\merchant
we will use this as a base example.

HTML name.   
45600.html  ( Main Html)

Code: [Select]
<html>
<title>General Shop</title>
<body>
<center>
<br>
<center><img src=L2UI.SquareGray width=150 height=1></center>
<td><img src="L2UI.SquareBlank" width=40 height=2></td>
<center><img src="L2UI.SquareGray" width=250 height=1></center>
<font color=3c3c3c>_________</font> <font color=ae9977>General Shop</font> <font color=3c3c3c>_________</font><br>
<table width=230>
<tr>
<td align=center><img src="icon.armor_t88_u_i00" width=32 height=32></td>
<td align=center><img src="icon.weapon_tallum_blade_i01" width=32 height=32></td>
<td align=center><img src="icon.accessory_ring_of_core_i00" width=32 height=32></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><button value="Armors" action="bypass -h npc_%objectId%_Chat 1" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Weapons" action="bypass -h npc_%objectId%_Chat 3" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Jewels" action="bypass -h npc_%objectId%_Chat 2" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><img src="icon.etc_prefect_belt_i00" width=32 height=32></td>
<td align=center><img src="icon.etc_blessed_scrl_of_ench_wp_s_i05" width=32 height=32></td>
<td align=center><img src="icon.item_normal45" width=32 height=32></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><button value="Pets" action="bypass -h npc_%objectId%_multisell 400000012" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Scrolls" action="bypass -h npc_%objectId%_multisell 400000013" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Tatto" action="bypass -h npc_%objectId%_multisell 400000014" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</tr>
<tr>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><img src="icon.accessory_valakas_circlet_i00" width=32 height=32></td></tr>
<td align=center><img src="icon.etc_con_hena_i01" width=32 height=32></td>
<td align=center><img src="icon.etc_spirit_bullet_gold_i00" width=32 height=32></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><button value="Accesory" action="bypass -h npc_%objectId%_multisell 400000015" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Dyes" action="bypass -h npc_%objectId%_multisell 400000016" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Consumable" action="bypass -h npc_%objectId%_multisell 400000017" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><img src="icon.etc_raid_b_i01" width=32 height=32></td>
<td align=center><img src="icon.etc_mineral_unique_i03" width=32 height=32></td>
<td align=center><img src="icon.etc_vacualite_noglow_white_i00" width=32 height=32></td>
</tr>
<tr><td></td></tr>
<tr>
<td align=center><button value="Various - Clan" action="bypass -h npc_%objectId%_Chat 4" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Lifes Stones" action="bypass -h npc_%objectId%_multisell 400000019" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><button value="Quest Items" action="bypass -h npc_%objectId%_multisell 400000020" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</table>
<br>
<button value="Sell" action="bypass -h npc_%objectId%_Sell" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2">
<font color=3c3c3c>__________________________</font><br>
</center>
</body>
</html>
Now that we have created our root HTML in the route, it could interact with our merchant NPC. Now we need to add the following HTML to our boxes so that they can open more pages or interact directly with our multisell.

HTML name.   
45600-1.html  ( Armor Html)

Code: [Select]
<html><title>General Shop</title>
<body>
<center>
<font color=3c3c3c>_________</font> <font color=ae9977>Armors Set</font> <font color=3c3c3c>_________</font><br>
</center>
<center>
<table width=230>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="icon.armor_t89_ul_i00" width=32 height=32></td>
<td align=center><button value="S80 Grade" action="bypass -h npc_%objectId%_multisell 400000001" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="icon.armor_t89_ul_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="icon.armor_t88_u_i00" width=32 height=32></td>
<td align=center><button value="S Grade" action="bypass -h npc_%objectId%_multisell 400000002" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="icon.armor_t89_ul_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="icon.armor_t77_ul_i00" width=32 height=32></td>
<td align=center><button value="A Grade" action="bypass -h npc_%objectId%_multisell 400000003" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="icon.armor_t76_ul_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="icon.armor_t71_ul_i00" width=32 height=32></td>
<td align=center><button value="B Grade" action="bypass -h npc_%objectId%_multisell 400000004" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="icon.armor_t59_ul_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="icon.armor_t21_ul_i00" width=32 height=32></td>
<td align=center><button value="C Grade" action="bypass -h npc_%objectId%_multisell 400000005" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="icon.armor_t53_u_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=center><img src="LucyCat_Weapons.shield_dynasty_shield_i00" width=32 height=32></td>
<td align=center><button value="Shields" action="bypass -h npc_%objectId%_multisell 400000030" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=center><img src="LucyCat_Weapons.weapon_tysandy_shield_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
</table>
</center>
<tr>
<center>
<td align=center><button value="Sell" action="bypass -h npc_%objectId%_Sell" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</center>
</tr>
<center>
<font color=3c3c3c>__________________________</font><br>
</center>
</body>
</html>


HTML name.   
45600-2.html  ( Jewels Html)

Code: [Select]
<html><title>General Shop</title>
<body>
<br>
<center>
<font color=3c3c3c>_________</font> <font color=ae9977>Jewels</font> <font color=3c3c3c>_________</font><br>
</center>
<center>
<table width=230>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.accessory_necklace_of_valakas_i00" width=32 height=32></td>
<td align=center><button value="S-Epic Boss" action="bypass -h npc_%objectId%_multisell 400000007" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.accessory_ring_of_baium_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.accessory_tateossian_earring_i00" width=32 height=32></td>
<td align=center><button value="S-Grade" action="bypass -h npc_%objectId%_multisell 400000008" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.accessory_tateossian_earring_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.accessary_phoenixs_earing_i00" width=32 height=32></td>
<td align=center><button value="A-Grade" action="bypass -h npc_%objectId%_multisell 400000009" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.accessary_inferno_ring_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.accessary_ring_of_black_ore_i00" width=32 height=32></td>
<td align=center><button value="B-grade" action="bypass -h npc_%objectId%_multisell 400000010" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.accessary_earing_of_black_ore_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.accessary_elven_ring_i00" width=32 height=32></td>
<td align=center><button value="C-D-Grade" action="bypass -h npc_%objectId%_multisell 400000011" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.accessary_elven_earing_i00" width=32 height=32></td>
</tr>



<tr><td><br></td></tr>
</table>
</center>
<br>
<tr>
<center>
<td align=center><button value="Sell" action="bypass -h npc_%objectId%_Sell" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</center>
</tr>
<center>
<font color=3c3c3c>__________________________</font><br>
</center>
</body>
</html>

HTML name.   
45600-3.html  ( Weapons Html)

Code: [Select]
<html><title>General Shop</title>
<body>
<center>
<font color=3c3c3c>_________</font> <font color=ae9977>Weapons</font> <font color=3c3c3c>_________</font><br>
</center>
<br>
<center>
<table width=230>
<tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_the_sword_of_hero_i00" width=32 height=32></td>
<td align=center><button value="S80 Grade" action="bypass -h npc_%objectId%_multisell 400000026" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_the_mace_of_hero_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_draconic_bow_i01" width=32 height=32></td>
<td align=center><button value="S Grade" action="bypass -h npc_%objectId%_multisell 400000021" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_angel_slayer_i01" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_sword_of_miracle_i01" width=32 height=32></td>
<td align=center><button value="A Grade" action="bypass -h npc_%objectId%_multisell 400000022" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_bloody_orchid_i01" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_kris_i01" width=32 height=32></td>
<td align=center><button value="B Grade" action="bypass -h npc_%objectId%_multisell 400000023" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_hazard_bow_i01" width=32 height=32></td></tr>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_homunkuluss_sword_i01" width=32 height=32></td>
<td align=center><button value="C Grade" action="bypass -h npc_%objectId%_multisell 400000024" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_eminence_bow_i01" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.weapon_scallop_jamadhr_i01" width=32 height=32></td>
<td align=center><button value="Epic Boss" action="bypass -h npc_%objectId%_multisell 400000025" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.weapon_life_stick_i01" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr><td><br></td></tr>
<tr>
</tr>
</table>
</center>
<tr>
<center>
<td align=center><button value="Sell" action="bypass -h npc_%objectId%_Sell" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</center>
</tr>
<center>
<font color=3c3c3c>__________________________</font><br>
</center>
</body>
</html>

HTML name.   
45600-4.html  ( Others items Html)
Code: [Select]
<html><title>General Shop</title>
<body>
<center>
<font color=3c3c3c>_________</font> <font color=ae9977>Various-Clan</font> <font color=3c3c3c>_________</font><br>
</center>
<br>
<center>
<table width=230>
<tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.etc_raid_b_i01" width=32 height=32></td>
<td align=center><button value="Various - Clan" action="bypass -h npc_%objectId%_multisell 400000018" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.etc_raid_b_i01" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
<td align=right><img src="icon.etc_echo_crystal_i00" width=32 height=32></td>
<td align=center><button value="Music Crystal" action="bypass -h npc_%objectId%_multisell 400000031" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
<td align=left><img src="icon.etc_echo_crystal_i00" width=32 height=32></td>
</tr>
<tr><td><br></td></tr>
<tr>
</tr>
</table>
</center>
<tr>
<center>
<td align=center><button value="Sell" action="bypass -h npc_%objectId%_Sell" width=85 height=26 back="L2UI_ch3.BigButton2_over" fore="L2UI_ch3.BigButton2"></td>
</center>
</tr>
<center>
<font color=3c3c3c>__________________________</font><br>
</center>
</body>
</html>

With this we have created all our HTML pages for our merchant NPC.Now you can see that each text in each HTML has an associated multisell inside these Multisell is where our objects will go.
I'll just give you one example of a multisell. You'll have to fill in the rest.

EXAMPLE. we must create an xml file within the multisell path. on the next route
git\master\L2J_Mobius_CT_0_Interlude Original\dist\game\data\multisell

For the HTML to interact with our multisell, it must have the same ID as the HTML, for example, consumables have the multisell ID 400000017

Multisell
400000017.xml
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<npcs>
<npc>45600</npc> <!-- General Shop Arkenia -->
</npcs>
<item>
<!-- Soulshot: No Grade ID: 1835 -->
<ingredient count="30" id="57" />
<production count="1" id="1835" />
</item>
<item>
<!-- Soulshot: D-grade ID: 1463 -->
<ingredient count="60" id="57" />
<production count="1" id="1463" />
</item>
<item>
<!-- Soulshot: C-grade ID: 1464 -->
<ingredient count="120" id="57" />
<production count="1" id="1464" />
</item>
<item>
<!-- Soulshot: B-grade ID: 1465 -->
<ingredient count="220" id="57" />
<production count="1" id="1465" />
</item>
<item>
<!-- Soulshot: A-grade ID: 1466 -->
<ingredient count="320" id="57" />
<production count="1" id="1466" />
</item>
<item>
<!-- Soulshot: S-grade ID: 1467 -->
<ingredient count="620" id="57" />
<production count="1" id="1467" />
</item>
<item>
<!-- Spiritshot: No Grade ID: 2509 -->
<ingredient count="80" id="57" />
<production count="1" id="2509" />
</item>
<item>
<!-- Spiritshot: D-grade ID: 2510 -->
<ingredient count="160" id="57" />
<production count="1" id="2510" />
</item>
<item>
<!-- Spiritshot: C-grade ID: 2511 -->
<ingredient count="320" id="57" />
<production count="1" id="2511" />
</item>
<item>
<!-- Spiritshot: B-grade ID: 2512 -->
<ingredient count="450" id="57" />
<production count="1" id="2512" />
</item>
<item>
<!-- Spiritshot: A-grade ID: 2513 -->
<ingredient count="560" id="57" />
<production count="1" id="2513" />
</item>
<item>
<!-- Spiritshot: S-grade ID: 2514 -->
<ingredient count="720" id="57" />
<production count="1" id="2514" />
</item>
</list>

Now that you can check how objects are added, both for their creation, you can do the same with the rest.

Ultimate example.
Set Armor B multisell.
400000004.xml
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<list maintainEnchantment="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd">
<npcs>
<npc>45600</npc> <!-- General Shop -->
</npcs>
<item>
<!-- 10 Doom Plate Armor Set -->
<ingredient count="8000000" id="57" />
<!-- Set -->
<production count="1" id="2381" />  <!-- Doom Plate Armor -->
<production count="1" id="2417" />  <!-- Doom Helmet -->
<production count="1" id="5722" />  <!-- Doom Gloves - Heavy -->
<production count="1" id="5738" />  <!-- Doom Boots - Heavy -->
</item>
</list>

I hope this can help improve some things regarding the game stores. While we created some XML and HTML, we only used the game's original resources and never modified the client, respecting the mod requirements.

I hope this helps you and you can create your store without any problems.

Atte BaZooKa


Atte BazooKa.RPM

Lineage II Lovers