- Joined
- Apr 30, 2011
- Messages
- 359
JASS:
//========================================================================================
//
// Ability Preload
// -*- overcold_ice -*-
//
// -[*] Requirements:
// - JNGP
// - latest version of JassHelper
//
// Simple ability preloading functions
//
// -[*] API:
//
// function PreloadAbility takes integer abilid returns nothing
// function PreloadAbilityRange takes integer start, integer end returns nothing
//
//========================================================================================
library AbilityPreload
globals
// your dummy unit id
private constant integer DUMMY_ID = 'dumy'
// here if you want to change the preloader unit's position/owner
private constant unit PRELOADER = CreateUnit(Player(15), DUMMY_ID, 0, 0, 0)
endglobals
//====================================================================================
// A P I
//====================================================================================
function PreloadAbility takes integer abilid returns nothing
call UnitAddAbility(PRELOADER, abilid)
call UnitRemoveAbility(PRELOADER, abilid)
endfunction
function PreloadAbilityRange takes integer aids, integer aide returns nothing
local integer i
if aids < aide then
set i = aids
else
set i = aide
endif
loop
call UnitAddAbility(PRELOADER, i)
call UnitRemoveAbility(PRELOADER, i)
exitwhen i == aide
set i = i + 1
endloop
endfunction
module InitM
static method onInit takes nothing returns nothing
call ShowUnit(PRELOADER, false)
call UnitAddAbility(PRELOADER, 'Aloc')
call UnitAddAbility(PRELOADER, 'Avul')
endmethod
endmodule
struct InitS
implement InitM
endstruct
endlibrary
can anyone tell me the maximum number of ability id that can be reached?
i want to make a PreloadAbilityAll function . . .
Last edited: