1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-15 23:10:31 +01:00
server-nalc/mods/pclasses/hunter.lua
LeMagnesium d491015a78 Updated pclasses with admin class
- Moved reserved_items into their class file
 - Added admin class for #139
2015-07-28 16:17:26 +02:00

33 lines
1.0 KiB
Lua
Executable File

------------------
-- Hunter class --
------------------
--
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/114
--
pclasses.api.register_class("hunter", {
determination = function(player)
return pclasses.api.util.does_wear_full_armor(player:get_player_name(), "reinforcedleather", true)
or pclasses.api.util.does_wear_full_armor(player:get_player_name(), "hardenedleather", true)
end,
on_assigned = function(pname)
minetest.chat_send_player(pname, "You are now a hunter")
minetest.sound_play("pclasses_full_hunter")
local reinforced = pclasses.api.util.does_wear_full_armor(pname, "reinforcedleather", true)
if reinforced then
sprint.increase_maxstamina(pname, 20)
else
sprint.increase_maxstamina(pname, 10)
end
minetest.log("action", "[PClasses] Player " .. pname .. " become a hunter")
end,
on_unassigned = function(pname)
sprint.set_default_maxstamina(pname)
end,
})
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn")
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn_improved")