Ir para conteúdo

(Resolvido)[PEDIDO] Ao dar x pontos de dano a um monstro ganhar 1 item apos o monstro morre

Featured Replies

Postado

Ola amigos. Estou precisando muito de um script assim.

 

um drag tem 700 pontos de life...

se eu causar 300 pontos de dano ou mais nele eu ganho 1 item apos o drag morrer, mesmo que outra pessoa mate ele.

é possivel ?

podem me ajudar ?

muito obrigado galera

Para 8.6 blz. valeww

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

Resolvido por Vodkart

Ir para solução
Postado

Esta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.

Spoiler

This is an automated message! This topic has been moved to the correct area.
Please read the forum rules.

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Postado
  • Solução
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Item_Bonus" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> 
<config name="itembonus_func"><![CDATA[
monsters = {
	["rat"] = {s = 487541, min = 15, item = {2160,10}},
	["rotworm"] = {s = 487542, min = 20, item = {2173,1}},
	["cyclops"] = {s = 487543, min = 100, item = {2173,1}},
}
]]></config>
<event type="login" name="ItemBonusRegister" event="script"><![CDATA[
function onLogin(cid)
registerCreatureEvent(cid, "ItemBonusCombat")
registerCreatureEvent(cid, "ItemBonusStats")
return true
end]]></event> 
<event type="combat" name="ItemBonusCombat" event="script"><![CDATA[
domodlib('itembonus_func')
if isPlayer(cid) and isMonster(target) and monsters[getCreatureName(target):lower()] then
	registerCreatureEvent(target, "ItemBonusStats")
	registerCreatureEvent(target, "ItemBonusDeath")
end
return true]]></event>
<event type="statschange" name="ItemBonusStats" event="script"><![CDATA[
domodlib('itembonus_func')
if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and isMonster(cid) and monsters[getCreatureName(cid):lower()] then
	if value >= monsters[getCreatureName(cid):lower()].min then
		setPlayerStorageValue(attacker, monsters[getCreatureName(cid):lower()].s, 1)
	end 
end
return true]]></event>
<event type="death" name="ItemBonusDeath" event="script"><![CDATA[
domodlib('itembonus_func')
function onDeath(cid, corpse, deathList)
local x = monsters[getCreatureName(cid):lower()]
if x then
	for _, pid in ipairs(deathList) do
		if isCreature(pid) and isPlayer(pid) and getPlayerStorageValue(pid, x.s) > 0 then 
			doPlayerAddItem(pid,x.item[1],x.item[2])
			setPlayerStorageValue(pid, x.s, 0)
		end
	end
end
return true
end]]></event>
</mod>

 

 

para configurar só vir nessa tabela:

 

monsters = {
    ["rat"] = {s = 487541, min = 15, item = {2160,10}},
    ["rotworm"] = {s = 487542, min = 20, item = {2173,1}},
    ["dragon"] = {s = 487543, min = 700, item = {2173,1}},
}

 

 

["nome do monstro em letra minuscula"] = [s = storage coloque sempre uma diferente, min = quantidade de hit necessaria, item {id do item, quantidade}}

 

 

 

obs: isso é em MODS

vodkart_logo.png

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

 

DISCORDvodkart#6090

 

Postado
  • Autor

@Vodkart rep+ nossa vei te amo 

esta tudo perfeito, so preciso de uma coisa.

 

só esta dando item se o player der um hit maior que o configurado, eu precisava tipo

   ["dragon"] = {s = 487541, min = 100, item = {2160,10}},

se o player der 4 hits que somar 100 ou mais ele ganha o item

 

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

Postado
<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Item_Bonus" version="1.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> 
<config name="itembonus_func"><![CDATA[
monsters = {
	["apocalypse"] = {s = 487541, min = 5000, item = {2160,10}},
	["ghazbaran"] = {s = 487542, min = 6000, item = {2173,1}},
	["infernatil"] = {s = 487543, min = 6000, item = {2173,1}},
	["dragon"] = {s = 487544, min = 200, item = {2159,10}}
}
]]></config>
<event type="login" name="ItemBonusRegister" event="script"><![CDATA[
domodlib('itembonus_func')
function onLogin(cid)
	registerCreatureEvent(cid, "ItemBonusCombat")
	registerCreatureEvent(cid, "ItemBonusStats")
	for _, v in pairs(monsters) do -- when die or relog
		setPlayerStorageValue(cid, v.s, 0)
	end
	return true
end]]></event> 
<event type="combat" name="ItemBonusCombat" event="script"><![CDATA[
domodlib('itembonus_func')
if isPlayer(cid) and isMonster(target) and monsters[getCreatureName(target):lower()] then
	registerCreatureEvent(target, "ItemBonusStats")
	registerCreatureEvent(target, "ItemBonusDeath")
end
return true]]></event>
<event type="statschange" name="ItemBonusStats" event="script"><![CDATA[
domodlib('itembonus_func')
if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and isMonster(cid) and monsters[getCreatureName(cid):lower()] then
	local v = monsters[getCreatureName(cid):lower()]
	if getPlayerStorageValue(attacker, v.s) < v.min then
		setPlayerStorageValue(attacker, v.s, (getPlayerStorageValue(attacker, v.s) <= 0 and value or getPlayerStorageValue(attacker, v.s)+value))
	end
end
return true]]></event>
<event type="death" name="ItemBonusDeath" event="script"><![CDATA[
domodlib('itembonus_func')
function onDeath(cid, corpse, deathList)
	local x = monsters[getCreatureName(cid):lower()]
	if x then
		for _, pid in ipairs(deathList) do
			if isCreature(pid) and isPlayer(pid) then
				if getPlayerStorageValue(pid, x.s) >= x.min then 
					doPlayerAddItem(pid,x.item[1],x.item[2])
				end
				setPlayerStorageValue(pid, x.s, 0)
			end
		end
	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

 

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