• 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 fix help please <3

FakkaHe

New Member
Joined
Feb 2, 2008
Messages
110
Reaction score
0
Heya otlanders it's me again. Can someone make this script so it gives 50 more mana every level?

Thanks before hand!


Code:
-- you want not  to add health just keep min and max = 0 
 
local vocation = { 
                                   [{1,5}] = {manamin = 1,manamax = 1, healthmin = 0 , healthmax= 0},   -- [vocation,promotedvocation] = {mini = minimum heal, maxi = maximum heal}
                                   [{2,6}] = {manamin = 1,manamax = 1, healthmin = 0 , healthmax= 0},
				   [{3,7}] = {manamin = 1,manamax = 1, healthmin = 40, healthmax= 50},  
				   [{4,8}] = {manamin = 1,manamax = 1, healthmin = 20 , healthmax= 40}
				   }
 
function onUse (cid, item, frompos, topos)
   for k,v in pairs(vocation) do
               if isInArray(k,getPlayerVocation(cid)) then
                          doCreatureSay(cid,"Vocation Rune!",19)
                          doCreatureAddMana(cid,math.random(v.manamin,v.manamax))
	                  doCreatureAddHealth(cid,math.random(v.healthmin,v.healthmax))
	                  doSendMagicEffect(getThingPos(cid),12)
               end
  end
return true
end
 
Simple try this

local vocation = {
[{1,5}] = {manamin = 1,manamax = 1, healthmin = 40 , healthmax= 60}, -- [vocation,promotedvocation] = {mini = minimum heal, maxi = maximum heal}
[{2,6}] = {manamin = 1,manamax = 1, healthmin = 40 , healthmax= 60},
[{3,7}] = {manamin = 1,manamax = 1, healthmin = 45, healthmax= 80},
[{4,8}] = {manamin = 1,manamax = 1, healthmin = 30 , healthmax= 70}
}

function onUse (cid, item, frompos, topos)
for k,v in pairs(vocation) do
if isInArray(k,getPlayerVocation(cid)) then
doCreatureSay(cid,"Vocation Rune!",19)
doCreatureAddMana(cid,math.random(v.manamin,v.manamax))
doCreatureAddHealth(cid,math.random(v.healthmin,v.healthmax))
doSendMagicEffect(getThingPos(cid),12)
end
end
return true
end
 
Lol are u noob or just acting stupid ^^ Read what it says after vocation > U gotta add what min u want a what max > if u cant get that bit then idk how to help u , my help is beyond what u need lol :D
 
LUA:
local t = {}

t[1] = { mp = {45, 55} }
t[2] = t[1]
t[3] = { mp = {30, 35}, hp = {30, 35} }
t[4] = { mp = {10, 15}, hp = {40, 50} }

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local a = getPlayerVocation(cid)
	while a > 4 do
		a = a - 4
	end

	a = t[a]

	doCreatureSay(cid, 'Vocation Rune!', TALKTYPE_ORANGE_1)
	local l = getPlayerLevel(cid)

	if a.mp then
		doCreatureAddMana(cid, math.random( l * a.mp[1], l * a.mp[2] ))
	end
	if a.hp then
		doCreatureAddHealth(cid, math.random( l * a.hp[1], l * a.hp[2] ))
	end

	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)

	return true
end
 
Back
Top