Wrathe
Curiosity Kills!
This scripts adds an item to you if you kill someone.
function onPrepareDeath(cid, killer)
if(isPlayer(killer) == TRUE) then
local levelDiff = getPlayerLevel(killer) * 1.1
if(levelDiff >= getPlayerLevel(cid)) then
local item = doPlayerAddItem(killer,5943,1)
doSetItemSpecialDescription(item, "This is the heart of "..getPlayerName(cid).."["..getPlayerLevel(cid).."]. He or She was killed by ".. getPlayerName(killer) .."["..getPlayerLevel(killer).."].")
end
end
end
It should be getPlayerLevel(killer), sorryI also added
so if a level 100 kills a level 8 they don't get an item.if getPlayerLevel(killer) >= getPlayerLevel(killer) / 2 then
function onPrepareDeath(cid, killer)
if(isPlayer(killer) == TRUE) then
local levelDiff = getPlayerLevel(cid) * 1.1
if(levelDiff >= getPlayerLevel(killer)) then
local item = doPlayerAddItem(killer,5943,1)
doSetItemSpecialDescription(item, "This is the heart of "..getPlayerName(cid).."["..getPlayerLevel(cid).."]. He or She was killed by ".. getPlayerName(killer) .."["..getPlayerLevel(killer).."].")
end
end
end
This script shows killer's name and what level he died, victim's name and what level he died, also, it does not give the killer an item if he's 10% higher in level
if getPlayerLevel(killer) >= (getPlayerLevel(killer) / 2) then
function onPrepareDeath(cid, killer)
if(isPlayer(killer) == TRUE) then
if getPlayerLevel(killer) >= (getPlayerLevel(killer)/2) then
doSetItemSpecialDescription(doPlayerAddItem(killer,5943,1), "This is the heart of "..getPlayerName(cid).."["..getPlayerLevel(cid).."]. He or She was killed by ".. getPlayerName(killer) .."["..getPlayerLevel(killer).."].")
end
end
end
On real tibia, you don't get exp for killing someone if he's 10% lower than you(so a level 100 can't get exp on a level 89, but he would get exp if he kills a level 90). This is the way I did it, you'll get an item if you kill someone that's either higher or 10% lower than you.It should be getPlayerLevel(killer), sorry
Wrong way around.
Should be this since you are getting the level of the player:
if (levelDiff <= getPlayerLevel(killer)) then
That just made it you could only get an item if your were over 10% of their level. eg. You only got an item if you killed a level 50 if you were equal or over level 55.
Now it makes it that you have to be 55 or under to get an item from killing the level 50.
Use mine
Code:if getPlayerLevel(killer) >= (getPlayerLevel(killer) / 2) then
So..
This is the latest code.
Code:function onPrepareDeath(cid, killer) if(isPlayer(killer) == TRUE) then if getPlayerLevel(killer) >= (getPlayerLevel(killer)/2) then doSetItemSpecialDescription(doPlayerAddItem(killer,5943,1), "This is the heart of "..getPlayerName(cid).."["..getPlayerLevel(cid).."]. He or She was killed by ".. getPlayerName(killer) .."["..getPlayerLevel(killer).."].") end end end
fragReward = "yes"
function onPrepareDeath(cid, killer)
if fragReward == "yes" then
if isPlayer(killer) == TRUE then
local levelDiffHigh = getPlayerLevel(killer) * 1.1
local levelDiffLow = getPlayerLevel(killer) * 0.9
if getPlayerLevel(killer) <= 20 and getPlayerLevel(killer) >= 1 then
addReward = TRUE
else
if getPlayerLevel(cid) >= levelDiffLow and getPlayerLevel(cid) <= levelDiffHigh then
addReward = TRUE
else
addReward = FALSE
end
end
if addReward == TRUE then
if getPlayerSex(cid) == 0 then
cidGender = 'She'
else
cidGender = 'He'
end
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
doSetItemSpecialDescription(doPlayerAddItem(killer,5943,1), 'This is a heart of ' .. getPlayerName(cid) .. '. ' .. cidGender .. ' was killed at level ' .. getPlayerLevel(cid) .. ' by ' .. getPlayerName(killer) .. ' (Level ' .. getPlayerLevel(killer) .. ').')
doSendMagicEffect(getPlayerPosition(killer),CONST_ME_MAGIC_RED)
end
end
end
end
function onKill(cid, target)
if isPlayer(cid) == 1 and isPlayer(target) == 1 then
medal = doPlayerAddItem(cid,5785,1)
doSetItemSpecialDescription(medal,"This medal was given to " ..getCreatureName(cid).. " for killing " .. getCreatureName(target) .." at level " .. getPlayerLevel(target) .. "")
end
return 1
end