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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  5. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  8. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  9. 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

SPELL TEST [ BETA 1 ].w3x
Variables
Init
IntroZ
IntroZ Cancel
Credit
Command
Abilites Hotkeys
Init
Rect
Everlies Research Temple
Entering Everlies Magic Research Temple
LeavingEverlies Magic Research Temple
Land Of Remake
Entering Land Of Remake
Leaving Land Of Remake
Black Shop Island
Entering Black Shop Island
Leaving Black Shop Island
Everlies Research Temple Autocommand Elevator
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
A16
A17
A18
A19
A20
B1
B2
B3
B4
B5
B6
B7
B8
B9
B10
B11
B12
B13
B14
B15
B16
B17
B18
B19
B20
Footie Spawn 1
Balack Spawn 1
Spellz
Instructions
Body Replacement
Body Replacement
Flash Jump
Jump System 1
Jump System 2
Actions to apply
Sample Spell Jump
---- Heal ----
Charm Heal
---- Times Block ----
Times Block
Adds Times Block
---- Times Frenzys
Assign Hashtable
Times Frenzys Start
Times Frenzys Loop
Adds Times Frenzys
Impulse
Impulse
Cast A Knockback
GetKnockback
Hesoyham
Hesoyham
Restart
Restart
MODE
Respawn Tree
Dying Tree
Explode
Kill
Remove
Gold
Life
Mana
No Cooldown Active
No Cooldown Deactive
Infine Mana Active
Infine Mana Deactive
No Cooldown
Infine Mana
STOP
Kejuti
Balack Spawn
Footie Spawn
Respawn
MoveSpeed
Setting Speed Change
MoveSpeedXGUI
MoveSpeedXGlobals
System
Damage
Unit Indexer
Damage Engine
Show Text
Damage Effect
GroupUtils
RegisterPlayerUnitEvent
SpellEffectEvent
TerrainPathability
TimerUtils
T32
xebasic
xefx

		
Name Type Is Array Initial Value
DamageBlockingAbility abilcode No
DamageEvent real No
DamageEventAmount real No
DamageEventExplodesUnit boolean No
DamageEventOverride boolean No
DamageEventPrevAmt real No
DamageEventSource unit No
DamageEventsWasted integer No
DamageEventTarget unit No
DamageEventTrigger trigger No
DamageEventType integer No
DamageModifierEvent real No
DamageTaken real No
DamageTypeDOT integer No
DamageTypeRanged integer No
DamageTypeSpell integer No
DemoVelocity real No
DmgEvLife real No
DmgEvN integer No
DmgEvStack unit Yes
DmgEvTimer timer No
DmgTypPrev integer No
DyingTree destructable No
Footie unit No
Hashtable_Split_Dimension hashtable No
HealAmount real No
HealUnit unit No
JD_Angle real Yes
JD_Animations string Yes
JD_Distances real Yes
JD_Effect string Yes
JD_Group group No
JD_HighSettings real Yes
JD_Integers integer Yes
JD_JumpHigh real Yes
JD_ReachedDistance real Yes
JD_RealTimer real Yes
JD_SpeedUnits real Yes
JD_TempPoint location Yes
JD_TreesDestroy boolean Yes
JD_Unit unit Yes
JDA_Animation string No
JDA_AnimationSpeed real No
JDA_Collusion boolean No
JDA_DestroyTrees_Dash boolean No
JDA_JumpHigh_Distance real No
JDA_SpecialEffect string No
JDA_Speed real No
JDA_TargetPoint location No
JDA_Unit unit No
KB_Angle real Yes
KB_Casters unit Yes
KB_CountBuffs integer No
KB_DestroyTrees boolean Yes
KB_Effects_1 string Yes
KB_Effects_2 string Yes
KB_GeneralIntegers integervar Yes
KB_KnockbackedUnits group No
KB_Levels integer Yes
KB_MaxDistance real Yes
KB_ReachedDistance real Yes
KB_ReducedReal real No
KB_ReduceSpeedReal real Yes
KB_SpecificSpeed real Yes
KB_StartPositions location Yes
KB_TempPoint location Yes
KB_TempReal real No
KB_TotalKnockUnits integer No
KB_Units unit Yes
KBA_Caster unit No
KBA_DestroyTrees boolean No
KBA_DistancePerLevel real No
KBA_Level integer No
KBA_SpecialEffects string Yes
KBA_Speed real No
KBA_StartingPosition location No
KBA_TargetUnit unit No
KejutiSoundz string No
KejutiSoundzNaah sound No
LS_Dummy unit No
LS_GeneralInteger integervar No
LS_Groups group Yes
LS_TempPoint location Yes
Point location No
Point_Split_Dimension location Yes
Split_Dimension_Group group No
Temp_Integer integer No
TempLoc1 location No
TempUnit unit No
TempX real No
TempY real No
TimesBlockCaster unit No
UDex integer No
UDexGen integer No
UDexNext integer Yes
UDexPrev integer Yes
UDexRecycle integer No
UDexUnits unit Yes
UDexWasted integer No
UMovNext integer Yes
UMovPrev integer Yes
UnitDamageRegistered boolean Yes
UnitIndexerEnabled boolean No
UnitIndexEvent real No
UnitIndexLock integer Yes
UnitMoving boolean Yes
UnitMovingEvent real No
UnitMovingX real Yes
UnitMovingY real Yes
UnitSpeedX real Yes
zz_ActionAndTrig trigger No
zz_AdjustCam boolean Yes
zz_ai_only_mode button No
zz_AllItems item Yes
zz_AllUnits unit Yes
zz_Anfangsfarbe integer Yes
zz_AnyDamageTrig trigger No
zz_AnzahlVoter integer No
zz_ATLastSound sound Yes
zz_AttackDiceUpgr integer Yes
zz_AttackRateUpgr integer Yes
zz_ATToBeSkipped boolean Yes
zz_BnsBit integer Yes
zz_CamAlreadyOff boolean Yes
zz_CamAngle real Yes
zz_CameraSettingVal real Yes
zz_CamFollowUnit unit Yes
zz_CamOffset real Yes
zz_CamPid integer Yes
zz_CamPidIndex integer No
zz_CamRoll real Yes
zz_CamRotation real Yes
zz_CamSysPlayer player No
zz_CamSysT real No
zz_CamSysTime real No
zz_CamZOffset real Yes
zz_cdlg_button button Yes
zz_cdlg_dialog dialog Yes
zz_cdlg_length integer No
zz_cdlg_number integer Yes
zz_chat_no_ally string No
zz_CheckLocation location No
zz_ClosestDestructable destructable No
zz_ClosestDistance real No
zz_ClosestItem item No
zz_CodeIdA string Yes
zz_CodeIdB string Yes
zz_CodeRow string No
zz_CodeRows integer Yes
zz_color_board leaderboard No
zz_command_dlg1 string Yes
zz_command_dlg2 string Yes
zz_command_dlg3 string Yes
zz_command_hotkey1 integer Yes
zz_command_hotkey2 integer Yes
zz_command_hotkey3 integer Yes
zz_command_key1 string Yes
zz_command_key2 string Yes
zz_command_key3 string Yes
zz_command_language string No
zz_command_length integer No
zz_command_msg string Yes
zz_command_number integer Yes
zz_command_par1 integer Yes
zz_command_par2 integer Yes
zz_command_par3 integer Yes
zz_command_prefix string No
zz_commanded_player player No
zz_commander_mode button No
zz_commanding_player player No
zz_Comp boolean No
zz_current_command integer No
zz_current_number_par integer No
zz_current_player_par integer No
zz_CurrentlySelectedHero unit Yes
zz_CustomBooleanValue boolean Yes
zz_CustomRealValue real Yes
zz_CustomStringValue string Yes
zz_DamageTaken real No
zz_debug_BlackMaskTrig trigger No
zz_debugCamAoaTrig trigger No
zz_debugCamDistTrig trigger No
zz_debugCamFarzTrig trigger No
zz_debugCamFovTrig trigger No
zz_debugCamInfoTrig trigger No
zz_debugCamResetTrig trigger No
zz_debugCamRollTrig trigger No
zz_debugCamRotTrig trigger No
zz_debugCloneTrig trigger No
zz_debugDemoTrig trigger No
zz_debugDifficultyTrig trigger No
zz_debugDispelTrig trigger No
zz_debugFingerOfDeathEnabled boolean Yes
zz_debugFingerOfDeathTrig trigger Yes
zz_debugGimmeTrig trigger No
zz_debugGotoUnits integer No
zz_debugGotoUnitTrig trigger No
zz_debugGotoUnitX real No
zz_debugGotoUnitY real No
zz_debugGotoXTrig trigger No
zz_debugGotoXYTrig trigger No
zz_debugGotoYTrig trigger No
zz_debugTeleportTrig trigger No
zz_debugToolOfDeathTrig trigger Yes
zz_debugUnitInfoTrig trigger No
zz_DefendCaster sound No
zz_DetectRandom real No
zz_DetectSelected real No
zz_deutsch_button button No
zz_dialog_in_use boolean No
zz_DialogAktion string Yes
zz_DialogButton button Yes
zz_DialogFolge trigger Yes
zz_DialogShortcut integer Yes
zz_DialogSpieler dialog Yes
zz_DivineShield sound No
zz_dlg_dialog dialog Yes
zz_dlg_length integer No
zz_dlg_string string Yes
zz_dlgbutton_ai_only string No
zz_dlgbutton_all string No
zz_dlgbutton_cancel string No
zz_dlgbutton_commander string No
zz_dlgbutton_gold string No
zz_dlgbutton_lumber string No
zz_dlgbutton_no_human string No
zz_dlgbutton_tribute string No
zz_dlghdr_choose_ally string No
zz_dlghdr_choose_number string No
zz_dlghdr_choose_player string No
zz_dlghdr_game_type string No
zz_dlghdr_root string No
zz_dlghdr_tribute_amount string No
zz_dlghdr_tribute_type string No
zz_Empty0p5 sound No
zz_Empty1 sound No
zz_Empty10 sound No
zz_Empty11 sound No
zz_Empty12 sound No
zz_Empty14 sound No
zz_Empty16 sound No
zz_Empty18 sound No
zz_Empty1p5 sound No
zz_Empty2 sound No
zz_Empty20 sound No
zz_Empty22 sound No
zz_Empty24 sound No
zz_Empty26 sound No
zz_Empty28 sound No
zz_Empty2p5 sound No
zz_Empty3 sound No
zz_Empty30 sound No
zz_Empty32 sound No
zz_Empty4 sound No
zz_Empty5 sound No
zz_Empty6 sound No
zz_Empty7 sound No
zz_Empty8 sound No
zz_Empty9 sound No
zz_EngineTimerDialogs timerdialog Yes
zz_EngineTimers timer Yes
zz_english_button button No
zz_EnumItemType integer No
zz_EnumItemTypeT itemtype No
zz_ErweckteIndex integer No
zz_ErweckteKreaturen unit Yes
zz_Farbinterval real Yes
zz_ForRectItem boolean No
zz_french_button button No
zz_game_start_dialog dialog No
zz_game_start_trigger trigger No
zz_GewitterBlitze integer No
zz_GewitterCenter location No
zz_GlowEffect effect Yes
zz_GlowEffectPlus effect Yes
zz_heap_array_0 integer Yes
zz_heap_array_1 integer Yes
zz_heap_array_2 integer Yes
zz_heap_array_begin integer No
zz_heap_array_end integer No
zz_heap_arraycount integer No
zz_heap_descriptor_alloccursor integer No
zz_heap_descriptor_array_0 integer Yes
zz_heap_descriptor_array_1 integer Yes
zz_heap_descriptor_arraycount integer No
zz_heap_descriptor_begin integer No
zz_heap_descriptor_end integer No
zz_heap_descriptor_first integer No
zz_heap_descriptor_last integer No
zz_heap_descriptor_record_size integer No
zz_HeroChoice trigger No
zz_HeroDiedMsg trigger No
zz_HeroSkill1 integer Yes
zz_HeroSkill2 integer Yes
zz_HeroSkill3 integer Yes
zz_HeroSkill4 integer Yes
zz_HeroSkill5 integer Yes
zz_IsAlreadyPathing boolean Yes
zz_ItemIndex integer No
zz_language_dialog dialog No
zz_language_trigger trigger No
zz_LastClickedButtonNr integer Yes
zz_LastCreatedMovingSFX integer No
zz_LastCreatedMultiboardItem multiboarditem No
zz_LastMidiSound sound No
zz_LastMultipleChoice integer Yes
zz_LifeRegenUpgr integer Yes
zz_ManaRegenUpgr integer Yes
zz_MissileLength integer No
zz_MissileModel string Yes
zz_MissileOrder string Yes
zz_MissileUnitType integer Yes
zz_MJAuswahl boolean Yes
zz_MJAuswahleinheit unit Yes
zz_MJLastSound sound Yes
zz_MJPlayerPointer integer No
zz_MJSelected group Yes
zz_MJTrig1 trigger Yes
zz_MJTrig2 trigger Yes
zz_ModuloHex integer No
zz_MoveRateUpgr integer Yes
zz_MovForward trigger No
zz_MovingSFX effect Yes
zz_MovingSFXAbstand real Yes
zz_MovingSFXCenter location Yes
zz_MovingSFXCounter integer Yes
zz_MovingSFXKilled boolean Yes
zz_MovingSFXLength integer No
zz_MovingSFXLoop boolean Yes
zz_MovingSFXNach rect Yes
zz_MovingSFXNr integer Yes
zz_MovingSFXPath string Yes
zz_MovingSFXRadius real Yes
zz_MovingSFXStartAngle real Yes
zz_MovingSFXTrigger trigger Yes
zz_MovingSFXType integer Yes
zz_MovingSFXUnit unit Yes
zz_MovingSFXVor rect Yes
zz_MovingSFXWait real Yes
zz_MovLeft integer Yes
zz_MovMoving boolean Yes
zz_MovRight integer Yes
zz_MovSidewards trigger No
zz_MovUnit unit Yes
zz_ndbn_button button Yes
zz_ndbn_length integer No
zz_no_human_mode button No
zz_NoBuildIndex integer No
zz_NoBuildRects rect Yes
zz_NoBuildTrig trigger No
zz_number_dialog dialog No
zz_observer_god boolean No
zz_parsed_command string Yes
zz_pcbn_button button Yes
zz_pcbn_length integer No
zz_pcbn_number integer Yes
zz_player_dialog dialog No
zz_PlayerLeftMsg trigger No
zz_PortaleffektA effect Yes
zz_PortaleffektB effect No
zz_PortaltriggerA trigger No
zz_PortaltriggerB trigger No
zz_PressDown trigger No
zz_PressLeft trigger No
zz_PressRight trigger No
zz_PressUp trigger No
zz_PrevCam camerasetup Yes
zz_RangeUpgr integer Yes
zz_RegrowingTrees trigger No
zz_ReleaseLeft trigger No
zz_ReleaseRight trigger No
zz_ReleaseUp trigger No
zz_root_dialog dialog No
zz_SaveLoadSettings boolean Yes
zz_sdbn_button button Yes
zz_sdbn_length integer No
zz_sdbn_number integer Yes
zz_SEAnzahl integer No
zz_SECaster unit No
zz_SECastingType integer Yes
zz_SEFunc string Yes
zz_SEId integer Yes
zz_SEIndex integer No
zz_SELastOrder string No
zz_SelectableHeros group No
zz_SEMana real Yes
zz_SEOrder string Yes
zz_SERange real Yes
zz_SETarget unit No
zz_SETX real No
zz_SETY real No
zz_ShortcutId string Yes
zz_start_dialog dialog No
zz_StimmeAbgegeben boolean Yes
zz_Stimmen integer Yes
zz_StimmenAbgabe trigger No
zz_StimmenAbgegeben integer No
zz_StringIdent string No
zz_swedish_button button No
zz_TargetDistance real Yes
zz_TargetUpgr integer Yes
zz_TimerCounter integer No
zz_TPCenter rect No
zz_TPCondition triggercondition Yes
zz_TPEingang rect Yes
zz_TPNextTown rect No
zz_TPOpen boolean Yes
zz_TPPointer integer No
zz_TPRestrictGroup group No
zz_TPRestrictType integer No
zz_TPWatchersA real No
zz_TPWatchersB real No
zz_tribute_amount string No
zz_tribute_dlg dialog No
zz_tribute_dlg_button button Yes
zz_tribute_dlg_length integer No
zz_tribute_g button No
zz_tribute_l button No
zz_tribute_type string No
zz_TrigAlways trigger No
zz_UnfertigeGebaeude unit Yes
zz_UnfertigeGebIndex integer No
zz_UnfertigeUpgrades unit Yes
zz_UnfertigeUpgradesIndex integer No
zz_UnitIndex integer No
zz_UseAngle boolean Yes
zz_UseDistance boolean Yes
zz_UseOffset boolean Yes
zz_UseRoll boolean Yes
zz_UseRotation boolean Yes
zz_UseZOffset boolean Yes
zz_VotingAuswahl string Yes
zz_VotingBoard leaderboard Yes
zz_VotingErgebnis string No
zz_VotingFolge string Yes
zz_VotingGeheim boolean No
zz_VotingTimer timerdialog No
zz_XAcquiredItem item Yes
zz_XBuiltConstruction unit Yes
zz_XDroppedItem item Yes
zz_XLearnedSkill integer Yes
zz_XResearchedUpgrade integer Yes
zz_XSoldItem item Yes
zz_XSoldUnit unit Yes
zz_XSummonedUnit unit Yes
zz_XTrainedUnit unit Yes
IntroZ
  Events
    Player - Player 1 (Red) types a chat message containing -IntroZ (stringnoformat) as An exact match
  Conditions
  Actions
    Trigger - Turn on IntroZ_Cancel <gen>
    Environment - Set sky to Lordaeron Summer Sky
    Cinematic - Turn cinematic mode On for (All players)
    Camera - Pan camera for Player 1 (Red) to (Position of Spell Tester 0000 <gen>) over 0 seconds
    Unit - Move Spell Tester 0000 <gen> instantly to (Center of Start <gen>)
    Unit - Create 1.Footman for Player 1 (Red) at (Center of Stupid_IntroZ <gen>) facing Default building facing degrees
    Unit - Order Spell Tester 0000 <gen> to Attack.(Last created unit)
    Wait 1.00 seconds
    Unit - Remove (Last created unit) from the game
    Camera - .Apply. gg_cam_IntroZ for Player 1 (Red) over 0 seconds
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display Hello there. Modify duration: Add 0.40 seconds and Wait
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display This is spell test for spell maker or just for template. Modify duration: Add 2.00 seconds and Wait
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display Well, lets start the introduction!!. Modify duration: Add 1.00 seconds and Wait
    Camera - .Apply. gg_cam_Land_Of_Remake_IntroZ for Player 1 (Red) over 0 seconds
    Wait 0.20 seconds
    Camera - Rotate camera 180.00 degrees around (Target of gg_cam_Land_Of_Remake_IntroZ) for Player 1 (Red) over 4.00 seconds
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display Okay, this is the Land Of RemakeThis is where you can spawns a dummy or test enemy unitsYou can see the Command on the Map Info panelsThen see the Land Of Remake commands..... Modify duration: Add 6.00 seconds and Wait
    Camera - .Apply. gg_cam_Everlies_Research_Temple_IntroZ for Player 1 (Red) over 0 seconds
    Wait 0.20 seconds
    Camera - Rotate camera 360.00 degrees around (Target of gg_cam_Everlies_Research_Temple_IntroZ) for Player 1 (Red) over 8.00 seconds
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display This is my research templeTheres autocommand elevators and much more. Modify duration: Add 2.00 seconds and Wait
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display And theres much more command or mode....Just see the Command on Map Info panel..... Modify duration: Add 2.00 seconds and Wait
    Camera - .Apply. gg_cam_Black_Shop_Island_IntroZ for Player 1 (Red) over 0 seconds
    Wait 0.20 seconds
    Camera - Rotate camera 360.00 degrees around (Target of gg_cam_Black_Shop_Island_IntroZ) for Player 1 (Red) over 8.00 seconds
    Cinematic - Send transmission to (All players) from Spell Tester 0000 <gen> named Everlies: Play No sound and display Well....This is where the illegal merchants market baseThis island is only the unknown island from country guardThe newfound island by illegal merchant. Modify duration: Add 8.00 seconds and Wait
    Cinematic - Turn cinematic mode Off for (All players)
    Camera - Pan camera for Player 1 (Red) to (Position of Spell Tester 0000 <gen>) over 0 seconds
    Camera - Reset camera for Player 1 (Red) to standard game-view over 0 seconds
