Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Data - Max Mana Gained to whatever you want.can we use JASS scripts by using Costum script?
//////////////////////////////////////////////////////////////////////////////////////////
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@ SetUnitMaxState
//@=======================================================================================
//@ Credits:
//@---------------------------------------------------------------------------------------
//@ Written by:
//@ Earth-Fury
//@ Based on the work of:
//@ Blade.dk
//@
//@ If you use this system, please credit all of the people mentioned above in your map.
//@=======================================================================================
//@ SetUnitMaxState Readme
//@---------------------------------------------------------------------------------------
//@
//@ SetUnitMaxState() is a function origionally written by Blade.dk. It takes advantage of
//@ a bug which was introduced in one of the patches: Bonus life and mana abilitys will
//@ only ever add the bonus ammount for level 1. However, when removed, they will remove
//@ the ammount they should have added at their current level. This allows you to change a
//@ units maximum life and mana, without adding a perminent ability to the unit.
//@
//@---------------------------------------------------------------------------------------
//@ Adding SetUnitMaxState to your map:
//@
//@ Simply copy this library in to a trigger which has been converted to custom text.
//@ After that, you must copy over the abilitys. This is made easy by the ObjectMerger in
//@ JASS NewGen. Distributed with this system are //! external calls to the ObjectMerger.
//@ Simply copy both of them in to your map, save your map, close and reopen your map in
//@ the editor, and remove the external calls. (Or otherwise disable them. Removing the !
//@ after the // works.)
//@
//@---------------------------------------------------------------------------------------
//@ Using SetUnitMaxState:
//@
//@ nothing SetUnitMaxState(unit <target>, unitstate <state>, real <new value>)
//@
//@ This function changes <target>'s unitstate <state> to be eqal to <new value>. Note
//@ that the only valid unitstates this function will use are UNIT_STATE_MAX_MAN and
//@ UNIT_STATE_MAX_LIFE. Use SetUnitState() to change other unitstates.
//@
//@ nothing AddUnitMaxState(unit <target>, unitstate <state>, real <add value>)
//@
//@ This function adds <add value> to <target>'s <state> unitstate. <add value> can be
//@ less than 0, making this function reduce the specified unitstate. This function will
//@ only work with the unitstates UNIT_STATE_MAX_LIFE and UNIT_STATE_MAX_MANA.
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//////////////////////////////////////////////////////////////////////////////////////////
library SetUnitMaxState initializer Initialize
globals
//========================================================================================
// Configuration
//========================================================================================
// The rawcode of the life ability:
private constant integer MAX_STATE_LIFE_ABILITY = 'Zx01'
// The rawcode of the mana ability:
private constant integer MAX_STATE_MANA_ABILITY = 'Zx00'
// The maximum power of two the abilitys use:
private constant integer MAX_STATE_MAX_POWER = 8
endglobals
//========================================================================================
// System Code
//----------------------------------------------------------------------------------------
// Do not edit below this line unless you wish to change the way the system works.
//========================================================================================
globals
private integer array PowersOf2
endglobals
function SetUnitMaxState takes unit u, unitstate state, real newValue returns nothing
local integer stateAbility
local integer newVal = R2I(newValue)
local integer i = MAX_STATE_MAX_POWER
local integer offset
if state == UNIT_STATE_MAX_LIFE then
set stateAbility = MAX_STATE_LIFE_ABILITY
elseif state == UNIT_STATE_MAX_MANA then
set stateAbility = MAX_STATE_MANA_ABILITY
else
debug call BJDebugMsg("SetUnitMaxState Error: Invalid unitstate")
return
endif
set newVal = newVal - R2I(GetUnitState(u, state))
if newVal > 0 then
set offset = MAX_STATE_MAX_POWER + 3
elseif newVal < 0 then
set offset = 2
set newVal = -newVal
else
return
endif
loop
exitwhen newVal == 0 or i < 0
if newVal >= PowersOf2[i] then
call UnitAddAbility(u, stateAbility)
call SetUnitAbilityLevel(u, stateAbility, offset + i)
call UnitRemoveAbility(u, stateAbility)
set newVal = newVal - PowersOf2[i]
else
set i = i - 1
endif
endloop
endfunction
function AddUnitMaxState takes unit u, unitstate state, real addValue returns nothing
call SetUnitMaxState(u, state, GetUnitState(u, state) + addValue)
endfunction
private function Initialize takes nothing returns nothing
local integer i = 1
set PowersOf2[0] = 1
loop
set PowersOf2[i] = PowersOf2[i - 1] * 2
set i = i + 1
exitwhen i == MAX_STATE_MAX_POWER + 3
endloop
endfunction
endlibrary
took me forever to find it sorry
JASS:////////////////////////////////////////////////////////////////////////////////////////// //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ //@ SetUnitMaxState //@======================================================================================= //@ Credits: //@--------------------------------------------------------------------------------------- //@ Written by: //@ Earth-Fury //@ Based on the work of: //@ Blade.dk //@ //@ If you use this system, please credit all of the people mentioned above in your map. //@======================================================================================= //@ SetUnitMaxState Readme //@--------------------------------------------------------------------------------------- //@ //@ SetUnitMaxState() is a function origionally written by Blade.dk. It takes advantage of //@ a bug which was introduced in one of the patches: Bonus life and mana abilitys will //@ only ever add the bonus ammount for level 1. However, when removed, they will remove //@ the ammount they should have added at their current level. This allows you to change a //@ units maximum life and mana, without adding a perminent ability to the unit. //@ //@--------------------------------------------------------------------------------------- //@ Adding SetUnitMaxState to your map: //@ //@ Simply copy this library in to a trigger which has been converted to custom text. //@ After that, you must copy over the abilitys. This is made easy by the ObjectMerger in //@ JASS NewGen. Distributed with this system are //! external calls to the ObjectMerger. //@ Simply copy both of them in to your map, save your map, close and reopen your map in //@ the editor, and remove the external calls. (Or otherwise disable them. Removing the ! //@ after the // works.) //@ //@--------------------------------------------------------------------------------------- //@ Using SetUnitMaxState: //@ //@ nothing SetUnitMaxState(unit <target>, unitstate <state>, real <new value>) //@ //@ This function changes <target>'s unitstate <state> to be eqal to <new value>. Note //@ that the only valid unitstates this function will use are UNIT_STATE_MAX_MAN and //@ UNIT_STATE_MAX_LIFE. Use SetUnitState() to change other unitstates. //@ //@ nothing AddUnitMaxState(unit <target>, unitstate <state>, real <add value>) //@ //@ This function adds <add value> to <target>'s <state> unitstate. <add value> can be //@ less than 0, making this function reduce the specified unitstate. This function will //@ only work with the unitstates UNIT_STATE_MAX_LIFE and UNIT_STATE_MAX_MANA. //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ////////////////////////////////////////////////////////////////////////////////////////// library SetUnitMaxState initializer Initialize globals //======================================================================================== // Configuration //======================================================================================== // The rawcode of the life ability: private constant integer MAX_STATE_LIFE_ABILITY = 'Zx01' // The rawcode of the mana ability: private constant integer MAX_STATE_MANA_ABILITY = 'Zx00' // The maximum power of two the abilitys use: private constant integer MAX_STATE_MAX_POWER = 8 endglobals //======================================================================================== // System Code //---------------------------------------------------------------------------------------- // Do not edit below this line unless you wish to change the way the system works. //======================================================================================== globals private integer array PowersOf2 endglobals function SetUnitMaxState takes unit u, unitstate state, real newValue returns nothing local integer stateAbility local integer newVal = R2I(newValue) local integer i = MAX_STATE_MAX_POWER local integer offset if state == UNIT_STATE_MAX_LIFE then set stateAbility = MAX_STATE_LIFE_ABILITY elseif state == UNIT_STATE_MAX_MANA then set stateAbility = MAX_STATE_MANA_ABILITY else debug call BJDebugMsg("SetUnitMaxState Error: Invalid unitstate") return endif set newVal = newVal - R2I(GetUnitState(u, state)) if newVal > 0 then set offset = MAX_STATE_MAX_POWER + 3 elseif newVal < 0 then set offset = 2 set newVal = -newVal else return endif loop exitwhen newVal == 0 or i < 0 if newVal >= PowersOf2[i] then call UnitAddAbility(u, stateAbility) call SetUnitAbilityLevel(u, stateAbility, offset + i) call UnitRemoveAbility(u, stateAbility) set newVal = newVal - PowersOf2[i] else set i = i - 1 endif endloop endfunction function AddUnitMaxState takes unit u, unitstate state, real addValue returns nothing call SetUnitMaxState(u, state, GetUnitState(u, state) + addValue) endfunction private function Initialize takes nothing returns nothing local integer i = 1 set PowersOf2[0] = 1 loop set PowersOf2[i] = PowersOf2[i - 1] * 2 set i = i + 1 exitwhen i == MAX_STATE_MAX_POWER + 3 endloop endfunction endlibrary
You can do it way easier.
Just create an ability based on the item-mana-bonus and give it two levels.
The first level gives 0 mana and the second -25.
Then you add this ability to your unit, set it's level to 2, and remove it again.
Your unit will have gained 25 max mana. (due to a little bug when leveling up this ability)
you'd have to do that this way to, theres just much less triggering this way. if you give me the values of the 100 levels i will gladly do it and have it back to you in about an hourbcoz i want to increase it 100 times...
that is NOT easy ^^
you'd have to do that this way to, theres just much less triggering this way. if you give me the values of the 100 levels i will gladly do it and have it back to you in about an houram i going to change the levels to 100?
bcoz i want to increase it 100 times...
that is NOT easy ^^
Well, you could also add/remove the ability 100 times.@meOme
am i going to change the levels to 100?
bcoz i want to increase it 100 times...
that is NOT easy ^^
cant have negative value for that field. i just tried that.
BonusTest

