Moderator
M
Moderator
Simple pick hero with trackable | Reviewed by Maker | 29th Sep 2013 | ||||
| APPROVED | ||||
|
Trackable
Trackable

Events


Map initialization

Conditions

Actions


Custom script: local trackable tr


-------- ------------------------- --------


-------- Configuration --------


-------- ------------------------- --------


Custom script: set udg_T_HASH = InitHashtable()


Set T_COUNT = 1


-------- ------------------------- --------


-------- Trackable Path --------


Set T_PATH = war3mapImported\64x64Track.mdx


-------- Region create icon --------


Set T_RECT = IconCreator <gen>


-------- Min distance between 2 icon creating --------


Set T_MIN = 200.00


-------- When the system reached this value, it will automatically down to the next row --------


Set T_MAX = 400.00


-------- Down row distance --------


Set T_ROW_DISTANCE = 100.00


-------- This value is very useful, don't touch this ;) --------


Set T_ANGLE = -90.00


-------- Effect when you clicking an icon --------


Set T_EFFECT = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl


-------- Trigger get event you click --------


Set T_TRIGGER = Track Hero <gen>


-------- Region create a review unit --------


Set T_REVIEW = Review <gen>


-------- ------------------- --------


-------- ------------------- --------


-------- CONFIGURATION --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Paladin


Set T_DES_TYPE[T_INT] = (HERO) Paladin


Set T_INFO[T_INT] = Warrior Hero, exceptional at defense and augmenting nearby friendly troops. Can learn Holy Light, Divine Shield, Devotion Aura and Resurrection.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Archmage


Set T_DES_TYPE[T_INT] = (HERO) Arch


Set T_INFO[T_INT] = Mystical Hero, adept at ranged assaults. Can learn Blizzard, Summon Water Elemental, Brilliance Aura and Mass Teleport.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Mountain King


Set T_DES_TYPE[T_INT] = (HERO) Mount


Set T_INFO[T_INT] = Warrior Hero, adept at offensive combat and disrupting enemy troops. Can learn Storm Bolt, Thunder Clap, Bash and Avatar.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Blood Mage


Set T_DES_TYPE[T_INT] = (HERO) Blood


Set T_INFO[T_INT] = Mystical Hero, adept at controlling magic and ranged assaults. Can learn Flame Strike, Banish, Siphon Mana and Phoenix.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Blademaster


Set T_DES_TYPE[T_INT] = (HERO) Bl


Set T_INFO[T_INT] = Cunning Hero, adept at quickly killing individual units and creating confusion among enemies. Can learn Mirror Image, Wind Walk, Critical Strike and Bladestorm.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Far Seer


Set T_DES_TYPE[T_INT] = (HERO) FS


Set T_INFO[T_INT] = Mystical Hero, effective at ranged attacks and scouting. Can learn Chain Lightning, Far Sight, Feral Spirit and Earthquake.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Tauren Chieftain


Set T_DES_TYPE[T_INT] = (HERO) TR


Set T_INFO[T_INT] = Warrior Hero, exceptional at absorbing damage and melee combat. Can learn Shockwave, War Stomp, Endurance Aura and Reincarnation.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Shadow Hunter


Set T_DES_TYPE[T_INT] = (HERO) SD


Set T_INFO[T_INT] = Cunning Hero, adept at healing magics and voodoo curses. Can learn Healing Wave, Hex, Serpent Ward and Big Bad Voodoo.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Death Knight


Set T_DES_TYPE[T_INT] = (HERO) DK


Set T_INFO[T_INT] = Warrior Hero, evil counterpart to the Human Paladin. Can learn Death Coil, Death Pact, Unholy Aura, and Animate Dead.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Lich


Set T_DES_TYPE[T_INT] = (HERO) L


Set T_INFO[T_INT] = Mystical Hero, particularly adept at cold magic. Can learn Frost Armor, Frost Nova, Dark Ritual and Death And Decay.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Dreadlord


Set T_DES_TYPE[T_INT] = (HERO) DL


Set T_INFO[T_INT] = Cunning Hero, adept at controlling combat. Can learn Carrion Swarm, Sleep, Vampiric Aura, and Inferno.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Crypt Lord


