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

help to twick small part of Crafting system By Ramirow + Zbizu

oshrigames

Active Member
Joined
Nov 9, 2012
Messages
222
Reaction score
47
Location
israel
1) Original post: CreatureEvent - [TFS 1.1] Ultimate item stat system (elements, skills, exp, loot and more) (https://otland.net/threads/tfs-1-1-ultimate-item-stat-system-elements-skills-exp-loot-and-more.229771/)
2) Original post: Action - [TFS 1.2+] Simple Smithing Skill w/ Options (https://otland.net/threads/tfs-1-2-simple-smithing-skill-w-options.261756/)

I'm use TFS 1.2, protocol 10.98.

as for the request itself, id like to add few more attributes to the table.
luckily the code by Zbizu is cover most of it. also something to know, i only use Zbizu upgrade stat system. (not monster drops)

line 98 by Zbizu stat.lua
Lua:
UPGRADE_STATS_VALUES_PER_LVL = {
        -- value per level
            atk = 1,
            def = 1,
            extradef = 1,
            arm = 1,
            hitchance = 2,
            shootrange = 1
    },

(i will work on balance later)
and here's the attributes i'd like to add:

manadrain = 2, -- add to spellbooks
lifedrain = 5, -- add to weapons
hp = 5, - all gear but weapons
mana = 5, - all gear but weapons
exp = +x0.5%, - rings & boots
loot = +x0.5% - rings & boots

now i realize theres more to it then just add few lines, to the table itself.
this is why i need your help.
here's what Zbizu said in his code
" -- do not touch things below unless you are a advanced scripter "

tho i still did my best so, here is core of what i got so far:
lets take, Life drain for example.

Lua:
UPGRADE_STATS_VALUES_PER_LVL = {
        -- value per level
            atk = 1,
            def = 1,
            extradef = 1,
            arm = 1,
            hitchance = 2,
            shootrange = 1,
            lifedrain = 5
    },

Lua:
 [7] = {ITEM_ATTRIBUTE_LIFEDRAIN, function(id) return id:getLifeDrain() > 1 and id:getLifeDrain() or 0 end, STATS_SYSTEM_CONFIG.UPGRADE_STATS_VALUES_PER_LVL.lifedrain}


Lua:
function getItemAttribute(uid, key, force)
    local i = ItemType(Item(uid):getId())
    local string_attributes = {
        [ITEM_ATTRIBUTE_NAME] = i:getName(),
        [ITEM_ATTRIBUTE_ARTICLE] = i:getArticle(),
        [ITEM_ATTRIBUTE_PLURALNAME] = i:getPluralName(),
        ["name"] = i:getName(),
        ["article"] = i:getArticle(),
        ["pluralname"] = i:getPluralName()
    }

    local numeric_attributes = {
        [ITEM_ATTRIBUTE_WEIGHT] = i:getWeight(),
        [ITEM_ATTRIBUTE_ATTACK] = i:getAttack(),
        [ITEM_ATTRIBUTE_DEFENSE] = i:getDefense(),
        [ITEM_ATTRIBUTE_EXTRADEFENSE] = i:getExtraDefense(),
        [ITEM_ATTRIBUTE_ARMOR] = i:getArmor(),
        [ITEM_ATTRIBUTE_HITCHANCE] = i:getHitChance(),
        [ITEM_ATTRIBUTE_SHOOTRANGE] = i:getShootRange(),
        [ITEM_ATTRIBUTE_LIFEDRAIN] = i:getlifeDrain(),
        ["weight"] = i:getWeight(),
        ["attack"] = i:getAttack(),
        ["defense"] = i:getDefense(),
        ["extradefense"] = i:getExtraDefense(),
        ["armor"] = i:getArmor(),
        ["hitchance"] = i:getHitChance(),
        ["shootrange"] = i:getShootRange(),
        ["Lifedrain"] = i:getLifeDrain()
    }


it's the biggest script i had to deal with so i'm in a overwhelming lose here.. please help ;3

there's much more i tried to twick but still i lack something so i attached the Stats.lua i edit with one extra attribute LifeDrain. (still not working).
 

Attachments

Last edited:
Back
Top