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

[Help] Where do i change start eq

Tutium

Cerdito Project
Joined
Apr 11, 2009
Messages
28
Reaction score
0
Location
Sweden
Well hi people as you may know im a new member and im trying to work with my war ot. im trying to know how to change the start eq of a character. i mean if i make a character for example knight.. i want it to have like magic sword and such rare set..

and i got a new question right away so i would love to ask where do you change so the player wont lose the eq he own. i mean like a war server when he dies he lose the eq but it will get back when he start again.

Hope that you can help me guys.
Rep+ for the one who can help me!


<>~Titium~<>
 
As pitufo said, you do an if statement to check what vocation the player is.
PHP:
if isKnight(cid) == TRUE then
-- knight equipments
elseif isPaladin(cid) == TRUE then
-- paladin equipments
elseif isDruid(cid) == TRUE then
-- druid equipments
elseif isSorcerer(cid) == TRUE then
-- sorcerer equipments
end
 
Code:
local Eq = {
	knight = {2390, 2493, 2494, 2495, 2195, 2523},
	sorcerer = {2195, 2470, 2656, 2493, 8922, 8918},
	druid = {2195, 2470, 2656, 2493, 8910, 8918},
	paladin = {8851, 2493, 8888, 9777, 2195, 6529}
}

function onLogin(cid)
	if isKnight(cid) == TRUE then
		for i = 1, table.maxn(Eq.knight) do
			doPlayerAddItem(cid, Eq.knight[i], 1)
		end
	elseif isSorcerer(cid) == TRUE then
		for i = 1, table.maxn(Eq.sorcerer) do
			doPlayerAddItem(cid, Eq.sorcerer[i], 1)
		end
	elseif isDruid(cid) == TRUE then
		for i = 1, table.maxn(Eq.druid) do
			doPlayerAddItem(cid, Eq.druid[i], 1)
		end
	elseif isPaladin(cid) == TRUE then
		for i = 1, table.maxn(Eq.paladin) do
			doPlayerAddItem(cid, Eq.paladin[i], 1)
		end
	end
end
 
Code:
local Eq = {
	knight = {2390, 2493, 2494, 2495, 2195, 2523},
	sorcerer = {2195, 2470, 2656, 2493, 8922, 8918},
	druid = {2195, 2470, 2656, 2493, 8910, 8918},
	paladin = {8851, 2493, 8888, 9777, 2195, 6529}
}

function onLogin(cid)
	if isKnight(cid) == TRUE then
		for i = 1, table.maxn(Eq.knight) do
			doPlayerAddItem(cid, Eq.knight[i], 1)
		end
	elseif isSorcerer(cid) == TRUE then
		for i = 1, table.maxn(Eq.sorcerer) do
			doPlayerAddItem(cid, Eq.sorcerer[i], 1)
		end
	elseif isDruid(cid) == TRUE then
		for i = 1, table.maxn(Eq.druid) do
			doPlayerAddItem(cid, Eq.druid[i], 1)
		end
	elseif isPaladin(cid) == TRUE then
		for i = 1, table.maxn(Eq.paladin) do
			doPlayerAddItem(cid, Eq.paladin[i], 1)
		end
	end
end

where should i put that.. i mean should i put it on firstitems.lua`? my firstitems.lua looks liket his under.. but when i start the server and want to login into Accmanager it doesnt work i mean i cant even login it just kick me.. i can come in and see accmanager but not login into the server.. help maby?

local firstItems =
{
2050,
2382
}

function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems, 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end
local bag = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(bag, 2674, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end


local Eq = {
knight = {2390, 2493, 2494, 2495, 2195, 2523},
sorcerer = {2195, 2470, 2656, 2493, 8922, 8918},
druid = {2195, 2470, 2656, 2493, 8910, 8918},
paladin = {8851, 2493, 8888, 9777, 2195, 6529}
}

function onLogin(cid)
if isKnight(cid) == TRUE then
for i = 1, table.maxn(Eq.knight) do
doPlayerAddItem(cid, Eq.knight, 1)
end
elseif isSorcerer(cid) == TRUE then
for i = 1, table.maxn(Eq.sorcerer) do
doPlayerAddItem(cid, Eq.sorcerer, 1)
end
elseif isDruid(cid) == TRUE then
for i = 1, table.maxn(Eq.druid) do
doPlayerAddItem(cid, Eq.druid, 1)
end
elseif isPaladin(cid) == TRUE then
for i = 1, table.maxn(Eq.paladin) do
doPlayerAddItem(cid, Eq.paladin, 1)
end
end
end
 
Code:
<?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 = 30001,
			knight = {2480, 2464, 2530, 2398, 2468, 2643, 2120},
	                sorcerer = {2480, 2464, 2530, 2190, 2468, 2643, 2120},
	                druid = {2480, 2464, 2530, 2182, 2468, 2643, 2120},
	                paladin = {2480, 2464, 2530, 2389, 2468, 2643, 2120}
		}
	]]></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
			
			
			if isKnight(cid) == TRUE then
		for i = 1, table.maxn(config.knight) do
			doPlayerAddItem(cid, config.knight[i], 1)
		end
	elseif isSorcerer(cid) == TRUE then
		for i = 1, table.maxn(config.sorcerer) do
			doPlayerAddItem(cid, config.sorcerer[i], 1)
		end
	elseif isDruid(cid) == TRUE then
		for i = 1, table.maxn(config.druid) do
			doPlayerAddItem(cid, config.druid[i], 1)
		end
	elseif isPaladin(cid) == TRUE then
		for i = 1, table.maxn(config.paladin) do
			doPlayerAddItem(cid, config.paladin[i], 1)
		end
	end


    doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2554, 1)
			setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>
 
Back
Top