mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-14 14:30:34 +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
28 lines
816 B
Lua
Executable File
28 lines
816 B
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")
|