Farmer: Add trading list.

Add 6 cotton seeds as initial inventory.
This commit is contained in:
Hector Franqui 2017-09-21 18:55:29 -04:00
parent 5a79b9a119
commit 164e09bed5
1 changed files with 17 additions and 4 deletions

View File

@ -36,7 +36,9 @@ local farmer_def = {
{type="field", origin_building_types={"hut", "house", "lumberjack"}} {type="field", origin_building_types={"hut", "house", "lumberjack"}}
}, },
walkable_nodes = farming_plants, walkable_nodes = farming_plants,
initial_inventory = {}, initial_inventory = {
{name="farming:seed_cotton", count=6}
},
schedules_entries = { schedules_entries = {
[6] = { [6] = {
-- Get out of bed -- Get out of bed
@ -481,21 +483,32 @@ local farmer_def = {
}, },
chance = 50 chance = 50
}, },
-- Change trader status to "trader" -- Set trade list - what NPC will buy and what NPC will sell
[2] = { [2] = {
property = npc.schedule_properties.set_trade_list, args = {
items = {
[1] = {name="farming:seed_cotton", sell=5, keep=5},
[2] = {name="farming:cotton", sell=10},
[3] = {name="bucket:bucket_empty", buy=2},
[4] = {name="farming:hoe_stone", buy=2}
}
}
},
-- Change trader status to "trader"
[3] = {
property = npc.schedule_properties.trader_status, args = { property = npc.schedule_properties.trader_status, args = {
status = npc.trade.TRADER status = npc.trade.TRADER
}, },
chance = 90 chance = 90
}, },
[3] = { [4] = {
property = npc.schedule_properties.can_receive_gifts, args = { property = npc.schedule_properties.can_receive_gifts, args = {
can_receive_gifts = false can_receive_gifts = false
}, },
depends = {1} depends = {1}
}, },
-- Allow mobs_redo wandering -- Allow mobs_redo wandering
[4] = {action = npc.actions.cmd.FREEZE, args = {freeze = false}} [5] = {action = npc.actions.cmd.FREEZE, args = {freeze = false}}
}, },
-- Schedule entry for 6 in the evening -- Schedule entry for 6 in the evening
[18] = { [18] = {