Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

[Enhancement] - Added boolean value to enable or disable greeting, ungreeting and trade npc callback #742

Merged
merged 6 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion data/npc/....lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_bearded_woman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ keywordHandler:addKeyword({'plundering'}, StdModule.say, {npcHandler = npcHandle

npcHandler:setMessage(MESSAGE_GREET, "GET ME OUT OF HERE! NOW!")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_beautiful_girl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end

npcHandler:setMessage(MESSAGE_GREET, "So you have come, |PLAYERNAME|. I hoped you would not...")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_beggar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ npcHandler:setMessage(MESSAGE_GREET, "Hi! What is it, what d'ye {want}?")

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_behemoth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_confused_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dark_priestess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dead_bureaucrat1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and don't forget me!")

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dead_bureaucrat2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and don't forget me!")

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dead_bureaucrat3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and don't forget me!")

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dead_bureaucrat4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye and don't forget me!")

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dragon_lord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dragon_mother.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_drillworm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_dwarven_ghost.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_fading_memory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ end

npcHandler:setMessage(MESSAGE_GREET, 'Oh...')

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_fluffy_squirrel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ npcHandler:setMessage(MESSAGE_FAREWELL, "Chh...")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Chh...")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Chchch. Chh! <you're not sure, but it seems that squirrel wants to trade your valuable acorns for useless stones that it found and considered uneatable>")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_frog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ keywordHandler:addKeyword({'ribbit'}, StdModule.say, {npcHandler = npcHandler, t
npcHandler:setMessage(MESSAGE_GREET, "*sigh* Yet another dumb adventurer.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Yeah, good bye and don't come again!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Hah! That idiot finally left.")
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_ghostly_guardian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_ghostly_knight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_ghostly_sage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ npcHandler:setMessage(MESSAGE_GREET, "Ah, I feel a mortal walks these ancient ha
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Farewell then.")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_ghostly_woman.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ npcHandler:setMessage(MESSAGE_GREET, "I feel you. I hear your thoughts. You are
npcHandler:setMessage(MESSAGE_FAREWELL, "Alone ... so alone. So cold.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Alone ... so alone. So cold.")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_ghostly_woman_ghostland.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_goblin_exile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ npcType.onThink = function(npc, interval)
npcHandler:onThink(npc, interval)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_grumpy_cyclops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_lost_basher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_lost_husher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_lost_soul.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_lost_thrower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_majestic_warwolf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Interesting. A human who can speak the language of wolves.")
npcHandler:setMessage(MESSAGE_FAREWELL, "YOOOOUHHOOOUU!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "YOOOOUHHOOOUU!")
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_nightmare_scion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_prisoner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ npcHandler:setMessage(MESSAGE_GREET, "Huh? What? I can see! Wow! A non-mino. Did

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_restless_soul.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_sleeping_dragon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
1 change: 1 addition & 0 deletions data/npc/a_starving_dog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ end
npcHandler:setMessage(MESSAGE_WALKAWAY, "")
keywordHandler:addGreetKeyword({"sniffler"}, {npcHandler = npcHandler, text = "<sniff>"})
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_strange_chalice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ local function creatureSayCallback(npc, creature, type, message)
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_strange_fellow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_swan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ end

npcHandler:setMessage(MESSAGE_GREET, "I salute you, mortal being.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_sweaty_cyclops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Hum Humm! Welcume lil' |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye lil' one.")

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_tainted_soul.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_tortured_soul.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ npcType.onCloseChannel = function(npc, creature)
npcHandler:onCloseChannel(npc, creature)
end

npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_vulcongra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ local function greetCallback(npc, creature)
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_weakened_forest_fury.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
2 changes: 1 addition & 1 deletion data/npc/a_wrinkled_bonelord.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ keywordHandler:addKeyword({'language'}, StdModule.say, {npcHandler = npcHandler,
npcHandler:setMessage(MESSAGE_GREET, "What is this? An optically challenged entity called |PLAYERNAME|. How fascinating!")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Wait right there. I will eat you after writing down what I found out.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Wait right there. I will eat you after writing down what I found out.")
npcHandler:addModule(FocusModule:new())
npcHandler:addModule(FocusModule:new(), npcConfig.name, true, true, true)

-- npcType registering the npcConfig table
npcType:register(npcConfig)
Loading