Rework of quests with multiple dependencies system (work in progress...)

This commit is contained in:
sys4-fr 2016-05-22 17:56:09 +02:00
parent f0833c12a0
commit fd3c4d3cab
10 changed files with 119 additions and 686 deletions

View File

@ -1,5 +0,0 @@
sys4_quests
minetest_quests
3d_armor
shields?
ethereal?

View File

@ -1,102 +0,0 @@
-- 3d_armor Quests
-- By Sys4
-- This mod add quests based on 3d_armor and shields mod
if not minetest.get_modpath("sys4_quests")
or not minetest.get_modpath("3d_armor") then
return
end
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local ins = table.insert
local up = sys4_quests.updateQuest
---------- Quests for 3d_armor mod ----------
local mod = "3d_armor"
local quests = sys4_quests.initQuests(mod, S)
----- Quests with type="dig" -----
local t = "dig"
-- cactus_digger
ins(quests, {
'cactus_digger', "Cactus Digger", nil, {'default:cactus'}, 50, {'3d_armor:boots_cactus', '3d_armor:chestplate_cactus', '3d_armor:helmet_cactus', '3d_armor:leggings_cactus'}, 'wood_crafter', type = t
})
-- gold_digger
up('gold_digger', nil, {'3d_armor:boots_gold', '3d_armor:chestplate_gold', '3d_armor:helmet_gold', '3d_armor:leggings_gold'})
-- diamond_digger
up('diamond_digger', nil, {'3d_armor:boots_diamond', '3d_armor:chestplate_diamond', '3d_armor:helmet_diamond', '3d_armor:leggings_diamond'})
----- Quests with type="craft" -----
t = "craft"
-- sword_crafter
ins(quests, {
'sword_crafter', "Sword Crafter", nil, {'default:sword_wood'}, 2, {'3d_armor:boots_wood', '3d_armor:chestplate_wood', '3d_armor:helmet_wood', '3d_armor:leggings_wood'}, 'wood_crafter', type = t
})
-- sword_crafter_lover
ins(quests, {
'sword_crafter_lover', "Sword Crafter Lover", nil, {'default:sword_steel'}, 2, {'3d_armor:boots_steel', '3d_armor:chestplate_steel', '3d_armor:helmet_steel', '3d_armor:leggings_steel'}, 'iron_digger', type = t
})
-- sword_crafter_pro
ins(quests, {
'sword_crafter_pro', "Sword Crafter Pro", nil, {'default:sword_bronze'}, 2, {'3d_armor:boots_bronze', '3d_armor:chestplate_bronze', '3d_armor:helmet_bronze', '3d_armor:leggings_bronze'}, 'bronze_crafter', type = t
})
-- ethereal_sword_crafter
if minetest.get_modpath("ethereal") then
ins(quests, {
'ethereal_sword_crafter', "Ethereal Sword Crafter", nil, {'ethereal:sword_crystal'}, 2, {'3d_armor:boots_crystal', '3d_armor:chestplate_crystal', '3d_armor:helmet_crystal', '3d_armor:leggings_crystal'}, 'crystal_crafter', type = t
})
end
-- Register quests
sys4_quests.registerQuests(mod)
mod = 'shields'
if minetest.get_modpath(mod) then
sys4_quests.initQuests(mod, S)
t = 'dig'
-- cactus_digger UP
up('cactus_digger', nil, {'shields:shield_cactus'})
-- gold_digger UP
up('gold_digger', nil, {'shields:shield_gold'})
-- diamond_digger UP
up('diamond_digger', nil, {'shields:shield_diamond'})
t = "place"
-- furnace_builder UP
up('furnace_builder', nil, {'shields:shield_enhanced_wood', 'shields:shield_enhanced_cactus'})
t = "craft"
-- sword_crafter UP
up('sword_crafter', nil, {'shields:shield_wood'})
-- sword_crafter_lover UP
up('sword_crafter_lover', nil, {'shields:shield_steel'})
-- sword_crafter_pro UP
up('sword_crafter_pro', nil, {'shields:shield_bronze'})
if minetest.get_modpath("ethereal") then
up('ethereal_sword_crafter', nil, {'shields:shield_crystal'})
end
end

View File

