1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Enfo FFB - v2.06.w3x
Variables
Libraries
MapMetaData
UnitInRect
FearSystem
ProgressBars v2 1
TimedLightning
RegisterNativeEvent
RegisterUnitEvent
SpellEffectEvent
Restored Triggers
Restored Triggers
TimerUtils
Disabled Triggers
Autopool Off
Autopool
TerrainPathability
Untitled Trigger 001
Well Of Sorrow
HurlBoulder
Unit Cleanup
Pred Ulti Cleave Checker
Old Decay
IsUnitInGroup
Test Trigger
General Functions
Tree AI
Flag Leaver
Protect Items
Hero Dummies
Region Kill
Starting Income
Income
Spawning Trigger
Autopool Waffle
Pick Aether Construct
Display Aether Stacks
Item Set
Item Set Tranquility
Summon Courier
SetPathing
UnitCleanup
ShopSystem
RegisterPlayerUnitEvent
Shopsystem
ExampleTrigger
Spells
Pick Up Items Terror
CrucibleHeal
Decay
ArcaneDrain
LuckyShot
Soldiers of Fortune
Soldiers of Fortune GoldCheck
PaladinHeal
Bloodbath
Lightningbolt
Happy Hour
Recklessness Taunt
Draw A Bead
Paladin Taunt
Eternal BattlethirstPassive
Eternal Battlethirst Active
Sanctified Armor
Reckless Greed
Faustian Bargain
Apple of Eden
Sinister Creed
Voracity
Rains Of Castamere
Aether Infusion
Aether Flare
Aethereal Mastery
Aethereal Mastery Active
Discharge Aether
Aether Core
Prides Downfall
Fear Item
Glythides
Venom
TemperancePAS
GluttonyPAS
TemperanceACT
GluttyACT
Execute
Ragnaros
Ragnarok
Losing Item Ragnas
Losing Item Ragnarok
Thief Collision
Pacify
SinisterJar
DesolationFear
AoEFearSpell
Wild Haunt
AoE DoT
FearGuyUlti
FearStacks
FearUlti4Illusion
NissaBinding
Eternitys End
NinjaRope
FlyingEvasion
Indulgence
IndulgenceActive
Wrath
For the Cause
Forest Call
Mana Disruption
Pierce The Veil
Shattered Veil On Summon
Shattered Veil On Kill
Skaar Ulti V2

//TESH.scrollpos=0
//TESH.alwaysfold=0
Name Type Is Array Initial Value
//TESH.scrollpos=48
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: v1.00
/// Last Modified: April 24, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which replay parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: people
/// who leave while end-game stats are being shown)
///////////////////////////////////////////////////////////////
/// Interface:
///   void FlagPlayer(player, flag_constant)
///   void DefineValue(name, type_constant, goal_constant, suggest_constant)
///   void UpdateValueInt(name, player, operation_constant, value)
///   void UpdateValueReal(name, player, operation_constant, value)
///   void UpdateValueString(name, player, value)
///   void DefineEvent0(name, format)
///   void DefineEvent1(name, format, argName1)
///   void DefineEvent2(name, format, argName1, argName2)
///   void DefineEvent3(name, format, argName1, argName2, argName3)
///   void LogEvent0(name)
///   void LogEvent1(name, arg0)
///   void LogEvent2(name, arg0, arg1)
///   void LogEvent3(name, arg0, arg1, arg2)
///   void LogCustom(unique_identifier, data)
///   void RaiseGuard(reason)
///////////////////////////////////////////////////////////////
/// Notes:
/// - Errors are displayed using BJDebugMsg
/// - Don't try to update a value before defining it
/// - Parsers expect a very specific format, don't screw with the library's output.
/// - If you emit a bunch of data per second, you will cause bandwidth problems for dial-up users. Try to avoid
/// emitting lots of data all at once except at the start and end of games or rounds.
/// - An event's format string uses {#} to represent arguments
/// - Calling RaiseGuard will increase the number of senders for each message from 1 to 3. This increases
/// security but uses more network bandwidth. It is done automatically if tampering is detected.
///////////////////////////////////////////////////////////////
library MMD initializer init
    globals
        public constant integer GOAL_NONE = 101
        public constant integer GOAL_HIGH = 102
        public constant integer GOAL_LOW = 103
       
        public constant integer TYPE_STRING = 101
        public constant integer TYPE_REAL = 102
        public constant integer TYPE_INT = 103

        public constant integer OP_ADD = 101
        public constant integer OP_SUB = 102
        public constant integer OP_SET = 103

        public constant integer SUGGEST_NONE = 101
        public constant integer SUGGEST_TRACK = 102
        public constant integer SUGGEST_LEADERBOARD = 103

        public constant integer FLAG_DRAWER = 101
        public constant integer FLAG_LOSER = 102
        public constant integer FLAG_WINNER = 103
        public constant integer FLAG_LEAVER = 104
        public constant integer FLAG_PRACTICING = 105
    endglobals

    ///////////////////////////////////////////////////////////////
    /// Private variables and constants
    ///////////////////////////////////////////////////////////////
    globals
        private constant boolean SHOW_DEBUG_MESSAGES = true
       
        private constant string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+= \\!@#$%^&*()/?>.<,;:'\"{}[]|`~"
        private constant integer num_chars = StringLength(chars)
        private string array flags
        private string array goals
        private string array ops
        private string array types
        private string array suggestions
        private boolean initialized = false
               
        private gamecache gc = null
        private constant string ESCAPED_CHARS = " \\"
       
        private constant integer CURRENT_VERSION = 1
        private constant integer MINIMUM_PARSER_VERSION = 1
        private constant string FILENAME = "MMD.Dat"
        private constant string M_KEY_VAL = "val:"
        private constant string M_KEY_CHK = "chk:"
        private constant integer NUM_SENDERS_NAIVE = 1
        private constant integer NUM_SENDERS_SAFE = 3
        private integer num_senders = NUM_SENDERS_NAIVE
        private integer num_msg = 0        
       
        private timer clock = CreateTimer()
        private string array q_msg
        private real array q_time
        private integer array q_index
        private keyword QueueNode
        private QueueNode q_head = 0
        private QueueNode q_tail = 0
    endglobals
   
    ///////////////////////////////////////////////////////////////
    /// Private functions
    ///////////////////////////////////////////////////////////////
   
    ///Triggered when tampering is detected. Increases the number of safeguards against tampering.
    public function RaiseGuard takes string reason returns nothing
        debug if SHOW_DEBUG_MESSAGES then
        debug     call BJDebugMsg("MMD: Guard Raised! (" + reason + ")")
        debug endif
        set num_senders = NUM_SENDERS_SAFE //increase number of players voting on each message
    endfunction

    ///Returns seconds elapsed in game time
    private function time takes nothing returns real
        return TimerGetElapsed(clock)
    endfunction
   
    ///Initializes the char-to-int conversion
    private function prepC2I takes nothing returns nothing
        local integer i = 0
        local string id
        loop
            exitwhen i >= num_chars
            set id = SubString(chars, i, i+1)
            if id == StringCase(id, true) then
                set id = id + "U"
            endif
            call StoreInteger(gc, "c2i", id, i)
            set i = i + 1
        endloop
    endfunction
    ///Converts a character to an integer
    private function C2I takes string c returns integer
        local integer i
        local string id = c
        if id == StringCase(id, true) then
            set id = id + "U"
        endif
        set i = GetStoredInteger(gc, "c2i", id)
        if (i < 0 or i >= num_chars or SubString(chars, i, i+1) != c) and HaveStoredInteger(gc, "c2i", id) then
            //A cheater sent a fake sync to screw with the cached values
            set i = 0
            loop
                exitwhen i >= num_chars //just a weird character
                if c == SubString(chars, i, i+1) then //cheating!
                    call RaiseGuard("c2i poisoned")
                    call StoreInteger(gc, "c2i", id, i)
                    exitwhen true
                endif
                set i = i + 1
            endloop
        endif
        return i
    endfunction

    ///Computes a weak hash value, hopefully secure enough for our purposes
    private function poor_hash takes string s, integer seed returns integer
        local integer n = StringLength(s)
        local integer m = n + seed
        local integer i = 0
        loop
            exitwhen i >= n
            set m = m * 41 + C2I(SubString(s, i, i+1))
            set i = i + 1
        endloop
        return m
    endfunction

    ///Stores previously sent messages for tamper detection purposes
    private struct QueueNode
        readonly real timeout
        readonly string msg
        readonly integer checksum
        readonly string key
        public QueueNode next = 0
        public static method create takes integer id, string msg returns QueueNode
            local QueueNode this = QueueNode.allocate()
            set .timeout = time() + 7.0 + GetRandomReal(0, 2+0.1*GetPlayerId(GetLocalPlayer()))
            set .msg = msg
            set .checksum = poor_hash(.msg, id)
            set .key = I2S(id)
            return this
        endmethod
        private method onDestroy takes nothing returns nothing
            call FlushStoredInteger(gc, M_KEY_VAL+.key, .msg)
            call FlushStoredInteger(gc, M_KEY_CHK+.key, .key)
            set .msg = null
            set .key = null
            set .next = 0
        endmethod
        public method send takes nothing returns nothing
            call StoreInteger(gc, M_KEY_VAL+.key, .msg, .checksum)
            call StoreInteger(gc, M_KEY_CHK+.key, .key, .checksum)
            call SyncStoredInteger(gc, M_KEY_VAL+.key, .msg)
            call SyncStoredInteger(gc, M_KEY_CHK+.key, .key)
        endmethod
    endstruct
   
    ///Returns true for a fixed size uniform random subset of players in the game
    private function isEmitter takes nothing returns boolean
        local integer i = 0
        local integer n = 0
        local integer r
        local integer array picks
        local boolean array pick_flags
        loop
            exitwhen i >= 12
            if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                if n < num_senders then //initializing picks
                    set picks[n] = i
                    set pick_flags[i] = true
                else //maintain the invariant 'P(being picked) = c/n'
                    set r = GetRandomInt(0, n)
                    if r < num_senders then
                        set pick_flags[picks[r]] = false
                        set picks[r] = i
                        set pick_flags[i] = true
                    endif
                endif
                set n = n + 1
            endif
            set i = i + 1
        endloop
        return pick_flags[GetPlayerId(GetLocalPlayer())]
    endfunction
   
    ///Places meta-data in the replay and in network traffic
    private function emit takes string message returns nothing
        local QueueNode q
        if not initialized then
            call BJDebugMsg("MMD Emit Error: Library not initialized yet.")
            return
        endif
       
        //remember sent messages for tamper check
        set q = QueueNode.create(num_msg, message)
        if q_head == 0 then
            set q_head = q
        else
            set q_tail.next = q
        endif
        set q_tail = q
               
        //send new message
        set num_msg = num_msg + 1
        if isEmitter() then
            call q.send()
        endif
    endfunction

    ///Performs tamper checks
    private function tick takes nothing returns nothing
        local QueueNode q
        local integer i
       
        //check previously sent messages for tampering
        set q = q_head
        loop
            exitwhen q == 0 or q.timeout >= time()
            if not HaveStoredInteger(gc, M_KEY_VAL+q.key, q.msg) then
                call RaiseGuard("message skipping")
                call q.send()
            elseif not HaveStoredInteger(gc, M_KEY_CHK+q.key, q.key) then
                call RaiseGuard("checksum skipping")
                call q.send()
            elseif GetStoredInteger(gc, M_KEY_VAL+q.key, q.msg) != q.checksum then
                call RaiseGuard("message tampering")
                call q.send()
            elseif GetStoredInteger(gc, M_KEY_CHK+q.key, q.key) != q.checksum then
                call RaiseGuard("checksum tampering")
                call q.send()
            endif
            set q_head = q.next
            call q.destroy()
            set q = q_head
        endloop
        if q_head == 0 then
            set q_tail = 0
        endif
       
        //check for future message tampering
        set i = 0
        loop
            exitwhen not HaveStoredInteger(gc, M_KEY_CHK+I2S(num_msg), I2S(num_msg))
            call RaiseGuard("message insertion")
            call emit("Blank")
            set i = i + 1
            exitwhen i >= 10
        endloop
    endfunction
   
    ///Replaces control characters with escape sequences
    private function pack takes string value returns string
        local integer j
        local integer i = 0
        local string result = ""
        local string c
        loop //for each character in argument string
            exitwhen i >= StringLength(value)
            set c = SubString(value, i, i+1)
            set j = 0
            loop //for each character in escaped chars string
                exitwhen j >= StringLength(ESCAPED_CHARS)
                //escape control characters
                if c == SubString(ESCAPED_CHARS, j, j+1) then
                    set c = "\\" + c
                    exitwhen true
                endif
                set j = j + 1
            endloop
            set result = result + c
            set i = i + 1
        endloop
        return result
    endfunction
   
    ///Updates the value of a defined variable for a given player
    private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
        local integer id = GetPlayerId(p)
        if p == null or id < 0 or id >= 12 then
            call BJDebugMsg("MMD Set Error: Invalid player. Must be P1 to P12.")
        elseif val_type != GetStoredInteger(gc, "types", name) then
            call BJDebugMsg("MMD Set Error: Updated value of undefined variable or used value of incorrect type.")
        elseif StringLength(op) == 0 then
            call BJDebugMsg("MMD Set Error: Unrecognized operation type.")        
        elseif StringLength(name) > 50 then
            call BJDebugMsg("MMD Set Error: Variable name is too long.")
        elseif StringLength(name) == 0 then
            call BJDebugMsg("MMD Set Error: Variable name is empty.")
        else
            call emit("VarP " + I2S(id) + " " + pack(name) + " " + op + " " + value)
        endif
    endfunction

    ///Defines an event's arguments and format
    private function DefineEvent takes string name, integer num_args, string format, string arg_data returns nothing
        if GetStoredInteger(gc, "events", name) != 0 then
            call BJDebugMsg("MMD DefEvent Error: Event redefined.")
        else
            call StoreInteger(gc, "events", name, num_args+1)
            call emit("DefEvent " + pack(name) + " " + I2S(num_args) + " " + arg_data + pack(format))
        endif
    endfunction
   
    ///Places an event in the meta-data
    private function LogEvent takes string name, integer num_args, string data returns nothing
        if GetStoredInteger(gc, "events", name) != num_args+1 then
            call BJDebugMsg("MMD LogEvent Error: Event not defined or defined with different # of args.")
        else
            call emit("Event " + pack(name) + data)
        endif
    endfunction

    ///////////////////////////////////////////////////////////////
    /// Public functions
    ///////////////////////////////////////////////////////////////

    ///Sets a player flag like "win_on_leave"
    public function FlagPlayer takes player p, string flag_type returns nothing
        local integer id = GetPlayerId(p)
        if p == null or id < 0 or id >= 12 then
            call BJDebugMsg("MMD Flag Error: Invalid player. Must be P1 to P12.")
        elseif StringLength(flag_type) == 0 then
            call BJDebugMsg("MMD Flag Error: Unrecognized flag type.")
        elseif GetPlayerController(Player(id)) == MAP_CONTROL_USER then
            call emit("FlagP " + I2S(id) + " " + flag_type)
        endif
    endfunction

    ///Defines a variable to store things in
    public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
        local string goal = goals[goal_type]
        local string vtype = types[value_type]
        local string stype = suggestions[suggestion_type]
        if goal == null then
            call BJDebugMsg("MMD Def Error: Unrecognized goal type.")
        elseif vtype == null then
            call BJDebugMsg("MMD Def Error: Unrecognized value type.")
        elseif stype == null then
            call BJDebugMsg("Stats Def Error: Unrecognized suggestion type.")
        elseif StringLength(name) > 32 then
            call BJDebugMsg("MMD Def Error: Variable name is too long.")
        elseif StringLength(name) == 0 then
            call BJDebugMsg("MMD Def Error: Variable name is empty.")
        elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
            call BJDebugMsg("MMD Def Error: Strings must have goal type of none.")
        elseif GetStoredInteger(gc, "types", name) != 0 then
            call BJDebugMsg("MMD Def Error: Value redefined.")
        else
            call StoreInteger(gc, "types", name, value_type)
            call emit("DefVarP " + pack(name) + " " + vtype + " " + goal + " " + stype)
        endif
    endfunction

    ///Updates the value of an integer variable
    public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
        call update_value(name, p, ops[op], I2S(value), TYPE_INT)
    endfunction
   
    ///Updates the value of a real variable
    public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
        call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
    endfunction
   
    ///Updates the value of a string variable
    public function UpdateValueString takes string name, player p, string value returns nothing
        local string q = "\""
        call update_value(name, p, ops[OP_SET], q + pack(value) + q, TYPE_STRING)
    endfunction    
   
    public function DefineEvent0 takes string name, string format returns nothing
        call DefineEvent(name, 0, format, "")
    endfunction
    public function DefineEvent1 takes string name, string format, string argName0 returns nothing
        call DefineEvent(name, 1, format, pack(argName0) + " ")
    endfunction
    public function DefineEvent2 takes string name, string format, string argName0, string argName1 returns nothing
        call DefineEvent(name, 2, format, pack(argName0) + " " + pack(argName1) + " ")
    endfunction
    public function DefineEvent3 takes string name, string format, string argName0, string argName1, string argName2 returns nothing
        call DefineEvent(name, 3, format, pack(argName0) + " " + pack(argName1) + " " + pack(argName2) + " ")
    endfunction
   
    public function LogEvent0 takes string name returns nothing
        call LogEvent(name, 0, "")
    endfunction
    public function LogEvent1 takes string name, string arg0 returns nothing
        call LogEvent(name, 1, " " + pack(arg0))
    endfunction
    public function LogEvent2 takes string name, string arg0, string arg1 returns nothing
        call LogEvent(name, 2, " " + pack(arg0) + " " + pack(arg1))
    endfunction
    public function LogEvent3 takes string name, string arg0, string arg1, string arg2 returns nothing
        call LogEvent(name, 3, " " + pack(arg0) + " " + pack(arg1) + " " + pack(arg2))
    endfunction

    ///Emits meta-data which parsers will ignore unless they are customized to understand it
    public function LogCustom takes string unique_identifier, string data returns nothing
        call emit("custom " + pack(unique_identifier) + " " + pack(data))
    endfunction

    ///////////////////////////////////////////////////////////////
    /// Initialization
    ///////////////////////////////////////////////////////////////
   
    ///Emits initialization data
    private function init2 takes nothing returns nothing
        local integer i
        local trigger t
        set initialized = true
       
        call emit("init version " + I2S(MINIMUM_PARSER_VERSION) + " " + I2S(CURRENT_VERSION))

        set i = 0
        loop
            exitwhen i >= 12
            if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
                call emit("init pid " + I2S(i) + " " + pack(GetPlayerName(Player(i))))
            endif
            set i = i + 1
        endloop
       
        set t = CreateTrigger()
        call TriggerAddAction(t, function tick)
        call TriggerRegisterTimerEvent(t, 0.37, true)
    endfunction
   
    ///Places init2 on a timer, initializes game cache, and translates constants
    private function init takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterTimerEvent(t, 0, false)
        call TriggerAddAction(t, function init2)
       
        set goals[GOAL_NONE] = "none"
        set goals[GOAL_HIGH] = "high"
        set goals[GOAL_LOW] = "low"
       
        set types[TYPE_INT] = "int"
        set types[TYPE_REAL] = "real"
        set types[TYPE_STRING] = "string"

        set suggestions[SUGGEST_NONE] = "none"
        set suggestions[SUGGEST_TRACK] = "track"
        set suggestions[SUGGEST_LEADERBOARD] = "leaderboard"

        set ops[OP_ADD] = "+="
        set ops[OP_SUB] = "-="
        set ops[OP_SET] = "="

        set flags[FLAG_DRAWER] = "drawer"
        set flags[FLAG_LOSER] = "loser"
        set flags[FLAG_WINNER] = "winner"
        set flags[FLAG_LEAVER] = "leaver"
        set flags[FLAG_PRACTICING] = "practicing"

        call FlushGameCache(InitGameCache(FILENAME))
        set gc = InitGameCache(FILENAME)
        call TimerStart(clock, 999999999, false, null)
        call prepC2I()
    endfunction
