Morre E Cai O Caração

Fronick
em Lixeira Pública

Fronick

Ajudando o Forum
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/01/10Posts: 36Char no Tibia: Argon Tard

Queria um script assim,Tipow,quandu a pessoa morrer,o loot dela aparecer automatiamente um morgaroth hearth,com o nome da pessoa morta,e o nome de quem matou... junto com ou loot,ou se a pessa tiver usandu aol, hearth tem que cair do msm jeito

 

Para ot 8.50 TFS 0.3.5

signbomber.gif

 

fancopy.png

Gostou do meu trabalho,use minha Fan Bar

 

Tópicos:

Nature I

 

Msn:fronickbr@hotmail.com



Skype:fronickbr

Wiltry

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/07/08Posts: 306

Tenta assim, em creaturescripts/playerdeath, embaixo de

if isPlayer(killer) == TRUE then
byPlayer = TRUE

Você coloca isso:

	pos = getCreaturePosition(cid)
nomoedomorto = getCreatureName(cid)
nomedoassassino = getCreatureName(killer)
heart = doCreateItem(HEARTID, 1, pos)
doDecayItem(heart)
doSetItemSpecialDescription(heart, "This is the heart of "..nomedomorto..", morto por "..nomedoassassino..")

Atenciosamente,
Wiltry
<div align='center'><b>Wiltry 2008~2009</b></div>
<div align='center'>Mapper & Scripter</div>
<div align='center'><img src="http://img263.imageshack.us/img263/9130/beyond.png" border="0" class="linked-sig-image" /></div>
vlw guww :*

Fronick

Ajudando o Forum
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 16/01/10Posts: 36Char no Tibia: Argon Tard

aki esta assim

 

local config = {
deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')),
sqlType = getConfigInfo('sqlType'),
maxDeathRecords = getConfigInfo('maxDeathRecords')
}

config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(config.deathListEnabled ~= TRUE) then
	return
end

local hitKillerName = "field item"
local damageKillerName = ""
if(lastHitKiller ~= FALSE) then
	if(isPlayer(lastHitKiller) == TRUE) then
		hitKillerName = getPlayerGUID(lastHitKiller)
	else
		hitKillerName = getCreatureName(lastHitKiller)
	end

	if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then
		if(isPlayer(mostDamageKiller) == TRUE) then
			damageKillerName = getPlayerGUID(mostDamageKiller)
		else
			damageKillerName = getCreatureName(mostDamageKiller)
		end
	end
end

db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");")
local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";")
if(rows:getID() ~= -1) then
	local amount = rows:getRows(true) - config.maxDeathRecords
	if(amount > 0) then
		if(config.sqlType == DATABASE_ENGINE_SQLITE) then
			for i = 1, amount do
				db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);")
			end
		else
			db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";")
		end
	end
end
end

signbomber.gif

 

fancopy.png

Gostou do meu trabalho,use minha Fan Bar

 

Tópicos:

Nature I

 

Msn:fronickbr@hotmail.com



Skype:fronickbr

Ablank

.-.
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/07/06Posts: 88

Lembrando que o código acima só funciona se o servidor tiver suporte a LUA SQL, ou seja SVN não consta nesta lista!

 

Wilty gostei do código :D

Att.

Ablankzin

Wiltry

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/07/08Posts: 306

Embaxo disso: if(isPlayer(lastHitKiller) == TRUE) then

hitKillerName = getPlayerGUID(lastHitKiller)

 

Ablank:

Obrigado ;P

Atenciosamente,
Wiltry
<div align='center'><b>Wiltry 2008~2009</b></div>
<div align='center'>Mapper & Scripter</div>
<div align='center'><img src="http://img263.imageshack.us/img263/9130/beyond.png" border="0" class="linked-sig-image" /></div>
vlw guww :*