@ -1,51 +0,0 @@
Cactus Digger = Coupe du cactus
Sword Crafter = Fabrique des épées en Bois
Sword Crafter Lover = Fabrique des épées en Acier
Sword Crafter Pro = Fabrique des épées en Bronze
Ethereal Sword Crafter = Fabrique des épées en Crystal
3d_armor:boots_cactus = Bottes en cactus
3d_armor:chestplate_cactus = Cuirasse en cactus
3d_armor:helmet_cactus = Casque en cactus
3d_armor:leggings_cactus = Jambières en cactus
3d_armor:boots_wood = Bottes en bois
3d_armor:chestplate_wood = Cuirasse en bois
3d_armor:helmet_wood = Casque en bois
3d_armor:leggings_wood = Jambières en bois
3d_armor:boots_steel = Bottes en Acier
3d_armor:chestplate_steel = Cuirasse en Acier
3d_armor:helmet_steel = Casque en Acier
3d_armor:leggings_steel = Jambières en Acier
3d_armor:boots_bronze = Bottes en Bronze
3d_armor:chestplate_bronze = Cuirasse en Bronze
3d_armor:helmet_bronze = Casque en Bronze
3d_armor:leggings_bronze = Jambières en Bronze
3d_armor:boots_gold = Bottes en Or
3d_armor:chestplate_gold = Cuirasse en Or
3d_armor:helmet_gold = Casque en Or
3d_armor:leggings_gold = Jambières en Or
3d_armor:boots_diamond = Bottes en Diamant
3d_armor:chestplate_diamond = Cuirasse en Diamant
3d_armor:helmet_diamond = Casque en Diamant
3d_armor:leggings_diamond = Jambières en Diamant
3d_armor:boots_crystal = Bottes en crystal
3d_armor:chestplate_crystal = Cuirasse en crystal
3d_armor:helmet_crystal = Casque en crystal
3d_armor:leggings_crystal = Jambières en crystal
shields:shield_wood = Bouclier en bois
shields:shield_enhanced_wood = Bouclier en bois amélioré
shields:shield_cactus = Bouclier en cactus
shields:shield_enhanced_cactus = Bouclier en cactus amélioré
shields:shield_steel = Bouclier en acier
shields:shield_bronze = Bouclier en bronze
shields:shield_gold = Bouclier en or
shields:shield_diamond = Bouclier en diamant
shields:shield_crystal = Bouclier en crystal

View File

@ -1,50 +0,0 @@
Cactus Digger =
Sword Crafter =
Sword Crafter Lover =
Sword Crafter Pro =
Ethereal Sword Crafter =
3d_armor:boots_cactus =
3d_armor:chestplate_cactus =
3d_armor:helmet_cactus =
3d_armor:leggings_cactus =
3d_armor:boots_wood =
3d_armor:chestplate_wood =
3d_armor:helmet_wood =
3d_armor:leggings_wood =
3d_armor:boots_steel =
3d_armor:chestplate_steel =
3d_armor:helmet_steel =
3d_armor:leggings_steel =
3d_armor:boots_bronze =
3d_armor:chestplate_bronze =
3d_armor:helmet_bronze =
3d_armor:leggings_bronze =
3d_armor:boots_gold =
3d_armor:chestplate_gold =
3d_armor:helmet_gold =
3d_armor:leggings_gold =
3d_armor:boots_diamond =
3d_armor:chestplate_diamond =
3d_armor:helmet_diamond =
3d_armor:leggings_diamond =
3d_armor:boots_crystal =
3d_armor:chestplate_crystal =
3d_armor:helmet_crystal =
3d_armor:leggings_crystal =
shields:shield_wood =
shields:shield_enhanced_wood =
shields:shield_cactus =
shields:shield_enhanced_cactus =
shields:shield_steel =
shields:shield_bronze =
shields:shield_gold =
shields:shield_diamond =
shields:shield_crystal =

View File

@ -1,4 +0,0 @@
ethereal
default
sys4_quests
minetest_quests

View File