IntroZ Cancel
  Events
    Player - Player 1 (Red) skips a cinematic sequence
  Conditions
  Actions
    Camera - Reset camera for Player 1 (Red) to standard game-view over 0 seconds
    Cinematic - Turn cinematic mode Off for (All players)
    Trigger - Turn off IntroZ <gen>
    Trigger - Turn on IntroZ <gen>
    Trigger - Turn off (This trigger)
Credit
  Events
    Time - Elapsed game time is 0.04 seconds
  Conditions
  Actions
    Quest - Create a Required quest titled Credi Help with the description Thank'z to this guy who help me alot of out loud!!- Arthas Nightshade- Mr_Bean- Hell_Master- Lambadelta ( Blackrose123 )Website:- Hive Workshop ( www.hiveworkshop.com )- WC 3 Campaign ( www.wc3c.net )- Warcraft 3 Underground ( warcraftunderground.com )- Warcraft 3 Underground ( Henry sites )- Archimondes Arena ( archimondesarena.forumotion.com )- Play DotA ( www.playdota.com )- The Jass Vault ( wc3jass.com )- Facebook ( www.facebook.com/lembidirubick ), using icon path PASBTNCredit.tga
    Quest - Create a Required quest titled Credi Inspiration with the description Thank'z to these guy for helping me alot out of loud :D :DGuy'z:- GTA San Andreas ( Game )- ap0calypse- MasterTrainer- -Kobas-- Mr.Bean987- Radamantus- Storm hih- Pharaoh_- eubzBand:- MEW- Avenged Sevenfold- Linkin Park, using icon path PASBTNCredit.tga
    Quest - Create a Required quest titled Credit Spell with the description Thank'z to these guy for helping me alot out of loud :D :DGuy'z:- ap0calypse- Maker- -Kobas-- Moyack- Maghteridon96- Paladon- Arisato- Mr.Bean987- Radamantus- Storm hih-, using icon path PASBTNCredit.tga
    Quest - Create a Required quest titled Credit Models with the description Thank'z to these guy for helping me alot out of loud :D :DGuy'z:- Frankster- Lord-Sengklek- eubz- Henry- SonOfJay- WaterKnight- nGyWebsite:- Hive Workshop ( www.hiveworkshop.com )- WC 3 Campaign ( www.wc3c.net )- Warcraft 3 Underground ( warcraftunderground.com )- Warcraft 3 Underground ( Henry sites )- Archimondes Arena ( archimondesarena.forumotion.com )- Play DotA ( www.playdota.com )- The Jass Vault ( wc3jass.com )- Facebook ( www.facebook.com/lembidirubick ), using icon path PASBTNCredit.tga
Command
  Events
    Time - Elapsed game time is 0.02 seconds
  Conditions
  Actions
    Quest - Create a Required quest titled Command with the description Intro'z: -IntroZ |cffffcc00Land Of Remake|r:Spawn Footie: -Footie ( Value )Spawn Balack Army: -Balack Army ( Value )|cffffcc00Mode|r:No Cooldown: -No Cooldown ( ON / OFF )Infine Mana: -Infine Mana ( ON / OFF )|cffffcc00Setter|r:Set Gold: -Gold ( Value )Set Movement Speed: -M, using icon path PASBTNCredit.tga
Abilites Hotkeys
  Events
    Time - Elapsed game time is 0.02 seconds
  Conditions
  Actions
    Quest - Create a Required quest titled Hotkeys with the description 1 Abilities: Q2 Abilities: W3 Abilities: E4 Abilities: R1 Sub-Abilities: D2 Sub-Abilities: F, using icon path PASBTNCredit.tga
Init
  Events
    Map initialization
  Conditions
  Actions
    Visibility - Disable fog of war
    Visibility - Disable black mask
    Game - Set the time of day to 12
    Game - Display to (All players) for 20.00 seconds the text: Intro'Z: -IntroZSee the command by opening Map InfoHave funZBy LembidiZ
    Unit - Add Impulse to Spell Tester 0000 <gen>
    Unit - Add Body Replacement to Spell Tester 0000 <gen>
    Unit - Add Charm Heal to Spell Tester 0000 <gen>
    Unit - Add Flash Jump to Spell Tester 0000 <gen>
    Unit - Add Hesoyham to Spell Tester 0000 <gen>
    Unit - Add Restart to Spell Tester 0000 <gen>
Entering Everlies Magic Research Temple
  Events
    Unit - A unit enters Everlies_Magic_Research_Temple <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFEntering:Everlies Magic Research Temple|r
    Cinematic - Ping minimap for (All players) at (Center of Everlies_Magic_Research_Temple <gen>) for 1 seconds
LeavingEverlies Magic Research Temple
  Events
    Unit - A unit leaves Everlies_Magic_Research_Temple <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFLeaving:Everlies Magic Research Temple|r
    Cinematic - Ping minimap for (All players) at (Center of Everlies_Magic_Research_Temple <gen>) for 1 seconds
Entering Land Of Remake
  Events
    Unit - A unit enters Land_Of_Remake <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFEntering:Land Of Remake|r
    Cinematic - Ping minimap for (All players) at (Center of Land_Of_Remake <gen>) for 1 seconds
Leaving Land Of Remake
  Events
    Unit - A unit leaves Land_Of_Remake <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFLeaving:Land Of Remake|r
    Cinematic - Ping minimap for (All players) at (Center of Land_Of_Remake <gen>) for 1 seconds
Entering Black Shop Island
  Events
    Unit - A unit enters Black_Shop_Island <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFEntering:Black Shop Island|r
    Cinematic - Ping minimap for (All players) at (Center of Black_Shop_Island <gen>) for 1 seconds
Leaving Black Shop Island
  Events
    Unit - A unit leaves Black_Shop_Island <gen>
  Conditions
    (Owner of (Triggering unit)) Equal to Player 1 (Red)
    ((Triggering unit) is A Hero) Equal to True
  Actions
    Game - Display to (All players) for 4.00 seconds the text: |c008080FFLeaving:Black Shop Island|r
    Cinematic - Ping minimap for (All players) at (Center of Black_Shop_Island <gen>) for 1 seconds
A1
  Events
    Unit - A unit enters A1 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0007 <gen> to 1
A2
  Events
    Unit - A unit enters A2 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0007 <gen> to 1
A3
  Events
    Unit - A unit enters A3 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0008 <gen> to 1
A4
  Events
    Unit - A unit enters A4 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0008 <gen> to 1
A5
  Events
    Unit - A unit enters A5 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0009 <gen> to 1
A6
  Events
    Unit - A unit enters A6 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0009 <gen> to 1
A7
  Events
    Unit - A unit enters A7 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0000 <gen> to 1
A8
  Events
    Unit - A unit enters A8 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0000 <gen> to 1
A9
  Events
    Unit - A unit enters A9 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0006 <gen> to 1
A10
  Events
    Unit - A unit enters A10 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0006 <gen> to 1
A11
  Events
    Unit - A unit enters A11 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0011 <gen> to 1
A12
  Events
    Unit - A unit enters A12 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0011 <gen> to 1
A13
  Events
    Unit - A unit enters A13 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0001 <gen> to 1
A14
  Events
    Unit - A unit enters A14 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0001 <gen> to 1
A15
  Events
    Unit - A unit enters A15 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0002 <gen> to 1
A16
  Events
    Unit - A unit enters A16 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0002 <gen> to 1
A17
  Events
    Unit - A unit enters A17 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0003 <gen> to 1
A18
  Events
    Unit - A unit enters A18 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0003 <gen> to 1
A19
  Events
    Unit - A unit enters A19 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0010 <gen> to 1
A20
  Events
    Unit - A unit enters
  Conditions
  Actions
    Destructible - Set height of Elevator 0010 <gen> to 1
B1
  Events
    Unit - A unit enters B1 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0007 <gen> to 2
B2
  Events
    Unit - A unit enters B2 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0007 <gen> to 2
B3
  Events
    Unit - A unit enters B3 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0008 <gen> to 2
B4
  Events
    Unit - A unit enters B4 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0008 <gen> to 2
B5
  Events
    Unit - A unit enters B5 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0009 <gen> to 2
B6
  Events
    Unit - A unit enters B6 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0009 <gen> to 2
B7
  Events
    Unit - A unit enters B7 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0005 <gen> to 2
B8
  Events
    Unit - A unit enters B8 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0005 <gen> to 2
B9
  Events
    Unit - A unit enters B9 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0010 <gen> to 2
B10
  Events
    Unit - A unit enters B10 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0010 <gen> to 2
B11
  Events
    Unit - A unit enters B11 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0011 <gen> to 2
B12
  Events
    Unit - A unit enters B12 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0011 <gen> to 2
B13
  Events
    Unit - A unit enters B13 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0005 <gen> to 2
B14
  Events
    Unit - A unit enters B14 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0004 <gen> to 2
B15
  Events
    Unit - A unit enters B15 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0004 <gen> to 2
B16
  Events
    Unit - A unit enters B16 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0004 <gen> to 2
B17
  Events
    Unit - A unit enters B17 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0004 <gen> to 2
B18
  Events
    Unit - A unit enters B18 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0001 <gen> to 2
B19
  Events
    Unit - A unit enters B19 <gen>
  Conditions
  Actions
    Destructible - Set height of Elevator 0001 <gen> to 2
B20
  Events
    Unit - A unit enters
  Conditions
  Actions
    Destructible - Set height of Elevator 0005 <gen> to 2
