Name | Type | is_array | initial_value |
Barracks | unit | Yes | |
COPName | rect | Yes | |
FirstPlayer | integer | No | |
Gold_received | integer | Yes | |
leaderbord_name | string | Yes | |
num_regions | integer | Yes | |
TeamNumber | integer | Yes | |
TempVariable | integer | No | |
Towers | unit | Yes | |
Turn | timer | No | |
xdeturn | integer | No |
//****************************************************************************
//* *
//* Human Airstrike *
//* *
//* By Blade.dk *
//* *
//* Implementation: Copy the Airstriker unit, the Airport unit, the *
//* Airstrike ability and this trigger to your map and change the three *
//* rawcodes in the configuration section below (see the Rawcode Info *
//* comment if you don't know what rawcodes are). *
//* You can also change the other values in the configuration section if you *
//* want. * *
//* *
//* IF YOU USE OR EDIT THIS SPELL YOU MUST GIVE CREDIT TO ME - BLADE.DK *
//* *
//****************************************************************************
//============================================================================
//Human Airstrike spell configuration
//The explosion art is the Airtrike spell's first target art, the warning
//symbol's art is the Airstrike spell's second target art.
function GetAirstrikeAbilityRawcode takes nothing returns integer
return 'h00A' // Change this to match the rawcode of the Airstrike spell in your map.
endfunction
function GetAirstrikeDummyRawcode takes nothing returns integer
return 'h00A' // Change this to match the rawcode of the Airstriker unit in your map.
endfunction
function GetAirstrikeCasterRawcode takes nothing returns integer
return 'n000' // Change this to match the rawcode of the Airport building in your map.
endfunction
function GetAirstrikeDamage takes nothing returns real
return 500.00 // Change this to how much damage you want the explosions to deal.
endfunction
function GetAirstrikeDestructableDamage takes nothing returns real
return 500.00 // Change this to how much damage you want the explosions to deal to destructibles. Set this to 0.00 if you don't want it to hit destructibles.
endfunction
function GetAirstrikeExpands takes nothing returns integer
return 1 // Change this to how many rings of special effect there shall be. The first explosion effect doesn't count, so if you only want that set this to 0.
endfunction
function GetAirstrikeArea takes nothing returns real
return 135.00 // Change this to the area you want each single effect to affect. The full area will be the area + ((area*2)*expands).
endfunction
//============================================================================
//This is the spell itself. Don't change it.
function AirstrikeDamageFunction takes nothing returns nothing
call UnitDamageTargetBJ( GetOrderedUnit(), GetEnumUnit(), GetAirstrikeDamage(), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function AirstrikeDamageDestructables takes nothing returns nothing
call SetDestructableLife( GetEnumDestructable(), ( GetDestructableLife(GetEnumDestructable()) - GetAirstrikeDestructableDamage() ) )
endfunction
function GetAirstrikeFullArea takes nothing returns real
local real r
set r = (GetAirstrikeArea() + ((GetAirstrikeArea()*2)*I2R(GetAirstrikeExpands())))
return r
endfunction
function AirstrikeConditions takes nothing returns boolean
if ( not GetBooleanAnd( GetIssuedOrderIdBJ() == String2OrderIdBJ("neutraldetectaoe"), GetUnitTypeId(GetOrderedUnit()) == GetAirstrikeCasterRawcode() ) ) then
return false
endif
return true
endfunction
function AirstrikeActions takes nothing returns nothing
local effect e
local location t
local location s
local unit d
local integer a = 1
local integer b
local integer m = R2I(( (GetAirstrikeFullArea() - GetAirstrikeArea()) / (GetAirstrikeArea()*2)))
local real r = 1.00
set t = GetOrderPointLoc()
set s = GetUnitLoc( GetOrderedUnit() )
if ( RectContainsLoc(GetPlayableMapRect(), t) == true ) then
call DoNothing()
else
loop
exitwhen ( RectContainsLoc(GetPlayableMapRect(), t) == true )
set t = PolarProjectionBJ(s, ( DistanceBetweenPoints(s, t) - 1.00 ), AngleBetweenPoints(s, t))
endloop
endif
call AddSpecialEffectLocBJ( t, GetAbilityEffectBJ( GetAirstrikeAbilityRawcode(), EFFECT_TYPE_TARGET, 1))
set e = GetLastCreatedEffectBJ()
call CreateNUnitsAtLocFacingLocBJ( 1, GetAirstrikeDummyRawcode(), Player(15), s, t )
set d = GetLastCreatedUnit()
call SetUnitPathing( d, false )
call IssuePointOrderLocBJ( d, "attackground", t )
call SetUnitFlyHeightBJ( d, 420.00, 450.00 )
loop
exitwhen ( DistanceBetweenPoints(GetUnitLoc(d), t) <= 50 )
call PolledWait(0.1)
call IssuePointOrderLocBJ( d, "attackground", t )
endloop
call PolledWait( 0.23 )
call IssuePointOrderLocBJ( d, "move", s )
call PolledWait( 0.22 )
call ForGroupBJ( GetUnitsInRangeOfLocAll(GetAirstrikeFullArea(), t), function AirstrikeDamageFunction )
call EnumDestructablesInCircleBJ( GetAirstrikeFullArea(), t, function AirstrikeDamageDestructables )
call DestroyEffectBJ( AddSpecialEffectLocBJ( t, GetAbilityEffectBJ( GetAirstrikeAbilityRawcode(), EFFECT_TYPE_TARGET, 0) ) )
call DestroyEffectBJ(e)
if ( m >= 1) then
loop
exitwhen a > m
set r = ( ((GetAirstrikeArea() + ((GetAirstrikeArea()*2.00)*m))*bj_PI)/GetAirstrikeArea() )
set b = 1
loop
exitwhen b > R2I(r)
call DestroyEffectBJ( AddSpecialEffectLocBJ( PolarProjectionBJ(t, ((GetAirstrikeArea()*2)*a), ((360/r)*b)), GetAbilityEffectBJ( GetAirstrikeAbilityRawcode(), EFFECT_TYPE_TARGET, 0) ) )
set b = b + 1
endloop
set a = a + 1
endloop
else
call DoNothing()
endif
loop
exitwhen ( DistanceBetweenPoints(GetUnitLoc(d), s) <= 300 )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.1))
endloop
call SetUnitFlyHeightBJ( d, 50.00, 450.00 )
loop
exitwhen ( DistanceBetweenPoints(GetUnitLoc(d), s) <= 50 )
call PolledWait(0.1)
call IssuePointOrderLocBJ( d, "move", s )
endloop
call RemoveUnit( d )
call RemoveLocation(s)
call RemoveLocation(t)
endfunction
//============================================================================
function InitTrig_Human_Airstrike takes nothing returns nothing
set gg_trg_Human_Airstrike = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Human_Airstrike, Player(15), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_Human_Airstrike, Condition( function AirstrikeConditions ) )
call TriggerAddAction( gg_trg_Human_Airstrike, function AirstrikeActions )
endfunction