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

Premium scroll for TFS 0.2.13

D_Evans89

Member
Joined
Dec 3, 2014
Messages
175
Reaction score
12
I need a premium scroll script for TFS 0.2.13

I don't need the option for the teleport back when premmy expires though.

Thanks, I looked everywhere
 
Try this.
it was made for 0.3.6 but i think it should work for 0.2.13 aswell

remember to change the item ids, i did use the tibianews.net fansite items
and you can only add premium if you have less then 365 days of premium on the account.
Feel free to edit.
it also make an magiceffect on the player, if you dont want it remove the lines
doSendMagicEffect(getCreaturePosition(cid), 49)

Code:
local toMuchPrem = "Sorry, you cannot add more than 365 days of premium."
local premInfo = "Re-login to your account to activate premium time."

function onUse(cid, item, frompos, item2, topos)

   if item.itemid == 8981 then -- 15 days
       if (getPlayerPremiumDays(cid) < 365) then
           doPlayerAddPremiumDays(cid, 15)
           doRemoveItem(item.uid)
           doSendMagicEffect(getCreaturePosition(cid), 49)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, premInfo)
       else
           doPlayerSendCancel(cid, toMuchPrem)
       end
   end
 
   if item.itemid == 9004 then -- 30 days
       if (getPlayerPremiumDays(cid) < 365) then
           doPlayerAddPremiumDays(cid, 30)
           doRemoveItem(item.uid)
           doSendMagicEffect(getCreaturePosition(cid), 49)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, premInfo)
       else
           doPlayerSendCancel(cid, toMuchPrem)
       end
   end
   return true
end
 
Try this.
it was made for 0.3.6 but i think it should work for 0.2.13 aswell

remember to change the item ids, i did use the tibianews.net fansite items
and you can only add premium if you have less then 365 days of premium on the account.
Feel free to edit.
it also make an magiceffect on the player, if you dont want it remove the lines
doSendMagicEffect(getCreaturePosition(cid), 49)

Code:
local toMuchPrem = "Sorry, you cannot add more than 365 days of premium."
local premInfo = "Re-login to your account to activate premium time."

function onUse(cid, item, frompos, item2, topos)

   if item.itemid == 8981 then -- 15 days
       if (getPlayerPremiumDays(cid) < 365) then
           doPlayerAddPremiumDays(cid, 15)
           doRemoveItem(item.uid)
           doSendMagicEffect(getCreaturePosition(cid), 49)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, premInfo)
       else
           doPlayerSendCancel(cid, toMuchPrem)
       end
   end
 
   if item.itemid == 9004 then -- 30 days
       if (getPlayerPremiumDays(cid) < 365) then
           doPlayerAddPremiumDays(cid, 30)
           doRemoveItem(item.uid)
           doSendMagicEffect(getCreaturePosition(cid), 49)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, premInfo)
       else
           doPlayerSendCancel(cid, toMuchPrem)
       end
   end
   return true
end
I removed the first part where it only adds 15 days. It works but instead of adding 30 days it added 240 days.
 
I removed the first part where it only adds 15 days. It works but instead of adding 30 days it added 240 days.
would you get the same result if you used the 15 day's?
then there is something wrong whit the
doPlayerAddPremiumDays(cid, premdays) function
 
would you get the same result if you used the 15 day's?
then there is something wrong whit the
doPlayerAddPremiumDays(cid, premdays) function
It works, I guess my previous script work, it just didn't notify me and it also didn't have magic affect! yours is nicer, thanks!
 
how would I make it so they start off with only 30 days premium? this is what I have for my firstitems.lua

Code:
function onLogin(cid)
    local storage = 30055 -- storage value
  
    local sorcItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2190, -- Wand of vortex
            2511, -- Brass shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield           
            2389, -- Spear
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2412, -- Katana
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
  
    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
      
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
      
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
      
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
      
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
    end
    return true
end

maybe there is something I can add in this?
 
how would I make it so they start off with only 30 days premium? this is what I have for my firstitems.lua

Code:
function onLogin(cid)
    local storage = 30055 -- storage value
 
    local sorcItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2190, -- Wand of vortex
            2511, -- Brass shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield        
            2389, -- Spear
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2412, -- Katana
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
 
    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
   
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
   
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
--doPlayerAddPremiumDays(cid, 30)  -- 30 day  premium
    end
    return true
end

maybe there is something I can add in this?
add this to -- Common for all
doPlayerAddPremiumDays(cid, 30) -- 30 day premium
 
^ that will add 30 day pacc to every new character

