1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Add [mff_pclasses], MFF-specific pclasses

This commit is contained in:
Wouters Dorian 2015-07-31 21:53:32 +02:00
parent 9e359f7fcd
commit ee461e1d41
10 changed files with 80 additions and 0 deletions

21
mods/mff/mff_pclasses/admin.lua Executable file
View 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")

View File

@ -0,0 +1,2 @@
mff_core
pclasses

View 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")

View File

@ -0,0 +1,5 @@
local path = minetest.get_modpath("mff_pclasses")
dofile(path .. "/warrior.lua")
dofile(path .. "/hunter.lua")
dofile(path .. "/admin.lua")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View 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")

View File

@ -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