• 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 1.0][10.37] advance Items reward, Mount Reward, Addon Reward

CharlesHudson

Just alive, or just breathing...
Joined
Oct 25, 2011
Messages
98
Reaction score
14
Good Night ppl of Otland, today i come here to request Scripts for Items Reward in X level and mounts and addons plx
i try everything and doesn't work :c
plx
 
Cash Reward for certain level

Code:
local t = {
  39001, {
    [20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
    [50] = {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
 
Cash Reward for certain level

Code:
local t = {
  39001, {
    [20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
    [50] = {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

And for creaturescripts.xml ? plx becouse i have try everything :C
 
Put in creaturescripts.xml like this:

Code:
    <event type="advance" name="Rewards" script="others/Rewards.lua"/>

Put in the script from first post into file: data/creaturescripts/others/Rewards.lua

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

function onAdvance(cid, skill, oldlevel, newlevel)
    local player = Player(cid)
    for level, v in pairs(t[2]) do
        if skill == 8 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
Fixed now works :D
 
Code:
local t = {
  39001, {
    [20] = {2160, 2, "You have been awarded with 2 crystal coin for reaching level 20!", 1},
    [35] = {2160, 3, "You have been awarded with 3 crystal coins for reaching level 50!", 2},
    [50] = {2160, 5, "You have been awarded with 5 crystal coins for reaching level 75!", 3},
    [100] = {2160, 10, "You have been awarded with 10 crystal coins for reaching level 100!", 4},
    [150] = {2160, 15, "You have been awarded with 15 crystal coins for reaching level 100!", 5},
    [200] = {2160, 20, "You have been awarded with 20 crystal coins for reaching level 200!", 6}
    }
}

function onAdvance(cid, skill, oldlevel, newlevel)
    local player = Player(cid)
    for level, v in pairs(t[2]) do
        if skill == 8 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
Fixed now works :D
where i have to put it? in config lua or where?!!
 
Back
Top