• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent [Heart] Frag Reward v1.1

Status
Not open for further replies.
This is way cooler then some of the other ones ive seen like slightly like this. =D Ima use it!
 
When a player dies there's no corpse after the player, while using this script
Im using crying damson 0.3.6 pl1

Error:
Code:
[25/03/2010 04:18:18] [Error - CreatureScript Interface] 
[25/03/2010 04:18:18] data/creaturescripts/scripts/reward.lua:onDeath
[25/03/2010 04:18:18] Description: 
[25/03/2010 04:18:18] data/creaturescripts/scripts/reward.lua:5: attempt to concatenate field 'killer_level' (a boolean value)
[25/03/2010 04:18:18] stack traceback:
[25/03/2010 04:18:18] 	data/creaturescripts/scripts/reward.lua:5: in function <data/creaturescripts/scripts/reward.lua:1>

The script works fine as long the player gets killed in PvP, this^ happens when the player dies from a monster
 
Last edited:
JDB, i have the same problem as equid, i tried your new script, it still doesn't work so good, after death corpse appears but..

Error:
Code:
[25/03/2010 20:12:14] [Error - CreatureScript Interface] 
[25/03/2010 20:12:14] data/creaturescripts/scripts/reward.lua:onDeath
[25/03/2010 20:12:14] Description: 
[25/03/2010 20:12:14] (internalGetPlayerInfo) Player not found when requesting player info #3

Also, it gives clean morgaroth's heart ;/

Code:
20:12 You see the Morgaroth's heart.
It weighs 35.00 oz.

I'm using TFS 0.3.6pl1 too.
 
Not tested

Code:
function onDeath(cid, corpse, deathList)
	local v = { killer_name = getCreatureName(deathList[1]), killer_level = getPlayerLevel(deathList[1]), target_name = getCreatureName(cid), target_level = getPlayerLevel(cid) }
	local reward = doAddContainerItem(corpse.uid, 5943, 1)
	if isPlayer(cid) then
		for i = 1, #deathList do
			if(isPlayer(deathList[i])) then
				doItemSetAttribute(reward, "description", "" .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed at level " .. v.target_level .. " by " .. v.killer_name .. " who was level " .. v.killer_level .. " at the time. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Unjustified]" or "[Justified]"))
			elseif(isMonster(deathList[i])) then
				return false
			end
			doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
		end
	end
	return true
end
 
Last edited:
Lua:
function onDeath(cid, corpse, deathList)
local corpse_ids = {
	[0] = 3065,
	[1] = 3058
}
	local v = { killer_name = getCreatureName(deathList[1]), killer_level = getPlayerLevel(deathList[1]), target_name = getCreatureName(cid), target_level = getPlayerLevel(cid) }
	local reward = doAddContainerItem(corpse.uid, 5943, 1)
	if isPlayer(cid) then
		for i = 1, #deathList do
			if(isPlayer(deathList[i])) then
				doItemSetAttribute(reward, "description", "" .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed at level " .. v.target_level .. " by " .. v.killer_name .. " who was level " .. v.killer_level .. " at the time. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Unjustified]" or "[Justified]"))
				local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""
				for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
					killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
				end
			end
			doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
		end
	end
	return true
end

:D!
 
That's nice, should work.
 
Code:
21:30 You see the Ishari's Heart.
It weighs 35.00 oz.
He was killed at level 87 by Ichigo who was level 81 at the time. [Unjustified]
Code:
21:31 You see the Mistake's Heart.
It weighs 35.00 oz.

It works, thx!
 
Status
Not open for further replies.
Back
Top