//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 | |
Loc | location | 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=263
//TESH.alwaysfold=0
//============================================================================================
// Target System v.0.1
// By neku99
//============================================================================================
// What does this system do?
//==================================================
//
// - This system allows you to put a marker at a location or a unit. There after you can refer to this location or unit
// as the target of a spell or ability. This is very useful for simulating battle systems like the one in Fina Fantasy Games
// or just do whatever you want with it, the possibilities are endless (I hope).
//
// - In this case I made the system to execute when you move to a location or when you right click on a unit but you can
// easily configure it for when an ability is casted (It will be convered on the Ability/Spell Configuration)
//
//==================================================
// Configurables
//==================================================
//
// - Determine if the system allows target following when you target a unit.
//
//==================================================
// Globals
//==================================================
//
// TARGET_ORDER_ID = a constant string that determines what order the system will fire when the order is executed
// TARGET_ORDER_ID2 = same as the one on top for secondary orders
// TARGET_DUMMY = a constant integer that determines the dummy unit used as a marker/arrow.
// TARGET_FOLLOW = a boolean that determines if the system allows target following
//
// TARGET_ARRAY = an integer array used for the indexing
// TOTAL = an integer used for the indexing
// TARGET_ TIMER = a timer used for the Loop
// TICK = a constant real that determines the interval for the loop
//
//==================================================
// Parameters
//==================================================
// - You can simply use this system using one function call:
//
// call Marker.CheckMarker( Parameters )
//
// Here are the parameters arranged in order with description
//
// u = the unit that executes the order/ability
// tx = the x coordinate of the target unit/location
// ty = the y coordinate of the target unit/location
// t = the target unit if a unit is targeted
//
//==================================================
// Getting a Target
//==================================================
//
// - To get a target I made a method called GetMarker.
//
// call Marker.GetMarker ( Insert Unit Here to Get its Marker )
//
// - What it does is return the dummy unit/marker/arrow whatever for the unit you put on the parameters. Now you can refer to this unit and determine it's location by
// calling the functions GetUnitX() and GetUnitY().
//
// - For the target unit it is automatically set as data.t when TARGET_FOLLOW is true.
//
//
//==================================================
// Ability/Spell Configuration
//==================================================
//
// - In this system I configured it to run when you left click on a unit or location. Now I'll go through in explaining how to configure the system to
// work when an ability is executed
//
// + First change "constant string TARGET_ORDER_ID" to "constant integer TARGET_ORDER_ID"
// + Next we need to set the raw code of the ability on the "constant string TARGET_ORDER_ID".
// - 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 in "constant string TARGET_ORDER_ID"
// Example: "constant integer TARGET_ORDER_ID = 'rawcodehere' "
// - YOu can also do this with TARGET_ORDER_ID2
// + Now we need to change the condition function.
// - Change this part:
//
// return ( GetIssuedOrderId() == String2OrderIdBJ(TARGET_ORDER_ID) or GetIssuedOrderId() == String2OrderIdBJ(TARGET_ORDER_ID2) )
//
// - to:
//
// return (GetSpellAbilityId() == TARGET_ORDER_ID)
// + Lastly we need to edit the events.
// - Change this:
//
// call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
// call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
//
// - to:
//
// call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EVENT)
// - Now we're done. It'll Look something like this:
//
// On the TARGET_ORDER_ID:
//
// constant string TARGET_ORDER_ID = 'RawCode'
//
// On the condition function:
//
// private function condition takes nothing returns boolean
// return (GetSpellAbilityId() == TARGET_ORDER_ID)
// endfunction
//
// On the Trigger Register Event:
//
// call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EVENT)
//
// + Well that's it enjoy the system.
//
//==================================================
// Ending Comments
//==================================================
// - This will be the second Jass/vJass coded system/spell I will be submmiting
// - The setup on this test map will be similar to the battle system I'll be incorporating in my map project
// - 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
//
//==================================================
// Credits to
//==================================================
// Berb - For teaching me JASS/vJASS
// Adiktuz - For doing the same and having patience for all my vJass Questions
//
//END/////////////////////////////////////////////////////////////////////////////////////////
library TargetSystem initializer init
globals
constant string TARGET_ORDER_ID = "smart"
constant string TARGET_ORDER_ID2 = "patrol"
constant integer TARGET_DUMMY = 'u002'
private boolean TARGET_FOLLOW = true
private integer array TARGET_ARRAY[8190]
private integer TOTAL = 0
private timer TARGET_TIMER = CreateTimer()
private constant real TICK = 0.01
endglobals
struct Marker
private unit u
private unit dummy
private unit t
private real tx
private real ty
private integer counter
private static thistype data
private static thistype datu
//Get Marker - Used to get the marker of a unit
static method GetMarker takes unit u returns unit
local integer i = 1
local unit m
loop
exitwhen i > TOTAL
set datu = TARGET_ARRAY[i]
if datu.u == u then
set m = datu.dummy
set i = TOTAL + 1
else
set i = i + 1
set m = null
endif
endloop
return m
endmethod
//Loop - The loop
private static method Loop takes nothing returns nothing
local integer i = 1
loop
exitwhen i > TOTAL
set data = TARGET_ARRAY[i]
if data.dummy != null then
if TARGET_FOLLOW == true then
if data.t != null then
call SetUnitX(data.dummy, GetUnitX(data.t))
call SetUnitY(data.dummy, GetUnitY(data.t))
endif
endif
else
set TARGET_ARRAY[i] = TARGET_ARRAY[TOTAL]
set TOTAL = TOTAL - 1
set i = i - 1
call data.destroy()
endif
if TOTAL == 0 then
call PauseTimer(TARGET_TIMER)
endif
set i = i + 1
endloop
endmethod
//Create - Creates an instance of an arrow for a unit
private static method create takes unit u, real x, real y, unit t returns thistype
set data = allocate()
set data.u = u
set data.tx = x
set data.ty = y
if TARGET_FOLLOW == true then
set data.t = t
endif
set data.dummy = CreateUnit( GetOwningPlayer(data.u), TARGET_DUMMY, data.tx, data.ty, 270)
set data.counter = 1
set TARGET_ARRAY[TOTAL] = data
if TOTAL == 1 then
call TimerStart( TARGET_TIMER, TICK, true, function Marker.Loop)
endif
return data
endmethod
//Check Marker - Checks if unit has a marker. If it has a marker it will move the marker. If not create a marker.
static method CheckMarker takes unit u, real x, real y, unit t returns thistype
local integer i = 1
set TOTAL = TOTAL + 1
call ClearTextMessages()
if t != null then
set x = GetUnitX(t)
set y = GetUnitY(t)
endif
loop
exitwhen i > TOTAL
set datu = TARGET_ARRAY[i]
if datu.u == u then
call BJDebugMsg("MOVE TARGET")
call SetUnitX(datu.dummy, x)
call SetUnitY(datu.dummy, y)
if TARGET_FOLLOW == true then
set datu.t = t
endif
set datu = TARGET_ARRAY[TOTAL]
set TOTAL = TOTAL - 1
set i = TOTAL + 1
else
set i = i + 1
if i > TOTAL then
call BJDebugMsg("NEW")
call Marker.create( u, x, y, t )
endif
set datu = 0
endif
endloop
return datu
endmethod
endstruct
//==============================================================================================================
private function condition takes nothing returns boolean
return ( GetIssuedOrderId() == String2OrderIdBJ(TARGET_ORDER_ID) or GetIssuedOrderId() == String2OrderIdBJ(TARGET_ORDER_ID2) )
endfunction
private function action takes nothing returns nothing
call Marker.CheckMarker( GetTriggerUnit(), GetOrderPointX(), GetOrderPointY(), GetOrderTargetUnit())
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(t, Filter(function condition))
call TriggerAddAction(t, function action)
endfunction
endlibrary
//TESH.scrollpos=39
//TESH.alwaysfold=0
library IceNovaSpell initializer init
globals
constant real ICE_NOVA_AREA = 250
constant real ICE_NOVA_DAMAGE = 100
constant integer ICE_NOVA_ABIL_ID = 'A009'
constant string ICE_NOVA_FX_PATH = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
endglobals
struct IceNova
private unit caster = null
private integer level
private real x
private real y
private integer charge
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 returns thistype
local thistype nova = allocate()
local real x
local real y
set nova.caster = caster
set nova.charge = 3
set nova.cool = 5.
set nova.slot = 3
set temp = nova
//////////////////////////////////////
//Here I use Marker.GetMArker to get the marker/arrow of the unit then I get it's x y values for the spell
//////////////////////////////////////
set nova.x = GetUnitX(Marker.GetMarker( nova.caster ))
set nova.y = GetUnitY(Marker.GetMarker( nova.caster ))
set x = nova.x
set y = nova.y
call IssueImmediateOrder( nova.caster, "stop")
call PauseUnit( nova.caster, true)
call PauseUnit( nova.caster, false)
call DestroyEffect(AddSpecialEffect(ICE_NOVA_FX_PATH, x, y))
call GroupEnumUnitsInRange(enumGroup, x, y, ICE_NOVA_AREA, Filter(function thistype.enumGroupFilter))
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())
endfunction
public function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t, Filter(function cond))
call TriggerAddAction(t, function actn)
endfunction
endlibrary