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

[0.3.4.][Action] Forge system 0.3.4->0.3.6

Dymczas

New Member
Joined
Mar 8, 2009
Messages
105
Reaction score
0
Who will rewrite my script from 0.3.4 to 0.3.6 ?
On 0.3.6 got this errors :

[17/02/2010 15:01:14] [Error - Action Interface]
[17/02/2010 15:01:14] data/actions/scripts/upgrade.lua:eek:nUse
[17/02/2010 15:01:14] Description:
[17/02/2010 15:01:14] data/actions/scripts/upgrade.lua:182: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[17/02/2010 15:01:14] stack traceback:
[17/02/2010 15:01:14] data/actions/scripts/upgrade.lua:182: in function 'Forge'
[17/02/2010 15:01:14] data/actions/scripts/upgrade.lua:227: in function <data/actions/scripts/upgrade.lua:226>

182 line :
PHP:
if (base_uid == 0) then
        if (math.random(1, 100) <= (list.percent + percentEx)) then
            local uid = doCreateItemEx(list.prize.id, list.prize.count)
            doSetItemSpecialDescription(uid, "It was forget by " .. getCreatureName(cid) .. ".")
182 ------> doTileAddItemEx(pos, uid) <--------- 182
            doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
        else
            doSendMagicEffect(pos, CONST_ME_POFF)
        end

227 line :
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local ret, msg = Smith:Forge(cid, item, toPosition)
227---->if not (ret) then <-----------------------227
        doPlayerSendCancel(cid, msg)
    end
    return TRUE
end



[17/02/2010 15:07:42] [Error - Action Interface]
[17/02/2010 15:07:42] data/actions/scripts/upgrade.lua:eek:nUse
[17/02/2010 15:07:42] Description:
[17/02/2010 15:07:42] data/actions/scripts/upgrade.lua:200: attempt to call global 'getItemExtraDefense' (a nil value)
[17/02/2010 15:07:42] stack traceback:
[17/02/2010 15:07:42] data/actions/scripts/upgrade.lua:200: in function 'Forge'
[17/02/2010 15:07:42] data/actions/scripts/upgrade.lua:227: in function <data/actions/scripts/upgrade.lua:226>

200 line:
PHP:
elseif (k == "defense") then
                local current = getItemExtraDefense(base_uid)
   200------------> if (v[current]) then <--------------200
                    if (math.random(1, 100) <= v[current].percent + percentEx) then
                        setItemExtraDefense(base_uid, v[current].to)
                        ret = true


Any ideas ? ^^
 
the same errors in all!
that functions are deprecated
data/actions/scripts/upgrade.lua:200: attempt to call global 'getItemExtraDefense' (a nil value)
data/actions/scripts/upgrade.lua:182: attempt to call global 'doSetItemSpecialDescription' (a nil value)

use others functions.. i cant help you now i havent touch the tfs data for about 1 month
 
doItemSetAttribute(itemuid, "attribute", param)
but the second one works strange(getItemAttribute(itemuid, "attribute"))returns some strange value
 
Change:
local current = getItemExtraDefense(base_uid)
to
local current = getItemAttribute(base_uid, "defense")


Change:
setItemExtraDefense(base_uid, v[current].to)
to
doItemSetAttribute(base_uid, "defense", v[current].to)


Change:
doSetItemSpecialDescription(uid, "It was forget by " .. getCreatureName(cid) .. ".")
to
doItemSetAttribute(uid, "description", "It was forged by " .. getCreatureName(cid) .. ".")
 
Thanks, now works better but still errors in console :
[18/02/2010 13:43:09] [Error - Action Interface]
[18/02/2010 13:43:09] data/actions/scripts/upgrade.lua:eek:nUse
[18/02/2010 13:43:09] Description:
[18/02/2010 13:43:09] data/actions/scripts/upgrade.lua:222: attempt to call global 'debugPrint' (a nil value)
[18/02/2010 13:43:09] stack traceback:
[18/02/2010 13:43:09] data/actions/scripts/upgrade.lua:222: in function 'Forge'
[18/02/2010 13:43:09] data/actions/scripts/upgrade.lua:227: in function <data/actions/scripts/upgrade.lua:226>

PHP:
 doPlayerAddSkillTryEx(cid, SKILL_EX_SMITH, 1)
    debugPrint(getPlayerSkillTryEx(cid, SKILL_EX_SMITH) .. " > " .. getPlayerSkillLevelEx(cid, SKILL_EX_SMITH))
    return true <------------------- 222
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local ret, msg = Smith:Forge(cid, item, toPosition) <--- 226
    if not (ret) then
<-----------------227
 
Change:
debugPrint(getPlayerSkillTryEx(cid, SKILL_EX_SMITH) .. " > " .. getPlayerSkillLevelEx(cid, SKILL_EX_SMITH)
to
print(getPlayerSkillTryEx(cid, SKILL_EX_SMITH) .. " > " .. getPlayerSkillLevelEx(cid, SKILL_EX_SMITH)

or just remove that line, I don't really get why it's there.
 
Now this error :
[18/02/2010 13:54:20] [Error - LuaScriptInterface::loadFile] data/actions/scripts/upgrade.lua:222: unexpected symbol near '..'
[18/02/2010 13:54:20] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/upgrade.lua)
[18/02/2010 13:54:20] data/actions/scripts/upgrade.lua:222: unexpected symbol near '..'
 
Okay, also :
[18/02/2010 14:00:46] [Error - Action Interface]
[18/02/2010 14:00:46] data/actions/scripts/upgrade.lua:eek:nUse
[18/02/2010 14:00:46] Description:
[18/02/2010 14:00:46] data/actions/scripts/upgrade.lua:192: attempt to call global 'getItemExtraAttack' (a nil value)
[18/02/2010 14:00:46] stack traceback:
[18/02/2010 14:00:46] data/actions/scripts/upgrade.lua:192: in function 'Forge'
[18/02/2010 14:00:46] data/actions/scripts/upgrade.lua:227: in function <data/actions/scripts/upgrade.lua:226>

PHP:
local ret = false
        for k, v in pairs(list.attr) do
            if (k == "attack") then
                local current = getItemExtraAttack(base_uid)
                if (v[current]) then <-----------------192
                    if (math.random(1, 100) <= v[current].percent + percentEx) then
                        setItemExtraAttack(base_uid, v[current].to)
                        ret = true
 
Change:
local current = getItemExtraAttack(base_uid)
to:
local current = getItemAttribute(base_uid, "attack")


Change:
setItemExtraAttack(base_uid, v[current].to)
to:
doItemSetAttribute(base_uid, "attack", v[current].to)

If there are more errors after this it will be alot easier if you just show me the whole script ^^
 
Back
Top