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

Mana punch spell! [Request][Spell]

tosse12

Panchira Project Member
Joined
Jun 10, 2007
Messages
864
Reaction score
9
Location
Sweden
To start this thread off: I am not sure if this already exist, but I don't really know what to search for :D

Anyways, I would like to request a spell that does following:
Code:
Use 100% of the users mana
and turn 50% of that mana to physical dmg at target
if no target, do the spell infront of the player

So, let's say we have a player that have 6k mana as max mana. When he/she/(IT??) use "mana puch" spell, he/she will loose all mana, in this case 6k mana.
When the mana has been drained the spell will deal 3k on the target (within 7 range ofc, also not an aoe attack)

If you don't understand by 100% please ask me to be more specifc at the area u don't understand.

Thanks in advance

Yours Faithfully

Tosse12
 
But this one needs target. :(
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 35)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
function onCastSpell(cid, var)
        local pid = getCreatureTarget(cid)
        local drainAmount = getCreatureMana(cid)
       
     if getCreatureMana(cid) >= 2 then
	   doCreatureAddMana(cid, -drainAmount)
           doCreatureAddHealth(pid, - drainAmount /2 )
           doSendAnimatedText(getThingPos(pid),drainAmount /2 .."",TEXTCOLOR_RED)
	   doCombat(cid, combat, var)
     else
            doPlayerSendCancel(cid,"Not enough mana.")
     end
   return true
end

And in spells.xml
Code:
<instant name="Push mana" words="push" lvl="16" mana="0" prem="1" range="7" needtarget="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="xxxxx.lua">

Dont change need target.
 
@Damadger:
Your spell checks if player has 2 or more mana poitns...

@tosse12:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)

function onCastSpell(cid, var)
	if(doCombat(cid, combat, var)) then
		local mp, target = getCreatureMana(cid), variantToNumber(var)
		if(mp == getCreatureMaxMana(cid)) then
			doCreatureAddMana(cid, -mp)
			doCreatureAddHealth(target, -(mp / 2))
			doSendAnimatedText(getCreaturePosition(target), -(mp / 2), TEXTCOLOR_RED)
		else
			doPlayerSendCancel(cid, "You don't have enough mana.")
			return false
		end
		return true
	else
		return false
	end
end
 
Back
Top