you could use something like this
Code:
function onLogin(cid)
    local storage = 30055 -- storage value
 
    local sorcItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2190, -- Wand of vortex
            2511, -- Brass shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield         
            2389, -- Spear
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2412, -- Katana
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
 
    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
    
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
    
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
    
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
    
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
    end

    if getPlayerPremiumDays(cid) == 0 then
        doPlayerAddPremiumDays(cid, 30)
    end
    return true
end

this will only add 30 days of pacc if the player has 0 days on it, but im not too sure if this works. Worth a try tho :)
 
^ that will add 30 day pacc to every new character

you could use something like this
Code:
function onLogin(cid)
    local storage = 30055 -- storage value
 
    local sorcItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2190, -- Wand of vortex
            2511, -- Brass shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield        
            2389, -- Spear
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2511, -- Brass shield
            2412, -- Katana
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
 
    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
   
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
   
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
    end

    if getPlayerPremiumDays(cid) == 0 then
        doPlayerAddPremiumDays(cid, 30)
    end
    return true
end

this will only add 30 days of pacc if the player has 0 days on it, but im not too sure if this works. Worth a try tho :)
Your edit will give premium forever. :p

This should work.
Code:
local storage = 11111

function onLogin(cid)

    -- Check if quest has been completed before.
    if getPlayerStorageValue(cid, storage) == 1 then
        return true
    end

    -- adding this part because I know you specifically need it.
    for i = 1, 4 do
        doRemoveItem(getPlayerSlotItem(cid, i + 2).uid)
    end

    local v = getPlayerVocation(cid)

    -- Sorcerer
    if v == 1 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    -- Druid
    elseif v == 2 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Paladin
    elseif v == 3 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 8891, 1, true) -- armor
        doPlayerAddItem(cid, 7368, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Knight
    elseif v == 4 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 2472, 1, true) -- armor
        doPlayerAddItem(cid, 2400, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 2470, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots
        doPlayerAddItem(cid, 2431, 1, true) -- an additional weapon

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    end
   
    setPlayerStorageValue(cid, storage, 1)

    return true
end

function onLogin(cid)
    local storage = 30055 -- storage value

    local sorcItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2190, -- Wand of vortex
        2511, -- Brass shield
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local druidItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2182, -- Snakebite rod
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local pallyItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield        
        2389, -- Spear
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
    }
    local kinaItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2412, -- Katana
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }

    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
   
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
   
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
   
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
        local prem_days = getPlayerPremiumDays(cid)
        if prem_days < 30 then
            doPlayerAddPremiumDays(cid, (30 - prem_days))
        end
    end

    return true
end
 
Your edit will give premium forever. :p

This should work.
Code:
local storage = 11111

function onLogin(cid)

    -- Check if quest has been completed before.
    if getPlayerStorageValue(cid, storage) == 1 then
        return true
    end

    -- adding this part because I know you specifically need it.
    for i = 1, 4 do
        doRemoveItem(getPlayerSlotItem(cid, i + 2).uid)
    end

    local v = getPlayerVocation(cid)

    -- Sorcerer
    if v == 1 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    -- Druid
    elseif v == 2 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Paladin
    elseif v == 3 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 8891, 1, true) -- armor
        doPlayerAddItem(cid, 7368, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Knight
    elseif v == 4 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 2472, 1, true) -- armor
        doPlayerAddItem(cid, 2400, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 2470, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots
        doPlayerAddItem(cid, 2431, 1, true) -- an additional weapon

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    end
 
    setPlayerStorageValue(cid, storage, 1)

    return true
end

function onLogin(cid)
    local storage = 30055 -- storage value

    local sorcItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2190, -- Wand of vortex
        2511, -- Brass shield
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local druidItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2182, -- Snakebite rod
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local pallyItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield     
        2389, -- Spear
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
    }
    local kinaItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2412, -- Katana
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }

    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
 
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
 
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
 
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
 
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
        local prem_days = getPlayerPremiumDays(cid)
        if prem_days < 30 then
            doPlayerAddPremiumDays(cid, (30 - prem_days))
        end
    end

    return true
end
It would not give prem forever only first time the char login, but you made it impossible to gain 30+ days by making lots of chars.

Edit: I didnt see the post you was responding to.
 
Your edit will give premium forever. :p

This should work.
Code:
local storage = 11111

