- Joined
- Feb 14, 2015
- Messages
- 5,643
- Solutions
- 559
- Reaction score
- 3,949
SQL needed to execute in db:
C++ Code: infernumx/forgottenserver (https://github.com/infernumx/forgottenserver/compare/master...infernumx:abilities-remove)
New Lua functions:
Examples:
Notes:
I figured it was done enough for me to "release" it after a week (although I still have more planned for this, there are a lot of things I need to add, fix, and optimize)
I didn't thoroughly test everything (especially item descriptions), so if you find a bug let me know on this thread and I will fix it.
Be sure to keep up to date with this branch to get the latest bugfixes with this code. (further commits will have the prefix Update so you know what to look for)
SQL:
ALTER TABLE player_items ADD abilities BLOB NOT NULL;
ALTER TABLE player_depotitems ADD abilities BLOB NOT NULL;
ALTER TABLE player_inboxitems ADD abilities BLOB NOT NULL;
C++ Code: infernumx/forgottenserver (https://github.com/infernumx/forgottenserver/compare/master...infernumx:abilities-remove)
New Lua functions:
- item:setAbility(key, value)
- item:getAbility(key)
- item:removeAbility(key)
Code:
ITEM_ABILITY_HEALTHGAIN
ITEM_ABILITY_HEALTHTICKS
ITEM_ABILITY_MANAGAIN
ITEM_ABILITY_MANATICKS
ITEM_ABILITY_CONDITIONSUPPRESSIONS
ITEM_ABILITY_MAXHITPOINTS
ITEM_ABILITY_MAXMANAPOINTS
ITEM_ABILITY_MAGICPOINTS
ITEM_ABILITY_MAXHITPOINTSPERCENT
ITEM_ABILITY_MAXMANAPOINTSPERCENT
ITEM_ABILITY_MAGICPOINTSPERCENT
ITEM_ABILITY_SKILLFIST
ITEM_ABILITY_SKILLCLUB
ITEM_ABILITY_SKILLSWORD
ITEM_ABILITY_SKILLAXE
ITEM_ABILITY_SKILLDISTANCE
ITEM_ABILITY_SKILLSHIELD
ITEM_ABILITY_SKILLFISHING
ITEM_ABILITY_CRITICALHITCHANCE
ITEM_ABILITY_CRITICALHITAMOUNT
ITEM_ABILITY_LIFELEECHCHANCE
ITEM_ABILITY_LIFELEECHAMOUNT
ITEM_ABILITY_MANALEECHCHANCE
ITEM_ABILITY_MANALEECHAMOUNT
ITEM_ABILITY_SPEED
ITEM_ABILITY_ABSORBPHYSICAL
ITEM_ABILITY_ABSORBENERGY
ITEM_ABILITY_ABSORBEARTH
ITEM_ABILITY_ABSORBFIRE
ITEM_ABILITY_ABSORBWATER
ITEM_ABILITY_ABSORBICE
ITEM_ABILITY_ABSORBHOLY
ITEM_ABILITY_ABSORBDEATH
ITEM_ABILITY_FIELDABSORBPHYSICAL
ITEM_ABILITY_FIELDABSORBENERGY
ITEM_ABILITY_FIELDABSORBEARTH
ITEM_ABILITY_FIELDABSORBFIRE
ITEM_ABILITY_FIELDABSORBWATER
ITEM_ABILITY_FIELDABSORBICE
ITEM_ABILITY_FIELDABSORBHOLY
ITEM_ABILITY_FIELDABSORBDEATH
ITEM_ABILITY_ELEMENTTYPE
ITEM_ABILITY_ELEMENTDAMAGE
ITEM_ABILITY_MANASHIELD
ITEM_ABILITY_INVISIBLE
ITEM_ABILITY_REGENERATION
Examples:
Notes:
- For regeneration to work (HEALTHGAIN, MANAGAIN) you need to also set ITEM_ABILITY_REGENERATION to 1.
- ITEM_ABILITY_REGENERATION, ITEM_ABILITY_MANASHIELD, and ITEM_ABILITY_INVISIBLE should only be set to 1 to enable the ability.
- If you want to "set an ability to 0" aka item:setAbility(key, 0) it won't work. Use item:removeAbility(key) instead.
- Setting an ability while an item is equipped will not automatically update it and apply the stats. For it to update, you must de-equip and re-equip the item.
- For now, this only works with TFS 1.3. If you use 1.2 and still want to use this code you can apply this commit to your sources for critical and leech skills, this commit as well since it was pushed later
- ITEM_ABILITY_ELEMENTTYPE and ITEM_ABILITY_ELEMENTDAMAGE must be paired together to work properly
- Items that are not loaded through movements.xml will not register abilities
- Weapons that are loaded through weapons.xml will not register abilities
I figured it was done enough for me to "release" it after a week (although I still have more planned for this, there are a lot of things I need to add, fix, and optimize)
I didn't thoroughly test everything (especially item descriptions), so if you find a bug let me know on this thread and I will fix it.
Be sure to keep up to date with this branch to get the latest bugfixes with this code. (further commits will have the prefix Update so you know what to look for)
Last edited: