Ir para conteúdo
  • Cadastre-se

[Resolvido] Problema com FirstItems


Posts Recomendados

Galera, eu troquei meu distro de realserver 3.0 (compilado para windows) e compilei um TFS 0.4_DEV para linux.

Praticamente TUDO do realserver funcionou perfeitamente no TFS, porém o firstitem.lua de creaturescripts não, os chars criados estão começando sem item nenhum, apenas uma backpack.

Meu server é de war, então tenho que dividir os items por creaturescripts.

Por favor, preciso saber o que está dando errado.

/creaturescripts/creaturescripts.xml

<?xml version="1.0" encoding="UTF-8"?>

<creaturescripts>

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

<event type="login" name="fraglook_register" event="script" value="fraglook.lua"/>

<event type="look" name="fraglook" event="script" value="fraglook.lua"/>

<event type="login" name="SlotLogin" script="slot.lua"/>

<event type="login" name="AntiMultiClient" event="script" value="antimc.lua"/>

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

<event type="login" name="StartSkills" event="script" value="startskills.lua"/>

<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>

<event type="kill" name="FragReward" event="script" value="onkill.lua"/>

			 <event type="death" name="DeathBroadcast" event="script" value="deathBroadcast.lua"/>

<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>

<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

</creaturescripts>

/creaturescripts/scripts/firstitems.lua
 local commonItems = {

-- ITEMS ALL VOCS RECEIVE

{itemid=2120, count=1}, -- rope

{itemid=2420, count=1}, -- machete

{itemid=2789, count=100}, -- brown mushrooms

{itemid=2305, count=1}, -- fire bomb rune

{itemid=2261, count=1}, -- destroy field rune

}


local firstItems = {

{ -- SORC ITEMS

{itemid=2323, count=1}, -- hat of the mad

{itemid=8871, count=1}, -- focus cape

{itemid=7730, count=1}, -- blue legs

{itemid=2195, count=1}, -- boots of haste

{itemid=8902, count=1}, -- spellbook of mind control

{itemid=2187, count=1}, -- wand of inferno


{itemid=2268, count=1}, -- sd

{itemid=2273, count=1}, -- uh

{itemid=7590, count=1}, -- gmp

{itemid=2293, count=1}, -- mw

},

{ -- DRUID ITEMS

{itemid=2323, count=1}, -- hat of the mad

{itemid=8871, count=1}, -- focus cape

{itemid=7730, count=1}, -- blue legs

{itemid=2195, count=1}, -- boots of haste

{itemid=8902, count=1}, -- spellbook of mind control

{itemid=2183, count=1}, -- hailstorm rod


{itemid=2268, count=1}, -- sd

{itemid=2273, count=1}, -- uh

{itemid=7590, count=1}, -- gmp

{itemid=2293, count=1}, -- mw

{itemid=2269, count=1}, -- wg

{itemid=2278, count=1}, -- para

},

{ -- PALADIN ITEMS

{itemid=2493, count=1}, -- demon helmet

{itemid=8891, count=1}, -- paladin armor

{itemid=7730, count=1}, -- blue legs

{itemid=2195, count=1}, -- boots of haste

{itemid=2514, count=1}, -- mastermind shield

{itemid=7368, count=10}, -- assassin stars


{itemid=2268, count=1}, -- sd

{itemid=2273, count=1}, -- uh

{itemid=8472, count=1}, -- gsp

{itemid=7589, count=1}, -- smp

{itemid=7588, count=1}, -- shp

{itemid=2293, count=1}, -- mw

},

{ -- KNIGHT ITEMS

{itemid=2493, count=1}, -- demon helmet

{itemid=2472, count=1}, -- magic plate armor

{itemid=2470, count=1}, -- golden legs

{itemid=2195, count=1}, -- boots of haste

{itemid=2514, count=1}, -- mastermind shield

{itemid=2400, count=1}, -- magic sword

{itemid=2431, count=1}, -- Stonecutter Axe

{itemid=8927, count=1}, -- dark trinity mace


{itemid=7620, count=1}, -- mp

{itemid=8473, count=1}, -- uhp

{itemid=2313, count=1}, -- explosion

{itemid=2293, count=1}, -- mw

}

}


for _, items in ipairs(firstItems) do

for _, item in ipairs(commonItems) do

table.insert(items, item)

end

end


function onLogin(cid)

if getPlayerGroupId(cid) < 2 then

local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708)


if hasReceivedFirstItems == -1 then

	 --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1)


	 local giveItems = firstItems[getPlayerVocation(cid)]


	 if giveItems ~= nil then

	 for _, v in ipairs(giveItems) do

		 --doAddContainerItem(backpack, v.itemid, v.count or 1)

		 doPlayerAddItem(cid, v.itemid, v.count or 1)

	 end


	 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce Recebeu seus equipamentos")

	 setPlayerStorageValue(cid, 67708, 1)

	 end

