• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell Lawful Grace paladin spell

Rielx

FOOL
Joined
Aug 23, 2010
Messages
67
Reaction score
1
Haven't shared anything for a long time, so here's some cool spell i made yesterday, to buff up my pal vocation on the server;
Spell is basically much like stronger version of eternal spear, tho you cant use it without target, and main thing about it, its lawful and you cannot strike killing blows to the players or the monsters with it.

lawful_grace.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)



function onTargetCreature(cid, target) 

local maglevel = getPlayerMagLevel(cid)
local level = getPlayerLevel(cid)
local dist = getPlayerSkillLevel(cid, 4)


	local mini = (level/6 * (dist * 2 + maglevel*2)) * 0.1
	local maxi = (level/6 * (dist * 2 + maglevel*2)) * 0.15
	local damage = math.random(mini, maxi)
	
if isPlayer(target) then
	if getCreatureHealth(target) < damage/2 then
	doSendMagicEffect(creatureGetPosition(target), CONST_ME_HOLYAREA)
	doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE,-getCreatureHealth(target)*2+1,-getCreatureHealth(target)*2+1, CONST_ME_HOLYDAMAGE)
	else
	doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE,-damage,-damage, CONST_ME_HOLYDAMAGE)
	end
else
	if getCreatureHealth(target) < damage then
	doSendMagicEffect(creatureGetPosition(target), CONST_ME_HOLYAREA)
	doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE,-getCreatureHealth(target)+1,-getCreatureHealth(target)+1, CONST_ME_HOLYDAMAGE)
	else
	doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE,-damage,-damage, CONST_ME_HOLYDAMAGE)
	end
end


end

setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

spells.xml
Code:
	<instant name="lawful grace" words="exori venia fas" lvl="60" mana="300" prem="1" range="3" needtarget="1" exhaustion="2000" blockwalls="1" needlearn="0" event="script" value="customspells/lawful_grace.lua">
		<vocation id="3"/>
	</instant>

Untitled-1.jpg
Instead of killing a rat, leaves it with 1 hp. Same goes for players...
 
Back
Top