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

CreatureEvent [TFS 1.3 / 1.4] Upgrade System

Stackable items do not have item level or anything, simply ignored by the script.
Here's the evidence. Pheraps spears are no threat the same as ammunitions, or gold coins, etc. Maybe this is related to .dat/.otb item properties.

Regards! and thanks for the fast reply :)
 
Last edited:
Why don't the bonuses show on the items when I look at them? The bonuses are there, just can't be seen on item description.

I'm using TFS 1.4 with the revscript method.
 
Last edited:
Why don't the bonuses show on the items when I look at them? The bonuses are there, just can't be seen on item description.

I'm using TFS 1.4 with the revscript method.
check everything again. it works for me. I am using TFS 1.4.2
 
A little question guys, how can I prevent the usage of upgrade runes on items that has ItemLevel: 0? Because the system breaks if the ItemLevel is 0, returning the weapon attack to :2, and def:2, that is just a waste of the rune. Regards!
 
Hi, the system is working well, thanks a lot for it!
I have a question, after a couple hours trying, wasn't able to figure out how to do it.

When I upgrade a "knife", it raises it's atk/def without any problem, the same way it lowers its atk/def when the upgrade fails and it downgrade.

But how can I show the item level upgrade when I look at it? Like "You see a knife (+5)".
 
Hi, the system is working well, thanks a lot for it!
I have a question, after a couple hours trying, wasn't able to figure out how to do it.

When I upgrade a "knife", it raises it's atk/def without any problem, the same way it lowers its atk/def when the upgrade fails and it downgrade.

But how can I show the item level upgrade when I look at it? Like "You see a knife (+5)".
if not mistaken you need to edit config.lua to have 'luaItemDesc = true'
 
Thanks for the reply, man! I just switch it to "true" and it didn't work, but I appreciate your help, I'm still trying to figure out what to do xD
 
Thanks for the reply, man! I just switch it to "true" and it didn't work, but I appreciate your help, I'm still trying to figure out what to do xD
Did you check if this is enabled?
XML:
<event class="Creature" method="onTargetCombat" enabled="1" />

<event class="Player" method="onLook" enabled="1" />
<event class="Player" method="onMoveItem" enabled="1" />
<event class="Player" method="onItemMoved" enabled="1" />
<event class="Player" method="onGainExperience" enabled="1" />

 
how do I send the client information that this item is (rare, epic, legendary, or unidentified)?
 
I don't know HOW but I managed to fix it, lol.

Please try to figure out how you fixed it.. xD I'm having the same issue, and i enabled it all in events.. Do i have to register the event callback somehow? Ingame i can see that the item is undentified as im getting cancel message that i cannot equip a unidentified item, but not at the item itself.
 
Please try to figure out how you fixed it.. xD I'm having the same issue, and i enabled it all in events.. Do i have to register the event callback somehow? Ingame i can see that the item is undentified as im getting cancel message that i cannot equip a unidentified item, but not at the item itself.
Problems started when I renamed the tiers in the config file and they were fixed when I went in deeper with the renames in the core file.
 
Problems started when I renamed the tiers in the config file and they were fixed when I went in deeper with the renames in the core file.

Hmm. I didn't even edit it yet, just wanted it to work properly first.. :<
 
how do I make them appear in tooltips?
Скриншот 14-03-2023 173155.jpg
and I can't adjust the color frames (rare, epic, legendary). (they only work with what is displayed in the popup hints).Can you suggest or direct me?

Скриншот 14-03-2023 174256.jpg
Lua:
local function setFrames()
  for _, container in pairs(g_game.getContainers()) do
      local window = container.itemsPanel
      for i, child in pairs(window:getChildren()) do
          local id = child:getItemId()
          local price = 0

          local name = child:getTooltip()
          child:setImageSource("/images/ui/item")
          if (name) then
print("name: " .. name)
            if (string.find(name, "epic")) then
              child:setImageSource('/images/ui/rarity_gold')
            elseif (string.find(name, "axe")) then
              child:setImageSource('/images/ui/rarity_purple')
            elseif (string.find(name, "rare")) then
              child:setImageSource('/images/ui/rarity_blue')
            end
          end

      end
  end
end
 
Everytime I work on a server that uses this system I add global player event onEquip and onUnEquip. I always wondered why isn't this a thing by default in TFS. I hate this hack I had to do to make these events in pure Lua.

Hi oen! I wonder what did you do exactly on global, to register onEquip and onUnEquip events, since i'm getting trouble when players switch their equipments, they doesn't get the correct attributes from items (not sure if they if they add up well, if they subtract from each other...)

Here's examples (doesn't add magic level properly):

Player set-up from previous gif:
1678805632573.png

Prints in function Player.getNextSubId:

image.png

image.png


And c++ verification if everything is right:
1678805572877.png

Regards!
 
Hi oen! I wonder what did you do exactly on global, to register onEquip and onUnEquip events, since i'm getting trouble when players switch their equipments, they doesn't get the correct attributes from items (not sure if they if they add up well, if they subtract from each other...)
Added source changes to execute functions in events/player.lua when item is equipped or unequipped (and both if switched).
 
Added source changes to execute functions in events/player.lua when item is equipped or unequipped (and both if switched).
Is there a chance to share that modification? I don't think I could script a solution by myself.
What I can provide is any testing that is requested, if that helps xD
 
Back
Top