Exide
I am amazingly focused right now!
- Reaction score
- 448
I decided to make a little spell, called Air Strike.
I haven't seen anyone like this before, and I hope there are none (there probably are, though..)
Anyways.. It's a tiny spell which calls for an air strike.
GUI - Yes.
MUI - Maybe.
Leakless - Sort of.
Fun - Yup! :thup:
Overkill - Hell yes.
First of all the important stuff, namely screenshots!
Secondly, the -not so important- stuff, namely the faulty triggers:
Special Effect Destruction:
Thirdly, the map - attached! :thup:
EDIT: Added a newer version of the map, with JASS triggers.
I haven't seen anyone like this before, and I hope there are none (there probably are, though..)
Anyways.. It's a tiny spell which calls for an air strike.
GUI - Yes.
MUI - Maybe.
Leakless - Sort of.
Fun - Yup! :thup:
Overkill - Hell yes.
First of all the important stuff, namely screenshots!
Secondly, the -not so important- stuff, namely the faulty triggers:
Code:
Call Air Strike
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Air Strike
Actions
If ((Level of Air Strike for Hero) Equal to 1) then do (Set NumberOfStrikes = 4) else do (Do nothing)
If ((Level of Air Strike for Hero) Equal to 2) then do (Set NumberOfStrikes = 6) else do (Do nothing)
If ((Level of Air Strike for Hero) Equal to 3) then do (Set NumberOfStrikes = 8) else do (Do nothing)
If ((Level of Air Strike for Hero) Equal to 1) then do (Set StrikeDamage = 100.00) else do (Do nothing)
If ((Level of Air Strike for Hero) Equal to 2) then do (Set StrikeDamage = 125.00) else do (Do nothing)
If ((Level of Air Strike for Hero) Equal to 3) then do (Set StrikeDamage = 150.00) else do (Do nothing)
Set AirStrikeLoc = (Target point of ability being cast)
Set JetFighterSpawn = (AirStrikeLoc offset by 2500.00 towards (Random angle) degrees)
Set JFLeaveLoc = (AirStrikeLoc offset by 2500.00 towards (Angle from JetFighterSpawn to AirStrikeLoc) degrees)
Unit - Create 1 Jet Fighter for (Owner of (Triggering unit)) at JetFighterSpawn facing 270.00 degrees
Set JetFighter = (Last created unit)
Unit - Add a 10.00 second Generic expiration timer to JetFighter
Unit - Order JetFighter to Move To AirStrikeLoc
Trigger - Turn on AS Check Distance <gen>
Code:
AS Check Distance
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Set JetFighterLoc = (Position of JetFighter)
Wait until ((Distance between AirStrikeLoc and JetFighterLoc) Less than or equal to 420.00), checking every 0.10 seconds
Unit - Order JetFighter to Move To JFLeaveLoc
Custom script: call RemoveLocation(udg_JetFighterSpawn)
Custom script: call RemoveLocation(udg_JetFighterLoc)
Wait 0.25 game-time seconds
For each (Integer A) from 1 to NumberOfStrikes, do (Actions)
Loop - Actions
Set specloc = (AirStrikeLoc offset by (Random real number between 1.00 and 350.00) towards (Random angle) degrees)
Special Effect - Create a special effect at specloc using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
Set SpecialFX = (Last created special effect)
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
Unit - Cause JetFighter to damage circular area after 0.00 seconds of radius 125.00 at specloc, dealing StrikeDamage damage of attack type Chaos and damage type Fire
Custom script: call RemoveLocation(udg_specloc)
Wait 0.20 game-time seconds
Trigger - Turn off (This trigger)
Custom script: call RemoveLocation(udg_AirStrikeLoc)
Code:
Call Air Strike MUI
Events
Unit - A unit Begins channeling an ability
Conditions
(Ability being cast) Equal to Air Strike
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Counter Less than or equal to 99
Then - Actions
Set Counter = (Counter + 1)
Else - Actions
Set Counter = 1
If ((Level of Air Strike for (Triggering unit)) Equal to 1) then do (Set NOS[Counter] = 4) else do (Do nothing)
If ((Level of Air Strike for (Triggering unit)) Equal to 2) then do (Set NOS[Counter] = 6) else do (Do nothing)
If ((Level of Air Strike for (Triggering unit)) Equal to 3) then do (Set NOS[Counter] = 8) else do (Do nothing)
If ((Level of Air Strike for (Triggering unit)) Equal to 1) then do (Set SD[Counter] = 100.00) else do (Do nothing)
If ((Level of Air Strike for (Triggering unit)) Equal to 2) then do (Set SD[Counter] = 125.00) else do (Do nothing)
If ((Level of Air Strike for (Triggering unit)) Equal to 3) then do (Set SD[Counter] = 150.00) else do (Do nothing)
Set ASL[Counter] = (Target point of ability being cast)
Set JFS[Counter] = (ASL[Counter] offset by 2500.00 towards (Random angle) degrees)
Set JFLL[Counter] = (ASL[Counter] offset by 2500.00 towards (Angle from JFS[Counter] to ASL[Counter]) degrees)
Unit - Create 1 Jet Fighter for (Owner of (Triggering unit)) at JFS[Counter] facing 270.00 degrees
Set JF[Counter] = (Last created unit)
Unit - Change color of JF[Counter] to (Color of Neutral Hostile)
Unit - Add a 10.00 second Generic expiration timer to JF[Counter]
Unit - Order JF[Counter] to Move To ASL[Counter]
Unit - Set the custom value of JF[Counter] to Counter
Unit Group - Add JF[Counter] to TempGroup
Code:
AS Check Distance MUI
Events
Time - Every 0.50 seconds of game time
Conditions
(Number of units in TempGroup) Greater than 0
Actions
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempInt = (Custom value of (Picked unit))
Set JFL[TempInt] = (Position of JF[TempInt])
Wait until ((Distance between ASL[TempInt] and JFL[TempInt]) Less than or equal to 420.00), checking every 0.10 seconds
Unit - Order JF[TempInt] to Move To JFLL[TempInt]
Custom script: call RemoveLocation(udg_JFS[udg_TempInt])
Custom script: call RemoveLocation(udg_JFL[udg_TempInt])
Custom script: call RemoveLocation(udg_JFLL[udg_TempInt])
For each (Integer A) from 1 to NOS[TempInt], do (Actions)
Loop - Actions
Set sl[TempInt] = (ASL[TempInt] offset by (Random real number between 1.00 and 350.00) towards (Random angle) degrees)
Special Effect - Create a special effect at sl[TempInt] using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
Set SpecialFX = (Last created special effect)
Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
Unit - Cause JF[TempInt] to damage circular area after 0.00 seconds of radius 125.00 at sl[TempInt], dealing SD[TempInt] damage of attack type Chaos and damage type Fire
Custom script: call RemoveLocation(udg_sl[udg_TempInt])
Custom script: call RemoveLocation(udg_ASL[udg_TempInt])
JASS:
function Trig_Call_Air_Strike_MUI_JASS_Conditions takes nothing returns boolean
return ( ( GetSpellAbilityId() == 039;A000039; ) )
endfunction
function Trig_Call_Air_Strike_MUI_JASS_Actions takes nothing returns nothing
if ( udg_Counter <= 99 ) then
set udg_Counter = ( udg_Counter + 1 )
else
set udg_Counter = 1
endif
set udg_NOS[udg_Counter] = ( 2 + GetUnitAbilityLevelSwapped(039;A000039;, GetTriggerUnit()) )
set udg_SD[udg_Counter] = ( 75.00 + ( 25.00 * I2R(GetUnitAbilityLevelSwapped(039;A000039;, GetTriggerUnit())) ) )
set udg_ASL[udg_Counter] = GetSpellTargetLoc()
set udg_JFS[udg_Counter] = PolarProjectionBJ(udg_ASL[udg_Counter], 2500.00, GetRandomDirectionDeg())
set udg_JFLL[udg_Counter] = PolarProjectionBJ(udg_ASL[udg_Counter], 2500.00, AngleBetweenPoints(udg_JFS[udg_Counter], udg_ASL[udg_Counter]))
call CreateNUnitsAtLoc( 1, 039;h001039;, GetOwningPlayer(GetTriggerUnit()), udg_JFS[udg_Counter], 270.00 )
set udg_JetFighter = GetLastCreatedUnit()
call SetUnitColor( udg_JetFighter, GetPlayerColor(Player(PLAYER_NEUTRAL_AGGRESSIVE)) )
call UnitApplyTimedLife( udg_JetFighter, 039;BTLF039;, 10.00 )
call IssuePointOrderLoc( udg_JetFighter, "move", udg_ASL[udg_Counter] )
call SetUnitUserData( udg_JetFighter, udg_Counter )
call GroupAddUnitSimple( udg_JetFighter, udg_TempGroup )
endfunction
//===========================================================================
function InitTrig_Call_Air_Strike_MUI_JASS takes nothing returns nothing
local trigger gg_trg_Call_Air_Strike_MUI_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Call_Air_Strike_MUI_JASS, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Call_Air_Strike_MUI_JASS, Condition( function Trig_Call_Air_Strike_MUI_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Call_Air_Strike_MUI_JASS, function Trig_Call_Air_Strike_MUI_JASS_Actions )
endfunction
JASS:
function Trig_AS_Check_Distance_MUI_JASS_Conditions takes nothing returns boolean
return ( ( CountUnitsInGroup(udg_TempGroup) > 0 ) )
endfunction
function Trig_AS_Check_Distance_MUI_JASS_Func001Func003001 takes nothing returns boolean
return ( DistanceBetweenPoints(udg_ASL[udg_TempInt], udg_JFL[udg_TempInt]) <= 420.00 )
endfunction
function GroupFunction takes nothing returns nothing
local integer loopnr = 0
set udg_TempInt = GetUnitUserData(GetEnumUnit())
set udg_JFL[udg_TempInt] = GetUnitLoc(GetEnumUnit())
loop
exitwhen ( Trig_AS_Check_Distance_MUI_JASS_Func001Func003001() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10))
endloop
call IssuePointOrderLoc( GetEnumUnit(), "move", udg_JFLL[udg_TempInt] )
call RemoveLocation(udg_JFS[udg_TempInt])
call RemoveLocation(udg_JFL[udg_TempInt])
call RemoveLocation(udg_JFLL[udg_TempInt])
loop
exitwhen loopnr > udg_NOS[udg_TempInt]
set udg_sl[udg_TempInt] = PolarProjectionBJ(udg_ASL[udg_TempInt], GetRandomReal(1.00, 350.00), GetRandomDirectionDeg())
set udg_SpecialFX = AddSpecialEffectLoc( "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl", udg_sl[udg_TempInt] )
call TriggerExecute( gg_trg_Special_Effect_Destruction )
call UnitDamagePointLoc( GetEnumUnit(), 0.50, 125.00, udg_sl[udg_TempInt], udg_SD[udg_TempInt], ATTACK_TYPE_CHAOS, DAMAGE_TYPE_FIRE )
call RemoveLocation(udg_sl[udg_TempInt])
set loopnr = loopnr + 1
endloop
call RemoveLocation(udg_ASL[udg_TempInt])
endfunction
function Trig_AS_Check_Distance_MUI_JASS_Actions takes nothing returns nothing
call ForGroupBJ( udg_TempGroup, function GroupFunction )
endfunction
//===========================================================================
function InitTrig_AS_Check_Distance_MUI_JASS takes nothing returns nothing
local trigger gg_trg_AS_Check_Distance_MUI_JASS = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_AS_Check_Distance_MUI_JASS, 0.50 )
call TriggerAddCondition( gg_trg_AS_Check_Distance_MUI_JASS, Condition( function Trig_AS_Check_Distance_MUI_JASS_Conditions ) )
call TriggerAddAction( gg_trg_AS_Check_Distance_MUI_JASS, function Trig_AS_Check_Distance_MUI_JASS_Actions )
endfunction
Special Effect Destruction:
JASS:
function Trig_Special_Effect_Destruction_Actions takes nothing returns nothing
local effect tempEffect
set tempEffect = udg_SpecialFX
call PolledWait( 5.00 )
set udg_SpecialFX = tempEffect
call DestroyEffect( udg_SpecialFX )
endfunction
//===========================================================================
function InitTrig_Special_Effect_Destruction takes nothing returns nothing
local trigger gg_trg_Special_Effect_Destruction = CreateTrigger( )
call DisableTrigger( gg_trg_Special_Effect_Destruction )
call TriggerAddAction( gg_trg_Special_Effect_Destruction, function Trig_Special_Effect_Destruction_Actions )
endfunction
Thirdly, the map - attached! :thup:
EDIT: Added a newer version of the map, with JASS triggers.