• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

What needs to be modified to create a new ring?

JConor

Member
Joined
Apr 2, 2020
Messages
15
Reaction score
5
Hello everyone,

This is my first time trying to do a modification for an otserver and I want to experiment doing something easy like modifying a ring, but I couldn't find what needs to be modified to create a new ring.

I have the next questions:

1- First, I want to create a new "item", because this will be a new ring (e.g. might look exactly as a life ring, but will do different things)
I guess for this I must add the new ring on "items.xml" with a unique ID and a new name, right?

2- Where do I declare what this ring is going to do?
E.g. Life ring gives 8 mp and 2 hp every 6 seconds, in which file can I see this?

3- Should any other file be modified in order to make my new the ring work?

Thanks!
 
I would start to look where life rings gets it’s modification in witch files and then u can just add the new ring item id there and with the attributes u want it to have :)
 
itmes.otb items. xml and movements
Thanks, I checked all the files and seems good.

But I couldn't find where is the lua code which defines what the life ring is going to do.
Where is this file that says "Life ring gives 8 mp and 2 hp every 6 seconds"
Or is that in C++?

Regards.
 
first of all, you gave us no information at all of which server you are using, so I'm going to assume tfs 1.x

the regeneration is defined on the data/items/items.xml just search for life ring and copy it


btw for creating a new ring with same sprite you would need to edit your client files as well and your players also would need to download a custom client in order to see it and not crash the client
 
In your items.xml, search for the equipped life ring (ID 2205)

All attributes you mentioned can be seen there.

To create a new item, you need to add a new ID in items.xml and edit items.otb.

Also, edit movements.xml as mentioned above (equip and deequip) (just find id 2205,copy and paste)
 
first of all, you gave us no information at all of which server you are using, so I'm going to assume tfs 1.x

the regeneration is defined on the data/items/items.xml just search for life ring and copy it


btw for creating a new ring with same sprite you would need to edit your client files as well and your players also would need to download a custom client in order to see it and not crash the client
Am probably wrong but would it not be enough to just copy the item and use same spirite and use a diffrent item id and use it? Would be like having same item look with two diffrent names?
 
Am probably wrong but would it not be enough to just copy the item and use same spirite and use a diffrent item id and use it? Would be like having same item look with two diffrent names?
from my limited understanding this would change nothing, the problem isn't the actual sprite but instead the client is expecting something based on it's files and will crash or do some really weird stuff if the server contradicts it.
 
Then the solution would be a need for a new spirite for the ring?
To make a new ring with a different id i believe what evil puncker wrote is exactly correct. Could also modify existing rings if he's ok with it not looking the same and essentially removing the existing ring from the game where his new ring would take its place.
 
Am probably wrong but would it not be enough to just copy the item and use same spirite and use a diffrent item id and use it? Would be like having same item look with two diffrent names?
Then the solution would be a need for a new spirite for the ring?

the client Tibia.dat file would still require editing in order for the new item to be usable

my advice if you don't want to edit client files: use any other existing item and make it a ring, its really simple
 
Thanks, I checked all the files and seems good.

But I couldn't find where is the lua code which defines what the life ring is going to do.
Where is this file that says "Life ring gives 8 mp and 2 hp every 6 seconds"
Or is that in C++?

Regards.
That's definied in the items.xml
 
First of all, thanks a lot for the help.

I am using TFS 1.2 (Release The Forgotten Server 1.2 · otland/forgottenserver (https://github.com/otland/forgottenserver/releases/tag/v1.2))

After reading, I believe the easier option is the below one mentioned by Evil Puncker & Sarah Wesker.
my advice if you don't want to edit client files: use any other existing item and make it a ring, its really simple

You can also make use of CustomAttributes and simply rename the item ;)
it is the best option and the most efficient

So lets keep it simple, let's say will copy the "Life Ring", and create a new ring called "Life Ring 2"

[Current information]
On items.xml I can see the below information related to the life ring.
XML:
    <item id="2168" article="a" name="life ring">
        <attribute key="weight" value="80" />
        <attribute key="slotType" value="ring" />
        <attribute key="transformEquipTo" value="2205" />
        <attribute key="stopduration" value="1" />
        <attribute key="showduration" value="1" />
    </item>

On movements.xml I can see the below line:
XML:
<movevent type="Equip" itemid="2168" slot="ring" event="function" value="onEquipItem"/>

[New information]
On items.xml I would change the "item id" to a unique id.
XML:
    <item id="[S]anyUniqueID####" [/S]article="a" name="life ring 2">
        <attribute key="weight" value="80" />
        <attribute key="slotType" value="ring" />
        <attribute key="transformEquipTo" value="2205" />
        <attribute key="stopduration" value="1" />
        <attribute key="showduration" value="1" />
    </item>

On movements.xml I would (1) change the "item id" to match the new id and (2) add in event a new event called lifering2.lua:
XML:
<movevent type="Equip" itemid="[S]anyUniqueID####[/S]" slot="ring" event="[B]lifering2.lua[/B]" value="onEquipItem"/>

On lifering2.lua, I will add what my "Life Ring 2" should do right?
Code:
Something like:

When equipped:
    - Increase 100 hp & mp every 1 second

Should this work?

Btw, I am trying to compile TFS 1.2 (source code), but I haven't had luck, I am still working on it, so I haven't try the modification above #lol.
I am just starting to see how a modification would work.

Regards.
 
Back
Top