Ir para conteúdo

Featured Replies

Postado

boa tarde estou com um erro no warantientrosa alguem pode ajudar

 

[Error - GlobalEvent Interface]
data/globalevents/scripts/antiEntrosaKillua.lua:onThink
Description:
data/globalevents/scripts/antiEntrosaKillua.lua:8: attempt to compare nil with number
stack traceback:
        data/globalevents/scripts/antiEntrosaKillua.lua:8: in function <data/globalevents/scripts/antiEntrosaKillua.lua:1>
[Error - GlobalEvents::think] Couldn't execute event: Anti Entrosa

 

function onThink(interval, lastExecution, thinkInterval)
    local storages = {}
    for a,b in pairs(Entrosa.arenas) do
        storages[b.number] = b.storage
    end
    for x,y in pairs(storages) do
        local tab_sto = getGlobalTableStorage(y)
        if tonumber(tab_sto[4]) < os.time() then
            if tonumber(tab_sto[1]) <= os.time() then
                for _, pid in pairs(getPlayersOnline()) do
                    if getPlayerStorageValue(pid,Entrosa.sto) == x then
                        doPlayerSetStorageValue(pid,Entrosa.sto,-1)
                        doTeleportThing(pid,getTownTemplePosition(getPlayerTown(cid)))
                        doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_ORANGE,"A guerra entre as guilds acabou e você foi trazido para o templo.")
                    end
                end
                local newTab = {}
                for l,t in next, tab_sto do
                    newTab[l] = 0
                end
                setGlobalTableStorage(y,newTab)
            end
        end
    end
    return true
end
 

Ajuda @Vodkart @Sttorm

Postado
  • Autor

@Sttorm

estou com esse aki tbm

 

[Error - CreatureScript Interface]
data/creaturescripts/scripts/killuaItemUp.lua:onKill
Description:
(luaGetMonsterInfo) Monster not found

 

 

-- Itens Upgrade System feito por Killua (Vítor Bertolucci)

local min_exp = 2000 -- Exp mínima para o monstro valer (exp que fica no monster.xml)
local exp_levels = {100000, 245000, 499500, 743300, 967000, 1317400, 2038000, 3800000, 5214000, 7130000} -- Exp pra upar. A cada vez que um item atingir um desses valores de exp, ele upa 1 lvl. (Tem 10, ou seja, nível máximo do item = 10) Pode por mais leveis se quiser.
local slots = {1,4,7,8,5,6}
local wands = {7735,7414,7410,7424}

local function getItemExp(item)
    if item.itemid > 0 then
        return getItemAttribute(item.uid, "exp") or tonumber(0)
    end
    return false
end

local function getItemLevel(experience)
    if experience < exp_levels[1] then return tonumber(0) end
    local old = 1
    for i = 2,10 do
        if experience < exp_levels and experience >= exp_levels[old] then
            return tonumber(old)
        end
        old = i
    end
end

local function getMonsterItemExp (cid,monsterExp)
    local n = monsterExp * 2.71828182846
    local lvl = getPlayerLevel(cid)
    n = (n / (lvl ^ (2.71828182846/10)))/1000
    return math.floor(n)
end


local function doItemAddExp(cid,item,exp)
    if item.itemid > 0 and tonumber(exp) then
        local exp_now = getItemExp(item)
        local oldLevel = getItemLevel(exp_now)
        doItemSetAttribute(item.uid, "exp", exp_now + exp)
        local newLevel = getItemLevel(getItemExp(item))

        if oldLevel < newLevel then

            local isPair = newLevel%2 == 0 and true or false
            local attribute = isPair and 1 or 2

            -- Upar o item
            local itemName = getItemNameById(item.itemid)
            doItemSetAttribute(item.uid,"name",itemName.." +"..newLevel)
            if isShield(item.uid) then
                local def = getItemAttribute(item.uid, "defense") or getItemInfo(item.itemid).defense
                doItemSetAttribute(item.uid,"defense", def + attribute)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Seu "..itemName.." upou para o level "..newLevel.." e recebeu +".. attribute .." de defesa.")
            elseif (isSword(item.uid) or isAxe(item.uid) or isClub(item.uid) or isBow(item.uid)) then
                local atk = getItemAttribute(item.uid, "attack") or getItemInfo(item.itemid).attack
                doItemSetAttribute(item.uid,"attack", atk + attribute)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Seu "..itemName.." upou para o level "..newLevel.." e recebeu +".. attribute .." de ataque.")
            elseif isArmor(item.itemid) then
                local arm = getItemAttribute(item.uid, "armor") or getItemInfo(item.itemid).armor
                doItemSetAttribute(item.uid,"armor", arm + attribute)
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Seu "..itemName.." upou para o level "..newLevel.." e recebeu +".. attribute .." de arm.")
            elseif isWand(item.uid) and isInArray(wands,item.itemid) then
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,"Sua "..itemName.." upou para o level "..newLevel.." e recebeu +5% de poder de ataque")
            end
        end

    end
    return false
end

function onKill(cid, target, lastHit)   

    if isPlayer(cid) and isMonster(target) then

        local monsterName = getCreatureName(target)
        if not monsterName or type(monsterName) ~= "string" then return true end
        local monster = getMonsterInfo(monsterName)
        if not monster then return true end
        local monsterExp = getMonsterInfo(monsterName).experience
        if not monsterExp then return true end
        local exp_gain = getMonsterItemExp(cid,monsterExp)


        if monsterExp >= min_exp then
            for _,b in pairs(slots) do
                local item = getPlayerSlotItem(cid, b)
                if item.uid > 0 then
                    if isArmor(item.itemid) or isShield(item.uid) or isWand(item.uid) or isAxe(item.uid) or isSword(item.uid) or isClub(item.uid) or isBow(item.uid) then
                        doItemAddExp(cid, item, exp_gain)
                        local itemExp = getItemExp(item)
                        --doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,"Seu "..getItemNameById(item.itemid).." ganhou "..exp_gain.." pontos de exp ao derrotar um "..monsterName..". Ele tem ["..itemExp.."/".. exp_levels[ getItemLevel(itemExp) +1] .."] pontos atualmente.")
                    end
                end

            end
        end
    end
    return true
end

function onLogin(cid)
    registerCreatureEvent(cid, "Item level")
    return true
end

no anti entrossa deu esse

 

[Error - GlobalEvent Interface]
data/globalevents/scripts/antiEntrosaKillua.lua:onThink
Description:
data/globalevents/scripts/antiEntrosaKillua.lua:8: attempt to compare nil with number
stack traceback:
        data/globalevents/scripts/antiEntrosaKillua.lua:8: in function <data/globalevents/scripts/antiEntrosaKillua.lua:1>
[Error - GlobalEvents::think] Couldn't execute event: Anti Entrosa

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.9k

Informação Importante

Confirmação de Termo