endlibrary
 
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Rects

public function IsUnitInRect takes unit u, rect r returns boolean
    return (GetUnitX(u) > GetRectMinX(r)-32 and GetUnitX(u) < GetRectMaxX(r)+32) and (GetUnitY(u) > GetRectMinY(r)-32 and GetUnitY(u) < GetRectMaxY(r)+32)
endfunction

endlibrary
//TESH.scrollpos=53
//TESH.alwaysfold=0
library FearSystem /* v2.7
************************************************************************************
*
*   */
uses /*
*    */
optional/*
*  
*       */
Table /*        http://www.hiveworkshop.com/forums/jass-resources-412/snippet-new-table-188084/
*        //By Bribe or Vexorian
*
************************************************************************************
*
*   struct Fear extends array
*
*       Description
*       -------------------------
*
*           This is a fear system; use it to remove player
*           control from a unit temporarily. Units affected
*           will also be unable to attack.
*
*       Fields
*       -------------------------
*
*           unit targ -> The unit you want to apply the fear.
*
*           string path -> The path of the sfx you want to add to the unit.
*
*           string attach -> The attachment string you want the sfx to be on the unit
*
*           readonly effect e -> The effect currently applied to the unit.
*           Initializes to null
*
*       Methods
*       -------------------------
*
*           static method create takes nothing returns thistype
*           method destroy takes nothing returns nothing
*
*           method start takes nothing returns nothing
*           When you have set every parameters you start your fear instance.
*
*           method changeEffect takes string path, string attach returns nothing
*           If you already have set the effect of your instance and it is running
*           and you want to change it use this.
*
*           static method isFeared takes unit u returns boolean
*           static method get takes unit u returns thistype
*          
*       Operators
*       -------------------------
*
*           method operator time= takes real t returns nothing
*           method operator time takes nothing returns real
*
*       Credits
*       -------------------------
*
*           - Vexorian for vJASS and Table
*           - Maker for the DisableUnit function
*           - Bribe for Table
*           - Chobibo for the addition in the DisableUnit function/
*
************************************************************************************/

    native UnitAlive takes unit u returns boolean
   
    globals
        //There will be check every FPS second.
        private constant real FPS = 0.031250000
        //Feared units will change direction every EACH_CHANGE FPS.
        private constant integer EACH_CHANGE = 8
        //Feared units will go maximum in a circle of 150 around them each time they change direction.
        private constant real AROUND = 300.
        //The rawcode of the attack disable. Be sure it is the same in the Object Editor.
        private constant integer DISABLE_ATTACK = 'A0CF'
        //The rawcode of the morph. Be sure it is the same in the Object Editor.
        private constant integer MORPH_ID = 'AEme'
        //The rawcode of the bear form. Be sure it is the same in the Object Editor.
        private constant integer BEAR_ID = 'Abrf'
    endglobals
   

        globals
            private hashtable ht = InitHashtable()
        endglobals

   
    private function round takes real r returns integer
        return R2I(r+0.5)
    endfunction
   
    private function modulo takes integer a, integer b returns integer
        return a - (a/b)*b
    endfunction
   
    //Credits to Maker for this awesum func <3
    private function DisableControl takes unit u returns nothing
        local boolean b
        //call UnitAddAbility(u, 'Aloc')
        //call UnitRemoveAbility(u, 'Aloc')
       // if IsUnitType(u, UNIT_TYPE_HERO) then
        //    call UnitAddAbility(u,MORPH_ID)
        //    call IssueImmediateOrder(u, "metamorphosis")
        //    call UnitRemoveAbility(u,MORPH_ID)
      //  else
      //      call UnitAddAbility(u, BEAR_ID)
      //      call IssueImmediateOrder(u, "bearform")
      //      call UnitRemoveAbility(u, BEAR_ID)    
      //  endif
        //Thanks to chobibo for this idea
      //  if GetLocalPlayer() != GetOwningPlayer(u) then
           // set b = not IsUnitHidden(u)
           // call ShowUnit(u,false)
           // call ShowUnit(u,b)
      //  endif
        //I added this line to disable their attack too.
        call UnitAddAbility(u,DISABLE_ATTACK)
        call UnitAddAbility(u,'A0CW')
    endfunction
   
    private function EnableControl takes unit u returns nothing
        local boolean backup = not IsUnitHidden(u)
        //call ShowUnit(u,false)
        //I added this line to enable their attack.
        call UnitRemoveAbility(u,DISABLE_ATTACK)
        call UnitRemoveAbility(u,'A0CW')
        //call ShowUnit(u,backup)
    endfunction
   
    struct Fear extends array
        unit targ
        string path
        string attach
        readonly effect e
        readonly boolean b
        private integer steps
        private integer startat
        private static timer period
        private static integer dindex
        private static thistype array data
        private static integer instanceCount
        private static thistype recycle
        private thistype recycleNext
       
        private static method periodic takes nothing returns nothing
            local thistype this
            local real x
            local real y
            local integer i = 0
            loop
                exitwhen i > dindex
                set this = data[i]
                if modulo(this.steps,EACH_CHANGE) == this.startat then
                    set x = GetUnitX(this.targ)
                    set y = GetUnitY(this.targ)
                    call IssuePointOrder(this.targ, "move", GetRandomReal(x-AROUND,x+AROUND), GetRandomReal(y-AROUND, y+AROUND) )
                endif
                set this.steps = this.steps - 1
                if this.steps == 0 or not(UnitAlive(this.targ)) then
                    set data[i] = data[dindex]
                    set i = i - 1
                    set dindex = dindex - 1
                    if this.e != null then
                        call DestroyEffect(this.e)
                        set this.e = null
                    endif
                    call IssueImmediateOrder(this.targ,"stop")
                    call EnableControl(this.targ)
                        call FlushChildHashtable(ht,GetHandleId(this.targ))
                    if this.b then
                        set this.targ = null
                        set recycleNext = recycle
                        set recycle = this
                    endif
                endif
                if dindex == -1 then
                    call PauseTimer(period)
                endif
                set i = i + 1
            endloop
        endmethod
       
        static method isFeared takes unit u returns boolean
                return HaveSavedInteger(ht,GetHandleId(u),0)
        endmethod
       
        method operator time= takes real t returns nothing
            set this.steps = round(t/FPS)
        endmethod
       
        method operator time takes nothing returns real
            return this.steps*FPS
        endmethod
       
        method changeEffect takes string path, string attach returns nothing
            call DestroyEffect(this.e)
            set this.e = null
            set this.e = AddSpecialEffectTarget(path,this.targ,attach)
        endmethod
       
        static method get takes unit u returns thistype
            local thistype this
            if isFeared(u) then
                    return LoadInteger(ht,GetHandleId(u),0)
            else
                debug call BJDebugMsg("Tryng to get wrong instance")
                return 0
            endif
        endmethod
       
        method start takes nothing returns nothing
            debug if this.targ==null or this.steps==0 then
                debug call BJDebugMsg("You're instanciating badly ....")
                debug return
            debug endif
            set dindex = dindex + 1
            set data[dindex] = this
            set this.startat = modulo(this.steps,EACH_CHANGE)
            call DisableControl(this.targ)
            if this.path != "" and this.attach != ""  then
                set this.e = AddSpecialEffectTarget(this.path, this.targ, this.attach)
            endif
                call SaveInteger(ht,GetHandleId(this.targ),0,this)
            if dindex == 0 then
                call TimerStart(period, FPS, true, function thistype.periodic)
            endif
        endmethod
       
        static method create takes nothing returns thistype
            local thistype this
            if recycle == 0 then
                set instanceCount = instanceCount + 1
                set this = instanceCount
            else
                set this = recycle
                set recycle = recycle.recycleNext
            endif
            set this.path = ""
            set this.attach = ""
            set this.e = null
            set this.b = false
            return this
        endmethod
       
        method destroy takes nothing returns nothing
            set this.b = true
        endmethod
       
        private static method onInit takes nothing returns nothing
            set dindex = - 1
            set instanceCount = 0
            set recycle = 0
            set period = CreateTimer()
        endmethod
    endstruct
endlibrary
v2.0.1
- Added support for different types of progress bars (without recycling) via .createEx(integer unitId).
- Properly nulled the timer handles.

v2.0.0
- beginProgression and everything associated with it has been removed. Use .setPercentage instead.
- zOffset getter included.
- xOffset and yOffset added.
- show method now adds and removes locust to prevent it removing.

-1.0.2
Minor efficiency improvements
freeDummies member renamed to lastDummyIndex

-1.0.1
Fixed a bug where the bar would fade out really slow on long durations.
Removed unused parameters from the getDummy method.
Removed UnitAddAbility and gave the dummy the ability directly.
targetUnit operator now sets the position of the bar directly (fixes cosmetic bug)
Changed onDestroy to destroy.
//TESH.scrollpos=3
//TESH.alwaysfold=0
library ProgressBars requires TimerUtils optional BoundSentinel
/**************************************************************
*
*   ProgressBars v2.0.1 by TriggerHappy
*
*   This library allows you to easily create and modify progress bars.
*   It works by creating a dummy unit with a special model and changing
*   the animation speed to increase or reduce the bar speed. It is more than
*   just a wrapper as it recycles each progress bar, meaning it will avoid
*   costly CreateUnit calls whenever possible which also leak.
*
*   Options:
*       x            - set X coordinate
*       y            - set Y coordinate
*       xOffset      - offset of the target unit, if any.
*       yOffset      - offset of the target unit, if any.
*       zOffset      - how high the bar is from the ground.
*       color        - allows you to tint the bar or add transparency
*       targetUnit   - pick which unit the bar should hover over
*       size         - set model scale
*
*   Usage:
*       local ProgressBar bar = ProgressBar.create()
*       set bar.zOffset       = 150
*       set bar.color         = PLAYER_COLOR_RED
*       set bar.targetUnit    = CreateUnit(Player(0), 'hfoo', 0, 0, 0)
*       call bar.setPercentage(30)
*
*   Installation:
*       1. Copy the dummy unit over to your map
*       2. Change the DUMMY constant to fit the Raw code of the dummy.
*       3. Copy this and all required libraries over to your map.
*
*   Thanks to JesusHipster for the Progress Bar models
*   and to Vexorian for TimerUtils & BoundSentinel
*
**************************************************************/


    globals
        private constant integer PROGRESS_BAR_DUMMY     = 'e00B' // the default one
        private constant player  PROGRESS_BAR_OWNER     = Player(PLAYER_NEUTRAL_PASSIVE) // owner of the dummy
        private constant real    UPDATE_POSITION_PERIOD = 0.03 // the timer period used with .targetUnit
    endglobals
   
    struct ProgressBar
   
        unit bar
        unit target
       
        real xOffset = 0
        real yOffset = 0
       
        timer timer
        timer timer2
       
        private boolean t_enabled = false
        private real endVal
        private real curVal=0
        private real pspeed=0
        private boolean reverse
        private boolean done
        private boolean recycle
       
        readonly static unit array dummy
        readonly static integer lastDummyIndex = -1

        method operator x= takes real x returns nothing
            call SetUnitX(this.bar, x)
        endmethod
       
        method operator x takes nothing returns real
            return GetUnitX(this.bar)
        endmethod
       
        method operator y= takes real y returns nothing
            call SetUnitY(this.bar, y)
        endmethod
       
        method operator y takes nothing returns real
            return GetUnitY(this.bar)
        endmethod
       
        method operator zOffset= takes real offset returns nothing
            call SetUnitFlyHeight(this.bar, offset, 0)
        endmethod
       
        method operator zOffset takes nothing returns real
            return GetUnitFlyHeight(this.bar)
        endmethod
       
        method operator size= takes real size returns nothing
            call SetUnitScale(this.bar, size, size, size)
        endmethod
       
        method operator color= takes playercolor color returns nothing
            call SetUnitColor(this.bar, color)
        endmethod
       
        method show takes boolean flag returns nothing
            call UnitRemoveAbility(this.bar, 'Aloc')
            call ShowUnit(this.bar, flag)
            call UnitAddAbility(this.bar, 'Aloc')
        endmethod
       
        method reset takes nothing returns nothing
            call SetUnitAnimationByIndex(this.bar, 1)
        endmethod

        method RGB takes integer red, integer green, integer blue, integer alpha returns nothing
            call SetUnitVertexColor(this.bar, red, green, blue, alpha)
        endmethod
       
        method destroy takes nothing returns nothing
            if (recycle) then
                set lastDummyIndex = lastDummyIndex + 1
                set dummy[lastDummyIndex] = this.bar
                call SetUnitAnimationByIndex(this.bar, 0)
                call SetUnitTimeScale(this.bar, 1)
            endif
           
            set this.bar        = null
            set this.target     = null
            set this.t_enabled  = false
            set this.endVal     = 0
            set this.curVal     = 0
           
            if (this.timer != null) then
                call ReleaseTimer(this.timer)
                set this.timer = null
            endif
           
            if (this.timer2 != null) then
                call ReleaseTimer(this.timer2)
                set this.timer2 = null
            endif
        endmethod
       
        private static method updatePercentage takes nothing returns nothing
            local timer expired = GetExpiredTimer()
            local thistype this = GetTimerData(expired)
           
            if (this.reverse) then
           
                if (this.curVal > this.endVal) then
                    call SetUnitTimeScale(this.bar, -this.pspeed)
                    set this.curVal = (this.curVal - (this.pspeed))
                elseif (this.curVal <= this.endVal) then
                    call PauseTimer(this.timer2)
                    call SetUnitTimeScale(this.bar, 0)
                    set this.curVal = this.endVal
                    set this.done   = true
                endif
               
            else
           
                if (this.curVal < this.endVal) then
                    call SetUnitTimeScale(this.bar, this.pspeed)
                    set this.curVal = (this.curVal + (this.pspeed))
                elseif (this.curVal >= this.endVal) then
                    call PauseTimer(this.timer2)
                    call SetUnitTimeScale(this.bar, 0)
                    set this.curVal = this.endVal
                    set this.done   = true
                   
                endif
               
            endif
           
        endmethod
       
        private static method updatePosition takes nothing returns nothing
            local thistype this = GetTimerData(GetExpiredTimer())
            if (this.target != null) then
                call SetUnitX(this.bar, GetUnitX(this.target) + xOffset)
                call SetUnitY(this.bar, GetUnitY(this.target) + yOffset)
            else
                call ReleaseTimer(GetExpiredTimer())
            endif
        endmethod
       
        private static method getDummy takes nothing returns unit
            if (lastDummyIndex <= -1) then
                set bj_lastCreatedUnit = CreateUnit(PROGRESS_BAR_OWNER, PROGRESS_BAR_DUMMY, 0, 0, 270)
                call PauseUnit(bj_lastCreatedUnit, true)
                return bj_lastCreatedUnit
            endif
            call SetUnitAnimationByIndex(dummy[lastDummyIndex], 1)
            set lastDummyIndex = lastDummyIndex - 1
            return dummy[lastDummyIndex + 1]
        endmethod
       
        static method release takes integer count returns nothing
            if (count > thistype.lastDummyIndex) then
                set count = thistype.lastDummyIndex
            endif
               
            loop
                exitwhen count <= 0
                call RemoveUnit(dummy[count])
                set dummy[count] = null
                set count = count - 1
            endloop
               
            set thistype.lastDummyIndex = -1
        endmethod
       
        static method create takes nothing returns thistype
            local thistype this = thistype.allocate()
           
            set this.bar        = thistype.getDummy()
            set this.done       = true
            set this.recycle    = true
           
            call SetUnitAnimationByIndex(this.bar, 1)
            call SetUnitTimeScale(this.bar, 0)
           
            return this
        endmethod
       
        static method createEx takes integer unitId returns thistype
            local thistype this = thistype.allocate()
           
            set this.bar        = CreateUnit(PROGRESS_BAR_OWNER, unitId, 0, 0, 0)
            set this.done       = true
            set this.recycle    = false
           
            call SetUnitAnimationByIndex(this.bar, 1)
            call SetUnitTimeScale(this.bar, 0)
           
            return this
        endmethod
       
        method setPercentage takes real percent, real speed returns nothing
            set this.endVal = R2I(percent)
            set this.pspeed = speed
           
            set this.reverse = (curVal > endVal)
               
            if (this.done) then
               
                if (this.timer2 == null) then
                    set this.timer2 = NewTimerEx(this)
                endif
           
                call TimerStart(this.timer2, 0.01, true, function thistype.updatePercentage)
                set this.done=false
            endif
        endmethod
       
        method operator targetUnit= takes unit u returns nothing
            set this.target = u
           
            if (u != null) then
                if (this.timer == null) then
                    set this.timer = NewTimerEx(this)
                endif
                call TimerStart(this.timer, UPDATE_POSITION_PERIOD, true, function thistype.updatePosition)
                call SetUnitX(this.bar, GetUnitX(this.target) - xOffset)
                call SetUnitY(this.bar, GetUnitY(this.target) - yOffset)
                set this.t_enabled = true
            else
                if (this.timer != null) then
                    call ReleaseTimer(this.timer)
                endif
                set this.t_enabled = false
            endif
        endmethod
       
    endstruct
   
endlibrary
//TESH.scrollpos=36
//TESH.alwaysfold=0