function Trig_Footie_Spawn_1_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'h001', Player(1), GetRectCenter(gg_rct_Land_Of_Remake), bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Footie_Spawn_1 takes nothing returns nothing
    set gg_trg_Footie_Spawn_1 = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Footie_Spawn_1, Player(0), "-footie", false )
    call TriggerAddAction( gg_trg_Footie_Spawn_1, function Trig_Footie_Spawn_1_Actions )
endfunction

 
function Trig_Balack_Spawn_1_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'h002', Player(1), GetRectCenter(gg_rct_Land_Of_Remake), bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Balack_Spawn_1 takes nothing returns nothing
    set gg_trg_Balack_Spawn_1 = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Balack_Spawn_1, Player(0), "-balack", false )
    call TriggerAddAction( gg_trg_Balack_Spawn_1, function Trig_Balack_Spawn_1_Actions )
endfunction

 
//TESH.scrollpos=19
//TESH.alwaysfold=0
//*******
//* This request was made here:
//*     http://www.hiveworkshop.com/forums/requests-341/mr_beans-spell-workshop-215436/index72.html#post2356053
//*     http://www.hiveworkshop.com/forums/requests-341/mr_beans-spell-workshop-215436/index73.html#post2356355
//*
//* If you are having trouble importing your spells, check out this guide:
//*     http://tiny.cc/importing-guide
//*
//* If you are still having problems, feel free to contact me:
//*     http://tiny.cc/mrbean-hive
//*     mrbean987789@gmail.com
//*
//* You can find my spell workshop here:
//*     http://tiny.cc/spellworkshop
//*******

- Copy all of the triggers in the "Requirements" folder that you don't alreay have.
    * If you copied "xebasic", do the following:
        > Import the included "dummy.mdx" file. Don'
t change the import path.
        > Copy over the "Dummy" unit. Make sure it's model is set to the imported one.
        > Open the copied "xebasic" trigger. Make sure XE_DUMMY_UNITID is set to the raw ID of the
            copied Dummy unit.
    * If you copied "Damage Engine", do the following:
        > Copy the "Cheat Death Ability (+500,000)" ability.
        > Open the "Damage Engine" trigger and make sure the second action sets the "DamageBlockingAbility"
            variable to the copied ability.
           
- Copy all of the triggers in the "Spells" folder.

- Copy all of the custom abilities.

- For each spell, open it'
s trigger. Update all of the raw IDs in the configurables section
    (for example, SPELL_ID) to the values as specified next to each configurable.
By:
LembidiZ
Body Replacement
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Body Replacement
  Actions
    Floating Text - Create floating text that reads Huft.... above (Casting unit) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
    Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90 degrees
    Special Effect - Create a special effect attached to the chest (attachpoint) of (Casting unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    Unit - Move (Casting unit) instantly to (Target point of ability being cast)
    Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    Special Effect - Destroy (Last created special effect)
By:
Paladon
Jump System 1
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        JD_Integers[1] Equal to 0
      Then - Actions
        Trigger - Turn on Jump_System_2 <gen>
      Else - Actions
    Set VariableSet JD_Integers[1] = (JD_Integers[1] + 1)
    Set VariableSet JD_Integers[2] = (JD_Integers[2] + 1)
    Set VariableSet JD_TempPoint[1] = (Position of JDA_Unit)
    Set VariableSet JD_Distances[JD_Integers[2]] = (Distance between JD_TempPoint[1] and JDA_TargetPoint)
    Set VariableSet JD_ReachedDistance[JD_Integers[2]] = 0.00
    Set VariableSet JD_SpeedUnits[JD_Integers[2]] = JDA_Speed
    Set VariableSet JD_Unit[JD_Integers[2]] = JDA_Unit
    Set VariableSet JD_Angle[JD_Integers[2]] = (Angle from JD_TempPoint[1] to JDA_TargetPoint)
    Set VariableSet JD_Effect[JD_Integers[2]] = JDA_SpecialEffect
    Set VariableSet JD_Animations[JD_Integers[2]] = JDA_Animation
    Set VariableSet JD_TreesDestroy[JD_Integers[2]] = JDA_DestroyTrees_Dash
    Set VariableSet JD_HighSettings[JD_Integers[2]] = (JDA_JumpHigh_Distance x JD_Distances[JD_Integers[2]])
    Unit - Turn collision for JDA_Unit Off.
    Animation - Change JDA_Unit's animation speed to (JDA_AnimationSpeed x 100.00)% of its original speed
    Animation - Play JDA_Unit's JDA_Animation animation
    Unit Group - Add JDA_Unit to JD_Group
    Unit - Add Storm Crow Form to JDA_Unit
    Unit - Remove Storm Crow Form from JDA_Unit
    Custom script: call RemoveLocation (udg_JD_TempPoint[1])
    Custom script: call RemoveLocation (udg_JDA_TargetPoint)
    -------- By Paladon --------
Jump System 2
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer JD_Integers[3]) from 1 to JD_Integers[2], do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (JD_Unit[JD_Integers[3]] is in JD_Group.) Equal to True
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                JD_ReachedDistance[JD_Integers[3]] Less than JD_Distances[JD_Integers[3]]
              Then - Actions
                Animation - Queue JD_Unit[JD_Integers[3]]'s JD_Animations[JD_Integers[3]] animation
                Set VariableSet JD_TempPoint[1] = (Position of JD_Unit[JD_Integers[3]])
                Set VariableSet JD_TempPoint[2] = (JD_TempPoint[1] offset by JD_SpeedUnits[JD_Integers[3]] towards JD_Angle[JD_Integers[3]] degrees.)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    JD_TreesDestroy[JD_Integers[3]] Equal to True
                  Then - Actions
                    Destructible - Pick every destructible within 150.00 of JD_TempPoint[2] and do (Kill (Picked destructible))
                  Else - Actions
                Unit - Move JD_Unit[JD_Integers[3]] instantly to JD_TempPoint[2]
                Set VariableSet JD_ReachedDistance[JD_Integers[3]] = (JD_ReachedDistance[JD_Integers[3]] + JD_SpeedUnits[JD_Integers[3]])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 5) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect attached to the chest (attachpoint) of JD_Unit[JD_Integers[3]] using JD_Effect[JD_Integers[3]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                Set VariableSet JD_RealTimer[JD_Integers[3]] = (JD_RealTimer[JD_Integers[3]] + (180.00 / (JD_Distances[JD_Integers[3]] / JD_SpeedUnits[JD_Integers[3]])))
                Set VariableSet JD_JumpHigh[JD_Integers[3]] = ((Sin(JD_RealTimer[JD_Integers[3]])) x JD_HighSettings[JD_Integers[3]])
                Animation - Change JD_Unit[JD_Integers[3]] flying height to JD_JumpHigh[JD_Integers[3]] at 1000000000.00
                Custom script: call RemoveLocation (udg_JD_TempPoint[1])
                Custom script: call RemoveLocation (udg_JD_TempPoint[2])
              Else - Actions
                Unit - Turn collision for JD_Unit[JD_Integers[3]] On.
                Unit Group - Remove JD_Unit[JD_Integers[3]] from JD_Group.
                Animation - Change JD_Unit[JD_Integers[3]]'s animation speed to 100.00% of its original speed
                Animation - Reset JD_Unit[JD_Integers[3]]'s animation
                Set VariableSet JD_RealTimer[JD_Integers[3]] = 0.00
                Set VariableSet JD_Integers[1] = (JD_Integers[1] - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    JD_Integers[1] Equal to 0
                  Then - Actions
                    Set VariableSet JD_Integers[2] = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
          Else - Actions
            -------- By Paladon --------
Actions to apply
  Events
  Conditions
  Actions
    -------- This are the actions to apply in your spell to use an effect of this system. --------
    -------- --------
    Set VariableSet JDA_JumpHigh_Distance = 1.00
    -------- This variable returns the base value of the high of the jump. --------
    -------- The Jump´s high is calculated by the distance jumped and by this value. --------
    -------- The higher this value is, the higher is the jump. I recommend to leave it at 1.00 . --------
    -------- --------
    Set VariableSet JDA_DestroyTrees_Dash = True
    -------- !Don´t pay attention to this variable if you have choosen the Jump effect! --------
    -------- This variable returns whether the hero should destroy trees while dashing. --------
    -------- Set this variable toTrue to destroy trees in the dashing unit´s way. --------
    -------- --------
    Set VariableSet JDA_TargetPoint = (Target point of ability being cast)
    -------- This returns where the target position of the Jump/Dash should be. --------
    -------- --------
    Set VariableSet JDA_Unit = (Triggering unit)
    -------- This returns the unit which shall jump/dash. --------
    -------- --------
    Set VariableSet JDA_Speed = 10.00
    -------- This returns the speed of the jump/dash. --------
    -------- --------
    Set VariableSet JDA_SpecialEffect = Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
    -------- This returns the path for the used special effect. --------
    -------- --------
    Set VariableSet JDA_Animation = slam
    -------- This returns the animation of the unit jumping/dashing. --------
    -------- --------
    Set VariableSet JDA_AnimationSpeed = 0.60
    -------- This returns the animation speed of the jumping/dashing unit. --------
    -------- --------
    Trigger - Run Jump_System_1 <gen> (checking conditions)
    -------- After setting all needed variables, this calls the system to execute the choosen effects on the choosen unit/units. --------
    -------- --------
    -------- By Paladon --------
Sample Spell Jump
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Flash Jump
  Actions
    Floating Text - Create floating text that reads Heah!! above (Casting unit) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90 degrees
    Set VariableSet JDA_JumpHigh_Distance = (1.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
    Set VariableSet JDA_DestroyTrees_Dash = False
    Set VariableSet JDA_Collusion = False
    Set VariableSet JDA_TargetPoint = (Target point of ability being cast)
    Set VariableSet JDA_Unit = (Triggering unit)
    Set VariableSet JDA_Speed = 20.00
    Set VariableSet JDA_SpecialEffect = Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
    Set VariableSet JDA_Animation = walk
    Set VariableSet JDA_AnimationSpeed = 0.02
    Trigger - Run Jump_System_1 <gen> (checking conditions)
    -------- By Paladon --------
By:
Mr. Bean
Charm Heal
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Charm Heal
  Actions
    Floating Text - Create floating text that reads Charm Heal!! above (Casting unit) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90 degrees
    Set VariableSet HealUnit = (Target unit of ability being cast)
    Set VariableSet HealAmount = ((Max life of HealUnit) x 0.20)
    Unit - Set life of HealUnit to ((Life of HealUnit) + HealAmount)
    -------- By Mr. Bean --------
Times Block
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to Times Block
  Actions
    Unit - Remove Times Block from TimesBlockCaster
    Set VariableSet TimesBlockCaster = (Triggering unit)
    Unit - Pause all units
    Unit - Unpause TimesBlockCaster
    Wait 10.00 seconds
    Unit - Unpause all units
    Unit - Add Times Block to TimesBlockCaster
Adds Times Block
  Events
    Player - Player 1 (Red) types a chat message containing -times block (stringnoformat) as An exact match
  Conditions
  Actions
    Unit - Add Times Block to Spell Tester 0000 <gen>
    Trigger - Turn off (This trigger)
By:
defskull
Assign Hashtable
  Events
    Map initialization
  Conditions
  Actions
    Hashtable - Create a hashtable
    Set VariableSet Hashtable_Split_Dimension = (Last created hashtable)
Times Frenzys Start
  Events
    Unit - A unit Starts the effect of an ability
  Conditions
    (Ability being cast) Equal to
  Actions
    Unit - Remove from (Triggering unit)
    Hashtable - Save 10 as (Key loop.) of (Key (Triggering unit).) in Hashtable_Split_Dimension.
    Hashtable - Save Handle Of(Target unit of ability being cast) as (Key target.) of (Key (Triggering unit).) in Hashtable_Split_Dimension.
    Unit Group - Add (Triggering unit) to Split_Dimension_Group
    Trigger - Turn on Times_Frenzys_Loop <gen>
Times Frenzys Loop
  Events
    Time - Every 0.20 seconds of game time
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Split_Dimension_Group is empty) Equal to True
      Then - Actions
        Trigger - Turn off (This trigger)
      Else - Actions
        Unit Group - Pick every unit in Split_Dimension_Group and do (Actions)
          Loop - Actions
            Set VariableSet Temp_Integer = (Load (Key loop.) of (Key (Picked unit).) from Hashtable_Split_Dimension.)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                Temp_Integer Greater than 0
              Then - Actions
                Set VariableSet Point_Split_Dimension[0] = (Position of (Picked unit))
                Set VariableSet Point_Split_Dimension[1] = (Position of (Load (Key target.) of (Key (Picked unit).) in Hashtable_Split_Dimension.))
                Set VariableSet Point_Split_Dimension[2] = (Point_Split_Dimension[0] offset by 450.00 towards (Random real number between 0 and 360.00) degrees.)
                Special Effect - Create a special effect at Point_Split_Dimension[1] using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Unit - Move (Load (Key target.) of (Key (Picked unit).) in Hashtable_Split_Dimension.) instantly to Point_Split_Dimension[2]
                Unit - Cause (Picked unit) to damage (Load (Key target.) of (Key (Picked unit).) in Hashtable_Split_Dimension.), dealing 100.00 damage of attack type Spells and damage type Normal
                Set VariableSet Temp_Integer = (Temp_Integer - 1)
                Hashtable - Save Temp_Integer as (Key loop.) of (Key (Picked unit).) in Hashtable_Split_Dimension.
                Custom script: call RemoveLocation (udg_Point_Split_Dimension[0])
                Custom script: call RemoveLocation (udg_Point_Split_Dimension[1])
                Custom script: call RemoveLocation (udg_Point_Split_Dimension[2])
              Else - Actions
                Unit Group - Remove (Picked unit) from Split_Dimension_Group.
                Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable_Split_Dimension.
                Unit - Add to Spell Tester 0000 <gen>
Adds Times Frenzys
  Events
    Player - Player 1 (Red) types a chat message containing -times frenzys (stringnoformat) as An exact match
  Conditions
  Actions
    Unit - Add to Spell Tester 0000 <gen>
    Trigger - Turn off (This trigger)
What do i need for this spell?

Copy and paste the variables with the prefix 'LS_' into your map. Then copy the trigger 'Lightning Strike'.
Additionally you need all the custom object editor data with the '(LS)' suffix.
Important!
You need my GUI Knockback System to use the knockback effects of this spell.
If you don´t use the knockbacks, delete the actions (contained in the unit group loop 'LS_Groups[1]') between
'-------- Knockback System --------' and '-------- End System --------'.
If you want to use the knockback effect, copy the GUI Knockback System Triggers as well as the 'KB_' and the 'KBA_' variables into your map.
Or i recommend you to download the system from http://www.hiveworkshop.com/forums/resource.php?t=107719
The downloaded system includes a full documentation how to use it.

By:
Paladon
Impulse
  Events
    Unit - A unit Begins casting an ability
  Conditions
    (Ability being cast) Equal to Impulse
  Actions
    Floating Text - Create floating text that reads Impulse!! above (Casting unit) with Z offset 0, using font size 10, color (100%, 100%, 100%), and 0% transparency
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90 degrees
    Set VariableSet LS_TempPoint[1] = (Position of (Triggering unit))
    Set VariableSet LS_TempPoint[2] = (Target point of ability being cast)
    Set VariableSet LS_TempPoint[3] = (LS_TempPoint[2] offset by 400.00 towards (Angle from LS_TempPoint[2] to LS_TempPoint[1]) degrees.)
    -------- --------
    -------- SET WHAT UNIT DO YOU WANT --------
    -------- --------
    Unit - Create 1.Lightning Strike Down Dummy (LS) for (Owner of (Triggering unit)) at LS_TempPoint[2] facing Default building facing degrees
    Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    Unit - Make (Last created unit) Explode on death
    Set VariableSet LS_Dummy = (Last created unit)
    For each (Integer LS_GeneralInteger) from 1 to 3, do (Actions)
      Loop - Actions
        -------- --------
        -------- SET WHAT UNIT DO YOU WANT --------
        -------- --------
        Unit - Create 1.Lightning Strike Dummy (LS) for (Owner of (Triggering unit)) at LS_TempPoint[3] facing Default building facing degrees
        Unit - Order (Last created unit) to Special Archimonde - Finger Of Death.LS_Dummy
        Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        Unit - Make (Last created unit) Explode on death
    -------- --------
    -------- What effect when it impack --------
    -------- --------
    Special Effect - Create a special effect at LS_TempPoint[2] using Stomp.mdx
    Special Effect - Destroy (Last created special effect)
    -------- --------
    -------- What effect of lightning bolt --------
    -------- --------
    Special Effect - Create a special effect at LS_TempPoint[2] using
    Special Effect - Destroy (Last created special effect)
    Set VariableSet LS_Groups[1] = (Units within 200.00 of LS_TempPoint[2] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True)))).)
    Unit Group - Pick every unit in LS_Groups[1] and do (Actions)
      Loop - Actions
        -------- --------
        -------- Set damage --------
        -------- --------
        Unit - Cause (Triggering unit) to damage (Picked unit), dealing 400.00 damage of attack type Spells and damage type Normal
        -------- Knockback System --------
        Set VariableSet KBA_Caster = (Triggering unit)
        Set VariableSet KBA_TargetUnit = (Picked unit)
        Set VariableSet KBA_StartingPosition = (Target point of ability being cast)
        Set VariableSet KBA_Level = (Level of (Ability being cast) for (Triggering unit))
        Set VariableSet KBA_Speed = 10.00
        Set VariableSet KBA_DistancePerLevel = 400.00
        Set VariableSet KBA_SpecialEffects[1] = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
        Set VariableSet KBA_SpecialEffects[2] =
        Set VariableSet KBA_DestroyTrees = True
        Trigger - Run Cast_A_Knockback <gen> (checking conditions)
        -------- End System --------
    Custom script: call RemoveLocation (udg_LS_TempPoint[1])
    Custom script: call RemoveLocation (udg_LS_TempPoint[2])
    Custom script: call RemoveLocation (udg_LS_TempPoint[3])
    Custom script: call DestroyGroup (udg_LS_Groups[1])
