slaw
Software Developer
How it looks in game: (screenshot is gone, you can make a new one and send me)
1. data/creaturescripts/scripts/monster_counter.lua
2. data/creaturescripts/creaturescripts.xml
* TFS 0.2
* TFS 0.3 (RC2+)
3. Add this at bottom of your login.lua (before return TRUE)
UPDATE:
Available as mod: http://tfs-mods.googlecode.com/svn/trunk/killed-monsters-counter.xml
1. data/creaturescripts/scripts/monster_counter.lua
Code:
local monsters = {
--name = storage
["rat"] = 35001,
["troll"] = 35002,
["rotworm"] = 35003,
["dragon"] = 35004,
["dragon lord"] = 35005,
["demon"] = 35006,
}
function onKill(cid, target)
if(isPlayer(target) ~= TRUE) then
local master = getCreatureMaster(target)
if(master and master ~= target) then return FALSE end
local name = getCreatureName(target)
local monster = monsters[string.lower(name)]
if(monster) then
local killedMonsters = getPlayerStorageValue(cid, monster)
if(killedMonsters == -1) then
killedMonsters = 1
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
setPlayerStorageValue(cid, monster, killedMonsters + 1)
end
end
return TRUE
end
2. data/creaturescripts/creaturescripts.xml
* TFS 0.2
Code:
<event type="kill" name="KilledMonstersCounter" script="monster_counter.lua"/>
Code:
<event type="kill" name="KilledMonstersCounter" event="script" value="monster_counter.lua"/>
3. Add this at bottom of your login.lua (before return TRUE)
Code:
registerCreatureEvent(cid, "KilledMonstersCounter")
UPDATE:
Available as mod: http://tfs-mods.googlecode.com/svn/trunk/killed-monsters-counter.xml
Last edited: