Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Uhh, this is such a simple question, I thought there was an item for it, but then I realised there wasn't. The I thought I could use a trigger, but I couldn't!
So yeah, I need an item to give +50 permanent mana to the user.
Is there a JASS way of doing it, to get/add mana to the unit (permanent total only)
Thanks guys, I'll try it out! Forgot you can just add those hidden abilities. Doesn't quite work the same way as a tome though, as I think their mana remaining doesn't increase as their cap does with those bonuses, but w/e, good enough.
Thanks again!
Gloom
P.S Unless someone else has something to add about a diff add, you can mark this as solved.
That looks like a lot of code and hassle for something simple :s
I read it over, it makes sense and all, but something that's based on a bug in the game may be fixed in the future, and I don't want to copy all the variables and libraries over...
I know but I need it to be a usable tome, not auto-acquired.. like they click it, and it gives them +50 mana..
And I need the item to be consumed.
btw I looked more over that VJass script then, it actually lags a little in the way it works, I may end up using it, I just took the map from wc3campaigns though, it was a bit simpler to understand... so thanks for that. +rep.
I think I got it from here now for sure. Thanks,
~Gloom
EDIT: Okay so I did get it after some modifications to the script etc...
I'll just paste my triggers just for anyone looking for this can find it easier. (Note; this is the most efficient way for anything added LESS THAN 100 mana (mine was +50), anyone who wants to add more than that will have to re-do the script a little.)
Code:
constant function MaxStateModifierId takes unitstate u returns integer
if u == UNIT_STATE_MAX_MANA then
return 'A02S' // Rawcode of the Max Mana Modifier ability.
endif
return 0
endfunction
function SetUnitMaxState takes unit whichUnit, unitstate whichUnitState, integer newVal returns boolean
local integer c = newVal-R2I(GetUnitState(whichUnit, whichUnitState))
local integer i = MaxStateModifierId(whichUnitState)
if i == 0 then
return false
endif
if c > 0 then
loop
exitwhen c == 0
call UnitAddAbility(whichUnit, i)
if c >= 10 then
set c = c - 10
call SetUnitAbilityLevel(whichUnit, i, 3)
else
set c = c - 1
call SetUnitAbilityLevel(whichUnit, i, 2)
endif
call UnitRemoveAbility(whichUnit, i)
endloop
endif
return true
endfunction
and then a trigger doing this:
-------
Event - Unit uses an item
Cond - Item type of Item being manipulated = your item.
Events -
set i = Integer((Max mana of (Hero manipulating item) + 50)
Custom script: call SetUnitMaxState(GetManipulatingUnit(), UNIT_STATE_MAX_MANA, udg_i)
-------
The modifier ability for me looks just like any Item Mana Bonus (+50) or w/e, with 3 levels, level 1: 0 Level2: -1, Level3: -10
The negatives are needed (get them by SHIFT-Clicking the data value and typing them in)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.