Skip to content

Custom Shields Patch

Neo edited this page Jul 23, 2021 · 2 revisions

Initial Preparation

Diffing

The Custom Shields Patch allows the client to handle up to 127 Shield appearances instead of the default value of 5.

This can be done without worrying about any item id range limitations.

When applying the patch, it will prompt you to select the new maximum ViewID for the table:

Support Files

The patch works with the help of 2 supporting lua files (available in the Inputs folder of the tool).

  • ShieldTable.lub
  • ShieldTable_F.lub

While selecting the patch, the tool also offers to copy this file to your Target area's data folder.

This will only be done if the patch is applied.

Anyways, in case you opt not to do this, then you need to copy the files on your own. Please take note of these 2 points, while copying :

  • The files need to be added in your data/Luafiles514\Lua Files\Datainfo folder (case doesn't matter).

  • Once you copy the files, you need to go inside the ShieldTable_F.lub file and change the Max_Shield = 10 to the value you have set.

    For e.g.Max_Shield = 99 in case you chose 99 in the patch.

Sprites

The shield sprites should be added inside data\sprite\¹æÆÐ folder.

Customizations

Having all files in place, it's time to edit ShieldTable.lub.

In this file, there are 4 tables to be edited if you're adding a new Shield.

For this guide, MYSHIELD will be used as an example.

Shield Types:

Shield Types (STs) are how the ViewIDs, or appearances, for the Shields are called, and for them, we assign a specific number or ID.

ST_MYSHIELD = 7,

With that line, MYSHIELD is now the Shield Type (ST) 7, we can move to the next table:

Shield Items:

The Shield Items (SI) table identifies certain Item IDs (IDs of item_db or itemInfo) as Shields, so the client recognizes them and is able to display the actual sprite of the Shield.

So, for it to work properly, it's necessary to select an Item ID to use as the new Shield:

SI_MYSHIELD = 51001,

Shield Name Table:

Next, just like headgears or robes, it is necessary to assign an identifier so the ST knows which files to look for using a suffix on their SPR/ACT when the client tries to render the Shield sprite on the character.

In this demonstration, the Shield Type (ST) MYSHIELD is set to look for SPR/ACTs with the suffix "_MYSHIELD" when called by the client.

[Shield_IDs.ST_MYSHIELD] = "_MYSHIELD",

Shield Map Table:

Lastly, it's time to assign a Shield Type (ST) to the Shield Item (SI) to be added.

[Shield_IDs.SI_MYSHIELD] = Shield_IDs.ST_MYSHIELD,

So, when the Client asks for the appearance assigned to the SI 51001, it will render the ST 7.

ItemInfo and ItemDB

To finish the implementation of the Shield appearance, the Shield Type ID (in this example, it is 7) needs to be added in 2 places :

  • The Class field in your ItemInfo (mostly for completeness).

  • The View field in your item_db.