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

[CreatureScript] [Request] Onlogin addSkills and Eq

PharaPL

Learning Lua
Joined
Oct 12, 2008
Messages
43
Reaction score
0
Location
Poland
Im need help...
Im want to make War Server with Priv Acc for everybody, and im have trouble with Skills and Equipment for first login...

It should looks like that:
-- If isPriest
- addskills
- addeq
-- If isKnight
- addskills
- addeq


Im dont need all script for all prof. Only example please!
 
For skills and magic, you'll have to edit them in the SQL database. It may be possible to do in LUA, but I'm not sure how.

For equipment, you can do it this way:

login.lua
PHP:
function addContainerWithItems(cid, container, item, item_count, count)
local Container = doPlayerAddItem(cid, container, 1)
for i = 1, count do
    doAddContainerItem(Container, item, item_count)
end
end

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
			doPlayerSetLossPercent(cid, i, loss)
		end
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "PlayerDeath")
	
		if getPlayerGroupId(cid) < 2 then

		if isSorcerer(cid) then
				
		doPlayerAddItem(cid, 8918, 1)
		doPlayerAddItem(cid, 8922, 1)
		local rand = math.random(1,4)
		if rand == 1 then
				doPlayerAddItem(cid, 8867, 1)
				elseif rand == 2 then
				doPlayerAddItem(cid, 8868, 1)
				elseif rand == 3 then
				doPlayerAddItem(cid, 8890, 1)
end
		doPlayerAddItem(cid, 9778, 1)
		doPlayerAddItem(cid, 7730, 1)
		doPlayerAddItem(cid, 6132, 1)
		doPlayerAddItem(cid, 2169, 1)
		doPlayerAddItem(cid, 2195, 1)
		doPlayerAddItem(cid, 2171, 1)
		
			local bag = doPlayerAddItem(cid, 2365, 1)
			addContainerWithItems(cid, 2004, 2293, 3, 20)
			addContainerWithItems(cid, 2001, 7590, 1, 20)
			addContainerWithItems(cid, 2002, 2274, 4, 20)
			addContainerWithItems(cid, 1999, 2278, 1, 20)
			
		local bag2 = doAddContainerItem(bag, 3939, 1)
		doAddContainerItem(bag2, 2286, 2)
		doAddContainerItem(bag2, 2305, 2)
		doAddContainerItem(bag2, 2262, 2)
		doAddContainerItem(bag2, 2208, 1)
		doAddContainerItem(bag2, 2165, 1)
		doAddContainerItem(bag2, 2167, 1)
		doAddContainerItem(bag2, 2214, 1)
		doAddContainerItem(bag2, 2168, 1)
		doAddContainerItem(bag2, 2169, 1)
		
		addContainerWithItems(cid, 2002, 2273, 1, 20)
		addContainerWithItems(cid, 2003, 2268, 3, 20)
		addContainerWithItems(cid, 2003, 2261, 3, 20)
		addContainerWithItems(cid, 2000, 2304, 4, 20)
		addContainerWithItems(cid, 2001, 2311, 10, 20)
		addContainerWithItems(cid, 2001, 2313, 6, 20)

		

		elseif isDruid(cid) then
local bag = doPlayerAddItem(cid, 2365, 1)
	doPlayerAddItem(cid, 8918, 1)
		doPlayerAddItem(cid, 8910, 1)
		local rand = math.random(1,2)
		if rand == 1 then
				doPlayerAddItem(cid, 8866, 1)
				elseif rand == 2 then
				doPlayerAddItem(cid, 8869, 1)