Cast A Knockback
  Events
  Conditions
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (KBA_TargetUnit is in KB_KnockbackedUnits.) Equal to True
      Then - Actions
        Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits.
        Set VariableSet KB_CountBuffs = (KB_CountBuffs - 1)
        For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
          Loop - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_Units[KB_GeneralIntegers[1]] Equal to KBA_TargetUnit
              Then - Actions
                Set VariableSet KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                Set VariableSet KB_GeneralIntegers[2] = KB_TotalKnockUnits
              Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
          Then - Actions
            Set VariableSet KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
            Set VariableSet KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
            Set VariableSet KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
            Set VariableSet KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
            Set VariableSet KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
            Set VariableSet KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
            Set VariableSet KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
            Set VariableSet KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
            Set VariableSet KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
            Set VariableSet KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
          Else - Actions
        Set VariableSet KB_Units[KB_TotalKnockUnits] = No unit
        Set VariableSet KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            KB_CountBuffs Equal to 0
          Then - Actions
            Set VariableSet KB_TotalKnockUnits = 0
            Trigger - Turn off GetKnockback <gen>
          Else - Actions
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        KB_CountBuffs Equal to 0
      Then - Actions
        Trigger - Turn on GetKnockback <gen>
      Else - Actions
    Set VariableSet KB_CountBuffs = (KB_CountBuffs + 1)
    Set VariableSet KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
    Set VariableSet KB_Casters[KB_TotalKnockUnits] = KBA_Caster
    Set VariableSet KB_Levels[KB_TotalKnockUnits] = KBA_Level
    Set VariableSet KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
    Set VariableSet KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
    Set VariableSet KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
    Set VariableSet KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
    Set VariableSet KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
    Set VariableSet KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
    Set VariableSet KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
    Set VariableSet KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
    Set VariableSet KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
    Set VariableSet KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
    Set VariableSet KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
    Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
    Custom script: call RemoveLocation (udg_KBA_StartingPosition)
    Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
    Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
GetKnockback
  Events
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits.) Equal to True
          Then - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                KB_ReachedDistance[KB_GeneralIntegers[1]] Greater than or equal to KB_MaxDistance[KB_GeneralIntegers[1]]
              Then - Actions
                Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits.
                Set VariableSet KB_CountBuffs = (KB_CountBuffs - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_TotalKnockUnits Greater than KB_GeneralIntegers[1]
                  Then - Actions
                    Set VariableSet KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                    Set VariableSet KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                    Set VariableSet KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                    Set VariableSet KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                    Set VariableSet KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                    Set VariableSet KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                    Set VariableSet KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                    Set VariableSet KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                    Set VariableSet KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                    Set VariableSet KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                  Else - Actions
                Set VariableSet KB_Units[KB_TotalKnockUnits] = No unit
                Set VariableSet KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_CountBuffs Equal to 0
                  Then - Actions
                    Set VariableSet KB_TotalKnockUnits = 0
                    Trigger - Turn off (This trigger)
                  Else - Actions
              Else - Actions
                Set VariableSet KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                Set VariableSet KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                Set VariableSet KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                Set VariableSet KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                Set VariableSet KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees.)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    KB_DestroyTrees[KB_GeneralIntegers[1]] Equal to True
                  Then - Actions
                    Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                      Loop - Actions
                        Destructible - Kill (Picked destructible)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 5) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    (Random integer number between 1 and 7) Equal to 1
                  Then - Actions
                    Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                    Special Effect - Destroy (Last created special effect)
                  Else - Actions
                Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                Set VariableSet KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
          Else - Actions
By:
Mr_Bean
//TESH.scrollpos=24
//TESH.alwaysfold=0
scope Hesoyham

    // -----
    // Start of Configurables
    // -----

    globals
   
        private constant integer SPELL_ID       = 'A008'    // "Hesoyham" ability.
       
        //============================================================
        //=== CHANNELLING
        private constant real    CHANNEL_TIME   = 2.0       // Channel duration.
        private constant real    START_SCALE    = 0.0       // Starting scale of the orb.
        private constant real    END_SCALE      = 4.0       // Ending scale of the orb.
        private constant real    CREATE_DIST    = 0.0     // Distance the orb is created from the caster.
        // Order ID of the spell:
        private constant string  ORDER_ID       = "shockwave"
       
        //============================================================
        //=== ORB MOVEMENT
        private constant real    DISTANCE       = 1000.0    // Orb travel distance.
        private constant real    MISSILE_HEIGHT = 50.0      // Orb travel height.
        private constant real    MISSILE_SPEED  = 500.0     // Orb travel speed.
        private constant real    MISSILE_ARC    = 0.0       // Orb travel arc.
        private constant real    DAMAGE_AOE     = 240.0     // Distance enemies must get to be damaged.
        private constant real    KNOCK_DAMAGE   = 200.0     // Damage dealt.
        // Orb model:
        private constant string  MISSILE_ART    = "OrbWaterX.mdx"
       
        //============================================================
        //=== EXPLOSION
        private constant real    EXPLODE_AOE    = 400.0     // Final explosion AoE.
        private constant real    EXPLODE_DAMAGE = 400.0     // Final explosion damage.
       
        //============================================================
        //=== KNOCKBACK
        private constant real    KNOCK_DISTANCE = 400.0     // Knockback distance.
        private constant real    KNOCK_SPEED    = 200.0     // Knockback speed.
        private constant real    EFFECT_FREQ    = 0.25      // How often effects are created on knocked back units.
        // Knockback effect:
        private constant string  KNOCK_EFFECT   = "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl"
        // Effect attachment point:
        private constant string  KNOCK_ATTACH   = "chest"
       
    endglobals
   
    // -----
    // End of Configurables
    // -----
   
    private struct Knockback
        static constant real INCREMENT = KNOCK_SPEED * T32_PERIOD
        //-----
        static hashtable data = InitHashtable()
        //-----
        unit    target
        integer id
        real    dist   = KNOCK_DISTANCE
        real    cos
        real    sin
        real    ticker
        //-----
       
        private method destroy takes nothing returns nothing
            call stopPeriodic()
            call SaveInteger(data, id, 0, 0)
            call PauseUnit(target, false)
            call SetUnitPathing(target, true)
            set target = null
            call deallocate()
        endmethod
       
        private method periodic takes nothing returns nothing
            local real x = GetUnitX(target) + INCREMENT * cos
            local real y = GetUnitY(target) + INCREMENT * sin
           
            if (not IsUnitType(target, UNIT_TYPE_DEAD) and IsTerrainWalkable(x, y) and dist > 0.0) then
                call SetUnitX(target, x)
                call SetUnitY(target, y)
                set dist = dist - INCREMENT
               
                // Create effect if necessary:
                if (ticker >= EFFECT_FREQ) then
                    call DestroyEffect(AddSpecialEffectTarget(KNOCK_EFFECT, target, KNOCK_ATTACH))
                    set ticker = 0.0
                else
                    set ticker = ticker + T32_PERIOD
                endif
            else
                call destroy()
            endif
        endmethod
       
        implement T32x
       
        static method start takes unit whichUnit, real angle returns thistype
            local thistype this = allocate()
            local thistype other
           
            set target = whichUnit
            set id = GetHandleId(target)
            set other = LoadInteger(data, id, 0)
           
            if (other != 0) then
                call other.destroy()
            endif
           
            set cos = Cos(angle)
            set sin = Sin(angle)
            set ticker = EFFECT_FREQ  // So that effect is created on first tick.
            call PauseUnit(target, true)
            call SetUnitPathing(target, false)
            call SaveInteger(data, id, 0, this)
            call startPeriodic()
       
            return this
        endmethod
   
    endstruct
   
    private struct SpellData
        static constant real    GROWTH       = ((END_SCALE - START_SCALE) / CHANNEL_TIME) * T32_PERIOD
        static constant real    INCREMENT    = MISSILE_SPEED * T32_PERIOD
        static          integer ORDER_ID_INT = 0 // set in onInit method.
        //-----
        static group enumG = CreateGroup()
        static unit temp
        //-----
        unit    caster
        player  owner
        group   hit
        boolean moving = false
        real    scale  = START_SCALE
        real    time   = CHANNEL_TIME
        real    cos
        real    sin
        xefx    fx
        //-----
       
        private method destroy takes nothing returns nothing
            call ReleaseGroup(hit)
            call fx.destroy()
            call stopPeriodic()
            set caster = null
            set hit = null
            set owner = null
            call deallocate()
        endmethod
       
        private method unitFilter takes unit u returns boolean
            return IsUnitEnemy(u, owner) /*
                */
and not IsUnitType(u, UNIT_TYPE_DEAD) /*
                */
and not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) /*
                */