@ -1,95 +0,0 @@
-- Ethereal Quests
-- By Sys4
-- This mod add quests based on ethereal mod
if not minetest.get_modpath("sys4_quests") then
return
end
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local ins = table.insert
local up = sys4_quests.updateQuest
---------- Quests for ethereal mod ----------
local mod = "ethereal"
local quests = sys4_quests.initQuests(mod, S)
----- Quests with type="dig" -----
local t = "dig"
up('tree_digger', {"ethereal:banana_trunk", "ethereal:birch_trunk", "ethereal:frost_tree", "ethereal:palm_trunk", "ethereal:redwood_trunk", "ethereal:willow_trunk", "ethereal:yellow_trunk"}, {"ethereal:banana_wood", "ethereal:birch_wood", "ethereal:frost_wood", "ethereal:palm_wood", "ethereal:redwood_wood", "ethereal:willow_wood", "ethereal:yellow_wood"})
up('crumbly_nodes_digger', {"ethereal:bamboo_dirt", "ethereal:cold_dirt", "ethereal:crystal_dirt", "ethereal:dry_dirt", "ethereal:fiery_dirt", "ethereal:gray_dirt", "ethereal:green_dirt", "ethereal:grove_dirt", "ethereal:jungle_dirt", "ethereal:mushroom_dirt", "ethereal:prairie_dirt"}, {"default:desert_sand", "ethereal:snowbrick", "ethereal:worm"})
up('papyrus_digger', {"ethereal:bamboo"}, {"ethereal:bamboo_floor"})
up('coal_digger', nil, {"ethereal:scorched_tree"})
up('stone_digger', nil, {"ethereal:stone_ladder"})
up('iron_digger', nil, {"ethereal:bucket_cactus"})
up('mese_digger', nil, {"ethereal:light_staff"})
up("wood_crafter", nil, {'ethereal:bowl'})
----- Quests with type="craft" -----
t = "craft"
up('wood_crafter', {"ethereal:banana_wood", "ethereal:birch_wood", "ethereal:frost_wood", "ethereal:palm_wood", "ethereal:redwood_wood", "ethereal:willow_wood", "ethereal:yellow_wood"}, {'ethereal:bowl'})
up('sticks_crafter', nil, {'ethereal:paper_wall', 'ethereal:fishing_rod', 'ethereal:fishing_rod_baited', 'ethereal:fence_acacia', 'ethereal:fence_banana', 'ethereal:fence_birch', 'ethereal:fence_frostwood', 'ethereal:fence_junglewood', 'ethereal:fence_mushroom', 'ethereal:fence_palm', 'ethereal:fence_pine', 'ethereal:fence_redwood', 'ethereal:fence_scorched', 'ethereal:fence_willow', 'ethereal:fence_yelowwood', 'ethereal:fence_acacia_closed', 'ethereal:fence_banana_closed', 'ethereal:fence_birch_closed', 'ethereal:fence_frostwood_closed', 'ethereal:fence_junglewood_closed', 'ethereal:fence_mushroom_closed', 'ethereal:fence_palm_closed', 'ethereal:fence_pine_closed', 'ethereal:fence_redwood_closed', 'ethereal:fence_scorched_closed', 'ethereal:fence_willow_closed', 'ethereal:fence_yelowwood_closed', 'ethereal:fencegate_wood_closed'})
t = "dig"
-- leave_digger
ins(quests, {
'leave_digger', 'Leaves Digger', 'Leaves Blocks', {'default:acacia_leaves', 'default:jungleleaves', 'default:leaves', 'default:pine_needles', 'ethereal:bamboo_leaves', 'ethereal:bananaleaves', 'ethereal:birch_leaves', 'ethereal:frost_leaves', 'ethereal:orange_leaves', 'ethereal:palmleaves', 'ethereal:redwood_leaves', 'ethereal:willow_twig', 'ethereal:yellowleaves', 'ethereal:dry_shrub'}, 100, {'ethereal:vine', 'ethereal:bush', 'ethereal:green_moss', 'ethereal:crystal_moss', 'ethereal:gray_moss', 'ethereal:fiery_moss', 'ethereal:mushroom_moss'}, nil, type = t
})
-- banana_digger
ins(quests, {
"banana_digger", "Banana Digger", nil, {"ethereal:banana"}, 100, {'ethereal:banana_dough'}, nil, type = t
})
-- ice_digger
ins(quests, {
"ice_digger", "Ice Digger", nil, {"default:ice"}, 100, {'ethereal:icebrick'}, 'tools_crafter', type = t
})
-- crystal_spike_digger
ins(quests, {
"crystal_spike_digger", "Crystal Spike Digger", nil, {"ethereal:crystal_spike"}, 100, {'ethereal:crystal_ingot'}, "tools_crafter_pro", type = t
})
t = 'craft'
-- crystal_crafter
ins(quests, {
'crystal_crafter', "Crystal Crafter", nil, {'ethereal:crystal_ingot'}, 50, {'ethereal:sword_crystal', 'ethereal:axe_crystal', 'ethereal:shovel_crystal', 'ethereal:crystal_block'}, 'crystal_spike_digger', type = t
})
-- crystal_tools_crafter
ins(quests, {
'crystal_tools_crafter', "Crystal Tools Crafter", "Crystal Tools", {'ethereal:sword_crystal', 'ethereal:axe_crystal', 'ethereal:shovel_crystal'}, 5, {'ethereal:crystal_gilly_staff', 'ethereal:pick_crystal'}, 'crystal_crafter', type = t
})
-- bowl_crafter
ins(quests, {
'bowl_crafter', "Bowl Crafter", nil, {'ethereal:bowl'}, 1, {'ethereal:mushroom_soup', 'ethereal:hearty_stew'}, 'wood_crafter', type = t
})
-- fire_dust_crafter
ins(quests, {
'fire_dust_crafter', "Fire Dust Crafter", nil, {'ethereal:fire_dust'}, 50, {'ethereal:lightstring'}, 'flower_digger', type = t
})
-- register quests
sys4_quests.registerQuests(mod)

View File

@ -1,16 +1,14 @@
sys4_quests
default
stairs
intllib?
beds?
boats?
bucket?
doors?
dye?
farming?
flowers?
screwdriver?
stairs?
tnt?
vessels?
wool?
xpanes?

View File

