Do you want to deleteSeen some but its for 0.3 and 0.4 tfs
Do you want to delete
loot chanle?
data/chatchannels/scripts add loot.lua
and past \/
function onSpeak(player, type, message)
return false
end
goto chatchannels xml add\/
<channel id="9" name="Loot" public="1" script="loot.lua" />
and goto creaturescripts/scripts and make loot.lua
and past \/
function onLogin(cid)
local player = Player(cid)
player:openChannel(9)
return true
end
goto creaturescripts xml add \/
<event type="login" name="loot" script="loot.lua"/>
And goto creaturescripts/scripts/login.lua add\/
player:registerEvent("loot")
Lol it creates just a channel but it misses source it needs to send loot info in this channelDo you want to delete
loot chanle?
Post automatically merged:
Lua:data/chatchannels/scripts add loot.lua and past \/ function onSpeak(player, type, message) return false end goto chatchannels xml add\/ <channel id="9" name="Loot" public="1" script="loot.lua" /> and goto creaturescripts/scripts and make loot.lua and past \/ function onLogin(cid) local player = Player(cid) player:openChannel(9) return true end goto creaturescripts xml add \/ <event type="login" name="loot" script="loot.lua"/> And goto creaturescripts/scripts/login.lua add\/ player:registerEvent("loot")
And do you know the name of the file that has this in the source?Lol it creates just a channel but it misses source it needs to send loot info in this channel
what? noAnd do you know the name of the file that has this in the source?
GitHub - celohere/forgottenserver (https://github.com/celohere/forgottenserver)what? no
not reallyGitHub - celohere/forgottenserver (https://github.com/celohere/forgottenserver)
This is a 1.2 source and there is a channel loot
If you understand the sources, move it from here to you
player:sendChannelMessage(author, text, type, channelId)
So you mean editing dropcorpse.lua? this lineIf you want to do like he said, would be easy to make the channel dedicated to loot, then for the part where you get the loot, can be found in the event onDropLoot, not sure when that was added to tfs, so if you don't have that then I'm sorry, I think it would be best that way, but it could also be done in an onDeath or an onKill, any of those events, if you write the logic would be a bit of work, but simple really, just find the item names, and send to that channel, the method you would use would be
so just use that in any of those events and make a string containing the message you want to send to the channel and send it with the above methodLua:player:sendChannelMessage(author, text, type, channelId)
killer:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
yup, you could definitely edit that line and have it sendChannelMessage instead and would fit your intended purposeSo you mean editing dropcorpse.lua? this line
?Lua:killer:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
well, just Create a new Channel "Loot" then you can replace this line with this :So you mean editing dropcorpse.lua? this line
?Lua:killer:sendTextMessage(MESSAGE_INFO_DESCR, string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
sendChannelMessage(channelid, TALKTYPE_CHANNEL_O,string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
where is dropcorpse.lua? i reviewed latest forgottenserver and it does not have it there's only default_onDropLoot.luawell, just Create a new Channel "Loot" then you can replace this line with this :
Lua:sendChannelMessage(channelid, TALKTYPE_CHANNEL_O,string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
replace channelid with the id you used at chatchannels.xml
local ec = EventCallback
ec.onDropLoot = function(self, 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)
sendChannelMessage(11, TALKTYPE_CHANNEL_O,string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
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)
sendChannelMessage(11, TALKTYPE_CHANNEL_O,string.format("Loot of %s: %s", monster:getName():lower(), next(lootItems) and table.concat(lootItems, ", ") or "nothing."))
end
end
end
ec:register()
function onLogin(cid)
local player = Player(cid)
player:openChannel(11)
return true
end
--local STORAGEVALUE_LOOT = 8914
function onSpeak(player, type, message)
local player = Player(corpse:getCorpseOwner())
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
<channel id="11" name="Loot Channel" script="looter.lua" />
<event type="login" name="Looter" script="loot.lua"/>