and not IsUnitType(u, UNIT_TYPE_STRUCTURE)
        endmethod
       
        private method explode takes nothing returns nothing
            call GroupEnumUnitsInRange(enumG, fx.x, fx.y, EXPLODE_AOE, null)
           
            for temp in enumG
                if (unitFilter(temp)) then
                    call UnitDamageTarget(caster, temp, EXPLODE_DAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
                    call Knockback.start(temp, Atan2(GetUnitY(temp) - fx.y, GetUnitX(temp) - fx.x))
                endif
            endfor
        endmethod
       
        private method checkNearby takes nothing returns nothing
            call GroupEnumUnitsInRange(enumG, fx.x, fx.y, DAMAGE_AOE, null)
           
            for temp in enumG
                if (not IsUnitInGroup(temp, hit) and unitFilter(temp)) then
                    call GroupAddUnit(hit, temp)
                    call UnitDamageTarget(caster, temp, KNOCK_DAMAGE, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, null)
                    call Knockback.start(temp, Atan2(GetUnitY(temp) - fx.y, GetUnitX(temp) - fx.x))
                endif
            endfor
        endmethod
       
        private method periodic takes nothing returns nothing
            // Missile has been launched:
            if (moving) then
                set fx.x = fx.x + cos
                set fx.y = fx.y + sin
                call checkNearby()
                set time = time - T32_PERIOD
                if (time <= 0.0) then
                    call explode()
                    call destroy()
                endif
            // Still channelling and caster cancelled:
            elseif (GetUnitCurrentOrder(caster) != ORDER_ID_INT) then
                call destroy()
            // Still channelling:
            else
                set time = time - T32_PERIOD
                // Time is up:
                if (time <= 0.0) then
                    call IssueImmediateOrder(caster, "stop")
                    set moving = true
                    set time = DISTANCE / MISSILE_SPEED
                // Grow orb:
                else
                    set scale = scale + GROWTH
                    set fx.scale = scale
                endif
            endif
        endmethod
       
        implement T32x
       
        private static method create takes nothing returns thistype
            local thistype this = allocate()
            local real angle
           
            set caster = GetTriggerUnit()
            set owner = GetTriggerPlayer()
            set hit = NewGroup()
            set angle = Atan2(GetSpellTargetY() - GetUnitY(caster), GetSpellTargetX() - GetUnitX(caster))
            set cos = INCREMENT * Cos(angle)
            set sin = INCREMENT * Sin(angle)
            set fx = xefx.create(GetUnitX(caster) + CREATE_DIST * Cos(angle), GetUnitY(caster) + CREATE_DIST * Sin(angle), 0.0)
            set fx.fxpath = MISSILE_ART
            set fx.scale = scale
            call startPeriodic()
           
            return this
        endmethod
   
        private static method onInit takes nothing returns nothing
            set ORDER_ID_INT = OrderId(ORDER_ID)
            call RegisterSpellEffectEvent(SPELL_ID, function thistype.create)
            call Preload(MISSILE_ART)
            call Preload(KNOCK_EFFECT)
        endmethod
   
    endstruct

endscope
By:
Mr_Bean
//TESH.scrollpos=27
//TESH.alwaysfold=0
scope Restart initializer OnInit

    // -----
    // Start of Configurables
    // -----

    globals
   
        private constant integer SPELL_ID       = 'A009'    // "Restart" ability.
        private constant real    MIN_HEALTH     = 1.0       // The target cannot have less that this much HP.
       
        // Effect created on target for the duration:
        private constant string  TARGET_EFFECT  = "Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl"
       
        // Attachment point for the above effect:
        private constant string  TARGET_ATTACH  = "overhead"
       
        // Effect created on target if it gets fully restored:
        private constant string  HEAL_EFFECT    = "Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl"
       
        // Attachment point for the above effect:
        private constant string  HEAL_ATTACH    = "origin"
       
    endglobals
   
    // Configure how the duration is calculated:
    private function GetDuration takes integer level returns real
        return 1.0 + level
    endfunction
   
    // -----
    // End of Configurables
    // -----
   
    globals
        private group units = CreateGroup()
    endglobals
   
    private struct SpellData
        static integer array instances
        //-----
        unit    target
        effect  fx
        boolean heal   = false
        //-----
       
        static method get takes unit u returns thistype
            return instances[GetUnitUserData(u)]
        endmethod
       
        private static method expire takes nothing returns nothing
            local thistype this = GetTimerData(GetExpiredTimer())
           
            if (heal) then
                call SetWidgetLife(target, GetUnitState(target, UNIT_STATE_MAX_LIFE))
                call SetUnitState(target, UNIT_STATE_MANA, GetUnitState(target, UNIT_STATE_MAX_MANA))
                call UnitRemoveBuffs(target, true, true)
                call DestroyEffect(AddSpecialEffectTarget(HEAL_EFFECT, target, HEAL_ATTACH))
            endif
           
            call ReleaseTimer(GetExpiredTimer())
            call DestroyEffect(fx)
            call GroupRemoveUnit(units, target)
            set instances[GetUnitUserData(target)] = 0
            set target = null
            set fx = null
            call deallocate()
        endmethod
       
        static method create takes nothing returns thistype
            local thistype this = allocate()
           
            set target = GetSpellTargetUnit()
            set fx = AddSpecialEffectTarget(TARGET_EFFECT, target, TARGET_ATTACH)
            set instances[GetUnitUserData(target)] = this
            call GroupAddUnit(units, target)
            call TimerStart(NewTimerEx(this), GetDuration(GetUnitAbilityLevel(GetTriggerUnit(), SPELL_ID)), false, function thistype.expire)

            return this
        endmethod
   
    endstruct
   
    private function OnDamage takes nothing returns boolean
        local real life
       
        if (IsUnitInGroup(udg_DamageEventTarget, units)) then
            set life = GetWidgetLife(udg_DamageEventTarget)
            if (udg_DamageEventPrevAmt >= life) then
                set udg_DamageEventAmount = life - MIN_HEALTH
                set SpellData(SpellData.get(udg_DamageEventTarget)).heal = true
            endif
        endif
       
        return false
    endfunction
   
    private function OnInit takes nothing returns nothing
        local trigger t = CreateTrigger()
       
        call RegisterSpellEffectEvent(SPELL_ID, function SpellData.create)
        call TriggerAddCondition(t, Condition(function OnDamage))
        call TriggerRegisterVariableEvent(t, "udg_DamageModifierEvent", EQUAL, 1.0)
        call Preload(TARGET_EFFECT)
        call Preload(HEAL_EFFECT)
    endfunction

endscope
Respawn Tree
  Events
    Player - Player 1 (Red) types a chat message containing -Respawn Tree (stringnoformat) as An exact match
  Conditions
  Actions
    Destructible - Resurrect DyingTree with (Max life of DyingTree) life and Hide birth animation
Dying Tree
  Events
    Destructible - A destructible within (Playable map area) dies
  Conditions
  Actions
    Set VariableSet DyingTree = (Dying destructible)
Explode
  Events
    Player - Player 1 (Red) types a chat message containing -Explode (stringnoformat) as An exact match
  Conditions
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Explode (Picked unit).
Kill
  Events
    Player - Player 1 (Red) types a chat message containing -Kill (stringnoformat) as An exact match
  Conditions
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Kill (Picked unit)
Remove
  Events
    Player - Player 1 (Red) types a chat message containing -Remove (stringnoformat) as An exact match
  Conditions
    ((Picked unit) is A Hero) Equal to False
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Remove (Picked unit) from the game
Gold
  Events
    Player - Player 1 (Red) types a chat message containing -Gold (stringnoformat) as A substring
  Conditions
  Actions
    -------- Many person ask this question, but this is so simple --------
    -------- Just set the ( Entered Chat String , 7, 20 ) --------
    -------- 7 mean that the count of the case, like "-Gold" has 5 number, and that 2 is the space and the start of the value set --------
    -------- Like "-Gold 1" So, that -Gold is 5 count, then the space is 6, and that count is 7 --------
    Player - Set Player 1 (Red).Current gold to (Integer((Substring((Entered chat string), 7, 20))))
Life
  Events
    Player - Player 1 (Red) types a chat message containing -Life (stringnoformat) as A substring
  Conditions
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Set life of (Picked unit) to (Real((Substring((Entered chat string), 7, 20))))
Mana
  Events
    Player - Player 1 (Red) types a chat message containing -Mana (stringnoformat) as A substring
  Conditions
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Set mana of (Picked unit) to (Real((Substring((Entered chat string), 7, 20))))
No Cooldown Active
  Events
    Player - Player 1 (Red) types a chat message containing -No Cooldown ON (stringnoformat) as An exact match
  Conditions
  Actions
    Game - Display to (All players) the text: No Cooldown Activated!!
    Trigger - Turn on No_Cooldown <gen>
No Cooldown Deactive
  Events
    Player - Player 1 (Red) types a chat message containing -No Cooldown OFF (stringnoformat) as An exact match
  Conditions
  Actions
    Game - Display to (All players) the text: No Cooldown Deactivated!!
    Trigger - Turn off No_Cooldown <gen>
Infine Mana Active
  Events
    Player - Player 1 (Red) types a chat message containing -Infine Mana ON (stringnoformat) as An exact match
  Conditions
  Actions
    Game - Display to (All players) the text: Infine Mana Activated!!
    Trigger - Turn on Infine_Mana <gen>
Infine Mana Deactive
  Events
    Player - Player 1 (Red) types a chat message containing -Infine Mana OFF (stringnoformat) as An exact match
  Conditions
  Actions
    Game - Display to (All players) the text: Infine Mana Deactivated!!
    Trigger - Turn off Infine_Mana <gen>
No Cooldown
  Events
    Unit - A unit Starts the effect of an ability
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      Loop - Actions
        Unit - Reset ability cooldowns for (Picked unit).
Infine Mana
  Events
    Unit - A unit Starts the effect of an ability
    Time - Every 0.02 seconds of game time
  Conditions
  Actions
    Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      Loop - Actions
        Unit - Set mana of (Picked unit) to 100%
function Trig_STOP_Actions takes nothing returns nothing
    call ResetToGameCameraForPlayer( Player(0), 0 )
endfunction

//===========================================================================
function InitTrig_STOP takes nothing returns nothing
    set gg_trg_STOP = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_STOP, Player(0), "STOP", true )
    call TriggerAddAction( gg_trg_STOP, function Trig_STOP_Actions )
endfunction

 
function Trig_Kejuti_Actions takes nothing returns nothing
    call CameraSetEQNoiseForPlayer( Player(0), 2000.00 )
    call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_023" )
endfunction

//===========================================================================
function InitTrig_Kejuti takes nothing returns nothing
    set gg_trg_Kejuti = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Kejuti, Player(0), "-kejuti", true )
    call TriggerAddAction( gg_trg_Kejuti, function Trig_Kejuti_Actions )
endfunction

 
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Balack_Spawn_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( S2I(SubStringBJ(GetEventPlayerChatString(), 17, 24)), 'h002', Player(1), GetRectCenter(gg_rct_Land_Of_Remake_Spawns), bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Balack_Spawn takes nothing returns nothing
    set gg_trg_Balack_Spawn = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Balack_Spawn, Player(0), "-balack warrior", false )
    call TriggerAddAction( gg_trg_Balack_Spawn, function Trig_Balack_Spawn_Actions )
endfunction

 
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Footie_Spawn_Actions takes nothing returns nothing
    call CreateNUnitsAtLoc( S2I(SubStringBJ(GetEventPlayerChatString(), 9, 20)), 'h001', Player(1), GetRectCenter(gg_rct_Land_Of_Remake_Spawns), bj_UNIT_FACING )
endfunction

//===========================================================================
function InitTrig_Footie_Spawn takes nothing returns nothing
    set gg_trg_Footie_Spawn = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Footie_Spawn, Player(0), "-footie", false )
    call TriggerAddAction( gg_trg_Footie_Spawn, function Trig_Footie_Spawn_Actions )
endfunction

 
function Trig_Respawn_Func001A takes nothing returns nothing
    call ReviveHeroLoc( GetEnumUnit(), GetRectCenter(gg_rct_Land_Of_Remake), false )
endfunction

function Trig_Respawn_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRectOfPlayer(GetEntireMapRect(), Player(0)), function Trig_Respawn_Func001A )
endfunction

//===========================================================================
function InitTrig_Respawn takes nothing returns nothing
    set gg_trg_Respawn = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Respawn, Player(0), "-Respawn", true )
    call TriggerAddAction( gg_trg_Respawn, function Trig_Respawn_Actions )
endfunction

 
By:
Purgeandfire
Setting Speed Change
  Events
    Player - Player 1 (Red) types a chat message containing -Movement Speed (stringnoformat) as A substring
  Conditions
  Actions
    Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
      Loop - Actions
        Unit - Set (Picked unit) movement speed to (Real((Substring((Entered chat string), 17, 24))))
        -------- This shows how to retrieve a unit's speed above 522 --------
        Game - Display to (All players) the text: (((|cff8080ff + ((Name of (Picked unit)) + |r)) + Movement speed set to: ) + (String(UnitSpeedX[(Custom value of Spell Tester 0000 <gen>)])))
//TESH.scrollpos=175
//TESH.alwaysfold=0
library MoveSpeedXGUI /* v1.1.0.0
*************************************************************************************
*
*   This library allows you to set unit movement speeds beyond 522 without bugs.
*   This is an extension of the library MoveSpeedX, but is formatted for GUI use.
*   Credits to Jesus4Lyf for the original system.
*
************************************************************************************
*
*   SETTINGS
*/

globals
    private constant real PERIOD = 0.03125
        //  This is the period on which all units will be run.
        // If you lower this value, movement bonuses will be smoother,
        // but will require more processing power (lag more).
        //  Also, the lower this is, the higher the move speed can be
        // before it starts bugging on waypoints. The lowest valid
        // period is 0.00125. A period of 0.00625 is very robust.
    private constant real MARGIN = 0.01
        // This is the margin of approximation when comparing reals.
        // You will most likely not need to change this.
endglobals
/*
************************************************************************************
*
*    Functions
*
*        function GetUnitMoveSpeedX takes unit whichUnit returns real
*           - Returns a unit movement speed. The GUI function will
*           - not return the correct value. This function will always
*           - return the correct value regardless of whether the unit
*           - has a movement speed beyond 522.
*
************************************************************************************
*
*   REQUIREMENTS
*
*       1.  JassNewGen Pack v5d
*       2.  JassHelper 0.A.2.B
*       3.  Any unit indexer
*
*   HOW TO IMPLEMENT
*  
*       1.  Copy the 'folder' MoveSpeedX.
*       2.  Paste it into your map.
*       3.  Open "Advanced -> Gameplay Constants".
*       4.  Checkmark "Use Custom Gameplay Constants".
*       5.  Find the field, "Movement - Unit Speed - Maximum", change
*           that to 522.
*       6.  Find the field, "Movement - Unit Speed - Minimum", hold
*           shift and click, and change it to 0.
*       7.  Read HOW TO USE.
*
************************************************************************************
*
*   HOW TO USE
*
*       This system will automatically work by itself. You can use the
*       normal GUI function for modifying unit movement speeds. Simply
*       use "Unit - Set Movement Speed", input whatever value you want,
*       and you are good to go! It will handle values beyond 522 by itself.
*
*       HOWEVER, the GUI function will not return correct values if a unit
*       has a movement speed greater than 522. To fix this, use the function
*       GetUnitMoveSpeedX to return the correct value. A sample is given in
*       the trigger "Speed Change" in the test map.
*
************************************************************************************
*
*   NOTES
*
*       Units that were issued orders as groups might not *always* end up in the proper
*       "order". (they might not end up in an organized formation) They do sometimes though.
*       This is only for units with speeds above 522.
*
*       This also will not factor in bonuses and probably not slows either.
*
*       Units may waddle around the point for a little bit. Reduce PERIOD to fix
*       it a little bit. I recommend about 0.02 if you have really high speeds.
*
************************************************************************************/


    private function ApproxEqual takes real A, real B returns boolean
        return (A >= (B - MARGIN)) and (A <= (B + MARGIN))
    endfunction
   
    private module M
        private static trigger issued = CreateTrigger()
       
        thistype next
        thistype prev
       
        boolean enabled
        unit curr
        real speed
        real x
        real y
        real ox
        real oy
       
        method destroy takes nothing returns nothing
            set this.next.prev = this.prev
            set this.prev.next = this.next
            set this.enabled = false
        endmethod
           
        private static method periodic takes nothing returns nothing
            local thistype this = thistype(0).next // first instance in list
            local real nx // the x-coordinate after tick
            local real ny // the y-coordinate after tick
            local real dx // distance between new-x and old-x
            local real dy // distance between new-y and old-y
            local real d  // distance between new point and old point
            local integer order // the unit's current order
            local unit u // unit being affected  
            loop
                exitwhen this == 0
                set u  = .curr
                set nx = GetUnitX(u)
                set ny = GetUnitY(u)
                if IsUnitType(u, UNIT_TYPE_DEAD) then
                    call this.destroy()
                elseif not ApproxEqual(nx, .x) or not ApproxEqual(ny, .y) then
                    if (not IsUnitPaused(u)) and GetUnitAbilityLevel(u, 'BSTN') == 0 and GetUnitAbilityLevel(u, 'BPSE') == 0 then
                        set order = GetUnitCurrentOrder(u)
                        set dx = nx - .x
                        set dy = ny - .y
                        set d  = SquareRoot(dx * dx + dy * dy)
                        set dx = dx / d * .speed // move the unit offset-x by this
                        set dy = dy / d * .speed // move the unit offset-y by this
                       
                        if (order == 851986 or order == 851971) and /*
                        */
(this.ox - nx)*(this.ox - nx) < (dx*dx) and /*
                        */
