//TESH.scrollpos=74
//TESH.alwaysfold=0
//!==========================================================//
// Фильтрация отряда
//!==========================================================//
function UnitCheck takes unit caster, unit u returns boolean
return IsUnitEnemy(u, GetOwningPlayer(caster)) and not (IsUnitType(u, UNIT_TYPE_DEAD) and GetUnitTypeId(u) != 0) and IsUnitType(u, UNIT_TYPE_GROUND) and not IsUnitType(u, UNIT_TYPE_STRUCTURE)
endfunction
//!==========================================================//
// Уничтожение деревьев
//!==========================================================//
function KillTrees takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
//!==========================================================//
function PS_KillTrees takes real x, real y, real radius returns nothing
local rect r=Rect(x-radius,y-radius,x+radius,y+radius)
call EnumDestructablesInRect(r,null,function KillTrees)
call RemoveRect(r)
set r=null
endfunction
//!====================================================================================================================
// Массивный Knockback By Lobster_1234
//!====================================================================================================================
function MassiveDamageLoop takes nothing returns nothing
local timer TMR = GetExpiredTimer()
local integer id = GetHandleId(TMR)
local unit i = LoadUnitHandle(hash,id,100)
local real speed = LoadReal(hash,id,101) - ( 1. )
local real angle = LoadReal(hash,id,102)
local real x = GetUnitX(i)
local real y = GetUnitY(i)
local real x1 = x+speed*Cos(angle*bj_DEGTORAD)
local real y1 = y+speed*Sin(angle*bj_DEGTORAD)
call PS_KillTrees( x, y, 125. )
if speed < 1 then
call PauseTimer(TMR)
call DestroyTimer(TMR)
call FlushChildHashtable(hash,id)
else
if IsTerrainPathable(x1, y1, PATHING_TYPE_WALKABILITY) == true then
set speed = 0
else
call SetUnitX(i,x1)
call SetUnitY(i,y1)
endif
endif
call SaveReal(hash,id,101,speed)
set TMR = null
set i = null
endfunction
//!=======================================================================================================
// Массивный Knockback By Lobster_1234
//!=======================================================================================================
function mk takes unit a,real x,real y, string Effect,real damage,real range,real speed returns nothing
local group gr
local unit i
local real angle
local timer TMR
local integer id
set gr = CreateGroup()
call GroupEnumUnitsInRange(gr, x, y, range, null)
set i = FirstOfGroup(gr)
loop
exitwhen(i == null)
if(IsUnitEnemy(i, GetOwningPlayer(a))) and UnitCheck(a, i) then
set TMR = CreateTimer()
set id = GetHandleId(TMR)
set angle = bj_RADTODEG * Atan2(GetUnitY(i) - y, GetUnitX(i) - x)
call UnitDamageTarget(a,i,damage,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call DestroyEffect(AddSpecialEffect(Effect,GetUnitX(i),GetUnitY(i)))
call SaveUnitHandle(hash,id,100,i)
call SaveReal(hash,id,101,speed)
call SaveReal(hash,id,102,angle)
call TimerStart(TMR,0.02,true,function MassiveDamageLoop)
set TMR = null
endif
call GroupRemoveUnit(gr, i)
set i = FirstOfGroup(gr)
endloop
call DestroyGroup(gr)
set a = null
set i = null
set gr = null
endfunction
//!=======================================================================================================
// Massive Damage
//!=======================================================================================================
function MassiveDamage takes unit a, real x, real y, real damage,real radius,string Effect returns nothing
local player p = GetOwningPlayer(a)
local group g = CreateGroup()
local unit n = GetEnumUnit()
call GroupEnumUnitsInRange(g,x,y,radius,null)
loop
set n = FirstOfGroup(g)
exitwhen n == null
if IsUnitEnemy(n, p) == true and UnitCheck(a, n) then
call UnitDamageTarget(a,n,damage,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
call DestroyEffect(AddSpecialEffect(Effect,GetUnitX(n),GetUnitY(n)))
endif
call GroupRemoveUnit(g,n)
endloop
call DestroyGroup(g)
set a = null
set g = null
set n = null
set p = null
endfunction
Name | Type | is_array | initial_value |
HandleBoard | leaderboard | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function HandleCounter_Update takes nothing returns nothing
local integer i = 0
local integer id
local location array P
local real result=0
loop
exitwhen i >= 50
set i = i + 1
set P[i] = Location(0,0)
set id = GetHandleId(P[i])
set result = result + (id-0x100000)
endloop
set result = result/i-i/2
loop
call RemoveLocation(P[i])
set P[i] = null
exitwhen i <= 1
set i = i - 1
endloop
call LeaderboardSetItemValue(udg_HandleBoard,0,R2I(result))
endfunction
function HandleCounter_Actions takes nothing returns nothing
set udg_HandleBoard = CreateLeaderboard()
call LeaderboardSetLabel(udg_HandleBoard, "Handle Counter")
call PlayerSetLeaderboard(GetLocalPlayer(),udg_HandleBoard)
call LeaderboardDisplay(udg_HandleBoard,true)
call LeaderboardAddItem(udg_HandleBoard,"Handles",0,Player(0))
call LeaderboardSetSizeByItemCount(udg_HandleBoard,1)
call HandleCounter_Update()
call TimerStart(GetExpiredTimer(),0.01,true,function HandleCounter_Update)
endfunction
function InitTrig_HandleCounter takes nothing returns nothing
call TimerStart(CreateTimer(),0,false,function HandleCounter_Actions)
endfunction
//TESH.scrollpos=63
//TESH.alwaysfold=0
globals
constant integer AbilityRaw = 'A000' // Способность
constant integer DummyId = 'h001' // Даммик
constant string Order = "stampede" // Ордер
endglobals
function String2OrderId takes string orderIdString returns integer
local integer orderId
// Check to see if it's a generic order.
set orderId = OrderId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Check to see if it's a (train) unit order.
set orderId = UnitId(orderIdString)
if (orderId != 0) then
return orderId
endif
// Unrecognized - return 0
return 0
endfunction
function Strela_Act2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local unit a = LoadUnitHandle(hash,id,0)
local unit dummy = LoadUnitHandle(hash,id,1)
local real damage = LoadReal(hash,id,3) + ( 1.)
local real tmr = LoadReal(hash,id,4) - (0.45)
local real Face = LoadReal(hash,id,5)
local real x = GetUnitX(dummy)
local real y = GetUnitY(dummy)
local real xx = x+tmr*Cos(Face*0.01747)
local real yy = y+tmr*Sin(Face*0.01747)
if tmr <15.00 then
call PauseTimer(t)
call DestroyTimer(t)
call RemoveUnit(dummy)
call FlushChildHashtable(hash,id)
elseif IsTerrainPathable(xx, yy, PATHING_TYPE_WALKABILITY) == false then
call SetUnitX(dummy, xx)
call SetUnitY(dummy, yy)
else
set tmr = ( tmr - GetRandomReal(-4.25,-6.30)) // когда сталкивается со скалой, теряет скорость
set Face = Face - GetRandomReal(90,180) // угол
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h002',x,y,Face),'BTLF',1.00)
endif
call PS_KillTrees(x,y,135)
call MassiveDamage(a,x,y,damage*(tmr/40),150+(damage/2),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
call SaveReal(hash,id,4,tmr)
call SaveReal(hash,id,5,Face)
set t = null
set a = null
set dummy = null
endfunction
function Strela_Act1 takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer id = GetHandleId(t)
local unit a = LoadUnitHandle(hash,id,0)
local unit dummy = LoadUnitHandle(hash,id,1)
local integer dur = LoadInteger(hash,id,2) - ( 1 )
local real damage = LoadReal(hash,id,3) + ( 1.00) // прирост урона
local real tmr = LoadReal(hash,id,4) + ( 0.90) // скорость и длительность сюрикена
if GetUnitCurrentOrder(a) == String2OrderId(Order) and dur > 0 or GetUnitState(a,UNIT_STATE_LIFE)<0.405 then
call SetUnitScale(dummy, (65 + (damage)) * 0.01, ( 65.00 + (damage)) * 0.01, ( 65.00 + (damage)) * 0.01) // размер сюрикена
else
call PauseTimer(t)
call IssueImmediateOrder(a,"stop")
call TimerStart(t,0.03,true,function Strela_Act2)
endif
call SaveInteger(hash,id,2,dur)
call SaveReal(hash,id,3,damage)
call SaveReal(hash,id,4,tmr)
set t = null
set a = null
set dummy = null
endfunction
function Trig_Strela_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local timer t = CreateTimer()
local integer id = GetHandleId(t)
local real damage = 10 * GetUnitAbilityLevel(a,AbilityRaw)// базовый урон
local integer dur = 25 +( 10 * GetUnitAbilityLevel(a,AbilityRaw))
local real tmr = 40 // базовая скорость снаряда
local real x = GetUnitX(a)
local real y = GetUnitY(a)
local real d = bj_RADTODEG * Atan2(GetSpellTargetY() - y, GetSpellTargetX() - x)
local unit dummy = CreateUnit(GetOwningPlayer(a),DummyId,x+100*Cos(d*0.0174),y+100*Sin(d*0.0174),d)
call FlushChildHashtable(hash,id)
call SaveUnitHandle(hash,id,0,a)
call SaveUnitHandle(hash,id,1,dummy)
call SaveInteger(hash,id,2,dur)
call SaveReal(hash,id,3,damage)
call SaveReal(hash,id,4,tmr)
call SaveReal(hash,id,5,GetUnitFacing(dummy))
call TimerStart(t,0.04,true,function Strela_Act1)
set t = null
set a = null
set dummy = null
endfunction
function Trig_Strela_Conditions takes nothing returns boolean
return GetSpellAbilityId() == AbilityRaw
endfunction
//===========================================================================
function InitTrig_Strela takes nothing returns nothing
set gg_trg_Strela = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Strela, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Strela, Condition( function Trig_Strela_Conditions ) )
call TriggerAddAction( gg_trg_Strela, function Trig_Strela_Actions )
endfunction
globals
hashtable hash = InitHashtable()
group UnitGroup = CreateGroup()
endglobals
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Shuriken_Act2 takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit a = LoadUnitHandle(hash,GetHandleId(t),50)
local unit b = LoadUnitHandle(hash,GetHandleId(t),51)
local real dur = LoadReal(hash,GetHandleId(t),231) - ( 1.)
if dur <0 then
call PauseTimer(t)
call RemoveUnit(b)
call DestroyTimer(t)
call FlushChildHashtable(hash,GetHandleId(t))
else
call MassiveDamageAoe(a,GetUnitX(b),GetUnitY(b),(GetUnitAbilityLevel(a, 'A032'))* 9,400)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00V',GetUnitX(b),GetUnitY(b),0),'BTLF',2)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00V',GetUnitX(b),GetUnitY(b),0),'BTLF',2)
endif
call SaveReal(hash,GetHandleId(t),231,dur)
set t = null
set a = null
set b = null
endfunction
function Shuriken_Act takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit a = LoadUnitHandle(hash,GetHandleId(t),50)
local unit b = LoadUnitHandle(hash,GetHandleId(t),51)
local real distance = LoadReal(hash,GetHandleId(t),230) - ( 50.)
local group g = CreateGroup()
local unit n
local real x =GetUnitX(b)+50*Cos(GetUnitFacing(b)*0.0174)
local real y =GetUnitY(b)+50*Sin(GetUnitFacing(b)*0.0174)
call PS_KillTrees( x, y, 180 )
call GroupEnumUnitsInRange(g,GetUnitX(b),GetUnitY(b),250,null)
loop
set n = FirstOfGroup(g)
exitwhen n == null
if IsUnitEnemy(n,GetOwningPlayer(a)) == true and UnitCheck(a, n) then
call SetUnitX(n,GetUnitX(b))
call SetUnitY(n,GetUnitY(b))
endif
call GroupRemoveUnit(g,n)
endloop
call DestroyGroup((g))
if distance <=0.00 or IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) == true then
call PauseTimer(t)
call SetUnitVertexColor( b, 100, 100, 100, 0 )
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),45),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),90),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),135),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),180),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),225),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),270),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),315),'BTLF',4.00)
call UnitApplyTimedLife(CreateUnit(GetOwningPlayer(a),'h00U',GetUnitX(b),GetUnitY(b),360),'BTLF',4.00)
call TimerStart(t,0.08,true, function Shuriken_Act2)
else
call SetUnitX(b,x)
call SetUnitY(b,y)
endif
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",GetUnitX(b),GetUnitY(b)))
call SaveReal(hash,GetHandleId(t),230,distance)
set t = null
set a = null
set b = null
set g = null
set n = null
endfunction
function Trig_RasenShuriken_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local real x = GetSpellTargetX()
local real y = GetSpellTargetY()
local timer t = CreateTimer()
local real d = bj_RADTODEG * Atan2(GetSpellTargetY() - GetUnitY(a),GetSpellTargetX() - GetUnitX(a))
local unit b = CreateUnit(GetOwningPlayer(a),'h00T',GetUnitX(a),GetUnitY(a),d)
call SaveUnitHandle(hash,GetHandleId(t),50,a)
call SaveUnitHandle(hash,GetHandleId(t),51,b)
call SaveReal(hash,GetHandleId(t),230,DistanceXY2D(GetUnitX(a),GetUnitY(a),x,y))
call SaveReal(hash,GetHandleId(t),231,40)
call TimerStart(t,0.03,true, function Shuriken_Act)
set a = null
set t = null
set b = null
endfunction
function Trig_RasenShuriken_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A032'
endfunction
//===========================================================================
function InitTrig_RasenShuriken takes nothing returns nothing
local trigger t = CreateTrigger()
call TRE( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( t, Condition( function Trig_RasenShuriken_Conditions ) )
call TriggerAddAction( t, function Trig_RasenShuriken_Actions )
call RemoveUnit(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00T', 0.00, 0.00, 0.00))
call RemoveUnit(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00V', 0.00, 0.00, 0.00))
call RemoveUnit(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00U', 0.00, 0.00, 0.00))
call Preload("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
set t = null
endfunction