223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
if matprops.bond then
local userct, found = 0, false
for i=1,matprops.bond do
local prop = 'bound_user_' .. tostring(i)
if meta:contains(prop) then
userct = i
local name = meta:get_string(prop)
print('wand bound to',name,i)
if name == user:get_player_name() then found = true break end
else break end
end
if not found then
if userct < matprops.bond then
print('binding wand to caster')
minetest.sound_play("xdecor_enchanting", { --FIXME make own sounds
pos = user:get_pos();
gain = 0.8;
})
sorcery.vfx.cast_sparkle(user, sorcery.lib.color(25,129,255), 2)
meta:set_string('bound_user_' .. tostring(userct+1), user:get_player_name())
return stack
|
|
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
if matprops.bond then
local userct, found = 0, false
for i=1,matprops.bond do
local prop = 'bound_user_' .. tostring(i)
if meta:contains(prop) then
userct = i
local name = meta:get_string(prop)
-- print('wand bound to',name,i)
if name == user:get_player_name() then found = true break end
else break end
end
if not found then
if userct < matprops.bond then
-- print('binding wand to caster')
minetest.sound_play("xdecor_enchanting", { --FIXME make own sounds
pos = user:get_pos();
gain = 0.8;
})
sorcery.vfx.cast_sparkle(user, sorcery.lib.color(25,129,255), 2)
meta:set_string('bound_user_' .. tostring(userct+1), user:get_player_name())
return stack
|