undead mage
Active Member
Also I made the room a bit smaller but it seems that you can't do that without fcking up the script xD there are about 7~8 runes left that are not the same I couldn't rlly find out how to change that. It should be changed here right?
Code:
function newBoard()
cleanBoard()
table.shuffle(MATCH.SHOWN)
local i, k, l, x, y = 0, {}, MATCH.SIZE[1]*MATCH.SIZE[2], MATCH.BOARD.from.x, MATCH.BOARD.from.y
for index = 1, (MATCH.SIZE[1]*MATCH.SIZE[2])/2 do
table.insert(k, MATCH.SHOWN[index])
table.insert(k, MATCH.SHOWN[index])
end
while i < l do
v, p = k[math.random(#k)], Position(x, y, MATCH.BOARD.from.z)
p:sendMagicEffect(10)
table.remove(k, table.getIndex(k, v))
r = Item(doCreateItemEx(MATCH.HIDDEN, 1))
r:setActionId(31337)
r:setAttribute(ITEM_ATTRIBUTE_CHARGES, v)
doTileAddItemEx(p, r:getUniqueId())
i = i + 1
if x == MATCH.BOARD.to.x then
y = y + 1
x = MATCH.BOARD.from.x
else
x = x + 1
end
end
end