mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-19 08:40:29 +01:00
Add [mff_pclasses], MFF-specific pclasses
This commit is contained in:
parent
9e359f7fcd
commit
ee461e1d41
21
mods/mff/mff_pclasses/admin.lua
Executable file
21
mods/mff/mff_pclasses/admin.lua
Executable file
@ -0,0 +1,21 @@
|
||||
-----------------
|
||||
-- Admin class --
|
||||
-----------------
|
||||
|
||||
--
|
||||
-- https://github.com/MinetestForFun/minetest-minetestforfun-server/issues/139
|
||||
--
|
||||
|
||||
pclasses.api.register_class("admin", {
|
||||
on_assigned = function(pname)
|
||||
minetest.chat_send_player(pname, "Hello admin.")
|
||||
end
|
||||
})
|
||||
|
||||
pclasses.api.reserve_item("admin", "3d_armor:helmet_admin")
|
||||
pclasses.api.reserve_item("admin", "3d_armor:chestplate_admin")
|
||||
pclasses.api.reserve_item("admin", "3d_armor:leggings_admin")
|
||||
pclasses.api.reserve_item("admin", "3d_armor:boots_admin")
|
||||
pclasses.api.reserve_item("admin", "shields:shields_admin")
|
||||
pclasses.api.reserve_item("admin", "maptools:pick_admin")
|
||||
pclasses.api.reserve_item("admin", "maptools:pick_admin_with_drops")
|
2
mods/mff/mff_pclasses/depends.txt
Executable file
2
mods/mff/mff_pclasses/depends.txt
Executable file
@ -0,0 +1,2 @@
|
||||
mff_core
|
||||
pclasses
|
29
mods/mff/mff_pclasses/hunter.lua
Executable file
29
mods/mff/mff_pclasses/hunter.lua
Executable file
@ -0,0 +1,29 @@
|
||||
------------------
|
||||
-- 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,
|
||||
})
|
||||
|
||||
|
||||
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")
|
5
mods/mff/mff_pclasses/init.lua
Normal file
5
mods/mff/mff_pclasses/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local path = minetest.get_modpath("mff_pclasses")
|
||||
|
||||
dofile(path .. "/warrior.lua")
|
||||
dofile(path .. "/hunter.lua")
|
||||
dofile(path .. "/admin.lua")
|
BIN
mods/mff/mff_pclasses/sounds/3d_armor_full_warrior.ogg-old
Executable file
BIN
mods/mff/mff_pclasses/sounds/3d_armor_full_warrior.ogg-old
Executable file
Binary file not shown.
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_hunter.ogg
Executable file
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_hunter.ogg
Executable file
Binary file not shown.
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_warrior.ogg
Executable file
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_warrior.ogg
Executable file
Binary file not shown.
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_wizard.ogg
Executable file
BIN
mods/mff/mff_pclasses/sounds/pclasses_full_wizard.ogg
Executable file
Binary file not shown.
22
mods/mff/mff_pclasses/warrior.lua
Executable file
22
mods/mff/mff_pclasses/warrior.lua
Executable file
@ -0,0 +1,22 @@
|
||||
-------------------
|
||||
-- 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 .. " become a warrior")
|
||||
end,
|
||||
on_unassigned = function(pname)
|
||||
sprint.set_default_maxstamina(pname)
|
||||
end,
|
||||
})
|
||||
|
||||
pclasses.api.reserve_item("warrior", "moreores:sword_mithril")
|
||||
pclasses.api.reserve_item("warrior", "default:dungeon_master_s_blood_sword")
|
@ -170,6 +170,7 @@ load_mod_action_timers = true
|
||||
|
||||
load_mod_throwing = true
|
||||
load_mod_pclasses = true
|
||||
load_mod_mff_pclasses = true
|
||||
load_mod_3d_armor = true
|
||||
load_mod_harnededleather = true
|
||||
load_mod_reinforcedleather = true
|
||||
|
Loading…
Reference in New Issue
Block a user