andypsylon
be be
in
data/creature/scripts/creaturescripts.xml
insert:
in
data/creaturescripts/scripts/login.lua
insert:
create
datacreaturescriptsscriptsonKill_removeItem.lua
and insert:
tested on tfs 0.4
data/creature/scripts/creaturescripts.xml
insert:
PHP:
<event type="kill" name="removeItem" event="script" value="onKill_removeItem.lua"/>
data/creaturescripts/scripts/login.lua
insert:
Code:
registerCreatureEvent(cid, "removeItem")
datacreaturescriptsscriptsonKill_removeItem.lua
and insert:
Code:
-- ver. 1 2011-12-07
-- author tfs, otland.net/members/andypsylon
-- otland.net/f82/onkill-doremoveitem-event-docreateitem-146056
local c = {
["mob1"] = { -- nazwa moba
{x = 111, y = 111, z = 7}
},
["mob2"] = {
{x = 111, y = 111, z = 7},
{x = 111, y = 111, z = 7}
},
items = {1304, 1305, 1306},
message = "TAKE WHAT YOU WILL, AND RUN AWAY!!",
time = 30
}
function onKill(cid, target, lastHit)
if isPlayer(target) then return true end
local m = c[getCreatureName(target):lower()]
if m then
for _, pos in ipairs(m) do
local it = nil
for _, i in pairs(c.items) do
local tmp = getTileItemById(pos, i)
if tmp.itemid == i then
it = tmp
break
end
end
if it == nil then return true end
doRemoveItem(it.uid, 1)
addEvent(doCreateItem, c.time*1000, it.itemid, 1, pos)
end
doCreatureSay(target, c.message, TALKTYPE_MONSTER)
end
return true
end
tested on tfs 0.4
Last edited: