1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-06 02:20:24 +01:00
server-nalc/mods/mff/mff_pclasses/warrior.lua
crabman77 a0f2f09e90 fix typo in shield
update armor_inventory only when switch class
we can not be equipped with reserved armor another class
2015-11-27 00:17:33 +01:00

36 lines
1.1 KiB
Lua
Executable File

-------------------
-- Warrior class --
-------------------
--
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/113
--
pclasses.api.register_class("warrior", {
on_assigned = function(pname)
minetest.sound_play("pclasses_full_warrior")
minetest.chat_send_player(pname, "You are now a warrior")
sprint.set_maxstamina(pname, 20)
minetest.log("action", "[PClasses] Player " .. pname .. " becomes a warrior")
end,
on_unassigned = function(pname)
sprint.set_default_maxstamina(pname)
end,
switch_params = {
color = {r = 06, g = 06, b = 30},
tile = "default_steel_block.png",
holo_item = "default:dungeon_master_s_blood_sword"
}
})
pclasses.api.reserve_item("warrior", "moreores:sword_mithril")
pclasses.api.reserve_item("warrior", "default:dungeon_master_s_blood_sword")
for _, i in pairs({"helmet", "chestplate", "boots", "leggings"}) do
pclasses.api.reserve_item("warrior", "3d_armor:" .. i .. "_blackmithril")
pclasses.api.reserve_item("warrior", "3d_armor:" .. i .. "_mithril")
end
pclasses.api.reserve_item("warrior", "shields:shield_mithril")
pclasses.api.reserve_item("warrior", "shields:shield_blackmithril")