end
		doPlayerAddItem(cid, 9778, 1)
		doPlayerAddItem(cid, 7730, 1)
		doPlayerAddItem(cid, 6132, 1)
		doPlayerAddItem(cid, 2169, 1)
		doPlayerAddItem(cid, 2195, 1)
		doPlayerAddItem(cid, 2171, 1)
		
			addContainerWithItems(cid, 2004, 2293, 3, 20)
			addContainerWithItems(cid, 2001, 7590, 1, 20)
			addContainerWithItems(cid, 2002, 2274, 4, 20)
			addContainerWithItems(cid, 1999, 2278, 1, 20)
			
		local bag2 = doAddContainerItem(bag, 3939, 1)
		doAddContainerItem(bag2, 2286, 2)
		doAddContainerItem(bag2, 2305, 2)
		doAddContainerItem(bag2, 2262, 2)
		doAddContainerItem(bag2, 2208, 1)
		doAddContainerItem(bag2, 2165, 1)
		doAddContainerItem(bag2, 2167, 1)
		doAddContainerItem(bag2, 2214, 1)
		doAddContainerItem(bag2, 2168, 1)
		doAddContainerItem(bag2, 2169, 1)
		
		addContainerWithItems(cid, 2002, 2273, 1, 20)
		addContainerWithItems(cid, 2003, 2268, 3, 20)
		addContainerWithItems(cid, 2003, 2261, 3, 20)
		addContainerWithItems(cid, 2000, 2304, 4, 20)
		addContainerWithItems(cid, 2001, 2311, 10, 20)
		addContainerWithItems(cid, 2001, 2313, 6, 20)
		
	
		elseif isPaladin(cid) then
				doPlayerAddItem(cid, 2520, 1)
		doPlayerAddItem(cid, 7368, 100)
		local rand = math.random(1,4)
		if rand == 1 then
				doPlayerAddItem(cid, 8885, 1)
				elseif rand == 2 then
				doPlayerAddItem(cid, 8886, 1)
				elseif rand == 3 then
				doPlayerAddItem(cid, 8887, 1)
				elseif rand == 4 then
				doPlayerAddItem(cid, 8888, 1)
				end
		doPlayerAddItem(cid, 2498, 1)
		doPlayerAddItem(cid, 9777, 1)
		doPlayerAddItem(cid, 6132, 1)
		doPlayerAddItem(cid, 2169, 1)
		doPlayerAddItem(cid, 2195, 1)
		doPlayerAddItem(cid, 2171, 1)
		
local bag = doPlayerAddItem(cid, 2365, 1)
			addContainerWithItems(cid, 2004, 2293, 3, 20)
			addContainerWithItems(cid, 1988, 8472, 1, 20)
			addContainerWithItems(cid, 2002, 2274, 4, 20)
			addContainerWithItems(cid, 1999, 2278, 1, 20)
			
		local bag2 = doAddContainerItem(bag, 3939, 1)
		doAddContainerItem(bag2, 2286, 2)
		doAddContainerItem(bag2, 2305, 2)
		doAddContainerItem(bag2, 2262, 2)
		doAddContainerItem(bag2, 2208, 1)
		doAddContainerItem(bag2, 2165, 1)
		doAddContainerItem(bag2, 2167, 1)
		doAddContainerItem(bag2, 2214, 1)
		doAddContainerItem(bag2, 2168, 1)
		doAddContainerItem(bag2, 2169, 1)
		
		addContainerWithItems(cid, 2002, 2273, 1, 20)
		addContainerWithItems(cid, 2003, 2268, 3, 20)
		addContainerWithItems(cid, 2003, 2261, 3, 20)
		addContainerWithItems(cid, 2000, 2304, 4, 20)
		addContainerWithItems(cid, 2001, 2311, 10, 20)
		addContainerWithItems(cid, 2001, 2313, 6, 20)
		

		elseif isKnight(cid) then
				local rand = math.random(1,4)
				if rand == 1 then
				doPlayerAddItem(cid, 8906, 1)
				elseif rand == 2 then
				doPlayerAddItem(cid, 8907, 1)
				elseif rand == 3 then
				doPlayerAddItem(cid, 8908, 1)
				elseif rand == 4 then
				doPlayerAddItem(cid, 8909, 1)
				end
		doPlayerAddItem(cid, 8924, 1)
		local rand = math.random(1,5)
				if rand == 1 then
				doPlayerAddItem(cid, 8881, 1)
				elseif rand == 2 then
				doPlayerAddItem(cid, 8882, 1)
				elseif rand == 3 then
				doPlayerAddItem(cid, 8883, 1)
				elseif rand == 4 then
				doPlayerAddItem(cid, 8884, 1)
				elseif rand == 5 then
				doPlayerAddItem(cid, 2472, 1)
				end
		doPlayerAddItem(cid, 2493, 1)
		doPlayerAddItem(cid, 2470, 1)
		doPlayerAddItem(cid, 6132, 1)
		doPlayerAddItem(cid, 2169, 1)
		doPlayerAddItem(cid, 2195, 1)
		doPlayerAddItem(cid, 2171, 1)
		
local bag = doPlayerAddItem(cid, 2365, 1)
			addContainerWithItems(cid, 2000, 8473, 1, 20)
			addContainerWithItems(cid, 2001, 7620, 1, 20)
			addContainerWithItems(cid, 2002, 2274, 4, 20)
			
		local bag2 = doAddContainerItem(bag, 3939, 1)
		doAddContainerItem(bag2, 2286, 2)
		doAddContainerItem(bag2, 2305, 2)
		doAddContainerItem(bag2, 2262, 2)
		doAddContainerItem(bag2, 2208, 1)
		doAddContainerItem(bag2, 2165, 1)
		doAddContainerItem(bag2, 2167, 1)
		doAddContainerItem(bag2, 2214, 1)
		doAddContainerItem(bag2, 2168, 1)
		doAddContainerItem(bag2, 2169, 1)
		
		addContainerWithItems(cid, 2002, 2273, 1, 20)
		addContainerWithItems(cid, 2003, 2261, 3, 20)
		addContainerWithItems(cid, 2000, 2304, 4, 20)
		addContainerWithItems(cid, 2001, 2311, 10, 20)
		addContainerWithItems(cid, 2001, 2313, 6, 20)
		
		end
		
	end
	return TRUE
