PDA

View Full Version : [Support] Spells costing a % of mana instead of a fixed value?



Nytemair
07-22-2011, 03:49 AM
Hey team, got back into mapping after a short hiatus.

I'm basically wondering if there's any way to make a hero's ability use a percentage of their Maximum/base mana instead of a fixed value.

So far I'm just playing around with <takemana> but as far as I know you can only use fixed values.

ElementUser answered one of my other questions with a <changehealth> function, and I'm wondering if there's any mana version of that? :)

Edit: Testing a modified version of Ra's nuke, instead taking a percentage of mana...will let you know :)))

Oloko
07-22-2011, 06:19 AM
Simply take a look at Repulsor ultimate:



<checkcost>
<evaluate a="source_maxmana" b="0.07" op="mult" />
<evaluate a="15" b="result" op="add" />
<compare a="source_mana" b="result" op="lt">
<invalidate />
</compare>
</checkcost>

<activatecost>
<evaluate a="source_maxmana" b="0.07" op="mult" />
<evaluate a="15" b="result" op="add" />
<takemana amount="1" b="result" op="mult" />
</activatecost>
Of course you can remove the basic 15 mana cost to simply keep the %.

Nytemair
07-22-2011, 08:08 AM
Simply take a look at Repulsor ultimate:



<checkcost>
<evaluate a="source_maxmana" b="0.07" op="mult" />
<evaluate a="15" b="result" op="add" />
<compare a="source_mana" b="result" op="lt">
<invalidate />
</compare>
</checkcost>

<activatecost>
<evaluate a="source_maxmana" b="0.07" op="mult" />
<evaluate a="15" b="result" op="add" />
<takemana amount="1" b="result" op="mult" />
</activatecost>
Of course you can remove the basic 15 mana cost to simply keep the %.

Hehehe yeah, that's basically what I ended up with after screwing around with Ra's, thanks (: