// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals // integer PLAYER_NEUTRAL_PASSIVE=0 // integer PLAYER_NEUTRAL_AGGRESSIVE=0 // alliancetype ALLIANCE_PASSIVE=null // racepreference RACE_PREF_HUMAN=null // mapcontrol MAP_CONTROL_USER=null // mapcontrol MAP_CONTROL_RESCUABLE=null // gametype GAME_TYPE_MELEE=null // gametype GAME_TYPE_FFA=null // gametype GAME_TYPE_USE_MAP_SETTINGS=null // gametype GAME_TYPE_ONE_ON_ONE=null // gametype GAME_TYPE_TWO_TEAM_PLAY=null // gametype GAME_TYPE_THREE_TEAM_PLAY=null // gametype GAME_TYPE_FOUR_TEAM_PLAY=null // placement MAP_PLACEMENT_USE_MAP_SETTINGS=null // playerslotstate PLAYER_SLOT_STATE_PLAYING=null // fgamestate GAME_STATE_TIME_OF_DAY=null // playerstate PLAYER_STATE_GIVES_BOUNTY=null // unitstate UNIT_STATE_LIFE=null // playerunitevent EVENT_PLAYER_UNIT_RESCUED=null // playerunitevent EVENT_PLAYER_UNIT_SELL_ITEM=null // limitop LESS_THAN=null // limitop EQUAL=null // limitop GREATER_THAN_OR_EQUAL=null // unittype UNIT_TYPE_HERO=null // unittype UNIT_TYPE_STRUCTURE=null // itemtype ITEM_TYPE_PERMANENT=null // itemtype ITEM_TYPE_CHARGED=null // itemtype ITEM_TYPE_ARTIFACT=null // integer CAMERA_MARGIN_LEFT=0 // integer CAMERA_MARGIN_RIGHT=0 // integer CAMERA_MARGIN_TOP=0 // integer CAMERA_MARGIN_BOTTOM=0 // originframetype ORIGIN_FRAME_GAME_UI=null // real bj_GAME_STARTED_THRESHOLD=0. // integer bj_MAX_PLAYERS=0 // integer bj_PLAYER_NEUTRAL_VICTIM=0 // integer bj_MAX_PLAYER_SLOTS=0 // integer bj_MAX_SKELETONS=0 // integer bj_MAX_STOCK_ITEM_SLOTS=0 // integer bj_MAX_STOCK_UNIT_SLOTS=0 // integer bj_MAX_ITEM_LEVEL=0 // real bj_TOD_DAWN=0. // real bj_TOD_DUSK=0. // real bj_STOCK_RESTOCK_INITIAL_DELAY=0. // real bj_STOCK_RESTOCK_INTERVAL=0. // integer bj_STOCK_MAX_ITERATIONS=0 // real bj_RESCUE_PING_TIME=0. // integer bj_MAX_QUEUED_TRIGGERS=0 // real bj_QUEUED_TRIGGER_TIMEOUT=0. // real bj_CORPSE_MAX_DEATH_TIME=0. // force bj_FORCE_ALL_PLAYERS=null // boolean bj_slotControlReady=false // timer bj_gameStartedTimer=null // trigger bj_dncSoundsDay=null // trigger bj_dncSoundsNight=null // sound bj_dayAmbientSound=null // sound bj_nightAmbientSound=null // trigger bj_dncSoundsDawn=null // trigger bj_dncSoundsDusk=null // sound bj_dawnSound=null // sound bj_duskSound=null // boolean bj_useDawnDuskSounds=false // boolean bj_dncIsDaytime=false // sound bj_rescueSound=null // trigger bj_stockItemPurchased=null // timer bj_stockUpdateTimer=null // integer bj_stockPickedItemLevel=0 // itemtype bj_stockPickedItemType=null // trigger bj_rescueUnitBehavior=null // boolean bj_rescueChangeColorUnit=false // boolean bj_rescueChangeColorBldg=false // integer bj_queuedExecTotal=0 // timer bj_queuedExecTimeoutTimer=null // trigger bj_queuedExecTimeout=null // integer bj_groupEnumTypeId=0 // player bj_groupEnumOwningPlayer=null // location bj_enumDestructableCenter=null // real bj_enumDestructableRadius=0. // group bj_suspendDecayFleshGroup=null // group bj_suspendDecayBoneGroup=null // timer bj_delayedSuspendDecayTimer=null // trigger bj_delayedSuspendDecayTrig=null // integer bj_livingPlayerUnitsTypeId=0 trigger gg_trg_test=null string array Colors_hexs integer Colors_decs=0 hashtable ErrorHandling_HT=null framehandle Framehandle_GAME_UI=null real GameTimer_currentTime=0. boolean MagicFunctions_compiletime=false player Player_localPlayer=null hashtable Table_ht=null integer TypeCasting_typecastdata=0 hashtable hashtable_compiletime=null hashtable hashtable_compiletime_105=null integer array Table_nextFree integer Table_firstFree=0 integer Table_maxIndex=0 integer array Table_typeId code ref_function_init_AbilityIds=null code ref_function_init_Real=null code ref_function_init_Integer=null code ref_function_init_Angle=null code ref_function_init_String=null code ref_function_init_Vectors=null code ref_function_init_Destructable=null code ref_function_init_Player=null code ref_function_init_Basics=null code ref_function_init_MagicFunctions=null code ref_function_init_Table=null code ref_function_init_Playercolor=null code ref_function_init_Maths=null code ref_function_init_Colors=null code ref_function_init_Printing=null code ref_function_init_GameTimer=null code ref_function_init_ErrorHandling=null code ref_function_init_HashList=null code ref_function_init_Matrices=null code ref_function_init_Quaternion=null code ref_function_init_Framehandle=null code ref_function_init_Group=null code ref_function_init_Lightning=null code ref_function_init_WeatherEffects=null code ref_function_init_TypeCasting=null code ref_function_init_EventHelper=null code ref_function_init_Test=null code ref_function_code__startPeriodic_GameTimer=null endglobals function Loglevel_getTag takes integer this returns string if this == 0 then return "|cffADADADtrace|r" elseif this == 1 then return "|cff2685DCdebug|r" elseif this == 2 then return "|cffFFCC00info|r" elseif this == 3 then return "|cffF47E3Ewarning|r" else return "|cffFB2700error|r" endif endfunction function compileError takes string msg returns nothing endfunction function error takes string msg returns nothing local integer hash local player showTo if MagicFunctions_compiletime then call compileError("ERROR: " + msg) else set hash = StringHash(msg) if HaveSavedInteger(ErrorHandling_HT, -1, hash) then if LoadInteger(ErrorHandling_HT, -1, hash) + 60 < GameTimer_currentTime then set msg = msg + "" set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + msg) endif call SaveInteger(ErrorHandling_HT, -1, hash, R2I(GameTimer_currentTime)) call SaveBoolean(ErrorHandling_HT, -1, hash, false) elseif HaveSavedBoolean(ErrorHandling_HT, -1, hash) then if not LoadBoolean(ErrorHandling_HT, -1, hash) then set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + "|cffFF3A29Excessive repeating errors are being omitted") endif call SaveBoolean(ErrorHandling_HT, -1, hash, true) endif else set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + "|cffFF3A29Excessive repeating errors are being omitted") endif call SaveBoolean(ErrorHandling_HT, -1, hash, true) endif else call SaveInteger(ErrorHandling_HT, -1, hash, R2I(GameTimer_currentTime)) set msg = "Message: " + msg + "" set showTo = Player_localPlayer if 2 <= 4 then call DisplayTimedTextToPlayer(showTo, 0., 0., 45., Loglevel_getTag(4) + " - " + msg) endif endif call I2S(1 / 0) endif endfunction function initCompiletimeState_0 takes nothing returns nothing call InitHashtable() call InitHashtable() set hashtable_compiletime_105 = InitHashtable() set hashtable_compiletime = InitHashtable() call SaveInteger(hashtable_compiletime_105, 1, -242600650, 0) call SaveInteger(hashtable_compiletime_105, 1, 1132341824, 1) call SaveInteger(hashtable_compiletime_105, 1, -647782241, 2) call SaveInteger(hashtable_compiletime_105, 1, -854572045, 3) call SaveInteger(hashtable_compiletime_105, 1, -680649701, 4) call SaveInteger(hashtable_compiletime_105, 1, -943650483, 5) call SaveInteger(hashtable_compiletime_105, 1, -671760605, 6) call SaveInteger(hashtable_compiletime_105, 1, 349230650, 7) call SaveInteger(hashtable_compiletime_105, 1, -1894922563, 8) call SaveInteger(hashtable_compiletime_105, 1, -1474492777, 9) call SaveInteger(hashtable_compiletime_105, 1, -1587459251, 10) call SaveInteger(hashtable_compiletime_105, 1, -1676716706, 11) call SaveInteger(hashtable_compiletime_105, 1, -1559655710, 12) call SaveInteger(hashtable_compiletime_105, 1, -1663695754, 13) call SaveInteger(hashtable_compiletime_105, 1, 597637742, 14) call SaveInteger(hashtable_compiletime_105, 1, 789744696, 15) call SaveStr(hashtable_compiletime_105, 2, 0, "") endfunction function code__startPeriodic_GameTimer takes nothing returns nothing set GameTimer_currentTime = GameTimer_currentTime + 0.030 endfunction function init_AbilityIds takes nothing returns boolean return true endfunction function init_Angle takes nothing returns boolean return true endfunction function init_Basics takes nothing returns boolean return true endfunction function dispatch_Table_Table_Table_saveInt takes integer this, integer parentKey, integer value returns nothing if Table_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Table.saveInt") else call error("Called Table.saveInt on invalid object.") endif endif call SaveInteger(Table_ht, this, parentKey, value) endfunction function new_Table takes nothing returns integer local integer this if Table_firstFree == 0 then if Table_maxIndex < 32768 then set Table_maxIndex = Table_maxIndex + 1 set this = Table_maxIndex set Table_typeId[this] = 12 else call error("Out of memory: Could not create Table.") set this = 0 endif else set Table_firstFree = Table_firstFree - 1 set this = Table_nextFree[Table_firstFree] set Table_typeId[this] = 12 endif return this endfunction function init_Colors takes nothing returns boolean local integer firstpart set Colors_hexs[0] = "0" set Colors_hexs[1] = "1" set Colors_hexs[2] = "2" set Colors_hexs[3] = "3" set Colors_hexs[4] = "4" set Colors_hexs[5] = "5" set Colors_hexs[6] = "6" set Colors_hexs[7] = "7" set Colors_hexs[8] = "8" set Colors_hexs[9] = "9" set Colors_hexs[10] = "A" set Colors_hexs[11] = "B" set Colors_hexs[12] = "C" set Colors_hexs[13] = "D" set Colors_hexs[14] = "E" set Colors_hexs[15] = "F" set Colors_decs = new_Table() set firstpart = 0 loop exitwhen firstpart > 15 call dispatch_Table_Table_Table_saveInt(Colors_decs, StringHash(Colors_hexs[firstpart]), firstpart) set firstpart = firstpart + 1 endloop return true endfunction function init_Destructable takes nothing returns boolean return true endfunction function init_ErrorHandling takes nothing returns boolean set ErrorHandling_HT = hashtable_compiletime return true endfunction function new_HashMap takes nothing returns integer local integer this if Table_firstFree == 0 then if Table_maxIndex < 32768 then set Table_maxIndex = Table_maxIndex + 1 set this = Table_maxIndex set Table_typeId[this] = 13 else call error("Out of memory: Could not create HashMap.") set this = 0 endif else set Table_firstFree = Table_firstFree - 1 set this = Table_nextFree[Table_firstFree] set Table_typeId[this] = 13 endif return this endfunction function init_EventHelper takes nothing returns boolean call new_HashMap() call new_HashMap() call new_Table() return true endfunction function verifyFrameNameLength takes string name returns boolean if StringLength(name) > 560 then call error("Trying to address frame with exceeding maximum frame name length (" + I2S(560) + ") for: " + name) return false endif return true endfunction function init_Framehandle takes nothing returns boolean local framehandle owner set Framehandle_GAME_UI = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) set owner = Framehandle_GAME_UI call verifyFrameNameLength("SetMousePositionCage") set owner = BlzCreateFrameByType("FRAME", "SetMousePositionCage", owner, null, 0) call BlzFrameSetSize(owner, 0.0001, 0.0001) return true endfunction function init_GameTimer takes nothing returns boolean call TimerStart(CreateTimer(), 100000., false, null) call TimerStart(CreateTimer(), 0.030, true, ref_function_code__startPeriodic_GameTimer) return true endfunction function init_Group takes nothing returns boolean call CreateGroup() return true endfunction function init_HashList takes nothing returns boolean return true endfunction function init_Integer takes nothing returns boolean return true endfunction function init_Lightning takes nothing returns boolean return true endfunction function init_MagicFunctions takes nothing returns boolean set MagicFunctions_compiletime = false return true endfunction function init_Maths takes nothing returns boolean return true endfunction function init_Matrices takes nothing returns boolean return true endfunction function init_Player takes nothing returns boolean local integer i local integer temp set Player_localPlayer = GetLocalPlayer() set i = 0 set temp = bj_MAX_PLAYER_SLOTS - 1 loop exitwhen i > temp set i = i + 1 endloop return true endfunction function init_Playercolor takes nothing returns boolean return true endfunction function init_Printing takes nothing returns boolean return true endfunction function init_Quaternion takes nothing returns boolean return true endfunction function init_Real takes nothing returns boolean return true endfunction function init_String takes nothing returns boolean return true endfunction function init_Table takes nothing returns boolean set Table_ht = hashtable_compiletime_105 return true endfunction function init_Test takes nothing returns boolean local string msg = "Hello World." local integer i = 0 loop call DisplayTimedTextToPlayer(Player(i), 0., 0., 60., msg) set i = i + 1 exitwhen i == bj_MAX_PLAYERS endloop return true endfunction function init_TypeCasting takes nothing returns boolean local integer this set TypeCasting_typecastdata = new_Table() set this = TypeCasting_typecastdata if Table_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Table.saveString") else call error("Called Table.saveString on invalid object.") endif endif call SaveStr(Table_ht, this, 0, "") return true endfunction function init_Vectors takes nothing returns boolean call Location(0., 0.) return true endfunction function init_WeatherEffects takes nothing returns boolean return true endfunction function initGlobals takes nothing returns nothing set gg_trg_test = null set ref_function_init_AbilityIds = function init_AbilityIds set ref_function_init_Real = function init_Real set ref_function_init_Integer = function init_Integer set ref_function_init_Angle = function init_Angle set ref_function_init_String = function init_String set ref_function_init_Vectors = function init_Vectors set ref_function_init_Destructable = function init_Destructable set ref_function_init_Player = function init_Player set ref_function_init_Basics = function init_Basics set ref_function_init_MagicFunctions = function init_MagicFunctions set ref_function_init_Table = function init_Table set ref_function_init_Playercolor = function init_Playercolor set ref_function_init_Maths = function init_Maths set ref_function_init_Colors = function init_Colors set ref_function_init_Printing = function init_Printing set ref_function_init_GameTimer = function init_GameTimer set ref_function_init_ErrorHandling = function init_ErrorHandling set ref_function_init_HashList = function init_HashList set ref_function_init_Matrices = function init_Matrices set ref_function_init_Quaternion = function init_Quaternion set ref_function_init_Framehandle = function init_Framehandle set ref_function_init_Group = function init_Group set ref_function_init_Lightning = function init_Lightning set ref_function_init_WeatherEffects = function init_WeatherEffects set ref_function_init_TypeCasting = function init_TypeCasting set ref_function_init_EventHelper = function init_EventHelper set ref_function_init_Test = function init_Test set ref_function_code__startPeriodic_GameTimer = function code__startPeriodic_GameTimer endfunction function main takes nothing returns nothing local trigger trig call initGlobals() call ExecuteFunc("initCompiletimeState_0") call SetCameraBounds(( - 7424.0) + GetCameraMargin(CAMERA_MARGIN_LEFT), ( - 7680.0) + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 7424.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), ( - 7424.0) + GetCameraMargin(CAMERA_MARGIN_LEFT), 7168.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 7424.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), ( - 7680.0) + GetCameraMargin(CAMERA_MARGIN_BOTTOM)) call SetDayNightModels("Environment\\DNC\\DNCDalaran\\DNCDalaranTerrain\\DNCDalaranTerrain.mdl", "Environment\\DNC\\DNCDalaran\\DNCDalaranUnit\\DNCDalaranUnit.mdl") call NewSoundEnvironment("Default") call SetAmbientDaySound("DalaranRuinsDay") call SetAmbientNightSound("DalaranRuinsNight") call SetMapMusic("Music", true, 0) call CreateUnit(Player(0), 1214409837, - 380.0, 1558.8, 42.628) call InitBlizzard() set trig = gg_trg_test if TriggerEvaluate(trig) then call TriggerExecute(trig) endif set trig = CreateTrigger() call TriggerAddCondition(trig, Condition(ref_function_init_AbilityIds)) if not TriggerEvaluate(trig) then call error("Could not initialize package AbilityIds.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Real)) if not TriggerEvaluate(trig) then call error("Could not initialize package Real.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Integer)) if not TriggerEvaluate(trig) then call error("Could not initialize package Integer.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Angle)) if not TriggerEvaluate(trig) then call error("Could not initialize package Angle.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_String)) if not TriggerEvaluate(trig) then call error("Could not initialize package String.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Vectors)) if not TriggerEvaluate(trig) then call error("Could not initialize package Vectors.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Destructable)) if not TriggerEvaluate(trig) then call error("Could not initialize package Destructable.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Player)) if not TriggerEvaluate(trig) then call error("Could not initialize package Player.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Basics)) if not TriggerEvaluate(trig) then call error("Could not initialize package Basics.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_MagicFunctions)) if not TriggerEvaluate(trig) then call error("Could not initialize package MagicFunctions.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Table)) if not TriggerEvaluate(trig) then call error("Could not initialize package Table.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Playercolor)) if not TriggerEvaluate(trig) then call error("Could not initialize package Playercolor.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Maths)) if not TriggerEvaluate(trig) then call error("Could not initialize package Maths.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Colors)) if not TriggerEvaluate(trig) then call error("Could not initialize package Colors.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Printing)) if not TriggerEvaluate(trig) then call error("Could not initialize package Printing.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_GameTimer)) if not TriggerEvaluate(trig) then call error("Could not initialize package GameTimer.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_ErrorHandling)) if not TriggerEvaluate(trig) then call error("Could not initialize package ErrorHandling.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_HashList)) if not TriggerEvaluate(trig) then call error("Could not initialize package HashList.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Matrices)) if not TriggerEvaluate(trig) then call error("Could not initialize package Matrices.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Quaternion)) if not TriggerEvaluate(trig) then call error("Could not initialize package Quaternion.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Framehandle)) if not TriggerEvaluate(trig) then call error("Could not initialize package Framehandle.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Group)) if not TriggerEvaluate(trig) then call error("Could not initialize package Group.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Lightning)) if not TriggerEvaluate(trig) then call error("Could not initialize package Lightning.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_WeatherEffects)) if not TriggerEvaluate(trig) then call error("Could not initialize package WeatherEffects.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_TypeCasting)) if not TriggerEvaluate(trig) then call error("Could not initialize package TypeCasting.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_EventHelper)) if not TriggerEvaluate(trig) then call error("Could not initialize package EventHelper.") endif call TriggerClearConditions(trig) call TriggerAddCondition(trig, Condition(ref_function_init_Test)) if not TriggerEvaluate(trig) then call error("Could not initialize package Test.") endif call TriggerClearConditions(trig) call DestroyTrigger(trig) endfunction function InitCustomPlayerSlots takes nothing returns nothing call SetPlayerStartLocation(Player(0), 0) call SetPlayerColor(Player(0), ConvertPlayerColor(0)) call SetPlayerRacePreference(Player(0), RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(0), true) call SetPlayerController(Player(0), MAP_CONTROL_USER) endfunction function config takes nothing returns nothing local integer playerIndex local integer index call SetMapName("Just another Warcraft III map") call SetMapDescription("Nondescript") call SetPlayers(1) call SetTeams(1) call SetGamePlacement(MAP_PLACEMENT_USE_MAP_SETTINGS) call DefineStartLocation(0, - 384.0, 1600.0) call InitCustomPlayerSlots() set playerIndex = GetPlayerId(Player(0)) if not bj_slotControlReady then set index = 0 loop set bj_slotControlUsed[index] = false set index = index + 1 exitwhen index == bj_MAX_PLAYERS endloop set bj_slotControlReady = true endif set bj_slotControlUsed[playerIndex] = true call InitGenericPlayerSlots() endfunction