1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-19 16:50:31 +01:00

Added mana max rune

- Added mane max rune
 - Fixed projection rune
This commit is contained in:
LeMagnesium 2015-04-25 23:01:27 +02:00
parent af3bb78c3f
commit c15196fd0e
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@
projection = function(itemstack, user, pointed_thing)
if pointed_thing.type == "object" then
local dir = vector.direction(user:getpos(),pointed_thing.ref:getpos())
local v = pointed_thing.ref:getvelocity() or {x=0,y=0,z=0}
local ykb = 10
if v.y ~= 0 then ykb = 0 end
pointed_thing.ref:setvelocity({x=dir.x*50,y=ykb,z=dir.z*50})
@ -49,6 +50,12 @@ go_to_me = function(pos, node, digger)
end
end
set_manamax = function(itemstack, user, pointed_thing)
if user and user:is_player() then
mana.set(user:get_player_name(),mana.getmax(user:get_player_name()))
end
end
-- Then, connect
runes.functions.connect("project","use",projection)
@ -57,3 +64,4 @@ runes.functions.connect("earthquake","use",earthquake)
runes.functions.connect("gotome","place",add_owner)
runes.functions.connect("gotome","dig",go_to_me)
runes.functions.connect("gotome","can_dig",is_owner_online)
runes.functions.connect("megamana","use",set_manamax)

View File

@ -38,6 +38,11 @@ runes.datas.items = {
description = "Go to me rune",
img = "default_wood.png",
type = "cube"
},
["megamana"] = {
description = "Mega Mana",
img = "default_diamond.png",
type = "craftitem"
}
}