• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Increase/Deincrease MANA ...

Status
Not open for further replies.
Level 11
Joined
Jul 28, 2007
Messages
920
I searched but didnt find anything related... probbly someone asked this but, how can i increase unit's mana pool and deincrease it, by using an item for example. I dont like to add and remove new abilites, like, 10 mana, 5 mana, 100 mana, that causes lagg...

Exacly what i want is, when unit uses item, that he gets +5 to maximum mana, and if he uses item again, another +5 max mana, and when he uses another item that deincreases, well, -5 max mana, and so on, ? Its for system... i just can remember what i used before xD
 
Level 8
Joined
Jul 22, 2008
Messages
331
Bboy they are telling you few only possible ways to do that..
BTW, and you can always replace units...
you can't increase or decrease mana or health by using trigger - Unit - Property....
___________________________
I hope you will find your way to do it...
 
Level 11
Joined
Jul 28, 2007
Messages
920
I can increase and deincrease health by adding tomes, with +5 or -5 hp for example, for mana there is way to make for each time new +5mana item. item mana bonus levels wont work. I just got an idea; to make like 100 items, 1st gives 5mp, 2nd 10mp, 3rd 15mp, and so on. So i would need to use some system to calculate how much i need and replace ability.
If for equip system, when i use an item that gives 5mp, and another that gives 10mp, that is 15 mp, nopw i just need to replace that 5mp ( wich i equipped 1st) with 15mp ability. That could work i think, i just need to preload abilities at start to prevent lagg... anyway if someone has any better idea, post here.
 
Level 8
Joined
Jul 22, 2008
Messages
331
or youcan do like this:
  • Events
    • Unit uses an item
  • Conditions
    • Item - item type of (item being manipulated) equal to (your item +5)
  • Actions
    • Remove (Item type of (item being manipulated)) from (hero manipulating item)
    • Create (your item +10) and give it to (hero manipulatig item)
This should work....
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
Item based mana addition is not that unefficient. I recomend using it over any upgrade system as abilities are leakless and fully reversiable as well as MUI (can affect a specific unit). Upgrades are generic so it will affect the whole unit type.

Only major downer with it is the increase in map loading times but really it is the only way to do it.

If you must have an alternative you have to use heroes and modify their intelligence.
 
Level 11
Joined
Jul 28, 2007
Messages
920
Here's the solution(and i think its the best way to do it):

TRIG1:
Actions
Set AAA_num = 1
Set MP_abil[AAA_num] = MP 0
Set AAA_num = (AAA_num + 1)
Set MP_abil[AAA_num] = MP 5
Set AAA_num = (AAA_num + 1)
Set MP_abil[AAA_num] = MP 10
Set AAA_num = (AAA_num + 1)
Set MP_abil[AAA_num] = MP 15
Set AAA_num = (AAA_num + 1)
Set MP_abil[AAA_num] = MP 20
..... and so on ( AAA_num = XX )


TRIG2:
Actions
For each (Integer A) from 1 to XX, do (Actions)
Loop - Actions
Unit - Remove MP_abil[(Integer A)] from Hero_Player[(Player number of (Owner of (Triggering unit)))]
Set MP_ITEM[(Player number of (Owner of (Triggering unit)))] = ((Player number of (Owner of (Triggering unit))) + 2"THIS IS MANA, 1=5 MANA, SO 2=10MANA")
Unit - Add MP_abil[MP_ITEM[(Player number of (Owner of (Triggering unit)))]] to Hero_Player[(Player number of (Owner of (Triggering unit)))]


TRIG3:
Actions
For each (Integer A) from 1 to XX, do (Actions)
Loop - Actions
Unit - Remove MP_abil[(Integer A)] from Hero_Player[(Player number of (Owner of (Triggering unit)))]
Set MP_ITEM[(Player number of (Owner of (Triggering unit)))] = ((Player number of (Owner of (Triggering unit))) - 2)
Unit - Add MP_abil[MP_ITEM[(Player number of (Owner of (Triggering unit)))]] to Hero_Player[(Player number of (Owner of (Triggering unit)))]



That could be shorter probbly, but this works fine too :D.


EDIT: Downside of this is that you need to create as many MP_abils you need.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
There is a nice trick you could use:
The abilities "Item Life bonus" and "Item mana bonus" only give/take away the maximum mana when you add or remove them - not when you change it's level.
So, i would do it this way:
dummy ability created from "item mana bonus"
1. level ... + 6 Max Mana
2. level ... + 1 Max Mana
Then, whenever you want to increase max mana of the unit, just add this ability (-> +6 MaxMana), increase its level( no change) and remove it (-> -1 MaxMana), giving a total difference of 5 MaxMana. Decreasing works simillary, just use +1 on first level and +6 on second.
 
Status
Not open for further replies.
Top