Ir para conteúdo

Featured Replies

Postado

consegui tirar todos os erros do tfs mas sobrou esse, eu acredito que o problema seja no lucky ou experience (por conterem a função q acusa erro na distro)

[25/02/2018 16:46:51] [Error - CreatureScript Interface]
[25/02/2018 16:46:51] data/creaturescripts/scripts/player/pokeDeath.lua:matou
[25/02/2018 16:46:51] Description:
[25/02/2018 16:46:51] (luaGetPlayerSlotItem) Player not found

 

a parte que tem isso:

 

function doCorpseAddLoot(name, item, cid, target) -- essa func jรก vai ajudar em um held, luck.
if cid == target then 
doItemSetAttribute(item, "corpseowner", "asçdlkasçldkaçslkdçaskdçaslkdçlsakdçkaslç")
return true 
end -- selfdestruct
local lootList = getMonsterLootList(name)
local isStoneDroped = false
name = doCorrectString(name)
local pokeName = name
local str, vir = "Loot from " .. name .. ": ", 0
local megaID, megaName = "", ""
local lootListNow = {}
	if isMega(target) then
		  if name == "Charizard" then
			 megaID = getPlayerStorageValue(target, storages.isMegaID)
		  end
		megaName = "Mega " .. name .. (megaID ~= "" and " " .. megaID or "")
	    str = "Loot from " .. megaName .. ": "
	    pokeName = megaName
	    local t = {id = megasConf[megaName].itemToDrop, count = 1, chance = 0.1}
	     table.insert(lootList, t)
	end
    local countVirg = 0
	for i, _ in pairs(lootList) do
	    countVirg = countVirg + 1
	    local id, count, chance = lootList[i].id, lootList[i].count, lootList[i].chance * 1
		local tienelucky =0
		local MaxChanceLucky=0
		---- X-Lucky
		local heldx = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "xHeldItem")
			if heldx then
			local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
				  if heldName == "X-Lucky" then -- dar mais loot
					tienelucky=1
					 MaxChanceLucky =  heldLucky[tonumber(heldTier)]
				  end
			end
		---- X-Lucky
		

		local percent, lootCount = math.random(0.1, 100.9), math.random(1, count)
		
		if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then
		 if  getPlayerStorageValue(cid, 123456) == 1 then
		percent = math.random(0.1, 10000.9)
		else
		 percent = math.random(0.1, 9000.9)
		 end
	end
		if (percent <= chance) then
			if isStone(id) then
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     posCorpse.x = posCorpse.x +1
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			if  id == 15644 then ----mighty token
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			posCorpse.x = posCorpse.x +1
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			
			if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then  -----mega stone
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				posCorpse.x = posCorpse.x +2
			   posCorpse.y = posCorpse.y +2  
			   doSendMagicEffect(posCorpse, 391)
				doBroadcastMessage(""..getCreatureName(cid).." got a "..getItemNameById(id)..".")
			posCorpse.x = posCorpse.x -1
			   posCorpse.y = posCorpse.y -1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
		     doAddContainerItem(item, id, lootCount)
			 table.insert(lootListNow, getItemNameById(id) .. " (" .. lootCount .. ")")
			 else -- ENTRA EL LUCKY AQUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
			 if tienelucky == 1 then
			 percent = math.random(0.1, MaxChanceLucky)
			 if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then
		 if  getPlayerStorageValue(cid, 123456) == 1 then
		percent = math.random(0.1, 100000.9)
		else
		 percent = math.random(0.1, 90000.9)
		 end
	end
		if (percent <= chance) then
			if isStone(id) then
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     posCorpse.x = posCorpse.x +1
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			if  id == 15644 then ----mighty token
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				     
			   doSendMagicEffect(posCorpse, stoneEffect[getItemNameById(id):lower()])
			posCorpse.x = posCorpse.x +1
			   posCorpse.y = posCorpse.y +1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
			
			if  id == 15133 or id == 15131 or id == 15134 or id == 15135 or id == 15136 or id == 15780 or id == 15781 or id == 15782 or id == 15783 or id == 15784 or id == 15785 or id == 15786 or id == 15787 or id == 15788 or id == 15789 or id == 15790 or id == 15791 or id == 15792 or id == 15793 or id == 15794 or id == 15177 or id == 15179 then  -----mega stone
			   isStoneDroped = true
			   local posCorpse = getThingPos(item)
				posCorpse.x = posCorpse.x +2
			   posCorpse.y = posCorpse.y +2  
			   doSendMagicEffect(posCorpse, 391)
				doBroadcastMessage(""..getCreatureName(cid).." got a "..getItemNameById(id).."!!")
			posCorpse.x = posCorpse.x -1
			   posCorpse.y = posCorpse.y -1
			   addEvent(doSendMagicEffect, 2000, posCorpse, 285)
			end
		     doAddContainerItem(item, id, lootCount)
			 table.insert(lootListNow, getItemNameById(id) .. " (" .. lootCount .. ")[>LUCKY<]")
			 end
			 -- SAÑE EL LUCKY AQUI <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		end
	end
	end
	for i = 1, #lootListNow do
		str = str .. lootListNow[i] .. (tonumber(i) == tonumber(#lootListNow) and "." or ", ")
	end
	if getExpByMoreDano(target) == true then
		return true
	end
	local players = string.explode(getExpByMoreDano(target), "|")
	local xp, newXP = getPokemonExperienceD(name), xp
	local maiorPercent = 0
	local playerWinner = ""
			if players ~= nil then
				for i = 1, #players do
				local name = string.explode(players[i], "/")[1]
				local percent = tonumber(string.explode(players[i], "/")[2])
					  if percent > maiorPercent then
					     playerWinner = name
						 maiorPercent = percent
					  end
					  if #players == 1 then -- caso so um player matou o bixo
					     percent = 100
					  end
					  local heldExp = 1
					  local player = getPlayerByName(name)
							local heldx = getItemAttribute(getPlayerSlotItem(player, 8).uid, "xHeldItem")
							if heldx then
							local heldName, heldTier = string.explode(heldx, "|")[1], string.explode(heldx, "|")[2]
								  if heldName == "X-Experience" then -- dar mais experiencia
									 heldExp = heldExperience[tonumber(heldTier)]
								  end
							end
					  playerAddExp(player,  math.ceil(percent * xp / 100) * heldExp)
				end
			end
		  local pWinnerLoot = getPlayerByName(playerWinner)	
		  if isCreature(pWinnerLoot) then
		     doItemSetAttribute(item, "corpseowner", playerWinner)
			 local loot =  str .. (str == "Loot from ".. name .. ": " and "Nothing." or "")
		     doPlayerSendTextMessage(pWinnerLoot, MESSAGE_INFO_DESCR, loot)
			 doSendMsgInParty(cid, loot)
			 if isStoneDroped then
			    doSendMagicEffect(getThingPos(pWinnerLoot), 173, pWinnerLoot)
				--- adicionar efeito em cima do loot
			 end
		  end
end

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo