-Skrypt Itemy przy awansie

arogan

New User
Zarejestrowany
Dołączył
Grudzień 9, 2012
Posty
1
Liczba reakcji
0
Witam. Szukam skryptu, kt?ry przy awansie da itemy. Chodzi np: lvl 20 do 3cc i r??d?ke lvl 30 3cc, r??d?ke i mana potiony..
Potrzebny do wersji: 10.98 TFS 1.2, niestety skrypty z internetu poprostu nie dzia?aj?. Pozdrawiam.

Kod:
local prizes = {
[19] = {id = 2160, count = 3}, -- at level 50 reward 3 item id 2160
[100] = {id = 2160, count = 5},
}

local storage = 34800
function onAdvance(player, skill, oldLevel, newLevel)
  if skill == 8 then
    for i = oldLevel+1, newLevel do -- just checking if he jumps multiple levels and pass 2+ prize levels
        if i > player:getStorageValue(storage) then
            local currentPrize = prizes[i]
            if currentPrize then
                player:setStorageValue(storage, i)
                local item = player:addItem(currentPrize.id, currentPrize.count)
                player:sendTextMessage(22, "Congratulations! You received "..currentPrize.count.."x "..item:getName().." for reaching level "..i..".")
            end
        end
    end
  end
    return true
end

function onLogin(player)
     player:registerEvent("advanceRewards")
    return true
end

To np. nie dzia?a

---------- Tre?? dodana o 17:15 ----------

Kod:
local t = {
  39001, {
    [20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
    [53] = {2160, 5, "You have been awarded with 5 crystal coins for reaching level 50!", 2},
    [75] = {2160, 10, "You have been awarded with 10 crystal coins for reaching level 75!", 3},
    [100] = {2160, 50, "You have been awarded with 50 crystal coins for reaching level 100!", 4},
    [200] = {2160, 100, "You have been awarded with 100 crystal coins for reaching level 200!", 5}
    }
}

function onAdvance(cid, skill, oldlevel, newlevel)
    local player = Player(cid)
    for level, v in pairs(t[2]) do
        if skill == SKILL_LEVEL and oldlevel < level and player:getLevel() >= level and player:getStorageValue(t[1]) < v[4] then
            player:addItem(v[1], v[2])
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, v[3])
            player:setStorageValue(t[1], v[4])
            break
        end
    end
    player:save()
    return true
end

ten skrypt dzia?a ale potrzebowa?bym go na dan? profesje i doda? np. miecz, r??d?ka itd
 
Back
Do góry