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

Manarune problem rep++ Cykotitan PLEASE READ OR ANY OTHER GOOD SCRIPTERS!!

Dalale

GX
Joined
Jun 13, 2008
Messages
718
Reaction score
2
Location
Sweden
Hello.
I got a old script from my 0.2 server, i would like to add my manarune like this, it will be adding people mana depending on mag lvl/vocation
also i will upload the 0.3 manarune i use right now, if anyone please could add it for me.

0.2 manarune is in "spells"
0.3 manarune is a "action"


0.2 script V

Code:
-- Script 100% by Colandus (Except for the exhaustion system).
-- If you edit this script, make sure to leave the credits to me, Colandus.
 
-- >>CONFIG<< --
--local ACCESS = {NO_REMOVE = 5, NO_EXHAUST = 5} -- The access of players that does not lose charges/get exhausted using the rune.
local MIN_MANA = 800 -- How much mana minium will you get?
local MAX_MANA = 1600 -- How much mana max will you get?
local STORE_VALUE = 3568 -- Value where exhaust is saved.
local EXHAUST_TIME = 2 -- Exhaust time in seconds.
local ANIMATION_COLOR = 41 -- The color of the "animation".
-- >>CONFIG<< --
 
local vocMultiply = {0.35, 0.35, 0.85, 1.05, 0, 0, 0.65, 0.80}
 
function onCastSpell(cid, var)
	local removeMana = 0
	local pos = getCreaturePosition(cid)
	if variantToNumber(var) == cid then
	--	if isExhausted(cid, STORE_VALUE, EXHAUST_TIME) == FALSE then
		local maxMana = getPlayerMaxMana(cid)
		if getPlayerMana(cid) < maxMana then
			local randMana = math.random(MIN_MANA, MAX_MANA)
			if getPlayerVocation(cid) >= 1 and getPlayerVocation(cid) <= 8 then
				removeMana = vocMultiply[getPlayerVocation(cid)]
			end
			local newMana = math.ceil(randMana + getPlayerLevel(cid) * 1.2 + getPlayerMagLevel(cid) * 1.5 - (randMana * removeMana))
			if getPlayerMana(cid) + newMana > maxMana then
				newMana = maxMana - getPlayerMana(cid)
			end



0.3 manarune script an "action"
Code:
function onUse(cid, item, frompos, item2, topos)
	if isExhausted(cid, 4231133, 1) == 1 then
		warnPlayer(cid, "You are exhausted.")
	elseif getPlayerLevel(cid) >= 50 then
		local chance = math.random(1, #text)
		local mana = math.random(getPlayerLevel(cid), getPlayerLevel(cid) * 5) + getPlayerMagLevel(cid) * 30
		local mana = math.random(1800, 2500)

		local chance1 = math.random(1, #textcolor)
		local pos = getCreaturePosition(cid)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		for x = -1, 1 do
			for y = -1, 1 do
				if(x ~= 0 and y ~= 0) then
					for i = 1, 1 do
						doSendDistanceShoot(pos, {x = pos.x + x * i, y = pos.y + y * i, z = pos.z}, 3)
					end
					doSendDistanceShoot(pos, {x = pos.x + x * 2, y = pos.y + y * 2, z = pos.z}, 35) --
					--doSendMagicEffect({x = pos.x + x * 6, y = pos.y + y * 6, z = pos.z}, CONST_ME_FIREAREA)
				end
			end
		end
		doPlayerAddMana(cid, mana)
		doSendAnimatedText(pos, mana, TEXTCOLOR_ORANGE)
		--doSendAnimatedText(pos, text[chance], textcolor[chance1])
		for i = 1, 3 do
			doSendMagicEffect(pos, effect[i][math.random(1, #effect[i])])
		end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Refilled " ..mana.." mana!")
		setExhaust(cid, 4231133, 1)
	else
		warnPlayer(cid, "Your level is too low.")
	end
	return TRUE
end
 
Lua:
local combat = createCombatObject() 
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) 
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) 
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) 
 
function onCastSpell(cid, var) 
 
local level = getPlayerLevel(cid) 
local mlevel = getPlayerMagLevel(cid) 
local pos = getPlayerPosition(cid) 
 
-- Mana Formula Settings -- 
-- You can use "level" and "mlevel" -- 
local mana_minimum = (level * 12.33) + (mlevel * 4) - 50 
local mana_maximum = (level * 13.5) + (mlevel * 5) 
-- Mana Formula Settings END -- 
local mana_add = math.random(mana_minimum, mana_maximum) 
doPlayerAddMana(cid, mana_add) 
doSendAnimatedText(pos, mana_add, TEXTCOLOR_PURPLE) 
return doCombat(cid, combat, var) 
end
 
Lua:
local combat = createCombatObject() 
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) 
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) 
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) 
 
function onCastSpell(cid, var) 
 
local level = getPlayerLevel(cid) 
local mlevel = getPlayerMagLevel(cid) 
local pos = getPlayerPosition(cid) 
 
-- Mana Formula Settings -- 
-- You can use "level" and "mlevel" -- 
local mana_minimum = (level * 12.33) + (mlevel * 4) - 50 
local mana_maximum = (level * 13.5) + (mlevel * 5) 
-- Mana Formula Settings END -- 
local mana_add = math.random(mana_minimum, mana_maximum) 
doPlayerAddMana(cid, mana_add) 
doSendAnimatedText(pos, mana_add, TEXTCOLOR_PURPLE) 
return doCombat(cid, combat, var) 
end

Thanks! But i want it as a action script, could u please fix it?
 
No, Its Should Be My all Custom Runes is Actions :)

A rune is considered a spell in the original distributions of OTs, just because some people like it as an action does not mean I'm going to remake it to their liking, it takes about 5 minutes, just do it yourself..

If you want it so badly, then get it.. Just next time you want to use a rune, I would really appreciate you using it as a Spell.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local exhausted = createConditionObject(CONDITION_EXHAUST)
			setConditionParam(exhausted, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
	local level = getPlayerLevel(cid) 
	local mlevel = getPlayerMagLevel(cid) 
	local pos = getPlayerPosition(cid) 
 
-- Mana Formula Settings -- 
-- You can use "level" and "mlevel" -- 
	local mana_minimum = (level * 12.33) + (mlevel * 4) - 50 
	local mana_maximum = (level * 13.5) + (mlevel * 5) 
-- Mana Formula Settings END -- 
	local mana_add = math.random(mana_minimum, mana_maximum) 
		doPlayerAddMana(cid, mana_add) 
		doSendAnimatedText(pos, mana_add, TEXTCOLOR_PURPLE) 
	return doCombat(cid, combat, var) 
end
 
Thanks Sonik, changed mine from an action to a spell event, the action event was causing the server to send both a "You lost 1800 mana" and a "You received 1800 mana" which ordinarily would be very confusing to anyone using it.
 
Back
Top