I know i'm double posting but this is what i've found to be the JASS script for the ability. Hopefully comeone can decipher it enough for me to understand how it worked.
BTW there seems to be a trigger used to restore the gatling gun so thats also in the scripts too.
//===========================================================================
// Trigger: Gattling Cannon
//
// New Skill for the tinker, very cool.
//===========================================================================
function Trig_Gattling_Cannon_Conditions takes nothing returns boolean
if ( not ( GetLearnedSkillBJ() == 'A0E8' ) ) then
return false
endif
if InstanceGetMemberUnit("x","g")!=null then
call SetPlayerTechResearchedSwap( 'R00G', GetUnitAbilityLevelSwapped('A0E8', GetLearningUnit())-1, GetOwningPlayer(GetLearningUnit()) )
return false
endif
return true
endfunction
function GattlingCannon takes nothing returns nothing
local unit caster=InstanceGetMemberUnit("x","c")
call SetUnitX(InstanceGetMemberUnit("x","g"), GetUnitX(caster)+6*CosBJ(GetUnitFacing(caster)+180))
call SetUnitY(InstanceGetMemberUnit("x","g"),GetUnitY(caster)+6*SinBJ(GetUnitFacing(caster)+180))
set caster=null
endfunction
function GattlingControl takes nothing returns nothing
local unit g=InstanceGetMemberUnit("x","g")
if (GetTriggerEventId()==EVENT_UNIT_DEATH) then
call ShowUnitHide( g)
call UnitAddTypeBJ( UNIT_TYPE_PEON, g )
call IssueImmediateOrderBJ(g, "stop" )
else
call ShowUnitShow( g )
call UnitRemoveAbility(g, 'Aloc')
call UnitAddAbility(g,'Aloc')
call IssueImmediateOrderBJ(g, "holdposition" )
call UnitRemoveTypeBJ( UNIT_TYPE_PEON, g )
call RemoveGuardPosition( g )
endif
set g=null
endfunction
function GattlingRefresh takes nothing returns nothing
call IssueImmediateOrderBJ(InstanceGetMemberUnit("x","g"), "holdposition" )
call RemoveGuardPosition( InstanceGetMemberUnit("x","g") )
call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_UPDATED, "Refreshing Gattling Cannon" )
endfunction
function Trig_Gattling_Cannon_Actions takes nothing returns nothing
local timer t=CreateTimer()
local unit gun
local trigger tr=CreateTrigger()
local trigger r=CreateTrigger()
set gun=CreateUnit( GetOwningPlayer(GetTriggerUnit()), 'e00G', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0 )
call InstanceSetMemberUnit("x", "g", gun)
call IssueImmediateOrderBJ(gun, "holdposition" )
call RemoveGuardPosition( gun )
call InstanceSetMemberUnit("x","c", GetTriggerUnit())
call UnitAddAbilityBJ( 'AEme', gun)
call UnitRemoveAbilityBJ( 'AEme', gun)
call SetUnitFlyHeight( gun, 64 , 10000.00 )
call TimerStart(t, 0.025, true, function GattlingCannon)
call TriggerRegisterUnitEvent( tr, GetTriggerUnit(), EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( tr, GetTriggerUnit(), EVENT_UNIT_HERO_REVIVE_FINISH )
call TriggerAddAction(tr,function GattlingControl)
call TriggerAddAction(r,function GattlingRefresh)
call TriggerRegisterPlayerChatEvent( r, GetOwningPlayer(GetTriggerUnit()), "-holdgun", true )
set gun=null
set r=null
set t=null
set tr=null
endfunction
//===========================================================================
function InitTrig_Gattling_Cannon takes nothing returns nothing
set gg_trg_Gattling_Cannon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Gattling_Cannon, EVENT_PLAYER_HERO_SKILL )
call TriggerAddCondition( gg_trg_Gattling_Cannon, Condition( function Trig_Gattling_Cannon_Conditions ) )
call TriggerAddAction( gg_trg_Gattling_Cannon, function Trig_Gattling_Cannon_Actions )
endfunction
that's all of it, maybe someone can tell me if this can be done via triggers, or simply how it was done. Now that i look at the triggering, it seems that a peon type unit was used. Perhaps the gun doesn't actualy attack, but rather simply faces a random target that is setup and attacks that target until the target dies or until it moves out of range. I suppose you could simply make a trigger to spawn a unit at the same spot as the gatling gun and order that you to attack once the random designated unit and continue so until triggers found the unit was out of range. Still, the gun seemed to attack based on priority.
[edit] Perhaps someone might just explain what this triggers is doing (and telling me when they used an unknown ability and such.