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

How to set specialskills attributes TFS 1.X

gritness

Member
Joined
May 26, 2021
Messages
33
Reaction score
6
Hey guys,

anyone has idea for set item specialskills attributes ? I'm trying to set it if player use some items on weapon (for example small ruby to get increased critical hit chance)

all works with basic attributes but doesn't with special skills :/


itemEx:setAttribute(ITEM_ATTRIBUTE_ATTACK,50) -- Work perfectly

itemEx:setAttribute(ITEM_ATTRIBUTE_ATTACK_CRITICALHITCHANCE,50) -- Not working, after fews uses tfs gonna stop and send callback Segmentation fault (core dumped)
 
there is no such thing as ITEM_ATTRIBUTE_ATTACK_CRITICALHITCHANCE as you can see here

for special skills you need to use
  • player:addSpecialSkill(specialSkillType, value)

and also remember that you ALWAYS NEED TO USE the two "chance" and "amount" types, in your example you used only chance
 
there is no such thing as ITEM_ATTRIBUTE_ATTACK_CRITICALHITCHANCE as you can see here

for special skills you need to use
  • player:addSpecialSkill(specialSkillType, value)

and also remember that you ALWAYS NEED TO USE the two "chance" and "amount" types, in your example you used only chance
Thanks for resolution, but your answer born a new question :D
How works items attributes in item.xml ?

when i added this two lines :

<attribute key="CRITICALHITAMOUNT" value="100" />
<attribute key="LIFELEECHCHANCE" value="100"/>

speciall sklls works when player has wear specific items.
I had also added specific item in movements.xml

"
<movevent event="Equip" slot="hand" itemid="26384" function="onEquipItem" />
<movevent event="DeEquip" slot="hand" itemid="26384" function="onDeEquipItem" />
"

I was also change item.lua like this :
"
local aux = {
['CriticalHitChance'] = {key = ITEM_ATTRIBUTE_CRITICALHITCHANCE},
['Defense'] = {key = ITEM_ATTRIBUTE_DEFENSE},
['ExtraDefense'] = {key = ITEM_ATTRIBUTE_EXTRADEFENSE},
['Attack'] = {key = ITEM_ATTRIBUTE_ATTACK},
['HitChance'] = {key = ITEM_ATTRIBUTE_HITCHANCE},
['ShootRange'] = {key = ITEM_ATTRIBUTE_SHOOTRANGE},
['Armor'] = {key = ITEM_ATTRIBUTE_ARMOR},
['Duration'] = {key = ITEM_ATTRIBUTE_DURATION, cmp = function(v) return v > 0 end},
['Text'] = {key = ITEM_ATTRIBUTE_TEXT, cmp = function(v) return v ~= '' end},
['Date'] = {key = ITEM_ATTRIBUTE_DATE},
['Writer'] = {key = ITEM_ATTRIBUTE_WRITER, cmp = function(v) return v ~= '' end}
}
"
 
Back
Top