function onLogin(cid)

    -- Check if quest has been completed before.
    if getPlayerStorageValue(cid, storage) == 1 then
        return true
    end

    -- adding this part because I know you specifically need it.
    for i = 1, 4 do
        doRemoveItem(getPlayerSlotItem(cid, i + 2).uid)
    end

    local v = getPlayerVocation(cid)

    -- Sorcerer
    if v == 1 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    -- Druid
    elseif v == 2 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2323, 1, true) -- helmet
        doPlayerAddItem(cid, 8871, 1, true) -- armor
        doPlayerAddItem(cid, 2187, 1, true) -- weapon
        doPlayerAddItem(cid, 8902, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Paladin
    elseif v == 3 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 8891, 1, true) -- armor
        doPlayerAddItem(cid, 7368, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 7730, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)


    -- Knight
    elseif v == 4 then
        doPlayerAddItem(cid, 1988, 1, true) -- backpack
        doPlayerAddItem(cid, 2493, 1, true) -- helmet
        doPlayerAddItem(cid, 2472, 1, true) -- armor
        doPlayerAddItem(cid, 2400, 1, true) -- weapon
        doPlayerAddItem(cid, 2514, 1, true) -- shield
        doPlayerAddItem(cid, 2470, 1, true) -- legs
        doPlayerAddItem(cid, 2195, 1, true) -- boots
        doPlayerAddItem(cid, 2431, 1, true) -- an additional weapon

        local backpack = doPlayerAddItem(cid, 1988, 1, true)
        doAddContainerItem(backpack, 1111111, 1)
        doAddContainerItem(backpack, 1111111, 1)

    end
  
    setPlayerStorageValue(cid, storage, 1)

    return true
end

function onLogin(cid)
    local storage = 30055 -- storage value

    local sorcItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2190, -- Wand of vortex
        2511, -- Brass shield
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local druidItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2182, -- Snakebite rod
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }
    local pallyItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield       
        2389, -- Spear
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
    }
    local kinaItems = {
        2460, -- Brass helmet
        2465, -- Brass armor
        2511, -- Brass shield
        2412, -- Katana
        2478, -- Brass legs
        2643, -- Leather boots
        1988, -- Brown backpack
        2050 -- torch
    }

    if getPlayerStorageValue(cid, storage) == -1 then
        setPlayerStorageValue(cid, storage, 1)
        if getPlayerVocation(cid) == 1 then
            -- Sorcerer
            for i = 1, table.getn(sorcItems), 1 do
                doPlayerAddItem(cid, sorcItems[i], 1, FALSE)
            end
  
        elseif getPlayerVocation(cid) == 2 then
            -- Druid
            for i = 1, table.getn(druidItems), 1 do
                doPlayerAddItem(cid, druidItems[i], 1, FALSE)
            end
  
        elseif getPlayerVocation(cid) == 3 then
            -- Paladin
            for i = 1, table.getn(pallyItems), 1 do
                doPlayerAddItem(cid, pallyItems[i], 1, FALSE)
            end
            -- 8 spears
            doPlayerAddItem(cid, 2389, 5, FALSE)
  
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
        end
  
        -- Common for all
        doPlayerAddItem(cid, 2674, 5, FALSE) -- 5 apples
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
        local prem_days = getPlayerPremiumDays(cid)
        if prem_days < 30 then
            doPlayerAddPremiumDays(cid, (30 - prem_days))
        end
    end

    return true
end


Hmm. Didn't think about the fact that creating a new character would give more days of premium. I want it set up so that when a new account is created the account gets 30 days automatically. Is there a way for that?
 
It would not give prem forever only first time the char login, but you made it impossible to gain 30+ days by making lots of chars.

Edit: I didnt see the post you was responding to.
Didn't even think of alternate characters. :p
Yours was outside the storage value check, so would be checked every time someone logged in/out. xD
Hmm. Didn't think about the fact that creating a new character would give more days of premium. I want it set up so that when a new account is created the account gets 30 days automatically. Is there a way for that?
Maybe not automatically.. but you could add some stuff to your database to make account-wide storage values...
I remember seeing one somewhere..
https://otland.net/threads/account-storage-value.240581/
 
Is there a way I can just set up config.php to automatically start new accounts with 10 points? If so they can start with 10 points on their account and use their 10 free points to get their premium scroll.
 
Is there a way I can just set up config.php to automatically start new accounts with 10 points? If so they can start with 10 points on their account and use their 10 free points to get their premium scroll.
Your AAC (config.php) might contain something that will give every new account x amount of premdays. what AAC website are you using?

Give away points is not a good idea since then players will just get unlimited amount of prem.
I mean if thay make lots of alt account and then transfer the scroll to main account.

Edit:
If you use gesior 2012
inside config.php search for
Code:
$config['site']['newaccount_premdays'] = 0;
and replace the 0 whit 30
 
Last edited:
Your AAC (config.php) might contain something that will give every new account x amount of premdays. what AAC website are you using?

Give away points is not a good idea since then players will just get unlimited amount of prem.
I mean if thay make lots of alt account and then transfer the scroll to main account.

Edit:
If you use gesior 2012
inside config.php search for
Code:
$config['site']['newaccount_premdays'] = 0;
and replace the 0 whit 30

Is there a way to make that line compatable with znoteacc and paste it into the config.php file?
 
Back
Top