[Pedido] Coração Dentro Do Corpo De Um Player Morto

thonynunes
em Lixeira Pública

thonynunes

Yüyi
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/01/12Posts: 9Char no Tibia: Brunocchi

Olá, Bom esse script que estou pedindo deve ser muito complexo porque até hoje só vi um ot com ele funcionando corretamente que é o Lendário pBot original...vou explicar como ele funciona, Acho que é um creaturescript. Quando um Player X mata um Player Y no corpo desse player Y (dentro do corpo) fica um coração e nesse coração tem uma mensagem que aparece quando da um look mais ou menos assim "Este é o coração de "Y" morto por "x" "

Conseguiram entender? Por Favor esse Script é muito legal e até agora eu não consegui fazer ele funcionar eu até tenho um, porém nunca funcionou

 

function onPrepareDeath(cid, corpse, lastHitKiller, mostDamageKiller)

local cidpos = getPlayerPosition(lastHitKiller)

loot = 5943

item = doPlayerAddItem(lastHitKiller,loot,1)

if(isPlayer(lastHitKiller) == TRUE) then

hitKillerName = getPlayerName(lastHitKiller)

doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")

doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")

doSendMagicEffect(cidpos,12)

else

hitKillerName = getCreatureName(lastHitKiller)

doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")

end

setItemName(item, ""..getPlayerName(cid).."\'s Heart")

return TRUE

end

Atenciosamente, Thony Nunes!

 

I BORN TO BE BRAVE!

 

zwcolh.jpg

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

tenta assim:

function onDeath(cid, corpse, killer)

loot = 5943 -- id do coração
if isPlayer(killer) then
   item = doPlayerAddItem(corpse,loot,1)
   doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(killer)..".")
   setItemName(item, ""..getPlayerName(cid).."\'s Heart")
   doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
end

return TRUE
end

 

Obs: Nem testei.

 

Muda a tag no creaturescripts.xml no lugar de "preparedeath" mude apenas para "death".

thonynunes

Yüyi
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/01/12Posts: 9Char no Tibia: Brunocchi

Oque eu coloco aqui oh...

 <event type="death" [color=#ff0000][b]name=""[/b][/color] script="heart.lua"/> 

 

Não funcionou :s

Atenciosamente, Thony Nunes!

 

I BORN TO BE BRAVE!

 

zwcolh.jpg

jhon992

Dono JhonBot
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/06/11Posts: 631Char no Tibia: Warrior of Mort

coloca:

<event type="death" name="Heart" script="heart.lua"/> 

 

E no script "login.lua" que esta em /scripts, antes do ultimo return true, coloca a tag:

registerCreatureEvent(cid, "Heart")

thonynunes

Yüyi
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/01/12Posts: 9Char no Tibia: Brunocchi

Esse que você me mandou não funciona, ve se consegue arrumar esse aqui oh...

function onDeath(cid, corpse, killer)
   local cidpos = getPlayerPosition(lastHitKiller)
   loot = 5943
   item = doPlayerAddItem(lastHitKiller,loot,1)
   if(isPlayer(lastHitKiller) == TRUE) then
    hitKillerName = getPlayerName(lastHitKiller)
    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")
    doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
    doSendMagicEffect(cidpos,12)
   else
    hitKillerName = getCreatureName(lastHitKiller)
    doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")
   end
   setItemName(item, ""..getPlayerName(cid).."\'s Heart")
   return TRUE
end

Atenciosamente, Thony Nunes!

 

I BORN TO BE BRAVE!

 

zwcolh.jpg