Skip to content

Commit

Permalink
Mobs: Traders: extract to separate mod. Closes #1148
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Sep 26, 2023
1 parent 24e60ce commit dfbd4c8
Show file tree
Hide file tree
Showing 19 changed files with 340 additions and 323 deletions.
9 changes: 9 additions & 0 deletions mods/lord/Entities/lord_traders/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local mod_path = minetest.get_modpath(minetest.get_current_modname())
local old_require = require
require = function(name) return dofile(mod_path .. "/src/" .. name:gsub("%.", "/") .. ".lua") end


require("traders")


require = old_require
94 changes: 94 additions & 0 deletions mods/lord/Entities/lord_traders/locale/lottmobs.en.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# textdomain: lord_traders

Trader=Trader
Hello=Hello
's stock:='s stock:
Selection=Selection
Price=Price
Payment=Payment
Brought items=Brought items

### traders/config.lua (messages) ###
We have many treasures, and for the right price we might be willing to part with them...=We have many treasures, and for the right price we might be willing to part with them...
Don't even think of stealing our treasure... If you do, heads shall roll.=Don't even think of stealing our treasure... If you do, heads shall roll.
What are you doing here? What do you want from us?=What are you doing here? What do you want from us?
Be careful when you enter our homes, a fall from the ladder could well prove deadly.=Be careful when you enter our homes, a fall from the ladder could well prove deadly.
If you want to mine, do so. There's plenty of iron to go around!=If you want to mine, do so. There's plenty of iron to go around!
If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly.=If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly.
Welcome to our lovely forest home, weary traveler. Refresh yourself here.=Welcome to our lovely forest home, weary traveler. Refresh yourself here.
Sauron grows in power. Shall we be able to vanquish him again?=Sauron grows in power. Shall we be able to vanquish him again?
We are a peace loving people, but if we are angered, our wrath is terrible!=We are a peace loving people, but if we are angered, our wrath is terrible!
Rest among us and prepare yourself, for war is imminent.=Rest among us and prepare yourself, for war is imminent.
If you wish to buy goods from us, there are certain traders who wander our land.=If you wish to buy goods from us, there are certain traders who wander our land.
Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme.=Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme.
Ah, what a lovely land we have, so peaceful, so beautiful.=Ah, what a lovely land we have, so peaceful, so beautiful.
There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?=There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?
If you are in need of any food, there are traders who wander around and they usually have a good stock.=If you are in need of any food, there are traders who wander around and they usually have a good stock.
If you are thinking that you'll find adventures here, think again! Good day!=If you are thinking that you'll find adventures here, think again! Good day!
We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt.=We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt.
Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes...=Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes...
War comes swiftly... We are preparing, but are we doing enough?=War comes swiftly... We are preparing, but are we doing enough?
The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods.=The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods.
Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together.=Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together.
Don't listen to those who say that all this talk of war will come to nothing, for we are at war now.=Don't listen to those who say that all this talk of war will come to nothing, for we are at war now.
We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!=We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!
Life here is far from normal. We wish for peace, yet the only way we can get peace is through war...=Life here is far from normal. We wish for peace, yet the only way we can get peace is through war...
DIE!!!", "Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!=DIE!!!", "Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!
Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!", "KILL! KILL! KILL!=Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!", "KILL! KILL! KILL!

### traders/config.lua (names) ###
#dwarf
Azaghâl=Azaghâl
Balbrin=Balbrin
Borin=Borin
Farin=Farin
Flói=Flói
Frerin=Frerin
Grór=Grór
Lóni=Lóni
Náli=Náli
Narvi=Narvi
Telchar=Telchar
Thion=Thion

#elf
Annael=Annael
Anairë=Anairë
Curufin=Curufin
Erestor=Erestor
Gwindor=Gwindor
Irimë=Irimë
Oropher=Oropher
Maglor=Maglor
Quennar=Quennar
Rúmil=Rúmil
Orgof=Orgof
Voronwë=Voronwë

#hobbit
Adalgrim=Adalgrim
Bodo=Bodo
Cotman=Cotman
Doderic=Doderic
Falco=Falco
Gormadoc=Gormadoc
Hobson=Hobson
Ilberic=Ilberic
Largo=Largo
Madoc=Madoc
Orgulas=Orgulas
Rorimac=Rorimac

#human
Aratan=Aratan
Arvegil=Arvegil
Belegorn=Belegorn
Celepharn=Celepharn
Dúnhere=Dúnhere
Elatan=Elatan
Gilraen=Gilraen
Írimon=Írimon
Minardil=Minardil
Oromendil=Oromendil
Tarcil=Tarcil
Vorondil=Vorondil
94 changes: 94 additions & 0 deletions mods/lord/Entities/lord_traders/locale/lottmobs.ru.tr
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# textdomain: lord_traders

Trader=Торговец
Hello=Привет
's stock:=, товары:
Selection=Товар
Price=Цена
Payment=Оплата
Brought items=Покупка

### traders/config.lua (messages) ###
We have many treasures, and for the right price we might be willing to part with them...=У нас много сокровищ, и за правильную цену мы могли бы с ними расстаться...
Don't even think of stealing our treasure... If you do, heads shall roll.=Даже не думайте о том, чтобы украсть наше сокровище ... Если вы это сделаете, лишитесь головы.
What are you doing here? What do you want from us?=Что вы здесь делаете? Что вы хотите от нас?
Be careful when you enter our homes, a fall from the ladder could well prove deadly.=Будьте осторожны, когда вы входите в наши дома, падение с лестницы может оказаться смертельным.
If you want to mine, do so. There's plenty of iron to go around!=Если вы хотите добывать, то добывайте. Вокруг много железа, в перед и с песней!
If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly.=Если вы рискнете зарыться глубоко под землю, берегитесь! Монстры там очень сильные, и убивают неподготовленного мгновенно.
Welcome to our lovely forest home, weary traveler. Refresh yourself here.=Добро пожаловать в наш прекрасный лесной дом, утомленный путешественник. Передохните здесь.
Sauron grows in power. Shall we be able to vanquish him again?=Власть Саурона растет. Сможем ли мы снова его победить?
We are a peace loving people, but if we are angered, our wrath is terrible!=Мы не злопамятные, но злые и память у нас хорошая!
Rest among us and prepare yourself, for war is imminent.=Нам всем нужно готовиться, потому что война неизбежна.
If you wish to buy goods from us, there are certain traders who wander our land.=Хочешь что-то купить покупай, или проваливай от сюда.
Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme.=Осторожно! Мы все ходим по лезвию ножа. Одно ложное движение - все закончится, а Саурон будет правителем всего и вся.
Ah, what a lovely land we have, so peaceful, so beautiful.=Ах, какая прекрасная земля у нас, такая мирная, такая красивая.
There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?=Нет ничего лучше запаха дымящейся трубки, в холодное октябрьское утро, не так ли?
If you are in need of any food, there are traders who wander around and they usually have a good stock.=Если вам нужна еда, найдите торговца, который бродит неподалеку, у него обычно большой выбор.
If you are thinking that you'll find adventures here, think again! Good day!=Если вы думаете, что здесь найдете приключения, подумайте еще раз! Добрый вечер!
We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt.=Мы слышим рассказы о войне, и нам кажется что это сказки - как у Олифаунта.
Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes...=Пища должна нравиться, и внешне и на вкус. Иногда нужно не просто поесть немного здесь и немного там, а посидеть в хорошей компании.
War comes swiftly... We are preparing, but are we doing enough?=Война надвигается быстро ... Мы готовимся, но ко всему ли?
The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods.=Благородная раса людей вновь расцветает! Даже гномы начинают проявлять интерес к некоторым нашим товарам.
Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together.=Готовы ли вы сразиться вместе с нами? Нам многое предстоит потерять, но еще больше мы должны выиграть! Нам нужно сплотиться вместе.
Don't listen to those who say that all this talk of war will come to nothing, for we are at war now.=Не слушайте тех, кто говорит, что все эти разговоры о войне ни к чему не приведут, они просто тролли.
We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!=Мы терпим набеги орков и других тварей, и ничего не делаем! Мы должны действовать и действовать немедленно!
Life here is far from normal. We wish for peace, yet the only way we can get peace is through war...=Жизнь здесь далека от идеала. Мы желаем мира, но единственный способ получить мир - это война...
DIE!!!, Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!=УМРИ!!! Убббббллллллюююююдддддооокккккк!!
Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!, KILL! KILL! KILL!=Хрррррррррррррррррррр!, СМЕРТЬ! СМЕРТЬ! СМЕРТЬ!

### trader_goods.lua ###
#dwarf
Azaghâl=Azaghâl
Balbrin=Balbrin
Borin=Borin
Farin=Farin
Flói=Flói
Frerin=Frerin
Grór=Grór
Lóni=Lóni
Náli=Náli
Narvi=Narvi
Telchar=Telchar
Thion=Thion

#elf
Annael=Annael
Anairë=Anairë
Curufin=Curufin
Erestor=Erestor
Gwindor=Gwindor
Irimë=Irimë
Oropher=Oropher
Maglor=Maglor
Quennar=Quennar
Rúmil=Rúmil
Orgof=Orgof
Voronwë=Voronwë

#hobbit
Adalgrim=Adalgrim
Bodo=Bodo
Cotman=Cotman
Doderic=Doderic
Falco=Falco
Gormadoc=Gormadoc
Hobson=Hobson
Ilberic=Ilberic
Largo=Largo
Madoc=Madoc
Orgulas=Orgulas
Rorimac=Rorimac

#human
Aratan=Aratan
Arvegil=Arvegil
Belegorn=Belegorn
Celepharn=Celepharn
Dúnhere=Dúnhere
Elatan=Elatan
Gilraen=Gilraen
Írimon=Írimon
Minardil=Minardil
Oromendil=Oromendil
Tarcil=Tarcil
Vorondil=Vorondil
94 changes: 94 additions & 0 deletions mods/lord/Entities/lord_traders/locale/template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# textdomain: lord_traders

Trader=
Hello=
's stock:=
Selection=
Price=
Payment=
Brought items=

### traders/config.lua (messages) ###
We have many treasures, and for the right price we might be willing to part with them...=
Don't even think of stealing our treasure... If you do, heads shall roll.=
What are you doing here? What do you want from us?=
Be careful when you enter our homes, a fall from the ladder could well prove deadly.=
If you want to mine, do so. There's plenty of iron to go around!=
If you venture deep underground, beware! The monsters there are very powerful, and kill the unprepared instantly.=
Welcome to our lovely forest home, weary traveler. Refresh yourself here.=
Sauron grows in power. Shall we be able to vanquish him again?=
We are a peace loving people, but if we are angered, our wrath is terrible!=
Rest among us and prepare yourself, for war is imminent.=
If you wish to buy goods from us, there are certain traders who wander our land.=
Beware! Our society, and all societies, are on the edge of a knife blade - one false move and all will end, and Sauron will rule supreme.=
Ah, what a lovely land we have, so peaceful, so beautiful.=
There's nothing quite like the smell of pipe smoke rising on a cold October morning, is there?=
If you are in need of any food, there are traders who wander around and they usually have a good stock.=
If you are thinking that you'll find adventures here, think again! Good day!=
We hear tales of war, but they cannot be more than tales - like that of the Oliphaunt.=
Food is meant to be enjoyed, not rushed. Don't just eat a little here and a little there, sit down for a proper meal sometimes...=
War comes swiftly... We are preparing, but are we doing enough?=
The noble race of man rises in the world! Even the dwarves are starting to show interest in some of our goods.=
Are you willing to fight with us? We have much to lose, but much to gain also! We must rally together.=
Don't listen to those who say that all this talk of war will come to nothing, for we are at war now.=
We suffer raids from orcs, and other evil things, yet we do nothing! We must act, and act with force!=
Life here is far from normal. We wish for peace, yet the only way we can get peace is through war...=
DIE!!!, Urrrrrrrrrrrrrghhhhhhhhhhhhhhhhhhh!!=
Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!, KILL! KILL! KILL!=

### trader_goods.lua ###
#dwarf
Azaghâl=
Balbrin=
Borin=
Farin=
Flói=
Frerin=
Grór=
Lóni=
Náli=
Narvi=
Telchar=
Thion=

#elf
Annael=
Anairë=
Curufin=
Erestor=
Gwindor=
Irimë=
Oropher=
Maglor=
Quennar=
Rúmil=
Orgof=
Voronwë=

#hobbit
Adalgrim=
Bodo=
Cotman=
Doderic=
Falco=
Gormadoc=
Hobson=
Ilberic=
Largo=
Madoc=
Orgulas=
Rorimac=

