///cinematic function credit: PurgeandFire on Hive.
function CinematicModeWithoutChangingFog takes boolean cineMode, force forForce, real interfaceFadeTime returns nothing
if (udg_GameStatus == udg_GAME_STATUS_REPLAY) then
return
endif
// If the game hasn't started yet, perform interface fades immediately
if (not bj_gameStarted) then
set interfaceFadeTime = 0
endif
if (cineMode) then
// Save the UI state so that we can restore it later.
if (not bj_cineModeAlreadyIn) then
set bj_cineModeAlreadyIn = true
set bj_cineModePriorSpeed = GetGameSpeed()
// set bj_cineModePriorFogSetting = IsFogEnabled()
// set bj_cineModePriorMaskSetting = IsFogMaskEnabled()
set bj_cineModePriorDawnDusk = IsDawnDuskEnabled()
set bj_cineModeSavedSeed = GetRandomInt(0, 1000000)
endif
// Perform local changes
if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call ClearTextMessages()
call ShowInterface(false, interfaceFadeTime)
call EnableUserControl(false)
call EnableOcclusion(false)
call SetCineModeVolumeGroupsBJ()
endif
// Perform global changes
call SetGameSpeed(bj_CINEMODE_GAMESPEED)
call SetMapFlag(MAP_LOCK_SPEED, true)
// call FogMaskEnable(false)
// call FogEnable(false)
// call EnableWorldFogBoundary(false)
call EnableDawnDusk(false)
// Use a fixed random seed, so that cinematics play consistently.
call SetRandomSeed(0)
else
set bj_cineModeAlreadyIn = false
// Perform local changes
if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
// Use only local code (no net traffic) within this block to avoid desyncs.
call ShowInterface(true, interfaceFadeTime)
call EnableUserControl(true)
call EnableOcclusion(true)
call VolumeGroupReset()
call EndThematicMusic()
call CameraResetSmoothingFactorBJ()
endif
// Perform global changes
call SetMapFlag(MAP_LOCK_SPEED, false)
call SetGameSpeed(bj_cineModePriorSpeed)
// call FogMaskEnable(bj_cineModePriorMaskSetting)
// call FogEnable(bj_cineModePriorFogSetting)
// call EnableWorldFogBoundary(true)
call EnableDawnDusk(bj_cineModePriorDawnDusk)
call SetRandomSeed(bj_cineModeSavedSeed)
endif
endfunction
///removeBnet function credit: IcemanBo, Purgedandfire @hiveworkshop.com
function removeBnetTag takes player p returns nothing
local string name = GetPlayerName(p)
local integer length = StringLength(name)
local integer index = length - 1
loop
exitwhen index < 0
if SubString(name, index, index+1) == "#" then
set name = SubString(name, 0, index)
call SetPlayerName(p, name)
return
endif
set index = index - 1
endloop
endfunction
function removeBnetTagAll takes nothing returns nothing
local integer pId = 0
local player p
loop
exitwhen pId >= bj_MAX_PLAYERS
set p = Player(pId)
if GetPlayerController(p) == MAP_CONTROL_USER then
call removeBnetTag(p)
endif
set pId = pId + 1
endloop
endfunction
Name | Type | is_array | initial_value |
absent_timer | timer | Yes | |
accepted_knight | integer | No | |
accepting_king | integer | No | |
additional_knight_cap | integer | No | 1 |
ai_craft_timer | timer | Yes | |
ai_king | boolean | Yes | |
ai_king_give | integer | Yes | |
AI_king_vis_mod | fogmodifier | Yes | |
allegiance_cd_timer | timer | Yes | |
AllUnits_Blue | group | No | |
AllUnits_Purp | group | No | |
AllUnits_Red | group | No | |
AllUnits_Teal | group | No | |
altar_point_teleport_array | location | Yes | |
altar_point_var_Brown | location | No | |
altar_point_var_DG | location | No | |
altar_point_var_Grey | location | No | |
altar_point_var_LB | location | No | |
altar_point_var_LG | location | No | |
altar_point_var_LightBrown | location | No | |
altar_point_var_LightPurple | location | No | |
altar_point_var_Lime | location | No | |
altar_point_var_OJ | location | No | |
altar_point_var_Peach | location | No | |
altar_point_var_Pink | location | No | |
altar_point_var_yellow | location | No | |
altar_regions_blue | rect | Yes | |
altar_regions_purple | rect | Yes | |
altar_regions_red | rect | Yes | |
altar_regions_teal | rect | Yes | |
Amount_bladetoss | real | No | |
Amount_fireball | real | No | |
Amount_frostbolt | real | No | |
Amount_katana_jutsu | real | No | |
amount_SA | real | No | |
Amount_snipe | real | No | |
animation_timer_boomvendor | timer | No | |
animation_timer_mana_temple | timer | No | |
animation_timer_panda | timer | No | |
animation_timer_vendor_gob | timer | No | |
animation_timer_vendor_wiz | timer | No | |
annoying_player | boolean | Yes | |
arti_counter_four_king | integer | No | |
arti_loop_four_king | integer | No | |
artifact_blue | item | No | |
artifact_crafted_blue | boolean | No | |
artifact_crafted_purp | boolean | No | |
artifact_crafted_red | boolean | No | |
artifact_crafted_teal | boolean | No | |
artifact_four_kings | item | No | |
artifact_god | item | No | |
artifact_purp | item | No | |
artifact_red | item | No | |
artifact_teal | item | No | |
AutoAccept_Buttons | button | Yes | |
AutoAccept_Dialog | dialog | No | |
AutoAccept_Result | integer | Yes | 1 |
AutoAccept_Strings | string | Yes | |
Available_Abom | boolean | No | true |
Available_DH | boolean | No | true |
Available_DI | boolean | No | true |
Available_DK | boolean | No | true |
Available_Druid | boolean | No | true |
Available_Fairy | boolean | No | true |
Available_Lock | boolean | No | true |
Available_LordRanger | boolean | No | true |
Available_Mage | boolean | No | true |
Available_Naga | boolean | No | true |
Available_Necro | boolean | No | true |
Available_Pala | boolean | No | true |
Available_Peasant | boolean | No | true |
Available_Pirate | boolean | No | true |
Available_Priest | boolean | No | true |
Available_Pyro | boolean | No | true |
Available_Samu | boolean | No | true |
Available_Shar | boolean | No | true |
Available_Sword | boolean | No | true |
Available_Vamp_Hunter | boolean | No | true |
Available_Vampire | boolean | No | true |
Available_War | boolean | No | true |
Available_Wisp | boolean | No | true |
Available_Wolf | boolean | No | true |
ba_crafted | boolean | No | |
base_SA | real | Yes | |
Basic_Creep_Items_Var | itemcode | Yes | |
beacons_KR_blue | group | No | |
beacons_KR_purp | group | No | |
beacons_KR_red | group | No | |
beacons_KR_teal | group | No | |
bf | integer | No | |
BF_DefautInterval | integer | No | |
BF_Hero | unit | Yes | |
BF_Max | integer | No | |
BF_SpecEffect1 | effect | Yes | |
BF_SpecEffect2 | effect | Yes | |
BF_Time | integer | Yes | |
BK1_loop | integer | No | |
BK2_loop | integer | No | |
BK3_loop | integer | No | |
BK4_loop | integer | No | |
BK_ankh_cd | real | No | |
BK_ankh_hp_restore | real | No | |
bk_arti | item | No | |
bk_death_counter | integer | No | |
bk_defeat_timer_a | timer | Yes | |
bk_defeat_timer_b | timer | Yes | |
BK_friendly_firer | location | No | |
bk_intro_sfx_timer | timer | Yes | |
BK_intro_sfx_Var | effect | No | |
bk_intro_timer | timer | No | |
BK_Port_Point_Var | location | No | |
BK_remind_timer | timer | Yes | |
BK_rez_timer | timer | Yes | |
bk_setup_loop_integer | integer | No | |
bk_xp_mod | real | No | 250.00 |
Black_altar_grp | group | Yes | |
Black_Altar_Teleport_Timer | timer | No | |
Black_Ankh_CD_Timers | timer | Yes | |
black_imp_point | location | No | |
Black_Recent_Death | unit | No | |
BlackAltar_type_Var | unitcode | No | n000 |
BlackKnight_1 | unit | No | |
BlackKnight_2 | unit | No | |
BlackKnight_3 | unit | No | |
BlackKnight_4 | unit | No | |
bladetoss_base | real | Yes | |
blk_default_pt_array | location | Yes | |
blk_unit_pt | location | Yes | |
BloodStainedDagger | itemcode | No | |
Blue_CastlePt_Var | location | No | |
Blue_King | unit | No | |
Blue_Prince | unit | No | |
BlueArtifact | itemcode | No | |
BlueMobaSpawnMid_Var | location | No | |
BlueMobaSpawnNorth_Var | location | No | |
BlueMobaSpawnSouth_Var | location | No | |
BlueMobaUnits_Bot | group | Yes | |
BlueMobaUnits_Mid | group | Yes | |
BlueMobaUnits_Top | group | Yes | |
bok_item | item | Yes | |
boot_message_string | string | No | |
boot_player_string | string | No | |
Boss_Room_Point_Var_Fire | location | No | |
Boss_Room_Point_Var_Snow | location | No | |
Boss_Room_Point_Var_Water | location | No | |
Boss_Room_Point_Var_Wind | location | No | |
boss_room_stay_array | trigger | Yes | |
Brown_Blue_Altar | location | No | |
Brown_Purp_Altar | location | No | |
Brown_Red_Altar | location | No | |
Brown_Teal_Altar | location | No | |
button_accept | button | Yes | |
button_decline | button | Yes | |
CAcceleration | real | Yes | |
CAccelerationRate | real | No | |
Callofdamned_PN | integer | No | |
cam_lock_triggers_pt2 | trigger | Yes | |
CAngle | real | Yes | |
CAnimSpeed | real | Yes | |
CArray | integer | No | |
caster_SA | unit | No | |
Castle_Alive | boolean | Yes | true |
castle_sfx | effect | Yes | |
castle_timer | timer | Yes | |
castle_vis_mod_blue | fogmodifier | Yes | |
castle_vis_mod_purp | fogmodifier | Yes | |
castle_vis_mod_red | fogmodifier | Yes | |
castle_vis_mod_teal | fogmodifier | Yes | |
castles | unit | Yes | |
CBoolean | boolean | Yes | |
CCaster | unit | Yes | |
CCasterCheck | unit | No | |
CCasterPos | location | No | |
CCasterPosCheck | location | No | |
CD_Ability | abilcode | No | |
CD_AbilityOrder | string | No | |
CD_Angle | real | Yes | |
CD_AngleAdjustment | real | No | |
CD_ApprenticeAoE | real | Yes | |
CD_ApprenticeUnitAllowed | integer | Yes | |
CD_ApprenticeUnitType | unitcode | No | |
CD_BonusUnitCount | integer | Yes | |
CD_BonusUnitOffset | real | Yes | |
CD_BonusUnitType | unitcode | Yes | |
CD_CasterId | unit | Yes | |
CD_CasterUnit | unit | Yes | |
CD_CastingTime | real | Yes | |
CD_CastingTimeLeft | real | Yes | |
CD_CastingTimeReduction | real | Yes | |
CD_CleanSFX | string | No | |
CD_DefaultState | boolean | No | |
CD_Destructible | destructable | No | |
CD_DummyUnitType | unitcode | No | |
CD_FormationEffect | effect | Yes | |
CD_FormationSFX | string | No | |
CD_FormationUnit | unit | Yes | |
CD_Harvester | unit | No | |
CD_HiddenUnit | unit | Yes | |
CD_Index1 | integer | No | |
CD_Index2 | integer | No | |
CD_IsClockwise | boolean | No | |
CD_IsComplete | boolean | Yes | |
CD_IsInward | boolean | Yes | |
CD_IsOccupied | boolean | Yes | |
CD_IsUpward | boolean | Yes | |
CD_Level | integer | Yes | |
CD_Looper1 | integer | No | |
CD_Looper2 | integer | No | |
CD_NotifySFX | string | No | |
CD_PingPoint | location | No | |
CD_Player | player | Yes | |
CD_Point1 | location | No | |
CD_Point2 | location | No | |
CD_SoulAngle | real | Yes | |
CD_SoulCurrentHeight | real | Yes | |
CD_SoulDelay | real | No | |
CD_SoulDistance | real | Yes | |
CD_SoulEffect | effect | Yes | |
CD_SoulHeightSpeed | real | No | |
CD_SoulMaxHeight | real | No | |
CD_SoulSFX | string | No | |
CD_SoulSpeed | real | Yes | |
CD_SoulTurnRate | real | No | |
CD_SoulUnit | unit | Yes | |
CD_SpawnSFX | string | No | |
CD_SubstituteAnimation | string | No | |
CD_SubstituteInterval | real | No | |
CD_SubstituteTimeLeft | real | Yes | |
CD_SubstituteUnit | unit | Yes | |
CD_SubstituteUnitType | unitcode | No | |
CD_SummonedUnitCount | integer | Yes | |
CD_SummonedUnitDuration | real | Yes | |
CD_SummonedUnitType | unitcode | Yes | |
CD_SummoningCircleAoE | real | Yes | |
CD_SummoningCircleDelay | real | No | |
CD_SummoningCircleEffect | effect | Yes | |
CD_SummoningCircleSFX | string | No | |
CD_SummoningCircleSize | real | Yes | |
CD_SummoningCircleTransparency | real | No | |
CD_SummoningCircleUnit | unit | Yes | |
CD_SummoningGroundEffect1 | effect | Yes | |
CD_SummoningGroundEffect2 | effect | Yes | |
CD_SummoningGroundSFX1 | string | No | |
CD_SummoningGroundSFX2 | string | No | |
CD_SwitchAbility | abilcode | No | |
CD_TempAngle | real | No | |
CD_TempGroup | group | No | |
CD_TempInt | integer | No | |
CD_TempUnit | unit | No | |
CDamage | real | Yes | |
CDistance | real | Yes | |
CEndOfCharge | boolean | Yes | |
Center_Point_Var | location | No | |
chest_clean_timer | timer | No | |
chest_group | group | No | |
CleanedItem | item | Yes | |
Cleanup_Timer_Blue | timer | No | |
Cleanup_Timer_Purp | timer | No | |
Cleanup_Timer_Red | timer | No | |
Cleanup_Timer_Teal | timer | No | |
CLevel | integer | Yes | |
CLoop | integer | No | |
CMovePoint | location | No | |
combine_A_integer | integer | No | |
conjure_black_player | player | No | |
conjure_black_pt | location | No | |
conjure_black_unit | unit | No | |
CorrAshArtifact_Item | itemcode | No | |
counter_cthuun | integer | No | |
counter_melbu | integer | No | |
counter_nzoth | integer | No | |
counter_SA | integer | No | |
counter_yogg | integer | No | |
court_mage_triggers | trigger | Yes | |
CPlayaGroup | force | Yes | |
CPlayaGroupCheck | force | No | |
creep_A_interger | integer | No | |
creep_array | unit | Yes | |
creep_B_integer | integer | No | |
creep_C_integer | integer | No | |
creep_camp_groups | group | Yes | |
creep_camp_regions | rect | Yes | |
Creep_Center_Var | location | No | |
creep_chest | unit | Yes | |
creep_counter | integer | No | |
creep_D_integer | integer | No | |
creep_death_pt | location | No | |
creep_dying | unit | No | |
creep_entering_unit | unit | No | |
Creep_NE_Var | location | No | |
Creep_NW_Var | location | No | |
creep_picked_unit | unit | No | |
Creep_Ping_Temp_Point | location | No | |
creep_point | location | Yes | |
creep_real | real | Yes | |
creep_respawn_timer | timer | No | |
Creep_SE_Var | location | No | |
Creep_SW_Var | location | No | |
creep_temp_chest | unit | No | |
creep_temp_group | group | No | |
creep_temp_unit | unit | No | |
Creep_Treasure_Unit_Grp | group | No | |
creep_type | unitcode | Yes | |
CreepDropItems_Region | rect | No | |
Creeps_End_Unit_Group | group | No | |
creeps_timer | timer | No | |
Crusader_UnitType_Var | unitcode | No | hfoo |
CTarget | unit | Yes | |
CTargetCheck | unit | No | |
CTargetPos | location | No | |
CTargetPosCheck | location | No | |
CWait | real | Yes | |
DarkArrow | itemcode | No | |
day_counter | integer | No | |
Dead_hero_items_pt | location | No | |
death_c_amount | real | No | |
death_c_base | real | Yes | |
death_c_level | integer | No | |
death_items | item | Yes | |
DeathRit_angle_count | integer | Yes | |
DeathRit_angle_real | real | Yes | |
DeathRit_caster | unit | Yes | |
DeathRit_timer | timer | Yes | |
DeathRitPoint_Cast | location | Yes | |
DeathRitPoint_SFX | location | Yes | |
DeathRitUnitGrp_Var | group | Yes | |
decline_counter | integer | No | |
defeat_timer_array_blu | timer | Yes | |
defeat_timer_array_purp | timer | Yes | |
defeat_timer_array_red | timer | Yes | |
defeat_timer_array_teal | timer | Yes | |
DefeatCounter | integer | No | |
deposit_PN | integer | No | |
DESP_Ability | abilcode | No | |
DESP_Angle | real | Yes | |
DESP_AngleLeft | real | Yes | |
DESP_AngleRight | real | Yes | |
DESP_AttackType1 | attacktype | No | |
DESP_AttackType2 | attacktype | No | |
DESP_BaseSpeed | real | Yes | |
DESP_BuildingDmgFactor | real | Yes | |
DESP_BurnEffect | boolean | No | |
DESP_Caster | unit | Yes | |
DESP_Counter | real | Yes | |
DESP_CurrentDistance | real | Yes | |
DESP_D1SpawnDelay | real | No | |
DESP_D1StartOffset | real | No | |
DESP_D2IsCenter | boolean | Yes | |
DESP_D2SpawnDelay | real | No | |
DESP_D2StartOffset | real | No | |
DESP_D3IsCenter | boolean | Yes | |
DESP_D3SpawnDelay | real | No | |
DESP_D3StartOffset | real | No | |
DESP_DamageBuilding | boolean | No | |
DESP_DamageType1 | damagetype | No | |
DESP_DamageType2 | damagetype | No | |
DESP_DestroyTree | boolean | No | |
DESP_Dummy1Height | real | Yes | |
DESP_Dummy1Size | real | Yes | |
DESP_Dummy2Delay | real | No | |
DESP_Dummy2Height | real | Yes | |
DESP_Dummy2nd | unit | Yes | |
DESP_Dummy2Size | real | Yes | |
DESP_Dummy3Delay | real | No | |
DESP_Dummy3Height | real | Yes | |
DESP_Dummy3rd | unit | Yes | |
DESP_Dummy3Size | real | Yes | |
DESP_DummyAbility | abilcode | No | |
DESP_DummyCaster | unit | No | |
DESP_DummyProjectile | unit | Yes | |
DESP_DummyType | unitcode | Yes | |
DESP_Effect | string | Yes | |
DESP_FinalAoe | real | Yes | |
DESP_FinalDmg | real | Yes | |
DESP_FixedDistance | boolean | No | |
DESP_FriendlyDmgFactor | real | Yes | |
DESP_FriendlyFire | boolean | No | |
DESP_Interval | real | No | |
DESP_IsCancelled | boolean | No | |
DESP_Level | integer | Yes | |
DESP_Loc | location | Yes | |
DESP_LoopInt | integer | No | |
DESP_LoopTrigger | trigger | No | |
DESP_MaxDistance | real | Yes | |
DESP_MaxIndex | integer | No | |
DESP_MergeBaseSpeed | real | Yes | |
DESP_MergeDelay | real | No | |
DESP_MergeSpeed | real | Yes | |
DESP_NodeNext | integer | Yes | |
DESP_NodePrev | integer | Yes | |
DESP_OrderId | string | No | |
DESP_Owner | player | Yes | |
DESP_ProjectileAoe | real | Yes | |
DESP_ProjectileDmg | real | Yes | |
DESP_RecycledSize | integer | No | |
DESP_RecycledStack | integer | Yes | |
DESP_Speed | real | Yes | |
DESP_Spell_ID | integer | No | |
DESP_SpellCount | integer | No | |
DESP_Stage | integer | Yes | |
DESP_StartLoc | location | Yes | |
DESP_TargetDistance | real | Yes | |
DESP_TempDest | destructable | No | |
DESP_TempUnit | unit | No | |
DESP_TreeDestAbility | abilcode | No | |
DESP_TreeDestroyer | unit | No | |
DESP_UndamagedGroup | group | Yes | |
DESP_UndamagedGroup2 | group | Yes | |
DG_Blue_Altar | location | No | |
DG_Purp_Altar | location | No | |
DG_Red_Altar | location | No | |
DG_Teal_Altar | location | No | |
dialog_05_accept | button | No | |
dialog_05_decline | button | No | |
dialog_06_accept | button | No | |
dialog_06_decline | button | No | |
dialog_07_accept | button | No | |
dialog_07_decline | button | No | |
dialog_08_accept | button | No | |
dialog_08_decline | button | No | |
dialog_09_accept | button | No | |
dialog_09_decline | button | No | |
dialog_10_accept | button | No | |
dialog_10_decline | button | No | |
dialog_11_accept | button | No | |
dialog_11_decline | button | No | |
dialog_12_accept | button | No | |
dialog_12_decline | button | No | |
dialog_17_accept | button | No | |
dialog_17_decline | button | No | |
dialog_18_accept | button | No | |
dialog_18_decline | button | No | |
dialog_19_accept | button | No | |
dialog_19_decline | button | No | |
dialog_20_accept | button | No | |
dialog_20_decline | button | No | |
dialog_join | dialog | Yes | |
dialog_join_Accept | button | No | |
dialog_join_Accept_string | string | No | |
dialog_join_Decline | button | No | |
dialog_join_Decline_string | string | No | |
dice_roll_temp | integer | No | |
DisableGateDies_Blue | boolean | No | |
DisableGateDies_Purp | boolean | No | |
DisableGateDies_Red | boolean | No | |
DisableGateDies_Teal | boolean | No | |
DisenchantUnit | unit | No | |
dk_mana | real | No | |
dreadnaughts | unit | Yes | |
drop_on_death_loop_integer | integer | No | |
dropped_items_blu_king | item | Yes | |
dropped_items_blue_prince | item | Yes | |
dropped_items_purp_king | item | Yes | |
dropped_items_purp_prince | item | Yes | |
dropped_items_red_king | item | Yes | |
dropped_items_red_prince | item | Yes | |
dropped_items_teal_king | item | Yes | |
dropped_items_teal_prince | item | Yes | |
Dying_Castle_Cam | camerasetup | No | |
ele_boss_group_temp | group | No | |
Ember_Base_Pt_Var | location | No | |
EmberForge | unit | No | |
EmberKnight | unit | No | |
Emerald | itemcode | No | |
ench_timer | timer | Yes | |
End_Loop_Timer | timer | No | |
End_Timer | timer | No | |
End_Timer_Camera | timer | No | |
Every_Unit_Temp_Var | group | No | |
fairy_heal_amount | real | No | |
fairy_heal_base | real | Yes | |
fairy_heal_level | integer | No | |
FallenDKBlade | itemcode | No | |
FallenKnightHelm | itemcode | No | |
FallenPallyWarGavel | itemcode | No | |
FC_Ability | abilcode | No | |
FC_Boolean | boolean | Yes | |
FC_Boolean_Knockback | boolean | Yes | |
FC_Integer_00 | integer | Yes | |
FC_Integer_AnimationIndex | integer | No | |
FC_Integer_Index | integer | Yes | |
FC_Integer_IndexKnockback | integer | Yes | |
FC_PN | integer | No | |
FC_Real_00 | real | Yes | |
FC_Real_01 | real | Yes | |
FC_Real_02 | real | Yes | |
FC_Real_03 | real | Yes | |
FC_Real_04 | real | Yes | |
FC_Real_05 | real | Yes | |
FC_Real_AnimationSpeed | real | Yes | |
FC_Real_DistanceKnockback | real | Yes | |
FC_Real_PercentageCancel | real | Yes | |
FC_Real_PercentageHitPoints | real | Yes | |
FC_Real_PercentageStrenght | real | Yes | |
FC_Real_Radius | real | Yes | |
FC_Real_SpeedKnockback | real | Yes | |
FC_Real_SpeedMove | real | Yes | |
FC_String_SEffectHit | string | No | |
FC_String_SEffectKnockback | string | No | |
FC_String_SEffectMove | string | No | |
FC_Unit_00 | unit | Yes | |
FC_Unit_01 | unit | Yes | |
FC_UnitGroup_Damaged | group | Yes | |
fearless_charge_loop_integer | integer | No | |
fi | integer | No | |
FI_Angle | real | Yes | |
FI_AnimSpeed | real | Yes | |
FI_DefaultHeight | real | No | |
FI_EffectA | string | No | |
FI_EffectB | string | No | |
FI_FallHeight | real | No | |
FI_Height | real | Yes | |
FI_Hero | unit | Yes | |
FI_Max | integer | No | |
FI_Sfx_Var | effect | No | |
FI_Sound | string | No | |
FI_Vp | real | Yes | |
FI_Vz | real | Yes | |
FI_z | real | Yes | |
fifteen_min | boolean | No | false |
Fire_Triggers_Blue | trigger | Yes | |
Fire_Triggers_Purp | trigger | Yes | |
Fire_Triggers_Red | trigger | Yes | |
Fire_Triggers_Teal | trigger | Yes | |
FireAxe | itemcode | No | |
fired_player_number | integer | No | |
FireGolemArtifact | itemcode | No | |
Force_Join_Button_Blue | button | Yes | |
Force_Join_Button_No | button | Yes | |
Force_Join_Button_Purp | button | Yes | |
Force_Join_Button_Red | button | Yes | |
Force_Join_Button_Teal | button | Yes | |
Force_Join_Dialog | dialog | Yes | |
force_join_PN | integer | No | |
Forces_Clean_Blue | group | No | |
Forces_Clean_Purp | group | No | |
Forces_Clean_Red | group | No | |
Forces_Clean_Teal | group | No | |
fork_light_amount | real | No | |
fork_light_base | real | Yes | |
fork_light_level | integer | No | |
friendly_fire_timer_bk1 | timer | No | |
friendly_fire_timer_bk2 | timer | No | |
friendly_fire_timer_bk3 | timer | No | |
friendly_fire_timer_bk4 | timer | No | |
g | real | No | |
GAME_STATUS_OFFLINE | integer | No | |
GAME_STATUS_ONLINE | integer | No | |
GAME_STATUS_REPLAY | integer | No | |
GameStatus | integer | No | |
GameStatus_Initialized | boolean | No | |
GameStatus_Temp | integer | No | |
GameStatus_TempPlayer | player | No | |
gate_reset_ani_timer | timer | Yes | |
GateIsDead_Blue | boolean | No | |
GateIsDead_Purp | boolean | No | |
GateIsDead_Red | boolean | No | |
GateIsDead_Teal | boolean | No | |
GemReward | itemcode | No | |
General_Weather_Var | weathereffect | No | |
genie_death_pt | location | No | |
Genie_Next_Port_Temp_Var | location | No | |
Genie_Previous_Point_Temp_Var | location | No | |
Genie_Random_Number | integer | No | |
genie_wish_cast | timer | No | |
genie_wish_CD | timer | No | |
genie_wish_item | item | No | |
genie_wish_unit | unit | No | |
GlowingSpirderHead | itemcode | No | |
God_Dest_Queen | unit | No | |
God_Dest_Unit_Var | unit | No | |
God_Dest_Units_Center_Var | group | No | |
god_gift_loop_integer | integer | No | |
god_of_dest_summoner | unit | No | |
God_of_Dest_Weather_Var | weathereffect | Yes | |
GoD_to_be_Removed | group | No | |
God_Unit_Var | unit | No | |
GodofDest_Player_Var | player | No | |
GodofDest_Sfx_Var | effect | No | |
GodofDest_Time_Window | timerdialog | No | |
GodofDest_Timer_One | timer | No | |
GodofDest_Timer_Two | timer | No | |
Gray_Blue_Altar | location | No | |
Gray_Purp_Altar | location | No | |
Gray_Red_Altar | location | No | |
Gray_Teal_Altar | location | No | |
group | group | No | |
Group6_DiedasBlk | force | No | |
Groups | force | Yes | |
Heaven_Port_Unit_Var | unit | No | |
hell_bonus_hp | boolean | Yes | |
Hell_Entrance_Pt_Var | location | No | |
Hell_Gold_Mine | unit | Yes | |
Hell_Owl1_Pt_Var | location | Yes | |
Hell_Owl2_Pt_Var | location | Yes | |
Hell_Portal_Current_Var | unit | No | |
Hell_Portal_Old | unit | No | |
hell_rune_port_pt | location | No | |
Hell_Rune_Unit_Grp_Var | group | No | |
hero_king | unit | Yes | |
hero_prince | unit | Yes | |
heroic_amount | real | No | |
heroic_caster | unit | No | |
heroic_level | integer | No | |
heroic_sfx | effect | No | |
heroic_strike_base | real | Yes | |
heroic_strike_multiplier | real | Yes | |
heroic_target | unit | No | |
heroic_timer | timer | No | |
Hev_Pt_Var | location | No | |
HiddenAltar_type_Var | unitcode | No | h00D |
Hire_Button_Unit_Brown | unit | Yes | |
Hire_Button_Unit_DG | unit | Yes | |
Hire_Button_Unit_Gray | unit | Yes | |
Hire_Button_Unit_LB | unit | Yes | |
Hire_Button_Unit_LG | unit | Yes | |
Hire_Button_Unit_LightBrown | unit | Yes | |
Hire_Button_Unit_LightPurple | unit | Yes | |
Hire_Button_Unit_Lime | unit | Yes | |
Hire_Button_Unit_OJ | unit | Yes | |
Hire_Button_Unit_Peach | unit | Yes | |
Hire_Button_Unit_Pink | unit | Yes | |
Hire_Button_Unit_Yellow | unit | Yes | |
hire_buttons_blue | unit | Yes | |
hire_buttons_knights_array | unitcode | Yes | |
hire_buttons_purp | unit | Yes | |
hire_buttons_red | unit | Yes | |
hire_buttons_teal | unit | Yes | |
Hire_Dialog_Menu_Blue | dialog | No | |
Hire_Dialog_Menu_Purp | dialog | No | |
Hire_Dialog_Menu_Red | dialog | No | |
Hire_Dialog_Menu_Teal | dialog | No | |
Hire_No_Button_Blue | button | No | |
Hire_No_Button_Purp | button | No | |
Hire_No_Button_Red | button | No | |
Hire_No_Button_Teal | button | No | |
hire_offer_timer | timer | Yes | |
Hire_Yes_Button_Blue | button | No | |
Hire_Yes_Button_Purp | button | No | |
Hire_Yes_Button_Red | button | No | |
Hire_Yes_Button_Teal | button | No | |
holy_light_amount | real | No | |
holy_light_base | real | Yes | |
holy_light_level | integer | No | |
ID | integer | Yes | |
ID2 | integer | No | |
IDMax | integer | No | |
ignore_next_defend | boolean | Yes | |
insane_A_integer | integer | No | |
insane_B_integer | integer | No | |
insane_cheats | boolean | Yes | |
insane_king | boolean | No | |
insane_rush | boolean | Yes | |
insane_tech | boolean | Yes | |
insane_tech_counter | integer | No | |
Int_A_hero_loop | integer | No | |
integer | integer | No | |
integer_A_blue_king | integer | No | |
integer_A_blue_prince | integer | No | |
integer_A_purp_king | integer | No | |
integer_A_purp_prince | integer | No | |
integer_A_red_king | integer | No | |
integer_A_red_prince | integer | No | |
integer_A_teal_king | integer | No | |
integer_A_teal_prince | integer | No | |
integer_blue_hire_loop | integer | No | |
integer_blue_hire_target | integer | No | |
integer_purp_hire_loop | integer | No | |
integer_purp_hire_target | integer | No | |
integer_red_hire_loop | integer | No | |
integer_red_hire_target | integer | No | |
integer_teal_hire_loop | integer | No | |
integer_teal_hire_target | integer | No | |
intro_wait_timer | timer | Yes | |
InvSlot | integer | No | |
item_combine_counter | integer | No | |
Item_Ping_Point | location | No | |
item_vault_hash | hashtable | No | |
ItemCleanupFlag | boolean | No | |
ItemCleanupTimer | timer | No | |
ItemCount | integer | No | |
ItemDrop_Buttons | button | Yes | |
ItemDrop_Dialog | dialog | No | |
ItemDrop_Results | integer | No | |
ItemDrop_String_Options | string | Yes | |
ItemDrop_VoteTally | integer | Yes | |
ItemIndex | integer | No | |
ItemsFound | item | Yes | |
ItemsToClean | integer | No | |
ItemTypes | itemcode | Yes | |
ItemTypesTotal | integer | No | |
join_blk_button_no | button | Yes | |
join_blk_button_yes | button | Yes | |
join_blk_dialog | dialog | Yes | |
join_blk_timer | timer | Yes | |
join_blk_warn_timer | timer | No | |
join_CD | boolean | Yes | |
join_cd_timer | timer | Yes | |
join_target_king | integer | No | |
joined_black | boolean | Yes | |
joining_enabled | boolean | No | |
joining_knight | integer | No | |
katana_caster | unit | No | |
katana_jutsu_base | real | Yes | |
katana_jutsu_multiplier | real | Yes | |
katana_sfx | effect | No | |
katana_target | unit | No | |
katana_timer | timer | No | |
kb | integer | No | |
KB_Angle | real | Yes | |
KB_Dist | real | Yes | |
KB_Max | integer | No | |
KB_MaxDist | real | Yes | |
KB_Speed | real | Yes | |
KB_Unit | unit | Yes | |
king_altar_blue | unit | No | |
king_altar_purp | unit | No | |
king_altar_red | unit | No | |
king_altar_teal | unit | No | |
King_Castle_Var_Blue | unit | No | |
King_Castle_Var_Purp | unit | No | |
King_Castle_Var_Red | unit | No | |
King_Castle_Var_Teal | unit | No | |
King_Gold | integer | Yes | |
king_library | unit | Yes | |
king_mage_blue | unit | Yes | |
king_mage_court | unit | Yes | |
king_mage_purp | unit | Yes | |
king_mage_red | unit | Yes | |
king_mage_teal | unit | Yes | |
king_offer_join_timer | timer | Yes | |
king_pages_timer | timer | Yes | |
King_Return_Blue | location | No | |
King_Return_Purp | location | No | |
King_Return_Red | location | No | |
King_Return_Teal | location | No | |
King_Summon_Point_Blue | location | No | |
King_Summon_Point_Purp | location | No | |
King_Summon_Point_Red | location | No | |
King_Summon_Point_Teal | location | No | |
King_Summon_Unit_Group_Blue | group | No | |
King_Summon_Unit_Group_Purp | group | No | |
King_Summon_Unit_Group_Red | group | No | |
King_Summon_Unit_Group_Teal | group | No | |
king_tech_announce_PN | integer | No | |
King_v_Black_Var | integer | No | 0 |
king_vendor | location | Yes | |
King_Vendor_Blue | location | No | |
King_Vendor_Purp | location | No | |
King_Vendor_Red | location | No | |
King_Vendor_Teal | location | No | |
king_vendor_timer | timer | Yes | |
kingdom_color_string | string | Yes | |
kingdom_join_CD | real | No | 120.00 |
kingdom_knight_cap | integer | Yes | |
KingOrb_Item | itemcode | No | |
Kings_Group_Var | force | No | |
knght_room_region_array | rect | Yes | |
kni_king_altars_hashtable | hashtable | No | |
Knight_Altar_Default_Pt | location | Yes | |
Knight_Altar_Var | unit | Yes | |
knight_ask_join_timer | timer | Yes | |
knight_death_temp_point_var | location | No | |
Knight_Hero_Var | unit | Yes | |
knight_max_calculate_timer | timer | No | |
Knight_Rcv_Gold_Blue | player | No | |
Knight_Rcv_Gold_Purp | player | No | |
Knight_Rcv_Gold_Red | player | No | |
Knight_Rcv_Gold_Teal | player | No | |
knight_type | string | Yes | |
Knights_Group_Var | force | No | |
KnightsBelt | itemcode | No | |
kobold_heal_amount | real | No | |
kobold_heal_base | real | Yes | |
kobold_heal_level | integer | No | |
kobold_wave_amount | real | No | |
kobold_wave_base | real | Yes | |
kobold_wave_level | integer | No | |
LB_Blue_Altar | location | No | |
LB_Purp_Altar | location | No | |
LB_Red_Altar | location | No | |
LB_Teal_Altar | location | No | |
Leave_Triggers | trigger | Yes | |
leaver_group | force | Yes | |
level_bladetoss | integer | No | |
level_katana_jutsu | integer | No | |
level_SA | integer | No | |
level_snipe | integer | No | |
LeviathanArtifact | itemcode | No | |
LG_Blue_Altar | location | No | |
LG_Purp_Altar | location | No | |
LG_Red_Altar | location | No | |
LG_Teal_Altar | location | No | |
LH_beacons | unit | Yes | |
LH_owner_player | player | Yes | |
LH_owner_unit | unit | Yes | |
LH_vis_mod_hash | hashtable | No | |
Light_Brown_Blue_Altar | location | No | |
Light_Brown_Purp_Altar | location | No | |
Light_Brown_Red_Altar | location | No | |
Light_Brown_Teal_Altar | location | No | |
Light_Purple_Blue_Altar | location | No | |
Light_Purple_Purp_Altar | location | No | |
Light_Purple_Red_Altar | location | No | |
Light_Purple_Teal_Altar | location | No | |
Lime_Blue_Altar | location | No | |
Lime_Purp_Altar | location | No | |
Lime_Red_Altar | location | No | |
Lime_Teal_Altar | location | No | |
limits_current_blue | integer | No | |
limits_current_purp | integer | No | |
limits_current_red | integer | No | |
limits_current_teal | integer | No | |
limits_max_knights | integer | No | |
limits_num_kings | integer | No | |
limits_num_knights | integer | No | |
Limvote_Buttons | button | Yes | |
Limvote_Dialog | dialog | No | |
Limvote_Results_no_cap | integer | No | |
Limvote_Results_plus1 | integer | No | |
Limvote_Results_random | integer | No | |
Limvote_String_Options | string | Yes | |
Limvote_VoteTally | imagetype | Yes | |
lock_alli_ab_timer | timer | No | |
Lock_Alliances_Timer | timer | No | |
Lock_Alliances_Timer_Window | timerdialog | No | |
Lock_Alliances_Warn_Timer | timer | No | |
Loop | integer | No | |
loop_integer_C | integer | No | |
loot_ran_num | integer | No | |
loot_spawn_pt | location | No | |
loot_spawn_types | itemcode | Yes | |
LOS_Blocker_Grp_Var | group | No | |
Losing_Group_Var | force | No | |
loyalty_status | integer | Yes | |
Loyalty_Status_Brown | integer | No | |
Loyalty_Status_DGrn | integer | No | |
Loyalty_Status_Gray | integer | No | |
Loyalty_Status_LBlue | integer | No | |
Loyalty_Status_LBrn | integer | No | |
Loyalty_Status_LG | integer | No | |
Loyalty_Status_LPurp | integer | No | |
Loyalty_Status_Mint | integer | No | |
Loyalty_Status_Oj | integer | No | |
Loyalty_Status_Peach | integer | No | |
Loyalty_Status_Pink | integer | No | |
Loyalty_Status_Yel | integer | No | |
loyalty_timer | timer | Yes | |
mage_bliz_amount | real | No | |
mage_bliz_base | real | Yes | |
mage_bliz_level | integer | No | |
mage_bliz_multiplier | real | Yes | |
mage_book_PN | integer | No | |
mage_book_types | itemcode | Yes | |
mage_ct_temp_pt | location | No | |
mage_ran_num | integer | No | |
Main_Players_Var | force | No | |
MaintenanceAbility | abilcode | No | |
MaintenanceCaster | unit | No | |
MaintenanceDuration | real | Yes | |
MaintenanceDurationRemaining | real | Yes | |
MaintenanceEffectName | string | No | |
MaintenanceEffectNameUnit | string | No | |
MaintenanceEffectUnitAttach | string | No | |
MaintenanceFilterPass | boolean | No | |
MaintenanceFilterTrigger | trigger | No | |
MaintenanceGroup | group | Yes | |
MaintenanceHealPerSecond | real | Yes | |
MaintenanceHealPerTick | real | Yes | |
MaintenanceIndex | integer | No | |
MaintenanceLevel | integer | No | |
MaintenanceLoopTrigger | trigger | No | |
MaintenanceMaxIndex | integer | No | |
MaintenancePoint | location | No | |
MaintenanceRange | real | Yes | |
MaintenanceScale | real | Yes | |
MaintenanceScaleUnit | real | Yes | |
MaintenanceTargetUnit | unit | No | |
MaintenanceTimeout | real | No | |
Map_Center_Point_Var | location | No | |
Market_Integer | integer | No | |
Market_Integer_Items | integer | No | |
master_item_array | itemcode | Yes | |
MemoryoftheAncientKing | itemcode | No | |
Mid_Moba_Rally_Pt | location | No | |
Middle_NW_Var | location | No | |
Middle_SE_Var | location | No | |
Midnight_Ankh_Type_Var | itemcode | No | |
MidnightAnkhs_only | integer | No | |
MMD_extra_timer_a | timer | No | |
MMD_extra_timer_b | timer | No | |
MMD_extra_timer_c | timer | No | |
MMD_String | string | Yes | |
MMD_Timer | timer | No | |
MMD_timer_array | timer | Yes | |
MMD_Trigger_Complete | integer | No | |
Mode_Timer | timer | No | |
monolith_pt | location | No | |
moon_gem | item | No | |
Moon_Gem_Given | integer | No | 0 |
moon_gem_king | integer | No | |
moon_item_init_timer | timer | No | |
MoveGroup | group | No | |
multiboard_colors | string | Yes | |
multiboard_factions | multiboard | No | |
multiboard_icons | string | Yes | |
multiboard_increment | integer | No | |
multiboard_loop_integer | integer | No | |
multiboard_names | string | Yes | |
multiboard_player_icon | string | Yes | |
multiboard_power | integer | Yes | |
multiboard_rows | integer | No | |
multiboard_update_timer | timer | No | |
multiplier_SA | real | Yes | |
NE_Bowl_Pt_Var | location | Yes | |
NE_Well_Pt_Var | location | Yes | |
ninty_sec_time | boolean | No | |
no_king_loop_integer | integer | No | |
no_king_timer | timer | No | |
no_knight_cap | boolean | No | |
No_string | string | No | Decline |
OJ_Blue_Altar | location | No | |
OJ_Purp_Altar | location | No | |
OJ_Red_Altar | location | No | |
OJ_Teal_Altar | location | No | |
old_god_entry_pt | location | Yes | |
orb_forge_complete | boolean | No | |
orb_forge_death_timer | timer | No | |
orb_forge_exit_timer | timer | No | |
orb_forge_extra_timer | timer | Yes | |
orb_forge_pts | location | Yes | |
orb_forge_sfx | effect | Yes | |
orb_forge_timer | timer | No | |
OrbBlue | itemcode | No | |
OrbFound | item | No | |
OrbGems | itemcode | Yes | |
OrbPurp | itemcode | No | |
OrbRed | itemcode | No | |
OrbTeal | itemcode | No | |
OrbTotal | integer | No | |
OrbTypes | itemcode | Yes | |
OrbWasFound | boolean | No | |
original_color | playercolor | Yes | |
original_name | string | Yes | |
original_treasure_counter | integer | No | |
owl_timer_E | timer | No | |
owl_timer_W | timer | No | |
pawn_item_blue | item | No | |
pawn_item_purp | item | No | |
pawn_item_red | item | No | |
pawn_item_teal | item | No | |
PB_Ability | abilcode | No | |
PB_Angle | real | No | |
PB_AngleDistance | real | No | |
PB_AngularDistance | real | Yes | |
PB_ChannelExpSFX | string | No | |
PB_ChannelingSFXTimer | real | Yes | |
PB_ChannelOrder | string | No | |
PB_ChannelSFXCreationDelay | real | No | |
PB_Damage | real | Yes | |
PB_DamageBonus | real | Yes | |
PB_DamageRadius | real | Yes | |
PB_DirectionOffset | real | Yes | |
PB_DurationRemaining | real | Yes | |
PB_ExplosionDamage | real | Yes | |
PB_ExplosionDelay | real | Yes | |
PB_ExplosionSFX | string | No | |
PB_ExplosionSpot | location | Yes | |
PB_ExpTravelRange | real | Yes | |
PB_FilterTrigger | trigger | No | |
PB_FollowCasterFacing | boolean | Yes | |
PB_GapRange | real | Yes | |
PB_Index | integer | No | |
PB_InitExpSFX | string | No | |
PB_InitTrigger | trigger | No | |
PB_Level | integer | Yes | |
PB_Loop | integer | No | |
PB_LoopTrigger | trigger | No | |
PB_MaxIndex | integer | No | |
PB_MaxLevel | integer | No | |
PB_MaxRange | real | Yes | |
PB_Point | location | No | |
PB_PreservedAngle | real | Yes | |
PB_Source | unit | Yes | |
PB_Splitter | integer | Yes | |
PB_Stage | integer | Yes | |
PB_StrikeSpot | location | No | |
PB_Target | unit | No | |
PB_Time | real | Yes | |
PB_Timeout | real | No | |
PB_Unit | unit | No | |
PB_UnitAttachment | string | No | |
PB_ValidTarget | boolean | No | |
Peach_Blue_Altar | location | No | |
Peach_Purp_Altar | location | No | |
Peach_Red_Altar | location | No | |
Peach_Teal_Altar | location | No | |
pending_relocation | boolean | Yes | |
PenguinArtifact | itemcode | No | |
ping_black_PN | integer | No | |
ping_blk_bldg_PN | integer | No | |
ping_knight_hero_unit | group | No | |
ping_knight_pt | location | No | |
ping_knights_PN | integer | No | |
Pink_Blue_Altar | location | No | |
Pink_Purp_Altar | location | No | |
Pink_Red_Altar | location | No | |
Pink_Teal_Altar | location | No | |
Pirate_Pt | location | No | |
pirate_ship_unit | unit | Yes | |
pirate_upgrade_player | player | No | |
player_absent | boolean | Yes | |
Player_array_var | player | Yes | |
player_color | playercolor | Yes | |
player_color_knight_strings | string | Yes | |
pledge_spells | abilcode | Yes | |
PN_beacon_knight_blue | integer | No | |
PN_beacon_knight_purp | integer | No | |
PN_beacon_knight_red | integer | No | |
PN_beacon_knight_teal | integer | No | |
PN_black_ankh | integer | No | |
PN_black_defeat | integer | No | |
PN_candle_altar | integer | No | |
PN_firing_king | integer | No | |
PN_hero_cam | integer | No | |
PN_join_black | integer | No | |
PN_leave | integer | No | |
PN_reset_cam | integer | No | |
PN_tax_collector | integer | No | |
PN_tax_victim | integer | No | |
PN_type_join | integer | No | |
point | location | No | |
Point | location | No | |
point2 | location | No | |
port_hp_blue | real | No | |
port_hp_purp | real | No | |
port_hp_red | real | No | |
port_hp_teal | real | No | |
Portal_to_Hev_Pt_Var | location | No | |
preload_spawn_pt | location | No | |
privileged_player | boolean | Yes | |
PumpMobaSpawnBot_Var | location | No | |
PumpMobaSpawnMid_Var | location | No | |
PumpMobaSpawnTop_Var | location | No | |
Purp_CastlePt_Var | location | No | |
Purp_King | unit | No | |
Purp_Prince | unit | No | |
PurpArtifact | itemcode | No | |
PurpMobaUnits_Mid | group | Yes | |
PurpMobaUnits_North | group | Yes | |
PurpMobaUnits_South | group | Yes | |
pyro_burnt_hp | real | Yes | |
pyro_burnt_PN | integer | No | |
quits_PN | integer | No | |
quitter_gold | integer | No | |
Ran_Music_Num_Var | integer | No | |
ran_num_AI_blue | integer | No | |
ran_num_AI_purp | integer | No | |
ran_num_AI_red | integer | No | |
ran_num_AI_teal | integer | No | |
ran_num_knight_lim | integer | No | |
Ran_Num_Moon_Gem | integer | No | 0 |
Ran_Num_Rez_Var | integer | No | |
ran_shard_amount | integer | No | |
Random_God_Phrase_Num | integer | No | |
Random_God_Virtue | string | Yes | |
random_increase | boolean | No | |
Random_Market_Unit_Var | unit | Yes | |
Random_Num_Var | integer | No | |
Random_Number_God_XP | integer | No | |
RandomMovesPOINT | location | No | |
real | real | No | |
real2 | real | No | |
Recent_Dead_Castle_Point_Var | location | No | |
recent_defeated_king_base | rect | No | |
Red_CastlePt_Var | location | No | |
Red_King | unit | No | |
Red_Prince | unit | No | |
RedArtifact | itemcode | No | |
RedMobaSpawnEast_Var | location | No | |
RedMobaSpawnMid_Varx | location | No | |
RedMobaSpawnWest_Var | location | No | |
RedMobaUnits_East | group | Yes | |
RedMobaUnits_Mid | group | Yes | |
RedMobaUnits_West | group | Yes | |
relocate_integer_loop | integer | No | |
relocate_PN | integer | No | |
RelocationUser | player | No | |
Request_Acted_On | integer | Yes | |
Request_Amount_Integer | integer | Yes | |
Request_Amount_String | string | Yes | |
Request_Deny_Button | button | Yes | |
Request_Deny_String | string | No | |
request_gold_timer | timer | Yes | |
Request_Grant_Button | button | Yes | |
Request_Grant_String | string | No | |
Request_Menu | dialog | Yes | |
Request_Player | string | Yes | |
request_PN | integer | No | |
Research_Blue | boolean | Yes | false |
Research_Blue_Extra | boolean | Yes | false |
Research_Blue_Knight_lv | integer | No | |
Research_Purp | boolean | Yes | false |
Research_Purp_Extra | boolean | Yes | false |
Research_Purp_Knight_lv | integer | No | |
Research_Red | boolean | Yes | false |
Research_Red_Extra | boolean | Yes | false |
Research_Red_Knight_lv | integer | No | |
Research_Teal | boolean | Yes | false |
Research_Teal_Extra | boolean | Yes | false |
Research_Teal_Knight_lv | integer | No | |
reset_king_animation_timer | timer | No | |
Rez_Pt_Count | integer | No | |
Rez_Pt_Var | location | Yes | |
rez_timer | timer | Yes | |
Rezing_Hero_Hev_Var | unit | Yes | |
royal_ct_sfx_blue | effect | No | |
royal_ct_sfx_purp | effect | No | |
royal_ct_sfx_red | effect | No | |
royal_ct_sfx_teal | effect | No | |
Royal_Hev_Rez_Timer | timer | Yes | |
RoyalKnight1_UnitType_Var | unitcode | No | hkni |
RubyRing | itemcode | No | |
Rune_Portals_Unt_Grp | group | Yes | |
SaphireRing | itemcode | No | |
satan_dies_timer | timer | No | |
Secondary_Black | unit | No | |
Shake | real | No | |
Shards_only | integer | No | |
Shards_plus_Midnightankhs | integer | No | |
Shield_DisenchantUnit | unit | No | |
Shield_FourItemsFound | boolean | No | |
Shield_Fusions_Var | itemcode | Yes | |
Shield_InvSlot | integer | No | |
Shield_ItemCount | integer | No | |
Shield_ItemIndex | integer | No | |
Shield_ItemsFound | item | Yes | |
Shield_ItemTypes | itemcode | Yes | |
Shield_ItemTypesTotal | integer | No | |
Shield_Ran_Num_Var | integer | No | |
Skill_BattleFurrySpeed | abilcode | No | |
Skill_BattleFury | abilcode | No | |
Skill_Bonebreaker | abilcode | No | |
Skill_FeralImpact | abilcode | No | |
Skill_Tornado | abilcode | No | |
smite_number | integer | No | |
snipe_base | real | Yes | |
solo_group | force | Yes | |
special_A_integer | integer | No | |
starfall_amount | real | No | |
starfall_base | real | Yes | |
starfall_level | integer | No | |
Stop_Music_Timer_Var | timer | No | |
StormArtifact | itemcode | No | |
succro_group | group | No | |
succro_vis_mod | fogmodifier | Yes | |
suck_blood_amount | real | No | |
suck_blood_base | real | Yes | |
suck_blood_level | integer | No | |
suck_blood_multiplier | real | Yes | |
summon_timer_blue | timer | No | |
summon_timer_purp | timer | No | |
summon_timer_red | timer | No | |
summon_timer_teal | timer | No | |
target_SA | unit | Yes | |
tax_amount | integer | No | |
Teal_CastlePt_Var | location | No | |
Teal_King | unit | No | |
Teal_Prince | unit | No | |
TealArtifact | itemcode | No | |
TealMobaSpawnEast_Var | location | No | |
TealMobaSpawnMid_Var | location | No | |
TealMobaSpawnWest_Var | location | No | |
TealMobaUnits_East | group | Yes | |
TealMobaUnits_Mid | group | Yes | |
TealMobaUnits_West | group | Yes | |
teams_locked | boolean | No | |
tech_loop_accpt_integer | integer | No | |
tech_loop_cast_integer | integer | No | |
Tech_Type | techcode | Yes | |
Teleport_Altar_Point | location | No | |
Teleport_Altar_Temp_Unit | unit | No | |
temp_altar_starting_var | location | No | |
temp_loot_pt | location | No | |
temp_point | location | No | |
temp_remove_units | group | No | |
temp_unit_grp | group | No | |
TempBoolean | boolean | No | |
TempInteger | integer | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempReal | real | No | |
TempReal2 | real | No | |
TempUnit | unit | No | |
ThreeItemsFound | boolean | No | |
timer_cthuun | timer | No | |
timer_god_of_dest | timer | Yes | |
timer_melbu | timer | No | |
timer_nzoth | timer | No | |
timer_SA | timer | Yes | |
timer_yogg | timer | No | |
tmpCasterZ | real | No | |
tmpDiffHeight | real | No | |
tmpDistance | real | No | |
tmpHeight | real | No | |
tmpSound | sound | No | |
tmpTargetZ | real | No | |
tmpTime | real | No | |
to | integervar | No | |
TO_Duration | real | Yes | |
TO_Hero | unit | Yes | |
TO_Max | integer | No | |
trained_triggers | trigger | Yes | |
tranq_A_integer | integer | No | |
tranq_buildings | group | No | |
tranq_increment | integer | No | |
tranq_picked_building_pt | location | No | |
tranq_picked_tree_pt | location | No | |
tranq_pt | location | No | |
tranq_tree_index | destructable | Yes | |
TSEAttachPoint | string | No | |
TSEChanneledOrderID | string | No | |
TSEChanneledOrderIDs | string | Yes | |
TSEDuration | real | No | |
TSEEffectName | string | No | |
TSEEffects | effect | Yes | |
TSEIndexLoop | integer | No | |
TSEIsChannelings | boolean | Yes | |
TSELoop | trigger | No | |
TSEMaxIndex | integer | No | |
TSEPatch | integer | No | |
TSEPoint | location | No | |
TSERegister | trigger | No | |
TSERemainingDurs | real | Yes | |
TSEScale | real | No | |
TSESourceUnit | unit | No | |
TSESourceUnits | unit | Yes | |
TSETimeout | real | No | |
TSEUnit | unit | No | |
TSEUnitAliveCheck | boolean | No | |
TSEUnitAliveChecks | boolean | Yes | |
TSEUnits | unit | Yes | |
TwelveMin_Timer_Int_Var | integer | No | 0 |
Unit_Brown_Altar | unit | No | |
Unit_DG_Altar | unit | No | |
Unit_Grey_Altar | unit | No | |
Unit_LB_Altar | unit | No | |
Unit_LG_Altar | unit | No | |
Unit_LightBrown_Altar | unit | No | |
Unit_LightPurple_Altar | unit | No | |
Unit_Lime_Altar | unit | No | |
Unit_OJ_Altar | unit | No | |
Unit_Peach_Altar | unit | No | |
Unit_Pink_Altar | unit | No | |
unit_royal_arti | unit | Yes | |
Unit_Yellow_Altar | unit | No | |
units_owned | group | Yes | |
units_owned_by_creeps | group | No | |
units_owned_loop | group | No | |
UpgradeScroll | itemcode | No | |
upgrading_hero | unit | No | |
VasFictleAxe | itemcode | No | |
vault_altar_temp_pt | location | No | |
vault_array | unit | Yes | |
vault_points | location | Yes | |
VerbeneBornariensis | itemcode | No | |
victory_timer_array_black | timer | Yes | |
victory_timer_array_king | timer | Yes | |
vis_mod_mid | fogmodifier | Yes | |
vis_mod_red | fogmodifier | Yes | |
VisMod_KnightRooms | fogmodifier | Yes | |
VM_BlkMono | fogmodifier | Yes | |
Vote_Results | integer | No | 0 |
Voted_Status | integer | Yes | |
WarhorseBridal | itemcode | No | |
wave_cast_pt | location | No | |
Weather_Ran_Num_Var | integer | No | |
wight_level | integer | No | |
wight_researcher | integer | No | |
wight_sac_items | item | Yes | |
Winning_Group_Var | force | No | |
wisp_hero | unit | No | |
wisp_items | item | Yes | |
wisp_level | integer | No | |
wisp_player | player | No | |
wisp_player_name | string | No | |
wisp_tree | unit | No | |
wisp_tree_deaths | integer | Yes | |
wisp_tree_pt | location | No | |
wisp_xp | integer | No | |
WN_atk_timer | timer | No | |
WN_cast_timer | timer | No | |
WN_Current_Destination | location | No | |
WN_Current_Point | location | No | |
WN_Point_Var_Array | location | Yes | |
Yellow_Blue_Altar | location | No | |
Yellow_Purp_Altar | location | No | |
Yellow_Red_Altar | location | No | |
Yellow_Teal_Altar | location | No | |
Yes_string | string | No | Accept |
YoungRal | player | No |
//TESH.scrollpos=70
//TESH.alwaysfold=0
// **************************************************************************
// ** **
// ** Charge **
// ** ————————————— **
// ** **
// ** A simple Charge Spell **
// ** **
// ** By: Majin **
// **
// ** **
// **************************************************************************
library ChargeConfig
globals
//CHECK THE CHARGEEXEC TRIGGER FOR MORE OPTIONS
//ID CONFIGURATIONS FOR SPELLS AND DUMMY UNITS
//ID of the Charge spell
constant integer SPELLID = 'A0AC'
//ID of the dummy unit used for the attack at the end of the charge. Set this to 0 for no unit
constant integer DUMMYID = 'e00P'
//ID of the spell to be casted by the dummy unit once the charge is complete (Has to be a spell with
//a Target). Set this to 0 for no spell. The Spell effect depends on the level of the Charge Spell
//So it's advisable to set the number of levels of this spell at the same value of the level of the
//Charge Spell
constant integer DUMMYSPELLID = 'A0AB'
//Order String for the spell to be casted by the dummy unit
constant string SPELLORDERID = "thunderbolt"
//SPECIAL EFFECTS CONFIGURATION
//You can set this to a non existand model (or change the code of the spell) if you don't want that
//effect
//Special Effect attached on the unit (in this example it will look like a red trail)
constant string ATTACHEDEFFECT = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"
//Special Effect created by the unit while walking
constant string WALKEFFECT = "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl"
//Special Effect used at the end of the Charge
constant string ENDINGEFFECT = "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl"
//NUMERICAL SETTINGS
//Charge Starting Speed
constant real STARTSPEED = 20.00
//Max Speed that can be reached by the Caster unit while charging
constant real MAXSPEED = 100.00
//Damage Dealt at the end of the Charge (0 for no damage). DEPENDS ON LEVEL
constant real CHARGEDAMAGE = 5.00
//Minimum Distance at where a unit can Charge (0 for no min distance)
//Make sure the dummy spell has a longer distance than this
constant real MINDISTANCE = 400.00
//Maximum Distance at where a unit can Charge (0 for no max distance)
//This is mainly used to interrupt the charge if the target unit gets teleported somewhere else
//Make sure the dummy spell has a distance equal or less than this number
constant real MAXDISTANCE = 2000.00
//KNOCKBACK SETTINGS
//Theese settings refer to the Knock trigger which is not made by me but by Silvenon. If you want
//to know more about this script, got to
//http://www.hiveworkshop.com/forums/jass-functions-413/knockback-unit-35545/
//Special Effect created by the knockback
constant string KNOCKEFFECT = "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl"
//The Distance of the Knockback effect. DEPENDS ON LEVEL
constant real KNOCKDISTANCE = 10.00
//The Duration of the Knockback effect
constant real KNOCKDURATION = 1
//Tree Destroying effect
//If you want trees destroyed behind your target while he's knocked back, then set this to true
//Otherwise set this to false. See the Knock Trigger for more configuration options
constant boolean KNOCKTREECHECK = true
//Knockback Effect
//This is the effect played on the Knocked Back Unit. If you set this to 0 then no effect will be played
//If you set this to 1 then the effect set on the KnockEffect() function is played as a periodic effect
//If you set this to 2 then the effect will be attached on the unit and destroyed once the knocback ends
constant integer KNOCKPLAYEFFECT = 1
//Attachement point of the effect played during the knockback. Default is "chest"
constant string KNOCKATTACH = "Foot"
//You may want to check the ChargeExec trigger for more Configuration Options
//PATCCHECKER SETTINGS
//ID of the dummy unit used for the path checker function (has to be an invulnerable locusted unit with No model)
constant integer PATHCHECKERID = 'e00Q'
//ID of the permanent windwalk spell used for the path checker function
constant integer SPELLPATHID = 'A0AA'
endglobals
function KnockTree takes nothing returns real
if (KNOCKTREECHECK==true) then
return 150.00
endif
return 0.00
endfunction
endlibrary
//TESH.scrollpos=248
//TESH.alwaysfold=0
// **************************************************************************
// ** **
// ** Charge **
// ** ————————————— **
// ** **
// ** A simple Charge Spell **
// ** **
// ** By: Majin **
// **
// ** **
// **************************************************************************
library ChargeExec requires Knockback
struct ChargeLoop
private real ChargeTargetx
private real ChargeTargety
private real ChargeEndx
private real ChargeEndy
private real ChargeLocx
private real ChargeLocy
private real ChargeNextx
private real ChargeNexty
private unit ChargeTarget
private unit ChargeCaster
private real ChargeAngle
private real ChargeDistance
private effect ChargeEffect
private timer ChargeTimer
private boolean ChargeCond = false
private integer SpellLvl
//START OF CONFIGURATION METHODS
//With this method you can set the "acceleration rate" (Physicists Forgive me) of the charge.
//You can use any kind of numeric function (for example this.ChargeDistance * 2.00 will double
//The speed at every loop)
private method ChangeDistance takes nothing returns real
return this.ChargeDistance + 1.00
endmethod
//END OF CONFIGURATION METHODS
//START OF CUSTOMIZABLE METHODS
//This method sets the conditions when to activate the AlmostCharge method. In particular
//You may be interested in changing the distance at where the condition is true.
//In this Example it will be activated when the Caster is 16x times the Charge Speed Far away
//From the target
private method AlmostChargeCond takes nothing returns boolean
return ((GetDistance(this.ChargeLocx, this.ChargeLocy, this.ChargeEndx, this.ChargeEndy) < ( this.ChargeDistance * 16.00 )) and this.ChargeCond == false)
endmethod
//Actions to take when the Charge is almost completed. In this example the caster will play
//The slam animation (Being a Blademaster, it will jump in the air while attacking)
private method AlmostCharge takes nothing returns nothing
set this.ChargeCond = true
call SetUnitTimeScale( this.ChargeCaster, 2.00 )
call SetUnitAnimation( this.ChargeCaster, "slam" )
call QueueUnitAnimation( this.ChargeCaster, "stand")
endmethod
//Actions to take when the Caster reaches its target and the charge is completed.
//In this example the target unit will be stunned and you will see a Thunderclap effect on the ground
private method CompleteCharge takes nothing returns nothing
local effect tempEffect
local unit dummy
local real angle=GetAngle(this.ChargeLocx, this.ChargeLocy, this.ChargeEndx, this.ChargeEndy)
set this.ChargeLocx = this.ChargeNextx
set this.ChargeLocy = this.ChargeNexty
set this.ChargeNextx = PolarProjectionx(this.ChargeLocx, this.ChargeDistance, this.ChargeAngle)
set this.ChargeNexty = PolarProjectiony(this.ChargeLocy, this.ChargeDistance, this.ChargeAngle)
call DestroyEffect(AddSpecialEffect( WALKEFFECT, this.ChargeLocx, this.ChargeLocy ))
call SetUnitX( this.ChargeCaster, this.ChargeEndx )
call SetUnitY( this.ChargeCaster, this.ChargeEndy )
set dummy = CreateUnit( GetOwningPlayer(this.ChargeCaster), DUMMYID, this.ChargeLocx, this.ChargeLocy, 0 )
call UnitAddAbility( dummy, DUMMYSPELLID )
call SetUnitAbilityLevel(dummy, DUMMYSPELLID, this.SpellLvl)
call IssueTargetOrder( dummy, SPELLORDERID, this.ChargeTarget )
call UnitApplyTimedLife( dummy, 'BTLF', 1.00)
call DestroyEffect(AddSpecialEffect( ENDINGEFFECT, this.ChargeLocx, this.ChargeLocy ))
call UnitDamageTarget( this.ChargeCaster, this.ChargeTarget, CHARGEDAMAGE*this.SpellLvl, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call PauseUnit( this.ChargeCaster, false )
//This is the Knockback effect, see the Knock Trigger for more customization options
call KnockbackEx(this.ChargeTarget, KNOCKDISTANCE*this.SpellLvl, angle, KNOCKDURATION, KnockTree(), KNOCKPLAYEFFECT, KNOCKEFFECT, KNOCKATTACH)
call IssueTargetOrder( this.ChargeCaster, "attack", this.ChargeTarget )
set dummy = null
endmethod
//What to do during the charge, the unit is moved, an effect is placed on the ground and
//the charging speed is increased
private method ContinueCharge takes nothing returns nothing
call DestroyEffect(AddSpecialEffect( WALKEFFECT, this.ChargeLocx, this.ChargeLocy ))
call SetUnitX(this.ChargeCaster, this.ChargeNextx)
call SetUnitY(this.ChargeCaster, this.ChargeNexty)
call SetUnitFacing(this.ChargeCaster, bj_RADTODEG * GetAngle(this.ChargeNextx, this.ChargeNexty, this.ChargeTargetx, this.ChargeTargety))
set this.ChargeLocx = this.ChargeNextx
set this.ChargeLocy = this.ChargeNexty
set this.ChargeNextx = PolarProjectionx(this.ChargeLocx, this.ChargeDistance, this.ChargeAngle)
set this.ChargeNexty = PolarProjectiony(this.ChargeLocy, this.ChargeDistance, this.ChargeAngle)
if (this.ChargeDistance <= MAXSPEED) then
set this.ChargeDistance = this.ChangeDistance()
endif
endmethod
//END OF CUSTOMIZABLE METHODS
//START OF OTHER METHODS
//This is the main method executed during the charge
public static method ChargeActions takes nothing returns nothing
local ChargeLoop l=GetTimerInt(GetExpiredTimer())
set l.ChargeTargetx = GetUnitX(l.ChargeTarget)
set l.ChargeTargety = GetUnitY(l.ChargeTarget)
set l.ChargeEndx = PolarProjectionx(l.ChargeTargetx, 100.00, GetAngle(l.ChargeTargetx, l.ChargeTargety, l.ChargeLocx, l.ChargeLocy))
set l.ChargeEndy = PolarProjectiony(l.ChargeTargety, 100.00, GetAngle(l.ChargeTargetx, l.ChargeTargety, l.ChargeLocx, l.ChargeLocy))
set l.ChargeAngle = GetAngle(l.ChargeLocx, l.ChargeLocy, l.ChargeEndx, l.ChargeEndy)
if ( l.AlmostChargeCond() ) then
//What to do when the caster is about to reach the target
call l.AlmostCharge()
endif
//If the Target gets too far away (by teleportation, for example) then stops the Charge
if ( GetDistance(l.ChargeLocx, l.ChargeLocy, l.ChargeEndx, l.ChargeEndy) >= MAXDISTANCE and (MAXDISTANCE != 0.00) ) then
call l.StopCharge()
endif
if ( l.ChargeConditions() ) then
//If the unit hasn't reached the target yet, then execute this
call l.ContinueCharge()
call TimerAttach(l.ChargeTimer,0.03,l,function ChargeLoop.ChargeActions)
else
if ( l.ChargeCompleted() ) then
//What to do if the charge is succesfully completed
call l.CompleteCharge()
endif
call l.StopCharge()
endif
endmethod
//Actions to take once the Charge is being stopped (either because it wasn't possible to complete
//the charge or because the caster reached its target)
private method StopCharge takes nothing returns nothing
set this.ChargeCond = false
call SetUnitPathing(this.ChargeCaster, true)
call PauseUnit(this.ChargeCaster, false)
call SetUnitAnimation(this.ChargeCaster, "stand")
call SetUnitTimeScale(this.ChargeCaster, 1.00)
call DestroyEffect(this.ChargeEffect)
call this.destroy()
endmethod
private method ChargeCompleted takes nothing returns boolean
if ((GetDistance(this.ChargeLocx, this.ChargeLocy, this.ChargeEndx, this.ChargeEndy) <= this.ChargeDistance*1.10) and IsPointWalkable(this.ChargeNextx, this.ChargeNexty)) then
if ((IsTerrainPathable(this.ChargeNextx, this.ChargeNexty, PATHING_TYPE_WALKABILITY) == false ) and ( (GetUnitState(this.ChargeTarget, UNIT_STATE_LIFE)<=0) == false )) then
if(((GetUnitState(this.ChargeCaster, UNIT_STATE_LIFE) <= 0) == false)) then
return true
endif
endif
endif
return false
endmethod
private method ChargeConditions takes nothing returns boolean
if ((GetDistance(this.ChargeLocx, this.ChargeLocy, this.ChargeEndx, this.ChargeEndy) > this.ChargeDistance*1.10) and IsPointWalkable(this.ChargeNextx, this.ChargeNexty)) then
if ((IsTerrainPathable(this.ChargeNextx, this.ChargeNexty, PATHING_TYPE_WALKABILITY) == false ) and ( (GetUnitState(this.ChargeTarget, UNIT_STATE_LIFE)<=0) == false )) then
if(((GetUnitState(this.ChargeCaster, UNIT_STATE_LIFE) <= 0) == false)) then
return true
endif
endif
endif
return false
endmethod
private method onDestroy takes nothing returns nothing
call ReleaseTimer(this.ChargeTimer)
set this.ChargeTarget = null
set this.ChargeCaster = null
set this.ChargeEffect = null
endmethod
static method create takes real pChargeTargetx, real pChargeTargety, real pChargeEndx, real pChargeEndy, real pChargeLocx, real pChargeLocy, real pChargeNextx, real pChargeNexty, unit pChargeTarget, unit pChargeCaster, real pChargeAngle, real pChargeDistance, effect pChargeEffect, timer pChargeTimer returns ChargeLoop
local ChargeLoop l = ChargeLoop.allocate()
set l.ChargeTargetx = pChargeTargetx
set l.ChargeTargety = pChargeTargety
set l.ChargeEndx = pChargeEndx
set l.ChargeEndy = pChargeEndy
set l.ChargeLocx = pChargeLocx
set l.ChargeLocy = pChargeLocy
set l.ChargeNextx = pChargeNextx
set l.ChargeNexty = pChargeNexty
set l.ChargeTarget = pChargeTarget
set l.ChargeCaster = pChargeCaster
set l.ChargeAngle = pChargeAngle
set l.ChargeDistance = pChargeDistance
set l.ChargeEffect = pChargeEffect
set l.ChargeTimer = pChargeTimer
set l.SpellLvl = GetUnitAbilityLevel(l.ChargeCaster, SPELLID)
return l
endmethod
//END OF OTHER METHODS
endstruct
endlibrary
//TRIGGER OF THE CHARGE SPELL
scope Charge initializer InitTrig
private function Conditions takes nothing returns boolean
return GetSpellAbilityId() == SPELLID
endfunction
private function CheckActions takes nothing returns nothing
local real ChargeLocx = GetUnitX(GetTriggerUnit())
local real ChargeLocy = GetUnitY(GetTriggerUnit())
local real ChargeEndx = GetUnitX(GetSpellTargetUnit())
local real ChargeEndy = GetUnitY(GetSpellTargetUnit())
local sound s
if ( GetDistance(ChargeLocx, ChargeLocy, ChargeEndx, ChargeEndy) <= (MINDISTANCE) ) then
call DisplayTextToPlayer( GetOwningPlayer(GetTriggerUnit()), 0, 0, "|cffFFCC00Target is too close!|r" )
set s = CreateSound("Sound\\Interface\\Error.wav", false, false, true, 12700, 12700, "")
call StartSound(s)
call KillSoundWhenDone(s)
set s = null
call IssueImmediateOrder( GetTriggerUnit(), "stop" )
endif
endfunction
private function InitActions takes nothing returns nothing
local timer ChargeTimer = NewTimer()
local effect ChargeEffect
local unit ChargeCaster = GetTriggerUnit()
local unit ChargeTarget = GetSpellTargetUnit()
local real ChargeDistance = STARTSPEED
local real ChargeLocx = GetUnitX(ChargeCaster)
local real ChargeLocy = GetUnitY(ChargeCaster)
local real ChargeTargetx = GetUnitX(ChargeTarget)
local real ChargeTargety = GetUnitY(ChargeTarget)
local real ChargeEndx = PolarProjectionx(ChargeTargetx, 100.00, GetAngle(ChargeTargetx, ChargeTargety, ChargeLocx, ChargeLocy))
local real ChargeEndy = PolarProjectiony(ChargeTargety, 100.00, GetAngle(ChargeTargetx, ChargeTargety, ChargeLocx, ChargeLocy))
local real ChargeAngle = GetAngle(ChargeLocx, ChargeLocy, ChargeEndx, ChargeEndy)
local real ChargeNextx = PolarProjectionx(ChargeLocx, ChargeDistance, ChargeAngle)
local real ChargeNexty = PolarProjectiony(ChargeLocy, ChargeDistance, ChargeAngle)
local ChargeLoop stru
set ChargeEffect = AddSpecialEffectTarget(ATTACHEDEFFECT, ChargeCaster, "chest" )
set stru = ChargeLoop.create(ChargeTargetx, ChargeTargety, ChargeEndx, ChargeEndy, ChargeLocx, ChargeLocy, ChargeNextx, ChargeNexty, ChargeTarget, ChargeCaster, ChargeAngle, ChargeDistance, ChargeEffect, ChargeTimer)
set udg_ignore_next_defend[GetConvertedPlayerId(GetOwningPlayer(ChargeCaster))] = true
call SetUnitPathing(ChargeCaster, false)
call SetUnitTimeScale(ChargeCaster, 3)
call IssueImmediateOrder(ChargeCaster, "stop" )
call PauseUnit(ChargeCaster, true)
call SetUnitAnimationByIndex(ChargeCaster,6)
call TimerAttach(ChargeTimer,0,stru,function ChargeLoop.ChargeActions)
set ChargeTimer = null
set ChargeEffect = null
set ChargeCaster = null
set ChargeTarget = null
endfunction
private function InitTrig takes nothing returns nothing
local trigger ChargeCheck = CreateTrigger()
local trigger ChargeInit = CreateTrigger()
local filterfunc f = Filter(function AntiLeak)
local integer i = 0
loop
exitwhen i == 16
call TriggerRegisterPlayerUnitEvent(ChargeCheck,Player(i),EVENT_PLAYER_UNIT_SPELL_CAST,truefilter)
call TriggerRegisterPlayerUnitEvent(ChargeInit,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,truefilter)
set i = i + 1
endloop
call TriggerAddCondition(ChargeCheck, Condition(function Conditions))
call TriggerAddAction(ChargeCheck, function CheckActions)
call TriggerAddCondition(ChargeInit, Condition(function Conditions))
call TriggerAddAction(ChargeInit, function InitActions)
set ChargeCheck = null
set ChargeInit = null
set f = null
endfunction
endscope
//TESH.scrollpos=0
//TESH.alwaysfold=0
// **************************************************************************
// ** **
// ** Mathematical Functions **
// ** ————————————— **
// ** **
// ** Functions used instead of BJs to calculate some values **
// ** **
// ** By: Majin **
// **
// ** **
// **************************************************************************
library Math
function GetDistance takes real ax, real ay, real bx, real by returns real
return SquareRoot((bx-ax)*(bx-ax)+(by-ay)*(by-ay))
endfunction
function PolarProjectionx takes real ax, real dist, real angle returns real
return ax + dist * Cos(angle)
endfunction
function PolarProjectiony takes real ay, real dist, real angle returns real
return ay + dist * Sin(angle)
endfunction
function GetAngle takes real ax, real ay, real bx, real by returns real
return Atan2(by-ay, bx-ax)
endfunction
function RAbs takes real a returns real
if (a >= 0) then
return a
else
return -a
endif
endfunction
function AntiLeak takes nothing returns boolean
return true
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
//Functions used to handle timers. Credits to Vexorian and Captain Griffen
//Check http://www.wc3c.net/showthread.php?t=89072 for more informations
library HandleTimers
globals
private timer array timers
private integer N = 0
endglobals
function NewTimer takes nothing returns timer
if (N==0) then
return CreateTimer()
endif
set N=N-1
return timers[N]
endfunction
function ReleaseTimer takes timer t returns nothing
call PauseTimer(t)
if (N==8191) 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
set timers[N]=t
set N=N+1
endif
endfunction
function TimerAttach takes timer t, real time, real value, code func returns nothing
call TimerStart(t, value, false, null)
call PauseTimer(t)
call TimerStart(t, time, false, func)
endfunction
// ONLY call on an expired timer.
function GetTimerInt takes timer t returns integer
return R2I(TimerGetRemaining(t) + 0.5)
endfunction
endlibrary
//TESH.scrollpos=25
//TESH.alwaysfold=0
// **************************************************************************
// ** **
// ** Check Pathability Function **
// ** ————————————— **
// ** **
// ** A Function that checks if a unit can walk over a certain area **
// ** (Ignores other units but not buildings, trees and other obstacles) **
// ** **
// ** By: Majin **
// **
// ** **
// **************************************************************************
library Walkable initializer init requires ChargeConfig, Math
globals
unit pathchecker
rect pathrect
filterfunc truefilter
endglobals
function HideItems takes nothing returns nothing
call SetItemVisible(GetEnumItem(), false)
endfunction
function UnHideItems takes nothing returns nothing
call SetItemVisible(GetEnumItem(), true)
endfunction
function IsPointWalkable takes real x, real y returns boolean
local boolean b
call SetUnitPosition(pathchecker,x,y)
set b=((GetUnitX(pathchecker)-x)*(GetUnitX(pathchecker)-x)+((GetUnitY(pathchecker)-y)*(GetUnitY(pathchecker)-y))<=1)
if (b==false) then
call MoveRectTo(pathrect, x, y)
call EnumItemsInRect(pathrect,truefilter,function HideItems)
call SetUnitPosition(pathchecker,x,y)
set b=((GetUnitX(pathchecker)-x)*(GetUnitX(pathchecker)-x)+((GetUnitY(pathchecker)-y)*(GetUnitY(pathchecker)-y))<=1)
call EnumItemsInRect(pathrect,truefilter,function UnHideItems)
endif
return b
endfunction
function init takes nothing returns nothing
local real x = GetRectMinX(bj_mapInitialPlayableArea)
local real y = GetRectMinY(bj_mapInitialPlayableArea)
set pathrect=Rect(x,y,x+200.00,y+200.00)
set pathchecker=CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), PATHCHECKERID, 0, 0, 0)
set truefilter=Filter(function AntiLeak)
call UnitAddAbility(pathchecker, SPELLPATHID)
call IssueImmediateOrder( pathchecker, "windwalk" )
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
library Knockback initializer Init requires HandleTimers, Walkable
// **************************************************************************
// ** **
// ** Knockback(Ex) **
// ** ————————————— **
// ** **
// ** A function made for efficient knockbacking **
// ** **
// ** By: Silvenon **
// ** **
// **************************************************************************
//=======================================//
//Credits to PitzerMike for this function//
//=======================================//
private function TreeFilter takes nothing returns boolean
local destructable d = GetFilterDestructable()
local boolean i = IsDestructableInvulnerable(d)
local unit u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), DUMMYID, GetWidgetX(d), GetWidgetY(d), 0)
local boolean result = false
call UnitAddAbility(u, 'Ahrl')
if i then
call SetDestructableInvulnerable(d, false)
endif
set result = IssueTargetOrder(u, "harvest", d)
call RemoveUnit(u)
if i then
call SetDestructableInvulnerable(d, true)
endif
set u = null
set d = null
return result
endfunction
//===========================================================================
globals
private timer Tim = CreateTimer()
private integer Total = 0
private boolexpr Cond = null
private integer array Ar
private boolean array BoolAr
private real MAX_X
private real MAX_Y
private real MIN_X
private real MIN_Y
endglobals
private constant function Interval takes nothing returns real
return 0.04
endfunction
private function KillTree takes nothing returns nothing
if BoolAr[0] then
call KillDestructable(GetEnumDestructable())
else
set BoolAr[1] = true
endif
endfunction
public struct Data
unit u
real d1
real d2
real sin
real cos
real r
string s = ""
effect e = null
static method create takes unit u, integer q, real d, real a, real r, integer t, string s, string p returns Data
local Data dat = Data.allocate()
set dat.u = u
set dat.d1 = 2 * d / (q + 1)
set dat.d2 = dat.d1 / q
set dat.sin = Sin(a)
set dat.cos = Cos(a)
set dat.r = r
if s != "" and s != null then
if t == 2 then
if p != "" and p != null then
set dat.e = AddSpecialEffectTarget(s, u, p)
else
set dat.e = AddSpecialEffectTarget(s, u, "chest")
endif
elseif t == 1 then
set dat.s = s
endif
endif
call SetUnitPosition(u, GetUnitX(u), GetUnitY(u))
call PauseUnit(u, true)
if Total == 0 then
call TimerStart(Tim, Interval(), true, function Data.Execute)
endif
set Total = Total + 1
set Ar[Total - 1] = dat
return dat
endmethod
static method Execute takes nothing returns nothing
local Data dat
local integer i = 0
local real x
local real y
local rect r
local real rad
loop
exitwhen i >= Total
set dat = Ar[i]
if dat.s != "" and dat.s != null then
set x = GetUnitX(dat.u)
set y = GetUnitY(dat.u)
call DestroyEffect(AddSpecialEffect(dat.s, x, y))
set x = x + dat.d1 * dat.cos
set y = y + dat.d1 * dat.sin
else
set x = GetUnitX(dat.u) + dat.d1 * dat.cos
set y = GetUnitY(dat.u) + dat.d1 * dat.sin
endif
if dat.r != 0 then
set BoolAr[0] = dat.r > 0
set rad = dat.r
if not BoolAr[0] then
set rad = rad * (-1)
endif
set r = Rect(x - rad, y - rad, x + rad, y + rad)
call EnumDestructablesInRect(r, Cond, function KillTree)
call RemoveRect(r)
set r = null
endif
if (x < MAX_X and y < MAX_Y and x > MIN_X and y > MIN_Y) and not BoolAr[1] and (IsPointWalkable(x, y)) then
call SetUnitX(dat.u, x)
call SetUnitY(dat.u, y)
endif
set dat.d1 = dat.d1 - dat.d2
if dat.d1 <= 0 or (x > MAX_X or y > MAX_Y or x < MIN_X or y < MIN_Y) or BoolAr[1] or not(IsPointWalkable(x, y)) then
set Ar[i] = Ar[Total - 1]
set Total = Total - 1
call dat.destroy()
endif
set i = i + 1
endloop
if Total == 0 then
call PauseTimer(Tim)
endif
endmethod
method onDestroy takes nothing returns nothing
if .e != null then
call DestroyEffect(.e)
endif
call PauseUnit(.u, false)
set BoolAr[0] = false
set BoolAr[1] = false
endmethod
endstruct
function KnockbackEx takes unit u, real d, real a, real w, real r, integer t, string s, string p returns nothing
call Data.create(u, R2I(w / Interval()), d, a, r, t, s, p)
endfunction
function Knockback takes unit u, real d, real a, real w returns nothing
call Data.create(u, R2I(w / Interval()), d, a, 0, 0, "", "")
endfunction
private function Init takes nothing returns nothing
set Cond = Filter(function TreeFilter)
set BoolAr[0] = false
set BoolAr[1] = false
set MAX_X = GetRectMaxX(bj_mapInitialPlayableArea) - 64
set MAX_Y = GetRectMaxY(bj_mapInitialPlayableArea) - 64
set MIN_X = GetRectMinX(bj_mapInitialPlayableArea) + 64
set MIN_Y = GetRectMinY(bj_mapInitialPlayableArea) + 64
endfunction
endlibrary
//TESH.scrollpos=0
//TESH.alwaysfold=0
Made by KhaosMachine (idea taked from HammerFist132)
//*************************
How to import?
Copy the next things:
Fearless Charge [FC00, FC01, FC02, FC03] (trigger folder)
Fearless Charge (ability from the object editor)
Configure all things into the trigger named 'FC00'
//*************************
LEAKLESS
LAGLESS
100% CONFIGURABLE
If you use this spell please give me credits!
//TESH.scrollpos=161
//TESH.alwaysfold=0
library RefractionCharge
globals
private constant integer ABIL_CODE = 'A02C'
private constant real TIMEOUT = 0.03125
//Damage types and attack types
private constant attacktype ATTACK_TYPE = ATTACK_TYPE_CHAOS
private constant damagetype DAMAGE_TYPE = DAMAGE_TYPE_DIVINE
//SFX
private constant string CHARGE_SFX = "Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl"//Refers to the sfx created when charging.
private constant string CHARGE_ATTACH = "chest"//Refers to the attachment of ^ SFX
private constant string DAMAGE_SFX = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"//Refers to the sfx when damaging
private constant string DAMAGE_ATTACH = "overhead"
private constant string SWORD_SFX = "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"//Refers to the sfx of the sword when charging.
private constant string SWORD_ATTACH = "weapon"
//Animation
private constant integer ANIM_ID = 6 //Refers to the walking animation
private constant real ANIM_SPEED = 2
private constant real MIN_DIST = 100
endglobals
//Damage Function
private function GetDamage takes unit u , integer lvl returns real
return I2R((GetHeroAgi(u,true) * ((lvl + 1)/3))) + 100
endfunction
//Get Speed
private function GetSpeed takes integer lvl returns real
return 500 * TIMEOUT
endfunction
//Get Minimum Distance
private function GetMinDist takes nothing returns real
return MIN_DIST * MIN_DIST
endfunction
//Running Spell
struct RefractionCharge
private thistype next
private thistype prev
private static timer iterator = CreateTimer()
private static integer count = 0
private unit caster
private unit target
private effect sword
private real speed
private real damage
private method destroy takes nothing returns nothing
/*
* Deallocate this instance.
*/
call this.deallocate()
/*
* We remove the instance from the linked list.
*/
set this.next.prev = this.prev
set this.prev.next = this.next
/*
* We decrease the count by 1.
* If the count is 0, we pause the timer.
*/
set count = count - 1
if count == 0 then
call PauseTimer(iterator)
endif
/*
* We null the data in the struct.
* This is completely optional. It doesn't really make a difference
* at all. (Unless you're casting the spell some hundreds of times.)
* If you have some real memory intense systems in your map,
* you might want to do this, especially if your struct has a lot of data.
*
* These are global variables, so they will be recycled eventually.
* It's all up to you, my friend.
*/
call DestroyEffect(this.sword)
set this.sword = null
call SetUnitAnimation(this.caster,"stand")
call SetUnitTimeScale(this.caster,1)
call PauseUnit(this.caster,false)
set this.caster = null
set this.target = null
endmethod
private static method periodic takes nothing returns nothing
/*
* Starting from the first instance, we loop
* over all the instance in the list until we hit
* a dead-end.
*/
local real x
local real y
local real x2
local real y2
local real dist
local real angle
local thistype this = thistype(0).next
loop
exitwhen this == 0
set x = GetUnitX(this.caster)
set y = GetUnitY(this.caster)
set x2 = GetUnitX(this.target)
set y2 = GetUnitY(this.target)
set angle = Atan2(y2 - y,x2 - x)
set dist = (x2-x) * (x2-x) + (y2-y)*(y2-y)
if not IsUnitType(this.caster,UNIT_TYPE_DEAD) and not IsUnitType(this.target,UNIT_TYPE_DEAD) then
if dist >= GetMinDist() then
set x = x + this.speed * Cos(angle)
set y = y + this.speed * Sin(angle)
//Moving Unit
call SetUnitX(this.caster,x)
call SetUnitY(this.caster,y)
call DestroyEffect(AddSpecialEffect(CHARGE_SFX,x,y))
call SetUnitAnimationByIndex(this.caster,ANIM_ID)
call SetUnitFacing(this.caster,angle * bj_RADTODEG)
else
call UnitDamageTarget(this.caster,this.target,this.damage,false,false,ATTACK_TYPE,DAMAGE_TYPE,null)
call DestroyEffect(AddSpecialEffectTarget(DAMAGE_SFX,this.target,DAMAGE_ATTACH))
call this.destroy()
endif
else
call this.destroy()
endif
set this = this.next
endloop
endmethod
private static method run takes nothing returns boolean
/*
* We allocate an instance.
*/
local thistype this = thistype.allocate()
local integer lvl
/*
* We add the instance to the linked list.
*/
set this.next = 0
set this.prev = thistype(0).prev
set thistype(0).prev.next = this
set thistype(0).prev = this
/*
* We increase the count by 1.
* If the count is 1, we start the timer to loop through
* the instances. This is because recasting the spell while
* an instance is already running shouldn't restart the timer.
*/
set count = count + 1
if count == 1 then
call TimerStart(iterator, TIMEOUT, true, function thistype.periodic)
endif
/*
* We set our struct data.
*/
set this.caster = GetTriggerUnit()
set this.target = GetSpellTargetUnit()
set this.sword = AddSpecialEffectTarget(SWORD_SFX,this.caster,SWORD_ATTACH)
set lvl = GetUnitAbilityLevel(this.caster,ABIL_CODE)
set this.damage = GetDamage(this.caster,lvl)
set this.speed = GetSpeed(lvl)
//Setting Animation Speed
call SetUnitTimeScale(this.caster,ANIM_SPEED)
call PauseUnit(this.caster,true)
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.run))
set t = null
endmethod
endstruct
endlibrary
function calculationking takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_multiboard_factions, 3, udg_multiboard_increment, I2S(( GetPlayerState(udg_Player_array_var[udg_multiboard_loop_integer], PLAYER_STATE_RESOURCE_FOOD_USED) + ( GetPlayerStructureCount(udg_Player_array_var[udg_multiboard_loop_integer], false) * 5 ) +(GetHeroStr(udg_hero_king[udg_multiboard_loop_integer], true)) + (GetHeroAgi(udg_hero_king[udg_multiboard_loop_integer], true)) + (GetHeroInt(udg_hero_king[udg_multiboard_loop_integer], true)) + (GetHeroStr(udg_hero_prince[udg_multiboard_loop_integer], true)) + (GetHeroAgi(udg_hero_prince[udg_multiboard_loop_integer], true)) + (GetHeroInt(udg_hero_prince[udg_multiboard_loop_integer], true)) )))
endfunction
function calculationknight takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_multiboard_factions, 3, udg_multiboard_increment, I2S(( GetPlayerState(udg_Player_array_var[udg_multiboard_loop_integer], PLAYER_STATE_RESOURCE_FOOD_USED) + ( GetPlayerStructureCount(udg_Player_array_var[udg_multiboard_loop_integer], false) * 5 ) +(GetHeroStr(udg_Knight_Hero_Var[udg_multiboard_loop_integer], true)) + ((GetHeroAgi(udg_Knight_Hero_Var[udg_multiboard_loop_integer], true)) + ((GetHeroInt(udg_Knight_Hero_Var[udg_multiboard_loop_integer], true)) + ( BlzGetUnitMaxHP(udg_Knight_Hero_Var[udg_multiboard_loop_integer]) / 25))))))
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////
/// The Map Meta Data Library
/// Version: v1.00
/// Last Modified: April 24, 2009
/// Author Chain: Strilanc, [insert next ...]
///////////////////////////////////////////////////////////////
/// This library is used to emit standardized meta data which parsers and bot hosts can use to record relevant
/// game statistics like "hero kills" which would otherwise be impossible to record automatically.
///
/// In particular, the flag function can be used to indicate if a leaver should be awarded a win or not. Replays
/// don't contain enough information to easily tell winners who leave from losers who leave. (for example: people
/// who leave while end-game stats are being shown)
///////////////////////////////////////////////////////////////
/// Interface:
/// void FlagPlayer(player, flag_constant)
/// void DefineValue(name, type_constant, goal_constant, suggest_constant)
/// void UpdateValueInt(name, player, operation_constant, value)
/// void UpdateValueReal(name, player, operation_constant, value)
/// void UpdateValueString(name, player, value)
/// void DefineEvent0(name, format) /////////////////////////
library MMD initializer init
globals
public constant integer GOAL_NONE = 101
public constant integer GOAL_HIGH = 102
public constant integer GOAL_LOW = 103
public constant integer TYPE_STRING = 101
public constant integer TYPE_REAL = 102
public constant integer TYPE_INT = 103
public constant integer OP_ADD = 101
public constant integer OP_SUB = 102
public constant integer OP_SET = 103
public constant integer SUGGEST_NONE = 101
public constant integer SUGGEST_TRACK = 102
public constant integer SUGGEST_LEADERBOARD = 103
public constant integer FLAG_DRAWER = 101
public constant integer FLAG_LOSER = 102
public constant integer FLAG_WINNER = 103
public constant integer FLAG_LEAVER = 104
public constant integer FLAG_PRACTICING = 105
endglobals
///////////////////////////////////////////////////////////////
/// Private variables and constants
///////////////////////////////////////////////////////////////
globals
private constant boolean SHOW_DEBUG_MESSAGES = true
private constant string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+= \\!@#$%^&*()/?>.<,;:'\"{}[]|`~"
private constant integer num_chars = StringLength(chars)
private string array flags
private string array goals
private string array ops
private string array types
private string array suggestions
private boolean initialized = false
private gamecache gc = null
private constant string ESCAPED_CHARS = " \\"
private constant integer CURRENT_VERSION = 1
private constant integer MINIMUM_PARSER_VERSION = 1
private constant string FILENAME = "MMD.Dat"
private constant string M_KEY_VAL = "val:"
private constant string M_KEY_CHK = "chk:"
private constant integer NUM_SENDERS_NAIVE = 1
private constant integer NUM_SENDERS_SAFE = 3
private integer num_senders = NUM_SENDERS_NAIVE
private integer num_msg = 0
private timer clock = CreateTimer()
private string array q_msg
private real array q_time
private integer array q_index
private keyword QueueNode
private QueueNode q_head = 0
private QueueNode q_tail = 0
endglobals
///////////////////////////////////////////////////////////////
/// Private functions
///////////////////////////////////////////////////////////////
///Triggered when tampering is detected. Increases the number of safeguards against tampering.
public function RaiseGuard takes string reason returns nothing
debug if SHOW_DEBUG_MESSAGES then
debug call BJDebugMsg("MMD: Guard Raised! (" + reason + ")")
debug endif
set num_senders = NUM_SENDERS_SAFE //increase number of players voting on each message
endfunction
///Returns seconds elapsed in game time
private function time takes nothing returns real
return TimerGetElapsed(clock)
endfunction
///Initializes the char-to-int conversion
private function prepC2I takes nothing returns nothing
local integer i = 0
local string id
loop
exitwhen i >= num_chars
set id = SubString(chars, i, i+1)
if id == StringCase(id, true) then
set id = id + "U"
endif
call StoreInteger(gc, "c2i", id, i)
set i = i + 1
endloop
endfunction
///Converts a character to an integer
private function C2I takes string c returns integer
local integer i
local string id = c
if id == StringCase(id, true) then
set id = id + "U"
endif
set i = GetStoredInteger(gc, "c2i", id)
if (i < 0 or i >= num_chars or SubString(chars, i, i+1) != c) and HaveStoredInteger(gc, "c2i", id) then
//A cheater sent a fake sync to screw with the cached values
set i = 0
loop
exitwhen i >= num_chars //just a weird character
if c == SubString(chars, i, i+1) then //cheating!
call RaiseGuard("c2i poisoned")
call StoreInteger(gc, "c2i", id, i)
exitwhen true
endif
set i = i + 1
endloop
endif
return i
endfunction
///Computes a weak hash value, hopefully secure enough for our purposes
private function poor_hash takes string s, integer seed returns integer
local integer n = StringLength(s)
local integer m = n + seed
local integer i = 0
loop
exitwhen i >= n
set m = m * 41 + C2I(SubString(s, i, i+1))
set i = i + 1
endloop
return m
endfunction
///Stores previously sent messages for tamper detection purposes
private struct QueueNode
readonly real timeout
readonly string msg
readonly integer checksum
readonly string key
public QueueNode next = 0
public static method create takes integer id, string msg returns QueueNode
local QueueNode this = QueueNode.allocate()
set .timeout = time() + 7.0 + GetRandomReal(0, 2+0.1*GetPlayerId(GetLocalPlayer()))
set .msg = msg
set .checksum = poor_hash(.msg, id)
set .key = I2S(id)
return this
endmethod
private method onDestroy takes nothing returns nothing
call FlushStoredInteger(gc, M_KEY_VAL+.key, .msg)
call FlushStoredInteger(gc, M_KEY_CHK+.key, .key)
set .msg = null
set .key = null
set .next = 0
endmethod
public method send takes nothing returns nothing
call StoreInteger(gc, M_KEY_VAL+.key, .msg, .checksum)
call StoreInteger(gc, M_KEY_CHK+.key, .key, .checksum)
call SyncStoredInteger(gc, M_KEY_VAL+.key, .msg)
call SyncStoredInteger(gc, M_KEY_CHK+.key, .key)
endmethod
endstruct
///Returns true for a fixed size uniform random subset of players in the game
private function isEmitter takes nothing returns boolean
local integer i = 0
local integer n = 0
local integer r
local integer array picks
local boolean array pick_flags
loop
exitwhen i >= 24
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
if n < num_senders then //initializing picks
set picks[n] = i
set pick_flags[i] = true
else //maintain the invariant 'P(being picked) = c/n'
set r = GetRandomInt(0, n)
if r < num_senders then
set pick_flags[picks[r]] = false
set picks[r] = i
set pick_flags[i] = true
endif
endif
set n = n + 1
endif
set i = i + 1
endloop
return pick_flags[GetPlayerId(GetLocalPlayer())]
endfunction
///Places meta-data in the replay and in network traffic
private function emit takes string message returns nothing
local QueueNode q
if not initialized then
call BJDebugMsg("MMD Emit Error: Library not initialized yet.")
return
endif
//remember sent messages for tamper check
set q = QueueNode.create(num_msg, message)
if q_head == 0 then
set q_head = q
else
set q_tail.next = q
endif
set q_tail = q
//send new message
set num_msg = num_msg + 1
if isEmitter() then
call q.send()
endif
endfunction
///Performs tamper checks
private function tick takes nothing returns nothing
local QueueNode q
local integer i
//check previously sent messages for tampering
set q = q_head
loop
exitwhen q == 0 or q.timeout >= time()
if not HaveStoredInteger(gc, M_KEY_VAL+q.key, q.msg) then
call RaiseGuard("message skipping")
call q.send()
elseif not HaveStoredInteger(gc, M_KEY_CHK+q.key, q.key) then
call RaiseGuard("checksum skipping")
call q.send()
elseif GetStoredInteger(gc, M_KEY_VAL+q.key, q.msg) != q.checksum then
call RaiseGuard("message tampering")
call q.send()
elseif GetStoredInteger(gc, M_KEY_CHK+q.key, q.key) != q.checksum then
call RaiseGuard("checksum tampering")
call q.send()
endif
set q_head = q.next
call q.destroy()
set q = q_head
endloop
if q_head == 0 then
set q_tail = 0
endif
//check for future message tampering
set i = 0
loop
exitwhen not HaveStoredInteger(gc, M_KEY_CHK+I2S(num_msg), I2S(num_msg))
call RaiseGuard("message insertion")
call emit("Blank")
set i = i + 1
exitwhen i >= 10
endloop
endfunction
///Replaces control characters with escape sequences
private function pack takes string value returns string
local integer j
local integer i = 0
local string result = ""
local string c
loop //for each character in argument string
exitwhen i >= StringLength(value)
set c = SubString(value, i, i+1)
set j = 0
loop //for each character in escaped chars string
exitwhen j >= StringLength(ESCAPED_CHARS)
//escape control characters
if c == SubString(ESCAPED_CHARS, j, j+1) then
set c = "\\" + c
exitwhen true
endif
set j = j + 1
endloop
set result = result + c
set i = i + 1
endloop
return result
endfunction
///Updates the value of a defined variable for a given player
private function update_value takes string name, player p, string op, string value, integer val_type returns nothing
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 24 then
//call BJDebugMsg("MMD Set Error: Invalid player. Must be P1 to P24.")
elseif val_type != GetStoredInteger(gc, "types", name) then
call BJDebugMsg("MMD Set Error: Updated value of undefined variable or used value of incorrect type.")
elseif StringLength(op) == 0 then
call BJDebugMsg("MMD Set Error: Unrecognized operation type.")
elseif StringLength(name) > 50 then
call BJDebugMsg("MMD Set Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Set Error: Variable name is empty.")
else
//call BJDebugMsg ("MMD Update: [name: " + name + "] [pid: " + I2S (GetPlayerId (p)) + "] [op: " + op + "] [value: " + value + "] [val_type: " + I2S (val_type) + "]")
call emit("VarP " + I2S(id) + " " + pack(name) + " " + op + " " + value)
endif
endfunction
///Defines an event's arguments and format
private function DefineEvent takes string name, integer num_args, string format, string arg_data returns nothing
if GetStoredInteger(gc, "events", name) != 0 then
call BJDebugMsg("MMD DefEvent Error: Event redefined.")
else
call StoreInteger(gc, "events", name, num_args+1)
call emit("DefEvent " + pack(name) + " " + I2S(num_args) + " " + arg_data + pack(format))
endif
endfunction
///Places an event in the meta-data
private function LogEvent takes string name, integer num_args, string data returns nothing
if GetStoredInteger(gc, "events", name) != num_args+1 then
call BJDebugMsg("MMD LogEvent Error: Event not defined or defined with different # of args.")
else
call emit("Event " + pack(name) + data)
endif
endfunction
///////////////////////////////////////////////////////////////
/// Public functions
///////////////////////////////////////////////////////////////
///Sets a player flag like "win_on_leave"
public function FlagPlayer takes player p, integer flag_type returns nothing
local string flag = flags[flag_type]
local integer id = GetPlayerId(p)
if p == null or id < 0 or id >= 24 then
call BJDebugMsg("MMD Flag Error: Invalid player. Must be P1 to P24.")
elseif StringLength(flag) == 0 then
call BJDebugMsg("MMD Flag Error: Unrecognized flag type.")
elseif GetPlayerController(Player(id)) == MAP_CONTROL_USER then
call emit("FlagP " + I2S(id) + " " + flag)
endif
endfunction
///Defines a variable to store things in
public function DefineValue takes string name, integer value_type, integer goal_type, integer suggestion_type returns nothing
local string goal = goals[goal_type]
local string vtype = types[value_type]
local string stype = suggestions[suggestion_type]
if goal == null then
call BJDebugMsg("MMD Def Error: Unrecognized goal type.")
elseif vtype == null then
call BJDebugMsg("MMD Def Error: Unrecognized value type.")
elseif stype == null then
call BJDebugMsg("Stats Def Error: Unrecognized suggestion type.")
elseif StringLength(name) > 32 then
call BJDebugMsg("MMD Def Error: Variable name is too long.")
elseif StringLength(name) == 0 then
call BJDebugMsg("MMD Def Error: Variable name is empty.")
elseif value_type == TYPE_STRING and goal_type != GOAL_NONE then
call BJDebugMsg("MMD Def Error: Strings must have goal type of none.")
elseif GetStoredInteger(gc, "types", name) != 0 then
call BJDebugMsg("MMD Def Error: Value redefined.")
else
call StoreInteger(gc, "types", name, value_type)
call emit("DefVarP " + pack(name) + " " + vtype + " " + goal + " " + stype)
endif
endfunction
///Updates the value of an integer variable
public function UpdateValueInt takes string name, player p, integer op, integer value returns nothing
call update_value(name, p, ops[op], I2S(value), TYPE_INT)
endfunction
///Updates the value of a real variable
public function UpdateValueReal takes string name, player p, integer op, real value returns nothing
call update_value(name, p, ops[op], R2S(value), TYPE_REAL)
endfunction
///Updates the value of a string variable
public function UpdateValueString takes string name, player p, string value returns nothing
local string q = "\""
call update_value(name, p, ops[OP_SET], q + pack(value) + q, TYPE_STRING)
endfunction
public function DefineEvent0 takes string name, string format returns nothing
call DefineEvent(name, 0, format, "")
endfunction
public function DefineEvent1 takes string name, string format, string argName0 returns nothing
call DefineEvent(name, 1, format, pack(argName0) + " ")
endfunction
public function DefineEvent2 takes string name, string format, string argName0, string argName1 returns nothing
call DefineEvent(name, 2, format, pack(argName0) + " " + pack(argName1) + " ")
endfunction
public function DefineEvent3 takes string name, string format, string argName0, string argName1, string argName2 returns nothing
call DefineEvent(name, 3, format, pack(argName0) + " " + pack(argName1) + " " + pack(argName2) + " ")
endfunction
public function LogEvent0 takes string name returns nothing
call LogEvent(name, 0, "")
endfunction
public function LogEvent1 takes string name, string arg0 returns nothing
call LogEvent(name, 1, " " + pack(arg0))
endfunction
public function LogEvent2 takes string name, string arg0, string arg1 returns nothing
call LogEvent(name, 2, " " + pack(arg0) + " " + pack(arg1))
endfunction
public function LogEvent3 takes string name, string arg0, string arg1, string arg2 returns nothing
call LogEvent(name, 3, " " + pack(arg0) + " " + pack(arg1) + " " + pack(arg2))
endfunction
///Emits meta-data which parsers will ignore unless they are customized to understand it
public function LogCustom takes string unique_identifier, string data returns nothing
call emit("custom " + pack(unique_identifier) + " " + pack(data))
endfunction
///////////////////////////////////////////////////////////////
/// Initialization
///////////////////////////////////////////////////////////////
///Emits initialization data
private function init2 takes nothing returns nothing
local integer i
local trigger t
set initialized = true
call emit("init version " + I2S(MINIMUM_PARSER_VERSION) + " " + I2S(CURRENT_VERSION))
set i = 0
loop
exitwhen i >= 24
if GetPlayerController(Player(i)) == MAP_CONTROL_USER and GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
call emit("init pid " + I2S(i) + " " + pack(GetPlayerName(Player(i))))
endif
set i = i + 1
endloop
set t = CreateTrigger()
call TriggerAddAction(t, function tick)
call TriggerRegisterTimerEvent(t, 0.37, true)
endfunction
///Places init2 on a timer, initializes game cache, and translates constants
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0, false)
call TriggerAddAction(t, function init2)
set goals[GOAL_NONE] = "none"
set goals[GOAL_HIGH] = "high"
set goals[GOAL_LOW] = "low"
set types[TYPE_INT] = "int"
set types[TYPE_REAL] = "real"
set types[TYPE_STRING] = "string"
set suggestions[SUGGEST_NONE] = "none"
set suggestions[SUGGEST_TRACK] = "track"
set suggestions[SUGGEST_LEADERBOARD] = "leaderboard"
set ops[OP_ADD] = "+="
set ops[OP_SUB] = "-="
set ops[OP_SET] = "="
set flags[FLAG_DRAWER] = "drawer"
set flags[FLAG_LOSER] = "loser"
set flags[FLAG_WINNER] = "winner"
set flags[FLAG_LEAVER] = "leaver"
set flags[FLAG_PRACTICING] = "practicing"
call FlushGameCache(InitGameCache(FILENAME))
set gc = InitGameCache(FILENAME)
call TimerStart(clock, 999999999, false, null)
call prepC2I()
endfunction
endlibrary