• 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

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
Just in case that someone needs, here's all the unregistered items from 8.6. Added one by one, and omited the ones that already has a moveevent. This should work fine. If someone uses this code and see there's a missing ID please let me know!


Regards!
 
Just in case that someone needs, here's all the unregistered items from 8.6. Added one by one, and omited the ones that already has a moveevent. This should work fine. If someone uses this code and see there's a missing ID please let me know!


Regards!
Why would you do that :eek:

Not exactly what I have but its close enough
 
Why would you do that :eek:

Not exactly what I have but its close enough

Thanks a lot!! Applied Added Player:onInventoryUpgrade, thanks @oen432 · ralke23/Greed-TFS-1.5-Downgrades@dbbccb9 (https://github.com/ralke23/Greed-TFS-1.5-Downgrades/commit/dbbccb978db64e6bc174c967790942c17324cc42)
 
how do I make them appear in tooltips?
View attachment 74110
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?

View attachment 74111
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
tell me how to make the tooltips and color frames work with your update system
 
Why would you do that :eek:

Not exactly what I have but its close enough

Sup @oen432! I wonder if onWrapItem method must be added aswell. I don't have it on my sources, also, there's somewhere I can take this commit to implement it? Searched onWrapItem commit on tfs-master and couldn't find it. I ask because players are still reporting that some skills are not added well, for example, Melee Skills + in a upgraded scarf, doesn't add properly.

Regards, and thanks in advance!! :)
 