(this.oy - ny)*(this.oy - ny) < (dy*dy) then
                            // if the unit is issued a move or smart order and they are near their destination
                            // then move them there instantly (removes a bit of glitchyness towards the end)
                            call SetUnitX(u, .ox)
                            call SetUnitY(u, .oy)
                            set .x = .ox
                            set .y = .oy
                            call IssueImmediateOrderById(u, 851972) // order them to stop
                        else
                            set .x = nx + dx
                            set .y = ny + dy
                            call SetUnitX(u, .x)
                            call SetUnitY(u, .y)
                        endif
                    endif
                endif
                set this = this.next
            endloop
            set u = null
        endmethod
       
        static method create takes unit whichUnit, real newSpeed returns thistype
            local thistype this = GetUnitUserData(whichUnit)
            set this.next = thistype(0).next
            set thistype(0).next.prev = this
            set thistype(0).next = this
            set this.prev  = 0
            set this.curr  = whichUnit
            set this.speed = (newSpeed - 522) * PERIOD
            set this.x     = GetUnitX(whichUnit)
            set this.y     = GetUnitY(whichUnit)
            set this.enabled = true
            return this
        endmethod
       
        static method update takes unit whichUnit, real newSpeed returns nothing
            local thistype this = GetUnitUserData(whichUnit)
            if this.enabled then
                if newSpeed > 522 then
                    set this.speed = (newSpeed - 522) * PERIOD
                else
                    call this.destroy()
                endif
            elseif newSpeed > 522 then
                call thistype.create(whichUnit, newSpeed)
            endif
        endmethod
       
        private static method storeOrderPoint takes nothing returns boolean
            local thistype this = GetUnitUserData(GetTriggerUnit())
            set this.ox = GetOrderPointX()
            set this.oy = GetOrderPointY()
            return false
        endmethod
   
        private static method onInit takes nothing returns nothing
            call TimerStart(CreateTimer(), PERIOD, true, function thistype.periodic)
            call TriggerRegisterAnyUnitEventBJ(issued, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
            call TriggerAddCondition(issued, Condition(function thistype.storeOrderPoint))
        endmethod
    endmodule
   
    private struct MoveSpeedStruct extends array
        implement M
    endstruct
   
    function GetUnitMoveSpeedX takes unit whichUnit returns real
        if MoveSpeedStruct(GetUnitUserData(whichUnit)).enabled then
            return udg_UnitSpeedX[GetUnitUserData(whichUnit)]
        endif
        return GetUnitMoveSpeed(whichUnit)
    endfunction
   
    function SetUnitMoveSpeedX takes unit whichUnit, real newSpeed returns nothing
        call MoveSpeedStruct.update(whichUnit, newSpeed)
        set udg_UnitSpeedX[GetUnitUserData(whichUnit)] = newSpeed
    endfunction

    hook SetUnitMoveSpeed SetUnitMoveSpeedX
endlibrary
MoveSpeedXGlobals
  Events
  Conditions
  Actions
    -------- Copy and paste this trigger to create this variable --------
    Set VariableSet UnitSpeedX[0] = 0.00
    -------- This variable will store unit speeds above 522 --------
By:
Bribe
ap0calypse
This trigger works in two key phases:

1) During map initialization, enumerate all units of all players to give them an index.
2) Adds a second event to itself to index new units as they enter the map.

As a unit enters the map, check for any old units that may have been removed at some point in order to free their index.
Unit Indexer
  Events
    Map initialization
  Conditions
  Actions
    Custom script: call ExecuteFunc("InitializeUnitIndexer")
    Custom script: endfunction
    -------- --------
    -------- This is the most important function - it provides an index for units as they enter the map --------
    -------- --------
    Custom script: function IndexUnit takes nothing returns boolean
    Custom script: local integer pdex = udg_UDex
    -------- --------
    -------- You can use the boolean UnitIndexerEnabled to protect some of your undesirable units from being indexed --------
    -------- - Example: --------
    -------- -- Set UnitIndexerEnabled = False --------
    -------- -- Unit - Create 1 Dummy for (Triggering player) at TempLoc facing 0.00 degrees --------
    -------- -- Set UnitIndexerEnabled = True --------
    -------- --------
    -------- You can also customize the following block - if conditions are false the (Matching unit) won't be indexed. --------
    -------- --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        UnitIndexerEnabled Equal to True
      Then - Actions
        -------- --------
        -------- Generate a unique integer index for this unit --------
        -------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            UDexRecycle Equal to 0
          Then - Actions
            Set VariableSet UDex = (UDexGen + 1)
            Set VariableSet UDexGen = UDex
          Else - Actions
            Set VariableSet UDex = UDexRecycle
            Set VariableSet UDexRecycle = UDexNext[UDex]
        -------- --------
        -------- Link index to unit, unit to index --------
        -------- --------
        Set VariableSet UDexUnits[UDex] = (Matching unit)
        Unit - Set the custom value of UDexUnits[UDex] to UDex
        -------- --------
        -------- Use a doubly-linked list to store all active indexes --------
        -------- --------
        Set VariableSet UDexPrev[UDexNext[0]] = UDex
        Set VariableSet UDexNext[UDex] = UDexNext[0]
        Set VariableSet UDexNext[0] = UDex
        -------- --------
        -------- Fire index event for UDex --------
        -------- --------
        Set VariableSet UnitIndexEvent = 0.00
        Set VariableSet UnitIndexEvent = 1.00
        Set VariableSet UnitIndexEvent = 0.00
        Custom script: set udg_UDex = pdex
      Else - Actions
    Custom script: return false
    Custom script: endfunction
    -------- --------
    -------- The next function is called each time a unit enters the map --------
    -------- --------
    Custom script: function IndexNewUnit takes nothing returns boolean
    Custom script: local integer pdex = udg_UDex
    Custom script: local integer ndex
    -------- --------
    -------- Recycle indices of units no longer in-play every (15) units created --------
    -------- --------
    Set VariableSet UDexWasted = (UDexWasted + 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        UDexWasted Equal to 15
      Then - Actions
        Set VariableSet UDexWasted = 0
        Set VariableSet UDex = UDexNext[0]
        Custom script: loop
        Custom script: exitwhen udg_UDex == 0
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            (Custom value of UDexUnits[UDex]) Equal to 0
          Then - Actions
            -------- --------
            -------- Remove index from linked list --------
            -------- --------
            Custom script: set ndex = udg_UDexNext[udg_UDex]
            Custom script: set udg_UDexNext[udg_UDexPrev[udg_UDex]] = ndex
            Custom script: set udg_UDexPrev[ndex] = udg_UDexPrev[udg_UDex]
            Set VariableSet UDexPrev[UDex] = 0
            -------- --------
            -------- Fire deindex event for UDex --------
            -------- --------
            Set VariableSet UnitIndexEvent = 2.00
            Set VariableSet UnitIndexEvent = 0.00
            -------- --------
            -------- Recycle the index for later use --------
            -------- --------
            Set VariableSet UDexUnits[UDex] = No unit
            Set VariableSet UDexNext[UDex] = UDexRecycle
            Set VariableSet UDexRecycle = UDex
            Custom script: set udg_UDex = ndex
          Else - Actions
            Set VariableSet UDex = UDexNext[UDex]
        Custom script: endloop
        Custom script: set udg_UDex = pdex
      Else - Actions
    -------- --------
    -------- Handle the entering unit (Matching unit) --------
    -------- --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Custom value of (Matching unit)) Equal to 0
      Then - Actions
        Custom script: call IndexUnit()
      Else - Actions
    Custom script: return false
    Custom script: endfunction
    -------- --------
    -------- The next function initializes the core of the system --------
    -------- --------
    Custom script: function InitializeUnitIndexer takes nothing returns nothing
    Custom script: local integer i = 0
    Custom script: local region re = CreateRegion()
    Custom script: local rect r = GetWorldBounds()
    Set VariableSet UnitIndexerEnabled = True
    Custom script: call RegionAddRect(re, r)
    Custom script: call TriggerRegisterEnterRegion(CreateTrigger(), re, Filter(function IndexNewUnit))
    Custom script: call RemoveRect(r)
    Custom script: set re = null
    Custom script: set r = null
    Custom script: loop
    Custom script: call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(i), Filter(function IndexUnit))
    Custom script: set i = i + 1
    Custom script: exitwhen i == 16
    Custom script: endloop
    -------- --------
    -------- This is the "Unit Indexer Initialized" event, use it instead of "Map Initialization" for best results --------
    -------- --------
    Set VariableSet UnitIndexEvent = 3.00
    Set VariableSet UnitIndexEvent = 0.00
Damage Engine lets you detect, amplify, block or nullify damage, and lets you cause special or undetectable damage. Just reference DamageEventAmount/Source/Target, to get the necessary damage event data.
--------
Detect damage: use the event "DamageEvent Equal to 1.00"
Detect zero-damage: use the event "DamageEvent Equal to 2.00"
To change damage before it's dealt: use the event "DamageModifierEvent Equal to 1.00"
--------
Modify DamageEventAmount/ExplodesUnit/Override from a "DamageModifierEvent Equal to 1.00" trigger. To prevent your script's damage stacking with others, include the condition "DamageEventOverride Equal to false".

Likewise, set "DamageEventOverride" to true if you don't want other scripts to stack with it.

If you need to reference the original in-game damage, use the variable "DamageEventPrevAmt".
--------
If you trigger all non-attack damage in the game, you can tell the difference between in-game damage and triggered damage, and you can customize the type of triggered damage as well. You set the variable "DamageEventType" accordingly, <before> triggering the damage.

DamageEventType will be 0 if the damage was dealt in-game or if you didn't set it right before causing the damage. You can create your own special damage types and add them to the list, and/or you can reference the existing ones (DamageTypeSpell/DOT/Ranged).
Damage Engine
  Events
    Game - UnitIndexEvent becomes Equal to 1.00
    Game - UnitIndexEvent becomes Equal to 2.00
  Conditions
  Actions
    -------- Copy the Cheat Death Ability from Object Editor into your map and set the following variable respectively: --------
    Set VariableSet DamageBlockingAbility = Cheat Death Ability (+500,000)
    -------- - --------
    Set VariableSet DamageTypeSpell = 1
    Set VariableSet DamageTypeDOT = 2
    Set VariableSet DamageTypeRanged = 3
    -------- - --------
    Custom script: call ExecuteFunc("InitDamageEvent")
    Custom script: endfunction
    Custom script:
    Custom script: function DmgEvFilter takes nothing returns boolean
    -------- - --------
    -------- The next conditions let you filter out unwanted units. By default, units with Locust will not pass the check. --------
    -------- - --------
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (TempUnit is A structure) Equal to False
      Then - Actions
        Custom script: return true
      Else - Actions
    Custom script: return false
    Custom script: endfunction
    Custom script:
    Custom script: function DmgEvRemoveAbilities takes nothing returns nothing
    Custom script: local real r
    Custom script: loop
    Set VariableSet DmgEvN = (DmgEvN - 1)
    Custom script: set r = GetWidgetLife(udg_DmgEvStack[udg_DmgEvN])
    Unit - Remove DamageBlockingAbility from DmgEvStack[DmgEvN]
    Custom script: call SetWidgetLife(udg_DmgEvStack[udg_DmgEvN], r)
    Set VariableSet DmgEvStack[DmgEvN] = No unit
    Custom script: exitwhen udg_DmgEvN == 0
    Custom script: endloop
    Custom script: endfunction
    Custom script:
    Custom script: function DmgEvSetVars takes nothing returns nothing
    Set VariableSet DamageEventAmount = (Damage taken)
    Set VariableSet DamageEventSource = (Damage source)
    Set VariableSet DamageEventTarget = (Triggering unit)
    Custom script: endfunction
    Custom script:
    Custom script: function FireDmgEv takes nothing returns nothing
    Custom script: local boolean b = GetUnitAbilityLevel(udg_DamageEventTarget, udg_DamageBlockingAbility) > 0
    Custom script: local real life = 0
    Custom script: local real pain = 0
    Custom script: if b then
    Custom script: set life = GetWidgetLife(udg_DamageEventTarget)
    Unit - Remove DamageBlockingAbility from DamageEventTarget
    Custom script: call SetWidgetLife(udg_DamageEventTarget, life)
    Custom script: set pain = GetWidgetLife(udg_DamageEventTarget)
    Custom script: endif
    Set VariableSet DamageEventPrevAmt = DamageEventAmount
    Set VariableSet DamageEventExplodesUnit = False
    Set VariableSet DamageEventOverride = False
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DamageEventAmount Equal to 0.00
      Then - Actions
        Set VariableSet DamageEvent = 2.00
      Else - Actions
        Set VariableSet DamageModifierEvent = 1.00
        Set VariableSet DamageEvent = 1.00
    Custom script: if b then
    Unit - Add DamageBlockingAbility to DamageEventTarget
    Custom script: call SetWidgetLife(udg_DamageEventTarget, life + GetWidgetLife(udg_DamageEventTarget) - pain)
    Custom script: endif
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DamageEventAmount Not equal to DamageEventPrevAmt
      Then - Actions
        Set VariableSet DmgEvLife = ((Life of DamageEventTarget) + (DamageEventPrevAmt - DamageEventAmount))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DamageEventAmount Greater than DamageEventPrevAmt
          Then - Actions
            Unit - Set life of DamageEventTarget to (Max(0.41, DmgEvLife))
            Custom script: if udg_DmgEvLife <= .405 then
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                DamageEventExplodesUnit Equal to True
              Then - Actions
                Unit - Make DamageEventTarget Explode on death
              Else - Actions
            Trigger - Turn off DamageEventTrigger
            Custom script: call UnitDamageTarget(udg_DamageEventSource, udg_DamageEventTarget, 999, false, false, null, null, null)
            Trigger - Turn on DamageEventTrigger
            Custom script: endif
          Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (Max life of DamageEventTarget) Less than DmgEvLife
              Then - Actions
                Unit - Add DamageBlockingAbility to DamageEventTarget
                Set VariableSet DmgEvStack[DmgEvN] = DamageEventTarget
                Set VariableSet DmgEvN = (DmgEvN + 1)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    DmgEvN Equal to 1
                  Then - Actions
                    Custom script: call TimerStart(udg_DmgEvTimer, 0, false, function DmgEvRemoveAbilities)
                  Else - Actions
              Else - Actions
            Unit - Set life of DamageEventTarget to DmgEvLife
      Else - Actions
    Custom script: endfunction
    Custom script:
    Custom script: function FireRecursiveDmgEv takes nothing returns nothing
    Custom script: local real d = udg_DamageEventAmount
    Custom script: local unit s = udg_DamageEventSource
    Custom script: local unit t = udg_DamageEventTarget
    Custom script: local integer ptype = udg_DmgTypPrev
    Custom script: local boolean explode = udg_DamageEventExplodesUnit
    Custom script: local boolean override = udg_DamageEventOverride
    Custom script: local real prev = udg_DamageEventPrevAmt
    Custom script: call DmgEvSetVars()
    Custom script: if udg_DamageEventTarget != t or udg_DamageEventSource != s or udg_DamageEventAmount != d or udg_DamageEventType != ptype then
    Set VariableSet DamageEvent = 0.00
    Set VariableSet DamageModifierEvent = 0.00
    Custom script: call FireDmgEv()
    -------- - --------
    -------- Delete the next three lines to disable the in-game recursion crash warnings --------
    -------- - --------
    Custom script: else
    Cinematic - Clear the screen of text messages for (All players).
    Game - Display to (All players) for 999.00 seconds the text: WARNING: Recursion error when dealing damage! Make sure when you deal damage from within a DamageEvent trigger, do it like this: Trigger - Turn off DamageEventTrigger Unit - Cause... Trigger - Turn on DamageEventTrigger
    -------- - --------
    Custom script: endif
    Custom script: set udg_DamageEventOverride = override
    Custom script: set udg_DamageEventExplodesUnit = explode
    Custom script: set udg_DamageEventPrevAmt = prev
    Custom script: set udg_DmgTypPrev = ptype
    Custom script: set udg_DamageEventAmount = d
    Custom script: set udg_DamageEventSource = s
    Custom script: set udg_DamageEventTarget = t
    Custom script: set s = null
    Custom script: set t = null
    Custom script: endfunction
    Custom script:
    Custom script: function OnDmgEv takes nothing returns boolean
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DamageEvent Equal to 0.00
      Then - Actions
        Set VariableSet DmgTypPrev = DamageEventType
        Custom script: call DmgEvSetVars()
        Custom script: call FireDmgEv()
        Set VariableSet DamageModifierEvent = 0.00
        Set VariableSet DamageEvent = 0.00
        Set VariableSet DamageEventType = 0
      Else - Actions
        Custom script: call FireRecursiveDmgEv()
    Custom script: return false
    Custom script: endfunction
    Custom script:
    Custom script: function CreateDmgEv takes nothing returns nothing
    Custom script: set udg_DamageEventTrigger = CreateTrigger()
    Custom script: call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnDmgEv))
    Custom script: endfunction
    Custom script:
    Custom script: function SetupDmgEv takes nothing returns boolean
    Custom script: local integer pdex = udg_UDex
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        UnitIndexEvent Equal to 1.00
      Then - Actions
        Set VariableSet TempUnit = UDexUnits[UDex]
        Custom script: if GetUnitAbilityLevel(udg_TempUnit, 'Aloc') == 0 and DmgEvFilter() then
        Set VariableSet UnitDamageRegistered[UDex] = True
        Trigger - Add to DamageEventTrigger the event (TempUnit Takes damage)
        Custom script: endif
      Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            UnitDamageRegistered[UDex] Equal to True
          Then - Actions
            Set VariableSet UnitDamageRegistered[UDex] = False
            Set VariableSet DamageEventsWasted = (DamageEventsWasted + 1)
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                DamageEventsWasted Equal to 15
              Then - Actions
                Set VariableSet DamageEventsWasted = 0
                Custom script: call DestroyTrigger(udg_DamageEventTrigger)
                Custom script: call CreateDmgEv()
                Set VariableSet UDex = UDexNext[0]
                Custom script: loop
                Custom script: exitwhen udg_UDex == 0
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  If - Conditions
                    UnitDamageRegistered[UDex] Equal to True
                  Then - Actions
                    Trigger - Add to DamageEventTrigger the event (UDexUnits[UDex] Takes damage)
                  Else - Actions
                Set VariableSet UDex = UDexNext[UDex]
                Custom script: endloop
                Custom script: set udg_UDex = pdex
              Else - Actions
          Else - Actions
    Custom script: return false
    Custom script: endfunction
    Custom script:
    Custom script: function InitDamageEvent takes nothing returns nothing
    Custom script: call CreateDmgEv()
    Custom script: call TriggerAddCondition(GetTriggeringTrigger(), Filter(function SetupDmgEv))
    Set VariableSet UnitIndexerEnabled = False
    Custom script: set udg_TempUnit = CreateUnit(Player(15), 'uloc', 0, 0, 0)
    Set VariableSet UnitIndexerEnabled = True
    Unit - Add DamageBlockingAbility to TempUnit
    Unit - Remove TempUnit from the game
    Countdown Timer - Start DmgEvTimer as a One-shot timer that will expire in 0.00 seconds
    Trigger - Run (This trigger) (checking conditions)
