init.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. -- default support (for use with MineClone2 and other [games]
  2. default = default or {
  3. node_sound_stone_defaults = function(table) end,
  4. node_sound_wood_defaults = function(table) end,
  5. gui_bg = "",
  6. gui_bg_img = "",
  7. gui_slots = "",
  8. }
  9. -- Load support for intllib.
  10. local MP = minetest.get_modpath(minetest.get_current_modname())
  11. local F = minetest.formspec_escape
  12. local S = minetest.get_translator and minetest.get_translator("protector") or
  13. dofile(MP .. "/intllib.lua")
  14. -- Load support for factions
  15. local factions_available = minetest.global_exists("factions")
  16. protector = {
  17. mod = "redo",
  18. modpath = MP,
  19. intllib = S
  20. }
  21. local protector_max_share_count = 12
  22. -- get minetest.conf settings
  23. local protector_radius = tonumber(minetest.settings:get("protector_radius")) or 5
  24. local protector_flip = minetest.settings:get_bool("protector_flip") or false
  25. local protector_hurt = tonumber(minetest.settings:get("protector_hurt")) or 0
  26. local protector_spawn = tonumber(minetest.settings:get("protector_spawn")
  27. or minetest.settings:get("protector_pvp_spawn")) or 0
  28. local protector_show = tonumber(minetest.settings:get("protector_show_interval")) or 5
  29. local protector_recipe = minetest.settings:get_bool("protector_recipe") ~= false
  30. local protector_msg = minetest.settings:get_bool("protector_msg") ~= false
  31. -- radius limiter (minetest cannot handle node volume of more than 4096000)
  32. if protector_radius > 22 then protector_radius = 22 end
  33. -- get static spawn position
  34. local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint"))
  35. or {x = 0, y = 2, z = 0}
  36. -- return list of members as a table
  37. local get_member_list = function(meta)
  38. return meta:get_string("members"):split(" ")
  39. end
  40. -- write member list table in protector meta as string
  41. local set_member_list = function(meta, list)
  42. meta:set_string("members", table.concat(list, " "))
  43. end
  44. -- check for owner name
  45. local is_owner = function(meta, name)
  46. return name == meta:get_string("owner")
  47. end
  48. -- check for member name
  49. local is_member = function(meta, name)
  50. if factions_available
  51. and meta:get_int("faction_members") == 1 then
  52. if factions.version == nil then
  53. -- backward compatibility
  54. if factions.get_player_faction(name) ~= nil
  55. and factions.get_player_faction(meta:get_string("owner")) ==
  56. factions.get_player_faction(name) then
  57. return true
  58. end
  59. else
  60. -- is member if player and owner share at least one faction
  61. local owner_factions = factions.get_player_factions(name)
  62. local owner = meta:get_string("owner")
  63. if owner_factions ~= nil and owner_factions ~= false then
  64. for _, f in ipairs(owner_factions) do
  65. if factions.player_is_in_faction(f, owner) then
  66. return true
  67. end
  68. end
  69. end
  70. end
  71. end
  72. for _, n in pairs(get_member_list(meta)) do
  73. if n == name then
  74. return true
  75. end
  76. end
  77. return false
  78. end
  79. -- add player name to table as member
  80. local add_member = function(meta, name)
  81. -- Constant (20) defined by player.h
  82. if name:len() > 25 then
  83. return
  84. end
  85. -- does name already exist?
  86. if is_owner(meta, name)
  87. or is_member(meta, name) then
  88. return
  89. end
  90. local list = get_member_list(meta)
  91. if #list >= protector_max_share_count then
  92. return
  93. end
  94. table.insert(list, name)
  95. set_member_list(meta, list)
  96. end
  97. -- remove player name from table
  98. local del_member = function(meta, name)
  99. local list = get_member_list(meta)
  100. for i, n in pairs(list) do
  101. if n == name then
  102. table.remove(list, i)
  103. break
  104. end
  105. end
  106. set_member_list(meta, list)
  107. end
  108. -- protector interface
  109. local protector_formspec = function(meta)
  110. local formspec = "size[8,7]"
  111. .. default.gui_bg
  112. .. default.gui_bg_img
  113. .. default.gui_slots
  114. .. "label[2.5,0;" .. F(S("-- Protector interface --")) .. "]"
  115. .. "label[0,1;" .. F(S("PUNCH node to show protected area")) .. "]"
  116. .. "label[0,2;" .. F(S("Members:")) .. "]"
  117. .. "button_exit[2.5,6.2;3,0.5;close_me;" .. F(S("Close")) .. "]"
  118. .. "field_close_on_enter[protector_add_member;false]"
  119. local members = get_member_list(meta)
  120. local npp = protector_max_share_count -- max users added to protector list
  121. local i = 0
  122. local checkbox_faction = false
  123. -- Display the checkbox only if the owner is member of at least 1 faction
  124. if factions_available then
  125. if factions.version == nil then
  126. -- backward compatibility
  127. if factions.get_player_faction(meta:get_string("owner")) then
  128. checkbox_faction = true
  129. end
  130. else
  131. if factions.get_player_factions(meta:get_string("owner")) ~= nil then
  132. if next(factions.get_player_faction(meta:get_string("owner"))) then
  133. checkbox_faction = true
  134. end
  135. end
  136. end
  137. end
  138. if checkbox_faction then
  139. formspec = formspec .. "checkbox[0,5;faction_members;"
  140. .. F(S("Allow faction access"))
  141. .. ";" .. (meta:get_int("faction_members") == 1 and
  142. "true" or "false") .. "]"
  143. if npp > 8 then
  144. npp = 8
  145. end
  146. end
  147. for n = 1, #members do
  148. if i < npp then
  149. -- show username
  150. formspec = formspec .. "button[" .. (i % 4 * 2)
  151. .. "," .. math.floor(i / 4 + 3)
  152. .. ";1.5,.5;protector_member;" .. F(members[n]) .. "]"
  153. -- username remove button
  154. .. "button[" .. (i % 4 * 2 + 1.25) .. ","
  155. .. math.floor(i / 4 + 3)
  156. .. ";.75,.5;protector_del_member_" .. F(members[n]) .. ";X]"
  157. end
  158. i = i + 1
  159. end
  160. if i < npp then
  161. -- user name entry field
  162. formspec = formspec .. "field[" .. (i % 4 * 2 + 1 / 3) .. ","
  163. .. (math.floor(i / 4 + 3) + 1 / 3)
  164. .. ";1.433,.5;protector_add_member;;]"
  165. -- username add button
  166. .."button[" .. (i % 4 * 2 + 1.25) .. ","
  167. .. math.floor(i / 4 + 3) .. ";.75,.5;protector_submit;+]"
  168. end
  169. return formspec
  170. end
  171. -- check if pos is inside a protected spawn area
  172. local inside_spawn = function(pos, radius)
  173. if protector_spawn <= 0 then
  174. return false
  175. end
  176. if pos.x < statspawn.x + radius
  177. and pos.x > statspawn.x - radius
  178. and pos.y < statspawn.y + radius
  179. and pos.y > statspawn.y - radius
  180. and pos.z < statspawn.z + radius
  181. and pos.z > statspawn.z - radius then
  182. return true
  183. end
  184. return false
  185. end
  186. -- show protection message if enabled
  187. local show_msg = function(player, msg)
  188. -- if messages disabled or no player name provided
  189. if protector_msg == false or not player or player == "" then
  190. return
  191. end
  192. minetest.chat_send_player(player, msg)
  193. end
  194. -- Infolevel:
  195. -- 0 for no info
  196. -- 1 for "This area is owned by <owner> !" if you can't dig
  197. -- 2 for "This area is owned by <owner>.
  198. -- 3 for checking protector overlaps
  199. protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
  200. if not digger or not pos then
  201. return false
  202. end
  203. -- protector_bypass privileged users can override protection
  204. if infolevel == 1
  205. and minetest.check_player_privs(digger, {protection_bypass = true}) then
  206. return true
  207. end
  208. -- infolevel 3 is only used to bypass priv check, change to 1 now
  209. if infolevel == 3 then infolevel = 1 end
  210. -- is spawn area protected ?
  211. if inside_spawn(pos, protector_spawn) then
  212. show_msg(digger,
  213. S("Spawn @1 has been protected up to a @2 block radius.",
  214. minetest.pos_to_string(statspawn), protector_spawn))
  215. return false
  216. end
  217. -- find the protector nodes
  218. local pos = minetest.find_nodes_in_area(
  219. {x = pos.x - r, y = pos.y - r, z = pos.z - r},
  220. {x = pos.x + r, y = pos.y + r, z = pos.z + r},
  221. {"protector:protect", "protector:protect2", "protector:protect_hidden"})
  222. local meta, owner, members
  223. for n = 1, #pos do
  224. meta = minetest.get_meta(pos[n])
  225. owner = meta:get_string("owner") or ""
  226. members = meta:get_string("members") or ""
  227. -- node change and digger isn't owner
  228. if infolevel == 1 and owner ~= digger then
  229. -- and you aren't on the member list
  230. if onlyowner or not is_member(meta, digger) then
  231. show_msg(digger,
  232. S("This area is owned by @1", owner) .. "!")
  233. return false
  234. end
  235. end
  236. -- when using protector as tool, show protector information
  237. if infolevel == 2 then
  238. minetest.chat_send_player(digger,
  239. S("This area is owned by @1", owner) .. ".")
  240. minetest.chat_send_player(digger,
  241. S("Protection located at: @1", minetest.pos_to_string(pos[n])))
  242. if members ~= "" then
  243. minetest.chat_send_player(digger, S("Members: @1.", members))
  244. end
  245. return false
  246. end
  247. end
  248. -- show when you can build on unprotected area
  249. if infolevel == 2 then
  250. if #pos < 1 then
  251. minetest.chat_send_player(digger, S("This area is not protected."))
  252. end
  253. minetest.chat_send_player(digger, S("You can build here."))
  254. end
  255. return true
  256. end
  257. local old_is_protected = minetest.is_protected
  258. -- check for protected area, return true if protected and digger isn't on list
  259. function minetest.is_protected(pos, digger)
  260. digger = digger or "" -- nil check
  261. -- is area protected against digger?
  262. if not protector.can_dig(protector_radius, pos, digger, false, 1) then
  263. local player = minetest.get_player_by_name(digger)
  264. if player and player:is_player() then
  265. -- hurt player if protection violated
  266. if protector_hurt > 0 and player:get_hp() > 0 then
  267. -- This delay fixes item duplication bug (thanks luk3yx)
  268. minetest.after(0.1, function()
  269. player:set_hp(player:get_hp() - protector_hurt)
  270. end)
  271. end
  272. -- flip player when protection violated
  273. if protector_flip then
  274. -- yaw + 180°
  275. local yaw = player:get_look_horizontal() + math.pi
  276. if yaw > 2 * math.pi then
  277. yaw = yaw - 2 * math.pi
  278. end
  279. player:set_look_horizontal(yaw)
  280. -- invert pitch
  281. player:set_look_vertical(-player:get_look_vertical())
  282. -- if digging below player, move up to avoid falling through hole
  283. local pla_pos = player:get_pos()
  284. if pos.y < pla_pos.y then
  285. player:set_pos({
  286. x = pla_pos.x,
  287. y = pla_pos.y + 0.8,
  288. z = pla_pos.z
  289. })
  290. end
  291. end
  292. end
  293. return true
  294. end
  295. -- otherwise can dig or place
  296. return old_is_protected(pos, digger)
  297. end
  298. -- make sure protection block doesn't overlap another protector's area
  299. local check_overlap = function(itemstack, placer, pointed_thing)
  300. if pointed_thing.type ~= "node" then
  301. return itemstack
  302. end
  303. local pos = pointed_thing.above
  304. local name = placer:get_player_name()
  305. -- make sure protector doesn't overlap onto protected spawn area
  306. if inside_spawn(pos, protector_spawn + protector_radius) then
  307. minetest.chat_send_player(name,
  308. S("Spawn @1 has been protected up to a @2 block radius.",
  309. minetest.pos_to_string(statspawn), protector_spawn))
  310. return itemstack
  311. end
  312. -- make sure protector doesn't overlap any other player's area
  313. if not protector.can_dig(protector_radius * 2, pos, name, true, 3) then
  314. minetest.chat_send_player(name,
  315. S("Overlaps into above players protected area"))
  316. return itemstack
  317. end
  318. return minetest.item_place(itemstack, placer, pointed_thing)
  319. end
  320. -- remove protector display entities
  321. local del_display = function(pos)
  322. local objects = minetest.get_objects_inside_radius(pos, 0.5)
  323. for _, v in ipairs(objects) do
  324. if v and v:get_luaentity()
  325. and v:get_luaentity().name == "protector:display" then
  326. v:remove()
  327. end
  328. end
  329. end
  330. -- temporary pos store
  331. local player_pos = {}
  332. -- protection node
  333. minetest.register_node("protector:protect", {
  334. description = S("Protection Block") .. " (" .. S("USE for area check") .. ")",
  335. drawtype = "nodebox",
  336. tiles = {
  337. "default_stone.png^protector_overlay.png",
  338. "default_stone.png^protector_overlay.png",
  339. "default_stone.png^protector_overlay.png^protector_logo.png"
  340. },
  341. sounds = default.node_sound_stone_defaults(),
  342. groups = {dig_immediate = 2, unbreakable = 1},
  343. is_ground_content = false,
  344. paramtype = "light",
  345. light_source = 4,
  346. node_box = {
  347. type = "fixed",
  348. fixed = {
  349. {-0.5 ,-0.5, -0.5, 0.5, 0.5, 0.5},
  350. }
  351. },
  352. on_place = check_overlap,
  353. after_place_node = function(pos, placer)
  354. local meta = minetest.get_meta(pos)
  355. meta:set_string("owner", placer:get_player_name() or "")
  356. meta:set_string("members", "")
  357. meta:set_string("infotext",
  358. S("Protection (owned by @1)", meta:get_string("owner")))
  359. end,
  360. on_use = function(itemstack, user, pointed_thing)
  361. if pointed_thing.type ~= "node" then
  362. return
  363. end
  364. protector.can_dig(protector_radius, pointed_thing.under,
  365. user:get_player_name(), false, 2)
  366. end,
  367. on_rightclick = function(pos, node, clicker, itemstack)
  368. local meta = minetest.get_meta(pos)
  369. local name = clicker:get_player_name()
  370. if meta
  371. and protector.can_dig(1, pos, name, true, 1) then
  372. player_pos[name] = pos
  373. minetest.show_formspec(name, "protector:node", protector_formspec(meta))
  374. end
  375. end,
  376. on_punch = function(pos, node, puncher)
  377. if minetest.is_protected(pos, puncher:get_player_name()) then
  378. return
  379. end
  380. minetest.add_entity(pos, "protector:display")
  381. end,
  382. can_dig = function(pos, player)
  383. return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
  384. end,
  385. on_blast = function() end,
  386. after_destruct = del_display
  387. })
  388. -- default recipe and alternative for MineClone2
  389. if protector_recipe then
  390. if minetest.registered_items["default:stone"] then
  391. minetest.register_craft({
  392. output = "protector:protect",
  393. recipe = {
  394. {"default:stone", "default:stone", "default:stone"},
  395. {"default:stone", "default:gold_ingot", "default:stone"},
  396. {"default:stone", "default:stone", "default:stone"},
  397. }
  398. })
  399. else
  400. minetest.register_craft({
  401. output = "protector:protect",
  402. recipe = {
  403. {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
  404. {"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
  405. {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
  406. }
  407. })
  408. end
  409. end
  410. -- protection logo
  411. minetest.register_node("protector:protect2", {
  412. description = S("Protection Logo") .. " (" .. S("USE for area check") .. ")",
  413. tiles = {"protector_logo.png"},
  414. wield_image = "protector_logo.png",
  415. inventory_image = "protector_logo.png",
  416. sounds = default.node_sound_stone_defaults(),
  417. groups = {dig_immediate = 2, unbreakable = 1},
  418. paramtype = "light",
  419. paramtype2 = "wallmounted",
  420. legacy_wallmounted = true,
  421. light_source = 4,
  422. drawtype = "nodebox",
  423. sunlight_propagates = true,
  424. walkable = true,
  425. node_box = {
  426. type = "wallmounted",
  427. wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5},
  428. wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5},
  429. wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375},
  430. },
  431. selection_box = {type = "wallmounted"},
  432. on_place = check_overlap,
  433. after_place_node = function(pos, placer)
  434. local meta = minetest.get_meta(pos)
  435. meta:set_string("owner", placer:get_player_name() or "")
  436. meta:set_string("members", "")
  437. meta:set_string("infotext",
  438. S("Protection (owned by @1)", meta:get_string("owner")))
  439. end,
  440. on_use = function(itemstack, user, pointed_thing)
  441. if pointed_thing.type ~= "node" then
  442. return
  443. end
  444. protector.can_dig(protector_radius, pointed_thing.under,
  445. user:get_player_name(), false, 2)
  446. end,
  447. on_rightclick = function(pos, node, clicker, itemstack)
  448. local meta = minetest.get_meta(pos)
  449. local name = clicker:get_player_name()
  450. if meta
  451. and protector.can_dig(1, pos, name, true, 1) then
  452. player_pos[name] = pos
  453. minetest.show_formspec(name, "protector:node", protector_formspec(meta))
  454. end
  455. end,
  456. on_punch = function(pos, node, puncher)
  457. if minetest.is_protected(pos, puncher:get_player_name()) then
  458. return
  459. end
  460. minetest.add_entity(pos, "protector:display")
  461. end,
  462. can_dig = function(pos, player)
  463. return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
  464. end,
  465. on_blast = function() end,
  466. after_destruct = del_display
  467. })
  468. -- recipes to switch between protectors
  469. minetest.register_craft({
  470. type = "shapeless",
  471. output = "protector:protect",
  472. recipe = {"protector:protect2"}
  473. })
  474. minetest.register_craft({
  475. type = "shapeless",
  476. output = "protector:protect2",
  477. recipe = {"protector:protect"}
  478. })
  479. -- check formspec buttons or when name entered
  480. minetest.register_on_player_receive_fields(function(player, formname, fields)
  481. if formname ~= "protector:node" then
  482. return
  483. end
  484. local name = player:get_player_name()
  485. local pos = player_pos[name]
  486. if not name or not pos then
  487. return
  488. end
  489. local add_member_input = fields.protector_add_member
  490. -- reset formspec until close button pressed
  491. if (fields.close_me or fields.quit)
  492. and (not add_member_input or add_member_input == "") then
  493. player_pos[name] = nil
  494. return
  495. end
  496. -- only owner can add names
  497. if not protector.can_dig(1, pos, player:get_player_name(), true, 1) then
  498. return
  499. end
  500. -- are we adding member to a protection node ? (csm protection)
  501. local nod = minetest.get_node(pos).name
  502. if nod ~= "protector:protect"
  503. and nod ~= "protector:protect2" then
  504. player_pos[name] = nil
  505. return
  506. end
  507. local meta = minetest.get_meta(pos)
  508. if not meta then
  509. return
  510. end
  511. -- add faction members
  512. if factions_available then
  513. meta:set_int("faction_members", fields.faction_members == "true" and 1 or 0)
  514. end
  515. -- add member [+]
  516. if add_member_input then
  517. for _, i in pairs(add_member_input:split(" ")) do
  518. add_member(meta, i)
  519. end
  520. end
  521. -- remove member [x]
  522. for field, value in pairs(fields) do
  523. if string.sub(field, 0,
  524. string.len("protector_del_member_")) == "protector_del_member_" then
  525. del_member(meta,
  526. string.sub(field,string.len("protector_del_member_") + 1))
  527. end
  528. end
  529. minetest.show_formspec(name, formname, protector_formspec(meta))
  530. end)
  531. -- display entity shown when protector node is punched
  532. minetest.register_entity("protector:display", {
  533. physical = false,
  534. collisionbox = {0, 0, 0, 0, 0, 0},
  535. visual = "wielditem",
  536. -- wielditem seems to be scaled to 1.5 times original node size
  537. visual_size = {x = 0.67, y = 0.67},
  538. textures = {"protector:display_node"},
  539. timer = 0,
  540. glow = 10,
  541. on_step = function(self, dtime)
  542. self.timer = self.timer + dtime
  543. -- remove after set number of seconds
  544. if self.timer > protector_show then
  545. self.object:remove()
  546. end
  547. end,
  548. })
  549. -- Display-zone node, Do NOT place the display as a node,
  550. -- it is made to be used as an entity (see above)
  551. local x = protector_radius
  552. minetest.register_node("protector:display_node", {
  553. tiles = {"protector_display.png"},
  554. use_texture_alpha = true,
  555. walkable = false,
  556. drawtype = "nodebox",
  557. node_box = {
  558. type = "fixed",
  559. fixed = {
  560. -- sides
  561. {-(x+.55), -(x+.55), -(x+.55), -(x+.45), (x+.55), (x+.55)},
  562. {-(x+.55), -(x+.55), (x+.45), (x+.55), (x+.55), (x+.55)},
  563. {(x+.45), -(x+.55), -(x+.55), (x+.55), (x+.55), (x+.55)},
  564. {-(x+.55), -(x+.55), -(x+.55), (x+.55), (x+.55), -(x+.45)},
  565. -- top
  566. {-(x+.55), (x+.45), -(x+.55), (x+.55), (x+.55), (x+.55)},
  567. -- bottom
  568. {-(x+.55), -(x+.55), -(x+.55), (x+.55), -(x+.45), (x+.55)},
  569. -- middle (surround protector)
  570. {-.55,-.55,-.55, .55,.55,.55},
  571. },
  572. },
  573. selection_box = {
  574. type = "regular",
  575. },
  576. paramtype = "light",
  577. groups = {dig_immediate = 3, not_in_creative_inventory = 1},
  578. drop = "",
  579. })
  580. dofile(MP .. "/doors_chest.lua")
  581. dofile(MP .. "/pvp.lua")
  582. dofile(MP .. "/admin.lua")
  583. dofile(MP .. "/tool.lua")
  584. dofile(MP .. "/hud.lua")
  585. dofile(MP .. "/lucky_block.lua")
  586. -- stop mesecon pistons from pushing protectors
  587. if minetest.get_modpath("mesecons_mvps") then
  588. mesecon.register_mvps_stopper("protector:protect")
  589. mesecon.register_mvps_stopper("protector:protect2")
  590. mesecon.register_mvps_stopper("protector:chest")
  591. end
  592. print (S("[MOD] Protector Redo loaded"))