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)
Goodluck to everyone in the future.
~Gloom