Loot Channel para TFS 1.X
Liberando mais alguns conteúdos para vocês. Dessa vez o loot channel para tfs 1.x.
Crie um arquivo chamado loot.lua na pasta chatchannels/scripts contendo isso
local STORAGEVALUE_LOOT = 8914
function onSpeak(player, type, message)
return false
end
function onJoin(player)
player:setStorageValue(STORAGEVALUE_LOOT, 1)
return true
end
function onLeave(player)
player:setStorageValue(STORAGEVALUE_LOOT, 0)
return true
end
Agora em chatchannels.xml adicione a tag
<channel id="11" name="Loot" script="loot.lua" />
Em events/scripts, abra o arquivo monster.lua e você provavelmente irá encontra-lo assim
function Monster:onDropLoot(corpse)
if configManager.getNumber(configKeys.RATE_LOOT) == 0 then
return
end
local player = Player(corpse:getCorpseOwner())
local mType = self:getType()
if not player or player:getStamina() > 840 then
local monsterLoot = mType:getLoot()
for i = 1, #monsterLoot do
local item = corpse:createLootItem(monsterLoot[i])
if not item then
print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
end
end
if player then
local text = ("Loot of %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
local party = player:getParty()
if party then
party:broadcastPartyLoot(text)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
end
end
else
local text = ("Loot of %s: nothing (due to low stamina)"):format(mType:getNameDescription())
local party = player:getParty()
if party then
party:broadcastPartyLoot(text)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
end
end
end
Altere para esse
local STORAGEVALUE_LOOT = 8914
function Monster:onDropLoot(corpse)
if configManager.getNumber(configKeys.RATE_LOOT) == 0 then
return
end
local player = Player(corpse:getCorpseOwner())
local mType = self:getType()
if not player or player:getStamina() > 840 then
local monsterLoot = mType:getLoot()
for i = 1, #monsterLoot do
local item = corpse:createLootItem(monsterLoot[i])
if not item then
print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
end
end
if player then
local text = ("Loot de %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
local party = player:getParty()
if party then
party:broadcastPartyLoot(text)
else
if player:getStorageValue(STORAGEVALUE_LOOT) == 1 then
sendChannelMessage(11, TALKTYPE_CHANNEL_O, text)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
end
end
end
else
local text = ("Loot de %s: nada (devivo a baixa stamina)"):format(mType:getNameDescription())
local party = player:getParty()
if party then
party:broadcastPartyLoot(text)
else
if player:getStorageValue(STORAGEVALUE_LOOT) == 1 then
sendChannelMessage(11, TALKTYPE_CHANNEL_O, text)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
end
end
end
end
Pronto, adicionado o Loot Channel!
Créditos: 100% meu