Set T_DES_TYPE[T_INT] = (HERO) CL


Set T_INFO[T_INT] = Warrior Hero, adept at summoning insect minions and crushing enemies. Can learn Impale, Spiked Carapace, Carrion Beetles and Locust Swarm.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Keeper of the Grove


Set T_DES_TYPE[T_INT] = (HERO) KP


Set T_INFO[T_INT] = Mystical Hero, adept at using nature spells. Can learn Entangling Roots, Force of Nature, Thorns Aura, and Tranquility.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Priestess of the Moon


Set T_DES_TYPE[T_INT] = (HERO) PM


Set T_INFO[T_INT] = Warrior Hero, adept at enhancing ranged attacks and slaying enemies from afar. Can learn Scout, Searing Arrows, Trueshot Aura, and Starfall.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Demon Hunter


Set T_DES_TYPE[T_INT] = (HERO) DM


Set T_INFO[T_INT] = Cunning Hero, adept at maneuvering through battles. Can learn Immolation, Evasion, Mana Burn, and Metamorphosis.


-------- ------------------- --------


Set T_INT = (T_INT + 1)


Set T_UNITS[T_INT] = Warden


Set T_DES_TYPE[T_INT] = (HERO) WD


Set T_INFO[T_INT] = Cunning Hero, adept at entering and escaping combat. Can learn Blink, Fan of Knives, Shadow Strike and Vengeance.


-------- ------------------- --------


Set T_TOTAL = T_INT


Set T_INT = 1


-------- ------------------- --------


-------- ------------------- --------


-------- END CONFIGURATION --------


-------- ------------------- --------


-------- ------------------- --------


For each (Integer T_INIT) from 1 to 12, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






((Player(T_INIT)) controller) Equal to User






((Player(T_INIT)) slot status) Equal to Is playing





Then - Actions






Set T_COUNT = (T_COUNT + 1)






For each (Integer T_INT) from 1 to T_TOTAL, do (Actions)







Loop - Actions








-------- Create the path visible for 1 player only --------








Custom script: if GetLocalPlayer() == Player(udg_T_INIT-1) then








Set T_S = T_PATH








Custom script: endif








-------- ------------- --------








-------- Get X,Y,O,Z --------








Custom script: set udg_T_X = GetRectCenterX(udg_T_RECT) + udg_T_Row_Creator * Cos(udg_T_ANGLE*0.01747)








Custom script: set udg_T_Y = GetRectCenterY(udg_T_RECT) + udg_T_Row_Creator * Sin(udg_T_ANGLE*0.01747)








Custom script: set udg_T_O = udg_T_X + udg_T_Creator * Cos(0.01747)








Custom script: set udg_T_Z = udg_T_Y + udg_T_Creator * Sin(0.01747)








-------- Create Trackable --------








Custom script: set tr = CreateTrackable(udg_T_S,udg_T_O,udg_T_Z,0.)








-------- Save Data --------








Custom script: set udg_T_INTEGER = GetHandleId(tr)








Hashtable - Save T_INIT as 0 of T_INTEGER in T_HASH








Hashtable - Save T_INT as 1 of T_INTEGER in T_HASH








Hashtable - Save T_O as 2 of T_INTEGER in T_HASH








Hashtable - Save T_Z as 3 of T_INTEGER in T_HASH








-------- Register Trigger For Trackable --------








Custom script: call TriggerRegisterTrackableHitEvent(udg_T_TRIGGER,tr)








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










T_Creator Less than or equal to T_MAX









Then - Actions










Set T_Creator = (T_Creator + T_MIN)









Else - Actions










Set T_Creator = 0.00










Set T_Row_Creator = (T_Row_Creator + T_ROW_DISTANCE)








-------- Begin Create Track and Destructable --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










T_Destructable[T_INT] Equal to No destructible









Then - Actions










Custom script: set udg_T_Destructable[udg_T_INT] = CreateDestructable(udg_T_DES_TYPE[udg_T_INT],udg_T_O,udg_T_Z,0.,1.,0)









Else - Actions





Else - Actions




Custom script: call TriggerRegisterPlayerEvent(gg_trg_PlayerLeft, Player(udg_T_INIT), EVENT_PLAYER_LEAVE)


