• 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!

Adding health to..

Donio

Banned User
Joined
Jun 24, 2008
Messages
4,004
Reaction score
16
Location
Manhattan, New York
yoyo warup.. I need some help adding health and mana to voc 3 and 7, how can I do that?.. i'v read some tutorials but I dont rly get it to 100% I tried but failed about 4 times :P

Cykotitan if you are still alive I know you can help me with this! =)

Code:
local runes = {
	[2270] = {
		voc = {1, 2, 5, 6},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 1'
	},
	[2300] = {
		voc = {3, 7},
		min = 'level * 1 + maglv * 4 - 2',
		max = 'level * 1 + maglv * 7'
	},
	[2306] = {
		voc = {4, 8},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 3'
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if isInArray(i.voc, 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

Thats the script
 
made one fast
LUA:
local runes = {
	[2270] = {
		voc = {1, 2, 5, 6},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 1'
	},
	[2300] = {
		voc = {3, 7},
		min = 'level * 1 + maglv * 4 - 2',
		max = 'level * 1 + maglv * 7'
	},
	[2306] = {
		voc = {4, 8},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 3'
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if isInArray(i.voc, getPlayerVocation(cid)) then
		if isPlayer(itemEx.uid) == TRUE then
			if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
			doPlayerAddHealth(cid, health)(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
			end
			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

with this one the druid will get same min/max Hp as mana.

Rep? :P

edit:

With this one you can configure how much min/max hp the druid should get (in the hpma(max) and hpmi(min))
LUA:
local runes = {
	[2270] = {
		voc = {1, 2, 5, 6},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 1'
	},
	[2300] = {
		voc = {3, 7},
		min = 'level * 1 + maglv * 4 - 2',
		max = 'level * 1 + maglv * 7',
		hpmi = 'level * 1 + maglv * 4 - 2',
		hpma = 'level * 1 + maglv * 7'
	},
	[2306] = {
		voc = {4, 8},
		min = 'level * 1 + maglv * 1 - 2',
		max = 'level * 1 + maglv * 3'
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = runes[item.itemid]
	if isInArray(i.voc, getPlayerVocation(cid)) then
		if isPlayer(itemEx.uid) == TRUE then
			if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
			doPlayerAddHealth(cid, health)(cid, math.random(loadstring('return '..i.hpmi)(), loadstring('return '..i.hpma)()))
			end
			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
 
Back
Top