NetherHawk
New Member
- Reaction score
- 26
Jass/MUI
Leakless: not too sure.. hopefully
Description: The hero channels for 2 seconds and fires a volley of arrows to the sky. These arrows then auto acquire their target and impales them at lightning speed, stunning damage, dealing lots of damage and knocking them back from the force of the impact. The arrows may hit similar targets.
From the manga claymore: this is the Dweller of the Deep Isley's ability. I found it cool so i decided to make it. =D Claymore rocks.. recomend u guys to read it @ onemanga.com
Tried to make it look as nice as possible =D
uses local handle variables
Leakless: not too sure.. hopefully
Description: The hero channels for 2 seconds and fires a volley of arrows to the sky. These arrows then auto acquire their target and impales them at lightning speed, stunning damage, dealing lots of damage and knocking them back from the force of the impact. The arrows may hit similar targets.
From the manga claymore: this is the Dweller of the Deep Isley's ability. I found it cool so i decided to make it. =D Claymore rocks.. recomend u guys to read it @ onemanga.com
Tried to make it look as nice as possible =D
uses local handle variables
JASS:
function Death_Arrows_Jass_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A000039;
endfunction
function DeathArrows_Filter takes nothing returns boolean
local boolean b1 = IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())) == true
local boolean b2 = IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE) == false
local boolean b3 = IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) == false
return b1 and b2 and b3
endfunction
function Skid takes nothing returns nothing
local timer ty = GetExpiredTimer()
local unit p = GetHandleUnit(ty,"target")
local real r = GetHandleReal(ty,"dist")
local real ax = GetHandleReal(ty,"angleofpush")
local integer c = GetHandleInt(ty,"counter")
local location pl = GetUnitLoc(p)
local location pnl = PolarProjectionBJ(pl,r,ax)
if c < 25 then // setting it to a higher number will increase knockback distance
set c = c + 1
call SetUnitPosition(p,GetLocationX(pnl),GetLocationY(pnl))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl",p,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",p,"chest"))
call SetHandleHandle(ty,"target",p)
call SetHandleReal(ty,"angleofpush",ax)
call SetHandleInt(ty,"counter",c)
call SetHandleReal(ty,"dist",r*.95)// to slow down rate of knockback
else
call PauseTimer(ty)
call FlushHandleLocals(ty)
call DestroyTimer(ty)
set ty = null
endif
set p = null
call RemoveLocation(pl)
call RemoveLocation(pnl)
set pl = null
set pnl = null
endfunction
function Damage takes nothing returns nothing
local timer tx = GetExpiredTimer()
local unit p = GetHandleUnit(tx,"target")
local unit u = GetHandleUnit(tx,"caster")
local integer i = GetUnitAbilityLevel(u,039;A000039;)
local unit q
local real r = 20 // u can adjust knockback speed with this
local integer c = 0
local timer ty = CreateTimer()
local real ax = GetHandleReal(tx,"angleofpush")
if GetUnitAbilityLevel(p,039;B000039;) > 0 then//determines when to create the purple, blood effects and the start of knockback
call PauseTimer(tx)
call SetHandleReal(ty,"angleofpush",ax)
call SetHandleHandle(ty,"target",p)
call SetHandleReal(ty,"dist",r)
call SetHandleInt(ty,"counter",c)
call TimerStart(ty,.04,true,function Skid)
call UnitDamageTarget(u,p,1,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_METAL_HEAVY_SLICE)// just for the sound effects
set q = CreateUnit(GetOwningPlayer(u),039;h003039;,GetUnitX(p),GetUnitY(p),bj_UNIT_FACING)// this is the dummy unit that provides the purple effect
call UnitApplyTimedLife(q,039;BTLF039;,0.04)
call DestroyTimer(tx)
call FlushHandleLocals(tx)
set u = null
set p = null
set q = null
endif
call SetHandleHandle(tx,"target",p)
call SetHandleHandle(tx,"caster",u)
set u = null
set p = null
endfunction
function Prepare takes nothing returns nothing
local trigger tr = GetTriggeringTrigger()// determines when the arrow has been shot to the sky
local unit d = GetTriggerUnit()
local location l = GetUnitLoc(d)
local unit u = GetHandleUnit(tr,"caster")
local real a = GetHandleReal(tr,"angle")
local integer i = GetUnitAbilityLevel(u,039;A000039;)
local real dx = GetUnitX(d)
local real dy = GetUnitY(d)
local integer kx = 1 + (2*i)
local integer k = 0
local unit x
local group g
local unit p
local group gx
local timer tx
local triggeraction ta = GetHandleTrigAct(tr,"action")
local real ax
call UnitAddAbility(d,039;Aloc039;)
call PolledWait(1.5)
call SetUnitVertexColorBJ(u,100,100,100,0 )// return caster to normal
loop
exitwhen k == kx // adjust kx value to a higher one so more arrows may be fired
set gx = CreateGroup()
set g = CreateGroup()
set g = GetUnitsInRangeOfLocMatching(2500,l,Condition(function DeathArrows_Filter)) // pick units in range
set gx = GetRandomSubGroup(1,g) // pick unit to fire arrow at
set x = CreateUnit(GetOwningPlayer(u),039;h000039;,dx,dy,a)
call SetUnitFlyHeight(x,600,6000)
call SetUnitAbilityLevel(x,039;A001039;,i)
set p = FirstOfGroup(gx)
call IssueTargetOrder(x,"thunderbolt",p)
call UnitApplyTimedLife(x,039;BTLF039;,1)
set ax = bj_RADTODEG*Atan2(GetUnitY(p)-GetUnitY(d),GetUnitX(p)-GetUnitX(d))
set tx = CreateTimer()
call SetHandleReal(tx,"angleofpush",ax)
call SetHandleHandle(tx,"target",p)
call SetHandleHandle(tx,"caster",u)
call TimerStart(tx,.1,true,function Damage)
set p = null
set x = null
call DestroyGroup(gx)
call DestroyGroup(g)
set k = k + 1
endloop
call RemoveUnit(d)
call PolledWait(2.)
set p = null
set u = null
set d = null
call RemoveLocation(l)
set l = null
call DisableTrigger(tr)
call TriggerRemoveAction(tr,ta)
call DestroyTrigger(tr)
endfunction
function Fade takes nothing returns nothing
local timer t1 = GetExpiredTimer()
local integer f = GetHandleInt(t1,"fade")
local unit u = GetHandleUnit(t1,"caster")
local integer c = GetHandleInt(t1,"counter")
set f = f + 2 // to make the unit slowly fade
if c < 50 then
set c = c + 1
call SetUnitVertexColorBJ(u,100,100,100,0 + f )
call SetHandleInt(t1,"fade",f)
call SetHandleInt(t1,"counter",c)
else
call PauseTimer(t1)
call FlushHandleLocals(t1)
call DestroyTimer(t1)
set t1 = null
endif
set u = null
endfunction
function Death_Arrows_Jass_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location ul = GetUnitLoc(u)
local real ulx = GetLocationX(ul)
local real uly = GetLocationY(ul)
local real a = GetUnitFacing(u)
local location l = PolarProjectionBJ(ul,800,a)
local real lx = GetLocationX(l)
local real ly = GetLocationY(l)
local unit d = CreateUnit(GetOwningPlayer(u),039;h001039;,lx,ly,a)
local unit x = CreateUnit(GetOwningPlayer(u),039;h002039;,ulx,uly,a)
local integer i = GetUnitAbilityLevel(u,039;A000039;)
local timer t1 = CreateTimer()
local group g = CreateGroup()
local integer f = 0
local integer c = 0
local trigger tr = CreateTrigger()
local triggeraction ta = TriggerAddAction(tr,function Prepare)
call SetUnitFlyHeight(d,600,600) // how high up the arrow should be shot
call SetUnitVertexColorBJ(d,100,100,100,100 )//making unit transparent
call SetHandleHandle(t1,"caster",u)
call SetHandleInt(t1,"fade",f)
call SetHandleInt(t1,"counter",c)
call TimerStart(t1,.04,true,function Fade)//starting the fading of the caster
call PolledWait(2)
call SetUnitAbilityLevel(x,039;A001039;,4)
call IssueTargetOrder(x,"attackonce",d)
call UnitApplyTimedLife(x,039;BTLF039;,1)
call SetHandleHandle(tr,"caster",u)
call SetHandleReal(tr,"angle",a)
call SetHandleHandle(tr,"action",ta)
call TriggerRegisterUnitEvent(tr,d,EVENT_UNIT_DAMAGED)
set u = null
call RemoveLocation(ul)
call RemoveLocation(l)
set d = null
set x = null
set ul =null
set l = null
endfunction
//===========================================================================
function InitTrig_Death_Arrows_Jass takes nothing returns nothing
set gg_trg_Death_Arrows_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Arrows_Jass, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Death_Arrows_Jass, Condition( function Death_Arrows_Jass_Conditions ) )
call TriggerAddAction( gg_trg_Death_Arrows_Jass, function Death_Arrows_Jass_Actions )
endfunction