Ir para conteúdo

[Encerrado] Problema Com Firstitems


goesraphael1

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 RaphaelGoes
Link para o comentário
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...