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

reward arena quest

Dogrinha

New Member
Joined
Oct 6, 2019
Messages
206
Solutions
1
Reaction score
2
Hello I have problems in my arena quest, the items that come in the gun are wrong, I tried to fix but I can not. can anybody help me?

<action actionid="26300;26400;26500;26600;26700;27300;27400;27500;27600;27700;28300;28400;28500;28600;28700" event="script" value="ArenaQuest/arena_reward.lua"/>


Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local arena = getCreatureStorage(cid, STORAGE_ARENA) - 1
    if ARENA[arena].reward[item.actionid] then
        local reward = ARENA[arena].reward[item.actionid]
        if getCreatureStorage(cid, ARENA[arena].reward.storage) > 0 then
            return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It's empty.")
        end
 
        if reward.container then
            local cont = doPlayerAddItem(cid, reward.id, 1)
            for i = 1, table.maxn(reward.inside) do
                doAddContainerItem(cont, reward.inside[i][1], reward.inside[i][2])
            end
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. getItemArticleById(reward.id) .. " " .. getItemNameById(reward.id) .. ".")
            doCreatureSetStorage(cid, ARENA[arena].reward.storage, 1)
            return true
        else
            doPlayerAddItem(cid, reward.id[1], reward.id[2])
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. (reward.id[2] < 2 and getItemArticleById(reward.id[1]) or "x" .. reward.id[2]) .. " " .. getItemNameById(reward.id[1]) .. ".")
            doCreatureSetStorage(cid, ARENA[arena].reward.storage, 1)
            return true
        end
    end
    return true
end

OTX2
 
Back
Top