yokoderaxd
New Member
- Joined
- Oct 22, 2016
- Messages
- 16
- Reaction score
- 4
1) Create the variable for the Loot tab
Look at the top of the file where the variables are:
It should stay next to:
2) Create function to display Loot messages
Find a free area before:
add:
3) Create a Loot tab when entering the game
Search:
Inside look for:
Add below:
4) Prevent the player from typing in the Loot tab
Look for function:
after:
add:
5) Clean Loot tab when disconnecting
Search:
Search:
add below:
8) Search function:
searh:
change for:
9) search function
seach:
change for:
10) search function
search:
change for
11) Register function to receive Opcode
Add at the end of the file:
12) Create Extended Opcode receiver module:
Create file: modules/game_loot/loot.lua
Create File: modules/game_loot/loot.otmod
13)Search on the server: data/scripts/eventcallbacks/monster/default_onDropLoot.lua
find:
add below the two:
Sorry for my English but I speak Spanish xD
Look at the top of the file where the variables are:
Code:
lootTab = nil
Code:
defaultTab = nil
serverTab = nil
lootTab = nil
Find a free area before:
Code:
function clear()
Code:
function addLootMessage(text)
if not lootTab then
return
end
addTabText(text, SpeakTypesSettings.channelOrange, lootTab)
end
Search:
Code:
function online()
Code:
defaultTab = addTab(tr('Default'), true)
serverTab = addTab(tr('Server Log'), false)
Code:
lootTab = addTab("Loot", false)
Look for function:
Code:
function sendMessage(message, tab)
Code:
local tab = tab or getCurrentTab()
Code:
if tab == lootTab then
return true
end
5) Clean Loot tab when disconnecting
Search:
Code:
function clear()
Code:
consoleTabBar:removeTab(serverTab)
serverTab = nil
Code:
consoleTabBar:removeTab(lootTab)
lootTab = nil
8) Search function:
Code:
function removeTab(tab)
Code:
if tab == defaultTab or tab == serverTab then
return
end
Code:
if tab == defaultTab or tab == serverTab or tab == lootTab then
return
end
9) search function
Code:
function processChannelTabMenu(tab, mousePos, mouseButton)
Code:
if tab ~= defaultTab and tab ~= serverTab then
Code:
if tab ~= defaultTab and tab ~= serverTab and tab ~= lootTab then
10) search function
Code:
function onTabChange(tabBar, tab)
Code:
if tab == defaultTab or tab == serverTab then
Code:
if tab == defaultTab or tab == serverTab or tab == lootTab then
11) Register function to receive Opcode
Add at the end of the file:
Code:
modules.game_console = modules.game_console or {}
modules.game_console.addLootMessage = addLootMessage
12) Create Extended Opcode receiver module:
Create file: modules/game_loot/loot.lua
Code:
local LOOT_OPCODE = 226
function init()
ProtocolGame.registerExtendedOpcode(LOOT_OPCODE, onLootOpcode)
end
function terminate()
ProtocolGame.unregisterExtendedOpcode(LOOT_OPCODE)
end
function onLootOpcode(protocol, opcode, buffer)
modules.game_console.addLootMessage(buffer)
end
Code:
Module
name: game_loot
description: Loot Channel
author: Mclovin
website:
sandboxed: true
autoload: true
scripts: [ loot ]
@onLoad: init()
@onUnload: terminate()
13)Search on the server: data/scripts/eventcallbacks/monster/default_onDropLoot.lua
find:
Code:
player:sendTextMessage(MESSAGE_INFO_DESCR, text)
Code:
player:sendExtendedOpcode(226, text)
Post automatically merged:
Sorry for my English but I speak Spanish xD
Last edited: