mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 02:30:38 +01:00
743507564f
- Moved the holographic item's name as a field in switch_params (pclasses.api.register_class) - Added wizard class' skeleton for later - Fixed a few bugs in nodes, inventory and api - Splitted tick function to bury items in two - Items from 3d_armor's armor inventory are also affected by inventory vacuuming (from tick function). The player's static armor inventory is first cleared, then copied to the detached one, then armor updates everything else (rendering, model, etc) - Fixed itemname of admin shield to reserve it properly - Return graveyard inventory if it already exists. Do not create it every two seconds
36 lines
1.1 KiB
Lua
Executable File
36 lines
1.1 KiB
Lua
Executable File
------------------
|
|
-- Hunter class --
|
|
------------------
|
|
|
|
--
|
|
-- See https://github.com/Ombridride/minetest-minetestforfun-server/issues/114
|
|
--
|
|
|
|
pclasses.api.register_class("hunter", {
|
|
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,
|
|
switch_params = {
|
|
color = {r = 30, g = 170, b = 00},
|
|
tile = "default_wood.png",
|
|
holo_item = "throwing:bow_minotaur_horn_improved"
|
|
}
|
|
})
|
|
|
|
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn")
|
|
pclasses.api.reserve_item("hunter", "throwing:bow_minotaur_horn_improved")
|
|
pclasses.api.reserve_item("hunter", "throwing:arrow_mithril")
|
|
pclasses.api.reserve_item("hunter", "throwing:arbalest_auto")
|