• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Manarune script REP++!

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
Hello Otlanders! i tried out how to fix that same rune heal differently depending voc, like.. this..

The one thats help me will get my rep!

Thanks for helping!

Lua:
 local runes = {
[2296] = {
voc = {1, 5},
min = 'level * 2.5 + maglv * 0 - 2',
max = 'level * 3.0 + maglv * 0'
},
[2296] = {
voc = {2, 6},
min = 'level * 2.5 + maglv * 0 - 2',
max = 'level * 3.0 + maglv * 0'
},
[2296] = {
voc = {3, 7},
min = 'level * 1.5 + maglv * 0 - 2',
max = 'level * 1.5 + maglv * 0'
},
[2296] = {
voc = {4, 8},
min = 'level * 0.5 + maglv * 0 - 2',
max = 'level * 0.5 + maglv * 0'
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = runes[item.itemid]
if isInArray(i.voc, getPlayerVocation(cid), getPlayerVocation(cid), getPlayerVocation(cid), getPlayerVocation(cid), getPlayerVocation(cid)) then
if isPlayer(itemEx.uid) == TRUE then
level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
doPlayerAddMana(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 0)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
end
else
doPlayerSendCancel(cid, 'Your vocation cannot use this rune.')
end
return true
end
 
Last edited by a moderator:
Lua:
dramix = {
-- [vocation] = {minmp, maxmp, minhp, maxhp},
	[1] = {3, 3.5, 0, 0}, 
	[2] = {3, 3.5, 0, 0},
	[3] = {1,1.2, 2, 2.2},
	[4] = {0, 0, 5, 7},
	[5] = {3, 3.5, 0, 0},
	[6] = {3, 3.5, 0, 0},
	[7] = {1,1.2, 2, 2.2},
	[8] = {0, 0, 5, 7}
}

function onUse(cid, item, itemEx)
local lv = getPlayerLevel(cid)
local conf = {
	v = dramix[getPlayerVocation(cid)],
	voc = getPlayerVocation(cid),
	level = 10
}

	if getPlayerLevel(cid) >= conf.level then
			doCreatureAddMana(cid, math.random((lv*conf.v[1]),(lv*conf.v[2])))
			doCreatureAddHealth(cid, math.random((lv*conf.v[3]),(lv*conf.v[4])))
			doCreatureSay(itemEx.uid, "Aaaah..", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getPlayerPosition(cid), 12)
	else
		doPlayerSendCancel(cid, 'Your vocation cannot use this rune.')
	end
end
 
Back
Top