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

Action>Spell

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
Can someone make this as a spell script?
Code:
function onUse (cid, item, fromPosition, itemEx, toPosition)
	if (getCreatureCondition(cid, CONDITION_EXHAUST)) then
		doPlayerSendCancel(cid, "You are exhausted.")
	else
		if getPlayerMagLevel(cid) >= 3 then
			if isPlayer(cid) then
				doCreatureAddHealth(cid, 100000000)
				doCreatureAddMana(cid, 100000000)
				doCreatureSay(cid, "Mixed Rune!", TALKTYPE_ORANGE_1)
			end
		end
	end
    return true
end
 
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onCastSpell(cid, var)
if getPlayerMagLevel(cid) < 4 then
		doCreatureAddHealth(cid, 100000000)
		doCreatureAddMana(cid, 100000000)
		doCreatureSay(cid, "Mixed Rune!", TALKTYPE_ORANGE_1)
	return doCombat(cid, combat, var)
else
	doPlayerSendCancel(cid, "Sorry, not enough magic level.")
	doSendMagicEffect(getCreaturePosition(cid, 2)
	end
	return true
end

XML:
	<instant name="SPELLNAME" words="SPELLWORD" lvl="XX" mana="XX" aggressive="0" selftarget="1" exhaustion="1000 = 1 sec" needlearn="0" event="script" value="healing/FILENAME.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="3"/>
		<vocation id="4"/>
		<vocation id="5"/>
		<vocation id="6"/>
		<vocation id="7"/>
		<vocation id="8"/>
		<vocation id="10"/>
	</instant>
 
XML:
<rune name="Mixed Rune" id="ITEMID" allowfaruse="1" charges="1" lvl="24" maglv="3" exhaustion="2000" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/FILENAME.lua"/>
		<vocation id="VOCID"/>
		<vocation id="VOCID" showInDescription="0"/>
	</rune>

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onCastSpell(cid, var)
		doCreatureAddHealth(cid, 100000000)
		doCreatureAddMana(cid, 100000000)
		doCreatureSay(cid, "Mixed Rune!", TALKTYPE_ORANGE_1)
	return doCombat(cid, combat, var)
end
 
this into spell rune?
Code:
local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions') - 100)
setConditionParam(exhausted, CONDITION_PARAM_SUBID, EXHAUST_HEALING)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if hasCondition(cid, CONDITION_EXHAUST, EXHAUST_HEALING) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	elseif not isPlayer(itemEx.uid) then
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	elseif getCreatureHealth(itemEx.uid) == getCreatureMaxHealth(itemEx.uid) then
		doPlayerSendCancel(cid, (itemEx.uid == cid and 'You already have' or getCreatureName(itemEx.uid) .. ' already has') .. ' full health.')
	else
		local lvl, mag, min, max = getPlayerLevel(cid), getPlayerMagLevel(cid)
		if isSorcerer(cid) or isDruid(cid) then
			min = lvl * 1.0 + mag * 1.0
			max = lvl * 1.0 + mag * 1.0
		elseif isPaladin(cid) then
			min = lvl * 1.0 + mag * 1.0
			max = lvl * 1.0 + mag * 1.0
		elseif isKnight(cid) then
			min = lvl * 0.5 + mag * 0.5
			max = lvl * 1.0 + mag * 1.0
		end
 
		local rand = math.random(min, max)
 
		rand = math.min(80000, rand)
		rand = math.max(80000, rand)
 
		doCreatureAddHealth(itemEx.uid, rand)
		doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
		doAddCondition(cid, exhausted)
		doCreatureSay(itemEx.uid, "HP!!", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Back
Top