silveralol
Advanced OT User
- Joined
- Mar 16, 2010
- Messages
- 1,484
- Solutions
- 9
- Reaction score
- 217
Hi, I see it in another forum and like it
the script can be configurable to drop any item inside of backpack bag in a monster...
its nice!!!
but I don't know the version of tfs that he was maked... So, please somebody convert this script to tfs 1.2
the script can be configurable to drop any item inside of backpack bag in a monster...
its nice!!!
but I don't know the version of tfs that he was maked... So, please somebody convert this script to tfs 1.2
Code:
local bag = xxx -- ID backpack
local itens ={xxx, xxx, xxx} -- ID of itens that will be droped and put into a backpack
dropados.functionLoot(mName, mPosition)
local items ={}
for i = getTileInfo(mPosition).items,1,-1 do
mPosition.stackpos = i
table.insert(items, getThingFromPos(mPosition))
end
if#items == 0 then
return true
end
local corpse =-1
for _, item in ipairs(items) do
local name = getItemName(item.uid):lower()
if name:find(mName:lower())then
corpse = item.uid
break
end
end
if not isContainer(corpse) then
return true
end
if corpse ==-1then
return true
end
for i =0, getContainerSize(corpse)-1 do
local item = getContainerItem(corpse, i)
if isInArray(itens, item.itemid)then
doAddContainerItem(doAddContainerItem(corpse, bag,1), item.itemid, item.type)
doRemoveItem(item.uid)
end
endendfunction onKill(cid, target)
if isMonster(target)then
addEvent(Loot,5, getCreatureName(target), getThingPos(target))
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid,"lootItem")
return true
end