Guitar Freak
_LüA_n☺b_
Well, I just saw a thread by a person requesting this spell, and I havent seen threads here with things like a spell that you use that wastes all your mana at any time, to mana train whenever the player feels like, and not only when the mana is a certain amount (or full) like most servers's manawaste spells.
So, as Im learning lua and Im still not too great at it, I decided Id give it a shot to see if I could make it or something similar.
I ended up on the "similar"
This means that what I made is a simulation of the spell, it isnt really a spell spell I think, but it works exactly like one and the "mana waste" part works perfectly.
In spells.xml add this:
Now into scripts make manawaste.lua and add this:
It might be a bit silly. but is one of the first scripts I make from scratch (the other ones are even sillier ).
Compatibility: Tested + working on TFS 0.3+
Have fun.
So, as Im learning lua and Im still not too great at it, I decided Id give it a shot to see if I could make it or something similar.
I ended up on the "similar"
This means that what I made is a simulation of the spell, it isnt really a spell spell I think, but it works exactly like one and the "mana waste" part works perfectly.
In spells.xml add this:
Lua:
<instant name="Mana Waste" words="manawaste" lvl="1" mana="0" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="manawaste.lua"/>
Now into scripts make manawaste.lua and add this:
Lua:
--[[
* Alternative "Mana Waste" Spell *
Author: Guitar Freak.
Optimizations: Evil Hero, Hermes.
]]--
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
local playerMana = getPlayerMana(cid)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if playerMana > 0 then
doPlayerAddSpentMana(cid, playerMana)
doCreatureAddMana(cid, -playerMana)
doCombat(cid, combat, var)
if not inFight then
doRemoveCondition(cid, CONDITION_INFIGHT)
end
else
doPlayerSendCancel(cid, "You dont have any mana.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
It might be a bit silly. but is one of the first scripts I make from scratch (the other ones are even sillier ).
Compatibility: Tested + working on TFS 0.3+
Have fun.
Last edited: