Moved some talk code to lua

This commit is contained in:
Henrique Santiago
2012-08-07 13:33:08 -03:00
parent 6feaeff8cc
commit 0e67bd97a5
4 changed files with 15 additions and 11 deletions

View File

@@ -428,7 +428,6 @@ function setIgnoreNpcMessages(ignore)
ignoreNpcMessages = ignore
end
function navigateMessageHistory(step)
local numCommands = #messageHistory
if numCommands > 0 then
@@ -455,6 +454,16 @@ end
function onTalk(name, level, mode, message, channelId, creaturePos)
if ignoreNpcMessages and mode == MessageModes.NpcFrom then return end
if (mode == MessageModes.Say or mode == MessageModes.Whisper or mode == MessageModes.Yell or
mode == MessageModes.Spell or mode == MessageModes.MonsterSay or mode == MessageModes.MonsterYell or
mode == MessageModes.NpcFrom or mode == MessageModes.BarkLow or mode == MessageModes.BarkLoud) and
creaturePos then
local staticText = StaticText.create()
staticText:addMessage(name, mode, message)
g_map.addThing(staticText, creaturePos, -1)
end
local defaultMessage = mode < 3 and true or false
speaktype = SpeakTypes[mode]

View File

@@ -94,7 +94,7 @@ function displayMessage(mode, text)
end
function displayPrivateMessage(text)
displayMessage(254, text)
displayMessage(254, text)
end
function displayStatusMessage(text)