Name | Type | is_array | initial_value |
Ssla_ability | abilcode | No | |
Ssla_attachedEffect | string | No | |
Ssla_attachedEffectPoint | string | Yes | |
Ssla_attackType | attacktype | No | |
Ssla_caster | unit | Yes | |
Ssla_counter | integer | Yes | |
Ssla_damageType | damagetype | No | |
Ssla_effect | effect | Yes | |
Ssla_effect2 | effect | Yes | |
Ssla_harvester | unit | No | |
Ssla_level | integer | Yes | |
Ssla_mapX | real | Yes | |
Ssla_mapY | real | Yes | |
Ssla_maxIndex | integer | No | |
Ssla_moveEffect | string | No | |
Ssla_orderID | ordercode | No | |
Ssla_orgX | real | Yes | |
Ssla_orgY | real | Yes | |
Ssla_owner | player | Yes | |
Ssla_slashAnimation | string | No | |
Ssla_slashAnimationSpeed | real | No | |
Ssla_slashAoE | real | Yes | |
Ssla_slashCount | integer | Yes | |
Ssla_slashDamage | real | Yes | |
Ssla_slashEffect | string | No | |
Ssla_slashEffectPoint | string | No | |
Ssla_slashRadius | real | Yes | |
Ssla_target | unit | Yes | |
Ssla_tempGroup | group | No | |
Ssla_timer | timer | No | |
Ssla_timerSpeed | real | No |
//***************************************************************************
//* *
//* Shadow Slashes v1.0 *
//* by Haley *
//* *
//***************************************************************************
//* *
//* Moves so fast to random point nearby while slashing all enemy ground *
//* units nearby the caster and dealing damage each slash. *
//* *
//***************************************************************************
//* *
//* Visit www.hiveworkshop.com for more spells *
//* *
//***************************************************************************
constant function Ssla_timerSpeed takes nothing returns real
return 0.03125
endfunction
constant function Ssla_stopOrder takes nothing returns integer
return OrderId("stop")
endfunction
constant function Ssla_harvestOrder takes nothing returns integer
return OrderId("harvest")
endfunction
function Ssla_TreeEnumeration takes nothing returns nothing
local destructable d=GetEnumDestructable()
if GetWidgetLife(d)>0 then
call IssueTargetOrderById(udg_Ssla_harvester,Ssla_harvestOrder(),d)
if GetUnitCurrentOrder(udg_Ssla_harvester)==Ssla_harvestOrder() then
call KillDestructable(d)
endif
endif
set d=null
endfunction
function Ssla_Periodic takes nothing returns nothing
local integer index=1
local real aoe
local real angle
local unit u
local location l
loop
exitwhen index>udg_Ssla_maxIndex
if GetUnitCurrentOrder(udg_Ssla_caster[index])==udg_Ssla_orderID then
if udg_Ssla_counter[index]>0 then
call GroupEnumUnitsInRange(udg_Ssla_tempGroup,udg_Ssla_orgX[index],udg_Ssla_orgY[index],udg_Ssla_slashAoE[udg_Ssla_level[index]],null)
call GroupRemoveUnit(udg_Ssla_tempGroup,udg_Ssla_target[index])
set udg_Ssla_target[index]=null
loop
set u=FirstOfGroup(udg_Ssla_tempGroup)
exitwhen u==null
if not IsUnitType(u,UNIT_TYPE_DEAD) and IsUnitEnemy(u,udg_Ssla_owner[index]) and IsUnitType(u,UNIT_TYPE_GROUND) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
set udg_Ssla_target[index]=u
exitwhen true
else
call GroupRemoveUnit(udg_Ssla_tempGroup,u)
endif
endloop
if udg_Ssla_target[index]==null then
set aoe=GetRandomReal(0,udg_Ssla_slashAoE[udg_Ssla_level[index]])
set angle=GetRandomReal(0,6.2892)
set udg_Ssla_mapX[2]=udg_Ssla_orgX[index]+aoe*Cos(angle)
set udg_Ssla_mapY[2]=udg_Ssla_orgY[index]+aoe*Sin(angle)
if udg_Ssla_mapX[2]<udg_Ssla_mapX[0] then
set udg_Ssla_mapX[2]=udg_Ssla_mapX[0]
elseif udg_Ssla_mapX[2]>udg_Ssla_mapX[1] then
set udg_Ssla_mapX[2]=udg_Ssla_mapX[1]
endif
if udg_Ssla_mapY[2]<udg_Ssla_mapY[0] then
set udg_Ssla_mapY[2]=udg_Ssla_mapY[0]
elseif udg_Ssla_mapY[2]>udg_Ssla_mapY[1] then
set udg_Ssla_mapY[2]=udg_Ssla_mapY[1]
endif
else
set udg_Ssla_mapX[2]=GetUnitX(udg_Ssla_target[index])
set udg_Ssla_mapY[2]=GetUnitY(udg_Ssla_target[index])
endif
call DestroyEffect(AddSpecialEffect(udg_Ssla_moveEffect,udg_Ssla_mapX[2],udg_Ssla_mapY[2]))
call SetUnitX(udg_Ssla_caster[index],udg_Ssla_mapX[2])
call SetUnitY(udg_Ssla_caster[index],udg_Ssla_mapY[2])
call SetUnitAnimation(udg_Ssla_caster[index],udg_Ssla_slashAnimation)
call GroupEnumUnitsInRange(udg_Ssla_tempGroup,udg_Ssla_mapX[2],udg_Ssla_mapY[2],udg_Ssla_slashRadius[udg_Ssla_level[index]],null)
call GroupRemoveUnit(udg_Ssla_tempGroup,udg_Ssla_caster[index])
loop
set u=FirstOfGroup(udg_Ssla_tempGroup)
exitwhen u==null
if not IsUnitType(u,UNIT_TYPE_DEAD) and IsUnitEnemy(u,udg_Ssla_owner[index]) and IsUnitType(u,UNIT_TYPE_GROUND) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) then
call UnitDamageTarget(udg_Ssla_caster[index],u,udg_Ssla_slashDamage[udg_Ssla_level[index]],true,false,udg_Ssla_attackType,udg_Ssla_damageType,null)
call DestroyEffect(AddSpecialEffectTarget(udg_Ssla_slashEffect,u,udg_Ssla_slashEffectPoint))
endif
call GroupRemoveUnit(udg_Ssla_tempGroup,u)
endloop
set u=null
set l=Location(udg_Ssla_mapX[2],udg_Ssla_mapY[2])
call EnumDestructablesInCircleBJ(udg_Ssla_slashRadius[udg_Ssla_level[index]],l,function Ssla_TreeEnumeration)
call IssueImmediateOrderById(udg_Ssla_harvester,Ssla_stopOrder())
call RemoveLocation(l)
set l=null
set udg_Ssla_counter[index]=udg_Ssla_counter[index]-1
else
call SetUnitX(udg_Ssla_caster[index],udg_Ssla_orgX[index])
call SetUnitY(udg_Ssla_caster[index],udg_Ssla_orgY[index])
call IssueImmediateOrderById(udg_Ssla_caster[index],Ssla_stopOrder())
endif
else
if not IsUnitType(udg_Ssla_caster[index],UNIT_TYPE_DEAD) then
call SetUnitX(udg_Ssla_caster[index],udg_Ssla_orgX[index])
call SetUnitY(udg_Ssla_caster[index],udg_Ssla_orgY[index])
endif
call DestroyEffect(udg_Ssla_effect[index])
call DestroyEffect(udg_Ssla_effect2[index])
call SetUnitTimeScalePercent(udg_Ssla_caster[index],100)
call SetUnitPathing(udg_Ssla_caster[index],true)
set udg_Ssla_caster[index]=udg_Ssla_caster[udg_Ssla_maxIndex]
set udg_Ssla_counter[index]=udg_Ssla_counter[udg_Ssla_maxIndex]
set udg_Ssla_effect[index]=udg_Ssla_effect[udg_Ssla_maxIndex]
set udg_Ssla_effect2[index]=udg_Ssla_effect2[udg_Ssla_maxIndex]
set udg_Ssla_level[index]=udg_Ssla_level[udg_Ssla_maxIndex]
set udg_Ssla_orgX[index]=udg_Ssla_orgX[udg_Ssla_maxIndex]
set udg_Ssla_orgY[index]=udg_Ssla_orgY[udg_Ssla_maxIndex]
set udg_Ssla_owner[index]=udg_Ssla_owner[udg_Ssla_maxIndex]
set udg_Ssla_maxIndex=udg_Ssla_maxIndex-1
if udg_Ssla_maxIndex==0 then
call PauseTimer(udg_Ssla_timer)
else
set index=index-1
endif
endif
set index=index+1
endloop
endfunction
function Ssla_Cast takes nothing returns boolean
if GetSpellAbilityId()==udg_Ssla_ability then
if udg_Ssla_maxIndex==0 then
call TimerStart(udg_Ssla_timer,Ssla_timerSpeed(),true,function Ssla_Periodic)
endif
set udg_Ssla_maxIndex=udg_Ssla_maxIndex+1
set udg_Ssla_caster[udg_Ssla_maxIndex]=GetTriggerUnit()
set udg_Ssla_owner[udg_Ssla_maxIndex]=GetTriggerPlayer()
set udg_Ssla_level[udg_Ssla_maxIndex]=GetUnitAbilityLevel(udg_Ssla_caster[udg_Ssla_maxIndex],udg_Ssla_ability)
set udg_Ssla_counter[udg_Ssla_maxIndex]=udg_Ssla_slashCount[udg_Ssla_level[udg_Ssla_maxIndex]]
set udg_Ssla_orgX[udg_Ssla_maxIndex]=GetUnitX(udg_Ssla_caster[udg_Ssla_maxIndex])
set udg_Ssla_orgY[udg_Ssla_maxIndex]=GetUnitY(udg_Ssla_caster[udg_Ssla_maxIndex])
set udg_Ssla_effect[udg_Ssla_maxIndex]=AddSpecialEffectTarget(udg_Ssla_attachedEffect,udg_Ssla_caster[udg_Ssla_maxIndex],udg_Ssla_attachedEffectPoint[1])
set udg_Ssla_effect2[udg_Ssla_maxIndex]=AddSpecialEffectTarget(udg_Ssla_attachedEffect,udg_Ssla_caster[udg_Ssla_maxIndex],udg_Ssla_attachedEffectPoint[2])
call SetUnitTimeScalePercent(udg_Ssla_caster[udg_Ssla_maxIndex],udg_Ssla_slashAnimationSpeed)
call SetUnitPathing(udg_Ssla_caster[udg_Ssla_maxIndex],false)
endif
return false
endfunction
//===========================================================================
function InitTrig_Shadow_Slashes takes nothing returns nothing
set gg_trg_Shadow_Slashes=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Shadow_Slashes,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Shadow_Slashes,Filter(function Ssla_Cast))
set udg_Ssla_mapX[0]=GetRectMinX(GetWorldBounds())
set udg_Ssla_mapY[0]=GetRectMinY(GetWorldBounds())
set udg_Ssla_mapX[1]=GetRectMaxX(GetWorldBounds())
set udg_Ssla_mapY[1]=GetRectMaxY(GetWorldBounds())
set udg_Ssla_harvester=CreateUnit(Player(15),'hpea',0,0,0)
call UnitAddAbility(udg_Ssla_harvester,'Aloc')
call ShowUnit(udg_Ssla_harvester,false)
endfunction
function InitTrig_initialization takes nothing returns nothing
call FogEnable(false)
call FogMaskEnable(false)
call DisplayTextToForce(GetPlayersAll(),"Press |cffffcc00Esc|r to refresh.")
endfunction
function CreepSpawn takes nothing returns boolean
local real x=GetPlayerStartLocationX(Player(0))
local real y=GetPlayerStartLocationY(Player(0))
local real x2=GetPlayerStartLocationX(Player(1))
local real y2=GetPlayerStartLocationY(Player(1))
local integer i=0
local unit array u
local boolean array b
set b[1]=GetPlayerState(Player(0),PLAYER_STATE_RESOURCE_FOOD_USED)<100
set b[2]=GetPlayerState(Player(1),PLAYER_STATE_RESOURCE_FOOD_USED)<100
// ------------------------------------------------------
if b[1] then
set u[0]=CreateUnit(Player(0),'ugho',x,y,55.16)
set u[1]=CreateUnit(Player(0),'ugho',x,y,55.16)
set u[2]=CreateUnit(Player(0),'ugho',x,y,55.16)
set u[3]=CreateUnit(Player(0),'uabo',x,y,55.16)
set u[4]=CreateUnit(Player(0),'uabo',x,y,55.16)
endif
// ------------------------------------------------------
if b[2] then
set u[5]=CreateUnit(Player(1),'ugho',x2,y2,243.90)
set u[6]=CreateUnit(Player(1),'ugho',x2,y2,243.90)
set u[7]=CreateUnit(Player(1),'ugho',x2,y2,243.90)
set u[8]=CreateUnit(Player(1),'uabo',x2,y2,243.90)
set u[9]=CreateUnit(Player(1),'uabo',x2,y2,243.90)
endif
// ------------------------------------------------------
if b[1] then
loop
exitwhen i>4
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u[i],"origin"))
call IssuePointOrder(u[i],"attack",x2,y2)
set u[i]=null
set i=i+1
endloop
endif
if b[2] then
loop
exitwhen i>9
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u[i],"origin"))
call IssuePointOrder(u[i],"attack",x,y)
set u[i]=null
set i=i+1
endloop
endif
return false
endfunction
//===========================================================================
function InitTrig_creep_spawn takes nothing returns nothing
set gg_trg_creep_spawn = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_creep_spawn,20,true)
call TriggerRegisterTimerEvent(gg_trg_creep_spawn,0,false)
call TriggerAddCondition(gg_trg_creep_spawn,Filter(function CreepSpawn))
endfunction
function Refresh takes nothing returns boolean
local group g=CreateGroup()
local unit u
call GroupEnumUnitsOfPlayer(g,Player(0),null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if not IsUnitType(u,UNIT_TYPE_DEAD) and IsUnitType(u,UNIT_TYPE_HERO) then
call SetUnitLifePercentBJ(u,100)
call SetUnitManaPercentBJ(u,100)
call UnitResetCooldown(u)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set u=null
set g=null
return false
endfunction
//===========================================================================
function InitTrig_refresh takes nothing returns nothing
set gg_trg_refresh = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(gg_trg_refresh,Player(0))
call TriggerAddCondition(gg_trg_refresh,Filter(function Refresh))
endfunction
function LevelMax takes nothing returns boolean
local group g=CreateGroup()
local unit u
call GroupEnumUnitsOfPlayer(g,Player(0),null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
if not IsUnitType(u,UNIT_TYPE_DEAD) and IsUnitType(u,UNIT_TYPE_HERO) then
call SetHeroLevel(u,10,true)
endif
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
set u=null
set g=null
return false
endfunction
//===========================================================================
function InitTrig_lvlmax takes nothing returns nothing
set gg_trg_lvlmax = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_lvlmax,Player(0),"-lvlmax",true)
call TriggerAddCondition(gg_trg_lvlmax,Filter(function LevelMax))
endfunction