CreatureEvent [TFS 1.1] Ultimate item stat system (elements, skills, exp, loot and more)

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by zbizu, Mar 7, 2015.

  1. bonfim25

    bonfim25 New Member

    Joined:
    Jan 17, 2011
    Messages:
    17
    the only thing that changed was the alteration that Sir Islam said to work the action the rest was already working normal. !
     
  2. chrillefock

    chrillefock Member

    Joined:
    Jul 4, 2009
    Messages:
    88
    Lua Script Error: [CreatureScript Interface]
    data/creaturescripts/scripts/stats.lua:eek:nLogin
    data/creaturescripts/scripts/stats.lua:22: attempt to call global 'stat_onLogin'
    (a nil value)
    stack traceback:
    [C]: in function 'stat_onLogin'
    data/creaturescripts/scripts/stats.lua:22: in function <data/creaturescr
    ipts/scripts/stats.lua:21>

    anyone know what i have done wrong?
     
  3. SlayingWorld

    SlayingWorld Active Member

    Joined:
    Jan 23, 2014
    Messages:
    120
    I got the same error, running it on the latest TFS 1.2, then everything goes nuts as it fails to load all the rest libs from global
     
  4. SlayingWorld

    SlayingWorld Active Member

    Joined:
    Jan 23, 2014
    Messages:
    120
    Nvm Fixed it
     
    William Sezo likes this.
  5. William Sezo

    William Sezo Rookie but passionate

    Joined:
    May 6, 2016
    Messages:
    43
    how did you fix it SlayingWorld?
     
  6. William Sezo

    William Sezo Rookie but passionate

    Joined:
    May 6, 2016
    Messages:
    43
    Wish I knew, I would love to have this system on my server... can't seem to make it work on TFS 1.2
     
  7. Aeronx

    Aeronx Member

    Joined:
    Dec 17, 2015
    Messages:
    288
    It works on TFS 1.2 There's many incompatibilities with other systems. Try it on a clean TFS 1.2 server, and then you'll know if its something on your server or just that you missed something :p
     
    William Sezo likes this.
  8. William Sezo

    William Sezo Rookie but passionate

    Joined:
    May 6, 2016
    Messages:
    43
    Got on top of it yesterday and got it working!
    Don't ask me what I did tho...

    Thanks!
     
  9. William Sezo

    William Sezo Rookie but passionate

    Joined:
    May 6, 2016
    Messages:
    43
    It works for upgrading with the stones, but the +X items are not dropping from monsters.
    Does anyone know how to fix this?
     
  10. Aeronx

    Aeronx Member

    Joined:
    Dec 17, 2015
    Messages:
    288
    Actually they drop, but there's a problem with that part,
    That even random crap items like torches or bones get
    Upgraded! I got it working fine on a tfs 1.2, just recheck
    Your steps, and redo them if necessary. It works, not as
    It should, but it works. The fixes needs to be done by yourself
    Or ask someone to do it for you.
     
    William Sezo likes this.
  11. William Sezo

    William Sezo Rookie but passionate

    Joined:
    May 6, 2016
    Messages:
    43
    Thanks Aeronx, I'll do that.
     
  12. God Mythera

    God Mythera Well-Known Member

    Joined:
    Aug 11, 2012
    Messages:
    1,869
    Anyone got this working with TFS 1.2?
     
  13. RazorBlade

    RazorBlade Snek Premium User

    Joined:
    Nov 7, 2009
    Messages:
    1,996
    considering the differences in code for 1.1 vs 1.2 are small, I can't imagine why it wouldn't work with 1.2. I don't remember for sure which version I was using when I tried this system but it worked fine. It was probably 1.2.
     
  14. God Mythera

    God Mythera Well-Known Member

    Joined:
    Aug 11, 2012
    Messages:
    1,869
    I did everything it said and my server wont open, if i was to test it again it would be when i get a dedi host ;d
     
  15. Kemixe

    Kemixe New Member

    Joined:
    Jul 18, 2014
    Messages:
    6

    When I try to use GEM_BASIC_LEVEL and GEM_ADD_SLOT, it works, but when I try to use the others, this error


    Code:
    Lua Script Error: [Action Interface]
    data/actions/scripts/slot.lua:onUse
    data/lib2/stats.lua:1470: attempt to index a nil value
    stack traceback:
            [C]: in function '__index'
            data/lib2/stats.lua:1470: in function 'stat_onUse'
            data/actions/scripts/slot.lua:3: in function <data/actions/scripts/slot.lua:1>
    Code:
        GEM_BASIC_LEVEL = 2280,
        GEM_ADD_SLOT = 2281,
        GEM_RANDOM = 2282,
        GEM_RARE = 2283,
        GEM_EPIC = 2284,
        GEM_LEGENDARY = 2296,
        gems_power = {
            [2297] = {min_wl = 0, max_wl = 4, min_el = 0.3, max_el = 0.6, sl = function() return 2 end}, -- rare
            [2298] = {min_wl = 3, max_wl = 6, min_el = 0.6, max_el = 0.7, sl = function() return 3 end}, -- epic
            [2299] = {min_wl = 5, max_wl = 9, min_el = 0.8, max_el = 1, sl = function() return 4 end}, -- legendary
            [2300] = {min_wl = 0, max_wl = 9, min_el = 0.3, max_el = 1, sl = function() return math.random(2, 4) end} -- random
    Line 1470:
    Code:
                    if item2:generateStats(u, STATS_SYSTEM_CONFIG.gems_power[item.itemid].sl(), math.random(STATS_SYSTEM_CONFIG.gems_power[item.itemid].min_wl, STATS_SYSTEM_CONFIG.gems_power[item.itemid].max_wl), math.floor(STATS_SYSTEM_CONFIG.maxLevel * STATS_SYSTEM_CONFIG.gems_power[item.itemid].min_el), math.ceil(STATS_SYSTEM_CONFIG.maxLevel * STATS_SYSTEM_CONFIG.gems_power[item.itemid].max_el)) then
                        toPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
                        doRemoveItem(item.uid, 1)
                        player:sendTextMessage(MESSAGE_INFO_DESCR, "Item modification successful.")
                        return true
                    else
                        player:sendTextMessage(MESSAGE_INFO_DESCR, "Erro1.")
                    end
    Actions:
    Code:
    function onUse(player, item, fromPosition, itemEx, toPosition)
    if not (Item(itemEx.uid) or not Creature(itemEx.uid)) or itemEx.itemid == 2173 then return false end
    stat_onUse(player, item, fromPosition, itemEx, toPosition)
    return true
    end


    Thx!
     
    Last edited: Dec 19, 2016
  16. Kemixe

    Kemixe New Member

    Joined:
    Jul 18, 2014
    Messages:
    6
    Fixed! Working now.
     
  17. Exos

    Exos New Member

    Joined:
    Dec 20, 2016
    Messages:
    14
    Does someone know where can I increase the loot chance to test the loot please? Thank you
     

Share This Page