2015-07-31 21:53:32 +02:00
|
|
|
-------------------
|
|
|
|
-- Warrior class --
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
--
|
|
|
|
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/113
|
|
|
|
--
|
|
|
|
|
|
|
|
pclasses.api.register_class("warrior", {
|
2016-01-03 23:01:40 +01:00
|
|
|
on_assigned = function(pname, inform)
|
|
|
|
if inform then
|
|
|
|
minetest.sound_play("pclasses_full_warrior", {to_player=pname, gain=1})
|
|
|
|
minetest.chat_send_player(pname, "You are now a warrior")
|
|
|
|
end
|
2015-07-31 21:53:32 +02:00
|
|
|
sprint.set_maxstamina(pname, 20)
|
2015-08-20 17:11:46 +02:00
|
|
|
minetest.log("action", "[PClasses] Player " .. pname .. " becomes a warrior")
|
2015-07-31 21:53:32 +02:00
|
|
|
end,
|
|
|
|
on_unassigned = function(pname)
|
|
|
|
sprint.set_default_maxstamina(pname)
|
|
|
|
end,
|
2015-08-17 10:53:13 +02:00
|
|
|
switch_params = {
|
|
|
|
color = {r = 06, g = 06, b = 30},
|
2015-08-20 17:11:46 +02:00
|
|
|
tile = "default_steel_block.png",
|
|
|
|
holo_item = "default:dungeon_master_s_blood_sword"
|
2015-08-17 10:53:13 +02:00
|
|
|
}
|
2015-07-31 21:53:32 +02:00
|
|
|
})
|
|
|
|
|
2016-06-03 21:52:52 +02:00
|
|
|
pclasses.api.reserve_item("warrior", "default:sword_mithril")
|
2015-07-31 21:53:32 +02:00
|
|
|
pclasses.api.reserve_item("warrior", "default:dungeon_master_s_blood_sword")
|
2015-11-26 22:26:08 +01:00
|
|
|
|
|
|
|
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")
|
2015-11-27 00:17:33 +01:00
|
|
|
pclasses.api.reserve_item("warrior", "shields:shield_blackmithril")
|