Salve carai! Então, tenho estudado um pouco de lua e acabei fazendo um script, simples, mas que pode vir a ser útil para alguns servidores...
O que o script faz? É simples, ele te deixa tirar a "pele" de um animal ainda vivo, como a obsidian knife faz com os mortos.
PS: Você pode configurar os mobs e suas respectivas "peles" no script, você só precisar tem um mínimo de conhecimento em lua.
PS²: Script feito em um TFS 1.2 recém baixado.
actions.xml: (PS: Não esqueça de definir o ID do item a ser usado)
<action itemid="ID DO ITEM" script="skinning.lua" />
Observação: A Sintaxe em lua nos codes do fórum está aparentemente bugada, apenas copie o código abaixo e cole no seu editor lua que ficará normal.
actions/scripts/skinning.lua:
local wool = {"Sheep", "Black Sheep"} -- Creatures configuration for the first table which gives wool when skinned
local leather = {"Deer", "Bear", "Rat"} -- Creatures configuration for the second table which gives minotaur leather when skinned (Should probably rename the item to leather by the way)
local dleather = {"Dragon", "Wyvern"} -- Creatures configuration for the third table which gives green dragon leather when skinned (Could also change this to green leather or something)
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if isCreature(target) and isInArray(wool, getCreatureName(target)) then
local tPos = getCreaturePosition(target)
doSendMagicEffect(tPos, 1) -- The magic effect that will be shown @ target's position when skinned.
player:addItem(11236, 3) -- Item which will be added when the mobs at "Wool" table are skinned and its amount.
doCreatureAddHealth(target, -10)
elseif isCreature(target) and isInArray(leather, getCreatureName(target)) then
local tPos = getCreaturePosition(target)
doSendMagicEffect(tPos, 1) -- The magic effect that will be shown @ target's position when skinned.
player:addItem(5878, 3) -- Item which will be added when the mobs at "Leather" table are skinned and its amount.
doCreatureAddHealth(target, -10)
elseif isCreature(target) and isInArray(dleather, getCreatureName(target)) then
local tPos = getCreaturePosition(target)
doSendMagicEffect(tPos, 1) -- The magic effect that will be shown @ target's position when skinned.
player:addItem(5877, 3) -- Item which will be added when the mobs at "DLeather" table are skinned and its amount.
doCreatureAddHealth(target, -10)
elseif isCreature(target) == false then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You can only skin creatures.") -- The error message it will give if the player is trying to skin something that isn't a creature.
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You cannot skin this creature.") -- The error message it will give if t he player is trying to skin a creature which isn't added in the configuration above.
return true
end
end