#human
Aratan=
Arvegil=
Belegorn=
Celepharn=
Dúnhere=
Elatan=
Gilraen=
Írimon=
Minardil=
Oromendil=
Tarcil=
Vorondil=
11 changes: 11 additions & 0 deletions mods/lord/Entities/lord_traders/mod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name = lord_traders
description = Traders mobs for LORD. (Builtin game mod)
depends = mobs, lottmobs, lottarmor, lottother, lord_money
optional_d = default, farming, boats, tools, lottblocks, lottplants, lottores, lottthrowing, lottfarming, lottpotion, lord_books

# mobs -- uses common engine 'mobs redo'
# lottmobs -- uses sounds & mod prefix `:lottmobs` for entities. Its for no aliases for old entities on map.
# lottarmor -- uses model (& goods)
# lottother -- follows lottother:narya (& goods)
# lord_money -- trading coins
#other mods uses for trading (items/goods)
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ local mod_path = minetest.get_modpath(minetest.get_current_modname())
local require = function(name) return dofile(mod_path .. "/src/" .. name:gsub("%.", "/") .. ".lua") end


local trader = require("trader")
local trader = require("traders.trader")


trader.register("lottmobs:elf_trader", {
trader.register(":lottmobs:elf_trader", {
race = "elf",
hp_min = 20,
hp_max = 50,
Expand All @@ -14,7 +14,6 @@ trader.register("lottmobs:elf_trader", {
{ "lottmobs_elf_trader.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png" },
},
visual_size = { x = 0.95, y = 1.15 },
mesh = "lottarmor_character_old.b3d",
view_range = 20,
walk_velocity = 1.5,
run_velocity = 5,
Expand All @@ -28,22 +27,21 @@ trader.register("lottmobs:elf_trader", {
},
})

trader.register("lottmobs:human_trader", {
trader.register(":lottmobs:human_trader", {
race = "man",
hp_min = 15,
hp_max = 35,
collisionbox = { -0.3, -1.0, -0.3, 0.3, 0.8, 0.3 },
textures = {
{ "lottmobs_human_trader.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png" },
},
mesh = "lottarmor_character_old.b3d",
view_range = 12,
run_velocity = 3,
armor = 100,
damage = 5,
})

trader.register("lottmobs:hobbit_trader", {
trader.register(":lottmobs:hobbit_trader", {
race = "hobbit",
hp_min = 5,
hp_max = 15,
Expand All @@ -52,7 +50,6 @@ trader.register("lottmobs:hobbit_trader", {
{ "lottmobs_hobbit_trader.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png" },
},
visual_size = { x = 1.1, y = 0.75 },
mesh = "lottarmor_character_old.b3d",
armor = 300,
lava_damage = 5,
follow = nil,
Expand All @@ -62,7 +59,7 @@ trader.register("lottmobs:hobbit_trader", {
sounds = nil,
})

trader.register("lottmobs:dwarf_trader", {
trader.register(":lottmobs:dwarf_trader", {
race = "dwarf",
hp_min = 20,
hp_max = 30,
Expand All @@ -71,14 +68,13 @@ trader.register("lottmobs:dwarf_trader", {
{ "lottmobs_dwarf_trader.png", "lottarmor_trans.png", "lottarmor_trans.png", "lottarmor_trans.png" },
},
visual_size = { x = 1.1, y = 0.85 },
mesh = "lottarmor_character_old.b3d",
view_range = 10,
run_velocity = 2,
armor = 200,
damage = 4,
})

mobs:spawn_specific("lottmobs:elf_trader", {"lottmapgen:lorien_grass"}, {"air"}, 0, 20, 30, 90000, 2, -31000, 31000)
mobs:spawn_specific("lottmobs:elf_trader", {"lottmapgen:lorien_grass"}, {"air"}, -1, 20, 30, 90000, 2, -31000, 31000)
mobs:spawn_specific("lottmobs:human_trader", {"lottmapgen:rohan_grass"}, {"air"}, -1, 20, 30, 90000, 2, -31000, 31000)
mobs:spawn_specific("lottmobs:human_trader", {"lottmapgen:gondor_grass"}, {"air"}, -1, 20, 30, 90000, 2, -31000, 31000)
mobs:spawn_specific("lottmobs:hobbit_trader",{"lottmapgen:shire_grass"}, {"air"}, -1, 20, 30, 90000, 2, -31000, 31000)
Expand Down
Loading

0 comments on commit dfbd4c8

Please sign in to comment.