I've been having a hell of a time making an AoE Stun ability.
Here's the ability as designed:
Horrify
Stuns units in an AoE for a short amount of time.
Lv 1: 300 AoE 1.5 Sec
Lv 2: 300 AoE 2 Sec
Lv 3: 350 AoE 2.5 Sec
Lv 4: 350 AoE 3 Sec
Lv 5: 400 AoE 4 Sec
I originally made an ability (I think I made it off Tornado Stun, but I really can't remember any more, been a long time)and gave it AoE under the Stats- Area of Effect line. That didn't work.
Then I made a dummy unit and have that cast different abilities based on what level of Horrify the casting unit has. Didn't work.
I then remade the dummy abilities and based those off of Storm Bolt. No dice.
I really just dunno wtf I'm doing with it at this point. Any help would be greatly appreciated.
The current JASS code is as follows:
I made the JASS code by coding it in GUI then converting to custom text, then replacing the IssueTargetOrder with the code of the ability.
Here's the GUI backup of what I converted.
The Human Peasant - Repair was changed to the custom code of the Horrify Dummy abilities.
Thanks again for any help!
Here's the ability as designed:
Horrify
Stuns units in an AoE for a short amount of time.
Lv 1: 300 AoE 1.5 Sec
Lv 2: 300 AoE 2 Sec
Lv 3: 350 AoE 2.5 Sec
Lv 4: 350 AoE 3 Sec
Lv 5: 400 AoE 4 Sec
I originally made an ability (I think I made it off Tornado Stun, but I really can't remember any more, been a long time)and gave it AoE under the Stats- Area of Effect line. That didn't work.
Then I made a dummy unit and have that cast different abilities based on what level of Horrify the casting unit has. Didn't work.
I then remade the dummy abilities and based those off of Storm Bolt. No dice.
I really just dunno wtf I'm doing with it at this point. Any help would be greatly appreciated.
The current JASS code is as follows:
JASS:
function Trig_AoE_Horrify_Lv_5_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A025039; ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped(039;A025039;, GetTriggerUnit()) == 5 ) ) then
return false
endif
return true
endfunction
function Trig_AoE_Horrify_Lv_5_Func006A takes nothing returns nothing
call IssueTargetOrderBJ( udg_Horrify_Dummy_Unit, "A053", GetEnumUnit() )
endfunction
function Trig_AoE_Horrify_Lv_5_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 039;n01D039;, Player(11), GetUnitLoc(GetSpellTargetUnit()), bj_UNIT_FACING )
set udg_Horrify_Dummy_Unit = GetLastCreatedUnit()
call UnitAddAbilityBJ( 039;A053039;, udg_Horrify_Dummy_Unit )
set udg_Horrify_Point = GetUnitLoc(GetSpellTargetUnit())
set udg_Horrify_Group = GetUnitsInRangeOfLocAll(400.00, udg_Horrify_Point)
call ForGroupBJ( udg_Horrify_Group, function Trig_AoE_Horrify_Lv_5_Func006A )
call RemoveUnit( udg_Horrify_Dummy_Unit )
call DestroyGroup(udg_Horrify_Group)
call RemoveLocation(udg_Horrify_Point)
endfunction
//===========================================================================
function InitTrig_AoE_Horrify_Lv_5 takes nothing returns nothing
set gg_trg_AoE_Horrify_Lv_5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AoE_Horrify_Lv_5, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_AoE_Horrify_Lv_5, Condition( function Trig_AoE_Horrify_Lv_5_Conditions ) )
call TriggerAddAction( gg_trg_AoE_Horrify_Lv_5, function Trig_AoE_Horrify_Lv_5_Actions )
endfunction
I made the JASS code by coding it in GUI then converting to custom text, then replacing the IssueTargetOrder with the code of the ability.
Here's the GUI backup of what I converted.
Trigger:
- AoE Horrify Lv 1 GUI Backup
- Events
- Unit - A unit Begins casting an ability
- Conditions
- (Ability being cast) Equal to Horrify
- (Level of Horrify for (Triggering unit)) Equal to 1
- Actions
- Unit - Create 1 DummyUnit (Custom Campaign) for Player 12 (Brown) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
- Set Horrify_Dummy_Unit = (Last created unit)
- Unit - Add Horrify (Dummy Lv 1) to Horrify_Dummy_Unit
- Set Horrify_Point = (Position of (Target unit of ability being cast))
- Set Horrify_Group = (Units within 300.00 of Horrify_Point)
- Unit Group - Pick every unit in Horrify_Group and do (Actions)
- Loop - Actions
- Unit - Order Horrify_Dummy_Unit to Human Peasant - Repair (Picked unit)
- Loop - Actions
- Unit - Remove Horrify_Dummy_Unit from the game
- Custom script: call DestroyGroup(udg_Horrify_Group)
- Custom script: call RemoveLocation(udg_Horrify_Point)
- Events
The Human Peasant - Repair was changed to the custom code of the Horrify Dummy abilities.
Thanks again for any help!