• 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 Support please! REP+

Snakie

New Member
Joined
Apr 15, 2010
Messages
263
Reaction score
4
People i need somebody to rescript this for me, i wannt this manarune to work like a potion so you can shot sds and heal at the same time rep++ to the one that helps me!



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
function onGetFormulaValues(cid, level, maglevel)
local min = level * 2 + maglevel * 10
local max = level * 2 + maglevel * 11
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Add this on top data/actions/actions.xml:

Code:
<action itemid="XXXX" event="script" value="manarune.lua"/>

XXXX is your rune ItemID being used.

now add this as manarune.lua on data/actions/scripts/
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	playerLevel = getPlayerLevel(cid)
	playerML = getPlayerMagLevel(cid)
	local min = playerLevel * 2 + playerML * 10
	local max = playerLevel * 2 + playerML * 11
	mana = math.random(min,max)
	doPlayerAddMana(cid,mana) 
	doPlayerRemoveItem(cid, item.itemid, 1)
	doSendMagicEffect(toPosition, 12)
	return true
end

Still needs exhausted code line, but i'm at job, so try that and i will add the exhausted code line shortly.
 
I'll wait til you add that line thats needed couse i cant try it, i got 70 players online and each restart i lose some of them so i need to be 100% that the script works, hope you can help me soon!
 
I'll wait til you add that line thats needed couse i cant try it, i got 70 players online and each restart i lose some of them so i need to be 100% that the script works, hope you can help me soon!

Isn't it better to use /reload action instead of restarting the server everytime?
 
Actions.xml add
Code:
<action itemid="[COLOR="red"]XXXX[/COLOR]" event="script" value="manarune.lua"/>
Red is rune ID

manarune.lua
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') + 1000))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	playerLevel = getPlayerLevel(cid)
	playerML = getPlayerMagLevel(cid)
	local min = playerLevel * 2 + playerML * 10
	local max = playerLevel * 2 + playerML * 11
	mana = math.random(min,max)
	  if hasCondition(cid, CONDITION_EXHAUST) == FALSE then
		doPlayerAddMana(cid,mana) 
		doPlayerRemoveItem(cid, item.itemid, 1)
		doSendMagicEffect(toPosition, 12)
          else
		doPlayerSendCancel(cid, "You are exhausted!")
	  end
	return 1
end

Edit exhaustion on this part
Code:
(getConfigInfo('timeBetweenExActions') + [COLOR="red"]1000[/COLOR]))
Rep+ :thumbup:
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return not doPlayerSendCancel(cid, 'You can only use this rune on players.')
	end

	local lvl, mlvl = getPlayerLevel(cid), getPlayerMagLevel(cid)
	local min = lvl * 2 + mlvl * 10
	local max = lvl * 2 + mlvl * 11
	doPlayerAddMana(cid, math.random(min,max)) 
	doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
	return true
end
 
Back
Top