end
 
Hah...
Im solved it with Eq, and better than you i think :p

Here's my code:
Code:
function onLogin(cid)
	local playerVoc = getPlayerVocation(cid)
	local bag = doPlayerAddItem(cid, 2365, 1)
		if playerVoc == 1 or playerVoc == 2 or playerVoc == 3 then
		firstItems =
		{
			8918, -- Shield (Book)
			8922, -- Weapon (Wand of voodoo)
			2196, -- Amulet (Broken)
			6132, -- Boots (Soft boots)
			9778, -- Helmet (Yalahar)
			8871, -- Armor (Focus cape)
			7730, -- Legs (Blue legs)
			2120, -- Ammo (Rope)
			2206, -- Ring (Time)
		}
		doAddContainerItem(bag, 2672, 5) -- Dragon ham
		doAddContainerItem(bag, 7618, 1) -- HP
		doAddContainerItem(bag, 7590, 1) -- gMP

		doAddContainerItem(bag, 2268, 1) -- SD
		doAddContainerItem(bag, 2308, 1) -- Flam
		doAddContainerItem(bag, 2295, 1) -- Holy

		doAddContainerItem(bag, 2305, 1) -- FBomb
		doAddContainerItem(bag, 2269, 1) -- NWall
		doAddContainerItem(bag, 2293, 1) -- MWall
		doAddContainerItem(bag, 2261, 1) -- DField
		doAddContainerItem(bag, 2278, 1) -- Paralyze

		elseif playerVoc == 4 or playerVoc == 5 then
		firstItems =
		{
			2514, -- Shield (Mastermind shield)
			8925, -- Weapon (Solar axe)
			2196, -- Amulet (Broken)
			6132, -- Boots (Soft boots)
			2471, -- Helmet (Golden helmet)
			2472, -- Armor (Magic plate armor)
			2470, -- Legs (Golden legs)
			2120, -- Ammo (Rope)
			2206, -- Ring (Time)
		}
		doAddContainerItem(bag, 2672, 5) -- Dragon ham
		doAddContainerItem(bag, 7620, 1) -- MP
		doAddContainerItem(bag, 7589, 1) -- sMP
		doAddContainerItem(bag, 7591, 1) -- gHP
		doAddContainerItem(bag, 8473, 1) -- uHP

		doAddContainerItem(bag, 2305, 1) -- FBomb
		doAddContainerItem(bag, 2269, 1) -- NWall
		doAddContainerItem(bag, 2293, 1) -- MWall
		doAddContainerItem(bag, 2261, 1) -- DField
		doAddContainerItem(bag, 2278, 1) -- Paralyze

		elseif playerVoc == 6 then
		firstItems =
		{
			8852, -- Weapon (Devileye)
			2196, -- Amulet (Broken)
			6132, -- Boots (Soft boots)
			2498, -- Helmet (Royal helmet)
			8888, -- Armor (Master archer armor)
			9777, -- Legs (Yalahar legs)
			2120, -- Ammo (Rope)
			2206, -- Ring (Time)
		}
		doAddContainerItem(bag, 2672, 5) -- Dragon ham
		doAddContainerItem(bag, 6529, 5) -- Infernal bolt
		doAddContainerItem(bag, 7589, 1) -- sMP
		doAddContainerItem(bag, 7588, 1) -- sHP
		doAddContainerItem(bag, 8472, 1) -- gSP

		doAddContainerItem(bag, 2295, 1) -- Holy

		doAddContainerItem(bag, 2305, 1) -- FBomb
		doAddContainerItem(bag, 2269, 1) -- NWall
		doAddContainerItem(bag, 2293, 1) -- MWall
		doAddContainerItem(bag, 2261, 1) -- DField
		doAddContainerItem(bag, 2278, 1) -- Paralyze

	end

	if getPlayerStorageValue(cid, 30001) == -1 then
		for i = 1, table.maxn(firstItems) do
			doPlayerAddItem(cid, firstItems[i], 1)
			setPlayerStorageValue(cid, 30001, 1)
		end
	end
 	return TRUE
end

Im know now how to add skills, but when im add it after login it shows many messages about skill advancing ;/
That will be annoying, when always after login it will be shown :(
Ehh...

Still need help, coz Gesior's Acc does'nt adding skills from samples to new char.
 
Back
Top