end

end

return TRUE

end 
/creaturescripts/scripts/login.lua
local config = {

loginMessage = getConfigValue('loginMessage'),

useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))

}


function onLogin(cid)

local loss = getConfigValue('deathLostPercent')

if(loss ~= nil) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)

doPlayerAddBlessing(cid, 1)

doPlayerAddBlessing(cid, 2)

doPlayerAddBlessing(cid, 3)

doPlayerAddBlessing(cid, 4)

doPlayerAddBlessing(cid, 5)

doPlayerAddPremiumDays(cid, 2)

doPlayerSetPromotionLevel(cid, 1)

end


local accountManager = getPlayerAccountManager(cid)

if(accountManager == MANAGER_NONE) then

local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage

if(lastLogin > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."

else

str = str .. " Please choose your outfit."

doPlayerSendOutfitWindow(cid)

end


doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

elseif(accountManager == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(accountManager == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")

end


if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end


	 registerCreatureEvent(cid, "kill")

	 registerCreatureEvent(cid, "onPrepareDeath")

	 registerCreatureEvent(cid, "PlayerLogout")

	 registerCreatureEvent(cid, "onPrepareDeath")

	 registerCreatureEvent(cid, "deathBroadcast")

	 registerCreatureEvent(cid, "DeathBroadcast")


registerCreatureEvent(cid, "Idle")

if(config.useFragHandler) then

registerCreatureEvent(cid, "SkullCheck")

end


registerCreatureEvent(cid, "ReportBug")

return true

end

Editado por sonanuca (veja o histórico de edições)

assinatura.jpg

sonanucafan.jpg

Link para o post
Compartilhar em outros sites
  • Respostas 6
  • Created
  • Última resposta

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Posts

Sonanuca então eu não sei ao certo mais tenta esse firstitems aqui PS: Não troquei os itens para testar se funfa, caso funcione so colocar as ids desejadas

Sonanuca então eu não sei ao certo mais tenta esse firstitems aqui

function onLogin(cid)

if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then

if isSorcerer(cid) then

local bag = doPlayerAddItem(cid, 9774, 1)


doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2152, 20)


doPlayerAddItem(cid, 2525, 1)

doPlayerAddItem(cid, 8911, 1)

doPlayerAddItem(cid, 2463, 1)

doPlayerAddItem(cid, 2457, 1)

doPlayerAddItem(cid, 2647, 1)

doPlayerAddItem(cid, 2643, 1)

doPlayerAddItem(cid, 2173, 1)

setPlayerStorageValue(cid, 50000, 1)


elseif isDruid(cid) then

local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2152, 20)


doPlayerAddItem(cid, 2525, 1)

doPlayerAddItem(cid, 8911, 1)

doPlayerAddItem(cid, 2463, 1)

doPlayerAddItem(cid, 2457, 1)

doPlayerAddItem(cid, 2647, 1)

doPlayerAddItem(cid, 2643, 1)

doPlayerAddItem(cid, 2173, 1)

setPlayerStorageValue(cid, 50000, 1)


elseif isPaladin(cid) then

local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2152, 20)


doPlayerAddItem(cid, 2389, 3)

doPlayerAddItem(cid, 2525, 1)

doPlayerAddItem(cid, 2457, 1)

doPlayerAddItem(cid, 2643, 1)

doPlayerAddItem(cid, 2647, 1)

doPlayerAddItem(cid, 2463, 1)

doPlayerAddItem(cid, 2173, 1)

setPlayerStorageValue(cid, 50000, 1)


elseif isKnight(cid) then

local bag = doPlayerAddItem(cid, 9774, 1)

doAddContainerItem(bag, 2120, 1)

doAddContainerItem(bag, 2554, 1)

doAddContainerItem(bag, 2152, 20)

doAddContainerItem(bag, 8601, 1)

doAddContainerItem(bag, 2383, 1)




doPlayerAddItem(cid, 2525, 1)

doPlayerAddItem(cid, 2463, 1)

doPlayerAddItem(cid, 2457, 1)

doPlayerAddItem(cid, 2647, 1)

doPlayerAddItem(cid, 2643, 1)

doPlayerAddItem(cid, 2173, 1)

setPlayerStorageValue(cid, 50000, 1)

end

end

return TRUE

end

PS: Não troquei os itens para testar se funfa, caso funcione so colocar as ids desejadas

Editado por WalaceBz (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96844
    Tópicos
    519608
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo