Name | Type | is_array | initial_value |
AttackersGroup | group | No | |
DefendersGroup | group | No | |
Income | integer | Yes | 3 |
IncomeTimer | timer | No | |
MonsterSpawnPts | location | Yes | |
SpawnPoint | location | No | |
TmpCount | integer | No | 1 |
TmpGroup | group | No | |
TmpString | string | No | |
TmpTimer | timer | No | |
TmpUnit | group | No | |
TownHalled | boolean | No | |
TrollMultiplier | integer | No | 1 |
function Trig_Rocketjump_Conditions takes nothing returns boolean
if ( ( GetSpellAbilityId() == 'A06D' ) or ( GetSpellAbilityId() == 'A06E' ) )then
return true
endif
return false
endfunction
//Conditions für Gruppe, die bei Landung weggestoßen wird.
function Trig_Rocketjump_Groupcond takes nothing returns boolean
if ( ( IsUnitAliveBJ(GetFilterUnit()) ) and ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) and ( IsPlayerEnemy(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(udg_g_unit[36])) == true ) ) then
return true
endif
return false
endfunction
// Bewegung der einzelnen Einheiten der Gruppe.
function Trig_Rocketjump_Groupmove takes nothing returns nothing
local location loc
local real winkel = AngleBetweenPoints(GetUnitLoc(udg_g_unit[36]), GetUnitLoc(GetEnumUnit()))
local real distanz = udg_g_real[6]
if ( IsUnitAliveBJ(GetEnumUnit()) ) then
set loc = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), distanz, ( winkel + GetRandomReal(-10.00, 10.00) ))
call SetUnitPositionLoc( GetEnumUnit(), loc )
else
endif
call RemoveLocation(loc)
set loc = null
endfunction
// Timer-Expire vor Gruppenmove.
function Trig_Rocketjump_Moveunit takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer iter = GetHandleInt(t, "iter")
local real distanz = GetHandleReal(t, "distanz")
local group g = GetHandleGroup(t, "g")
set iter = iter + 1
call SetHandleInt(t, "iter", iter)
set udg_g_real[6] = distanz
call ForGroupBJ( g, function Trig_Rocketjump_Groupmove )
set distanz = distanz - 0.10
call SetHandleReal(t, "distanz", distanz)
if ( iter == 50 ) then
call PauseTimerBJ( true, t )
call FlushHandleLocals(t)
call DestroyTimer(t)
else
endif
set t = null
call DestroyGroup(g)
set g = null
endfunction
// einmaliger Schaden an Gruppe direkt nach Landung
function Trig_Rocketjump_Damage takes nothing returns nothing
local real damage
local integer int = udg_g_integer[11]
local real scaler
local unit caster = udg_g_unit[36]
local unit target = GetEnumUnit()
local boolean crit = true
local location loc = GetUnitLoc(target)
set damage = GetRandomReal((150+int*50), (175+int*75))
set scaler = damage / (175+int*75)
call CreateNUnitsAtLoc( 1, 'u000', GetOwningPlayer(caster), loc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A018', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", target )
call DamageTargetWithTextPhysical(caster, target, damage, scaler, crit)
call RemoveLocation(loc)
set loc = null
set caster = null
set target = null
endfunction
// Actions ab Absprung: Timer, Gruppenerkennung, Schaden usw.
function Trig_Rocketjump_Absprung takes nothing returns nothing
local unit caster = udg_g_unit[36]
local location loc = GetUnitLoc(caster)
local real distanz = 5.00
local timer t = CreateTimer()
local integer iter = 0
local group g
local unit explosionssfx
local real damage
local integer int = udg_g_integer[11]
local real scaler
local unit target = GetEnumUnit()
local boolean crit = true
set g = GetUnitsInRangeOfLocMatching(200.00, loc, Condition(function Trig_Rocketjump_Groupcond))
call AddSpecialEffectLocBJ( loc, "Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl" )
set explosionssfx = CreateUnitAtLoc( GetOwningPlayer(caster), 'u00P', loc, bj_UNIT_FACING )
call KillUnit(explosionssfx)
call ForGroupBJ( g, function Trig_Rocketjump_Damage )
set damage = GetRandomReal(0.1,0.5) * GetRandomReal((150+int*50), (175+int*75))
set scaler = damage / (0.5*(175+int*75))
call DamageTargetWithTextPhysical(caster, caster, damage, scaler, crit)
call SetHandleReal(t, "distanz", distanz)
call SetHandleInt(t, "iter", iter)
call SetHandleHandle(t, "g", g)
call TimerStart(t, 0.01, true, function Trig_Rocketjump_Moveunit)
call RemoveLocation(loc)
set loc = null
set caster = null
set t = null
set explosionssfx = null
endfunction
function Trig_Rocketjump_Move takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit caster = GetHandleUnit(t, "caster")
local integer iter = GetHandleInt(t, "iter")
local integer wende = GetHandleInt(t, "wende")
local real tempo = GetHandleReal(t, "tempo")
local real winkel = GetHandleReal(t, "winkel")
local real strecke = GetHandleReal(t, "strecke")
local location loc
set iter = iter + 1
call SetHandleInt(t, "iter", iter)
if ( IsUnitAliveBJ(caster) ) then
if ( iter <= wende ) then
set tempo = tempo - (4 / I2R(wende))
call SetHandleReal(t, "tempo", tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 6000 * iter ), 10000 )
else
set tempo = tempo - (4 / I2R(wende))
call SetHandleReal(t, "tempo", tempo)
call SetUnitFlyHeightBJ( caster, SquareRoot( 6000 * ((2*wende) - iter) ), 10000 )
endif
set loc = PolarProjectionBJ(GetUnitLoc(caster), tempo, winkel )
call SetUnitPositionLoc( caster, loc )
if ( iter == 2*wende ) then
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call SetUnitPathing( caster, true )
call PauseTimerBJ( true, t )
call FlushHandleLocals(t)
call DestroyTimer(t)
endif
else
call SetUnitFlyHeightBJ( caster, 0, 10000 )
call PauseTimerBJ( true, t )
call FlushHandleLocals(t)
call DestroyTimer(t)
endif
call RemoveLocation(loc)
set loc = null
set t = null
set caster = null
endfunction
function Trig_Rocketjump_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local location loc2 = PolarProjectionBJ(loc, 450.00, ( GetUnitFacing(caster) + 180.00 ))
local integer iter = 0
local real strecke
local integer wende
local real tempo = 10.00
local real winkel
local unit dummy
set dummy = CreateUnitAtLoc( Player(2), 'uabo', loc2, bj_UNIT_FACING )
set loc2 = GetUnitLoc(dummy)
call RemoveUnit(dummy)
set strecke = DistanceBetweenPoints(loc, loc2)
set wende = R2I(strecke / 12)
set winkel = AngleBetweenPoints(loc, loc2)
call UnitAddAbilityBJ( 'Amrf', caster )
call UnitRemoveAbilityBJ( 'Amrf', caster )
call SetUnitPathing( caster, false )
set udg_g_integer[11] = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())
set udg_g_unit[36] = caster
call Trig_Rocketjump_Absprung()
call SetHandleHandle(t, "caster", caster)
call SetHandleInt(t, "iter", iter)
call SetHandleInt(t, "wende", wende)
call SetHandleReal(t, "tempo", tempo)
call SetHandleReal(t, "winkel", winkel)
call SetHandleReal(t, "strecke", strecke)
call TimerStart(t, 0.01, true, function Trig_Rocketjump_Move)
call RemoveLocation(loc)
set loc = null
call RemoveLocation(loc2)
set loc2 = null
set t = null
set caster = null
set dummy = null
endfunction
//===========================================================================
function InitTrig_Rocketjump takes nothing returns nothing
set gg_trg_Rocketjump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rocketjump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rocketjump, Condition( function Trig_Rocketjump_Conditions ) )
call TriggerAddAction( gg_trg_Rocketjump, function Trig_Rocketjump_Actions )
endfunction