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!
i made it too, and following the methode:
make a integer array PAGE (we store here what page is the current for unit)
-once add lets say 16 ability to hero
-disable every ability after what isnt on current page
make a updown ability what show the next page, if somebody click to next page ability then acctually its increase page value with 1 and disable abilities on previous page
in my case udg_Max_Ability_Per_Unit=12 at map init and class2[] show the hero what class (so different skillset for archer, wizard, warror, so each with 12 ability)
Abilities was stored to variables and lets say if i choose paladin what is class2[]=0 then its add to unit the Abilities[0-11], if warrior what is 1 then add Abilities[12-23] to unit and we shift that 12 ability
so basically in jass the pageing after u added all ability what u want look like this
(this mpi but u can use custom unit value too if u want more but problem is when u got same ability on more unit/player )
up ability
JASS:
function Trig_Shift_up_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A014'
endfunction
function Trig_Shift_up_Actions takes nothing returns nothing
local player pl = GetTriggerPlayer()
local integer p = GetPlayerId(pl) + 1
local integer i = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4
local integer t = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4 + 3
loop
exitwhen i > t
call SetPlayerAbilityAvailable( pl, udg_Abilities1[i], false )
set i = i + 1
endloop
if ( udg_AbilityPage > 0 ) then
set udg_AbilityPage = udg_AbilityPage - 1
else
set udg_AbilityPage = udg_Max_Ability_Per_Unit / 4 - 1
endif
set i = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4
set t = i + 3
loop
exitwhen i > t
call SetPlayerAbilityAvailable( pl, udg_Abilities1[i], true )
set i = i + 1
endloop
set pl = null
endfunction
//===========================================================================
function InitTrig_Shift_up takes nothing returns nothing
set gg_trg_Shift_up = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shift_up, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Shift_up, Condition( function Trig_Shift_up_Conditions ) )
call TriggerAddAction( gg_trg_Shift_up, function Trig_Shift_up_Actions )
endfunction
down ability
JASS:
function Trig_Shift_down_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01A'
endfunction
function Trig_Shift_down_Actions takes nothing returns nothing
local player pl = GetTriggerPlayer()
local integer p = GetPlayerId(pl) + 1
local integer i = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4
local integer t = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4 + 3
loop
exitwhen i > t
call SetPlayerAbilityAvailable( pl, udg_Abilities1[i], false )
set i = i + 1
endloop
if ( udg_AbilityPage < ( udg_Max_Ability_Per_Unit / 4 - 1 ) ) then
set udg_AbilityPage = ( udg_AbilityPage + 1 )
else
set udg_AbilityPage = 0
endif
set i = udg_Class2 * udg_Max_Ability_Per_Unit + udg_AbilityPage * 4
set t = i + 3
loop
exitwhen i > t
call SetPlayerAbilityAvailable( pl, udg_Abilities1[i], true )
set i = i + 1
endloop
set pl = null
endfunction
//===========================================================================
function InitTrig_Shift_down takes nothing returns nothing
set gg_trg_Shift_down = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shift_down, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
call TriggerAddCondition( gg_trg_Shift_down, Condition( function Trig_Shift_down_Conditions ) )
call TriggerAddAction( gg_trg_Shift_down, function Trig_Shift_down_Actions )
endfunction
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.