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

Error with Samples Characters

Szka

Member
Joined
Jul 27, 2016
Messages
65
Reaction score
11
Location
Chile
Hello guys!
I configure the first items for the new players, edited already the level and all was set, but when I created a new character, it appears level 1 with nothing in the equip!

here are the samples and I don't know how to make the equip appears!
i4vwZB.png
 
I haven't set-up a server in awhile, but from what I remember, whatever the samples have, is copied to each new character.

So if you give your sample level 8, with some basic equipment, log them out at the temple, each druid created after that, (restart server and database), will be a copy of that sample.
 
What distro you use? Anything post TFS 1.0 (if I remember right..) you should look into config.php into your web ACC. There you edit everything, level, HP, MP, skills, town, outfit...
 
Again, long time ago, but you should be able to just use god commands while the sample is online.

/addskill druid sample, level
/addskill druid sample, magic (might be magic level)
/addskill druid sample, shielding
(repeat until desired levels)

/i 1988
(spawn the items, then drop them on the floor, pick up on druid sample)

Move the sample to the temple position, log out sample.

/save
(to save everything in the server)

/shutdown
(to further save everything and shutdown the server safely.)

Stop, then start MySQL and Apache (going from memory again.)

Start up server.
Create a new character, and everything you added to the sample, should appear on the newly created characters.
 
@BahamutxD I'm using TFS 4.0
And @Xikini that is the problem, at the moment of giving some equip to those characters, after log out the item disappear
Hmm :/
I'm sorry I'm not familiar with setting up server's anymore.

I could create a login script that gives the players levels and items when they login for the first time if you want.

Just tell me the items and levels and vocation numbers. (check data/xml/vocations.xml for the number)
I'll do the rest. (Just make sure the player will have enough capacity to hold all the items.)

-- example.

vocation id = 1
level = 8
item 1 = (item_id = 1111, count = 1)
item 2 = (item_id = 2222, count = 10)

vocation id = 2
.
.
.
 