Events


Player - Player 1 (Red) types a chat message containing <Empty String> as A substring

Conditions

Actions


Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)



Loop - Actions




Set Bonus = (Integer((Entered chat string)))




Set Bonus_Which = 4




Set u = (Picked unit)




Trigger - Run BonusSet <gen> (ignoring conditions)
BonusSet

Events

Conditions

Actions


Custom script: local integer size = udg_Bonus_Which * 100


Custom script: local integer i = 0


Custom script: local integer max = 9


Custom script: local real power = max


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




Bonus_Which Not equal to 1




Bonus_Which Not equal to 2




Bonus_Which Not equal to 4



Then - Actions



Else - Actions




Custom script: set max = 15


Custom script: loop


Custom script: call UnitRemoveAbility(udg_u, udg_Bonus_Ability[i+size])


Custom script: exitwhen i == max


Custom script: set i = i + 1


Custom script: endloop


Custom script: loop


Custom script: exitwhen i < 0 or udg_Bonus < 1


Custom script: set power = Pow(2.00, i)


Custom script: if udg_Bonus >= power then


Custom script: call UnitAddAbility(udg_u, udg_Bonus_Ability[i+size])


Custom script: set udg_Bonus = udg_Bonus - R2I(power)


Custom script: endif


Custom script: set i = i - 1