/******************************************************************************
 *
 *  TIMED LIGHTNINGS by Maker v1.0.1.1
 *
 *  Allows the creation of lightnings with expiration timer.
 *  Supports:
 *      o Fading lightnings in and out
 *      o Attaching to units
 *      o Attaching to points
 *      o Linear movement in x-, y- and z-axes
 *
 *
 *  Methods
 *
 *      P2U
 *          From a static point attached to a unit
 *          static method P2U takes lightning l, unit t, real time, real x1, real y1, real z1, real z2, real startAlpha, real endAlpha returns nothing
 *          
 *          The lightning, target unit, duration, origin x, origin y, origin z, end z
 *
 *
 *      P2UEx
 *          From a moving point attached to a unit
 *          static method P2UEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, target unit, duration, target z, origin start x, origin start y, origin start z, origin end x, origin end y, origin end z
 *
 *      U2P
 *          From attached to a unit to a static point
 *          static method U2P takes lightning l, unit s, real t, real x1, real y1, real x2, real y2, real z1, real z2, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, source unit, duration, origin x, origin y, point x , point y, source z, point z
 *
 *      U2PEx
 *          From attached to a unit to a moving point
 *          static method U2PEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, source unit, duration, source z, point start x, point start y, point start z, point end x, point end y, point end z
 *
 *      U2U
 *          From attached to a unit to attached to a unit
 *          static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, source unit, target unit, duration, source z, target z
 *
 *      P2P
 *          From a static point to a static point
 *          static method P2P takes lightning l, real t, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, duration
 *
 *      P2PEx
 *          From a moving point to a moving point
 *          static method P2PEx takes lightning l, real t, real x1, real y1, real z1, real x2, real y2, real z2, real x3, real y3, real z3, real x4, real y4, real z4, real startAlpha, real endAlpha returns nothing
 *
 *          The lightning, duration, origin start x, origin start y, origin start z, origin end x, origin end y, origin end z, target start x, target start y, target start z, target end x, target end y, target end z
 *
 *  
 *      Alpha values are between 1 and 0. 1 is fully visible, 0 is transparent.
 *
 *******************************************************************************/