Thank you Xikini! Hope it works!
Here are the items for each vocation!
Code:
local sorcItems = {
            8820, -- helmet
            8819, -- armor
            2190, -- Wand of vortex
            2525, -- shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            8820, -- helmet
            8819, -- armor
            2525, -- shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2660, -- Ranger Cloak
            2456, -- Bow
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2525, -- shield
            8602, -- Jagged Sword
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch

They also should get this depending on their vocation:
Code:
-- 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 arrows
            doPlayerAddItem(cid, 2544, 100, FALSE)
            doPlayerAddItem(cid, 2525, 1, FALSE)
      
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
                        --
            doPlayerAddItem(cid, 2439, 1, FALSE)
            doPlayerAddItem(cid, 2428, 1, FALSE)
And finally, these are the common items all should get:
Code:
        -- Common for all
        doPlayerAddItem(cid, 2789, 25, FALSE) -- 25 mushroms
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
        doPlayerAddItem(cid, 2554, 1, FALSE) -- 1 shovel
        doPlayerAddItem(cid, 2160, 1, FALSE) -- 1 cc
        doPlayerAddItem(cid, 7620, 10, FALSE) -- 10 mp
        doPlayerAddItem(cid, 7618, 10, FALSE) -- 10 hp

Thanks again homie!
 
Thank you Xikini! Hope it works!
Here are the items for each vocation!
Code:
local sorcItems = {
            8820, -- helmet
            8819, -- armor
            2190, -- Wand of vortex
            2525, -- shield
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local druidItems = {
            8820, -- helmet
            8819, -- armor
            2525, -- shield
            2182, -- Snakebite rod
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch
        }
    local pallyItems = {
            2460, -- Brass helmet
            2660, -- Ranger Cloak
            2456, -- Bow
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
        }
    local kinaItems = {
            2460, -- Brass helmet
            2465, -- Brass armor
            2525, -- shield
            8602, -- Jagged Sword
            2478, -- Brass legs
            2643, -- Leather boots
            1988, -- Brown backpack
            2050 -- torch

They also should get this depending on their vocation:
Code:
-- 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 arrows
            doPlayerAddItem(cid, 2544, 100, FALSE)
            doPlayerAddItem(cid, 2525, 1, FALSE)
  
        elseif getPlayerVocation(cid) == 4 then
            -- Knight
            for i = 1, table.getn(kinaItems), 1 do
                doPlayerAddItem(cid, kinaItems[i], 1, FALSE)
            end
                        --
            doPlayerAddItem(cid, 2439, 1, FALSE)
            doPlayerAddItem(cid, 2428, 1, FALSE)
And finally, these are the common items all should get:
Code:
        -- Common for all
        doPlayerAddItem(cid, 2789, 25, FALSE) -- 25 mushroms
        doPlayerAddItem(cid, 2120, 1, FALSE) -- 1 rope
        doPlayerAddItem(cid, 2554, 1, FALSE) -- 1 shovel
        doPlayerAddItem(cid, 2160, 1, FALSE) -- 1 cc
        doPlayerAddItem(cid, 7620, 10, FALSE) -- 10 mp
        doPlayerAddItem(cid, 7618, 10, FALSE) -- 10 hp

Thanks again homie!
I still need the vocation id's and the level you want the players to be. :p

(check data/xml/vocations.xml for the number)
 
Sorry! I want the level 8!
And the vocations are just there!
Anyway I wrote this for u:
Sorcerer: 1
Druid: 2
Paladin: 3
Knight 4
 
Sorry it took so long.
Was typing this out in between calls at work.

(It's also untested because I'm not home.)
(Please send back any error's you receive.)
(I suggest trying it as-is to check for errors, before modifying it to fit your current or future needs.)

All items are placed into a brown backpack.
Maximum 20 items can go into a backpack, so all the items in "give_to_all_items" + the vocation specific items must be 20 or less.

Cheers!


data/creaturescripts/creaturescripts.xml

Code:
<event type="login" name="first_login_items" event="script" value="first_login_items.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near to bottom with the other registered events]
Code:
registerCreatureEvent(cid, "first_login_items")
data/creaturescripts/scripts/first_login_items.lua
Code:
local vocation_specific_items = {
    [1] = {item_list = { -- sorcerer
        [1] = {item_id = 8820, count = 1}, -- helmet
        [2] = {item_id = 8819, count = 1}, -- armor
        [3] = {item_id = 2190, count = 1}, -- wand of vortex
        [4] = {item_id = 2525, count = 1}, -- shield
        [5] = {item_id = 2478, count = 1}, -- brass legs
        [6] = {item_id = 2643, count = 1}, -- leather boots
        [7] = {item_id = 2050, count = 1}  -- torch
        }
    },
    [2] = {item_list = { -- druid
        [1] = {item_id = 8820, count = 1}, -- helmet
        [2] = {item_id = 8819, count = 1}, -- armor
        [3] = {item_id = 2525, count = 1}, -- shield
        [4] = {item_id = 2182, count = 1}, -- snakebite rod
        [5] = {item_id = 2478, count = 1}, -- brass legs
        [6] = {item_id = 2643, count = 1}, -- leather boots
        [7] = {item_id = 2050, count = 1}  -- torch
        }
    },
    [3] = {item_list = { -- paladin
        [1] = {item_id = 2460, count = 1}, -- brass helmet
        [2] = {item_id = 2660, count = 1}, -- range cloak
        [3] = {item_id = 2456, count = 1}, -- bow
        [4] = {item_id = 2478, count = 1}, -- brass legs
        [5] = {item_id = 2643, count = 1}, -- leather boots
        [6] = {item_id = 2455, count = 100}, -- ????
        [7] = {item_id = 2525, count = 1}    -- ????
        }
    },
    [4] = {item_list = { -- knight
        [1] = {item_id = 2460, count = 1}, -- brass helmet
        [2] = {item_id = 2465, count = 1}, -- brass armor
        [3] = {item_id = 2525, count = 1}, -- shield
        [4] = {item_id = 8602, count = 1}, -- jagged sword
        [5] = {item_id = 2478, count = 1}, -- brass legs
        [6] = {item_id = 2643, count = 1}, -- leather boots
        [7] = {item_id = 2050, count = 1}, -- torch
        [8] = {item_id = 2439, count = 1}, -- ????
        [9] = {item_id = 2428, count = 1}  -- ????
        }
    }
}

local give_to_all_items = {
    [1] = {item_id = 2789, count = 25}, -- 25 mushrooms
    [2] = {item_id = 2120, count = 1},  -- rope
    [3] = {item_id = 2554, count = 1},  -- shovel
    [4] = {item_id = 2160, count = 1},  -- crystal coin
    [5] = {item_id = 7620, count = 10}, -- 10 mana potion
    [6] = {item_id = 7618, count = 10}  -- 10 health potion
}

local experience_to_give = 4200 -- level 8 (0 = disable)
local storage = 45001 -- any free storage

function onLogin(cid)

    if getPlayerStorageValue(cid, storage) == 1 then
        return true
    end

    if experience_to_give > 0 then
        doPlayerAddExperience(cid, experience_to_give)
    end

    local backpack = doPlayerAddItem(cid, 1988, 1, true)
    for i = 1, #give_to_all_items do
        doAddContainerItem(backpack, give_to_all_items[i].item_id, give_to_all_items[i].count)
    end

    local v = getPlayerVocation(cid)
    local voc_table_list = vocation_specific_items[v].item_list
    for i = 1, #voc_table_list do
        doPlayerAddItem(cid, voc_table_list[i].item_id, voc_table_list[i].count, true)
    end

    setPlayerStorageValue(cid, storage, 1)

    return true
end
 
Last edited:
Thank you so much bro!
I really appreciate your time and your work mate! You fix this annoying problem I had!

Everything is working just fine, just having a little issue with the rookgard items (they appears too in every vocation)
Anyway, sorry for my late answer!

EDIT: I checked again, and the error has nothing to do with your script!
Nice work bro! Thanks again
 
Last edited:
Back
Top