2 skills involed.. the mirana like arrow skill and the 2nd skill that dashes to the arrow. It wont dash unless theres an .. problem is even when the arrow is gone and he passes the arrow's last position he keeps dashing.. and dashes out of the map
heres skill 1. the arrow
2nd skill the dashing one
heres skill 1. the arrow
JASS:
scope ThunderSlash initializer Init
private function ThunderSlash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A02A039;
endfunction
globals
private constant integer DUMMY_ID = 039;h01K039; //Dummy ID
private constant integer ABILITY = 039;A02F039; //acidbomb ID
private constant integer DUMMY_IDD = 039;h00A039; //Dummy ID for the caster
private constant integer GENERIC = 039;BTLF039; //Generic timer buff
private constant real DISTANCE = 20.00 //MAX DISTANCE
private constant string HITEFFECT = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" //thunder clap effect
private constant string MOVEMENTEFFECT = "Abilities\\Weapons\\Bolt\\BoltImpact.mdl" //thunder movement effect
private unit ky
private unit caster
private location ky_l
private location dummy_l
private location os_l
private location tar_l
private location target_l
private integer count = 0
private integer level_k = 0
private integer gc = 0
private player op
private group ky_g = CreateGroup()
private group target = CreateGroup()
private timer ky_t = CreateTimer()
private real au = 0.00
private real damage_k = 0.00
private real adding
endglobals
//DO NOT TOUCH ANYTHING BELOW THIS LINE=====================================================
private function booleanftw1 takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(ky)) and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
endfunction
private function groupdmg1 takes nothing returns nothing
set caster = CreateUnitAtLoc(op, DUMMY_IDD, dummy_l, au)
call UnitAddAbility(caster, ABILITY)
call UnitApplyTimedLife(caster, GENERIC, 1.00)
if count <= 200 then
call SetUnitAbilityLevel(caster, ABILITY, 1)
else
endif
if count <= 600 and count > 200 then
call SetUnitAbilityLevel(caster, ABILITY, 2)
else
endif
if count <= 800 and count > 400 then
call SetUnitAbilityLevel(caster, ABILITY, 3)
else
endif
if count <= 1000 and count > 600 then
call SetUnitAbilityLevel(caster, ABILITY, 4)
else
endif
if count <= 1200 and count > 800 then
call SetUnitAbilityLevel(caster, ABILITY, 5)
else
endif
if count <= 1400 and count > 1000 then
call SetUnitAbilityLevel(caster, ABILITY, 6)
else
endif
if count <= 1600 and count > 1200 then
call SetUnitAbilityLevel(caster, ABILITY, 7)
else
endif
if count <= 2400 and count > 1600 then
call SetUnitAbilityLevel(caster, ABILITY, 8)
else
endif
call IssueTargetOrder(caster, "shadowstrike", GetEnumUnit())
call UnitDamageTargetBJ(ky, GetEnumUnit(), damage_k, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
endfunction
private function arrowmovement takes nothing returns nothing
set count = count + 20
set dummy_l = GetUnitLoc(udg_ky_dummy1)
call AddSpecialEffectLoc(MOVEMENTEFFECT, dummy_l)
set ky_g = GetUnitsInRangeOfLocMatching(82.00, dummy_l, Condition(function booleanftw1))
set gc = CountUnitsInGroup(ky_g)
if gc == 0 then
set os_l = PolarProjectionBJ(dummy_l, DISTANCE, au)
call SetUnitPositionLoc(udg_ky_dummy1, os_l)
call RemoveLocation(os_l)
call RemoveLocation(dummy_l)
call DestroyEffect(GetLastCreatedEffectBJ())
else
set target = GetRandomSubGroup(1, ky_g)
call AddSpecialEffectLoc(HITEFFECT, dummy_l)
call ForGroup(target, function groupdmg1)
call DestroyGroup(target)
call DestroyGroup(ky_g)
call RemoveLocation(dummy_l)
call PauseTimer(GetExpiredTimer())
call RemoveUnit(udg_ky_dummy1)
call DestroyEffect(GetLastCreatedEffectBJ())
endif
if count >= 2400 then
call PauseTimer(GetExpiredTimer())
call RemoveUnit(udg_ky_dummy1)
set udg_skillison = false
else
endif
endfunction
private function ThunderSlash_Actions takes nothing returns nothing
set ky = GetTriggerUnit()
set ky_l = GetUnitLoc(ky)
set tar_l = GetSpellTargetLoc()
set op = GetOwningPlayer(ky)
set level_k = GetUnitAbilityLevel(ky, 039;A02A039;)
set au = AngleBetweenPoints(ky_l, tar_l)
set damage_k = I2R(level_k)*100
set count = 0
set udg_ky_dummy1 = CreateUnitAtLoc(op, DUMMY_ID, ky_l, au)
set udg_skillison = true
call RemoveLocation(tar_l)
call RemoveLocation(ky_l)
call TimerStart(ky_t, 0.02, true, function arrowmovement)
endfunction
//===========================================================================
public function Init takes nothing returns nothing
local trigger ThunderSlash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( ThunderSlash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( ThunderSlash, Condition( function ThunderSlash_Conditions ) )
call TriggerAddAction( ThunderSlash, function ThunderSlash_Actions )
endfunction
endscope
2nd skill the dashing one
JASS:
scope SonicDash initializer Init1
private function SonicDashC takes nothing returns boolean
return GetSpellAbilityId() == 039;F00E039;
endfunction
globals
private constant integer BLINKDUMMY = 039;h01N039;
private constant real DISTANCE_K = 30.00
private constant string BLINKEFFECT = "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"
private constant string BOLTEFFECT = "Abilities\\Weapons\\Bolt\\BoltImpact.mdl"
private unit ky_b
private unit ky_a
private location ky_loc
private location ky_a_l
private location ky_o
private location s_loc
private real ky_d
private real ky_angle
private real ky_dis
private integer ky_level
private timer k_timer_1 = CreateTimer()
private group ky_g2 = CreateGroup()
endglobals
private function hurray takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(ky_b)) and IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
endfunction
private function groupdamage11 takes nothing returns nothing
local location enumloc = GetUnitLoc(GetEnumUnit())
call UnitDamageTargetBJ(ky_b, GetEnumUnit(), ky_d, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)
call AddSpecialEffectLoc(BOLTEFFECT, enumloc)
set enumloc = null
call RemoveLocation(enumloc)
endfunction
private function dash takes nothing returns nothing
local unit dummyhi
set ky_loc = GetUnitLoc(ky_b)
set ky_a_l = GetUnitLoc(ky_a)
set ky_dis = DistanceBetweenPoints(ky_loc, ky_a_l)
set ky_o = PolarProjectionBJ(ky_loc, DISTANCE_K, ky_angle)
if ky_dis >= 110.00 then
set ky_g2 = GetUnitsInRangeOfLocMatching(150.00, ky_loc, Condition(function hurray))
call ForGroup(ky_g2, function groupdamage11)
set dummyhi = CreateUnitAtLoc(GetOwningPlayer(ky_b), BLINKDUMMY, ky_loc, ky_angle)
call AddSpecialEffectLoc(BLINKEFFECT, ky_loc)
call SetUnitAnimation(dummyhi, "walk")
call UnitApplyTimedLife(dummyhi, 039;BFig039;, 0.10)
call SetUnitVertexColorBJ( dummyhi, 100.00, 100.00, 100.00, 50.00 )
call SetUnitAnimation(ky_b, "walk")
call SetUnitFacing(ky_b, ky_angle)
call SetUnitPositionLoc(ky_b, ky_o)
call RemoveLocation (ky_loc)
call RemoveLocation(ky_o)
call DestroyEffect(GetLastCreatedEffectBJ())
else
endif
if ky_dis <= 110.00 then
call SetUnitPathing(ky_b, true)
call PauseTimer(GetExpiredTimer())
else
endif
endfunction
private function SonicDashA takes nothing returns nothing
if udg_skillison == true then
set ky_b = GetTriggerUnit()
set ky_a = udg_ky_dummy1
set ky_loc = GetUnitLoc(ky_b)
set ky_a_l = GetUnitLoc(ky_a)
set ky_angle = AngleBetweenPoints(ky_loc, ky_a_l)
call RemoveLocation(ky_a_l)
set s_loc = GetSpellTargetLoc()
set ky_level = GetUnitAbilityLevel(ky_b, 039;F00E039;)
set ky_d = I2R(ky_level) * 25
set ky_dis = DistanceBetweenPoints(ky_loc, ky_a_l)
call RemoveLocation(ky_loc)
if ky_dis >= 200 then
call SetUnitPathing(ky_b, false)
call TimerStart(k_timer_1, 0.06, true, function dash)
else
endif
else
endif
endfunction
//===========================================================================
public function Init1 takes nothing returns nothing
local trigger SonicDash1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( SonicDash1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( SonicDash1, Condition( function SonicDashC ) )
call TriggerAddAction( SonicDash1, function SonicDashA )
endfunction
endscope