library TimedLightnings

    globals
        private constant    real        TO      = 0.03125000    // Update interval
       
        private             integer     CT      = 0             // Lightning count
        private             timer       TMR     = CreateTimer()
        private             location    loc     = Location(0,0)
    endglobals
   
    struct TimedL extends array
   
        lightning l
        real av        // aplha value
        real da        // transparency change rate
        real x1  
        real x2
        real y1
        real y2
        real z1
        real z2
        real dx1
        real dy1
        real dz1
        real dx2
        real dy2
        real dz2
        unit s          // source
        unit t          // target
        integer time    // how many ticks, time
        integer next    // next node
        integer prev    // previous node
        boolean moves
       
        private static integer rlast = 0    // previous created
        private static thistype first       // first node
       
        private static integer ic = 0
        private static integer ir = 0
        private thistype rn
       
        private static thistype dat
        private static thistype dat2
        private static thistype dat3
       
        private static method destroyL takes nothing returns nothing
        /*-Link previous node with next one-*/
            set dat3 = dat2.prev
            set dat3.next = dat2.next
        /*-----Set new last created node----*/
            if dat2 == rlast then
                set rlast = dat3
            endif
       
        /*-Link next node with previous one-*/
            set dat3 = dat2.next
            set dat3.prev = dat2.prev
        /*--------Set new first node--------*/
            if dat2 == first then
                set first = dat3
            endif
           
            call DestroyLightning(dat2.l)
            set CT = CT - 1
            if CT == 0 then
                call PauseTimer(TMR)
            endif
            set dat2.rn=ir
            set ir=dat2
        endmethod
       
        private static method looping takes nothing returns nothing
            local real z1
            local real z2
            set dat = first
            loop
                set z1 = 0
                set z2 = 0
                set dat.time = dat.time - 1
                if dat.da != 0 then
                    set dat.av = dat.av - dat.da
                    call SetLightningColor(dat.l, 1, 1, 1, dat.av)
                endif
                if dat.s == null then
                    if dat.dx1 != 0 then
                        set dat.x1 = dat.x1 + dat.dx1
                    endif
                    if dat.dy1 != 0 then
                        set dat.y1 = dat.y1 + dat.dy1
                    endif
                    if dat.dz1 != 0 then
                        set dat.z1 = dat.z1 + dat.dz1
                    endif
                else
                    set dat.x1 = GetUnitX(dat.s)
                    set dat.y1 = GetUnitY(dat.s)
                    set z1 = GetUnitFlyHeight(dat.s)
                endif
                if dat.t == null then
                    if dat.dx2 != 0 then
                        set dat.x2 = dat.x2 + dat.dx2
                    endif
                    if dat.dy2 != 0 then
                        set dat.y2 = dat.y2 + dat.dy2
                    endif
                    if dat.dz2 != 0 then
                        set dat.z2 = dat.z2 + dat.dz2
                    endif
                else
                    set dat.x2 = GetUnitX(dat.t)
                    set dat.y2 = GetUnitY(dat.t)
                    set z2 = GetUnitFlyHeight(dat.t)
                endif
                if dat.moves then
                    call MoveLocation(loc, dat.x1, dat.y1)
                    set z1 = GetLocationZ(loc) + dat.z1 + z1
                    call MoveLocation(loc, dat.x2, dat.y2)
                    set z2 = GetLocationZ(loc) + dat.z2 + z2
                    call MoveLightningEx(dat.l, true, dat.x1, dat.y1, z1, dat.x2, dat.y2, z2)
                endif
                if dat.time == 0 then
                    set dat2 = dat
                    set dat = dat.next
                    call destroyL()
                else
                    set dat = dat.next
                endif
                exitwhen dat == 0
            endloop
        endmethod
       
        private static method InitAdd takes nothing returns nothing
            /* Add node to list, make this the last on list */
            if rlast != 0 then
                set dat2 = rlast
                set dat2.next = dat
            endif
           
            /* Link this with previous node                 */
            set dat.prev = rlast
            /* Make this the last created node              */
            set rlast = dat
           
            set CT = CT + 1
            if CT == 1 then
                /* Make this the first node                 */
                set first = dat
                call TimerStart(TMR, TO, true, function thistype.looping)
            endif
        endmethod
       
        private static method Recycle takes nothing returns nothing
            if 0==ir then
                set ic=ic+1
                set dat=ic
            else
                set dat=ir
                set ir=dat.rn
            endif
        endmethod
       
        static method P2U takes lightning l, unit t, real time, real x1, real y1, real z1, real z2, real startAlpha, real endAlpha returns nothing
            local thistype this
           
            call Recycle()
            set this = dat
           
            set .x1 = x1
            set .y1 = y1
            set .z1 = z1
            set .z2 = z2
            set .s = null
            set .t = t
            set .next = 0   // Nodes are added to the end of the list, there is no next node
            set .l = l
            set .time = R2I(time/TO)   // Calculates how many loops does the lightning lasts
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*TO/time    // Transparency change speed
            set .moves = true

            call InitAdd()
        endmethod
       
        static method U2P takes lightning l, unit s, real t, real x1, real y1, real x2, real y2, real z1, real z2, real startAlpha, real endAlpha returns nothing
            local thistype this
           
            call Recycle()
            set this = dat
           
            set .x1 = x1
            set .y1 = y1
            set .x2 = x2
            set .y2 = y2
            set .z1 = z1
            set .z2 = z2
            set .s = s
            set .t = null
            set .next = 0
            set .l = l
            set .time = R2I(t/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*TO/t
            set .moves = true

            call InitAdd()
        endmethod
       
        static method U2U takes lightning l, unit s, unit t, real time, real z1, real z2, real startAlpha, real endAlpha returns nothing
            local thistype this
           
            call Recycle()
            set this = dat
           
            set .z1 = z1
            set .z2 = z2
            set .s = s
            set .t = t
            set .next = 0
            set .l = l
            set .time = R2I(time/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*TO/time
            set .moves = true

            call InitAdd()
        endmethod
       
        static method P2P takes lightning l, real t, real startAlpha, real endAlpha returns nothing
            local thistype this
           
            call Recycle()
            set this = dat
           
            set .s = null
            set .t = null
            set .next = 0
            set .l = l
            set .time = R2I(t/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*TO/t
            set .moves = false

            call InitAdd()
        endmethod
       
        static method P2UEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
            local thistype this
            local real n = TO/t
           
            call Recycle()
            set this = dat
           
            set .x1 = x1
            set dx1 = (x2-x1)*n
            set .y1 = y1
            set dy1 = (y2-y1)*n
            set .z1 = z1
            set dz1 = (z2-z1)*n
            set .z2 = zu
            set .s = null
            set .t = a
            set .next = 0
            set .l = l
            set .time = R2I(t/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*n
            set .moves = true

            call InitAdd()
        endmethod
       
        static method U2PEx takes lightning l, unit a, real t, real zu, real x1, real y1, real z1, real x2, real y2, real z2, real startAlpha, real endAlpha returns nothing
            local thistype this
            local real n = TO/t
           
            call Recycle()
            set this = dat
           
            set .x2 = x1
            set .dx2 = (x2-x1)*n
            set .y2 = y1
            set .dy2 = (y2-y1)*n
            set .z2 = z1
            set .dz2 = (z2-z1)*n
            set .z1 = zu
            set .s = a
            set .t = null
            set .next = 0
            set .l = l
            set .time = R2I(t/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*n
            set .moves = true

            call thistype.InitAdd()
        endmethod
   
        static method P2PEx takes lightning l, real t, real x1, real y1, real z1, real x2, real y2, real z2, real x3, real y3, real z3, real x4, real y4, real z4, real startAlpha, real endAlpha returns nothing
            local thistype this
            local real n = TO/t
           
            call Recycle()
            set this = dat
           
            set .x1 = x1
            set .x2 = x3
            set .y1 = y1
            set .y2 = y3
            set .z1 = z1
            set .z2 = z3
            set .dx1 = (x2-x1)*n
            set .dy1 = (y2-y1)*n
            set .dz1 = (z2-z1)*n
            set .dx2 = (x4-x3)*n
            set .dy2 = (y4-y3)*n
            set .dz2 = (z4-z3)*n
            set .s = null
            set .t = null
            set .next = 0
            set .l = l
            set .time = R2I(t/TO)
            set .av = startAlpha
            set .da = (startAlpha-endAlpha)*n
            set .moves = true

            call InitAdd()
        endmethod
    endstruct
   
endlibrary
 
//TESH.scrollpos=29
//TESH.alwaysfold=0
/*****************************************************************************
*
*    RegisterNativeEvent v1.0.0.0
*       by Bannar aka Spinnaker
*
*    Storage of trigger handles for native events.
*
******************************************************************************
*    
*    Optional requirements:
*
*       Table by Bribe
*          hiveworkshop.com/forums/jass-resources-412/snippet-new-table-188084/
*
******************************************************************************
*
*    Important:
*
*       Avoid using TriggerSleepAction within functions registered
*       Destroy native event trigger on your own responsibility
*
******************************************************************************
*    
*    Functions:
*
*       function IsNativeEventRegistered takes integer whichIndex, integer eventId returns boolean
*          whether index whichIndex has already been attached to event with id eventId
*
*       function RegisterNativeEvent takes integer whichIndex, integer eventId returns boolean
*          attaches index whichIndex to eventId if it hasn't been attached already and creates new trigger handle if needed
*
*       function GetNativeEventTrigger takes integer eventId returns trigger
*          retrieves trigger handle for event with id eventId
*
*****************************************************************************/

library RegisterNativeEvent uses optional Table

    globals
    private trigger array triggers
    endglobals

    private module NativeEventInit
        private static method onInit takes nothing returns nothing
            static if LIBRARY_Table then
                set table = TableArray[122]
            endif
        endmethod
    endmodule

    private struct NativeEvent extends array
        static if LIBRARY_Table then
            static TableArray table
        else
            static hashtable table = InitHashtable()
        endif

        // 122 native events, unfortunatelly ids are not continuous
        static method operator[] takes integer eventId returns integer
            if ( eventId > 286 ) then
                return eventId - 174
            elseif ( eventId > 259 ) then
                return eventId - 165
            elseif ( eventId > 91 ) then
                return eventId - 164
            endif
            return eventId
        endmethod

        implement NativeEventInit
    endstruct

    private function RegisterEvent takes integer whichIndex, integer eventId returns nothing
        static if LIBRARY_Table then
            set NativeEvent.table[NativeEvent[eventId]].integer[whichIndex] = eventId
        else
            call SaveInteger(NativeEvent.table, NativeEvent[eventId], whichIndex, eventId)
        endif
    endfunction

    function IsNativeEventRegistered takes integer whichIndex, integer eventId returns boolean
        static if LIBRARY_Table then
            return NativeEvent.table[NativeEvent[eventId]].has(whichIndex)
        else
            return HaveSavedInteger(NativeEvent.table, NativeEvent[eventId], whichIndex)
        endif
    endfunction

    function RegisterNativeEvent takes integer whichIndex, integer eventId returns boolean
        if not IsNativeEventRegistered(whichIndex, eventId) then
            call RegisterEvent(whichIndex, eventId)
            if ( triggers[eventId] == null ) then
                set triggers[eventId] = CreateTrigger()
            endif
            return true
        endif
        return false
    endfunction

    function GetNativeEventTrigger takes integer eventId returns trigger
        return triggers[eventId]
    endfunction

endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
/*****************************************************************************
*
*    RegisterUnitEvent v1.0.0.1
*       by Bannar aka Spinnaker
*
*    Register version of TriggerRegisterUnitEvent.
*
******************************************************************************
*    
*    Requirements:
*
*       RegisterNativeEvent by Bannar
*          hiveworkshop.com/forums/submissions-414/snippet-registerevent-pack-250266/
*
******************************************************************************
*    
*    Functions:
*
*       function RegisterUnitEvent takes unit whichUnit, unitevent whichEvent, code cb returns nothing
*          registers unitevent whichEvent for unit whichUnit adding code cb as callback
*
*       function GetUnitEventTrigger takes unitevent whichEvent returns trigger
*          retrieves trigger handle for unitevent whichEvent
*
*****************************************************************************/

library RegisterUnitEvent requires RegisterNativeEvent

    globals
    triggercondition array TriggerCondition
    endglobals
   
    function RegisterUnitEvent takes unit whichUnit, unitevent whichEvent, code cb returns nothing
        local integer eventId = GetHandleId(whichEvent)

        if RegisterNativeEvent(GetHandleId(whichUnit), eventId) then
            call TriggerRegisterUnitEvent(GetNativeEventTrigger(eventId), whichUnit, whichEvent)
        endif

        set TriggerCondition[eventId] = TriggerAddCondition(GetNativeEventTrigger(eventId), Condition(cb))
    endfunction

    function GetUnitEventTrigger takes unitevent whichEvent returns trigger
        return GetNativeEventTrigger(GetHandleId(whichEvent))
    endfunction

endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//============================================================================
// SpellEffectEvent
// - Version 1.1.0.0
//
// API
// ---
//     RegisterSpellEffectEvent(integer abil, code onCast)
//
// Requires
// --------
//     RegisterPlayerUnitEvent: hiveworkshop.com/forums/showthread.php?t=203338
//
// Optional
// --------
//     Table: hiveworkshop.com/forums/showthread.php?t=188084
//
library SpellEffectEvent requires RegisterPlayerUnitEvent, optional Table
 
//============================================================================
private module M
   
    static if LIBRARY_Table then
        static Table tb
    else
        static hashtable ht = InitHashtable()
    endif
   
    static method onCast takes nothing returns nothing
        static if LIBRARY_Table then
            call TriggerEvaluate(.tb.trigger[GetSpellAbilityId()])
        else
            call TriggerEvaluate(LoadTriggerHandle(.ht, 0, GetSpellAbilityId()))
        endif
    endmethod
 
    private static method onInit takes nothing returns nothing
        static if LIBRARY_Table then
            set .tb = Table.create()
        endif
        call RegisterPlayerUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT, function thistype.onCast)
    endmethod
endmodule
 
//============================================================================
private struct S extends array
    implement M
endstruct
 
//============================================================================
function RegisterSpellEffectEvent takes integer abil, code onCast returns nothing
    static if LIBRARY_Table then
        if not S.tb.handle.has(abil) then
            set S.tb.trigger[abil] = CreateTrigger()
        endif
        call TriggerAddCondition(S.tb.trigger[abil], Filter(onCast))
    else
        if not HaveSavedHandle(S.ht, 0, abil) then
            call SaveTriggerHandle(S.ht, 0, abil, CreateTrigger())
        endif
        call TriggerAddCondition(LoadTriggerHandle(S.ht, 0, abil), Filter(onCast))
    endif
endfunction
 
endlibrary
//TESH.scrollpos=26188
//TESH.alwaysfold=0
globals
constant integer CalloftheHaunted___ABIL_ID= 'A0AA'
constant integer CalloftheHaunted___ABIL_ID2= 'A0A9'
constant integer CalloftheHaunted___NOSTACK_ID= 'A0AB'
constant integer CalloftheHaunted___INV_ID= 'AInv'
constant integer CalloftheHaunted___TIMED_LIFE_ID= 'BTLF'
constant integer CalloftheHaunted___SUPER_HP= 'I021'
constant integer CalloftheHaunted___SUPER_DMG= 'I022'
constant integer CalloftheHaunted___HEALTH_TOME_1= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_2= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_3= 'I021'
constant integer CalloftheHaunted___HEALTH_TOME_4= 'I021'
constant integer CalloftheHaunted___DAMAGE_TOME_1= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_2= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_3= 'I022'
constant integer CalloftheHaunted___DAMAGE_TOME_4= 'I022'
constant integer CalloftheHaunted___UNIT1= 'uske'
constant integer CalloftheHaunted___UNIT2= 'uskm'
constant integer CalloftheHaunted___UNIT3= 'nskm'
constant integer CalloftheHaunted___UNIT4= 'nskf'
constant integer CalloftheHaunted___UNIT1_INDEX= 9
constant integer CalloftheHaunted___UNIT2_INDEX= 6
constant integer CalloftheHaunted___UNIT3_INDEX= 7
constant integer CalloftheHaunted___UNIT4_INDEX= 7
constant integer CalloftheHaunted___UNIT1_ABILITY1= 'A0A0'
constant integer CalloftheHaunted___UNIT1_ABILITY2= 'A0A1'
constant integer CalloftheHaunted___UNIT2_ABILITY1= 'A0A6'
constant integer CalloftheHaunted___UNIT2_ABILITY2= 'A0A6'
constant integer CalloftheHaunted___UNIT3_ABILITY1= 'A09Z'
constant integer CalloftheHaunted___UNIT3_ABILITY2= 'A09W'
constant integer CalloftheHaunted___UNIT4_ABILITY1= 'A09Z'
constant integer CalloftheHaunted___UNIT4_ABILITY2= 'A09Z'
constant integer CalloftheHaunted___SUPER_UNIT= 'nsko'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY1= 'A0A4'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY2= 'A0A5'
constant integer CalloftheHaunted___SUPER_UNIT_ABILITY3= 'A0A2'
constant integer CalloftheHaunted___SUPER_BIRTH_INDEX= 9
constant string CalloftheHaunted___EFFECT= "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl"
constant string CalloftheHaunted___SUPER_EFFECT= "Abilities\\Spells\\Undead\\RaiseSkeletonWarrior\\RaiseSkeleton.mdl"
constant string CalloftheHaunted___ATTACH= "war3mapImported\\Soul Aura.mdx"
constant string CalloftheHaunted___ATTACH_POINT= "origin"
       
constant integer CalloftheHaunted___SUPER_UNIT_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___SUPER_UNIT_HP_PER_TOME= 25
       
constant integer CalloftheHaunted___UNIT1_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT2_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT3_DAMAGE_PER_TOME= 16
constant integer CalloftheHaunted___UNIT4_DAMAGE_PER_TOME= 16
       
constant integer CalloftheHaunted___UNIT1_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT2_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT3_HP_PER_TOME= 25
constant integer CalloftheHaunted___UNIT4_HP_PER_TOME= 25
   
constant boolean CalloftheHaunted___USE_UPGRADE_ABILITY= true

constant integer Chernobyliss__ABIL_ID= 'A03E'
constant integer Chernobyliss__SLOW_ID= 'A09U'
constant string Chernobyliss__EFFECT1= "war3mapImported\\Acid Ex.mdx"
constant string Chernobyliss__EFFECT2= "war3mapImported\\VenomousGaleV2_Portrait.mdx"
constant string Chernobyliss__EFFECT3= "Abilities\\Spells\\Other\\AcidBomb\\BottleMissile.mdl"
constant string Chernobyliss__ATTACH= "chest"
constant string Chernobyliss__ATTACH2= "chest"
constant string Chernobyliss__KB_SFX= ""
constant real Chernobyliss__TIMER_INTERVAL= 2.
constant real Chernobyliss__KB_DURATION= .6

constant boolean Chernobyliss__CHANGE_VERTEX_COLOR= true
       
constant attacktype Chernobyliss__ATTACK_TYPE= ATTACK_TYPE_NORMAL
constant damagetype Chernobyliss__DAMAGE_TYPE= DAMAGE_TYPE_LIGHTNING
       
constant real Chernobyliss__TREE_AOE= 0.0
constant boolean Chernobyliss__ALLOW_MOVE= false
constant boolean Chernobyliss__CHECK_PATHING= false

constant group Chernobyliss__GROUP= CreateGroup()
unit Chernobyliss__CASTER
real Chernobyliss__SPELL_X
real Chernobyliss__SPELL_Y

constant integer si__Chernobyliss__Cbliss=419
integer si__Chernobyliss__Cbliss_F=0
integer si__Chernobyliss__Cbliss_I=0
integer array si__Chernobyliss__Cbliss_V
unit array s__Chernobyliss__Cbliss_cast
unit array s__Chernobyliss__Cbliss_t
real array s__Chernobyliss__Cbliss_x
real array s__Chernobyliss__Cbliss_y
real array s__Chernobyliss__Cbliss_dur
integer array s__Chernobyliss__Cbliss_lvl
effect array s__Chernobyliss__Cbliss_attach

constant integer si__CalloftheHaunted___CotH=420
integer si__CalloftheHaunted___CotH_F=0
integer si__CalloftheHaunted___CotH_I=0
integer array si__CalloftheHaunted___CotH_V
unit array s__CalloftheHaunted___CotH_cast
real array s__CalloftheHaunted___CotH_x
real array s__CalloftheHaunted___CotH_y
integer array s__CalloftheHaunted___CotH_lvl
integer array s__CalloftheHaunted___CotH_lvl2
effect array s__CalloftheHaunted___CotH_attach

constant integer si__DeathCall___DCall=421
integer si__DeathCall___DCall_F=0
integer si__DeathCall___DCall_I=0
integer array si__DeathCall___DCall_V
unit array s__DeathCall___DCall_cast
unit array s__DeathCall___DCall_t
effect array s__DeathCall___DCall_attach

constant integer si__ReviveSafe___revivec=422
integer si__ReviveSafe___revivec_F=0
integer si__ReviveSafe___revivec_I=0
integer array si__ReviveSafe___revivec_V
integer array s__ReviveSafe___revivec_i

unit V
boolean E=true
integer X=1
boolean O=true
real R=2.
boolean I=true
boolean A=true
boolean BRTON=false
boolean NOOBM=false
boolean GAMEM=true
boolean LWMON=false
boolean FLAGREMATCH=true
boolean array LICHS
boolean array TIPST
string N="Sound\\Interface\\Error.wav"
unit array B
unit array C
item array D
item array F
item array G
real array H
integer J=0
integer K=0
timer L=CreateTimer()
destructable M
effect P
hashtable Q=InitHashtable()
integer S=0
integer T=0
integer array U
boolean array W
item array Y
integer Z=0
integer VV=0
real EV=.0
real XV=.0
real OV=.0
real RV=.0
rect IV=null
unit AV=null
item NV=null
timer BV=null
boolexpr CV=null
timer array DV
trigger array FV
integer array GV
integer array HV
triggercondition array JV
boolexpr array KV
integer array LV
integer array MV
integer array PV
integer QV=0
integer array SV
integer TV=1
integer array UV
triggercondition array WV
boolexpr array YV
boolean array ZV
integer VE=0
integer EE=-1
integer XE
integer OE
integer RE
integer IE
conditionfunc AE
conditionfunc NE
conditionfunc BE
integer array CE
boolexpr array DE
trigger array FE
integer GE=0
trigger array HE
integer array JE
integer KE
trigger LE
integer ME
integer PE
trigger QE
group SE=null
item TE=null
location UE=null
location HeroCreateLocation=null
location RandomCreateLocation=null
boolexpr WE=null
location YE=Location(.0,.0)
constant timer ZE=CreateTimer()
location VX=null
location EX=null
constant integer XX=255
constant integer OX=255
constant integer RX=255
constant integer IX=175
sound AX
integer NX=0
trigger BX=CreateTrigger()
hashtable CX
//hashtable FX
//integer GX=0
//constant integer HX=679645218
integer JX=0
integer array KX
integer LX=0
timer MX=CreateTimer()
integer PX=0
integer array QX
integer SX=0
timer TX=CreateTimer()
timer UX=CreateTimer()
integer WX=0
unit array YX
integer array ZX
integer array VO
integer EO=0
integer XO=0
integer array OO
integer RO=0
timer IO=CreateTimer()
integer array AO
integer NO=0
integer array BO
integer CO=0
integer DO=0
integer array FO
unit array GO
trigger HO=CreateTrigger()
trigger JO=CreateTrigger()
trigger KO=CreateTrigger()
integer MO
integer QO=0
integer SO=0
group array TO
boolexpr WO=null
boolexpr YO=null
hashtable ZO=InitHashtable()
boolean VR=false
group ER=null
group array XR
integer OR=0
real RR=.0
real IR=.0
real AR=.0
hashtable NR=InitHashtable()
unit BR
unit CR
unit DR
integer FR
rect GR=null
group JR=CreateGroup()
//group PATHING_GROUP = CreateGroup()
real KR
real LR
real MR
real PR
hashtable QR=InitHashtable()
constant real SR=200.*200.
constant trigger TR=CreateTrigger()
integer UR
integer WR
integer YR
string array ZR
integer VI=0
hashtable EI=InitHashtable()
integer XI=0
timer OI
timer RI
integer II
boolean AI=true
integer NI=0
damagetype array BI
boolean array CI
real array DI
unit array FI
integer GI=0
timer HI=CreateTimer()
real JI
unit KI
unit LI
real MI
trigger QI=null
trigger SI=null
group TI=null
group UI=null
unit WI=null
unit YI=null
real ZI=.0
real VA=1410065408.
real XA=VA
real OA=.0
real RA=.0
real IA=.0
destructable AA=null
item NA=null
unit BA
real CA
real DA
real FA
real GA
real HA
constant player JA=Player(PLAYER_NEUTRAL_PASSIVE)
integer KA=0
integer LA=0
integer MA=0
integer PA=0
integer QA=0
real TA=.0
real UA=.0
real WA=.0
real YA=.0
hashtable ZA=null
hashtable VN=null
real XN=.0
real ON=.0
real RN=.0
real IN=.0
real AN=.0
location NN=null
constant real BN=-5000
location CN=Location(.0,.0)
real array DN
real array FN
integer array GN
location HN=Location(.0,.0)
constant attacktype JN=ATTACK_TYPE_CHAOS
constant real KN=-.061875
constant damagetype LN=DAMAGE_TYPE_FORCE
integer MN=0
integer PN=0
unit QN=null
unit SN=null
real TN=.0
integer array UN
location WN=Location(.0,.0)
location YN=Location(.0,.0)
constant integer ZN=20
location VB=Location(.0,.0)
location EB=Location(.0,.0)
location XB=Location(.0,.0)
constant group OB=CreateGroup()
unit RB
location IB=Location(.0,.0)
constant group AB=CreateGroup()
unit NB
location BB=Location(.0,.0)
location CB=Location(.0,.0)
location DB=Location(.0,.0)
location FB=Location(.0,.0)
location GB=Location(.0,.0)
location HB=Location(.0,.0)
location JB=Location(.0,.0)
constant group KB=CreateGroup()
unit LB
real MB
location PB=Location(.0,.0)
location QB=Location(.0,.0)
location SB=Location(.0,.0)
location TB=Location(.0,.0)
trigger UB=null
location WB=Location(.0,.0)
unit YB
location ZB=Location(.0,.0)
location VC=Location(.0,.0)
location EC=Location(.0,.0)
location XC=Location(.0,.0)
unit OC
boolean array RC
integer array IC
integer array AC
boolean array NC
integer array BC
integer array CC
boolean array DC
integer array FC
integer array GC
constant real HC=2*bj_PI
integer JC
group KC=CreateGroup()
unit array LC
integer array MC
integer PC=0
integer QC=0
integer SC=0
integer TC=0
unit array UC
integer WC=0
dialog YC=null
button array ZC
integer array VD
real ED=0
timer array XD
boolean array OD
dialog RD=null
button array ID
integer array AD
integer ND=0
integer array BD
boolean DD=false
unit FD=null
rect array GD
boolean HD=false
boolean array KD
leaderboard LD=null
location array MD
location array PD
boolean array QD
group SD=null
integer array TD
string array UD
real WD=0
real YD=0
location NF=null
location BF=null
location CF=null
location DF=null
hashtable FF=null
integer GF=0
real HF=0
location JF=null
unit KF=null
integer LF=0
unit array MF
location array PF
integer array QF
integer array SF
real array TF
unit UF=null
group array WF
sound array YF
integer ZF=0
group VG=null
location EG=null
location XG=null
unit OG=null
location RG=null
group IG=null
integer AG=0
real NG=0
integer array BG
location array CG
unit DG=null
real array FG
location GG=null
real array HG
real array JG
real KG=0
unit array LG
real array MG
string array PG
string QG=""
string array SG
string TG=""
boolean array UG
boolean WG=false
real array YG
real ZG=0
real VH=0
group EH=null
real array XH
real array OH
boolean RH=false
location IH=null
group AH=null
integer NH=0
unit array BH
unit array CH
location array DH
location array FH
real array GH
real array HH
integer array JH
real array KH
real array LH
integer MH=0
group PH=null
integer QH=0
unit array SH
location array TH
integer array UH
real array WH
location array YH
real array ZH
real array VJ
integer EJ=0
group array XJ
group OJ=null
integer RJ=0
integer IJ=0
unit array AJ
location array NJ
real array BJ
real array CJ
real array DJ
group array FJ
integer GJ=0
location array HJ
integer JJ=0
unit array KJ
real array LJ
real array MJ
real PJ=0
real QJ=0
real SJ=0
location array TJ
unit array UJ
integer WJ=0
group array YJ
group ZJ=null
real VK=0
integer EK=0
location XK=null
location OK=null
location RK=null
location IK=null
group AK=null
group NK=null
group BK=null
group CK=null
location DK=null
location FK=null
group GK=null
integer HK=0
integer JK=0
integer KK=0
location LK=null
location MK=null
integer array PK
group QK=null
group SK=null
group TK=null
group UK=null
group WK=null
location YK=null
location ZK=null
location TempLocation=null
location TempLocation2=null
unit array VL
location EL=null
group XL=null
integer OL=0
unit RL=null
location IL=null
location AL=null
integer NL=0
unit BL=null
location CL=null
real DL=0
real FL=0
group GL=null
location HL=null
location JL=null
group KL=null
location LL=null
location ML=null
unit array PL
location QL=null
effect array SL
location TL=null
location UL=null
group WL=null
location YL=null
real ZL=0
location VM=null
boolean array EM
unit XM=null
unit OM=null
location array RM
integer array IM
real array AM
group NM=null
lightning BM=null
group CM=null
location DM=null
unit array FM
player GM=null
location array HM
integer array JM
boolean array KM
real array LM
real array MM
real array PM
unit array QM
unit array SM
group TM=null
effect array UM
effect array WM
effect array YM
effect array ZM
location array VP
location array EP
real array XP
real array OP
real array RP
real array IP
unit array AP
unit array NP
unit array BP
unit array CP
unit array DP
unit array FP
unit array GP
unit array HP
unit array JP
real array KP
real array LP
integer array MP
integer array PP
real array QP
location array SP
location array TP
location array UP
location array WP
location array YP
location array ZP
unit VQ=null
unit SpeedyGonzalez=null
location EQ=null
force XQ=null
real OQ=0
location RQ=null
location IQ=null
location AQ=null
location NQ=null
force BQ=null
real array CQ
integer array DQ
integer array FQ
integer array GQ
integer array HQ
integer array JQ
integer array KQ
integer array LQ
unit array MQ
string PQ=""
integer array QQ
string array SQ
integer TQ=0
integer array UQ
string WQ=""
string YQ=""
string ZQ=""
force array VS
force ES=null
string array XS
integer OS=0
string RS=""
integer array IS
multiboard array AS
leaderboard array NS
string array BS
integer CS=0
boolean DS=false
integer FS=0
real array GS
integer array HS
integer array JS
integer array KS
integer LS=0
force MS=null
integer PS=0
integer array QS
string array SS
integer array TS
integer array US
integer array WS
integer YS=0
real array ZS
integer array VT
integer array ET
integer XT=0
integer OT=0
string RT=""
real array IT
real array AT
string array NT
integer array BT
integer array CT
string array DT
integer array FT
integer array GT
integer array HT
boolean array JT
real array KT
integer array LT
integer array MT
integer array PT
integer array QT
boolean ST=false
boolean array TT
location UT=null
boolean array WT
location YT=null
integer ZT=0
integer VU=0
boolean array EU
unit array XU
real array OU
real array RU
integer IU=0
location AU=null
location NU=null
effect array BU
timer array CU
trigger DU=null
location FU=null
rect GU=null
rect HU=null
rect JU=null
rect KU=null
rect LU=null
rect MU=null
rect PU=null
rect QU=null
rect SU=null
rect TU=null
rect UU=null
rect WU=null
rect YU=null
rect ZU=null
rect VW=null
rect EW=null
rect XW=null
rect OW=null
rect RW=null
rect IW=null
rect AW=null
rect NW=null
rect BW=null
rect CW=null
rect DW=null
rect FW=null
rect GW=null
rect HW=null
rect JW=null
rect KW=null
rect LW=null
rect MW=null
rect PW=null
rect QW=null
rect SW=null
rect TW=null
rect UW=null
rect WW=null
rect YW=null
rect ZW=null
rect VY=null
rect EY=null
rect XY=null
rect OY=null
rect RY=null
rect IY=null
rect AY=null
rect NY=null
rect BY=null
rect CY=null
camerasetup DY=null
camerasetup FY=null
sound GY=null
sound HY=null
sound JY=null
sound KY=null
sound LY=null
sound MY=null
sound PY=null
sound QY=null
sound SY=null
sound TY=null
trigger UY=null
trigger WY=null
trigger YY=null
trigger ZY=null
trigger VZ=null
trigger EZ=null
trigger XZ=null
trigger OZ=null
trigger RZ=null
trigger IZ=null
trigger AZ=null
trigger NZ=null
trigger BZ=null
trigger CZ=null
trigger DZ=null
trigger FZ=null
trigger GZ=null
trigger HZ=null
trigger JZ=null
trigger KZ=null
trigger LZ=null
trigger MZ=null
trigger PZ=null
trigger QZ=null
trigger SZ=null
trigger TZ=null
trigger UZ=null
trigger WZ=null
trigger YZ=null
trigger ZZ=null
trigger V0=null
trigger E0=null
trigger X0=null
trigger O0=null
trigger R0=null
trigger I0=null
trigger A0=null
trigger N0=null
trigger B0=null
trigger C0=null
trigger D0=null
trigger F0=null
trigger G0=null
trigger H0=null
trigger J0=null
trigger K0=null
trigger L0=null
trigger M0=null
trigger P0=null
trigger Q0=null
trigger S0=null
trigger T0=null
trigger U0=null
trigger W0=null
trigger Y0=null
trigger Z0=null
trigger V1=null
trigger E1=null
trigger X1=null
trigger O1=null
trigger R1=null
trigger I1=null
trigger A1=null
trigger N1=null
trigger B1=null
trigger C1=null
trigger D1=null
trigger F1=null
trigger G1=null
trigger H1=null
trigger J1=null
trigger K1=null
trigger L1=null
trigger M1=null
trigger P1=null
trigger Q1=null
trigger S1=null
trigger T1=null
//trigger U1=null
trigger W1=null
trigger Y1=null
//trigger Z1=null
trigger V2=null
//trigger E2=null
trigger X2=null
trigger O2=null
trigger R2=null
trigger I2=null
trigger A2=null
trigger N2=null
trigger B2=null
trigger C2=null
trigger D2=null
trigger F2=null
//trigger G2=null
trigger H2=null
trigger J2=null
trigger K2=null
trigger L2=null
trigger M2=null
trigger P2=null
trigger Q2=null
trigger S2=null
trigger T2=null
trigger U2=null
trigger W2=null
trigger Y2=null
trigger Z2=null
trigger V3=null
trigger E3=null
trigger X3=null
//trigger O3=null
trigger R3=null
trigger I3=null
trigger A3=null
trigger N3=null
trigger B3=null
trigger C3=null
trigger D3=null
trigger F3=null
trigger G3=null
trigger H3=null
trigger J3=null
trigger K3=null
trigger L3=null
trigger M3=null
trigger P3=null
trigger Q3=null
trigger S3=null
trigger T3=null
trigger U3=null
trigger W3=null
trigger Y3=null
trigger Z3=null
trigger V4=null
trigger E4=null
trigger X4=null
trigger O4=null
trigger R4=null
trigger I4=null
trigger A4=null
trigger N4=null
trigger B4=null
trigger C4=null
trigger D4=null
trigger F4=null
trigger G4=null
trigger H4=null
trigger J4=null
trigger K4=null
trigger L4=null
trigger M4=null
trigger P4=null
trigger Q4=null
trigger S4=null
trigger T4=null
trigger U4=null
trigger W4=null
trigger Y4=null
trigger Z4=null
trigger V5=null
trigger E5=null
trigger X5=null
trigger O5=null
trigger R5=null
trigger I5=null
trigger A5=null
trigger N5=null
trigger B5=null
trigger C5=null
trigger D5=null
trigger F5=null
trigger G5=null
trigger H5=null
trigger J5=null
trigger K5=null
trigger L5=null
trigger M5=null
trigger P5=null
trigger Q5=null
trigger S5=null
trigger T5=null
trigger U5=null
trigger W5=null
trigger Y5=null
trigger Z5=null
trigger V6=null
trigger E6=null
trigger X6=null
trigger O6=null
trigger R6=null
trigger I6=null
trigger A6=null
trigger N6=null
trigger B6=null
trigger C6=null
trigger D6=null
trigger F6=null
trigger G6=null
trigger H6=null
trigger J6=null
trigger K6=null
trigger L6=null
trigger M6=null
trigger P6=null
trigger Q6=null
trigger S6=null
trigger T6=null
trigger U6=null
//trigger W6=null
trigger Y6=null
trigger Z6=null
trigger V7=null
trigger E7=null
trigger X7=null
trigger O7=null
trigger R7=null
trigger I7=null
trigger A7=null
trigger N7=null
trigger B7=null
trigger C7=null
trigger D7=null
trigger F7=null
trigger G7=null
trigger H7=null
trigger J7=null
trigger K7=null
trigger L7=null
trigger M7=null
trigger P7=null
trigger Q7=null
trigger S7=null
trigger T7=null
trigger U7=null
trigger W7=null
trigger Z7=null
trigger V8=null
trigger E8=null
trigger X8=null
trigger O8=null
trigger R8=null
trigger I8=null
trigger A8=null
trigger N8=null
trigger B8=null
trigger C8=null
trigger D8=null
trigger F8=null
trigger G8=null
trigger H8=null
trigger J8=null
trigger K8=null
trigger L8=null
trigger M8=null
trigger P8=null
trigger Q8=null
trigger S8=null
trigger T8=null
trigger U8=null
trigger W8=null
trigger Y8=null
trigger Z8=null
trigger VVV=null
trigger VEV=null
trigger VXV=null
trigger VOV=null
trigger VRV=null
trigger VIV=null
trigger VAV=null
trigger VNV=null
trigger VBV=null
trigger VCV=null
trigger VDV=null
trigger QoBT=null
trigger PeHT=null
trigger VFV=null
trigger VGV=null
trigger VHV=null
trigger VJV=null
trigger VKV=null
trigger VLV=null
trigger VMV=null
trigger VPV=null
trigger VQV=null
trigger VSV=null
trigger VTV=null
trigger VUV=null
trigger VWV=null
trigger VYV=null
trigger VZV=null
trigger V_V=null
trigger V0V=null
trigger V1V=null
trigger V2V=null
trigger V3V=null
trigger V4V=null
trigger V5V=null
trigger V6V=null
trigger V7V=null
trigger V8V=null
trigger V9V=null
trigger EVV=null
trigger EEV=null
trigger EXV=null
trigger EOV=null
trigger ERV=null
trigger EIV=null
trigger EAV=null
trigger ENV=null
trigger EBV=null
trigger ECV=null
trigger EDV=null
trigger EFV=null
trigger EGV=null
trigger EHV=null
trigger EJV=null
trigger EKV=null
trigger ELV=null
trigger EMV=null
trigger EPV=null
trigger EQV=null
trigger ESV=null
trigger ETV=null
trigger EUV=null
//trigger EWV=null
//trigger EYV=null
trigger EZV=null
trigger E_V=null
trigger E0V=null
//trigger Z_Y= null
trigger P_9=null
//trigger Q_8=null
//trigger Q_7=null
//trigger Q_6=null
trigger Q_5=null
trigger Q_4=null
trigger Q_3=null
unit E1V=null
unit E2V=null
unit E3V=null
unit E4V=null
unit E5V=null
unit E6V=null
unit E7V=null
unit E8V=null
unit E9V=null
unit XVV=null
unit XEV=null
unit XXV=null
unit XOV=null
unit XRV=null
unit XIV=null
unit XAV=null
unit QoBC=null
unit XNV=null
unit XBV=null
unit XCV=null
unit XDV=null
unit XFV=null
unit XGV=null
unit XHV=null
unit XJV=null
unit XKV=null
unit XLV=null
unit XMV=null
unit XPV=null
unit XQV=null
unit XSV=null
unit XTV=null
unit XUV=null
unit XWV=null
unit XYV=null
unit XZV=null
unit X_V=null
unit X0V=null
unit X1V=null
unit X2V=null
unit X3V=null
unit X4V=null
unit X5V=null
unit X6V=null
unit X7V=null
unit X8V=null
unit X9V=null
unit OVV=null
unit OEV=null
unit OXV=null
unit OOV=null
unit PeHC=null
constant group ORV=CreateGroup()
unit OIV
constant group OAV=CreateGroup()
unit ONV
unit OBV
//constant group OCV=CreateGroup()
//unit ODV
constant real OFV=-420.
rect OGV=null
trigger OHV
integer OJV
location OKV=Location(.0,.0)
location OLV=Location(.0,.0)
location OMV=Location(.0,.0)
constant group OPV=CreateGroup()
group OQV
unit OSV
integer OTV
location OUV=Location(0,0)
group OWV=CreateGroup()
hashtable OYV
sound OZV
real array O_V
real array O0V
real array O1V
real array O2V
constant real O3V=175
constant group O4V=CreateGroup()
unit O5V
constant integer O6V=127
integer O7V
integer array O8V
constant group O9V=CreateGroup()
unit RVV
constant group REV=CreateGroup()
unit RXV
constant group ROV=CreateGroup()
unit RRV
constant group RIV=CreateGroup()
unit RAV
constant group RNV=CreateGroup()
group UNIT_SPAWNERS_GROUP=CreateGroup()
unit RBV
unit RCV
integer RDV=0
integer array RFV
integer RGV=0
timer RHV=CreateTimer()
integer array RJV
integer RKV=0
integer array RLV
integer RMV=0
integer RPV=0
integer array RQV
trigger array RSV
integer array RTV
integer array RUV
trigger RWV
integer RYV=0
integer RZV=0
integer array R_V
unit array R0V
real array R1V
real array R2V
real array R3V
real array R4V
real array R5V
integer array R6V
effect array R7V
boolean array R8V
boolean array R9V
boolean array IVV
boolean array IEV
integer IXV=0
integer IOV=0
integer array IRV
integer array IIV
integer array IAV
real array INV
real array IBV
real array ICV
real array IDV
real array IFV
real array IGV
real array IHV
real array IJV
real array IKV
boolean array ILV
boolean array IMV
boolean array IPV
real array IQV
real array ISV
real array ITV
boolean array IUV
boolean array IWV
boolean array IYV
integer IZV=1
integer I_V=0
integer I0V=0
integer array I1V
integer I2V=0
integer I3V=0
integer array I4V
unit array I5V
real array I6V
real array I7V
integer array I8V
integer I9V=0
integer AVV=0
integer array AEV
unit array AXV
real array AOV
real array ARV
integer array AIV
integer AAV=0
integer ANV=0
integer array ABV
unit array ACV
real array ADV
real array AFV
real array AGV
real array AHV
location array AJV
integer array AKV
integer ALV=0
integer AMV=0
integer array APV
integer array AQV
real array ASV
real array ATV
unit array AUV
timer AWV=CreateTimer()
integer AYV=0
boolean array AZV
boolean array A_V
integer A0V=0
integer A1V=0
integer array A2V
unit array A3V
real array A4V
real array A5V
real array A6V
real array A7V
real array A8V
real array A9V
real array NVV
real array NEV
integer array NXV
integer array NOV
integer array NRV
integer array NIV
boolean array NAV
boolean array NNV
integer NBV=1
timer NCV=CreateTimer()
integer NDV=0
integer NFV=0
integer array NGV
unit array NHV
real array NJV
real array NKV
real array NMV
real array NPV
real array NQV
real array NSV
real array NTV
real array NUV
integer array NWV
timer NYV=CreateTimer()
integer NZV=0
boolean array N_V
boolean array N0V
integer N1V=0
integer N2V=0
integer array N3V
unit array N4V
unit array N5V
unit array N6V
real array N7V
real array N8V
real array N9V
string array BVV
integer array BEV
timer BXV=CreateTimer()
integer BOV=0
boolean array BRV
boolean array BIV
integer BAV=0
integer BNV=0
integer array BBV
unit array BCV
unit array BDV
real array BFV
real array BGV
real array BHV
real array BJV
real array BKV
real array BLV
real array BMV
real array BPV
string array BQV
integer array BSV
timer BTV=CreateTimer()
integer BUV=0
boolean array BWV
boolean array BYV
integer BZV=0
integer B_V=0
integer array B0V
integer array B1V
trigger array B2V
trigger array B3V
trigger array B4V
trigger array B5V
trigger array B6V
real array B7V
real array B8V
unit array B9V
real array CVV
real array CEV
integer array CXV
integer array COV
real array CRV
real array CIV
real array CAV
real array CNV
boolean array CBV
real array CCV
string array CDV
player array CFV
real array CGV
boolean array CHV
real array CJV
attacktype array CKV
damagetype array CLV
real CMV
real CPV
integer CQV
integer CSV
integer CTV
unit CUV
integer array CWV
integer array CYV
integer CZV=0
integer C_V=0
integer array C0V
constant integer C1V=10
integer array C2V
integer C3V=0
integer C4V=0
integer array C5V
constant integer C6V=10
integer array C7V
integer C8V=0
integer C9V=0
integer array DVV
integer array DEV
integer array DXV
integer array DOV
integer array DRV
string array DIV
string array DAV
boolean array DNV
boolean array DBV
integer DCV
unit array DDV
real array DFV
integer DGV=0
integer DHV=0
integer DJV=0
integer DKV=0
integer array DLV
integer array DMV
unit array DPV
effect array DQV
real array DSV
integer array DTV
integer array DUV
integer array DWV
integer array DYV
integer array DZV
boolean array D_V
conditionfunc D0V
trigger array D1V
real array D2V
real array D3V
boolean array D4V
boolean array D5V
real array D6V
real array D7V
boolean array D8V
integer D9V=0
integer FVV=0
integer array FEV
integer array FXV
trigger array FOV
trigger array FRV
trigger array FIV
trigger array FAV
trigger array FNV
trigger array FBV
trigger array FCV
trigger array FDV
trigger array FFV
trigger array FGV
integer array FHV
string array FJV
integer array FKV
integer array FLV
integer array FMV
integer array FPV
real array FQV
real array FSV
real array FTV
real array FUV
real array FWV
unit array FYV
group array FZV
boolean array F_V
boolean array F0V
boolean array F1V
boolean array F2V
boolean array F3V
boolean array F4V
boolean array F5V
integer F6V=0
integer F7V=1
timer F8V=CreateTimer()
rect F9V
integer GVV
trigger GEV=CreateTrigger()
boolean GXV=true
boolexpr array GOV
boolean array GRV
boolean array GIV
boolean array GAV
boolean array GBV
boolean array GCV
integer array GDV
integer GFV=0
integer GGV=0
integer array GHV
unit array GJV
real array GKV
integer array GLV
integer array GMV
integer GPV=0
integer GQV=0
integer array GSV
integer array GTV
integer array GUV
integer array GWV
boolean array GYV
unit array GZV
player array G_V
real array G0V
real array G1V
real array G2V
real array G3V
real array G4V
real array G5V
real array G6V
boolean array G7V
boolean array G8V
boolean array G9V
boolean array HVV
boolean array HEV
boolean array HXV
boolean array HOV
integer array HRV
integer array HIV
integer array HAV
integer array HNV
integer array HBV
integer array HCV
integer array HDV
unit array HFV
real array HGV
real array HHV
real array HJV
real array HKV
real array HLV
real array HMV
real array HPV
real array HQV
real array HSV
real array HTV
real array HUV
real array HWV
real array HYV
unit array HZV
effect array H_V
string array H0V
boolean array H1V
boolean array H2V
boolean array H3V
real array H4V
real array H5V
real array H6V
real array H7V
real array H8V
real array H9V
group array JVV
rect JEV=null
group JXV=null
boolexpr JOV=null
boolexpr JRV=null
integer JIV=0
image array JAV
real array JNV
boolean array JBV
real array JCV
real array JDV
boolean array JFV
integer array JGV
integer array JHV
integer array JJV
integer array JKV
integer array JLV
integer array JMV
integer JPV=0
integer JQV=0
integer JSV=0
integer array JTV
integer array JUV
group array JWV
string array JYV
real array JZV
real array J_V
real array J0V
real array J1V
real array J2V
real array J3V
boolean array J4V
boolean array J5V
integer J6V=0
integer J7V=0
integer array J8V
lightning array J9V
unit array KVV
unit array KEV
real array KXV
real array KOV
boolean array KRV
real array KIV
integer KAV=1
timer KNV=CreateTimer()
integer array KBV
integer array KCV
unit array KDV
real array KFV
real array KGV
real array KHV
string array KJV
string array KKV
integer array KLV
boolean array KMV
boolean array KPV
boolean array KQV
unit array KSV
unit KTV=null
unit KUV=null
integer KWV=0
group KYV=CreateGroup()
integer KZV=0
integer K_V=0
integer K0V=0
integer array K1V
real array K2V
real array K3V
integer K4V=0
integer K5V=0
integer array K6V
real array K7V
real array K8V
unit array K9V
real array LVV
real array LEV
real array LXV
integer array LOV
integer LRV=0
integer LIV=0
integer array LAV
real array LNV
real array LBV
unit array LCV
real array LDV
real array LFV
real array LGV
integer array LHV
integer LJV=0
integer LKV=0
integer array LLV
unit array LMV
effect array LPV
integer LQV=0
integer LSV=0
integer array LTV
unit array LUV
effect array LWV
integer array LYV
real array LZV
integer L_V=0
integer L0V=0
integer array L1V
unit array L2V
real array L3V
integer array L4V
integer array L5V
integer L6V=0
integer L7V=0
integer array L8V
unit array L9V
unit array MVV
effect array MEV
real array MXV
real array MOV
real array MRV
real array MIV
real array MAV
integer array MNV
integer array MBV
integer array MCV
integer MDV=0
integer MFV=0
integer array MGV
boolean array MHV
boolean array MJV
boolean array MKV
boolean array MLV
boolean array MMV
boolean array MPV
boolean array MQV
boolean array MSV
boolean array MTV
damagetype array MUV
attacktype array MWV
weapontype array MYV
integer array MZV
boolean array M_V
real array M0V
boolean array M1V
unittype array M2V
boolean array M3V
unittype array M4V
unittype array M5V
integer array M6V
real array M7V
integer array M8V
integer array M9V
integer array PVV
integer array PEV
real array PXV
integer array POV
integer array PRV
boolean array PIV
string array PAV
string array PNV
damagetype PBV=null
attacktype PCV=null
integer PDV=0
integer PFV=0
boolean PGV=false
integer PHV
integer array PJV
unit array PKV
real array PLV
real array PMV
real array PPV
real array PQV
boolexpr PSV
boolexpr PTV
group PUV
rect PWV
integer PYV=0
integer PZV=0
integer array P_V
unit array P0V
unit array P1V
real array P2V
integer array P3V
integer array P4V
integer P5V=0
integer P6V=0
integer array P7V
unit array P8V
integer array P9V
integer array QVV
integer array QEV
integer array QXV
integer QOV=0
integer QRV=0
integer array QIV
unit array QAV
unit array QNV
real array QBV
integer array QCV
integer array QDV
integer QFV=0
integer QGV=0
integer array QHV
unit array QJV
integer array QKV
integer array QLV
integer array QMV
integer array QPV
integer QQV=0
integer QSV=0
integer array QTV
unit array QUV
unit array QWV
real array QYV
integer array QZV
integer array Q_V
integer Q0V=0
integer Q1V=0
integer array Q2V
unit array Q3V
integer array Q4V
integer array Q5V
integer array Q6V
integer array Q7V
integer Q8V=0
integer Q9V=0
integer array SVV
unit array SEV
unit array SXV
real array SOV
integer array SRV
integer array SIV
integer array SAV
integer array SNV
integer SBV=0
integer SCV=0
integer array SDV
unit array SFV
effect array SGV
real array SHV
integer array SJV
integer array SKV
integer SLV=0
integer SMV=0
integer array SPV
unit array SQV
unit array SSV
unit array STV
integer array SUV
integer array SWV
integer array SYV
boolean array SZV
integer array S_V
boolean array S0V
integer array S1V
boolean array S2V
integer array S3V
real array S4V
integer array S5V
real array S6V
integer array S7V
real array S8V
integer array S9V
real array TVV
boolean array TEV
integer array TXV
timer array TOV
integer array TRV
integer array TIV
integer TAV
integer TNV=0
integer TBV=0
integer array TCV
unit array TDV
integer TFV=0
integer TGV=0
integer array THV
unit array TJV
real array TKV
real array TLV
real array TMV
real array TPV
real array TQV
real array TSV
real array TTV
real array TUV
effect array TWV
integer TYV=0
integer TZV=0
integer array T_V
unit array T0V
integer array T1V
effect array T2V
integer T3V=0
integer T4V=0
integer array T5V
unit array T6V
effect array T7V
integer T8V=0
integer T9V=0
integer array UVV
unit array UEV
real array UXV
real array UOV
real array URV
integer UIV=0
integer UAV=0
integer array UNV
unit array UBV
unit array UCV
real array UDV
integer UFV=0
integer UGV=0
integer array UHV
unit array UJV
integer UKV=0
integer ULV=0
integer array UMV
unit array UPV
unit array UQV
integer array USV
integer UTV=0
integer UUV=0
integer array UWV
unit array UYV
unit array UZV
real array U_V
real array U0V
integer U1V=0
integer U2V=0
integer array U3V
unit array U4V
unit array U5V
effect array U6V
integer array U7V
integer U8V=0
integer U9V=0
integer array WVV
timer WEV=CreateTimer()
integer WXV=0
unit array WOV
real array WRV
real array WIV
integer WAV=0
integer WNV=0
integer array WBV
unit array WCV
unit array WDV
effect array WFV
lightning array WGV
real array WHV
real array WJV
real array WKV
real array WLV
real array WMV
real array WPV
real array WQV
real array WSV
integer array WTV
timer WUV=CreateTimer()
integer WWV=0
boolean array WYV
boolean array WZV
integer W_V=0
integer W0V=0
integer array W1V
unit array W2V
effect array W3V
lightning array W4V
real array W5V
real array W6V
real array W7V
real array W8V
real array W9V
real array YVV
real array YEV
real array YXV
timer YOV=CreateTimer()
integer YRV=0
boolean array YIV
boolean array YAV
integer YNV=0
integer YBV=0
integer array YCV
real array YDV
real array YFV
real array YGV
real array YHV
unit array YJV
unit array YKV
effect array YLV
lightning array YMV
timer YPV=CreateTimer()
integer YQV=0
boolean array YSV
boolean array YTV
real array YUV
real array YWV
integer array YYV
integer YZV=0
integer Y_V=0
integer array Y0V
unit array Y1V
unit array Y2V
player array Y3V
lightning array Y4V
integer array Y5V
real array Y6V
integer array Y7V
real array Y8V
integer array Y9V
real array ZVV
integer array ZEV
real array ZXV
integer array ZOV
unit array ZRV
unit array ZIV
real array ZAV
real array ZNV
real array ZBV
real array ZCV
real array ZDV
real array ZFV
real array ZGV
real array ZHV
real array ZJV
real array ZKV
real array ZLV
effect array ZMV
effect array ZPV
integer array ZQV
real array ZSV
real array ZTV
integer ZUV=0
integer ZWV=0
integer array ZYV
unit array ZZV
unit array Z_V
player array Z0V
lightning array Z1V
integer array Z2V
real array Z3V
integer array Z4V
real array Z5V
integer array Z6V
real array Z7V
integer array Z8V
real array Z9V
integer array VVE
unit array VEE
unit array VXE
real array VOE
real array VRE
real array VIE
real array VAE
real array VNE
real array VBE
real array VCE
real array VDE
real array VFE
real array VGE
real array VHE
effect array VJE
effect array VKE
integer array VLE
real array VME
real array VPE
integer VQE=0
integer VSE=0
integer array VTE
unit array VUE
unit array VWE
player array VYE
lightning array VZE
integer array V_E
real array V0E
integer array V1E
real array V2E
integer array V3E
real array V4E
integer array V5E
real array V6E
integer array V7E
unit array V8E
unit array V9E
real array EVE
real array EEE
real array EXE
real array EOE
real array ERE
real array EIE
real array EAE
real array ENE
real array EBE
real array ECE
real array EDE
effect array EFE
effect array EGE
integer array EHE
real array EJE
real array EKE
integer ELE=0
integer EME=0
integer array EPE
unit array EQE
unit array ESE
integer array ETE
integer array EUE
real array EWE
group array EYE
integer EZE=0
integer E_E=0
integer array E0E
unit array E1E
real array E2E
real array E3E
integer array E4E
effect array E5E
integer E6E=0
integer E7E=0
integer array E8E
unit array E9E
unit array XVE
unit array XEE
real array XXE
timer array XOE
effect array XRE
boolean array XIE
integer XAE=0
integer XNE=0
integer array XBE
real array XCE
real array XDE
real array XFE
integer array XGE
integer array XHE
integer array XJE
unit array XKE
unit array XLE
integer array XME
timer array XPE
integer XQE=0
integer XSE=0
integer array XTE
unit array XUE
integer array XWE
integer XYE=0
integer XZE=0
integer array X_E
unit array X0E
real array X1E
real array X2E
real array X3E
real array X4E
real array X5E
real array X6E
real array X7E
real array X8E
real array X9E
real array OVE
real array OEE
real array OXE
real array OOE
real array ORE
effect array OIE
effect array OAE
effect array ONE
effect array OBE
effect array OCE
effect array ODE
effect array OFE
real array OGE
integer OHE=0
integer OJE=0
integer array OKE
unit array OLE
unit array OME
effect array OPE
real array OQE
integer OSE=0
integer OTE=0
integer array OUE
real array OWE
unit array OYE
integer array OZE
integer O_E=0
integer O0E=0
integer array O1E
unit array O2E
unit array O3E
real array O4E
real array O5E
integer O6E=0
integer O7E=0
integer array O8E
unit array O9E
unit array RVE
integer array REE
effect array RXE
integer ROE=0
integer RRE=0
integer array RIE
unit array RAE
unit array RNE
effect array RBE
effect array RCE
integer RDE=0
integer RFE=0
integer array RGE
unit array RHE
integer RJE=0
integer RKE=0
integer array RLE
integer array RME
unit array RPE
effect array RQE
integer RSE=0
integer RTE=0
integer array RUE
unit array RWE
integer array RYE
integer RZE=0
integer R_E=0
integer array R0E
unit array R1E
real array R2E
real array R3E
integer array R4E
real array R5E
integer R6E=0
integer R7E=0
integer array R8E
unit array R9E
integer array IVE
integer IEE=0
integer IXE=0
integer array IOE
unit array IRE
integer IIE=0
integer IAE=0
integer array INE
unit array IBE
integer array ICE
integer IDE=0
integer IFE=0
integer array IGE
unit array IHE
integer array IJE
integer IKE=0
integer ILE=0
integer array IME
unit array IPE
unit array IQE
real array ISE
integer ITE=0
integer IUE=0
integer array IWE
unit array IYE
unit array IZE
real array I_E
real array I0E
integer I1E=0
integer I2E=0
integer array I3E
unit array I4E
unit array I5E
integer array I6E
integer I7E=0
integer I8E=0
integer array I9E
real array AVE
real array AEE
unit array AXE
integer AOE=0
integer ARE=0
integer array AIE
unit array AAE
timerdialog array ANE
integer ABE=0
integer ACE=0
integer array ADE
unit array AFE
integer array AGE
real array AHE
real array AJE
real array AKE
real array ALE
real array AME
effect array APE
integer AQE
integer ASE
integer ATE
integer AUE
integer AWE
integer AWEQQ
integer AWEQ1
integer AWEQ2
integer AWEQ3
integer AWEQ4
integer AWEQ5
integer array AYE
integer array AZE
//timer array A_E
integer array A0E
timer array A1E
boolexpr array A2E
unit array A3E
unit array A4E
real array A5E
real array A6E
integer array A7E
integer array A8E
integer array A9E
integer array NVE
integer array NEE
integer array NXE
integer array NOE
integer array NRE
integer array NIE
trigger array NAE
trigger array NNE
integer array NBE
trigger array NCE
trigger NDE
trigger NFE
trigger NGE
trigger NHE
trigger NJE
trigger NKE
trigger NLE
trigger NME
trigger NPE
trigger NQE
trigger NSE
trigger NTE
trigger NUE
trigger NWE
trigger NYE
trigger NZE
trigger N_E
trigger N0E
trigger N1E
trigger N2E
trigger N3E
trigger N4E
trigger N5E
trigger N6E
trigger N7E
trigger N8E
trigger N9E
trigger BVE
trigger BEE
trigger BXE
trigger BOE
trigger BRE
trigger BIE
trigger BAE
trigger BNE
trigger BBE
trigger BCE
trigger BDE
trigger BFE
trigger BGE
trigger array BHE
trigger array BJE
trigger array BKE
trigger array BLE
trigger array BME
trigger array BPE
trigger array BQE
real BSE
trigger array BTE
real BUE
real BWE
unit BYE
destructable BZE
integer B_E
trigger B0E
boolexpr B1E
group B2E
integer B3E
boolean B4E
integer B5E
timer B6E=null
real B8E=.0
real B9E=.0
group CVE=null
force CEE=null
boolexpr CXE=null
endglobals

native UnitAlive takes unit whichUnit returns boolean

function CRE takes real CIE returns nothing
local real CAE
local real st=TimerGetElapsed(B6E)
if st<=0 then
set B6E=CreateTimer()
call TimerStart(B6E,1000000,false,null)
endif
if(CIE>0)then
loop
set CAE=CIE-TimerGetElapsed(B6E)+st
exitwhen CAE<=0
if(CAE>bj_POLLED_WAIT_SKIP_THRESHOLD)then
call TriggerSleepAction(.1*CAE)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction
function CNE takes location CBE,real CCE,real CDE returns location
return Location(GetLocationX(CBE)+CCE*Cos(CDE*bj_DEGTORAD),GetLocationY(CBE)+CCE*Sin(CDE*bj_DEGTORAD))
endfunction
function CFE takes nothing returns boolean
local real dx=GetDestructableX(GetFilterDestructable())-B8E
local real dy=GetDestructableY(GetFilterDestructable())-B9E
return(dx*dx+dy*dy<=bj_enumDestructableRadius)
endfunction
function CGE takes real CHE,location CJE,code CKE returns nothing
local rect r
if(CHE>=0)then
set B8E=GetLocationX(CJE)
set B9E=GetLocationY(CJE)
set bj_enumDestructableRadius=CHE*CHE
set r=Rect(B8E-CHE,B9E-CHE,B8E+CHE,B9E+CHE)
call EnumDestructablesInRect(r,filterEnumDestructablesInCircleBJ,CKE)
call RemoveRect(r)
set r=null
endif
endfunction
function CLE takes rect r,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRect(CVE,r,CME)
call DestroyBoolExpr(CME)
return CVE
endfunction
function CPE takes rect r returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRect(CVE,r,CXE)
return CVE
endfunction
function CQE takes real CHE,location CSE,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(CVE,CSE,CHE,CME)
return CVE
endfunction
function CTE takes real CHE,location CSE returns group
set CVE=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(CVE,CSE,CHE,CXE)
return CVE
endfunction
function CUE takes player CWE,boolexpr CME returns group
set CVE=CreateGroup()
call GroupEnumUnitsOfPlayer(CVE,CWE,CME)
call DestroyBoolExpr(CME)
return CVE
endfunction
function CountingAliveUnitsOfComputer takes nothing returns boolean
return UnitAlive(GetFilterUnit())
endfunction
function CYE takes player CWE returns group
set CVE=CreateGroup()
call GroupEnumUnitsOfPlayer(CVE,CWE,Filter(function CountingAliveUnitsOfComputer))
return CVE
endfunction
function CZE takes player CWE returns force
set CEE=CreateForce()
call ForceAddPlayer(CEE,CWE)
return CEE
endfunction
function C_E takes mapcontrol C0E returns force
local integer C1E
local player C2E
set CEE=CreateForce()
set C1E=0
loop
set C2E=Player(C1E)
if GetPlayerController(C2E)==C0E then
call ForceAddPlayer(CEE,C2E)
endif
set C1E=C1E+1
exitwhen C1E==16
endloop
return CEE
endfunction
function C3E takes player CWE returns force
set CEE=CreateForce()
call ForceEnumAllies(CEE,CWE,CXE)
return CEE
endfunction
function C4E takes boolexpr CME returns force
set CEE=CreateForce()
call ForceEnumPlayers(CEE,CME)
call DestroyBoolExpr(CME)
return CEE
endfunction

       
function C5E takes integer C6E,group C7E returns group
set bj_randomSubGroupGroup=CreateGroup()
set bj_randomSubGroupWant=C6E
set bj_randomSubGroupTotal=CountUnitsInGroup(C7E)
if(bj_randomSubGroupWant<=0 or bj_randomSubGroupTotal<=0)then
return bj_randomSubGroupGroup
endif
set bj_randomSubGroupChance=I2R(bj_randomSubGroupWant)/I2R(bj_randomSubGroupTotal)
call ForGroup(C7E,function GetRandomSubGroupEnum)
return bj_randomSubGroupGroup
endfunction
function C8E takes player CWE,playercolor C9E,boolean DVE returns nothing
local group g
call SetPlayerColor(CWE,C9E)
if DVE then
set bj_setPlayerTargetColor=C9E
set g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,CWE,CXE)
call ForGroup(g,function SetPlayerColorBJEnum)
call DestroyGroup(g)
set g=null
endif
endfunction
function DEE takes itemtype DXE,integer DOE returns nothing
local group g
set bj_stockPickedItemType=DXE
set bj_stockPickedItemLevel=DOE
set g=CreateGroup()
call GroupEnumUnitsOfType(g,"marketplace",CXE)
call ForGroup(g,function UpdateEachStockBuildingEnum)
call DestroyGroup(g)
set g=null
endfunction
function DRE takes nothing returns nothing
local integer pickedItemId
local itemtype DIE
local integer DAE=0
local integer DNE=0
local integer DOE
set DOE=1
loop
if(bj_stockAllowedPermanent[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_PERMANENT
set DAE=DOE
endif
endif
if(bj_stockAllowedCharged[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_CHARGED
set DAE=DOE
endif
endif
if(bj_stockAllowedArtifact[DOE])then
set DNE=DNE+1
if(GetRandomInt(1,DNE)==1)then
set DIE=ITEM_TYPE_ARTIFACT
set DAE=DOE
endif
endif
set DOE=DOE+1
exitwhen DOE>10
endloop
if(DNE==0)then
set DIE=null
return
endif
call DEE(DIE,DAE)
set DIE=null
endfunction
function DBE takes nothing returns nothing
call DRE()
call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INTERVAL,true,function DRE)
endfunction
function DDE takes nothing returns boolean
return true
endfunction
function DJE takes integer i returns real
if(i<8191)then
return ICV[i]
elseif(i<16382)then
return INV[i-8191]
else
return IBV[i-16382]
endif
endfunction
function DKE takes integer i,real v returns nothing
if(i<8191)then
set ICV[i]=v
elseif(i<16382)then
set INV[i-8191]=v
else
set IBV[i-16382]=v
endif
endfunction
function DLE takes integer i returns real
if(i<8191)then
return IGV[i]
elseif(i<16382)then
return IDV[i-8191]
else
return IFV[i-16382]
endif
endfunction
function DME takes integer i,real v returns nothing
if(i<8191)then
set IGV[i]=v
elseif(i<16382)then
set IDV[i-8191]=v
else
set IFV[i-16382]=v
endif
endfunction
function DPE takes integer i returns real
if(i<8191)then
return IKV[i]
elseif(i<16382)then
return IHV[i-8191]
else
return IJV[i-16382]
endif
endfunction
function DQE takes integer i,real v returns nothing
if(i<8191)then
set IKV[i]=v
elseif(i<16382)then
set IHV[i-8191]=v
else
set IJV[i-16382]=v
endif
endfunction
function DSE takes integer i returns boolean
if(i<8191)then
return IPV[i]
elseif(i<16382)then
return ILV[i-8191]
else
return IMV[i-16382]
endif
endfunction
function DTE takes integer i,boolean v returns nothing
if(i<8191)then
set IPV[i]=v
elseif(i<16382)then
set ILV[i-8191]=v
else
set IMV[i-16382]=v
endif
endfunction
function DUE takes integer i returns real
if(i<8191)then
return ITV[i]
elseif(i<16382)then
return IQV[i-8191]
else
return ISV[i-16382]
endif
endfunction
function DWE takes integer i,real v returns nothing
if(i<8191)then
set ITV[i]=v
elseif(i<16382)then
set IQV[i-8191]=v
else
set ISV[i-16382]=v
endif
endfunction
function DYE takes integer i returns boolean
if(i<8191)then
return IYV[i]
elseif(i<16382)then
return IUV[i-8191]
else
return IWV[i-16382]
endif
endfunction
function DZE takes integer i,boolean v returns nothing
if(i<8191)then
set IYV[i]=v
elseif(i<16382)then
set IUV[i-8191]=v
else
set IWV[i-16382]=v
endif
endfunction
function D_E takes nothing returns integer
local integer D0E=ABE
if(D0E!=0)then
set ABE=ADE[D0E]
else
set ACE=ACE+1
set D0E=ACE
endif
if(D0E>8190)then
return 0
endif
set AGE[D0E]=0
set ADE[D0E]=-1
return D0E
endfunction
function D1E takes nothing returns integer
local integer D0E=AOE
if(D0E!=0)then
set AOE=AIE[D0E]
else
set ARE=ARE+1
set D0E=ARE
endif
if(D0E>8190)then
return 0
endif
set AIE[D0E]=-1
return D0E
endfunction
function D2E takes integer D0E returns nothing
if D0E==null then
return
elseif(AIE[D0E]!=-1)then
return
endif
set AIE[D0E]=AOE
set AOE=D0E
endfunction
function D3E takes nothing returns integer
local integer D0E=I7E
if(D0E!=0)then
set I7E=I9E[D0E]
else
set I8E=I8E+1
set D0E=I8E
endif
if(D0E>8190)then
return 0
endif
set I9E[D0E]=-1
return D0E
endfunction
function D4E takes integer D0E returns nothing
if D0E==null then
return
elseif(I9E[D0E]!=-1)then
return
endif
set I9E[D0E]=I7E
set I7E=D0E
endfunction
function D5E takes nothing returns integer
local integer D0E=I1E
if(D0E!=0)then
set I1E=I3E[D0E]
else
set I2E=I2E+1
set D0E=I2E
endif
if(D0E>8190)then
return 0
endif
set I3E[D0E]=-1
return D0E
endfunction
function D6E takes integer D0E returns nothing
if D0E==null then
return
elseif(I3E[D0E]!=-1)then
return
endif
set I3E[D0E]=I1E
set I1E=D0E
endfunction
function D7E takes nothing returns integer
local integer D0E=ITE
if(D0E!=0)then
set ITE=IWE[D0E]
else
set IUE=IUE+1
set D0E=IUE
endif
if(D0E>8190)then
return 0
endif
set IWE[D0E]=-1
return D0E
endfunction
function D8E takes integer D0E returns nothing
if D0E==null then
return
elseif(IWE[D0E]!=-1)then
return
endif
set IWE[D0E]=ITE
set ITE=D0E
endfunction
function D9E takes nothing returns integer
local integer D0E=IKE
if(D0E!=0)then
set IKE=IME[D0E]
else
set ILE=ILE+1
set D0E=ILE
endif
if(D0E>8190)then
return 0
endif
set IME[D0E]=-1
return D0E
endfunction
function FVE takes integer D0E returns nothing
if D0E==null then
return
elseif(IME[D0E]!=-1)then
return
endif
set IME[D0E]=IKE
set IKE=D0E
endfunction
function FEE takes nothing returns integer
local integer D0E=IDE
if(D0E!=0)then
set IDE=IGE[D0E]
else
set IFE=IFE+1
set D0E=IFE
endif
if(D0E>8190)then
return 0
endif
set IGE[D0E]=-1
return D0E
endfunction
function FXE takes integer D0E returns nothing
if D0E==null then
return
elseif(IGE[D0E]!=-1)then
return
endif
set IGE[D0E]=IDE
set IDE=D0E
endfunction
function FOE takes nothing returns integer
local integer D0E=IIE
if(D0E!=0)then
set IIE=INE[D0E]
else
set IAE=IAE+1
set D0E=IAE
endif
if(D0E>8190)then
return 0
endif
set INE[D0E]=-1
return D0E
endfunction
function FRE takes integer D0E returns nothing
if D0E==null then
return
elseif(INE[D0E]!=-1)then
return
endif
set INE[D0E]=IIE
set IIE=D0E
endfunction
function FIE takes nothing returns integer
local integer D0E=IEE
if(D0E!=0)then
set IEE=IOE[D0E]
else
set IXE=IXE+1
set D0E=IXE
endif
if(D0E>8190)then
return 0
endif
set IOE[D0E]=-1
return D0E
endfunction
function FAE takes integer D0E returns nothing
if D0E==null then
return
elseif(IOE[D0E]!=-1)then
return
endif
set IOE[D0E]=IEE
set IEE=D0E
endfunction
function FNE takes nothing returns integer
local integer D0E=R6E
if(D0E!=0)then
set R6E=R8E[D0E]
else
set R7E=R7E+1
set D0E=R7E
endif
if(D0E>8190)then
return 0
endif
set R8E[D0E]=-1
return D0E
endfunction
function FBE takes integer D0E returns nothing
if D0E==null then
return
elseif(R8E[D0E]!=-1)then
return
endif
set R8E[D0E]=R6E
set R6E=D0E
endfunction
function FCE takes nothing returns integer
local integer D0E=RZE
if(D0E!=0)then
set RZE=R0E[D0E]
else
set R_E=R_E+1
set D0E=R_E
endif
if(D0E>8190)then
return 0
endif
set R0E[D0E]=-1
return D0E
endfunction
function FDE takes integer D0E returns nothing
if D0E==null then
return
elseif(R0E[D0E]!=-1)then
return
endif
set R0E[D0E]=RZE
set RZE=D0E
endfunction
function FFE takes nothing returns integer
local integer D0E=RSE
if(D0E!=0)then
set RSE=RUE[D0E]
else
set RTE=RTE+1
set D0E=RTE
endif
if(D0E>8190)then
return 0
endif
set RUE[D0E]=-1
return D0E
endfunction
function FGE takes integer D0E returns nothing
if D0E==null then
return
elseif(RUE[D0E]!=-1)then
return
endif
set RUE[D0E]=RSE
set RSE=D0E
endfunction
function FHE takes nothing returns integer
local integer D0E=RJE
if(D0E!=0)then
set RJE=RLE[D0E]
else
set RKE=RKE+1
set D0E=RKE
endif
if(D0E>8190)then
return 0
endif
set RLE[D0E]=-1
return D0E
endfunction
function FJE takes integer D0E returns nothing
if D0E==null then
return
elseif(RLE[D0E]!=-1)then
return
endif
set RLE[D0E]=RJE
set RJE=D0E
endfunction
function FKE takes nothing returns integer
local integer D0E=RDE
if(D0E!=0)then
set RDE=RGE[D0E]
else
set RFE=RFE+1
set D0E=RFE
endif
if(D0E>8190)then
return 0
endif
set RGE[D0E]=-1
return D0E
endfunction
function FLE takes integer D0E returns nothing
if D0E==null then
return
elseif(RGE[D0E]!=-1)then
return
endif
set RGE[D0E]=RDE
set RDE=D0E
endfunction
function FME takes nothing returns integer
local integer D0E=ROE
if(D0E!=0)then
set ROE=RIE[D0E]
else
set RRE=RRE+1
set D0E=RRE
endif
if(D0E>8190)then
return 0
endif
set RIE[D0E]=-1
return D0E
endfunction
function FPE takes integer D0E returns nothing
if D0E==null then
return
elseif(RIE[D0E]!=-1)then
return
endif
set RIE[D0E]=ROE
set ROE=D0E
endfunction
function FQE takes nothing returns integer
local integer D0E=O6E
if(D0E!=0)then
set O6E=O8E[D0E]
else
set O7E=O7E+1
set D0E=O7E
endif
if(D0E>8190)then
return 0
endif
set O8E[D0E]=-1
return D0E
endfunction
function FSE takes integer D0E returns nothing
if D0E==null then
return
elseif(O8E[D0E]!=-1)then
return
endif
set O8E[D0E]=O6E
set O6E=D0E
endfunction
function FTE takes nothing returns integer
local integer D0E=O_E
if(D0E!=0)then
set O_E=O1E[D0E]
else
set O0E=O0E+1
set D0E=O0E
endif
if(D0E>8190)then
return 0
endif
set O1E[D0E]=-1
return D0E
endfunction
function FUE takes integer D0E returns nothing
if D0E==null then
return
elseif(O1E[D0E]!=-1)then
return
endif
set O1E[D0E]=O_E
set O_E=D0E
endfunction
function FWE takes nothing returns integer
local integer D0E=OSE
if(D0E!=0)then
set OSE=OUE[D0E]
else
set OTE=OTE+1
set D0E=OTE
endif
if(D0E>8190)then
return 0
endif
set OUE[D0E]=-1
return D0E
endfunction
function FYE takes integer D0E returns nothing
if D0E==null then
return
elseif(OUE[D0E]!=-1)then
return
endif
set OUE[D0E]=OSE
set OSE=D0E
endfunction
function FZE takes nothing returns integer
local integer D0E=OHE
if(D0E!=0)then
set OHE=OKE[D0E]
else
set OJE=OJE+1
set D0E=OJE
endif
if(D0E>8190)then
return 0
endif
set OKE[D0E]=-1
return D0E
endfunction
function F_E takes integer D0E returns nothing
if D0E==null then
return
elseif(OKE[D0E]!=-1)then
return
endif
set OKE[D0E]=OHE
set OHE=D0E
endfunction
function F0E takes nothing returns integer
local integer D0E=XYE
if(D0E!=0)then
set XYE=X_E[D0E]
else
set XZE=XZE+1
set D0E=XZE
endif
if(D0E>8190)then
return 0
endif
set X_E[D0E]=-1
return D0E
endfunction
function F1E takes integer D0E returns nothing
if D0E==null then
return
elseif(X_E[D0E]!=-1)then
return
endif
set X_E[D0E]=XYE
set XYE=D0E
endfunction
function F2E takes nothing returns integer
local integer D0E=XQE
if(D0E!=0)then
set XQE=XTE[D0E]
else
set XSE=XSE+1
set D0E=XSE
endif
if(D0E>8190)then
return 0
endif
set XTE[D0E]=-1
return D0E
endfunction
function F3E takes integer D0E returns nothing
if D0E==null then
return
elseif(XTE[D0E]!=-1)then
return
endif
set XTE[D0E]=XQE
set XQE=D0E
endfunction
function F4E takes nothing returns integer
local integer D0E=XAE
if(D0E!=0)then
set XAE=XBE[D0E]
else
set XNE=XNE+1
set D0E=XNE
endif
if(D0E>8190)then
return 0
endif
set XBE[D0E]=-1
return D0E
endfunction
function F5E takes integer D0E returns nothing
if D0E==null then
return
elseif(XBE[D0E]!=-1)then
return
endif
set XBE[D0E]=XAE
set XAE=D0E
endfunction
function F6E takes nothing returns integer
local integer D0E=E6E
if(D0E!=0)then
set E6E=E8E[D0E]
else
set E7E=E7E+1
set D0E=E7E
endif
if(D0E>8190)then
return 0
endif
set E8E[D0E]=-1
return D0E
endfunction
function F7E takes integer D0E returns nothing
if D0E==null then
return
elseif(E8E[D0E]!=-1)then
return
endif
set E8E[D0E]=E6E
set E6E=D0E
endfunction
function F8E takes nothing returns integer
local integer D0E=EZE
if(D0E!=0)then
set EZE=E0E[D0E]
else
set E_E=E_E+1
set D0E=E_E
endif
if(D0E>8190)then
return 0
endif
set E0E[D0E]=-1
return D0E
endfunction
function F9E takes integer D0E returns nothing
if D0E==null then
return
elseif(E0E[D0E]!=-1)then
return
endif
set E0E[D0E]=EZE
set EZE=D0E
endfunction
function GVE takes nothing returns integer
local integer D0E=ELE
if(D0E!=0)then
set ELE=EPE[D0E]
else
set EME=EME+1
set D0E=EME
endif
if(D0E>8190)then
return 0
endif
set EPE[D0E]=-1
return D0E
endfunction
function GEE takes nothing returns integer
local integer D0E=VQE
if(D0E!=0)then
set VQE=VTE[D0E]
else
set VSE=VSE+1
set D0E=VSE
endif
if(D0E>4094)then
return 0
endif
set V_E[D0E]=(D0E-1)*2
set V1E[D0E]=(D0E-1)*2
set V3E[D0E]=(D0E-1)*2
set V5E[D0E]=(D0E-1)*2
set V7E[D0E]=(D0E-1)*2
set EKE[D0E]=.0
set VTE[D0E]=-1
return D0E
endfunction
function GXE takes integer D0E returns nothing
if D0E==null then
return
elseif(VTE[D0E]!=-1)then
return
endif
set VTE[D0E]=VQE
set VQE=D0E
endfunction
function GOE takes nothing returns integer
local integer D0E=ZUV
if(D0E!=0)then
set ZUV=ZYV[D0E]
else
set ZWV=ZWV+1
set D0E=ZWV
endif
if(D0E>4094)then
return 0
endif
set Z2V[D0E]=(D0E-1)*2
set Z4V[D0E]=(D0E-1)*2
set Z6V[D0E]=(D0E-1)*2
set Z8V[D0E]=(D0E-1)*2
set VVE[D0E]=(D0E-1)*2
set VPE[D0E]=.0
set ZYV[D0E]=-1
return D0E
endfunction
function GRE takes integer D0E returns nothing
if D0E==null then
return
elseif(ZYV[D0E]!=-1)then
return
endif
set ZYV[D0E]=ZUV
set ZUV=D0E
endfunction
function GIE takes nothing returns integer
local integer D0E=YZV
if(D0E!=0)then
set YZV=Y0V[D0E]
else
set Y_V=Y_V+1
set D0E=Y_V
endif
if(D0E>4094)then
return 0
endif
set Y5V[D0E]=(D0E-1)*2
set Y7V[D0E]=(D0E-1)*2
set Y9V[D0E]=(D0E-1)*2
set ZEV[D0E]=(D0E-1)*2
set ZOV[D0E]=(D0E-1)*2
set ZTV[D0E]=.0
set Y0V[D0E]=-1
return D0E
endfunction
function GAE takes integer D0E returns nothing
if D0E==null then
return
elseif(Y0V[D0E]!=-1)then
return
endif
set Y0V[D0E]=YZV
set YZV=D0E
endfunction
function GBE takes nothing returns integer
local integer D0E=RMV
if(D0E!=0)then
set RMV=RQV[D0E]
else
set RPV=RPV+1
set D0E=RPV
endif
if(D0E>8190)then
return 0
endif
set RQV[D0E]=-1
return D0E
endfunction
function GCE takes integer D0E returns nothing
if D0E==null then
return
elseif(RQV[D0E]!=-1)then
return
endif
set RQV[D0E]=RMV
set RMV=D0E
endfunction
function GDE takes nothing returns integer
local integer D0E=YNV
if(D0E!=0)then
set YNV=YCV[D0E]
else
set YBV=YBV+1
set D0E=YBV
endif
if(D0E>8190)then
return 0
endif
set YCV[D0E]=-1
return D0E
endfunction
function GFE takes integer D0E returns nothing
if D0E==null then
return
elseif(YCV[D0E]!=-1)then
return
endif
set YCV[D0E]=YNV
set YNV=D0E
endfunction
function GGE takes nothing returns integer
local integer D0E=W_V
if(D0E!=0)then
set W_V=W1V[D0E]
else
set W0V=W0V+1
set D0E=W0V
endif
if(D0E>8190)then
return 0
endif
set W1V[D0E]=-1
return D0E
endfunction
function GHE takes integer D0E returns nothing
if D0E==null then
return
elseif(W1V[D0E]!=-1)then
return
endif
set W1V[D0E]=W_V
set W_V=D0E
endfunction
function GJE takes nothing returns integer
local integer D0E=WAV
if(D0E!=0)then
set WAV=WBV[D0E]
else
set WNV=WNV+1
set D0E=WNV
endif
if(D0E>2729)then
return 0
endif
set WTV[D0E]=(D0E-1)*3
set WBV[D0E]=-1
return D0E
endfunction
function GKE takes integer D0E returns nothing
if D0E==null then
return
elseif(WBV[D0E]!=-1)then
return
endif
set WBV[D0E]=WAV
set WAV=D0E
endfunction
function GLE takes nothing returns integer
local integer D0E=U8V
if(D0E!=0)then
set U8V=WVV[D0E]
else
set U9V=U9V+1
set D0E=U9V
endif
if(D0E>8190)then
return 0
endif
set WVV[D0E]=-1
return D0E
endfunction
function GME takes integer D0E returns nothing
if D0E==null then
return
elseif(WVV[D0E]!=-1)then
return
endif
set WVV[D0E]=U8V
set U8V=D0E
endfunction
/*function GPE takes nothing returns integer
local integer D0E=U1V
if(D0E!=0)then
set U1V=U3V[D0E]
else
set U2V=U2V+1
set D0E=U2V
endif
if(D0E>8190)then
return 0
endif
set U3V[D0E]=-1
return D0E
endfunction*/

function GQE takes integer D0E returns nothing
if D0E==null then
return
elseif(U3V[D0E]!=-1)then
return
endif
set U3V[D0E]=U1V
set U1V=D0E
endfunction
function GSE takes nothing returns integer
local integer D0E=UTV
if(D0E!=0)then
set UTV=UWV[D0E]
else
set UUV=UUV+1
set D0E=UUV
endif
if(D0E>8190)then
return 0
endif
set UWV[D0E]=-1
return D0E
endfunction
function GTE takes integer D0E returns nothing
if D0E==null then
return
elseif(UWV[D0E]!=-1)then
return
endif
set UWV[D0E]=UTV
set UTV=D0E
endfunction
function GUE takes nothing returns integer
local integer D0E=UKV
if(D0E!=0)then
set UKV=UMV[D0E]
else
set ULV=ULV+1
set D0E=ULV
endif
if(D0E>8190)then
return 0
endif
set UMV[D0E]=-1
return D0E
endfunction
function GWE takes integer D0E returns nothing
if D0E==null then
return
elseif(UMV[D0E]!=-1)then
return
endif
set UMV[D0E]=UKV
set UKV=D0E
endfunction
function GYE takes nothing returns integer
local integer D0E=UFV
if(D0E!=0)then
set UFV=UHV[D0E]
else
set UGV=UGV+1
set D0E=UGV
endif
if(D0E>8190)then
return 0
endif
set UHV[D0E]=-1
return D0E
endfunction
function GZE takes integer D0E returns nothing
if D0E==null then
return
elseif(UHV[D0E]!=-1)then
return
endif
set UHV[D0E]=UFV
set UFV=D0E
endfunction
function G_E takes nothing returns integer
local integer D0E=UIV
if(D0E!=0)then
set UIV=UNV[D0E]
else
set UAV=UAV+1
set D0E=UAV
endif
if(D0E>8190)then
return 0
endif
set UNV[D0E]=-1
return D0E
endfunction
function G0E takes integer D0E returns nothing
if D0E==null then
return
elseif(UNV[D0E]!=-1)then
return
endif
set UNV[D0E]=UIV
set UIV=D0E
endfunction
function G1E takes nothing returns integer
local integer D0E=T8V
if(D0E!=0)then
set T8V=UVV[D0E]
else
set T9V=T9V+1
set D0E=T9V
endif
if(D0E>8190)then
return 0
endif
set UVV[D0E]=-1
return D0E
endfunction
function G2E takes integer D0E returns nothing
if D0E==null then
return
elseif(UVV[D0E]!=-1)then
return
endif
set UVV[D0E]=T8V
set T8V=D0E
endfunction
function G3E takes nothing returns integer
local integer D0E=T3V
if(D0E!=0)then
set T3V=T5V[D0E]
else
set T4V=T4V+1
set D0E=T4V
endif
if(D0E>8190)then
return 0
endif
set T5V[D0E]=-1
return D0E
endfunction
function G4E takes integer D0E returns nothing
if D0E==null then
return
elseif(T5V[D0E]!=-1)then
return
endif
set T5V[D0E]=T3V
set T3V=D0E
endfunction
function G5E takes nothing returns integer
local integer D0E=TYV
if(D0E!=0)then
set TYV=T_V[D0E]
else
set TZV=TZV+1
set D0E=TZV
endif
if(D0E>8190)then
return 0
endif
set T_V[D0E]=-1
return D0E
endfunction
function G6E takes integer D0E returns nothing
if D0E==null then
return
elseif(T_V[D0E]!=-1)then
return
endif
set T_V[D0E]=TYV
set TYV=D0E
endfunction
function G7E takes nothing returns integer
local integer D0E=TFV
if(D0E!=0)then
set TFV=THV[D0E]
else
set TGV=TGV+1
set D0E=TGV
endif
if(D0E>8190)then
return 0
endif
set THV[D0E]=-1
return D0E
endfunction
function G8E takes integer D0E returns nothing
if D0E==null then
return
elseif(THV[D0E]!=-1)then
return
endif
set THV[D0E]=TFV
set TFV=D0E
endfunction
function G9E takes nothing returns integer
local integer D0E=TNV
if(D0E!=0)then
set TNV=TCV[D0E]
else
set TBV=TBV+1
set D0E=TBV
endif
if(D0E>8190)then
return 0
endif
set TCV[D0E]=-1
return D0E
endfunction
function HVE takes integer D0E returns nothing
if D0E==null then
return
elseif(TCV[D0E]!=-1)then
return
endif
set TCV[D0E]=TNV
set TNV=D0E
endfunction
function HEE takes nothing returns integer
local integer D0E=SLV
if(D0E!=0)then
set SLV=SPV[D0E]
else
set SMV=SMV+1
set D0E=SMV
endif
if(D0E>67)then
return 0
endif
set SUV[D0E]=(D0E-1)*120
set SYV[D0E]=(D0E-1)*120
set S_V[D0E]=(D0E-1)*120
set S1V[D0E]=(D0E-1)*120
set S3V[D0E]=(D0E-1)*120
set S5V[D0E]=(D0E-1)*120
set S7V[D0E]=(D0E-1)*120
set S9V[D0E]=(D0E-1)*120
set TXV[D0E]=(D0E-1)*120
set SPV[D0E]=-1
return D0E
endfunction
function HXE takes integer D0E returns nothing
if D0E==null then
return
elseif(SPV[D0E]!=-1)then
return
endif
set B3E=D0E
call TriggerEvaluate(BFE)
set SPV[D0E]=SLV
set SLV=D0E
endfunction
function HOE takes integer D0E returns nothing
set SJV[SKV[D0E]]=SJV[D0E]
set SKV[SJV[D0E]]=SKV[D0E]
endfunction
function HRE takes nothing returns integer
local integer D0E=SBV
if(D0E!=0)then
set SBV=SDV[D0E]
else
set SCV=SCV+1
set D0E=SCV
endif
if(D0E>8190)then
return 0
endif
set SFV[D0E]=null
set SGV[D0E]=null
set SHV[D0E]=.0
set SDV[D0E]=-1
return D0E
endfunction
function HIE takes integer D0E returns nothing
if D0E==null then
return
elseif(SDV[D0E]!=-1)then
return
endif
set SDV[D0E]=SBV
set SBV=D0E
endfunction
function HAE takes integer D0E returns nothing
set SAV[SNV[D0E]]=SAV[D0E]
set SNV[SAV[D0E]]=SNV[D0E]
endfunction
function HNE takes nothing returns integer
local integer D0E=Q8V
if(D0E!=0)then
set Q8V=SVV[D0E]
else
set Q9V=Q9V+1
set D0E=Q9V
endif
if(D0E>8190)then
return 0
endif
set SEV[D0E]=null
set SXV[D0E]=null
set SOV[D0E]=.0
set SRV[D0E]=0
set SIV[D0E]=0
set SVV[D0E]=-1
return D0E
endfunction
function HBE takes integer D0E returns nothing
if D0E==null then
return
elseif(SVV[D0E]!=-1)then
return
endif
set SVV[D0E]=Q8V
set Q8V=D0E
endfunction
function HCE takes integer D0E returns nothing
set Q6V[Q7V[D0E]]=Q6V[D0E]
set Q7V[Q6V[D0E]]=Q7V[D0E]
endfunction
function HDE takes nothing returns integer
local integer D0E=Q0V
if(D0E!=0)then
set Q0V=Q2V[D0E]
else
set Q1V=Q1V+1
set D0E=Q1V
endif
if(D0E>8190)then
return 0
endif
set Q3V[D0E]=null
set Q4V[D0E]=0
set Q5V[D0E]=0
set Q2V[D0E]=-1
return D0E
endfunction
function HFE takes integer D0E returns nothing
if D0E==null then
return
elseif(Q2V[D0E]!=-1)then
return
endif
set Q2V[D0E]=Q0V
set Q0V=D0E
endfunction
function HGE takes integer D0E returns nothing
set QZV[Q_V[D0E]]=QZV[D0E]
set Q_V[QZV[D0E]]=Q_V[D0E]
endfunction
function HHE takes nothing returns integer
local integer D0E=QQV
if(D0E!=0)then
set QQV=QTV[D0E]
else
set QSV=QSV+1
set D0E=QSV
endif
if(D0E>8190)then
return 0
endif
set QUV[D0E]=null
set QWV[D0E]=null
set QYV[D0E]=.0
set QTV[D0E]=-1
return D0E
endfunction
function HJE takes integer D0E returns nothing
if D0E==null then
return
elseif(QTV[D0E]!=-1)then
return
endif
set QTV[D0E]=QQV
set QQV=D0E
endfunction
function HKE takes integer D0E returns nothing
set QMV[QPV[D0E]]=QMV[D0E]
set QPV[QMV[D0E]]=QPV[D0E]
endfunction
function HLE takes nothing returns integer
local integer D0E=QFV
if(D0E!=0)then
set QFV=QHV[D0E]
else
set QGV=QGV+1
set D0E=QGV
endif
if(D0E>8190)then
return 0
endif
set QJV[D0E]=null
set QKV[D0E]=0
set QLV[D0E]=0
set QHV[D0E]=-1
return D0E
endfunction
function HME takes integer D0E returns nothing
if D0E==null then
return
elseif(QHV[D0E]!=-1)then
return
endif
set QHV[D0E]=QFV
set QFV=D0E
endfunction
function HPE takes integer D0E returns nothing
set QCV[QDV[D0E]]=QCV[D0E]
set QDV[QCV[D0E]]=QDV[D0E]
endfunction
function HQE takes nothing returns integer
local integer D0E=QOV
if(D0E!=0)then
set QOV=QIV[D0E]
else
set QRV=QRV+1
set D0E=QRV
endif
if(D0E>8190)then
return 0
endif
set QAV[D0E]=null
set QNV[D0E]=null
set QBV[D0E]=.0
set QIV[D0E]=-1
return D0E
endfunction
function HSE takes integer D0E returns nothing
if D0E==null then
return
elseif(QIV[D0E]!=-1)then
return
endif
set QIV[D0E]=QOV
set QOV=D0E
endfunction
function HTE takes integer D0E returns nothing
set QEV[QXV[D0E]]=QEV[D0E]
set QXV[QEV[D0E]]=QXV[D0E]
endfunction
function HUE takes nothing returns integer
local integer D0E=P5V
if(D0E!=0)then
set P5V=P7V[D0E]
else
set P6V=P6V+1
set D0E=P6V
endif
if(D0E>8190)then
return 0
endif
set P8V[D0E]=null
set P9V[D0E]=0
set QVV[D0E]=0
set P7V[D0E]=-1
return D0E
endfunction
function HWE takes integer D0E returns nothing
if D0E==null then
return
elseif(P7V[D0E]!=-1)then
return
endif
set P7V[D0E]=P5V
set P5V=D0E
endfunction
function HYE takes integer D0E returns nothing
set P3V[P4V[D0E]]=P3V[D0E]
set P4V[P3V[D0E]]=P4V[D0E]
endfunction
function HZE takes nothing returns integer
local integer D0E=PYV
if(D0E!=0)then
set PYV=P_V[D0E]
else
set PZV=PZV+1
set D0E=PZV
endif
if(D0E>8190)then
return 0
endif
set P0V[D0E]=null
set P1V[D0E]=null
set P2V[D0E]=.0
set P_V[D0E]=-1
return D0E
endfunction
function H_E takes integer D0E returns nothing
if D0E==null then
return
elseif(P_V[D0E]!=-1)then
return
endif
set P_V[D0E]=PYV
set PYV=D0E
endfunction
function H0E takes nothing returns integer
local integer D0E=MDV
if(D0E!=0)then
set MDV=MGV[D0E]
else
set MFV=MFV+1
set D0E=MFV
endif
if(D0E>2729)then
return 0
endif
set M6V[D0E]=(D0E-1)*3
set M8V[D0E]=(D0E-1)*3
set PEV[D0E]=(D0E-1)*3
set POV[D0E]=(D0E-1)*3
set MHV[D0E]=false
set MJV[D0E]=false
set MKV[D0E]=true
set MLV[D0E]=true
set MMV[D0E]=true
set MPV[D0E]=false
set MQV[D0E]=false
set MSV[D0E]=false
set MTV[D0E]=false
set MUV[D0E]=DAMAGE_TYPE_UNIVERSAL
set MWV[D0E]=ATTACK_TYPE_NORMAL
set MYV[D0E]=WEAPON_TYPE_WHOKNOWS
set MZV[D0E]=0
set M_V[D0E]=false
set M0V[D0E]=1.
set M1V[D0E]=false
set M2V[D0E]=null
set M3V[D0E]=false
set M4V[D0E]=null
set M9V[D0E]=0
set PRV[D0E]=0
set PIV[D0E]=false
set MGV[D0E]=-1
return D0E
endfunction
function H1E takes integer D0E returns nothing
set MBV[MCV[D0E]]=MBV[D0E]
set MCV[MBV[D0E]]=MCV[D0E]
endfunction
function H2E takes nothing returns integer
local integer D0E=L6V
if(D0E!=0)then
set L6V=L8V[D0E]
else
set L7V=L7V+1
set D0E=L7V
endif
if(D0E>8190)then
return 0
endif
set L9V[D0E]=null
set MVV[D0E]=null
set MEV[D0E]=null
set MXV[D0E]=.0
set MOV[D0E]=.0
set MRV[D0E]=.0
set MIV[D0E]=.0
set MAV[D0E]=.0
set MNV[D0E]=0
set L8V[D0E]=-1
return D0E
endfunction
function H3E takes integer D0E returns nothing
if D0E==null then
return
elseif(L8V[D0E]!=-1)then
return
endif
set L8V[D0E]=L6V
set L6V=D0E
endfunction
function H4E takes integer D0E returns nothing
set L4V[L5V[D0E]]=L4V[D0E]
set L5V[L4V[D0E]]=L5V[D0E]
endfunction
function H5E takes nothing returns integer
local integer D0E=L_V
if(D0E!=0)then
set L_V=L1V[D0E]
else
set L0V=L0V+1
set D0E=L0V
endif
if(D0E>8190)then
return 0
endif
set L2V[D0E]=null
set L3V[D0E]=.0
set L1V[D0E]=-1
return D0E
endfunction
function H6E takes integer D0E returns nothing
if D0E==null then
return
elseif(L1V[D0E]!=-1)then
return
endif
set L1V[D0E]=L_V
set L_V=D0E
endfunction
function H7E takes nothing returns integer
local integer D0E=LQV
if(D0E!=0)then
set LQV=LTV[D0E]
else
set LSV=LSV+1
set D0E=LSV
endif
if(D0E>8190)then
return 0
endif
set LTV[D0E]=-1
return D0E
endfunction
function H8E takes integer D0E returns nothing
if D0E==null then
return
elseif(LTV[D0E]!=-1)then
return
endif
set LTV[D0E]=LQV
set LQV=D0E
endfunction
function H9E takes nothing returns integer
local integer D0E=LJV
if(D0E!=0)then
set LJV=LLV[D0E]
else
set LKV=LKV+1
set D0E=LKV
endif
if(D0E>8190)then
return 0
endif
set LLV[D0E]=-1
return D0E
endfunction
function JVE takes integer D0E returns nothing
if D0E==null then
return
elseif(LLV[D0E]!=-1)then
return
endif
set LLV[D0E]=LJV
set LJV=D0E
endfunction
function JEE takes nothing returns integer
local integer D0E=LRV
if(D0E!=0)then
set LRV=LAV[D0E]
else
set LIV=LIV+1
set D0E=LIV
endif
if(D0E>8190)then
return 0
endif
set LAV[D0E]=-1
return D0E
endfunction
function JXE takes integer D0E returns nothing
if D0E==null then
return
elseif(LAV[D0E]!=-1)then
return
endif
set LAV[D0E]=LRV
set LRV=D0E
endfunction
function JOE takes nothing returns integer
local integer D0E=K4V
if(D0E!=0)then
set K4V=K6V[D0E]
else
set K5V=K5V+1
set D0E=K5V
endif
if(D0E>8190)then
return 0
endif
set K6V[D0E]=-1
return D0E
endfunction
function JRE takes integer D0E returns nothing
if D0E==null then
return
elseif(K6V[D0E]!=-1)then
return
endif
set K6V[D0E]=K4V
set K4V=D0E
endfunction
function JIE takes nothing returns integer
local integer D0E=K_V
if(D0E!=0)then
set K_V=K1V[D0E]
else
set K0V=K0V+1
set D0E=K0V
endif
if(D0E>8190)then
return 0
endif
set K2V[D0E]=.0
set K3V[D0E]=.0
set K1V[D0E]=-1
return D0E
endfunction
function JAE takes integer D0E returns nothing
if D0E==null then
return
elseif(K1V[D0E]!=-1)then
return
endif
set K1V[D0E]=K_V
set K_V=D0E
endfunction
function JNE takes nothing returns integer
local integer D0E=RYV
if(D0E!=0)then
set RYV=R_V[D0E]
else
set RZV=RZV+1
set D0E=RZV
endif
if(D0E>8190)then
return 0
endif
set R0V[D0E]=null
set R1V[D0E]=.0
set R2V[D0E]=.0
set R3V[D0E]=.0
set R4V[D0E]=.0
set R5V[D0E]=.0
set R6V[D0E]=0
set R7V[D0E]=null
set R8V[D0E]=false
set R9V[D0E]=false
set IVV[D0E]=false
set IEV[D0E]=false
set R_V[D0E]=-1
return D0E
endfunction
function JBE takes nothing returns integer
local integer D0E=J6V
if(D0E!=0)then
set J6V=J8V[D0E]
else
set J7V=J7V+1
set D0E=J7V
endif
if(D0E>8190)then
return 0
endif
set KXV[D0E]=.0
set KOV[D0E]=.0
set KIV[D0E]=1.
set J8V[D0E]=-1
return D0E
endfunction
function JCE takes integer D0E returns nothing
if D0E==null then
return
elseif(J8V[D0E]!=-1)then
return
endif
set J8V[D0E]=J6V
set J6V=D0E
endfunction
function JDE takes integer D0E,integer JFE returns boolean
set B3E=D0E
set B_E=JFE
call TriggerEvaluate(N9E)
return B4E
endfunction
function JGE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(BVE)
endfunction
function JHE takes nothing returns integer
local integer D0E=JQV
if(D0E!=0)then
set JQV=JTV[D0E]
else
set JSV=JSV+1
set D0E=JSV
endif
if(D0E>8190)then
return 0
endif
set JUV[D0E]=0
set JTV[D0E]=-1
return D0E
endfunction
function JJE takes integer D0E returns nothing
if D0E==null then
return
elseif(JTV[D0E]!=-1)then
return
endif
set JTV[D0E]=JQV
set JQV=D0E
endfunction
function JKE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N3E)
return B5E
endfunction
function JLE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N4E)
return B5E
endfunction
function JME takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N5E)
return B5E
endfunction
function JPE takes integer D0E returns integer
set B3E=D0E
call TriggerEvaluate(N6E)
return B5E
endfunction
function JQE takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(N7E)
endfunction
function JSE takes integer D0E returns nothing
set JHV[JJV[D0E]]=JHV[D0E]
set JJV[JHV[D0E]]=JJV[D0E]
endfunction
function JTE takes nothing returns integer
local integer D0E=GPV
if(D0E!=0)then
set GPV=GSV[D0E]
else
set GQV=GQV+1
set D0E=GQV
endif
if(D0E>8190)then
return 0
endif
set GTV[D0E]=0
set GUV[D0E]=0
set GWV[D0E]=0
set GYV[D0E]=false
set GZV[D0E]=null
set G_V[D0E]=null
set G0V[D0E]=64.
set G1V[D0E]=64.
set G2V[D0E]=.0
set G3V[D0E]=.0
set G4V[D0E]=.0
set G5V[D0E]=1.
set G6V[D0E]=2.
set G7V[D0E]=false
set G8V[D0E]=false
set G9V[D0E]=false
set HVV[D0E]=false
set HEV[D0E]=false
set HXV[D0E]=false
set HOV[D0E]=false
set HRV[D0E]=0
set HIV[D0E]=0
set HAV[D0E]=0
set HNV[D0E]=0
set HBV[D0E]=0
set HCV[D0E]=0
set HDV[D0E]=0
set HFV[D0E]=null
set HGV[D0E]=.0
set HHV[D0E]=.0
set HJV[D0E]=.0
set HKV[D0E]=.0
set HLV[D0E]=.0
set HMV[D0E]=.0
set HPV[D0E]=.0
set HQV[D0E]=.0
set HSV[D0E]=.0
set HTV[D0E]=.0
set HUV[D0E]=.0
set HWV[D0E]=.0
set HYV[D0E]=.0
set HZV[D0E]=null
set H_V[D0E]=null
set H0V[D0E]=""
set H1V[D0E]=false
set H2V[D0E]=false
set H3V[D0E]=true
set H4V[D0E]=.0
set H5V[D0E]=.0
set H6V[D0E]=.0
set H7V[D0E]=.0
set H8V[D0E]=.0
set H9V[D0E]=.0
set JAV[D0E]=null
set JNV[D0E]=.0
set JBV[D0E]=false
set JCV[D0E]=.0
set JDV[D0E]=1.
set JFV[D0E]=false
set JGV[D0E]=0
set GSV[D0E]=-1
return D0E
endfunction
function JUE takes integer D0E returns nothing
if D0E==null then
return
elseif(GSV[D0E]!=-1)then
return
endif
set GSV[D0E]=GPV
set GPV=D0E
endfunction
function JWE takes integer D0E returns nothing
set GLV[GMV[D0E]]=GLV[D0E]
set GMV[GLV[D0E]]=GMV[D0E]
endfunction
function JYE takes nothing returns integer
local integer D0E=GFV
if(D0E!=0)then
set GFV=GHV[D0E]
else
set GGV=GGV+1
set D0E=GGV
endif
if(D0E>8190)then
return 0
endif
set GJV[D0E]=null
set GKV[D0E]=.0
set GHV[D0E]=-1
return D0E
endfunction
function JZE takes integer D0E returns nothing
if D0E==null then
return
elseif(GHV[D0E]!=-1)then
return
endif
set GHV[D0E]=GFV
set GFV=D0E
endfunction
function J_E takes nothing returns integer
local integer D0E=IXV
if(D0E!=0)then
if(D0E<8191)then
set IXV=IRV[D0E]
elseif(D0E<16382)then
set IXV=IIV[D0E-8191]
else
set IXV=IAV[D0E-16382]
endif
else
set IOV=IOV+1
set D0E=IOV
endif
if(D0E>20000)then
return 0
endif
if(D0E<8191)then
set ICV[D0E]=.0
set IGV[D0E]=.0
set IKV[D0E]=.0
set IPV[D0E]=true
set ITV[D0E]=.0
set IYV[D0E]=false
elseif(D0E<16382)then
set INV[D0E-8191]=.0
set IDV[D0E-8191]=.0
set IHV[D0E-8191]=.0
set ILV[D0E-8191]=true
set IQV[D0E-8191]=.0
set IUV[D0E-8191]=false
else
set IBV[D0E-16382]=.0
set IFV[D0E-16382]=.0
set IJV[D0E-16382]=.0
set IMV[D0E-16382]=true
set ISV[D0E-16382]=.0
set IWV[D0E-16382]=false
endif
if(D0E<8191)then
set IRV[D0E]=-1
elseif(D0E<16382)then
set IIV[D0E-8191]=-1
else
set IAV[D0E-16382]=-1
endif
return D0E
endfunction
function J0E takes integer D0E returns nothing
set B3E=D0E
call TriggerEvaluate(FRV[FXV[D0E]])
endfunction
function J1E takes integer D0E,unit J2E returns nothing
set B3E=D0E
set BYE=J2E
call TriggerEvaluate(FIV