Custom script: set tr = null
Track Hero

Events

Conditions

Actions


-------- This trigger takes data of trigger Trackable --------


-------- Load trackable you clicked --------


Custom script: local trackable tr = GetTriggeringTrackable()


-------- Begin load data --------


-------- id = number of trackable --------


Custom script: local integer id = LoadIntegerBJ(1,GetHandleId(tr),udg_T_HASH)


-------- Load player --------


Custom script: local player p = Player(LoadIntegerBJ(0,GetHandleId(tr),udg_T_HASH))


-------- x,y for effect --------


Custom script: local real x = LoadRealBJ(2,GetHandleId(tr),udg_T_HASH)


Custom script: local real y = LoadRealBJ(3,GetHandleId(tr),udg_T_HASH)


-------- Stuff --------


Custom script: local unit u


-------- You must set this value = 100 to make unit invisible for other player --------


Set T_VISIBLE = 100.00


-------- Create effect and unit visible for 1 player only --------


Custom script: if GetLocalPlayer() == p then


Set T_S = T_EFFECT


-------- Then set it = 0, T_VISIBLE = 0.00 on this player click trackable, and other, it = 100. --------


Set T_VISIBLE = 0.00


-------- Clear Text Messages --------


Custom script: call ClearTextMessages()


Custom script: endif


-------- ------ --------


Custom script: call DestroyEffect(AddSpecialEffect(udg_T_S,x,y))


-------- ------ --------


Custom script: call RemoveUnit(LoadUnitHandleBJ(0,GetPlayerId(p),udg_T_HASH))


Custom script: if GetUnitTypeId(LoadUnitHandleBJ(GetPlayerId(p),0,udg_T_HASH)) == udg_T_UNITS[id] then


-------- IMPORTANT: THIS LINE JUST TEST, YOU MUST TO EDIT IT --------


Custom script: set udg_TEST_HERO[GetPlayerId(p)] = CreateUnit(p,udg_T_UNITS[id],GetRectCenterX(gg_rct_W),GetRectCenterY(gg_rct_W),0.)


-------- --------Clean Leak and Flush Data-------- --------


-------- ------ --------


Set T_COUNT = (T_COUNT - 1)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




T_COUNT Equal to 0



Then - Actions




Hashtable - Clear T_HASH




Custom script: call DestroyTrigger(udg_T_TRIGGER)



Else - Actions


Custom script: set tr = null


-------- Return nothing --------


Custom script: return


-------- ----------------------------------------------------------------- --------


Custom script: endif


-------- ------ --------


-------- Create unit for review --------


Custom script: set u = CreateUnit(p,udg_T_UNITS[id],GetRectCenterX(udg_T_REVIEW),GetRectCenterY(udg_T_REVIEW),0.)


-------- Text --------


Custom script: call DisplayTextToPlayer(p,0,0,"Hero Name:"+ GetUnitName(u))


Custom script: call DisplayTextToPlayer(p,0,0,udg_T_INFO[id])


Custom script: call DisplayTextToPlayer(p,0,0,"Click Again to choose this hero")


-------- Save this unit !! --------


Custom script: call SaveUnitHandleBJ(u,0,GetPlayerId(p),udg_T_HASH)


-------- This line make unit visible --------


Custom script: call UnitAddAbility(u,'Aloc')


Custom script: call SetUnitPathing(u,false)


Custom script: call SetUnitPosition(u,GetRectCenterX(udg_T_REVIEW),GetRectCenterY(udg_T_REVIEW))


Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with T_VISIBLE% transparency


-------- Recycle --------


Custom script: set tr = null


Custom script: set u = null
[/HIDDEN]
PlayerLeft

Events

Conditions

Actions


Game - Display to (All players) for 30.00 seconds the text: ((Name of (Triggering player)) + OUT !)


Set T_COUNT = (T_COUNT - 1)


-------- Clean Data --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




T_COUNT Equal to 0



Then - Actions




Hashtable - Clear T_HASH




Custom script: call DestroyTrigger(udg_T_TRIGGER)




Custom script: call DestroyTrigger(GetTriggeringTrigger())



Else - Actions