Custom script: endloop
BonusIni

Events


Map initialization

Conditions

Actions


-------- If you change the event to "Elapsed game time = 0 sec" it will load a lot faster but it will lag when the game starts --------


-------- Armor Bonus --------


Set Bonus_Ability[0] = Item Armor Bonus (+1)


Set Bonus_Ability[1] = Item Armor Bonus (+2)


Set Bonus_Ability[2] = Item Armor Bonus (+4)


Set Bonus_Ability[3] = Item Armor Bonus (+8)


Set Bonus_Ability[4] = Item Armor Bonus (+16)


Set Bonus_Ability[5] = Item Armor Bonus (+32)


Set Bonus_Ability[6] = Item Armor Bonus (+64)


Set Bonus_Ability[7] = Item Armor Bonus (+128)


Set Bonus_Ability[8] = Item Armor Bonus (+256)


Set Bonus_Ability[9] = Item Armor Bonus (+512)


-------- Damage Bonus --------


Set Bonus_Ability[100] = Item Damage Bonus (+1)


Set Bonus_Ability[101] = Item Damage Bonus (+2)


Set Bonus_Ability[102] = Item Damage Bonus (+4)


Set Bonus_Ability[103] = Item Damage Bonus (+8)


Set Bonus_Ability[104] = Item Damage Bonus (+16)


