//----------------------------- Создает текст над героем ---------------------------------
function TeoTextTag takes string t, unit hero, real R, real G, real B returns nothing
local texttag text = CreateTextTagUnitBJ( t, hero, 20, 10, R, G, B, 0 )
call SetTextTagPermanentBJ( text, false )
call SetTextTagLifespanBJ( text, 2.00 )
call SetTextTagFadepointBJ( text, 0.50 )
call SetTextTagVelocityBJ( text, 64, 90 )
set text = null
endfunction
//----------------------------- Создание юнита --------------------------------------------
function TeoCreateUnit takes player id, integer unitid, real x, real y, real face returns unit
set bj_lastCreatedUnit = CreateUnit(id, unitid, x, y, face)
return bj_lastCreatedUnit
endfunction
//------------------------------ Создание юнита-пустышки -------------------------------------
// Функция создает юнита-пустышку на 1.5 сек. для определенного игрока в точке (x,y)
// с определенной способностью
// Входные параметры: игрок; тип юнита; координаты; способность.
//-------------------------------------------------------------------------------
function TeoCreateDummyUnit takes player id, integer unitid, real x, real y, integer abilityid returns unit
set bj_lastCreatedUnit = CreateUnit(id, unitid, x, y, 0)
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 1.5 )
call UnitAddAbility( bj_lastCreatedUnit, abilityid )
return bj_lastCreatedUnit
endfunction
//--------------------------------------------------------------------------------
function TeoMovement takes real step, unit u, real angle returns nothing
local real x = GetUnitX(u) + step * Cos(angle * bj_DEGTORAD)
local real y = GetUnitY(u) + step * Sin(angle * bj_DEGTORAD)
call SetUnitPosition( u, x, y )
endfunction
//---------------------------- Создание бегущей крысы ---------------------------
// Функция создает крысу, бегущую из точки (x1,y1) в точку (x2,y2)
// Входные параметры: координаты начала; координаты конца; угол поворота.
//-------------------------------------------------------------------------------
function TeoRat takes real x1, real y1, real x2, real y2, real face returns nothing
local unit u
local real dist
local real time
// Создаем крысу в нужной точке под нужным углом
set u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'n01N', x1, y1, face)
// Вычисляем расстояние
set dist = SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))
// Вычисляем время
set time = dist / GetUnitDefaultMoveSpeed(u)
call UnitApplyTimedLife( u, 'BTLF', time )
call IssuePointOrder (u, "move", x2, y2)
endfunction
//---------------------------- Оживление каменного голема ---------------------------
// Функция оживляет конкретного каменного голема-статую
// Входные параметры: оживляемый голем.
//-------------------------------------------------------------------------------
function TeoGolemRevival takes unit golem returns nothing
local unit u = golem
call ShowUnitHide(u)
call UnitRemoveAbility(u, 'Aloc')
call ShowUnitShow(u)
call UnitAddItemByIdSwapped('I01X', u )
call SetUnitOwner( u, Player(PLAYER_NEUTRAL_AGGRESSIVE), true )
call SetUnitAnimation(u, "stand")
call SetUnitVertexColorBJ( u, 100, 100, 100, 0 )
// Обнуляем переменные
set u = null
endfunction
//------------------------------ Создание портала -------------------------------
// Функция возрождает портал с ускоренной анимацией и звуком
// Входные параметры: номер портала.
//-------------------------------------------------------------------------------
function TeoPortalRevival takes integer num returns nothing
local destructable d1 = LoadDestructableHandleBJ(num, 1, GetLastCreatedHashtableBJ())
local destructable d2 = LoadDestructableHandleBJ(num, 2, GetLastCreatedHashtableBJ())
local real x1 = GetDestructableX(d1)
local real y1 = GetDestructableY(d1)
local real x2 = GetDestructableX(d2)
local real y2 = GetDestructableY(d2)
local destructable sound1
local destructable sound2
//Создаем декорацию без файла-модели с нужным звуком смерти и уничтожаем её
set sound1 = CreateDestructable ('B00Q', x1, y1, GetRandomDirectionDeg(), 1, 0)
set sound2 = CreateDestructable ('B00Q', x2, y2, GetRandomDirectionDeg(), 1, 0)
call KillDestructable( sound1 )
call KillDestructable( sound2 )
call DestructableRestoreLife( d1, 50.00, true )
call DestructableRestoreLife( d2, 50.00, true )
call SetDestAnimationSpeedPercent( d1, 320.00 )
call SetDestAnimationSpeedPercent( d2, 320.00 )
call TriggerSleepAction( 1.00 )
call SetDestAnimationSpeedPercent( d1, 100.00 )
call SetDestAnimationSpeedPercent( d2, 100.00 )
call TriggerSleepAction( 3.00 )
set udg_Portal_Activity_Bool[num] = true
// Обнуляем переменные
set d1 = null
set d2 = null
set sound1 = null
set sound2 = null
endfunction
//------------------------------ Перемещение через портал -----------------------
// Функция возрождает портал с ускоренной анимацией и звуком
// Входные параметры: входящий в портал юнит; номер портала; угол выхода из портала.
//-------------------------------------------------------------------------------
function TeoPortalMoving takes unit u, integer num, real angle returns nothing
local real distance = 200
local destructable d = LoadDestructableHandleBJ(num, 2, GetLastCreatedHashtableBJ())
local real x = GetDestructableX(d)
local real y = GetDestructableY(d)
local location point = GetDestructableLoc(d)
call SetUnitPosition( u, x, y )
call IssuePointOrder( u, "move", x + distance*Cos(angle * 0.0174), y + distance*Sin(angle * 0.0174) )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(u), point, 0 )
// Обнуляем переменные
call RemoveLocation(point)
set point = null
set d = null
endfunction
//------------------------------ Включение обелиска -----------------------------
// Функция включает обелиск
// Входные параметры: номер обелиска; подходящий к обелиску юнит.
//-------------------------------------------------------------------------------
function TeoObeliskEntrance takes integer i, unit u returns nothing
if ((IsUnitGroupEmptyBJ(udg_Obelisk_Units[i]) == true ) and (udg_Obelisk_condition[i] == false )) then
call PlaySoundBJ( gg_snd_AutoCastButtonClick1 )
call SetUnitColor( udg_Obelisk[i], PLAYER_COLOR_PURPLE )
call SetUnitAnimation( udg_Obelisk[i], "stand alternate" )
endif
call PauseTimerBJ( true, udg_Obelisk_Timer[i] )
set udg_Obelisk_condition[i] = true
call GroupAddUnitSimple( u, udg_Obelisk_Units[i] )
endfunction
//------------------------------ Выключение обелиска ----------------------------
// Функция выключает обелиск
// Входные параметры: номер обелиска; отходящий от обелиска юнит.
//-------------------------------------------------------------------------------
function TeoObeliskExit takes integer i, unit u returns nothing
call GroupRemoveUnitSimple( u, udg_Obelisk_Units[i] )
if ( IsUnitGroupEmptyBJ(udg_Obelisk_Units[i]) == true ) then
call StartTimerBJ( udg_Obelisk_Timer[i], false, 3.00 )
endif
endfunction
//------------------------ Таймер деактивации обелисков Босса --------------------
// Функция показывает таймер деактивации обелисков босса.
// Входные параметры: номер обелиска; начальное значение таймера.
//--------------------------------------------------------------------------------
function TeoObeliskTimer takes integer i, integer num returns nothing
local texttag msg
local string text = I2S(num)
set msg = CreateTextTagUnitBJ( text, udg_Boss_Obelisk[i], 0, 10, 100, 100, 0.00, 0 )
set num = num - 1
call TriggerSleepAction( 0.85 )
call DestroyTextTag(msg)
if ((num > 0) and (udg_Boss_Obelisk_condition[i]== true)) then
call TeoObeliskTimer(i,num)
endif
endfunction
//------------------------ ПРОВЕРКА НА УТЕЧКИ --------------------------------
function HandleCounter_Update takes nothing returns nothing
local integer i = 0
local integer id
local location array P
local real result=0
loop
exitwhen i >= 50
set i = i + 1
set P[i] = Location(0,0)
set id = GetHandleId(P[i])
set result = result + (id-0x100000)
endloop
set result = result/i-i/2
loop
call RemoveLocation(P[i])
set P[i] = null
exitwhen i <= 1
set i = i - 1
endloop
call LeaderboardSetItemValue(udg_HandleBoard,0,R2I(result))
endfunction
function HandleCounter_Actions takes nothing returns nothing
set udg_HandleBoard = CreateLeaderboard()
call LeaderboardSetLabel(udg_HandleBoard, "Handle Counter")
call PlayerSetLeaderboard(GetLocalPlayer(),udg_HandleBoard)
call LeaderboardDisplay(udg_HandleBoard,true)
call LeaderboardAddItem(udg_HandleBoard,"Handles",0,Player(0))
call LeaderboardSetSizeByItemCount(udg_HandleBoard,1)
call HandleCounter_Update()
call TimerStart(GetExpiredTimer(),0.05,true,function HandleCounter_Update)
endfunction
Name | Type | is_array | initial_value |
All_Items | item | Yes | |
All_Items_num | integer | No | |
AnimationStep | real | No | |
Archmage_Heal_Group | group | No | |
Archmage_Heal_Timer | timer | No | |
Archmage_type_attack | integer | No | |
Beast_Rampage_bool | boolean | No | |
Beast_Rampage_Unit | unit | No | |
Blocking_Point | location | Yes | |
Blocking_Unit | group | No | |
Book_open_Bool | boolean | No | |
Boss1_stage | integer | No | 1 |
Boss3_Archmage_Sphere | unit | No | |
Boss3_Goblin_Item | item | No | |
Boss3_InitialSpawnFrequence | integer | Yes | |
Boss3_MaxMonsters | integer | Yes | |
Boss3_MonsterGroups | group | Yes | |
Boss3_MonsterTypes | unitcode | Yes | |
Boss3_NumMonsters | integer | No | |
Boss3_Orc_Item | item | No | |
Boss3_SpawnFrequence | integer | Yes | |
Boss3_SpawnRegions | rect | Yes | |
Boss3_Troll_Item | item | No | |
Boss3_Wave_Timer | timer | No | |
Boss_Obelisk | unit | Yes | |
Boss_Obelisk_condition | boolean | Yes | false |
Boss_Obelisk_num | integer | No | |
Boss_Obelisk_Timer | timer | Yes | |
BoxSize | real | No | |
Bridge_num | integer | No | |
Bridge_Timer | timer | No | |
Button | destructable | Yes | |
Button_Units | group | Yes | |
Choice_Player | group | Yes | |
Cinematic_Prisoner | boolean | No | |
Cinematic_skipped | boolean | No | |
Cinematic_Timer | timer | No | |
Cooldown_Boss1 | timer | No | |
Corpses_Group | group | No | |
Count_Life | integer | No | |
Debuff_status | integer | No | |
Devouer_in_zone | boolean | No | true |
Devouer_Timer | timer | No | |
Distance_to_victim | real | No | |
EarthGuard_in_zone | boolean | No | |
EarthGuard_Timer | timer | No | |
EasyPuzzle_Available_Box | boolean | Yes | |
EasyPuzzle_Group | group | No | |
EasyPuzzle_Group_New | group | No | |
EasyPuzzle_Region | rect | Yes | |
EasyPuzzle_Size_Timer | timer | No | |
Elevator_Timer | timer | Yes | |
EnableSpawners | boolean | Yes | |
END_ITEM | destructable | No | |
Eye | fogmodifier | Yes | |
Foggy_Mind_Timer | timer | No | |
Force_field | destructable | Yes | |
Force_Generator | unit | Yes | |
FREECAM | boolean | Yes | false |
Frenzy_Bool | boolean | No | true |
Frenzy_Unit | unit | No | |
FS_Angle | real | No | |
FS_Direction | real | No | |
FS_Final_Damage | real | No | |
FS_Items | item | Yes | |
FS_Level | integer | No | |
FS_Step | real | No | |
FS_Target_Unit | unit | No | |
FS_Unit_Copy | unit | No | |
Game_Stage | integer | No | |
Gate | destructable | Yes | |
Golem | unit | Yes | |
HandleBoard | leaderboard | No | |
HardPuzzle_Available_Box | boolean | Yes | |
HardPuzzle_Group | group | No | |
HardPuzzle_Group_New | group | No | |
HardPuzzle_Region | rect | Yes | |
HardPuzzle_Size_Timer | timer | No | |
HardPuzzleBox | unit | Yes | |
HaveBlock | boolean | No | false |
HellishCreature_random | integer | No | |
HellishCreature_zone | rect | Yes | |
Hero_any | unit | No | |
Hero_mechanic | unit | No | |
Hero_shaman | unit | No | |
Hero_Timer | timer | Yes | |
Hero_warrior | unit | No | |
Heroes_count | integer | No | |
HP_Devouer | real | No | |
InitialFrequencies | integer | Yes | |
InitialSpawnFrequence | integer | Yes | |
InitialTrapsFrequence | integer | Yes | |
Items | integer | Yes | |
Lighting | boolean | No | |
Lighting_Discharge_Timer | timer | No | |
Lighting_Storm_Timer | timer | No | |
Marauder_Timer | timer | No | |
MaxMonsters | integer | Yes | |
MonsterGroups | group | Yes | |
MonsterSpawners | unit | Yes | |
MonsterTypes | unitcode | Yes | |
Movement_Timer | timer | No | |
Movements_num | integer | No | |
Msg | texttag | No | |
Music | integer | No | |
Music_Timer | timer | No | |
Music_Timer_count | real | No | |
N | integer | No | |
Note | item | Yes | |
Note_count | integer | No | |
Note_num | integer | No | |
Note_Type | itemcode | Yes | |
NumMonsters | integer | No | |
NumTraps | integer | No | |
Obelisk | unit | Yes | |
Obelisk_condition | boolean | Yes | |
Obelisk_Timer | timer | Yes | |
Obelisk_Units | group | Yes | |
Pedestal | unit | Yes | |
Players | force | No | |
Portal_Activity_Bool | boolean | Yes | |
Portal_num | integer | No | |
Portals | unit | Yes | |
Provocation_Group | group | No | |
Provocation_Timer | timer | No | |
Quest_Prisoner | boolean | No | |
Random | integer | No | |
Rats_Group | group | No | |
Repair_Timer | timer | No | |
Reputation | real | No | 0.00 |
ResurrectionCircle | unit | Yes | |
ResurrectionsStones_condition | boolean | Yes | false |
ResurrectionStone | unit | Yes | |
ResurrectionStones_num | integer | No | |
Robot_Activation_Bool | boolean | No | |
Robot_Generator | unit | Yes | |
Robot_Repair_Bool | boolean | No | |
Robots_Group | group | No | |
Runes1 | destructable | Yes | |
Runes2 | destructable | Yes | |
Runes3 | destructable | Yes | |
Runes_conditions | integer | Yes | 0 |
Runes_num | integer | No | |
RunesTypes | destructablecode | Yes | |
Shadows_Group | group | No | |
Skeleton_Group | group | No | |
Spatial_Cube | unit | Yes | |
Spatial_Cubes_Checking | integer | Yes | |
SpawnAngle | real | Yes | |
SpawnFrequence | integer | Yes | |
Switch | destructable | Yes | |
Switch_condition | boolean | Yes | false |
Switch_num | integer | No | |
Talking_Hero | unit | No | |
Tanks_Group | group | No | |
Task_First | quest | No | |
Task_Main | quest | No | |
Task_Notes | quest | No | |
Teleport_Bool | boolean | No | |
TempGenerator | unit | Yes | |
TempGroup | group | No | |
TempHardPuzzleBox | unit | Yes | |
TempItem | item | No | |
TempNumButton | integer | No | |
TempNumButtonItem | integer | No | |
TempREG | rect | No | |
TempUnit | unit | No | |
Timer_Duration | real | No | |
TotalGold | integer | No | |
Trap_Bool | boolean | Yes | |
Trap_Units | group | No | |
TrapBlock | destructable | Yes | |
TrapFrequence | integer | Yes | |
TrapRegion | rect | Yes | |
Traps | destructable | Yes | |
Traps_count | integer | No | |
Trigger_for_Boss1 | integer | No | |
UNIT_Boss1 | unit | No | |
UNIT_Boss2 | unit | No | |
UNIT_Boss3_Archmage | unit | No | |
UNIT_Boss3_Goblin | unit | No | |
UNIT_Boss3_Orc | unit | No | |
UNIT_Boss3_Troll | unit | No | |
UNIT_Devastator | unit | No | |
UNIT_Devouer | unit | No | |
UNIT_EarthGuard | unit | No | |
UNIT_FS_Dummy | unit | No | |
UNIT_HellishCreature | unit | No | |
UNIT_Lizard | unit | No | |
UNIT_Marauder | unit | No | |
UNIT_Merchant | unit | No | |
UNIT_Naga | unit | No | |
UNIT_Overseer | unit | No | |
UNIT_Prisoner | unit | No | |
UNIT_Robot | unit | No | |
UNIT_Robot_Mechanic | unit | No | |
UNIT_Skeleton_merchant | unit | No | |
UNIT_Traveler | unit | No | |
UNIT_WaterGuard | unit | No | |
Units_in_the_boss1_area | group | No | |
Victims_Group | group | No | |
VictimUnit | unit | No | |
WaterGuard_in_zone | boolean | No | |
WaterGuard_Timer | timer | No | |
WaterGuard_Warrior | group | No | |
WaterGuard_Worker | group | No | |
Wrong_Place_for_Item | boolean | No | |
Z_time | real | Yes | 0.00 |
Z_Unit | unit | Yes |