Hello, Oen. First, thanks for all your contribution!
So, i'm looking your files, to implement it on my server, and i figured out that have a little mistake on 'calculateItemLevel' function, jic you want to fix it and, sure, for everyone that are using your system..
this is your function (i've just inserted some 'tiers' to explain better):
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 10 >= 100 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 10 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end
actually, any item will be 'tier 4' because it's the same condition of 'tier 3'
"/100 >= 10" and "/10 >= 100" are the same condition..

the fix would be:
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 100 >= 1 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 1 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end
but, my suggestion, after doing some tests, is:
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 100 >= 5 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 1 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end

thanks!
 
Hello, Oen. First, thanks for all your contribution!
So, i'm looking your files, to implement it on my server, and i figured out that have a little mistake on 'calculateItemLevel' function, jic you want to fix it and, sure, for everyone that are using your system..
this is your function (i've just inserted some 'tiers' to explain better):
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 10 >= 100 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 10 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end
actually, any item will be 'tier 4' because it's the same condition of 'tier 3'
"/100 >= 10" and "/10 >= 100" are the same condition..

the fix would be:
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 100 >= 1 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 1 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end
but, my suggestion, after doing some tests, is:
Lua:
function calculateItemLevel(monsterType)
  local level = 1
  local monsterValue = monsterType:getMaxHealth() + monsterType:getExperience()
  if monsterValue / 1000 >= 100 then
    level = math.ceil(math.log(monsterValue) * 10) -- tier 1
  elseif monsterValue / 100 >= 100 then
    level = math.ceil(math.log(monsterValue / 2) * 10) -- tier 2
  elseif monsterValue / 100 >= 10 then
    level = math.ceil(math.log(monsterValue / 4) * 8) -- tier 3
  elseif monsterValue / 100 >= 5 then
    level = math.ceil(math.log(monsterValue / 6) * 6) -- tier 4
  elseif monsterValue / 10 >= 1 then
    level = math.ceil(math.log(monsterValue / 8) * 4) -- tier 5
  else
    level = math.ceil(math.log(monsterValue / 10) * 2) -- tier 6
  end
  return math.max(1, level)
end

thanks!
Old. Go to Github for recent version.
 
NEW UPDATES -> GitHub
Upgrade System
Tibia has flat, dull, boring and not fun items system, time to change it. Expand your server with a lot of possibilities to make grinding more satisfying. No more useless items laying around and being ignored by others, now every item can be powerful. Using special crystals, items can be upgraded with new stats and powerful attributes. New property - Item Level - which determines how powerful given item is. A lot of crystals to upgrade items even further.


New items

NameDescriptionHow to obtain
Upgrade CrystalCan be used on a piece of equipment for a chance to upgrade it.Crystal Fossil
Enchantment CrystalCan be used on a piece of equipment to add random attribute.Crystal Fossil
Alteration CrystalCan be used on a piece of equipment to remove last attribute.Crystal Fossil
Cleansing CrystalCan be used on a piece of equipment to remove all attributes.Crystal Fossil
Fortune CrystalCan be used on a piece of equipment to change value of last attribute.Crystal Fossil
Faith CrystalCan be used on a piece of equipment to change values of all attributes.Crystal Fossil
Mind CrystalUsed to extract all attributes and values and store in that crystal. Can be used again to place these attributes to a new item. Lower item rarity will remove exceeded attributes.Custom - NPC, Quests etc.
Limitless CrystalUsed to remove Item Level requirement to equip given item.Custom - NPC, Quests etc.
Mirrored CrystalUsed to make a copy of any item. Copies can't be modified and mirrored again.Custom - NPC, Quests etc.
Void CrystalUsed to transform item into random Unique type.Custom - NPC, Quests etc.
Upgrade CatalystPrevents item destroy on upgrade. Consumed on item upgrade.Custom - NPC, Quests etc.
Crystal FossilThere is unknown crystal inside, try to use crystal extractor.Randomly drops from monsters
Crystal ExtractorUsed to extract rare crystals from crystal fossil.Custom - NPC, Quests etc.
Scroll of IdentificationCan be used on unidentified item to reveal hidden attributes.Custom - NPC, Quests etc.

Attributes

  1. Max HP
  2. Max MP
  3. Magic Level
  4. Melee Skills (all in one)
  5. Fist Fighting
  6. Sword Fighting
  7. Axe Fighting
  8. Club Fighting
  9. Distance Fighting
  10. Shielding
  11. Mana Shield
  12. Life Steal
  13. Experience
  14. Physical Damage
  15. Physical Protection
  16. Energy Damage
  17. Energy Protection
  18. Earth Damage
  19. Earth Protection
  20. Fire Damage
  21. Fire Protection
  22. Ice Damage
  23. Ice Protection
  24. Holy Damage
  25. Holy Protection
  26. Death Damage
  27. Death Protection
  28. Elemental Damage (every element in one except physical)
  29. Elemental Protection (every element in one except physical)
  30. Cast Flame Strike on Attack
  31. Cast Flame Strike on Hit
  32. Cast Ice Strike on Attack
  33. Cast Ice Strike on Hit
  34. Cast Terra Strike on Attack
  35. Cast Terra Strike on Hit
  36. Cast Death Strike on Attack
  37. Cast Death Strike on Hit
  38. Cast Energy Strike on Attack
  39. Cast Energy Strike on Hit
  40. Cast Divine Missile on Attack
  41. Cast Divine Missile on Hit
  42. Explosion on Kill
  43. Regenerate Health on Kill
  44. Regenerate Mana on Kill
  45. Mana Steal
  46. Chance to regenerate full HP on Kill
  47. Chance to regenerate full MP on Kill
  48. Chance to cast Mass Healing on Attack
  49. Increased healing from all sources
  50. Additional gold from monsters loot
  51. Chance to deal double damage
  52. Chance to be revived with 100% HP and MP upon death
  53. Chance to get Bonus Damage buff on Kill
  54. Chance to get Bonus Max HP buff on Kill
  55. Chance to get Bonus Max MP buff on Kill

Item Level
Item Level (iLvl) is set for every wearable item (excluding Stackable [spears, assassins stars, ammunition etc.] and Transformable [special rings or boots]) when dropped by a monster.
Default iLvl is calculated using special algorithm that determines monster level/power based on its Max HP and Experience.
Then additional iLvl value is given based on base item stats (Atk, Def, Armor, Hit Chance). After all of that, additional stats are calculated based on item iLvl.
Upgrading item level increases iLvl in addition to bonus stats and values for bonus attributes are based on iLvl of the item.
Given all of that I have made every item different. If you drop a Giant Sword from a Behemoth and a Giant Sword from a Ferumbras they will be different in stats.
You may ask "What if someone loots Sword from high level monster and a new player gets it? That's unbalanced." but don't be afraid.
If player level is lower than iLvl of given items, they can't equip them!

Unique Items
Items with predefined attributes that can't be altered, only their values can be changed. Unidentified items can become Unique.

Installation

  1. Open data/global.lua.
  2. Add somewhere on top
    Lua:
    dofile('data/upgrade_system_core.lua')
  3. Open data/events/events.xml.
  4. Make sure you have 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" />
  5. Open data/events/scripts/player.lua.
  6. Find Player:onLook.
  7. Add after local description = "You see " .. thing:getDescription(distance)
    Lua:
    description = onItemUpgradeLook(self, thing, position, distance, description)
  8. Find Player:onMoveItem.
  9. Change return true from last line to
    Lua:
    return us_onMoveItem(self, item, fromPosition, toPosition)
  10. Find Player:onItemMoved.
  11. Add inside
    Lua:
    onUpgradeMoved(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder)
  12. Find Player:onGainExperience.
  13. Add at the end before return exp
    Lua:
    exp = us_onGainExperience(self, source, exp, rawExp)
  14. Open data/events/scripts/creature.lua.
  15. Find Creature:onTargetCombat.
  16. Add somewhere (the best place is after all events, before any event that calculates damage, like DPS Counter)
    Lua:
    target:registerEvent("UpgradeSystemHealth")
    target:registerEvent("UpgradeSystemDeath")
  17. Open data/actions/actions.xml.
  18. This is important part, you have to specify items ID for crystals, scroll of identification and crystal extractor. I have created custom items for myself and IDs are one after another so I'm using fromid and toid. I hope you can handle it.
    XML:
    <action fromid="26383" toid="26389" script="upgrade_system_actions.lua" /> <!-- Crystals and Scroll -->
    <action fromid="26393" toid="26396" script="upgrade_system_actions.lua" /> <!-- Crystals -->
    <action itemid="26391" script="upgrade_system_tool.lua" /> <!-- Crystal Extractor -->
  19. Open data/creaturescripts/creaturescripts.xml.
  20. Add
    XML:
    <event type="login" name="UpgradeSystemLogin" script="upgrade_system_cs.lua" />
    <event type="death" name="UpgradeSystemDeath" script="upgrade_system_cs.lua" />
    <event type="kill" name="UpgradeSystemKill" script="upgrade_system_cs.lua" />
    <event type="healthchange" name="UpgradeSystemHealth" script="upgrade_system_cs.lua" />
    <event type="manachange" name="UpgradeSystemMana" script="upgrade_system_cs.lua" />
    <event type="preparedeath" name="UpgradeSystemPD" script="upgrade_system_cs.lua" />
  21. Download upgrade_system.rar from attachment at the bottom of this post.
  22. Extract and copy data into your data.

Configuration
Every configuration is inside data/upgrade_system_const.lua.
I have added some comments that should explain each property. There are however few special properties for attributes.
VALUES_PER_LEVEL - this indicates max value that can be rolled for given attribute, based on item level. For example if set to 3 then every Item Level adds +3 value, at Item Level 100, max value for this attribute can be 300 (still rolled from 1 to max value).
minLevel - this indicates what Item Level is required for this attribute to be rolled. Use it to balance some early and late game attributes.
chance - chance in % that this attribute will be rolled. If you want 100% then remove that property or just set to 100.

Changelog
[2.0.0] - 2019-06-02
  • Reworked refreshing attributes when changing items
  • Reworked Item Level functionality
  • Monsters Level is now calculated using special algorithm
  • Item Level for dropped items from monsters is assigned based on Monster Level (min 1, random from monsterLevel - 5 to monsterLevel)
  • Item Level is now increased for every upgrade level
  • Item Level is now increased for every base stat of an item
  • Item Level now increases base stats for an item
  • Equipping items require player level to be equal or higher than Item Level
  • Equipping unidentified items is not possible anymore
  • Added Items Rarity - Common, max 1 slot; Rare, max 2 slots; Epic, max 3 slots; Legendary, max 4 slots
  • Rewritten onLook function. Cleaner description for items, additionally showing Total Item Level for a player that we look at.
  • Added Mind Crystal - extracts attributes from selected item and stores them in the crystal, can be then used on a different item to apply these attributes, very rare, not possible to obtain through loot
  • Added Limitless Crystal - adds special attribute (doesn't take attribute slot) "Removed Item Level Requirement" allowing item to be equipped by player with less level than Item Level, very rare, not possible to obtain through loot
  • Added Mirrored Crystal - after using on a item, makes a copy of that item with every value being the same, mirrored items can't be modified, extremely rare, not possible to obtain through loot
  • Added Void Crystal - transforms item into random Unique type, very rare, not possible to obtain through loot
  • Added new attributes:
    • Mana Steal
    • More gold from loot
    • Chance to gain full HP / MP on kill
    • Chance to deal double damage
    • Chance to cast Mass Healing on Attack
    • Chance to be revived on death
    • Chance to get buff (more damage, hp, mp) on kill for 8 seconds
    • Increased healing from all sources
  • Reworked some attributes to be more dynamic rather than fixed (Cast on Attack/Hit)
  • Added % chance (optional) property to attributes, making them harder to roll
  • Removed attributes limit for Unique items
  • New config values
  • Big thanks to @Aeronx for cool ideas and help with testing
[1.1.2] - 2019-05-26
  • Rewritten attributes refreshing when removing items
  • Removed onMoveItem event usage
[1.1.1] - 2019-05-25
  • Fixed property naming
[1.1.0] - 2019-05-24
  • Added Unique type items, predefined attributes that can't be altered, only their values can be changed. Unidentified items can become Unique.
  • Corrected onLook for plural names
[1.0.0] - 2019-05-24
  • Release version
Hi, how are you? I did as you explained... but when I use it, it no longer shows the look of the item and gives the following error... could you help me please?
 

Attachments

Hi, how are you? I did as you explained... but when I use it, it no longer shows the look of the item and gives the following error... could you help me please?
it seems that you are missing the isItem function, can you check if you deleted it accidentally
 
it seems that you are missing the isItem function, can you check if you deleted it accidentally
I did the same as explained in the post, but could you tell me where I check this option? I use Downgrade nekiro tfs 1.5 8.0 which, by the way, I'm not able to move the stackable runes... if there are 100 and I drag it, there's only one then I have to remove 1 by 1 from the bp :(

*EDIT
Sorry for the mistakes in English, here in Brazil we only learn the verb to/be in public schools kkkkk
 
Hello. I'm currently using this system on my project, but we are trying to create a new spin on it. I was wondering if it was possible to instead of add stats when looting items, you could add the stats you wish personally using specific items on your equipment?

Would really appreciate any help anyone could offer.

Thanks in advance.
 
Hello. I'm currently using this system on my project, but we are trying to create a new spin on it. I was wondering if it was possible to instead of add stats when looting items, you could add the stats you wish personally using specific items on your equipment?

Would really appreciate any help anyone could offer.

Thanks in advance.
Not the place for such questions. Go to Support forum and create thread there. But short answer is yes, it is obviously possible.
 
Hello I am using TFS 1.4 with OTCV8

I implemented the system and items drop.. however there is a problem, I am not sure?

Item drops from creature
10:53 You see Trousers (Arm:6).
It weighs 18.00 oz.
They offer slightly more protection.
Item ID: 2649
Position: 665, 1247, 7

It doesn't say it is unidentified, I can equip it just fine before identifying it too, I can use identify scroll on it and it says "Item successfully identified!"
I can upgrade the item and what not, but it is not giving any bonus stats besides armor or weapon attack (when items drop)
There is also no item level listed on items

Quite confused, can't seem to figure it out.. any idea?
Post automatically merged:

I just started over with TFS 1.4 and it seems to work now, no idea.. lol.. thanks for the system!
 
Last edited:
This system is very interesting, I have a question to clear up doubts... If I kill a Demon and it 'drops' a Magic Sword (common) that has random attributes, it must remain common, not become rare, epic or legendary, correct ? And if I have another sword that is epic and it drops from a strong monster that should only drop epic items, it cannot become common or rare, only epic. I'm making some colorful slot systems, each for common, rare, epic and legendary items...

Another question about stones/scrolls... Only specific to common, rare, epic and legendary items... For example, an epic stone can only be used on an epic item, it cannot be used on a common item... Understand ?
 
This system is very interesting, I have a question to clear up doubts... If I kill a Demon and it 'drops' a Magic Sword (common) that has random attributes, it must remain common, not become rare, epic or legendary, correct ? And if I have another sword that is epic and it drops from a strong monster that should only drop epic items, it cannot become common or rare, only epic. I'm making some colorful slot systems, each for common, rare, epic and legendary items...

Another question about stones/scrolls... Only specific to common, rare, epic and legendary items... For example, an epic stone can only be used on an epic item, it cannot be used on a common item... Understand ?
No, nothing you said here is correct.
 
You have all the info you need on the repository! just check it and read it. Its way faster! :)

Rarity doesnt work like that. It has to do with the free slots the item has for extra attributes.
About the stones, you can make them work as you like. They are not based on rarity as it is.
But, as said, most of the info you need is in the repo.
 
I delete a lot of enchantments because i dont want themm but kept many.. however it still tries to pull those enchantments from the config.lua.. do i need to drill down through core.lua and remove every trace of things i dont want?

no error, just when i go to enchant a item it locks up the server (no crash, no errors) but cannot log back in on any character

edit: nvermind i add them back and give 0 chance.. less break.. haha
 
Last edited:
Back
Top