@ -30,57 +30,52 @@ local t = "dig"
-- tree_digger
ins(quests, {
'tree_digger', "Tree Digger", nil, {"default:tree", "default:jungletree", "default:acacia_tree", "default:pine_tree"}, 100, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood"}, nil, type = t
})
-- crumbly_nodes_digger
ins(quests, {
'crumbly_nodes_digger', 'Crumbly Nodes Digger', "Blocks of Crumbly Nodes", {'default:gravel', 'default:dirt', 'default:dirt_with_grass', 'default:dirt_with_dry_grass', 'default:dirt_with_snow', 'default:clay', 'default:desert_sand', 'default:sand', 'default:sandstone', 'default:snowblock', 'default:snow'}, 100, {"default:clay", "default:clay_lump", "default:sand", "default:sandstone", "default:snowblock", "default:snow"}, nil, type = t
'tree_digger', "Tree Digger", nil, {"default:tree", "default:jungletree", "default:acacia_tree", "default:pine_tree", "default:aspen_tree"}, 1, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, nil, type = t
})
-- papyrus_digger
ins(quests, {
'papyrus_digger', 'Papyrus Digger', nil, {'default:papyrus'}, 100, {'default:paper'}, nil, type = t
'papyrus_digger', "Papyrus Digger", nil, {"default:papyrus"}, 3, {"default:paper"}, nil, type = t
})
-- clay_digger
ins(quests, {
'clay_digger', "Clay Crafter", nil, {"default:clay"}, 1, {"default:clay", "default:brick"}, nil, type = t
})
-- coal_digger
ins(quests, {
'coal_digger', 'Coal Digger', nil, {'default:stone_with_coal'}, 100, {"default:torch", "default:coal_lump", "default:coalblock"}, 'tools_crafter', type = t
'coal_digger', "Coal Digger", nil, {"default:stone_with_coal"}, 1, {"default:torch"}, "more_tools", type = t
})
-- coal_digger_lover
ins(quests, {
'coal_digger_lover', "Coal Digger Lover", nil, {"default:stone_with_coal"}, 8, {"default:coalblock", "default:coal_lump"}, "coal_digger", type = t
})
-- stone_digger
ins(quests, {
'stone_digger', "Stone Digger", nil, {'default:stone', 'default:desert_stone', 'default:cobble', 'default:desert_cobble', 'default:mossycobble'}, 100, {'default:sword_stone', 'default:axe_stone', 'default:shovel_stone', 'default:furnace'}, 'tools_crafter', type = t
'stone_digger', "Stone Digger", nil, {"default:stone", "default:desert_stone", "default:cobble", "default:desert_cobble", "default:mossycobble", "default:stonebrick", "default:desert_stonebrick"}, 1, {"default:shovel_stone"}, "more_tools", type = t
})
-- iron_digger
-- stone_digger_lover
ins(quests, {
'iron_digger', 'Iron Digger', nil, {'default:stone_with_iron'}, 100, { 'default:steel_ingot', 'default:steelblock', 'default:sword_steel', 'default:axe_steel', 'default:shovel_steel', 'default:chest_locked', 'default:rail'}, 'tools_crafter_lover', type = t
'stone_digger_lover', "Stone Digger Lover", nil, {"default:stone", "default:desert_stone", "default:cobble", "default:desert_cobble", "default:mossycobble", "default:stonebrick", "default:desert_stonebrick"}, 1, {"default:sword_stone"}, "stone_digger", type = t
})
-- copper_digger
-- stone_digger_pro
ins(quests, {
'copper_digger', 'Copper Digger', nil, {'default:stone_with_copper'}, 100, {'default:copper_ingot', 'default:copperblock', 'default:bronze_ingot'}, 'tools_crafter_lover', type = t
'stone_digger_pro', "Stone Digger Pro", nil, {"default:stone", "default:desert_stone", "default:cobble", "default:desert_cobble", "default:mossycobble", "default:stonebrick", "default:desert_stonebrick"}, 1, {"default:pick_stone", "default:axe_stone", "stairs:slab_cobble", "stairs:slab_desert_cobble"}, "stone_digger_lover", type = t
})
-- gold_digger
-- stone_digger_expert
ins(quests, {
'gold_digger', 'Gold Digger', nil, {'default:stone_with_gold'}, 100, {'default:gold_ingot', 'default:goldblock'}, 'tools_crafter_lover', type = t
'stone_digger_expert', "Stone Digger Expert", nil, {"default:stone", "default:desert_stone", "default:cobble", "default:desert_cobble", "default:mossycobble", "default:stonebrick", "default:desert_stonebrick"}, 3, {"stairs:stair_cobble", "stairs:stair_desert_cobble"}, "stone_digger_pro", type = t
})
-- mese_digger
-- stone_digger_master
ins(quests, {
'mese_digger', 'Mese Digger', nil, {'default:stone_with_mese', 'default:mese'}, 100, {'default:mese', 'default:mese_crystal', 'default:mese_crystal_fragment', 'default:sword_mese', 'default:axe_mese', 'default:shovel_mese', 'default:meselamp'}, 'tools_crafter_pro', type = t
})
-- diamond_digger
ins(quests, {
'diamond_digger', 'Diamond Digger', nil, {'default:stone_with_diamond'}, 100, {'default:diamond', 'default:diamondblock', 'default:sword_diamond', 'default:axe_diamond', 'default:shovel_diamond'}, 'tools_crafter_pro', type = t
})
-- obsidian_digger
ins(quests, {
'obsidian_digger', 'Obsidian Digger', nil, {'default:obsidian'}, 100, {'default:obsidian', 'default:obsidian_shard', 'default:obsidianbrick'}, "tools_crafter_pro", type = t
'stone_digger_master', "Stone Digger Master", nil, {"default:stone", "default:desert_stone", "default:cobble", "default:desert_cobble", "default:mossycobble", "default:stonebrick", "default:desert_stonebrick"}, 2, {"default:furnace"}, "stone_digger_expert", type = t
})
----- Quests with type="craft" -----
@ -88,358 +83,86 @@ t = "craft"
-- wood_crafter
ins(quests, {
'wood_crafter', "Wood Crafter", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood"}, 100, {"default:stick", "default:chest", "default:sign_wall", "default:sword_wood", "default:axe_wood", "default:shovel_wood"}, "tree_digger", type = t
'wood_crafter', "Wood Crafter", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"default:stick"}, "tree_digger", type = t
})
-- wood_crafter_lover
ins(quests, {
'wood_crafter_lover', "Wood Crafter Lover", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"default:sword_wood"}, "wood_crafter", type = t
})
-- wood_crafter_pro
ins(quests, {
'wood_crafter_pro', "Wood Crafter Pro", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"stairs:slab_wood", "stairs:slab_junglewood", "stairs:slab_pine_wood", "stairs:slab_acacia_wood", "stairs:slab_aspen_wood"}, "wood_crafter_lover", type = t
})
-- wood_crafter_expert
ins(quests, {
'wood_crafter_expert', "Wood Crafter Expert", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 3, {"default:sign_wall_wood", "stairs:stair_wood", "stairs:stair_junglewood", "stairs:stair_pine_wood", "stairs:stair_acacia_wood", "stairs:stair_aspen_wood"}, "wood_crafter_pro", type = t
})
-- wood_crafter_master
ins(quests, {
'wood_crafter_master', "Wood Crafter Master", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 2, {"default:chest"}, "wood_crafter_expert", type = t
})
-- sticks_crafter
ins(quests, {
'sticks_crafter', "Sticks Crafter", nil, {"default:stick"}, 100, {'default:ladder', 'default:fence_wood'}, 'wood_crafter', type = t
'sticks_crafter', "Sticks Crafter", nil, {"default:stick"}, 2, {"default:shovel_wood"}, "wood_crafter", type = t
})
-- sandstone_crafter
-- sticks_crafter_lover
ins(quests, {
'sandstone_crafter', "Sandstone Crafter", nil, {'default:sandstone'}, 100, {'default:sandstonebrick'}, 'crumbly_nodes_digger', type = t
'sticks_crafter_lover', "Sticks Crafter Lover", nil, {"default:stick"}, 5, {"default:ladder_wood"}, "sticks_crafter", type = t
})
-- more_tools
ins(quests, {
'more_tools', "More Tools", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"default:axe_wood", "default:pick_wood"}, {"wood_crafter_lover", "sticks_crafter"}, type = t
})
-- paper_crafter
ins(quests, {
'paper_crafter', "Papers Crafter", nil, {'default:paper'}, 100, {'default:book'}, 'papyrus_digger', type = t
'paper_crafter', "Paper Crafter", nil, {"default:paper"}, 3, {"default:book"}, "papyrus_digger", type = t
})
-- book_crafter
ins(quests, {
'book_crafter', "Books Crafter", nil, {'default:book'}, 100, {'default:bookshelf'}, {'paper_crafter', 'wood_crafter'}, type = t
'book_crafter', "Book Crafter", nil, {"default:book"}, 3, {"default:bookshelf"}, {"wood_crafter_expert", "paper_crafter"}, type = t
})
-- bronze_crafter
-- clay_crafter
ins(quests, {
'bronze_crafter', "Bronze Crafter", nil, {'default:bronze_ingot'}, 100, {'default:sword_bronze', 'default:axe_bronze', 'default:shovel_bronze'}, 'copper_digger', type = t
'clay_crafter', "Clay Crafter", nil, {"default:clay"}, 1, {"default:clay_lump"}, "clay_digger", type = t
})
-- tools_crafter
-- wood_architect
ins(quests, {
'tools_crafter', "Tools Crafter", "Wooden Tools", {'default:sword_wood', 'default:axe_wood', 'default:shovel_wood'}, 20, {'default:pick_wood'}, 'wood_crafter', type = t
'wood_architect', "Wood Architect", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"default:fence_wood", "default:fence_junglewood", "default:fence_pine_wood", "default:fence_acacia_wood", "default:fence_aspen_wood"}, {"sticks_crafter", "wood_crafter_pro"}, type = t
})
-- tools_crafter_lover
-- furnace_crafter
ins(quests, {
'tools_crafter_lover', "Tools Crafter Lover", "Stone Tools", {'default:sword_stone', 'default:axe_stone', 'default:shovel_stone'}, 15, {'default:pick_stone'}, 'stone_digger', type = t
'furnace_crafter', "Furnace Crafter", nil, {"default:furnace"}, 1, {"default:stonebrick", "default:desert_stonebrick", "stairs:slab_stonebrick", "stairs:slab_desert_stonebrick", "stairs:stair_stonebrick", "stairs:stair_desert_stonebrick", "stairs:slab_stone", "stairs:slab_desert_stone", "stairs:stair_stone", "stairs:stair_desert_stone"}, "stone_digger_master", type = t, level = false
})
-- tools_crafter_pro
-- brick_crafter
ins(quests, {
'tools_crafter_pro', "Tools Crafter Pro", "Steel or Bronze Tools", {'default:sword_steel', 'default:axe_steel', 'default:shovel_steel', 'default:sword_bronze', 'default:axe_bronze', 'default:shovel_bronze'}, 10, {'default:pick_steel', 'default:pick_bronze'}, 'iron_digger', type = t
'brick_crafter', "Bricks Crafter", nil, {"default:brick"}, 1, {"default:clay_brick"}, {"clay_digger", "furnace_crafter"}, type = t
})
-- tools_crafter_expert
ins(quests, {
'tools_crafter_expert', "Tools Crafter Expert", "Mese Tools", {'default:sword_mese', 'default:axe_mese', 'default:shovel_mese'}, 5, {'default:pick_mese'}, 'mese_digger', type = t
})
-- tools_crafter_master
ins(quests, {
'tools_crafter_master', "Tools Crafter Master", "Diamond Tools", {'default:sword_diamond', 'default:axe_diamond', 'default:shovel_diamond'}, 5, {'default:pick_diamond'}, 'diamond_digger', type = t
})
----- Quests with type="place" -----
t = "place"
-- furnace_builder
ins(quests, {
'furnace_builder', "Furnace Builder", nil, {'default:furnace'}, 2, {'default:clay_brick', 'default:brick', 'default:stonebrick', 'default:desert_stonebrick'}, 'stone_digger', type = t
})
-- wood_builder
ins(quests, {
'wood_builder', "Wood Builder", "Wooden Planks", {'default:wood', 'default:junglewood', 'default:acacia_wood', 'default:pine_wood'}, 100, {'stairs:slab_wood', 'stairs:slab_junglewood', 'stairs:slab_acacia_wood', 'stairs:slab_pine_wood'}, 'tree_digger', type = t
})
-- wood_builder_lover
ins(quests, {
'wood_builder_lover', "Wood Builder Lover", "stairs:slab_wood", {'stairs:slab_wood', 'stairs:slab_junglewood', 'stairs:slab_acacia_wood', 'stairs:slab_pine_wood'}, 100, {'stairs:stair_wood', 'stairs:stair_junglewood', 'stairs:stair_acacia_wood', 'stairs:stair_pine_wood'}, 'wood_builder', type = t
})
----------- Register quests ----------
sys4_quests.registerQuests(mod)
---------- Quests for farming mod ----------
mod = "farming"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Dig --
t = "dig"
-- wood_crafter UP
up('wood_crafter', nil, {'farming:hoe_wood'})
-- stone_digger UP
up('stone_digger', nil, {'farming:hoe_stone'})
-- iron_digger UP
up('iron_digger', nil, {'farming:hoe_steel'})
-- mese_digger UP
up('mese_digger', nil, {'farming:hoe_mese'})
-- diamond_digger UP
up('diamond_digger', nil, {'farming:hoe_diamond'})
-- wheat_digger
ins(quests, {
'wheat_digger', "Wheat Digger", nil, {'farming:wheat_1', 'farming:wheat_2', 'farming:wheat_3', 'farming:wheat_4', 'farming:wheat_5', 'farming:wheat_6', 'farming:wheat_7', 'farming:wheat_8'}, 100, {'farming:flour'}, 'wood_crafter', type = t
})
-- Type Craft --
t = "craft"
-- bronze_crafter UP
up('bronze_crafter', nil, {'farming:hoe_bronze'})
quests = sys4_quests.initQuests(mod, S)
-- tools_crafter UP
up('tools_crafter', {'farming:hoe_wood'}, nil)
t = "craft"
-- tools_crafter_lover UP
up('tools_crafter_lover', {'farming:hoe_stone'}, nil)
-- farming_tools
ins(quests, {
'farming_tools', "Farming Tools", nil, {"default:wood", "default:junglewood", "default:acacia_wood", "default:pine_wood", "default:aspen_wood"}, 1, {"farming:hoe_wood"}, {"wood_crafter","sticks_crafter"}, type = t
})
-- tools_crafter_pro UP
up('tools_crafter_pro', {'farming:hoe_steel', 'farming:hoe_bronze'}, nil)
sys4_quests.registerQuests()
-- tools_crafter_expert UP
up('tools_crafter_expert', {'farming:hoe_mese'}, nil)
-- updates
-- tools_crafter_master UP
up('tools_crafter_master', {'farming:hoe_diamond'}, nil)
-- flour_crafter
ins(quests, {
'flour_crafter', "Flour Crafter", nil, {'farming:flour'}, 100, {'farming:wheat', 'farming:straw'}, 'wheat_digger', type = t
})
-- Type Place
t = "place"
-- straw_builder
ins(quests, {
'straw_builder', "Straw Builder", nil, {'farming:straw'}, 100, {'stairs:slab_straw'}, 'flour_crafter', type = t
})
-- straw_builder_lover
ins(quests, {
'straw_builder_lover', "Straw Builder Lover", nil, {'stairs:slab_straw'}, 100, {'stairs:stair_straw'}, 'straw_builder', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for wool mod ----------
mod = "wool"
if minetest.get_modpath(mod)
and minetest.get_modpath("farming") then
quests = sys4_quests.initQuests(mod, S)
-- Type Dig --
t = "dig"
-- Cotton_digger
ins(quests, {
'cotton_digger', "Cotton Digger", nil, {'farming:cotton_1', 'farming:cotton_2', 'farming:cotton_3', 'farming:cotton_4', 'farming:cotton_5', 'farming:cotton_6', 'farming:cotton_7', 'farming:cotton_8', }, 100, {'wool:white'}, 'wood_crafter', type = t
})
-- Type Craft --
t = "craft"
-- wool_crafter
ins(quests, {
'wool_crafter', "Wool Crafter", nil, {'wool:white'}, 100, {'wool:black', 'wool:blue', 'wool:brown', 'wool:cyan', 'wool:dark_green', 'wool:dark_grey', 'wool:green', 'wool:grey', 'wool:magenta', 'wool:orange', 'wool:pink', 'wool:red', 'wool:violet', 'wool:yellow'}, 'cotton_digger', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for dye mod ----------
mod = "dye"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Dig --
t = "dig"
-- coal_digger UP
up('coal_digger', nil, {'dye:black'})
if minetest.get_modpath("flowers") then
-- flower_digger
ins(quests, {
'flower_digger', "Flower Digger", "Flowers", {'flowers:dandelion_white', 'flowers:dandelion_yellow', 'flowers:geranium', 'flowers:rose', 'flowers:tulip', 'flowers:viola'}, 100, {'dye:blue', 'dye:brown', 'dye:cyan', 'dye:dark_green', 'dye:dark_grey', 'dye:green', 'dye:grey', 'dye:magenta', 'dye:orange', 'dye:pink', 'dye:red', 'dye:violet', 'dye:yellow', 'dye:white'}, nil, type = t
})
end
sys4_quests.registerQuests(mod)
end
---------- Quests for beds mod ----------
mod = "beds"
if minetest.get_modpath(mod)
and minetest.get_modpath("wool") then
quests = sys4_quests.initQuests(mod)
-- Type Craft --
t = "craft"
-- wool_crafter_lover
ins(quests, {
'wool_crafter_lover', "Wool Crafter Lover", "Colored Wools", {'wool:black', 'wool:blue', 'wool:brown', 'wool:cyan', 'wool:dark_green', 'wool:dark_grey', 'wool:green', 'wool:grey', 'wool:magenta', 'wool:orange', 'wool:pink', 'wool:red', 'wool:violet', 'wool:yellow'}, 100, {'beds:bed_bottom', 'beds:fancy_bed_bottom'}, 'wool_crafter', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for boats mod ----------
mod = "boats"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Craft --
t = "craft"
-- wood_crafter UP
up('wood_crafter', nil, {'boats:boat'})
-- sys4_quests.registerQuests(mod)
-- Not needeed here, because there is no quest insertion
end
---------- Quests for bucket mod ----------
mod = "bucket"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Place --
t = "place"
-- furnace_builder UP
up('furnace_builder', nil, {'bucket:bucket_empty'})
end
---------- Quests for doors mod ----------
mod = "doors"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod)
-- Type Craft --
t = "craft"
-- wood_crafter UP
up('wood_crafter', nil, {'doors:door_wood', 'doors:trapdoor'})
-- obsidian_shard_crafter
ins(quests, {
'obsidian_shard_crafter', "Obsidian shard Crafter", nil, {'default:obsidian_shard'}, 100, {'doors:door_obsidian_glass'}, 'obsidian_digger', type = t
})
-- Type Dig --
t = "dig"
-- iron_digger UP
up('iron_digger', nil, {'doors:door_steel'})
-- Type Place --
t = "place"
-- glass_builder
ins(quests, {
'glass_builder', "Glass Builder", nil, {'default:glass'}, 100, {'doors:door_glass'}, 'furnace_builder', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for screwdriver mod ----------
mod = "screwdriver"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Place --
t = "place"
-- furnace_builder
up('furnace_builder', nil, {'screwdriver:screwdriver'})
end
---------- Quests for tnt mod ----------
mod = "tnt"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Dig --
t = "dig"
-- gravel_digger
ins(quests, {
'gravel_digger', "Gravel Digger", nil, {'default:gravel'}, 100, {'tnt:gunpowder'}, nil, type = t
})
-- Type Craft --
t = "craft"
-- gunpowder_crafter
ins(quests, {
'gunpowder_crafter', "Gunpowder Crafter", nil,{'tnt:gunpowder'}, 10, {'tnt:tnt'}, 'gravel_digger', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for vessels mod ----------
mod = "vessels"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Place --
t = "place"
-- furnace_builder UP
up('furnace_builder', nil, {'vessels:steel_bottle', 'vessels:drinking_glass', 'vessels:glass_bottle', 'vessels:glass_fragments'})
-- Type Craft --
t = "craft"
-- vessels_crafter
ins(quests, {
'vessels_crafter', "Vessels Crafter", "Vessels Items", {'vessels:steel_bottle', 'vessels:drinking_glass', 'vessels:glass_bottle'}, 100, {'vessels:shelf'}, 'furnace_builder', type = t
})
sys4_quests.registerQuests(mod)
end
---------- Quests for xpanes mod ----------
mod = "xpanes"
if minetest.get_modpath(mod) then
quests = sys4_quests.initQuests(mod, S)
-- Type Dig --
t = "dig"
-- iron_digger UP
up('iron_digger', nil, {'xpanes:bar'})
-- Type Place --
t = "place"
if minetest.get_modpath("doors") then
-- glass_builder UP
up('glass_builder', nil, {'xpanes:pane'})
else
-- glass_builder
ins(quests, {
'glass_builder', "Glass Builder", nil, {'default:glass'}, 100, {'xpanes:pane'}, 'furnace_builder', type = t
})
sys4_quests.registerQuests(mod)
end
end
up('stone_digger_lover', nil, {"farming:hoe_stone"})

Binary file not shown.

View File

@ -22,7 +22,7 @@ minetest.register_node("sys4_quests:waste",
sys4_quests = {}
local lastQuestIndex = 0
local level = 1
local level = 5
function sys4_quests.initQuests(mod, intllib)
if not intllib or intllib == nil then
@ -39,27 +39,38 @@ function sys4_quests.initQuests(mod, intllib)
return sys4_quests.registeredQuests[mod].quests
end
function sys4_quests.registerQuests(mod)
local modIntllib = sys4_quests.registeredQuests[mod].intllib
function sys4_quests.registerQuests()
-- init quests index
for _, quest in pairs(sys4_quests.registeredQuests[mod].quests) do
lastQuestIndex = lastQuestIndex + 1
quest.index = lastQuestIndex
end
for mod, registeredQuests in pairs(sys4_quests.registeredQuests) do
local modIntllib = registeredQuests.intllib
-- Register quests
for _, quest in pairs(sys4_quests.registeredQuests[mod].quests) do
-- Register quest
quests.register_quest("sys4_quests:"..quest[1],
{ title = modIntllib(quest[2]),
description = sys4_quests.formatDescription(quest, level, modIntllib),
max = quest[5] * level,
autoaccept = sys4_quests.hasDependencies(quest[1]),
callback = sys4_quests.nextQuest
})
-- init quests index
for _, quest in pairs(registeredQuests.quests) do
-- Register quest
--print("Register quest : "..mod.." - "..quest[1])
--local auto = sys4_quests.hasDependencies(quest[1])
--print("Autoaccept next quest : "..dump(auto))
local maxlevel = quest[5] * level
if quest.level and not quest.level then
maxlevel = quest[5]
end
if quests.register_quest("sys4_quests:"..quest[1],
{ title = modIntllib(quest[2]),
description = sys4_quests.formatDescription(quest, level, modIntllib),
max = maxlevel,
autoaccept = sys4_quests.hasDependencies(quest[1]),
callback = sys4_quests.nextQuest
})
then
lastQuestIndex = lastQuestIndex + 1
quest.index = lastQuestIndex
end
end
end
end
@ -204,6 +215,7 @@ function sys4_quests.hasDependencies(questName)
end
function sys4_quests.nextQuest(playername, questname)
print("Next quest after : "..questname)
if questname ~= "" then
local quest = string.split(questname, ":")[2]
if quest and quest ~= nil and quest ~= "" and sys4_quests.hasDependencies(quest) then
@ -213,6 +225,7 @@ function sys4_quests.nextQuest(playername, questname)
local parentQuests = registeredQuest[7]
if isParentQuestsCompleted(parentQuests, quest, playername) then
print("Next quest selected : "..registeredQuest[1])
nextquest = registeredQuest.index
sys4_quests.setCurrentQuest(playername, nextquest)
minetest.after(1, function() quests.start_quest(playername, "sys4_quests:"..registeredQuest[1]) end)
@ -280,9 +293,9 @@ local function getCraftRecipes(item)
if itemIngredient ~= nil then
-- local intllib = sys4_quests.intllib_by_item(itemIngredient)
-- str = str.."'"..intllib(itemIngredient).."' "
str = str.."'"..itemIngredient.."' "
str = str.."["..itemIngredient.."] "
else
str = str.."'"..S("empty").."' "
str = str.."[ ] "
end
if x == width then
str = str.."\n"
@ -298,7 +311,7 @@ local function getCraftRecipes(item)
return str
end
local function writeBook(content, items)
local function writeBook(content, items, playern)
local txt = ""
if content and content ~= nil then
@ -306,14 +319,18 @@ local function writeBook(content, items)
end
if items and items ~= nil then
txt = txt..S("You have unlocked these crafts").." :"
txt = txt..playern.." "..S("has unlocked these crafts").." :"
local tt= "\n"
local tt= "\n\n"
for _, item in ipairs(items) do
local intllib = sys4_quests.intllib_by_item(item)
tt = tt.."\n"..getCraftRecipes(item)
tt = tt..S("Output").." --> "..intllib(item).."\n\n"
tt = tt.."----------OOOOOO----------\n"
tt = tt..">>>> "..intllib(item).." <<<<\n\n"
tt = tt..S("Craft recipes :\n")
tt = tt..getCraftRecipes(item)
tt = tt.."\n----------OOOOOO----------\n\n"
end
txt = txt..tt.."\n"
end
@ -342,7 +359,7 @@ local function giveBook(playerName, quest)
local bookData = {}
bookData.title = "SYS4 QUESTS : "..registeredQuest[2]
bookData.text = writeBook(nil, registeredQuest[6])
bookData.text = writeBook(nil, registeredQuest[6], playerName)
bookData.owner = playerName
bookItem:set_metadata(minetest.serialize(bookData))
@ -425,6 +442,8 @@ minetest.register_on_craft(
end
end
print("WasteItem state = "..dump(wasteItem))
for mod, registeredQuests in pairs(sys4_quests.registeredQuests) do
for _, registeredQuest in ipairs(registeredQuests.quests) do
local questType = registeredQuest.type