• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Snippet] AutoFly

I thought Azlier had posted his script here, but I guess not (I know Nestharus had a version at one point).

This basically removes the overhead of adding crow form to units before applying a custom fly-height.

Requires UnitDex.

JASS:
library AutoFly initializer onInit requires UnitDex
/***************************************************************
*
*   v1.0, by TriggerHappy
*   ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
*   AutoFly adds & removes crow of upon any unit entering the map. This
*   allows modifying of the units height without having to do it manually.
*
*   Credits go to azlier for the orginal idea.
*
****************************************************************/

    globals
        private constant integer CROW_FORM = 'Amrf'
    endglobals
    
    private function AddFly takes nothing returns boolean
        return UnitAddAbility(GetIndexedUnit(), CROW_FORM) and UnitRemoveAbility(GetIndexedUnit(), CROW_FORM)
    endfunction
    
    private function onInit takes nothing returns nothing
        call RegisterUnitIndexEvent(Filter(function AddFly), EVENT_UNIT_INDEX)
    endfunction

endlibrary
 
Last edited:
Top