This trigger displays floating text whenever a unit takes damage of any kind.
Show Text
  Events
    Game - DamageEvent becomes Equal to 1.00
  Conditions
  Actions
    Set VariableSet TempLoc1 = (Position of DamageEventTarget)
    -------- Use only 1 of the 2 options below --------
    -------- 1) This will display a REAL value (e.g.: 5.589) --------
    -------- 2) This will display an INTEGER value (e.g.: 5) --------
    Floating Text - Create floating text that reads ( + ((String((Integer(DamageEventAmount)))) + !)) at TempLoc1 with Z offset 100.00, using font size 10.00, color (100%, 0.00%, 0.00%), and 0% transparency
    Custom script: call RemoveLocation(udg_TempLoc1)
    Floating Text - Change (Last created floating text): Disable permanence
    Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
    Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
    Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
Damage Effect
  Events
    Unit - A unit Is attacked
  Conditions
  Actions
    Special Effect - Create a special effect attached to the chest (attachpoint) of TempUnit using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
//TESH.scrollpos=0
//TESH.alwaysfold=0
/***************************************
*
*   GroupTools
*   v1.1.2.2
*   By Magtheridon96
*
*   - Original version by Rising_Dusk
*
*   - Recycles groups, and allows the
*   enumeration of units while taking
*   into account collision.
*
*   API:
*   ----
*
*       - group ENUM_GROUP
*
*       - function NewGroup takes nothing returns group
*       - function ReleaseGroup takes group g returns nothing
*           - Get and release group handles
*
*       - function GroupRefresh takes group g returns nothing
*           - Refresh a group so that null units are removed
*
*       - function GroupUnitsInArea takes group whichGroup, real x, real y, real radius returns nothing
*           - Groups units while taking into account collision
*
***************************************/

library GroupTools
   
    globals
        // The highest collision size you're using in your map.
        private constant real MAX_COLLISION_SIZE = 197.
        // Data Variables
        private group array groups
        private group gT = null
        private integer gN = 0
        private boolean f = false
        // Global Group (Change it to CreateGroup() if you want)
        group ENUM_GROUP = bj_lastCreatedGroup
    endglobals
   
    static if DEBUG_MODE then
        private struct V extends array
            debug static hashtable ht = InitHashtable()
        endstruct
    endif
   
    private function AE takes nothing returns nothing
        if (f) then
            call GroupClear(gT)
            set f = false
        endif
        call GroupAddUnit(gT,GetEnumUnit())
    endfunction
   
    function GroupRefresh takes group g returns nothing
        debug if null==g then
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"[GroupUtils]Error: Attempt to refresh null group!")
            debug return
        debug endif
        set f = true
        set gT = g
        call ForGroup(gT,function AE)
        if (f) then
            call GroupClear(g)
        endif
    endfunction
   
    function NewGroup takes nothing returns group
        if 0==gN then
            return CreateGroup()
        endif
        set gN = gN - 1
        debug call SaveBoolean(V.ht,GetHandleId(groups[gN]),0,false)
        return groups[gN]
    endfunction
   
    function ReleaseGroup takes group g returns nothing
        debug if null==g then
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"[GroupUtils]Error: Attempt to release null group!")
            debug return
        debug endif
        debug if LoadBoolean(V.ht,GetHandleId(g),0) then
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"[GroupUtils]Error: Double free!")
            debug return
        debug endif
        debug call SaveBoolean(V.ht,GetHandleId(g),0,true)
        call GroupClear(g)
        set groups[gN] = g
        set gN = gN + 1
    endfunction
   
    function GroupUnitsInArea takes group whichGroup, real x, real y, real radius returns nothing
        local unit u
        debug if null==whichGroup then
            debug call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60,"[GroupUtils]Error: Null group passed to GroupUnitsInArea!")
            debug return
        debug endif
        call GroupEnumUnitsInRange(ENUM_GROUP,x,y,radius+MAX_COLLISION_SIZE,null)
        loop
            set u = FirstOfGroup(ENUM_GROUP)
            exitwhen null==u
            if IsUnitInRangeXY(u,x,y,radius) then
                call GroupAddUnit(whichGroup,u)
            endif
            call GroupRemoveUnit(ENUM_GROUP,u)
        endloop
    endfunction
   
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
/**************************************************************
*
*   RegisterPlayerUnitEvent
*   v4.2.0.0
*   By Magtheridon96
*
*   I would like to give a special thanks to Bribe, azlier
*   and BBQ for improving this library. For modularity, it only
*   supports player unit events.
*
*   Functions passed to RegisterPlayerUnitEvent must
*   return false. They can return nothing as well.
*
*   Disclaimer:
*   -----------
*
*       - Don't use TriggerSleepAction inside registered code.
*
*      API:
*      ----
*
*       function RegisterPlayerUnitEvent
*           takes
*               playerunitevent whichEvent  :   The event you would like to register
*               code whichFunction          :   The code you would like to register
*           returns
*               nothing
*
*           - Registers code that will execute when an event fires.
*
**************************************************************/

library RegisterPlayerUnitEvent // Special Thanks to Bribe and azlier
    globals
        private trigger array t
    endglobals
   
    function RegisterPlayerUnitEvent takes playerunitevent p, code c returns nothing
        local integer i = GetHandleId(p)
        local integer k = 15
        if t[i] == null then
            set t[i] = CreateTrigger()
            loop
                call TriggerRegisterPlayerUnitEvent(t[i], Player(k), p, null)
                exitwhen k == 0
                set k = k - 1
            endloop
        endif
        call TriggerAddCondition(t[i], Filter(c))
    endfunction
endlibrary
//TESH.scrollpos=20
//TESH.alwaysfold=0
//============================================================================
// SpellEffectEvent by Bribe
// - 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=72
//TESH.alwaysfold=0
library TerrainPathability initializer Init

//******************************************************************************
//* BY: Rising_Dusk
//*
//* This script can be used to detect the type of pathing at a specific point.
//* It is valuable to do it this way because the IsTerrainPathable is very
//* counterintuitive and returns in odd ways and aren't always as you would
//* expect. This library, however, facilitates detecting those things reliably
//* and easily.
//*
//******************************************************************************
//*
//*    > function IsTerrainDeepWater    takes real x, real y returns boolean
//*    > function IsTerrainShallowWater takes real x, real y returns boolean
//*    > function IsTerrainLand         takes real x, real y returns boolean
//*    > function IsTerrainPlatform     takes real x, real y returns boolean
//*    > function IsTerrainWalkable     takes real x, real y returns boolean
//*
//* These functions return true if the given point is of the type specified
//* in the function's name and false if it is not. For the IsTerrainWalkable
//* function, the MAX_RANGE constant below is the maximum deviation range from
//* the supplied coordinates that will still return true.
//*
//* The IsTerrainPlatform works for any preplaced walkable destructable. It will
//* return true over bridges, destructable ramps, elevators, and invisible
//* platforms. Walkable destructables created at runtime do not create the same
//* pathing hole as preplaced ones do, so this will return false for them. All
//* other functions except IsTerrainWalkable return false for platforms, because
//* the platform itself erases their pathing when the map is saved.
//*
//* After calling IsTerrainWalkable(x, y), the following two global variables
//* gain meaning. They return the X and Y coordinates of the nearest walkable
//* point to the specified coordinates. These will only deviate from the
//* IsTerrainWalkable function arguments if the function returned false.
//*
//* Variables that can be used from the library:
//*     [real]    TerrainPathability_X
//*     [real]    TerrainPathability_Y
//*

    globals
        private constant real    MAX_RANGE     = 10.
        private constant integer DUMMY_ITEM_ID = 'wolg'
    endglobals

    globals    
        private item       Item   = null
        private rect       Find   = null
        private item array Hid
        private integer    HidMax = 0
        public  real       X      = 0.
        public  real       Y      = 0.
    endglobals

    function IsTerrainDeepWater takes real x, real y returns boolean
        return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
    endfunction
   
    function IsTerrainShallowWater takes real x, real y returns boolean
        return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY)
    endfunction
   
    function IsTerrainLand takes real x, real y returns boolean
        return IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY)
    endfunction
   
    function IsTerrainPlatform takes real x, real y returns boolean
        return not IsTerrainPathable(x, y, PATHING_TYPE_FLOATABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY) and not IsTerrainPathable(x, y, PATHING_TYPE_BUILDABILITY)
    endfunction

    private function HideItem takes nothing returns nothing
        if IsItemVisible(GetEnumItem()) then
            set Hid[HidMax] = GetEnumItem()
            call SetItemVisible(Hid[HidMax], false)
            set HidMax = HidMax + 1
        endif
    endfunction
   
    function IsTerrainWalkable takes real x, real y returns boolean
        //Hide any items in the area to avoid conflicts with our item
        call MoveRectTo(Find, x, y)
        call EnumItemsInRect(Find ,null, function HideItem)
        //Try to move the test item and get its coords
        call SetItemPosition(Item, x, y) //Unhides the item
        set X = GetItemX(Item)
        set Y = GetItemY(Item)
        static if LIBRARY_IsTerrainWalkable then
            //This is for compatibility with the IsTerrainWalkable library
            set IsTerrainWalkable_X = X
            set IsTerrainWalkable_Y = Y
        endif
        call SetItemVisible(Item, false)//Hide it again
        //Unhide any items hidden at the start
        loop
            exitwhen HidMax <= 0
            set HidMax = HidMax - 1
            call SetItemVisible(Hid[HidMax], true)
            set Hid[HidMax] = null
        endloop
        //Return walkability
        return (X-x)*(X-x)+(Y-y)*(Y-y) <= MAX_RANGE*MAX_RANGE and not IsTerrainPathable(x, y, PATHING_TYPE_WALKABILITY)
    endfunction

    private function Init takes nothing returns nothing
        set Find = Rect(0., 0., 128., 128.)
        set Item = CreateItem(DUMMY_ITEM_ID, 0, 0)
        call SetItemVisible(Item, false)
    endfunction
   
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library TimerUtils initializer init
//*********************************************************************
//* TimerUtils (red+blue+orange flavors for 1.24b+) 2.0
//* ----------
//*
//*  To implement it , create a custom text trigger called TimerUtils
//* and paste the contents of this script there.
//*
//*  To copy from a map to another, copy the trigger holding this
//* library to your map.
//*
//* (requires vJass)   More scripts: htt://www.wc3c.net
//*
//* For your timer needs:
//*  * Attaching
//*  * Recycling (with double-free protection)
//*
//* set t=NewTimer()      : Get a timer (alternative to CreateTimer)
//* set t=NewTimerEx(x)   : Get a timer (alternative to CreateTimer), call
//*                            Initialize timer data as x, instead of 0.
//*
//* ReleaseTimer(t)       : Relese a timer (alt to DestroyTimer)
//* SetTimerData(t,2)     : Attach value 2 to timer
//* GetTimerData(t)       : Get the timer's value.
//*                         You can assume a timer's value is 0
//*                         after NewTimer.
//*
//* Multi-flavor:
//*    Set USE_HASH_TABLE to true if you don't want to complicate your life.
//*
//* If you like speed and giberish try learning about the other flavors.
//*
//********************************************************************

