Name | Type | is_array | initial_value |
H | hashtable | No |
function Trig_fast_respawn_Conditions takes nothing returns boolean
return(GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE))
endfunction
//===========================================================================
function fast_respawn_Actions takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=LoadUnitHandle(udg_H, GetHandleId(t), 0)
local unit u2=CreateUnit(Player(PLAYER_NEUTRAL_AGGRESSIVE),GetUnitTypeId(u),GetUnitX(u),GetUnitY(u),0)
call PauseTimer(t)
call FlushChildHashtable(udg_H, GetHandleId(t))
call DestroyTimer(t)
set t=null
set u=null
set u2=null
endfunction
//===========================================================================
function Trig_fast_respawn_Actions takes nothing returns nothing
local unit u=GetDyingUnit()
local timer t=CreateTimer()
call SaveUnitHandle(udg_H, GetHandleId(t), 0, u)
call TimerStart(t, 5.00, false, function fast_respawn_Actions)
set u=null
set t=null
endfunction
//===========================================================================
function InitTrig_fast_respawn takes nothing returns nothing
set gg_trg_fast_respawn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_fast_respawn, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_fast_respawn, Condition( function Trig_fast_respawn_Conditions ) )
call TriggerAddAction( gg_trg_fast_respawn, function Trig_fast_respawn_Actions )
endfunction
function Trig_ds_dummy_Conditions takes nothing returns boolean
return(GetSpellAbilityId() == 'A001')
endfunction
//===========================================================================
function ds_dummy_Actions takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit d=LoadUnitHandle(udg_H, GetHandleId(t), 1)
local real ang=LoadReal(udg_H, GetHandleId(t), 2)
local group gr=CreateGroup()
local unit g
local unit d2
local real x
local real y
local real x1
local real y1
local real ang2
local location l
if GetWidgetLife(d) > 0.405 then
call GroupEnumUnitsInRange(gr,GetUnitX(d),GetUnitY(d),75.00,null)
loop
set g=FirstOfGroup(gr)
exitwhen g==null
if IsUnitType(g, UNIT_TYPE_STRUCTURE) == false and GetWidgetLife(g) > 0.405 and IsUnitEnemy(g, GetOwningPlayer(d)) == true then
call UnitDamageTarget(d, g, 9999, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DEATH, null)
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl",GetUnitX(g),GetUnitY(g)))
set ang2=GetRandomReal(1.00,359.00)
set x=GetUnitX(d)+300*Cos(ang2*bj_DEGTORAD)
set y=GetUnitY(d)+300*Sin(ang2*bj_DEGTORAD)
set d2=CreateUnit(GetOwningPlayer(d),'h001',GetUnitX(d),GetUnitY(d),ang2)
call UnitAddAbility(d2, 'A001')
call IssuePointOrder(d2, "silence", x,y)
call UnitApplyTimedLife(d2, 'BTLF', 1)
call UnitApplyTimedLife(d, 'BTLF', 0.1)//
endif
call GroupRemoveUnit(gr,g)
endloop
set x1=GetUnitX(d)+25*Cos(ang)
set y1=GetUnitY(d)+25*Sin(ang)
set l=Location(x1,y1)
call SetUnitPositionLoc(d,l)// location потому, что SetUnitX/Y выбрасывает юнита за пределы карты
else
call PauseTimer(t)
call FlushChildHashtable(udg_H, GetHandleId(t))
call DestroyTimer(t)
endif
call DestroyGroup(gr)
call RemoveLocation(l)
set l=null
set gr=null
set d=null
set d2=null
set g=null
set t=null
endfunction
//===========================================================================
function Trig_ds_dummy_Actions takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local location l=GetSpellTargetLoc()
local real ang=Atan2(GetLocationY(l)-GetUnitY(u),GetLocationX(l)-GetUnitX(u))
local timer t=CreateTimer()
local unit d=CreateUnit(GetOwningPlayer(u),'h000',GetUnitX(u),GetUnitY(u),ang)
call UnitApplyTimedLife(d, 'BTLF', 3.0)
call SaveUnitHandle(udg_H, GetHandleId(t), 1, d)
call SaveReal(udg_H, GetHandleId(t), 2, ang)
call TimerStart(t, 0.03, true, function ds_dummy_Actions)
call RemoveLocation(l)
set l=null
set t=null
set d=null
set u=null
endfunction
//===========================================================================
function InitTrig_ds_dummy takes nothing returns nothing
set gg_trg_ds_dummy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ds_dummy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ds_dummy, Condition( function Trig_ds_dummy_Conditions ) )
call TriggerAddAction( gg_trg_ds_dummy, function Trig_ds_dummy_Actions )
endfunction
function Trig_soulstone_Conditions takes nothing returns boolean
return(GetSpellAbilityId() == 'A000')
endfunction
//===========================================================================
function soulstone_Actions takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit sar=LoadUnitHandle(udg_H, GetHandleId(t), 0)
local unit sp=LoadUnitHandle(udg_H, GetHandleId(t), 1)
local integer sc=LoadInteger(udg_H, GetHandleId(t), 3)
local real ang=LoadReal(udg_H, GetHandleId(t), 2)
local real dist=LoadReal(udg_H, GetHandleId(t), 4)
local real x=GetUnitX(sar)
local real y=GetUnitY(sar)
local real x1=GetUnitX(sp)
local real y1=GetUnitY(sp)
local integer n=1
local location l
local real spX
local real spY
local unit dum
if SquareRoot((x1-x)*(x1-x)+(y1-y)*(y1-y)) >=30 then
call SetUnitScalePercent(sar, sc, sc, sc)
set sc=sc+1
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl",GetUnitX(sar),GetUnitY(sar)))
call SaveInteger(udg_H, GetHandleId(t), 3, sc)
set spX=x+dist*Cos(ang*bj_DEGTORAD)
set spY=y+dist*Sin(ang*bj_DEGTORAD)
set ang=ang+20.00
set dist=dist-4.00
call SaveReal(udg_H, GetHandleId(t), 2, ang)
call SaveReal(udg_H, GetHandleId(t), 4, dist)
set l=Location(spX,spY)
call SetUnitPositionLoc(sp,l)
else
loop
exitwhen n>3
set dum=CreateUnit(GetOwningPlayer(sar),'h001',GetUnitX(sar),GetUnitY(sar),0)
call UnitAddAbility(dum, 'A001')
call IssuePointOrder(dum, "silence", GetUnitX(sar)+300*Cos(n*120*bj_DEGTORAD),GetUnitY(sar)+300*Sin(n*120*bj_DEGTORAD))
call UnitApplyTimedLife(dum, 'BTLF', 1)
set n=n+1
endloop
call UnitApplyTimedLife(sar, 'BTLF', 0.1)
call UnitApplyTimedLife(sp, 'BTLF', 0.1)
call PauseTimer(t)
call FlushChildHashtable(udg_H, GetHandleId(t))
call DestroyTimer(t)
endif
call RemoveLocation(l)
set l=null
set t=null
set sar=null
set sp=null
set dum=null
endfunction
//===========================================================================
function Trig_soulstone_Actions takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local location l=GetSpellTargetLoc()
local real x=GetLocationX(l)
local real y=GetLocationY(l)
local timer t=CreateTimer()
local integer sc=20
local real ang=20.00
local real dist=400.00
local unit sar=CreateUnit(GetOwningPlayer(u),'h002',x,y,0)
local unit sp=CreateUnit(GetOwningPlayer(u),'h000',x+400*Cos(0*bj_DEGTORAD),y+400*Sin(0*bj_DEGTORAD),0)
call SetUnitFlyHeight(sp, 75.00, 99999.00)
call SaveUnitHandle(udg_H, GetHandleId(t), 0, sar)
call SaveUnitHandle(udg_H, GetHandleId(t), 1, sp)
call SaveReal(udg_H, GetHandleId(t), 2, ang)
call SaveInteger(udg_H, GetHandleId(t), 3, sc)
call SaveReal(udg_H, GetHandleId(t), 4, dist)
call TimerStart(t, 0.05, true, function soulstone_Actions)
call RemoveLocation(l)
set l=null
set u=null
set t=null
set sar=null
set sp=null
endfunction
//===========================================================================
function InitTrig_soulstone takes nothing returns nothing
set gg_trg_soulstone = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_soulstone, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_soulstone, Condition( function Trig_soulstone_Conditions ) )
call TriggerAddAction( gg_trg_soulstone, function Trig_soulstone_Actions )
endfunction