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

First items in 3.6.0pl1

Samuro

GameDev
Joined
Aug 7, 2007
Messages
1,845
Reaction score
571
Location
Sweden
I wanna change the items depending on what vocation you wanna start with.
I found the firstitems.xml


Then what?
rep++ to anyone who helps
 
put this on mods folder
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
    <config name="firstitems_config"><![CDATA[
        config = {
            storage = 11554,
            items = {2554, 2120} -- what all vocations get
        }
    ]]></config>
    <event type="login" name="FirstItems" event="script"><![CDATA[
        domodlib('firstitems_config')

        function onLogin(cid)
            if(getPlayerStorageValue(cid, config.storage) > 0) then
                return true
            end

            doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
           
            for _, id in ipairs(config.items) do
                doPlayerAddItem(cid, id, 1)
            end
           
            if (getPlayerVocation(cid) == 1) then
				doPlayerAddItem(cid, 2190)	
                doPlayerAddItem(cid, 2175)				
				doPlayerAddItem(cid, 8819, 1)				
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2661, 1) 
				doPlayerAddItem(cid, 2643, 1) 
				doPlayerAddItem(cid, 8820, 1)							
				doPlayerAddItem(cid, 2160, 2)	
            elseif (getPlayerVocation(cid) == 2) then
				doPlayerAddItem(cid, 2182)	
                doPlayerAddItem(cid, 2175)				
				doPlayerAddItem(cid, 8819, 1)				
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2661, 1) 
				doPlayerAddItem(cid, 2643, 1) 
				doPlayerAddItem(cid, 8820, 1)							
				doPlayerAddItem(cid, 2160, 2)							
            elseif (getPlayerVocation(cid) == 3) then
				doPlayerAddItem(cid, 2509)				
				doPlayerAddItem(cid, 2389, 1)
				doPlayerAddItem(cid, 2480, 1)
				doPlayerAddItem(cid, 8923, 1)
				doPlayerAddItem(cid, 2661, 1)
				doPlayerAddItem(cid, 2643, 1)
				doPlayerAddItem(cid, 2660, 1)	
				doPlayerAddItem(cid, 2160, 2)											
            elseif (getPlayerVocation(cid) == 4) then	
				doPlayerAddItem(cid, 8602)				
                doPlayerAddItem(cid, 2439)
				doPlayerAddItem(cid, 8601, 1)
                doPlayerAddItem(cid, 2509)
				doPlayerAddItem(cid, 2481)
				doPlayerAddItem(cid, 2465, 1)
				doPlayerAddItem(cid, 2478, 1)
				doPlayerAddItem(cid, 2643, 1)
				doPlayerAddItem(cid, 2661, 1)
				doPlayerAddItem(cid, 2160, 2)						
            end
           
            setPlayerStorageValue(cid, config.storage, 1)
           
            setPlayerStorageValue(cid, 19732, 100)
            return true
        end
    ]]></event>
</mod>
 
put this on mods folder
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
    <config name="firstitems_config"><![CDATA[
        config = {
            storage = 11554,
            items = {2554, 2120} -- what all vocations get
        }
    ]]></config>
    <event type="login" name="FirstItems" event="script"><![CDATA[
        domodlib('firstitems_config')

        function onLogin(cid)
            if(getPlayerStorageValue(cid, config.storage) > 0) then
                return true
            end

            doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2789, 10)
           
            for _, id in ipairs(config.items) do
                doPlayerAddItem(cid, id, 1)
            end
           
            if (getPlayerVocation(cid) == 1) then
				doPlayerAddItem(cid, 2190)	
                doPlayerAddItem(cid, 2175)				
				doPlayerAddItem(cid, 8819, 1)				
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2661, 1) 
				doPlayerAddItem(cid, 2643, 1) 
				doPlayerAddItem(cid, 8820, 1)							
				doPlayerAddItem(cid, 2160, 2)	
            elseif (getPlayerVocation(cid) == 2) then
				doPlayerAddItem(cid, 2182)	
                doPlayerAddItem(cid, 2175)				
				doPlayerAddItem(cid, 8819, 1)				
				doPlayerAddItem(cid, 2468, 1)
				doPlayerAddItem(cid, 2661, 1) 
				doPlayerAddItem(cid, 2643, 1) 
				doPlayerAddItem(cid, 8820, 1)							
				doPlayerAddItem(cid, 2160, 2)							
            elseif (getPlayerVocation(cid) == 3) then
				doPlayerAddItem(cid, 2509)				
				doPlayerAddItem(cid, 2389, 1)
				doPlayerAddItem(cid, 2480, 1)
				doPlayerAddItem(cid, 8923, 1)
				doPlayerAddItem(cid, 2661, 1)
				doPlayerAddItem(cid, 2643, 1)
				doPlayerAddItem(cid, 2660, 1)	
				doPlayerAddItem(cid, 2160, 2)											
            elseif (getPlayerVocation(cid) == 4) then	
				doPlayerAddItem(cid, 8602)				
                doPlayerAddItem(cid, 2439)
				doPlayerAddItem(cid, 8601, 1)
                doPlayerAddItem(cid, 2509)
				doPlayerAddItem(cid, 2481)
				doPlayerAddItem(cid, 2465, 1)
				doPlayerAddItem(cid, 2478, 1)
				doPlayerAddItem(cid, 2643, 1)
				doPlayerAddItem(cid, 2661, 1)
				doPlayerAddItem(cid, 2160, 2)						
            end
           
            setPlayerStorageValue(cid, config.storage, 1)
           
            setPlayerStorageValue(cid, 19732, 100)
            return true
        end
    ]]></event>
</mod>

Thanks man, the script worked!
 
Samples should not have items @ DB then, so they don't get extra items
 
Back
Top