function EnemyTroops takes nothing returns boolean
return IsUnitEnemy( GetFilterUnit(), ConvertedPlayer( udg_AI_PlayerNumber ) ) and IsUnitAliveBJ( GetFilterUnit() ) //and GetConvertedPlayerId(GetOwningPlayer(GetFilterUnit())) < 6
endfunction
// ********************************************************************
// checks if the unit type is a captain of the batalion
// returns array index defined in initialization, otherwise returns 0
function IsCaptain takes integer captain returns integer
local integer i = 1
loop
if ( captain == udg_BattalionCaptain[i] ) then
return i
endif
exitwhen i > udg_NrTypes
set i = i + 1
endloop
return 0
endfunction
// ********************************************************************
// returns captain unit of the batalion
function GetCaptain takes group batalion returns unit
local unit captain
local group tempgroup = CreateGroup()
call GroupAddGroup(batalion,tempgroup)
loop
set captain = FirstOfGroup(tempgroup)
exitwhen LoadInteger(udg_hashtable, GetHandleId(captain), 1) == 1 // or captain == null
call GroupRemoveUnit( tempgroup, captain )
endloop
call DestroyGroup(tempgroup)
set tempgroup = null
return captain
endfunction
// ********************************************************************
// checks if batalion has all his units
function IsComplete takes unit captain returns boolean
local integer battallionIndex = LoadInteger(udg_hashtable, GetHandleId(captain), 0)
if ( battallionIndex == 0 ) then
return true
endif
if ( CountUnitsInGroup( udg_Battallion[battallionIndex] ) == udg_BattalionSize[IsCaptain(GetUnitTypeId( captain ))] +1 ) then
return true
else
return false
endif
endfunction
// ********************************************************************
function GetOrderAbility takes integer batalionOrder, integer caster returns integer
local integer i = 1
loop
exitwhen i == 30
if ( batalionOrder == udg_BattalionSpellOrderID[i] and caster == udg_BattalionSpellCaster[i] ) then
return i
endif
set i = i + 1
endloop
return 0
endfunction
function GetBatalionAbility takes integer batalionSpell returns integer
local integer i = 1
loop
exitwhen i == 30
if ( batalionSpell == udg_BattalionSpellAbility[i] ) then
return i
endif
set i = i + 1
endloop
return 0
endfunction
Name | Type | is_array | initial_value |
AH_colorString | string | Yes | |
AH_commandString | string | Yes | |
AH_hashtable | hashtable | No | |
AH_player | player | No | |
AH_playerTarget | player | No | |
AH_prefix | string | No | |
AH_skipGroup | force | No | |
AH_string | string | No | |
AH_substring | string | No | |
AH_tempGroup | force | No | |
AI_AttackGroup | group | Yes | |
AI_Defenders | group | Yes | |
AI_Movement | group | Yes | |
AI_Player_Copy | player | No | |
AI_PlayerNumber | integer | No | |
armorCounter | integer | No | |
Arturus | unit | No | |
BatalionHash_Beast | integer | No | 9 |
BatalionHash_Crew | integer | No | 8 |
BatalionHash_Guards | integer | No | 6 |
BatalionHash_Order | integer | No | 2 |
BatalionHash_Summonable | integer | No | 7 |
BatalionHash_TargetUnit | integer | No | 5 |
BatalionHash_TargetX | integer | No | 3 |
BatalionHash_TargetY | integer | No | 4 |
BattalionCaptain | unitcode | Yes | |
BattalionGoldCost | integer | Yes | |
BattalionPowerCost | integer | Yes | |
BattalionSize | integer | Yes | |
BattalionSpellAbility | abilcode | Yes | |
BattalionSpellCaster | unitcode | Yes | |
BattalionSpellOrderID | integer | Yes | |
BattalionSpellOrderString | string | Yes | |
BattalionTimer | real | Yes | |
BattalionTroop | unitcode | Yes | |
Battallion | group | Yes | |
BattallionCount | integer | No | |
BattallionIndex | integer | No | |
BattallionLimit | integer | No | 330 |
BattallionQueued | group | No | |
BattallionRegroup | real | No | 700.00 |
Build_TreeType | unitcode | Yes | |
CargoEvent | real | No | |
CargoTransportGroup | group | Yes | |
CargoTransportUnit | unit | Yes | |
CAVAbiLevel | integer | No | |
CAVAccDistance | real | Yes | |
CAVAccPenalty | real | Yes | |
CAVAccRate | real | Yes | |
CavalryGroup | group | No | |
CAVAnimationSpeed | real | Yes | |
CAVAnimationSpeed_time | real | Yes | |
CAVAttackType | attacktype | No | |
CAVChargeTime | real | Yes | |
CAVDamage | real | Yes | |
CAVDamagecCoef | real | Yes | |
CAVDamageType | damagetype | No | |
CAVDetectGroup | group | No | |
CAVDistanceOfEnding | real | Yes | |
CAVDummyUnitType | unitcode | No | |
CAVgroup | group | No | |
CAVgroup2 | group | No | |
CAVgroup3 | group | No | |
CAVgroup4 | group | No | |
CAVHitArea | real | Yes | |
CAVinteger | integer | No | |
CAVinteger2 | integer | No | |
CAVinteger3 | integer | No | |
CAVKnockbackGroup | group | No | |
CAVKnockDur | real | Yes | |
CAVKnockRate | real | Yes | |
CAVMainAbility | abilcode | No | |
CAVpoint | location | Yes | |
CAVreal | real | Yes | |
CAVResetGroup | group | No | |
CAVSpeed | real | Yes | |
CAVSquadEngage | real | Yes | |
CAVStunAbility | abilcode | No | |
CAVStunDuration | real | Yes | |
CAVStunGroup | group | No | |
CAVtemp_unit | unit | No | |
CAVtemp_unit2 | unit | No | |
CAVtemp_unit_type | unitcode | No | |
check | boolean | No | |
CheckDeathList | integer | Yes | |
CheckDeathTimer | timer | No | |
ClsR_Ability | abilcode | No | |
ClsR_AbilityLevels | integer | No | |
ClsR_AbilityOrder | ordercode | No | |
ClsR_AreaOfEffect | real | Yes | |
ClsR_areaOfTarget | real | Yes | |
ClsR_Caster | unit | Yes | |
ClsR_casterOwner | player | Yes | |
ClsR_Counter | integer | Yes | |
ClsR_Counter2 | integer | Yes | |
ClsR_CountRockets | boolean | No | |
ClsR_DamagePerRocket | real | Yes | |
ClsR_DelayPerWave | real | No | |
ClsR_FirstWaveDelay | real | No | |
ClsR_Hashtable | hashtable | No | |
ClsR_HitTargetOnly | boolean | No | |
ClsR_Last | integer | No | |
ClsR_lastPitch | real | Yes | |
ClsR_lastX | real | Yes | |
ClsR_lastY | real | Yes | |
ClsR_lastZ | real | Yes | |
ClsR_Level | integer | Yes | |
ClsR_MakeUnitExplode | boolean | No | |
ClsR_mapBorder | real | Yes | |
ClsR_MaxIndex | integer | No | |
ClsR_Next | integer | Yes | |
ClsR_NoTarget | boolean | No | |
ClsR_OrientationPitch | real | No | |
ClsR_OrientationRoll | real | No | |
ClsR_OrientationYaw | real | No | |
ClsR_Pitch | real | Yes | |
ClsR_posX | real | Yes | |
ClsR_posY | real | Yes | |
ClsR_posZ | real | Yes | |
ClsR_PreferTargetUnit | boolean | No | |
ClsR_Prev | integer | Yes | |
ClsR_realTimer | real | Yes | |
ClsR_realTimer2 | real | Yes | |
ClsR_Recyclable | integer | No | |
ClsR_Recycle | integer | Yes | |
ClsR_RocketAttackType | attacktype | No | |
ClsR_RocketDamageType | damagetype | No | |
ClsR_rocketFx | effect | Yes | |
ClsR_RocketsCollisionSize | real | No | |
ClsR_RocketsCount | integer | Yes | |
ClsR_RocketsCrashHeight | real | No | |
ClsR_RocketsDamageRange | real | Yes | |
ClsR_RocketsExpirationTime | real | No | |
ClsR_RocketsFacingWidth | real | No | |
ClsR_RocketsInterval | real | No | |
ClsR_RocketsMaxFacingVariation | real | No | |
ClsR_RocketsMaxPitchVariation | real | No | |
ClsR_RocketsMinFacingVariation | real | No | |
ClsR_RocketsMinPitchVariation | real | No | |
ClsR_RocketsModel | string | No | |
ClsR_RocketsPerSecond | integer | No | |
ClsR_RocketsPerWave | integer | No | |
ClsR_RocketsSize | real | No | |
ClsR_RocketsSpawnHeightBonus | real | No | |
ClsR_RocketsSpawnOffset | real | No | |
ClsR_RocketsSpeedBase | real | Yes | |
ClsR_RocketsTurnAcceleration | real | Yes | |
ClsR_RocketsUnitsHeightBonus | real | No | |
ClsR_Roll | real | Yes | |
ClsR_Stage | integer | Yes | |
ClsR_Target | unit | Yes | |
ClsR_targetCollision | real | Yes | |
ClsR_TargetEffectAttachment | string | No | |
ClsR_TargetEffectModel | string | No | |
ClsR_targetType | integer | Yes | |
ClsR_tempGroup | group | No | |
ClsR_Timer | timer | No | |
ClsR_ZLocator | location | No | |
CurrentDay | integer | No | |
CurrentMonth | integer | No | |
Dateint | integer | No | |
Datemultiboard | multiboard | No | |
Daysoftheweek | string | Yes | |
DeathEvent | real | No | |
DetectRemoveAbility | abilcode | No | |
DetectTransformAbility | abilcode | No | |
DummySystems | unit | No | |
Faction4Income | integer | No | |
handle | integer | No | |
HASHCAVALRY | hashtable | No | |
hashtable | hashtable | No | |
IncomeTimer | timer | No | |
isBuildingUnderConstruction | boolean | Yes | |
ISeeCannons | fogmodifier | No | |
IsUnitAlive | boolean | Yes | |
IsUnitBeingUnloaded | boolean | Yes | |
IsUnitNew | boolean | Yes | |
IsUnitPreplaced | boolean | Yes | |
IsUnitReincarnating | boolean | Yes | |
IsUnitRemoved | boolean | Yes | |
IsUnitTransforming | boolean | Yes | |
KB | integervar | No | |
KB_Angle | real | Yes | |
KB_Distance | real | Yes | |
KB_Group | group | Yes | |
KB_Int | integer | No | |
KB_Off | boolean | Yes | |
KB_Point | location | Yes | |
KB_Skip | integer | No | |
KB_Spam | integer | Yes | |
KB_Speed | real | Yes | |
KB_Target | unit | Yes | |
KB_Times | integer | No | |
KillerOfUnit | unit | Yes | |
monthsoftheyyear | string | Yes | |
MultiboatrdTitle | string | No | |
NrTypes | integer | No | 50 |
OHS_CancelTrainingGroup | group | No | |
OHS_CancelTrainingStack | integer | Yes | |
OHS_CheckHashtable | hashtable | No | |
OHS_CheckResourceType | string | No | |
OHS_CheckUnitGroup | group | No | |
OHS_DisplayOilIcon | string | No | |
OHS_FloatingTextColour | string | No | |
OHS_HarvestAbility | abilcode | No | |
OHS_LoadOilCost | integer | No | |
OHS_LoadUnitType | unitcode | No | |
OHS_Multiboard | multiboard | Yes | |
OHS_OilHarvestAmount | integer | No | |
OHS_OilRemaining | integer | Yes | |
OHS_OilResource | integer | Yes | |
OHS_PlayersUsingDisplaySystem | force | No | |
OHS_ReturnAbility | abilcode | No | |
OHS_SaveFunctionType | string | No | |
OHS_SaveGoldRefund | integer | No | |
OHS_SaveLumberRefund | integer | No | |
OHS_SaveOilCost | integer | No | |
OHS_SaveOilRemaining | integer | No | |
OHS_SaveResourceType | string | No | |
OHS_SaveUnitType | unitcode | No | |
OHS_SearchFunctionType | string | No | |
OHS_SearchResourceType | string | No | |
OHS_UsageHashtable | hashtable | No | |
Players | force | No | |
PointRotate | location | No | |
PRM_Change | integer | No | |
PRM_EVENT | real | No | |
PRM_FireEvent | boolean | No | |
PRM_GoldLevel | integer | Yes | |
PRM_LumberLevel | integer | Yes | |
PRM_MonitorPlayer | boolean | Yes | |
PRM_Player | player | No | |
Quest_DefendReq2 | questitem | No | |
Quest_KirindorfFire | quest | No | |
Quest_Necromancer | quest | No | |
Quest_Necromancer_Req | questitem | No | |
RandomINT | integer | No | |
RegionClear | rect | No | |
Resource_Ability | abilcode | No | |
Resource_Cost | integer | Yes | |
Resource_CostItem | itemcode | No | |
Resource_CostResearch | techcode | No | |
Resource_CostUnit | unitcode | No | |
Resource_Destructable | destructablecode | Yes | |
Resource_Dummy | unitcode | No | |
Resource_DummyTree | destructablecode | No | |
Resource_Event | real | No | |
Resource_Name | string | Yes | |
Resource_Number | integer | No | |
Resource_Player | player | No | |
Resource_PrintMsgDeveloping | boolean | No | |
Resource_PrintWarnings | boolean | No | |
Resource_Structure | unitcode | Yes | |
Resource_Value | integer | No | |
Resource_Worker | unitcode | Yes | |
ResourceColor | string | Yes | |
RG_BooleanResourceBuilding | boolean | No | |
RG_Building | unitcode | No | |
RG_DurationInterval | real | No | |
RG_FloatingTextFadeTime | real | No | |
RG_FloatingTextLifeSpan | real | No | |
RG_FloatingTextSpeed | real | No | |
RG_Group | group | No | |
RG_Hashtable | hashtable | No | |
RG_Income | integer | No | |
RG_Interval | real | No | |
RG_Key | integer | No | |
RG_MaxResource | integer | No | |
RG_ResourceType | integer | No | |
RG_ResourceTypeFood | integer | No | |
RG_ResourceTypeGold | integer | No | |
RG_ResourceTypeLumber | integer | No | |
RG_Triggers | trigger | Yes | |
Selected1 | group | Yes | |
shieldCounter | integer | No | |
Status | integer | Yes | |
Summon | integer | No | 6 |
SummonerOfUnit | unit | Yes | |
target | unit | No | |
TempCommander | unit | No | |
tempDistance | real | No | |
TempFloatingText | texttag | No | |
tempForce | force | No | |
TempGroiup | group | No | |
tempGroup | group | No | |
TempHero | unit | No | |
tempId | integer | No | |
tempInt | integer | No | |
Tempint | integer | No | |
tempLoc | location | No | |
tempLoc2 | location | No | |
Tempplayer | player | No | |
tempPlayer | player | No | |
TempPlayerGroup | force | No | |
Temppoint | location | No | |
TempPoint | location | No | |
Temppoint01 | location | No | |
TempRealX | real | No | |
Tempunit | unit | No | |
TempUnit | unit | No | |
tempUnit | unit | No | |
tempUnitPicked | unit | No | |
tempUnitTarget | unit | No | |
tempUnitTrigger | unit | No | |
TempUnitType | unitcode | No | |
timer | real | No | |
Timer | timer | No | |
TimerWindow | timerdialog | No | |
TorchDuration | real | Yes | |
TorchTimer | timer | No | |
TorchUG | group | No | |
TownCap | unit | No | |
TranslatePlayerNumber | integer | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexLastRecycled | integer | No | |
UDexMax | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
Unittype | unitcode | No | |
UnitTypeEvent | real | No | |
UnitTypeOf | unitcode | Yes | |
WagonsKilled | integer | No | |
WaveFreemen | group | No | |
weaponCounter | integer | No | |
Weather | weathereffect | No | |
WeatherperSeason | weathereffect | No | |
WeatherSTR | string | No | |
WeatherVar | weathereffect | Yes | |
WeekNumber | integer | No | |
WorldMaxX | real | No | |
WorldMaxY | real | No |