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

TFS 0.3.6 Reward on Level - Need 1 more thing? :) <3

archer32

Member
Joined
Feb 3, 2011
Messages
88
Solutions
1
Reaction score
9
Hello...so this is my script...

Lua:
local t = {
    39001, {
    [20] = {2160, 2, "Congratulations on level 20! You have been awarded with 2 crystal coins! Get that promo slacker.", 1},
    [50] = {2160, 3, "Congratulations on level 50! Beware, you are vulnerable to those shitty PKers now! Here is 3 crystal coins! Store it fast!", 2},
    [75] = {2160, 5, "Congratulations, you made it this far, you might as well stay here forever, here is 5 crystal coins!", 3},
    [100] = {2160, 10, "Congratulations, you have successfully played way to much, I suppose an award is in order? You have been awarded with 10 crystal coins!", 4}
    }
}
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL then
        for level, v in pairs(t[2]) do
            if oldlevel < level and getPlayerLevel(cid) >= level and getPlayerStorageValue(cid, t[1]) < v[4] then
                doPlayerAddItem(cid, v[1], v[2])
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, v[3])
                setPlayerStorageValue(cid, t[1], v[4])
            end
        end
    end
    doPlayerSave(cid, true)
    return true
end




Now, I am not the best at this -- but how do I also award vocations with level 20 gear? Etc -- so they have something better than starter weapons?
This is just crystal coin.

Edit: It is not a huge deal - but meh...I can just make them buy it :p or quest maybe :)

Just was wondering if somebody had time to add it to that
 
here is the script with especific vocs! just edit the levels and the items id/count

Code:
local c = {
  [{1,5}] = { -- sorcerer
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{2,6}] = { -- druid
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{3,7}] = { -- paladin
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{4,8}] = { -- knight
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  }
}
function onAdvance(cid, skill, oldlevel, newlevel)
        if skill ~= SKILL__LEVEL then
            return true
        end
        for voc, x in pairs(c) do
            if isInArray(voc, getPlayerVocation(cid)) then
                    for level, z in pairs(x) do
                        if newlevel >= level and getPlayerStorageValue(cid, z.storage) ~= 1 then
                    local text = ""
                    for v = 1, #z.items do
                        count, info = z.items[v].count, getItemInfo(z.items[v].itemid)
                        local ret = ", "
                        if v == 1 then
                            ret = ""
                        elseif v == #z.items then
                            ret = " and "
                        end
                        text = text .. ret
                        text = text .. (count > 1 and count or info.article).." "..(count > 1 and info.plural or info.name)
                        doPlayerAddItem(cid, z.items[v].itemid, z.items[v].count)
                    end
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you reached level "..level.." and received "..text..".")
                                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
                                setPlayerStorageValue(cid, z.storage, 1)
                        end
                    end
            end
        end
        return true
end
 
here is the script with especific vocs! just edit the levels and the items id/count

Code:
local c = {
  [{1,5}] = { -- sorcerer
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{2,6}] = { -- druid
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{3,7}] = { -- paladin
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  },
  [{4,8}] = { -- knight
    [50] = {items = {{itemid = 2160, count = 5}}, storage = 40953},
    [100] = {items = {{itemid = 2160, count = 10}}, storage = 40954},
    [200] = {items = {{itemid = 2160, count = 20}}, storage = 40955},
    [300] = {items = {{itemid = 2160, count = 50}}, storage = 40956},
    [400] = {items = {{itemid = 2160, count = 100}}, storage = 40957},
    [500] = {items = {{itemid = 8982, count = 1}}, storage = 40958},
    [600] = {items = {{itemid = 2157, count = 5}}, storage = 40959},
    [800] = {items = {{itemid = 8982, count = 5}}, storage = 40960},
    [1000] = {items = {{itemid = 9004, count = 1}}, storage = 40961}
  }
}
function onAdvance(cid, skill, oldlevel, newlevel)
        if skill ~= SKILL__LEVEL then
            return true
        end
        for voc, x in pairs(c) do
            if isInArray(voc, getPlayerVocation(cid)) then
                    for level, z in pairs(x) do
                        if newlevel >= level and getPlayerStorageValue(cid, z.storage) ~= 1 then
                    local text = ""
                    for v = 1, #z.items do
                        count, info = z.items[v].count, getItemInfo(z.items[v].itemid)
                        local ret = ", "
                        if v == 1 then
                            ret = ""
                        elseif v == #z.items then
                            ret = " and "
                        end
                        text = text .. ret
                        text = text .. (count > 1 and count or info.article).." "..(count > 1 and info.plural or info.name)
                        doPlayerAddItem(cid, z.items[v].itemid, z.items[v].count)
                    end
                                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you reached level "..level.." and received "..text..".")
                                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
                                setPlayerStorageValue(cid, z.storage, 1)
                        end
                    end
            end
        end
        return true
end

Love you , liked your post, not sure if that gives rep or something
 
Back
Top