Set Bonus_Ability[105] = Item Damage Bonus (+32)


Set Bonus_Ability[106] = Item Damage Bonus (+64)


Set Bonus_Ability[107] = Item Damage Bonus (+128)


Set Bonus_Ability[108] = Item Damage Bonus (+256)


Set Bonus_Ability[109] = Item Damage Bonus (+512)


Set Bonus_Ability[110] = Item Damage Bonus (+1024)


Set Bonus_Ability[111] = Item Damage Bonus (+2048)


Set Bonus_Ability[112] = Item Damage Bonus (+4096)


Set Bonus_Ability[113] = Item Damage Bonus (+8192)


Set Bonus_Ability[114] = Item Damage Bonus (+16384)


Set Bonus_Ability[115] = Item Damage Bonus (+32768)


-------- Attack Speed Bonus --------


Set Bonus_Ability[200] = Item Attack Speed Bonus (+1)


Set Bonus_Ability[201] = Item Attack Speed Bonus (+2)


Set Bonus_Ability[202] = Item Attack Speed Bonus (+4)


Set Bonus_Ability[203] = Item Attack Speed Bonus (+8)


Set Bonus_Ability[204] = Item Attack Speed Bonus (+16)


Set Bonus_Ability[205] = Item Attack Speed Bonus (+32)


Set Bonus_Ability[206] = Item Attack Speed Bonus (+64)


Set Bonus_Ability[207] = Item Attack Speed Bonus (+128)


Set Bonus_Ability[208] = Item Attack Speed Bonus (+256)


Set Bonus_Ability[209] = Item Attack Speed Bonus (+512)


-------- Life Bonus --------


Set Bonus_Ability[300] = Item Life Bonus (+1)


Set Bonus_Ability[301] = Item Life Bonus (+2)


Set Bonus_Ability[302] = Item Life Bonus (+4)


Set Bonus_Ability[303] = Item Life Bonus (+8)


Set Bonus_Ability[304] = Item Life Bonus (+16)


Set Bonus_Ability[305] = Item Life Bonus (+32)


Set Bonus_Ability[306] = Item Life Bonus (+64)


Set Bonus_Ability[307] = Item Life Bonus (+128)


Set Bonus_Ability[308] = Item Life Bonus (+256)


Set Bonus_Ability[309] = Item Life Bonus (+512)


Set Bonus_Ability[310] = Item Life Bonus (+1024)


Set Bonus_Ability[311] = Item Life Bonus (+2048)


Set Bonus_Ability[312] = Item Life Bonus (+4096)


Set Bonus_Ability[313] = Item Life Bonus (+8192)


Set Bonus_Ability[314] = Item Life Bonus (+16384)


Set Bonus_Ability[315] = Item Life Bonus (+32768)


-------- Mana Bonus --------


Set Bonus_Ability[400] = Item Mana Bonus (+1)


Set Bonus_Ability[401] = Item Mana Bonus (+2)


Set Bonus_Ability[402] = Item Mana Bonus (+4)


