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

[Request]Vocation mana rune with exhaust.

Syndicate

New Member
Joined
Mar 29, 2008
Messages
9
Reaction score
0
Im looking for a mana rune which gives different mana and health to different vocation.
The problem in my server is that people can stairhop, they cant cast spells due to the 2000 stair hop exhaust. I want them to have a one second exhaust when stairhopping.

This is the code i tried to make.. From other scripts though, no credits to me at all.

Code:
local vocation = { 
                   [{1,5}] = {manamin = 500,manamax = 600, healthmin = 0 , healthmax= 0},   -- [vocation,promotedvocation] = {mini = minimum heal, maxi = maximum heal}
                   [{2,6}] = {manamin = 500,manamax = 600, healthmin = 0 , healthmax= 0},
				   [{3,7}] = {manamin = 400,manamax = 500, healthmin = 100, healthmax= 150},  
				   [{4,8}] = {manamin = 150,manamax = 200, healthmin = 0 , healthmax= 0},
				   [{9,10}] = {manamin = 1400,manamax = 1500, healthmin = 0 , healthmax= 0},
				   [{11}] = {manamin = 1000,manamax = 1100, healthmin = 500 , healthmax= 700},
				   [{12}] = {manamin = 350,manamax = 550, healthmin = 0 , healthmax= 0}
				   }
local exhaust = createConditionObject(CONDITION_EXHAUST);
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 10000));
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == true then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end

   for k,v in pairs(vocation) do
               if isInArray(k,getPlayerVocation(cid)) then
					doAddCondition(cid, exhaust)
                    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
 
If you can edit this script and make it work, i would be more then happy. I tried to put the exhaust thingy into the excisting script. The script works only it doesnt give you exhaust.
 
LUA:
local t = {
	-- [vocation, promotedvocation] = {mini = minimum heal, maxi = maximum heal}
	[{1, 2, 5, 6}] = {mp={500,600}},
	[{3, 7}] = {mp={400,500}, hp={100,150}},
	[{4, 8}] = {mp={150,200}},
	[{9, 10}] = {mp={1400,1500}},
	[{11}] = {mp={1000,1100}, hp={500,700}},
	[{12}] = {mp={350,550}}
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, EXHAUST_HEALING)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return false
	elseif hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end

	local p = getPlayerVocation(cid)
	for k, v in pairs(t) do
		if isInArray(k, p) then
			doAddCondition(cid, exhaust)
			if v.mp then
				doCreatureAddMana(cid, math.random(v.mp[1], v.mp[2]))
			end
			if v.hp then
				doCreatureAddHealth(cid, math.random(v.hp[1], v.hp[2]))
			end
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			return true
		end
	end

end
 
Back
Top