//================================================================
    globals
        //How to tweak timer utils:
        // USE_HASH_TABLE = true  (new blue)
        //  * SAFEST
        //  * SLOWEST (though hash tables are kind of fast)
        //
        // USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = true  (orange)
        //  * kinda safe (except there is a limit in the number of timers)
        //  * ALMOST FAST
        //
        // USE_HASH_TABLE = false, USE_FLEXIBLE_OFFSET = false (red)
        //  * THE FASTEST (though is only  faster than the previous method
        //                  after using the optimizer on the map)
        //  * THE LEAST SAFE ( you may have to tweak OFSSET manually for it to
        //                     work)
        //
        private constant boolean USE_HASH_TABLE      = true
        private constant boolean USE_FLEXIBLE_OFFSET = false

        private constant integer OFFSET     = 0x100000
        private          integer VOFFSET    = OFFSET
             
        //Timers to preload at map init:
        private constant integer QUANTITY   = 256
       
        //Changing this  to something big will allow you to keep recycling
        // timers even when there are already AN INCREDIBLE AMOUNT of timers in
        // the stack. But it will make things far slower so that's probably a bad idea...
        private constant integer ARRAY_SIZE = 8190

    endglobals

    //==================================================================================================
    globals
        private integer array data[ARRAY_SIZE]
        private hashtable     ht
    endglobals
   
   

    //It is dependent on jasshelper's recent inlining optimization in order to perform correctly.
    function SetTimerData takes timer t, integer value returns nothing
        static if(USE_HASH_TABLE) then
            // new blue
            call SaveInteger(ht,0,GetHandleId(t), value)
           
        elseif (USE_FLEXIBLE_OFFSET) then
            // orange
            static if (DEBUG_MODE) then
                if(GetHandleId(t)-VOFFSET<0) then
                    call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
                endif
            endif
            set data[GetHandleId(t)-VOFFSET]=value
        else
            // new red
            static if (DEBUG_MODE) then
                if(GetHandleId(t)-OFFSET<0) then
                    call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
                endif
            endif
            set data[GetHandleId(t)-OFFSET]=value
        endif        
    endfunction

    function GetTimerData takes timer t returns integer
        static if(USE_HASH_TABLE) then
            // new blue
            return LoadInteger(ht,0,GetHandleId(t) )
           
        elseif (USE_FLEXIBLE_OFFSET) then
            // orange
            static if (DEBUG_MODE) then
                if(GetHandleId(t)-VOFFSET<0) then
                    call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
                endif
            endif
            return data[GetHandleId(t)-VOFFSET]
        else
            // new red
            static if (DEBUG_MODE) then
                if(GetHandleId(t)-OFFSET<0) then
                    call BJDebugMsg("SetTimerData: Wrong handle id, only use SetTimerData on timers created by NewTimer")
                endif
            endif
            return data[GetHandleId(t)-OFFSET]
        endif        
    endfunction

    //==========================================================================================
    globals
        private timer array tT[ARRAY_SIZE]
        private integer tN = 0
        private constant integer HELD=0x28829022
        //use a totally random number here, the more improbable someone uses it, the better.
       
        private boolean       didinit = false
    endglobals
    private keyword init

    //==========================================================================================
    // I needed to decide between duplicating code ignoring the "Once and only once" rule
    // and using the ugly textmacros. I guess textmacros won.
    //
    //! textmacro TIMERUTIS_PRIVATE_NewTimerCommon takes VALUE
    // On second thought, no.
    //! endtextmacro

    function NewTimerEx takes integer value returns timer
        if (tN==0) then
            if (not didinit) then
                //This extra if shouldn't represent a major performance drawback
                //because QUANTITY rule is not supposed to be broken every day.
                call init.evaluate()
                set tN = tN - 1
            else
                //If this happens then the QUANTITY rule has already been broken, try to fix the
                // issue, else fail.
                debug call BJDebugMsg("NewTimer: Warning, Exceeding TimerUtils_QUANTITY, make sure all timers are getting recycled correctly")
                set tT[0]=CreateTimer()
                static if( not USE_HASH_TABLE) then
                    debug call BJDebugMsg("In case of errors, please increase it accordingly, or set TimerUtils_USE_HASH_TABLE to true")
                    static if( USE_FLEXIBLE_OFFSET) then
                        if (GetHandleId(tT[0])-VOFFSET<0) or (GetHandleId(tT[0])-VOFFSET>=ARRAY_SIZE) then
                            //all right, couldn't fix it
                            call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
                            return null
                        endif
                    else
                        if (GetHandleId(tT[0])-OFFSET<0) or (GetHandleId(tT[0])-OFFSET>=ARRAY_SIZE) then
                            //all right, couldn't fix it
                            call BJDebugMsg("NewTimer: Unable to allocate a timer, you should probably set TimerUtils_USE_HASH_TABLE to true or fix timer leaks.")
                            return null
                        endif
                    endif
                endif
            endif
        else
            set tN=tN-1
        endif
        call SetTimerData(tT[tN],value)
     return tT[tN]
    endfunction
   
    function NewTimer takes nothing returns timer
        return NewTimerEx(0)
    endfunction


    //==========================================================================================
    function ReleaseTimer takes timer t returns nothing
        if(t==null) then
            debug call BJDebugMsg("Warning: attempt to release a null timer")
            return
        endif
        if (tN==ARRAY_SIZE) then
            debug call BJDebugMsg("Warning: Timer stack is full, destroying timer!!")

            //stack is full, the map already has much more troubles than the chance of bug
            call DestroyTimer(t)
        else
            call PauseTimer(t)
            if(GetTimerData(t)==HELD) then
                debug call BJDebugMsg("Warning: ReleaseTimer: Double free!")
                return
            endif
            call SetTimerData(t,HELD)
            set tT[tN]=t
            set tN=tN+1
        endif    
    endfunction

    private function init takes nothing returns nothing
     local integer i=0
     local integer o=-1
     local boolean oops = false
        if ( didinit ) then
            return
        else
            set didinit = true
        endif
     
        static if( USE_HASH_TABLE ) then
            set ht = InitHashtable()
            loop
                exitwhen(i==QUANTITY)
                set tT[i]=CreateTimer()
                call SetTimerData(tT[i], HELD)
                set i=i+1
            endloop
            set tN = QUANTITY
        else
            loop
                set i=0
                loop
                    exitwhen (i==QUANTITY)
                    set tT[i] = CreateTimer()
                    if(i==0) then
                        set VOFFSET = GetHandleId(tT[i])
                        static if(USE_FLEXIBLE_OFFSET) then
                            set o=VOFFSET
                        else
                            set o=OFFSET
                        endif
                    endif
                    if (GetHandleId(tT[i])-o>=ARRAY_SIZE) then
                        exitwhen true
                    endif
                    if (GetHandleId(tT[i])-o>=0)  then
                        set i=i+1
                    endif
                endloop
                set tN = i
                exitwhen(tN == QUANTITY)
                set oops = true
                exitwhen not USE_FLEXIBLE_OFFSET
                debug call BJDebugMsg("TimerUtils_init: Failed a initialization attempt, will try again")              
            endloop
           
            if(oops) then
                static if ( USE_FLEXIBLE_OFFSET) then
                    debug call BJDebugMsg("The problem has been fixed.")
                    //If this message doesn't appear then there is so much
                    //handle id fragmentation that it was impossible to preload
                    //so many timers and the thread crashed! Therefore this
                    //debug message is useful.
                elseif(DEBUG_MODE) then
                    call BJDebugMsg("There were problems and the new timer limit is "+I2S(i))
                    call BJDebugMsg("This is a rare ocurrence, if the timer limit is too low:")
                    call BJDebugMsg("a) Change USE_FLEXIBLE_OFFSET to true (reduces performance a little)")
                    call BJDebugMsg("b) or try changing OFFSET to "+I2S(VOFFSET) )
                endif
            endif
        endif

    endfunction

endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~ Timer32 ~~ By Jesus4Lyf ~~ Version 1.06 ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//  What is Timer32?
//         - Timer32 implements a fully optimised timer loop for a struct.
//         - Instances can be added to the loop, which will call .periodic every
//           PERIOD until .stopPeriodic() is called.
//
//    =Pros=
//         - Efficient.
//         - Simple.
//
//    =Cons=
//         - Only allows one period.
//         - The called method must be named ".periodic".
//
//    Methods:
//         - struct.startPeriodic()
//         - struct.stopPeriodic()
//
//         - private method periodic takes nothing returns nothing
//
//           This must be defined in structs that implement Periodic Module.
//           It will be executed by the module every PERIOD until .stopPeriodic() is called.
//           Put "implement T32x" BELOW this method.
//
//    Modules:
//         - T32x
//           Has no safety on .stopPeriodic or .startPeriodic (except debug messages
//           to warn).
//
//         - T32xs
//           Has safety on .stopPeriodic and .startPeriodic so if they are called
//           multiple times, or while otherwise are already stopped/started respectively,
//           no error will occur, the call will be ignored.
//
//         - T32
//           The original, old version of the T32 module. This remains for backwards
//           compatability, and is deprecated. The periodic method must return a boolean,
//           false to continue running or true to stop.
//
//  Details:
//         - Uses one timer.
//
//         - Do not, within a .periodic method, follow a .stopPeriodic call with a
//           .startPeriodic call.
//
//  How to import:
//         - Create a trigger named T32.
//         - Convert it to custom text and replace the whole trigger text with this.
//
//  Thanks:
//         - Infinitegde for finding a bug in the debug message that actually altered
//           system operation (when in debug mode).
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
library T32 initializer OnInit
    globals
        public constant real PERIOD=0.03125
        public constant integer FPS=R2I(1/PERIOD)
        public integer Tick=0 // very useful.
       
//==============================================================================
        private trigger Trig=CreateTrigger()
    endglobals
   
    //==============================================================================
    // The standard T32 module, T32x.
    //
    module T32x
        private thistype next
        private thistype prev
       
        private static method PeriodicLoop takes nothing returns boolean
            local thistype this=thistype(0).next
            loop
                exitwhen this==0
                call this.periodic()
                set this=this.next
            endloop
            return false
        endmethod

        method startPeriodic takes nothing returns nothing
            debug if this.prev!=0 or thistype(0).next==this then
            debug   call BJDebugMsg("T32 ERROR: Struct #"+I2S(this)+" had startPeriodic called while already running!")
            debug endif
            set thistype(0).next.prev=this
            set this.next=thistype(0).next
            set thistype(0).next=this
            set this.prev=thistype(0)
        endmethod
       
        method stopPeriodic takes nothing returns nothing
            debug if this.prev==0 and thistype(0).next!=this then
            debug   call BJDebugMsg("T32 ERROR: Struct #"+I2S(this)+" had stopPeriodic called while not running!")
            debug endif
            // This is some real magic.
            set this.prev.next=this.next
            set this.next.prev=this.prev
            // This will even work for the starting element.
            debug set this.prev=0
        endmethod
       
        private static method onInit takes nothing returns nothing
            call TriggerAddCondition(Trig,Condition(function thistype.PeriodicLoop))
        endmethod
    endmodule
   
    //==============================================================================
    // The standard T32 module with added safety checks on .startPeriodic() and
    // .stopPeriodic(), T32xs.
    //
    module T32xs
        private thistype next
        private thistype prev
        private boolean runningPeriodic
       
        private static method PeriodicLoop takes nothing returns boolean
            local thistype this=thistype(0).next
            loop
                exitwhen this==0
                call this.periodic()
                set this=this.next
            endloop
            return false
        endmethod

        method startPeriodic takes nothing returns nothing
            if not this.runningPeriodic then
                set thistype(0).next.prev=this
                set this.next=thistype(0).next
                set thistype(0).next=this
                set this.prev=thistype(0)
               
                set this.runningPeriodic=true
            endif
        endmethod
       
        method stopPeriodic takes nothing returns nothing
            if this.runningPeriodic then
                // This is some real magic.
                set this.prev.next=this.next
                set this.next.prev=this.prev
                // This will even work for the starting element.
               
                set this.runningPeriodic=false
            endif
        endmethod
       
        private static method onInit takes nothing returns nothing
            call TriggerAddCondition(Trig,Condition(function thistype.PeriodicLoop))
        endmethod
    endmodule
   
    //==============================================================================
    // The original T32 module, for backwards compatability only.
    //
    module T32 // deprecated.
        private thistype next
        private thistype prev
       
        private static method PeriodicLoop takes nothing returns boolean
            local thistype this=thistype(0).next
            loop
                exitwhen this==0
                if this.periodic() then
                    // This is some real magic.
                    set this.prev.next=this.next
                    set this.next.prev=this.prev
                    // This will even work for the starting element.
                    debug set this.prev=0
                endif
                set this=this.next
            endloop
            return false
        endmethod

        method startPeriodic takes nothing returns nothing
            debug if this.prev!=0 or thistype(0).next==this then
            debug   call BJDebugMsg("T32 ERROR: Struct #"+I2S(this)+" had startPeriodic called while already running!")
            debug endif
            set thistype(0).next.prev=this
            set this.next=thistype(0).next
            set thistype(0).next=this
            set this.prev=thistype(0)
        endmethod
       
        private static method onInit takes nothing returns nothing
            call TriggerAddCondition(Trig,Condition(function thistype.PeriodicLoop))
        endmethod
    endmodule
   
    //==============================================================================
    // System Core.
    //
    private function OnExpire takes nothing returns nothing
        set Tick=Tick+1
        call TriggerEvaluate(Trig)
    endfunction
   
    private function OnInit takes nothing returns nothing
        call TimerStart(CreateTimer(),PERIOD,true,function OnExpire)
    endfunction
endlibrary
 
SH.scrollpos=27
//TESH.alwaysfold=0
library xebasic
//**************************************************************************
//
// xebasic 0.4
// =======
// XE_DUMMY_UNITID : Rawcode of the dummy unit in your map. It should
//                   use the dummy.mdx model, so remember to import it as
//                   well, just use copy&paste to copy the dummy from the
//                   xe map to yours, then change the rawcode.
//
// XE_HEIGHT_ENABLER: Medivh's raven form ability, you may need to change
//                    this rawcode to another spell that morphs into a flier
//                    in case you modified medivh's spell in your map.
//
// XE_TREE_RECOGNITION: The ancients' Eat tree ability, same as with medivh
//                      raven form, you might have to change it.
//
// XE_ANIMATION_PERIOD: The global period of animation used by whatever
//                      timer that depends on it, if you put a low value
//                      the movement will look good but it may hurt your
//                      performance, if instead you use a high value it
//                      will not lag but will be fast.
//
// XE_MAX_COLLISION_SIZE: The maximum unit collision size in your map, if
//                        you got a unit bigger than 197.0 it would be
//                        a good idea to update this constant, since some
//                        enums will not find it. Likewise, if none of
//                        your units can go bellow X and X is much smaller
//                        than 197.0, it would be a good idea to update
//                        as well, since it will improve the performance
//                        those enums.
//
// Notice you probably don't have to update this library, unless I specify
// there are new constants which would be unlikely.
//
//**************************************************************************

//===========================================================================
globals
   constant integer XE_DUMMY_UNITID       = 'e002'
   constant integer XE_HEIGHT_ENABLER     = 'Amrf'
   constant integer XE_TREE_RECOGNITION   = 'Aeat'
   constant real    XE_ANIMATION_PERIOD   =  0.025
   constant real    XE_MAX_COLLISION_SIZE =  197.0
endglobals

endlibrary