apockalyptik
New Member
- Joined
- Jun 17, 2007
- Messages
- 47
- Reaction score
- 0
Ive been looking for an update version of this script, coz the previous one wouldnt work with TFS 0.2.13. I finnaly found it on other forum and edited it so that it shows the level of the killer and the level of the killed person at the time.
This will give 3 kinds of goblets, depending of the victim's level:
Bronze to lv 1-99
Silver to lv 100-199
Golden to lv 200+
It will show like:
22:05 You see a silver goblet.
It weighs 15.00 oz.
It was awarded to Admin at level 101 for killing Cobaia at level 130.
login.lua
creaturescripts.xml
reward.lua
This is the original, simpliest version of reward.lua, fixed by Ruda to work with the lastest tfs.
This will give 3 kinds of goblets, depending of the victim's level:
Bronze to lv 1-99
Silver to lv 100-199
Golden to lv 200+
It will show like:
22:05 You see a silver goblet.
It weighs 15.00 oz.
It was awarded to Admin at level 101 for killing Cobaia at level 130.
login.lua
PHP:
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "Killed")
return TRUE
end
creaturescripts.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="login" name="FirstItems" script="firstitems.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="preparedeath" name="Killed" script="reward.lua"/>
</creaturescripts>
reward.lua
PHP:
function onPrepareDeath(cid, killer)
--broadcastMessage(getCreatureName(killer).." killed "..getCreatureName(cid), 18)
onKill(killer, cid)
end
function onKill(cid, target)
if isPlayer(cid) then
killerName = getCreatureName(cid)
name = getCreatureName(target)
lvl = getPlayerLevel(target)
if lvl > 0 and lvl < 100 then
loot = 5807
elseif lvl > 99 and lvl < 200 then
loot = 5806
elseif lvl > 199 then
loot = 5805
else
loot = 5807
end
item = doPlayerAddItem(cid, loot, 1)
doSetItemSpecialDescription(item,"It was awarded to "..getCreatureName(cid).." at level "..getPlayerLevel(cid).." for killing "..getCreatureName(target).." at level "..getPlayerLevel(target)..".")
doPlayerSendTextMessage(killer, 22, "You killed "..name..".")
end
end
This is the original, simpliest version of reward.lua, fixed by Ruda to work with the lastest tfs.
PHP:
function onPrepareDeath(cid, killer)
if isPlayer(killer) == true then
killerName = getCreatureName(killer)
name = getCreatureName(cid)
lvl = getPlayerLevel(cid)
if lvl > 0 and lvl < 100 then
loot = 5807
elseif lvl > 99 and lvl < 200 then
loot = 5806
elseif lvl > 199 then
loot = 5805
else
loot = 5807
end
item = doPlayerAddItem(killer, loot, 1)
doSetItemSpecialDescription(item, name.." was killed by "..killerName.." at Level "..lvl..".")
doPlayerSendTextMessage(killer, 22, "You killed "..name..".")
end
end
Last edited: