//TESH.scrollpos=0
//TESH.alwaysfold=0
Name | Type | is_array | initial_value |
aoeBaseImpBomb | real | No | |
aoePerLvlImpBomb | real | No | |
aoeTotalImpBomb | real | Yes | |
attachPointDummyImpBomb | string | No | |
attachPointUnitImpBomb | string | No | |
attackTypeImpBomb | attacktype | No | |
casterImpBomb | unit | Yes | |
casterXImpBomb | real | Yes | |
casterYImpBomb | real | Yes | |
damageEffectImpBomb | string | No | |
damageTypeImpBomb | damagetype | No | |
damBaseImpBomb | real | No | |
damPerLvlImpBomb | real | No | |
damToDealImpBomb | real | Yes | |
decScaleImpBomb | real | Yes | |
distanceMXImpBomb | real | Yes | |
distanceMYImpBomb | real | Yes | |
dummyEffectImpBomb | string | No | |
dummyImpBomb | unit | Yes | |
dummyUnitImpBomb | unitcode | No | |
durBaseImpBomb | integer | No | |
durCounterImpBomb | integer | Yes | |
durInt1ImpBomb | integer | Yes | |
durInt2ImpBomb | integer | Yes | |
durPerLvlImpBomb | integer | No | |
effectImpBomb | effect | Yes | |
groupImpBomb | group | No | |
maxIndexImpBomb | integer | No | |
propWindowImpBomb | real | Yes | |
scaleImpBomb | real | Yes | |
spellIdImpBomb | integer | No | |
targetImpBomb | unit | Yes | |
targetMXImpBomb | real | Yes | |
targetMYImpBomb | real | Yes | |
targetSXImpBomb | real | Yes | |
targetSYImpBomb | real | Yes | |
tempInt | integer | No | |
termpInt2 | integer | No | |
timerImpBomb | timer | No | |
unitEffectImpBomb | string | No | |
velocityImpBomb | real | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
// Implosion Bomb Spell made by deathismyfriend
// GUI FRIENDLY version 1.1.8
function DistanceBetweenXYImpBomb takes real x1, real y1, real x2, real y2 returns real
local real x = x2 - x1
local real y = y2 - y1
return SquareRoot(x*x + y*y)
endfunction
function GetAngleBetweenXYImpBomb takes real x1, real y1, real x2, real y2 returns real
return Atan2( y1 - y2, x1 - x2)
endfunction
function PolarProjectionXImpBomb takes real x, real dist, real angle returns real // returns x
return x + dist * Cos( angle)
endfunction
function PolarProjectionYImpBomb takes real y, real dist, real angle returns real // returns y
return y + dist * Sin( angle)
endfunction
function ImplosionBombDeIndex takes integer L returns nothing
local integer m = udg_maxIndexImpBomb
set udg_durCounterImpBomb[ L] = udg_durCounterImpBomb[ m]
call SetUnitPropWindow( udg_targetImpBomb[ L], udg_propWindowImpBomb[ L])
set udg_propWindowImpBomb[ L] = udg_propWindowImpBomb[ m]
set udg_casterImpBomb[ L] = udg_casterImpBomb[ m]
set udg_casterXImpBomb[ L] = udg_casterXImpBomb[ m]
set udg_casterYImpBomb[ L] = udg_casterYImpBomb[ m]
set udg_targetImpBomb[ L] = udg_targetImpBomb[ m]
set udg_targetSXImpBomb[ L] = udg_targetSXImpBomb[ m]
set udg_targetSYImpBomb[ L] = udg_targetSYImpBomb[ m]
set udg_targetMXImpBomb[ L] = udg_targetMXImpBomb[ m]
set udg_targetMYImpBomb[ L] = udg_targetMYImpBomb[ m]
set udg_distanceMXImpBomb[ L] = udg_distanceMXImpBomb[ m]
set udg_distanceMYImpBomb[ L] = udg_distanceMYImpBomb[ m]
set udg_durInt1ImpBomb[ L] = udg_durInt1ImpBomb[ m]
set udg_durInt2ImpBomb[ L] = udg_durInt2ImpBomb[ m]
set udg_scaleImpBomb[ L] = udg_scaleImpBomb[ m]
set udg_decScaleImpBomb[ L] = udg_decScaleImpBomb[ m]
set udg_damToDealImpBomb[ L] = udg_damToDealImpBomb[ m]
set udg_aoeTotalImpBomb[ L] = udg_aoeTotalImpBomb[ m]
set udg_dummyImpBomb[ L] = udg_dummyImpBomb[ m]
call DestroyEffect( udg_effectImpBomb[ L])
set udg_effectImpBomb[ L] = udg_effectImpBomb[ m]
set udg_maxIndexImpBomb = udg_maxIndexImpBomb - 1
endfunction
function ImplosionBombChangeScale takes integer L returns nothing
set udg_scaleImpBomb[ L] = udg_scaleImpBomb[ L] - udg_decScaleImpBomb[ L]
call SetUnitScale( udg_targetImpBomb[ L], udg_scaleImpBomb[ L], udg_scaleImpBomb[ L], udg_scaleImpBomb[ L])
endfunction
function ImplosionBombMovingUnits takes integer L returns nothing
set udg_targetMXImpBomb[ L] = udg_targetMXImpBomb[ L] - udg_distanceMXImpBomb[ L]
set udg_targetMYImpBomb[ L] = udg_targetMYImpBomb[ L] - udg_distanceMYImpBomb[ L]
call SetUnitX( udg_targetImpBomb[ L], udg_targetMXImpBomb[ L])
call SetUnitY( udg_targetImpBomb[ L], udg_targetMYImpBomb[ L])
endfunction
function ImplosionBombTimerActions takes nothing returns nothing
local integer L = 1
local real x
local real y
local real d
local real v = udg_velocityImpBomb/2
loop
exitwhen L > udg_maxIndexImpBomb
set udg_durCounterImpBomb[ L] = udg_durCounterImpBomb[ L] + 1
if udg_targetImpBomb[ L] == null then
if udg_durCounterImpBomb[ L] == udg_durInt1ImpBomb[ L] - 32 then // sets the variables for second stage on. damage units here
call DestroyEffect( AddSpecialEffectTarget( udg_damageEffectImpBomb, udg_dummyImpBomb[ L], udg_attachPointDummyImpBomb))
elseif udg_durCounterImpBomb[ L] >= udg_durInt2ImpBomb[ L] + 1 then // de-index the caster here.
call SetUnitPropWindow( udg_casterImpBomb[ L], GetUnitDefaultPropWindow( udg_casterImpBomb[ L]))
call RemoveUnit( udg_dummyImpBomb[ L])
call ImplosionBombDeIndex( L)
set L = L - 1
endif
elseif udg_durCounterImpBomb[ L] < udg_durInt1ImpBomb[ L] then // first faze. pull units into implosion
if DistanceBetweenXYImpBomb( udg_casterXImpBomb[ L], udg_casterYImpBomb[ L], udg_targetMXImpBomb[ L], udg_targetMYImpBomb[ L]) >= v then
call ImplosionBombMovingUnits( L)
endif
call ImplosionBombChangeScale( L)
elseif udg_durCounterImpBomb[ L] == udg_durInt1ImpBomb[ L] then // sets the variables for second stage on. damage units here
set d = DistanceBetweenXYImpBomb( udg_casterXImpBomb[ L], udg_casterYImpBomb[ L], udg_targetMXImpBomb[ L], udg_targetMYImpBomb[ L])
if d >= v then
call ImplosionBombMovingUnits( L)
endif
call ImplosionBombChangeScale( L)
set d = udg_aoeTotalImpBomb[ L] - d
call UnitDamageTarget( udg_casterImpBomb[ L], udg_targetImpBomb[ L], ( d/udg_aoeTotalImpBomb[ L])*udg_damToDealImpBomb[ L], true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
set udg_effectImpBomb[ L] = AddSpecialEffectTarget( udg_unitEffectImpBomb, udg_targetImpBomb[ L], udg_attachPointUnitImpBomb)
//set udg_angleImpBomb[ L] = udg_angleImpBomb[ L] + 180.00
set udg_distanceMXImpBomb[ L] = udg_distanceMXImpBomb[ L] * -2
set udg_distanceMYImpBomb[ L] = udg_distanceMYImpBomb[ L] * -2
set udg_decScaleImpBomb[ L] = -1.00/I2R( udg_durInt2ImpBomb[ L] - udg_durInt1ImpBomb[ L])
if IsUnitType( udg_targetImpBomb[ L], UNIT_TYPE_DEAD) or GetUnitTypeId( udg_targetImpBomb[ L]) == 0 then
call ImplosionBombDeIndex( L)
set L = L - 1
endif
elseif udg_durCounterImpBomb[ L] < udg_durInt2ImpBomb[ L] then // final faze. moving units to there original position
if DistanceBetweenXYImpBomb( udg_targetMXImpBomb[ L], udg_targetMYImpBomb[ L], udg_targetSXImpBomb[ L], udg_targetSYImpBomb[ L]) >= v then
call ImplosionBombMovingUnits( L)
elseif udg_targetMXImpBomb[ L] != udg_targetSXImpBomb[ L] and udg_targetMYImpBomb[ L] != udg_targetSYImpBomb[ L] then
call SetUnitX( udg_targetImpBomb[ L], udg_targetSXImpBomb[ L])
call SetUnitY( udg_targetImpBomb[ L], udg_targetSYImpBomb[ L])
endif
call ImplosionBombChangeScale( L)
elseif udg_durCounterImpBomb[ L] >= udg_durInt2ImpBomb[ L] then // de-index here
call ImplosionBombChangeScale( L)
call ImplosionBombDeIndex( L)
set L = L - 1
endif
set L = L + 1
endloop
if udg_maxIndexImpBomb <= 0 then
call PauseTimer( udg_timerImpBomb)
endif
endfunction
function ImplosionBombSetup takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit u
local integer abiLvl = GetUnitAbilityLevel( c, udg_spellIdImpBomb)
local real r = udg_aoeBaseImpBomb + ( udg_aoePerLvlImpBomb*I2R( abiLvl))
local real x = GetUnitX( c)
local real y = GetUnitY( c)
local integer i = ( udg_durBaseImpBomb + ( udg_durPerLvlImpBomb*abiLvl))
local integer i2 = R2I( I2R( i)*0.75)
local real dam = udg_damBaseImpBomb + ( udg_damPerLvlImpBomb*abiLvl)
local unit dum
local integer m = udg_maxIndexImpBomb
local real angle
local real v = udg_velocityImpBomb/2
set m = m + 1
set udg_casterImpBomb[ m] = c
set udg_casterXImpBomb[ m] = x
set udg_casterYImpBomb[ m] = y
set udg_targetImpBomb[ m] = null
set udg_durCounterImpBomb[ m] = 0
set udg_durInt1ImpBomb[ m] = i2 // first effect stage
set udg_durInt2ImpBomb[ m] = i // second effect stage
set udg_damToDealImpBomb[ m] = dam
set udg_aoeTotalImpBomb[ m] = r
set udg_propWindowImpBomb[ m] = GetUnitPropWindow( c)
set udg_dummyImpBomb[ m] = CreateUnit( GetOwningPlayer( c), udg_dummyUnitImpBomb, x, y, 0)
set dum = udg_dummyImpBomb[ m]
call SetUnitPropWindow( dum, 0.00)
call SetUnitX( udg_dummyImpBomb[ m], x)
call SetUnitY( udg_dummyImpBomb[ m], y)
set udg_effectImpBomb[ m] = AddSpecialEffectTarget( udg_dummyEffectImpBomb, udg_dummyImpBomb[ m], udg_attachPointDummyImpBomb)
if m == 1 then
call TimerStart( udg_timerImpBomb, 0.031250000, true, function ImplosionBombTimerActions)
endif
call GroupEnumUnitsInRange( udg_groupImpBomb, x, y, r, null)
loop
set u = FirstOfGroup( udg_groupImpBomb)
exitwhen u == null
if u != c and u != UNIT_TYPE_STRUCTURE and not IsUnitType( u, UNIT_TYPE_DEAD) and u != dum then
set m = m + 1
set udg_casterImpBomb[ m] = c
set udg_casterXImpBomb[ m] = x
set udg_casterYImpBomb[ m] = y
set udg_targetImpBomb[ m] = u
set udg_targetSXImpBomb[ m] = GetUnitX( udg_targetImpBomb[ m])
set udg_targetSYImpBomb[ m] = GetUnitY( udg_targetImpBomb[ m])
set udg_targetMXImpBomb[ m] = udg_targetSXImpBomb[ m]
set udg_targetMYImpBomb[ m] = udg_targetSYImpBomb[ m]
set udg_durInt1ImpBomb[ m] = i2 // first effect stage
set udg_durInt2ImpBomb[ m] = i // second effect stage
set udg_durCounterImpBomb[ m] = 0
set udg_scaleImpBomb[ m] = 1.00
set udg_decScaleImpBomb[ m] = 1.00/i2
set udg_damToDealImpBomb[ m] = dam
set udg_aoeTotalImpBomb[ m] = r
set udg_propWindowImpBomb[ m] = GetUnitPropWindow( u)
call SetUnitPropWindow( u, 0.00)
set angle = GetAngleBetweenXYImpBomb( x, y, udg_targetSXImpBomb[ m], udg_targetSYImpBomb[ m])
set udg_distanceMXImpBomb[ m] = udg_targetSXImpBomb[ m] - PolarProjectionXImpBomb( udg_targetMXImpBomb[ m], v, angle)
set udg_distanceMYImpBomb[ m] = udg_targetSYImpBomb[ m] - PolarProjectionYImpBomb( udg_targetMYImpBomb[ m], udg_velocityImpBomb/2, angle)
endif
call GroupRemoveUnit( udg_groupImpBomb, u)
endloop
set udg_maxIndexImpBomb = m
set c = null
set dum = null
endfunction
function ImplosionBombCastConditions takes nothing returns boolean
if GetSpellAbilityId() == udg_spellIdImpBomb then
call ImplosionBombSetup()
endif
return false
endfunction
//===========================================================================
function InitTrig_Implosion_Bomb_Cast takes nothing returns nothing
local trigger t = CreateTrigger()
set udg_timerImpBomb = CreateTimer()
set udg_groupImpBomb = CreateGroup()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition( t, Condition( function ImplosionBombCastConditions))
set t = null
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Alloc /* by Nestharus */
module Alloc
private static integer array recycler
private static integer instanceCount = 0
debug private static boolean enabled = true
static method allocate takes nothing returns thistype
local thistype this = recycler[0]
debug if (not enabled) then
debug return 1/0
debug endif
if (this == 0) then
debug if (instanceCount == 8191) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"OVERFLOW")
debug set enabled = false
debug set this = 1/0
debug endif
set this = instanceCount + 1
set instanceCount = this
else
set recycler[0] = recycler[this]
endif
debug set recycler[this] = -1
return this
endmethod
method deallocate takes nothing returns nothing
debug if (not enabled) then
debug set this = 1/0
debug endif
debug if (recycler[this] != -1) then
debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"ATTEMPT TO DEALLOCATE NULL STRUCT INSTANCE")
debug set enabled = false
debug set this = 1/0
debug endif
set recycler[this] = recycler[0]
set recycler[0] = this
endmethod
endmodule
endlibrary
//TESH.scrollpos=215
//TESH.alwaysfold=0
library ImpBomb
// Implosion Bomb Spell made by deathismyfriend
// Alloc by Nestharus can be found here. http://www.hiveworkshop.com/forums/jass-resources-412/snippet-alloc-alternative-221493/
// vJass version 1.1.8
globals
// These are the base values that u can set.
// Here u can set the Aoe base radius. Its a real variable. This does not increase per lvl
private constant real AOE_BASE = 400.00
// This is the damage Base of the spell.
private constant real DAM_BASE = 200.00
// This is the duration Base of the spell. This is important as it sets the intervals for the spell. Put it in seconds.
private constant integer DUR_BASE = 200
// These are the values that get added to the base per lvl that u can set.
// Here u can set the Aoe radius. Its a real variable. This increases per lvl So dont go to high
private constant real AOE_PER_LVL = 200.00
// This is the damage of the spell.
private constant real DAM_PER_LVL = 100.00
// This is the duration of the spell. This is important as it sets the intervals for the spell. Put it in seconds.
private constant integer DUR_PER_LVL = 100
// These are the other values that u can change
// This is the VELOCITY the unit moves at. Towards the Implosion
private constant real VELOCITY = 2.00
// Set the dummy unit type here.
private constant integer DUMMY_UNIT = 'h000'
// This is the explosion effect that gets played.when units get damaged.
private constant string DAMAGE_EFF = "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl"
// Here is were you can set the effect that gets attached to the Dummy Unit.
private constant string DUMMY_EFF = "Abilities\\Spells\\Orc\\Voodoo\\VoodooAura.mdl" //caster
// Here is were you set the attachment point for the dummy unit.
private constant string ATTACH_POINT_DUMMY = "origin"
// Here is were you can set the effect that gets attached to the Units that get damaged.
private constant string UNIT_EFF = "Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl"
// Here is were you set the attachment point for the effect that gets attached to the units that get damaged.
private constant string ATTACH_POINT_UNIT = "origin"
// Here is the ability id
private constant integer SPELL_ID = 'A000'
// Here is the attack type
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_CHAOS
// Here is the damage type
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL
// dont change anything below here.
private integer array structIndex
private timer tmr
private integer maxIndex = 0
private group grp
endglobals
private struct impBombSpell extends array
implement Alloc
private real aoeTotal
private unit caster
private real casterX
private real casterY
private real decScale
private real damToDeal
private unit dummy
private integer durCounter
private integer durInt1
private integer durInt2
private effect eff
private real propWindow
private real scale
private unit target
private real distanceMX
private real distanceMY
private real targetMX
private real targetMY
private real targetSX
private real targetSY
static method distBetweenXY takes real x1, real y1, real x2, real y2 returns real
local real x = x2 - x1
local real y = y2 - y1
return SquareRoot(x*x + y*y)
endmethod
private static method getAngleBetweenXY takes real x1, real y1, real x2, real y2 returns real
return Atan2( y1 - y2, x1 - x2)
endmethod
private static method polarProjectionX takes real x, real dist, real angle returns real // returns x
return x + dist * Cos( angle)
endmethod
private static method polarProjectionY takes real y, real dist, real angle returns real // returns y
return y + dist * Sin( angle)
endmethod
private method changeScale takes nothing returns nothing
set this.scale = this.scale - this.decScale
call SetUnitScale( this.target, this.scale, this.scale, this.scale)
endmethod
private method movingUnits takes real vel returns nothing
set this.targetMX = this.targetMX - this.distanceMX
set this.targetMY = this.targetMY - this.distanceMY
call SetUnitX( this.target, this.targetMX)
call SetUnitY( this.target, this.targetMY)
endmethod
private method destroy takes nothing returns nothing // de-index
call SetUnitPropWindow( this.target, this.propWindow)
set this.caster = null
set this.target = null
set this.dummy = null
call DestroyEffect( this.eff)
set this.eff = null
set maxIndex = maxIndex - 1
call this.deallocate()
endmethod
private static method timerActions takes nothing returns nothing
local thistype this
local integer L = 1
local real x
local real y
local real d
local real v = VELOCITY/2
loop
exitwhen L > maxIndex
set this = structIndex[ L]
set this.durCounter = this.durCounter + 1
if this.target == null then
if this.durCounter == this.durInt1 - 32 then // sets the variables for second stage on. damage units here
call DestroyEffect( AddSpecialEffectTarget( DAMAGE_EFF, this.dummy, ATTACH_POINT_DUMMY))
elseif this.durCounter >= this.durInt2 + 1 then // de-index the caster here.
call SetUnitPropWindow( this.caster,this.propWindow)
call RemoveUnit( this.dummy)
set structIndex[ L] = structIndex[ maxIndex]
call this.destroy()
set L = L - 1
endif
elseif this.durCounter < this.durInt1 then // first faze. pull units into implosion
if distBetweenXY( this.casterX, this.casterY, this.targetMX, this.targetMY) >= v then
call this.movingUnits( v)
endif
call this.changeScale()
elseif this.durCounter == this.durInt1 then // sets the variables for second stage on. damage units here
set d = distBetweenXY( this.casterX, this.casterY, this.targetMX, this.targetMY)
if d >= v then
call this.movingUnits( v)
endif
call this.changeScale()
set d = this.aoeTotal - d
call UnitDamageTarget( this.caster, this.target, ( d/this.aoeTotal)*this.damToDeal, false, false, ATTACK_TYPE, DAMAGE_TYPE, null)
set this.eff = AddSpecialEffectTarget( UNIT_EFF, this.target, ATTACH_POINT_UNIT)
set this.distanceMX = this.distanceMX * -2
set this.distanceMY = this.distanceMY * -2
set this.decScale = -1.00/I2R( this.durInt2 - this.durInt1)
if IsUnitType( this.target, UNIT_TYPE_DEAD) or GetUnitTypeId( this.target) == 0 then
set structIndex[ L] = structIndex[ maxIndex]
call this.destroy()
set L = L - 1
endif
elseif this.durCounter < this.durInt2 then // final faze. moving units to there original position
if distBetweenXY( this.targetMX, this.targetMY, this.targetSX, this.targetSY) >= v then
call this.movingUnits( VELOCITY)
elseif this.targetMX != this.targetSX and this.targetMY != this.targetSY then
call SetUnitX( this.target, this.targetSX)
call SetUnitY( this.target, this.targetSY)
endif
call this.changeScale()
elseif this.durCounter >= this.durInt2 then // de-index here
call this.changeScale()
set structIndex[ L] = structIndex[ maxIndex]
call this.destroy()
set L = L - 1
endif
set L = L + 1
endloop
if maxIndex <= 0 then
call PauseTimer( tmr)
endif
endmethod
private static method create takes unit c, real x, real y, integer i, integer i2, real dam, real r returns thistype
local thistype this = thistype.allocate()
set this.caster = c
set this.casterX = x
set this.casterY = y
set this.durCounter = 0
set this.durInt1 = i2 // first effect stage
set this.durInt2 = i // second effect stage
set this.damToDeal = dam
set this.aoeTotal = r
set maxIndex = maxIndex + 1
return this
endmethod
private static method setup takes nothing returns nothing
local thistype this
local thistype data
local unit c = GetTriggerUnit()
local unit u
local unit dum
local integer abiLvl = GetUnitAbilityLevel( c, SPELL_ID)
local real r = AOE_BASE + ( AOE_PER_LVL*I2R( abiLvl))
local real x = GetUnitX( c)
local real y = GetUnitY( c)
local integer i = ( DUR_BASE + ( DUR_PER_LVL*abiLvl))
local integer i2 = R2I( I2R( i)*0.75)
local real dam = DAM_BASE + ( DAM_PER_LVL*abiLvl)
local real angle
local real v = VELOCITY/2
set this = thistype.create( c, x, y, i, i2, dam, r)
set this.target = null
set this.propWindow = GetUnitPropWindow( this.caster)
set this.dummy = CreateUnit( GetOwningPlayer( c), DUMMY_UNIT, x, y, 0)
call SetUnitPropWindow( this.dummy, 0.00)
call SetUnitX( this.dummy, x)
call SetUnitY( this.dummy, y)
set this.eff = AddSpecialEffectTarget( DUMMY_EFF, this.dummy, ATTACH_POINT_DUMMY)
set dum = this.dummy
set structIndex[ maxIndex] = this
if maxIndex == 1 then
call TimerStart( tmr, 0.031250000, true, function thistype.timerActions)
endif
call GroupEnumUnitsInRange( grp, x, y, r, null)
loop
set u = FirstOfGroup( grp)
exitwhen u == null
if u != c and u != UNIT_TYPE_STRUCTURE and not IsUnitType( u, UNIT_TYPE_DEAD) and u != dum then
set this = thistype.create( c, x, y, i, i2, dam, r)
set this.target = u
set this.targetSX = GetUnitX( this.target)
set this.targetSY = GetUnitY( this.target)
set this.targetMX = this.targetSX
set this.targetMY = this.targetSY
set this.propWindow = GetUnitPropWindow( this.target)
call SetUnitPropWindow( this.target, 0.00)
set this.scale = 1.00
set this.decScale = 1.00/i2
set angle = getAngleBetweenXY( x, y, this.targetSX, this.targetSY)
set this.distanceMX = this.targetSX - polarProjectionX( this.targetMX, v, angle)
set this.distanceMY = this.targetSY - polarProjectionY( this.targetMY, v, angle)
set structIndex[ maxIndex] = this
endif
call GroupRemoveUnit( grp, u)
endloop
set c = null
set dum = null
endmethod
private static method conditions takes nothing returns boolean
if GetSpellAbilityId() == SPELL_ID then
call setup()
endif
return false
endmethod
//===========================================================================
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
set tmr = CreateTimer()
set grp = CreateGroup()
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition( t, Condition( function thistype.conditions))
set t = null
endmethod
endstruct
endlibrary
/*
[hidden="Changelog"]
version 1.1.8
[indent]Removed unneeded GetUnitTypeId().[/indent]
version 1.1.7
[indent]Fixed a bug and some other small things.[/indent]
version 1.1.6
[indent]Fixed a small mistake.[/indent]
version 1.1.5
[indent]Updated with the fixes suggested.[/indent]
version 1.1.2
[indent]made changes Maker suggested.[/indent]
version 1.1.1
[indent]got rid of the BJDEGTORAD things
fixed button positions ( pointless)
changed follow through time to 0.00[/indent]
version 1.1.0
[indent]changed the jass spell a little.
easier to read.[/indent]
version 1.0.6
[indent]changed the jass spell a little.
easier to read.[/indent]
version 1.0.5
[indent]fixed bug with the effects not showing[/indent]
version 1.0.4
[indent]fixed some things in the spell[/indent]
version 1.0.3
[indent]changed vJass version a bit
added ability to change effects easier[/indent]
version 1.0.2
[indent]added vJass version[/indent]
version 1.0.1
[indent]fixed bug[/indent]
version 1.0.0
[indent]first upload[/indent]
[/hidden]
*/