//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
AB_Running | boolean | No | |
AB_TimeCounter | real | No | |
AbilityIndexInt | integer | No | |
Anim_Attack1 | integer | Yes | |
Anim_Walk1 | integer | Yes | |
Attack_Angle | real | Yes | |
Attack_Anim | boolean | Yes | |
Attack_AnimIndex | integer | Yes | |
Attack_Caster | unit | Yes | |
Attack_Distance | real | Yes | |
Attack_DistancePerinterval | real | Yes | |
Attack_Effect | effect | Yes | |
Attack_Effects | boolean | Yes | |
Attack_EndStart | boolean | Yes | |
Attack_EndTimer | real | Yes | |
Attack_Group | group | No | |
Attack_Index | integer | Yes | |
Attack_Loc | location | No | |
Attack_Loc2 | location | No | |
Attack_Loc3 | location | No | |
Attack_Loc4 | location | No | |
Attack_Loop | integer | No | 0 |
Attack_MaxSize | integer | No | |
Attack_MinSize | integer | No | |
Attack_PushEffect | string | No | |
Attack_RangeCIRC | real | Yes | |
Attack_Speed | real | Yes | |
Attack_Target | unit | Yes | |
Attack_Timer | real | Yes | |
AttackInt | integer | No | |
Damage_Caster | unit | No | |
Damage_CasterDmg | real | No | |
Damage_Element | integer | No | |
Damage_Final | real | No | |
Damage_Type | integer | No | |
Damage_Unit | unit | No | |
Damage_UnitDef | real | No | |
Dash_Angle | real | Yes | |
Dash_Caster | unit | Yes | |
Dash_Dummy | unit | Yes | |
Dash_Dur | real | Yes | |
Dash_Effect | effect | Yes | |
Dash_Effect2 | effect | Yes | |
Dash_Index | integer | Yes | |
Dash_Loop | integer | No | 0 |
Dash_MaxSize | integer | No | |
Dash_MinSize | integer | No | |
Dash_Speed | real | Yes | |
DashInt | integer | No | |
DashLoc | location | No | |
DashLoc2 | location | No | |
EXAMPLE_DUR | real | Yes | |
EXAMPLE_GFX | effect | Yes | |
EXAMPLE_Index | integer | Yes | |
EXAMPLE_Index_maxSize | integer | No | |
EXAMPLE_Index_Size | integer | No | |
EXAMPLE_LOC | location | Yes | |
EXAMPLE_LOOP | integervar | No | |
Job_Class | integer | Yes | |
Jump_AnimIndex | integer | Yes | |
Jump_Caster | unit | Yes | |
Jump_Down | boolean | Yes | |
Jump_DownSpeed | real | Yes | |
Jump_Height | real | Yes | |
Jump_HeightCounter | real | Yes | |
Jump_Index | integer | Yes | |
Jump_Loc | location | No | |
Jump_Loop | integer | No | |
Jump_MaxSize | integer | No | |
Jump_MinSize | integer | No | |
Jump_Scale | real | Yes | |
Jump_UpSpeed | real | Yes | |
JumpInt | integer | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
Move_AbilityIndex | integer | Yes | |
Move_Angle | real | Yes | |
Move_Collision | boolean | Yes | |
Move_CollisionGroup | group | No | |
Move_Distance | real | Yes | |
Move_End | boolean | Yes | |
Move_Index | integer | Yes | |
Move_Loc1 | location | No | |
Move_Loc2 | location | No | |
Move_Loop | integer | No | |
Move_MaxSize | integer | No | |
Move_MinSize | integer | No | |
Move_PerInterval | real | Yes | |
Move_Speed | real | Yes | |
Move_Time | real | Yes | |
Move_Unit | unit | Yes | |
MoveA_AbilityIndex | integer | No | |
MoveA_Angle | real | No | |
MoveA_Caster | unit | No | |
MoveA_Collision | boolean | No | |
MoveA_Distance | real | No | |
MoveA_Speed | real | No | |
MoveInt | integer | No | |
SPELL_ANGLE | real | Yes | |
SPELL_BOOL | boolean | Yes | |
SPELL_CASTER | unit | Yes | |
SPELL_DUR | real | Yes | |
SPELL_EFFECT | effect | No | |
SPELL_Index | integer | Yes | |
SPELL_Index_maxSize | integer | No | |
SPELL_Index_Size | integer | No | |
SPELL_LIGHT | lightning | Yes | |
SPELL_LIGHTT | lightningtype | No | |
SPELL_LOOP | integervar | No | |
SPELL_MISSILE | unit | Yes | |
SPELL_SPEED | real | Yes | |
SpellMove_Max | integer | No | |
Target_Caster | unit | Yes | |
Target_Index | integer | Yes | |
Target_Loc | location | Yes | |
Target_Loop | integer | No | |
Target_MaxSize | integer | No | |
Target_MinSize | integer | No | |
Target_Unit | unit | Yes | |
TargetInt | integer | No | |
TempGroup | group | No | |
TempGroup2 | group | No | |
TempInt | integer | No | |
TempLoc | location | Yes |
//TESH.scrollpos=186
//TESH.alwaysfold=0
//============================================================================================
// Custom Cooldown System v.0.1
// By neku99
//============================================================================================
// What does this system do?
//==================================================
//
// - This very simple system allows you to attach a custom cooldown to any ability you choose
// with just one function call
//
//==================================================
// Configurables
//==================================================
// - Well there aren't really, but if you want to experiment with some other cooldown concepts
// then you may use this as a template
//
//
//==================================================
// Globals
//==================================================
//
// COOL_ARRAY = an integer array used for the indexing
// COOL_ABIL_ID = an integer array used to store the dummy abilities I used for while abilities are in cooldown
// (I declared the raw codes of the dummy abilities for each slot on the init function on the bottom)
//
// COOL_ TIMER = a timer used for the Loop
// TOTAL = an integer used for the indexing
//
//==================================================
// Parameters
//==================================================
// - You can simply use this system using one function call:
//
// call Cool.create( Parameters )
//
// - It is advised that you call this function after an ability is casted to prevent it from
// canceling the ability. I also added example spells in Jass and GUI on how to use the system.
//
// Here are the parameters arranged in order with description
//
// u = the unit that casted the ability that is being cooled down
// cool = the cooldown of the ability in seconds
// slot = the slot number of the ability ( see the Command Card Diagrams on the buttom, under "Dummy Ability Configuration" )
// abilityId = the raw code of the ability
//
//==================================================
// Dummy Ability Configuration
//==================================================
// - In this system I use dummy abilities that will replace the ability while it is cooling down.
// After the cooldwon is finished the dummy ability will be replaced again with the original ability.
// The 4 dummy abilities I used corresponds to the 4 slots in the buttom row of the command card
//
// - You can just copy the dummy abilities I used on the test map for you to use. But if you want to add more slots,
// here are some guidlines:
//
// + The dummy abilties are recommended to be passive abilities with no effects.
// I used "Brilliance Aura" for the dummy ability.
//
// + After choosing a base passive ability, create a copy of the base ability for each slot you want to make.
// Change the names (or the editor suffix) of the dummy abilities according to their slot.
//
// + Now after creating and naming your dummy abilities it's time to set their x,y coordinates according to their positions on the command card
// - As an example I'll be showing you how I did my dummy abilities
//
// Command Card(X,Y): The numbers inside are respectively the x,y positions of the slots in the command card
// [0,0][1,0][2,0][3,0]
// [0,1][1,1][2,1][3,1]
// [0,2][1,2][2,2][3,2]
//
// - My dummy abilities are named according to their slot positions, but are not based on the coordinates but an intiger starting from 1
// The dummy abilities are:
// - On Cooldown (Slot 1)
// - On Cooldown (Slot 2)
// - On Cooldown (Slot 3)
// - On Cooldown (Slot 4)
//
// Command Card(Slot): This is the one I based for the slot numbers
// [slot 9][slot 10][slot 11][slot 12]
// [slot 5][slot 6][slot 7][slot 8]
// [slot 1][slot 2][slot 3][slot 4]
//
//
// - Next thing you do is set the x,y coordinates of the abilties by editing these fields in the Object Editor:
// *Art - Button Position - Noramal(X)
// *Art - Button Position - Noramal(Y)
//
// - Set the x,y coordinates based on the coordinates (On the "Command Card (X,Y)" diagram)
// The dummy abilities and their respective x,y positions:
// - On Cooldown (Slot 1)(0,2)
// - On Cooldown (Slot 2)(1,2)
// - On Cooldown (Slot 3)(2,2)
// - On Cooldown (Slot 4)(3,2)
//
// -After setting them accordingly it's time for the next step . . .
// + Next we need to set the raw codes of the abilities on the COOL_ABIL_ID array. (It is set at the init function on the buttom)
// - To see the raw codes of the abilities in the Object Editor, you need to go to
// View and check the "Disply Values As Raw Data" or simply enter CTRL + D
// doing this will let you see the raw codes of everything from units to abilities
// - Now that you've seen the raw codes of the dummy abilities it's just a case of copying it and setting it in the init function
//
// + SETTING IT UP +
// - First remember that Slot 1 = Coordinate (0,2), Slot 2 = Coordinate (1,2), and so on. Now setting it up is pretty easy.
//
// As one example (Since I already have set 4 on the init function) on how to set it up:
//
// set COOL_ABIL_ID[SlotNumberHere] = 'RawCodeHere'
// set COOL_ABIL_ID[ 1 ] = ' A00A ' //Dummy ability for slot 1
//
// + And presto! you just made the dummy abilties
//
//==================================================
// Ending Comments
//==================================================
// - This will be the first Jass/vJass coded system/spell submmiting
// - If you find any bugs or you have any suggestions contact me. neku99
// - If you use this on any map of your's never forget to give credits :D
// - I left Debug messages that can be deleted and will not affect code
// Any call that has "//DEBUG MESSAGE YOU CAN DELETE THIS" can be removed
//
//==================================================
// Credits to
//==================================================
// Berb - For teaching me JASS/vJASS
// Adiktuz - For doing the same and having patience for all my vJass Questions
//
//END/////////////////////////////////////////////////////////////////////////////////////////
library CustomCooldown initializer init
globals
private integer array COOL_ARRAY[8190]
private integer array COOL_ABIL_ID
private integer TOTAL = 0
private timer COOL_TIMER = CreateTimer()
private constant real TICK = 0.1
endglobals
struct Cool
private unit u = null
private real cool
private integer slot
private integer abilityId
private static thistype data
private static method Loop takes nothing returns nothing
local integer i = 1
loop
exitwhen i > TOTAL
set data = COOL_ARRAY[i]
call ClearTextMessages()
call BJDebugMsg( GetAbilityName(data.abilityId) + " Cooldown = " + R2S(data.cool))//DEBUG MESSAGE YOU CAN DELETE THIS
if data.cool > 1.0 then
set data.cool = data.cool - TICK
else
call BJDebugMsg("RE-ADD/REMOVE")//DEBUG MESSAGE YOU CAN DELETE THIS
call UnitRemoveAbility( data.u, COOL_ABIL_ID[data.slot])
call UnitAddAbility( data.u, data.abilityId )
set COOL_ARRAY[i] = COOL_ARRAY[TOTAL]
set TOTAL = TOTAL - 1
set i = i - 1
call BJDebugMsg("DATA DESTROY")//DEBUG MESSAGE YOU CAN DELETE THIS
call data.destroy()
endif
if TOTAL == 0 then
call BJDebugMsg("PAUSE TIMER")//DEBUG MESSAGE YOU CAN DELETE THIS
call PauseTimer(COOL_TIMER)
endif
set i = i + 1
endloop
endmethod
static method create takes unit u, real cool, integer slot, integer abilityId returns thistype
set TOTAL = TOTAL + 1
set data = allocate()
set data.u = u
set data.cool = cool
set data.slot = slot
set data.abilityId = abilityId
call UnitRemoveAbility( u, abilityId)
call UnitAddAbility( u, COOL_ABIL_ID[slot] )
call BJDebugMsg("ADD/REMOVE")//DEBUG MESSAGE YOU CAN DELETE THIS
set COOL_ARRAY[TOTAL] = data
if TOTAL == 1 then
call BJDebugMsg("TIMER START")//DEBUG MESSAGE YOU CAN DELETE THIS
call TimerStart( COOL_TIMER, TICK, true, function Cool.Loop)
endif
return data
endmethod
endstruct
private function init takes nothing returns nothing
set COOL_ABIL_ID[1] = 'A00A' //Dummy ability for slot 1
set COOL_ABIL_ID[2] = 'A00B' //Dummy ability for slot 2
set COOL_ABIL_ID[3] = 'A00D' //Dummy ability for slot 3
set COOL_ABIL_ID[4] = 'A007' //Dummy ability for slot 4
endfunction
endlibrary
//TESH.scrollpos=9
//TESH.alwaysfold=0
// Thanks for Berb for this code
library IceNovaSpell initializer init
globals
constant real ICE_NOVA_AREA = 150
constant real ICE_NOVA_DAMAGE = 250
constant integer ICE_NOVA_ABIL_ID = 'A00C'
constant string ICE_NOVA_FX_PATH = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
endglobals
struct IceNova
private unit caster = null
private integer level
private real cool
private integer slot
private static group enumGroup = CreateGroup()
private static thistype temp
private static method enumGroupFilter takes nothing returns boolean
if IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(temp.caster)) then
call UnitDamageTarget(temp.caster, GetFilterUnit(), ICE_NOVA_DAMAGE, false, false, /*
*/ ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
endif
return false
endmethod
static method create takes unit caster, real x, real y, integer level returns thistype
local thistype nova = allocate()
set nova.caster = caster
set nova.level = level
set nova.cool = 3.
set nova.slot = 2
set temp = nova
call DestroyEffect(AddSpecialEffect(ICE_NOVA_FX_PATH, x, y))
call GroupEnumUnitsInRange(enumGroup, x, y, ICE_NOVA_AREA, Filter(function thistype.enumGroupFilter))
//==================================================================================================================
//
// As you can see I use call Cool.create right after the abilities effect is finished to prevent the system from canceling the ability order
//
//==================================================================================================================
call Cool.create( nova.caster, nova.cool, nova.slot, ICE_NOVA_ABIL_ID)
call nova.destroy()
return 0
endmethod
endstruct
//==============================================================================================================
private function cond takes nothing returns boolean
return GetSpellAbilityId() == ICE_NOVA_ABIL_ID
endfunction
private function actn takes nothing returns nothing
call IceNova.create(GetTriggerUnit(), GetSpellTargetX(), GetSpellTargetY(), 0)
endfunction
public function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Filter(function cond))
call TriggerAddAction(t, function actn)
endfunction
endlibrary