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

[Mod & Lua] Advanced First Items (useRunes, useSlot, slotType, useMessage, inContainer)

Do you find this MOD useful?

  • Yes, of course! Thank you!

  • No, not exactly. But thank you.

  • Somewhat, yes. Thank you.


Results are only viewable after voting.
I'm not familiar with 0.4 so I can't really help you with that, but I could suggest opening the firstitems.lua you already have and copy the format of the function (most likely to replace "function onLogin(player)" to something else) to the newer script
thats 1.x
 
I know this is pretty old but anyone have any idea how to edit start items for custom vocations?
Each index corresponds to the id of the vocation, if you look in your vocations file you will see that sorcerer is id 1, druid is id 2, paladin is id 3 and knight is id 4.
Code:
firstItems = {
    { -- Sorcerer
        {itemid=1988}, -- backpack
        {itemid=2175}, -- spellbook
        {itemid=2190}, -- wand of vortex
        {itemid=8819}, -- magician's robe
        {itemid=8820}, -- mage hat
        {itemid=2468}, -- studded legs
        {itemid=7620, count=3, inContainer=true} -- mana potion
    },
    { -- Druid
        {itemid=1988}, -- backpack
        {itemid=2175}, -- spellbook
        {itemid=2182}, -- snakebite rod
        {itemid=8819}, -- magician's robe
        {itemid=8820}, -- mage hat
        {itemid=2468}, -- studded legs
        {itemid=7620, count=3, inContainer=true} -- mana potion
    },
    { -- Paladin
        {itemid=1988}, -- backpack
        {itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow
        {itemid=2544, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 arrow's
        {itemid=2660}, -- ranger's cloak
        {itemid=2481}, -- soldier helmet
        {itemid=8923}, -- ranger legs
        {itemid=7618, count=1, inContainer=true}, -- health potion
        {itemid=7620, count=2, inContainer=true} -- mana potion
    },
    { -- Knight
        {itemid=1988}, -- backpack
        {itemid=2509}, -- steel shield
        {itemid=8602}, -- jagged sword
        {itemid=8601, inContainer=true}, -- steel axe
        {itemid=2439, inContainer=true}, -- daramanian mace
        {itemid=2465}, -- brass armor
        {itemid=2481}, -- soldier helmet
        {itemid=2478}, -- brass legs
        {itemid=7618, count=3, inContainer=true} -- health potion
    }
}

If you have more than 4 vocations you will need to add in more tables within firstItems
Example
Code:
firstItems = {
    { -- Sorcerer -- id 1
        {itemid=1988}, -- backpack
        {itemid=2175}, -- spellbook
        {itemid=2190}, -- wand of vortex
        {itemid=8819}, -- magician's robe
        {itemid=8820}, -- mage hat
        {itemid=2468}, -- studded legs
        {itemid=7620, count=3, inContainer=true} -- mana potion
    },
    { -- Druid -- id 2
        {itemid=1988}, -- backpack
        {itemid=2175}, -- spellbook
        {itemid=2182}, -- snakebite rod
        {itemid=8819}, -- magician's robe
        {itemid=8820}, -- mage hat
        {itemid=2468}, -- studded legs
        {itemid=7620, count=3, inContainer=true} -- mana potion
    },
    { -- Paladin -- id 3
        {itemid=1988}, -- backpack
        {itemid=2456, count=1, useSlot=true, slotType=CONST_SLOT_LEFT}, -- bow
        {itemid=2544, count=100, useSlot=true, slotType=CONST_SLOT_LAST}, -- 100 arrow's
        {itemid=2660}, -- ranger's cloak
        {itemid=2481}, -- soldier helmet
        {itemid=8923}, -- ranger legs
        {itemid=7618, count=1, inContainer=true}, -- health potion
        {itemid=7620, count=2, inContainer=true} -- mana potion
    },
    { -- Knight -- id 4
        {itemid=1988}, -- backpack
        {itemid=2509}, -- steel shield
        {itemid=8602}, -- jagged sword
        {itemid=8601, inContainer=true}, -- steel axe
        {itemid=2439, inContainer=true}, -- daramanian mace
        {itemid=2465}, -- brass armor
        {itemid=2481}, -- soldier helmet
        {itemid=2478}, -- brass legs
        {itemid=7618, count=3, inContainer=true} -- health potion
    },
    { -- whatever is id 5
        {itemid=1988}, -- backpack
        {itemid=2509}, -- steel shield
        {itemid=8602}, -- jagged sword
        {itemid=8601, inContainer=true}, -- steel axe
        {itemid=2439, inContainer=true}, -- daramanian mace
        {itemid=2465}, -- brass armor
        {itemid=2481}, -- soldier helmet
        {itemid=2478}, -- brass legs
        {itemid=7618, count=3, inContainer=true} -- health potion
    },
    { -- whatever is id 6
        {itemid=1988}, -- backpack
        {itemid=2509}, -- steel shield
        {itemid=8602}, -- jagged sword
        {itemid=8601, inContainer=true}, -- steel axe
        {itemid=2439, inContainer=true}, -- daramanian mace
        {itemid=2465}, -- brass armor
        {itemid=2481}, -- soldier helmet
        {itemid=2478}, -- brass legs
        {itemid=7618, count=3, inContainer=true} -- health potion
    },
    -- etc..
}

Then you can edit the itemid's for those vocations
 
Hello! The LUA isn't working for me! The new player are spawning without nothing.
 
Hello, someone know how to rebuild script to get backpack style in something like that:

Main: Brown Backpack
-- Inside main backpack: Blue Backpack
---- Inside blue backpack: 20 blue backpacks
-------- Inside every: 20 uh runes x1 use
so at end 400 single uh runes (its just example numbers to show structure)
And other runes in same style... + tools etc
I just mean more configurable and container in container in container without getting all mess.
@J.Dre
 
If know exactly what you want to do, and you know that the player will have enough cap, you can just set-up that script directly.
Making a script that flexible in advance would be hefty to create, and nearly impossible to explain to a newbie.
 
Hey everyone,

Has anyone tested this on TFS 1.3? I’m assuming it will not work. Perhaps I’ll write a new version soon. :)
 
Hey everyone,

Has anyone tested this on TFS 1.3? I’m assuming it will not work. Perhaps I’ll write a new version soon. :)

A quick look tells me that it is not fully compatible with TFS.
 
Back
Top