• 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

Sure, added CRYSTAL_FOSSIL_DROP_LEVEL to configuration. Version 2.4.0 uploaded.
Very good!
But I think you did not understand ..
My server does not have the "monster level"
But that had a list to ignore the drop of the crystal fossil of the weak monsters .. ex: ['rat, cave rat, rotworm']
 
Very good!
But I think you did not understand ..
My server does not have the "monster level"
But that had a list to ignore the drop of the crystal fossil of the weak monsters .. ex: ['rat, cave rat, rotworm']
I did understand you correctly. Please read about this feature once again. Monsters Level is calculated by this script, you don't have to worry about anything. Rat is level 1-2, Rotworm is around 10, Amazon is 13-14. You can calculate monster level same way as this script here https://includespark.eu/item_level.php just take whatever monster you want to check, get its HP and EXP and that's it.
 
I did understand you correctly. Please read about this feature once again. Monsters Level is calculated by this script, you don't have to worry about anything. Rat is level 1-2, Rotworm is around 10, Amazon is 13-14. You can calculate monster level same way as this script here https://includespark.eu/item_level.php just take whatever monster you want to check, get its HP and EXP and that's it.
Thanks for this ilvl calculator, it helped me a lot! : D
But there is one thing I saw on the soft boots, she adds the random add to the equipped boots, but when unequiped it, the status disappears and can't add stats others or remove it, you only can add if the item not change, soft boots its a example...
ex:
UNEQUIPED.
21:34 You see pair of soft boots.
It weighs 8.00 oz.
Item ID: 6132
Transforms to: 2640 (onEquip)
Position: 705, 559, 8

EQUIPED
21:37 You see a pair of soft boots (faster regeneration).
It weighs 8.00 oz.
Item ID: 2640
Transforms to: 6132 (onDeEquip)
Decays to: 10021
Position: 707, 559, 8
 
Thanks for this ilvl calculator, it helped me a lot! : D
But there is one thing I saw on the soft boots, she adds the random add to the equipped boots, but when unequiped it, the status disappears and can't add stats others or remove it, you only can add if the item not change, soft boots its a example...
ex:
Items like soft boots, firewalker boots or rings that expire after time can't be upgraded.
 
if I remove the time? it can't upgrade too ?
Let me be more specific. Items that can't be upgraded are the one that:
  • Can expire after time
  • Can transform to a different item when used/equipped
  • Have charges
  • Are stackable
 
???
Sin título.png
???
im not a programer myself but i managed to follow the steps carefully and recompiled the distro with these changes
 
And you are using these crystals on an item like a weapon or an armor?
Yes everythin' is well installed

@edit
It was a problem with usable/nousable sprites i managed to fix it through Object Builder/Item Editor
Thanks!
 

Attachments

Last edited:
And you are using these crystals on an item like a weapon or an armor?
@edit2
Now i have this error lmao:
Before using upgrade crys
e1.PNG


after using upgrade crystal it reset the dmg and def ?¿
e2.PNG
 
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
Tibia Scripting God...
Thanks for sharing ;)
 
Lua Script Error: [Action Interface]
data/actions/scripts/upgrade_system_actions.lua:eek:nUse
data/upgrade_system_core.lua:7: attempt to call method 'isItem' (a nil value)
stack traceback:
[C]: in function 'isItem'
data/upgrade_system_core.lua:7: in function <data/upgrade_system_core.lua:6>
is there someway to make gems usable without having to make custom items
 
Last edited:
Lua Script Error: [Action Interface]
data/actions/scripts/upgrade_system_actions.lua:eek:nUse
data/upgrade_system_core.lua:7: attempt to call method 'isItem' (a nil value)
stack traceback:
[C]: in function 'isItem'
data/upgrade_system_core.lua:7: in function <data/upgrade_system_core.lua:6>
is there someway to make gems usable without having to make custom items
Yeah, just take Tibia items that have usable flag and use them.
 
Back
Top