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

Spell [0.3+] Waste all your mana AT ANY TIME (for mana training!).

So true!

My mistake, like a month ago I was going through all my scripts getting the "configs" out of the scripts because Colandus told me it was useless to keep them inside since they'd get redefined every time the script loaded, so it is truly useless, but I forgot to keep inside those that call for cid (duh :p), etc, it always happens to me lol thanks for the reminder ;)



Hey there Hermes, by the look of it I would think too it gets rid of the infight condition, have you tested it out to make sure?

Thanks anyway both of you!

EDIT: Nvm, I did test it and it works! I will edit the first post with it.

However, does anyone know how does the "getConfigInfo('rateMagic')" thing really work? Or what is the formula for "rateMagic"?

Because now that Im testing this, with the getConfigInfo it is spending a lot more mana than it should, but when I remove it, it takes the real thing.

Anyway edited first post with all optimizations, it should work properly now, thanks Hermes!


No problem =]
 
i've tested here and is counting muuuch more mana than the wasted.
exemple.
2 exuras: 10%
40 mp with manawaste: 2 ml's

:S
 
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:

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 :p).

Compatibility: Tested + working on TFS 0.3+

Have fun.
what i should write for the spell will work? i wrote mana and manawaste and nothing happens
 
Back
Top