• 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!

Solved weapon attributes, how to?

Anghelos

Member
Joined
Nov 1, 2014
Messages
30
Reaction score
10
I was wondering how to make items (weapons, armor, etc) with particular attributes, for instance:
Weapon with added fire/earth/whatever damage or even 'life/mana' steal, armors with % resist to a certain element and so on.
Badly, i'm quite noob of scripting but i'm trying to figure out how to do stuff since i know programming ^_^
Now, i searched this forum and found something, that requires the server recompile, so first question is:

Do i really need to add attributes to the core and recompile or can i handle this stuff via script?

What would be the best way to handle this kind of attributes since u are a way more expert than me?

Can u suggest me how to proceed (don't need the script, just .. u know, where to work and why since i want to learn :) ofc if something like this already exists i'm gonna check it :D )

Thx in advance :)
 
I was wondering how to make items (weapons, armor, etc) with particular attributes, for instance:
Weapon with added fire/earth/whatever damage or even 'life/mana' steal, armors with % resist to a certain element and so on.
Badly, i'm quite noob of scripting but i'm trying to figure out how to do stuff since i know programming ^_^
Now, i searched this forum and found something, that requires the server recompile, so first question is:

Do i really need to add attributes to the core and recompile or can i handle this stuff via script?

What would be the best way to handle this kind of attributes since u are a way more expert than me?

Can u suggest me how to proceed (don't need the script, just .. u know, where to work and why since i want to learn :) ofc if something like this already exists i'm gonna check it :D )

Thx in advance :)
Before we start, can we know the server version? :p
 
items.xml
Code:
<item id="2656" article="a" name="blue robe"> -- ID and name of item
     <attribute key="description" value="This is a very light and stylish magicians robe."/> -- description of item
     <attribute key="weight" value="3650"/> -- weight of item, this item weigh's 36.5 oz
     <attribute key="armor" value="6"/>
     <attribute key="maxManaPercent" value="136"/> -- this may or may not work.. might of had to do a compile
     <attribute key="magiclevelpercent" value="124"/> -- magic level bonus of 24%
     <attribute key="absorbPercentPhysical" value="0"/>
     <attribute key="absorbPercentFire" value="20"/> -- this makes it hurt less 20%
     <attribute key="absorbPercentIce" value="24"/>
     <attribute key="absorbPercentEnergy" value="-24"/> -- This makes it hurt more 24%
     <attribute key="absorbPercentEarth" value="20"/>
     <attribute key="absorbPercentDeath" value="20"/>
     <attribute key="absorbPercentHoly" value="20"/> -- I believe this is most damages that can be done however there are more like drown/life drain, but yeah.
     <attribute key="slotType" value="body"/>
   </item>
For weapons and such go to
data/weapons/scripts
 
oh sorry, TFS 1.0.

MMmm this attributes works directly without recompiling?
and do there is a list of all the available attributes?
 
oh sorry, TFS 1.0.

MMmm this attributes works directly without recompiling?
Welllll. xD
Those are from 0.3.7
I'm not 100% sure they will all work, as I don't have 1.0.0, but the scripts should be the same.
I've quickly checked, and I cannot find magiclevelpercent, or maxmanapercent... but that doesn't mean they don't work, it just means that none of the items currently have those value's attached to them.

--edit
So yes, all the absorbpercentelement works just as shown.
--edit 2
Fire sword has 'elementFire' attached to it. I believe this is what you were looking for as well.
Code:
<item id="2392" article="a" name="fire sword">
     <attribute key="description" value="The blade is a magic flame." />
     <attribute key="weight" value="2300" />
     <attribute key="defense" value="20" />
     <attribute key="attack" value="24" />
     <attribute key="elementFire" value="11" />
     <attribute key="weaponType" value="sword" />
     <attribute key="extradef" value="1" />
   </item>
--edit 3 (final edit)
life/mana steal would need a script I'm sure though, so weapons.xml for that
 
I've added an extra attribute on my items on my server(TFS 1.0), called Item Level.
To do this you have to edit the source code(TFS C++ code), add supporting functions to LuA(optional) and assign what the new attributes should modify in the game.
If you have coding experience, you can probably search your way through the source to find what you need to add for additional attributes to work.
If you don't have coding experience, I suggest you to learn more about programming before trying anything.
 
I've added an extra attribute on my items on my server(TFS 1.0), called Item Level.
To do this you have to edit the source code(TFS C++ code), add supporting functions to LuA(optional) and assign what the new attributes should modify in the game.
If you have coding experience, you can probably search your way through the source to find what you need to add for additional attributes to work.
If you don't have coding experience, I suggest you to learn more about programming before trying anything.
I like your items attributes system :D
 
Do i really need to add attributes to the core and recompile or can i handle this stuff via script?

What would be the best way to handle this kind of attributes since u are a way more expert than me?

Thx in advance :)

You need to add the attributes to the core and recompile. Nothing in TFS 1.0 supports custom attributes.
Search through the source code, at for example "magiclevelpoints" and continue to read through the code, continue with more searches and understand how the game is handling this attribute.
This will probably take a lot of time if you are not familiar with the source code, but that's the process of learning and understanding.
 
Nice, everything seems quite understandable, and according with the attributes we currently have i don't need any recompile...unless i want to add mana/life leech.
cool :D
 
Back
Top