Ir para conteúdo

Featured Replies

Postado

Saudações Tibianos!

 

Atualmente, venho desenvolvendo um OTServer. Problema que ele é um RLMAP, ou seja, contem Rookguard, e o char inicialmente nasce em Rook. só que ele nasce no templo sem nenhum item, só que normalmente deveria nascer com. Gostaria de abrir um servidor sem fins-lucrativos. (nem donate), problema que estou impacado nisso. (Sim é simples, mas está ruim de resolver isso.)

 

Existe um item na minha pasta 'mods' em meu OT chamado 'firstitems.xml' e contem o seguinte código:

<?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,
			items = {2050, 2382}
		}
	]]></config>
<event type="login" name="FirstItems" event="script">
<![CDATA[ 
		domodlib('firstitems_config')

		function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1)
                        doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2190, 1)
                  doPlayerAddItem(cid, 2789, 10)
                  doPlayerAddItem(cid, 2200, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 7457, 1)

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1)
                        doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2182, 1)
                  doPlayerAddItem(cid, 2789, 10)
                  doPlayerAddItem(cid, 2200, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 7457, 1)

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1)
                        doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
		
			doPlayerAddItem(cid, 2525, 1)
			doPlayerAddItem(cid, 2389, 1)
                  doPlayerAddItem(cid, 2789, 10)
                  doPlayerAddItem(cid, 2200, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 7457, 1)

			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1)
                        doAddContainerItem(bag, 2554, 1)
			doAddContainerItem(bag, 2152, 20)
			doAddContainerItem(bag, 8602, 1)
                        doAddContainerItem(bag, 2439, 1)
		
			doPlayerAddItem(cid, 2525, 1)
                        doPlayerAddItem(cid, 2789, 10)
                        doPlayerAddItem(cid, 2200, 1)
                        doPlayerAddItem(cid, 8601, 1)
			doPlayerAddItem(cid, 2463, 1)
			doPlayerAddItem(cid, 2457, 1)
			doPlayerAddItem(cid, 2647, 1)
			doPlayerAddItem(cid, 7457, 1)

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end
	

  ]]> 
  </event>
  </mod>

Mas infelizmente, parece que esse arquivo é ignorado ou não carrega. Simplesmente, mesmo com esse arquivo na pasta mods do OT, e o código correto simplesmente o char após a criação no site, nasce no templo sem nenhum item.

 

Obrigado pela atenção.

 

Postado

Este 'mod' geralmente não funciona por estar utilizando o 'storage' 50000. Cheque se ele está, ou não, sendo utilizado.

 

Caso, contrário, se estiver utilizando 0.2, crie um arquivo 'firstitems.lua', salve-o dentro da pasta: 'data > creaturescripts > scripts' e cole isto dentro:

Spoiler

function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coints
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2190, 1) -- wand of wortex
			doPlayerAddItem(cid, 8819, 1) -- magician's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2182, 1) -- snakebite rod
			doPlayerAddItem(cid, 8819, 1) -- magican's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2389, 1) -- spear
                        doPlayerAddItem(cid, 2456, 1) -- bow
			doPlayerAddItem(cid, 2544, 100) -- 100 arrows
			doPlayerAddItem(cid, 2660, 1) -- hidden turban
			doPlayerAddItem(cid, 2480, 1) -- legion helmet
			doPlayerAddItem(cid, 8923, 1) -- ranger legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
		
			doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2465, 1) -- brass armor
			doPlayerAddItem(cid, 2481, 1) -- soldier helmet
			doPlayerAddItem(cid, 2478, 1) -- brass legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end

 

 

Depois vá no arquivo: data > creaturescripts > creaturescripts.xml e insira esta linha|:

<event type="login" name="FirstItems" script="firstitems.lua"/>

 

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Postado
  • Autor

Mas amigão, o problema é que no meu OTserver, o char começa em rookguard, ele não tem vocação, ele vem nú, sem nenhum item, por exemplo; gostaria de colocar para todo player começar com um leather set e uma backpack.

 

Postado

Hmm. Então era só criar mais um com isRookie(cid). Tá aí:

Spoiler

function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coints
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2190, 1) -- wand of wortex
			doPlayerAddItem(cid, 8819, 1) -- magician's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2182, 1) -- snakebite rod
			doPlayerAddItem(cid, 8819, 1) -- magican's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
		
			doPlayerAddItem(cid, 2389, 1) -- spear
                        doPlayerAddItem(cid, 2456, 1) -- bow
			doPlayerAddItem(cid, 2544, 100) -- 100 arrows
			doPlayerAddItem(cid, 2660, 1) -- hidden turban
			doPlayerAddItem(cid, 2480, 1) -- legion helmet
			doPlayerAddItem(cid, 8923, 1) -- ranger legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
		
			doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2465, 1) -- brass armor
			doPlayerAddItem(cid, 2481, 1) -- soldier helmet
			doPlayerAddItem(cid, 2478, 1) -- brass legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)		
			
		elseif isRookie(cid)(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
		
			doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2465, 1) -- brass armor
			doPlayerAddItem(cid, 2481, 1) -- soldier helmet
			doPlayerAddItem(cid, 2478, 1) -- brass legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddItem(cid, 2173, 1) -- amulet of loss
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: [B]Chronic Elements[/B]

			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end

 

 

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo