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

Action [TFS 1.1] - Slot system

Status
Not open for further replies.
function getItemArmor(uid) return ItemType(getThing(uid).itemid):getArmor() end
function isArmor(uid) if (getItemArmor(uid) ~= 0 and getItemWeaponType(uid) == 0) then return true else return false end end


These 2 functions dont seem to be working properly for me on TFS 1.0 (10.35). Could you please help me? Other than that, great work!

Did you add this to your global.lua?

Code:
  function getItemAttack(uid) return ItemType(getThing(uid).itemid):getAttack() end
   function getItemDefense(uid) return ItemType(getThing(uid).itemid):getDefense() end
   function getItemArmor(uid) return ItemType(getThing(uid).itemid):getArmor() end
   function getItemWeaponType(uid) return ItemType(getThing(uid).itemid):getWeaponType() end
   function isArmor(uid) if (getItemArmor(uid) ~= 0 and getItemWeaponType(uid) == 0) then return true else return false end end
   function isWeapon(uid) return (getItemWeaponType(uid) > 0 and getItemWeaponType(uid) ~= 4) end
   function isShield(uid) return getItemWeaponType(uid) == 4 end
   function isBow(uid) return (getItemWeaponType(uid) == 5 and (not ItemType(getThing(uid).itemid):isStackable())) end
 
Ok switched to 1041 and still doesn't work for some reason.
Yep, those functions were put into global.lua
"getItemAttack(uid)" is working, but not "getItemArmor(uid)". Weird.
 
Last edited:
Ok switched to 1041 and still doesn't work for some reason.
Yep, those functions were put into global.lua
"getItemAttack(uid)" is working, but not "getItemArmor(uid)". Weird.
try
ItemType(itemid):getArmor()
 
try
ItemType(itemid):getArmor()
Nope, not working. I am trying to retrieve my value, and its showing that I am wearing a total armor value of 0. However, I have leather items on.
NOTE: I have it scripted so that while wearing nothing, it gets set to zero. So it's either showing no armor pieces on my character or its showing the total value at 0.
 
Last edited:
Hey nice script, works great !
I want to ask something, is there anyway to add attack speed on weapons ?
like 1.5x faster or 2x faster .
Thank you for help
 
Hey nice script, works great !
I want to ask something, is there anyway to add attack speed on weapons ?
like 1.5x faster or 2x faster .
Thank you for help
Not yet. I'll make atk/def/arm/atkspeed/elements protection stats when they make it possible to modify items in TFS 1.0
 
you mean its not possible with lua functions.
but if we change .cpp and .h code can we do this ?
 
you mean its not possible with lua functions.
but if we change .cpp and .h code can we do this ?
It's possible in 0.3+ branches so why not? Maybe in the distant future.
I have to figure out what source edits are required.
 
@zbizu im noob when it comes to script like yours i can't lower the % is giving too much can you explain a little ? like i wanted to put always 1~3% dont matter the player level... or skill level..
 
@zbizu im noob when it comes to script like yours i can't lower the % is giving too much can you explain a little ? like i wanted to put always 1~3% dont matter the player level... or skill level..
To be honest I have no idea how % calculation works, it's @Mock 's function
You may change
Code:
local p = getper()
to
Code:
local p = math.random(min, max)
 
add this to global.lua:
Code:
  function getItemAttack(uid) return ItemType(getThing(uid).itemid):getAttack() end
   function getItemDefense(uid) return ItemType(getThing(uid).itemid):getDefense() end
   function getItemArmor(uid) return ItemType(getThing(uid).itemid):getArmor() end
   function getItemWeaponType(uid) return ItemType(getThing(uid).itemid):getWeaponType() end
   function isArmor(uid) if (getItemArmor(uid) ~= 0 and getItemWeaponType(uid) == 0) then return true else return false end end
   function isWeapon(uid) return (getItemWeaponType(uid) > 0 and getItemWeaponType(uid) ~= 4) end
   function isShield(uid) return getItemWeaponType(uid) == 4 end
   function isBow(uid) return (getItemWeaponType(uid) == 5 and (not ItemType(getThing(uid).itemid):isStackable())) end

credit to who can tell me where i find global.lua, i do not have it in my ot folder neither do i know where to make one...
 
It should be in your data folder:

ejddMoh.png


If you do not have it for some reason you can get take them from either of the 2 places:
1. Printers Datapack
2. the forogottenserver datapack
 
I have some problems.
First:
mlvl dont work.
I have [ml.+1%] [ml.+1%] [hp.+2%], and its give me only hp.
Secound.
When i take shield on hand, and dont have max hp, it is heal me.
I can have 1% hp, and when i take item, it heal me to 100%
How fix this bug?

tfs 1.0 / tibia 1.31
 
@zbizu

I know they do not give support on this issue, but my question is entirely too easy, I get this simple error:

[Warning - Actions :: registerEvent] Duplicate registered item with ID: 8299 in fr
omid: 8298, toid: 8299
[Warning - Actions :: registerEvent] Duplicate registered item with ID: 8300


you I can change the number of items for others that are not in use right ?, not easy?
greetings and thanks if you read
 
it's mod/items.xml issue not related to that script
 
Status
Not open for further replies.
Back
Top