WolfieeifloW
WEHZ Helper
- Reaction score
- 372
Phantom Dash
Created By: WolfieeifloW
Requires NewGen and TimerUtils
Optionally can use GTrigger
Version: 1.0
Credits:
Spell editing, idea, and triggers were created by WolfieeifloW.
If you take the time to download / look at these, please at least leave a comment.
Don't forget to rate also (using the stars
) !
Screenshots serve no justice, try the spell out ingame.
Features:
-Leakless
-Lagless
-Eye-candy
-MUI
Spell Description
Dash to a target point, dealing damage to all enemies hit. Leaves an image at each enemy behind to confuse opponents.
Level 1: 50 damage.
Level 2: 100 damage.
Level 3: 150 damage.
Level 4: 200 damage.
Cooldown: 20/18/16/14 seconds.
Spell Code
Created By: WolfieeifloW
Requires NewGen and TimerUtils
Optionally can use GTrigger
Version: 1.0
Credits:
Spell editing, idea, and triggers were created by WolfieeifloW.
If you take the time to download / look at these, please at least leave a comment.
Don't forget to rate also (using the stars


Screenshots serve no justice, try the spell out ingame.
Features:
-Leakless
-Lagless
-Eye-candy
-MUI
Spell Description
Dash to a target point, dealing damage to all enemies hit. Leaves an image at each enemy behind to confuse opponents.
Level 1: 50 damage.
Level 2: 100 damage.
Level 3: 150 damage.
Level 4: 200 damage.
Cooldown: 20/18/16/14 seconds.
Spell Code
JASS:
// +---------------------------------------------------+
// | -=-=- Phantom Dash [v1.0] -=-=- |
// | -=-=- By WolfieeifloW -=-=- |
// | Requires JASS NewGen and TimerUtils |
// | Optionally can use GTrigger |
// +---------------------------------------------------+
// | Dash to a target point, dealing damage and |
// | creating an illusion for each enemy hit |
// +---------------------------------------------------+
// | -=-=- How To Implement -=-=- |
// | 1. Copy TimerUtils into your map |
// | b. Copy GTrigger into your map |
// | 2. Copy this trigger into your map |
// | 3. Copy the Phantom Dash, and Phantom Dash |
// | (Dummy) abilities into your map |
// | 4. Make sure the 'Rawcodes' in the trigger |
// | match your codes in the Object Editor |
// | 5. Customize the spell |
// | 6. Enjoy! |
// +---------------------------------------------------+
// | -=-=- Credits -=-=- |
// | Credits are not needed, but appreciated |
// | Just don't claim this as yours |
// +---------------------------------------------------+
// | -=-=- Version History -=-=- |
// | Version 1.0 |
// | - Initial release |
// +---------------------------------------------------+
library PhantomDash initializer Init requires TimerUtils optional GTrigger
globals
// +-----------------------------------+
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// | -=-=- MODIFY HERE -=-=- |
// +-----------------------------------+
private constant integer ABILITY_ID = 'PHAN' //Rawcode of the "Phantom Dash" ability
private constant integer ILLUSION_ID = 'ILLU' //Rawcode of the "Phantom Dash (Dummy)" ability
private constant integer DUMMY_ID = 'dUMM' //Rawcode of the dummy unit
private constant integer ORDER_ID = 852274 //Order Id of the "Wand of Illusion" item
private constant real SPEED = 1500. //Speed the unit moves at during the dash
private constant real RADIUS = 125. //Radius the unit hits units in - Don't go below 100
private constant string EFFECT = "Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl"
private constant string ATTACH = "origin"
private constant string ANIMATION = "walk" //Animation to play during Phantom Dash
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_MELEE //Attack Type of Phantom Dash
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_NORMAL //Damage Type of Phantom Dash
private constant weapontype WEAPON_TYPE = WEAPON_TYPE_WHOKNOWS //Weapon Type of Phantom Dash
endglobals
private function Damage takes integer level returns real
return level * 50. //Damage that Phantom Dash deals
endfunction
// +----------------------------------------------+
// | -=-=- DO NOT TOUCH PAST HERE -=-=- |
// | -=-=- DO NOT TOUCH PAST HERE -=-=- |
// | -=-=- DO NOT TOUCH PAST HERE -=-=- |
// +----------------------------------------------+
struct data
unit caster
real casterX
real casterY
real targetX
real targetY
real facing
effect sfx
group hit = CreateGroup()
timer t
method destroy takes nothing returns nothing
call ReleaseTimer(.t)
call GroupClear(.hit)
call .deallocate()
endmethod
endstruct
globals
private constant integer HIT_RANGE = 50
private constant real PERIOD = 0.03125
private constant real DSPEED = SPEED * PERIOD
private group GROUP = CreateGroup()
private location loc
private real x
private real y
private integer CurrentInstance
endglobals
private function Conditions takes nothing returns boolean
local unit u = GetFilterUnit()
local unit dummy
local data d = CurrentInstance
if IsUnitType(u, UNIT_TYPE_STRUCTURE) == false and GetWidgetLife(u) >= 0.405 and IsUnitEnemy(u, GetOwningPlayer(d.caster)) and IsUnitInGroup(u, d.hit) == false then
call UnitDamageTarget(d.caster, u, Damage(GetUnitAbilityLevel(d.caster, ABILITY_ID)), true, false, ATTACK_TYPE, DAMAGE_TYPE, WEAPON_TYPE)
set dummy = CreateUnit(GetOwningPlayer(d.caster), DUMMY_ID, GetUnitX(u), GetUnitY(u), bj_UNIT_FACING)
call UnitAddAbility(dummy, ILLUSION_ID)
call SetUnitAbilityLevel(dummy, ILLUSION_ID, GetUnitAbilityLevel(d.caster, ABILITY_ID))
call IssueTargetOrderById(dummy, ORDER_ID, d.caster)
call UnitApplyTimedLife(dummy, 'BTLF', 1.)
call GroupAddUnit(d.hit, u)
endif
set dummy = null
set u = null
return false
endfunction
private function Callback takes nothing returns nothing
local data d = GetTimerData(GetExpiredTimer())
set d.casterX = GetUnitX(d.caster)
set d.casterY = GetUnitY(d.caster)
set x = d.targetX - d.casterX
set y = d.targetY - d.casterY
if SquareRoot(x * x + y * y) >= HIT_RANGE then
set d.facing = Atan2(d.targetY - d.casterY, d.targetX - d.casterX)
set d.casterX = d.casterX + DSPEED * Cos(d.facing)
set d.casterY = d.casterY + DSPEED * Sin(d.facing)
call SetUnitX(d.caster, d.casterX)
call SetUnitY(d.caster, d.casterY)
set CurrentInstance = d
call GroupEnumUnitsInRange(GROUP, GetUnitX(d.caster), GetUnitY(d.caster), RADIUS, Condition(function Conditions))
else
call SetUnitAnimation(d.caster, "stand")
call PauseUnit(d.caster, false)
call DestroyEffect(d.sfx)
call d.destroy()
endif
endfunction
private function Actions takes nothing returns boolean
local data d
if GetSpellAbilityId() == ABILITY_ID then
set d = data.create()
set d.caster = GetTriggerUnit()
set loc = GetSpellTargetLoc()
set d.casterX = GetUnitX(d.caster)
set d.casterY = GetUnitY(d.caster)
set d.targetX = GetLocationX(loc)
set d.targetY = GetLocationY(loc)
set d.sfx = AddSpecialEffectTarget(EFFECT, d.caster, ATTACH)
set d.t = NewTimer()
call SetTimerData(d.t, d)
call SetUnitAnimation(d.caster, ANIMATION)
call PauseUnit(d.caster, true)
call TimerStart(d.t, PERIOD, true, function Callback)
set loc = null
endif
return false
endfunction
private function Init takes nothing returns nothing
local trigger trig = CreateTrigger()
static if(LIBRARY_GTrigger) then
call TriggerAddCondition(GT_RegisterStartsEffectEvent(trig, ABILITY_ID), Condition(function Actions))
else
call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(trig, Condition(function Actions))
endif
set trig = null
endfunction
endlibrary
Test map included.
Constructive criticism is welcomed, flaming is not.
This spell will only be submitted to TH.net.
Do not redistribute or modify without permission.
Credits are not needed but are appreciated.
Just don't claim the spell as yours.
Hope you enjoy it!
Constructive criticism is welcomed, flaming is not.
This spell will only be submitted to TH.net.
Do not redistribute or modify without permission.
Credits are not needed but are appreciated.
Just don't claim the spell as yours.
Hope you enjoy it!
Changelog
v1.0
- Initial release
- Initial release
Attachments
-
49.6 KB Views: 401