Set Bonus_Ability[403] = Item Mana Bonus (+8)


Set Bonus_Ability[404] = Item Mana Bonus (+16)


Set Bonus_Ability[405] = Item Mana Bonus (+32)


Set Bonus_Ability[406] = Item Mana Bonus (+64)


Set Bonus_Ability[407] = Item Mana Bonus (+128)


Set Bonus_Ability[408] = Item Mana Bonus (+256)


Set Bonus_Ability[409] = Item Mana Bonus (+512)


Set Bonus_Ability[410] = Item Mana Bonus (+1024)


Set Bonus_Ability[411] = Item Mana Bonus (+2048)


Set Bonus_Ability[412] = Item Mana Bonus (+4096)


Set Bonus_Ability[413] = Item Mana Bonus (+8192)


Set Bonus_Ability[414] = Item Mana Bonus (+16384)


Set Bonus_Ability[415] = Item Mana Bonus (+32768)


-------- Item Agi Bonus --------


Set Bonus_Ability[500] = Item Agi Bonus (+1)


Set Bonus_Ability[501] = Item Agi Bonus (+2)


Set Bonus_Ability[502] = Item Agi Bonus (+4)


Set Bonus_Ability[503] = Item Agi Bonus (+8)


Set Bonus_Ability[504] = Item Agi Bonus (+16)


Set Bonus_Ability[505] = Item Agi Bonus (+32)


Set Bonus_Ability[506] = Item Agi Bonus (+64)


Set Bonus_Ability[507] = Item Agi Bonus (+128)


Set Bonus_Ability[508] = Item Agi Bonus (+256)


Set Bonus_Ability[509] = Item Agi Bonus (+512)


-------- Item Str Bonus --------


Set Bonus_Ability[600] = Item Str Bonus (+1)


Set Bonus_Ability[601] = Item Str Bonus (+2)


Set Bonus_Ability[602] = Item Str Bonus (+4)


Set Bonus_Ability[603] = Item Str Bonus (+8)


Set Bonus_Ability[604] = Item Str Bonus (+16)


Set Bonus_Ability[605] = Item Str Bonus (+32)


Set Bonus_Ability[606] = Item Str Bonus (+64)


Set Bonus_Ability[607] = Item Str Bonus (+128)


Set Bonus_Ability[608] = Item Str Bonus (+256)


Set Bonus_Ability[609] = Item Str Bonus (+512)


-------- Item Int Bonus --------


Set Bonus_Ability[700] = Item Int Bonus (+1)


Set Bonus_Ability[701] = Item Int Bonus (+2)


Set Bonus_Ability[702] = Item Int Bonus (+4)


Set Bonus_Ability[703] = Item Int Bonus (+8)


Set Bonus_Ability[704] = Item Int Bonus (+16)


Set Bonus_Ability[705] = Item Int Bonus (+32)


Set Bonus_Ability[706] = Item Int Bonus (+64)


Set Bonus_Ability[707] = Item Int Bonus (+128)


Set Bonus_Ability[708] = Item Int Bonus (+256)


Set Bonus_Ability[709] = Item Int Bonus (+512)


Set zLoc = (Point(0.00, 0.00))


Unit - Create 1 Hero Dummy for Neutral Passive at zLoc facing 0.00 degrees


-------- Preload abilities --------


For each (Integer i) from 0 to 7, do (Actions)



Loop - Actions




For each (Integer i2) from 0 to 15, do (Actions)





Loop - Actions






Unit - Add Bonus_Ability[((i x 100) + i2)] to (Last created unit)






Unit - Remove Bonus_Ability[((i x 100) + i2)] from (Last created unit)


Unit - Remove (Last created unit) from the game
You can do it way easier.
Just create an ability based on the item-mana-bonus and give it two levels.
The first level gives 0 mana and the second -25.
Then you add this ability to your unit, set it's level to 2, and remove it again.
Your unit will have gained 25 max mana. (due to a little bug when leveling up this ability)