//TESH.scrollpos=0
//TESH.alwaysfold=0
function DebugError takes player ForPlayer, string msg returns nothing
local sound error=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
if (GetLocalPlayer() == ForPlayer) then
if (msg!="") and (msg!=null) then
call ClearTextMessages()
call DisplayTimedTextToPlayer(ForPlayer, 0.85, 0., 2.00, "|cffffcc00"+msg+"|r")
endif
call StartSound(error)
endif
call KillSoundWhenDone(error)
set error=null
endfunction
function HideLifeBar takes unit u returns nothing
call UnitAddAbility(u,'Aloc')
call ShowUnit(u,false)
call UnitRemoveAbility(u,'Aloc')
call ShowUnit(u,true)
endfunction
library Z initializer Init
globals
private location tempL
endglobals
function GetCoordinateZ takes real x, real y returns real
call MoveLocation(tempL, x, y)
return GetLocationZ(tempL)
endfunction
function GetZ takes real x, real y returns real
local real x1 = x - ModuloReal(x, 128.) // top left corner
local real y1 = y - ModuloReal(x, 128.) + 128.
local real z1 = GetCoordinateZ(x1, y1)
local real x3 = x1 + 128. // bottom right
local real y3 = y1 - 128.
local real z3 = GetCoordinateZ(x3, y3)
local real x2
local real y2
local real z2
local real A
local real B
local real C
local real D
if (x-x1) < (y1-y) then // in bottom left section
set x2 = x1
set y2 = y3
else
set x2 = x3 // top right corner
set y2 = y1
endif
set z2 = GetCoordinateZ(x2, y2)
set A = y1*(z2 - z3) + y2*(z3 - z1) + y3*(z1 - z2) //
//http://local.wasp.uwa.edu.au/~pbourke/geometry/planeeq/ ftw
set B = z1*(x2 - x3) + z2*(x3 - x1) + z3*(x1 - x2)
set C = x1*(y2 - y3) + x2*(y3 - y1) + x3*(y1 - y2)
set D = -( x1*(y2*z3 - y3*z2) + x2*(y3*z1 - y1*z3) + x3*(y1*z2 - y2*z1) )
return -(A*x + B*y + D) / C
endfunction
private function Init takes nothing returns nothing
set tempL = Location(0.,0.)
endfunction
endlibrary
Name | Type | is_array | initial_value |
Bar_Players_Group | force | No | |
BolehRepick | boolean | Yes | |
CH | boolean | Yes | |
ColourString | string | Yes | |
Creep_Loop | integer | No | |
Creep_Positions | location | Yes | |
Creep_ReviveTime | real | Yes | |
Creep_Types | unitcode | Yes | |
Floating_Text_Unit | unit | Yes | |
GameTimE | integer | No | |
Gray_Bar | boolean | No | |
Gray_Bar_Float_HP | texttag | Yes | |
Gray_Bar_Float_MA | texttag | Yes | |
Gray_Bar_Text | string | No | |
Heroes | unit | Yes | |
HeroLevel | integer | Yes | |
HP_Bar_Float | texttag | Yes | |
HP_Bar_Percentage | real | Yes | |
HP_Bar_Text | StringExt | Yes | |
Integer_A | integervar | Yes | |
LB_Int | integer | No | |
LoadingBar_Intra_Loop | integer | No | |
LoadingBar_Loop | integer | No | |
LoadingBar_Player_Group | force | Yes | |
LoadingBar_String | string | No | |
LoadingBar_String2 | string | Yes | |
LoadingBar_Times | integer | Yes | |
LoopCreep | integer | No | |
MA_Bar_Float | texttag | Yes | |
MA_Bar_Percentage | real | Yes | |
MA_Bar_Text | StringExt | Yes | |
Minutes | integer | No | |
PlayerNames | string | Yes | |
PlayerNumber_Loop | integer | No | |
Players_Selected_Unit | unit | Yes | |
Points | location | Yes | |
PrivateGroup | force | Yes | |
Random_Hero_Integer | integer | No | |
Random_Integer | integer | No | |
Random_Total | integer | Yes | |
RandomHero | unitcode | Yes | |
ReviveHero | unit | Yes | |
Seconds | integer | No | |
Skills_Owner | integer | Yes | 1 |
Skills_Unit_No | unit | Yes | |
StandarName | string | Yes | |
String | string | Yes | |
SudahRandom | boolean | Yes | |
System_B_Inc_Lvl | boolean | Yes | |
System_Hero_Tab | location | No | |
System_Inc_Lvl | integer | Yes | |
System_is_already_on | boolean | Yes | |
System_Level_Spells1 | integer | Yes | |
System_Level_Spells2 | integer | Yes | |
System_Level_Spells3 | integer | Yes | |
System_Level_Spells4 | integer | Yes | |
System_Owner | unit | Yes | |
System_Spells1_Loc | location | No | |
System_Spells2_Loc | location | No | |
System_Spells3_Loc | location | No | |
System_Spells4_Loc | location | No | |
System_System_Loc | location | No | |
System_Unit | unit | Yes | |
SystemOwner_Loop | integer | No | |
SystemPlayer_Owner | player | Yes | |
Temp_String | string | Yes | |
Temp_Unit | unit | No | |
The_Sentinel | group | No | |
The_Sentinel_Player_Group | force | No | |
TheSentinel_Unit | unit | Yes | |
UnitGroup | group | No | |
UnitGroups | group | Yes | |
Weather | weathereffect | Yes | |
WEATHER_RANDOM | integer | No | |
WEATHERLOOP | integer | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function ReviveCreepsSystem takes nothing returns nothing
local real WaitAfterMeReviveAgain = 60.00
local integer CUSTOM = GetUnitUserData(GetDyingUnit())
call TriggerSleepAction( WaitAfterMeReviveAgain )
call CreateNUnitsAtLoc( 1, udg_Creep_Types[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Positions[CUSTOM], bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
set WaitAfterMeReviveAgain = 0.00
set CUSTOM = 0
endfunction
//===========================================================================
function InitTrig_Revive_Creeps_Jass takes nothing returns nothing
local trigger we = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple( we, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( we, function ReviveCreepsSystem )
set we = null
endfunction
//TESH.scrollpos=70
//TESH.alwaysfold=0
library RectSystem initializer Init
globals
private rect R = Rect(0,0,0,0)
private group G = CreateGroup()
boolexpr ALL = null
endglobals
/*
Require :
library Z initializer Init
*/
function GetGroupInRect takes real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns group
local group g = CreateGroup()
local unit u = null
local real minx = 0
local real maxx = 0
local real miny = 0
local real maxy = 0
local real ux = 0
local real uy = 0
if x1 >= x2 and x1 >= x3 and x1 >= x4 then
set maxx = x1
elseif x2 >= x1 and x2 >= x3 and x2 >= x4 then
set maxx = x2
elseif x3 >= x1 and x3 >= x2 and x3 >= x4 then
set maxx = x3
else
set maxx = x4
endif
if x1 <= x2 and x1 <= x3 and x1 <= x4 then
set minx = x1
elseif x2 <= x1 and x2 <= x3 and x2 <= x4 then
set minx = x2
elseif x3 <= x1 and x3 <= x2 and x3 <= x4 then
set minx = x3
else
set minx = x4
endif
if y1 >= y2 and y1 >= y3 and y1 >= y4 then
set maxy = y1
elseif y2 >= y1 and y2 >= y3 and y2 >= y4 then
set maxy = y2
elseif y3 >= y1 and y3 >= y2 and y3 >= y4 then
set maxy = y3
else
set maxy = y4
endif
if y1 <= y2 and y1 <= y3 and y1 <= y4 then
set miny = y1
elseif y2 <= y1 and y2 <= y3 and y2 <= y4 then
set miny = y2
elseif y3 <= y1 and y3 <= y2 and y3 <= y4 then
set miny = y3
else
set miny = y4
endif
call SetRect(R, minx, miny, maxx, maxy)
call GroupEnumUnitsInRect(G, R, ALL)
loop
set u = FirstOfGroup(G)
exitwhen u == null
//if GetUnitFlyHeight(u) <= maxHeight and GetUnitFlyHeight(u) >= minHeight then
set ux = GetUnitX(u)
set uy = GetUnitY(u)
if (uy - y1)*(x2 - x1) - (ux - x1)*(y2 - y1) <= 0. then
if (uy - y2)*(x3 - x2) - (ux - x2)*(y3 - y2) <= 0. then
if (uy - y3)*(x4 - x3) - (ux - x3)*(y4 - y3) <= 0. then
if (uy - y4)*(x1 - x4) - (ux - x4)*(y1 - y4) <= 0. then
call GroupAddUnit(g, u)
endif
endif
endif
endif
//endif
call GroupRemoveUnit(G, u)
endloop
set G = g
set g = null
return G
endfunction
private function AlwaysTrue takes nothing returns boolean
return true
endfunction
private function Init takes nothing returns nothing
set ALL = Filter(function AlwaysTrue)
endfunction
endlibrary
//TESH.scrollpos=31
//TESH.alwaysfold=0
function Trig_Unstuck_Func001002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Unstuck_Func002A takes nothing returns nothing
call PauseUnitBJ( true, GetEnumUnit() )
endfunction
function Trig_Unstuck_Func005A takes nothing returns nothing
local unit z = GetEnumUnit()
local location x = GetRectCenter(gg_rct_Picking_Hero)
call PauseUnitBJ( false, z )
call SetUnitPositionLoc( z, x )
call RemoveLocation(x)
set z = null
set x = null
endfunction
function Trig_Unstuck_Actions takes nothing returns nothing
local player a = GetTriggerPlayer()
local location b = GetRectCenter(gg_rct_Picking_Hero)
local group HEH = GetUnitsOfPlayerMatching(GetTriggerPlayer(), Condition(function Trig_Unstuck_Func001002002))
local string WEQ = "Tunggu 5 detik, semua unit anda akan di unstuck dan langsung ke base"
call ForGroupBJ( HEH, function Trig_Unstuck_Func002A )
call DisplayTextToForce( GetForceOfPlayer(a), WEQ )
call TriggerSleepAction( 5.00 )
call ForGroupBJ( HEH, function Trig_Unstuck_Func005A )
call PanCameraToTimedLocForPlayer( a, b, 0 )
call DestroyGroup(HEH)
call RemoveLocation(b)
set HEH = null
set b = null
set WEQ = ""
set a = null
endfunction
//===========================================================================
function InitTrig_Unstuck takes nothing returns nothing
local trigger gg_trg_Unstuck = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(0), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(1), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(2), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(3), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(4), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(5), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(6), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(7), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(8), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(9), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(10), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(11), "-unstuck", true )
call TriggerAddAction( gg_trg_Unstuck, function Trig_Unstuck_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ChargesAddItems_Actions takes nothing returns nothing
local integer i = -1
local unit u = GetTriggerUnit()
local item it = GetManipulatedItem()
//Type Item Charged and Purchasble
loop
set i=i+1
if UnitItemInSlot(u,i)!=it and GetItemType(it)==ITEM_TYPE_CHARGED and GetItemTypeId(UnitItemInSlot(u,i))==GetItemTypeId(it)then
call SetItemCharges(UnitItemInSlot(u,i), GetItemCharges(UnitItemInSlot(u,i))+GetItemCharges(it))
call RemoveItem(it)
endif
if UnitItemInSlot(u,i)!=it and GetItemType(it)==ITEM_TYPE_PURCHASABLE and GetItemTypeId(UnitItemInSlot(u,i))==GetItemTypeId(it)then
call SetItemCharges(UnitItemInSlot(u,i), GetItemCharges(UnitItemInSlot(u,i))+GetItemCharges(it))
call RemoveItem(it)
endif
exitwhen i==5
endloop
set u = null
set it = null
endfunction
//===========================================================================
function InitTrig_ChargesAddItems takes nothing returns nothing
local trigger ChargesAdd = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( ChargesAdd, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( ChargesAdd, function Trig_ChargesAddItems_Actions )
set ChargesAdd = null
endfunction
//TESH.scrollpos=25
//TESH.alwaysfold=0
function Trig_Matchup_Func001002002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Matchup_Func001002002002 takes nothing returns boolean
return ( GetPlayerController(GetOwningPlayer(GetFilterUnit())) == MAP_CONTROL_USER )
endfunction
function Trig_Matchup_Func001002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Matchup_Func001002002001(), Trig_Matchup_Func001002002002() )
endfunction
function Trig_Matchup_Func002Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetTriggerPlayer()) == true ) ) then
return false
endif
return true
endfunction
function Trig_Matchup_Func002A takes nothing returns nothing
if ( Trig_Matchup_Func002Func001C() ) then
call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), ( ( "|cffFEFFD7" + ( GetPlayerName(GetOwningPlayer(GetEnumUnit())) + "|r" ) ) + ( " memegang hero " + ( ( "|cff01A2FF" + GetUnitName(GetEnumUnit()) ) + ( " |c004e2a04Telah menginjak Level |r|c007ebff1" + ( I2S(GetHeroLevel(GetEnumUnit())) + "|r" ) ) ) ) ) )
else
endif
endfunction
function Trig_Matchup_Actions takes nothing returns nothing
local group APALU = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Matchup_Func001002002))
call ForGroupBJ( APALU, function Trig_Matchup_Func002A )
call TriggerSleepAction( 1.00 )
call DestroyGroup(APALU)
set APALU = null
endfunction
//===========================================================================
function InitTrig_Matchup takes nothing returns nothing
set gg_trg_Matchup = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(1), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(6), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(0), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(2), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(3), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(4), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(5), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(7), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(8), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(9), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(10), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(11), "-ma", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(1), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(0), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(6), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(2), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(3), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(4), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(5), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(7), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(8), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(9), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(10), "-matchup", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Matchup, Player(11), "-matchup", true )
call TriggerAddAction( gg_trg_Matchup, function Trig_Matchup_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Movespeed_Func001002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Movespeed_Func002A takes nothing returns nothing
call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), ( ( GetPlayerName(GetTriggerPlayer()) + " " ) + ( GetUnitName(GetEnumUnit()) + ( "|r kecepatannya yaitu " + R2SW(GetUnitMoveSpeed(GetEnumUnit()), 1, 1) ) ) ) )
endfunction
function Trig_Movespeed_Actions takes nothing returns nothing
local group WANJENK = GetUnitsOfPlayerMatching(GetTriggerPlayer(), Condition(function Trig_Movespeed_Func001002002))
call ForGroupBJ( WANJENK, function Trig_Movespeed_Func002A )
call TriggerSleepAction( 1.00 )
call DestroyGroup(WANJENK)
set WANJENK = null
endfunction
//===========================================================================
function InitTrig_Movespeed takes nothing returns nothing
set gg_trg_Movespeed = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(1), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(0), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(6), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(2), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(3), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(4), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(5), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(7), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(8), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(9), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(10), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(11), "-ms", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(1), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(0), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(6), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(2), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(3), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(4), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(5), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(7), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(8), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(9), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(10), "-movespeed", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Movespeed, Player(11), "-movespeed", true )
call TriggerAddAction( gg_trg_Movespeed, function Trig_Movespeed_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function Trig_Setname_System_Jass_Actions takes nothing returns nothing
local player a = GetTriggerPlayer()
local string b = SubStringBJ(GetEventPlayerChatString(),10,StringLength(GetEventPlayerChatString()))
local integer c = 1
loop
exitwhen c>10
call SetPlayerName(a,b)
set c = c + 1
endloop
set a = null
set b = ""
endfunction
//===========================================================================
function InitTrig_Setname_System_Jass takes nothing returns nothing
local trigger gg_trg_Setname_System_Jass = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(0), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(1), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(2), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(3), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(4), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(5), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(6), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(7), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(8), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(9), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(10), "-setname", false )
call TriggerRegisterPlayerChatEvent( gg_trg_Setname_System_Jass, Player(11), "-setname", false )
call TriggerAddAction( gg_trg_Setname_System_Jass, function Trig_Setname_System_Jass_Actions )
set gg_trg_Setname_System_Jass = null
endfunction