Ir para conteúdo
  • Cadastre-se

(Resolvido)Ajustando Skull System


Ir para solução Resolvido por Vodkart,

Posts Recomendados

Galera tenho um OT de War, achei um Skull system feito pelo Sky, Ele está pegando normalmente, mas ha um porém.

 

O Red Skull e o Black Skull, quando o jogador morre para player ele nao dropa os itens(Legal, isso foi alterado ta como desejado).

Problema: Mas quando você morre para algum Monstro ou algum Tile que da dano, seus itens dropam todos. 

 

Duvida: Teria algum modo de colocar a Red e a Black para nao dropar de jeito nenhum os itens? alterando alguma script ?, Caso nao dê eu pensei em criar um Colar que seja IMOVEL e que ja vem nos "Chars". Esse colar faria que mesmo voce no Red ou Black os itens nao dropassem. 

 

Script do Sky:

<?xml version="1.0" encoding="ISO-8859-1"?>

<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">

<config name="SkullC_func"><![CDATA[


function setSkullColor(cid)

local t = {

[{5,10}] = 1,

[{11,15}] = 2,

[{16,20}] = 3,

[{21,25}] = 4,

[{26,math.huge}] = 5

}

for var, ret in pairs(t) do

if getPlayerFrags(cid) >= var[1] and getPlayerFrags(cid) <= var[2] then

doCreatureSetSkullType(cid, ret)

end

end

end

function getPlayerFrags(cid)

local time = os.time()

local times = {today = (time - 86400), week = (time - (7 * 86400))}

local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")

if(result:getID() ~= -1) then

repeat

local content = {date = result:getDataInt("date")}

if(content.date > times.today) then

table.insert(contents.day, content)

elseif(content.date > times.week) then

table.insert(contents.week, content)

else

table.insert(contents.month, content)

end

until not result:next()

result:free()

end

local size = {day = table.maxn(contents.day),week = table.maxn(contents.week),month = table.maxn(contents.month)}

return size.day + size.week + size.month

end

]]></config>

<event type="login" name="SkullLogin" event="script"><![CDATA[

domodlib('SkullC_func')

function onLogin(cid)

registerCreatureEvent(cid, "ColorKill")

setSkullColor(cid)

return true

end]]></event>

<event type="kill" name="ColorKill" event="script"><![CDATA[

domodlib('SkullC_func')

function onKill(cid, target)

if isPlayer(cid) and isPlayer(target) then

doCreatureSetSkullType(target, 0)

addEvent(setSkullColor, 1, cid)

end

return true

end]]></event>

</mod>
Link para o post
Compartilhar em outros sites
  • Respostas 11
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

adc no MODS a função onPrepareDeath e coloca para não dropar nenhum item...   function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) then doCreatureSetDropLoot(cid, false) end return true end  

<?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes"> <config name="SkullC_func"><![CDATA[ function setSkullColor(cid) local t = { [{5,10}] = 1, [{11,15}] = 2, [{16,20}] = 3, [{21,25}] = 4, [{26,math.huge}] = 5 } for var, ret in pairs(t) do if getPlayerFrags(cid) >= var[1] and getPlayerFrags(cid) <= var[2] then doCreatureSetSkullType(cid, ret) end end end funct

function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) and getPlayerIp(cid) == getPlayerIp(target) then return false end return true end  

  • Solução

adc no MODS a função onPrepareDeath e coloca para não dropar nenhum item...

 

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if isPlayer(cid) then
		doCreatureSetDropLoot(cid, false)
	end
	return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • 7 months later...
  Em 20/01/2017 em 14:44, Biinhows disse:

@Vodkart, teria como colocar para quando um player do mesmo ip matar o outro não receber a skull?

Expand   Mostrar mais  

 

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Skull System" version="1.0" author="Skyforever" contact="tibiaking.com" enabled="yes">
<config name="SkullC_func"><![CDATA[
function setSkullColor(cid)
	local t = {
		[{5,10}] = 1,
		[{11,15}] = 2,
		[{16,20}] = 3,
		[{21,25}] = 4,
		[{26,math.huge}] = 5
	}
	for var, ret in pairs(t) do
		if getPlayerFrags(cid) >= var[1] and getPlayerFrags(cid) <= var[2] then
			doCreatureSetSkullType(cid, ret)
		end
	end
end

function getPlayerFrags(cid)
	local time = os.time()
	local times = {today = (time - 86400), week = (time - (7 * 86400))}
	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
	if(result:getID() ~= -1) then
		repeat
			local content = {date = result:getDataInt("date")}
			if(content.date > times.today) then
				table.insert(contents.day, content)
			elseif(content.date > times.week) then
				table.insert(contents.week, content)
			else
				table.insert(contents.month, content)
			end
		until not result:next()
		result:free()
	end
	local size = {day = table.maxn(contents.day),week = table.maxn(contents.week),month = table.maxn(contents.month)}
	return size.day + size.week + size.month
end

]]></config>
<event type="login" name="SkullLogin" event="script"><![CDATA[
domodlib('SkullC_func')
function onLogin(cid)
registerCreatureEvent(cid, "ColorKill")
setSkullColor(cid)
return true
end]]></event>
<event type="kill" name="ColorKill" event="script"><![CDATA[
domodlib('SkullC_func')
function onKill(cid, target)
	if isPlayer(cid) and isPlayer(target) and getPlayerIp(cid) ~= getPlayerIp(target)  then
		doCreatureSetSkullType(target, 0)
		addEvent(setSkullColor, 1, cid)
	end
	return true
end]]></event>
</mod>

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

@Vodkart, não funcionou!

Quando um player do mesmo ip mata não aparece a skull, mas quando ele desloga e loga a skull aparece.

Não teria como você criar um creaturescripts que adiciona as skulls com uma storage no player?

 

eu tentei usar esse script mas não funcionou:

function onKill(cid, target, lastHit)
if cid ~= target and isPlayer(target) then
if getPlayerIp(cid) == getPlayerIp(target) then
doCreatureAddHealth(cid, -200)
doCreatureAddMana(cid, -200)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.')
else
doPlayerAddItem(cid, 2152, 1)
setPlayerStorageValue(cid, 6776, getCreatureStorage(cid, 6776) + 1)
end
end

if(getPlayerStorageValue(cid, 6776) == 5) and getCreatureStorage(cid, 6001) == -1 then
setPlayerStorageValue(cid, 6001, 1)
doCreatureSetSkullType(cid, 1)

elseif(getPlayerStorageValue(cid, 6776) == 10) and getCreatureStorage(cid, 6002) == -1 then
setPlayerStorageValue(cid, 6002, 1)
doCreatureSetSkullType(cid, 2)

elseif(getPlayerStorageValue(cid, 6776) == 25) and getCreatureStorage(cid, 6003) == -1 then
setPlayerStorageValue(cid, 6003, 1)
doCreatureSetSkullType(cid, 3)

elseif(getPlayerStorageValue(cid, 6776) == 50) and getCreatureStorage(cid, 6004) == -1 then
setPlayerStorageValue(cid, 6004, 1)
doCreatureSetSkullType(cid, 4)

elseif(getPlayerStorageValue(cid, 6776) == 100) and getCreatureStorage(cid, 6005) == -1 then
setPlayerStorageValue(cid, 6005, 1)
doCreatureSetSkullType(cid, 5)
return true
end
end

 

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
    519600
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo