hooks.lua in tibia script:
Spoiler
addhook("say","EXPsay",-10)
function EXPsay(id,words)
if PLAYERS[id].tmp.exhaust.talk then return 1 end
PLAYERS[id].tmp.exhaust.talk = true
addtimer(CONFIG.EXHAUST.TALK, rawset, PLAYERS[id].tmp.exhaust, "talk", false)
if words:sub(1,1) == '!' then
command = words:sub(2):split(' ')
local func = COMMANDS[command[1]]
if func then
table.remove(command,1)
func(id,command)
end
return 1
end
if not PLAYERS[id].Tutorial.say then
message(id, "Talking! I don't think you need a tutorial on that, but just to let you know, whatever you say can only be heard by people around you.", "255128000")
PLAYERS[id].Tutorial.say = true
end
local picture = 'gfx/weiwen/talk.png'
words = words:gsub('%s+', ' ')
local radiusx, radiusy, colour, action
if words:sub(-1) == '!' then
words = words:upper()
action = "yells"
radiusx, radiusy = 1280, 960
elseif words:sub(-1) == '?' then
action = "asks"
picture = 'gfx/weiwen/ask.png'
elseif words:sub(1,2) == '::' then
words = words:sub(3)
action = "whispers"
radiusx, radiusy = 48, 48
end
if words:find':D' or words:find'=D' or words:find':)' or words:find'=)' or words:find'%(:' or words:find'%(=' or words:find'xD' or words:find'lol' or words:find'haha' then
picture = 'gfx/weiwen/happy.png'
elseif words:find'>:%(' or words:find':@' or words:find'fuck' or words:find'shit' or words:find'ass' then
picture = 'gfx/weiwen/angry.png'
elseif words:find':%(' or words:find'=%(' or words:find'):' or words:find'):' or words:find':\'%(' or words:find':<' then
picture = 'gfx/weiwen/sad.png'
end
addtimer(1000, freeimage, image(picture, 0, 0, 200+id))
local code = words:lower()
if code:sub(1,1) == '^' then
colour = CONFIG.COLOURS[code:sub(2,2)]
end
if player(id,"team") == 0 then
radiusx, radiusy = 0, 0
end
local text = string.format("\169%s %s %s %s : %s", colour or "255255100", os.date'%X', player(id, "name"), action or "says", words)
text = "\169" .. (colour or "255255100") .. os.date'%X' .. " " .. player(id, "name") .. " " .. (action or "says") .. " : " .. words
radiusmsg(text, player(id, 'x'), player(id, 'y'), radiusx, radiusy)
return 1
end
addhook("say","_EXPsay",100)
function _EXPsay(id,words)
return 1
end
function EXPsay(id,words)
if PLAYERS[id].tmp.exhaust.talk then return 1 end
PLAYERS[id].tmp.exhaust.talk = true
addtimer(CONFIG.EXHAUST.TALK, rawset, PLAYERS[id].tmp.exhaust, "talk", false)
if words:sub(1,1) == '!' then
command = words:sub(2):split(' ')
local func = COMMANDS[command[1]]
if func then
table.remove(command,1)
func(id,command)
end
return 1
end
if not PLAYERS[id].Tutorial.say then
message(id, "Talking! I don't think you need a tutorial on that, but just to let you know, whatever you say can only be heard by people around you.", "255128000")
PLAYERS[id].Tutorial.say = true
end
local picture = 'gfx/weiwen/talk.png'
words = words:gsub('%s+', ' ')
local radiusx, radiusy, colour, action
if words:sub(-1) == '!' then
words = words:upper()
action = "yells"
radiusx, radiusy = 1280, 960
elseif words:sub(-1) == '?' then
action = "asks"
picture = 'gfx/weiwen/ask.png'
elseif words:sub(1,2) == '::' then
words = words:sub(3)
action = "whispers"
radiusx, radiusy = 48, 48
end
if words:find':D' or words:find'=D' or words:find':)' or words:find'=)' or words:find'%(:' or words:find'%(=' or words:find'xD' or words:find'lol' or words:find'haha' then
picture = 'gfx/weiwen/happy.png'
elseif words:find'>:%(' or words:find':@' or words:find'fuck' or words:find'shit' or words:find'ass' then
picture = 'gfx/weiwen/angry.png'
elseif words:find':%(' or words:find'=%(' or words:find'):' or words:find'):' or words:find':\'%(' or words:find':<' then
picture = 'gfx/weiwen/sad.png'
end
addtimer(1000, freeimage, image(picture, 0, 0, 200+id))
local code = words:lower()
if code:sub(1,1) == '^' then
colour = CONFIG.COLOURS[code:sub(2,2)]
end
if player(id,"team") == 0 then
radiusx, radiusy = 0, 0
end
local text = string.format("\169%s %s %s %s : %s", colour or "255255100", os.date'%X', player(id, "name"), action or "says", words)
text = "\169" .. (colour or "255255100") .. os.date'%X' .. " " .. player(id, "name") .. " " .. (action or "says") .. " : " .. words
radiusmsg(text, player(id, 'x'), player(id, 'y'), radiusx, radiusy)
return 1
end
addhook("say","_EXPsay",100)
function _EXPsay(id,words)
return 1
end
It is possible to fix it without losing functionality?
Also, Nickname on Cyrillics from Steam is also displayed incorrectly on a board (when you hover mouse over the player)